diff --git a/hifi-src/src/components/PublicLayout.jsx b/hifi-src/src/components/PublicLayout.jsx index 96d0617..03e5acf 100644 --- a/hifi-src/src/components/PublicLayout.jsx +++ b/hifi-src/src/components/PublicLayout.jsx @@ -46,6 +46,7 @@ const DEFAULT_SITE_SETTINGS = { package_wheel_hint_interval: 8, gallery_card_text_x: 0, gallery_card_text_y: 100, + site_font: null, }; // Das Impressum (und die anderen rechtlichen Pflichtseiten) müssen laut § 5 DDG @@ -65,6 +66,17 @@ export default function PublicLayout() { api.get('/site-settings').then(setSiteSettings).catch(() => {}); }, []); + // Globale Schriftart als CSS-Variable auf - tailwind.config.js definiert font-sans + // als var(--site-font, ...Systemschrift...), dadurch greift die Auswahl automatisch auf + // praktisch jeden Text der Seite, ohne einzelne Komponenten anzufassen. + useEffect(() => { + if (siteSettings.site_font) { + document.documentElement.style.setProperty('--site-font', siteSettings.site_font); + } else { + document.documentElement.style.removeProperty('--site-font'); + } + }, [siteSettings.site_font]); + if (status === null || authLoading) { return
; } diff --git a/hifi-src/src/components/Reveal.jsx b/hifi-src/src/components/Reveal.jsx index c97c467..db93923 100644 --- a/hifi-src/src/components/Reveal.jsx +++ b/hifi-src/src/components/Reveal.jsx @@ -24,13 +24,13 @@ const shineVariants = { // Trigger-based reveal: each element fades/slides/un-blurs into place the // first time it enters the viewport, then stays put. Calm and predictable // on repeated scrolling in either direction (no re-triggering, no jitter). -export default function Reveal({ children, direction = 'up', className = '', index = 0, shine = false }) { +export default function Reveal({ children, direction = 'up', className = '', index = 0, shine = false, style }) { const delay = Math.min(index * 0.09, 0.45); return (
+
+ + +
{active.updated_at && ( diff --git a/hifi-src/src/pages/admin/settings/WebsiteSettings.jsx b/hifi-src/src/pages/admin/settings/WebsiteSettings.jsx index 8b79bd8..0a06dac 100644 --- a/hifi-src/src/pages/admin/settings/WebsiteSettings.jsx +++ b/hifi-src/src/pages/admin/settings/WebsiteSettings.jsx @@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from 'react'; import { api } from '../../../api/client.js'; import ImageUploadField from '../../../components/ImageUploadField.jsx'; import { dragAnchorStyle } from '../../../utils/dragAnchorPosition.js'; +import { FONT_OPTIONS } from '../../../utils/fontOptions.js'; const DAYS = [ { key: 'mon', label: 'Montag' }, @@ -34,6 +35,7 @@ const emptyForm = { package_wheel_hint_interval: 8, gallery_card_text_x: 0, gallery_card_text_y: 100, + site_font: '', }; const PACKAGE_CARD_THEMES = [ @@ -127,6 +129,7 @@ export default function WebsiteSettings() { package_wheel_hint_interval: res.package_wheel_hint_interval || 8, gallery_card_text_x: res.gallery_card_text_x ?? 0, gallery_card_text_y: res.gallery_card_text_y ?? 100, + site_font: res.site_font || '', }) ) .finally(() => setLoading(false)); @@ -269,6 +272,23 @@ export default function WebsiteSettings() { +
+

Schriftart

+

+ Gilt für die gesamte Website. Einzelne Startseiten-Sektionen können unter „Startseite“ + davon abweichen. +

+ +
+

Kontaktdaten

diff --git a/hifi-src/src/pages/public/Home.jsx b/hifi-src/src/pages/public/Home.jsx index 51b24cb..8e881ef 100644 --- a/hifi-src/src/pages/public/Home.jsx +++ b/hifi-src/src/pages/public/Home.jsx @@ -30,7 +30,7 @@ const ALIGN_MARGIN_X = { left: '', center: 'mx-auto', right: 'ml-auto' }; const EMPTY_SECTION = { eyebrow_de: '', eyebrow_en: '', title_de: '', title_en: '', body_html_de: '', body_html_en: '', text_align: 'center', text_align_x: 50, text_align_y: 50, - button_label_de: '', button_label_en: '', button_url: '', + button_label_de: '', button_label_en: '', button_url: '', font_family: null, }; /** Rendert nur, wenn sowohl Beschriftung als auch Ziel gesetzt sind - interne Ziele (mit "/") @@ -88,6 +88,7 @@ export default function Home() { alignY: s.text_align_y, buttonLabel: s[`button_label_${language}`] || '', buttonUrl: s.button_url || '', + fontFamily: s.font_family || undefined, }; }; @@ -209,7 +210,10 @@ export default function Home() { sollen sich nicht mit dieser statischen, per Drag gesetzten Position ueberschneiden). */}

{section('youtube').eyebrow && ( @@ -329,7 +336,7 @@ export default function Home() { style={{ maxHeight: 380 }} /> - + {section('craft').eyebrow && (

{section('craft').eyebrow}

)} @@ -342,7 +349,7 @@ export default function Home() {
- + {section('advice').eyebrow && (

{section('advice').eyebrow}

)} @@ -367,7 +374,7 @@ export default function Home() {
- + {section('insights').eyebrow && (

{section('insights').eyebrow}

)} @@ -434,6 +441,7 @@ export default function Home() { direction="right" index={1} className={`rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 ${ALIGN_TEXT[section('more').align]}`} + style={{ fontFamily: section('more').fontFamily }} > {section('more').eyebrow && (

{section('more').eyebrow}

diff --git a/hifi-src/src/utils/fontOptions.js b/hifi-src/src/utils/fontOptions.js new file mode 100644 index 0000000..07bf2c0 --- /dev/null +++ b/hifi-src/src/utils/fontOptions.js @@ -0,0 +1,13 @@ +// Bewusst klassische, auf jedem Geraet vorinstallierte Schriftarten statt eigens gehosteter +// Web-Fonts: fuer E-Mail-Vorlagen laden Mail-Clients @font-face-Schriften oft gar nicht und +// fallen dann unvorhersehbar zurueck; fuer die Website selbst spart es zusaetzliche +// Ladevorgaenge. Von RichTextEditor (Mail-Vorlagen/Rechtstexte) und den Schriftart-Auswahlen +// fuer die Website (global + pro Startseiten-Sektion) gemeinsam genutzt. +export const FONT_OPTIONS = [ + { label: 'Systemschrift', value: '' }, + { label: 'Serifenlos (Arial)', value: 'Arial, Helvetica, sans-serif' }, + { label: 'Serif (Georgia)', value: 'Georgia, "Times New Roman", serif' }, + { label: 'Klassisch (Times New Roman)', value: '"Times New Roman", Times, serif' }, + { label: 'Modern (Verdana)', value: 'Verdana, Geneva, sans-serif' }, + { label: 'Schreibmaschine (Courier New)', value: '"Courier New", Courier, monospace' }, +]; diff --git a/hifi-src/tailwind.config.js b/hifi-src/tailwind.config.js index c8922ba..873fd0f 100644 --- a/hifi-src/tailwind.config.js +++ b/hifi-src/tailwind.config.js @@ -4,6 +4,13 @@ export default { content: ['./index.html', './src/**/*.{js,jsx}'], theme: { extend: { + // Greift die globale Website-Schriftart auf (siehe app_settings.site_font, gesetzt von + // SiteSettingsContext.jsx als CSS-Variable auf ) - ohne eigene Auswahl faellt es auf + // Tailwinds Standard-Systemschriftstapel zurueck. Tailwinds Preflight wendet font-sans + // bereits global auf an, dadurch greift die Variable praktisch ueberall. + fontFamily: { + sans: 'var(--site-font, ui-sans-serif, system-ui, sans-serif)', + }, colors: { brand: { 50: '#f5fbee', diff --git a/hifi/api/database/migration_font.sql b/hifi/api/database/migration_font.sql new file mode 100644 index 0000000..bf700b9 --- /dev/null +++ b/hifi/api/database/migration_font.sql @@ -0,0 +1,13 @@ +USE hifi_shop; + +-- Schriftart-Auswahl: eine globale Standardschrift fuer die ganze Website (app_settings) plus +-- ein optionaler Override pro Startseiten-Sektion (home_sections), der die globale Schrift +-- ueberschreibt, wenn gesetzt. Additiv, nichts wird geloescht. +-- Hinweis: Auf der Live-Seite reicht stattdessen ein Klick auf "Datenbankstruktur aktualisieren" +-- unter Admin-Panel -> Einstellungen -> Datenbank. + +ALTER TABLE app_settings + ADD COLUMN IF NOT EXISTS site_font VARCHAR(255) NULL AFTER gallery_card_text_y; + +ALTER TABLE home_sections + ADD COLUMN IF NOT EXISTS font_family VARCHAR(255) NULL AFTER button_url; diff --git a/hifi/api/database/schema.sql b/hifi/api/database/schema.sql index 578cbb7..61189e3 100644 --- a/hifi/api/database/schema.sql +++ b/hifi/api/database/schema.sql @@ -38,6 +38,7 @@ CREATE TABLE app_settings ( package_wheel_hint_interval INT NOT NULL DEFAULT 8, gallery_card_text_x TINYINT UNSIGNED NOT NULL DEFAULT 0, gallery_card_text_y TINYINT UNSIGNED NOT NULL DEFAULT 100, + site_font VARCHAR(255) NULL, mail_host VARCHAR(255) NULL, mail_port INT NULL, mail_username VARCHAR(255) NULL, @@ -76,6 +77,7 @@ CREATE TABLE home_sections ( button_label_de VARCHAR(100) NULL, button_label_en VARCHAR(100) NULL, button_url VARCHAR(500) NULL, + font_family VARCHAR(255) NULL, updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB; diff --git a/hifi/api/src/Controllers/HomeSectionController.php b/hifi/api/src/Controllers/HomeSectionController.php index e056db7..0263dbe 100644 --- a/hifi/api/src/Controllers/HomeSectionController.php +++ b/hifi/api/src/Controllers/HomeSectionController.php @@ -3,6 +3,7 @@ namespace App\Controllers; use App\Config\Database; +use App\Support\Fonts; use App\Support\Http; /** @@ -27,6 +28,7 @@ class HomeSectionController 'text_align' => 'center', 'text_align_x' => 50, 'text_align_y' => 50, 'button_label_de' => null, 'button_label_en' => null, 'button_url' => null, + 'font_family' => null, ], 'youtube' => [ 'eyebrow_de' => 'HifiPlanet präsentiert', 'eyebrow_en' => 'HifiPlanet presents', @@ -37,6 +39,7 @@ class HomeSectionController 'text_align_x' => 50, 'text_align_y' => 50, 'button_label_de' => 'Jetzt ansehen', 'button_label_en' => 'Watch now', 'button_url' => 'https://www.youtube.com/watch?v=ostj2mKDVUc', + 'font_family' => null, ], 'craft' => [ 'eyebrow_de' => 'Handwerk', 'eyebrow_en' => 'Craftsmanship', @@ -46,6 +49,7 @@ class HomeSectionController 'text_align' => 'left', 'text_align_x' => 50, 'text_align_y' => 50, 'button_label_de' => null, 'button_label_en' => null, 'button_url' => null, + 'font_family' => null, ], 'advice' => [ 'eyebrow_de' => 'Beratung', 'eyebrow_en' => 'Consultation', @@ -55,6 +59,7 @@ class HomeSectionController 'text_align' => 'left', 'text_align_x' => 50, 'text_align_y' => 50, 'button_label_de' => null, 'button_label_en' => null, 'button_url' => null, + 'font_family' => null, ], 'insights' => [ 'eyebrow_de' => null, 'eyebrow_en' => null, @@ -64,6 +69,7 @@ class HomeSectionController 'text_align' => 'center', 'text_align_x' => 50, 'text_align_y' => 50, 'button_label_de' => null, 'button_label_en' => null, 'button_url' => null, + 'font_family' => null, ], 'more' => [ 'eyebrow_de' => null, 'eyebrow_en' => null, @@ -74,12 +80,14 @@ class HomeSectionController 'text_align_x' => 50, 'text_align_y' => 50, 'button_label_de' => 'Alle Leistungen entdecken', 'button_label_en' => 'Discover all our services', 'button_url' => '/leistungen', + 'font_family' => null, ], ]; private const COLUMNS = [ 'eyebrow_de', 'eyebrow_en', 'title_de', 'title_en', 'body_html_de', 'body_html_en', 'text_align', 'text_align_x', 'text_align_y', 'button_label_de', 'button_label_en', 'button_url', + 'font_family', ]; /** Oeffentlich + Admin: alle Abschnitte auf einmal (DB-Stand oder Standardtext). */ @@ -114,6 +122,13 @@ class HomeSectionController $alignX = max(0, min(100, (int) ($body['text_align_x'] ?? 50))); $alignY = max(0, min(100, (int) ($body['text_align_y'] ?? 50))); + // Schriftart-Override dieser Sektion - leer/ungueltig = "Standard" (faellt in Home.jsx + // auf die globale Website-Schriftart zurueck, siehe app_settings.site_font). + $fontFamily = (string) ($body['font_family'] ?? ''); + if (!in_array($fontFamily, Fonts::VALUES, true)) { + $fontFamily = ''; + } + $values = [ 'eyebrow_de' => trim($body['eyebrow_de'] ?? '') ?: null, 'eyebrow_en' => trim($body['eyebrow_en'] ?? '') ?: null, @@ -127,6 +142,7 @@ class HomeSectionController 'button_label_de' => trim($body['button_label_de'] ?? '') ?: null, 'button_label_en' => trim($body['button_label_en'] ?? '') ?: null, 'button_url' => trim($body['button_url'] ?? '') ?: null, + 'font_family' => $fontFamily ?: null, ]; $db = Database::connection(); diff --git a/hifi/api/src/Controllers/SettingsController.php b/hifi/api/src/Controllers/SettingsController.php index 308c661..6663782 100644 --- a/hifi/api/src/Controllers/SettingsController.php +++ b/hifi/api/src/Controllers/SettingsController.php @@ -42,7 +42,7 @@ class SettingsController 'hero_image_path', 'ga_measurement_id', 'ga_property_id', 'google_place_id', 'package_card_theme', 'package_card_layout', 'package_wheel_hint_interval', - 'gallery_card_text_x', 'gallery_card_text_y', + 'gallery_card_text_x', 'gallery_card_text_y', 'site_font', 'mail_host', 'mail_port', 'mail_username', 'mail_encryption', 'mail_from_email', 'mail_from_name', 'mail_notify_email', 'mail_customer_subject', 'mail_customer_body', 'mail_owner_subject', 'mail_owner_body', @@ -53,7 +53,7 @@ class SettingsController 'home_sections' => [ 'id', 'slug', 'eyebrow_de', 'eyebrow_en', 'title_de', 'title_en', 'body_html_de', 'body_html_en', 'text_align', 'text_align_x', 'text_align_y', - 'button_label_de', 'button_label_en', 'button_url', 'updated_at', + 'button_label_de', 'button_label_en', 'button_url', 'font_family', 'updated_at', ], ]; diff --git a/hifi/api/src/Controllers/SiteSettingsController.php b/hifi/api/src/Controllers/SiteSettingsController.php index 352752a..9757080 100644 --- a/hifi/api/src/Controllers/SiteSettingsController.php +++ b/hifi/api/src/Controllers/SiteSettingsController.php @@ -3,6 +3,7 @@ namespace App\Controllers; use App\Config\Database; +use App\Support\Fonts; use App\Support\Http; use App\Support\Uploads; @@ -27,6 +28,7 @@ class SiteSettingsController 'package_wheel_hint_interval' => 8, 'gallery_card_text_x' => 0, 'gallery_card_text_y' => 100, + 'site_font' => null, ]; // Entspricht dem, was zuvor hart in Footer.jsx (isOpenNow() + die drei separaten @@ -44,7 +46,7 @@ class SiteSettingsController private const APP_SETTINGS_COLUMNS = 'phone, whatsapp, contact_email, address_street, address_zip, address_city, logo_path, logo_dark_path, business_hours, hero_image_path, ga_measurement_id, package_card_theme, package_card_layout, package_wheel_hint_interval, - gallery_card_text_x, gallery_card_text_y'; + gallery_card_text_x, gallery_card_text_y, site_font'; public static function show(): void { @@ -99,6 +101,13 @@ class SiteSettingsController $galleryCardTextX = max(0, min(100, (int) ($body['gallery_card_text_x'] ?? 0))); $galleryCardTextY = max(0, min(100, (int) ($body['gallery_card_text_y'] ?? 100))); + // Globale Standard-Schriftart der Website - faellt auf Systemschrift (leerer String) + // zurueck, wenn ein unbekannter Wert ankommt, statt ihn ungeprueft zu speichern. + $siteFont = (string) ($body['site_font'] ?? ''); + if (!in_array($siteFont, Fonts::VALUES, true)) { + $siteFont = ''; + } + $newHeroImagePath = trim($body['hero_image_path'] ?? '') ?: null; $newLogoPath = trim($body['logo_path'] ?? '') ?: null; $newLogoDarkPath = trim($body['logo_dark_path'] ?? '') ?: null; @@ -128,7 +137,7 @@ class SiteSettingsController 'UPDATE app_settings SET phone = ?, whatsapp = ?, contact_email = ?, address_street = ?, address_zip = ?, address_city = ?, logo_path = ?, logo_dark_path = ?, business_hours = ?, hero_image_path = ?, ga_measurement_id = ?, package_card_theme = ?, package_card_layout = ?, package_wheel_hint_interval = ?, - gallery_card_text_x = ?, gallery_card_text_y = ? + gallery_card_text_x = ?, gallery_card_text_y = ?, site_font = ? WHERE id = 1' ); $stmt->execute([ @@ -148,6 +157,7 @@ class SiteSettingsController $wheelHintInterval, $galleryCardTextX, $galleryCardTextY, + $siteFont ?: null, ]); Uploads::deleteIfOrphaned($old['hero_image_path'] ?? null, $newHeroImagePath); diff --git a/hifi/api/src/Support/Fonts.php b/hifi/api/src/Support/Fonts.php new file mode 100644 index 0000000..ef7910c --- /dev/null +++ b/hifi/api/src/Support/Fonts.php @@ -0,0 +1,17 @@ + 'INT NOT NULL DEFAULT 8', 'gallery_card_text_x' => 'TINYINT UNSIGNED NOT NULL DEFAULT 0', 'gallery_card_text_y' => 'TINYINT UNSIGNED NOT NULL DEFAULT 100', + 'site_font' => 'VARCHAR(255) NULL', 'mail_host' => 'VARCHAR(255) NULL', 'mail_port' => 'INT NULL', 'mail_username' => 'VARCHAR(255) NULL', @@ -395,6 +398,7 @@ class Schema 'button_label_de' => 'VARCHAR(100) NULL', 'button_label_en' => 'VARCHAR(100) NULL', 'button_url' => 'VARCHAR(500) NULL', + 'font_family' => 'VARCHAR(255) NULL', 'updated_at' => 'DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', ], 'services' => [ diff --git a/hifi/assets/index-BhPW2e0c.css b/hifi/assets/index-BhPW2e0c.css deleted file mode 100644 index 4713084..0000000 --- a/hifi/assets/index-BhPW2e0c.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-5{bottom:-1.25rem}.-left-1\/3{left:-33.333333%}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-right-\[60px\]{right:-60px}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-3{top:-.75rem}.-top-\[60px\]{top:-60px}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3\.5{left:.875rem}.left-5{left:1.25rem}.left-6{left:1.5rem}.left-\[14px\]{left:14px}.right-0{right:0}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-8{top:2rem}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[200\]{z-index:200}.z-\[60\]{z-index:60}.order-1{order:1}.order-2{order:2}.col-span-full{grid-column:1 / -1}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.-mt-\[89px\]{margin-top:-89px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-7{margin-bottom:1.75rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-6{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-\[4\/3\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-\[17px\]{height:17px}.h-\[18px\]{height:18px}.h-\[190px\]{height:190px}.h-\[210px\]{height:210px}.h-\[22px\]{height:22px}.h-\[46px\]{height:46px}.h-dvh{height:100dvh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-64{max-height:16rem}.max-h-\[85vh\]{max-height:85vh}.min-h-\[10rem\]{min-height:10rem}.min-h-\[420px\]{min-height:420px}.min-h-\[560px\]{min-height:560px}.min-h-\[70vh\]{min-height:70vh}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[17px\]{width:17px}.w-\[18px\]{width:18px}.w-\[190px\]{width:190px}.w-\[22px\]{width:22px}.w-\[230px\]{width:230px}.w-\[46px\]{width:46px}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-\[190px\]{min-width:190px}.min-w-\[220px\]{min-width:220px}.min-w-\[240px\]{min-width:240px}.min-w-\[9rem\]{min-width:9rem}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-6xl{max-width:72rem}.max-w-\[1280px\]{max-width:1280px}.max-w-\[160px\]{max-width:160px}.max-w-\[1880px\]{max-width:1880px}.max-w-\[240px\]{max-width:240px}.max-w-\[520px\]{max-width:520px}.max-w-\[85\%\]{max-width:85%}.max-w-\[8rem\]{max-width:8rem}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-\[190px\]{flex-basis:190px}.origin-left{transform-origin:left}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-12{--tw-rotate: 12deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y: pan-y;touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-start{scroll-snap-align:start}.snap-center{scroll-snap-align:center}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[18px\]{gap:18px}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.gap-y-3{row-gap:.75rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-neutral-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(245 245 245 / var(--tw-divide-opacity, 1))}.divide-neutral-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 229 229 / var(--tw-divide-opacity, 1))}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[18px\]{border-radius:18px}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-width:1px}.border-0{border-width:0px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-brand-300{--tw-border-opacity: 1;border-color:rgb(182 227 130 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.border-neutral-100{--tw-border-opacity: 1;border-color:rgb(245 245 245 / var(--tw-border-opacity, 1))}.border-neutral-200{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-neutral-300{--tw-border-opacity: 1;border-color:rgb(212 212 212 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/10{border-color:#ffffff1a}.border-white\/30{border-color:#ffffff4d}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/55{background-color:#0000008c}.bg-black\/60{background-color:#0009}.bg-black\/70{background-color:#000000b3}.bg-black\/90{background-color:#000000e6}.bg-brand-100{--tw-bg-opacity: 1;background-color:rgb(233 246 218 / var(--tw-bg-opacity, 1))}.bg-brand-400{--tw-bg-opacity: 1;background-color:rgb(146 212 68 / var(--tw-bg-opacity, 1))}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(245 251 238 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.bg-brand-500\/60{background-color:#6ba62699}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-neutral-100{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}.bg-neutral-200{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.bg-neutral-300{--tw-bg-opacity: 1;background-color:rgb(212 212 212 / var(--tw-bg-opacity, 1))}.bg-neutral-400{--tw-bg-opacity: 1;background-color:rgb(163 163 163 / var(--tw-bg-opacity, 1))}.bg-neutral-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}.bg-neutral-800{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.bg-neutral-900\/10{background-color:#1717171a}.bg-neutral-900\/85{background-color:#171717d9}.bg-neutral-950{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-50\/40{background-color:#fef2f266}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/90{background-color:#ffffffe6}.bg-white\/95{background-color:#fffffff2}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-black\/70{--tw-gradient-from: rgb(0 0 0 / .7) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/85{--tw-gradient-from: rgb(0 0 0 / .85) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-neutral-700{--tw-gradient-from: #404040 var(--tw-gradient-from-position);--tw-gradient-to: rgb(64 64 64 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-neutral-950{--tw-gradient-from: #0a0a0a var(--tw-gradient-from-position);--tw-gradient-to: rgb(10 10 10 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-black\/10{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(0 0 0 / .1) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-black\/20{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(0 0 0 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-neutral-950\/80{--tw-gradient-to: rgb(10 10 10 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(10 10 10 / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/40{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .4) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-black\/40{--tw-gradient-to: rgb(0 0 0 / .4) var(--tw-gradient-to-position)}.to-neutral-900{--tw-gradient-to: #171717 var(--tw-gradient-to-position)}.to-neutral-950\/40{--tw-gradient-to: rgb(10 10 10 / .4) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[22px\]{padding:22px}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[22px\]{padding-left:22px;padding-right:22px}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[22px\]{padding-top:22px;padding-bottom:22px}.py-\[26px\]{padding-top:26px;padding-bottom:26px}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.pb-24{padding-bottom:6rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-5{padding-left:1.25rem}.pl-6{padding-left:1.5rem}.pl-\[42px\]{padding-left:42px}.pr-4{padding-right:1rem}.pr-8{padding-right:2rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-3{padding-top:.75rem}.pt-3\.5{padding-top:.875rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[17px\]{font-size:17px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-\[1\.08\]{line-height:1.08}.leading-\[1\.4\]{line-height:1.4}.leading-\[1\.55\]{line-height:1.55}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-\[2px\]{letter-spacing:2px}.tracking-\[3px\]{letter-spacing:3px}.tracking-\[6px\]{letter-spacing:6px}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-brand-300{--tw-text-opacity: 1;color:rgb(182 227 130 / var(--tw-text-opacity, 1))}.text-brand-400{--tw-text-opacity: 1;color:rgb(146 212 68 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(107 166 38 / var(--tw-text-opacity, 1))}.text-brand-500\/10{color:#6ba6261a}.text-brand-600{--tw-text-opacity: 1;color:rgb(88 137 31 / var(--tw-text-opacity, 1))}.text-brand-700{--tw-text-opacity: 1;color:rgb(72 112 26 / var(--tw-text-opacity, 1))}.text-brand-800{--tw-text-opacity: 1;color:rgb(59 91 21 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-neutral-200{--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity, 1))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.text-neutral-600{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.text-neutral-700{--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.text-neutral-800{--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.text-neutral-900{--tw-text-opacity: 1;color:rgb(23 23 23 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_-8px_24px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow: 0 -8px 24px rgba(0,0,0,.08);--tw-shadow-colored: 0 -8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(107\,166\,38\,0\.7\)\]{--tw-shadow: 0 0 10px rgba(107,166,38,.7);--tw-shadow-colored: 0 0 10px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-brand-500\/30{--tw-shadow-color: rgb(107 166 38 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-neutral-900\/20{--tw-shadow-color: rgb(23 23 23 / .2);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-brand-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(146 212 68 / var(--tw-ring-opacity, 1))}.ring-brand-500\/40{--tw-ring-color: rgb(107 166 38 / .4)}.ring-neutral-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(212 212 212 / var(--tw-ring-opacity, 1))}.ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity, 1))}.ring-white\/50{--tw-ring-color: rgb(255 255 255 / .5)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[filter\,box-shadow\]{transition-property:filter,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.will-change-transform{will-change:transform}.\[scrollbar-width\:none\]{scrollbar-width:none}html{scroll-behavior:smooth}.marquee-viewport{-webkit-mask-image:linear-gradient(to right,transparent,black 6%,black 94%,transparent);mask-image:linear-gradient(to right,transparent,black 6%,black 94%,transparent)}.page-texture{background-color:#f6f5f0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:180px 180px}.dark .page-texture{background-color:#0a0b07;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}.kf-page{--kf-pagebg: linear-gradient(120deg, #eef0ea 0%, #f6f8f3 45%, #fbfcf9 100%);--kf-card: #ffffff;--kf-cardbrd: #e4e8dc;--kf-text: #23271d;--kf-text2: #2a2e24;--kf-muted: #6c7360;--kf-label: #838a72;--kf-field: #fafcf6;--kf-fieldbrd: #dde2d3;--kf-fieldicon: #a7ad9d;--kf-accent: #a4d417;--kf-accent2: #8ec21a;--kf-accentsoft: #f2f8df;--kf-pill: #ffffff;--kf-pillbrd: #dfe4d6;--kf-shadow: 0 24px 60px rgba(60, 70, 40, .08);--kf-shadow2: 0 16px 40px rgba(60, 70, 40, .06);--kf-divider: #e8ecdf;--kf-topo: #d7dccd;--kf-pkgbg: #f4fbe4;--kf-pkgbrd: #cfe89a;--kf-btntext: #1f2417;--kf-scrim: linear-gradient(90deg, rgba(244, 246, 241, .35) 0%, rgba(244, 246, 241, .55) 55%, rgba(246, 248, 243, 1) 100%)}.dark .kf-page{--kf-pagebg: linear-gradient(120deg, #181b0f 0%, #111409 45%, #0a0c06 100%);--kf-card: #14170e;--kf-cardbrd: rgba(168, 225, 12, .16);--kf-text: #f3f6ea;--kf-text2: #e8ece0;--kf-muted: #9aa38c;--kf-label: #8f987f;--kf-field: rgba(0, 0, 0, .35);--kf-fieldbrd: #2c3323;--kf-fieldicon: #5f6852;--kf-accent: #a8e10c;--kf-accent2: #b6e619;--kf-accentsoft: rgba(168, 225, 12, .1);--kf-pill: #14170e;--kf-pillbrd: rgba(168, 225, 12, .28);--kf-shadow: 0 24px 60px rgba(0, 0, 0, .55);--kf-shadow2: 0 16px 40px rgba(0, 0, 0, .45);--kf-divider: rgba(168, 225, 12, .15);--kf-pkgbg: rgba(168, 225, 12, .08);--kf-pkgbrd: rgba(168, 225, 12, .4);--kf-btntext: #0f1208}.kontakt-sektion{background-image:url(/assets/bg-light-C_7mxjWZ.png);background-size:cover;background-position:center}.dark .kontakt-sektion{background-image:url(/assets/bg-dark-DX_vTCv2.png)}.kf-page input::-moz-placeholder,.kf-page textarea::-moz-placeholder{color:var(--kf-fieldicon)}.kf-page input::placeholder,.kf-page textarea::placeholder{color:var(--kf-fieldicon)}.kf-page input:focus,.kf-page textarea:focus{border-color:var(--kf-accent)!important;box-shadow:0 0 0 3px #a4d41733}.grain-band{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:180px 180px}.dark .grain-band{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}html.hifi-cursor-on,html.hifi-cursor-on *{cursor:none!important}html.hifi-cursor-on :is(input,textarea,[contenteditable=true]){cursor:auto!important}.hifi-cursor{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:99999;opacity:1;transition:opacity .2s ease}.hifi-cursor[data-hidden=true]{opacity:0}.hifi-cursor__core{position:fixed;top:0;left:0;width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:9999px;background:#7fd44a;box-shadow:0 0 0 1.5px #ffffffe6,0 0 10px #7fd44abf;transition:width .18s ease,height .18s ease,margin .18s ease,background-color .18s ease,opacity .15s ease}.hifi-cursor__orbit{position:fixed;top:0;left:0;opacity:0;transition:opacity .18s ease}.hifi-cursor__ring{position:absolute;width:38px;height:15px;margin:-7.5px 0 0 -19px;border:1px solid rgba(139,234,60,.85);border-radius:50%;transform:rotate(-24deg) scale(.6);transition:transform .22s ease}.hifi-cursor__sat{position:absolute;width:5px;height:5px;margin:-2.5px 0 0 -2.5px;border-radius:9999px;background:#eaffdb;box-shadow:0 0 6px #8bea3ce6}.hifi-cursor[data-state=hover] .hifi-cursor__orbit{opacity:1}.hifi-cursor[data-state=hover] .hifi-cursor__core{width:16px;height:16px;margin:-8px 0 0 -8px;background:#8bea3c;box-shadow:0 0 0 1.5px #fffffff2,0 0 12px #8bea3cd9}.hifi-cursor[data-state=hover] .hifi-cursor__ring{transform:rotate(-24deg) scale(1.45)}.hifi-cursor[data-state=text] .hifi-cursor__core,.hifi-cursor[data-state=text] .hifi-cursor__orbit{opacity:0}.hifi-cursor[data-down=true] .hifi-cursor__core{width:20px;height:20px;margin:-10px 0 0 -10px}.hifi-cursor__pulse{position:fixed;top:0;left:0;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:9999px;border:1.5px solid rgba(139,234,60,.9);opacity:0}.hifi-cursor__pulse.is-live{animation:hifi-cursor-pulse .45s ease-out forwards}@keyframes hifi-cursor-pulse{0%{opacity:.9;transform:scale(1)}to{opacity:0;transform:scale(3.2)}}.rte-content ul{list-style:disc;padding-left:1.5rem}.rte-content ol{list-style:decimal;padding-left:1.5rem}.rte-content a{color:#3b82f6;text-decoration:underline}.rte-content p{margin:.25rem 0}.rte-content h2{font-size:1.125rem;font-weight:700;margin:.75rem 0 .25rem}.rte-content code{font-family:ui-monospace,monospace;background:#7d7d7d26;border-radius:.25rem;padding:.1rem .3rem;font-size:.85em}.legal-content h2{margin:2rem 0 .5rem;font-weight:600;color:#171717}.dark .legal-content h2{color:#fff}.legal-content h2:first-child{margin-top:0}.legal-content p{margin:.5rem 0}.legal-content ul{list-style:disc;padding-left:1.25rem;margin:.5rem 0}.legal-content li{margin:.25rem 0}.legal-content a{color:#6ba626;text-decoration:underline}.legal-content code{font-family:ui-monospace,monospace;background:#7d7d7d26;border-radius:.25rem;padding:.1rem .3rem;font-size:.85em}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[var\(--kf-accent\)\]:hover{border-color:var(--kf-accent)}.hover\:border-brand-500:hover{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.hover\:border-neutral-400:hover{--tw-border-opacity: 1;border-color:rgb(163 163 163 / var(--tw-border-opacity, 1))}.hover\:bg-\[var\(--kf-accentsoft\)\]:hover{background-color:var(--kf-accentsoft)}.hover\:bg-brand-400:hover{--tw-bg-opacity: 1;background-color:rgb(146 212 68 / var(--tw-bg-opacity, 1))}.hover\:bg-brand-50:hover{--tw-bg-opacity: 1;background-color:rgb(245 251 238 / var(--tw-bg-opacity, 1))}.hover\:bg-brand-600:hover{--tw-bg-opacity: 1;background-color:rgb(88 137 31 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-100:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/10:hover{background-color:#ffffff1a}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(107 166 38 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(88 137 31 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\:grayscale-0:hover{--tw-grayscale: grayscale(0);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-brand-500:focus{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 166 38 / var(--tw-ring-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.group:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:from-black\/95{--tw-gradient-from: rgb(0 0 0 / .95) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.peer:checked~.peer-checked\:translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.dark\:divide-neutral-800:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(38 38 38 / var(--tw-divide-opacity, 1))}.dark\:border-brand-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(48 75 17 / var(--tw-border-opacity, 1))}.dark\:border-neutral-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity, 1))}.dark\:border-neutral-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.dark\:border-red-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(127 29 29 / var(--tw-border-opacity, 1))}.dark\:bg-amber-900\/20:is(.dark *){background-color:#78350f33}.dark\:bg-amber-900\/40:is(.dark *){background-color:#78350f66}.dark\:bg-brand-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.dark\:bg-brand-900\/20:is(.dark *){background-color:#304b1133}.dark\:bg-brand-900\/40:is(.dark *){background-color:#304b1166}.dark\:bg-green-900\/20:is(.dark *){background-color:#14532d33}.dark\:bg-green-900\/40:is(.dark *){background-color:#14532d66}.dark\:bg-neutral-100:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(82 82 82 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-800\/50:is(.dark *){background-color:#26262680}.dark\:bg-neutral-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-900\/40:is(.dark *){background-color:#17171766}.dark\:bg-neutral-900\/95:is(.dark *){background-color:#171717f2}.dark\:bg-neutral-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-950\/90:is(.dark *){background-color:#0a0a0ae6}.dark\:bg-neutral-950\/95:is(.dark *){background-color:#0a0a0af2}.dark\:bg-red-900\/10:is(.dark *){background-color:#7f1d1d1a}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-red-900\/40:is(.dark *){background-color:#7f1d1d66}.dark\:bg-slate-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-brand-200:is(.dark *){--tw-text-opacity: 1;color:rgb(211 238 180 / var(--tw-text-opacity, 1))}.dark\:text-brand-300:is(.dark *){--tw-text-opacity: 1;color:rgb(182 227 130 / var(--tw-text-opacity, 1))}.dark\:text-brand-400:is(.dark *){--tw-text-opacity: 1;color:rgb(146 212 68 / var(--tw-text-opacity, 1))}.dark\:text-brand-400\/10:is(.dark *){color:#92d4441a}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-neutral-100:is(.dark *){--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.dark\:text-neutral-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity, 1))}.dark\:text-neutral-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.dark\:text-neutral-400:is(.dark *){--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.dark\:text-neutral-500:is(.dark *){--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.dark\:text-neutral-600:is(.dark *){--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.dark\:text-neutral-900:is(.dark *){--tw-text-opacity: 1;color:rgb(23 23 23 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-slate-100:is(.dark *){--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:shadow-black\/40:is(.dark *){--tw-shadow-color: rgb(0 0 0 / .4);--tw-shadow: var(--tw-shadow-colored)}.dark\:ring-neutral-600:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(82 82 82 / var(--tw-ring-opacity, 1))}.dark\:ring-neutral-900:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(23 23 23 / var(--tw-ring-opacity, 1))}.dark\:hover\:border-neutral-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-brand-900\/20:hover:is(.dark *){background-color:#304b1133}.dark\:hover\:bg-neutral-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-neutral-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-neutral-800\/50:hover:is(.dark *){background-color:#26262680}.dark\:hover\:bg-red-900\/20:hover:is(.dark *){background-color:#7f1d1d33}@media (min-width: 640px){.sm\:left-4{left:1rem}.sm\:left-8{left:2rem}.sm\:right-4{right:1rem}.sm\:top-\[65px\]{top:65px}.sm\:-mt-\[97px\]{margin-top:-97px}.sm\:block{display:block}.sm\:hidden{display:none}.sm\:h-16{height:4rem}.sm\:h-20{height:5rem}.sm\:h-96{height:24rem}.sm\:min-h-\[640px\]{min-height:640px}.sm\:min-h-\[85vh\]{min-height:85vh}.sm\:w-72{width:18rem}.sm\:w-auto{width:auto}.sm\:flex-none{flex:none}.sm\:shrink-0{flex-shrink:0}.sm\:basis-\[210px\]{flex-basis:210px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.sm\:grid-cols-\[10rem_1fr\]{grid-template-columns:10rem 1fr}.sm\:grid-cols-\[16rem_1fr\]{grid-template-columns:16rem 1fr}.sm\:grid-cols-\[1fr_120px\]{grid-template-columns:1fr 120px}.sm\:grid-cols-\[1fr_120px_1fr\]{grid-template-columns:1fr 120px 1fr}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:p-10{padding:2.5rem}.sm\:p-5{padding:1.25rem}.sm\:p-6{padding:1.5rem}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:px-8{padding-left:2rem;padding-right:2rem}.sm\:py-14{padding-top:3.5rem;padding-bottom:3.5rem}.sm\:py-\[34px\]{padding-top:34px;padding-bottom:34px}.sm\:pl-8{padding-left:2rem}.sm\:pl-\[52px\]{padding-left:52px}.sm\:pt-1{padding-top:.25rem}.sm\:pt-14{padding-top:3.5rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-5xl{font-size:3rem;line-height:1}.sm\:text-\[46px\]{font-size:46px}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 641px){.min-\[641px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.min-\[641px\]\:border-b-0{border-bottom-width:0px}.min-\[641px\]\:border-r{border-right-width:1px}.min-\[641px\]\:last\:border-r-0:last-child{border-right-width:0px}}@media (min-width: 768px){.md\:order-1{order:1}.md\:order-2{order:2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 901px){.min-\[901px\]\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 981px){.min-\[981px\]\:grid-cols-\[minmax\(0\,1\.35fr\)_minmax\(320px\,1fr\)\]{grid-template-columns:minmax(0,1.35fr) minmax(320px,1fr)}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:w-80{width:20rem}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:text-\[60px\]{font-size:60px}}@media (min-width: 1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none} diff --git a/hifi/assets/index-CEZHSio1.js b/hifi/assets/index-CBt-zBNW.js similarity index 66% rename from hifi/assets/index-CEZHSio1.js rename to hifi/assets/index-CBt-zBNW.js index 4ec6be8..6e0784b 100644 --- a/hifi/assets/index-CEZHSio1.js +++ b/hifi/assets/index-CBt-zBNW.js @@ -1,4 +1,4 @@ -import{r as v,g as Bw,R as V2,D as $2,C as H2,M as W2,a as U2,P as K2,U as G2,b as Nx,c as Cx,d as q2,S as J2,e as Y2,E as X2,i as Z2,f as Gr}from"./lucide-icons-Cg2IxtAO.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var zw={exports:{}},jd={};/** +import{r as v,g as zw,R as $2,D as H2,C as W2,M as U2,a as K2,P as G2,U as q2,b as Cx,c as jx,d as J2,S as Y2,e as X2,E as Z2,i as Q2,f as Gr}from"./lucide-icons-Cg2IxtAO.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Fw={exports:{}},jd={};/** * @license React * react-jsx-runtime.production.min.js * @@ -6,7 +6,7 @@ import{r as v,g as Bw,R as V2,D as $2,C as H2,M as W2,a as U2,P as K2,U as G2,b * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Q2=v,eM=Symbol.for("react.element"),tM=Symbol.for("react.fragment"),nM=Object.prototype.hasOwnProperty,rM=Q2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,sM={key:!0,ref:!0,__self:!0,__source:!0};function Fw(t,e,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)nM.call(e,r)&&!sM.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:eM,type:t,key:i,ref:o,props:s,_owner:rM.current}}jd.Fragment=tM;jd.jsx=Fw;jd.jsxs=Fw;zw.exports=jd;var c=zw.exports,qf={},Vw={exports:{}},$t={},$w={exports:{}},Hw={};/** + */var eM=v,tM=Symbol.for("react.element"),nM=Symbol.for("react.fragment"),rM=Object.prototype.hasOwnProperty,sM=eM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,iM={key:!0,ref:!0,__self:!0,__source:!0};function Vw(t,e,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)rM.call(e,r)&&!iM.hasOwnProperty(r)&&(s[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)s[r]===void 0&&(s[r]=e[r]);return{$$typeof:tM,type:t,key:i,ref:o,props:s,_owner:sM.current}}jd.Fragment=nM;jd.jsx=Vw;jd.jsxs=Vw;Fw.exports=jd;var c=Fw.exports,qf={},$w={exports:{}},$t={},Hw={exports:{}},Ww={};/** * @license React * scheduler.production.min.js * @@ -14,7 +14,7 @@ import{r as v,g as Bw,R as V2,D as $2,C as H2,M as W2,a as U2,P as K2,U as G2,b * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(t){function e(_,I){var V=_.length;_.push(I);e:for(;0>>1,te=_[K];if(0>>1;Ks(he,V))Tes(lt,he)?(_[K]=lt,_[Te]=V,K=Te):(_[K]=he,_[se]=V,K=se);else if(Tes(lt,V))_[K]=lt,_[Te]=V,K=Te;else break e}}return I}function s(_,I){var V=_.sortIndex-I.sortIndex;return V!==0?V:_.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,h=null,f=3,p=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(_){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=_)r(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=n(u)}}function w(_){if(g=!1,k(_),!m)if(n(l)!==null)m=!0,B(C);else{var I=n(u);I!==null&&Z(w,I.startTime-_)}}function C(_,I){m=!1,g&&(g=!1,b(N),N=-1),p=!0;var V=f;try{for(k(I),h=n(l);h!==null&&(!(h.expirationTime>I)||_&&!T());){var K=h.callback;if(typeof K=="function"){h.callback=null,f=h.priorityLevel;var te=K(h.expirationTime<=I);I=t.unstable_now(),typeof te=="function"?h.callback=te:h===n(l)&&r(l),k(I)}else r(l);h=n(l)}if(h!==null)var Se=!0;else{var se=n(u);se!==null&&Z(w,se.startTime-I),Se=!1}return Se}finally{h=null,f=V,p=!1}}var E=!1,S=null,N=-1,M=5,j=-1;function T(){return!(t.unstable_now()-j_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(_){switch(f){case 1:case 2:case 3:var I=3;break;default:I=f}var V=f;f=I;try{return _()}finally{f=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(_,I){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var V=f;f=_;try{return I()}finally{f=V}},t.unstable_scheduleCallback=function(_,I,V){var K=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0K?(_.sortIndex=V,e(u,_),n(l)===null&&_===n(u)&&(g?(b(N),N=-1):g=!0,Z(w,V-K))):(_.sortIndex=te,e(l,_),m||p||(m=!0,B(C))),_},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(_){var I=f;return function(){var V=f;f=I;try{return _.apply(this,arguments)}finally{f=V}}}})(Hw);$w.exports=Hw;var iM=$w.exports;/** + */(function(t){function e(_,I){var V=_.length;_.push(I);e:for(;0>>1,te=_[K];if(0>>1;Ks(he,V))Tes(lt,he)?(_[K]=lt,_[Te]=V,K=Te):(_[K]=he,_[se]=V,K=se);else if(Tes(lt,V))_[K]=lt,_[Te]=V,K=Te;else break e}}return I}function s(_,I){var V=_.sortIndex-I.sortIndex;return V!==0?V:_.id-I.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,h=null,f=3,p=!1,m=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(_){for(var I=n(u);I!==null;){if(I.callback===null)r(u);else if(I.startTime<=_)r(u),I.sortIndex=I.expirationTime,e(l,I);else break;I=n(u)}}function w(_){if(g=!1,k(_),!m)if(n(l)!==null)m=!0,B(C);else{var I=n(u);I!==null&&Z(w,I.startTime-_)}}function C(_,I){m=!1,g&&(g=!1,b(N),N=-1),p=!0;var V=f;try{for(k(I),h=n(l);h!==null&&(!(h.expirationTime>I)||_&&!T());){var K=h.callback;if(typeof K=="function"){h.callback=null,f=h.priorityLevel;var te=K(h.expirationTime<=I);I=t.unstable_now(),typeof te=="function"?h.callback=te:h===n(l)&&r(l),k(I)}else r(l);h=n(l)}if(h!==null)var Se=!0;else{var se=n(u);se!==null&&Z(w,se.startTime-I),Se=!1}return Se}finally{h=null,f=V,p=!1}}var E=!1,S=null,N=-1,M=5,j=-1;function T(){return!(t.unstable_now()-j_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<_?Math.floor(1e3/_):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(_){switch(f){case 1:case 2:case 3:var I=3;break;default:I=f}var V=f;f=I;try{return _()}finally{f=V}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(_,I){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var V=f;f=_;try{return I()}finally{f=V}},t.unstable_scheduleCallback=function(_,I,V){var K=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0K?(_.sortIndex=V,e(u,_),n(l)===null&&_===n(u)&&(g?(b(N),N=-1):g=!0,Z(w,V-K))):(_.sortIndex=te,e(l,_),m||p||(m=!0,B(C))),_},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(_){var I=f;return function(){var V=f;f=I;try{return _.apply(this,arguments)}finally{f=V}}}})(Ww);Hw.exports=Ww;var oM=Hw.exports;/** * @license React * react-dom.production.min.js * @@ -22,14 +22,14 @@ import{r as v,g as Bw,R as V2,D as $2,C as H2,M as W2,a as U2,P as K2,U as G2,b * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oM=v,Vt=iM;function z(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jf=Object.prototype.hasOwnProperty,aM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,jx={},Ex={};function lM(t){return Jf.call(Ex,t)?!0:Jf.call(jx,t)?!1:aM.test(t)?Ex[t]=!0:(jx[t]=!0,!1)}function cM(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function uM(t,e,n,r){if(e===null||typeof e>"u"||cM(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Nt(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ot[t]=new Nt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ot[e]=new Nt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ot[t]=new Nt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ot[t]=new Nt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ot[t]=new Nt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ot[t]=new Nt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ot[t]=new Nt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ot[t]=new Nt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ot[t]=new Nt(t,5,!1,t.toLowerCase(),null,!1,!1)});var dg=/[\-:]([a-z])/g;function hg(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(dg,hg);ot[e]=new Nt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(dg,hg);ot[e]=new Nt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(dg,hg);ot[e]=new Nt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ot[t]=new Nt(t,1,!1,t.toLowerCase(),null,!1,!1)});ot.xlinkHref=new Nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ot[t]=new Nt(t,1,!1,t.toLowerCase(),null,!0,!0)});function fg(t,e,n,r){var s=ot.hasOwnProperty(e)?ot[e]:null;(s!==null?s.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jf=Object.prototype.hasOwnProperty,lM=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ex={},Tx={};function cM(t){return Jf.call(Tx,t)?!0:Jf.call(Ex,t)?!1:lM.test(t)?Tx[t]=!0:(Ex[t]=!0,!1)}function uM(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function dM(t,e,n,r){if(e===null||typeof e>"u"||uM(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Nt(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ot[t]=new Nt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ot[e]=new Nt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ot[t]=new Nt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ot[t]=new Nt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ot[t]=new Nt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ot[t]=new Nt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ot[t]=new Nt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ot[t]=new Nt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ot[t]=new Nt(t,5,!1,t.toLowerCase(),null,!1,!1)});var dg=/[\-:]([a-z])/g;function hg(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(dg,hg);ot[e]=new Nt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(dg,hg);ot[e]=new Nt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(dg,hg);ot[e]=new Nt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ot[t]=new Nt(t,1,!1,t.toLowerCase(),null,!1,!1)});ot.xlinkHref=new Nt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ot[t]=new Nt(t,1,!1,t.toLowerCase(),null,!0,!0)});function fg(t,e,n,r){var s=ot.hasOwnProperty(e)?ot[e]:null;(s!==null?s.type!==0:r||!(2a||s[o]!==i[a]){var l=` -`+s[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{wh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Fo(t):""}function dM(t){switch(t.tag){case 5:return Fo(t.type);case 16:return Fo("Lazy");case 13:return Fo("Suspense");case 19:return Fo("SuspenseList");case 0:case 2:case 15:return t=Sh(t.type,!1),t;case 11:return t=Sh(t.type.render,!1),t;case 1:return t=Sh(t.type,!0),t;default:return""}}function Qf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case xi:return"Fragment";case gi:return"Portal";case Yf:return"Profiler";case pg:return"StrictMode";case Xf:return"Suspense";case Zf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Kw:return(t.displayName||"Context")+".Consumer";case Uw:return(t._context.displayName||"Context")+".Provider";case mg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case gg:return e=t.displayName||null,e!==null?e:Qf(t.type)||"Memo";case xr:e=t._payload,t=t._init;try{return Qf(t(e))}catch{}}return null}function hM(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qf(e);case 8:return e===pg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function qr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function qw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function fM(t){var e=qw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Rl(t){t._valueTracker||(t._valueTracker=fM(t))}function Jw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=qw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Xc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ep(t,e){var n=e.checked;return Ee({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Mx(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=qr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Yw(t,e){e=e.checked,e!=null&&fg(t,"checked",e,!1)}function tp(t,e){Yw(t,e);var n=qr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?np(t,e.type,n):e.hasOwnProperty("defaultValue")&&np(t,e.type,qr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Px(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function np(t,e,n){(e!=="number"||Xc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Vo=Array.isArray;function Di(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=_l.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ea(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Xo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pM=["Webkit","ms","Moz","O"];Object.keys(Xo).forEach(function(t){pM.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Xo[e]=Xo[t]})});function e1(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Xo.hasOwnProperty(t)&&Xo[t]?(""+e).trim():e+"px"}function t1(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=e1(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var mM=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ip(t,e){if(e){if(mM[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(z(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(z(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(z(61))}if(e.style!=null&&typeof e.style!="object")throw Error(z(62))}}function op(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ap=null;function xg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var lp=null,Li=null,Ri=null;function Lx(t){if(t=hl(t)){if(typeof lp!="function")throw Error(z(280));var e=t.stateNode;e&&(e=Ad(e),lp(t.stateNode,t.type,e))}}function n1(t){Li?Ri?Ri.push(t):Ri=[t]:Li=t}function r1(){if(Li){var t=Li,e=Ri;if(Ri=Li=null,Lx(t),e)for(t=0;t>>=0,t===0?32:31-(jM(t)/EM|0)|0}var Il=64,Ol=4194304;function $o(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function tu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=$o(a):(i&=o,i!==0&&(r=$o(i)))}else o=n&~s,o!==0?r=$o(o):i!==0&&(r=$o(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ul(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-bn(e),t[e]=n}function AM(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Qo),$x=" ",Hx=!1;function S1(t,e){switch(t){case"keyup":return iP.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function N1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yi=!1;function aP(t,e){switch(t){case"compositionend":return N1(e);case"keypress":return e.which!==32?null:(Hx=!0,$x);case"textInput":return t=e.data,t===$x&&Hx?null:t;default:return null}}function lP(t,e){if(yi)return t==="compositionend"||!Cg&&S1(t,e)?(t=k1(),Cc=wg=jr=null,yi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Gx(n)}}function T1(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?T1(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function M1(){for(var t=window,e=Xc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Xc(t.document)}return e}function jg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function xP(t){var e=M1(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&T1(n.ownerDocument.documentElement,n)){if(r!==null&&jg(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=qx(n,i);var o=qx(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,bi=null,pp=null,ta=null,mp=!1;function Jx(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mp||bi==null||bi!==Xc(r)||(r=bi,"selectionStart"in r&&jg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ta&&La(ta,r)||(ta=r,r=su(pp,"onSelect"),0wi||(t.current=kp[wi],kp[wi]=null,wi--)}function ge(t,e){wi++,kp[wi]=t.current,t.current=e}var Jr={},pt=ts(Jr),Pt=ts(!1),$s=Jr;function Vi(t,e){var n=t.type.contextTypes;if(!n)return Jr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function At(t){return t=t.childContextTypes,t!=null}function ou(){be(Pt),be(pt)}function ny(t,e,n){if(pt.current!==Jr)throw Error(z(168));ge(pt,e),ge(Pt,n)}function B1(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(z(108,hM(t)||"Unknown",s));return Ee({},n,r)}function au(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Jr,$s=pt.current,ge(pt,t),ge(Pt,Pt.current),!0}function ry(t,e,n){var r=t.stateNode;if(!r)throw Error(z(169));n?(t=B1(t,e,$s),r.__reactInternalMemoizedMergedChildContext=t,be(Pt),be(pt),ge(pt,t)):be(Pt),ge(Pt,n)}var qn=null,Dd=!1,Oh=!1;function z1(t){qn===null?qn=[t]:qn.push(t)}function MP(t){Dd=!0,z1(t)}function ns(){if(!Oh&&qn!==null){Oh=!0;var t=0,e=de;try{var n=qn;for(de=1;t>=o,s-=o,Jn=1<<32-bn(e)+s|n<N?(M=S,S=null):M=S.sibling;var j=f(b,S,k[N],w);if(j===null){S===null&&(S=M);break}t&&S&&j.alternate===null&&e(b,S),x=i(j,x,N),E===null?C=j:E.sibling=j,E=j,S=M}if(N===k.length)return n(b,S),we&&gs(b,N),C;if(S===null){for(;NN?(M=S,S=null):M=S.sibling;var T=f(b,S,j.value,w);if(T===null){S===null&&(S=M);break}t&&S&&T.alternate===null&&e(b,S),x=i(T,x,N),E===null?C=T:E.sibling=T,E=T,S=M}if(j.done)return n(b,S),we&&gs(b,N),C;if(S===null){for(;!j.done;N++,j=k.next())j=h(b,j.value,w),j!==null&&(x=i(j,x,N),E===null?C=j:E.sibling=j,E=j);return we&&gs(b,N),C}for(S=r(b,S);!j.done;N++,j=k.next())j=p(S,b,N,j.value,w),j!==null&&(t&&j.alternate!==null&&S.delete(j.key===null?N:j.key),x=i(j,x,N),E===null?C=j:E.sibling=j,E=j);return t&&S.forEach(function(R){return e(b,R)}),we&&gs(b,N),C}function y(b,x,k,w){if(typeof k=="object"&&k!==null&&k.type===xi&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case Ll:e:{for(var C=k.key,E=x;E!==null;){if(E.key===C){if(C=k.type,C===xi){if(E.tag===7){n(b,E.sibling),x=s(E,k.props.children),x.return=b,b=x;break e}}else if(E.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===xr&&oy(C)===E.type){n(b,E.sibling),x=s(E,k.props),x.ref=Eo(b,E,k),x.return=b,b=x;break e}n(b,E);break}else e(b,E);E=E.sibling}k.type===xi?(x=Ls(k.props.children,b.mode,w,k.key),x.return=b,b=x):(w=Lc(k.type,k.key,k.props,null,b.mode,w),w.ref=Eo(b,x,k),w.return=b,b=w)}return o(b);case gi:e:{for(E=k.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===k.containerInfo&&x.stateNode.implementation===k.implementation){n(b,x.sibling),x=s(x,k.children||[]),x.return=b,b=x;break e}else{n(b,x);break}else e(b,x);x=x.sibling}x=Uh(k,b.mode,w),x.return=b,b=x}return o(b);case xr:return E=k._init,y(b,x,E(k._payload),w)}if(Vo(k))return m(b,x,k,w);if(wo(k))return g(b,x,k,w);Wl(b,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,x!==null&&x.tag===6?(n(b,x.sibling),x=s(x,k),x.return=b,b=x):(n(b,x),x=Wh(k,b.mode,w),x.return=b,b=x),o(b)):n(b,x)}return y}var Hi=H1(!0),W1=H1(!1),uu=ts(null),du=null,Ci=null,Pg=null;function Ag(){Pg=Ci=du=null}function Dg(t){var e=uu.current;be(uu),t._currentValue=e}function Np(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ii(t,e){du=t,Pg=Ci=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Tt=!0),t.firstContext=null)}function sn(t){var e=t._currentValue;if(Pg!==t)if(t={context:t,memoizedValue:e,next:null},Ci===null){if(du===null)throw Error(z(308));Ci=t,du.dependencies={lanes:0,firstContext:t}}else Ci=Ci.next=t;return e}var ws=null;function Lg(t){ws===null?ws=[t]:ws.push(t)}function U1(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,Lg(e)):(n.next=s.next,s.next=n),e.interleaved=n,or(t,r)}function or(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var yr=!1;function Rg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function K1(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function er(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Or(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,le&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,or(t,n)}return s=r.interleaved,s===null?(e.next=e,Lg(r)):(e.next=s.next,s.next=e),r.interleaved=e,or(t,n)}function Ec(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bg(t,n)}}function ay(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function hu(t,e,n,r){var s=t.updateQueue;yr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var h=s.baseState;o=0,d=u=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=t,g=a;switch(f=e,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){h=m.call(p,h,f);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(p,h,f):m,f==null)break e;h=Ee({},h,f);break e;case 2:yr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=h):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(l=h),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Us|=o,t.lanes=o,t.memoizedState=h}}function ly(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=zh.transition;zh.transition={};try{t(!1),e()}finally{de=n,zh.transition=r}}function cS(){return on().memoizedState}function LP(t,e,n){var r=zr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},uS(t))dS(e,n);else if(n=U1(t,e,n,r),n!==null){var s=kt();vn(n,t,r,s),hS(n,e,r)}}function RP(t,e,n){var r=zr(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(uS(t))dS(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Sn(a,o)){var l=e.interleaved;l===null?(s.next=s,Lg(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=U1(t,e,s,r),n!==null&&(s=kt(),vn(n,t,r,s),hS(n,e,r))}}function uS(t){var e=t.alternate;return t===Ce||e!==null&&e===Ce}function dS(t,e){na=pu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function hS(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bg(t,n)}}var mu={readContext:sn,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useInsertionEffect:ut,useLayoutEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useMutableSource:ut,useSyncExternalStore:ut,useId:ut,unstable_isNewReconciler:!1},_P={readContext:sn,useCallback:function(t,e){return En().memoizedState=[t,e===void 0?null:e],t},useContext:sn,useEffect:uy,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Mc(4194308,4,sS.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Mc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Mc(4,2,t,e)},useMemo:function(t,e){var n=En();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=En();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=LP.bind(null,Ce,t),[r.memoizedState,t]},useRef:function(t){var e=En();return t={current:t},e.memoizedState=t},useState:cy,useDebugValue:$g,useDeferredValue:function(t){return En().memoizedState=t},useTransition:function(){var t=cy(!1),e=t[0];return t=DP.bind(null,t[1]),En().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ce,s=En();if(we){if(n===void 0)throw Error(z(407));n=n()}else{if(n=e(),Je===null)throw Error(z(349));Ws&30||Y1(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,uy(Z1.bind(null,r,i,t),[t]),r.flags|=2048,Va(9,X1.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=En(),e=Je.identifierPrefix;if(we){var n=Yn,r=Jn;n=(r&~(1<<32-bn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=za++,0")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{wh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Fo(t):""}function hM(t){switch(t.tag){case 5:return Fo(t.type);case 16:return Fo("Lazy");case 13:return Fo("Suspense");case 19:return Fo("SuspenseList");case 0:case 2:case 15:return t=Sh(t.type,!1),t;case 11:return t=Sh(t.type.render,!1),t;case 1:return t=Sh(t.type,!0),t;default:return""}}function Qf(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case xi:return"Fragment";case gi:return"Portal";case Yf:return"Profiler";case pg:return"StrictMode";case Xf:return"Suspense";case Zf:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Gw:return(t.displayName||"Context")+".Consumer";case Kw:return(t._context.displayName||"Context")+".Provider";case mg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case gg:return e=t.displayName||null,e!==null?e:Qf(t.type)||"Memo";case xr:e=t._payload,t=t._init;try{return Qf(t(e))}catch{}}return null}function fM(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qf(e);case 8:return e===pg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function qr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Jw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function pM(t){var e=Jw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Rl(t){t._valueTracker||(t._valueTracker=pM(t))}function Yw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Jw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Xc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function ep(t,e){var n=e.checked;return Ee({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Px(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=qr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Xw(t,e){e=e.checked,e!=null&&fg(t,"checked",e,!1)}function tp(t,e){Xw(t,e);var n=qr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?np(t,e.type,n):e.hasOwnProperty("defaultValue")&&np(t,e.type,qr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Ax(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function np(t,e,n){(e!=="number"||Xc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Vo=Array.isArray;function Di(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=_l.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ea(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Xo={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},mM=["Webkit","ms","Moz","O"];Object.keys(Xo).forEach(function(t){mM.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Xo[e]=Xo[t]})});function t1(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Xo.hasOwnProperty(t)&&Xo[t]?(""+e).trim():e+"px"}function n1(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=t1(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var gM=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ip(t,e){if(e){if(gM[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(z(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(z(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(z(61))}if(e.style!=null&&typeof e.style!="object")throw Error(z(62))}}function op(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ap=null;function xg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var lp=null,Li=null,Ri=null;function Rx(t){if(t=hl(t)){if(typeof lp!="function")throw Error(z(280));var e=t.stateNode;e&&(e=Ad(e),lp(t.stateNode,t.type,e))}}function r1(t){Li?Ri?Ri.push(t):Ri=[t]:Li=t}function s1(){if(Li){var t=Li,e=Ri;if(Ri=Li=null,Rx(t),e)for(t=0;t>>=0,t===0?32:31-(EM(t)/TM|0)|0}var Il=64,Ol=4194304;function $o(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function tu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=$o(a):(i&=o,i!==0&&(r=$o(i)))}else o=n&~s,o!==0?r=$o(o):i!==0&&(r=$o(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function ul(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-bn(e),t[e]=n}function DM(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Qo),Hx=" ",Wx=!1;function N1(t,e){switch(t){case"keyup":return oP.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C1(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var yi=!1;function lP(t,e){switch(t){case"compositionend":return C1(e);case"keypress":return e.which!==32?null:(Wx=!0,Hx);case"textInput":return t=e.data,t===Hx&&Wx?null:t;default:return null}}function cP(t,e){if(yi)return t==="compositionend"||!Cg&&N1(t,e)?(t=w1(),Cc=wg=jr=null,yi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qx(n)}}function M1(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?M1(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function P1(){for(var t=window,e=Xc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Xc(t.document)}return e}function jg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function yP(t){var e=P1(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&M1(n.ownerDocument.documentElement,n)){if(r!==null&&jg(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=Jx(n,i);var o=Jx(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,bi=null,pp=null,ta=null,mp=!1;function Yx(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mp||bi==null||bi!==Xc(r)||(r=bi,"selectionStart"in r&&jg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ta&&La(ta,r)||(ta=r,r=su(pp,"onSelect"),0wi||(t.current=kp[wi],kp[wi]=null,wi--)}function ge(t,e){wi++,kp[wi]=t.current,t.current=e}var Jr={},pt=ts(Jr),Pt=ts(!1),$s=Jr;function Vi(t,e){var n=t.type.contextTypes;if(!n)return Jr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function At(t){return t=t.childContextTypes,t!=null}function ou(){ve(Pt),ve(pt)}function ry(t,e,n){if(pt.current!==Jr)throw Error(z(168));ge(pt,e),ge(Pt,n)}function z1(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(z(108,fM(t)||"Unknown",s));return Ee({},n,r)}function au(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Jr,$s=pt.current,ge(pt,t),ge(Pt,Pt.current),!0}function sy(t,e,n){var r=t.stateNode;if(!r)throw Error(z(169));n?(t=z1(t,e,$s),r.__reactInternalMemoizedMergedChildContext=t,ve(Pt),ve(pt),ge(pt,t)):ve(Pt),ge(Pt,n)}var qn=null,Dd=!1,Oh=!1;function F1(t){qn===null?qn=[t]:qn.push(t)}function PP(t){Dd=!0,F1(t)}function ns(){if(!Oh&&qn!==null){Oh=!0;var t=0,e=de;try{var n=qn;for(de=1;t>=o,s-=o,Jn=1<<32-bn(e)+s|n<N?(M=S,S=null):M=S.sibling;var j=f(b,S,k[N],w);if(j===null){S===null&&(S=M);break}t&&S&&j.alternate===null&&e(b,S),x=i(j,x,N),E===null?C=j:E.sibling=j,E=j,S=M}if(N===k.length)return n(b,S),we&&gs(b,N),C;if(S===null){for(;NN?(M=S,S=null):M=S.sibling;var T=f(b,S,j.value,w);if(T===null){S===null&&(S=M);break}t&&S&&T.alternate===null&&e(b,S),x=i(T,x,N),E===null?C=T:E.sibling=T,E=T,S=M}if(j.done)return n(b,S),we&&gs(b,N),C;if(S===null){for(;!j.done;N++,j=k.next())j=h(b,j.value,w),j!==null&&(x=i(j,x,N),E===null?C=j:E.sibling=j,E=j);return we&&gs(b,N),C}for(S=r(b,S);!j.done;N++,j=k.next())j=p(S,b,N,j.value,w),j!==null&&(t&&j.alternate!==null&&S.delete(j.key===null?N:j.key),x=i(j,x,N),E===null?C=j:E.sibling=j,E=j);return t&&S.forEach(function(R){return e(b,R)}),we&&gs(b,N),C}function y(b,x,k,w){if(typeof k=="object"&&k!==null&&k.type===xi&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case Ll:e:{for(var C=k.key,E=x;E!==null;){if(E.key===C){if(C=k.type,C===xi){if(E.tag===7){n(b,E.sibling),x=s(E,k.props.children),x.return=b,b=x;break e}}else if(E.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===xr&&ay(C)===E.type){n(b,E.sibling),x=s(E,k.props),x.ref=Eo(b,E,k),x.return=b,b=x;break e}n(b,E);break}else e(b,E);E=E.sibling}k.type===xi?(x=Ls(k.props.children,b.mode,w,k.key),x.return=b,b=x):(w=Lc(k.type,k.key,k.props,null,b.mode,w),w.ref=Eo(b,x,k),w.return=b,b=w)}return o(b);case gi:e:{for(E=k.key;x!==null;){if(x.key===E)if(x.tag===4&&x.stateNode.containerInfo===k.containerInfo&&x.stateNode.implementation===k.implementation){n(b,x.sibling),x=s(x,k.children||[]),x.return=b,b=x;break e}else{n(b,x);break}else e(b,x);x=x.sibling}x=Uh(k,b.mode,w),x.return=b,b=x}return o(b);case xr:return E=k._init,y(b,x,E(k._payload),w)}if(Vo(k))return m(b,x,k,w);if(wo(k))return g(b,x,k,w);Wl(b,k)}return typeof k=="string"&&k!==""||typeof k=="number"?(k=""+k,x!==null&&x.tag===6?(n(b,x.sibling),x=s(x,k),x.return=b,b=x):(n(b,x),x=Wh(k,b.mode,w),x.return=b,b=x),o(b)):n(b,x)}return y}var Hi=W1(!0),U1=W1(!1),uu=ts(null),du=null,Ci=null,Pg=null;function Ag(){Pg=Ci=du=null}function Dg(t){var e=uu.current;ve(uu),t._currentValue=e}function Np(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Ii(t,e){du=t,Pg=Ci=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Tt=!0),t.firstContext=null)}function sn(t){var e=t._currentValue;if(Pg!==t)if(t={context:t,memoizedValue:e,next:null},Ci===null){if(du===null)throw Error(z(308));Ci=t,du.dependencies={lanes:0,firstContext:t}}else Ci=Ci.next=t;return e}var ws=null;function Lg(t){ws===null?ws=[t]:ws.push(t)}function K1(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,Lg(e)):(n.next=s.next,s.next=n),e.interleaved=n,or(t,r)}function or(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var yr=!1;function Rg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function G1(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function er(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Or(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,le&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,or(t,n)}return s=r.interleaved,s===null?(e.next=e,Lg(r)):(e.next=s.next,s.next=e),r.interleaved=e,or(t,n)}function Ec(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bg(t,n)}}function ly(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function hu(t,e,n,r){var s=t.updateQueue;yr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var h=s.baseState;o=0,d=u=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=t,g=a;switch(f=e,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){h=m.call(p,h,f);break e}h=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m=="function"?m.call(p,h,f):m,f==null)break e;h=Ee({},h,f);break e;case 2:yr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=h):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(l=h),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Us|=o,t.lanes=o,t.memoizedState=h}}function cy(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=zh.transition;zh.transition={};try{t(!1),e()}finally{de=n,zh.transition=r}}function uS(){return on().memoizedState}function RP(t,e,n){var r=zr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dS(t))hS(e,n);else if(n=K1(t,e,n,r),n!==null){var s=kt();vn(n,t,r,s),fS(n,e,r)}}function _P(t,e,n){var r=zr(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dS(t))hS(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Sn(a,o)){var l=e.interleaved;l===null?(s.next=s,Lg(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=K1(t,e,s,r),n!==null&&(s=kt(),vn(n,t,r,s),fS(n,e,r))}}function dS(t){var e=t.alternate;return t===Ce||e!==null&&e===Ce}function hS(t,e){na=pu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function fS(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bg(t,n)}}var mu={readContext:sn,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useInsertionEffect:ut,useLayoutEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useMutableSource:ut,useSyncExternalStore:ut,useId:ut,unstable_isNewReconciler:!1},IP={readContext:sn,useCallback:function(t,e){return En().memoizedState=[t,e===void 0?null:e],t},useContext:sn,useEffect:dy,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Mc(4194308,4,iS.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Mc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Mc(4,2,t,e)},useMemo:function(t,e){var n=En();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=En();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=RP.bind(null,Ce,t),[r.memoizedState,t]},useRef:function(t){var e=En();return t={current:t},e.memoizedState=t},useState:uy,useDebugValue:$g,useDeferredValue:function(t){return En().memoizedState=t},useTransition:function(){var t=uy(!1),e=t[0];return t=LP.bind(null,t[1]),En().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Ce,s=En();if(we){if(n===void 0)throw Error(z(407));n=n()}else{if(n=e(),Je===null)throw Error(z(349));Ws&30||X1(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,dy(Q1.bind(null,r,i,t),[t]),r.flags|=2048,Va(9,Z1.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=En(),e=Je.identifierPrefix;if(we){var n=Yn,r=Jn;n=(r&~(1<<32-bn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=za++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Ln]=e,t[Ia]=r,wS(t,e,!1,!1),e.stateNode=t;e:{switch(o=op(n,r),n){case"dialog":xe("cancel",t),xe("close",t),s=r;break;case"iframe":case"object":case"embed":xe("load",t),s=r;break;case"video":case"audio":for(s=0;sKi&&(e.flags|=128,r=!0,To(i,!1),e.lanes=4194304)}else{if(!r)if(t=fu(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),To(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!we)return dt(e),null}else 2*_e()-i.renderingStartTime>Ki&&n!==1073741824&&(e.flags|=128,r=!0,To(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_e(),e.sibling=null,n=Ne.current,ge(Ne,r?n&1|2:n&1),e):(dt(e),null);case 22:case 23:return qg(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?_t&1073741824&&(dt(e),e.subtreeFlags&6&&(e.flags|=8192)):dt(e),null;case 24:return null;case 25:return null}throw Error(z(156,e.tag))}function HP(t,e){switch(Tg(e),e.tag){case 1:return At(e.type)&&ou(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Wi(),be(Pt),be(pt),Og(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Ig(e),null;case 13:if(be(Ne),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(z(340));$i()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return be(Ne),null;case 4:return Wi(),null;case 10:return Dg(e.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var Kl=!1,ft=!1,WP=typeof WeakSet=="function"?WeakSet:Set,U=null;function ji(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){De(t,e,r)}else n.current=null}function Lp(t,e,n){try{n()}catch(r){De(t,e,r)}}var ky=!1;function UP(t,e){if(gp=nu,t=M1(),jg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,h=t,f=null;t:for(;;){for(var p;h!==n||s!==0&&h.nodeType!==3||(a=o+s),h!==i||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===n&&++u===s&&(a=o),f===i&&++d===r&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(xp={focusedElem:t,selectionRange:n},nu=!1,U=e;U!==null;)if(e=U,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,U=t;else for(;U!==null;){e=U;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,y=m.memoizedState,b=e.stateNode,x=b.getSnapshotBeforeUpdate(e.elementType===e.type?g:fn(e.type,g),y);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var k=e.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(w){De(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,U=t;break}U=e.return}return m=ky,ky=!1,m}function ra(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&Lp(e,n,i)}s=s.next}while(s!==r)}}function _d(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Rp(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function CS(t){var e=t.alternate;e!==null&&(t.alternate=null,CS(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ln],delete e[Ia],delete e[vp],delete e[EP],delete e[TP])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function jS(t){return t.tag===5||t.tag===3||t.tag===4}function wy(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||jS(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function _p(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=iu));else if(r!==4&&(t=t.child,t!==null))for(_p(t,e,n),t=t.sibling;t!==null;)_p(t,e,n),t=t.sibling}function Ip(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Ip(t,e,n),t=t.sibling;t!==null;)Ip(t,e,n),t=t.sibling}var et=null,pn=!1;function hr(t,e,n){for(n=n.child;n!==null;)ES(t,e,n),n=n.sibling}function ES(t,e,n){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(Ed,n)}catch{}switch(n.tag){case 5:ft||ji(n,e);case 6:var r=et,s=pn;et=null,hr(t,e,n),et=r,pn=s,et!==null&&(pn?(t=et,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):et.removeChild(n.stateNode));break;case 18:et!==null&&(pn?(t=et,n=n.stateNode,t.nodeType===8?Ih(t.parentNode,n):t.nodeType===1&&Ih(t,n),Aa(t)):Ih(et,n.stateNode));break;case 4:r=et,s=pn,et=n.stateNode.containerInfo,pn=!0,hr(t,e,n),et=r,pn=s;break;case 0:case 11:case 14:case 15:if(!ft&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Lp(n,e,o),s=s.next}while(s!==r)}hr(t,e,n);break;case 1:if(!ft&&(ji(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){De(n,e,a)}hr(t,e,n);break;case 21:hr(t,e,n);break;case 22:n.mode&1?(ft=(r=ft)||n.memoizedState!==null,hr(t,e,n),ft=r):hr(t,e,n);break;default:hr(t,e,n)}}function Sy(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new WP),e.forEach(function(r){var s=eA.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function cn(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~i}if(r=s,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*GP(r/1960))-r,10t?16:t,Er===null)var r=!1;else{if(t=Er,Er=null,yu=0,le&6)throw Error(z(331));var s=le;for(le|=4,U=t.current;U!==null;){var i=U,o=i.child;if(U.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l_e()-Kg?Ds(t,0):Ug|=n),Dt(t,e)}function _S(t,e){e===0&&(t.mode&1?(e=Ol,Ol<<=1,!(Ol&130023424)&&(Ol=4194304)):e=1);var n=kt();t=or(t,e),t!==null&&(ul(t,e,n),Dt(t,n))}function QP(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),_S(t,n)}function eA(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(e),_S(t,n)}var IS;IS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Pt.current)Tt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Tt=!1,VP(t,e,n);Tt=!!(t.flags&131072)}else Tt=!1,we&&e.flags&1048576&&F1(e,cu,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Pc(t,e),t=e.pendingProps;var s=Vi(e,pt.current);Ii(e,n),s=zg(null,e,r,t,s,n);var i=Fg();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,At(r)?(i=!0,au(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Rg(e),s.updater=Rd,e.stateNode=s,s._reactInternals=e,jp(e,r,t,n),e=Mp(null,e,r,!0,i,n)):(e.tag=0,we&&i&&Eg(e),xt(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Pc(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=nA(r),t=fn(r,t),s){case 0:e=Tp(null,e,r,t,n);break e;case 1:e=yy(null,e,r,t,n);break e;case 11:e=gy(null,e,r,t,n);break e;case 14:e=xy(null,e,r,fn(r.type,t),n);break e}throw Error(z(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fn(r,s),Tp(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fn(r,s),yy(t,e,r,s,n);case 3:e:{if(bS(e),t===null)throw Error(z(387));r=e.pendingProps,i=e.memoizedState,s=i.element,K1(t,e),hu(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Ui(Error(z(423)),e),e=by(t,e,r,n,s);break e}else if(r!==s){s=Ui(Error(z(424)),e),e=by(t,e,r,n,s);break e}else for(Ot=Ir(e.stateNode.containerInfo.firstChild),Bt=e,we=!0,mn=null,n=W1(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($i(),r===s){e=ar(t,e,n);break e}xt(t,e,r,n)}e=e.child}return e;case 5:return G1(e),t===null&&Sp(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,yp(r,s)?o=null:i!==null&&yp(r,i)&&(e.flags|=32),yS(t,e),xt(t,e,o,n),e.child;case 6:return t===null&&Sp(e),null;case 13:return vS(t,e,n);case 4:return _g(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Hi(e,null,r,n):xt(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fn(r,s),gy(t,e,r,s,n);case 7:return xt(t,e,e.pendingProps,n),e.child;case 8:return xt(t,e,e.pendingProps.children,n),e.child;case 12:return xt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,ge(uu,r._currentValue),r._currentValue=o,i!==null)if(Sn(i.value,o)){if(i.children===s.children&&!Pt.current){e=ar(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=er(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Np(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(z(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Np(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}xt(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Ii(e,n),s=sn(s),r=r(s),e.flags|=1,xt(t,e,r,n),e.child;case 14:return r=e.type,s=fn(r,e.pendingProps),s=fn(r.type,s),xy(t,e,r,s,n);case 15:return gS(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fn(r,s),Pc(t,e),e.tag=1,At(r)?(t=!0,au(e)):t=!1,Ii(e,n),fS(e,r,s),jp(e,r,s,n),Mp(null,e,r,!0,t,n);case 19:return kS(t,e,n);case 22:return xS(t,e,n)}throw Error(z(156,e.tag))};function OS(t,e){return u1(t,e)}function tA(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(t,e,n,r){return new tA(t,e,n,r)}function Yg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function nA(t){if(typeof t=="function")return Yg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===mg)return 11;if(t===gg)return 14}return 2}function Fr(t,e){var n=t.alternate;return n===null?(n=Qt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Lc(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")Yg(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case xi:return Ls(n.children,s,i,e);case pg:o=8,s|=8;break;case Yf:return t=Qt(12,n,e,s|2),t.elementType=Yf,t.lanes=i,t;case Xf:return t=Qt(13,n,e,s),t.elementType=Xf,t.lanes=i,t;case Zf:return t=Qt(19,n,e,s),t.elementType=Zf,t.lanes=i,t;case Gw:return Od(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Uw:o=10;break e;case Kw:o=9;break e;case mg:o=11;break e;case gg:o=14;break e;case xr:o=16,r=null;break e}throw Error(z(130,t==null?t:typeof t,""))}return e=Qt(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Ls(t,e,n,r){return t=Qt(7,t,r,e),t.lanes=n,t}function Od(t,e,n,r){return t=Qt(22,t,r,e),t.elementType=Gw,t.lanes=n,t.stateNode={isHidden:!1},t}function Wh(t,e,n){return t=Qt(6,t,null,e),t.lanes=n,t}function Uh(t,e,n){return e=Qt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function rA(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ch(0),this.expirationTimes=Ch(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ch(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Xg(t,e,n,r,s,i,o,a,l){return t=new rA(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Qt(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rg(i),t}function sA(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VS)}catch(t){console.error(t)}}VS(),Vw.exports=$t;var $d=Vw.exports;const cA=Bw($d);var Ay=$d;qf.createRoot=Ay.createRoot,qf.hydrateRoot=Ay.hydrateRoot;/** +`+i.stack}return{value:t,source:e,stack:s,digest:null}}function $h(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Ep(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var zP=typeof WeakMap=="function"?WeakMap:Map;function mS(t,e,n){n=er(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){xu||(xu=!0,Op=r),Ep(t,e)},n}function gS(t,e,n){n=er(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var s=e.value;n.payload=function(){return r(s)},n.callback=function(){Ep(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ep(t,e),typeof r!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function py(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new zP;var s=new Set;r.set(e,s)}else s=r.get(e),s===void 0&&(s=new Set,r.set(e,s));s.has(n)||(s.add(n),t=QP.bind(null,t,e,n),e.then(t,t))}function my(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function gy(t,e,n,r,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=er(-1,1),e.tag=2,Or(n,e,1))),n.lanes|=1),t)}var FP=cr.ReactCurrentOwner,Tt=!1;function xt(t,e,n,r){e.child=t===null?U1(e,null,n,r):Hi(e,t.child,n,r)}function xy(t,e,n,r,s){n=n.render;var i=e.ref;return Ii(e,s),r=zg(t,e,n,r,i,s),n=Fg(),t!==null&&!Tt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,ar(t,e,s)):(we&&n&&Eg(e),e.flags|=1,xt(t,e,r,s),e.child)}function yy(t,e,n,r,s){if(t===null){var i=n.type;return typeof i=="function"&&!Yg(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,xS(t,e,i,r,s)):(t=Lc(n.type,null,r,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:La,n(o,r)&&t.ref===e.ref)return ar(t,e,s)}return e.flags|=1,t=Fr(i,r),t.ref=e.ref,t.return=e,e.child=t}function xS(t,e,n,r,s){if(t!==null){var i=t.memoizedProps;if(La(i,r)&&t.ref===e.ref)if(Tt=!1,e.pendingProps=r=i,(t.lanes&s)!==0)t.flags&131072&&(Tt=!0);else return e.lanes=t.lanes,ar(t,e,s)}return Tp(t,e,n,r,s)}function yS(t,e,n){var r=e.pendingProps,s=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ge(Ei,_t),_t|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ge(Ei,_t),_t|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ge(Ei,_t),_t|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,ge(Ei,_t),_t|=r;return xt(t,e,s,n),e.child}function bS(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Tp(t,e,n,r,s){var i=At(n)?$s:pt.current;return i=Vi(e,i),Ii(e,s),n=zg(t,e,n,r,i,s),r=Fg(),t!==null&&!Tt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,ar(t,e,s)):(we&&r&&Eg(e),e.flags|=1,xt(t,e,n,s),e.child)}function by(t,e,n,r,s){if(At(n)){var i=!0;au(e)}else i=!1;if(Ii(e,s),e.stateNode===null)Pc(t,e),pS(e,n,r),jp(e,n,r,s),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=sn(u):(u=At(n)?$s:pt.current,u=Vi(e,u));var d=n.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&fy(e,o,r,u),yr=!1;var f=e.memoizedState;o.state=f,hu(e,r,o,s),l=e.memoizedState,a!==r||f!==l||Pt.current||yr?(typeof d=="function"&&(Cp(e,n,d,r),l=e.memoizedState),(a=yr||hy(e,n,a,r,f,l,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,G1(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:fn(e.type,a),o.props=u,h=e.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=sn(l):(l=At(n)?$s:pt.current,l=Vi(e,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&fy(e,o,r,l),yr=!1,f=e.memoizedState,o.state=f,hu(e,r,o,s);var m=e.memoizedState;a!==h||f!==m||Pt.current||yr?(typeof p=="function"&&(Cp(e,n,p,r),m=e.memoizedState),(u=yr||hy(e,n,u,r,f,m,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),r=!1)}return Mp(t,e,n,r,i,s)}function Mp(t,e,n,r,s,i){bS(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return s&&sy(e,n,!1),ar(t,e,i);r=e.stateNode,FP.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Hi(e,t.child,null,i),e.child=Hi(e,null,a,i)):xt(t,e,a,i),e.memoizedState=r.state,s&&sy(e,n,!0),e.child}function vS(t){var e=t.stateNode;e.pendingContext?ry(t,e.pendingContext,e.pendingContext!==e.context):e.context&&ry(t,e.context,!1),_g(t,e.containerInfo)}function vy(t,e,n,r,s){return $i(),Mg(s),e.flags|=256,xt(t,e,n,r),e.child}var Pp={dehydrated:null,treeContext:null,retryLane:0};function Ap(t){return{baseLanes:t,cachePool:null,transitions:null}}function kS(t,e,n){var r=e.pendingProps,s=Ne.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(s&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),ge(Ne,s&1),t===null)return Sp(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,i?(r=e.mode,i=e.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Od(o,r,0,null),t=Ls(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Ap(n),e.memoizedState=Pp,t):Hg(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return VP(t,e,o,r,a,s,n);if(i){i=r.fallback,o=e.mode,s=t.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==s?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Fr(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=Fr(a,i):(i=Ls(i,o,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,o=t.child.memoizedState,o=o===null?Ap(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=Pp,r}return i=t.child,t=i.sibling,r=Fr(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Hg(t,e){return e=Od({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Ul(t,e,n,r){return r!==null&&Mg(r),Hi(e,t.child,null,n),t=Hg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function VP(t,e,n,r,s,i,o){if(n)return e.flags&256?(e.flags&=-257,r=$h(Error(z(422))),Ul(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,s=e.mode,r=Od({mode:"visible",children:r.children},s,0,null),i=Ls(i,s,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&Hi(e,t.child,null,o),e.child.memoizedState=Ap(o),e.memoizedState=Pp,i);if(!(e.mode&1))return Ul(t,e,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(z(419)),r=$h(i,r,void 0),Ul(t,e,o,r)}if(a=(o&t.childLanes)!==0,Tt||a){if(r=Je,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,or(t,s),vn(r,t,s,-1))}return Jg(),r=$h(Error(z(421))),Ul(t,e,o,r)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=eA.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,Ot=Ir(s.nextSibling),Bt=e,we=!0,mn=null,t!==null&&(Yt[Xt++]=Jn,Yt[Xt++]=Yn,Yt[Xt++]=Hs,Jn=t.id,Yn=t.overflow,Hs=e),e=Hg(e,r.children),e.flags|=4096,e)}function ky(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),Np(t.return,e,n)}function Hh(t,e,n,r,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function wS(t,e,n){var r=e.pendingProps,s=r.revealOrder,i=r.tail;if(xt(t,e,r.children,n),r=Ne.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ky(t,n,e);else if(t.tag===19)ky(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(ge(Ne,r),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(n=e.child,s=null;n!==null;)t=n.alternate,t!==null&&fu(t)===null&&(s=n),n=n.sibling;n=s,n===null?(s=e.child,e.child=null):(s=n.sibling,n.sibling=null),Hh(e,!1,s,n,i);break;case"backwards":for(n=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&fu(t)===null){e.child=s;break}t=s.sibling,s.sibling=n,n=s,s=t}Hh(e,!0,n,null,i);break;case"together":Hh(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Pc(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ar(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Us|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(z(153));if(e.child!==null){for(t=e.child,n=Fr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Fr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function $P(t,e,n){switch(e.tag){case 3:vS(e),$i();break;case 5:q1(e);break;case 1:At(e.type)&&au(e);break;case 4:_g(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,s=e.memoizedProps.value;ge(uu,r._currentValue),r._currentValue=s;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(ge(Ne,Ne.current&1),e.flags|=128,null):n&e.child.childLanes?kS(t,e,n):(ge(Ne,Ne.current&1),t=ar(t,e,n),t!==null?t.sibling:null);ge(Ne,Ne.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return wS(t,e,n);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ge(Ne,Ne.current),r)break;return null;case 22:case 23:return e.lanes=0,yS(t,e,n)}return ar(t,e,n)}var SS,Dp,NS,CS;SS=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Dp=function(){};NS=function(t,e,n,r){var s=t.memoizedProps;if(s!==r){t=e.stateNode,Ss(_n.current);var i=null;switch(n){case"input":s=ep(t,s),r=ep(t,r),i=[];break;case"select":s=Ee({},s,{value:void 0}),r=Ee({},r,{value:void 0}),i=[];break;case"textarea":s=rp(t,s),r=rp(t,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=iu)}ip(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ja.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ja.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ye("scroll",t),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};CS=function(t,e,n,r){n!==r&&(e.flags|=4)};function To(t,e){if(!we)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function dt(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function HP(t,e,n){var r=e.pendingProps;switch(Tg(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(e),null;case 1:return At(e.type)&&ou(),dt(e),null;case 3:return r=e.stateNode,Wi(),ve(Pt),ve(pt),Og(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Hl(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,mn!==null&&(Fp(mn),mn=null))),Dp(t,e),dt(e),null;case 5:Ig(e);var s=Ss(Ba.current);if(n=e.type,t!==null&&e.stateNode!=null)NS(t,e,n,r,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(z(166));return dt(e),null}if(t=Ss(_n.current),Hl(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[Ln]=e,r[Ia]=i,t=(e.mode&1)!==0,n){case"dialog":ye("cancel",r),ye("close",r);break;case"iframe":case"object":case"embed":ye("load",r);break;case"video":case"audio":for(s=0;s<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Ln]=e,t[Ia]=r,SS(t,e,!1,!1),e.stateNode=t;e:{switch(o=op(n,r),n){case"dialog":ye("cancel",t),ye("close",t),s=r;break;case"iframe":case"object":case"embed":ye("load",t),s=r;break;case"video":case"audio":for(s=0;sKi&&(e.flags|=128,r=!0,To(i,!1),e.lanes=4194304)}else{if(!r)if(t=fu(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),To(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!we)return dt(e),null}else 2*_e()-i.renderingStartTime>Ki&&n!==1073741824&&(e.flags|=128,r=!0,To(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=_e(),e.sibling=null,n=Ne.current,ge(Ne,r?n&1|2:n&1),e):(dt(e),null);case 22:case 23:return qg(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?_t&1073741824&&(dt(e),e.subtreeFlags&6&&(e.flags|=8192)):dt(e),null;case 24:return null;case 25:return null}throw Error(z(156,e.tag))}function WP(t,e){switch(Tg(e),e.tag){case 1:return At(e.type)&&ou(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Wi(),ve(Pt),ve(pt),Og(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Ig(e),null;case 13:if(ve(Ne),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(z(340));$i()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ve(Ne),null;case 4:return Wi(),null;case 10:return Dg(e.type._context),null;case 22:case 23:return qg(),null;case 24:return null;default:return null}}var Kl=!1,ft=!1,UP=typeof WeakSet=="function"?WeakSet:Set,U=null;function ji(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){De(t,e,r)}else n.current=null}function Lp(t,e,n){try{n()}catch(r){De(t,e,r)}}var wy=!1;function KP(t,e){if(gp=nu,t=P1(),jg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,h=t,f=null;t:for(;;){for(var p;h!==n||s!==0&&h.nodeType!==3||(a=o+s),h!==i||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===n&&++u===s&&(a=o),f===i&&++d===r&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(xp={focusedElem:t,selectionRange:n},nu=!1,U=e;U!==null;)if(e=U,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,U=t;else for(;U!==null;){e=U;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,y=m.memoizedState,b=e.stateNode,x=b.getSnapshotBeforeUpdate(e.elementType===e.type?g:fn(e.type,g),y);b.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var k=e.stateNode.containerInfo;k.nodeType===1?k.textContent="":k.nodeType===9&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(w){De(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,U=t;break}U=e.return}return m=wy,wy=!1,m}function ra(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&Lp(e,n,i)}s=s.next}while(s!==r)}}function _d(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Rp(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function jS(t){var e=t.alternate;e!==null&&(t.alternate=null,jS(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Ln],delete e[Ia],delete e[vp],delete e[TP],delete e[MP])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ES(t){return t.tag===5||t.tag===3||t.tag===4}function Sy(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ES(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function _p(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=iu));else if(r!==4&&(t=t.child,t!==null))for(_p(t,e,n),t=t.sibling;t!==null;)_p(t,e,n),t=t.sibling}function Ip(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Ip(t,e,n),t=t.sibling;t!==null;)Ip(t,e,n),t=t.sibling}var et=null,pn=!1;function hr(t,e,n){for(n=n.child;n!==null;)TS(t,e,n),n=n.sibling}function TS(t,e,n){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount(Ed,n)}catch{}switch(n.tag){case 5:ft||ji(n,e);case 6:var r=et,s=pn;et=null,hr(t,e,n),et=r,pn=s,et!==null&&(pn?(t=et,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):et.removeChild(n.stateNode));break;case 18:et!==null&&(pn?(t=et,n=n.stateNode,t.nodeType===8?Ih(t.parentNode,n):t.nodeType===1&&Ih(t,n),Aa(t)):Ih(et,n.stateNode));break;case 4:r=et,s=pn,et=n.stateNode.containerInfo,pn=!0,hr(t,e,n),et=r,pn=s;break;case 0:case 11:case 14:case 15:if(!ft&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Lp(n,e,o),s=s.next}while(s!==r)}hr(t,e,n);break;case 1:if(!ft&&(ji(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){De(n,e,a)}hr(t,e,n);break;case 21:hr(t,e,n);break;case 22:n.mode&1?(ft=(r=ft)||n.memoizedState!==null,hr(t,e,n),ft=r):hr(t,e,n);break;default:hr(t,e,n)}}function Ny(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new UP),e.forEach(function(r){var s=tA.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function cn(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~i}if(r=s,r=_e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qP(r/1960))-r,10t?16:t,Er===null)var r=!1;else{if(t=Er,Er=null,yu=0,le&6)throw Error(z(331));var s=le;for(le|=4,U=t.current;U!==null;){var i=U,o=i.child;if(U.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l_e()-Kg?Ds(t,0):Ug|=n),Dt(t,e)}function IS(t,e){e===0&&(t.mode&1?(e=Ol,Ol<<=1,!(Ol&130023424)&&(Ol=4194304)):e=1);var n=kt();t=or(t,e),t!==null&&(ul(t,e,n),Dt(t,n))}function eA(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),IS(t,n)}function tA(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(e),IS(t,n)}var OS;OS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Pt.current)Tt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Tt=!1,$P(t,e,n);Tt=!!(t.flags&131072)}else Tt=!1,we&&e.flags&1048576&&V1(e,cu,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Pc(t,e),t=e.pendingProps;var s=Vi(e,pt.current);Ii(e,n),s=zg(null,e,r,t,s,n);var i=Fg();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,At(r)?(i=!0,au(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Rg(e),s.updater=Rd,e.stateNode=s,s._reactInternals=e,jp(e,r,t,n),e=Mp(null,e,r,!0,i,n)):(e.tag=0,we&&i&&Eg(e),xt(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Pc(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=rA(r),t=fn(r,t),s){case 0:e=Tp(null,e,r,t,n);break e;case 1:e=by(null,e,r,t,n);break e;case 11:e=xy(null,e,r,t,n);break e;case 14:e=yy(null,e,r,fn(r.type,t),n);break e}throw Error(z(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fn(r,s),Tp(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fn(r,s),by(t,e,r,s,n);case 3:e:{if(vS(e),t===null)throw Error(z(387));r=e.pendingProps,i=e.memoizedState,s=i.element,G1(t,e),hu(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Ui(Error(z(423)),e),e=vy(t,e,r,n,s);break e}else if(r!==s){s=Ui(Error(z(424)),e),e=vy(t,e,r,n,s);break e}else for(Ot=Ir(e.stateNode.containerInfo.firstChild),Bt=e,we=!0,mn=null,n=U1(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($i(),r===s){e=ar(t,e,n);break e}xt(t,e,r,n)}e=e.child}return e;case 5:return q1(e),t===null&&Sp(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,yp(r,s)?o=null:i!==null&&yp(r,i)&&(e.flags|=32),bS(t,e),xt(t,e,o,n),e.child;case 6:return t===null&&Sp(e),null;case 13:return kS(t,e,n);case 4:return _g(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Hi(e,null,r,n):xt(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fn(r,s),xy(t,e,r,s,n);case 7:return xt(t,e,e.pendingProps,n),e.child;case 8:return xt(t,e,e.pendingProps.children,n),e.child;case 12:return xt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,ge(uu,r._currentValue),r._currentValue=o,i!==null)if(Sn(i.value,o)){if(i.children===s.children&&!Pt.current){e=ar(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=er(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Np(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(z(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Np(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}xt(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,Ii(e,n),s=sn(s),r=r(s),e.flags|=1,xt(t,e,r,n),e.child;case 14:return r=e.type,s=fn(r,e.pendingProps),s=fn(r.type,s),yy(t,e,r,s,n);case 15:return xS(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:fn(r,s),Pc(t,e),e.tag=1,At(r)?(t=!0,au(e)):t=!1,Ii(e,n),pS(e,r,s),jp(e,r,s,n),Mp(null,e,r,!0,t,n);case 19:return wS(t,e,n);case 22:return yS(t,e,n)}throw Error(z(156,e.tag))};function BS(t,e){return d1(t,e)}function nA(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(t,e,n,r){return new nA(t,e,n,r)}function Yg(t){return t=t.prototype,!(!t||!t.isReactComponent)}function rA(t){if(typeof t=="function")return Yg(t)?1:0;if(t!=null){if(t=t.$$typeof,t===mg)return 11;if(t===gg)return 14}return 2}function Fr(t,e){var n=t.alternate;return n===null?(n=Qt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Lc(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")Yg(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case xi:return Ls(n.children,s,i,e);case pg:o=8,s|=8;break;case Yf:return t=Qt(12,n,e,s|2),t.elementType=Yf,t.lanes=i,t;case Xf:return t=Qt(13,n,e,s),t.elementType=Xf,t.lanes=i,t;case Zf:return t=Qt(19,n,e,s),t.elementType=Zf,t.lanes=i,t;case qw:return Od(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Kw:o=10;break e;case Gw:o=9;break e;case mg:o=11;break e;case gg:o=14;break e;case xr:o=16,r=null;break e}throw Error(z(130,t==null?t:typeof t,""))}return e=Qt(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function Ls(t,e,n,r){return t=Qt(7,t,r,e),t.lanes=n,t}function Od(t,e,n,r){return t=Qt(22,t,r,e),t.elementType=qw,t.lanes=n,t.stateNode={isHidden:!1},t}function Wh(t,e,n){return t=Qt(6,t,null,e),t.lanes=n,t}function Uh(t,e,n){return e=Qt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function sA(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ch(0),this.expirationTimes=Ch(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ch(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Xg(t,e,n,r,s,i,o,a,l){return t=new sA(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Qt(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rg(i),t}function iA(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($S)}catch(t){console.error(t)}}$S(),$w.exports=$t;var $d=$w.exports;const uA=zw($d);var Dy=$d;qf.createRoot=Dy.createRoot,qf.hydrateRoot=Dy.hydrateRoot;/** * @remix-run/router v1.23.3 * * Copyright (c) Remix Software Inc. @@ -38,7 +38,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ha(){return Ha=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function t0(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function dA(){return Math.random().toString(36).substr(2,8)}function Ly(t,e){return{usr:t.state,key:t.key,idx:e}}function Vp(t,e,n,r){return n===void 0&&(n=null),Ha({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?po(e):e,{state:n,key:e&&e.key||r||dA()})}function ku(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function po(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function hA(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Tr.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(Ha({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){a=Tr.Pop;let y=d(),b=y==null?null:y-u;u=y,l&&l({action:a,location:g.location,delta:b})}function f(y,b){a=Tr.Push;let x=Vp(g.location,y,b);u=d()+1;let k=Ly(x,u),w=g.createHref(x);try{o.pushState(k,"",w)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(w)}i&&l&&l({action:a,location:g.location,delta:1})}function p(y,b){a=Tr.Replace;let x=Vp(g.location,y,b);u=d();let k=Ly(x,u),w=g.createHref(x);o.replaceState(k,"",w),i&&l&&l({action:a,location:g.location,delta:0})}function m(y){let b=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof y=="string"?y:ku(y);return x=x.replace(/ $/,"%20"),je(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let g={get action(){return a},get location(){return t(s,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Dy,h),l=y,()=>{s.removeEventListener(Dy,h),l=null}},createHref(y){return e(s,y)},createURL:m,encodeLocation(y){let b=m(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(y){return o.go(y)}};return g}var Ry;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Ry||(Ry={}));function fA(t,e,n){return n===void 0&&(n="/"),pA(t,e,n)}function pA(t,e,n,r){let s=typeof e=="string"?po(e):e,i=Gi(s.pathname||"/",n);if(i==null)return null;let o=$S(t);mA(o);let a=null,l=jA(i);for(let u=0;a==null&&u{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(je(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Vr([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(je(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$S(i.children,e,d,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:wA(u,i.index),routesMeta:d})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of HS(i.path))s(i,o,l)}),e}function HS(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=HS(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function mA(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:SA(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const gA=/^:[\w-]+$/,xA=3,yA=2,bA=1,vA=10,kA=-2,_y=t=>t==="*";function wA(t,e){let n=t.split("/"),r=n.length;return n.some(_y)&&(r+=kA),e&&(r+=yA),n.filter(s=>!_y(s)).reduce((s,i)=>s+(gA.test(i)?xA:i===""?bA:vA),r)}function SA(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function NA(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a{let{paramName:f,isOptional:p}=d;if(f==="*"){let g=a[h]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[h];return p&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function CA(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),t0(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function jA(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return t0(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Gi(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}const EA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,TA=t=>EA.test(t);function MA(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?po(t):t,i;if(n)if(TA(n))i=n;else{if(n.includes("//")){let o=n;n=WS(n),t0(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=Iy(n.substring(1),"/"):i=Iy(n,e)}else i=e;return{pathname:i,search:DA(r),hash:LA(s)}}function Iy(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Kh(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function PA(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function n0(t,e){let n=PA(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function r0(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=po(t):(s=Ha({},t),je(!s.pathname||!s.pathname.includes("?"),Kh("?","pathname","search",s)),je(!s.pathname||!s.pathname.includes("#"),Kh("#","pathname","hash",s)),je(!s.search||!s.search.includes("#"),Kh("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let h=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}a=h>=0?e[h]:"/"}let l=MA(s,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const WS=t=>t.replace(/\/\/+/g,"/"),Vr=t=>WS(t.join("/")),AA=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),DA=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,LA=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function RA(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const US=["post","put","patch","delete"];new Set(US);const _A=["get",...US];new Set(_A);/** + */function Ha(){return Ha=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function t0(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function hA(){return Math.random().toString(36).substr(2,8)}function Ry(t,e){return{usr:t.state,key:t.key,idx:e}}function Vp(t,e,n,r){return n===void 0&&(n=null),Ha({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?po(e):e,{state:n,key:e&&e.key||r||hA()})}function ku(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function po(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function fA(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Tr.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(Ha({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){a=Tr.Pop;let y=d(),b=y==null?null:y-u;u=y,l&&l({action:a,location:g.location,delta:b})}function f(y,b){a=Tr.Push;let x=Vp(g.location,y,b);u=d()+1;let k=Ry(x,u),w=g.createHref(x);try{o.pushState(k,"",w)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;s.location.assign(w)}i&&l&&l({action:a,location:g.location,delta:1})}function p(y,b){a=Tr.Replace;let x=Vp(g.location,y,b);u=d();let k=Ry(x,u),w=g.createHref(x);o.replaceState(k,"",w),i&&l&&l({action:a,location:g.location,delta:0})}function m(y){let b=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof y=="string"?y:ku(y);return x=x.replace(/ $/,"%20"),je(b,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,b)}let g={get action(){return a},get location(){return t(s,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Ly,h),l=y,()=>{s.removeEventListener(Ly,h),l=null}},createHref(y){return e(s,y)},createURL:m,encodeLocation(y){let b=m(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:f,replace:p,go(y){return o.go(y)}};return g}var _y;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(_y||(_y={}));function pA(t,e,n){return n===void 0&&(n="/"),mA(t,e,n)}function mA(t,e,n,r){let s=typeof e=="string"?po(e):e,i=Gi(s.pathname||"/",n);if(i==null)return null;let o=HS(t);gA(o);let a=null,l=EA(i);for(let u=0;a==null&&u{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(je(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Vr([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(je(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),HS(i.children,e,d,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:SA(u,i.index),routesMeta:d})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of WS(i.path))s(i,o,l)}),e}function WS(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=WS(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function gA(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:NA(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const xA=/^:[\w-]+$/,yA=3,bA=2,vA=1,kA=10,wA=-2,Iy=t=>t==="*";function SA(t,e){let n=t.split("/"),r=n.length;return n.some(Iy)&&(r+=wA),e&&(r+=bA),n.filter(s=>!Iy(s)).reduce((s,i)=>s+(xA.test(i)?yA:i===""?vA:kA),r)}function NA(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function CA(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a{let{paramName:f,isOptional:p}=d;if(f==="*"){let g=a[h]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const m=a[h];return p&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function jA(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),t0(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function EA(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return t0(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function Gi(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}const TA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MA=t=>TA.test(t);function PA(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?po(t):t,i;if(n)if(MA(n))i=n;else{if(n.includes("//")){let o=n;n=US(n),t0(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=Oy(n.substring(1),"/"):i=Oy(n,e)}else i=e;return{pathname:i,search:LA(r),hash:RA(s)}}function Oy(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Kh(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function AA(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function n0(t,e){let n=AA(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function r0(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=po(t):(s=Ha({},t),je(!s.pathname||!s.pathname.includes("?"),Kh("?","pathname","search",s)),je(!s.pathname||!s.pathname.includes("#"),Kh("#","pathname","hash",s)),je(!s.search||!s.search.includes("#"),Kh("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let h=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}a=h>=0?e[h]:"/"}let l=PA(s,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const US=t=>t.replace(/\/\/+/g,"/"),Vr=t=>US(t.join("/")),DA=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),LA=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,RA=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function _A(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const KS=["post","put","patch","delete"];new Set(KS);const IA=["get",...KS];new Set(IA);/** * React Router v6.30.4 * * Copyright (c) Remix Software Inc. @@ -47,7 +47,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Wa(){return Wa=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),v.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let h=r0(u,JSON.parse(o),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Vr([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,o,i,t])}const BA=v.createContext(null);function zA(t){let e=v.useContext(Bn).outlet;return e&&v.createElement(BA.Provider,{value:t},e)}function Qs(){let{matches:t}=v.useContext(Bn),e=t[t.length-1];return e?e.params:{}}function Ud(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=v.useContext(ur),{matches:s}=v.useContext(Bn),{pathname:i}=ln(),o=JSON.stringify(n0(s,r.v7_relativeSplatPath));return v.useMemo(()=>r0(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function FA(t,e){return VA(t,e)}function VA(t,e,n,r){mo()||je(!1);let{navigator:s}=v.useContext(ur),{matches:i}=v.useContext(Bn),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=ln(),d;if(e){var h;let y=typeof e=="string"?po(e):e;l==="/"||(h=y.pathname)!=null&&h.startsWith(l)||je(!1),d=y}else d=u;let f=d.pathname||"/",p=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=fA(t,{pathname:p}),g=KA(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Vr([l,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Vr([l,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return e&&g?v.createElement(Wd.Provider,{value:{location:Wa({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Tr.Pop}},g):g}function $A(){let t=YA(),e=RA(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},e),n?v.createElement("pre",{style:s},n):null,null)}const HA=v.createElement($A,null);class WA extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?v.createElement(Bn.Provider,{value:this.props.routeContext},v.createElement(GS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UA(t){let{routeContext:e,match:n,children:r}=t,s=v.useContext(Hd);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Bn.Provider,{value:e},r)}function KA(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);d>=0||je(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let p,m=!1,g=null,y=null;n&&(p=a&&h.route.id?a[h.route.id]:void 0,g=h.route.errorElement||HA,l&&(u<0&&f===0?(ZA("route-fallback"),m=!0,y=null):u===f&&(m=!0,y=h.route.hydrateFallbackElement||null)));let b=e.concat(o.slice(0,f+1)),x=()=>{let k;return p?k=g:m?k=y:h.route.Component?k=v.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=d,v.createElement(UA,{match:h,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?v.createElement(WA,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var JS=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(JS||{}),YS=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(YS||{});function GA(t){let e=v.useContext(Hd);return e||je(!1),e}function qA(t){let e=v.useContext(KS);return e||je(!1),e}function JA(t){let e=v.useContext(Bn);return e||je(!1),e}function XS(t){let e=JA(),n=e.matches[e.matches.length-1];return n.route.id||je(!1),n.route.id}function YA(){var t;let e=v.useContext(GS),n=qA(),r=XS();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function XA(){let{router:t}=GA(JS.UseNavigateStable),e=XS(YS.UseNavigateStable),n=v.useRef(!1);return qS(()=>{n.current=!0}),v.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,Wa({fromRouteId:e},i)))},[t,e])}const Oy={};function ZA(t,e,n){Oy[t]||(Oy[t]=!0)}function QA(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Ua(t){let{to:e,replace:n,state:r,relative:s}=t;mo()||je(!1);let{future:i,static:o}=v.useContext(ur),{matches:a}=v.useContext(Bn),{pathname:l}=ln(),u=pl(),d=r0(e,n0(a,i.v7_relativeSplatPath),l,s==="path"),h=JSON.stringify(d);return v.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:s}),[u,h,s,n,r]),null}function Kd(t){return zA(t.context)}function Q(t){je(!1)}function eD(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Tr.Pop,navigator:i,static:o=!1,future:a}=t;mo()&&je(!1);let l=e.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:l,navigator:i,static:o,future:Wa({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=po(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:m="default"}=r,g=v.useMemo(()=>{let y=Gi(d,l);return y==null?null:{location:{pathname:y,search:h,hash:f,state:p,key:m},navigationType:s}},[l,d,h,f,p,m,s]);return g==null?null:v.createElement(ur.Provider,{value:u},v.createElement(Wd.Provider,{children:n,value:g}))}function tD(t){let{children:e,location:n}=t;return FA(Hp(e),n)}new Promise(()=>{});function Hp(t,e){e===void 0&&(e=[]);let n=[];return v.Children.forEach(t,(r,s)=>{if(!v.isValidElement(r))return;let i=[...e,s];if(r.type===v.Fragment){n.push.apply(n,Hp(r.props.children,i));return}r.type!==Q&&je(!1),!r.props.index||!r.props.children||je(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Hp(r.props.children,i)),n.push(o)}),n}/** + */function Wa(){return Wa=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),v.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let h=r0(u,JSON.parse(o),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Vr([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,o,i,t])}const zA=v.createContext(null);function FA(t){let e=v.useContext(Bn).outlet;return e&&v.createElement(zA.Provider,{value:t},e)}function Qs(){let{matches:t}=v.useContext(Bn),e=t[t.length-1];return e?e.params:{}}function Ud(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=v.useContext(ur),{matches:s}=v.useContext(Bn),{pathname:i}=ln(),o=JSON.stringify(n0(s,r.v7_relativeSplatPath));return v.useMemo(()=>r0(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function VA(t,e){return $A(t,e)}function $A(t,e,n,r){mo()||je(!1);let{navigator:s}=v.useContext(ur),{matches:i}=v.useContext(Bn),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=ln(),d;if(e){var h;let y=typeof e=="string"?po(e):e;l==="/"||(h=y.pathname)!=null&&h.startsWith(l)||je(!1),d=y}else d=u;let f=d.pathname||"/",p=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let m=pA(t,{pathname:p}),g=GA(m&&m.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:Vr([l,s.encodeLocation?s.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Vr([l,s.encodeLocation?s.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return e&&g?v.createElement(Wd.Provider,{value:{location:Wa({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Tr.Pop}},g):g}function HA(){let t=XA(),e=_A(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},e),n?v.createElement("pre",{style:s},n):null,null)}const WA=v.createElement(HA,null);class UA extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?v.createElement(Bn.Provider,{value:this.props.routeContext},v.createElement(qS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function KA(t){let{routeContext:e,match:n,children:r}=t,s=v.useContext(Hd);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Bn.Provider,{value:e},r)}function GA(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);d>=0||je(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let p,m=!1,g=null,y=null;n&&(p=a&&h.route.id?a[h.route.id]:void 0,g=h.route.errorElement||WA,l&&(u<0&&f===0?(QA("route-fallback"),m=!0,y=null):u===f&&(m=!0,y=h.route.hydrateFallbackElement||null)));let b=e.concat(o.slice(0,f+1)),x=()=>{let k;return p?k=g:m?k=y:h.route.Component?k=v.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=d,v.createElement(KA,{match:h,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?v.createElement(UA,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:x(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):x()},null)}var YS=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(YS||{}),XS=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(XS||{});function qA(t){let e=v.useContext(Hd);return e||je(!1),e}function JA(t){let e=v.useContext(GS);return e||je(!1),e}function YA(t){let e=v.useContext(Bn);return e||je(!1),e}function ZS(t){let e=YA(),n=e.matches[e.matches.length-1];return n.route.id||je(!1),n.route.id}function XA(){var t;let e=v.useContext(qS),n=JA(),r=ZS();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function ZA(){let{router:t}=qA(YS.UseNavigateStable),e=ZS(XS.UseNavigateStable),n=v.useRef(!1);return JS(()=>{n.current=!0}),v.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,Wa({fromRouteId:e},i)))},[t,e])}const By={};function QA(t,e,n){By[t]||(By[t]=!0)}function eD(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Ua(t){let{to:e,replace:n,state:r,relative:s}=t;mo()||je(!1);let{future:i,static:o}=v.useContext(ur),{matches:a}=v.useContext(Bn),{pathname:l}=ln(),u=pl(),d=r0(e,n0(a,i.v7_relativeSplatPath),l,s==="path"),h=JSON.stringify(d);return v.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:s}),[u,h,s,n,r]),null}function Kd(t){return FA(t.context)}function Q(t){je(!1)}function tD(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Tr.Pop,navigator:i,static:o=!1,future:a}=t;mo()&&je(!1);let l=e.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:l,navigator:i,static:o,future:Wa({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=po(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:m="default"}=r,g=v.useMemo(()=>{let y=Gi(d,l);return y==null?null:{location:{pathname:y,search:h,hash:f,state:p,key:m},navigationType:s}},[l,d,h,f,p,m,s]);return g==null?null:v.createElement(ur.Provider,{value:u},v.createElement(Wd.Provider,{children:n,value:g}))}function nD(t){let{children:e,location:n}=t;return VA(Hp(e),n)}new Promise(()=>{});function Hp(t,e){e===void 0&&(e=[]);let n=[];return v.Children.forEach(t,(r,s)=>{if(!v.isValidElement(r))return;let i=[...e,s];if(r.type===v.Fragment){n.push.apply(n,Hp(r.props.children,i));return}r.type!==Q&&je(!1),!r.props.index||!r.props.children||je(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Hp(r.props.children,i)),n.push(o)}),n}/** * React Router DOM v6.30.4 * * Copyright (c) Remix Software Inc. @@ -56,7 +56,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function wu(){return wu=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function sD(t,e){let n=Wp(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const iD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],oD=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],aD="6";try{window.__reactRouterVersion=aD}catch{}const lD=v.createContext({isTransitioning:!1}),cD="startTransition",By=V2[cD];function uD(t){let{basename:e,children:n,future:r,window:s}=t,i=v.useRef();i.current==null&&(i.current=uA({window:s,v5Compat:!0}));let o=i.current,[a,l]=v.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=v.useCallback(h=>{u&&By?By(()=>l(h)):l(h)},[l,u]);return v.useLayoutEffect(()=>o.listen(d),[o,d]),v.useEffect(()=>QA(r),[r]),v.createElement(eD,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const dD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",hD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ee=v.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:d,viewTransition:h}=e,f=ZS(e,iD),{basename:p}=v.useContext(ur),m,g=!1;if(typeof u=="string"&&hD.test(u)&&(m=u,dD))try{let k=new URL(window.location.href),w=u.startsWith("//")?new URL(k.protocol+u):new URL(u),C=Gi(w.pathname,p);w.origin===k.origin&&C!=null?u=C+w.search+w.hash:g=!0}catch{}let y=IA(u,{relative:s}),b=pD(u,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:h});function x(k){r&&r(k),k.defaultPrevented||b(k)}return v.createElement("a",wu({},f,{href:m||y,onClick:g||i?r:x,ref:n,target:l}))}),QS=v.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:u,children:d}=e,h=ZS(e,oD),f=Ud(l,{relative:h.relative}),p=ln(),m=v.useContext(KS),{navigator:g,basename:y}=v.useContext(ur),b=m!=null&&gD(f)&&u===!0,x=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,k=p.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;s||(k=k.toLowerCase(),w=w?w.toLowerCase():null,x=x.toLowerCase()),w&&y&&(w=Gi(w,y)||w);const C=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let E=k===x||!o&&k.startsWith(x)&&k.charAt(C)==="/",S=w!=null&&(w===x||!o&&w.startsWith(x)&&w.charAt(x.length)==="/"),N={isActive:E,isPending:S,isTransitioning:b},M=E?r:void 0,j;typeof i=="function"?j=i(N):j=[i,E?"active":null,S?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let T=typeof a=="function"?a(N):a;return v.createElement(ee,wu({},h,{"aria-current":M,className:j,ref:n,style:T,to:l,viewTransition:u}),typeof d=="function"?d(N):d)});var Up;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Up||(Up={}));var zy;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(zy||(zy={}));function fD(t){let e=v.useContext(Hd);return e||je(!1),e}function pD(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=pl(),u=ln(),d=Ud(t,{relative:o});return v.useCallback(h=>{if(rD(h,n)){h.preventDefault();let f=r!==void 0?r:ku(u)===ku(d);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,d,r,s,n,t,i,o,a])}function mD(t){let e=v.useRef(Wp(t)),n=v.useRef(!1),r=ln(),s=v.useMemo(()=>sD(r.search,n.current?null:e.current),[r.search]),i=pl(),o=v.useCallback((a,l)=>{const u=Wp(typeof a=="function"?a(s):a);n.current=!0,i("?"+u,l)},[i,s]);return[s,o]}function gD(t,e){e===void 0&&(e={});let n=v.useContext(lD);n==null&&je(!1);let{basename:r}=fD(Up.useViewTransitionState),s=Ud(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=Gi(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Gi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $p(s.pathname,o)!=null||$p(s.pathname,i)!=null}function xD(){const{pathname:t}=ln();return v.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[t]),null}const yD='a, button, [role="button"], label, select, summary, [data-cursor="hover"], .cursor-pointer',bD='input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="file"]), textarea, [contenteditable="true"]';function vD(){const t=v.useRef(null),e=v.useRef(null),n=v.useRef(null),r=v.useRef(null),s=v.useRef(null);return v.useEffect(()=>{const i=window.matchMedia("(pointer: fine)"),o=window.matchMedia("(prefers-reduced-motion: reduce)");if(!i.matches||o.matches)return;const a=t.current,l=e.current,u=n.current,d=r.current,h=s.current;if(!a||!l||!u||!d||!h)return;document.documentElement.classList.add("hifi-cursor-on");const f=-24*Math.PI/180,p=Math.cos(f),m=Math.sin(f);let g=-100,y=-100,b=0,x=2.4,k=2.4,w=16,C=6.5,E=16,S=6.5,N=!1,M,j=performance.now();const T=_=>{const I=Math.min((_-j)/1e3,.05);j=_,x+=(k-x)*Math.min(1,I*8),w+=(E-w)*Math.min(1,I*10),C+=(S-C)*Math.min(1,I*10),b+=x*I,l.style.transform=`translate3d(${g}px, ${y}px, 0)`,u.style.transform=`translate3d(${g}px, ${y}px, 0)`;const V=Math.cos(b)*w,K=Math.sin(b)*C;d.style.transform=`translate(${V*p-K*m}px, ${V*m+K*p}px)`,M=requestAnimationFrame(T)},R=_=>{a.dataset.state=_;const I=_==="hover";k=I?7:2.4,E=I?23:16,S=I?9.5:6.5},$=_=>{g=_.clientX,y=_.clientY,N||(N=!0,a.dataset.hidden="false")},L=_=>{const I=_.target;I instanceof Element&&(I.closest(bD)?R("text"):I.closest(yD)?R("hover"):R("default"))},W=()=>{a.dataset.down="true",h.style.left=`${g}px`,h.style.top=`${y}px`,h.classList.remove("is-live"),h.offsetWidth,h.classList.add("is-live")},B=()=>{a.dataset.down="false"},Z=()=>{N=!1,a.dataset.hidden="true"};return document.addEventListener("mousemove",$,{passive:!0}),document.addEventListener("mouseover",L,{passive:!0}),document.addEventListener("mousedown",W,{passive:!0}),document.addEventListener("mouseup",B,{passive:!0}),document.documentElement.addEventListener("mouseleave",Z),window.addEventListener("blur",Z),M=requestAnimationFrame(T),()=>{cancelAnimationFrame(M),document.removeEventListener("mousemove",$),document.removeEventListener("mouseover",L),document.removeEventListener("mousedown",W),document.removeEventListener("mouseup",B),document.documentElement.removeEventListener("mouseleave",Z),window.removeEventListener("blur",Z),document.documentElement.classList.remove("hifi-cursor-on")}},[]),c.jsxs("div",{ref:t,className:"hifi-cursor","data-state":"default","data-hidden":"true","data-down":"false","aria-hidden":"true",children:[c.jsxs("div",{ref:n,className:"hifi-cursor__orbit",children:[c.jsx("div",{className:"hifi-cursor__ring"}),c.jsx("div",{ref:r,className:"hifi-cursor__sat"})]}),c.jsx("div",{ref:e,className:"hifi-cursor__core"}),c.jsx("div",{ref:s,className:"hifi-cursor__pulse"})]})}const eN=`${"/".replace(/\/$/,"")}/api`;async function Po(t,e={}){const n=await fetch(`${eN}${t}`,{credentials:"include",headers:e.body instanceof FormData?{}:{"Content-Type":"application/json"},...e}),r=await n.text();let s=null;if(r)try{s=JSON.parse(r)}catch{}if(!n.ok)throw new Error((s==null?void 0:s.error)||`Fehler ${n.status}`);if(s===null&&r)throw new Error("Unerwartete Server-Antwort (kein gültiges JSON)");return s}const A={get:t=>Po(t),post:(t,e)=>Po(t,{method:"POST",body:e instanceof FormData?e:JSON.stringify(e)}),put:(t,e)=>Po(t,{method:"PUT",body:JSON.stringify(e)}),patch:(t,e)=>Po(t,{method:"PATCH",body:JSON.stringify(e)}),delete:t=>Po(t,{method:"DELETE"})};function kD({children:t}){const[e,n]=v.useState({pathname:null,needsSetup:null}),r=ln();return v.useEffect(()=>{let s=!1;return A.get("/setup/status").then(i=>{s||n({pathname:r.pathname,needsSetup:i.needs_setup})}).catch(()=>{s||n({pathname:r.pathname,needsSetup:!1})}),()=>{s=!0}},[r.pathname]),e.pathname!==r.pathname||e.needsSetup===null?c.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"}):e.needsSetup&&r.pathname!=="/setup"?c.jsx(Ua,{to:"/setup",replace:!0}):!e.needsSetup&&r.pathname==="/setup"?c.jsx(Ua,{to:"/",replace:!0}):t}const tN=v.createContext(null);function wD(){const t=new Date,e=t.getHours()+t.getMinutes()/60;return e>=6.5&&e<21?"light":"dark"}function SD({children:t}){const[e,n]=v.useState(()=>{const s=localStorage.getItem("hifi-theme");return s==="light"||s==="dark"?s:wD()});v.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),localStorage.setItem("hifi-theme",e)},[e]);const r=()=>n(s=>s==="dark"?"light":"dark");return c.jsx(tN.Provider,{value:{theme:e,toggleTheme:r},children:t})}function ND(){return v.useContext(tN)}const CD={nav:{openMenu:"Menü öffnen",closeMenu:"Menü schließen",close:"Schließen",adminPanel:"Zum Admin-Panel",vehicles:"Fahrzeuge",services:"Leistungen",gallery:"Galerie",contact:"Kontakt",whatsapp:"WhatsApp",shop:"Zum Shop"},themeToggle:{label:"Theme umschalten"},languageToggle:{label:"Sprache auswählen"},footer:{routePlan:"Route planen",contactHeading:"Kontakt",contactForm:"Kontaktformular",hoursHeading:"Öffnungszeiten",open:"Geöffnet",closed:"Geschlossen",days:{monFri:"Montag – Freitag",sat:"Samstag",sun:"Sonntag"},copyright:t=>`© ${t} HifiPlanet. Alle Angaben ohne Gewähr.`,imprint:"Impressum",privacy:"Datenschutz",terms:"AGB",cookieSettings:"Cookie-Einstellungen"},cookieConsent:{bannerText:"Wir verwenden nur technisch notwendige Cookies. Für Google Maps, YouTube-Videos und Statistik-Cookies benötigen wir zusätzlich deine Zustimmung, da dabei Daten an Google übertragen werden.",moreInfo:"Mehr dazu in unserer",privacyPolicy:"Datenschutzerklärung",settings:"Einstellungen",onlyNecessary:"Nur notwendige",acceptAll:"Alle akzeptieren",modalTitle:"Cookie-Einstellungen",modalIntro:"Lege fest, welche Kategorien du zulassen möchtest. Mehr dazu in unserer",necessaryTitle:"Notwendig",necessaryDesc:"Für den Betrieb der Website erforderlich (z. B. Login-Session, Theme- und Cookie-Einstellung). Kann nicht deaktiviert werden.",externalTitle:"Externe Medien",externalDesc:"Google Maps und YouTube-Videos. Beim Laden werden Daten (u. a. deine IP-Adresse) an Google übertragen.",analyticsTitle:"Statistik",analyticsDesc:"Google Analytics hilft uns zu verstehen, wie die Website genutzt wird. Dabei werden Daten an Google übertragen.",cancel:"Abbrechen",saveSelection:"Auswahl speichern"},maintenance:{title:"Wartungsarbeiten",defaultMessage:"Dieser Bereich wird gerade aktualisiert. Bitte schau in Kürze wieder vorbei."},lightbox:{close:"Schließen",previous:"Vorheriges Bild",next:"Nächstes Bild"},home:{metaTitle:"Car-Hifi Umbauten nach Maß",metaDescription:"HifiPlanet – dein Car-Hifi Spezialist in Amorbach. Marke und Modell wählen, passende Sound-Pakete entdecken und unverbindlich anfragen.",stickyCta:"Bereit für deinen Sound-Umbau?",selectVehicle:"Fahrzeug auswählen",getInTouch:"Kontakt aufnehmen",welcome:"Willkommen bei HifiPlanet",heroTitle:"Home of pure Sound",heroSubtitle:"Dein Car-Hifi Spezialist für individuelle Sound-Umbauten. Wähle dein Fahrzeug, entdecke passende Pakete und frag unverbindlich an – wir kümmern uns um den Rest.",stats:[{value:"20+",label:"Jahre Erfahrung"},{value:"Riesige",label:"3D-Druckfarm im eigenen Haus"},{value:"Eigene",label:"CNC- & Laserwerkstatt"},{value:"International",label:"anerkannter Car-Hifi-Spezialist"}],brandsHeading:"Marken, mit denen wir arbeiten",youtubeBadge:"HifiPlanet präsentiert",youtubeTitle:"Das Handwerk hinter deinem Sound",youtubeText:"Entdecke die Handwerkskunst hinter unserer Arbeit",youtubeCta:"Jetzt ansehen",heroImageAlt:"Ground Zero Subwoofer und Endstufen mit violetter Ambiente-Beleuchtung",craftImageAlt:"Individueller Subwoofer-Bau",adviceImageAlt:"Endstufen-Einbau mit Ambiente-Beleuchtung",moreImageAlt:"Hochwertige Endstufe und Subwoofer, Studioaufnahme",craftEyebrow:"Handwerk",craftTitle:"Präzisionsarbeit in jedem Detail",craftText:"Ob eigens gefertigte Subwoofer-Gehäuse, integrierte Beleuchtung oder unsichtbar verlegte Kabelwege – dank eigener CNC-, Laser- und 3D-Druck-Fertigung entstehen bei uns Lösungen, die es von der Stange nicht gibt.",adviceEyebrow:"Beratung",adviceTitle:"Von der ersten Idee bis zum letzten Schliff",adviceText:"Jedes Fahrzeug und jeder Anspruch ist anders. Deshalb beraten wir dich persönlich und unverbindlich – vom dezenten Upgrade bis zum kompromisslosen High-End-System.",insightsTitle:"Einblicke in unsere Umbauten",insightsText:"Vom unauffälligen Sound-Upgrade bis zum aufwendigen Komplettumbau – Handarbeit aus unserer Werkstatt in Amorbach.",galleryAlts:["Individueller Subwoofer-Bau mit Ground Zero Bässen","Endstufen-Einbau mit violetter Ambiente-Beleuchtung","Hochtöner- und Mitteltöner-Einbau von Focal Utopia","Sony Navigationssystem mit Apple CarPlay im Cockpit","Verbauter Hochtöner im Kofferraum","Individueller Subwoofer-Einbau mit LED-Beleuchtung im Kofferraum"],reviewsRating:"5,0 von 181 Kunden bewertet",reviewsRatingDynamic:(t,e)=>`${t.toFixed(1).replace(".",",")} von ${e} Kunden bewertet`,reviewsText:"Das sagen unsere Kunden über uns.",reviewsLink:"Alle Bewertungen auf Google ansehen →",testimonials:[{name:"Thomas K.",text:"Über YouTube auf dieses Klang-Juwel gestoßen. Beratung und Empfehlungen sind erstklassig – der Tesla-Vorführwagen hat meine Leidenschaft für guten Sound neu entfacht."},{name:"Andreas I.",text:"Sehr professionelle Beratung und Service. Obwohl ich von VAG zu Mercedes gewechselt bin, wurde alles reibungslos angepasst. Die 3-Wege-Lautsprecher und zwei Subwoofer liefern außergewöhnliche Leistung."},{name:"Thomas F.",text:"Kompletter Audi A4 B9 Umbau hat meine Erwartungen übertroffen. Von Anfang bis Ende professionell, mit tadelloser Verarbeitung und Klangqualität."},{name:"Drago G.",text:"Beeindruckt von der CNC-Arbeit, die auf YouTube gezeigt wird. Angefangen mit 3D-gedruckten Lautsprecherringen für meinen Ford Mustang – daraus wurde ein viel größeres Projekt."},{name:"Leonardo B.",text:"Toller Service und meisterhafte Handwerkskunst. Saubere Installation, Leidenschaft in jedem Detail erkennbar."},{name:"Marcel S.",text:"Unschlagbares Preis-Leistungs-Verhältnis. Das Team hat sich viel Zeit genommen, um genau die Lösung für mein Budget zu finden."},{name:"Julia W.",text:"Endlich ein Betrieb, der auch Wohnmobile ernst nimmt. Die Soundanlage in unserem Camper klingt jetzt wie im Wohnzimmer."},{name:"Kevin R.",text:"Dashcam und Alarmanlage in einem Termin sauber verbaut, keine sichtbaren Kabel. Absolute Empfehlung für alle, die Wert auf Verarbeitung legen."},{name:"Sabrina H.",text:"Mein Oldtimer hat jetzt modernen Sound, ohne dass es dem Original-Look geschadet hätte. Genau das habe ich gesucht."},{name:"Niklas P.",text:"Von der ersten Anfrage bis zum fertigen Umbau lief alles reibungslos. Ehrliche Beratung ohne Verkaufsdruck."}],moreTitle:"Mehr als nur Car-Hifi",moreText:"Neben individuellen Sound-Umbauten bieten wir CNC-Zerspanung, Lasertechnik, 3D-Druck und mehr – alles aus einer Hand in unserer eigenen Werkstatt.",moreCta:"Alle Leistungen entdecken",faqHeading:"Häufig gestellte Fragen"},vehicleSelect:{metaTitle:"Fahrzeug auswählen",metaDescription:"Wähle deine Fahrzeugmarke und dein Modell und entdecke passende Car-Hifi Sound-Pakete von HifiPlanet.",title:"Fahrzeug auswählen",intro:"Wähle zuerst deine Marke, dann dein Modell – wir zeigen dir direkt die passenden Sound-Pakete.",empty:"Es sind noch keine Marken hinterlegt."},brandPage:{metaTitleFallback:"Modell auswählen",metaDescription:t=>`Wähle dein ${t} Modell und entdecke passende Car-Hifi Sound-Pakete von HifiPlanet.`,loading:"Lädt…",breadcrumbVehicles:"Fahrzeuge",titleSuffix:"Modell wählen",empty:"Für diese Marke sind noch keine Modelle hinterlegt."},modelPage:{metaTitleFallback:"Sound-Pakete",metaTitle:(t,e)=>`${t} ${e} Sound-Pakete`,metaDescription:(t,e)=>`Car-Hifi Sound-Pakete für ${t} ${e} inkl. aktueller Preise – von HifiPlanet unverbindlich anfragen.`,loading:"Lädt…",breadcrumbVehicles:"Fahrzeuge",titleSuffix:"Sound-Pakete",empty:"Für dieses Modell sind noch keine Pakete hinterlegt.",totalPrice:"ab ca.",productLoading:"Produkt wird geladen…",requestContact:"Kontakt anfragen",featuredBadge:"Empfohlen",moreBullets:t=>t===1?"+ 1 weitere Leistung":`+ ${t} weitere Leistungen`,lessBullets:"Weniger anzeigen",wheelHint:"Mit dem Mausrad blättern"},leistungen:{metaTitle:"Leistungen",metaDescription:"Car-Hifi, Wohnmobil & Caravan, Oldtimer, CNC-Zerspanung, Lasertechnik, 3D-Druck, Alarmanlagen und Dash Cams – alles aus einer Hand bei HifiPlanet in Amorbach.",title:"Unsere Leistungen",intro:"Von individuellen Sound-Umbauten bis zur eigenen CNC- und 3D-Druck-Fertigung – alles aus einer Hand in unserer Werkstatt in Amorbach.",notListedTitle:"Dein Projekt ist nicht dabei?",notListedText:"Sprich uns einfach an – wir finden gemeinsam die passende Lösung.",contact:"Kontakt aufnehmen"},contactPage:{metaTitle:"Kontakt",metaDescription:"Kontaktiere HifiPlanet in Amorbach für dein individuelles Car-Hifi Projekt – wir beraten dich gerne unverbindlich.",title:"Kontakt aufnehmen",heroEyebrow:"Kontakt",heroTitlePre:"Sprich",heroTitleAccent:"mit",heroTitlePost:"uns.",heroSubtitle:"Ob Anlage, Einbau oder Klang-Tuning für dein Fahrzeug — schreib uns, wir melden uns schnellstmöglich zurück.",packageBoxTitle:"Deine Anfrage bezieht sich auf",formTitle:"Anfrage senden",sentTitle:"Anfrage gesendet ✓",sentText:"Danke! Wir melden uns innerhalb eines Werktags bei dir.",contextIntro:"Deine Anfrage bezieht sich auf:",contextBrand:"Marke",contextModel:"Modell",contextPackage:"Paket",contextProduct:"Produkt",packagePrice:"Paketpreis",upgrades:"Upgrades",optionalUpgrades:"Optionale Upgrades",totalWithUpgrades:"Gesamt inkl. Upgrades",nameLabel:"Name *",namePlaceholder:"Max Mustermann",emailLabel:"E-Mail *",emailPlaceholder:"max@mail.de",phoneLabel:"Telefon",phonePlaceholder:"Optional",vinLabel:"Fahrgestellnummer (FIN)",vinPlaceholder:"Optional – hilft bei der Einschätzung",messageLabel:"Nachricht",messagePlaceholder:"Erzähl uns von deinem Projekt – Fahrzeug, Wunschklang, Budget …",requiredHint:"* Pflichtfelder",sending:"Wird gesendet…",submit:"Anfrage senden",cardTitle:"HiFi Planet Amorbach",address:"Adresse",phone:"Telefon",email:"E-Mail",hours:"Öffnungszeiten",hoursWeek:"Mo–Fr: 9:00–18:00 Uhr",hoursSat:"Sa: 10:00–13:00 Uhr",hoursWeekDays:"Mo–Fr",hoursWeekTime:"9:00 – 18:00 Uhr",hoursSatDay:"Sa",hoursSatTime:"10:00 – 13:00 Uhr",directionsTitle:"Anfahrt",mapEmbedName:"Die Google-Maps-Karte",mapOpenChip:"In Maps öffnen",routePlan:"Route planen",featurePremiumTitle:"Premium Klang",featurePremiumSub:"Höchste Qualität",featureGermanyTitle:"Made in Germany",featureGermanySub:"Präzise Handarbeit",featureIndividualTitle:"Individuell",featureIndividualSub:"Maßgeschneiderte Lösungen",featureExpertsTitle:"Experten Team",featureExpertsSub:"Leidenschaft & Know-how"},galleryOverview:{metaTitle:"Bildergalerie",metaDescription:"Einblicke in unsere Car-Hifi Umbauten – nach Marke sortiert. Wähle eine Marke und entdecke die Projekte.",title:"Bildergalerie",intro:"Wähle eine Marke und entdecke unsere Umbauten im Detail.",loading:"Lädt…",empty:"Es sind noch keine Galerie-Marken hinterlegt."},galleryBrandPage:{metaTitleFallback:"Bildergalerie",metaTitle:t=>`${t} Umbauten`,metaDescription:t=>`Einblicke in unsere ${t} Car-Hifi Umbauten.`,loading:"Lädt…",breadcrumbGallery:"Galerie",titleSuffix:"Projekt wählen",empty:"Für diese Marke sind noch keine Projekte hinterlegt."},galleryProjectPage:{metaTitleFallback:"Bildergalerie",metaDescription:t=>`Fotos unseres ${t} Umbaus.`,loading:"Lädt…",breadcrumbGallery:"Galerie",empty:"Für dieses Projekt sind noch keine Fotos hinterlegt.",enlargeImage:"Bild vergrößern"}},jD={nav:{openMenu:"Open menu",closeMenu:"Close menu",close:"Close",adminPanel:"Go to admin panel",vehicles:"Vehicles",services:"Services",gallery:"Gallery",contact:"Contact",whatsapp:"WhatsApp",shop:"Visit shop"},themeToggle:{label:"Toggle theme"},languageToggle:{label:"Select language"},footer:{routePlan:"Get directions",contactHeading:"Contact",contactForm:"Contact form",hoursHeading:"Opening hours",open:"Open",closed:"Closed",days:{monFri:"Monday – Friday",sat:"Saturday",sun:"Sunday"},copyright:t=>`© ${t} HifiPlanet. All information without guarantee.`,imprint:"Legal notice",privacy:"Privacy",terms:"Terms",cookieSettings:"Cookie settings"},cookieConsent:{bannerText:"We only use technically necessary cookies. For Google Maps, YouTube videos and analytics cookies we need your additional consent, since data is transferred to Google in that case.",moreInfo:"More details in our",privacyPolicy:"privacy policy",settings:"Settings",onlyNecessary:"Necessary only",acceptAll:"Accept all",modalTitle:"Cookie settings",modalIntro:"Choose which categories you want to allow. More details in our",necessaryTitle:"Necessary",necessaryDesc:"Required to operate the website (e.g. login session, theme and cookie preference). Cannot be disabled.",externalTitle:"External media",externalDesc:"Google Maps and YouTube videos. Loading them transfers data (including your IP address) to Google.",analyticsTitle:"Analytics",analyticsDesc:"Google Analytics helps us understand how the website is used. This transfers data to Google.",cancel:"Cancel",saveSelection:"Save selection"},maintenance:{title:"Under maintenance",defaultMessage:"This area is currently being updated. Please check back shortly."},lightbox:{close:"Close",previous:"Previous image",next:"Next image"},home:{metaTitle:"Custom Car-Hifi Installations",metaDescription:"HifiPlanet – your car-hifi specialist in Amorbach, Germany. Choose your make and model, discover matching sound packages and get in touch, no obligation.",stickyCta:"Ready for your sound upgrade?",selectVehicle:"Select vehicle",getInTouch:"Get in touch",welcome:"Welcome to HifiPlanet",heroTitle:"Home of pure Sound",heroSubtitle:"Your car-hifi specialist for custom sound installations. Choose your vehicle, discover the right package and get in touch, no obligation – we take care of the rest.",stats:[{value:"20+",label:"years of experience"},{value:"Huge",label:"in-house 3D print farm"},{value:"In-house",label:"CNC & laser workshop"},{value:"International",label:"recognized car-hifi specialist"}],brandsHeading:"Brands we work with",youtubeBadge:"HifiPlanet presents",youtubeTitle:"The craft behind your sound",youtubeText:"Discover the artistry behind our work",youtubeCta:"Watch now",heroImageAlt:"Ground Zero subwoofer and amplifiers with purple ambient lighting",craftImageAlt:"Custom subwoofer build",adviceImageAlt:"Amplifier installation with ambient lighting",moreImageAlt:"High-end amplifier and subwoofer, studio shot",craftEyebrow:"Craftsmanship",craftTitle:"Precision work in every detail",craftText:"Whether custom-built subwoofer enclosures, integrated lighting or invisibly routed cabling – our own CNC, laser and 3D-printing production means we can build solutions you simply can't buy off the shelf.",adviceEyebrow:"Consultation",adviceTitle:"From the first idea to the final touch",adviceText:"Every vehicle and every requirement is different. That's why we advise you personally and without obligation – from a subtle upgrade to an uncompromising high-end system.",insightsTitle:"A look at our installations",insightsText:"From subtle sound upgrades to elaborate full installations – handcrafted in our workshop in Amorbach.",galleryAlts:["Custom subwoofer build with Ground Zero bass drivers","Amplifier installation with purple ambient lighting","Tweeter and midrange installation by Focal Utopia","Sony navigation system with Apple CarPlay in the cockpit","Installed tweeter in the trunk","Custom subwoofer installation with LED lighting in the trunk"],reviewsRating:"Rated 5.0 by 181 customers",reviewsRatingDynamic:(t,e)=>`Rated ${t.toFixed(1)} by ${e} customers`,reviewsText:"Here's what our customers say about us.",reviewsLink:"See all reviews on Google →",testimonials:[{name:"Thomas K.",text:"Found this gem through YouTube. Advice and recommendations are top-notch – the Tesla demo car reignited my passion for great sound."},{name:"Andreas I.",text:"Very professional advice and service. Even though I switched from VAG to Mercedes, everything was adapted smoothly. The 3-way speakers and two subwoofers deliver outstanding performance."},{name:"Thomas F.",text:"The complete Audi A4 B9 build exceeded my expectations. Professional from start to finish, with flawless workmanship and sound quality."},{name:"Drago G.",text:"Impressed by the CNC work shown on YouTube. Started with 3D-printed speaker rings for my Ford Mustang – it turned into a much bigger project."},{name:"Leonardo B.",text:"Great service and masterful craftsmanship. Clean installation, passion visible in every detail."},{name:"Marcel S.",text:"Unbeatable value for money. The team took a lot of time to find the exact solution for my budget."},{name:"Julia W.",text:"Finally a shop that takes motorhomes seriously too. The sound system in our camper now sounds like a living room."},{name:"Kevin R.",text:"Dash cam and alarm system installed cleanly in a single appointment, no visible cables. Highly recommended for anyone who values quality workmanship."},{name:"Sabrina H.",text:"My classic car now has modern sound without compromising the original look. Exactly what I was looking for."},{name:"Niklas P.",text:"From the first inquiry to the finished build, everything went smoothly. Honest advice with no sales pressure."}],moreTitle:"More than just car-hifi",moreText:"Besides custom sound installations, we also offer CNC machining, laser technology, 3D printing and more – all from a single source in our own workshop.",moreCta:"Discover all our services",faqHeading:"Frequently asked questions"},vehicleSelect:{metaTitle:"Select your vehicle",metaDescription:"Choose your vehicle make and model and discover matching car-hifi sound packages from HifiPlanet.",title:"Select your vehicle",intro:"Choose your make first, then your model – we'll show you the matching sound packages right away.",empty:"No brands have been added yet."},brandPage:{metaTitleFallback:"Select a model",metaDescription:t=>`Choose your ${t} model and discover matching car-hifi sound packages from HifiPlanet.`,loading:"Loading…",breadcrumbVehicles:"Vehicles",titleSuffix:"Select a model",empty:"No models have been added for this brand yet."},modelPage:{metaTitleFallback:"Sound packages",metaTitle:(t,e)=>`${t} ${e} sound packages`,metaDescription:(t,e)=>`Car-hifi sound packages for the ${t} ${e} including current prices – get in touch with HifiPlanet, no obligation.`,loading:"Loading…",breadcrumbVehicles:"Vehicles",titleSuffix:"Sound packages",empty:"No packages have been added for this model yet.",totalPrice:"from approx.",productLoading:"Loading product…",requestContact:"Request contact",featuredBadge:"Recommended",moreBullets:t=>t===1?"+ 1 more feature":`+ ${t} more features`,lessBullets:"Show less",wheelHint:"Scroll to browse"},leistungen:{metaTitle:"Services",metaDescription:"Car-hifi, motorhomes & caravans, classic cars, CNC machining, laser technology, 3D printing, alarm systems and dash cams – all from a single source at HifiPlanet in Amorbach.",title:"Our services",intro:"From custom sound installations to our own CNC and 3D-printing production – all from a single source in our workshop in Amorbach.",notListedTitle:"Don't see your project?",notListedText:"Just get in touch – we'll find the right solution together.",contact:"Get in touch"},contactPage:{metaTitle:"Contact",metaDescription:"Get in touch with HifiPlanet in Amorbach for your custom car-hifi project – we're happy to advise you, no obligation.",title:"Get in touch",heroEyebrow:"Contact",heroTitlePre:"Talk",heroTitleAccent:"to",heroTitlePost:"us.",heroSubtitle:"Whether it's a system, installation, or sound tuning for your car — write to us, we'll get back to you as soon as possible.",packageBoxTitle:"Your inquiry relates to",formTitle:"Send inquiry",sentTitle:"Inquiry sent ✓",sentText:"Thanks! We'll get back to you within one business day.",contextIntro:"Your inquiry relates to:",contextBrand:"Brand",contextModel:"Model",contextPackage:"Package",contextProduct:"Product",packagePrice:"Package price",upgrades:"Upgrades",optionalUpgrades:"Optional upgrades",totalWithUpgrades:"Total incl. upgrades",nameLabel:"Name *",namePlaceholder:"Max Mustermann",emailLabel:"Email *",emailPlaceholder:"max@mail.de",phoneLabel:"Phone",phonePlaceholder:"Optional",vinLabel:"Vehicle identification number (VIN)",vinPlaceholder:"Optional – helps us assess your vehicle",messageLabel:"Message",messagePlaceholder:"Tell us about your project – vehicle, desired sound, budget …",requiredHint:"* Required fields",sending:"Sending…",submit:"Send inquiry",cardTitle:"HiFi Planet Amorbach",address:"Address",phone:"Phone",email:"Email",hours:"Opening hours",hoursWeek:"Mon–Fri: 9:00 AM–6:00 PM",hoursSat:"Sat: 10:00 AM–1:00 PM",hoursWeekDays:"Mon–Fri",hoursWeekTime:"9:00 AM – 6:00 PM",hoursSatDay:"Sat",hoursSatTime:"10:00 AM – 1:00 PM",directionsTitle:"Directions",mapEmbedName:"The Google Maps map",mapOpenChip:"Open in Maps",routePlan:"Get directions",featurePremiumTitle:"Premium Sound",featurePremiumSub:"Highest quality",featureGermanyTitle:"Made in Germany",featureGermanySub:"Precision craftsmanship",featureIndividualTitle:"Custom-built",featureIndividualSub:"Tailored solutions",featureExpertsTitle:"Expert Team",featureExpertsSub:"Passion & know-how"},galleryOverview:{metaTitle:"Photo gallery",metaDescription:"A look at our car-hifi installations – sorted by brand. Choose a brand and explore the projects.",title:"Photo gallery",intro:"Choose a brand and explore our installations in detail.",loading:"Loading…",empty:"No gallery brands have been added yet."},galleryBrandPage:{metaTitleFallback:"Photo gallery",metaTitle:t=>`${t} installations`,metaDescription:t=>`A look at our ${t} car-hifi installations.`,loading:"Loading…",breadcrumbGallery:"Gallery",titleSuffix:"Select a project",empty:"No projects have been added for this brand yet."},galleryProjectPage:{metaTitleFallback:"Photo gallery",metaDescription:t=>`Photos of our ${t} installation.`,loading:"Loading…",breadcrumbGallery:"Gallery",empty:"No photos have been added for this project yet.",enlargeImage:"Enlarge image"}},Rc={de:CD,en:jD};function ED(){const t=localStorage.getItem("hifi-lang");return t==="de"||t==="en"?t:(navigator.language||"de").toLowerCase().startsWith("de")?"de":"en"}function Kp(t,e){return e.split(".").reduce((n,r)=>n==null?void 0:n[r],t)}const nN=v.createContext({language:"de",setLanguage:()=>{},toggleLanguage:()=>{},t:t=>{const e=Kp(Rc.de,t);return e!==void 0?e:t}});function Fy({children:t}){const[e,n]=v.useState(ED);v.useEffect(()=>{document.documentElement.setAttribute("lang",e),localStorage.setItem("hifi-lang",e)},[e]);const r=()=>n(i=>i==="de"?"en":"de"),s=i=>{const o=Rc[e]||Rc.de,a=Kp(o,i);if(a!==void 0)return a;const l=Kp(Rc.de,i);return l!==void 0?l:i};return c.jsx(nN.Provider,{value:{language:e,setLanguage:n,toggleLanguage:r,t:s},children:t})}function at(){return v.useContext(nN)}function rN({overHero:t=!1}){const{theme:e,toggleTheme:n}=ND(),{t:r}=at();return c.jsx("button",{onClick:n,"aria-label":r("themeToggle.label"),className:`rounded-full p-2 transition ${t?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:e==="dark"?c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:c.jsx("path",{d:"M12 3a1 1 0 011 1v1a1 1 0 11-2 0V4a1 1 0 011-1zm0 15a5 5 0 100-10 5 5 0 000 10zm9-6a1 1 0 010 2h-1a1 1 0 110-2h1zM4 12a1 1 0 010 2H3a1 1 0 110-2h1zm14.36-7.36a1 1 0 011.42 1.42l-.71.7a1 1 0 11-1.41-1.4l.7-.72zM5.64 18.36a1 1 0 011.41 1.41l-.7.71a1 1 0 11-1.42-1.41l.71-.71zm12.72 0l.71.7a1 1 0 11-1.41 1.42l-.71-.71a1 1 0 011.41-1.41zM6.34 5.64l-.7-.7A1 1 0 117.05 3.5l.7.71A1 1 0 016.34 5.64zM12 6a1 1 0 011-1v0a1 1 0 01-1 1zm0 12a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1z"})}):c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:c.jsx("path",{fillRule:"evenodd",d:"M9.53 2.25a.75.75 0 01.19.82 8.25 8.25 0 0011.03 11.03.75.75 0 011.01.99A10.5 10.5 0 1112.9 2.1a.75.75 0 011.63-.85z",clipRule:"evenodd"})})})}function Mt({name:t,className:e="h-6 w-6",...n}){return t?c.jsx($2,{name:t,className:e,...n}):null}const sN=v.createContext(null);function TD({children:t}){const[e,n]=v.useState(null),[r,s]=v.useState(!0);v.useEffect(()=>{A.get("/auth/me").then(d=>n(d.authenticated===!1?null:d)).catch(()=>n(null)).finally(()=>s(!1))},[]);const i=async(d,h)=>{const f=await A.post("/auth/login",{username:d,password:h});return f.requires_2fa?{requires2fa:!0}:(n(f),{requires2fa:!1})},o=async d=>{const h=await A.post("/auth/verify-2fa",{code:d});n(h)},a=async()=>{await A.post("/auth/logout",{}),n(null)},l=async()=>{const d=await A.get("/auth/me");n(d.authenticated===!1?null:d)},u=d=>{var h;return!!e&&(e.is_super_admin||((h=e.permissions)==null?void 0:h.includes(d)))};return c.jsx(sN.Provider,{value:{user:e,loading:r,login:i,verifyTwoFactor:o,logout:a,refreshUser:l,hasPermission:u},children:t})}function Cn(){return v.useContext(sN)}const iN=v.createContext({phone:"09373 20 62 390",whatsapp:null,contact_email:"info@hifi-planet-amorbach.de",address_street:"Boxbrunner Str. 20a",address_zip:"63916",address_city:"Amorbach",logo_path:null,logo_dark_path:null,business_hours:null,hero_image_path:null,ga_measurement_id:null,gallery_card_text_x:0,gallery_card_text_y:100}),MD=iN.Provider;function rs(){return v.useContext(iN)}const Ka="/assets/logo-BNfZDkmN.png",Su="/assets/logo-dark-R-ckaBhx.png",PD="https://www.audio4cars.de/",Vy=t=>(t||"").replace(/[^\d+]/g,""),$y=70,AD=500;function DD({className:t}){return c.jsxs("svg",{viewBox:"0 0 3 2",className:t,"aria-hidden":"true",children:[c.jsx("rect",{width:"3",height:"0.667",y:"0",fill:"#000"}),c.jsx("rect",{width:"3",height:"0.667",y:"0.667",fill:"#D00"}),c.jsx("rect",{width:"3",height:"0.666",y:"1.334",fill:"#FFCE00"})]})}function LD({className:t}){return c.jsxs("svg",{viewBox:"0 0 60 30",className:t,"aria-hidden":"true",children:[c.jsx("clipPath",{id:"fgb-t",children:c.jsx("path",{d:"M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"})}),c.jsx("path",{d:"M0,0 v30 h60 v-30 z",fill:"#00247d"}),c.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#fff",strokeWidth:"6"}),c.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",clipPath:"url(#fgb-t)",stroke:"#cf142b",strokeWidth:"4"}),c.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#fff",strokeWidth:"10"}),c.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#cf142b",strokeWidth:"6"})]})}const Gh=[{code:"de",label:"Deutsch",Flag:DD},{code:"en",label:"English",Flag:LD}];function RD({overHero:t=!1}){const{language:e,setLanguage:n,t:r}=at(),[s,i]=v.useState(!1),o=v.useRef(null),a=Gh.find(l=>l.code===e)||Gh[0];return v.useEffect(()=>{if(!s)return;const l=d=>{o.current&&!o.current.contains(d.target)&&i(!1)},u=d=>{d.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",l),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",u)}},[s]),c.jsxs("div",{className:"relative",ref:o,children:[c.jsxs("button",{type:"button",onClick:()=>i(l=>!l),"aria-haspopup":"listbox","aria-expanded":s,"aria-label":r("languageToggle.label"),className:`flex items-center gap-1 rounded-full p-1.5 transition ${t?"hover:bg-white/10":"hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[c.jsx("span",{className:`block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ${t?"ring-white/50":"ring-neutral-300 dark:ring-neutral-600"}`,children:c.jsx(a.Flag,{className:"h-full w-full"})}),c.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:`h-3 w-3 transition-transform ${t?"text-white/70":"text-neutral-400"} ${s?"rotate-180":""}`,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"})})]}),s&&c.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-2 min-w-[9rem] overflow-hidden rounded-lg border border-neutral-200 bg-white py-1 shadow-lg dark:border-neutral-700 dark:bg-neutral-900",children:Gh.map(l=>c.jsxs("button",{type:"button",role:"option","aria-selected":l.code===e,onClick:()=>{n(l.code),i(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition hover:bg-neutral-100 dark:hover:bg-neutral-800 ${l.code===e?"font-semibold text-brand-600 dark:text-brand-400":"text-neutral-700 dark:text-neutral-200"}`,children:[c.jsx("span",{className:"block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ring-neutral-300 dark:ring-neutral-600",children:c.jsx(l.Flag,{className:"h-full w-full"})}),l.label]},l.code))})]})}function _D(){const[t,e]=v.useState(!1),[n,r]=v.useState(!1),[s,i]=v.useState(!1),{user:o}=Cn(),{phone:a,whatsapp:l,logo_path:u,logo_dark_path:d}=rs(),{t:h}=at(),f=l?8:7,m=ln().pathname==="/",[g,y]=v.useState(!m);v.useEffect(()=>{if(!m){y(!0);return}const C=()=>y(window.scrollY>24);return C(),window.addEventListener("scroll",C,{passive:!0}),()=>window.removeEventListener("scroll",C)},[m]);const b=m&&!g;v.useEffect(()=>{if(t){r(!0);let S;const N=requestAnimationFrame(()=>{S=requestAnimationFrame(()=>i(!0))});return()=>{cancelAnimationFrame(N),S&&cancelAnimationFrame(S)}}i(!1);const C=AD+(f-1)*$y,E=setTimeout(()=>r(!1),C);return()=>clearTimeout(E)},[t,f]);const x=()=>`transition-all duration-500 ease-out ${s?"opacity-100":"opacity-0"}`,k=C=>({transitionDelay:`${(s?C:f-1-C)*$y}ms`,transform:s?"translateY(0)":"translateY(-140px)"}),w=o&&c.jsx(ee,{to:"/admin","aria-label":h("nav.adminPanel"),title:h("nav.adminPanel"),className:`rounded-full p-2 transition ${b?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:c.jsx(Mt,{name:"layout-dashboard",className:"h-5 w-5"})});return c.jsxs("header",{className:`sticky top-0 z-30 border-b transition-colors duration-300 ${b?"border-transparent bg-transparent":"border-neutral-200 bg-white/90 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/90"}`,children:[c.jsxs("div",{className:"mx-auto grid max-w-6xl grid-cols-[1fr_auto_1fr] items-center gap-3 px-4 py-3 sm:px-6",children:[c.jsx("div",{className:"flex items-center justify-self-start",children:c.jsx("button",{onClick:()=>e(!0),"aria-label":h("nav.openMenu"),className:`rounded-md p-2 transition ${b?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})}),c.jsxs(ee,{to:"/",className:"flex items-center justify-self-center rounded-lg px-2 py-1",children:[c.jsx("img",{src:u||Ka,alt:"HifiPlanet",className:"h-14 w-auto dark:hidden sm:h-16"}),c.jsx("img",{src:d||Su,alt:"HifiPlanet",className:"hidden h-14 w-auto dark:block sm:h-16"})]}),c.jsxs("div",{className:"flex items-center justify-self-end gap-1",children:[w,!t&&c.jsx(RD,{overHero:b}),c.jsx(rN,{overHero:b})]})]}),n&&$d.createPortal(c.jsx("div",{className:"fixed inset-0 z-[100] overflow-y-auto text-left backdrop-blur-xl",style:{background:"linear-gradient(135deg, rgba(241,245,249,0.55) 0%, rgba(227,240,207,0.55) 50%, rgba(248,250,252,0.55) 100%)"},children:c.jsxs("div",{className:"relative mx-auto flex min-h-full max-w-6xl flex-col items-start justify-center gap-5 py-24 pl-6 pr-8 sm:pl-8",children:[c.jsxs("button",{onClick:()=>e(!1),"aria-label":h("nav.closeMenu"),className:"absolute left-6 top-8 flex items-center gap-2 text-neutral-600 hover:text-brand-600 sm:left-8 sm:top-[65px]",children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})}),c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:h("nav.close")})]}),c.jsx(ee,{to:"/fahrzeuge",onClick:()=>e(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${x()}`,style:k(0),children:h("nav.vehicles")}),c.jsx(ee,{to:"/leistungen",onClick:()=>e(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${x()}`,style:k(1),children:h("nav.services")}),c.jsx(ee,{to:"/galerie",onClick:()=>e(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${x()}`,style:k(2),children:h("nav.gallery")}),c.jsx(ee,{to:"/kontakt",onClick:()=>e(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${x()}`,style:k(3),children:h("nav.contact")}),c.jsx("div",{className:`h-px w-16 bg-brand-500/60 ${x()}`,style:k(4)}),a&&c.jsxs("a",{href:`tel:${Vy(a)}`,className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${x()}`,style:k(5),children:[c.jsx(Mt,{name:"phone",className:"h-4 w-4"}),a]}),l&&c.jsxs("a",{href:`https://wa.me/${Vy(l).replace(/^0/,"49").replace("+","")}`,target:"_blank",rel:"noopener noreferrer",className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${x()}`,style:k(6),children:[c.jsx(Mt,{name:"message-circle",className:"h-4 w-4"}),h("nav.whatsapp")]}),c.jsxs("a",{href:PD,target:"_blank",rel:"noopener noreferrer",className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${x()}`,style:k(l?7:6),children:[c.jsx(Mt,{name:"shopping-bag",className:"h-4 w-4"}),h("nav.shop")]})]})}),document.body)]})}const Hy="hifiplanet-cookie-consent",oN={necessary:!0,external:!1,analytics:!1},aN=v.createContext({consent:oN,decided:!1,settingsOpen:!1,acceptAll:()=>{},rejectNonEssential:()=>{},saveCustom:()=>{},openSettings:()=>{},closeSettings:()=>{}});function ID({children:t}){const[e,n]=v.useState(oN),[r,s]=v.useState(!1),[i,o]=v.useState(!1);v.useEffect(()=>{try{const p=localStorage.getItem(Hy);if(p){const m=JSON.parse(p);n({necessary:!0,external:!!m.external,analytics:!!m.analytics}),s(!0)}}catch{}},[]);const a=v.useCallback(p=>{n(p),s(!0),o(!1),localStorage.setItem(Hy,JSON.stringify({...p,decidedAt:new Date().toISOString()}))},[]),l=v.useCallback(()=>a({necessary:!0,external:!0,analytics:!0}),[a]),u=v.useCallback(()=>a({necessary:!0,external:!1,analytics:!1}),[a]),d=v.useCallback(p=>a({necessary:!0,external:!!p.external,analytics:!!p.analytics}),[a]),h=v.useCallback(()=>o(!0),[]),f=v.useCallback(()=>o(!1),[]);return c.jsx(aN.Provider,{value:{consent:e,decided:r,settingsOpen:i,acceptAll:l,rejectNonEssential:u,saveCustom:d,openSettings:h,closeSettings:f},children:t})}function go(){return v.useContext(aN)}const OD=["mon","tue","wed","thu","fri","sat","sun"],BD=["sun","mon","tue","wed","thu","fri","sat"],qh={mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",sun:"So"};function zD(t){const e=new Date,n=t==null?void 0:t[BD[e.getDay()]];if(!n||n.closed||!n.open||!n.close)return!1;const r=e.getHours()*60+e.getMinutes(),[s,i]=n.open.split(":").map(Number),[o,a]=n.close.split(":").map(Number);return r>=s*60+i&&r{const s=FD(t==null?void 0:t[r])||e,i=n[n.length-1];i&&i.label===s?i.days=`${i.firstLabel}-${qh[r]}`:n.push({key:r,days:qh[r],firstLabel:qh[r],label:s})}),n}const VD=t=>(t||"").replace(/[^\d+]/g,"");function $D(){const{phone:t,contact_email:e,address_street:n,address_zip:r,address_city:s,business_hours:i}=rs(),o=zD(i),{openSettings:a}=go(),{pathname:l}=ln(),u=l==="/",{t:d}=at(),h=[n,[r,s].filter(Boolean).join(" ")].filter(Boolean).join(", "),f=`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(h)}`,p=lN(i,d("footer.closed"));return c.jsxs("footer",{className:`border-t border-neutral-200 bg-neutral-50 py-10 text-sm text-neutral-600 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-300 ${u?"pb-24":""}`,children:[c.jsxs("div",{className:"mx-auto grid max-w-6xl gap-4 px-4 sm:grid-cols-3 sm:px-6",children:[c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(Mt,{name:"map-pin",className:"h-4 w-4 text-brand-500"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:"HifiPlanet"})]}),n&&c.jsx("p",{children:n}),(r||s)&&c.jsx("p",{children:[r,s].filter(Boolean).join(" ")}),c.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"mt-4 flex items-center justify-center gap-1.5 rounded-md bg-brand-500 px-3 py-2 text-xs font-semibold text-white hover:bg-brand-600",children:[c.jsx(Mt,{name:"navigation",className:"h-3.5 w-3.5"}),d("footer.routePlan")]})]}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(Mt,{name:"phone",className:"h-4 w-4 text-brand-500"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:d("footer.contactHeading")})]}),c.jsx("p",{children:c.jsx("a",{href:`tel:${VD(t)}`,className:"inline-block py-1 hover:text-brand-500",children:t})}),c.jsx("p",{children:c.jsx("a",{href:`mailto:${e}`,className:"inline-block py-1 hover:text-brand-500",children:e})}),c.jsx(ee,{to:"/kontakt",className:"mt-4 flex items-center justify-center gap-1.5 rounded-md border border-neutral-300 px-3 py-2 text-xs font-semibold text-neutral-700 hover:border-brand-500 hover:text-brand-600 dark:border-neutral-700 dark:text-neutral-200",children:d("footer.contactForm")})]}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Mt,{name:"clock",className:"h-4 w-4 text-brand-500"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:d("footer.hoursHeading")})]}),c.jsxs("span",{className:`flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-semibold ${o?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400"}`,children:[c.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${o?"bg-green-500":"bg-neutral-400"}`}),d(o?"footer.open":"footer.closed")]})]}),c.jsx("dl",{className:"space-y-1.5",children:p.map(m=>c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:m.days}),c.jsx("dd",{className:"font-medium text-neutral-700 dark:text-neutral-200",children:m.label})]},m.key))})]})]}),c.jsx("div",{className:"mx-auto mt-8 max-w-6xl border-t border-neutral-200 px-4 pt-6 text-center text-xs text-neutral-500 dark:border-neutral-800 dark:text-neutral-400 sm:px-6",children:c.jsxs("p",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[c.jsx("span",{children:d("footer.copyright")(new Date().getFullYear())}),c.jsx("span",{children:"·"}),c.jsx(ee,{to:"/impressum",className:"hover:text-brand-500",children:d("footer.imprint")}),c.jsx("span",{children:"·"}),c.jsx(ee,{to:"/datenschutz",className:"hover:text-brand-500",children:d("footer.privacy")}),c.jsx("span",{children:"·"}),c.jsx(ee,{to:"/agb",className:"hover:text-brand-500",children:d("footer.terms")}),c.jsx("span",{children:"·"}),c.jsx("button",{type:"button",onClick:a,className:"hover:text-brand-500",children:d("footer.cookieSettings")})]})})]})}const s0=v.createContext({});function Yr(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const HD=typeof window<"u",ml=HD?v.useLayoutEffect:v.useEffect,Gd=v.createContext(null);function i0(t,e){t.indexOf(e)===-1&&t.push(e)}function Nu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Nn=(t,e,n)=>n>e?e:n{};const Xr={},cN=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),uN=t=>typeof t=="object"&&t!==null,dN=t=>/^0[^.\s]+$/u.test(t);function hN(t){let e;return()=>(e===void 0&&(e=t()),e)}const Lt=t=>t,gl=(...t)=>t.reduce((e,n)=>r=>n(e(r))),qi=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class a0{constructor(){this.subscriptions=[]}add(e){return i0(this.subscriptions,e),()=>Nu(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;it*1e3,en=t=>t/1e3,l0=(t,e)=>e?t*(1e3/e):0,fN=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,WD=1e-7,UD=12;function KD(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=fN(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>WD&&++aKD(i,0,1,t,n);return i=>i===0||i===1?i:fN(s(i),e,r)}const pN=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,mN=t=>e=>1-t(1-e),gN=xl(.33,1.53,.69,.99),c0=mN(gN),xN=pN(c0),yN=t=>t>=1?1:(t*=2)<1?.5*c0(t):.5*(2-Math.pow(2,-10*(t-1))),u0=t=>1-Math.sin(Math.acos(t)),bN=mN(u0),vN=pN(u0),GD=xl(.42,0,1,1),qD=xl(0,0,.58,1),kN=xl(.42,0,.58,1),JD=t=>Array.isArray(t)&&typeof t[0]!="number",wN=t=>Array.isArray(t)&&typeof t[0]=="number",YD={linear:Lt,easeIn:GD,easeInOut:kN,easeOut:qD,circIn:u0,circInOut:vN,circOut:bN,backIn:c0,backInOut:xN,backOut:gN,anticipate:yN},XD=t=>typeof t=="string",Wy=t=>{if(wN(t)){o0(t.length===4);const[e,n,r,s]=t;return xl(e,n,r,s)}else if(XD(t))return YD[t];return t},Jl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function ZD(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){i.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,d=!1,h=!1)=>{const p=h&&r?e:n;return d&&i.add(u),p.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(o=u,r){s=!0;return}r=!0;const d=e;e=n,n=d,e.forEach(a),e.clear(),r=!1,s&&(s=!1,l.process(u))}};return l}const QD=40;function SN(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Jl.reduce((k,w)=>(k[w]=ZD(i),k),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:d,update:h,preRender:f,render:p,postRender:m}=o,g=()=>{const k=Xr.useManualTiming,w=k?s.timestamp:performance.now();n=!1,k||(s.delta=r?1e3/60:Math.max(Math.min(w-s.timestamp,QD),1)),s.timestamp=w,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),d.process(s),h.process(s),f.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(g))},y=()=>{n=!0,r=!0,s.isProcessing||t(g)};return{schedule:Jl.reduce((k,w)=>{const C=o[w];return k[w]=(E,S=!1,N=!1)=>(n||y(),C.schedule(E,S,N)),k},{}),cancel:k=>{for(let w=0;w(_c===void 0&&yt.set(Ge.isProcessing||Xr.useManualTiming?Ge.timestamp:performance.now()),_c),set:t=>{_c=t,queueMicrotask(e3)}},NN=t=>e=>typeof e=="string"&&e.startsWith(t),CN=NN("--"),t3=NN("var(--"),d0=t=>t3(t)?n3.test(t.split("/*")[0].trim()):!1,n3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Uy(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const xo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ga={...xo,transform:t=>Nn(0,1,t)},Yl={...xo,default:1},oa=t=>Math.round(t*1e5)/1e5,h0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function r3(t){return t==null}const s3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,f0=(t,e)=>n=>!!(typeof n=="string"&&s3.test(n)&&n.startsWith(t)||e&&!r3(n)&&Object.prototype.hasOwnProperty.call(n,e)),jN=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(h0);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},i3=t=>Nn(0,255,t),Yh={...xo,transform:t=>Math.round(i3(t))},Ns={test:f0("rgb","red"),parse:jN("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Yh.transform(t)+", "+Yh.transform(e)+", "+Yh.transform(n)+", "+oa(Ga.transform(r))+")"};function o3(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Gp={test:f0("#"),parse:o3,transform:Ns.transform},yl=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Wn=yl("deg"),In=yl("%"),G=yl("px"),a3=yl("vh"),l3=yl("vw"),Ky={...In,parse:t=>In.parse(t)/100,transform:t=>In.transform(t*100)},Ti={test:f0("hsl","hue"),parse:jN("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+In.transform(oa(e))+", "+In.transform(oa(n))+", "+oa(Ga.transform(r))+")"},Ie={test:t=>Ns.test(t)||Gp.test(t)||Ti.test(t),parse:t=>Ns.test(t)?Ns.parse(t):Ti.test(t)?Ti.parse(t):Gp.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ns.transform(t):Ti.transform(t),getAnimatableNone:t=>{const e=Ie.parse(t);return e.alpha=0,Ie.transform(e)}},c3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function u3(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(h0))==null?void 0:e.length)||0)+(((n=t.match(c3))==null?void 0:n.length)||0)>0}const EN="number",TN="color",d3="var",h3="var(",Gy="${}",f3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ji(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(f3,l=>(Ie.test(l)?(r.color.push(i),s.push(TN),n.push(Ie.parse(l))):l.startsWith(h3)?(r.var.push(i),s.push(d3),n.push(l)):(r.number.push(i),s.push(EN),n.push(parseFloat(l))),++i,Gy)).split(Gy);return{values:n,split:a,indexes:r,types:s}}function p3(t){return Ji(t).values}function MN({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;itypeof t=="number"?0:Ie.test(t)?Ie.getAnimatableNone(t):t,x3=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:g3(t);function y3(t){const e=Ji(t);return MN(e)(e.values.map((r,s)=>x3(r,e.split[s])))}const kn={test:u3,parse:p3,createTransformer:m3,getAnimatableNone:y3};function Xh(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function b3({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=Xh(l,a,t+1/3),i=Xh(l,a,t),o=Xh(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Cu(t,e){return n=>n>0?e:t}const pe=(t,e,n)=>t+(e-t)*n,Zh=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},v3=[Gp,Ns,Ti],k3=t=>v3.find(e=>e.test(t));function qy(t){const e=k3(t);if(!e)return!1;let n=e.parse(t);return e===Ti&&(n=b3(n)),n}const Jy=(t,e)=>{const n=qy(t),r=qy(e);if(!n||!r)return Cu(t,e);const s={...n};return i=>(s.red=Zh(n.red,r.red,i),s.green=Zh(n.green,r.green,i),s.blue=Zh(n.blue,r.blue,i),s.alpha=pe(n.alpha,r.alpha,i),Ns.transform(s))},qp=new Set(["none","hidden"]);function w3(t,e){return qp.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function S3(t,e){return n=>pe(t,e,n)}function p0(t){return typeof t=="number"?S3:typeof t=="string"?d0(t)?Cu:Ie.test(t)?Jy:j3:Array.isArray(t)?PN:typeof t=="object"?Ie.test(t)?Jy:N3:Cu}function PN(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>p0(i)(i,e[o]));return i=>{for(let o=0;o{for(const i in r)n[i]=r[i](s);return n}}function C3(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=kn.createTransformer(e),r=Ji(t),s=Ji(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?qp.has(t)&&!s.values.length||qp.has(e)&&!r.values.length?w3(t,e):gl(PN(C3(r,s),s.values),n):Cu(t,e)};function AN(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?pe(t,e,n):p0(t)(t,e)}const E3=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ae.update(e,n),stop:()=>an(e),now:()=>Ge.isProcessing?Ge.timestamp:yt.now()}},DN=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i=ju?1/0:e}function T3(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(m0(r),ju);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:en(s)}}const Ae={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Jp(t,e){return t*Math.sqrt(1-e*e)}const M3=12;function P3(t,e,n){let r=n;for(let s=1;s{const d=u*o,h=d*t,f=d-n,p=Jp(u,o),m=Math.exp(-h);return Qh-f/p*m},i=u=>{const h=u*o*t,f=h*n+n,p=Math.pow(o,2)*Math.pow(u,2)*t,m=Math.exp(-h),g=Jp(Math.pow(u,2),o);return(-s(u)+Qh>0?-1:1)*((f-p)*m)/g}):(s=u=>{const d=Math.exp(-u*t),h=(u-n)*t+1;return-Qh+d*h},i=u=>{const d=Math.exp(-u*t),h=(n-u)*(t*t);return d*h});const a=5/t,l=P3(s,i,a);if(t=zt(t),isNaN(l))return{stiffness:Ae.stiffness,damping:Ae.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const D3=["duration","bounce"],L3=["stiffness","damping","mass"];function Yy(t,e){return e.some(n=>t[n]!==void 0)}function R3(t){let e={velocity:Ae.velocity,stiffness:Ae.stiffness,damping:Ae.damping,mass:Ae.mass,isResolvedFromDuration:!1,...t};if(!Yy(t,L3)&&Yy(t,D3))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Nn(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Ae.mass,stiffness:s,damping:i}}else{const n=A3({...t,velocity:0});e={...e,...n,mass:Ae.mass},e.isResolvedFromDuration=!0}return e}function Eu(t=Ae.visualDuration,e=Ae.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:p}=R3({...n,velocity:-en(n.velocity||0)}),m=f||0,g=u/(2*Math.sqrt(l*d)),y=o-i,b=en(Math.sqrt(l/d)),x=Math.abs(y)<5;r||(r=x?Ae.restSpeed.granular:Ae.restSpeed.default),s||(s=x?Ae.restDelta.granular:Ae.restDelta.default);let k,w,C,E,S,N;if(g<1)C=Jp(b,g),E=(m+g*b*y)/C,k=j=>{const T=Math.exp(-g*b*j);return o-T*(E*Math.sin(C*j)+y*Math.cos(C*j))},S=g*b*E+y*C,N=g*b*y-E*C,w=j=>Math.exp(-g*b*j)*(S*Math.sin(C*j)+N*Math.cos(C*j));else if(g===1){k=T=>o-Math.exp(-b*T)*(y+(m+b*y)*T);const j=m+b*y;w=T=>Math.exp(-b*T)*(b*j*T-m)}else{const j=b*Math.sqrt(g*g-1);k=L=>{const W=Math.exp(-g*b*L),B=Math.min(j*L,300);return o-W*((m+g*b*y)*Math.sinh(B)+j*y*Math.cosh(B))/j};const T=(m+g*b*y)/j,R=g*b*T-y*j,$=g*b*y-T*j;w=L=>{const W=Math.exp(-g*b*L),B=Math.min(j*L,300);return W*(R*Math.sinh(B)+$*Math.cosh(B))}}const M={calculatedDuration:p&&h||null,velocity:j=>zt(w(j)),next:j=>{if(!p&&g<1){const R=Math.exp(-g*b*j),$=Math.sin(C*j),L=Math.cos(C*j),W=o-R*(E*$+y*L),B=zt(R*(S*$+N*L));return a.done=Math.abs(B)<=r&&Math.abs(o-W)<=s,a.value=a.done?o:W,a}const T=k(j);if(p)a.done=j>=h;else{const R=zt(w(j));a.done=Math.abs(R)<=r&&Math.abs(o-T)<=s}return a.value=a.done?o:T,a},toString:()=>{const j=Math.min(m0(M),ju),T=DN(R=>M.next(j*R).value,j,30);return j+"ms "+T},toTransition:()=>{}};return M}Eu.applyToOptions=t=>{const e=T3(t,100,Eu);return t.ease=e.ease,t.duration=zt(e.duration),t.type="keyframes",t};const _3=5;function LN(t,e,n){const r=Math.max(e-_3,0);return l0(n-t(r),e-r)}function Yp({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const h=t[0],f={done:!1,value:h},p=N=>a!==void 0&&Nl,m=N=>a===void 0?l:l===void 0||Math.abs(a-N)-g*Math.exp(-N/r),k=N=>b+x(N),w=N=>{const M=x(N),j=k(N);f.done=Math.abs(M)<=u,f.value=f.done?b:j};let C,E;const S=N=>{p(f.value)&&(C=N,E=Eu({keyframes:[f.value,m(f.value)],velocity:LN(k,N,f.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return S(0),{calculatedDuration:null,next:N=>{let M=!1;return!E&&C===void 0&&(M=!0,w(N),S(N)),C!==void 0&&N>=C?E.next(N-C):(!M&&w(N),f)}}}function I3(t,e,n){const r=[],s=n||Xr.mix||AN,i=t.length-1;for(let o=0;oe[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=I3(e,r,s),l=a.length,u=d=>{if(o&&d1)for(;hu(Nn(t[0],t[i-1],d)):u}function O3(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=qi(0,e,r);t.push(pe(n,1,s))}}function RN(t){const e=[0];return O3(e,t.length-1),e}function B3(t,e){return t.map(n=>n*e)}function z3(t,e){return t.map(()=>e||kN).splice(0,t.length-1)}function aa({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=JD(r)?r.map(Wy):Wy(r),i={done:!1,value:e[0]},o=B3(n&&n.length===e.length?n:RN(e),t),a=g0(o,e,{ease:Array.isArray(s)?s:z3(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const F3=t=>t!==null;function qd(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(F3),a=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const V3={decay:Yp,inertia:Yp,tween:aa,keyframes:aa,spring:Eu};function _N(t){typeof t.type=="string"&&(t.type=V3[t.type])}class x0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const $3=t=>t/100;class qa extends x0{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==yt.now()&&this.tick(yt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;_N(e);const{type:n=aa,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const l=n||aa;l!==aa&&typeof a[0]!="number"&&(this.mixKeyframes=gl($3,AN(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=m0(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:f,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let k=this.currentTime,w=r;if(h){const N=Math.min(this.currentTime,s)/a;let M=Math.floor(N),j=N%1;!j&&N>=1&&(j=1),j===1&&M--,M=Math.min(M,h+1),!!(M%2)&&(f==="reverse"?(j=1-j,p&&(j-=p/a)):f==="mirror"&&(w=o)),k=Nn(0,1,j)*a}let C;x?(this.delayState.value=d[0],C=this.delayState):C=w.next(k),i&&!x&&(C.value=i(C.value));let{done:E}=C;!x&&l!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return S&&m!==Yp&&(C.value=qd(d,this.options,y,this.speed)),g&&g(C.value),S&&this.finish(),C}then(e,n){return this.finished.then(e,n)}get duration(){return en(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+en(e)}get time(){return en(this.currentTime)}set time(e){e=zt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return LN(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(yt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=en(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=E3,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(yt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function H3(t){for(let e=1;et*180/Math.PI,Xp=t=>{const e=Cs(Math.atan2(t[1],t[0]));return Zp(e)},W3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Xp,rotateZ:Xp,skewX:t=>Cs(Math.atan(t[1])),skewY:t=>Cs(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Zp=t=>(t=t%360,t<0&&(t+=360),t),Xy=Xp,Zy=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Qy=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),U3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Zy,scaleY:Qy,scale:t=>(Zy(t)+Qy(t))/2,rotateX:t=>Zp(Cs(Math.atan2(t[6],t[5]))),rotateY:t=>Zp(Cs(Math.atan2(-t[2],t[0]))),rotateZ:Xy,rotate:Xy,skewX:t=>Cs(Math.atan(t[4])),skewY:t=>Cs(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Qp(t){return t.includes("scale")?1:0}function em(t,e){if(!t||t==="none")return Qp(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=U3,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=W3,s=a}if(!s)return Qp(e);const i=r[e],o=s[1].split(",").map(G3);return typeof i=="function"?i(o):o[i]}const K3=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return em(n,e)};function G3(t){return parseFloat(t.trim())}const yo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bo=new Set([...yo,"pathRotation"]),eb=t=>t===xo||t===G,q3=new Set(["x","y","z"]),J3=yo.filter(t=>!q3.has(t));function Y3(t){const e=[];return J3.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Mr={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>em(e,"x"),y:(t,{transform:e})=>em(e,"y")};Mr.translateX=Mr.x;Mr.translateY=Mr.y;const Rs=new Set;let tm=!1,nm=!1,rm=!1;function IN(){if(nm){const t=Array.from(Rs).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=Y3(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}nm=!1,tm=!1,Rs.forEach(t=>t.complete(rm)),Rs.clear()}function ON(){Rs.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(nm=!0)})}function X3(){rm=!0,ON(),IN(),rm=!1}class y0{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Rs.add(this),tm||(tm=!0,ae.read(ON),ae.resolveKeyframes(IN))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}H3(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Rs.delete(this)}cancel(){this.state==="scheduled"&&(Rs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Z3=t=>t.startsWith("--");function BN(t,e,n){Z3(e)?t.style.setProperty(e,n):t.style[e]=n}const Q3={};function b0(t,e){const n=hN(t);return()=>Q3[e]??n()}const v0=b0(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),zN=b0(()=>window.ViewTimeline!==void 0,"viewTimeline"),FN=b0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wo=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,tb={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wo([0,.65,.55,1]),circOut:Wo([.55,0,1,.45]),backIn:Wo([.31,.01,.66,-.59]),backOut:Wo([.33,1.53,.69,.99])};function VN(t,e){if(t)return typeof t=="function"?FN()?DN(t,e):"ease-out":wN(t)?Wo(t):Array.isArray(t)?t.map(n=>VN(n,e)||tb.easeOut):tb[t]}function e4(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const h=VN(a,s);Array.isArray(h)&&(d.easing=h);const f={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(d,f)}function $N(t){return typeof t=="function"&&"applyToOptions"in t}function t4({type:t,...e}){return $N(t)&&FN()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class HN extends x0{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,o0(typeof e.type!="string");const u=t4(e);this.animation=e4(n,r,s,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=qd(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),BN(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return en(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+en(e)}get time(){return en(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=zt(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&v0()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Lt):s(this)}}const WN={anticipate:yN,backInOut:xN,circInOut:vN};function n4(t){return t in WN}function r4(t){typeof t.ease=="string"&&n4(t.ease)&&(t.ease=WN[t.ease])}const ef=10;class s4 extends HN{constructor(e){r4(e),_N(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new qa({...o,autoplay:!1}),l=Math.max(ef,yt.now()-this.startTime),u=Nn(0,ef,l-ef),d=a.sample(l).value,{name:h}=this.options;i&&h&&BN(i,h,d),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,d,u),a.stop()}}const nb=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(kn.test(t)||t==="0")&&!t.startsWith("url("));function i4(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function d4(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=t;if(!(((h=e==null?void 0:e.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return u4()&&n&&(UN.has(n)||c4.has(n)&&l4(a))&&(n!=="transform"||!d)&&!u&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const h4=40;class f4 extends x0{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:d,...h}){var m;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=yt.now();const f={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:u,element:d,...h},p=(d==null?void 0:d.KeyframeResolver)||y0;this.keyframeResolver=new p(a,(g,y,b)=>this.onKeyframesResolved(g,y,f,!b),l,u,d),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=yt.now();let h=!0;o4(e,i,o,a)||(h=!1,(Xr.instantAnimations||!l)&&(d==null||d(qd(e,r,n))),e[0]=e[e.length-1],sm(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>h4?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},m=h&&!u&&d4(p),g=(x=(b=p.motionValue)==null?void 0:b.owner)==null?void 0:x.current;let y;if(m)try{y=new s4({...p,element:g})}catch{y=new qa(p)}else y=new qa(p);y.finished.then(()=>{this.notifyFinished()}).catch(Lt),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),X3()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function KN(t,e,n,r=0,s=1){const i=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const rb=30,p4=t=>!isNaN(parseFloat(t)),la={current:void 0};class m4{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=yt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=yt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=p4(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new a0);const r=this.events[e].add(n);return e==="change"?()=>{r(),ae.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return la.current&&la.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=yt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>rb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,rb);return l0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xn(t,e){return new m4(t,e)}function GN(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function k0(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?GN(n,t):n}const g4={type:"spring",stiffness:500,damping:25,restSpeed:10},x4=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),y4={type:"keyframes",duration:.8},b4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},v4=(t,{keyframes:e})=>e.length>2?y4:bo.has(t)?t.startsWith("scale")?x4(e[1]):g4:b4,k4=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function w4(t){for(const e in t)if(!k4.has(e))return!0;return!1}const w0=(t,e,n,r={},s,i)=>o=>{const a=k0(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-zt(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};w4(a)||Object.assign(d,v4(t,d)),d.duration&&(d.duration=zt(d.duration)),d.repeatDelay&&(d.repeatDelay=zt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(sm(d),d.delay===0&&(h=!0)),(Xr.instantAnimations||Xr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(h=!0,sm(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,h&&!i&&e.get()!==void 0){const f=qd(d.keyframes,a);if(f!==void 0){ae.update(()=>{d.onUpdate(f),d.onComplete()});return}}return a.isSync?new qa(d):new f4(d)},S4=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function N4(t){const e=S4.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function qN(t,e,n=1){const[r,s]=N4(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return cN(o)?parseFloat(o):o}return d0(s)?qN(s,e,n+1):s}function sb(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function S0(t,e,n,r){if(typeof e=="function"){const[s,i]=sb(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=sb(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function _s(t,e,n){const r=t.getProps();return S0(r,e,n!==void 0?n:r.custom,t)}const JN=new Set(["width","height","top","left","right","bottom",...yo]),im=t=>Array.isArray(t);function C4(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,xn(n))}function j4(t){return im(t)?t[t.length-1]||0:t}function E4(t,e){const n=_s(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=j4(i[o]);C4(t,o,a)}}const We=t=>!!(t&&t.getVelocity);function T4(t){return!!(We(t)&&t.add)}function om(t,e){const n=t.getValue("willChange");if(T4(n))return n.add(e);if(!n&&Xr.WillChange){const r=new Xr.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function N0(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const M4="framerAppearId",YN="data-"+N0(M4);function XN(t){return t.props[YN]}function P4({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function ZN(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();i=i?GN(i,l):l;const u=i==null?void 0:i.reduceMotion,d=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],f=s&&t.animationState&&t.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(t,a,i,n,h);for(const m in a){const g=t.getValue(m,t.latestValues[m]??null),y=a[m];if(y===void 0||f&&P4(f,m))continue;const b={delay:n,...k0(i||{},m)};d&&(b.skipAnimations=!0);const x=g.get();if(x!==void 0&&!g.isAnimating()&&!Array.isArray(y)&&y===x&&!b.velocity){ae.update(()=>g.set(y));continue}let k=!1;if(window.MotionHandoffAnimation){const E=XN(t);if(E){const S=window.MotionHandoffAnimation(E,m,ae);S!==null&&(b.startTime=S,k=!0)}}om(t,m);const w=u??t.shouldReduceMotion;g.start(w0(m,g,y,w&&JN.has(m)?{type:!1}:b,t,k));const C=g.animation;C&&h.push(C)}if(o){const m=()=>ae.update(()=>{o&&E4(t,o)});h.length?Promise.all(h).then(m):m()}return h}function am(t,e,n={}){var l;const r=_s(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(ZN(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:f}=s;return A4(t,e,u,d,h,f,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[u,d]=a==="beforeChildren"?[i,o]:[o,i];return u().then(()=>d())}else return Promise.all([i(),o(n.delay)])}function A4(t,e,n=0,r=0,s=0,i=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(am(l,e,{...o,delay:n+(typeof r=="function"?0:r)+KN(t.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function D4(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>am(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=am(t,e,n);else{const s=typeof e=="function"?_s(t,e,n.custom):e;r=Promise.all(ZN(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const L4={test:t=>t==="auto",parse:t=>t},QN=t=>e=>e.test(t),eC=[xo,G,In,Wn,l3,a3,L4],ib=t=>eC.find(QN(t));function R4(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||dN(t):!0}const _4=new Set(["brightness","contrast","saturate","opacity"]);function I4(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(h0)||[];if(!r)return t;const s=n.replace(r,"");let i=_4.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const O4=/\b([a-z-]*)\(.*?\)/gu,lm={...kn,getAnimatableNone:t=>{const e=t.match(O4);return e?e.map(I4).join(" "):t}},cm={...kn,getAnimatableNone:t=>{const e=kn.parse(t);return kn.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},ob={...xo,transform:Math.round},B4={rotate:Wn,pathRotation:Wn,rotateX:Wn,rotateY:Wn,rotateZ:Wn,scale:Yl,scaleX:Yl,scaleY:Yl,scaleZ:Yl,skew:Wn,skewX:Wn,skewY:Wn,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:Ga,originX:Ky,originY:Ky,originZ:G},Tu={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,inset:G,insetBlock:G,insetBlockStart:G,insetBlockEnd:G,insetInline:G,insetInlineStart:G,insetInlineEnd:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,paddingBlock:G,paddingBlockStart:G,paddingBlockEnd:G,paddingInline:G,paddingInlineStart:G,paddingInlineEnd:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,marginBlock:G,marginBlockStart:G,marginBlockEnd:G,marginInline:G,marginInlineStart:G,marginInlineEnd:G,fontSize:G,backgroundPositionX:G,backgroundPositionY:G,...B4,zIndex:ob,fillOpacity:Ga,strokeOpacity:Ga,numOctaves:ob},z4={...Tu,color:Ie,backgroundColor:Ie,outlineColor:Ie,fill:Ie,stroke:Ie,borderColor:Ie,borderTopColor:Ie,borderRightColor:Ie,borderBottomColor:Ie,borderLeftColor:Ie,filter:lm,WebkitFilter:lm,mask:cm,WebkitMask:cm},tC=t=>z4[t],F4=new Set([lm,cm]);function nC(t,e){let n=tC(t);return F4.has(n)||(n=kn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const V4=new Set(["auto","none","0"]);function $4(t,e,n){let r=0,s;for(;r{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const C0=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function rC(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const s=document.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const um=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function ca(t){return uN(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Yi,cancel:sC}=SN(queueMicrotask,!1),hn={x:!1,y:!1};function iC(){return hn.x||hn.y}function W4(t){return t==="x"||t==="y"?hn[t]?null:(hn[t]=!0,()=>{hn[t]=!1}):hn.x||hn.y?null:(hn.x=hn.y=!0,()=>{hn.x=hn.y=!1})}function oC(t,e){const n=rC(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function U4(t){return!(t.pointerType==="touch"||iC())}function K4(t,e,n={}){const[r,s,i]=oC(t,n);return r.forEach(o=>{let a=!1,l=!1,u;const d=()=>{o.removeEventListener("pointerleave",m)},h=y=>{u&&(u(y),u=void 0),d()},f=y=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(y))},p=()=>{a=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},m=y=>{if(y.pointerType!=="touch"){if(a){l=!0;return}h(y)}},g=y=>{if(!U4(y))return;l=!1;const b=e(o,y);typeof b=="function"&&(u=b,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const aC=(t,e)=>e?t===e?!0:aC(t,e.parentElement):!1,j0=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,G4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function q4(t){return G4.has(t.tagName)||t.isContentEditable===!0}const J4=new Set(["INPUT","SELECT","TEXTAREA"]);function Y4(t){return J4.has(t.tagName)||t.isContentEditable===!0}const Ic=new WeakSet;function ab(t){return e=>{e.key==="Enter"&&t(e)}}function tf(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const X4=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=ab(()=>{if(Ic.has(n))return;tf(n,"down");const s=ab(()=>{tf(n,"up")}),i=()=>tf(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function lb(t){return j0(t)&&!iC()}const cb=new WeakSet;function Z4(t,e,n={}){const[r,s,i]=oC(t,n),o=a=>{const l=a.currentTarget;if(!lb(a)||cb.has(a))return;Ic.add(l),n.stopPropagation&&cb.add(a);const u=e(l,a),d={...s,capture:!0},h=(m,g)=>{window.removeEventListener("pointerup",f,d),window.removeEventListener("pointercancel",p,d),Ic.has(l)&&Ic.delete(l),lb(m)&&typeof u=="function"&&u(m,{success:g})},f=m=>{h(m,l===window||l===document||n.useGlobalTarget||aC(l,m.target))},p=m=>{h(m,!1)};window.addEventListener("pointerup",f,d),window.addEventListener("pointercancel",p,d)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),ca(a)&&(a.addEventListener("focus",u=>X4(u,s)),!q4(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function E0(t){return uN(t)&&"ownerSVGElement"in t}const Oc=new WeakMap;let mr;const lC=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:E0(r)&&"getBBox"in r?r.getBBox()[e]:r[n],Q4=lC("inline","width","offsetWidth"),eL=lC("block","height","offsetHeight");function tL({target:t,borderBoxSize:e}){var n;(n=Oc.get(t))==null||n.forEach(r=>{r(t,{get width(){return Q4(t,e)},get height(){return eL(t,e)}})})}function nL(t){t.forEach(tL)}function rL(){typeof ResizeObserver>"u"||(mr=new ResizeObserver(nL))}function sL(t,e){mr||rL();const n=rC(t);return n.forEach(r=>{let s=Oc.get(r);s||(s=new Set,Oc.set(r,s)),s.add(e),mr==null||mr.observe(r)}),()=>{n.forEach(r=>{const s=Oc.get(r);s==null||s.delete(e),s!=null&&s.size||mr==null||mr.unobserve(r)})}}const Bc=new Set;let Mi;function iL(){Mi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Bc.forEach(e=>e(t))},window.addEventListener("resize",Mi)}function oL(t){return Bc.add(t),Mi||iL(),()=>{Bc.delete(t),!Bc.size&&typeof Mi=="function"&&(window.removeEventListener("resize",Mi),Mi=void 0)}}function dm(t,e){return typeof t=="function"?oL(t):sL(t,e)}function cC(t,e){let n;const r=()=>{const{currentTime:s}=e,o=(s===null?0:s.value)/100;n!==o&&t(o),n=o};return ae.preUpdate(r,!0),()=>an(r)}function aL(t){return E0(t)&&t.tagName==="svg"}function lL(...t){const e=!Array.isArray(t[0]),n=e?0:-1,r=t[0+n],s=t[1+n],i=t[2+n],o=t[3+n],a=g0(s,i,o);return e?a(r):a}function cL(t,e,n={}){const r=t.get();let s=null,i=r,o;const a=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,l=()=>{s&&(s.stop(),s=null),t.animation=void 0},u=()=>{const h=ub(t.get()),f=ub(i);if(h===f){l();return}const p=s?s.getGeneratorVelocity():t.getVelocity();l(),s=new qa({keyframes:[h,f],velocity:p,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},d=()=>{var h;u(),t.animation=s??void 0,(h=t.events.animationStart)==null||h.notify(),s==null||s.then(()=>{var f;t.animation=void 0,(f=t.events.animationComplete)==null||f.notify()})};if(t.attach((h,f)=>{i=h,o=p=>f(nf(p,a)),ae.postRender(d)},l),We(e)){let h=n.skipInitialAnimation===!0;const f=e.on("change",m=>{h?(h=!1,t.jump(nf(m,a),!1)):t.set(nf(m,a))}),p=t.on("destroy",f);return()=>{f(),p()}}return l}function nf(t,e){return e?t+e:t}function ub(t){return typeof t=="number"?t:parseFloat(t)}const uL=[...eC,Ie,kn],dL=t=>uL.find(QN(t)),db=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pi=()=>({x:db(),y:db()}),hb=()=>({min:0,max:0}),Ve=()=>({x:hb(),y:hb()}),hL=new WeakMap;function Jd(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ja(t){return typeof t=="string"||Array.isArray(t)}const T0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],M0=["initial",...T0];function Yd(t){return Jd(t.animate)||M0.some(e=>Ja(t[e]))}function uC(t){return!!(Yd(t)||t.variants)}function fL(t,e,n){for(const r in e){const s=e[r],i=n[r];if(We(s))t.addValue(r,s);else if(We(i))t.addValue(r,xn(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,xn(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const hm={current:null},dC={current:!1},pL=typeof window<"u";function mL(){if(dC.current=!0,!!pL)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>hm.current=t.matches;t.addEventListener("change",e),e()}else hm.current=!1}const fb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Mu={};function hC(t){Mu=t}function gL(){return Mu}class xL{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=y0,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=yt.now();this.renderScheduledAtthis.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(dC.current||mL(),this.shouldReduceMotion=hm.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),an(this.notifyUpdate),an(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&UN.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:d}=n.accelerate,h=new HN({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:zt(d)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const r=bo.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ae.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Mu){const n=Mu[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ve()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=xn(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(cN(r)||dN(r))?r=parseFloat(r):!dL(r)&&kn.test(n)&&(r=nC(e,n)),this.setBaseTarget(e,We(r)?r.get():r)),We(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=S0(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!We(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new a0),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Yi.render(this.render)}}class fC extends xL{constructor(){super(...arguments),this.KeyframeResolver=H4}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;We(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ss{constructor(e){this.isMounted=!1,this.node=e}update(){}}function pC({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function yL({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function bL(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function rf(t){return t===void 0||t===1}function fm({scale:t,scaleX:e,scaleY:n}){return!rf(t)||!rf(e)||!rf(n)}function ys(t){return fm(t)||mC(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function mC(t){return pb(t.x)||pb(t.y)}function pb(t){return t&&t!=="0%"}function Pu(t,e,n){const r=t-n,s=e*r;return n+s}function mb(t,e,n,r,s){return s!==void 0&&(t=Pu(t,s,r)),Pu(t,n,r)+e}function pm(t,e=0,n=1,r,s){t.min=mb(t.min,e,n,r,s),t.max=mb(t.max,e,n,r,s)}function gC(t,{x:e,y:n}){pm(t.x,e.translate,e.scale,e.originPoint),pm(t.y,n.translate,n.scale,n.originPoint)}const gb=.999999999999,xb=1.0000000000001;function vL(t,e,n,r=!1){var a;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let l=0;lgb&&(e.x=1),e.ygb&&(e.y=1)}function Dn(t,e){t.min+=e,t.max+=e}function yb(t,e,n,r,s=.5){const i=pe(t.min,t.max,s);pm(t,e,n,i,r)}function bb(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function zc(t,e,n){const r=n??t;yb(t.x,bb(e.x,r.x),e.scaleX,e.scale,e.originX),yb(t.y,bb(e.y,r.y),e.scaleY,e.scale,e.originY)}function xC(t,e){return pC(bL(t.getBoundingClientRect(),e))}function kL(t,e,n){const r=xC(t,n),{scroll:s}=e;return s&&(Dn(r.x,s.offset.x),Dn(r.y,s.offset.y)),r}const wL={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},SL=yo.length;function NL(t,e,n){let r="",s=!0;for(let o=0;o{if(!e.target)return t;if(typeof t=="string")if(G.test(t))t=parseFloat(t);else return t;const n=vb(t,e.target.x),r=vb(t,e.target.y);return`${n}% ${r}%`}},CL={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=kn.parse(t);if(s.length>5)return r;const i=kn.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=pe(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}},mm={borderRadius:{...Ao,applyTo:[...C0]},borderTopLeftRadius:Ao,borderTopRightRadius:Ao,borderBottomLeftRadius:Ao,borderBottomRightRadius:Ao,boxShadow:CL};function bC(t,{layout:e,layoutId:n}){return bo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!mm[t]||t==="opacity")}function A0(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const a in r)(We(r[a])||s&&We(s[a])||bC(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function jL(t){return window.getComputedStyle(t)}class EL extends fC{constructor(){super(...arguments),this.type="html",this.renderInstance=yC}readValueFromInstance(e,n){var r;if(bo.has(n))return(r=this.projection)!=null&&r.isProjecting?Qp(n):K3(e,n);{const s=jL(e),i=(CN(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return xC(e,n)}build(e,n,r){P0(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return A0(e,n,r)}}const TL={offset:"stroke-dashoffset",array:"stroke-dasharray"},ML={offset:"strokeDashoffset",array:"strokeDasharray"};function PL(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?TL:ML;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const AL=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function vC(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,u,d){if(P0(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const p of AL)h[p]!==void 0&&(f[p]=h[p],delete h[p]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&PL(h,s,i,o,!1)}const kC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),wC=t=>typeof t=="string"&&t.toLowerCase()==="svg";function DL(t,e,n,r){yC(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(kC.has(s)?s:N0(s),e.attrs[s])}function SC(t,e,n){const r=A0(t,e,n);for(const s in t)if(We(t[s])||We(e[s])){const i=yo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class LL extends fC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ve}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(bo.has(n)){const r=tC(n);return r&&r.default||0}return n=kC.has(n)?n:N0(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return SC(e,n,r)}build(e,n,r){vC(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){DL(e,n,r,s)}mount(e){this.isSVGTag=wC(e.tagName),super.mount(e)}}const RL=M0.length;function NC(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?NC(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;nPromise.all(e.map(({animation:n,options:r})=>D4(t,n,r)))}function BL(t){let e=OL(t),n=kb(),r=!0,s=!1;const i=u=>(d,h)=>{var p;const f=_s(t,h,u==="exit"?(p=t.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:g,...y}=f;d={...d,...y,...g}}return d};function o(u){e=u(t)}function a(u){const{props:d}=t,h=NC(t.parent)||{},f=[],p=new Set;let m={},g=1/0;for(let b=0;bg&&C,j=!1;const T=Array.isArray(w)?w:[w];let R=T.reduce(i(x),{});E===!1&&(R={});const{prevResolvedValues:$={}}=k,L={...$,...R},W=_=>{M=!0,p.has(_)&&(j=!0,p.delete(_)),k.needsAnimating[_]=!0;const I=t.getValue(_);I&&(I.liveStyle=!1)};for(const _ in L){const I=R[_],V=$[_];if(m.hasOwnProperty(_))continue;let K=!1;im(I)&&im(V)?K=!CC(I,V)||N:K=I!==V,K?I!=null?W(_):p.add(_):I!==void 0&&p.has(_)?W(_):k.protectedKeys[_]=!0}k.prevProp=w,k.prevResolvedValues=R,k.isActive&&(m={...m,...R}),(r||s)&&t.blockInitialAnimation&&(M=!1);const B=S&&N;M&&(!B||j)&&f.push(...T.map(_=>{const I={type:x};if(typeof _=="string"&&(r||s)&&!B&&t.manuallyAnimateOnMount&&t.parent){const{parent:V}=t,K=_s(V,_);if(V.enteringChildren&&K){const{delayChildren:te}=K.transition||{};I.delay=KN(V.enteringChildren,t,te)}}return{animation:_,options:I}}))}if(p.size){const b={};if(typeof d.initial!="boolean"){const x=_s(t,Array.isArray(d.initial)?d.initial[0]:d.initial);x&&x.transition&&(b.transition=x.transition)}p.forEach(x=>{const k=t.getBaseTarget(x),w=t.getValue(x);w&&(w.liveStyle=!0),b[x]=k??null}),f.push({animation:b})}let y=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(y=!1),r=!1,s=!1,y?e(f):Promise.resolve()}function l(u,d){var f;if(n[u].isActive===d)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(u,d)}),n[u].isActive=d;const h=a(u);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=kb(),s=!0}}}function zL(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!CC(e,t):!1}function ps(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kb(){return{animate:ps(!0),whileInView:ps(),whileHover:ps(),whileTap:ps(),whileDrag:ps(),whileFocus:ps(),exit:ps()}}function gm(t,e){t.min=e.min,t.max=e.max}function un(t,e){gm(t.x,e.x),gm(t.y,e.y)}function wb(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const jC=1e-4,FL=1-jC,VL=1+jC,EC=.01,$L=0-EC,HL=0+EC;function bt(t){return t.max-t.min}function WL(t,e,n){return Math.abs(t-e)<=n}function Sb(t,e,n,r=.5){t.origin=r,t.originPoint=pe(e.min,e.max,t.origin),t.scale=bt(n)/bt(e),t.translate=pe(n.min,n.max,t.origin)-t.originPoint,(t.scale>=FL&&t.scale<=VL||isNaN(t.scale))&&(t.scale=1),(t.translate>=$L&&t.translate<=HL||isNaN(t.translate))&&(t.translate=0)}function ua(t,e,n,r){Sb(t.x,e.x,n.x,r?r.originX:void 0),Sb(t.y,e.y,n.y,r?r.originY:void 0)}function Nb(t,e,n,r=0){const s=r?pe(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+bt(e)}function UL(t,e,n,r){Nb(t.x,e.x,n.x,r==null?void 0:r.x),Nb(t.y,e.y,n.y,r==null?void 0:r.y)}function Cb(t,e,n,r=0){const s=r?pe(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+bt(e)}function Au(t,e,n,r){Cb(t.x,e.x,n.x,r==null?void 0:r.x),Cb(t.y,e.y,n.y,r==null?void 0:r.y)}function jb(t,e,n,r,s){return t-=e,t=Pu(t,1/n,r),s!==void 0&&(t=Pu(t,1/s,r)),t}function KL(t,e=0,n=1,r=.5,s,i=t,o=t){if(In.test(e)&&(e=parseFloat(e),e=pe(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=pe(i.min,i.max,r);t===i&&(a-=e),t.min=jb(t.min,e,n,a,s),t.max=jb(t.max,e,n,a,s)}function Eb(t,e,[n,r,s],i,o){KL(t,e[n],e[r],e[s],e.scale,i,o)}const GL=["x","scaleX","originX"],qL=["y","scaleY","originY"];function Tb(t,e,n,r){Eb(t.x,e,GL,n?n.x:void 0,r?r.x:void 0),Eb(t.y,e,qL,n?n.y:void 0,r?r.y:void 0)}function Mb(t){return t.translate===0&&t.scale===1}function TC(t){return Mb(t.x)&&Mb(t.y)}function Pb(t,e){return t.min===e.min&&t.max===e.max}function JL(t,e){return Pb(t.x,e.x)&&Pb(t.y,e.y)}function Ab(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function MC(t,e){return Ab(t.x,e.x)&&Ab(t.y,e.y)}function Db(t){return bt(t.x)/bt(t.y)}function Lb(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Tn(t){return[t("x"),t("y")]}function YL(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,pathRotation:h,rotateX:f,rotateY:p,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotate(${h}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const XL=C0.length,Rb=t=>typeof t=="string"?parseFloat(t):t,_b=t=>typeof t=="number"||G.test(t);function ZL(t,e,n,r,s,i){s?(t.opacity=pe(0,n.opacity??1,QL(r)),t.opacityExit=pe(e.opacity??1,0,eR(r))):i&&(t.opacity=pe(e.opacity??1,n.opacity??1,r));for(let o=0;ore?1:n(qi(t,e,r))}function tR(t,e,n){const r=We(t)?t:xn(t);return r.start(w0("",r,e,n)),r.animation}function Ya(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const nR=(t,e)=>t.depth-e.depth;class rR{constructor(){this.children=[],this.isDirty=!1}add(e){i0(this.children,e),this.isDirty=!0}remove(e){Nu(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nR),this.isDirty=!1,this.children.forEach(e)}}function sR(t,e){const n=yt.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(an(r),t(i-e))};return ae.setup(r,!0),()=>an(r)}function Fc(t){return We(t)?t.get():t}class iR{constructor(){this.members=[]}add(e){i0(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Nu(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Nu(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Vc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},sf=["","X","Y","Z"],oR=1e3;let aR=0;function of(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function AC(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=XN(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ae,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&AC(r)}function DC({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=aR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(uR),this.nodes.forEach(gR),this.nodes.forEach(xR),this.nodes.forEach(dR)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;ae.read(()=>{h=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,d&&d(),d=sR(f,250),Vc.hasAnimatedSinceResize&&(Vc.hasAnimatedSinceResize=!1,this.nodes.forEach(zb)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||wR,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),b=!this.targetLayout||!MC(this.targetLayout,p),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...k0(m,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(d,x,k.path)}else h||zb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),an(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&AC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!bt(this.snapshot.measuredBox.x)&&!bt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const S=E/1e3,N=C==null?void 0:C(S);N?(f.x.translate=N.x,f.x.scale=pe(o.x.scale,1,S),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=N.y,f.y.scale=pe(o.y.scale,1,S),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(Fb(f.x,o.x,S),Fb(f.y,o.y,S)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Au(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),vR(this.relativeTarget,this.relativeTargetOrigin,p,S),w&&JL(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Ve()),un(w,this.relativeTarget)),y&&(this.animationValues=h,ZL(h,d,this.latestValues,S,k,x)),N&&N.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=N.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(an(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ae.update(()=>{Vc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=xn(0)),this.motionValue.jump(0,!1),this.currentAnimation=tR(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(oR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&LC(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ve();const h=bt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=bt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}un(a,l),zc(a,d),ua(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new iR),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&of("z",o,u,this.animationValues);for(let d=0;d{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Ob),this.root.sharedNodes.clear()}}}function lR(t){t.updateLayout()}function cR(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Tn(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],p=bt(f);f.min=r[h].min,f.max=f.min+p});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";gm(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else LC(i,e.layoutBox,r)&&Tn(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],p=bt(r[h]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+p)});const a=Pi();ua(a,r,e.layoutBox);const l=Pi();o?ua(l,t.applyTransform(s,!0),e.measuredBox):ua(l,r,e.layoutBox);const u=!TC(a);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:p}=h;if(f&&p){const m=t.options.layoutAnchor||void 0,g=Ve();Au(g,e.layoutBox,f.layoutBox,m);const y=Ve();Au(y,r,p.layoutBox,m),MC(g,y)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=g,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function uR(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function dR(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function hR(t){t.clearSnapshot()}function Ob(t){t.clearMeasurements()}function fR(t){t.isLayoutDirty=!0,t.updateLayout()}function Bb(t){t.isLayoutDirty=!1}function pR(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function mR(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function zb(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function gR(t){t.resolveTargetDelta()}function xR(t){t.calcProjection()}function yR(t){t.resetSkewAndRotation()}function bR(t){t.removeLeadSnapshot()}function Fb(t,e,n){t.translate=pe(e.translate,0,n),t.scale=pe(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Vb(t,e,n,r){t.min=pe(e.min,n.min,r),t.max=pe(e.max,n.max,r)}function vR(t,e,n,r){Vb(t.x,e.x,n.x,r),Vb(t.y,e.y,n.y,r)}function kR(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const wR={duration:.45,ease:[.4,0,.1,1]},$b=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Hb=$b("applewebkit/")&&!$b("chrome/")?Math.round:Lt;function Wb(t){t.min=Hb(t.min),t.max=Hb(t.max)}function SR(t){Wb(t.x),Wb(t.y)}function LC(t,e,n){return t==="position"||t==="preserve-aspect"&&!WL(Db(e),Db(n),.2)}function NR(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const CR=DC({attachResizeListener:(t,e)=>Ya(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),af={current:void 0},RC=DC({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!af.current){const t=new CR({});t.mount(window),t.setOptions({layoutScroll:!0}),af.current=t}return af.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),bl=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Ub(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function jR(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Ub(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{width:p,height:m,top:g,left:y,right:b,bottom:x,direction:k}=l.current;if(e||i===!1||!a.current||!p||!m)return;const w=k==="rtl",C=n==="left"?w?`right: ${b}`:`left: ${y}`:w?`left: ${y}`:`right: ${b}`,E=r==="bottom"?`bottom: ${x}`:`top: ${g}`;a.current.dataset.motionPopId=o;const S=document.createElement("style");u&&(S.nonce=u);const N=s??document.head;return N.appendChild(S),S.sheet&&S.sheet.insertRule(` + */function wu(){return wu=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let r=t[n];return e.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function iD(t,e){let n=Wp(t);return e&&e.forEach((r,s)=>{n.has(s)||e.getAll(s).forEach(i=>{n.append(s,i)})}),n}const oD=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],aD=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],lD="6";try{window.__reactRouterVersion=lD}catch{}const cD=v.createContext({isTransitioning:!1}),uD="startTransition",zy=$2[uD];function dD(t){let{basename:e,children:n,future:r,window:s}=t,i=v.useRef();i.current==null&&(i.current=dA({window:s,v5Compat:!0}));let o=i.current,[a,l]=v.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=v.useCallback(h=>{u&&zy?zy(()=>l(h)):l(h)},[l,u]);return v.useLayoutEffect(()=>o.listen(d),[o,d]),v.useEffect(()=>eD(r),[r]),v.createElement(tD,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const hD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",fD=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ee=v.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:d,viewTransition:h}=e,f=QS(e,oD),{basename:p}=v.useContext(ur),m,g=!1;if(typeof u=="string"&&fD.test(u)&&(m=u,hD))try{let k=new URL(window.location.href),w=u.startsWith("//")?new URL(k.protocol+u):new URL(u),C=Gi(w.pathname,p);w.origin===k.origin&&C!=null?u=C+w.search+w.hash:g=!0}catch{}let y=OA(u,{relative:s}),b=mD(u,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:h});function x(k){r&&r(k),k.defaultPrevented||b(k)}return v.createElement("a",wu({},f,{href:m||y,onClick:g||i?r:x,ref:n,target:l}))}),eN=v.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:u,children:d}=e,h=QS(e,aD),f=Ud(l,{relative:h.relative}),p=ln(),m=v.useContext(GS),{navigator:g,basename:y}=v.useContext(ur),b=m!=null&&xD(f)&&u===!0,x=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,k=p.pathname,w=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;s||(k=k.toLowerCase(),w=w?w.toLowerCase():null,x=x.toLowerCase()),w&&y&&(w=Gi(w,y)||w);const C=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let E=k===x||!o&&k.startsWith(x)&&k.charAt(C)==="/",S=w!=null&&(w===x||!o&&w.startsWith(x)&&w.charAt(x.length)==="/"),N={isActive:E,isPending:S,isTransitioning:b},M=E?r:void 0,j;typeof i=="function"?j=i(N):j=[i,E?"active":null,S?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let T=typeof a=="function"?a(N):a;return v.createElement(ee,wu({},h,{"aria-current":M,className:j,ref:n,style:T,to:l,viewTransition:u}),typeof d=="function"?d(N):d)});var Up;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Up||(Up={}));var Fy;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Fy||(Fy={}));function pD(t){let e=v.useContext(Hd);return e||je(!1),e}function mD(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=pl(),u=ln(),d=Ud(t,{relative:o});return v.useCallback(h=>{if(sD(h,n)){h.preventDefault();let f=r!==void 0?r:ku(u)===ku(d);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,d,r,s,n,t,i,o,a])}function gD(t){let e=v.useRef(Wp(t)),n=v.useRef(!1),r=ln(),s=v.useMemo(()=>iD(r.search,n.current?null:e.current),[r.search]),i=pl(),o=v.useCallback((a,l)=>{const u=Wp(typeof a=="function"?a(s):a);n.current=!0,i("?"+u,l)},[i,s]);return[s,o]}function xD(t,e){e===void 0&&(e={});let n=v.useContext(cD);n==null&&je(!1);let{basename:r}=pD(Up.useViewTransitionState),s=Ud(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=Gi(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Gi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $p(s.pathname,o)!=null||$p(s.pathname,i)!=null}function yD(){const{pathname:t}=ln();return v.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[t]),null}const bD='a, button, [role="button"], label, select, summary, [data-cursor="hover"], .cursor-pointer',vD='input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="file"]), textarea, [contenteditable="true"]';function kD(){const t=v.useRef(null),e=v.useRef(null),n=v.useRef(null),r=v.useRef(null),s=v.useRef(null);return v.useEffect(()=>{const i=window.matchMedia("(pointer: fine)"),o=window.matchMedia("(prefers-reduced-motion: reduce)");if(!i.matches||o.matches)return;const a=t.current,l=e.current,u=n.current,d=r.current,h=s.current;if(!a||!l||!u||!d||!h)return;document.documentElement.classList.add("hifi-cursor-on");const f=-24*Math.PI/180,p=Math.cos(f),m=Math.sin(f);let g=-100,y=-100,b=0,x=2.4,k=2.4,w=16,C=6.5,E=16,S=6.5,N=!1,M,j=performance.now();const T=_=>{const I=Math.min((_-j)/1e3,.05);j=_,x+=(k-x)*Math.min(1,I*8),w+=(E-w)*Math.min(1,I*10),C+=(S-C)*Math.min(1,I*10),b+=x*I,l.style.transform=`translate3d(${g}px, ${y}px, 0)`,u.style.transform=`translate3d(${g}px, ${y}px, 0)`;const V=Math.cos(b)*w,K=Math.sin(b)*C;d.style.transform=`translate(${V*p-K*m}px, ${V*m+K*p}px)`,M=requestAnimationFrame(T)},R=_=>{a.dataset.state=_;const I=_==="hover";k=I?7:2.4,E=I?23:16,S=I?9.5:6.5},$=_=>{g=_.clientX,y=_.clientY,N||(N=!0,a.dataset.hidden="false")},L=_=>{const I=_.target;I instanceof Element&&(I.closest(vD)?R("text"):I.closest(bD)?R("hover"):R("default"))},W=()=>{a.dataset.down="true",h.style.left=`${g}px`,h.style.top=`${y}px`,h.classList.remove("is-live"),h.offsetWidth,h.classList.add("is-live")},B=()=>{a.dataset.down="false"},Z=()=>{N=!1,a.dataset.hidden="true"};return document.addEventListener("mousemove",$,{passive:!0}),document.addEventListener("mouseover",L,{passive:!0}),document.addEventListener("mousedown",W,{passive:!0}),document.addEventListener("mouseup",B,{passive:!0}),document.documentElement.addEventListener("mouseleave",Z),window.addEventListener("blur",Z),M=requestAnimationFrame(T),()=>{cancelAnimationFrame(M),document.removeEventListener("mousemove",$),document.removeEventListener("mouseover",L),document.removeEventListener("mousedown",W),document.removeEventListener("mouseup",B),document.documentElement.removeEventListener("mouseleave",Z),window.removeEventListener("blur",Z),document.documentElement.classList.remove("hifi-cursor-on")}},[]),c.jsxs("div",{ref:t,className:"hifi-cursor","data-state":"default","data-hidden":"true","data-down":"false","aria-hidden":"true",children:[c.jsxs("div",{ref:n,className:"hifi-cursor__orbit",children:[c.jsx("div",{className:"hifi-cursor__ring"}),c.jsx("div",{ref:r,className:"hifi-cursor__sat"})]}),c.jsx("div",{ref:e,className:"hifi-cursor__core"}),c.jsx("div",{ref:s,className:"hifi-cursor__pulse"})]})}const tN=`${"/".replace(/\/$/,"")}/api`;async function Po(t,e={}){const n=await fetch(`${tN}${t}`,{credentials:"include",headers:e.body instanceof FormData?{}:{"Content-Type":"application/json"},...e}),r=await n.text();let s=null;if(r)try{s=JSON.parse(r)}catch{}if(!n.ok)throw new Error((s==null?void 0:s.error)||`Fehler ${n.status}`);if(s===null&&r)throw new Error("Unerwartete Server-Antwort (kein gültiges JSON)");return s}const A={get:t=>Po(t),post:(t,e)=>Po(t,{method:"POST",body:e instanceof FormData?e:JSON.stringify(e)}),put:(t,e)=>Po(t,{method:"PUT",body:JSON.stringify(e)}),patch:(t,e)=>Po(t,{method:"PATCH",body:JSON.stringify(e)}),delete:t=>Po(t,{method:"DELETE"})};function wD({children:t}){const[e,n]=v.useState({pathname:null,needsSetup:null}),r=ln();return v.useEffect(()=>{let s=!1;return A.get("/setup/status").then(i=>{s||n({pathname:r.pathname,needsSetup:i.needs_setup})}).catch(()=>{s||n({pathname:r.pathname,needsSetup:!1})}),()=>{s=!0}},[r.pathname]),e.pathname!==r.pathname||e.needsSetup===null?c.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"}):e.needsSetup&&r.pathname!=="/setup"?c.jsx(Ua,{to:"/setup",replace:!0}):!e.needsSetup&&r.pathname==="/setup"?c.jsx(Ua,{to:"/",replace:!0}):t}const nN=v.createContext(null);function SD(){const t=new Date,e=t.getHours()+t.getMinutes()/60;return e>=6.5&&e<21?"light":"dark"}function ND({children:t}){const[e,n]=v.useState(()=>{const s=localStorage.getItem("hifi-theme");return s==="light"||s==="dark"?s:SD()});v.useEffect(()=>{document.documentElement.classList.toggle("dark",e==="dark"),localStorage.setItem("hifi-theme",e)},[e]);const r=()=>n(s=>s==="dark"?"light":"dark");return c.jsx(nN.Provider,{value:{theme:e,toggleTheme:r},children:t})}function CD(){return v.useContext(nN)}const jD={nav:{openMenu:"Menü öffnen",closeMenu:"Menü schließen",close:"Schließen",adminPanel:"Zum Admin-Panel",vehicles:"Fahrzeuge",services:"Leistungen",gallery:"Galerie",contact:"Kontakt",whatsapp:"WhatsApp",shop:"Zum Shop"},themeToggle:{label:"Theme umschalten"},languageToggle:{label:"Sprache auswählen"},footer:{routePlan:"Route planen",contactHeading:"Kontakt",contactForm:"Kontaktformular",hoursHeading:"Öffnungszeiten",open:"Geöffnet",closed:"Geschlossen",days:{monFri:"Montag – Freitag",sat:"Samstag",sun:"Sonntag"},copyright:t=>`© ${t} HifiPlanet. Alle Angaben ohne Gewähr.`,imprint:"Impressum",privacy:"Datenschutz",terms:"AGB",cookieSettings:"Cookie-Einstellungen"},cookieConsent:{bannerText:"Wir verwenden nur technisch notwendige Cookies. Für Google Maps, YouTube-Videos und Statistik-Cookies benötigen wir zusätzlich deine Zustimmung, da dabei Daten an Google übertragen werden.",moreInfo:"Mehr dazu in unserer",privacyPolicy:"Datenschutzerklärung",settings:"Einstellungen",onlyNecessary:"Nur notwendige",acceptAll:"Alle akzeptieren",modalTitle:"Cookie-Einstellungen",modalIntro:"Lege fest, welche Kategorien du zulassen möchtest. Mehr dazu in unserer",necessaryTitle:"Notwendig",necessaryDesc:"Für den Betrieb der Website erforderlich (z. B. Login-Session, Theme- und Cookie-Einstellung). Kann nicht deaktiviert werden.",externalTitle:"Externe Medien",externalDesc:"Google Maps und YouTube-Videos. Beim Laden werden Daten (u. a. deine IP-Adresse) an Google übertragen.",analyticsTitle:"Statistik",analyticsDesc:"Google Analytics hilft uns zu verstehen, wie die Website genutzt wird. Dabei werden Daten an Google übertragen.",cancel:"Abbrechen",saveSelection:"Auswahl speichern"},maintenance:{title:"Wartungsarbeiten",defaultMessage:"Dieser Bereich wird gerade aktualisiert. Bitte schau in Kürze wieder vorbei."},lightbox:{close:"Schließen",previous:"Vorheriges Bild",next:"Nächstes Bild"},home:{metaTitle:"Car-Hifi Umbauten nach Maß",metaDescription:"HifiPlanet – dein Car-Hifi Spezialist in Amorbach. Marke und Modell wählen, passende Sound-Pakete entdecken und unverbindlich anfragen.",stickyCta:"Bereit für deinen Sound-Umbau?",selectVehicle:"Fahrzeug auswählen",getInTouch:"Kontakt aufnehmen",welcome:"Willkommen bei HifiPlanet",heroTitle:"Home of pure Sound",heroSubtitle:"Dein Car-Hifi Spezialist für individuelle Sound-Umbauten. Wähle dein Fahrzeug, entdecke passende Pakete und frag unverbindlich an – wir kümmern uns um den Rest.",stats:[{value:"20+",label:"Jahre Erfahrung"},{value:"Riesige",label:"3D-Druckfarm im eigenen Haus"},{value:"Eigene",label:"CNC- & Laserwerkstatt"},{value:"International",label:"anerkannter Car-Hifi-Spezialist"}],brandsHeading:"Marken, mit denen wir arbeiten",youtubeBadge:"HifiPlanet präsentiert",youtubeTitle:"Das Handwerk hinter deinem Sound",youtubeText:"Entdecke die Handwerkskunst hinter unserer Arbeit",youtubeCta:"Jetzt ansehen",heroImageAlt:"Ground Zero Subwoofer und Endstufen mit violetter Ambiente-Beleuchtung",craftImageAlt:"Individueller Subwoofer-Bau",adviceImageAlt:"Endstufen-Einbau mit Ambiente-Beleuchtung",moreImageAlt:"Hochwertige Endstufe und Subwoofer, Studioaufnahme",craftEyebrow:"Handwerk",craftTitle:"Präzisionsarbeit in jedem Detail",craftText:"Ob eigens gefertigte Subwoofer-Gehäuse, integrierte Beleuchtung oder unsichtbar verlegte Kabelwege – dank eigener CNC-, Laser- und 3D-Druck-Fertigung entstehen bei uns Lösungen, die es von der Stange nicht gibt.",adviceEyebrow:"Beratung",adviceTitle:"Von der ersten Idee bis zum letzten Schliff",adviceText:"Jedes Fahrzeug und jeder Anspruch ist anders. Deshalb beraten wir dich persönlich und unverbindlich – vom dezenten Upgrade bis zum kompromisslosen High-End-System.",insightsTitle:"Einblicke in unsere Umbauten",insightsText:"Vom unauffälligen Sound-Upgrade bis zum aufwendigen Komplettumbau – Handarbeit aus unserer Werkstatt in Amorbach.",galleryAlts:["Individueller Subwoofer-Bau mit Ground Zero Bässen","Endstufen-Einbau mit violetter Ambiente-Beleuchtung","Hochtöner- und Mitteltöner-Einbau von Focal Utopia","Sony Navigationssystem mit Apple CarPlay im Cockpit","Verbauter Hochtöner im Kofferraum","Individueller Subwoofer-Einbau mit LED-Beleuchtung im Kofferraum"],reviewsRating:"5,0 von 181 Kunden bewertet",reviewsRatingDynamic:(t,e)=>`${t.toFixed(1).replace(".",",")} von ${e} Kunden bewertet`,reviewsText:"Das sagen unsere Kunden über uns.",reviewsLink:"Alle Bewertungen auf Google ansehen →",testimonials:[{name:"Thomas K.",text:"Über YouTube auf dieses Klang-Juwel gestoßen. Beratung und Empfehlungen sind erstklassig – der Tesla-Vorführwagen hat meine Leidenschaft für guten Sound neu entfacht."},{name:"Andreas I.",text:"Sehr professionelle Beratung und Service. Obwohl ich von VAG zu Mercedes gewechselt bin, wurde alles reibungslos angepasst. Die 3-Wege-Lautsprecher und zwei Subwoofer liefern außergewöhnliche Leistung."},{name:"Thomas F.",text:"Kompletter Audi A4 B9 Umbau hat meine Erwartungen übertroffen. Von Anfang bis Ende professionell, mit tadelloser Verarbeitung und Klangqualität."},{name:"Drago G.",text:"Beeindruckt von der CNC-Arbeit, die auf YouTube gezeigt wird. Angefangen mit 3D-gedruckten Lautsprecherringen für meinen Ford Mustang – daraus wurde ein viel größeres Projekt."},{name:"Leonardo B.",text:"Toller Service und meisterhafte Handwerkskunst. Saubere Installation, Leidenschaft in jedem Detail erkennbar."},{name:"Marcel S.",text:"Unschlagbares Preis-Leistungs-Verhältnis. Das Team hat sich viel Zeit genommen, um genau die Lösung für mein Budget zu finden."},{name:"Julia W.",text:"Endlich ein Betrieb, der auch Wohnmobile ernst nimmt. Die Soundanlage in unserem Camper klingt jetzt wie im Wohnzimmer."},{name:"Kevin R.",text:"Dashcam und Alarmanlage in einem Termin sauber verbaut, keine sichtbaren Kabel. Absolute Empfehlung für alle, die Wert auf Verarbeitung legen."},{name:"Sabrina H.",text:"Mein Oldtimer hat jetzt modernen Sound, ohne dass es dem Original-Look geschadet hätte. Genau das habe ich gesucht."},{name:"Niklas P.",text:"Von der ersten Anfrage bis zum fertigen Umbau lief alles reibungslos. Ehrliche Beratung ohne Verkaufsdruck."}],moreTitle:"Mehr als nur Car-Hifi",moreText:"Neben individuellen Sound-Umbauten bieten wir CNC-Zerspanung, Lasertechnik, 3D-Druck und mehr – alles aus einer Hand in unserer eigenen Werkstatt.",moreCta:"Alle Leistungen entdecken",faqHeading:"Häufig gestellte Fragen"},vehicleSelect:{metaTitle:"Fahrzeug auswählen",metaDescription:"Wähle deine Fahrzeugmarke und dein Modell und entdecke passende Car-Hifi Sound-Pakete von HifiPlanet.",title:"Fahrzeug auswählen",intro:"Wähle zuerst deine Marke, dann dein Modell – wir zeigen dir direkt die passenden Sound-Pakete.",empty:"Es sind noch keine Marken hinterlegt."},brandPage:{metaTitleFallback:"Modell auswählen",metaDescription:t=>`Wähle dein ${t} Modell und entdecke passende Car-Hifi Sound-Pakete von HifiPlanet.`,loading:"Lädt…",breadcrumbVehicles:"Fahrzeuge",titleSuffix:"Modell wählen",empty:"Für diese Marke sind noch keine Modelle hinterlegt."},modelPage:{metaTitleFallback:"Sound-Pakete",metaTitle:(t,e)=>`${t} ${e} Sound-Pakete`,metaDescription:(t,e)=>`Car-Hifi Sound-Pakete für ${t} ${e} inkl. aktueller Preise – von HifiPlanet unverbindlich anfragen.`,loading:"Lädt…",breadcrumbVehicles:"Fahrzeuge",titleSuffix:"Sound-Pakete",empty:"Für dieses Modell sind noch keine Pakete hinterlegt.",totalPrice:"ab ca.",productLoading:"Produkt wird geladen…",requestContact:"Kontakt anfragen",featuredBadge:"Empfohlen",moreBullets:t=>t===1?"+ 1 weitere Leistung":`+ ${t} weitere Leistungen`,lessBullets:"Weniger anzeigen",wheelHint:"Mit dem Mausrad blättern"},leistungen:{metaTitle:"Leistungen",metaDescription:"Car-Hifi, Wohnmobil & Caravan, Oldtimer, CNC-Zerspanung, Lasertechnik, 3D-Druck, Alarmanlagen und Dash Cams – alles aus einer Hand bei HifiPlanet in Amorbach.",title:"Unsere Leistungen",intro:"Von individuellen Sound-Umbauten bis zur eigenen CNC- und 3D-Druck-Fertigung – alles aus einer Hand in unserer Werkstatt in Amorbach.",notListedTitle:"Dein Projekt ist nicht dabei?",notListedText:"Sprich uns einfach an – wir finden gemeinsam die passende Lösung.",contact:"Kontakt aufnehmen"},contactPage:{metaTitle:"Kontakt",metaDescription:"Kontaktiere HifiPlanet in Amorbach für dein individuelles Car-Hifi Projekt – wir beraten dich gerne unverbindlich.",title:"Kontakt aufnehmen",heroEyebrow:"Kontakt",heroTitlePre:"Sprich",heroTitleAccent:"mit",heroTitlePost:"uns.",heroSubtitle:"Ob Anlage, Einbau oder Klang-Tuning für dein Fahrzeug — schreib uns, wir melden uns schnellstmöglich zurück.",packageBoxTitle:"Deine Anfrage bezieht sich auf",formTitle:"Anfrage senden",sentTitle:"Anfrage gesendet ✓",sentText:"Danke! Wir melden uns innerhalb eines Werktags bei dir.",contextIntro:"Deine Anfrage bezieht sich auf:",contextBrand:"Marke",contextModel:"Modell",contextPackage:"Paket",contextProduct:"Produkt",packagePrice:"Paketpreis",upgrades:"Upgrades",optionalUpgrades:"Optionale Upgrades",totalWithUpgrades:"Gesamt inkl. Upgrades",nameLabel:"Name *",namePlaceholder:"Max Mustermann",emailLabel:"E-Mail *",emailPlaceholder:"max@mail.de",phoneLabel:"Telefon",phonePlaceholder:"Optional",vinLabel:"Fahrgestellnummer (FIN)",vinPlaceholder:"Optional – hilft bei der Einschätzung",messageLabel:"Nachricht",messagePlaceholder:"Erzähl uns von deinem Projekt – Fahrzeug, Wunschklang, Budget …",requiredHint:"* Pflichtfelder",sending:"Wird gesendet…",submit:"Anfrage senden",cardTitle:"HiFi Planet Amorbach",address:"Adresse",phone:"Telefon",email:"E-Mail",hours:"Öffnungszeiten",hoursWeek:"Mo–Fr: 9:00–18:00 Uhr",hoursSat:"Sa: 10:00–13:00 Uhr",hoursWeekDays:"Mo–Fr",hoursWeekTime:"9:00 – 18:00 Uhr",hoursSatDay:"Sa",hoursSatTime:"10:00 – 13:00 Uhr",directionsTitle:"Anfahrt",mapEmbedName:"Die Google-Maps-Karte",mapOpenChip:"In Maps öffnen",routePlan:"Route planen",featurePremiumTitle:"Premium Klang",featurePremiumSub:"Höchste Qualität",featureGermanyTitle:"Made in Germany",featureGermanySub:"Präzise Handarbeit",featureIndividualTitle:"Individuell",featureIndividualSub:"Maßgeschneiderte Lösungen",featureExpertsTitle:"Experten Team",featureExpertsSub:"Leidenschaft & Know-how"},galleryOverview:{metaTitle:"Bildergalerie",metaDescription:"Einblicke in unsere Car-Hifi Umbauten – nach Marke sortiert. Wähle eine Marke und entdecke die Projekte.",title:"Bildergalerie",intro:"Wähle eine Marke und entdecke unsere Umbauten im Detail.",loading:"Lädt…",empty:"Es sind noch keine Galerie-Marken hinterlegt."},galleryBrandPage:{metaTitleFallback:"Bildergalerie",metaTitle:t=>`${t} Umbauten`,metaDescription:t=>`Einblicke in unsere ${t} Car-Hifi Umbauten.`,loading:"Lädt…",breadcrumbGallery:"Galerie",titleSuffix:"Projekt wählen",empty:"Für diese Marke sind noch keine Projekte hinterlegt."},galleryProjectPage:{metaTitleFallback:"Bildergalerie",metaDescription:t=>`Fotos unseres ${t} Umbaus.`,loading:"Lädt…",breadcrumbGallery:"Galerie",empty:"Für dieses Projekt sind noch keine Fotos hinterlegt.",enlargeImage:"Bild vergrößern"}},ED={nav:{openMenu:"Open menu",closeMenu:"Close menu",close:"Close",adminPanel:"Go to admin panel",vehicles:"Vehicles",services:"Services",gallery:"Gallery",contact:"Contact",whatsapp:"WhatsApp",shop:"Visit shop"},themeToggle:{label:"Toggle theme"},languageToggle:{label:"Select language"},footer:{routePlan:"Get directions",contactHeading:"Contact",contactForm:"Contact form",hoursHeading:"Opening hours",open:"Open",closed:"Closed",days:{monFri:"Monday – Friday",sat:"Saturday",sun:"Sunday"},copyright:t=>`© ${t} HifiPlanet. All information without guarantee.`,imprint:"Legal notice",privacy:"Privacy",terms:"Terms",cookieSettings:"Cookie settings"},cookieConsent:{bannerText:"We only use technically necessary cookies. For Google Maps, YouTube videos and analytics cookies we need your additional consent, since data is transferred to Google in that case.",moreInfo:"More details in our",privacyPolicy:"privacy policy",settings:"Settings",onlyNecessary:"Necessary only",acceptAll:"Accept all",modalTitle:"Cookie settings",modalIntro:"Choose which categories you want to allow. More details in our",necessaryTitle:"Necessary",necessaryDesc:"Required to operate the website (e.g. login session, theme and cookie preference). Cannot be disabled.",externalTitle:"External media",externalDesc:"Google Maps and YouTube videos. Loading them transfers data (including your IP address) to Google.",analyticsTitle:"Analytics",analyticsDesc:"Google Analytics helps us understand how the website is used. This transfers data to Google.",cancel:"Cancel",saveSelection:"Save selection"},maintenance:{title:"Under maintenance",defaultMessage:"This area is currently being updated. Please check back shortly."},lightbox:{close:"Close",previous:"Previous image",next:"Next image"},home:{metaTitle:"Custom Car-Hifi Installations",metaDescription:"HifiPlanet – your car-hifi specialist in Amorbach, Germany. Choose your make and model, discover matching sound packages and get in touch, no obligation.",stickyCta:"Ready for your sound upgrade?",selectVehicle:"Select vehicle",getInTouch:"Get in touch",welcome:"Welcome to HifiPlanet",heroTitle:"Home of pure Sound",heroSubtitle:"Your car-hifi specialist for custom sound installations. Choose your vehicle, discover the right package and get in touch, no obligation – we take care of the rest.",stats:[{value:"20+",label:"years of experience"},{value:"Huge",label:"in-house 3D print farm"},{value:"In-house",label:"CNC & laser workshop"},{value:"International",label:"recognized car-hifi specialist"}],brandsHeading:"Brands we work with",youtubeBadge:"HifiPlanet presents",youtubeTitle:"The craft behind your sound",youtubeText:"Discover the artistry behind our work",youtubeCta:"Watch now",heroImageAlt:"Ground Zero subwoofer and amplifiers with purple ambient lighting",craftImageAlt:"Custom subwoofer build",adviceImageAlt:"Amplifier installation with ambient lighting",moreImageAlt:"High-end amplifier and subwoofer, studio shot",craftEyebrow:"Craftsmanship",craftTitle:"Precision work in every detail",craftText:"Whether custom-built subwoofer enclosures, integrated lighting or invisibly routed cabling – our own CNC, laser and 3D-printing production means we can build solutions you simply can't buy off the shelf.",adviceEyebrow:"Consultation",adviceTitle:"From the first idea to the final touch",adviceText:"Every vehicle and every requirement is different. That's why we advise you personally and without obligation – from a subtle upgrade to an uncompromising high-end system.",insightsTitle:"A look at our installations",insightsText:"From subtle sound upgrades to elaborate full installations – handcrafted in our workshop in Amorbach.",galleryAlts:["Custom subwoofer build with Ground Zero bass drivers","Amplifier installation with purple ambient lighting","Tweeter and midrange installation by Focal Utopia","Sony navigation system with Apple CarPlay in the cockpit","Installed tweeter in the trunk","Custom subwoofer installation with LED lighting in the trunk"],reviewsRating:"Rated 5.0 by 181 customers",reviewsRatingDynamic:(t,e)=>`Rated ${t.toFixed(1)} by ${e} customers`,reviewsText:"Here's what our customers say about us.",reviewsLink:"See all reviews on Google →",testimonials:[{name:"Thomas K.",text:"Found this gem through YouTube. Advice and recommendations are top-notch – the Tesla demo car reignited my passion for great sound."},{name:"Andreas I.",text:"Very professional advice and service. Even though I switched from VAG to Mercedes, everything was adapted smoothly. The 3-way speakers and two subwoofers deliver outstanding performance."},{name:"Thomas F.",text:"The complete Audi A4 B9 build exceeded my expectations. Professional from start to finish, with flawless workmanship and sound quality."},{name:"Drago G.",text:"Impressed by the CNC work shown on YouTube. Started with 3D-printed speaker rings for my Ford Mustang – it turned into a much bigger project."},{name:"Leonardo B.",text:"Great service and masterful craftsmanship. Clean installation, passion visible in every detail."},{name:"Marcel S.",text:"Unbeatable value for money. The team took a lot of time to find the exact solution for my budget."},{name:"Julia W.",text:"Finally a shop that takes motorhomes seriously too. The sound system in our camper now sounds like a living room."},{name:"Kevin R.",text:"Dash cam and alarm system installed cleanly in a single appointment, no visible cables. Highly recommended for anyone who values quality workmanship."},{name:"Sabrina H.",text:"My classic car now has modern sound without compromising the original look. Exactly what I was looking for."},{name:"Niklas P.",text:"From the first inquiry to the finished build, everything went smoothly. Honest advice with no sales pressure."}],moreTitle:"More than just car-hifi",moreText:"Besides custom sound installations, we also offer CNC machining, laser technology, 3D printing and more – all from a single source in our own workshop.",moreCta:"Discover all our services",faqHeading:"Frequently asked questions"},vehicleSelect:{metaTitle:"Select your vehicle",metaDescription:"Choose your vehicle make and model and discover matching car-hifi sound packages from HifiPlanet.",title:"Select your vehicle",intro:"Choose your make first, then your model – we'll show you the matching sound packages right away.",empty:"No brands have been added yet."},brandPage:{metaTitleFallback:"Select a model",metaDescription:t=>`Choose your ${t} model and discover matching car-hifi sound packages from HifiPlanet.`,loading:"Loading…",breadcrumbVehicles:"Vehicles",titleSuffix:"Select a model",empty:"No models have been added for this brand yet."},modelPage:{metaTitleFallback:"Sound packages",metaTitle:(t,e)=>`${t} ${e} sound packages`,metaDescription:(t,e)=>`Car-hifi sound packages for the ${t} ${e} including current prices – get in touch with HifiPlanet, no obligation.`,loading:"Loading…",breadcrumbVehicles:"Vehicles",titleSuffix:"Sound packages",empty:"No packages have been added for this model yet.",totalPrice:"from approx.",productLoading:"Loading product…",requestContact:"Request contact",featuredBadge:"Recommended",moreBullets:t=>t===1?"+ 1 more feature":`+ ${t} more features`,lessBullets:"Show less",wheelHint:"Scroll to browse"},leistungen:{metaTitle:"Services",metaDescription:"Car-hifi, motorhomes & caravans, classic cars, CNC machining, laser technology, 3D printing, alarm systems and dash cams – all from a single source at HifiPlanet in Amorbach.",title:"Our services",intro:"From custom sound installations to our own CNC and 3D-printing production – all from a single source in our workshop in Amorbach.",notListedTitle:"Don't see your project?",notListedText:"Just get in touch – we'll find the right solution together.",contact:"Get in touch"},contactPage:{metaTitle:"Contact",metaDescription:"Get in touch with HifiPlanet in Amorbach for your custom car-hifi project – we're happy to advise you, no obligation.",title:"Get in touch",heroEyebrow:"Contact",heroTitlePre:"Talk",heroTitleAccent:"to",heroTitlePost:"us.",heroSubtitle:"Whether it's a system, installation, or sound tuning for your car — write to us, we'll get back to you as soon as possible.",packageBoxTitle:"Your inquiry relates to",formTitle:"Send inquiry",sentTitle:"Inquiry sent ✓",sentText:"Thanks! We'll get back to you within one business day.",contextIntro:"Your inquiry relates to:",contextBrand:"Brand",contextModel:"Model",contextPackage:"Package",contextProduct:"Product",packagePrice:"Package price",upgrades:"Upgrades",optionalUpgrades:"Optional upgrades",totalWithUpgrades:"Total incl. upgrades",nameLabel:"Name *",namePlaceholder:"Max Mustermann",emailLabel:"Email *",emailPlaceholder:"max@mail.de",phoneLabel:"Phone",phonePlaceholder:"Optional",vinLabel:"Vehicle identification number (VIN)",vinPlaceholder:"Optional – helps us assess your vehicle",messageLabel:"Message",messagePlaceholder:"Tell us about your project – vehicle, desired sound, budget …",requiredHint:"* Required fields",sending:"Sending…",submit:"Send inquiry",cardTitle:"HiFi Planet Amorbach",address:"Address",phone:"Phone",email:"Email",hours:"Opening hours",hoursWeek:"Mon–Fri: 9:00 AM–6:00 PM",hoursSat:"Sat: 10:00 AM–1:00 PM",hoursWeekDays:"Mon–Fri",hoursWeekTime:"9:00 AM – 6:00 PM",hoursSatDay:"Sat",hoursSatTime:"10:00 AM – 1:00 PM",directionsTitle:"Directions",mapEmbedName:"The Google Maps map",mapOpenChip:"Open in Maps",routePlan:"Get directions",featurePremiumTitle:"Premium Sound",featurePremiumSub:"Highest quality",featureGermanyTitle:"Made in Germany",featureGermanySub:"Precision craftsmanship",featureIndividualTitle:"Custom-built",featureIndividualSub:"Tailored solutions",featureExpertsTitle:"Expert Team",featureExpertsSub:"Passion & know-how"},galleryOverview:{metaTitle:"Photo gallery",metaDescription:"A look at our car-hifi installations – sorted by brand. Choose a brand and explore the projects.",title:"Photo gallery",intro:"Choose a brand and explore our installations in detail.",loading:"Loading…",empty:"No gallery brands have been added yet."},galleryBrandPage:{metaTitleFallback:"Photo gallery",metaTitle:t=>`${t} installations`,metaDescription:t=>`A look at our ${t} car-hifi installations.`,loading:"Loading…",breadcrumbGallery:"Gallery",titleSuffix:"Select a project",empty:"No projects have been added for this brand yet."},galleryProjectPage:{metaTitleFallback:"Photo gallery",metaDescription:t=>`Photos of our ${t} installation.`,loading:"Loading…",breadcrumbGallery:"Gallery",empty:"No photos have been added for this project yet.",enlargeImage:"Enlarge image"}},Rc={de:jD,en:ED};function TD(){const t=localStorage.getItem("hifi-lang");return t==="de"||t==="en"?t:(navigator.language||"de").toLowerCase().startsWith("de")?"de":"en"}function Kp(t,e){return e.split(".").reduce((n,r)=>n==null?void 0:n[r],t)}const rN=v.createContext({language:"de",setLanguage:()=>{},toggleLanguage:()=>{},t:t=>{const e=Kp(Rc.de,t);return e!==void 0?e:t}});function Vy({children:t}){const[e,n]=v.useState(TD);v.useEffect(()=>{document.documentElement.setAttribute("lang",e),localStorage.setItem("hifi-lang",e)},[e]);const r=()=>n(i=>i==="de"?"en":"de"),s=i=>{const o=Rc[e]||Rc.de,a=Kp(o,i);if(a!==void 0)return a;const l=Kp(Rc.de,i);return l!==void 0?l:i};return c.jsx(rN.Provider,{value:{language:e,setLanguage:n,toggleLanguage:r,t:s},children:t})}function at(){return v.useContext(rN)}function sN({overHero:t=!1}){const{theme:e,toggleTheme:n}=CD(),{t:r}=at();return c.jsx("button",{onClick:n,"aria-label":r("themeToggle.label"),className:`rounded-full p-2 transition ${t?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:e==="dark"?c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:c.jsx("path",{d:"M12 3a1 1 0 011 1v1a1 1 0 11-2 0V4a1 1 0 011-1zm0 15a5 5 0 100-10 5 5 0 000 10zm9-6a1 1 0 010 2h-1a1 1 0 110-2h1zM4 12a1 1 0 010 2H3a1 1 0 110-2h1zm14.36-7.36a1 1 0 011.42 1.42l-.71.7a1 1 0 11-1.41-1.4l.7-.72zM5.64 18.36a1 1 0 011.41 1.41l-.7.71a1 1 0 11-1.42-1.41l.71-.71zm12.72 0l.71.7a1 1 0 11-1.41 1.42l-.71-.71a1 1 0 011.41-1.41zM6.34 5.64l-.7-.7A1 1 0 117.05 3.5l.7.71A1 1 0 016.34 5.64zM12 6a1 1 0 011-1v0a1 1 0 01-1 1zm0 12a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1z"})}):c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:c.jsx("path",{fillRule:"evenodd",d:"M9.53 2.25a.75.75 0 01.19.82 8.25 8.25 0 0011.03 11.03.75.75 0 011.01.99A10.5 10.5 0 1112.9 2.1a.75.75 0 011.63-.85z",clipRule:"evenodd"})})})}function Mt({name:t,className:e="h-6 w-6",...n}){return t?c.jsx(H2,{name:t,className:e,...n}):null}const iN=v.createContext(null);function MD({children:t}){const[e,n]=v.useState(null),[r,s]=v.useState(!0);v.useEffect(()=>{A.get("/auth/me").then(d=>n(d.authenticated===!1?null:d)).catch(()=>n(null)).finally(()=>s(!1))},[]);const i=async(d,h)=>{const f=await A.post("/auth/login",{username:d,password:h});return f.requires_2fa?{requires2fa:!0}:(n(f),{requires2fa:!1})},o=async d=>{const h=await A.post("/auth/verify-2fa",{code:d});n(h)},a=async()=>{await A.post("/auth/logout",{}),n(null)},l=async()=>{const d=await A.get("/auth/me");n(d.authenticated===!1?null:d)},u=d=>{var h;return!!e&&(e.is_super_admin||((h=e.permissions)==null?void 0:h.includes(d)))};return c.jsx(iN.Provider,{value:{user:e,loading:r,login:i,verifyTwoFactor:o,logout:a,refreshUser:l,hasPermission:u},children:t})}function Cn(){return v.useContext(iN)}const oN=v.createContext({phone:"09373 20 62 390",whatsapp:null,contact_email:"info@hifi-planet-amorbach.de",address_street:"Boxbrunner Str. 20a",address_zip:"63916",address_city:"Amorbach",logo_path:null,logo_dark_path:null,business_hours:null,hero_image_path:null,ga_measurement_id:null,gallery_card_text_x:0,gallery_card_text_y:100,site_font:null}),PD=oN.Provider;function rs(){return v.useContext(oN)}const Ka="/assets/logo-BNfZDkmN.png",Su="/assets/logo-dark-R-ckaBhx.png",AD="https://www.audio4cars.de/",$y=t=>(t||"").replace(/[^\d+]/g,""),Hy=70,DD=500;function LD({className:t}){return c.jsxs("svg",{viewBox:"0 0 3 2",className:t,"aria-hidden":"true",children:[c.jsx("rect",{width:"3",height:"0.667",y:"0",fill:"#000"}),c.jsx("rect",{width:"3",height:"0.667",y:"0.667",fill:"#D00"}),c.jsx("rect",{width:"3",height:"0.666",y:"1.334",fill:"#FFCE00"})]})}function RD({className:t}){return c.jsxs("svg",{viewBox:"0 0 60 30",className:t,"aria-hidden":"true",children:[c.jsx("clipPath",{id:"fgb-t",children:c.jsx("path",{d:"M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"})}),c.jsx("path",{d:"M0,0 v30 h60 v-30 z",fill:"#00247d"}),c.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#fff",strokeWidth:"6"}),c.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",clipPath:"url(#fgb-t)",stroke:"#cf142b",strokeWidth:"4"}),c.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#fff",strokeWidth:"10"}),c.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#cf142b",strokeWidth:"6"})]})}const Gh=[{code:"de",label:"Deutsch",Flag:LD},{code:"en",label:"English",Flag:RD}];function _D({overHero:t=!1}){const{language:e,setLanguage:n,t:r}=at(),[s,i]=v.useState(!1),o=v.useRef(null),a=Gh.find(l=>l.code===e)||Gh[0];return v.useEffect(()=>{if(!s)return;const l=d=>{o.current&&!o.current.contains(d.target)&&i(!1)},u=d=>{d.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",l),document.addEventListener("keydown",u),()=>{document.removeEventListener("mousedown",l),document.removeEventListener("keydown",u)}},[s]),c.jsxs("div",{className:"relative",ref:o,children:[c.jsxs("button",{type:"button",onClick:()=>i(l=>!l),"aria-haspopup":"listbox","aria-expanded":s,"aria-label":r("languageToggle.label"),className:`flex items-center gap-1 rounded-full p-1.5 transition ${t?"hover:bg-white/10":"hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[c.jsx("span",{className:`block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ${t?"ring-white/50":"ring-neutral-300 dark:ring-neutral-600"}`,children:c.jsx(a.Flag,{className:"h-full w-full"})}),c.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:`h-3 w-3 transition-transform ${t?"text-white/70":"text-neutral-400"} ${s?"rotate-180":""}`,children:c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"})})]}),s&&c.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-2 min-w-[9rem] overflow-hidden rounded-lg border border-neutral-200 bg-white py-1 shadow-lg dark:border-neutral-700 dark:bg-neutral-900",children:Gh.map(l=>c.jsxs("button",{type:"button",role:"option","aria-selected":l.code===e,onClick:()=>{n(l.code),i(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition hover:bg-neutral-100 dark:hover:bg-neutral-800 ${l.code===e?"font-semibold text-brand-600 dark:text-brand-400":"text-neutral-700 dark:text-neutral-200"}`,children:[c.jsx("span",{className:"block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ring-neutral-300 dark:ring-neutral-600",children:c.jsx(l.Flag,{className:"h-full w-full"})}),l.label]},l.code))})]})}function ID(){const[t,e]=v.useState(!1),[n,r]=v.useState(!1),[s,i]=v.useState(!1),{user:o}=Cn(),{phone:a,whatsapp:l,logo_path:u,logo_dark_path:d}=rs(),{t:h}=at(),f=l?8:7,m=ln().pathname==="/",[g,y]=v.useState(!m);v.useEffect(()=>{if(!m){y(!0);return}const C=()=>y(window.scrollY>24);return C(),window.addEventListener("scroll",C,{passive:!0}),()=>window.removeEventListener("scroll",C)},[m]);const b=m&&!g;v.useEffect(()=>{if(t){r(!0);let S;const N=requestAnimationFrame(()=>{S=requestAnimationFrame(()=>i(!0))});return()=>{cancelAnimationFrame(N),S&&cancelAnimationFrame(S)}}i(!1);const C=DD+(f-1)*Hy,E=setTimeout(()=>r(!1),C);return()=>clearTimeout(E)},[t,f]);const x=()=>`transition-all duration-500 ease-out ${s?"opacity-100":"opacity-0"}`,k=C=>({transitionDelay:`${(s?C:f-1-C)*Hy}ms`,transform:s?"translateY(0)":"translateY(-140px)"}),w=o&&c.jsx(ee,{to:"/admin","aria-label":h("nav.adminPanel"),title:h("nav.adminPanel"),className:`rounded-full p-2 transition ${b?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:c.jsx(Mt,{name:"layout-dashboard",className:"h-5 w-5"})});return c.jsxs("header",{className:`sticky top-0 z-30 border-b transition-colors duration-300 ${b?"border-transparent bg-transparent":"border-neutral-200 bg-white/90 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/90"}`,children:[c.jsxs("div",{className:"mx-auto grid max-w-6xl grid-cols-[1fr_auto_1fr] items-center gap-3 px-4 py-3 sm:px-6",children:[c.jsx("div",{className:"flex items-center justify-self-start",children:c.jsx("button",{onClick:()=>e(!0),"aria-label":h("nav.openMenu"),className:`rounded-md p-2 transition ${b?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})}),c.jsxs(ee,{to:"/",className:"flex items-center justify-self-center rounded-lg px-2 py-1",children:[c.jsx("img",{src:u||Ka,alt:"HifiPlanet",className:"h-14 w-auto dark:hidden sm:h-16"}),c.jsx("img",{src:d||Su,alt:"HifiPlanet",className:"hidden h-14 w-auto dark:block sm:h-16"})]}),c.jsxs("div",{className:"flex items-center justify-self-end gap-1",children:[w,!t&&c.jsx(_D,{overHero:b}),c.jsx(sN,{overHero:b})]})]}),n&&$d.createPortal(c.jsx("div",{className:"fixed inset-0 z-[100] overflow-y-auto text-left backdrop-blur-xl",style:{background:"linear-gradient(135deg, rgba(241,245,249,0.55) 0%, rgba(227,240,207,0.55) 50%, rgba(248,250,252,0.55) 100%)"},children:c.jsxs("div",{className:"relative mx-auto flex min-h-full max-w-6xl flex-col items-start justify-center gap-5 py-24 pl-6 pr-8 sm:pl-8",children:[c.jsxs("button",{onClick:()=>e(!1),"aria-label":h("nav.closeMenu"),className:"absolute left-6 top-8 flex items-center gap-2 text-neutral-600 hover:text-brand-600 sm:left-8 sm:top-[65px]",children:[c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})}),c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:h("nav.close")})]}),c.jsx(ee,{to:"/fahrzeuge",onClick:()=>e(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${x()}`,style:k(0),children:h("nav.vehicles")}),c.jsx(ee,{to:"/leistungen",onClick:()=>e(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${x()}`,style:k(1),children:h("nav.services")}),c.jsx(ee,{to:"/galerie",onClick:()=>e(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${x()}`,style:k(2),children:h("nav.gallery")}),c.jsx(ee,{to:"/kontakt",onClick:()=>e(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${x()}`,style:k(3),children:h("nav.contact")}),c.jsx("div",{className:`h-px w-16 bg-brand-500/60 ${x()}`,style:k(4)}),a&&c.jsxs("a",{href:`tel:${$y(a)}`,className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${x()}`,style:k(5),children:[c.jsx(Mt,{name:"phone",className:"h-4 w-4"}),a]}),l&&c.jsxs("a",{href:`https://wa.me/${$y(l).replace(/^0/,"49").replace("+","")}`,target:"_blank",rel:"noopener noreferrer",className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${x()}`,style:k(6),children:[c.jsx(Mt,{name:"message-circle",className:"h-4 w-4"}),h("nav.whatsapp")]}),c.jsxs("a",{href:AD,target:"_blank",rel:"noopener noreferrer",className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${x()}`,style:k(l?7:6),children:[c.jsx(Mt,{name:"shopping-bag",className:"h-4 w-4"}),h("nav.shop")]})]})}),document.body)]})}const Wy="hifiplanet-cookie-consent",aN={necessary:!0,external:!1,analytics:!1},lN=v.createContext({consent:aN,decided:!1,settingsOpen:!1,acceptAll:()=>{},rejectNonEssential:()=>{},saveCustom:()=>{},openSettings:()=>{},closeSettings:()=>{}});function OD({children:t}){const[e,n]=v.useState(aN),[r,s]=v.useState(!1),[i,o]=v.useState(!1);v.useEffect(()=>{try{const p=localStorage.getItem(Wy);if(p){const m=JSON.parse(p);n({necessary:!0,external:!!m.external,analytics:!!m.analytics}),s(!0)}}catch{}},[]);const a=v.useCallback(p=>{n(p),s(!0),o(!1),localStorage.setItem(Wy,JSON.stringify({...p,decidedAt:new Date().toISOString()}))},[]),l=v.useCallback(()=>a({necessary:!0,external:!0,analytics:!0}),[a]),u=v.useCallback(()=>a({necessary:!0,external:!1,analytics:!1}),[a]),d=v.useCallback(p=>a({necessary:!0,external:!!p.external,analytics:!!p.analytics}),[a]),h=v.useCallback(()=>o(!0),[]),f=v.useCallback(()=>o(!1),[]);return c.jsx(lN.Provider,{value:{consent:e,decided:r,settingsOpen:i,acceptAll:l,rejectNonEssential:u,saveCustom:d,openSettings:h,closeSettings:f},children:t})}function go(){return v.useContext(lN)}const BD=["mon","tue","wed","thu","fri","sat","sun"],zD=["sun","mon","tue","wed","thu","fri","sat"],qh={mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",sun:"So"};function FD(t){const e=new Date,n=t==null?void 0:t[zD[e.getDay()]];if(!n||n.closed||!n.open||!n.close)return!1;const r=e.getHours()*60+e.getMinutes(),[s,i]=n.open.split(":").map(Number),[o,a]=n.close.split(":").map(Number);return r>=s*60+i&&r{const s=VD(t==null?void 0:t[r])||e,i=n[n.length-1];i&&i.label===s?i.days=`${i.firstLabel}-${qh[r]}`:n.push({key:r,days:qh[r],firstLabel:qh[r],label:s})}),n}const $D=t=>(t||"").replace(/[^\d+]/g,"");function HD(){const{phone:t,contact_email:e,address_street:n,address_zip:r,address_city:s,business_hours:i}=rs(),o=FD(i),{openSettings:a}=go(),{pathname:l}=ln(),u=l==="/",{t:d}=at(),h=[n,[r,s].filter(Boolean).join(" ")].filter(Boolean).join(", "),f=`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(h)}`,p=cN(i,d("footer.closed"));return c.jsxs("footer",{className:`border-t border-neutral-200 bg-neutral-50 py-10 text-sm text-neutral-600 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-300 ${u?"pb-24":""}`,children:[c.jsxs("div",{className:"mx-auto grid max-w-6xl gap-4 px-4 sm:grid-cols-3 sm:px-6",children:[c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(Mt,{name:"map-pin",className:"h-4 w-4 text-brand-500"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:"HifiPlanet"})]}),n&&c.jsx("p",{children:n}),(r||s)&&c.jsx("p",{children:[r,s].filter(Boolean).join(" ")}),c.jsxs("a",{href:f,target:"_blank",rel:"noopener noreferrer",className:"mt-4 flex items-center justify-center gap-1.5 rounded-md bg-brand-500 px-3 py-2 text-xs font-semibold text-white hover:bg-brand-600",children:[c.jsx(Mt,{name:"navigation",className:"h-3.5 w-3.5"}),d("footer.routePlan")]})]}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(Mt,{name:"phone",className:"h-4 w-4 text-brand-500"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:d("footer.contactHeading")})]}),c.jsx("p",{children:c.jsx("a",{href:`tel:${$D(t)}`,className:"inline-block py-1 hover:text-brand-500",children:t})}),c.jsx("p",{children:c.jsx("a",{href:`mailto:${e}`,className:"inline-block py-1 hover:text-brand-500",children:e})}),c.jsx(ee,{to:"/kontakt",className:"mt-4 flex items-center justify-center gap-1.5 rounded-md border border-neutral-300 px-3 py-2 text-xs font-semibold text-neutral-700 hover:border-brand-500 hover:text-brand-600 dark:border-neutral-700 dark:text-neutral-200",children:d("footer.contactForm")})]}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Mt,{name:"clock",className:"h-4 w-4 text-brand-500"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:d("footer.hoursHeading")})]}),c.jsxs("span",{className:`flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-semibold ${o?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400"}`,children:[c.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${o?"bg-green-500":"bg-neutral-400"}`}),d(o?"footer.open":"footer.closed")]})]}),c.jsx("dl",{className:"space-y-1.5",children:p.map(m=>c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:m.days}),c.jsx("dd",{className:"font-medium text-neutral-700 dark:text-neutral-200",children:m.label})]},m.key))})]})]}),c.jsx("div",{className:"mx-auto mt-8 max-w-6xl border-t border-neutral-200 px-4 pt-6 text-center text-xs text-neutral-500 dark:border-neutral-800 dark:text-neutral-400 sm:px-6",children:c.jsxs("p",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[c.jsx("span",{children:d("footer.copyright")(new Date().getFullYear())}),c.jsx("span",{children:"·"}),c.jsx(ee,{to:"/impressum",className:"hover:text-brand-500",children:d("footer.imprint")}),c.jsx("span",{children:"·"}),c.jsx(ee,{to:"/datenschutz",className:"hover:text-brand-500",children:d("footer.privacy")}),c.jsx("span",{children:"·"}),c.jsx(ee,{to:"/agb",className:"hover:text-brand-500",children:d("footer.terms")}),c.jsx("span",{children:"·"}),c.jsx("button",{type:"button",onClick:a,className:"hover:text-brand-500",children:d("footer.cookieSettings")})]})})]})}const s0=v.createContext({});function Yr(t){const e=v.useRef(null);return e.current===null&&(e.current=t()),e.current}const WD=typeof window<"u",ml=WD?v.useLayoutEffect:v.useEffect,Gd=v.createContext(null);function i0(t,e){t.indexOf(e)===-1&&t.push(e)}function Nu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Nn=(t,e,n)=>n>e?e:n{};const Xr={},uN=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),dN=t=>typeof t=="object"&&t!==null,hN=t=>/^0[^.\s]+$/u.test(t);function fN(t){let e;return()=>(e===void 0&&(e=t()),e)}const Lt=t=>t,gl=(...t)=>t.reduce((e,n)=>r=>n(e(r))),qi=(t,e,n)=>{const r=e-t;return r?(n-t)/r:1};class a0{constructor(){this.subscriptions=[]}add(e){return i0(this.subscriptions,e),()=>Nu(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;it*1e3,en=t=>t/1e3,l0=(t,e)=>e?t*(1e3/e):0,pN=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,UD=1e-7,KD=12;function GD(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=pN(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>UD&&++aGD(i,0,1,t,n);return i=>i===0||i===1?i:pN(s(i),e,r)}const mN=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,gN=t=>e=>1-t(1-e),xN=xl(.33,1.53,.69,.99),c0=gN(xN),yN=mN(c0),bN=t=>t>=1?1:(t*=2)<1?.5*c0(t):.5*(2-Math.pow(2,-10*(t-1))),u0=t=>1-Math.sin(Math.acos(t)),vN=gN(u0),kN=mN(u0),qD=xl(.42,0,1,1),JD=xl(0,0,.58,1),wN=xl(.42,0,.58,1),YD=t=>Array.isArray(t)&&typeof t[0]!="number",SN=t=>Array.isArray(t)&&typeof t[0]=="number",XD={linear:Lt,easeIn:qD,easeInOut:wN,easeOut:JD,circIn:u0,circInOut:kN,circOut:vN,backIn:c0,backInOut:yN,backOut:xN,anticipate:bN},ZD=t=>typeof t=="string",Uy=t=>{if(SN(t)){o0(t.length===4);const[e,n,r,s]=t;return xl(e,n,r,s)}else if(ZD(t))return XD[t];return t},Jl=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function QD(t){let e=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){i.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,d=!1,h=!1)=>{const p=h&&r?e:n;return d&&i.add(u),p.add(u),u},cancel:u=>{n.delete(u),i.delete(u)},process:u=>{if(o=u,r){s=!0;return}r=!0;const d=e;e=n,n=d,e.forEach(a),e.clear(),r=!1,s&&(s=!1,l.process(u))}};return l}const e3=40;function NN(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Jl.reduce((k,w)=>(k[w]=QD(i),k),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:d,update:h,preRender:f,render:p,postRender:m}=o,g=()=>{const k=Xr.useManualTiming,w=k?s.timestamp:performance.now();n=!1,k||(s.delta=r?1e3/60:Math.max(Math.min(w-s.timestamp,e3),1)),s.timestamp=w,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),d.process(s),h.process(s),f.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(g))},y=()=>{n=!0,r=!0,s.isProcessing||t(g)};return{schedule:Jl.reduce((k,w)=>{const C=o[w];return k[w]=(E,S=!1,N=!1)=>(n||y(),C.schedule(E,S,N)),k},{}),cancel:k=>{for(let w=0;w(_c===void 0&&yt.set(Ge.isProcessing||Xr.useManualTiming?Ge.timestamp:performance.now()),_c),set:t=>{_c=t,queueMicrotask(t3)}},CN=t=>e=>typeof e=="string"&&e.startsWith(t),jN=CN("--"),n3=CN("var(--"),d0=t=>n3(t)?r3.test(t.split("/*")[0].trim()):!1,r3=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ky(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const xo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ga={...xo,transform:t=>Nn(0,1,t)},Yl={...xo,default:1},oa=t=>Math.round(t*1e5)/1e5,h0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function s3(t){return t==null}const i3=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,f0=(t,e)=>n=>!!(typeof n=="string"&&i3.test(n)&&n.startsWith(t)||e&&!s3(n)&&Object.prototype.hasOwnProperty.call(n,e)),EN=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(h0);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},o3=t=>Nn(0,255,t),Yh={...xo,transform:t=>Math.round(o3(t))},Ns={test:f0("rgb","red"),parse:EN("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Yh.transform(t)+", "+Yh.transform(e)+", "+Yh.transform(n)+", "+oa(Ga.transform(r))+")"};function a3(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Gp={test:f0("#"),parse:a3,transform:Ns.transform},yl=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Wn=yl("deg"),In=yl("%"),G=yl("px"),l3=yl("vh"),c3=yl("vw"),Gy={...In,parse:t=>In.parse(t)/100,transform:t=>In.transform(t*100)},Ti={test:f0("hsl","hue"),parse:EN("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+In.transform(oa(e))+", "+In.transform(oa(n))+", "+oa(Ga.transform(r))+")"},Ie={test:t=>Ns.test(t)||Gp.test(t)||Ti.test(t),parse:t=>Ns.test(t)?Ns.parse(t):Ti.test(t)?Ti.parse(t):Gp.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Ns.transform(t):Ti.transform(t),getAnimatableNone:t=>{const e=Ie.parse(t);return e.alpha=0,Ie.transform(e)}},u3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function d3(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(h0))==null?void 0:e.length)||0)+(((n=t.match(u3))==null?void 0:n.length)||0)>0}const TN="number",MN="color",h3="var",f3="var(",qy="${}",p3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ji(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(p3,l=>(Ie.test(l)?(r.color.push(i),s.push(MN),n.push(Ie.parse(l))):l.startsWith(f3)?(r.var.push(i),s.push(h3),n.push(l)):(r.number.push(i),s.push(TN),n.push(parseFloat(l))),++i,qy)).split(qy);return{values:n,split:a,indexes:r,types:s}}function m3(t){return Ji(t).values}function PN({split:t,types:e}){const n=t.length;return r=>{let s="";for(let i=0;itypeof t=="number"?0:Ie.test(t)?Ie.getAnimatableNone(t):t,y3=(t,e)=>typeof t=="number"?e!=null&&e.trim().endsWith("/")?t:0:x3(t);function b3(t){const e=Ji(t);return PN(e)(e.values.map((r,s)=>y3(r,e.split[s])))}const kn={test:d3,parse:m3,createTransformer:g3,getAnimatableNone:b3};function Xh(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function v3({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=Xh(l,a,t+1/3),i=Xh(l,a,t),o=Xh(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function Cu(t,e){return n=>n>0?e:t}const pe=(t,e,n)=>t+(e-t)*n,Zh=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},k3=[Gp,Ns,Ti],w3=t=>k3.find(e=>e.test(t));function Jy(t){const e=w3(t);if(!e)return!1;let n=e.parse(t);return e===Ti&&(n=v3(n)),n}const Yy=(t,e)=>{const n=Jy(t),r=Jy(e);if(!n||!r)return Cu(t,e);const s={...n};return i=>(s.red=Zh(n.red,r.red,i),s.green=Zh(n.green,r.green,i),s.blue=Zh(n.blue,r.blue,i),s.alpha=pe(n.alpha,r.alpha,i),Ns.transform(s))},qp=new Set(["none","hidden"]);function S3(t,e){return qp.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function N3(t,e){return n=>pe(t,e,n)}function p0(t){return typeof t=="number"?N3:typeof t=="string"?d0(t)?Cu:Ie.test(t)?Yy:E3:Array.isArray(t)?AN:typeof t=="object"?Ie.test(t)?Yy:C3:Cu}function AN(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>p0(i)(i,e[o]));return i=>{for(let o=0;o{for(const i in r)n[i]=r[i](s);return n}}function j3(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=kn.createTransformer(e),r=Ji(t),s=Ji(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?qp.has(t)&&!s.values.length||qp.has(e)&&!r.values.length?S3(t,e):gl(AN(j3(r,s),s.values),n):Cu(t,e)};function DN(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?pe(t,e,n):p0(t)(t,e)}const T3=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ae.update(e,n),stop:()=>an(e),now:()=>Ge.isProcessing?Ge.timestamp:yt.now()}},LN=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i=ju?1/0:e}function M3(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(m0(r),ju);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:en(s)}}const Ae={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Jp(t,e){return t*Math.sqrt(1-e*e)}const P3=12;function A3(t,e,n){let r=n;for(let s=1;s{const d=u*o,h=d*t,f=d-n,p=Jp(u,o),m=Math.exp(-h);return Qh-f/p*m},i=u=>{const h=u*o*t,f=h*n+n,p=Math.pow(o,2)*Math.pow(u,2)*t,m=Math.exp(-h),g=Jp(Math.pow(u,2),o);return(-s(u)+Qh>0?-1:1)*((f-p)*m)/g}):(s=u=>{const d=Math.exp(-u*t),h=(u-n)*t+1;return-Qh+d*h},i=u=>{const d=Math.exp(-u*t),h=(n-u)*(t*t);return d*h});const a=5/t,l=A3(s,i,a);if(t=zt(t),isNaN(l))return{stiffness:Ae.stiffness,damping:Ae.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const L3=["duration","bounce"],R3=["stiffness","damping","mass"];function Xy(t,e){return e.some(n=>t[n]!==void 0)}function _3(t){let e={velocity:Ae.velocity,stiffness:Ae.stiffness,damping:Ae.damping,mass:Ae.mass,isResolvedFromDuration:!1,...t};if(!Xy(t,R3)&&Xy(t,L3))if(e.velocity=0,t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*Nn(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Ae.mass,stiffness:s,damping:i}}else{const n=D3({...t,velocity:0});e={...e,...n,mass:Ae.mass},e.isResolvedFromDuration=!0}return e}function Eu(t=Ae.visualDuration,e=Ae.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:p}=_3({...n,velocity:-en(n.velocity||0)}),m=f||0,g=u/(2*Math.sqrt(l*d)),y=o-i,b=en(Math.sqrt(l/d)),x=Math.abs(y)<5;r||(r=x?Ae.restSpeed.granular:Ae.restSpeed.default),s||(s=x?Ae.restDelta.granular:Ae.restDelta.default);let k,w,C,E,S,N;if(g<1)C=Jp(b,g),E=(m+g*b*y)/C,k=j=>{const T=Math.exp(-g*b*j);return o-T*(E*Math.sin(C*j)+y*Math.cos(C*j))},S=g*b*E+y*C,N=g*b*y-E*C,w=j=>Math.exp(-g*b*j)*(S*Math.sin(C*j)+N*Math.cos(C*j));else if(g===1){k=T=>o-Math.exp(-b*T)*(y+(m+b*y)*T);const j=m+b*y;w=T=>Math.exp(-b*T)*(b*j*T-m)}else{const j=b*Math.sqrt(g*g-1);k=L=>{const W=Math.exp(-g*b*L),B=Math.min(j*L,300);return o-W*((m+g*b*y)*Math.sinh(B)+j*y*Math.cosh(B))/j};const T=(m+g*b*y)/j,R=g*b*T-y*j,$=g*b*y-T*j;w=L=>{const W=Math.exp(-g*b*L),B=Math.min(j*L,300);return W*(R*Math.sinh(B)+$*Math.cosh(B))}}const M={calculatedDuration:p&&h||null,velocity:j=>zt(w(j)),next:j=>{if(!p&&g<1){const R=Math.exp(-g*b*j),$=Math.sin(C*j),L=Math.cos(C*j),W=o-R*(E*$+y*L),B=zt(R*(S*$+N*L));return a.done=Math.abs(B)<=r&&Math.abs(o-W)<=s,a.value=a.done?o:W,a}const T=k(j);if(p)a.done=j>=h;else{const R=zt(w(j));a.done=Math.abs(R)<=r&&Math.abs(o-T)<=s}return a.value=a.done?o:T,a},toString:()=>{const j=Math.min(m0(M),ju),T=LN(R=>M.next(j*R).value,j,30);return j+"ms "+T},toTransition:()=>{}};return M}Eu.applyToOptions=t=>{const e=M3(t,100,Eu);return t.ease=e.ease,t.duration=zt(e.duration),t.type="keyframes",t};const I3=5;function RN(t,e,n){const r=Math.max(e-I3,0);return l0(n-t(r),e-r)}function Yp({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const h=t[0],f={done:!1,value:h},p=N=>a!==void 0&&Nl,m=N=>a===void 0?l:l===void 0||Math.abs(a-N)-g*Math.exp(-N/r),k=N=>b+x(N),w=N=>{const M=x(N),j=k(N);f.done=Math.abs(M)<=u,f.value=f.done?b:j};let C,E;const S=N=>{p(f.value)&&(C=N,E=Eu({keyframes:[f.value,m(f.value)],velocity:RN(k,N,f.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return S(0),{calculatedDuration:null,next:N=>{let M=!1;return!E&&C===void 0&&(M=!0,w(N),S(N)),C!==void 0&&N>=C?E.next(N-C):(!M&&w(N),f)}}}function O3(t,e,n){const r=[],s=n||Xr.mix||DN,i=t.length-1;for(let o=0;oe[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=O3(e,r,s),l=a.length,u=d=>{if(o&&d1)for(;hu(Nn(t[0],t[i-1],d)):u}function B3(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=qi(0,e,r);t.push(pe(n,1,s))}}function _N(t){const e=[0];return B3(e,t.length-1),e}function z3(t,e){return t.map(n=>n*e)}function F3(t,e){return t.map(()=>e||wN).splice(0,t.length-1)}function aa({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=YD(r)?r.map(Uy):Uy(r),i={done:!1,value:e[0]},o=z3(n&&n.length===e.length?n:_N(e),t),a=g0(o,e,{ease:Array.isArray(s)?s:F3(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const V3=t=>t!==null;function qd(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(V3),a=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const $3={decay:Yp,inertia:Yp,tween:aa,keyframes:aa,spring:Eu};function IN(t){typeof t.type=="string"&&(t.type=$3[t.type])}class x0{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const H3=t=>t/100;class qa extends x0{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==yt.now()&&this.tick(yt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;IN(e);const{type:n=aa,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const l=n||aa;l!==aa&&typeof a[0]!="number"&&(this.mixKeyframes=gl(H3,DN(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=m0(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:f,repeatDelay:p,type:m,onUpdate:g,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const b=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let k=this.currentTime,w=r;if(h){const N=Math.min(this.currentTime,s)/a;let M=Math.floor(N),j=N%1;!j&&N>=1&&(j=1),j===1&&M--,M=Math.min(M,h+1),!!(M%2)&&(f==="reverse"?(j=1-j,p&&(j-=p/a)):f==="mirror"&&(w=o)),k=Nn(0,1,j)*a}let C;x?(this.delayState.value=d[0],C=this.delayState):C=w.next(k),i&&!x&&(C.value=i(C.value));let{done:E}=C;!x&&l!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return S&&m!==Yp&&(C.value=qd(d,this.options,y,this.speed)),g&&g(C.value),S&&this.finish(),C}then(e,n){return this.finished.then(e,n)}get duration(){return en(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+en(e)}get time(){return en(this.currentTime)}set time(e){e=zt(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const n=this.generator.next(e).value;return RN(r=>this.generator.next(r).value,e,n)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;n&&this.driver&&this.updateTime(yt.now()),this.playbackSpeed=e,n&&this.driver&&(this.time=en(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=T3,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(yt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function W3(t){for(let e=1;et*180/Math.PI,Xp=t=>{const e=Cs(Math.atan2(t[1],t[0]));return Zp(e)},U3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Xp,rotateZ:Xp,skewX:t=>Cs(Math.atan(t[1])),skewY:t=>Cs(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Zp=t=>(t=t%360,t<0&&(t+=360),t),Zy=Xp,Qy=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),eb=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),K3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Qy,scaleY:eb,scale:t=>(Qy(t)+eb(t))/2,rotateX:t=>Zp(Cs(Math.atan2(t[6],t[5]))),rotateY:t=>Zp(Cs(Math.atan2(-t[2],t[0]))),rotateZ:Zy,rotate:Zy,skewX:t=>Cs(Math.atan(t[4])),skewY:t=>Cs(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Qp(t){return t.includes("scale")?1:0}function em(t,e){if(!t||t==="none")return Qp(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=K3,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=U3,s=a}if(!s)return Qp(e);const i=r[e],o=s[1].split(",").map(q3);return typeof i=="function"?i(o):o[i]}const G3=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return em(n,e)};function q3(t){return parseFloat(t.trim())}const yo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],bo=new Set([...yo,"pathRotation"]),tb=t=>t===xo||t===G,J3=new Set(["x","y","z"]),Y3=yo.filter(t=>!J3.has(t));function X3(t){const e=[];return Y3.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const Mr={width:({x:t},{paddingLeft:e="0",paddingRight:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},height:({y:t},{paddingTop:e="0",paddingBottom:n="0",boxSizing:r})=>{const s=t.max-t.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(n)},top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>em(e,"x"),y:(t,{transform:e})=>em(e,"y")};Mr.translateX=Mr.x;Mr.translateY=Mr.y;const Rs=new Set;let tm=!1,nm=!1,rm=!1;function ON(){if(nm){const t=Array.from(Rs).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=X3(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}nm=!1,tm=!1,Rs.forEach(t=>t.complete(rm)),Rs.clear()}function BN(){Rs.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(nm=!0)})}function Z3(){rm=!0,BN(),ON(),rm=!1}class y0{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(Rs.add(this),tm||(tm=!0,ae.read(BN),ae.resolveKeyframes(ON))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}W3(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Rs.delete(this)}cancel(){this.state==="scheduled"&&(Rs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Q3=t=>t.startsWith("--");function zN(t,e,n){Q3(e)?t.style.setProperty(e,n):t.style[e]=n}const e4={};function b0(t,e){const n=fN(t);return()=>e4[e]??n()}const v0=b0(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),FN=b0(()=>window.ViewTimeline!==void 0,"viewTimeline"),VN=b0(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wo=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,nb={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wo([0,.65,.55,1]),circOut:Wo([.55,0,1,.45]),backIn:Wo([.31,.01,.66,-.59]),backOut:Wo([.33,1.53,.69,.99])};function $N(t,e){if(t)return typeof t=="function"?VN()?LN(t,e):"ease-out":SN(t)?Wo(t):Array.isArray(t)?t.map(n=>$N(n,e)||nb.easeOut):nb[t]}function t4(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const h=$N(a,s);Array.isArray(h)&&(d.easing=h);const f={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(d,f)}function HN(t){return typeof t=="function"&&"applyToOptions"in t}function n4({type:t,...e}){return HN(t)&&VN()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class WN extends x0{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,o0(typeof e.type!="string");const u=n4(e);this.animation=t4(n,r,s,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=qd(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),zN(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const e=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return en(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+en(e)}get time(){return en(Number(this.animation.currentTime)||0)}set time(e){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=zt(e),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&v0()?(this.animation.timeline=e,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Lt):s(this)}}const UN={anticipate:bN,backInOut:yN,circInOut:kN};function r4(t){return t in UN}function s4(t){typeof t.ease=="string"&&r4(t.ease)&&(t.ease=UN[t.ease])}const ef=10;class i4 extends WN{constructor(e){s4(e),IN(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new qa({...o,autoplay:!1}),l=Math.max(ef,yt.now()-this.startTime),u=Nn(0,ef,l-ef),d=a.sample(l).value,{name:h}=this.options;i&&h&&zN(i,h,d),n.setWithVelocity(a.sample(Math.max(0,l-u)).value,d,u),a.stop()}}const rb=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(kn.test(t)||t==="0")&&!t.startsWith("url("));function o4(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function h4(t){var h;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=t;if(!(((h=e==null?void 0:e.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return d4()&&n&&(KN.has(n)||u4.has(n)&&c4(a))&&(n!=="transform"||!d)&&!u&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const f4=40;class p4 extends x0{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:d,...h}){var m;super(),this.stop=()=>{var g,y;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=yt.now();const f={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:u,element:d,...h},p=(d==null?void 0:d.KeyframeResolver)||y0;this.keyframeResolver=new p(a,(g,y,b)=>this.onKeyframesResolved(g,y,f,!b),l,u,d),(m=this.keyframeResolver)==null||m.scheduleResolve()}onKeyframesResolved(e,n,r,s){var b,x;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=yt.now();let h=!0;a4(e,i,o,a)||(h=!1,(Xr.instantAnimations||!l)&&(d==null||d(qd(e,r,n))),e[0]=e[e.length-1],sm(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>f4?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},m=h&&!u&&h4(p),g=(x=(b=p.motionValue)==null?void 0:b.owner)==null?void 0:x.current;let y;if(m)try{y=new i4({...p,element:g})}catch{y=new qa(p)}else y=new qa(p);y.finished.then(()=>{this.notifyFinished()}).catch(Lt),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),Z3()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function GN(t,e,n,r=0,s=1){const i=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const sb=30,m4=t=>!isNaN(parseFloat(t)),la={current:void 0};class g4{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=yt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=yt.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=m4(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new a0);const r=this.events[e].add(n);return e==="change"?()=>{r(),ae.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return la.current&&la.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=yt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>sb)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,sb);return l0(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function xn(t,e){return new g4(t,e)}function qN(t,e){if(t!=null&&t.inherit&&e){const{inherit:n,...r}=t;return{...e,...r}}return t}function k0(t,e){const n=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return n!==t?qN(n,t):n}const x4={type:"spring",stiffness:500,damping:25,restSpeed:10},y4=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),b4={type:"keyframes",duration:.8},v4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},k4=(t,{keyframes:e})=>e.length>2?b4:bo.has(t)?t.startsWith("scale")?y4(e[1]):x4:v4,w4=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function S4(t){for(const e in t)if(!w4.has(e))return!0;return!1}const w0=(t,e,n,r={},s,i)=>o=>{const a=k0(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-zt(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};S4(a)||Object.assign(d,k4(t,d)),d.duration&&(d.duration=zt(d.duration)),d.repeatDelay&&(d.repeatDelay=zt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(sm(d),d.delay===0&&(h=!0)),(Xr.instantAnimations||Xr.skipAnimations||s!=null&&s.shouldSkipAnimations||a.skipAnimations)&&(h=!0,sm(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,h&&!i&&e.get()!==void 0){const f=qd(d.keyframes,a);if(f!==void 0){ae.update(()=>{d.onUpdate(f),d.onComplete()});return}}return a.isSync?new qa(d):new p4(d)},N4=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function C4(t){const e=N4.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function JN(t,e,n=1){const[r,s]=C4(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return uN(o)?parseFloat(o):o}return d0(s)?JN(s,e,n+1):s}function ib(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function S0(t,e,n,r){if(typeof e=="function"){const[s,i]=ib(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=ib(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function _s(t,e,n){const r=t.getProps();return S0(r,e,n!==void 0?n:r.custom,t)}const YN=new Set(["width","height","top","left","right","bottom",...yo]),im=t=>Array.isArray(t);function j4(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,xn(n))}function E4(t){return im(t)?t[t.length-1]||0:t}function T4(t,e){const n=_s(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=E4(i[o]);j4(t,o,a)}}const We=t=>!!(t&&t.getVelocity);function M4(t){return!!(We(t)&&t.add)}function om(t,e){const n=t.getValue("willChange");if(M4(n))return n.add(e);if(!n&&Xr.WillChange){const r=new Xr.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function N0(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const P4="framerAppearId",XN="data-"+N0(P4);function ZN(t){return t.props[XN]}function A4({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function QN(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=e;const l=t.getDefaultTransition();i=i?qN(i,l):l;const u=i==null?void 0:i.reduceMotion,d=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],f=s&&t.animationState&&t.animationState.getState()[s],p=i==null?void 0:i.path;p&&p.animateVisualElement(t,a,i,n,h);for(const m in a){const g=t.getValue(m,t.latestValues[m]??null),y=a[m];if(y===void 0||f&&A4(f,m))continue;const b={delay:n,...k0(i||{},m)};d&&(b.skipAnimations=!0);const x=g.get();if(x!==void 0&&!g.isAnimating()&&!Array.isArray(y)&&y===x&&!b.velocity){ae.update(()=>g.set(y));continue}let k=!1;if(window.MotionHandoffAnimation){const E=ZN(t);if(E){const S=window.MotionHandoffAnimation(E,m,ae);S!==null&&(b.startTime=S,k=!0)}}om(t,m);const w=u??t.shouldReduceMotion;g.start(w0(m,g,y,w&&YN.has(m)?{type:!1}:b,t,k));const C=g.animation;C&&h.push(C)}if(o){const m=()=>ae.update(()=>{o&&T4(t,o)});h.length?Promise.all(h).then(m):m()}return h}function am(t,e,n={}){var l;const r=_s(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(QN(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:f}=s;return D4(t,e,u,d,h,f,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[u,d]=a==="beforeChildren"?[i,o]:[o,i];return u().then(()=>d())}else return Promise.all([i(),o(n.delay)])}function D4(t,e,n=0,r=0,s=0,i=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(am(l,e,{...o,delay:n+(typeof r=="function"?0:r)+GN(t.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function L4(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>am(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=am(t,e,n);else{const s=typeof e=="function"?_s(t,e,n.custom):e;r=Promise.all(QN(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}const R4={test:t=>t==="auto",parse:t=>t},eC=t=>e=>e.test(t),tC=[xo,G,In,Wn,c3,l3,R4],ob=t=>tC.find(eC(t));function _4(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||hN(t):!0}const I4=new Set(["brightness","contrast","saturate","opacity"]);function O4(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(h0)||[];if(!r)return t;const s=n.replace(r,"");let i=I4.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const B4=/\b([a-z-]*)\(.*?\)/gu,lm={...kn,getAnimatableNone:t=>{const e=t.match(B4);return e?e.map(O4).join(" "):t}},cm={...kn,getAnimatableNone:t=>{const e=kn.parse(t);return kn.createTransformer(t)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},ab={...xo,transform:Math.round},z4={rotate:Wn,pathRotation:Wn,rotateX:Wn,rotateY:Wn,rotateZ:Wn,scale:Yl,scaleX:Yl,scaleY:Yl,scaleZ:Yl,skew:Wn,skewX:Wn,skewY:Wn,distance:G,translateX:G,translateY:G,translateZ:G,x:G,y:G,z:G,perspective:G,transformPerspective:G,opacity:Ga,originX:Gy,originY:Gy,originZ:G},Tu={borderWidth:G,borderTopWidth:G,borderRightWidth:G,borderBottomWidth:G,borderLeftWidth:G,borderRadius:G,borderTopLeftRadius:G,borderTopRightRadius:G,borderBottomRightRadius:G,borderBottomLeftRadius:G,width:G,maxWidth:G,height:G,maxHeight:G,top:G,right:G,bottom:G,left:G,inset:G,insetBlock:G,insetBlockStart:G,insetBlockEnd:G,insetInline:G,insetInlineStart:G,insetInlineEnd:G,padding:G,paddingTop:G,paddingRight:G,paddingBottom:G,paddingLeft:G,paddingBlock:G,paddingBlockStart:G,paddingBlockEnd:G,paddingInline:G,paddingInlineStart:G,paddingInlineEnd:G,margin:G,marginTop:G,marginRight:G,marginBottom:G,marginLeft:G,marginBlock:G,marginBlockStart:G,marginBlockEnd:G,marginInline:G,marginInlineStart:G,marginInlineEnd:G,fontSize:G,backgroundPositionX:G,backgroundPositionY:G,...z4,zIndex:ab,fillOpacity:Ga,strokeOpacity:Ga,numOctaves:ab},F4={...Tu,color:Ie,backgroundColor:Ie,outlineColor:Ie,fill:Ie,stroke:Ie,borderColor:Ie,borderTopColor:Ie,borderRightColor:Ie,borderBottomColor:Ie,borderLeftColor:Ie,filter:lm,WebkitFilter:lm,mask:cm,WebkitMask:cm},nC=t=>F4[t],V4=new Set([lm,cm]);function rC(t,e){let n=nC(t);return V4.has(n)||(n=kn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const $4=new Set(["auto","none","0"]);function H4(t,e,n){let r=0,s;for(;r{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const C0=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function sC(t,e,n){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){const s=document.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(r=>r!=null)}const um=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function ca(t){return dN(t)&&"offsetHeight"in t&&!("ownerSVGElement"in t)}const{schedule:Yi,cancel:iC}=NN(queueMicrotask,!1),hn={x:!1,y:!1};function oC(){return hn.x||hn.y}function U4(t){return t==="x"||t==="y"?hn[t]?null:(hn[t]=!0,()=>{hn[t]=!1}):hn.x||hn.y?null:(hn.x=hn.y=!0,()=>{hn.x=hn.y=!1})}function aC(t,e){const n=sC(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function K4(t){return!(t.pointerType==="touch"||oC())}function G4(t,e,n={}){const[r,s,i]=aC(t,n);return r.forEach(o=>{let a=!1,l=!1,u;const d=()=>{o.removeEventListener("pointerleave",m)},h=y=>{u&&(u(y),u=void 0),d()},f=y=>{a=!1,window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",f),l&&(l=!1,h(y))},p=()=>{a=!0,window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",f,s)},m=y=>{if(y.pointerType!=="touch"){if(a){l=!0;return}h(y)}},g=y=>{if(!K4(y))return;l=!1;const b=e(o,y);typeof b=="function"&&(u=b,o.addEventListener("pointerleave",m,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const lC=(t,e)=>e?t===e?!0:lC(t,e.parentElement):!1,j0=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,q4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function J4(t){return q4.has(t.tagName)||t.isContentEditable===!0}const Y4=new Set(["INPUT","SELECT","TEXTAREA"]);function X4(t){return Y4.has(t.tagName)||t.isContentEditable===!0}const Ic=new WeakSet;function lb(t){return e=>{e.key==="Enter"&&t(e)}}function tf(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Z4=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=lb(()=>{if(Ic.has(n))return;tf(n,"down");const s=lb(()=>{tf(n,"up")}),i=()=>tf(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function cb(t){return j0(t)&&!oC()}const ub=new WeakSet;function Q4(t,e,n={}){const[r,s,i]=aC(t,n),o=a=>{const l=a.currentTarget;if(!cb(a)||ub.has(a))return;Ic.add(l),n.stopPropagation&&ub.add(a);const u=e(l,a),d={...s,capture:!0},h=(m,g)=>{window.removeEventListener("pointerup",f,d),window.removeEventListener("pointercancel",p,d),Ic.has(l)&&Ic.delete(l),cb(m)&&typeof u=="function"&&u(m,{success:g})},f=m=>{h(m,l===window||l===document||n.useGlobalTarget||lC(l,m.target))},p=m=>{h(m,!1)};window.addEventListener("pointerup",f,d),window.addEventListener("pointercancel",p,d)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),ca(a)&&(a.addEventListener("focus",u=>Z4(u,s)),!J4(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function E0(t){return dN(t)&&"ownerSVGElement"in t}const Oc=new WeakMap;let mr;const cC=(t,e,n)=>(r,s)=>s&&s[0]?s[0][t+"Size"]:E0(r)&&"getBBox"in r?r.getBBox()[e]:r[n],eL=cC("inline","width","offsetWidth"),tL=cC("block","height","offsetHeight");function nL({target:t,borderBoxSize:e}){var n;(n=Oc.get(t))==null||n.forEach(r=>{r(t,{get width(){return eL(t,e)},get height(){return tL(t,e)}})})}function rL(t){t.forEach(nL)}function sL(){typeof ResizeObserver>"u"||(mr=new ResizeObserver(rL))}function iL(t,e){mr||sL();const n=sC(t);return n.forEach(r=>{let s=Oc.get(r);s||(s=new Set,Oc.set(r,s)),s.add(e),mr==null||mr.observe(r)}),()=>{n.forEach(r=>{const s=Oc.get(r);s==null||s.delete(e),s!=null&&s.size||mr==null||mr.unobserve(r)})}}const Bc=new Set;let Mi;function oL(){Mi=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};Bc.forEach(e=>e(t))},window.addEventListener("resize",Mi)}function aL(t){return Bc.add(t),Mi||oL(),()=>{Bc.delete(t),!Bc.size&&typeof Mi=="function"&&(window.removeEventListener("resize",Mi),Mi=void 0)}}function dm(t,e){return typeof t=="function"?aL(t):iL(t,e)}function uC(t,e){let n;const r=()=>{const{currentTime:s}=e,o=(s===null?0:s.value)/100;n!==o&&t(o),n=o};return ae.preUpdate(r,!0),()=>an(r)}function lL(t){return E0(t)&&t.tagName==="svg"}function cL(...t){const e=!Array.isArray(t[0]),n=e?0:-1,r=t[0+n],s=t[1+n],i=t[2+n],o=t[3+n],a=g0(s,i,o);return e?a(r):a}function uL(t,e,n={}){const r=t.get();let s=null,i=r,o;const a=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,l=()=>{s&&(s.stop(),s=null),t.animation=void 0},u=()=>{const h=db(t.get()),f=db(i);if(h===f){l();return}const p=s?s.getGeneratorVelocity():t.getVelocity();l(),s=new qa({keyframes:[h,f],velocity:p,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:o})},d=()=>{var h;u(),t.animation=s??void 0,(h=t.events.animationStart)==null||h.notify(),s==null||s.then(()=>{var f;t.animation=void 0,(f=t.events.animationComplete)==null||f.notify()})};if(t.attach((h,f)=>{i=h,o=p=>f(nf(p,a)),ae.postRender(d)},l),We(e)){let h=n.skipInitialAnimation===!0;const f=e.on("change",m=>{h?(h=!1,t.jump(nf(m,a),!1)):t.set(nf(m,a))}),p=t.on("destroy",f);return()=>{f(),p()}}return l}function nf(t,e){return e?t+e:t}function db(t){return typeof t=="number"?t:parseFloat(t)}const dL=[...tC,Ie,kn],hL=t=>dL.find(eC(t)),hb=()=>({translate:0,scale:1,origin:0,originPoint:0}),Pi=()=>({x:hb(),y:hb()}),fb=()=>({min:0,max:0}),Ve=()=>({x:fb(),y:fb()}),fL=new WeakMap;function Jd(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Ja(t){return typeof t=="string"||Array.isArray(t)}const T0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],M0=["initial",...T0];function Yd(t){return Jd(t.animate)||M0.some(e=>Ja(t[e]))}function dC(t){return!!(Yd(t)||t.variants)}function pL(t,e,n){for(const r in e){const s=e[r],i=n[r];if(We(s))t.addValue(r,s);else if(We(i))t.addValue(r,xn(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,xn(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const hm={current:null},hC={current:!1},mL=typeof window<"u";function gL(){if(hC.current=!0,!!mL)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>hm.current=t.matches;t.addEventListener("change",e),e()}else hm.current=!1}const pb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Mu={};function fC(t){Mu=t}function xL(){return Mu}class yL{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=y0,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=yt.now();this.renderScheduledAtthis.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(hC.current||gL(),this.shouldReduceMotion=hm.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),an(this.notifyUpdate),an(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),n.accelerate&&KN.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:u,duration:d}=n.accelerate,h=new WN({element:this.current,name:e,keyframes:a,times:l,ease:u,duration:zt(d)}),f=o(h);this.valueSubscriptions.set(e,()=>{f(),h.cancel()});return}const r=bo.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&ae.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Mu){const n=Mu[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ve()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=xn(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(uN(r)||hN(r))?r=parseFloat(r):!hL(r)&&kn.test(n)&&(r=rC(e,n)),this.setBaseTarget(e,We(r)?r.get():r)),We(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=S0(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!We(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new a0),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Yi.render(this.render)}}class pC extends yL{constructor(){super(...arguments),this.KeyframeResolver=W4}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){const r=e.style;return r?r[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;We(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class ss{constructor(e){this.isMounted=!1,this.node=e}update(){}}function mC({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function bL({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function vL(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function rf(t){return t===void 0||t===1}function fm({scale:t,scaleX:e,scaleY:n}){return!rf(t)||!rf(e)||!rf(n)}function ys(t){return fm(t)||gC(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function gC(t){return mb(t.x)||mb(t.y)}function mb(t){return t&&t!=="0%"}function Pu(t,e,n){const r=t-n,s=e*r;return n+s}function gb(t,e,n,r,s){return s!==void 0&&(t=Pu(t,s,r)),Pu(t,n,r)+e}function pm(t,e=0,n=1,r,s){t.min=gb(t.min,e,n,r,s),t.max=gb(t.max,e,n,r,s)}function xC(t,{x:e,y:n}){pm(t.x,e.translate,e.scale,e.originPoint),pm(t.y,n.translate,n.scale,n.originPoint)}const xb=.999999999999,yb=1.0000000000001;function kL(t,e,n,r=!1){var a;const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let l=0;lxb&&(e.x=1),e.yxb&&(e.y=1)}function Dn(t,e){t.min+=e,t.max+=e}function bb(t,e,n,r,s=.5){const i=pe(t.min,t.max,s);pm(t,e,n,i,r)}function vb(t,e){return typeof t=="string"?parseFloat(t)/100*(e.max-e.min):t}function zc(t,e,n){const r=n??t;bb(t.x,vb(e.x,r.x),e.scaleX,e.scale,e.originX),bb(t.y,vb(e.y,r.y),e.scaleY,e.scale,e.originY)}function yC(t,e){return mC(vL(t.getBoundingClientRect(),e))}function wL(t,e,n){const r=yC(t,n),{scroll:s}=e;return s&&(Dn(r.x,s.offset.x),Dn(r.y,s.offset.y)),r}const SL={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},NL=yo.length;function CL(t,e,n){let r="",s=!0;for(let o=0;o{if(!e.target)return t;if(typeof t=="string")if(G.test(t))t=parseFloat(t);else return t;const n=kb(t,e.target.x),r=kb(t,e.target.y);return`${n}% ${r}%`}},jL={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=kn.parse(t);if(s.length>5)return r;const i=kn.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=pe(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}},mm={borderRadius:{...Ao,applyTo:[...C0]},borderTopLeftRadius:Ao,borderTopRightRadius:Ao,borderBottomLeftRadius:Ao,borderBottomRightRadius:Ao,boxShadow:jL};function vC(t,{layout:e,layoutId:n}){return bo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!mm[t]||t==="opacity")}function A0(t,e,n){var o;const r=t.style,s=e==null?void 0:e.style,i={};if(!r)return i;for(const a in r)(We(r[a])||s&&We(s[a])||vC(a,t)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function EL(t){return window.getComputedStyle(t)}class TL extends pC{constructor(){super(...arguments),this.type="html",this.renderInstance=bC}readValueFromInstance(e,n){var r;if(bo.has(n))return(r=this.projection)!=null&&r.isProjecting?Qp(n):G3(e,n);{const s=EL(e),i=(jN(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return yC(e,n)}build(e,n,r){P0(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return A0(e,n,r)}}const ML={offset:"stroke-dashoffset",array:"stroke-dasharray"},PL={offset:"strokeDashoffset",array:"strokeDasharray"};function AL(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?ML:PL;t[i.offset]=`${-r}`,t[i.array]=`${e} ${n}`}const DL=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function kC(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,u,d){if(P0(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const p of DL)h[p]!==void 0&&(f[p]=h[p],delete h[p]);e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&AL(h,s,i,o,!1)}const wC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),SC=t=>typeof t=="string"&&t.toLowerCase()==="svg";function LL(t,e,n,r){bC(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(wC.has(s)?s:N0(s),e.attrs[s])}function NC(t,e,n){const r=A0(t,e,n);for(const s in t)if(We(t[s])||We(e[s])){const i=yo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}class RL extends pC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ve}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(bo.has(n)){const r=nC(n);return r&&r.default||0}return n=wC.has(n)?n:N0(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return NC(e,n,r)}build(e,n,r){kC(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){LL(e,n,r,s)}mount(e){this.isSVGTag=SC(e.tagName),super.mount(e)}}const _L=M0.length;function CC(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?CC(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<_L;n++){const r=M0[n],s=t.props[r];(Ja(s)||s===!1)&&(e[r]=s)}return e}function jC(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;rPromise.all(e.map(({animation:n,options:r})=>L4(t,n,r)))}function zL(t){let e=BL(t),n=wb(),r=!0,s=!1;const i=u=>(d,h)=>{var p;const f=_s(t,h,u==="exit"?(p=t.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:m,transitionEnd:g,...y}=f;d={...d,...y,...g}}return d};function o(u){e=u(t)}function a(u){const{props:d}=t,h=CC(t.parent)||{},f=[],p=new Set;let m={},g=1/0;for(let b=0;bg&&C,j=!1;const T=Array.isArray(w)?w:[w];let R=T.reduce(i(x),{});E===!1&&(R={});const{prevResolvedValues:$={}}=k,L={...$,...R},W=_=>{M=!0,p.has(_)&&(j=!0,p.delete(_)),k.needsAnimating[_]=!0;const I=t.getValue(_);I&&(I.liveStyle=!1)};for(const _ in L){const I=R[_],V=$[_];if(m.hasOwnProperty(_))continue;let K=!1;im(I)&&im(V)?K=!jC(I,V)||N:K=I!==V,K?I!=null?W(_):p.add(_):I!==void 0&&p.has(_)?W(_):k.protectedKeys[_]=!0}k.prevProp=w,k.prevResolvedValues=R,k.isActive&&(m={...m,...R}),(r||s)&&t.blockInitialAnimation&&(M=!1);const B=S&&N;M&&(!B||j)&&f.push(...T.map(_=>{const I={type:x};if(typeof _=="string"&&(r||s)&&!B&&t.manuallyAnimateOnMount&&t.parent){const{parent:V}=t,K=_s(V,_);if(V.enteringChildren&&K){const{delayChildren:te}=K.transition||{};I.delay=GN(V.enteringChildren,t,te)}}return{animation:_,options:I}}))}if(p.size){const b={};if(typeof d.initial!="boolean"){const x=_s(t,Array.isArray(d.initial)?d.initial[0]:d.initial);x&&x.transition&&(b.transition=x.transition)}p.forEach(x=>{const k=t.getBaseTarget(x),w=t.getValue(x);w&&(w.liveStyle=!0),b[x]=k??null}),f.push({animation:b})}let y=!!f.length;return r&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(y=!1),r=!1,s=!1,y?e(f):Promise.resolve()}function l(u,d){var f;if(n[u].isActive===d)return Promise.resolve();(f=t.variantChildren)==null||f.forEach(p=>{var m;return(m=p.animationState)==null?void 0:m.setActive(u,d)}),n[u].isActive=d;const h=a(u);for(const p in n)n[p].protectedKeys={};return h}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=wb(),s=!0}}}function FL(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!jC(e,t):!1}function ps(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function wb(){return{animate:ps(!0),whileInView:ps(),whileHover:ps(),whileTap:ps(),whileDrag:ps(),whileFocus:ps(),exit:ps()}}function gm(t,e){t.min=e.min,t.max=e.max}function un(t,e){gm(t.x,e.x),gm(t.y,e.y)}function Sb(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const EC=1e-4,VL=1-EC,$L=1+EC,TC=.01,HL=0-TC,WL=0+TC;function bt(t){return t.max-t.min}function UL(t,e,n){return Math.abs(t-e)<=n}function Nb(t,e,n,r=.5){t.origin=r,t.originPoint=pe(e.min,e.max,t.origin),t.scale=bt(n)/bt(e),t.translate=pe(n.min,n.max,t.origin)-t.originPoint,(t.scale>=VL&&t.scale<=$L||isNaN(t.scale))&&(t.scale=1),(t.translate>=HL&&t.translate<=WL||isNaN(t.translate))&&(t.translate=0)}function ua(t,e,n,r){Nb(t.x,e.x,n.x,r?r.originX:void 0),Nb(t.y,e.y,n.y,r?r.originY:void 0)}function Cb(t,e,n,r=0){const s=r?pe(n.min,n.max,r):n.min;t.min=s+e.min,t.max=t.min+bt(e)}function KL(t,e,n,r){Cb(t.x,e.x,n.x,r==null?void 0:r.x),Cb(t.y,e.y,n.y,r==null?void 0:r.y)}function jb(t,e,n,r=0){const s=r?pe(n.min,n.max,r):n.min;t.min=e.min-s,t.max=t.min+bt(e)}function Au(t,e,n,r){jb(t.x,e.x,n.x,r==null?void 0:r.x),jb(t.y,e.y,n.y,r==null?void 0:r.y)}function Eb(t,e,n,r,s){return t-=e,t=Pu(t,1/n,r),s!==void 0&&(t=Pu(t,1/s,r)),t}function GL(t,e=0,n=1,r=.5,s,i=t,o=t){if(In.test(e)&&(e=parseFloat(e),e=pe(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=pe(i.min,i.max,r);t===i&&(a-=e),t.min=Eb(t.min,e,n,a,s),t.max=Eb(t.max,e,n,a,s)}function Tb(t,e,[n,r,s],i,o){GL(t,e[n],e[r],e[s],e.scale,i,o)}const qL=["x","scaleX","originX"],JL=["y","scaleY","originY"];function Mb(t,e,n,r){Tb(t.x,e,qL,n?n.x:void 0,r?r.x:void 0),Tb(t.y,e,JL,n?n.y:void 0,r?r.y:void 0)}function Pb(t){return t.translate===0&&t.scale===1}function MC(t){return Pb(t.x)&&Pb(t.y)}function Ab(t,e){return t.min===e.min&&t.max===e.max}function YL(t,e){return Ab(t.x,e.x)&&Ab(t.y,e.y)}function Db(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function PC(t,e){return Db(t.x,e.x)&&Db(t.y,e.y)}function Lb(t){return bt(t.x)/bt(t.y)}function Rb(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function Tn(t){return[t("x"),t("y")]}function XL(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,pathRotation:h,rotateX:f,rotateY:p,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotate(${h}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const ZL=C0.length,_b=t=>typeof t=="string"?parseFloat(t):t,Ib=t=>typeof t=="number"||G.test(t);function QL(t,e,n,r,s,i){s?(t.opacity=pe(0,n.opacity??1,eR(r)),t.opacityExit=pe(e.opacity??1,0,tR(r))):i&&(t.opacity=pe(e.opacity??1,n.opacity??1,r));for(let o=0;ore?1:n(qi(t,e,r))}function nR(t,e,n){const r=We(t)?t:xn(t);return r.start(w0("",r,e,n)),r.animation}function Ya(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}const rR=(t,e)=>t.depth-e.depth;class sR{constructor(){this.children=[],this.isDirty=!1}add(e){i0(this.children,e),this.isDirty=!0}remove(e){Nu(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rR),this.isDirty=!1,this.children.forEach(e)}}function iR(t,e){const n=yt.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(an(r),t(i-e))};return ae.setup(r,!0),()=>an(r)}function Fc(t){return We(t)?t.get():t}class oR{constructor(){this.members=[]}add(e){i0(this.members,e);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Nu(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(Nu(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){var n;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,n){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=e.options;(i===void 0||i!==o)&&(e.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,r,s,i,o;(r=(n=e.options).onExitComplete)==null||r.call(n),(o=(s=e.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const Vc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},sf=["","X","Y","Z"],aR=1e3;let lR=0;function of(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function DC(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ZN(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ae,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&DC(r)}function LC({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=lR++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(dR),this.nodes.forEach(xR),this.nodes.forEach(yR),this.nodes.forEach(hR)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;ae.read(()=>{h=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,d&&d(),d=iR(f,250),Vc.hasAnimatedSinceResize&&(Vc.hasAnimatedSinceResize=!1,this.nodes.forEach(Fb)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||SR,{onLayoutAnimationStart:g,onLayoutAnimationComplete:y}=u.getProps(),b=!this.targetLayout||!PC(this.targetLayout,p),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const k={...k0(m,"layout"),onPlay:g,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(k.delay=0,k.type=!1),this.startAnimation(k),this.setAnimationOrigin(d,x,k.path)}else h||Fb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),an(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(bR),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&DC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!bt(this.snapshot.measuredBox.x)&&!bt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const S=E/1e3,N=C==null?void 0:C(S);N?(f.x.translate=N.x,f.x.scale=pe(o.x.scale,1,S),f.x.origin=o.x.origin,f.x.originPoint=o.x.originPoint,f.y.translate=N.y,f.y.scale=pe(o.y.scale,1,S),f.y.origin=o.y.origin,f.y.originPoint=o.y.originPoint):(Vb(f.x,o.x,S),Vb(f.y,o.y,S)),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Au(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),kR(this.relativeTarget,this.relativeTargetOrigin,p,S),w&&YL(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Ve()),un(w,this.relativeTarget)),y&&(this.animationValues=h,QL(h,d,this.latestValues,S,k,x)),N&&N.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=N.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(an(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ae.update(()=>{Vc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=xn(0)),this.motionValue.jump(0,!1),this.currentAnimation=nR(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(aR),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&RC(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Ve();const h=bt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=bt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}un(a,l),zc(a,d),ua(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new oR),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&of("z",o,u,this.animationValues);for(let d=0;d{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Bb),this.root.sharedNodes.clear()}}}function cR(t){t.updateLayout()}function uR(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;if(i==="size")Tn(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],p=bt(f);f.min=r[h].min,f.max=f.min+p});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";gm(o?e.measuredBox[h]:e.layoutBox[h],r[h])}else RC(i,e.layoutBox,r)&&Tn(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],p=bt(r[h]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+p)});const a=Pi();ua(a,r,e.layoutBox);const l=Pi();o?ua(l,t.applyTransform(s,!0),e.measuredBox):ua(l,r,e.layoutBox);const u=!MC(a);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:p}=h;if(f&&p){const m=t.options.layoutAnchor||void 0,g=Ve();Au(g,e.layoutBox,f.layoutBox,m);const y=Ve();Au(y,r,p.layoutBox,m),PC(g,y)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=g,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function dR(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function hR(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function fR(t){t.clearSnapshot()}function Bb(t){t.clearMeasurements()}function pR(t){t.isLayoutDirty=!0,t.updateLayout()}function zb(t){t.isLayoutDirty=!1}function mR(t){t.isAnimationBlocked&&t.layout&&!t.isLayoutDirty&&(t.snapshot=t.layout,t.isLayoutDirty=!0)}function gR(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Fb(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function xR(t){t.resolveTargetDelta()}function yR(t){t.calcProjection()}function bR(t){t.resetSkewAndRotation()}function vR(t){t.removeLeadSnapshot()}function Vb(t,e,n){t.translate=pe(e.translate,0,n),t.scale=pe(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function $b(t,e,n,r){t.min=pe(e.min,n.min,r),t.max=pe(e.max,n.max,r)}function kR(t,e,n,r){$b(t.x,e.x,n.x,r),$b(t.y,e.y,n.y,r)}function wR(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const SR={duration:.45,ease:[.4,0,.1,1]},Hb=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Wb=Hb("applewebkit/")&&!Hb("chrome/")?Math.round:Lt;function Ub(t){t.min=Wb(t.min),t.max=Wb(t.max)}function NR(t){Ub(t.x),Ub(t.y)}function RC(t,e,n){return t==="position"||t==="preserve-aspect"&&!UL(Lb(e),Lb(n),.2)}function CR(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const jR=LC({attachResizeListener:(t,e)=>Ya(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),af={current:void 0},_C=LC({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!af.current){const t=new jR({});t.mount(window),t.setOptions({layoutScroll:!0}),af.current=t}return af.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),bl=v.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function Kb(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function ER(...t){return e=>{let n=!1;const r=t.map(s=>{const i=Kb(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{width:p,height:m,top:g,left:y,right:b,bottom:x,direction:k}=l.current;if(e||i===!1||!a.current||!p||!m)return;const w=k==="rtl",C=n==="left"?w?`right: ${b}`:`left: ${y}`:w?`left: ${y}`:`right: ${b}`,E=r==="bottom"?`bottom: ${x}`:`top: ${g}`;a.current.dataset.motionPopId=o;const S=document.createElement("style");u&&(S.nonce=u);const N=s??document.head;return N.appendChild(S),S.sheet&&S.sheet.insertRule(` [data-motion-pop-id="${o}"] { position: absolute !important; width: ${p}px !important; @@ -64,8 +64,8 @@ Error generating stack: `+i.message+` ${C}px !important; ${E}px !important; } - `),()=>{var M;(M=a.current)==null||M.removeAttribute("data-motion-pop-id"),N.contains(S)&&N.removeChild(S)}},[e]),c.jsx(TR,{isPresent:e,childRef:a,sizeRef:l,pop:i,children:i===!1?t:v.cloneElement(t,{ref:h})})}const PR=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:u})=>{const d=Yr(AR),h=v.useId(),f=v.useRef(n),p=v.useRef(r);ml(()=>{f.current=n,p.current=r});let m=!0,g=v.useMemo(()=>(m=!1,{id:h,initial:e,isPresent:n,custom:s,onExitComplete:y=>{d.set(y,!0);for(const b of d.values())if(!b)return;r&&r()},register:y=>(d.set(y,!1),()=>{var b;d.delete(y),!f.current&&!d.size&&((b=p.current)==null||b.call(p))})}),[n,d,r]);return i&&m&&(g={...g}),v.useMemo(()=>{d.forEach((y,b)=>d.set(b,!1))},[n]),v.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=c.jsx(MR,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:u,children:t}),c.jsx(Gd.Provider,{value:g,children:t})};function AR(){return new Map}function _C(t=!0){const e=v.useContext(Gd);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=v.useId();v.useEffect(()=>{if(t)return s(i)},[t]);const o=v.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const Xl=t=>t.key||"";function Kb(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const DR=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[d,h]=_C(o),f=v.useMemo(()=>Kb(t),[t]),p=o&&!d?[]:f.map(Xl),m=v.useRef(!0),g=v.useRef(f),y=Yr(()=>new Map),b=v.useRef(new Set),[x,k]=v.useState(f),[w,C]=v.useState(f);ml(()=>{m.current=!1,g.current=f;for(let N=0;N{const M=Xl(N),j=o&&!d?!1:f===w||p.includes(M),T=()=>{if(b.current.has(M))return;if(y.has(M))b.current.add(M),y.set(M,!0);else return;let R=!0;y.forEach($=>{$||(R=!1)}),R&&(S==null||S(),C(g.current),o&&(h==null||h()),r&&r())};return c.jsx(PR,{isPresent:j,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:u,onExitComplete:j?void 0:T,anchorX:a,anchorY:l,children:N},M)})})},IC=v.createContext({strict:!1}),Gb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let qb=!1;function LR(){if(qb)return;const t={};for(const e in Gb)t[e]={isEnabled:n=>Gb[e].some(r=>!!n[r])};hC(t),qb=!0}function OC(){return LR(),gL()}function RR(t){const e=OC();for(const n in t)e[n]={...e[n],...t[n]};hC(e)}const _R=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Du(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||_R.has(t)}let BC=t=>!Du(t);function IR(t){typeof t=="function"&&(BC=e=>e.startsWith("on")?!Du(e):t(e))}try{IR(require("@emotion/is-prop-valid").default)}catch{}function OR(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||We(t[s])||(BC(s)||n===!0&&Du(s)||!e&&!Du(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Xd=v.createContext({});function BR(t,e){if(Yd(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ja(n)?n:void 0,animate:Ja(r)?r:void 0}}return t.inherit!==!1?e:{}}function zR(t){const{initial:e,animate:n}=BR(t,v.useContext(Xd));return v.useMemo(()=>({initial:e,animate:n}),[Jb(e),Jb(n)])}function Jb(t){return Array.isArray(t)?t.join(" "):t}const D0=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function zC(t,e,n){for(const r in e)!We(e[r])&&!bC(r,n)&&(t[r]=e[r])}function FR({transformTemplate:t},e){return v.useMemo(()=>{const n=D0();return P0(n,e,t),Object.assign({},n.vars,n.style)},[e])}function VR(t,e){const n=t.style||{},r={};return zC(r,n,t),Object.assign(r,FR(t,e)),r}function $R(t,e){const n={},r=VR(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const FC=()=>({...D0(),attrs:{}});function HR(t,e,n,r){const s=v.useMemo(()=>{const i=FC();return vC(i,e,wC(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};zC(i,t.style,t),s.style={...i,...s.style}}return s}const WR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function L0(t){return typeof t!="string"||t.includes("-")?!1:!!(WR.indexOf(t)>-1||/[A-Z]/u.test(t))}function UR(t,e,n,{latestValues:r},s,i=!1,o){const l=(o??L0(t)?HR:$R)(e,r,s,t),u=OR(e,typeof t=="string",i),d=t!==v.Fragment?{...u,...l,ref:n}:{},{children:h}=e,f=v.useMemo(()=>We(h)?h.get():h,[h]);return v.createElement(t,{...d,children:f})}function KR({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:GR(n,r,s,t),renderState:e()}}function GR(t,e,n,r){const s={},i=r(t,{});for(const f in i)s[f]=Fc(i[f]);let{initial:o,animate:a}=t;const l=Yd(t),u=uC(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const h=d?a:o;if(h&&typeof h!="boolean"&&!Jd(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p(e,n)=>{const r=v.useContext(Xd),s=v.useContext(Gd),i=()=>KR(t,e,r,s);return n?i():Yr(i)},qR=VC({scrapeMotionValuesFromProps:A0,createRenderState:D0}),JR=VC({scrapeMotionValuesFromProps:SC,createRenderState:FC}),YR=Symbol.for("motionComponentSymbol");function XR(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.useCallback(i=>{var a;i&&((a=t.onMount)==null||a.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const $C=v.createContext({});function ui(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ZR(t,e,n,r,s,i){var k,w;const{visualElement:o}=v.useContext(Xd),a=v.useContext(IC),l=v.useContext(Gd),u=v.useContext(bl),d=u.reducedMotion,h=u.skipAnimations,f=v.useRef(null),p=v.useRef(!1);r=r||a.renderer,!f.current&&r&&(f.current=r(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:i}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,g=v.useContext($C);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&QR(f.current,n,s,g);const y=v.useRef(!1);v.useInsertionEffect(()=>{m&&y.current&&m.update(n,l)});const b=n[YN],x=v.useRef(!!b&&typeof window<"u"&&!((k=window.MotionHandoffIsComplete)!=null&&k.call(window,b))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,b)));return ml(()=>{p.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),v.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,b)}),x.current=!1),m.enteringChildren=void 0)}),m}function QR(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:d,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:HC(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&ui(a),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:l,layoutRoot:u,layoutAnchor:d})}function HC(t){if(t)return t.options.allowProjection!==!1?t.projection:HC(t.parent)}function lf(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&RR(r);const i=n?n==="svg":L0(t),o=i?JR:qR;function a(u,d){let h;const f={...v.useContext(bl),...u,layoutId:e_(u)},{isStatic:p}=f,m=zR(u),g=o(u,p);if(!p&&typeof window<"u"){t_();const y=n_(f);h=y.MeasureLayout,m.visualElement=ZR(t,g,f,s,y.ProjectionNode,i)}return c.jsxs(Xd.Provider,{value:m,children:[h&&m.visualElement?c.jsx(h,{visualElement:m.visualElement,...f}):null,UR(t,u,XR(g,m.visualElement,d),g,p,e,i)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=v.forwardRef(a);return l[YR]=t,l}function e_({layoutId:t}){const e=v.useContext(s0).id;return e&&t!==void 0?e+"-"+t:t}function t_(t,e){v.useContext(IC).strict}function n_(t){const e=OC(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function r_(t,e){if(typeof Proxy>"u")return lf;const n=new Map,r=(i,o)=>lf(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,lf(o,void 0,t,e)),n.get(o))})}const s_=(t,e)=>e.isSVG??L0(t)?new LL(e):new EL(e,{allowProjection:t!==v.Fragment});class i_ extends ss{constructor(e){super(e),e.animationState||(e.animationState=BL(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Jd(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let o_=0;class a_ extends ss{constructor(){super(...arguments),this.id=o_++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=_s(this.node,o,a);if(l){const{transition:u,transitionEnd:d,...h}=l;for(const f in h)(i=this.node.getValue(f))==null||i.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const l_={animation:{Feature:i_},exit:{Feature:a_}};function vl(t){return{point:{x:t.pageX,y:t.pageY}}}const c_=t=>e=>j0(e)&&t(e,vl(e));function da(t,e,n,r){return Ya(t,e,c_(n),r)}const WC=({current:t})=>t?t.ownerDocument.defaultView:null,Yb=(t,e)=>Math.abs(t-e);function u_(t,e){const n=Yb(t.x,e.x),r=Yb(t.y,e.y);return Math.sqrt(n**2+r**2)}const Xb=new Set(["auto","scroll"]);class UC{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zl(this.lastRawMoveEventInfo,this.transformPagePoint));const m=cf(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=u_(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!y)return;const{point:b}=m,{timestamp:x}=Ge;this.history.push({...b,timestamp:x});const{onStart:k,onMove:w}=this.handlers;g||(k&&k(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=Zl(g,this.transformPagePoint),ae.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:y,onSessionEnd:b,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=cf(m.type==="pointercancel"?this.lastMoveEventInfo:Zl(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(m,k),b&&b(m,k)},!j0(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=vl(e),u=Zl(l,this.transformPagePoint),{point:d}=u,{timestamp:h}=Ge;this.history=[{...d,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,cf(u,this.history));const p={passive:!0,capture:!0};this.removeListeners=gl(da(this.contextWindow,"pointermove",this.handlePointerMove,p),da(this.contextWindow,"pointerup",this.handlePointerUp,p),da(this.contextWindow,"pointercancel",this.handlePointerUp,p)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(Xb.has(r.overflowX)||Xb.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),ae.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),an(this.updatePoint)}}function Zl(t,e){return e?{point:e(t.point)}:t}function Zb(t,e){return{x:t.x-e.x,y:t.y-e.y}}function cf({point:t},e){return{point:t,delta:Zb(t,KC(e)),offset:Zb(t,d_(e)),velocity:h_(e,.1)}}function d_(t){return t[0]}function KC(t){return t[t.length-1]}function h_(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=KC(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>zt(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>zt(e)*2&&(r=t[1]);const i=en(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function f_(t,{min:e,max:n},r){return e!==void 0&&tn&&(t=r?pe(n,t,r.max):Math.min(t,n)),t}function Qb(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function p_(t,{top:e,left:n,bottom:r,right:s}){return{x:Qb(t.x,n,s),y:Qb(t.y,e,r)}}function ev(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.minr?n=qi(e.min,e.max-r,t.min):r>s&&(n=qi(t.min,t.max-s,e.min)),Nn(0,1,n)}function x_(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const xm=.35;function y_(t=xm){return t===!1?t=0:t===!0&&(t=xm),{x:tv(t,"left","right"),y:tv(t,"top","bottom")}}function tv(t,e,n){return{min:nv(t,e),max:nv(t,n)}}function nv(t,e){return typeof t=="number"?t:t[e]||0}const b_=new WeakMap;class v_{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ve(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(vl(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=W4(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tn(b=>{let x=this.getAxisMotionValue(b).get()||0;if(In.test(x)){const{projection:k}=this.visualElement;if(k&&k.layout){const w=k.layout.layoutBox[b];w&&(x=bt(w)*(parseFloat(x)/100))}}this.originPoint[b]=x}),g&&ae.update(()=>g(h,f),!1,!0),om(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(m&&this.currentDirection===null){this.currentDirection=w_(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),y&&ae.update(()=>y(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new UC(e,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:WC(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&ae.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!Ql(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=f_(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&ui(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=p_(r.layoutBox,e):this.constraints=!1,this.elastic=y_(n),s!==this.constraints&&!ui(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Tn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=x_(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ui(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=kL(r,s.root,this.visualElement.getTransformPagePoint());let o=m_(s.layout.layoutBox,i);if(n){const a=n(yL(o));this.hasMutatedConstraints=!!a,a&&(o=pC(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Tn(d=>{if(!Ql(d,n,this.currentDirection))return;let h=l&&l[d]||{};(o===!0||o===d)&&(h={min:0,max:0});const f=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?e[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return om(this.visualElement,e),r.start(w0(e,r,0,n,this.visualElement,!1))}stopAnimation(){Tn(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Tn(n=>{const{drag:r}=this.getProps();if(!Ql(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(e[n]-pe(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ui(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Tn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=g_({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tn(o=>{if(!Ql(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(pe(l,u,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;b_.set(this.visualElement,this);const e=this.visualElement.current,n=da(e,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps(),f=u.target,p=f!==e&&Y4(f);d&&h&&!p&&this.start(u)});let r;const s=()=>{const{dragConstraints:u}=this.getProps();ui(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=k_(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ae.read(s);const a=Ya(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Tn(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=xm,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function rv(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function k_(t,e,n){const r=dm(t,rv(n)),s=dm(e,rv(n));return()=>{r(),s()}}function Ql(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function w_(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class S_ extends ss{constructor(e){super(e),this.removeGroupControls=Lt,this.removeListeners=Lt,this.controls=new v_(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Lt}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const uf=t=>(e,n)=>{t&&ae.update(()=>t(e,n),!1,!0)};class N_ extends ss{constructor(){super(...arguments),this.removePointerDownListener=Lt}onPointerDown(e){this.session=new UC(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:WC(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:uf(e),onStart:uf(n),onMove:uf(r),onEnd:(i,o)=>{delete this.session,s&&ae.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=da(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let df=!1;class C_ extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),df&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Vc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),df=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||ae.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Yi.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;df=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function GC(t){const[e,n]=_C(),r=v.useContext(s0);return c.jsx(C_,{...t,layoutGroup:r,switchLayoutGroup:v.useContext($C),isPresent:e,safeToRemove:n})}const j_={pan:{Feature:N_},drag:{Feature:S_,ProjectionNode:RC,MeasureLayout:GC}};function sv(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ae.postRender(()=>i(e,vl(e)))}class E_ extends ss{mount(){const{current:e}=this.node;e&&(this.unmount=K4(e,(n,r)=>(sv(this.node,r,"Start"),s=>sv(this.node,s,"End"))))}unmount(){}}class T_ extends ss{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=gl(Ya(this.node.current,"focus",()=>this.onFocus()),Ya(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function iv(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ae.postRender(()=>i(e,vl(e)))}class M_ extends ss{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Z4(e,(s,i)=>(iv(this.node,i,"Start"),(o,{success:a})=>iv(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ym=new WeakMap,hf=new WeakMap,P_=t=>{const e=ym.get(t.target);e&&e(t)},A_=t=>{t.forEach(P_)};function D_({root:t,...e}){const n=t||document;hf.has(n)||hf.set(n,{});const r=hf.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(A_,{root:t,...e})),r[s]}function L_(t,e,n){const r=D_(e);return ym.set(t,n),r.observe(t),()=>{ym.delete(t),r.unobserve(t)}}const R_={some:0,all:1};class __ extends ss{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:R_[s]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),p=d?h:f;p&&p(u)};this.stopObserver=L_(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(I_(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function I_({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const O_={inView:{Feature:__},tap:{Feature:M_},focus:{Feature:T_},hover:{Feature:E_}},B_={layout:{ProjectionNode:RC,MeasureLayout:GC}},z_={...l_,...O_,...j_,...B_},Xn=r_(z_,s_);function Lu(t){return typeof window>"u"?!1:t?zN():v0()}const F_=50,ov=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),V_=()=>({time:0,x:ov(),y:ov()}),$_={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function av(t,e,n,r){const s=n[e],{length:i,position:o}=$_[e],a=s.current,l=n.time;s.current=Math.abs(t[`scroll${o}`]),s.scrollLength=t[`scroll${i}`]-t[`client${i}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=qi(0,s.scrollLength,s.current);const u=r-l;s.velocity=u>F_?0:l0(s.current-a,u)}function H_(t,e,n){av(t,"x",e,n),av(t,"y",e,n),e.time=n}function W_(t,e){const n={x:0,y:0};let r=t;for(;r&&r!==e;)if(ca(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const s=r.getBoundingClientRect();r=r.parentElement;const i=r.getBoundingClientRect();n.x+=s.left-i.left,n.y+=s.top-i.top}else if(r instanceof SVGGraphicsElement){const{x:s,y:i}=r.getBBox();n.x+=s,n.y+=i;let o=null,a=r.parentNode;for(;!o;)a.tagName==="svg"&&(o=a),a=r.parentNode;r=o}else break;return n}const bm={start:0,center:.5,end:1};function lv(t,e,n=0){let r=0;if(t in bm&&(t=bm[t]),typeof t=="string"){const s=parseFloat(t);t.endsWith("px")?r=s:t.endsWith("%")?t=s/100:t.endsWith("vw")?r=s/100*document.documentElement.clientWidth:t.endsWith("vh")?r=s/100*document.documentElement.clientHeight:t=s}return typeof t=="number"&&(r=e*t),n+r}const U_=[0,0];function K_(t,e,n,r){let s=Array.isArray(t)?t:U_,i=0,o=0;return typeof t=="number"?s=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?s=t.split(" "):s=[t,bm[t]?t:"0"]),i=lv(s[0],n,r),o=lv(s[1],e),i-o}const Uo={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},G_={x:0,y:0};function q_(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function J_(t,e,n){const{offset:r=Uo.All}=n,{target:s=t,axis:i="y"}=n,o=i==="y"?"height":"width",a=s!==t?W_(s,t):G_,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:q_(s),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let d=!e[i].interpolate;const h=r.length;for(let f=0;f{Y_(t,r.target,n),H_(t,n,s),(r.offset||r.target)&&J_(t,n,r)},notify:()=>e(n)}}const ii=new WeakMap,cv=new WeakMap,ff=new WeakMap,uv=new WeakMap,ec=new WeakMap,dv=t=>t===document.scrollingElement?window:t;function qC(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!e)return Lt;let s=ff.get(e);s||(s=new Set,ff.set(e,s));const i=V_(),o=X_(e,t,i,r);if(s.add(o),!ii.has(e)){const l=()=>{for(const f of s)f.measure(Ge.timestamp);ae.preUpdate(u)},u=()=>{for(const f of s)f.notify()},d=()=>ae.read(l);ii.set(e,d);const h=dv(e);window.addEventListener("resize",d),e!==document.documentElement&&cv.set(e,dm(e,d)),h.addEventListener("scroll",d),d()}if(n&&!ec.has(e)){const l=ii.get(e),u={width:e.scrollWidth,height:e.scrollHeight};uv.set(e,u);const d=()=>{const f=e.scrollWidth,p=e.scrollHeight;(u.width!==f||u.height!==p)&&(l(),u.width=f,u.height=p)},h=ae.read(d,!0);ec.set(e,h)}const a=ii.get(e);return ae.read(a,!1,!0),()=>{var h;an(a);const l=ff.get(e);if(!l||(l.delete(o),l.size))return;const u=ii.get(e);ii.delete(e),u&&(dv(e).removeEventListener("scroll",u),(h=cv.get(e))==null||h(),window.removeEventListener("resize",u));const d=ec.get(e);d&&(an(d),ec.delete(e)),uv.delete(e)}}const Z_=[[Uo.Enter,"entry"],[Uo.Exit,"exit"],[Uo.Any,"cover"],[Uo.All,"contain"]],hv={start:0,end:1};function Q_(t){const e=t.trim().split(/\s+/);if(e.length!==2)return;const n=hv[e[0]],r=hv[e[1]];if(!(n===void 0||r===void 0))return[n,r]}function eI(t){if(t.length!==2)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else if(typeof n=="string"){const r=Q_(n);if(!r)return;e.push(r)}else return;return e}function tI(t,e){const n=eI(t);if(!n)return!1;for(let r=0;r<2;r++){const s=n[r],i=e[r];if(s[0]!==i[0]||s[1]!==i[1])return!1}return!0}function R0(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Z_)if(tI(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const fv=new Map;function pv(t){const e={value:0},n=qC(r=>{e.value=r[t.axis].progress*100},t);return{currentTime:e,cancel:n}}function JC({source:t,container:e,...n}){const{axis:r}=n;t&&(e=t);let s=fv.get(e);s||(s=new Map,fv.set(e,s));const i=n.target??"self";let o=s.get(i);o||(o={},s.set(i,o));const a=r+(n.offset??[]).join(",");return o[a]||(n.target&&Lu(n.target)?R0(n.offset)?o[a]=new ViewTimeline({subject:n.target,axis:r}):o[a]=pv({container:e,...n}):Lu()?o[a]=new ScrollTimeline({source:e,axis:r}):o[a]=pv({container:e,...n})),o[a]}function nI(t,e){const n=JC(e),r=e.target?R0(e.offset):void 0,s=e.target?Lu(e.target)&&!!r:Lu();return t.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:i=>(i.pause(),cC(o=>{i.time=i.iterationDuration*o},n))})}function rI(t){return t&&(t.target||t.offset)}function sI(t){return t.length===2}function iI(t,e){return sI(t)||rI(e)?qC(n=>{t(n[e.axis].progress,n)},e):cC(t,JC(e))}function YC(t,{axis:e="y",container:n=document.scrollingElement,...r}={}){if(!n)return Lt;const s={axis:e,container:n,...r};return typeof t=="function"?iI(t,s):nI(t,s)}const oI=()=>({scrollX:xn(0),scrollY:xn(0),scrollXProgress:xn(0),scrollYProgress:xn(0)}),Ai=t=>t?!t.current:!1;function mv(t,e,n,r){return{factory:s=>{let i;const o=()=>{if(Ai(n)||Ai(r)){Yi.read(o);return}i=YC(s,{...e,axis:t,container:(n==null?void 0:n.current)||void 0,target:(r==null?void 0:r.current)||void 0})};return Yi.read(o),()=>{sC(o),i==null||i()}},times:[0,1],keyframes:[0,1],ease:s=>s,duration:1}}function aI(t,e){return typeof window>"u"?!1:t?zN()&&!!R0(e):v0()}function XC({container:t,target:e,...n}={}){const r=Yr(oI);aI(e,n.offset)&&(r.scrollXProgress.accelerate=mv("x",n,t,e),r.scrollYProgress.accelerate=mv("y",n,t,e));const s=v.useRef(null),i=v.useRef(!1),o=v.useCallback(()=>(s.current=YC((a,{x:l,y:u})=>{r.scrollX.set(l.current),r.scrollXProgress.set(l.progress),r.scrollY.set(u.current),r.scrollYProgress.set(u.progress)},{...n,container:(t==null?void 0:t.current)||void 0,target:(e==null?void 0:e.current)||void 0}),()=>{var a;(a=s.current)==null||a.call(s)}),[t,e,JSON.stringify(n.offset)]);return ml(()=>{if(i.current=!1,Ai(t)||Ai(e)){i.current=!0;return}else return o()},[o]),v.useEffect(()=>{if(!i.current)return;let a;const l=()=>{const u=Ai(t),d=Ai(e);!u&&!d&&(a=o())};return Yi.read(l),()=>{sC(l),a==null||a()}},[o]),r}function ZC(t){const e=Yr(()=>xn(t)),{isStatic:n}=v.useContext(bl);if(n){const[,r]=v.useState(t);v.useEffect(()=>e.on("change",r),[])}return e}function QC(t,e){const n=ZC(e()),r=()=>n.set(e());return r(),ml(()=>{const s=()=>ae.preRender(r,!1,!0),i=t.map(o=>o.on("change",s));return()=>{i.forEach(o=>o()),an(r)}}),n}function lI(t){la.current=[],t();const e=QC(la.current,t);return la.current=void 0,e}function br(t,e,n,r){if(typeof t=="function")return lI(t);if(n!==void 0&&!Array.isArray(n)&&typeof e!="function")return cI(t,e,n,r);const o=typeof e=="function"?e:lL(e,n,r),a=Array.isArray(t)?gv(t,o):gv([t],([u])=>o(u)),l=Array.isArray(t)?void 0:t.accelerate;return l&&!l.isTransformed&&typeof e!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(a.accelerate={...l,times:e,keyframes:n,isTransformed:!0}),a}function gv(t,e){const n=Yr(()=>[]);return QC(t,()=>{n.length=0;const r=t.length;for(let s=0;sObject.keys(n)),i=Yr(()=>({}));for(const o of s)i[o]=br(t,e,n[o],r);return i}function uI(t,e={}){const{isStatic:n}=v.useContext(bl),r=()=>We(t)?t.get():t;if(n)return br(r);const s=ZC(r());return v.useInsertionEffect(()=>cL(s,t,e),[s,JSON.stringify(e)]),s}function dI(t,e={}){return uI(t,{type:"spring",...e})}function hI(){const{scrollYProgress:t}=XC(),e=dI(t,{stiffness:200,damping:30,restDelta:.001});return c.jsx(Xn.div,{style:{scaleX:e},className:"fixed left-0 top-0 z-40 h-0.5 w-full origin-left bg-brand-500"})}const fI=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"h-10 w-10",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.7 6.3a4 4 0 0 0-5.5 4.5L3 17l2 2 6.2-6.2a4 4 0 0 0 4.5-5.5l-2.6 2.6-2-2 2.6-2.6Z"})});function kl({message:t,fullScreen:e=!1}){const{t:n}=at(),r=c.jsxs("div",{className:"mx-auto max-w-md text-center",children:[c.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:c.jsx(fI,{})}),c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:n("maintenance.title")}),c.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:t||n("maintenance.defaultMessage")})]});return e?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950",children:r}):c.jsx("div",{className:"mx-auto max-w-6xl px-4 py-20 sm:px-6",children:r})}const xv=c.jsx(c.Fragment,{children:'Wartungsmodus aktiv – Besucher sehen aktuell eine Wartungsmeldung. Du siehst diese Seite nur, weil du die Berechtigung "Wartungsmodus umgehen" hast.'});function wl({inline:t=!1}){return t?c.jsx("div",{className:"mb-8 rounded-lg bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:xv}):c.jsx("div",{className:"bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:xv})}function pI({onClose:t}){const{consent:e,saveCustom:n}=go(),[r,s]=v.useState(e.external),[i,o]=v.useState(e.analytics),{t:a}=at();return c.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:t,children:c.jsxs("div",{className:"w-full max-w-md rounded-xl bg-white p-6 dark:bg-neutral-900",onClick:l=>l.stopPropagation(),children:[c.jsx("h2",{className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:a("cookieConsent.modalTitle")}),c.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:[a("cookieConsent.modalIntro")," ",c.jsx(ee,{to:"/datenschutz",className:"underline hover:text-brand-500",onClick:t,children:a("cookieConsent.privacyPolicy")}),"."]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:a("cookieConsent.necessaryTitle")}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:a("cookieConsent.necessaryDesc")})]}),c.jsx("input",{type:"checkbox",checked:!0,disabled:!0,className:"mt-1 h-4 w-4 shrink-0"})]}),c.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:a("cookieConsent.externalTitle")}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:a("cookieConsent.externalDesc")})]}),c.jsx("input",{type:"checkbox",checked:r,onChange:l=>s(l.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]}),c.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:a("cookieConsent.analyticsTitle")}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:a("cookieConsent.analyticsDesc")})]}),c.jsx("input",{type:"checkbox",checked:i,onChange:l=>o(l.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]})]}),c.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:t,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:a("cookieConsent.cancel")}),c.jsx("button",{type:"button",onClick:()=>n({external:r,analytics:i}),className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:a("cookieConsent.saveSelection")})]})]})})}function mI(){const{decided:t,settingsOpen:e,acceptAll:n,rejectNonEssential:r,openSettings:s,closeSettings:i}=go(),{t:o}=at();return c.jsxs(c.Fragment,{children:[!t&&c.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 border-t border-neutral-200 bg-white/95 p-4 shadow-lg backdrop-blur dark:border-neutral-800 dark:bg-neutral-900/95 sm:p-5",children:c.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[o("cookieConsent.bannerText")," ",o("cookieConsent.moreInfo")," ",c.jsx(ee,{to:"/datenschutz",className:"underline hover:text-brand-500",children:o("cookieConsent.privacyPolicy")}),"."]}),c.jsxs("div",{className:"flex flex-wrap gap-2 sm:shrink-0",children:[c.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:o("cookieConsent.settings")}),c.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:o("cookieConsent.onlyNecessary")}),c.jsx("button",{type:"button",onClick:n,className:"rounded-md bg-brand-500 px-3 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o("cookieConsent.acceptAll")})]})]})}),e&&c.jsx(pI,{onClose:i})]})}function gI(){const{consent:t}=go(),{ga_measurement_id:e}=rs(),n=v.useRef(!1);return v.useEffect(()=>{if(!e||!t.analytics||n.current)return;n.current=!0;const r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,r.async=!0,document.head.appendChild(r),window.dataLayer=window.dataLayer||[];function s(...i){window.dataLayer.push(i)}window.gtag=s,s("js",new Date),s("config",e,{anonymize_ip:!0})},[e,t.analytics]),null}const ej=v.createContext({global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null},bypass:!1}),xI=ej.Provider;function Zd(){return v.useContext(ej)}const yI={global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null}},bI={mon:{open:"09:00",close:"18:00",closed:!1},tue:{open:"09:00",close:"18:00",closed:!1},wed:{open:"09:00",close:"18:00",closed:!1},thu:{open:"09:00",close:"18:00",closed:!1},fri:{open:"09:00",close:"18:00",closed:!1},sat:{open:"10:00",close:"13:00",closed:!1},sun:{open:"",close:"",closed:!0}},vI={phone:"09373 20 62 390",whatsapp:null,contact_email:"info@hifi-planet-amorbach.de",address_street:"Boxbrunner Str. 20a",address_zip:"63916",address_city:"Amorbach",logo_path:null,logo_dark_path:null,business_hours:bI,hero_image_path:null,ga_measurement_id:null,package_card_theme:"graphite",package_card_layout:"strip",package_wheel_hint_interval:8,gallery_card_text_x:0,gallery_card_text_y:100},kI=["/impressum","/datenschutz","/agb"];function wI(){const[t,e]=v.useState(null),[n,r]=v.useState(vI),{loading:s,hasPermission:i}=Cn(),o=ln();if(v.useEffect(()=>{A.get("/maintenance").then(e).catch(()=>e(yI)),A.get("/site-settings").then(r).catch(()=>{})},[]),t===null||s)return c.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});const a=i("maintenance.bypass"),l=kI.includes(o.pathname);return t.global.enabled&&!a&&!l?c.jsx(Fy,{children:c.jsx(kl,{message:t.global.message,fullScreen:!0})}):c.jsx(Fy,{children:c.jsx(xI,{value:{...t,bypass:a},children:c.jsx(MD,{value:n,children:c.jsxs("div",{className:"page-texture flex min-h-screen flex-col text-neutral-900 dark:text-neutral-100",children:[a&&t.global.enabled&&c.jsx(wl,{}),c.jsx(hI,{}),c.jsx(_D,{}),c.jsx("main",{className:"flex-1",children:c.jsx(Kd,{})}),c.jsx($D,{}),c.jsx(mI,{}),c.jsx(gI,{})]})})})})}const SI={home:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9",tag:"M4 4h7l9 9-7 7-9-9V4Zm3.5 3.5h.01",car:"M3 13.5 4.5 9A2 2 0 0 1 6.4 7.5h11.2A2 2 0 0 1 19.5 9L21 13.5M3 13.5v4a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1h12v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-4M3 13.5h18M6.5 16.5h.01M17.5 16.5h.01",box:"M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Zm0 9 8-4.5M12 12v9M12 12 4 7.5",mail:"M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm0 0 8 7 8-7",users:"M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-4 6c-4 0-7 2-7 4.5V19h14v-1.5C19 15 16 13 12 13Z",shield:"M12 3 4 6v6c0 4.5 3.4 7.7 8 9 4.6-1.3 8-4.5 8-9V6l-8-3Zm-1.5 9.5 4-4 1 1-5 5-2.5-2.5 1-1 1.5 1.5Z",lock:"M6 10V8a6 6 0 1 1 12 0v2m-13 0h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1Zm7 5v2",briefcase:"M4 7h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm4 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12h18",sliders:"M4 6h16M4 6a2 2 0 1 0 4 0 2 2 0 0 0-4 0Zm16 6H4m10 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0ZM4 18h16m-12 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0Z",image:"M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Zm2 12 4.5-5.5L14 16l2.5-3L20 17H6ZM8 9.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-5.5v.01M9.5 9.25a2.5 2.5 0 1 1 3.5 2.29c-.7.32-1 .77-1 1.46v.3"},NI=({path:t})=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"h-5 w-5 shrink-0",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})});function CI(){const{logout:t,user:e,hasPermission:n}=Cn(),r=pl(),[s,i]=v.useState(!1),[o,a]=v.useState(0);v.useEffect(()=>{n("contact.manage")&&A.get("/contact").then(f=>a(f.filter(p=>p.status==="new").length)).catch(()=>{})},[]);const l=[{title:null,links:[{to:"/admin",label:"Dashboard",icon:"home",end:!0},{to:"/admin/account",label:"Mein Konto",icon:"lock"}]},{title:"Fahrzeug-Katalog",links:[{to:"/admin/brands",label:"Marken",icon:"tag",permission:"brands.manage"},{to:"/admin/models",label:"Modelle",icon:"car",permission:"models.manage"},{to:"/admin/packages",label:"Pakete",icon:"box",permission:"packages.manage"}]},{title:"Website",links:[{to:"/admin/home-sections",label:"Startseite",icon:"home",permission:"content.manage"},{to:"/admin/services",label:"Leistungen",icon:"briefcase",permission:"services.manage"},{to:"/admin/faqs",label:"FAQ",icon:"help",permission:"content.manage"},{to:"/admin/partners",label:"Partner",icon:"tag",permission:"content.manage"}]},{title:"Bildergalerie",links:[{to:"/admin/gallery-brands",label:"Marken",icon:"tag",permission:"gallery.manage"},{to:"/admin/gallery-projects",label:"Projekte",icon:"image",permission:"gallery.manage"}]},{title:"Kunden",links:[{to:"/admin/contact-requests",label:"Kontaktanfragen",icon:"mail",permission:"contact.manage",badge:o}]},{title:"Verwaltung",links:[{to:"/admin/users",label:"Benutzer",icon:"users",permission:"users.manage"},{to:"/admin/permission-groups",label:"Berechtigungsgruppen",icon:"shield",permission:"permission_groups.manage"},{to:"/admin/settings",label:"Einstellungen",icon:"sliders",permission:"settings.manage"}]}].map(f=>({...f,links:f.links.filter(p=>!p.permission||n(p.permission))})).filter(f=>f.links.length>0),u=async()=>{await t(),r("/admin/login")},d=({isActive:f})=>`flex items-center justify-between gap-2 rounded-md px-3 py-2 text-sm font-medium transition ${f?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,h=({onNavigate:f})=>c.jsx("nav",{className:"space-y-5",children:l.map((p,m)=>c.jsxs("div",{children:[p.title&&c.jsx("p",{className:"mb-1.5 px-3 text-xs font-semibold uppercase tracking-wide text-neutral-400 dark:text-neutral-500",children:p.title}),c.jsx("div",{className:"space-y-1",children:p.links.map(g=>c.jsxs(QS,{to:g.to,end:g.end,className:d,onClick:f,children:[c.jsxs("span",{className:"flex items-center gap-2.5",children:[c.jsx(NI,{path:SI[g.icon]}),g.label]}),!!g.badge&&c.jsx("span",{className:"rounded-full bg-red-500 px-2 py-0.5 text-xs font-bold text-white",children:g.badge})]},g.to))})]},m))});return c.jsxs("div",{className:"flex min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[c.jsxs("aside",{className:"hidden w-60 shrink-0 border-r border-neutral-200 p-4 dark:border-neutral-800 sm:block",children:[c.jsxs("div",{className:"mb-6 flex items-center gap-2 px-3",children:[c.jsxs("span",{className:"rounded-lg px-2 py-1",children:[c.jsx("img",{src:Ka,alt:"HifiPlanet",className:"h-7 w-auto dark:hidden"}),c.jsx("img",{src:Su,alt:"HifiPlanet",className:"hidden h-7 w-auto dark:block"})]}),c.jsx("span",{className:"text-sm font-semibold text-neutral-500 dark:text-neutral-400",children:"Admin"})]}),c.jsx(h,{})]}),c.jsxs("div",{className:"flex-1",children:[c.jsxs("header",{className:"border-b border-neutral-200 dark:border-neutral-800",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 sm:px-6",children:[c.jsxs("div",{className:"flex items-center gap-2 sm:hidden",children:[c.jsx("button",{onClick:()=>i(f=>!f),"aria-label":"Menü öffnen",className:"rounded-md p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),c.jsxs("span",{className:"rounded-lg px-1.5 py-0.5",children:[c.jsx("img",{src:Ka,alt:"HifiPlanet",className:"h-6 w-auto dark:hidden"}),c.jsx("img",{src:Su,alt:"HifiPlanet",className:"hidden h-6 w-auto dark:block"})]})]}),c.jsxs("p",{className:"hidden text-sm text-neutral-500 dark:text-neutral-400 sm:block",children:["Angemeldet als ",e==null?void 0:e.username,e!=null&&e.is_super_admin?" · Super-Admin":""]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(rN,{}),c.jsx("button",{onClick:u,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:"Abmelden"})]})]}),s&&c.jsx("div",{className:"border-t border-neutral-200 px-4 py-3 dark:border-neutral-800 sm:hidden",children:c.jsx(h,{onNavigate:()=>i(!1)})})]}),c.jsx("main",{className:"p-4 sm:p-6",children:c.jsx(Kd,{})})]})]})}function jI(){const{user:t,loading:e}=Cn();return e?c.jsx("div",{className:"flex min-h-screen items-center justify-center text-neutral-500",children:"Lädt…"}):t?c.jsx(Kd,{}):c.jsx(Ua,{to:"/admin/login",replace:!0})}function Ze({permission:t,children:e}){const{hasPermission:n}=Cn();return(Array.isArray(t)?t:[t]).some(i=>n(i))?e:c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-8 text-center dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h1",{className:"mb-2 text-lg font-bold text-neutral-900 dark:text-white",children:"Keine Berechtigung"}),c.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Du hast keinen Zugriff auf diesen Bereich. Bitte wende dich an einen Administrator, falls du hier Zugriff brauchst."})]})}function pf(t,e,n="name"){if(!e)return;let r=document.head.querySelector(`meta[${n}="${t}"]`);r||(r=document.createElement("meta"),r.setAttribute(n,t),document.head.appendChild(r)),r.setAttribute("content",e)}function EI(t){let e=document.head.querySelector('link[rel="canonical"]');e||(e=document.createElement("link"),e.setAttribute("rel","canonical"),document.head.appendChild(e)),e.setAttribute("href",`https://hifi-planet.de${t}`)}function Wt({title:t,description:e,path:n}){v.useEffect(()=>{t&&(document.title=`${t} | HifiPlanet`,pf("og:title",`${t} | HifiPlanet`,"property")),e&&(pf("description",e),pf("og:description",e,"property")),n&&EI(n)},[t,e,n])}const TI=[.16,1,.3,1],yv={up:{y:40},left:{x:-56},right:{x:56}};function MI(t){return{hidden:{opacity:0,scale:.96,filter:"blur(8px)",...yv[t]||yv.up},visible:{opacity:1,scale:1,x:0,y:0,filter:"blur(0px)"}}}const PI={hidden:{x:"-130%"},visible:{x:"230%",transition:{duration:1.1,ease:"easeInOut",delay:.4}}};function Qe({children:t,direction:e="up",className:n="",index:r=0,shine:s=!1}){const i=Math.min(r*.09,.45);return c.jsxs(Xn.div,{className:n,style:{position:"relative",overflow:"hidden"},initial:"hidden",whileInView:"visible",viewport:{once:!0,amount:.25,margin:"-100px"},variants:MI(e),transition:{duration:.75,ease:TI,delay:i},children:[t,s&&c.jsx(Xn.div,{"aria-hidden":!0,variants:PI,className:"pointer-events-none absolute inset-y-0 -left-1/3 w-1/3 rotate-12 bg-gradient-to-r from-transparent via-white/40 to-transparent"})]})}function AI({items:t}){const[e,n]=v.useState(null);return c.jsx("div",{className:"divide-y divide-neutral-200 rounded-xl border border-neutral-200 bg-white dark:divide-neutral-800 dark:border-neutral-800 dark:bg-neutral-900",children:t.map((r,s)=>{const i=e===s;return c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>n(i?null:s),className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left","aria-expanded":i,children:[c.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:r.question}),c.jsx(Xn.svg,{animate:{rotate:i?180:0},transition:{duration:.2},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0 text-neutral-500",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6 9 6 6 6-6"})})]}),c.jsx(DR,{initial:!1,children:i&&c.jsx(Xn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:c.jsx("p",{className:"px-5 pb-4 text-sm text-neutral-600 dark:text-neutral-300",children:r.answer})})})]},r.question)})})}function tj({count:t=5,className:e="h-4 w-4"}){return c.jsx("div",{className:"flex gap-0.5 text-amber-400",children:Array.from({length:t}).map((n,r)=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:e,children:c.jsx("path",{d:"M10 1.5l2.6 5.6 6.1.6-4.6 4.1 1.3 6-5.4-3.1-5.4 3.1 1.3-6-4.6-4.1 6.1-.6L10 1.5z"})},r))})}const DI=70;function LI({testimonials:t}){const e=v.useRef(null),n=v.useRef(null),r=v.useRef({pos:0,half:0,hovering:!1,dragging:!1,dragStartX:0,dragStartPos:0,lastTime:null,rafId:null}).current;v.useLayoutEffect(()=>{const i=n.current,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,a=()=>{i.style.transform=`translateX(${r.pos}px)`},l=x=>{if(r.half<=0)return x;for(;x>0;)x-=r.half;for(;x<=-r.half;)x+=r.half;return x},u=()=>{r.half=i.scrollWidth/2,r.pos===0?r.pos=-r.half:r.pos=l(r.pos),a()};u();const d=new ResizeObserver(u);d.observe(i);const h=x=>{r.lastTime===null&&(r.lastTime=x);const k=(x-r.lastTime)/1e3;r.lastTime=x,!r.dragging&&!r.hovering&&!o&&(r.pos=l(r.pos+DI*k),a()),r.rafId=requestAnimationFrame(h)};r.rafId=requestAnimationFrame(h);const f=e.current,p=()=>{r.hovering=!0},m=()=>{r.hovering=!1},g=x=>{r.dragging=!0,r.dragStartX=x.clientX,r.dragStartPos=r.pos,f.setPointerCapture(x.pointerId),f.classList.add("cursor-grabbing"),f.classList.remove("cursor-grab")},y=x=>{r.dragging&&(r.pos=l(r.dragStartPos+(x.clientX-r.dragStartX)),a())},b=x=>{r.dragging&&(r.dragging=!1,f.hasPointerCapture(x.pointerId)&&f.releasePointerCapture(x.pointerId),f.classList.remove("cursor-grabbing"),f.classList.add("cursor-grab"))};return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",m),f.addEventListener("pointerdown",g),f.addEventListener("pointermove",y),f.addEventListener("pointerup",b),f.addEventListener("pointercancel",b),()=>{cancelAnimationFrame(r.rafId),d.disconnect(),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",m),f.removeEventListener("pointerdown",g),f.removeEventListener("pointermove",y),f.removeEventListener("pointerup",b),f.removeEventListener("pointercancel",b)}},[t.length]);const s=[...t,...t];return c.jsx("div",{ref:e,className:"marquee-viewport cursor-grab touch-pan-y select-none overflow-hidden",children:c.jsx("div",{ref:n,className:"marquee-track flex w-max gap-5",children:s.map((i,o)=>c.jsx("div",{className:"w-64 shrink-0 sm:w-72 lg:w-80",children:c.jsxs("div",{className:"relative flex h-full flex-col overflow-hidden rounded-xl border border-neutral-200 bg-white p-6 shadow-sm transition-shadow duration-300 hover:shadow-lg dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 32 24",className:"absolute -right-1 -top-1 h-16 w-16 text-brand-500/10 dark:text-brand-400/10",children:c.jsx("path",{fill:"currentColor",d:"M9.4 0C4.4 3.5 1 9.1 1 15.3 1 20.6 4.3 24 8.4 24c3.8 0 6.6-3 6.6-6.6 0-3.4-2.4-5.9-5.4-5.9-.6 0-1.4.1-1.6.2C8.5 8.5 11.6 4.6 14.6 2.6L9.4 0zm16.5 0c-4.8 3.5-8.3 9.1-8.3 15.3 0 5.3 3.3 8.6 7.5 8.6 3.7 0 6.6-3 6.6-6.6 0-3.4-2.5-5.9-5.4-5.9-.6 0-1.4.1-1.6.2.5-3.3 3.6-7.1 6.7-9.1L25.9 0z"})}),c.jsx(tj,{className:"relative z-10 mb-3 h-4 w-4",count:i.rating||5}),c.jsxs("p",{className:"relative z-10 mb-4 line-clamp-6 flex-1 text-sm leading-relaxed text-neutral-600 dark:text-neutral-300",children:["„",i.text,'"']}),c.jsxs("div",{className:"relative z-10 mt-auto flex items-center gap-3",children:[i.photo?c.jsx("img",{src:i.photo,alt:"",referrerPolicy:"no-referrer",className:"h-9 w-9 shrink-0 rounded-full object-cover"}):c.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-brand-100 text-sm font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-300",children:i.name.charAt(0).toUpperCase()}),c.jsx("p",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:i.name})]})]})},`${i.name}-${o}`))})})}function Xi(t,e,n={x:0,y:0}){const r=Math.max(0,Math.min(100,t==null?n.x:Number(t)||0)),s=Math.max(0,Math.min(100,e==null?n.y:Number(e)||0));return{left:`${r}%`,top:`${s}%`,transform:`translate(-${r}%, -${s}%)`}}const RI="/assets/gallery-dash2-CEVCErVK.webp",nj="/assets/gallery-amp-purple-CESAKuOf.webp",_I="/assets/gallery-speaker-CUXQZ49Q.webp",rj="/assets/gallery-subs-COSd4seJ.webp",sj="/assets/gallery-dash-Cg-7v9qo.webp",II="/assets/hero-trunk-Dp4_JHDh.webp",OI="/assets/gallery-rear-8cIXPC7T.webp",BI="/assets/hero-highlight-Co4f1Kj5.webp",zI="/assets/youtube-hintergrund-C0osNxn7.mp4",tc={left:"text-left",center:"text-center",right:"text-right"},FI={left:"",center:"mx-auto",right:"ml-auto"},VI={eyebrow_de:"",eyebrow_en:"",title_de:"",title_en:"",body_html_de:"",body_html_en:"",text_align:"center",text_align_x:50,text_align_y:50,button_label_de:"",button_label_en:"",button_url:""};function bv({label:t,url:e,className:n}){return!t||!e?null:e.startsWith("/")?c.jsx(ee,{to:e,className:n,children:t}):c.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:n,children:t})}const $I=[{src:rj,width:900,height:600},{src:nj,width:900,height:600},{src:_I,width:900,height:1200},{src:sj,width:900,height:814},{src:OI,width:900,height:1200},{src:II,width:1920,height:1280}];function HI(){const{hero_image_path:t}=rs(),e=t||RI,{t:n,language:r}=at(),s=n("home.stats"),i=n("home.galleryAlts"),o=$I.map((M,j)=>({...M,alt:i[j]})),[a,l]=v.useState([]),[u,d]=v.useState({}),[h,f]=v.useState([]),p=M=>{const j=u[M]||VI;return{eyebrow:j[`eyebrow_${r}`]||"",title:j[`title_${r}`]||"",bodyHtml:j[`body_html_${r}`]||"",align:j.text_align||"center",alignX:j.text_align_x,alignY:j.text_align_y,buttonLabel:j[`button_label_${r}`]||"",buttonUrl:j.button_url||""}};v.useEffect(()=>{A.get("/home-sections").then(d).catch(()=>{})},[]),v.useEffect(()=>{A.get("/partners").then(f).catch(()=>{})},[]);const[m,g]=v.useState(null),y=m?m.reviews.filter(M=>M.review_text).map(M=>({name:M.author_name,text:M.review_text,rating:M.rating,photo:M.profile_photo_url})):n("home.testimonials");v.useEffect(()=>{A.get("/faqs").then(M=>{l(M.map(j=>({question:r==="de"?j.question_de:j.question_en,answer:r==="de"?j.answer_de:j.answer_en})))}).catch(()=>{})},[r]),v.useEffect(()=>{A.get("/google-reviews").then(M=>{M.rating!=null&&M.reviews.some(j=>j.review_text)&&g(M)}).catch(()=>{})},[]),Wt({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),v.useEffect(()=>{if(a.length===0)return;const M=document.createElement("script");return M.type="application/ld+json",M.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:a.map(j=>({"@type":"Question",name:j.question,acceptedAnswer:{"@type":"Answer",text:j.answer}}))}),document.head.appendChild(M),()=>document.head.removeChild(M)},[a]);const b=v.useRef(null),{scrollYProgress:x}=XC({target:b,offset:["start start","end start"]}),k=br(x,[0,1],["-6%","6%"]),w=br(x,[0,1],["0%","60%"]),C=br(x,[0,.8],[1,0]),E=br(x,[.5,1],[0,1]),S=br(E,M=>M>.05?"auto":"none"),N=br(x,[.5,1],[16,0]);return c.jsxs("div",{children:[c.jsx(Xn.div,{style:{opacity:E,pointerEvents:S,y:N},className:"fixed inset-x-0 bottom-0 z-20 border-t border-neutral-200 bg-white/95 px-4 py-3 shadow-[0_-8px_24px_rgba(0,0,0,0.08)] backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:px-6",children:c.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[c.jsx("p",{className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block",children:n("home.stickyCta")}),c.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[c.jsx(ee,{to:"/fahrzeuge",className:"flex-1 rounded-md bg-brand-500 px-5 py-2.5 text-center text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 sm:flex-none",children:n("home.selectVehicle")}),c.jsx(ee,{to:"/kontakt",className:"flex-1 rounded-md border border-neutral-300 px-5 py-2.5 text-center text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800 sm:flex-none",children:n("home.getInTouch")})]})]})}),c.jsxs("section",{ref:b,className:"relative -mt-[89px] h-dvh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[c.jsx(Xn.img,{style:{y:k,scale:1.15},src:e,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),c.jsx(Xn.div,{style:{y:w,opacity:C},className:"absolute inset-0",children:c.jsx("div",{className:"absolute w-full max-w-2xl px-4 text-center sm:px-6",style:Xi(p("hero").alignX,p("hero").alignY,{x:50,y:50}),children:c.jsxs(Xn.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[p("hero").eyebrow&&c.jsx("p",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",children:p("hero").eyebrow}),c.jsx("h1",{className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",children:p("hero").title}),c.jsx("div",{className:"legal-content mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg",dangerouslySetInnerHTML:{__html:p("hero").bodyHtml}}),c.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[c.jsx(ee,{to:"/fahrzeuge",className:"rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 hover:shadow-lg",children:n("home.selectVehicle")}),c.jsx(ee,{to:"/kontakt",className:"rounded-md border border-white/30 bg-white/10 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:-translate-y-0.5 hover:bg-white/20",children:n("home.getInTouch")})]})]})})})]}),c.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:c.jsx("div",{className:"mx-auto grid max-w-6xl grid-cols-2 gap-6 px-4 text-center sm:grid-cols-4 sm:px-6",children:s.map((M,j)=>c.jsxs(Qe,{index:j,children:[c.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:M.value}),c.jsx("p",{className:"text-sm text-neutral-400",children:M.label})]},M.label))})}),c.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:c.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[c.jsx("p",{className:"mb-4 text-center text-xs font-semibold uppercase tracking-wide text-neutral-400",children:n("home.brandsHeading")}),c.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:h.map((M,j)=>c.jsx(Qe,{index:j,children:M.logo_path?c.jsx("img",{src:M.logo_path,alt:M.name,className:"h-8 max-w-[8rem] object-contain opacity-70 grayscale transition hover:opacity-100 hover:grayscale-0"}):c.jsx("span",{className:"text-lg font-bold text-neutral-400 dark:text-neutral-600",children:M.name})},M.id))})]})}),c.jsxs("section",{className:"relative min-h-[70vh] overflow-hidden sm:min-h-[85vh]",children:[c.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,poster:sj,className:"absolute inset-0 h-full w-full object-cover",children:c.jsx("source",{src:zI,type:"video/mp4"})}),c.jsx("div",{className:"absolute inset-0 bg-black/55"}),c.jsx("div",{className:"absolute w-full max-w-3xl px-4 text-center sm:px-6",style:Xi(p("youtube").alignX,p("youtube").alignY,{x:50,y:50}),children:c.jsxs(Qe,{children:[p("youtube").eyebrow&&c.jsx("p",{className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",children:p("youtube").eyebrow}),c.jsx("h2",{className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",children:p("youtube").title}),c.jsx("div",{className:"legal-content mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm",dangerouslySetInnerHTML:{__html:p("youtube").bodyHtml}}),c.jsx(bv,{label:p("youtube").buttonLabel,url:p("youtube").buttonUrl,className:"mt-8 inline-flex items-center justify-center rounded-full bg-white px-8 py-3 text-xs font-bold uppercase tracking-wide text-neutral-900 transition hover:-translate-y-0.5 hover:bg-neutral-100"})]})})]}),c.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:c.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[c.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[c.jsx(Qe,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:c.jsx("img",{src:rj,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})}),c.jsxs(Qe,{direction:"right",index:1,className:tc[p("craft").align],children:[p("craft").eyebrow&&c.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:p("craft").eyebrow}),c.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:p("craft").title}),c.jsx("div",{className:"legal-content text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:p("craft").bodyHtml}})]})]}),c.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[c.jsxs(Qe,{direction:"left",className:`order-2 md:order-1 ${tc[p("advice").align]}`,children:[p("advice").eyebrow&&c.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:p("advice").eyebrow}),c.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:p("advice").title}),c.jsx("div",{className:"legal-content text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:p("advice").bodyHtml}})]}),c.jsx(Qe,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:c.jsx("img",{src:nj,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})]})]})}),c.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[c.jsxs(Qe,{className:`mb-8 ${tc[p("insights").align]}`,children:[p("insights").eyebrow&&c.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:p("insights").eyebrow}),c.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:p("insights").title}),c.jsx("div",{className:"legal-content mt-2 text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:p("insights").bodyHtml}})]}),c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:o.map((M,j)=>c.jsx(Qe,{index:j%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsx("img",{src:M.src,alt:M.alt,width:M.width,height:M.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})},M.src))})]}),c.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:c.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[c.jsxs(Qe,{className:"mb-10 text-center",children:[c.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:c.jsx(tj,{className:"h-6 w-6",count:m?Math.round(m.rating):5})}),c.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:m?n("home.reviewsRatingDynamic")(m.rating,m.rating_count):n("home.reviewsRating")}),c.jsx("p",{className:"mt-1 text-neutral-600 dark:text-neutral-300",children:n("home.reviewsText")}),c.jsx("a",{href:"https://www.google.com/maps/search/?api=1&query=Hifi+Planet+Amorbach+Boxbrunner+Stra%C3%9Fe+20a",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-block text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:n("home.reviewsLink")})]}),c.jsx(Qe,{children:c.jsx(LI,{testimonials:y})})]})}),c.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:c.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[c.jsx(Qe,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:c.jsx("img",{src:BI,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})}),c.jsxs(Qe,{direction:"right",index:1,className:`rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 ${tc[p("more").align]}`,children:[p("more").eyebrow&&c.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:p("more").eyebrow}),c.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:p("more").title}),c.jsx("div",{className:`legal-content mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 ${FI[p("more").align]}`,dangerouslySetInnerHTML:{__html:p("more").bodyHtml}}),c.jsx(bv,{label:p("more").buttonLabel,url:p("more").buttonUrl,className:"inline-block rounded-md border border-neutral-300 px-6 py-3 text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800"})]})]})}),c.jsx("section",{className:"border-t border-neutral-300 py-16 dark:border-neutral-700",children:c.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[c.jsx(Qe,{className:"mb-8 text-center",children:c.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.faqHeading")})}),c.jsx(Qe,{index:1,children:c.jsx(AI,{items:a})})]})})]})}function WI(){const[t,e]=v.useState([]),[n,r]=v.useState(""),s=Zd(),{t:i}=at();return Wt({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),v.useEffect(()=>{s.vehicles.enabled&&!s.bypass||A.get("/brands").then(e).catch(o=>r(o.message))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?c.jsx(kl,{message:s.vehicles.message}):c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[s.vehicles.enabled&&s.bypass&&c.jsx(wl,{inline:!0}),c.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:i("vehicleSelect.title")}),c.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:i("vehicleSelect.intro")}),n&&c.jsx("p",{className:"text-red-600",children:n}),t.length===0&&!n&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.map(o=>c.jsxs(ee,{to:`/fahrzeuge/${o.slug}`,className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:[o.image_path&&c.jsx("img",{src:o.image_path,alt:"",className:"h-16 w-full object-contain"}),o.name]},o.id))})]})}function UI(){const{brandSlug:t}=Qs(),[e,n]=v.useState(null),[r,s]=v.useState(""),i=Zd(),{t:o}=at();return v.useEffect(()=>{i.vehicles.enabled&&!i.bypass||A.get(`/brands/${t}/models`).then(n).catch(a=>s(a.message))},[t,i.vehicles.enabled,i.bypass]),Wt({title:e?`${e.brand.name} ${o("brandPage.titleSuffix")}`:o("brandPage.metaTitleFallback"),description:e?o("brandPage.metaDescription")(e.brand.name):void 0,path:`/fahrzeuge/${t}`}),i.vehicles.enabled&&!i.bypass?c.jsx(kl,{message:i.vehicles.message}):r?c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):e?c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&c.jsx(wl,{inline:!0}),c.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[c.jsx(ee,{to:"/fahrzeuge",className:"hover:text-brand-500",children:o("brandPage.breadcrumbVehicles")})," / ",e.brand.name]}),c.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[e.brand.name," – ",o("brandPage.titleSuffix")]}),e.models.length===0&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:o("brandPage.empty")}),c.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:e.models.map(a=>c.jsxs(ee,{to:`/fahrzeuge/${t}/${a.slug}`,className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:[a.image_path&&c.jsx("img",{src:a.image_path,alt:"",className:"h-16 w-full object-contain"}),a.name]},a.id))})]}):c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:o("brandPage.loading")})}const vv="data:image/webp;base64,UklGRmoNAABXRUJQVlA4IF4NAAAQjACdASrgAVYDPlEok0ajoqGhIRK4IHAKCWlu/F+5xDCoDux8VXNtc99B5Uf715Q+k/+V6E/yD7bfvf7tYI7QKys1Pu/n/K9wD+L/0L/aeqHflfZf937AH81/p//N/yXr9f9f+M/yf7c+4D6R/7n+O+BL9d+rb+0f//9yX9VQU+fHDhw4cN7KTkCBAgQIECBAgQIEB8GtgzU5WrVq1atWrVq1atTTWWxGRvDLM5r169evXr169evVcNgPhleRXp06dOnTp06dOnTpUIn65+OKaJVsmzZs2bNmzZs2bNmSyYC6ipEunTp06dOnTp06dOlydZVuN901q1atWrVq1atWrVXZqLYS16JYyeHDhw4cOHDhw4cN4wtQeDaQLgECBAgQIECBAgQIDddB6sEmQB2atWrVq1atWrVq1aq1iYS5JU9iBlzXr169evXr169evXeEPp+8N6OklatWrVq1atWrVq1V3IfqDdZ8CK1AgQIECBAgQIECBBQFoI3bXHSzdGb8+OHDhw4cOHDhw4ZwLNj/Gx48ePHjx48ePHjx5HaZ5q8hFQPLVq1atWrVq1atWrVWlrSSS1atWrVq1atWrVq1VouJ4vs1atWrVq1atWrVqzMNN6naRaj4OHDhw4cOHDhwzggYy8goXr169evXr169evXbAmy3nWg79+/fv379+/fv377Aw+GV3JG24BIkSJEiRIkSJEiRH091sORb3KZK2rVq1atWrVq1atWZgOgxn2g3CECBAgQIECBAgQHwEh4tRYq5WHRSJEiRIkSJEiRIkRmQ4gXd9q0Xa9evXr169evXr169SUP3aSDmqBOfHDhw4cOHDhw4cN/rYXzoW6jx48ePHjx48ePHjwyNgV/F/hRIkSJEiRIkSJEiRGcgeccx2x48ePHjx48ePHjx5+h2DL7y1q1atWrVq1atWrVqrLjxn1+UevXr169evXr169epWz/ixb7G7Fx48ePHjx48ePHjx64Dpo0+TFzjw4cOHDhw4cOHDhwr64/FOVqj1ftlBYsWLFixYsWLFixsB93m6MKtrfi/YePHjx48ePHjx48eGCFP4MdBX+BXbQiRIkSJEiRIkSJEiA+X4/Ne4l0FixYsWLFixYsWLTKZjxkHLs7TTrVq1atWrVq1atWrSGY83Cktx0PPjhw4cOHDhw4cN/7Xmd/H4DxEePHjx48ePHjx48ct7KWpas7p5jy5cuXLly5cuXLlyM+h2/gRIkSJEiRIkSJEiRAPRMs9EnbFixYsWLFixYsWLBwJstxClHwcOHDhw4cOHDhw3+o6GvCGxY8ePHjx48ePHjx45aAayr3BCnnxw4cOHDhw4cOG/2HuJWxIvK1JLZs2bNmzZs2bNmyAMNnZLnTo6dOnTp06dOnTp06Vd0rFPQfnwwCPHjx48ePHjx48eOU7jRhCFUn5bFixYsWLFixYsWKZRr/1LzwcOHDhw4cOHDhw4ZshIGgexQoECBAgQIECBAgQH+hD+jvXr169eu0AAP7/2BA2pStbx3f0LK6/mZcFuZpv73FLTm7GUv07j8lFLoOGX1EwKUHfPc4FImBkAvjxF1E2TgBogJKpQ2lbMv5bOqPckB4PELJo9ZXlMwGup4PkMOtTZPmrbNoaCJqn0H4Bx7A0xA439P5hkMGBnAEfInQIN5UeUIDb3y6tLej2gR8HhJ5XmTsxvmM15ltL5ZwdGmoNeW8NevUVUKqJ8mNngu7ocCsyGYaeYOGGZBBt6rj6bPVKVbxvb8onw6mljAaaxGTz0W+aNPv06kK3qhDe6/uHi8kg2qvjF3njhRMyOJKZzg12h4qOtVgTuKPAMRWYDkgwiRs9iYqcumonNNXvXk3FAk2LO5XnyjtD5sHSUO3pIrztpBvqq+UJzKeIwGBlPwA2NP46tOJxLzbrKeH4SQjt2HAsbrVcQ/b/TgKZGPwaqfGDN+OjqJK3Z9dyCkGGfGKeG1w9+HSZTm/qh052lQEJAcdUX6vm/+sDBxtrfl4Sg8iMcVnDsfTKJpsTYF/vzJ1oQ6/VPyIX1HpDwnPXsptu9rKDFazlkwc3ofi8uKJmycgPiG9xOLlzn4Af8Dm+LcjJUMAtA7XeZPLlW1bwogbRthU8oA4LcURuku6eXDJ1eb1IKUU7k/UK0cBeK+R5YVcmrOnZIyHzcIaClYnrIwerP535fHv4VXjURTO6/85BvSeTNWvQGqkW5v1hG6AEMrxBryfat3kmr+SNEz5wC2f54z1O7C2KsRpt3maISh9PhMg7jDIxmVe07eHtkLtz6v3yQUJQV95yazDYpH5JfpuYSb8dtmB1cKjeoDTPvik9dCA1UFCTZBfojpIOwXdwAR7JEdZkEi/24hMNKJJlB6udZZKqNJB1hNl24Z++z6lAGSAuRgSwDZGdbqxs+0iL6wmRHilqPOiYB6hQiPZ7cfpMZxesqRwyhcf1O29w4ORG/7BlerR8hYvY4B1XsPYbDORvPk6FHIDXwTXGpuDIta7G4F6RNDdOvCFkAl53GZo5h/p2QkWUry5YuyegnPlKjT3He6ewYypA9YOvMhaqip7kr9sF4TU2bX9foKZ+FFZNzhyySS+13+g4BdJo9YF3bw5b6eSxUfTWiDLNh50VjuqRQWHUEkiA8zJqnqkKCwuDy6iY2oF20FJQlGIPpCDKPBzdXSb/n9NDltaoUlbam7cDAU7CwNdaWFXTABRk0S0e49iF4tO106Uwul7DGYpq0Eu71TnKUjCtEBc83QH8skvRzHniEne3AtJLYRH0cMNSSzeCJ1g+Nfc8RaZkhLhCaZGZdYe5j0LGmQnVFt2iapZvGBi7Sw0X56zdziC9Foq0OPsqKFetZdICc2eUV5Vu1+nvisSzn8wlSDUt3OmRkt/gJxfJQfWxcu5HZ26qqNpA4ablWrX4E9DEmvXzpFGYCnYJMheN2BlWwBVLh1cyQ8INngXaoB8I5Pj9oYyuz/W+jvJQ6G074luX9D3pLkuc88D0Hae3ZqXrRYRzGF1vD8pHsk9Co8B6rpE/4GEwW/zsCtnjz5G8m4KFwf2qW1k0HkNv7Nlg38bcz6TdTzuw/jega5XZQQhflLu4I6l+s90BHFIR+JEXTBBqJwT+IgTnpHNc+h5Ek74HiKqXuGUNGIKIozHkiFxMlnrsklrpweBzYY6ype9CzepAuQF63xC/eIJw1pMZEC1pPgq/r+1gWx5M6g8fpu2O12sb6pLeqT+G4mK3yHMZTojfp1xwQedRmwZnWQ8SCh4XV2a/+3OTz4D4pmmumyBV7V2VW3he8y6usinSjfYPxLyTng27fgw6jQhHl2mVhxBBjiwr5ljvJV7L+MJYDiZjGWfBCsTmehk6rbNt7ahTJpHu4B9ctRqiZXjx0zGpTF91OKifmy4nTq31p1XaIsZAHCWvItXKeke06KKKRTIm6mCT9yBJVwG1sqQhjrkP77q0/JGYgOwgdCQCstsAZQ0FlOrGYXYTIQK/krLyCAZjg8vP/Ers/KVN8F88OsyU5/T1e5ba8A2F63qgwhtkWoVIEZErOVL8sM/DtpWTlcBNsvVOFl4tT+Sk6a2ScCptFL5F6cZXTIw8JmgoCbyqB6xyU+uPP5y09s5T8MDC7Em7NpxCjgD39eed40gHQrBm6CtAbS9JOCVPkPxbpcGDj/LoAGbnyYzMpOmTi28LJ9FTIqyGuAI0jxY/QpNelOOEvNK3io1HeYkK3AprImDk99tlUjgt9bc3ejCOFDXt9LqGHjFssGrhVHyJBmWjwHQipcIMHxF2jfP5jfAGuHtJRRncHIFgLWmJ1XmzJ0LLqWCJShdJSJLc7L6YeVcgKfzOZCwhtzJ7VeI3uBhPXQNOqCf5tlQ32HApAMvCIiBwhYrpfFo/kvjfTMB/NJ0w2Lk8GAFfFQY+U6uX1oB0hztGmA5HggJTwgLo8exG64m3Xu4fg2g4MmQol7z6xNwwubABnpoS3Og85giFkaarUP2ovQyixFpXki8Xf5a5NwjUGCPbx+LD3WKJiBtkiHsYMMV/VAZVNvdg/Ph/V4ZYOr+hw7g9mOJXi+oVZxG9pqJC9w8nRkegsnQ2lpRHn22lTsIa9aOkR0X8zp/IajQxUzv057a3WptBst0EZbZtfmWp6h2K0sDQS9oQT1PqOkGDJlz6ZHZzDMShDTcwJfIZMdnjpeHdPoYoqlcn3M8daRuMeTSP3mabP1/pdQrs6Wl7ToKog2Au/gv46pUMgVcKmdWNJdDF8RplMMXJpU2tZMdkTWq4ofSypsCfuWfeHOpFQGJdFF6OoH2pDJXvkqpj1a832g3uYtVQg1TGyqYqI7UBZQy4NEZbdj6O/s6MNEnfujUDQ8QZj7rSE2RI77egKDWzM708AsvlMFoeX4CVP09rMzXNP2aOZwY7zOBTvBgEEqCWlXAFlY8pW0zIm16gqSPiwRUgH41i1PuJx382C0zTWGT243ZhLnyOIlreUrMQAfwR/oYt+ljnDFKqa5PEczDPa+u/vWmR6UM+Q/lLFiIlgBJTfaekWoeLpPd9FPN4gIHzK1ZS8kDHyq3lh/e6FQ84a4Zg6JlfQC/qhAAAAA==",KI="/assets/base-BKOm0Bib.webp",GI="/assets/clear-DZZMSrMX.webp",qI="/assets/drive-BE2W1yna.webp",JI="/assets/prime-BTVNe2Gb.webp",YI="/assets/elite_r-BRvz_pyr.webp",XI="/assets/apex-CFy2qup8.webp",ZI="/assets/statement-pTO-wTPx.webp",QI="/assets/limitless-DDs0S_PU.webp",eO=(t,e,n)=>{e/=100,n/=100;const r=o=>(o+t/30)%12,s=e*Math.min(n,1-n),i=o=>n-s*Math.max(-1,Math.min(r(o)-3,Math.min(9-r(o),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},mf=(t,e,n)=>`rgb(${eO(t,e,n).join(", ")})`,kv=t=>t.map(([e,n,r,s,i,o])=>({bgTop:mf(e,n,r),border:mf(e,n,r+8),accent:mf(s,i,o),img:null})),wv={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:KI},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:GI},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:qI},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:JI},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:YI},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:XI},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:ZI},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:QI}],"deep-blue":kv([[215,18,11,210,15,60],[212,25,11,208,32,60],[210,38,12,206,46,60],[212,46,12,205,56,61],[214,52,12,205,63,62],[216,58,12,205,68,63],[220,62,12,212,73,65],[226,66,12,216,78,68]]),"warm-bronze":kv([[30,15,11,34,22,60],[34,32,11,34,46,60],[32,46,12,30,58,60],[26,52,12,24,65,60],[20,55,12,18,68,60],[14,55,12,12,68,61],[8,52,12,6,64,62],[2,50,12,358,60,63]])},tO="#f2f2f2",nO="#8a8a8a",rO="#c4c4c4",Sv=5;function sO({pkg:t,tier:e,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:o,t:a}){const[l,u]=v.useState(!1),d=s.length-Sv,h=l?s:s.slice(0,Sv),f=e.img?null:{backgroundColor:e.accent,WebkitMaskImage:`url(${vv})`,maskImage:`url(${vv})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return c.jsxs("div",{style:{borderColor:e.border,background:`linear-gradient(180deg, ${e.bgTop} 0%, #0b0b0b 55%, #080808 100%)`},className:r==="strip"?"relative flex min-h-[420px] grow shrink basis-[190px] min-w-[190px] max-w-[240px] snap-start flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40 sm:min-h-[640px] sm:basis-[210px]":r==="coverflow"?"relative flex min-h-[420px] w-[230px] shrink-0 snap-center flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40 sm:min-h-[640px]":"relative flex min-h-[420px] flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40 sm:min-h-[640px]",children:[e.img?c.jsx("img",{src:e.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...f,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),c.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...f,opacity:.55+n*.45},"aria-hidden":"true"})]}),t.is_featured&&c.jsx("span",{className:"absolute top-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-brand-500 px-3 py-1 text-xs font-bold text-white shadow",children:a("modelPage.featuredBadge")}),c.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0"},children:[c.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:e.accent,textTransform:"uppercase",lineHeight:1.1},children:t.name}),c.jsx("div",{style:{width:"44px",height:"2px",margin:"14px auto 0",background:`linear-gradient(90deg, rgba(255,255,255,0) 0%, ${e.accent} 50%, rgba(255,255,255,0) 100%)`}})]}),s.length>0&&c.jsxs("div",{className:"relative z-10",style:{padding:"18px 20px 14px",background:l?"linear-gradient(180deg, rgba(8,8,8,0.7) 0%, rgba(8,8,8,0.62) 94%, rgba(8,8,8,0) 100%)":"linear-gradient(180deg, rgba(8,8,8,0.55) 0%, rgba(8,8,8,0.48) 92%, rgba(8,8,8,0) 100%)"},children:[c.jsx("ul",{className:"space-y-1.5 text-left",children:h.map((p,m)=>c.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:rO},children:[c.jsx(Mt,{name:"check",className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:e.accent}}),c.jsx("span",{className:"leading-snug",children:p})]},m))}),d>0&&c.jsxs("button",{type:"button",onClick:()=>u(p=>!p),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:e.accent},children:[l?a("modelPage.lessBullets"):a("modelPage.moreBullets")(d),c.jsx(Mt,{name:l?"chevron-up":"chevron-down",className:"h-3.5 w-3.5"})]})]}),c.jsx("div",{className:"relative z-10 flex-1"}),c.jsx("div",{className:"relative z-10",style:{padding:"20px 20px 28px",background:"linear-gradient(180deg, rgba(8,8,8,0) 0%, rgba(8,8,8,0.85) 45%, rgba(8,8,8,0.95) 100%)"},children:c.jsxs("div",{className:"text-center",children:[!t.price_text&&c.jsx("div",{style:{fontSize:"13px",color:nO},children:a("modelPage.totalPrice")}),c.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:tO},children:t.price_text||i(t.total_price)}),c.jsx(ee,{to:o(t),className:"mt-4 inline-block rounded-md bg-brand-500 px-4 py-2 text-center text-sm font-semibold text-white shadow-lg shadow-brand-500/30 hover:bg-brand-400",children:a("modelPage.requestContact")})]})})]})}function iO(){const{brandSlug:t,modelSlug:e}=Qs(),[n,r]=v.useState(null),[s,i]=v.useState(""),o=Zd(),{t:a,language:l}=at(),{package_card_theme:u,package_card_layout:d,package_wheel_hint_interval:h}=rs(),f=wv[u]||wv.graphite,p=["grid","strip","coverflow"].includes(d)?d:"strip",m=Math.max(2,Number(h)||8)*1e3,g=v.useRef(null),y=v.useRef(null),b=v.useRef(null),[x,k]=v.useState(!1),w=T=>new Intl.NumberFormat(l==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(T);if(v.useEffect(()=>{o.vehicles.enabled&&!o.bypass||A.get(`/models/${t}/${e}/packages`).then(r).catch(T=>i(T.message))},[t,e,o.vehicles.enabled,o.bypass]),v.useEffect(()=>{const T=g.current;if(p!=="coverflow"||!T)return;let R=0;const $=()=>{R=0;const B=T.scrollLeft+T.clientWidth/2;for(const Z of T.children){const _=Z.offsetLeft+Z.offsetWidth/2,I=Math.max(-1,Math.min(1,(_-B)/(Z.offsetWidth*1.4))),V=Math.abs(I);Z.style.transform=`rotateY(${(-I*35).toFixed(2)}deg) scale(${(1-V*.13).toFixed(3)}) translateZ(${(-V*60).toFixed(1)}px)`,Z.style.zIndex=String(100-Math.round(V*50))}},L=()=>{R||(R=requestAnimationFrame($))};$(),T.addEventListener("scroll",L,{passive:!0});const W=new ResizeObserver(L);return W.observe(T),()=>{T.removeEventListener("scroll",L),W.disconnect(),cancelAnimationFrame(R)}},[p,n]),v.useEffect(()=>{const T=g.current;if(p==="grid"||!T)return;const R=window.matchMedia("(pointer: coarse)").matches;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let L=[],W=0;const B=()=>{const _=Math.min(T.clientWidth*.4,160);L.push(setTimeout(()=>T.scrollTo({left:_,behavior:"smooth"}),500)),L.push(setTimeout(()=>T.scrollTo({left:0,behavior:"smooth"}),1250)),R||(L.push(setTimeout(()=>k(!0),450)),L.push(setTimeout(()=>k(!1),1700)))},Z=new IntersectionObserver(([_])=>{_.isIntersecting&&(Z.disconnect(),B(),W=setInterval(()=>{T.scrollLeft<=1&&B()},m))},{threshold:.35});return Z.observe(T),()=>{Z.disconnect(),clearInterval(W),L.forEach(clearTimeout)}},[p,n,m]),v.useEffect(()=>{const T=g.current;if(p==="grid"||!T)return;let R=0,$=0,L=!1,W=0,B=0;const Z=()=>[...T.children].map(K=>K.offsetLeft+K.offsetWidth/2),_=(K,te)=>{let Se=0,se=1/0;return K.forEach((he,Te)=>{const lt=Math.abs(he-te);lt{L=!1;const K=Z();if(!K.length)return;const te=T.scrollLeft+T.clientWidth/2,Se=_(K,te);let se=Se;Se===W&&Math.abs(B)>4&&(se=B>0?Math.min(W+1,K.length-1):Math.max(W-1,0));const he=T.scrollWidth-T.clientWidth,Te=Math.max(0,Math.min(K[se]-T.clientWidth/2,he));T.scrollTo({left:Te,behavior:"smooth"}),clearTimeout($),$=setTimeout(()=>{T.style.scrollSnapType=""},450)},V=K=>{if(Math.abs(K.deltaX)>Math.abs(K.deltaY))return;const te=T.scrollWidth-T.clientWidth;if(te<=1)return;const Se=T.scrollLeft<=1,se=T.scrollLeft>=te-1;K.deltaY<0&&Se||K.deltaY>0&&se||(K.preventDefault(),L||(L=!0,B=0,W=_(Z(),T.scrollLeft+T.clientWidth/2)),B+=K.deltaY,T.style.scrollSnapType="none",T.scrollLeft+=K.deltaY,clearTimeout(R),R=setTimeout(I,150))};return T.addEventListener("wheel",V,{passive:!1}),()=>{T.removeEventListener("wheel",V),clearTimeout(R),clearTimeout($)}},[p,n]),v.useEffect(()=>{const T=g.current,R=y.current,$=b.current;if(p==="grid"||!T||!R||!$)return;let L=0;const W=()=>{L=0;const se=T.scrollWidth-T.clientWidth;if(se<=1){R.style.opacity="0",R.style.pointerEvents="none";return}R.style.opacity="1",R.style.pointerEvents="auto";const he=R.clientWidth,Te=Math.max(32,T.clientWidth/T.scrollWidth*he);$.style.width=`${Te}px`,$.style.transform=`translateX(${(T.scrollLeft/se*(he-Te)).toFixed(1)}px)`},B=()=>{L||(L=requestAnimationFrame(W))};W(),T.addEventListener("scroll",B,{passive:!0});const Z=new ResizeObserver(B);Z.observe(T);let _=!1,I=0;const V=se=>{const he=R.getBoundingClientRect(),Te=$.clientWidth,lt=Math.min(Math.max(se-he.left-I,0),he.width-Te);T.scrollLeft=lt/(he.width-Te)*(T.scrollWidth-T.clientWidth)},K=se=>{_=!0,R.setPointerCapture(se.pointerId),T.style.scrollSnapType="none";const he=$.getBoundingClientRect();I=se.clientX>=he.left&&se.clientX<=he.right?se.clientX-he.left:$.clientWidth/2,se.clientX>=he.left&&se.clientX<=he.right||V(se.clientX)},te=se=>{_&&V(se.clientX)},Se=se=>{var he;_&&(_=!1,(he=R.hasPointerCapture)!=null&&he.call(R,se.pointerId)&&R.releasePointerCapture(se.pointerId),T.style.scrollSnapType="")};return R.addEventListener("pointerdown",K),R.addEventListener("pointermove",te),R.addEventListener("pointerup",Se),R.addEventListener("pointercancel",Se),()=>{T.removeEventListener("scroll",B),Z.disconnect(),cancelAnimationFrame(L),R.removeEventListener("pointerdown",K),R.removeEventListener("pointermove",te),R.removeEventListener("pointerup",Se),R.removeEventListener("pointercancel",Se)}},[p,n]),Wt({title:n?a("modelPage.metaTitle")(n.model.brand_name,n.model.name):a("modelPage.metaTitleFallback"),description:n?a("modelPage.metaDescription")(n.model.brand_name,n.model.name):void 0,path:`/fahrzeuge/${t}/${e}`}),o.vehicles.enabled&&!o.bypass)return c.jsx(kl,{message:o.vehicles.message});if(s)return c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s});if(!n)return c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:a("modelPage.loading")});const{model:C,packages:E}=n,S=new Map([...E].sort((T,R)=>T.total_price-R.total_price).map((T,R)=>[T.id,R])),N=T=>{const R=E.length,$=S.get(T.id)??0,L=R<=1?0:$/(R-1),W=Math.round(L*(f.length-1));return{tier:f[W],tierT:L}},M=T=>[...T.products.map(R=>R.name_override||R.scraped_name||a("modelPage.productLoading")),...(T.description||"").split(` -`).map(R=>R.trim()).filter(Boolean)],j=T=>`/kontakt?${new URLSearchParams({brand:C.brand_name,model:C.name,package:T.name,packageId:T.id,total:T.total_price}).toString()}`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-12 sm:px-6",children:[o.vehicles.enabled&&o.bypass&&c.jsx(wl,{inline:!0}),c.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[c.jsx(ee,{to:"/fahrzeuge",className:"hover:text-brand-500",children:a("modelPage.breadcrumbVehicles")})," /"," ",c.jsx(ee,{to:`/fahrzeuge/${t}`,className:"hover:text-brand-500",children:C.brand_name})," / ",C.name]}),c.jsxs("h1",{className:`text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl ${E.length?"mb-2":"mb-8"}`,children:[C.brand_name," ",C.name," – ",a("modelPage.titleSuffix")]}),E.length===0&&c.jsx("p",{className:"pb-12 text-neutral-500 dark:text-neutral-400",children:a("modelPage.empty")})]}),E.length>0&&c.jsx("section",{className:"py-10 sm:py-14",style:{fontFamily:"'Barlow', sans-serif"},children:c.jsxs("div",{className:p==="grid"?"mx-auto max-w-6xl px-4 sm:px-6":"relative mx-auto max-w-[1880px] px-4 sm:px-6",children:[c.jsx("div",{ref:p==="grid"?void 0:g,className:p==="grid"?"grid items-start gap-[18px] sm:grid-cols-2 xl:grid-cols-3":"flex select-none items-start gap-[18px] overflow-x-auto pb-3 snap-x snap-mandatory [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:p==="coverflow"?{perspective:"1200px",paddingLeft:"calc(50% - 115px)",paddingRight:"calc(50% - 115px)",paddingTop:"10px"}:void 0,children:E.map(T=>{const{tier:R,tierT:$}=N(T);return c.jsx(sO,{pkg:T,tier:R,tierT:$,layout:p,bullets:M(T),formatPrice:w,contactUrl:j,t:a},T.id)})}),p!=="grid"&&c.jsx("div",{className:`pointer-events-none absolute inset-x-0 top-1/2 z-[200] flex -translate-y-1/2 justify-center transition-opacity duration-300 ${x?"opacity-100":"opacity-0"}`,"aria-hidden":"true",children:c.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-neutral-900/85 px-4 py-2 text-xs font-medium text-white shadow-lg backdrop-blur-sm",children:[c.jsx(H2,{className:"h-3.5 w-3.5 text-brand-400"}),c.jsx(W2,{className:"h-4 w-4 text-brand-400"}),c.jsx(U2,{className:"h-3.5 w-3.5 text-brand-400"}),c.jsx("span",{children:a("modelPage.wheelHint")})]})}),p!=="grid"&&c.jsx("div",{ref:y,className:"relative mx-auto mt-5 h-2 w-56 max-w-full cursor-pointer rounded-full bg-neutral-900/10 transition-opacity duration-200 dark:bg-white/10",style:{touchAction:"none"},"aria-hidden":"true",children:c.jsx("div",{ref:b,className:"absolute left-0 top-0 h-full rounded-full bg-brand-500 shadow-[0_0_10px_rgba(107,166,38,0.7)]",style:{width:"48px"}})})]})})]})}function oO(){const[t,e]=v.useState(null),[n,r]=v.useState(""),{t:s}=at(),{gallery_card_text_x:i,gallery_card_text_y:o}=rs();return Wt({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),v.useEffect(()=>{A.get("/gallery-brands").then(e).catch(a=>r(a.message))},[]),c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[c.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("galleryOverview.title")}),c.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:s("galleryOverview.intro")}),n&&c.jsx("p",{className:"text-red-600",children:n}),!t&&!n&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),t&&t.length===0&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t==null?void 0:t.map(a=>c.jsxs(ee,{to:`/galerie/${a.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[a.cover_image_path?c.jsx("img",{src:a.cover_image_path,alt:a.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),c.jsx("span",{className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:Xi(i,o,{x:0,y:100}),children:a.name})]},a.id))})]})}function aO(){const{brandSlug:t}=Qs(),[e,n]=v.useState(null),[r,s]=v.useState(""),{t:i}=at(),{gallery_card_text_x:o,gallery_card_text_y:a}=rs();return v.useEffect(()=>{A.get(`/gallery-brands/${t}/projects`).then(n).catch(l=>s(l.message))},[t]),Wt({title:e?i("galleryBrandPage.metaTitle")(e.brand.name):i("galleryBrandPage.metaTitleFallback"),description:e?i("galleryBrandPage.metaDescription")(e.brand.name):void 0,path:`/galerie/${t}`}),r?c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):e?c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[c.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[c.jsx(ee,{to:"/galerie",className:"hover:text-brand-500",children:i("galleryBrandPage.breadcrumbGallery")})," / ",e.brand.name]}),c.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[e.brand.name," – ",i("galleryBrandPage.titleSuffix")]}),e.projects.length===0&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("galleryBrandPage.empty")}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:e.projects.map(l=>c.jsxs(ee,{to:`/galerie/${t}/${l.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[l.cover_image_path?c.jsx("img",{src:l.cover_image_path,alt:l.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),c.jsx("span",{className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:Xi(o,a,{x:0,y:100}),children:l.name})]},l.id))})]}):c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:i("galleryBrandPage.loading")})}function lO({photos:t,index:e,onClose:n,onNavigate:r}){const{t:s}=at();if(v.useEffect(()=>{if(e==null)return;const a=l=>{l.key==="Escape"&&n(),l.key==="ArrowRight"&&r(1),l.key==="ArrowLeft"&&r(-1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,n,r]),e==null)return null;const i=t[e],o=a=>a.stopPropagation();return $d.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:n,children:[c.jsx("button",{onClick:a=>{o(a),n()},"aria-label":s("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-7 w-7",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),t.length>1&&c.jsx("button",{onClick:a=>{o(a),r(-1)},"aria-label":s("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),c.jsx("img",{src:i.image_path,alt:i.caption||"",onClick:o,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),t.length>1&&c.jsx("button",{onClick:a=>{o(a),r(1)},"aria-label":s("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),i.caption&&c.jsx("p",{onClick:o,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:i.caption})]}),document.body)}function cO(){const{brandSlug:t,projectSlug:e}=Qs(),[n,r]=v.useState(null),[s,i]=v.useState(""),[o,a]=v.useState(null),{t:l}=at();v.useEffect(()=>{A.get(`/gallery-brands/${t}/${e}/photos`).then(r).catch(d=>i(d.message))},[t,e]),Wt({title:n?`${n.project.name} – ${n.project.brand_name}`:l("galleryProjectPage.metaTitleFallback"),description:n?l("galleryProjectPage.metaDescription")(n.project.name):void 0,path:`/galerie/${t}/${e}`});const u=d=>{a(h=>{const f=n.photos.length;return(h+d+f)%f})};return s?c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s}):n?c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[c.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[c.jsx(ee,{to:"/galerie",className:"hover:text-brand-500",children:l("galleryProjectPage.breadcrumbGallery")})," /"," ",c.jsx(ee,{to:`/galerie/${t}`,className:"hover:text-brand-500",children:n.project.brand_name})," / ",n.project.name]}),c.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:n.project.name}),n.photos.length===0&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:l("galleryProjectPage.empty")}),c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:n.photos.map((d,h)=>c.jsx(Qe,{index:h%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:c.jsx("button",{onClick:()=>a(h),className:"block h-full w-full","aria-label":d.caption||l("galleryProjectPage.enlargeImage"),children:c.jsx("img",{src:d.image_path,alt:d.caption||"",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},d.id))}),c.jsx(lO,{photos:n.photos,index:o,onClose:()=>a(null),onNavigate:u})]}):c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:l("galleryProjectPage.loading")})}function uO(){const[t,e]=v.useState([]),n=Zd(),{t:r}=at();return v.useEffect(()=>{A.get("/services").then(e).catch(()=>e([]))},[]),Wt({title:r("leistungen.metaTitle"),description:r("leistungen.metaDescription"),path:"/leistungen"}),n.services.enabled&&!n.bypass?c.jsx(kl,{message:n.services.message}):c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[n.services.enabled&&n.bypass&&c.jsx(wl,{inline:!0}),c.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:r("leistungen.title")}),c.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:r("leistungen.intro")}),c.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:t.map((s,i)=>c.jsxs(Qe,{index:i%3,shine:!0,className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"relative aspect-[4/3]",children:[s.image_path&&c.jsx("img",{src:s.image_path,alt:s.title,className:"h-full w-full object-cover",loading:"lazy"}),c.jsx("div",{className:"absolute -bottom-5 left-5 flex h-12 w-12 items-center justify-center rounded-full bg-brand-500 text-white shadow-lg ring-4 ring-white dark:ring-neutral-900",children:c.jsx(Mt,{name:s.icon_name,className:"h-6 w-6"})})]}),c.jsxs("div",{className:"p-6 pt-8",children:[c.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:s.title}),c.jsx("p",{className:"mb-3 text-sm text-neutral-600 dark:text-neutral-300",children:s.description}),c.jsxs(ee,{to:s.cta_url||"/kontakt",className:"text-sm font-semibold text-brand-600 hover:underline dark:text-brand-400",children:[s.cta_label||r("leistungen.contact")," →"]})]})]},s.id))}),c.jsxs("div",{className:"mt-12 rounded-xl border border-neutral-200 bg-neutral-50 p-8 text-center dark:border-neutral-800 dark:bg-neutral-900/40",children:[c.jsx("h2",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:r("leistungen.notListedTitle")}),c.jsx("p",{className:"mb-5 text-neutral-600 dark:text-neutral-300",children:r("leistungen.notListedText")}),c.jsx(ee,{to:"/kontakt",className:"inline-block rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white hover:bg-brand-600",children:r("leistungen.contact")})]})]})}function dO({name:t,description:e,className:n="",children:r}){const{consent:s,acceptAll:i,openSettings:o}=go();return s.external?r:c.jsxs("div",{className:`flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-neutral-50 p-6 text-center dark:border-neutral-800 dark:bg-neutral-900/40 ${n}`,children:[c.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:e||`${t} wird erst nach deiner Zustimmung geladen, da dabei Daten an Google übertragen werden.`}),c.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[c.jsx("button",{type:"button",onClick:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Laden erlauben"}),c.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Cookie-Einstellungen"})]})]})}const ij=t=>(t||"").replace(/[^\d+]/g,""),hO=t=>`https://wa.me/${ij(t).replace(/^0/,"49").replace("+","")}`,$c={fontFamily:"'Michroma', sans-serif"};function fO({className:t}){return c.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M12 2a10 10 0 0 0-8.6 15l-1.3 4.8 5-1.3A10 10 0 1 0 12 2zm0 2a8 8 0 1 1-4.2 14.8l-.3-.2-2.6.7.7-2.5-.2-.3A8 8 0 0 1 12 4zm4.3 9.9c-.2-.1-1.4-.7-1.6-.8s-.4-.1-.5.1l-.7.9c-.1.1-.3.2-.5.1a6.5 6.5 0 0 1-3.2-2.8c-.1-.2 0-.4.1-.5l.4-.5.2-.4v-.4l-.7-1.7c-.2-.4-.4-.4-.5-.4h-.5c-.2 0-.4.1-.6.3-.7.7-.9 1.6-.6 2.7.5 1.7 1.6 3.1 3.4 4.2 1.7 1 2.5 1 3.4.9.5-.1 1.4-.6 1.6-1.1.2-.5.2-1 .1-1.1z"})})}function pO({path:t,className:e}){return c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:t})})}const mO={premium:"M4 12v3M8 8v11M12 4v16M16 8v11M20 12v3",germany:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0 M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5 19 19M19 5l-1.5 1.5M6.5 17.5 5 19",individual:"M6 3h12l4 6-10 12L2 9z M11 3 8 9l4 12 4-12-3-6M2 9h20",experts:"M20 6 9 17l-5-5"};function Nv({formatted:t,color:e}){const[n,r]=t.split("€");return c.jsxs("span",{style:{...$c,color:e},children:[n,c.jsx("span",{style:{fontFamily:"'Barlow', sans-serif"},children:"€"}),r]})}function nc({icon:t,label:e,name:n,type:r="text",required:s,value:i,onChange:o,placeholder:a}){return c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("label",{htmlFor:`kf-${n}`,className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:e}),c.jsxs("div",{className:"relative flex items-center",children:[c.jsx(t,{className:"pointer-events-none absolute left-[14px] h-[17px] w-[17px]",style:{color:"var(--kf-fieldicon)"}}),c.jsx("input",{id:`kf-${n}`,name:n,type:r,required:s,value:i,onChange:o,placeholder:a,className:"w-full rounded-lg border py-3.5 pl-[42px] pr-4 text-[15px] outline-none transition-colors",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)",color:"var(--kf-text2)"}})]})]})}function gO(){const[t]=mD(),{phone:e,whatsapp:n,contact_email:r,address_street:s,address_zip:i,address_city:o,business_hours:a}=rs(),{t:l,language:u}=at(),{consent:d}=go(),h=[s,[i,o].filter(Boolean).join(" ")].filter(Boolean).join(", "),f=encodeURIComponent(h),p=`https://www.google.com/maps/dir/?api=1&destination=${f}`,m=lN(a,l("footer.closed")),g=I=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(I),[y,b]=v.useState({name:"",email:"",phone:"",vin:"",message:""}),[x,k]=v.useState("idle"),[w,C]=v.useState(""),[E,S]=v.useState([]),[N,M]=v.useState([]),j=t.get("packageId"),T=t.get("total")?Number(t.get("total")):null;v.useEffect(()=>{if(!j){S([]);return}A.get(`/packages/${j}/upgrades`).then(S).catch(()=>S([]))},[j]);const R=I=>{M(V=>V.includes(I)?V.filter(K=>K!==I):[...V,I])},$=E.filter(I=>N.includes(I.id)).reduce((I,V)=>I+Number(V.price),0);Wt({title:l("contactPage.metaTitle"),description:l("contactPage.metaDescription"),path:"/kontakt"});const L={brand:t.get("brand")||"",model:t.get("model")||"",package:t.get("package")||""},W=!!(L.brand&&L.model&&L.package),B=I=>b(V=>({...V,[I.target.name]:I.target.value})),Z=async I=>{I.preventDefault(),k("sending"),C("");try{await A.post("/contact",{...y,brand_name:L.brand||null,model_name:L.model||null,package_name:L.package||null,product_name:t.get("product")||null,package_id:j||null,package_product_id:t.get("productId")||null,upgrade_ids:N}),k("sent"),b({name:"",email:"",phone:"",vin:"",message:""})}catch(V){C(V.message),k("idle")}},_=[{key:"premium",title:l("contactPage.featurePremiumTitle"),sub:l("contactPage.featurePremiumSub")},{key:"germany",title:l("contactPage.featureGermanyTitle"),sub:l("contactPage.featureGermanySub")},{key:"individual",title:l("contactPage.featureIndividualTitle"),sub:l("contactPage.featureIndividualSub")},{key:"experts",title:l("contactPage.featureExpertsTitle"),sub:l("contactPage.featureExpertsSub")}];return c.jsx("div",{className:"kf-page kontakt-sektion relative w-full overflow-hidden px-4 pb-10 sm:px-10",style:{color:"var(--kf-text2)",fontFamily:"'Barlow', sans-serif"},children:c.jsxs("div",{className:"relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14",children:[c.jsx("div",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.heroEyebrow")}),c.jsxs("h1",{className:"text-[34px] leading-[1.08] sm:text-[46px] lg:text-[60px]",style:{...$c,color:"var(--kf-text)"},children:[l("contactPage.heroTitlePre")," ",c.jsx("span",{style:{color:"var(--kf-accent2)"},children:l("contactPage.heroTitleAccent")})," ",l("contactPage.heroTitlePost")]}),c.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:"var(--kf-muted)"},children:l("contactPage.heroSubtitle")}),c.jsxs("div",{className:"grid grid-cols-1 items-start gap-10 min-[981px]:grid-cols-[minmax(0,1.35fr)_minmax(320px,1fr)]",children:[c.jsx("div",{children:c.jsxs("div",{className:"rounded-2xl border p-[22px] sm:p-10",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[W&&c.jsxs("div",{className:"mb-8 rounded-xl border px-6 py-[22px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[c.jsxs("div",{className:"mb-3.5 flex items-center gap-2.5 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:[c.jsx(K2,{className:"h-4 w-4"}),l("contactPage.packageBoxTitle")]}),c.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-5 gap-y-2 text-[15px]",children:[c.jsx("span",{style:{color:"var(--kf-label)"},children:l("contactPage.contextBrand")}),c.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:L.brand}),c.jsx("span",{style:{color:"var(--kf-label)"},children:l("contactPage.contextModel")}),c.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:L.model}),c.jsx("span",{style:{color:"var(--kf-label)"},children:l("contactPage.contextPackage")}),c.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:L.package})]}),c.jsxs("div",{className:"mt-3.5 flex items-baseline justify-between border-t pt-3.5",style:{borderColor:"var(--kf-pkgbrd)"},children:[c.jsx("span",{className:"text-[13px] font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:l("contactPage.packagePrice")}),c.jsx("span",{className:"text-xl",children:T!=null?c.jsx(Nv,{formatted:g(T),color:"var(--kf-text)"}):"—"})]})]}),E.length>0&&c.jsxs("div",{className:"mb-8 rounded-xl border p-5",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)"},children:[c.jsx("div",{className:"mb-3 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.optionalUpgrades")}),c.jsx("div",{className:"space-y-2",children:E.map(I=>c.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border p-3 text-sm",style:{borderColor:"var(--kf-fieldbrd)"},children:[c.jsx("input",{type:"checkbox",checked:N.includes(I.id),onChange:()=>R(I.id),className:"mt-0.5 h-4 w-4 rounded",style:{accentColor:"var(--kf-accent)"}}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block font-semibold",style:{color:"var(--kf-text2)"},children:I.name}),I.description&&c.jsx("span",{className:"block text-xs",style:{color:"var(--kf-muted)"},children:I.description})]}),c.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-accent2)"},children:["+",g(I.price)]})]},I.id))}),N.length>0&&T!=null&&c.jsxs("div",{className:"mt-3 flex items-baseline justify-between border-t pt-3 text-sm",style:{borderColor:"var(--kf-pkgbrd)"},children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:l("contactPage.totalWithUpgrades")}),c.jsx(Nv,{formatted:g(T+$),color:"var(--kf-text)"})]})]}),c.jsx("h2",{className:"mb-8 text-xl",style:{...$c,color:"var(--kf-text)"},children:l("contactPage.formTitle")}),x==="sent"&&c.jsxs("div",{className:"mb-6 rounded-[10px] border p-5",style:{borderColor:"var(--kf-accent)",background:"var(--kf-accentsoft)"},children:[c.jsx("div",{className:"text-base font-bold",style:{color:"var(--kf-accent2)"},children:l("contactPage.sentTitle")}),c.jsx("div",{className:"mt-1 text-sm",style:{color:"var(--kf-muted)"},children:l("contactPage.sentText")})]}),c.jsxs("form",{onSubmit:Z,children:[c.jsxs("div",{className:"grid grid-cols-1 gap-6 min-[641px]:grid-cols-2",children:[c.jsx(nc,{icon:G2,label:l("contactPage.nameLabel"),name:"name",required:!0,value:y.name,onChange:B,placeholder:l("contactPage.namePlaceholder")}),c.jsx(nc,{icon:Nx,label:l("contactPage.emailLabel"),name:"email",type:"email",required:!0,value:y.email,onChange:B,placeholder:l("contactPage.emailPlaceholder")}),c.jsx(nc,{icon:Cx,label:l("contactPage.phoneLabel"),name:"phone",value:y.phone,onChange:B,placeholder:l("contactPage.phonePlaceholder")}),c.jsx(nc,{icon:q2,label:l("contactPage.vinLabel"),name:"vin",value:y.vin,onChange:B,placeholder:l("contactPage.vinPlaceholder")})]}),c.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[c.jsx("label",{htmlFor:"kf-message",className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:l("contactPage.messageLabel")}),c.jsx("textarea",{id:"kf-message",name:"message",rows:5,value:y.message,onChange:B,placeholder:l("contactPage.messagePlaceholder"),className:"w-full resize-y rounded-lg border px-4 py-3.5 text-[15px] outline-none",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)",color:"var(--kf-text2)"}})]}),w&&c.jsx("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:w}),c.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-5",children:[c.jsxs("button",{type:"submit",disabled:x==="sending",className:"inline-flex items-center gap-3 rounded-lg px-8 py-4 text-sm font-bold uppercase tracking-[3px] transition-[filter,box-shadow] hover:brightness-110 disabled:opacity-60",style:{background:"var(--kf-accent)",color:"var(--kf-btntext)",boxShadow:"0 10px 24px rgba(150,200,20,0.32)"},children:[c.jsx(J2,{className:"h-[18px] w-[18px]"}),l(x==="sending"?"contactPage.sending":"contactPage.submit")]}),c.jsx("div",{className:"text-[13px]",style:{color:"var(--kf-label)"},children:l("contactPage.requiredHint")})]})]})]})}),c.jsxs("div",{className:"flex flex-col gap-6",children:[c.jsxs("div",{className:"relative overflow-hidden rounded-2xl border px-[22px] py-[26px] sm:px-8 sm:py-[34px]",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[c.jsx("div",{className:"pointer-events-none absolute -right-[60px] -top-[60px] h-[190px] w-[190px] rounded-full border border-dashed",style:{borderColor:"var(--kf-pkgbrd)"}}),c.jsx("h2",{className:"mb-7 text-[17px]",style:{...$c,color:"var(--kf-text)"},children:l("contactPage.cardTitle")}),c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:c.jsx(Cx,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.phone")}),c.jsx("a",{href:`tel:${ij(e)}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:e})]})]}),c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:c.jsx(Nx,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.email")}),c.jsx("a",{href:`mailto:${r}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:r})]})]}),c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:c.jsx(Y2,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.address")}),c.jsxs("div",{className:"text-base font-semibold leading-[1.4]",style:{color:"var(--kf-text2)"},children:[s,c.jsx("br",{}),[i,o].filter(Boolean).join(" ")]})]})]}),n&&c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:c.jsx(fO,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("nav.whatsapp")}),c.jsx("a",{href:hO(n),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:n})]})]})]}),c.jsxs("div",{className:"mt-7 border-t pt-6",style:{borderColor:"var(--kf-divider)"},children:[c.jsx("div",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.hours")}),c.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-[15px]",children:m.map(I=>c.jsxs("span",{style:{display:"contents"},children:[c.jsx("span",{style:{color:"var(--kf-label)"},children:I.days}),c.jsx("span",{children:I.label})]},I.key))})]})]}),c.jsxs("div",{className:"relative overflow-hidden rounded-2xl border",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[d.external&&c.jsxs("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"absolute left-3.5 top-3.5 z-10 inline-flex items-center gap-2 rounded-lg border px-3.5 py-2 text-[13px] font-semibold hover:border-[var(--kf-accent)]",style:{background:"var(--kf-pill)",borderColor:"var(--kf-pillbrd)",color:"var(--kf-text2)",boxShadow:"var(--kf-shadow2)"},children:[l("contactPage.mapOpenChip"),c.jsx(X2,{className:"h-3.5 w-3.5",style:{color:"var(--kf-accent2)"}})]}),c.jsx(dO,{name:l("contactPage.mapEmbedName"),className:"h-[210px] w-full",children:c.jsx("div",{className:"h-[210px] overflow-hidden",children:c.jsx("iframe",{title:"HifiPlanet Amorbach – Standort",src:`https://www.google.com/maps?q=${f}&output=embed`,width:"100%",height:"290",style:{border:0,display:"block",marginTop:"-60px"},loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"})})}),c.jsxs("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2.5 border-t px-4 py-4 text-[13px] font-bold uppercase tracking-[3px] hover:bg-[var(--kf-accentsoft)]",style:{borderColor:"var(--kf-divider)",color:"var(--kf-accent2)"},children:[l("contactPage.routePlan")," →"]})]})]})]}),c.jsx("div",{className:"mt-10 grid grid-cols-1 overflow-hidden rounded-2xl border min-[641px]:grid-cols-2 min-[901px]:grid-cols-4",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow2)"},children:_.map(I=>c.jsxs("div",{className:"flex items-center gap-4 border-b p-6 last:border-b-0 min-[641px]:border-b-0 min-[641px]:border-r min-[641px]:last:border-r-0",style:{borderColor:"var(--kf-divider)"},children:[c.jsx("div",{className:"flex h-[46px] w-[46px] flex-shrink-0 items-center justify-center rounded-full border-[1.5px]",style:{borderColor:"var(--kf-pkgbrd)",color:"var(--kf-accent2)"},children:c.jsx(pO,{path:mO[I.key],className:"h-[22px] w-[22px]"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[15px] font-bold",style:{color:"var(--kf-text)"},children:I.title}),c.jsx("div",{className:"mt-0.5 text-[13px]",style:{color:"var(--kf-muted)"},children:I.sub})]})]},I.key))})]})})}function xO(){const[t,e]=v.useState(null);return v.useEffect(()=>{A.get("/legal-pages/impressum").then(e).catch(()=>{})},[]),Wt({title:(t==null?void 0:t.title)||"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG.",path:"/impressum"}),t?c.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[c.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:t.title}),c.jsx("div",{className:"legal-content text-sm text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:t.body_html}})]}):null}function yO(){const[t,e]=v.useState(null);return v.useEffect(()=>{A.get("/legal-pages/datenschutz").then(e).catch(()=>{})},[]),Wt({title:(t==null?void 0:t.title)||"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO.",path:"/datenschutz"}),t?c.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[c.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:t.title}),c.jsx("div",{className:"legal-content text-sm text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:t.body_html}})]}):null}function bO(){const[t,e]=v.useState(null);return v.useEffect(()=>{A.get("/legal-pages/agb").then(e).catch(()=>{})},[]),Wt({title:(t==null?void 0:t.title)||"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach.",path:"/agb"}),t?c.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[c.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:t.title}),c.jsx("div",{className:"legal-content text-sm text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:t.body_html}})]}):null}const vO={host:"",name:"",user:"",password:"",charset:"utf8mb4"},kO={username:"",password:"",password_confirmation:""};function wO(){Wt({title:"Ersteinrichtung",path:"/setup"});const[t,e]=v.useState("loading"),[n,r]=v.useState(""),[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(vO),[d,h]=v.useState(kO),[f,p]=v.useState(null),m=()=>A.get("/setup/status").then(S=>(S.needs_setup?S.steps.admin.ok?e("done"):S.steps.schema.ok?e("admin"):e(S.steps.database.ok?"schema":"database"):e("locked"),S));v.useEffect(()=>{A.get("/setup/status").then(S=>e(S.needs_setup?"password":"locked")).catch(()=>e("locked"))},[]);const g=async S=>{S.preventDefault(),r(""),i(!0);try{await A.post("/setup/verify-password",{password:o}),await m()}catch(N){r(N.message)}finally{i(!1)}},y=async S=>{S.preventDefault(),r(""),i(!0);try{await A.post("/setup/database",l),await m()}catch(N){r(N.message)}finally{i(!1)}},b=async()=>{r(""),i(!0);try{const S=await A.post("/setup/migrate",{});p(S.actions),S.status.steps.schema.ok&&e("admin")}catch(S){r(S.message)}finally{i(!1)}},x=async S=>{if(S.preventDefault(),r(""),d.password!==d.password_confirmation){r("Die Passwörter stimmen nicht überein");return}i(!0);try{await A.post("/setup/admin",d),e("done")}catch(N){r(N.message)}finally{i(!1)}},k="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900",w="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",C=[{key:"database",label:"Datenbank"},{key:"schema",label:"Struktur"},{key:"admin",label:"Admin-Account"}],E=C.findIndex(S=>S.key===t);return c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 py-12 dark:bg-neutral-950",children:[c.jsx("img",{src:Ka,alt:"HifiPlanet",className:"h-16 w-auto sm:h-20"}),c.jsxs("div",{className:"w-full max-w-md rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[t==="loading"&&c.jsx("p",{className:"text-center text-sm text-neutral-400",children:"Lädt…"}),t==="locked"&&c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bereits eingerichtet"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Seite wurde bereits vollständig eingerichtet. Der Assistent ist deshalb gesperrt."}),c.jsx(ee,{to:"/admin/login",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Zum Login"})]}),["database","schema","admin"].includes(t)&&c.jsx("div",{className:"mb-6 flex items-center justify-center gap-2",children:C.map((S,N)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-semibold ${Na(S.target.value),required:!0,autoFocus:!0,className:k})]}),n&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),c.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Prüfe…":"Weiter"})]}),t==="database"&&c.jsxs("form",{onSubmit:y,children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Trage die Zugangsdaten der Datenbank auf diesem Server ein. Die Verbindung wird vor dem Speichern getestet."}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Host *"}),c.jsx("input",{required:!0,value:l.host,onChange:S=>u({...l,host:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Datenbankname *"}),c.jsx("input",{required:!0,value:l.name,onChange:S=>u({...l,name:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Benutzer *"}),c.jsx("input",{required:!0,value:l.user,onChange:S=>u({...l,user:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Passwort"}),c.jsx("input",{type:"password",value:l.password,onChange:S=>u({...l,password:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-6",children:[c.jsx("label",{className:w,children:"Zeichensatz"}),c.jsx("input",{value:l.charset,onChange:S=>u({...l,charset:S.target.value}),className:k})]}),n&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),c.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Teste Verbindung…":"Verbindung testen & speichern"})]}),t==="schema"&&c.jsxs("div",{children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Datenbankverbindung funktioniert. Jetzt legen wir die benötigten Tabellen an."}),f&&c.jsx("ul",{className:"mb-4 space-y-1 rounded-md bg-neutral-50 p-3 text-sm text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:f.map((S,N)=>c.jsx("li",{children:S},N))}),n&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),c.jsx("button",{type:"button",onClick:b,disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Richte ein…":"Datenbankstruktur einrichten"})]}),t==="admin"&&c.jsxs("form",{onSubmit:x,children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Erster Admin-Account"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Lege den ersten Super-Admin-Account an, mit dem du dich anschließend einloggen kannst."}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Benutzername"}),c.jsx("input",{required:!0,autoFocus:!0,value:d.username,onChange:S=>h({...d,username:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Passwort"}),c.jsx("input",{type:"password",required:!0,minLength:8,value:d.password,onChange:S=>h({...d,password:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-6",children:[c.jsx("label",{className:w,children:"Passwort wiederholen"}),c.jsx("input",{type:"password",required:!0,minLength:8,value:d.password_confirmation,onChange:S=>h({...d,password_confirmation:S.target.value}),className:k})]}),n&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),c.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Lege an…":"Admin-Account anlegen"})]}),t==="done"&&c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Fertig!"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Ersteinrichtung ist abgeschlossen. Du kannst dich jetzt mit deinem neuen Admin-Account anmelden."}),c.jsx(ee,{to:"/admin/login",className:"inline-block w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Zum Login"})]})]})]})}function SO(){const{user:t,login:e,verifyTwoFactor:n}=Cn(),r=pl(),[s,i]=v.useState("credentials"),[o,a]=v.useState(""),[l,u]=v.useState(""),[d,h]=v.useState(""),[f,p]=v.useState(""),[m,g]=v.useState(!1);if(t)return c.jsx(Ua,{to:"/admin",replace:!0});const y=async x=>{x.preventDefault(),g(!0),p("");try{(await e(o,l)).requires2fa?i("code"):r("/admin")}catch(k){p(k.message)}finally{g(!1)}},b=async x=>{x.preventDefault(),g(!0),p("");try{await n(d),r("/admin")}catch(k){p(k.message)}finally{g(!1)}};return c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[c.jsx("img",{src:Ka,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),c.jsx("img",{src:Su,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),s==="credentials"?c.jsxs("form",{onSubmit:y,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),c.jsx("input",{value:o,onChange:x=>a(x.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"mb-6",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),c.jsx("input",{type:"password",value:l,onChange:x=>u(x.target.value),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),f&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:f}),c.jsx("button",{type:"submit",disabled:m,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:m?"Anmelden…":"Anmelden"})]}):c.jsxs("form",{onSubmit:b,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Öffne die Google Authenticator App und gib den 6-stelligen Code ein. Alternativ kannst du auch einen deiner Wiederherstellungscodes verwenden."}),c.jsxs("div",{className:"mb-6",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),c.jsx("input",{value:d,onChange:x=>h(x.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),f&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:f}),c.jsx("button",{type:"submit",disabled:m,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:m?"Prüfe…":"Bestätigen"}),c.jsx("button",{type:"button",onClick:()=>{i("credentials"),h(""),p("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}const NO={tag:"M4 4h7l9 9-7 7-9-9V4Zm3.5 3.5h.01",car:"M3 13.5 4.5 9A2 2 0 0 1 6.4 7.5h11.2A2 2 0 0 1 19.5 9L21 13.5M3 13.5v4a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1h12v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-4M3 13.5h18M6.5 16.5h.01M17.5 16.5h.01",box:"M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Zm0 9 8-4.5M12 12v9M12 12 4 7.5",mail:"M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm0 0 8 7 8-7"},CO=({path:t,className:e="h-6 w-6"})=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:e,children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})});function jO(){const[t,e]=v.useState(null),[n,r]=v.useState("");if(v.useEffect(()=>{A.get("/analytics/report").then(e).catch(i=>r(i.message))},[]),n)return c.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),c.jsx("p",{className:"text-sm text-red-600",children:n})]});if(!t)return null;if(!t.configured)return c.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),c.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Noch nicht eingerichtet. Unter"," ",c.jsx(ee,{to:"/admin/settings/website",className:"text-brand-600 hover:underline dark:text-brand-400",children:"Einstellungen → Website"})," ","kannst du die Dashboard-Anbindung konfigurieren, um hier Besucherzahlen zu sehen."]})]});const s=Math.max(1,...t.daily.map(i=>i.pageviews));return c.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),c.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Letzte 7 Tage."}),c.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:t.totals.users}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Nutzer"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:t.totals.sessions}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Sitzungen"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:t.totals.pageviews}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Seitenaufrufe"})]})]}),t.daily.length>0&&c.jsx("div",{className:"mb-6 flex h-24 items-end gap-1.5",children:t.daily.map(i=>c.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[c.jsx("div",{className:"w-full rounded-t bg-brand-400 dark:bg-brand-500",style:{height:`${Math.max(4,i.pageviews/s*80)}px`},title:`${i.date}: ${i.pageviews} Seitenaufrufe`}),c.jsxs("span",{className:"text-[10px] text-neutral-400",children:[i.date.slice(6,8),".",i.date.slice(4,6),"."]})]},i.date))}),t.top_pages.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Meistbesuchte Seiten"}),c.jsx("ul",{className:"space-y-1 text-sm",children:t.top_pages.map(i=>c.jsxs("li",{className:"flex items-center justify-between gap-3 text-neutral-700 dark:text-neutral-300",children:[c.jsx("span",{className:"truncate font-mono text-xs",children:i.path}),c.jsx("span",{className:"shrink-0 font-semibold",children:i.pageviews})]},i.path))})]})]})}function EO(){const{user:t,hasPermission:e}=Cn(),[n,r]=v.useState({});v.useEffect(()=>{e("brands.manage")&&A.get("/brands").then(i=>r(o=>({...o,brands:i.length}))),(e("models.manage")||e("packages.manage"))&&A.get("/models").then(i=>r(o=>({...o,models:i.length}))),e("packages.manage")&&A.get("/packages").then(i=>r(o=>({...o,packages:i.length}))),e("contact.manage")&&A.get("/contact").then(i=>r(o=>({...o,newContacts:i.filter(a=>a.status==="new").length})))},[]);const s=[{key:"brands",label:"Marken",icon:"tag",hint:"Die Hersteller, z. B. Audi oder BMW.",value:n.brands,to:"/admin/brands",show:e("brands.manage")},{key:"models",label:"Modelle",icon:"car",hint:"Die Fahrzeuge einer Marke, z. B. A4.",value:n.models,to:"/admin/models",show:e("models.manage")},{key:"packages",label:"Pakete",icon:"box",hint:"Die Sound-Pakete für ein Modell.",value:n.packages,to:"/admin/packages",show:e("packages.manage")},{key:"contacts",label:"Neue Anfragen",icon:"mail",hint:"Kunden, die noch auf Antwort warten.",value:n.newContacts,to:"/admin/contact-requests",show:e("contact.manage"),highlight:!0}].filter(i=>i.show);return c.jsxs("div",{children:[c.jsxs("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:["Willkommen, ",t==null?void 0:t.username,"!"]}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Hier siehst du auf einen Blick, wie viel in deinem Shop hinterlegt ist. Klicke auf eine Kachel, um dorthin zu gelangen."}),s.length===0?c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:"Für deinen Account sind noch keine Bereiche freigeschaltet. Bitte wende dich an einen Administrator."}):c.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:s.map(i=>c.jsxs(ee,{to:i.to,className:`rounded-xl border p-5 shadow-sm transition hover:-translate-y-0.5 hover:shadow-md ${i.highlight&&i.value>0?"border-brand-300 bg-brand-50 dark:border-brand-900 dark:bg-brand-900/20":"border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900"}`,children:[c.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:c.jsx(CO,{path:NO[i.icon]})}),c.jsx("p",{className:"text-sm font-semibold text-neutral-700 dark:text-neutral-200",children:i.label}),c.jsx("p",{className:"mt-1 text-3xl font-extrabold text-brand-600 dark:text-brand-400",children:i.value??"…"}),c.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:i.hint})]},i.key))}),e("settings.manage")&&c.jsx(jO,{})]})}var Cv=!1,bs,vm,km,Hc,Wc,oj,Uc,wm,Sm,Nm,aj,Cm,jm,lj,cj;function Ct(){if(!Cv){Cv=!0;var t=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),n=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(Cm=/\b(iPhone|iP[ao]d)/.exec(t),jm=/\b(iP[ao]d)/.exec(t),Nm=/Android/i.exec(t),lj=/FBAN\/\w+;/i.exec(t),cj=/Mobile/i.exec(t),aj=!!/Win64/.exec(t),e){bs=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,bs&&document&&document.documentMode&&(bs=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(t);oj=r?parseFloat(r[1])+4:bs,vm=e[2]?parseFloat(e[2]):NaN,km=e[3]?parseFloat(e[3]):NaN,Hc=e[4]?parseFloat(e[4]):NaN,Hc?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),Wc=e&&e[1]?parseFloat(e[1]):NaN):Wc=NaN}else bs=vm=km=Wc=Hc=NaN;if(n){if(n[1]){var s=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);Uc=s?parseFloat(s[1].replace("_",".")):!0}else Uc=!1;wm=!!n[2],Sm=!!n[3]}else Uc=wm=Sm=!1}}var Em={ie:function(){return Ct()||bs},ieCompatibilityMode:function(){return Ct()||oj>bs},ie64:function(){return Em.ie()&&aj},firefox:function(){return Ct()||vm},opera:function(){return Ct()||km},webkit:function(){return Ct()||Hc},safari:function(){return Em.webkit()},chrome:function(){return Ct()||Wc},windows:function(){return Ct()||wm},osx:function(){return Ct()||Uc},linux:function(){return Ct()||Sm},iphone:function(){return Ct()||Cm},mobile:function(){return Ct()||Cm||jm||Nm||cj},nativeApp:function(){return Ct()||lj},android:function(){return Ct()||Nm},ipad:function(){return Ct()||jm}},TO=Em,MO=!!(typeof window<"u"&&window.document&&window.document.createElement),PO={canUseDOM:MO},AO=PO,uj=AO,dj;uj.canUseDOM&&(dj=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** + `),()=>{var M;(M=a.current)==null||M.removeAttribute("data-motion-pop-id"),N.contains(S)&&N.removeChild(S)}},[e]),c.jsx(MR,{isPresent:e,childRef:a,sizeRef:l,pop:i,children:i===!1?t:v.cloneElement(t,{ref:h})})}const AR=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:u})=>{const d=Yr(DR),h=v.useId(),f=v.useRef(n),p=v.useRef(r);ml(()=>{f.current=n,p.current=r});let m=!0,g=v.useMemo(()=>(m=!1,{id:h,initial:e,isPresent:n,custom:s,onExitComplete:y=>{d.set(y,!0);for(const b of d.values())if(!b)return;r&&r()},register:y=>(d.set(y,!1),()=>{var b;d.delete(y),!f.current&&!d.size&&((b=p.current)==null||b.call(p))})}),[n,d,r]);return i&&m&&(g={...g}),v.useMemo(()=>{d.forEach((y,b)=>d.set(b,!1))},[n]),v.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),t=c.jsx(PR,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:u,children:t}),c.jsx(Gd.Provider,{value:g,children:t})};function DR(){return new Map}function IC(t=!0){const e=v.useContext(Gd);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=v.useId();v.useEffect(()=>{if(t)return s(i)},[t]);const o=v.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const Xl=t=>t.key||"";function Gb(t){const e=[];return v.Children.forEach(t,n=>{v.isValidElement(n)&&e.push(n)}),e}const LR=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:u})=>{const[d,h]=IC(o),f=v.useMemo(()=>Gb(t),[t]),p=o&&!d?[]:f.map(Xl),m=v.useRef(!0),g=v.useRef(f),y=Yr(()=>new Map),b=v.useRef(new Set),[x,k]=v.useState(f),[w,C]=v.useState(f);ml(()=>{m.current=!1,g.current=f;for(let N=0;N{const M=Xl(N),j=o&&!d?!1:f===w||p.includes(M),T=()=>{if(b.current.has(M))return;if(y.has(M))b.current.add(M),y.set(M,!0);else return;let R=!0;y.forEach($=>{$||(R=!1)}),R&&(S==null||S(),C(g.current),o&&(h==null||h()),r&&r())};return c.jsx(AR,{isPresent:j,initial:!m.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:u,onExitComplete:j?void 0:T,anchorX:a,anchorY:l,children:N},M)})})},OC=v.createContext({strict:!1}),qb={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Jb=!1;function RR(){if(Jb)return;const t={};for(const e in qb)t[e]={isEnabled:n=>qb[e].some(r=>!!n[r])};fC(t),Jb=!0}function BC(){return RR(),xL()}function _R(t){const e=BC();for(const n in t)e[n]={...e[n],...t[n]};fC(e)}const IR=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Du(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||IR.has(t)}let zC=t=>!Du(t);function OR(t){typeof t=="function"&&(zC=e=>e.startsWith("on")?!Du(e):t(e))}try{OR(require("@emotion/is-prop-valid").default)}catch{}function BR(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||We(t[s])||(zC(s)||n===!0&&Du(s)||!e&&!Du(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const Xd=v.createContext({});function zR(t,e){if(Yd(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Ja(n)?n:void 0,animate:Ja(r)?r:void 0}}return t.inherit!==!1?e:{}}function FR(t){const{initial:e,animate:n}=zR(t,v.useContext(Xd));return v.useMemo(()=>({initial:e,animate:n}),[Yb(e),Yb(n)])}function Yb(t){return Array.isArray(t)?t.join(" "):t}const D0=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function FC(t,e,n){for(const r in e)!We(e[r])&&!vC(r,n)&&(t[r]=e[r])}function VR({transformTemplate:t},e){return v.useMemo(()=>{const n=D0();return P0(n,e,t),Object.assign({},n.vars,n.style)},[e])}function $R(t,e){const n=t.style||{},r={};return FC(r,n,t),Object.assign(r,VR(t,e)),r}function HR(t,e){const n={},r=$R(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const VC=()=>({...D0(),attrs:{}});function WR(t,e,n,r){const s=v.useMemo(()=>{const i=VC();return kC(i,e,SC(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};FC(i,t.style,t),s.style={...i,...s.style}}return s}const UR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function L0(t){return typeof t!="string"||t.includes("-")?!1:!!(UR.indexOf(t)>-1||/[A-Z]/u.test(t))}function KR(t,e,n,{latestValues:r},s,i=!1,o){const l=(o??L0(t)?WR:HR)(e,r,s,t),u=BR(e,typeof t=="string",i),d=t!==v.Fragment?{...u,...l,ref:n}:{},{children:h}=e,f=v.useMemo(()=>We(h)?h.get():h,[h]);return v.createElement(t,{...d,children:f})}function GR({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:qR(n,r,s,t),renderState:e()}}function qR(t,e,n,r){const s={},i=r(t,{});for(const f in i)s[f]=Fc(i[f]);let{initial:o,animate:a}=t;const l=Yd(t),u=dC(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const h=d?a:o;if(h&&typeof h!="boolean"&&!Jd(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p(e,n)=>{const r=v.useContext(Xd),s=v.useContext(Gd),i=()=>GR(t,e,r,s);return n?i():Yr(i)},JR=$C({scrapeMotionValuesFromProps:A0,createRenderState:D0}),YR=$C({scrapeMotionValuesFromProps:NC,createRenderState:VC}),XR=Symbol.for("motionComponentSymbol");function ZR(t,e,n){const r=v.useRef(n);v.useInsertionEffect(()=>{r.current=n});const s=v.useRef(null);return v.useCallback(i=>{var a;i&&((a=t.onMount)==null||a.call(t,i)),e&&(i?e.mount(i):e.unmount());const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i)},[e])}const HC=v.createContext({});function ui(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function QR(t,e,n,r,s,i){var k,w;const{visualElement:o}=v.useContext(Xd),a=v.useContext(OC),l=v.useContext(Gd),u=v.useContext(bl),d=u.reducedMotion,h=u.skipAnimations,f=v.useRef(null),p=v.useRef(!1);r=r||a.renderer,!f.current&&r&&(f.current=r(t,{visualState:e,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:i}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const m=f.current,g=v.useContext(HC);m&&!m.projection&&s&&(m.type==="html"||m.type==="svg")&&e_(f.current,n,s,g);const y=v.useRef(!1);v.useInsertionEffect(()=>{m&&y.current&&m.update(n,l)});const b=n[XN],x=v.useRef(!!b&&typeof window<"u"&&!((k=window.MotionHandoffIsComplete)!=null&&k.call(window,b))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,b)));return ml(()=>{p.current=!0,m&&(y.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),x.current&&m.animationState&&m.animationState.animateChanges())}),v.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,b)}),x.current=!1),m.enteringChildren=void 0)}),m}function e_(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutAnchor:d,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:WC(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&ui(a),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:l,layoutRoot:u,layoutAnchor:d})}function WC(t){if(t)return t.options.allowProjection!==!1?t.projection:WC(t.parent)}function lf(t,{forwardMotionProps:e=!1,type:n}={},r,s){r&&_R(r);const i=n?n==="svg":L0(t),o=i?YR:JR;function a(u,d){let h;const f={...v.useContext(bl),...u,layoutId:t_(u)},{isStatic:p}=f,m=FR(u),g=o(u,p);if(!p&&typeof window<"u"){n_();const y=r_(f);h=y.MeasureLayout,m.visualElement=QR(t,g,f,s,y.ProjectionNode,i)}return c.jsxs(Xd.Provider,{value:m,children:[h&&m.visualElement?c.jsx(h,{visualElement:m.visualElement,...f}):null,KR(t,u,ZR(g,m.visualElement,d),g,p,e,i)]})}a.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const l=v.forwardRef(a);return l[XR]=t,l}function t_({layoutId:t}){const e=v.useContext(s0).id;return e&&t!==void 0?e+"-"+t:t}function n_(t,e){v.useContext(OC).strict}function r_(t){const e=BC(),{drag:n,layout:r}=e;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(t)||r!=null&&r.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function s_(t,e){if(typeof Proxy>"u")return lf;const n=new Map,r=(i,o)=>lf(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,lf(o,void 0,t,e)),n.get(o))})}const i_=(t,e)=>e.isSVG??L0(t)?new RL(e):new TL(e,{allowProjection:t!==v.Fragment});class o_ extends ss{constructor(e){super(e),e.animationState||(e.animationState=zL(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Jd(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let a_=0;class l_ extends ss{constructor(){super(...arguments),this.id=a_++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=_s(this.node,o,a);if(l){const{transition:u,transitionEnd:d,...h}=l;for(const f in h)(i=this.node.getValue(f))==null||i.jump(h[f])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const c_={animation:{Feature:o_},exit:{Feature:l_}};function vl(t){return{point:{x:t.pageX,y:t.pageY}}}const u_=t=>e=>j0(e)&&t(e,vl(e));function da(t,e,n,r){return Ya(t,e,u_(n),r)}const UC=({current:t})=>t?t.ownerDocument.defaultView:null,Xb=(t,e)=>Math.abs(t-e);function d_(t,e){const n=Xb(t.x,e.x),r=Xb(t.y,e.y);return Math.sqrt(n**2+r**2)}const Zb=new Set(["auto","scroll"]);class KC{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Zl(this.lastRawMoveEventInfo,this.transformPagePoint));const m=cf(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=d_(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!y)return;const{point:b}=m,{timestamp:x}=Ge;this.history.push({...b,timestamp:x});const{onStart:k,onMove:w}=this.handlers;g||(k&&k(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=Zl(g,this.transformPagePoint),ae.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:y,onSessionEnd:b,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=cf(m.type==="pointercancel"?this.lastMoveEventInfo:Zl(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(m,k),b&&b(m,k)},!j0(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=vl(e),u=Zl(l,this.transformPagePoint),{point:d}=u,{timestamp:h}=Ge;this.history=[{...d,timestamp:h}];const{onSessionStart:f}=n;f&&f(e,cf(u,this.history));const p={passive:!0,capture:!0};this.removeListeners=gl(da(this.contextWindow,"pointermove",this.handlePointerMove,p),da(this.contextWindow,"pointerup",this.handlePointerUp,p),da(this.contextWindow,"pointercancel",this.handlePointerUp,p)),a&&this.startScrollTracking(a)}startScrollTracking(e){let n=e.parentElement;for(;n;){const r=getComputedStyle(n);(Zb.has(r.overflowX)||Zb.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const n=this.scrollPositions.get(e);if(!n)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,s),ae.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),an(this.updatePoint)}}function Zl(t,e){return e?{point:e(t.point)}:t}function Qb(t,e){return{x:t.x-e.x,y:t.y-e.y}}function cf({point:t},e){return{point:t,delta:Qb(t,GC(e)),offset:Qb(t,h_(e)),velocity:f_(e,.1)}}function h_(t){return t[0]}function GC(t){return t[t.length-1]}function f_(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=GC(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>zt(e)));)n--;if(!r)return{x:0,y:0};r===t[0]&&t.length>2&&s.timestamp-r.timestamp>zt(e)*2&&(r=t[1]);const i=en(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function p_(t,{min:e,max:n},r){return e!==void 0&&tn&&(t=r?pe(n,t,r.max):Math.min(t,n)),t}function ev(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function m_(t,{top:e,left:n,bottom:r,right:s}){return{x:ev(t.x,n,s),y:ev(t.y,e,r)}}function tv(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.minr?n=qi(e.min,e.max-r,t.min):r>s&&(n=qi(t.min,t.max-s,e.min)),Nn(0,1,n)}function y_(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const xm=.35;function b_(t=xm){return t===!1?t=0:t===!0&&(t=xm),{x:nv(t,"left","right"),y:nv(t,"top","bottom")}}function nv(t,e,n){return{min:rv(t,e),max:rv(t,n)}}function rv(t,e){return typeof t=="number"?t:t[e]||0}const v_=new WeakMap;class k_{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ve(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(vl(h).point),this.stopAnimation()},o=(h,f)=>{const{drag:p,dragPropagation:m,onDragStart:g}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=U4(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Tn(b=>{let x=this.getAxisMotionValue(b).get()||0;if(In.test(x)){const{projection:k}=this.visualElement;if(k&&k.layout){const w=k.layout.layoutBox[b];w&&(x=bt(w)*(parseFloat(x)/100))}}this.originPoint[b]=x}),g&&ae.update(()=>g(h,f),!1,!0),om(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:g,onDrag:y}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(m&&this.currentDirection===null){this.currentDirection=S_(b),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),y&&ae.update(()=>y(h,f),!1,!0)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new KC(e,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:UC(this.visualElement),element:this.visualElement.current})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&ae.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!Ql(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=p_(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&ui(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=m_(r.layoutBox,e):this.constraints=!1,this.elastic=b_(n),s!==this.constraints&&!ui(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&Tn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=y_(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ui(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=wL(r,s.root,this.visualElement.getTransformPagePoint());let o=g_(s.layout.layoutBox,i);if(n){const a=n(bL(o));this.hasMutatedConstraints=!!a,a&&(o=mC(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Tn(d=>{if(!Ql(d,n,this.currentDirection))return;let h=l&&l[d]||{};(o===!0||o===d)&&(h={min:0,max:0});const f=s?200:1e6,p=s?40:1e7,m={type:"inertia",velocity:r?e[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(d,m)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return om(this.visualElement,e),r.start(w0(e,r,0,n,this.visualElement,!1))}stopAnimation(){Tn(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Tn(n=>{const{drag:r}=this.getProps();if(!Ql(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(e[n]-pe(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ui(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Tn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=x_({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Tn(o=>{if(!Ql(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(pe(l,u,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;v_.set(this.visualElement,this);const e=this.visualElement.current,n=da(e,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps(),f=u.target,p=f!==e&&X4(f);d&&h&&!p&&this.start(u)});let r;const s=()=>{const{dragConstraints:u}=this.getProps();ui(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),r||(r=w_(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),ae.read(s);const a=Ya(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(Tn(h=>{const f=this.getAxisMotionValue(h);f&&(this.originPoint[h]+=u[h].translate,f.set(f.get()+u[h].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=xm,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function sv(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function w_(t,e,n){const r=dm(t,sv(n)),s=dm(e,sv(n));return()=>{r(),s()}}function Ql(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function S_(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class N_ extends ss{constructor(e){super(e),this.removeGroupControls=Lt,this.removeListeners=Lt,this.controls=new k_(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Lt}update(){const{dragControls:e}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};e!==n&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const uf=t=>(e,n)=>{t&&ae.update(()=>t(e,n),!1,!0)};class C_ extends ss{constructor(){super(...arguments),this.removePointerDownListener=Lt}onPointerDown(e){this.session=new KC(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:UC(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:uf(e),onStart:uf(n),onMove:uf(r),onEnd:(i,o)=>{delete this.session,s&&ae.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=da(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let df=!1;class j_ extends v.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),df&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Vc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,e.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),df=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||ae.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:n}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Yi.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;df=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function qC(t){const[e,n]=IC(),r=v.useContext(s0);return c.jsx(j_,{...t,layoutGroup:r,switchLayoutGroup:v.useContext(HC),isPresent:e,safeToRemove:n})}const E_={pan:{Feature:C_},drag:{Feature:N_,ProjectionNode:_C,MeasureLayout:qC}};function iv(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&ae.postRender(()=>i(e,vl(e)))}class T_ extends ss{mount(){const{current:e}=this.node;e&&(this.unmount=G4(e,(n,r)=>(iv(this.node,r,"Start"),s=>iv(this.node,s,"End"))))}unmount(){}}class M_ extends ss{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=gl(Ya(this.node.current,"focus",()=>this.onFocus()),Ya(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ov(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&ae.postRender(()=>i(e,vl(e)))}class P_ extends ss{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Q4(e,(s,i)=>(ov(this.node,i,"Start"),(o,{success:a})=>ov(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const ym=new WeakMap,hf=new WeakMap,A_=t=>{const e=ym.get(t.target);e&&e(t)},D_=t=>{t.forEach(A_)};function L_({root:t,...e}){const n=t||document;hf.has(n)||hf.set(n,{});const r=hf.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(D_,{root:t,...e})),r[s]}function R_(t,e,n){const r=L_(e);return ym.set(t,n),r.observe(t),()=>{ym.delete(t),r.unobserve(t)}}const __={some:0,all:1};class I_ extends ss{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:__[s]},a=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:f}=this.node.getProps(),p=d?h:f;p&&p(u)};this.stopObserver=R_(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(O_(e,n))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function O_({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const B_={inView:{Feature:I_},tap:{Feature:P_},focus:{Feature:M_},hover:{Feature:T_}},z_={layout:{ProjectionNode:_C,MeasureLayout:qC}},F_={...c_,...B_,...E_,...z_},Xn=s_(F_,i_);function Lu(t){return typeof window>"u"?!1:t?FN():v0()}const V_=50,av=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),$_=()=>({time:0,x:av(),y:av()}),H_={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function lv(t,e,n,r){const s=n[e],{length:i,position:o}=H_[e],a=s.current,l=n.time;s.current=Math.abs(t[`scroll${o}`]),s.scrollLength=t[`scroll${i}`]-t[`client${i}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=qi(0,s.scrollLength,s.current);const u=r-l;s.velocity=u>V_?0:l0(s.current-a,u)}function W_(t,e,n){lv(t,"x",e,n),lv(t,"y",e,n),e.time=n}function U_(t,e){const n={x:0,y:0};let r=t;for(;r&&r!==e;)if(ca(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const s=r.getBoundingClientRect();r=r.parentElement;const i=r.getBoundingClientRect();n.x+=s.left-i.left,n.y+=s.top-i.top}else if(r instanceof SVGGraphicsElement){const{x:s,y:i}=r.getBBox();n.x+=s,n.y+=i;let o=null,a=r.parentNode;for(;!o;)a.tagName==="svg"&&(o=a),a=r.parentNode;r=o}else break;return n}const bm={start:0,center:.5,end:1};function cv(t,e,n=0){let r=0;if(t in bm&&(t=bm[t]),typeof t=="string"){const s=parseFloat(t);t.endsWith("px")?r=s:t.endsWith("%")?t=s/100:t.endsWith("vw")?r=s/100*document.documentElement.clientWidth:t.endsWith("vh")?r=s/100*document.documentElement.clientHeight:t=s}return typeof t=="number"&&(r=e*t),n+r}const K_=[0,0];function G_(t,e,n,r){let s=Array.isArray(t)?t:K_,i=0,o=0;return typeof t=="number"?s=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?s=t.split(" "):s=[t,bm[t]?t:"0"]),i=cv(s[0],n,r),o=cv(s[1],e),i-o}const Uo={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},q_={x:0,y:0};function J_(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function Y_(t,e,n){const{offset:r=Uo.All}=n,{target:s=t,axis:i="y"}=n,o=i==="y"?"height":"width",a=s!==t?U_(s,t):q_,l=s===t?{width:t.scrollWidth,height:t.scrollHeight}:J_(s),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let d=!e[i].interpolate;const h=r.length;for(let f=0;f{X_(t,r.target,n),W_(t,n,s),(r.offset||r.target)&&Y_(t,n,r)},notify:()=>e(n)}}const ii=new WeakMap,uv=new WeakMap,ff=new WeakMap,dv=new WeakMap,ec=new WeakMap,hv=t=>t===document.scrollingElement?window:t;function JC(t,{container:e=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!e)return Lt;let s=ff.get(e);s||(s=new Set,ff.set(e,s));const i=$_(),o=Z_(e,t,i,r);if(s.add(o),!ii.has(e)){const l=()=>{for(const f of s)f.measure(Ge.timestamp);ae.preUpdate(u)},u=()=>{for(const f of s)f.notify()},d=()=>ae.read(l);ii.set(e,d);const h=hv(e);window.addEventListener("resize",d),e!==document.documentElement&&uv.set(e,dm(e,d)),h.addEventListener("scroll",d),d()}if(n&&!ec.has(e)){const l=ii.get(e),u={width:e.scrollWidth,height:e.scrollHeight};dv.set(e,u);const d=()=>{const f=e.scrollWidth,p=e.scrollHeight;(u.width!==f||u.height!==p)&&(l(),u.width=f,u.height=p)},h=ae.read(d,!0);ec.set(e,h)}const a=ii.get(e);return ae.read(a,!1,!0),()=>{var h;an(a);const l=ff.get(e);if(!l||(l.delete(o),l.size))return;const u=ii.get(e);ii.delete(e),u&&(hv(e).removeEventListener("scroll",u),(h=uv.get(e))==null||h(),window.removeEventListener("resize",u));const d=ec.get(e);d&&(an(d),ec.delete(e)),dv.delete(e)}}const Q_=[[Uo.Enter,"entry"],[Uo.Exit,"exit"],[Uo.Any,"cover"],[Uo.All,"contain"]],fv={start:0,end:1};function eI(t){const e=t.trim().split(/\s+/);if(e.length!==2)return;const n=fv[e[0]],r=fv[e[1]];if(!(n===void 0||r===void 0))return[n,r]}function tI(t){if(t.length!==2)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else if(typeof n=="string"){const r=eI(n);if(!r)return;e.push(r)}else return;return e}function nI(t,e){const n=tI(t);if(!n)return!1;for(let r=0;r<2;r++){const s=n[r],i=e[r];if(s[0]!==i[0]||s[1]!==i[1])return!1}return!0}function R0(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of Q_)if(nI(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const pv=new Map;function mv(t){const e={value:0},n=JC(r=>{e.value=r[t.axis].progress*100},t);return{currentTime:e,cancel:n}}function YC({source:t,container:e,...n}){const{axis:r}=n;t&&(e=t);let s=pv.get(e);s||(s=new Map,pv.set(e,s));const i=n.target??"self";let o=s.get(i);o||(o={},s.set(i,o));const a=r+(n.offset??[]).join(",");return o[a]||(n.target&&Lu(n.target)?R0(n.offset)?o[a]=new ViewTimeline({subject:n.target,axis:r}):o[a]=mv({container:e,...n}):Lu()?o[a]=new ScrollTimeline({source:e,axis:r}):o[a]=mv({container:e,...n})),o[a]}function rI(t,e){const n=YC(e),r=e.target?R0(e.offset):void 0,s=e.target?Lu(e.target)&&!!r:Lu();return t.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:i=>(i.pause(),uC(o=>{i.time=i.iterationDuration*o},n))})}function sI(t){return t&&(t.target||t.offset)}function iI(t){return t.length===2}function oI(t,e){return iI(t)||sI(e)?JC(n=>{t(n[e.axis].progress,n)},e):uC(t,YC(e))}function XC(t,{axis:e="y",container:n=document.scrollingElement,...r}={}){if(!n)return Lt;const s={axis:e,container:n,...r};return typeof t=="function"?oI(t,s):rI(t,s)}const aI=()=>({scrollX:xn(0),scrollY:xn(0),scrollXProgress:xn(0),scrollYProgress:xn(0)}),Ai=t=>t?!t.current:!1;function gv(t,e,n,r){return{factory:s=>{let i;const o=()=>{if(Ai(n)||Ai(r)){Yi.read(o);return}i=XC(s,{...e,axis:t,container:(n==null?void 0:n.current)||void 0,target:(r==null?void 0:r.current)||void 0})};return Yi.read(o),()=>{iC(o),i==null||i()}},times:[0,1],keyframes:[0,1],ease:s=>s,duration:1}}function lI(t,e){return typeof window>"u"?!1:t?FN()&&!!R0(e):v0()}function ZC({container:t,target:e,...n}={}){const r=Yr(aI);lI(e,n.offset)&&(r.scrollXProgress.accelerate=gv("x",n,t,e),r.scrollYProgress.accelerate=gv("y",n,t,e));const s=v.useRef(null),i=v.useRef(!1),o=v.useCallback(()=>(s.current=XC((a,{x:l,y:u})=>{r.scrollX.set(l.current),r.scrollXProgress.set(l.progress),r.scrollY.set(u.current),r.scrollYProgress.set(u.progress)},{...n,container:(t==null?void 0:t.current)||void 0,target:(e==null?void 0:e.current)||void 0}),()=>{var a;(a=s.current)==null||a.call(s)}),[t,e,JSON.stringify(n.offset)]);return ml(()=>{if(i.current=!1,Ai(t)||Ai(e)){i.current=!0;return}else return o()},[o]),v.useEffect(()=>{if(!i.current)return;let a;const l=()=>{const u=Ai(t),d=Ai(e);!u&&!d&&(a=o())};return Yi.read(l),()=>{iC(l),a==null||a()}},[o]),r}function QC(t){const e=Yr(()=>xn(t)),{isStatic:n}=v.useContext(bl);if(n){const[,r]=v.useState(t);v.useEffect(()=>e.on("change",r),[])}return e}function ej(t,e){const n=QC(e()),r=()=>n.set(e());return r(),ml(()=>{const s=()=>ae.preRender(r,!1,!0),i=t.map(o=>o.on("change",s));return()=>{i.forEach(o=>o()),an(r)}}),n}function cI(t){la.current=[],t();const e=ej(la.current,t);return la.current=void 0,e}function br(t,e,n,r){if(typeof t=="function")return cI(t);if(n!==void 0&&!Array.isArray(n)&&typeof e!="function")return uI(t,e,n,r);const o=typeof e=="function"?e:cL(e,n,r),a=Array.isArray(t)?xv(t,o):xv([t],([u])=>o(u)),l=Array.isArray(t)?void 0:t.accelerate;return l&&!l.isTransformed&&typeof e!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(a.accelerate={...l,times:e,keyframes:n,isTransformed:!0}),a}function xv(t,e){const n=Yr(()=>[]);return ej(t,()=>{n.length=0;const r=t.length;for(let s=0;sObject.keys(n)),i=Yr(()=>({}));for(const o of s)i[o]=br(t,e,n[o],r);return i}function dI(t,e={}){const{isStatic:n}=v.useContext(bl),r=()=>We(t)?t.get():t;if(n)return br(r);const s=QC(r());return v.useInsertionEffect(()=>uL(s,t,e),[s,JSON.stringify(e)]),s}function hI(t,e={}){return dI(t,{type:"spring",...e})}function fI(){const{scrollYProgress:t}=ZC(),e=hI(t,{stiffness:200,damping:30,restDelta:.001});return c.jsx(Xn.div,{style:{scaleX:e},className:"fixed left-0 top-0 z-40 h-0.5 w-full origin-left bg-brand-500"})}const pI=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"h-10 w-10",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.7 6.3a4 4 0 0 0-5.5 4.5L3 17l2 2 6.2-6.2a4 4 0 0 0 4.5-5.5l-2.6 2.6-2-2 2.6-2.6Z"})});function kl({message:t,fullScreen:e=!1}){const{t:n}=at(),r=c.jsxs("div",{className:"mx-auto max-w-md text-center",children:[c.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:c.jsx(pI,{})}),c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:n("maintenance.title")}),c.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:t||n("maintenance.defaultMessage")})]});return e?c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950",children:r}):c.jsx("div",{className:"mx-auto max-w-6xl px-4 py-20 sm:px-6",children:r})}const yv=c.jsx(c.Fragment,{children:'Wartungsmodus aktiv – Besucher sehen aktuell eine Wartungsmeldung. Du siehst diese Seite nur, weil du die Berechtigung "Wartungsmodus umgehen" hast.'});function wl({inline:t=!1}){return t?c.jsx("div",{className:"mb-8 rounded-lg bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:yv}):c.jsx("div",{className:"bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:yv})}function mI({onClose:t}){const{consent:e,saveCustom:n}=go(),[r,s]=v.useState(e.external),[i,o]=v.useState(e.analytics),{t:a}=at();return c.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:t,children:c.jsxs("div",{className:"w-full max-w-md rounded-xl bg-white p-6 dark:bg-neutral-900",onClick:l=>l.stopPropagation(),children:[c.jsx("h2",{className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:a("cookieConsent.modalTitle")}),c.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:[a("cookieConsent.modalIntro")," ",c.jsx(ee,{to:"/datenschutz",className:"underline hover:text-brand-500",onClick:t,children:a("cookieConsent.privacyPolicy")}),"."]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:a("cookieConsent.necessaryTitle")}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:a("cookieConsent.necessaryDesc")})]}),c.jsx("input",{type:"checkbox",checked:!0,disabled:!0,className:"mt-1 h-4 w-4 shrink-0"})]}),c.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:a("cookieConsent.externalTitle")}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:a("cookieConsent.externalDesc")})]}),c.jsx("input",{type:"checkbox",checked:r,onChange:l=>s(l.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]}),c.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:a("cookieConsent.analyticsTitle")}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:a("cookieConsent.analyticsDesc")})]}),c.jsx("input",{type:"checkbox",checked:i,onChange:l=>o(l.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]})]}),c.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:t,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:a("cookieConsent.cancel")}),c.jsx("button",{type:"button",onClick:()=>n({external:r,analytics:i}),className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:a("cookieConsent.saveSelection")})]})]})})}function gI(){const{decided:t,settingsOpen:e,acceptAll:n,rejectNonEssential:r,openSettings:s,closeSettings:i}=go(),{t:o}=at();return c.jsxs(c.Fragment,{children:[!t&&c.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 border-t border-neutral-200 bg-white/95 p-4 shadow-lg backdrop-blur dark:border-neutral-800 dark:bg-neutral-900/95 sm:p-5",children:c.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[c.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[o("cookieConsent.bannerText")," ",o("cookieConsent.moreInfo")," ",c.jsx(ee,{to:"/datenschutz",className:"underline hover:text-brand-500",children:o("cookieConsent.privacyPolicy")}),"."]}),c.jsxs("div",{className:"flex flex-wrap gap-2 sm:shrink-0",children:[c.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:o("cookieConsent.settings")}),c.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:o("cookieConsent.onlyNecessary")}),c.jsx("button",{type:"button",onClick:n,className:"rounded-md bg-brand-500 px-3 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o("cookieConsent.acceptAll")})]})]})}),e&&c.jsx(mI,{onClose:i})]})}function xI(){const{consent:t}=go(),{ga_measurement_id:e}=rs(),n=v.useRef(!1);return v.useEffect(()=>{if(!e||!t.analytics||n.current)return;n.current=!0;const r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,r.async=!0,document.head.appendChild(r),window.dataLayer=window.dataLayer||[];function s(...i){window.dataLayer.push(i)}window.gtag=s,s("js",new Date),s("config",e,{anonymize_ip:!0})},[e,t.analytics]),null}const tj=v.createContext({global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null},bypass:!1}),yI=tj.Provider;function Zd(){return v.useContext(tj)}const bI={global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null}},vI={mon:{open:"09:00",close:"18:00",closed:!1},tue:{open:"09:00",close:"18:00",closed:!1},wed:{open:"09:00",close:"18:00",closed:!1},thu:{open:"09:00",close:"18:00",closed:!1},fri:{open:"09:00",close:"18:00",closed:!1},sat:{open:"10:00",close:"13:00",closed:!1},sun:{open:"",close:"",closed:!0}},kI={phone:"09373 20 62 390",whatsapp:null,contact_email:"info@hifi-planet-amorbach.de",address_street:"Boxbrunner Str. 20a",address_zip:"63916",address_city:"Amorbach",logo_path:null,logo_dark_path:null,business_hours:vI,hero_image_path:null,ga_measurement_id:null,package_card_theme:"graphite",package_card_layout:"strip",package_wheel_hint_interval:8,gallery_card_text_x:0,gallery_card_text_y:100,site_font:null},wI=["/impressum","/datenschutz","/agb"];function SI(){const[t,e]=v.useState(null),[n,r]=v.useState(kI),{loading:s,hasPermission:i}=Cn(),o=ln();if(v.useEffect(()=>{A.get("/maintenance").then(e).catch(()=>e(bI)),A.get("/site-settings").then(r).catch(()=>{})},[]),v.useEffect(()=>{n.site_font?document.documentElement.style.setProperty("--site-font",n.site_font):document.documentElement.style.removeProperty("--site-font")},[n.site_font]),t===null||s)return c.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});const a=i("maintenance.bypass"),l=wI.includes(o.pathname);return t.global.enabled&&!a&&!l?c.jsx(Vy,{children:c.jsx(kl,{message:t.global.message,fullScreen:!0})}):c.jsx(Vy,{children:c.jsx(yI,{value:{...t,bypass:a},children:c.jsx(PD,{value:n,children:c.jsxs("div",{className:"page-texture flex min-h-screen flex-col text-neutral-900 dark:text-neutral-100",children:[a&&t.global.enabled&&c.jsx(wl,{}),c.jsx(fI,{}),c.jsx(ID,{}),c.jsx("main",{className:"flex-1",children:c.jsx(Kd,{})}),c.jsx(HD,{}),c.jsx(gI,{}),c.jsx(xI,{})]})})})})}const NI={home:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9",tag:"M4 4h7l9 9-7 7-9-9V4Zm3.5 3.5h.01",car:"M3 13.5 4.5 9A2 2 0 0 1 6.4 7.5h11.2A2 2 0 0 1 19.5 9L21 13.5M3 13.5v4a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1h12v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-4M3 13.5h18M6.5 16.5h.01M17.5 16.5h.01",box:"M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Zm0 9 8-4.5M12 12v9M12 12 4 7.5",mail:"M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm0 0 8 7 8-7",users:"M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-4 6c-4 0-7 2-7 4.5V19h14v-1.5C19 15 16 13 12 13Z",shield:"M12 3 4 6v6c0 4.5 3.4 7.7 8 9 4.6-1.3 8-4.5 8-9V6l-8-3Zm-1.5 9.5 4-4 1 1-5 5-2.5-2.5 1-1 1.5 1.5Z",lock:"M6 10V8a6 6 0 1 1 12 0v2m-13 0h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1Zm7 5v2",briefcase:"M4 7h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm4 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12h18",sliders:"M4 6h16M4 6a2 2 0 1 0 4 0 2 2 0 0 0-4 0Zm16 6H4m10 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0ZM4 18h16m-12 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0Z",image:"M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Zm2 12 4.5-5.5L14 16l2.5-3L20 17H6ZM8 9.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-5.5v.01M9.5 9.25a2.5 2.5 0 1 1 3.5 2.29c-.7.32-1 .77-1 1.46v.3"},CI=({path:t})=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"h-5 w-5 shrink-0",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})});function jI(){const{logout:t,user:e,hasPermission:n}=Cn(),r=pl(),[s,i]=v.useState(!1),[o,a]=v.useState(0);v.useEffect(()=>{n("contact.manage")&&A.get("/contact").then(f=>a(f.filter(p=>p.status==="new").length)).catch(()=>{})},[]);const l=[{title:null,links:[{to:"/admin",label:"Dashboard",icon:"home",end:!0},{to:"/admin/account",label:"Mein Konto",icon:"lock"}]},{title:"Fahrzeug-Katalog",links:[{to:"/admin/brands",label:"Marken",icon:"tag",permission:"brands.manage"},{to:"/admin/models",label:"Modelle",icon:"car",permission:"models.manage"},{to:"/admin/packages",label:"Pakete",icon:"box",permission:"packages.manage"}]},{title:"Website",links:[{to:"/admin/home-sections",label:"Startseite",icon:"home",permission:"content.manage"},{to:"/admin/services",label:"Leistungen",icon:"briefcase",permission:"services.manage"},{to:"/admin/faqs",label:"FAQ",icon:"help",permission:"content.manage"},{to:"/admin/partners",label:"Partner",icon:"tag",permission:"content.manage"}]},{title:"Bildergalerie",links:[{to:"/admin/gallery-brands",label:"Marken",icon:"tag",permission:"gallery.manage"},{to:"/admin/gallery-projects",label:"Projekte",icon:"image",permission:"gallery.manage"}]},{title:"Kunden",links:[{to:"/admin/contact-requests",label:"Kontaktanfragen",icon:"mail",permission:"contact.manage",badge:o}]},{title:"Verwaltung",links:[{to:"/admin/users",label:"Benutzer",icon:"users",permission:"users.manage"},{to:"/admin/permission-groups",label:"Berechtigungsgruppen",icon:"shield",permission:"permission_groups.manage"},{to:"/admin/settings",label:"Einstellungen",icon:"sliders",permission:"settings.manage"}]}].map(f=>({...f,links:f.links.filter(p=>!p.permission||n(p.permission))})).filter(f=>f.links.length>0),u=async()=>{await t(),r("/admin/login")},d=({isActive:f})=>`flex items-center justify-between gap-2 rounded-md px-3 py-2 text-sm font-medium transition ${f?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,h=({onNavigate:f})=>c.jsx("nav",{className:"space-y-5",children:l.map((p,m)=>c.jsxs("div",{children:[p.title&&c.jsx("p",{className:"mb-1.5 px-3 text-xs font-semibold uppercase tracking-wide text-neutral-400 dark:text-neutral-500",children:p.title}),c.jsx("div",{className:"space-y-1",children:p.links.map(g=>c.jsxs(eN,{to:g.to,end:g.end,className:d,onClick:f,children:[c.jsxs("span",{className:"flex items-center gap-2.5",children:[c.jsx(CI,{path:NI[g.icon]}),g.label]}),!!g.badge&&c.jsx("span",{className:"rounded-full bg-red-500 px-2 py-0.5 text-xs font-bold text-white",children:g.badge})]},g.to))})]},m))});return c.jsxs("div",{className:"flex min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[c.jsxs("aside",{className:"hidden w-60 shrink-0 border-r border-neutral-200 p-4 dark:border-neutral-800 sm:block",children:[c.jsxs("div",{className:"mb-6 flex items-center gap-2 px-3",children:[c.jsxs("span",{className:"rounded-lg px-2 py-1",children:[c.jsx("img",{src:Ka,alt:"HifiPlanet",className:"h-7 w-auto dark:hidden"}),c.jsx("img",{src:Su,alt:"HifiPlanet",className:"hidden h-7 w-auto dark:block"})]}),c.jsx("span",{className:"text-sm font-semibold text-neutral-500 dark:text-neutral-400",children:"Admin"})]}),c.jsx(h,{})]}),c.jsxs("div",{className:"flex-1",children:[c.jsxs("header",{className:"border-b border-neutral-200 dark:border-neutral-800",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 sm:px-6",children:[c.jsxs("div",{className:"flex items-center gap-2 sm:hidden",children:[c.jsx("button",{onClick:()=>i(f=>!f),"aria-label":"Menü öffnen",className:"rounded-md p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),c.jsxs("span",{className:"rounded-lg px-1.5 py-0.5",children:[c.jsx("img",{src:Ka,alt:"HifiPlanet",className:"h-6 w-auto dark:hidden"}),c.jsx("img",{src:Su,alt:"HifiPlanet",className:"hidden h-6 w-auto dark:block"})]})]}),c.jsxs("p",{className:"hidden text-sm text-neutral-500 dark:text-neutral-400 sm:block",children:["Angemeldet als ",e==null?void 0:e.username,e!=null&&e.is_super_admin?" · Super-Admin":""]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(sN,{}),c.jsx("button",{onClick:u,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:"Abmelden"})]})]}),s&&c.jsx("div",{className:"border-t border-neutral-200 px-4 py-3 dark:border-neutral-800 sm:hidden",children:c.jsx(h,{onNavigate:()=>i(!1)})})]}),c.jsx("main",{className:"p-4 sm:p-6",children:c.jsx(Kd,{})})]})]})}function EI(){const{user:t,loading:e}=Cn();return e?c.jsx("div",{className:"flex min-h-screen items-center justify-center text-neutral-500",children:"Lädt…"}):t?c.jsx(Kd,{}):c.jsx(Ua,{to:"/admin/login",replace:!0})}function Ze({permission:t,children:e}){const{hasPermission:n}=Cn();return(Array.isArray(t)?t:[t]).some(i=>n(i))?e:c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-8 text-center dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h1",{className:"mb-2 text-lg font-bold text-neutral-900 dark:text-white",children:"Keine Berechtigung"}),c.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Du hast keinen Zugriff auf diesen Bereich. Bitte wende dich an einen Administrator, falls du hier Zugriff brauchst."})]})}function pf(t,e,n="name"){if(!e)return;let r=document.head.querySelector(`meta[${n}="${t}"]`);r||(r=document.createElement("meta"),r.setAttribute(n,t),document.head.appendChild(r)),r.setAttribute("content",e)}function TI(t){let e=document.head.querySelector('link[rel="canonical"]');e||(e=document.createElement("link"),e.setAttribute("rel","canonical"),document.head.appendChild(e)),e.setAttribute("href",`https://hifi-planet.de${t}`)}function Wt({title:t,description:e,path:n}){v.useEffect(()=>{t&&(document.title=`${t} | HifiPlanet`,pf("og:title",`${t} | HifiPlanet`,"property")),e&&(pf("description",e),pf("og:description",e,"property")),n&&TI(n)},[t,e,n])}const MI=[.16,1,.3,1],bv={up:{y:40},left:{x:-56},right:{x:56}};function PI(t){return{hidden:{opacity:0,scale:.96,filter:"blur(8px)",...bv[t]||bv.up},visible:{opacity:1,scale:1,x:0,y:0,filter:"blur(0px)"}}}const AI={hidden:{x:"-130%"},visible:{x:"230%",transition:{duration:1.1,ease:"easeInOut",delay:.4}}};function Qe({children:t,direction:e="up",className:n="",index:r=0,shine:s=!1,style:i}){const o=Math.min(r*.09,.45);return c.jsxs(Xn.div,{className:n,style:{position:"relative",overflow:"hidden",...i},initial:"hidden",whileInView:"visible",viewport:{once:!0,amount:.25,margin:"-100px"},variants:PI(e),transition:{duration:.75,ease:MI,delay:o},children:[t,s&&c.jsx(Xn.div,{"aria-hidden":!0,variants:AI,className:"pointer-events-none absolute inset-y-0 -left-1/3 w-1/3 rotate-12 bg-gradient-to-r from-transparent via-white/40 to-transparent"})]})}function DI({items:t}){const[e,n]=v.useState(null);return c.jsx("div",{className:"divide-y divide-neutral-200 rounded-xl border border-neutral-200 bg-white dark:divide-neutral-800 dark:border-neutral-800 dark:bg-neutral-900",children:t.map((r,s)=>{const i=e===s;return c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>n(i?null:s),className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left","aria-expanded":i,children:[c.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:r.question}),c.jsx(Xn.svg,{animate:{rotate:i?180:0},transition:{duration:.2},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0 text-neutral-500",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6 9 6 6 6-6"})})]}),c.jsx(LR,{initial:!1,children:i&&c.jsx(Xn.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:c.jsx("p",{className:"px-5 pb-4 text-sm text-neutral-600 dark:text-neutral-300",children:r.answer})})})]},r.question)})})}function nj({count:t=5,className:e="h-4 w-4"}){return c.jsx("div",{className:"flex gap-0.5 text-amber-400",children:Array.from({length:t}).map((n,r)=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:e,children:c.jsx("path",{d:"M10 1.5l2.6 5.6 6.1.6-4.6 4.1 1.3 6-5.4-3.1-5.4 3.1 1.3-6-4.6-4.1 6.1-.6L10 1.5z"})},r))})}const LI=70;function RI({testimonials:t}){const e=v.useRef(null),n=v.useRef(null),r=v.useRef({pos:0,half:0,hovering:!1,dragging:!1,dragStartX:0,dragStartPos:0,lastTime:null,rafId:null}).current;v.useLayoutEffect(()=>{const i=n.current,o=window.matchMedia("(prefers-reduced-motion: reduce)").matches,a=()=>{i.style.transform=`translateX(${r.pos}px)`},l=x=>{if(r.half<=0)return x;for(;x>0;)x-=r.half;for(;x<=-r.half;)x+=r.half;return x},u=()=>{r.half=i.scrollWidth/2,r.pos===0?r.pos=-r.half:r.pos=l(r.pos),a()};u();const d=new ResizeObserver(u);d.observe(i);const h=x=>{r.lastTime===null&&(r.lastTime=x);const k=(x-r.lastTime)/1e3;r.lastTime=x,!r.dragging&&!r.hovering&&!o&&(r.pos=l(r.pos+LI*k),a()),r.rafId=requestAnimationFrame(h)};r.rafId=requestAnimationFrame(h);const f=e.current,p=()=>{r.hovering=!0},m=()=>{r.hovering=!1},g=x=>{r.dragging=!0,r.dragStartX=x.clientX,r.dragStartPos=r.pos,f.setPointerCapture(x.pointerId),f.classList.add("cursor-grabbing"),f.classList.remove("cursor-grab")},y=x=>{r.dragging&&(r.pos=l(r.dragStartPos+(x.clientX-r.dragStartX)),a())},b=x=>{r.dragging&&(r.dragging=!1,f.hasPointerCapture(x.pointerId)&&f.releasePointerCapture(x.pointerId),f.classList.remove("cursor-grabbing"),f.classList.add("cursor-grab"))};return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",m),f.addEventListener("pointerdown",g),f.addEventListener("pointermove",y),f.addEventListener("pointerup",b),f.addEventListener("pointercancel",b),()=>{cancelAnimationFrame(r.rafId),d.disconnect(),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",m),f.removeEventListener("pointerdown",g),f.removeEventListener("pointermove",y),f.removeEventListener("pointerup",b),f.removeEventListener("pointercancel",b)}},[t.length]);const s=[...t,...t];return c.jsx("div",{ref:e,className:"marquee-viewport cursor-grab touch-pan-y select-none overflow-hidden",children:c.jsx("div",{ref:n,className:"marquee-track flex w-max gap-5",children:s.map((i,o)=>c.jsx("div",{className:"w-64 shrink-0 sm:w-72 lg:w-80",children:c.jsxs("div",{className:"relative flex h-full flex-col overflow-hidden rounded-xl border border-neutral-200 bg-white p-6 shadow-sm transition-shadow duration-300 hover:shadow-lg dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 32 24",className:"absolute -right-1 -top-1 h-16 w-16 text-brand-500/10 dark:text-brand-400/10",children:c.jsx("path",{fill:"currentColor",d:"M9.4 0C4.4 3.5 1 9.1 1 15.3 1 20.6 4.3 24 8.4 24c3.8 0 6.6-3 6.6-6.6 0-3.4-2.4-5.9-5.4-5.9-.6 0-1.4.1-1.6.2C8.5 8.5 11.6 4.6 14.6 2.6L9.4 0zm16.5 0c-4.8 3.5-8.3 9.1-8.3 15.3 0 5.3 3.3 8.6 7.5 8.6 3.7 0 6.6-3 6.6-6.6 0-3.4-2.5-5.9-5.4-5.9-.6 0-1.4.1-1.6.2.5-3.3 3.6-7.1 6.7-9.1L25.9 0z"})}),c.jsx(nj,{className:"relative z-10 mb-3 h-4 w-4",count:i.rating||5}),c.jsxs("p",{className:"relative z-10 mb-4 line-clamp-6 flex-1 text-sm leading-relaxed text-neutral-600 dark:text-neutral-300",children:["„",i.text,'"']}),c.jsxs("div",{className:"relative z-10 mt-auto flex items-center gap-3",children:[i.photo?c.jsx("img",{src:i.photo,alt:"",referrerPolicy:"no-referrer",className:"h-9 w-9 shrink-0 rounded-full object-cover"}):c.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-brand-100 text-sm font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-300",children:i.name.charAt(0).toUpperCase()}),c.jsx("p",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:i.name})]})]})},`${i.name}-${o}`))})})}function Xi(t,e,n={x:0,y:0}){const r=Math.max(0,Math.min(100,t==null?n.x:Number(t)||0)),s=Math.max(0,Math.min(100,e==null?n.y:Number(e)||0));return{left:`${r}%`,top:`${s}%`,transform:`translate(-${r}%, -${s}%)`}}const _I="/assets/gallery-dash2-CEVCErVK.webp",rj="/assets/gallery-amp-purple-CESAKuOf.webp",II="/assets/gallery-speaker-CUXQZ49Q.webp",sj="/assets/gallery-subs-COSd4seJ.webp",ij="/assets/gallery-dash-Cg-7v9qo.webp",OI="/assets/hero-trunk-Dp4_JHDh.webp",BI="/assets/gallery-rear-8cIXPC7T.webp",zI="/assets/hero-highlight-Co4f1Kj5.webp",FI="/assets/youtube-hintergrund-C0osNxn7.mp4",tc={left:"text-left",center:"text-center",right:"text-right"},VI={left:"",center:"mx-auto",right:"ml-auto"},$I={eyebrow_de:"",eyebrow_en:"",title_de:"",title_en:"",body_html_de:"",body_html_en:"",text_align:"center",text_align_x:50,text_align_y:50,button_label_de:"",button_label_en:"",button_url:"",font_family:null};function vv({label:t,url:e,className:n}){return!t||!e?null:e.startsWith("/")?c.jsx(ee,{to:e,className:n,children:t}):c.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:n,children:t})}const HI=[{src:sj,width:900,height:600},{src:rj,width:900,height:600},{src:II,width:900,height:1200},{src:ij,width:900,height:814},{src:BI,width:900,height:1200},{src:OI,width:1920,height:1280}];function WI(){const{hero_image_path:t}=rs(),e=t||_I,{t:n,language:r}=at(),s=n("home.stats"),i=n("home.galleryAlts"),o=HI.map((M,j)=>({...M,alt:i[j]})),[a,l]=v.useState([]),[u,d]=v.useState({}),[h,f]=v.useState([]),p=M=>{const j=u[M]||$I;return{eyebrow:j[`eyebrow_${r}`]||"",title:j[`title_${r}`]||"",bodyHtml:j[`body_html_${r}`]||"",align:j.text_align||"center",alignX:j.text_align_x,alignY:j.text_align_y,buttonLabel:j[`button_label_${r}`]||"",buttonUrl:j.button_url||"",fontFamily:j.font_family||void 0}};v.useEffect(()=>{A.get("/home-sections").then(d).catch(()=>{})},[]),v.useEffect(()=>{A.get("/partners").then(f).catch(()=>{})},[]);const[m,g]=v.useState(null),y=m?m.reviews.filter(M=>M.review_text).map(M=>({name:M.author_name,text:M.review_text,rating:M.rating,photo:M.profile_photo_url})):n("home.testimonials");v.useEffect(()=>{A.get("/faqs").then(M=>{l(M.map(j=>({question:r==="de"?j.question_de:j.question_en,answer:r==="de"?j.answer_de:j.answer_en})))}).catch(()=>{})},[r]),v.useEffect(()=>{A.get("/google-reviews").then(M=>{M.rating!=null&&M.reviews.some(j=>j.review_text)&&g(M)}).catch(()=>{})},[]),Wt({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),v.useEffect(()=>{if(a.length===0)return;const M=document.createElement("script");return M.type="application/ld+json",M.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:a.map(j=>({"@type":"Question",name:j.question,acceptedAnswer:{"@type":"Answer",text:j.answer}}))}),document.head.appendChild(M),()=>document.head.removeChild(M)},[a]);const b=v.useRef(null),{scrollYProgress:x}=ZC({target:b,offset:["start start","end start"]}),k=br(x,[0,1],["-6%","6%"]),w=br(x,[0,1],["0%","60%"]),C=br(x,[0,.8],[1,0]),E=br(x,[.5,1],[0,1]),S=br(E,M=>M>.05?"auto":"none"),N=br(x,[.5,1],[16,0]);return c.jsxs("div",{children:[c.jsx(Xn.div,{style:{opacity:E,pointerEvents:S,y:N},className:"fixed inset-x-0 bottom-0 z-20 border-t border-neutral-200 bg-white/95 px-4 py-3 shadow-[0_-8px_24px_rgba(0,0,0,0.08)] backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:px-6",children:c.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[c.jsx("p",{className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block",children:n("home.stickyCta")}),c.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[c.jsx(ee,{to:"/fahrzeuge",className:"flex-1 rounded-md bg-brand-500 px-5 py-2.5 text-center text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 sm:flex-none",children:n("home.selectVehicle")}),c.jsx(ee,{to:"/kontakt",className:"flex-1 rounded-md border border-neutral-300 px-5 py-2.5 text-center text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800 sm:flex-none",children:n("home.getInTouch")})]})]})}),c.jsxs("section",{ref:b,className:"relative -mt-[89px] h-dvh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[c.jsx(Xn.img,{style:{y:k,scale:1.15},src:e,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),c.jsx(Xn.div,{style:{y:w,opacity:C},className:"absolute inset-0",children:c.jsx("div",{className:"absolute w-full max-w-2xl px-4 text-center sm:px-6",style:{...Xi(p("hero").alignX,p("hero").alignY,{x:50,y:50}),fontFamily:p("hero").fontFamily},children:c.jsxs(Xn.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[p("hero").eyebrow&&c.jsx("p",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",children:p("hero").eyebrow}),c.jsx("h1",{className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",children:p("hero").title}),c.jsx("div",{className:"legal-content mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg",dangerouslySetInnerHTML:{__html:p("hero").bodyHtml}}),c.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[c.jsx(ee,{to:"/fahrzeuge",className:"rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 hover:shadow-lg",children:n("home.selectVehicle")}),c.jsx(ee,{to:"/kontakt",className:"rounded-md border border-white/30 bg-white/10 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:-translate-y-0.5 hover:bg-white/20",children:n("home.getInTouch")})]})]})})})]}),c.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:c.jsx("div",{className:"mx-auto grid max-w-6xl grid-cols-2 gap-6 px-4 text-center sm:grid-cols-4 sm:px-6",children:s.map((M,j)=>c.jsxs(Qe,{index:j,children:[c.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:M.value}),c.jsx("p",{className:"text-sm text-neutral-400",children:M.label})]},M.label))})}),c.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:c.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[c.jsx("p",{className:"mb-4 text-center text-xs font-semibold uppercase tracking-wide text-neutral-400",children:n("home.brandsHeading")}),c.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:h.map((M,j)=>c.jsx(Qe,{index:j,children:M.logo_path?c.jsx("img",{src:M.logo_path,alt:M.name,className:"h-8 max-w-[8rem] object-contain opacity-70 grayscale transition hover:opacity-100 hover:grayscale-0"}):c.jsx("span",{className:"text-lg font-bold text-neutral-400 dark:text-neutral-600",children:M.name})},M.id))})]})}),c.jsxs("section",{className:"relative min-h-[70vh] overflow-hidden sm:min-h-[85vh]",children:[c.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,poster:ij,className:"absolute inset-0 h-full w-full object-cover",children:c.jsx("source",{src:FI,type:"video/mp4"})}),c.jsx("div",{className:"absolute inset-0 bg-black/55"}),c.jsx("div",{className:"absolute w-full max-w-3xl px-4 text-center sm:px-6",style:{...Xi(p("youtube").alignX,p("youtube").alignY,{x:50,y:50}),fontFamily:p("youtube").fontFamily},children:c.jsxs(Qe,{children:[p("youtube").eyebrow&&c.jsx("p",{className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",children:p("youtube").eyebrow}),c.jsx("h2",{className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",children:p("youtube").title}),c.jsx("div",{className:"legal-content mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm",dangerouslySetInnerHTML:{__html:p("youtube").bodyHtml}}),c.jsx(vv,{label:p("youtube").buttonLabel,url:p("youtube").buttonUrl,className:"mt-8 inline-flex items-center justify-center rounded-full bg-white px-8 py-3 text-xs font-bold uppercase tracking-wide text-neutral-900 transition hover:-translate-y-0.5 hover:bg-neutral-100"})]})})]}),c.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:c.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[c.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[c.jsx(Qe,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:c.jsx("img",{src:sj,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})}),c.jsxs(Qe,{direction:"right",index:1,className:tc[p("craft").align],style:{fontFamily:p("craft").fontFamily},children:[p("craft").eyebrow&&c.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:p("craft").eyebrow}),c.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:p("craft").title}),c.jsx("div",{className:"legal-content text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:p("craft").bodyHtml}})]})]}),c.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[c.jsxs(Qe,{direction:"left",className:`order-2 md:order-1 ${tc[p("advice").align]}`,style:{fontFamily:p("advice").fontFamily},children:[p("advice").eyebrow&&c.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:p("advice").eyebrow}),c.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:p("advice").title}),c.jsx("div",{className:"legal-content text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:p("advice").bodyHtml}})]}),c.jsx(Qe,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:c.jsx("img",{src:rj,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})]})]})}),c.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[c.jsxs(Qe,{className:`mb-8 ${tc[p("insights").align]}`,style:{fontFamily:p("insights").fontFamily},children:[p("insights").eyebrow&&c.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:p("insights").eyebrow}),c.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:p("insights").title}),c.jsx("div",{className:"legal-content mt-2 text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:p("insights").bodyHtml}})]}),c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:o.map((M,j)=>c.jsx(Qe,{index:j%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsx("img",{src:M.src,alt:M.alt,width:M.width,height:M.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})},M.src))})]}),c.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:c.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[c.jsxs(Qe,{className:"mb-10 text-center",children:[c.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:c.jsx(nj,{className:"h-6 w-6",count:m?Math.round(m.rating):5})}),c.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:m?n("home.reviewsRatingDynamic")(m.rating,m.rating_count):n("home.reviewsRating")}),c.jsx("p",{className:"mt-1 text-neutral-600 dark:text-neutral-300",children:n("home.reviewsText")}),c.jsx("a",{href:"https://www.google.com/maps/search/?api=1&query=Hifi+Planet+Amorbach+Boxbrunner+Stra%C3%9Fe+20a",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-block text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:n("home.reviewsLink")})]}),c.jsx(Qe,{children:c.jsx(RI,{testimonials:y})})]})}),c.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:c.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[c.jsx(Qe,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:c.jsx("img",{src:zI,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})}),c.jsxs(Qe,{direction:"right",index:1,className:`rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 ${tc[p("more").align]}`,style:{fontFamily:p("more").fontFamily},children:[p("more").eyebrow&&c.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:p("more").eyebrow}),c.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:p("more").title}),c.jsx("div",{className:`legal-content mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 ${VI[p("more").align]}`,dangerouslySetInnerHTML:{__html:p("more").bodyHtml}}),c.jsx(vv,{label:p("more").buttonLabel,url:p("more").buttonUrl,className:"inline-block rounded-md border border-neutral-300 px-6 py-3 text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800"})]})]})}),c.jsx("section",{className:"border-t border-neutral-300 py-16 dark:border-neutral-700",children:c.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[c.jsx(Qe,{className:"mb-8 text-center",children:c.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.faqHeading")})}),c.jsx(Qe,{index:1,children:c.jsx(DI,{items:a})})]})})]})}function UI(){const[t,e]=v.useState([]),[n,r]=v.useState(""),s=Zd(),{t:i}=at();return Wt({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),v.useEffect(()=>{s.vehicles.enabled&&!s.bypass||A.get("/brands").then(e).catch(o=>r(o.message))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?c.jsx(kl,{message:s.vehicles.message}):c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[s.vehicles.enabled&&s.bypass&&c.jsx(wl,{inline:!0}),c.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:i("vehicleSelect.title")}),c.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:i("vehicleSelect.intro")}),n&&c.jsx("p",{className:"text-red-600",children:n}),t.length===0&&!n&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.map(o=>c.jsxs(ee,{to:`/fahrzeuge/${o.slug}`,className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:[o.image_path&&c.jsx("img",{src:o.image_path,alt:"",className:"h-16 w-full object-contain"}),o.name]},o.id))})]})}function KI(){const{brandSlug:t}=Qs(),[e,n]=v.useState(null),[r,s]=v.useState(""),i=Zd(),{t:o}=at();return v.useEffect(()=>{i.vehicles.enabled&&!i.bypass||A.get(`/brands/${t}/models`).then(n).catch(a=>s(a.message))},[t,i.vehicles.enabled,i.bypass]),Wt({title:e?`${e.brand.name} ${o("brandPage.titleSuffix")}`:o("brandPage.metaTitleFallback"),description:e?o("brandPage.metaDescription")(e.brand.name):void 0,path:`/fahrzeuge/${t}`}),i.vehicles.enabled&&!i.bypass?c.jsx(kl,{message:i.vehicles.message}):r?c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):e?c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&c.jsx(wl,{inline:!0}),c.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[c.jsx(ee,{to:"/fahrzeuge",className:"hover:text-brand-500",children:o("brandPage.breadcrumbVehicles")})," / ",e.brand.name]}),c.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[e.brand.name," – ",o("brandPage.titleSuffix")]}),e.models.length===0&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:o("brandPage.empty")}),c.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:e.models.map(a=>c.jsxs(ee,{to:`/fahrzeuge/${t}/${a.slug}`,className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:[a.image_path&&c.jsx("img",{src:a.image_path,alt:"",className:"h-16 w-full object-contain"}),a.name]},a.id))})]}):c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:o("brandPage.loading")})}const kv="data:image/webp;base64,UklGRmoNAABXRUJQVlA4IF4NAAAQjACdASrgAVYDPlEok0ajoqGhIRK4IHAKCWlu/F+5xDCoDux8VXNtc99B5Uf715Q+k/+V6E/yD7bfvf7tYI7QKys1Pu/n/K9wD+L/0L/aeqHflfZf937AH81/p//N/yXr9f9f+M/yf7c+4D6R/7n+O+BL9d+rb+0f//9yX9VQU+fHDhw4cN7KTkCBAgQIECBAgQIEB8GtgzU5WrVq1atWrVq1atTTWWxGRvDLM5r169evXr169evVcNgPhleRXp06dOnTp06dOnTpUIn65+OKaJVsmzZs2bNmzZs2bNmSyYC6ipEunTp06dOnTp06dOlydZVuN901q1atWrVq1atWrVXZqLYS16JYyeHDhw4cOHDhw4cN4wtQeDaQLgECBAgQIECBAgQIDddB6sEmQB2atWrVq1atWrVq1aq1iYS5JU9iBlzXr169evXr169evXeEPp+8N6OklatWrVq1atWrVq1V3IfqDdZ8CK1AgQIECBAgQIECBBQFoI3bXHSzdGb8+OHDhw4cOHDhw4ZwLNj/Gx48ePHjx48ePHjx5HaZ5q8hFQPLVq1atWrVq1atWrVWlrSSS1atWrVq1atWrVq1VouJ4vs1atWrVq1atWrVqzMNN6naRaj4OHDhw4cOHDhwzggYy8goXr169evXr169evXbAmy3nWg79+/fv379+/fv377Aw+GV3JG24BIkSJEiRIkSJEiRH091sORb3KZK2rVq1atWrVq1atWZgOgxn2g3CECBAgQIECBAgQHwEh4tRYq5WHRSJEiRIkSJEiRIkRmQ4gXd9q0Xa9evXr169evXr169SUP3aSDmqBOfHDhw4cOHDhw4cN/rYXzoW6jx48ePHjx48ePHjwyNgV/F/hRIkSJEiRIkSJEiRGcgeccx2x48ePHjx48ePHjx5+h2DL7y1q1atWrVq1atWrVqrLjxn1+UevXr169evXr169epWz/ixb7G7Fx48ePHjx48ePHjx64Dpo0+TFzjw4cOHDhw4cOHDhwr64/FOVqj1ftlBYsWLFixYsWLFixsB93m6MKtrfi/YePHjx48ePHjx48eGCFP4MdBX+BXbQiRIkSJEiRIkSJEiA+X4/Ne4l0FixYsWLFixYsWLTKZjxkHLs7TTrVq1atWrVq1atWrSGY83Cktx0PPjhw4cOHDhw4cN/7Xmd/H4DxEePHjx48ePHjx48ct7KWpas7p5jy5cuXLly5cuXLlyM+h2/gRIkSJEiRIkSJEiRAPRMs9EnbFixYsWLFixYsWLBwJstxClHwcOHDhw4cOHDhw3+o6GvCGxY8ePHjx48ePHjx45aAayr3BCnnxw4cOHDhw4cOG/2HuJWxIvK1JLZs2bNmzZs2bNmyAMNnZLnTo6dOnTp06dOnTp06Vd0rFPQfnwwCPHjx48ePHjx48eOU7jRhCFUn5bFixYsWLFixYsWKZRr/1LzwcOHDhw4cOHDhw4ZshIGgexQoECBAgQIECBAgQH+hD+jvXr169eu0AAP7/2BA2pStbx3f0LK6/mZcFuZpv73FLTm7GUv07j8lFLoOGX1EwKUHfPc4FImBkAvjxF1E2TgBogJKpQ2lbMv5bOqPckB4PELJo9ZXlMwGup4PkMOtTZPmrbNoaCJqn0H4Bx7A0xA439P5hkMGBnAEfInQIN5UeUIDb3y6tLej2gR8HhJ5XmTsxvmM15ltL5ZwdGmoNeW8NevUVUKqJ8mNngu7ocCsyGYaeYOGGZBBt6rj6bPVKVbxvb8onw6mljAaaxGTz0W+aNPv06kK3qhDe6/uHi8kg2qvjF3njhRMyOJKZzg12h4qOtVgTuKPAMRWYDkgwiRs9iYqcumonNNXvXk3FAk2LO5XnyjtD5sHSUO3pIrztpBvqq+UJzKeIwGBlPwA2NP46tOJxLzbrKeH4SQjt2HAsbrVcQ/b/TgKZGPwaqfGDN+OjqJK3Z9dyCkGGfGKeG1w9+HSZTm/qh052lQEJAcdUX6vm/+sDBxtrfl4Sg8iMcVnDsfTKJpsTYF/vzJ1oQ6/VPyIX1HpDwnPXsptu9rKDFazlkwc3ofi8uKJmycgPiG9xOLlzn4Af8Dm+LcjJUMAtA7XeZPLlW1bwogbRthU8oA4LcURuku6eXDJ1eb1IKUU7k/UK0cBeK+R5YVcmrOnZIyHzcIaClYnrIwerP535fHv4VXjURTO6/85BvSeTNWvQGqkW5v1hG6AEMrxBryfat3kmr+SNEz5wC2f54z1O7C2KsRpt3maISh9PhMg7jDIxmVe07eHtkLtz6v3yQUJQV95yazDYpH5JfpuYSb8dtmB1cKjeoDTPvik9dCA1UFCTZBfojpIOwXdwAR7JEdZkEi/24hMNKJJlB6udZZKqNJB1hNl24Z++z6lAGSAuRgSwDZGdbqxs+0iL6wmRHilqPOiYB6hQiPZ7cfpMZxesqRwyhcf1O29w4ORG/7BlerR8hYvY4B1XsPYbDORvPk6FHIDXwTXGpuDIta7G4F6RNDdOvCFkAl53GZo5h/p2QkWUry5YuyegnPlKjT3He6ewYypA9YOvMhaqip7kr9sF4TU2bX9foKZ+FFZNzhyySS+13+g4BdJo9YF3bw5b6eSxUfTWiDLNh50VjuqRQWHUEkiA8zJqnqkKCwuDy6iY2oF20FJQlGIPpCDKPBzdXSb/n9NDltaoUlbam7cDAU7CwNdaWFXTABRk0S0e49iF4tO106Uwul7DGYpq0Eu71TnKUjCtEBc83QH8skvRzHniEne3AtJLYRH0cMNSSzeCJ1g+Nfc8RaZkhLhCaZGZdYe5j0LGmQnVFt2iapZvGBi7Sw0X56zdziC9Foq0OPsqKFetZdICc2eUV5Vu1+nvisSzn8wlSDUt3OmRkt/gJxfJQfWxcu5HZ26qqNpA4ablWrX4E9DEmvXzpFGYCnYJMheN2BlWwBVLh1cyQ8INngXaoB8I5Pj9oYyuz/W+jvJQ6G074luX9D3pLkuc88D0Hae3ZqXrRYRzGF1vD8pHsk9Co8B6rpE/4GEwW/zsCtnjz5G8m4KFwf2qW1k0HkNv7Nlg38bcz6TdTzuw/jega5XZQQhflLu4I6l+s90BHFIR+JEXTBBqJwT+IgTnpHNc+h5Ek74HiKqXuGUNGIKIozHkiFxMlnrsklrpweBzYY6ype9CzepAuQF63xC/eIJw1pMZEC1pPgq/r+1gWx5M6g8fpu2O12sb6pLeqT+G4mK3yHMZTojfp1xwQedRmwZnWQ8SCh4XV2a/+3OTz4D4pmmumyBV7V2VW3he8y6usinSjfYPxLyTng27fgw6jQhHl2mVhxBBjiwr5ljvJV7L+MJYDiZjGWfBCsTmehk6rbNt7ahTJpHu4B9ctRqiZXjx0zGpTF91OKifmy4nTq31p1XaIsZAHCWvItXKeke06KKKRTIm6mCT9yBJVwG1sqQhjrkP77q0/JGYgOwgdCQCstsAZQ0FlOrGYXYTIQK/krLyCAZjg8vP/Ers/KVN8F88OsyU5/T1e5ba8A2F63qgwhtkWoVIEZErOVL8sM/DtpWTlcBNsvVOFl4tT+Sk6a2ScCptFL5F6cZXTIw8JmgoCbyqB6xyU+uPP5y09s5T8MDC7Em7NpxCjgD39eed40gHQrBm6CtAbS9JOCVPkPxbpcGDj/LoAGbnyYzMpOmTi28LJ9FTIqyGuAI0jxY/QpNelOOEvNK3io1HeYkK3AprImDk99tlUjgt9bc3ejCOFDXt9LqGHjFssGrhVHyJBmWjwHQipcIMHxF2jfP5jfAGuHtJRRncHIFgLWmJ1XmzJ0LLqWCJShdJSJLc7L6YeVcgKfzOZCwhtzJ7VeI3uBhPXQNOqCf5tlQ32HApAMvCIiBwhYrpfFo/kvjfTMB/NJ0w2Lk8GAFfFQY+U6uX1oB0hztGmA5HggJTwgLo8exG64m3Xu4fg2g4MmQol7z6xNwwubABnpoS3Og85giFkaarUP2ovQyixFpXki8Xf5a5NwjUGCPbx+LD3WKJiBtkiHsYMMV/VAZVNvdg/Ph/V4ZYOr+hw7g9mOJXi+oVZxG9pqJC9w8nRkegsnQ2lpRHn22lTsIa9aOkR0X8zp/IajQxUzv057a3WptBst0EZbZtfmWp6h2K0sDQS9oQT1PqOkGDJlz6ZHZzDMShDTcwJfIZMdnjpeHdPoYoqlcn3M8daRuMeTSP3mabP1/pdQrs6Wl7ToKog2Au/gv46pUMgVcKmdWNJdDF8RplMMXJpU2tZMdkTWq4ofSypsCfuWfeHOpFQGJdFF6OoH2pDJXvkqpj1a832g3uYtVQg1TGyqYqI7UBZQy4NEZbdj6O/s6MNEnfujUDQ8QZj7rSE2RI77egKDWzM708AsvlMFoeX4CVP09rMzXNP2aOZwY7zOBTvBgEEqCWlXAFlY8pW0zIm16gqSPiwRUgH41i1PuJx382C0zTWGT243ZhLnyOIlreUrMQAfwR/oYt+ljnDFKqa5PEczDPa+u/vWmR6UM+Q/lLFiIlgBJTfaekWoeLpPd9FPN4gIHzK1ZS8kDHyq3lh/e6FQ84a4Zg6JlfQC/qhAAAAA==",GI="/assets/base-BKOm0Bib.webp",qI="/assets/clear-DZZMSrMX.webp",JI="/assets/drive-BE2W1yna.webp",YI="/assets/prime-BTVNe2Gb.webp",XI="/assets/elite_r-BRvz_pyr.webp",ZI="/assets/apex-CFy2qup8.webp",QI="/assets/statement-pTO-wTPx.webp",eO="/assets/limitless-DDs0S_PU.webp",tO=(t,e,n)=>{e/=100,n/=100;const r=o=>(o+t/30)%12,s=e*Math.min(n,1-n),i=o=>n-s*Math.max(-1,Math.min(r(o)-3,Math.min(9-r(o),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},mf=(t,e,n)=>`rgb(${tO(t,e,n).join(", ")})`,wv=t=>t.map(([e,n,r,s,i,o])=>({bgTop:mf(e,n,r),border:mf(e,n,r+8),accent:mf(s,i,o),img:null})),Sv={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:GI},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:qI},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:JI},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:YI},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:XI},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:ZI},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:QI},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:eO}],"deep-blue":wv([[215,18,11,210,15,60],[212,25,11,208,32,60],[210,38,12,206,46,60],[212,46,12,205,56,61],[214,52,12,205,63,62],[216,58,12,205,68,63],[220,62,12,212,73,65],[226,66,12,216,78,68]]),"warm-bronze":wv([[30,15,11,34,22,60],[34,32,11,34,46,60],[32,46,12,30,58,60],[26,52,12,24,65,60],[20,55,12,18,68,60],[14,55,12,12,68,61],[8,52,12,6,64,62],[2,50,12,358,60,63]])},nO="#f2f2f2",rO="#8a8a8a",sO="#c4c4c4",Nv=5;function iO({pkg:t,tier:e,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:o,t:a}){const[l,u]=v.useState(!1),d=s.length-Nv,h=l?s:s.slice(0,Nv),f=e.img?null:{backgroundColor:e.accent,WebkitMaskImage:`url(${kv})`,maskImage:`url(${kv})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return c.jsxs("div",{style:{borderColor:e.border,background:`linear-gradient(180deg, ${e.bgTop} 0%, #0b0b0b 55%, #080808 100%)`},className:r==="strip"?"relative flex min-h-[420px] grow shrink basis-[190px] min-w-[190px] max-w-[240px] snap-start flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40 sm:min-h-[640px] sm:basis-[210px]":r==="coverflow"?"relative flex min-h-[420px] w-[230px] shrink-0 snap-center flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40 sm:min-h-[640px]":"relative flex min-h-[420px] flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40 sm:min-h-[640px]",children:[e.img?c.jsx("img",{src:e.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...f,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),c.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...f,opacity:.55+n*.45},"aria-hidden":"true"})]}),t.is_featured&&c.jsx("span",{className:"absolute top-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-brand-500 px-3 py-1 text-xs font-bold text-white shadow",children:a("modelPage.featuredBadge")}),c.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0"},children:[c.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:e.accent,textTransform:"uppercase",lineHeight:1.1},children:t.name}),c.jsx("div",{style:{width:"44px",height:"2px",margin:"14px auto 0",background:`linear-gradient(90deg, rgba(255,255,255,0) 0%, ${e.accent} 50%, rgba(255,255,255,0) 100%)`}})]}),s.length>0&&c.jsxs("div",{className:"relative z-10",style:{padding:"18px 20px 14px",background:l?"linear-gradient(180deg, rgba(8,8,8,0.7) 0%, rgba(8,8,8,0.62) 94%, rgba(8,8,8,0) 100%)":"linear-gradient(180deg, rgba(8,8,8,0.55) 0%, rgba(8,8,8,0.48) 92%, rgba(8,8,8,0) 100%)"},children:[c.jsx("ul",{className:"space-y-1.5 text-left",children:h.map((p,m)=>c.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:sO},children:[c.jsx(Mt,{name:"check",className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:e.accent}}),c.jsx("span",{className:"leading-snug",children:p})]},m))}),d>0&&c.jsxs("button",{type:"button",onClick:()=>u(p=>!p),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:e.accent},children:[l?a("modelPage.lessBullets"):a("modelPage.moreBullets")(d),c.jsx(Mt,{name:l?"chevron-up":"chevron-down",className:"h-3.5 w-3.5"})]})]}),c.jsx("div",{className:"relative z-10 flex-1"}),c.jsx("div",{className:"relative z-10",style:{padding:"20px 20px 28px",background:"linear-gradient(180deg, rgba(8,8,8,0) 0%, rgba(8,8,8,0.85) 45%, rgba(8,8,8,0.95) 100%)"},children:c.jsxs("div",{className:"text-center",children:[!t.price_text&&c.jsx("div",{style:{fontSize:"13px",color:rO},children:a("modelPage.totalPrice")}),c.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:nO},children:t.price_text||i(t.total_price)}),c.jsx(ee,{to:o(t),className:"mt-4 inline-block rounded-md bg-brand-500 px-4 py-2 text-center text-sm font-semibold text-white shadow-lg shadow-brand-500/30 hover:bg-brand-400",children:a("modelPage.requestContact")})]})})]})}function oO(){const{brandSlug:t,modelSlug:e}=Qs(),[n,r]=v.useState(null),[s,i]=v.useState(""),o=Zd(),{t:a,language:l}=at(),{package_card_theme:u,package_card_layout:d,package_wheel_hint_interval:h}=rs(),f=Sv[u]||Sv.graphite,p=["grid","strip","coverflow"].includes(d)?d:"strip",m=Math.max(2,Number(h)||8)*1e3,g=v.useRef(null),y=v.useRef(null),b=v.useRef(null),[x,k]=v.useState(!1),w=T=>new Intl.NumberFormat(l==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(T);if(v.useEffect(()=>{o.vehicles.enabled&&!o.bypass||A.get(`/models/${t}/${e}/packages`).then(r).catch(T=>i(T.message))},[t,e,o.vehicles.enabled,o.bypass]),v.useEffect(()=>{const T=g.current;if(p!=="coverflow"||!T)return;let R=0;const $=()=>{R=0;const B=T.scrollLeft+T.clientWidth/2;for(const Z of T.children){const _=Z.offsetLeft+Z.offsetWidth/2,I=Math.max(-1,Math.min(1,(_-B)/(Z.offsetWidth*1.4))),V=Math.abs(I);Z.style.transform=`rotateY(${(-I*35).toFixed(2)}deg) scale(${(1-V*.13).toFixed(3)}) translateZ(${(-V*60).toFixed(1)}px)`,Z.style.zIndex=String(100-Math.round(V*50))}},L=()=>{R||(R=requestAnimationFrame($))};$(),T.addEventListener("scroll",L,{passive:!0});const W=new ResizeObserver(L);return W.observe(T),()=>{T.removeEventListener("scroll",L),W.disconnect(),cancelAnimationFrame(R)}},[p,n]),v.useEffect(()=>{const T=g.current;if(p==="grid"||!T)return;const R=window.matchMedia("(pointer: coarse)").matches;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let L=[],W=0;const B=()=>{const _=Math.min(T.clientWidth*.4,160);L.push(setTimeout(()=>T.scrollTo({left:_,behavior:"smooth"}),500)),L.push(setTimeout(()=>T.scrollTo({left:0,behavior:"smooth"}),1250)),R||(L.push(setTimeout(()=>k(!0),450)),L.push(setTimeout(()=>k(!1),1700)))},Z=new IntersectionObserver(([_])=>{_.isIntersecting&&(Z.disconnect(),B(),W=setInterval(()=>{T.scrollLeft<=1&&B()},m))},{threshold:.35});return Z.observe(T),()=>{Z.disconnect(),clearInterval(W),L.forEach(clearTimeout)}},[p,n,m]),v.useEffect(()=>{const T=g.current;if(p==="grid"||!T)return;let R=0,$=0,L=!1,W=0,B=0;const Z=()=>[...T.children].map(K=>K.offsetLeft+K.offsetWidth/2),_=(K,te)=>{let Se=0,se=1/0;return K.forEach((he,Te)=>{const lt=Math.abs(he-te);lt{L=!1;const K=Z();if(!K.length)return;const te=T.scrollLeft+T.clientWidth/2,Se=_(K,te);let se=Se;Se===W&&Math.abs(B)>4&&(se=B>0?Math.min(W+1,K.length-1):Math.max(W-1,0));const he=T.scrollWidth-T.clientWidth,Te=Math.max(0,Math.min(K[se]-T.clientWidth/2,he));T.scrollTo({left:Te,behavior:"smooth"}),clearTimeout($),$=setTimeout(()=>{T.style.scrollSnapType=""},450)},V=K=>{if(Math.abs(K.deltaX)>Math.abs(K.deltaY))return;const te=T.scrollWidth-T.clientWidth;if(te<=1)return;const Se=T.scrollLeft<=1,se=T.scrollLeft>=te-1;K.deltaY<0&&Se||K.deltaY>0&&se||(K.preventDefault(),L||(L=!0,B=0,W=_(Z(),T.scrollLeft+T.clientWidth/2)),B+=K.deltaY,T.style.scrollSnapType="none",T.scrollLeft+=K.deltaY,clearTimeout(R),R=setTimeout(I,150))};return T.addEventListener("wheel",V,{passive:!1}),()=>{T.removeEventListener("wheel",V),clearTimeout(R),clearTimeout($)}},[p,n]),v.useEffect(()=>{const T=g.current,R=y.current,$=b.current;if(p==="grid"||!T||!R||!$)return;let L=0;const W=()=>{L=0;const se=T.scrollWidth-T.clientWidth;if(se<=1){R.style.opacity="0",R.style.pointerEvents="none";return}R.style.opacity="1",R.style.pointerEvents="auto";const he=R.clientWidth,Te=Math.max(32,T.clientWidth/T.scrollWidth*he);$.style.width=`${Te}px`,$.style.transform=`translateX(${(T.scrollLeft/se*(he-Te)).toFixed(1)}px)`},B=()=>{L||(L=requestAnimationFrame(W))};W(),T.addEventListener("scroll",B,{passive:!0});const Z=new ResizeObserver(B);Z.observe(T);let _=!1,I=0;const V=se=>{const he=R.getBoundingClientRect(),Te=$.clientWidth,lt=Math.min(Math.max(se-he.left-I,0),he.width-Te);T.scrollLeft=lt/(he.width-Te)*(T.scrollWidth-T.clientWidth)},K=se=>{_=!0,R.setPointerCapture(se.pointerId),T.style.scrollSnapType="none";const he=$.getBoundingClientRect();I=se.clientX>=he.left&&se.clientX<=he.right?se.clientX-he.left:$.clientWidth/2,se.clientX>=he.left&&se.clientX<=he.right||V(se.clientX)},te=se=>{_&&V(se.clientX)},Se=se=>{var he;_&&(_=!1,(he=R.hasPointerCapture)!=null&&he.call(R,se.pointerId)&&R.releasePointerCapture(se.pointerId),T.style.scrollSnapType="")};return R.addEventListener("pointerdown",K),R.addEventListener("pointermove",te),R.addEventListener("pointerup",Se),R.addEventListener("pointercancel",Se),()=>{T.removeEventListener("scroll",B),Z.disconnect(),cancelAnimationFrame(L),R.removeEventListener("pointerdown",K),R.removeEventListener("pointermove",te),R.removeEventListener("pointerup",Se),R.removeEventListener("pointercancel",Se)}},[p,n]),Wt({title:n?a("modelPage.metaTitle")(n.model.brand_name,n.model.name):a("modelPage.metaTitleFallback"),description:n?a("modelPage.metaDescription")(n.model.brand_name,n.model.name):void 0,path:`/fahrzeuge/${t}/${e}`}),o.vehicles.enabled&&!o.bypass)return c.jsx(kl,{message:o.vehicles.message});if(s)return c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s});if(!n)return c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:a("modelPage.loading")});const{model:C,packages:E}=n,S=new Map([...E].sort((T,R)=>T.total_price-R.total_price).map((T,R)=>[T.id,R])),N=T=>{const R=E.length,$=S.get(T.id)??0,L=R<=1?0:$/(R-1),W=Math.round(L*(f.length-1));return{tier:f[W],tierT:L}},M=T=>[...T.products.map(R=>R.name_override||R.scraped_name||a("modelPage.productLoading")),...(T.description||"").split(` +`).map(R=>R.trim()).filter(Boolean)],j=T=>`/kontakt?${new URLSearchParams({brand:C.brand_name,model:C.name,package:T.name,packageId:T.id,total:T.total_price}).toString()}`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-12 sm:px-6",children:[o.vehicles.enabled&&o.bypass&&c.jsx(wl,{inline:!0}),c.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[c.jsx(ee,{to:"/fahrzeuge",className:"hover:text-brand-500",children:a("modelPage.breadcrumbVehicles")})," /"," ",c.jsx(ee,{to:`/fahrzeuge/${t}`,className:"hover:text-brand-500",children:C.brand_name})," / ",C.name]}),c.jsxs("h1",{className:`text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl ${E.length?"mb-2":"mb-8"}`,children:[C.brand_name," ",C.name," – ",a("modelPage.titleSuffix")]}),E.length===0&&c.jsx("p",{className:"pb-12 text-neutral-500 dark:text-neutral-400",children:a("modelPage.empty")})]}),E.length>0&&c.jsx("section",{className:"py-10 sm:py-14",style:{fontFamily:"'Barlow', sans-serif"},children:c.jsxs("div",{className:p==="grid"?"mx-auto max-w-6xl px-4 sm:px-6":"relative mx-auto max-w-[1880px] px-4 sm:px-6",children:[c.jsx("div",{ref:p==="grid"?void 0:g,className:p==="grid"?"grid items-start gap-[18px] sm:grid-cols-2 xl:grid-cols-3":"flex select-none items-start gap-[18px] overflow-x-auto pb-3 snap-x snap-mandatory [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:p==="coverflow"?{perspective:"1200px",paddingLeft:"calc(50% - 115px)",paddingRight:"calc(50% - 115px)",paddingTop:"10px"}:void 0,children:E.map(T=>{const{tier:R,tierT:$}=N(T);return c.jsx(iO,{pkg:T,tier:R,tierT:$,layout:p,bullets:M(T),formatPrice:w,contactUrl:j,t:a},T.id)})}),p!=="grid"&&c.jsx("div",{className:`pointer-events-none absolute inset-x-0 top-1/2 z-[200] flex -translate-y-1/2 justify-center transition-opacity duration-300 ${x?"opacity-100":"opacity-0"}`,"aria-hidden":"true",children:c.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-neutral-900/85 px-4 py-2 text-xs font-medium text-white shadow-lg backdrop-blur-sm",children:[c.jsx(W2,{className:"h-3.5 w-3.5 text-brand-400"}),c.jsx(U2,{className:"h-4 w-4 text-brand-400"}),c.jsx(K2,{className:"h-3.5 w-3.5 text-brand-400"}),c.jsx("span",{children:a("modelPage.wheelHint")})]})}),p!=="grid"&&c.jsx("div",{ref:y,className:"relative mx-auto mt-5 h-2 w-56 max-w-full cursor-pointer rounded-full bg-neutral-900/10 transition-opacity duration-200 dark:bg-white/10",style:{touchAction:"none"},"aria-hidden":"true",children:c.jsx("div",{ref:b,className:"absolute left-0 top-0 h-full rounded-full bg-brand-500 shadow-[0_0_10px_rgba(107,166,38,0.7)]",style:{width:"48px"}})})]})})]})}function aO(){const[t,e]=v.useState(null),[n,r]=v.useState(""),{t:s}=at(),{gallery_card_text_x:i,gallery_card_text_y:o}=rs();return Wt({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),v.useEffect(()=>{A.get("/gallery-brands").then(e).catch(a=>r(a.message))},[]),c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[c.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("galleryOverview.title")}),c.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:s("galleryOverview.intro")}),n&&c.jsx("p",{className:"text-red-600",children:n}),!t&&!n&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),t&&t.length===0&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t==null?void 0:t.map(a=>c.jsxs(ee,{to:`/galerie/${a.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[a.cover_image_path?c.jsx("img",{src:a.cover_image_path,alt:a.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),c.jsx("span",{className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:Xi(i,o,{x:0,y:100}),children:a.name})]},a.id))})]})}function lO(){const{brandSlug:t}=Qs(),[e,n]=v.useState(null),[r,s]=v.useState(""),{t:i}=at(),{gallery_card_text_x:o,gallery_card_text_y:a}=rs();return v.useEffect(()=>{A.get(`/gallery-brands/${t}/projects`).then(n).catch(l=>s(l.message))},[t]),Wt({title:e?i("galleryBrandPage.metaTitle")(e.brand.name):i("galleryBrandPage.metaTitleFallback"),description:e?i("galleryBrandPage.metaDescription")(e.brand.name):void 0,path:`/galerie/${t}`}),r?c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):e?c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[c.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[c.jsx(ee,{to:"/galerie",className:"hover:text-brand-500",children:i("galleryBrandPage.breadcrumbGallery")})," / ",e.brand.name]}),c.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[e.brand.name," – ",i("galleryBrandPage.titleSuffix")]}),e.projects.length===0&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("galleryBrandPage.empty")}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:e.projects.map(l=>c.jsxs(ee,{to:`/galerie/${t}/${l.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[l.cover_image_path?c.jsx("img",{src:l.cover_image_path,alt:l.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),c.jsx("span",{className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:Xi(o,a,{x:0,y:100}),children:l.name})]},l.id))})]}):c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:i("galleryBrandPage.loading")})}function cO({photos:t,index:e,onClose:n,onNavigate:r}){const{t:s}=at();if(v.useEffect(()=>{if(e==null)return;const a=l=>{l.key==="Escape"&&n(),l.key==="ArrowRight"&&r(1),l.key==="ArrowLeft"&&r(-1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[e,n,r]),e==null)return null;const i=t[e],o=a=>a.stopPropagation();return $d.createPortal(c.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:n,children:[c.jsx("button",{onClick:a=>{o(a),n()},"aria-label":s("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-7 w-7",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),t.length>1&&c.jsx("button",{onClick:a=>{o(a),r(-1)},"aria-label":s("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),c.jsx("img",{src:i.image_path,alt:i.caption||"",onClick:o,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),t.length>1&&c.jsx("button",{onClick:a=>{o(a),r(1)},"aria-label":s("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),i.caption&&c.jsx("p",{onClick:o,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:i.caption})]}),document.body)}function uO(){const{brandSlug:t,projectSlug:e}=Qs(),[n,r]=v.useState(null),[s,i]=v.useState(""),[o,a]=v.useState(null),{t:l}=at();v.useEffect(()=>{A.get(`/gallery-brands/${t}/${e}/photos`).then(r).catch(d=>i(d.message))},[t,e]),Wt({title:n?`${n.project.name} – ${n.project.brand_name}`:l("galleryProjectPage.metaTitleFallback"),description:n?l("galleryProjectPage.metaDescription")(n.project.name):void 0,path:`/galerie/${t}/${e}`});const u=d=>{a(h=>{const f=n.photos.length;return(h+d+f)%f})};return s?c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s}):n?c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[c.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[c.jsx(ee,{to:"/galerie",className:"hover:text-brand-500",children:l("galleryProjectPage.breadcrumbGallery")})," /"," ",c.jsx(ee,{to:`/galerie/${t}`,className:"hover:text-brand-500",children:n.project.brand_name})," / ",n.project.name]}),c.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:n.project.name}),n.photos.length===0&&c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:l("galleryProjectPage.empty")}),c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:n.photos.map((d,h)=>c.jsx(Qe,{index:h%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:c.jsx("button",{onClick:()=>a(h),className:"block h-full w-full","aria-label":d.caption||l("galleryProjectPage.enlargeImage"),children:c.jsx("img",{src:d.image_path,alt:d.caption||"",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},d.id))}),c.jsx(cO,{photos:n.photos,index:o,onClose:()=>a(null),onNavigate:u})]}):c.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:l("galleryProjectPage.loading")})}function dO(){const[t,e]=v.useState([]),n=Zd(),{t:r}=at();return v.useEffect(()=>{A.get("/services").then(e).catch(()=>e([]))},[]),Wt({title:r("leistungen.metaTitle"),description:r("leistungen.metaDescription"),path:"/leistungen"}),n.services.enabled&&!n.bypass?c.jsx(kl,{message:n.services.message}):c.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[n.services.enabled&&n.bypass&&c.jsx(wl,{inline:!0}),c.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:r("leistungen.title")}),c.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:r("leistungen.intro")}),c.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:t.map((s,i)=>c.jsxs(Qe,{index:i%3,shine:!0,className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"relative aspect-[4/3]",children:[s.image_path&&c.jsx("img",{src:s.image_path,alt:s.title,className:"h-full w-full object-cover",loading:"lazy"}),c.jsx("div",{className:"absolute -bottom-5 left-5 flex h-12 w-12 items-center justify-center rounded-full bg-brand-500 text-white shadow-lg ring-4 ring-white dark:ring-neutral-900",children:c.jsx(Mt,{name:s.icon_name,className:"h-6 w-6"})})]}),c.jsxs("div",{className:"p-6 pt-8",children:[c.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:s.title}),c.jsx("p",{className:"mb-3 text-sm text-neutral-600 dark:text-neutral-300",children:s.description}),c.jsxs(ee,{to:s.cta_url||"/kontakt",className:"text-sm font-semibold text-brand-600 hover:underline dark:text-brand-400",children:[s.cta_label||r("leistungen.contact")," →"]})]})]},s.id))}),c.jsxs("div",{className:"mt-12 rounded-xl border border-neutral-200 bg-neutral-50 p-8 text-center dark:border-neutral-800 dark:bg-neutral-900/40",children:[c.jsx("h2",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:r("leistungen.notListedTitle")}),c.jsx("p",{className:"mb-5 text-neutral-600 dark:text-neutral-300",children:r("leistungen.notListedText")}),c.jsx(ee,{to:"/kontakt",className:"inline-block rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white hover:bg-brand-600",children:r("leistungen.contact")})]})]})}function hO({name:t,description:e,className:n="",children:r}){const{consent:s,acceptAll:i,openSettings:o}=go();return s.external?r:c.jsxs("div",{className:`flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-neutral-50 p-6 text-center dark:border-neutral-800 dark:bg-neutral-900/40 ${n}`,children:[c.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:e||`${t} wird erst nach deiner Zustimmung geladen, da dabei Daten an Google übertragen werden.`}),c.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[c.jsx("button",{type:"button",onClick:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Laden erlauben"}),c.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Cookie-Einstellungen"})]})]})}const oj=t=>(t||"").replace(/[^\d+]/g,""),fO=t=>`https://wa.me/${oj(t).replace(/^0/,"49").replace("+","")}`,$c={fontFamily:"'Michroma', sans-serif"};function pO({className:t}){return c.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:c.jsx("path",{d:"M12 2a10 10 0 0 0-8.6 15l-1.3 4.8 5-1.3A10 10 0 1 0 12 2zm0 2a8 8 0 1 1-4.2 14.8l-.3-.2-2.6.7.7-2.5-.2-.3A8 8 0 0 1 12 4zm4.3 9.9c-.2-.1-1.4-.7-1.6-.8s-.4-.1-.5.1l-.7.9c-.1.1-.3.2-.5.1a6.5 6.5 0 0 1-3.2-2.8c-.1-.2 0-.4.1-.5l.4-.5.2-.4v-.4l-.7-1.7c-.2-.4-.4-.4-.5-.4h-.5c-.2 0-.4.1-.6.3-.7.7-.9 1.6-.6 2.7.5 1.7 1.6 3.1 3.4 4.2 1.7 1 2.5 1 3.4.9.5-.1 1.4-.6 1.6-1.1.2-.5.2-1 .1-1.1z"})})}function mO({path:t,className:e}){return c.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:t})})}const gO={premium:"M4 12v3M8 8v11M12 4v16M16 8v11M20 12v3",germany:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0 M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5 19 19M19 5l-1.5 1.5M6.5 17.5 5 19",individual:"M6 3h12l4 6-10 12L2 9z M11 3 8 9l4 12 4-12-3-6M2 9h20",experts:"M20 6 9 17l-5-5"};function Cv({formatted:t,color:e}){const[n,r]=t.split("€");return c.jsxs("span",{style:{...$c,color:e},children:[n,c.jsx("span",{style:{fontFamily:"'Barlow', sans-serif"},children:"€"}),r]})}function nc({icon:t,label:e,name:n,type:r="text",required:s,value:i,onChange:o,placeholder:a}){return c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("label",{htmlFor:`kf-${n}`,className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:e}),c.jsxs("div",{className:"relative flex items-center",children:[c.jsx(t,{className:"pointer-events-none absolute left-[14px] h-[17px] w-[17px]",style:{color:"var(--kf-fieldicon)"}}),c.jsx("input",{id:`kf-${n}`,name:n,type:r,required:s,value:i,onChange:o,placeholder:a,className:"w-full rounded-lg border py-3.5 pl-[42px] pr-4 text-[15px] outline-none transition-colors",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)",color:"var(--kf-text2)"}})]})]})}function xO(){const[t]=gD(),{phone:e,whatsapp:n,contact_email:r,address_street:s,address_zip:i,address_city:o,business_hours:a}=rs(),{t:l,language:u}=at(),{consent:d}=go(),h=[s,[i,o].filter(Boolean).join(" ")].filter(Boolean).join(", "),f=encodeURIComponent(h),p=`https://www.google.com/maps/dir/?api=1&destination=${f}`,m=cN(a,l("footer.closed")),g=I=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(I),[y,b]=v.useState({name:"",email:"",phone:"",vin:"",message:""}),[x,k]=v.useState("idle"),[w,C]=v.useState(""),[E,S]=v.useState([]),[N,M]=v.useState([]),j=t.get("packageId"),T=t.get("total")?Number(t.get("total")):null;v.useEffect(()=>{if(!j){S([]);return}A.get(`/packages/${j}/upgrades`).then(S).catch(()=>S([]))},[j]);const R=I=>{M(V=>V.includes(I)?V.filter(K=>K!==I):[...V,I])},$=E.filter(I=>N.includes(I.id)).reduce((I,V)=>I+Number(V.price),0);Wt({title:l("contactPage.metaTitle"),description:l("contactPage.metaDescription"),path:"/kontakt"});const L={brand:t.get("brand")||"",model:t.get("model")||"",package:t.get("package")||""},W=!!(L.brand&&L.model&&L.package),B=I=>b(V=>({...V,[I.target.name]:I.target.value})),Z=async I=>{I.preventDefault(),k("sending"),C("");try{await A.post("/contact",{...y,brand_name:L.brand||null,model_name:L.model||null,package_name:L.package||null,product_name:t.get("product")||null,package_id:j||null,package_product_id:t.get("productId")||null,upgrade_ids:N}),k("sent"),b({name:"",email:"",phone:"",vin:"",message:""})}catch(V){C(V.message),k("idle")}},_=[{key:"premium",title:l("contactPage.featurePremiumTitle"),sub:l("contactPage.featurePremiumSub")},{key:"germany",title:l("contactPage.featureGermanyTitle"),sub:l("contactPage.featureGermanySub")},{key:"individual",title:l("contactPage.featureIndividualTitle"),sub:l("contactPage.featureIndividualSub")},{key:"experts",title:l("contactPage.featureExpertsTitle"),sub:l("contactPage.featureExpertsSub")}];return c.jsx("div",{className:"kf-page kontakt-sektion relative w-full overflow-hidden px-4 pb-10 sm:px-10",style:{color:"var(--kf-text2)",fontFamily:"'Barlow', sans-serif"},children:c.jsxs("div",{className:"relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14",children:[c.jsx("div",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.heroEyebrow")}),c.jsxs("h1",{className:"text-[34px] leading-[1.08] sm:text-[46px] lg:text-[60px]",style:{...$c,color:"var(--kf-text)"},children:[l("contactPage.heroTitlePre")," ",c.jsx("span",{style:{color:"var(--kf-accent2)"},children:l("contactPage.heroTitleAccent")})," ",l("contactPage.heroTitlePost")]}),c.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:"var(--kf-muted)"},children:l("contactPage.heroSubtitle")}),c.jsxs("div",{className:"grid grid-cols-1 items-start gap-10 min-[981px]:grid-cols-[minmax(0,1.35fr)_minmax(320px,1fr)]",children:[c.jsx("div",{children:c.jsxs("div",{className:"rounded-2xl border p-[22px] sm:p-10",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[W&&c.jsxs("div",{className:"mb-8 rounded-xl border px-6 py-[22px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[c.jsxs("div",{className:"mb-3.5 flex items-center gap-2.5 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:[c.jsx(G2,{className:"h-4 w-4"}),l("contactPage.packageBoxTitle")]}),c.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-5 gap-y-2 text-[15px]",children:[c.jsx("span",{style:{color:"var(--kf-label)"},children:l("contactPage.contextBrand")}),c.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:L.brand}),c.jsx("span",{style:{color:"var(--kf-label)"},children:l("contactPage.contextModel")}),c.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:L.model}),c.jsx("span",{style:{color:"var(--kf-label)"},children:l("contactPage.contextPackage")}),c.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:L.package})]}),c.jsxs("div",{className:"mt-3.5 flex items-baseline justify-between border-t pt-3.5",style:{borderColor:"var(--kf-pkgbrd)"},children:[c.jsx("span",{className:"text-[13px] font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:l("contactPage.packagePrice")}),c.jsx("span",{className:"text-xl",children:T!=null?c.jsx(Cv,{formatted:g(T),color:"var(--kf-text)"}):"—"})]})]}),E.length>0&&c.jsxs("div",{className:"mb-8 rounded-xl border p-5",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)"},children:[c.jsx("div",{className:"mb-3 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.optionalUpgrades")}),c.jsx("div",{className:"space-y-2",children:E.map(I=>c.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border p-3 text-sm",style:{borderColor:"var(--kf-fieldbrd)"},children:[c.jsx("input",{type:"checkbox",checked:N.includes(I.id),onChange:()=>R(I.id),className:"mt-0.5 h-4 w-4 rounded",style:{accentColor:"var(--kf-accent)"}}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block font-semibold",style:{color:"var(--kf-text2)"},children:I.name}),I.description&&c.jsx("span",{className:"block text-xs",style:{color:"var(--kf-muted)"},children:I.description})]}),c.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-accent2)"},children:["+",g(I.price)]})]},I.id))}),N.length>0&&T!=null&&c.jsxs("div",{className:"mt-3 flex items-baseline justify-between border-t pt-3 text-sm",style:{borderColor:"var(--kf-pkgbrd)"},children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:l("contactPage.totalWithUpgrades")}),c.jsx(Cv,{formatted:g(T+$),color:"var(--kf-text)"})]})]}),c.jsx("h2",{className:"mb-8 text-xl",style:{...$c,color:"var(--kf-text)"},children:l("contactPage.formTitle")}),x==="sent"&&c.jsxs("div",{className:"mb-6 rounded-[10px] border p-5",style:{borderColor:"var(--kf-accent)",background:"var(--kf-accentsoft)"},children:[c.jsx("div",{className:"text-base font-bold",style:{color:"var(--kf-accent2)"},children:l("contactPage.sentTitle")}),c.jsx("div",{className:"mt-1 text-sm",style:{color:"var(--kf-muted)"},children:l("contactPage.sentText")})]}),c.jsxs("form",{onSubmit:Z,children:[c.jsxs("div",{className:"grid grid-cols-1 gap-6 min-[641px]:grid-cols-2",children:[c.jsx(nc,{icon:q2,label:l("contactPage.nameLabel"),name:"name",required:!0,value:y.name,onChange:B,placeholder:l("contactPage.namePlaceholder")}),c.jsx(nc,{icon:Cx,label:l("contactPage.emailLabel"),name:"email",type:"email",required:!0,value:y.email,onChange:B,placeholder:l("contactPage.emailPlaceholder")}),c.jsx(nc,{icon:jx,label:l("contactPage.phoneLabel"),name:"phone",value:y.phone,onChange:B,placeholder:l("contactPage.phonePlaceholder")}),c.jsx(nc,{icon:J2,label:l("contactPage.vinLabel"),name:"vin",value:y.vin,onChange:B,placeholder:l("contactPage.vinPlaceholder")})]}),c.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[c.jsx("label",{htmlFor:"kf-message",className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:l("contactPage.messageLabel")}),c.jsx("textarea",{id:"kf-message",name:"message",rows:5,value:y.message,onChange:B,placeholder:l("contactPage.messagePlaceholder"),className:"w-full resize-y rounded-lg border px-4 py-3.5 text-[15px] outline-none",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)",color:"var(--kf-text2)"}})]}),w&&c.jsx("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:w}),c.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-5",children:[c.jsxs("button",{type:"submit",disabled:x==="sending",className:"inline-flex items-center gap-3 rounded-lg px-8 py-4 text-sm font-bold uppercase tracking-[3px] transition-[filter,box-shadow] hover:brightness-110 disabled:opacity-60",style:{background:"var(--kf-accent)",color:"var(--kf-btntext)",boxShadow:"0 10px 24px rgba(150,200,20,0.32)"},children:[c.jsx(Y2,{className:"h-[18px] w-[18px]"}),l(x==="sending"?"contactPage.sending":"contactPage.submit")]}),c.jsx("div",{className:"text-[13px]",style:{color:"var(--kf-label)"},children:l("contactPage.requiredHint")})]})]})]})}),c.jsxs("div",{className:"flex flex-col gap-6",children:[c.jsxs("div",{className:"relative overflow-hidden rounded-2xl border px-[22px] py-[26px] sm:px-8 sm:py-[34px]",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[c.jsx("div",{className:"pointer-events-none absolute -right-[60px] -top-[60px] h-[190px] w-[190px] rounded-full border border-dashed",style:{borderColor:"var(--kf-pkgbrd)"}}),c.jsx("h2",{className:"mb-7 text-[17px]",style:{...$c,color:"var(--kf-text)"},children:l("contactPage.cardTitle")}),c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:c.jsx(jx,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.phone")}),c.jsx("a",{href:`tel:${oj(e)}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:e})]})]}),c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:c.jsx(Cx,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.email")}),c.jsx("a",{href:`mailto:${r}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:r})]})]}),c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:c.jsx(X2,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.address")}),c.jsxs("div",{className:"text-base font-semibold leading-[1.4]",style:{color:"var(--kf-text2)"},children:[s,c.jsx("br",{}),[i,o].filter(Boolean).join(" ")]})]})]}),n&&c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:c.jsx(pO,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),c.jsxs("div",{children:[c.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("nav.whatsapp")}),c.jsx("a",{href:fO(n),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:n})]})]})]}),c.jsxs("div",{className:"mt-7 border-t pt-6",style:{borderColor:"var(--kf-divider)"},children:[c.jsx("div",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:l("contactPage.hours")}),c.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-[15px]",children:m.map(I=>c.jsxs("span",{style:{display:"contents"},children:[c.jsx("span",{style:{color:"var(--kf-label)"},children:I.days}),c.jsx("span",{children:I.label})]},I.key))})]})]}),c.jsxs("div",{className:"relative overflow-hidden rounded-2xl border",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[d.external&&c.jsxs("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"absolute left-3.5 top-3.5 z-10 inline-flex items-center gap-2 rounded-lg border px-3.5 py-2 text-[13px] font-semibold hover:border-[var(--kf-accent)]",style:{background:"var(--kf-pill)",borderColor:"var(--kf-pillbrd)",color:"var(--kf-text2)",boxShadow:"var(--kf-shadow2)"},children:[l("contactPage.mapOpenChip"),c.jsx(Z2,{className:"h-3.5 w-3.5",style:{color:"var(--kf-accent2)"}})]}),c.jsx(hO,{name:l("contactPage.mapEmbedName"),className:"h-[210px] w-full",children:c.jsx("div",{className:"h-[210px] overflow-hidden",children:c.jsx("iframe",{title:"HifiPlanet Amorbach – Standort",src:`https://www.google.com/maps?q=${f}&output=embed`,width:"100%",height:"290",style:{border:0,display:"block",marginTop:"-60px"},loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"})})}),c.jsxs("a",{href:p,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2.5 border-t px-4 py-4 text-[13px] font-bold uppercase tracking-[3px] hover:bg-[var(--kf-accentsoft)]",style:{borderColor:"var(--kf-divider)",color:"var(--kf-accent2)"},children:[l("contactPage.routePlan")," →"]})]})]})]}),c.jsx("div",{className:"mt-10 grid grid-cols-1 overflow-hidden rounded-2xl border min-[641px]:grid-cols-2 min-[901px]:grid-cols-4",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow2)"},children:_.map(I=>c.jsxs("div",{className:"flex items-center gap-4 border-b p-6 last:border-b-0 min-[641px]:border-b-0 min-[641px]:border-r min-[641px]:last:border-r-0",style:{borderColor:"var(--kf-divider)"},children:[c.jsx("div",{className:"flex h-[46px] w-[46px] flex-shrink-0 items-center justify-center rounded-full border-[1.5px]",style:{borderColor:"var(--kf-pkgbrd)",color:"var(--kf-accent2)"},children:c.jsx(mO,{path:gO[I.key],className:"h-[22px] w-[22px]"})}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[15px] font-bold",style:{color:"var(--kf-text)"},children:I.title}),c.jsx("div",{className:"mt-0.5 text-[13px]",style:{color:"var(--kf-muted)"},children:I.sub})]})]},I.key))})]})})}function yO(){const[t,e]=v.useState(null);return v.useEffect(()=>{A.get("/legal-pages/impressum").then(e).catch(()=>{})},[]),Wt({title:(t==null?void 0:t.title)||"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG.",path:"/impressum"}),t?c.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[c.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:t.title}),c.jsx("div",{className:"legal-content text-sm text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:t.body_html}})]}):null}function bO(){const[t,e]=v.useState(null);return v.useEffect(()=>{A.get("/legal-pages/datenschutz").then(e).catch(()=>{})},[]),Wt({title:(t==null?void 0:t.title)||"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO.",path:"/datenschutz"}),t?c.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[c.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:t.title}),c.jsx("div",{className:"legal-content text-sm text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:t.body_html}})]}):null}function vO(){const[t,e]=v.useState(null);return v.useEffect(()=>{A.get("/legal-pages/agb").then(e).catch(()=>{})},[]),Wt({title:(t==null?void 0:t.title)||"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach.",path:"/agb"}),t?c.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[c.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:t.title}),c.jsx("div",{className:"legal-content text-sm text-neutral-600 dark:text-neutral-300",dangerouslySetInnerHTML:{__html:t.body_html}})]}):null}const kO={host:"",name:"",user:"",password:"",charset:"utf8mb4"},wO={username:"",password:"",password_confirmation:""};function SO(){Wt({title:"Ersteinrichtung",path:"/setup"});const[t,e]=v.useState("loading"),[n,r]=v.useState(""),[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(kO),[d,h]=v.useState(wO),[f,p]=v.useState(null),m=()=>A.get("/setup/status").then(S=>(S.needs_setup?S.steps.admin.ok?e("done"):S.steps.schema.ok?e("admin"):e(S.steps.database.ok?"schema":"database"):e("locked"),S));v.useEffect(()=>{A.get("/setup/status").then(S=>e(S.needs_setup?"password":"locked")).catch(()=>e("locked"))},[]);const g=async S=>{S.preventDefault(),r(""),i(!0);try{await A.post("/setup/verify-password",{password:o}),await m()}catch(N){r(N.message)}finally{i(!1)}},y=async S=>{S.preventDefault(),r(""),i(!0);try{await A.post("/setup/database",l),await m()}catch(N){r(N.message)}finally{i(!1)}},b=async()=>{r(""),i(!0);try{const S=await A.post("/setup/migrate",{});p(S.actions),S.status.steps.schema.ok&&e("admin")}catch(S){r(S.message)}finally{i(!1)}},x=async S=>{if(S.preventDefault(),r(""),d.password!==d.password_confirmation){r("Die Passwörter stimmen nicht überein");return}i(!0);try{await A.post("/setup/admin",d),e("done")}catch(N){r(N.message)}finally{i(!1)}},k="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900",w="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",C=[{key:"database",label:"Datenbank"},{key:"schema",label:"Struktur"},{key:"admin",label:"Admin-Account"}],E=C.findIndex(S=>S.key===t);return c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 py-12 dark:bg-neutral-950",children:[c.jsx("img",{src:Ka,alt:"HifiPlanet",className:"h-16 w-auto sm:h-20"}),c.jsxs("div",{className:"w-full max-w-md rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[t==="loading"&&c.jsx("p",{className:"text-center text-sm text-neutral-400",children:"Lädt…"}),t==="locked"&&c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bereits eingerichtet"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Seite wurde bereits vollständig eingerichtet. Der Assistent ist deshalb gesperrt."}),c.jsx(ee,{to:"/admin/login",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Zum Login"})]}),["database","schema","admin"].includes(t)&&c.jsx("div",{className:"mb-6 flex items-center justify-center gap-2",children:C.map((S,N)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-semibold ${Na(S.target.value),required:!0,autoFocus:!0,className:k})]}),n&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),c.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Prüfe…":"Weiter"})]}),t==="database"&&c.jsxs("form",{onSubmit:y,children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Trage die Zugangsdaten der Datenbank auf diesem Server ein. Die Verbindung wird vor dem Speichern getestet."}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Host *"}),c.jsx("input",{required:!0,value:l.host,onChange:S=>u({...l,host:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Datenbankname *"}),c.jsx("input",{required:!0,value:l.name,onChange:S=>u({...l,name:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Benutzer *"}),c.jsx("input",{required:!0,value:l.user,onChange:S=>u({...l,user:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Passwort"}),c.jsx("input",{type:"password",value:l.password,onChange:S=>u({...l,password:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-6",children:[c.jsx("label",{className:w,children:"Zeichensatz"}),c.jsx("input",{value:l.charset,onChange:S=>u({...l,charset:S.target.value}),className:k})]}),n&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),c.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Teste Verbindung…":"Verbindung testen & speichern"})]}),t==="schema"&&c.jsxs("div",{children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Datenbankverbindung funktioniert. Jetzt legen wir die benötigten Tabellen an."}),f&&c.jsx("ul",{className:"mb-4 space-y-1 rounded-md bg-neutral-50 p-3 text-sm text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:f.map((S,N)=>c.jsx("li",{children:S},N))}),n&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),c.jsx("button",{type:"button",onClick:b,disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Richte ein…":"Datenbankstruktur einrichten"})]}),t==="admin"&&c.jsxs("form",{onSubmit:x,children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Erster Admin-Account"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Lege den ersten Super-Admin-Account an, mit dem du dich anschließend einloggen kannst."}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Benutzername"}),c.jsx("input",{required:!0,autoFocus:!0,value:d.username,onChange:S=>h({...d,username:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-3",children:[c.jsx("label",{className:w,children:"Passwort"}),c.jsx("input",{type:"password",required:!0,minLength:8,value:d.password,onChange:S=>h({...d,password:S.target.value}),className:k})]}),c.jsxs("div",{className:"mb-6",children:[c.jsx("label",{className:w,children:"Passwort wiederholen"}),c.jsx("input",{type:"password",required:!0,minLength:8,value:d.password_confirmation,onChange:S=>h({...d,password_confirmation:S.target.value}),className:k})]}),n&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),c.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Lege an…":"Admin-Account anlegen"})]}),t==="done"&&c.jsxs("div",{className:"text-center",children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Fertig!"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Ersteinrichtung ist abgeschlossen. Du kannst dich jetzt mit deinem neuen Admin-Account anmelden."}),c.jsx(ee,{to:"/admin/login",className:"inline-block w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Zum Login"})]})]})]})}function NO(){const{user:t,login:e,verifyTwoFactor:n}=Cn(),r=pl(),[s,i]=v.useState("credentials"),[o,a]=v.useState(""),[l,u]=v.useState(""),[d,h]=v.useState(""),[f,p]=v.useState(""),[m,g]=v.useState(!1);if(t)return c.jsx(Ua,{to:"/admin",replace:!0});const y=async x=>{x.preventDefault(),g(!0),p("");try{(await e(o,l)).requires2fa?i("code"):r("/admin")}catch(k){p(k.message)}finally{g(!1)}},b=async x=>{x.preventDefault(),g(!0),p("");try{await n(d),r("/admin")}catch(k){p(k.message)}finally{g(!1)}};return c.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[c.jsx("img",{src:Ka,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),c.jsx("img",{src:Su,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),s==="credentials"?c.jsxs("form",{onSubmit:y,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),c.jsx("input",{value:o,onChange:x=>a(x.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"mb-6",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),c.jsx("input",{type:"password",value:l,onChange:x=>u(x.target.value),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),f&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:f}),c.jsx("button",{type:"submit",disabled:m,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:m?"Anmelden…":"Anmelden"})]}):c.jsxs("form",{onSubmit:b,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Öffne die Google Authenticator App und gib den 6-stelligen Code ein. Alternativ kannst du auch einen deiner Wiederherstellungscodes verwenden."}),c.jsxs("div",{className:"mb-6",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),c.jsx("input",{value:d,onChange:x=>h(x.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),f&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:f}),c.jsx("button",{type:"submit",disabled:m,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:m?"Prüfe…":"Bestätigen"}),c.jsx("button",{type:"button",onClick:()=>{i("credentials"),h(""),p("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}const CO={tag:"M4 4h7l9 9-7 7-9-9V4Zm3.5 3.5h.01",car:"M3 13.5 4.5 9A2 2 0 0 1 6.4 7.5h11.2A2 2 0 0 1 19.5 9L21 13.5M3 13.5v4a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1h12v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-4M3 13.5h18M6.5 16.5h.01M17.5 16.5h.01",box:"M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Zm0 9 8-4.5M12 12v9M12 12 4 7.5",mail:"M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm0 0 8 7 8-7"},jO=({path:t,className:e="h-6 w-6"})=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:e,children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:t})});function EO(){const[t,e]=v.useState(null),[n,r]=v.useState("");if(v.useEffect(()=>{A.get("/analytics/report").then(e).catch(i=>r(i.message))},[]),n)return c.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),c.jsx("p",{className:"text-sm text-red-600",children:n})]});if(!t)return null;if(!t.configured)return c.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),c.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Noch nicht eingerichtet. Unter"," ",c.jsx(ee,{to:"/admin/settings/website",className:"text-brand-600 hover:underline dark:text-brand-400",children:"Einstellungen → Website"})," ","kannst du die Dashboard-Anbindung konfigurieren, um hier Besucherzahlen zu sehen."]})]});const s=Math.max(1,...t.daily.map(i=>i.pageviews));return c.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),c.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Letzte 7 Tage."}),c.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:t.totals.users}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Nutzer"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:t.totals.sessions}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Sitzungen"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:t.totals.pageviews}),c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Seitenaufrufe"})]})]}),t.daily.length>0&&c.jsx("div",{className:"mb-6 flex h-24 items-end gap-1.5",children:t.daily.map(i=>c.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[c.jsx("div",{className:"w-full rounded-t bg-brand-400 dark:bg-brand-500",style:{height:`${Math.max(4,i.pageviews/s*80)}px`},title:`${i.date}: ${i.pageviews} Seitenaufrufe`}),c.jsxs("span",{className:"text-[10px] text-neutral-400",children:[i.date.slice(6,8),".",i.date.slice(4,6),"."]})]},i.date))}),t.top_pages.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Meistbesuchte Seiten"}),c.jsx("ul",{className:"space-y-1 text-sm",children:t.top_pages.map(i=>c.jsxs("li",{className:"flex items-center justify-between gap-3 text-neutral-700 dark:text-neutral-300",children:[c.jsx("span",{className:"truncate font-mono text-xs",children:i.path}),c.jsx("span",{className:"shrink-0 font-semibold",children:i.pageviews})]},i.path))})]})]})}function TO(){const{user:t,hasPermission:e}=Cn(),[n,r]=v.useState({});v.useEffect(()=>{e("brands.manage")&&A.get("/brands").then(i=>r(o=>({...o,brands:i.length}))),(e("models.manage")||e("packages.manage"))&&A.get("/models").then(i=>r(o=>({...o,models:i.length}))),e("packages.manage")&&A.get("/packages").then(i=>r(o=>({...o,packages:i.length}))),e("contact.manage")&&A.get("/contact").then(i=>r(o=>({...o,newContacts:i.filter(a=>a.status==="new").length})))},[]);const s=[{key:"brands",label:"Marken",icon:"tag",hint:"Die Hersteller, z. B. Audi oder BMW.",value:n.brands,to:"/admin/brands",show:e("brands.manage")},{key:"models",label:"Modelle",icon:"car",hint:"Die Fahrzeuge einer Marke, z. B. A4.",value:n.models,to:"/admin/models",show:e("models.manage")},{key:"packages",label:"Pakete",icon:"box",hint:"Die Sound-Pakete für ein Modell.",value:n.packages,to:"/admin/packages",show:e("packages.manage")},{key:"contacts",label:"Neue Anfragen",icon:"mail",hint:"Kunden, die noch auf Antwort warten.",value:n.newContacts,to:"/admin/contact-requests",show:e("contact.manage"),highlight:!0}].filter(i=>i.show);return c.jsxs("div",{children:[c.jsxs("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:["Willkommen, ",t==null?void 0:t.username,"!"]}),c.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Hier siehst du auf einen Blick, wie viel in deinem Shop hinterlegt ist. Klicke auf eine Kachel, um dorthin zu gelangen."}),s.length===0?c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:"Für deinen Account sind noch keine Bereiche freigeschaltet. Bitte wende dich an einen Administrator."}):c.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:s.map(i=>c.jsxs(ee,{to:i.to,className:`rounded-xl border p-5 shadow-sm transition hover:-translate-y-0.5 hover:shadow-md ${i.highlight&&i.value>0?"border-brand-300 bg-brand-50 dark:border-brand-900 dark:bg-brand-900/20":"border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900"}`,children:[c.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:c.jsx(jO,{path:CO[i.icon]})}),c.jsx("p",{className:"text-sm font-semibold text-neutral-700 dark:text-neutral-200",children:i.label}),c.jsx("p",{className:"mt-1 text-3xl font-extrabold text-brand-600 dark:text-brand-400",children:i.value??"…"}),c.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:i.hint})]},i.key))}),e("settings.manage")&&c.jsx(EO,{})]})}var jv=!1,bs,vm,km,Hc,Wc,aj,Uc,wm,Sm,Nm,lj,Cm,jm,cj,uj;function Ct(){if(!jv){jv=!0;var t=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),n=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(Cm=/\b(iPhone|iP[ao]d)/.exec(t),jm=/\b(iP[ao]d)/.exec(t),Nm=/Android/i.exec(t),cj=/FBAN\/\w+;/i.exec(t),uj=/Mobile/i.exec(t),lj=!!/Win64/.exec(t),e){bs=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,bs&&document&&document.documentMode&&(bs=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(t);aj=r?parseFloat(r[1])+4:bs,vm=e[2]?parseFloat(e[2]):NaN,km=e[3]?parseFloat(e[3]):NaN,Hc=e[4]?parseFloat(e[4]):NaN,Hc?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),Wc=e&&e[1]?parseFloat(e[1]):NaN):Wc=NaN}else bs=vm=km=Wc=Hc=NaN;if(n){if(n[1]){var s=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);Uc=s?parseFloat(s[1].replace("_",".")):!0}else Uc=!1;wm=!!n[2],Sm=!!n[3]}else Uc=wm=Sm=!1}}var Em={ie:function(){return Ct()||bs},ieCompatibilityMode:function(){return Ct()||aj>bs},ie64:function(){return Em.ie()&&lj},firefox:function(){return Ct()||vm},opera:function(){return Ct()||km},webkit:function(){return Ct()||Hc},safari:function(){return Em.webkit()},chrome:function(){return Ct()||Wc},windows:function(){return Ct()||wm},osx:function(){return Ct()||Uc},linux:function(){return Ct()||Sm},iphone:function(){return Ct()||Cm},mobile:function(){return Ct()||Cm||jm||Nm||uj},nativeApp:function(){return Ct()||cj},android:function(){return Ct()||Nm},ipad:function(){return Ct()||jm}},MO=Em,PO=!!(typeof window<"u"&&window.document&&window.document.createElement),AO={canUseDOM:PO},DO=AO,dj=DO,hj;dj.canUseDOM&&(hj=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, @@ -78,7 +78,7 @@ Error generating stack: `+i.message+` * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT - */function DO(t,e){if(!uj.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var s=document.createElement("div");s.setAttribute(n,"return;"),r=typeof s[n]=="function"}return!r&&dj&&t==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var LO=DO,RO=TO,_O=LO,jv=10,Ev=40,Tv=800;function hj(t){var e=0,n=0,r=0,s=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=e*jv,s=n*jv,"deltaY"in t&&(s=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||s)&&t.deltaMode&&(t.deltaMode==1?(r*=Ev,s*=Ev):(r*=Tv,s*=Tv)),r&&!e&&(e=r<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:s}}hj.getEventType=function(){return RO.firefox()?"DOMMouseScroll":_O("wheel")?"wheel":"mousewheel"};var IO=hj,OO=IO;const BO=Bw(OO);function Xa(t){"@babel/helpers - typeof";return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xa(t)}function zO(t,e){if(Xa(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function FO(t){var e=zO(t,"string");return Xa(e)=="symbol"?e:e+""}function VO(t,e,n){return(e=FO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Ke(t){for(var e=1;eu*s?{width:u*s,height:u}:{width:l,height:l/s}}function HO(t){return t.width>t.height?t.width/t.naturalWidth:t.height/t.naturalHeight}function Do(t,e,n,r,s=0){const{width:i,height:o}=Zi(e.width,e.height,s);return{x:Pv(t.x,i,n.width,r),y:Pv(t.y,o,n.height,r)}}function Pv(t,e,n,r){const s=Math.abs(e*r/2-n/2);return Qd(t,-s,s)}function Av(t,e){return Math.sqrt(Math.pow(t.y-e.y,2)+Math.pow(t.x-e.x,2))}function Dv(t,e){return Math.atan2(e.y-t.y,e.x-t.x)*180/Math.PI}function WO(t,e,n,r,s,i=0,o=!0){const a=o?UO:KO,l=Zi(e.width,e.height,i),u=Zi(e.naturalWidth,e.naturalHeight,i),d={x:a(100,((l.width-n.width/s)/2-t.x/s)/l.width*100),y:a(100,((l.height-n.height/s)/2-t.y/s)/l.height*100),width:a(100,n.width/l.width*100/s),height:a(100,n.height/l.height*100/s)},h=Math.round(a(u.width,d.width*u.width/100)),f=Math.round(a(u.height,d.height*u.height/100)),p=u.width>=u.height*r?{width:Math.round(f*r),height:f}:{width:h,height:Math.round(h/r)};return{croppedAreaPercentages:d,croppedAreaPixels:Ke(Ke({},p),{},{x:Math.round(a(u.width-p.width,d.x*u.width/100)),y:Math.round(a(u.height-p.height,d.y*u.height/100))})}}function UO(t,e){return Math.min(t,Math.max(0,e))}function KO(t,e){return e}function GO(t,e,n,r,s,i){const o=Zi(e.width,e.height,n),a=Qd(r.width/o.width*(100/t.width),s,i);return{crop:{x:a*o.width/2-r.width/2-o.width*a*(t.x/100),y:a*o.height/2-r.height/2-o.height*a*(t.y/100)},zoom:a}}function qO(t,e,n){const r=HO(e);return n.height>n.width?n.height/(t.height*r):n.width/(t.width*r)}function JO(t,e,n=0,r,s,i){const o=Zi(e.naturalWidth,e.naturalHeight,n),a=Qd(qO(t,e,r),s,i),l=r.height>r.width?r.height/t.height:r.width/t.width;return{crop:{x:((o.width-t.width)/2-t.x)*l,y:((o.height-t.height)/2-t.y)*l},zoom:a}}function Lv(t,e){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function YO(t){return t*Math.PI/180}function Zi(t,e,n){const r=YO(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}function Qd(t,e,n){return Math.min(Math.max(t,e),n)}function rc(...t){return t.filter(e=>typeof e=="string"&&e.length>0).join(" ").trim()}var XO=`.reactEasyCrop_Container { + */function LO(t,e){if(!dj.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,r=n in document;if(!r){var s=document.createElement("div");s.setAttribute(n,"return;"),r=typeof s[n]=="function"}return!r&&hj&&t==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var RO=LO,_O=MO,IO=RO,Ev=10,Tv=40,Mv=800;function fj(t){var e=0,n=0,r=0,s=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=e*Ev,s=n*Ev,"deltaY"in t&&(s=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||s)&&t.deltaMode&&(t.deltaMode==1?(r*=Tv,s*=Tv):(r*=Mv,s*=Mv)),r&&!e&&(e=r<1?-1:1),s&&!n&&(n=s<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:s}}fj.getEventType=function(){return _O.firefox()?"DOMMouseScroll":IO("wheel")?"wheel":"mousewheel"};var OO=fj,BO=OO;const zO=zw(BO);function Xa(t){"@babel/helpers - typeof";return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xa(t)}function FO(t,e){if(Xa(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function VO(t){var e=FO(t,"string");return Xa(e)=="symbol"?e:e+""}function $O(t,e,n){return(e=VO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Ke(t){for(var e=1;eu*s?{width:u*s,height:u}:{width:l,height:l/s}}function WO(t){return t.width>t.height?t.width/t.naturalWidth:t.height/t.naturalHeight}function Do(t,e,n,r,s=0){const{width:i,height:o}=Zi(e.width,e.height,s);return{x:Av(t.x,i,n.width,r),y:Av(t.y,o,n.height,r)}}function Av(t,e,n,r){const s=Math.abs(e*r/2-n/2);return Qd(t,-s,s)}function Dv(t,e){return Math.sqrt(Math.pow(t.y-e.y,2)+Math.pow(t.x-e.x,2))}function Lv(t,e){return Math.atan2(e.y-t.y,e.x-t.x)*180/Math.PI}function UO(t,e,n,r,s,i=0,o=!0){const a=o?KO:GO,l=Zi(e.width,e.height,i),u=Zi(e.naturalWidth,e.naturalHeight,i),d={x:a(100,((l.width-n.width/s)/2-t.x/s)/l.width*100),y:a(100,((l.height-n.height/s)/2-t.y/s)/l.height*100),width:a(100,n.width/l.width*100/s),height:a(100,n.height/l.height*100/s)},h=Math.round(a(u.width,d.width*u.width/100)),f=Math.round(a(u.height,d.height*u.height/100)),p=u.width>=u.height*r?{width:Math.round(f*r),height:f}:{width:h,height:Math.round(h/r)};return{croppedAreaPercentages:d,croppedAreaPixels:Ke(Ke({},p),{},{x:Math.round(a(u.width-p.width,d.x*u.width/100)),y:Math.round(a(u.height-p.height,d.y*u.height/100))})}}function KO(t,e){return Math.min(t,Math.max(0,e))}function GO(t,e){return e}function qO(t,e,n,r,s,i){const o=Zi(e.width,e.height,n),a=Qd(r.width/o.width*(100/t.width),s,i);return{crop:{x:a*o.width/2-r.width/2-o.width*a*(t.x/100),y:a*o.height/2-r.height/2-o.height*a*(t.y/100)},zoom:a}}function JO(t,e,n){const r=WO(e);return n.height>n.width?n.height/(t.height*r):n.width/(t.width*r)}function YO(t,e,n=0,r,s,i){const o=Zi(e.naturalWidth,e.naturalHeight,n),a=Qd(JO(t,e,r),s,i),l=r.height>r.width?r.height/t.height:r.width/t.width;return{crop:{x:((o.width-t.width)/2-t.x)*l,y:((o.height-t.height)/2-t.y)*l},zoom:a}}function Rv(t,e){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function XO(t){return t*Math.PI/180}function Zi(t,e,n){const r=XO(n);return{width:Math.abs(Math.cos(r)*t)+Math.abs(Math.sin(r)*e),height:Math.abs(Math.sin(r)*t)+Math.abs(Math.cos(r)*e)}}function Qd(t,e,n){return Math.min(Math.max(t,e),n)}function rc(...t){return t.filter(e=>typeof e=="string"&&e.length>0).join(" ").trim()}var ZO=`.reactEasyCrop_Container { position: absolute; top: 0; left: 0; @@ -159,9 +159,9 @@ Error generating stack: `+i.message+` border-left: 0; border-right: 0; } -`;const ZO=250,QO=1,e5=3,t5=1;var eh=class dn extends v.Component{constructor(...e){super(...e),this.cropperRef=v.createRef(),this.imageRef=v.createRef(),this.videoRef=v.createRef(),this.containerPosition={x:0,y:0},this.containerRef=null,this.styleRef=null,this.containerRect=null,this.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},this.dragStartPosition={x:0,y:0},this.dragStartCrop={x:0,y:0},this.gestureZoomStart=0,this.gestureRotationStart=0,this.isTouching=!1,this.lastPinchDistance=0,this.lastPinchRotation=0,this.rafDragTimeout=null,this.rafPinchTimeout=null,this.wheelTimer=null,this.resizeEmitTimer=null,this.currentDoc=typeof document<"u"?document:null,this.currentWindow=typeof window<"u"?window:null,this.resizeObserver=null,this.previousCropSize=null,this.isInitialized=!1,this.dragInteractionSource=null,this.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},this.initResizeObserver=()=>{if(typeof window.ResizeObserver>"u"||!this.containerRef)return;let n=!0;this.resizeObserver=new window.ResizeObserver(r=>{if(n){n=!1;return}this.computeSizes({isResizeTriggered:!0})}),this.resizeObserver.observe(this.containerRef)},this.onWindowResize=()=>{this.computeSizes({isResizeTriggered:!0})},this.preventZoomSafari=n=>n.preventDefault(),this.cleanEvents=()=>{this.currentDoc&&(this.currentDoc.removeEventListener("mousemove",this.onMouseMove),this.currentDoc.removeEventListener("mouseup",this.onDragStopped),this.currentDoc.removeEventListener("touchmove",this.onTouchMove),this.currentDoc.removeEventListener("touchend",this.onDragStopped),this.currentDoc.removeEventListener("gesturechange",this.onGestureChange),this.currentDoc.removeEventListener("gestureend",this.onGestureEnd),this.currentDoc.removeEventListener("scroll",this.onScroll))},this.clearScrollEvent=()=>{this.containerRef&&this.containerRef.removeEventListener("wheel",this.onWheel),this.wheelTimer&&clearTimeout(this.wheelTimer)},this.onMediaLoad=()=>{const n=this.computeSizes();n&&(this.previousCropSize=n,this.emitCropData(),this.setInitialCrop(n),this.isInitialized=!0),this.props.onMediaLoaded&&this.props.onMediaLoaded(this.mediaSize)},this.setInitialCrop=n=>{if(this.props.initialCroppedAreaPercentages){const{crop:r,zoom:s}=GO(this.props.initialCroppedAreaPercentages,this.mediaSize,this.props.rotation,n,this.props.minZoom,this.props.maxZoom);this.props.onCropChange(r),this.props.onZoomChange&&this.props.onZoomChange(s)}else if(this.props.initialCroppedAreaPixels){const{crop:r,zoom:s}=JO(this.props.initialCroppedAreaPixels,this.mediaSize,this.props.rotation,n,this.props.minZoom,this.props.maxZoom);this.props.onCropChange(r),this.props.onZoomChange&&this.props.onZoomChange(s)}},this.computeSizes=({isResizeTriggered:n=!1}={})=>{const r=this.imageRef.current||this.videoRef.current;if(r&&this.containerRef){var s,i,o,a,l,u;this.containerRect=this.containerRef.getBoundingClientRect(),this.saveContainerPosition();const d=this.containerRect.width/this.containerRect.height,h=((s=this.imageRef.current)===null||s===void 0?void 0:s.naturalWidth)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,f=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=this.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,p=r.offsetWidthm?{width:this.containerRect.height*m,height:this.containerRect.height}:{width:this.containerRect.width,height:this.containerRect.width/m};break;case"horizontal-cover":g={width:this.containerRect.width,height:this.containerRect.width/m};break;case"vertical-cover":g={width:this.containerRect.height*m,height:this.containerRect.height};break}else g={width:r.offsetWidth,height:r.offsetHeight};this.mediaSize=Ke(Ke({},g),{},{naturalWidth:h,naturalHeight:f}),this.props.setMediaSize&&this.props.setMediaSize(this.mediaSize);const y=this.props.cropSize?this.props.cropSize:$O(this.mediaSize.width,this.mediaSize.height,this.containerRect.width,this.containerRect.height,this.props.aspect,this.props.rotation);return(((l=this.state.cropSize)===null||l===void 0?void 0:l.height)!==y.height||((u=this.state.cropSize)===null||u===void 0?void 0:u.width)!==y.width)&&this.props.onCropSizeChange&&this.props.onCropSizeChange(y),this.setState({cropSize:y},()=>this.recomputeCropPosition({isResizeTriggered:n})),this.props.setCropSize&&this.props.setCropSize(y),y}},this.saveContainerPosition=()=>{if(this.containerRef){const n=this.containerRef.getBoundingClientRect();this.containerPosition={x:n.left,y:n.top}}},this.onMouseDown=n=>{this.currentDoc&&(n.preventDefault(),this.currentDoc.addEventListener("mousemove",this.onMouseMove),this.currentDoc.addEventListener("mouseup",this.onDragStopped),this.saveContainerPosition(),this.onDragStart(dn.getMousePoint(n),"mouse"))},this.onMouseMove=n=>this.onDrag(dn.getMousePoint(n)),this.onScroll=n=>{this.currentDoc&&(n.preventDefault(),this.saveContainerPosition())},this.onTouchStart=n=>{this.currentDoc&&(this.isTouching=!0,!(this.props.onTouchRequest&&!this.props.onTouchRequest(n))&&(this.currentDoc.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.currentDoc.addEventListener("touchend",this.onDragStopped),this.saveContainerPosition(),n.touches.length===2?this.onPinchStart(n):n.touches.length===1&&this.onDragStart(dn.getTouchPoint(n.touches[0]),"touch")))},this.onTouchMove=n=>{n.preventDefault(),n.touches.length===2?this.onPinchMove(n):n.touches.length===1&&this.onDrag(dn.getTouchPoint(n.touches[0]))},this.onGestureStart=n=>{this.currentDoc&&(n.preventDefault(),this.currentDoc.addEventListener("gesturechange",this.onGestureChange),this.currentDoc.addEventListener("gestureend",this.onGestureEnd),this.gestureZoomStart=this.props.zoom,this.gestureRotationStart=this.props.rotation)},this.onGestureChange=n=>{if(n.preventDefault(),this.isTouching)return;const r=dn.getMousePoint(n),s=this.gestureZoomStart-1+n.scale;if(this.setNewZoom(s,r,{shouldUpdatePosition:!0}),this.props.onRotationChange){const i=this.gestureRotationStart+n.rotation;this.props.onRotationChange(i)}},this.onGestureEnd=n=>{this.cleanEvents()},this.onDragStart=({x:n,y:r},s)=>{var i,o;this.dragStartPosition={x:n,y:r},this.dragStartCrop=Ke({},this.props.crop),this.dragInteractionSource=s,(i=(o=this.props).onInteractionStart)===null||i===void 0||i.call(o,{source:s})},this.onDrag=({x:n,y:r})=>{this.currentWindow&&(this.rafDragTimeout&&this.currentWindow.cancelAnimationFrame(this.rafDragTimeout),this.rafDragTimeout=this.currentWindow.requestAnimationFrame(()=>{if(!this.state.cropSize||n===void 0||r===void 0)return;const s=n-this.dragStartPosition.x,i=r-this.dragStartPosition.y,o={x:this.dragStartCrop.x+s,y:this.dragStartCrop.y+i},a=this.props.restrictPosition?Do(o,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):o;this.props.onCropChange(a)}))},this.onDragStopped=()=>{var n,r,s;this.isTouching=!1,this.cleanEvents(),this.emitCropData(),(n=(r=this.props).onInteractionEnd)===null||n===void 0||n.call(r,{source:(s=this.dragInteractionSource)!==null&&s!==void 0?s:"mouse"}),this.dragInteractionSource=null},this.onWheel=n=>{if(!this.currentWindow||this.props.onWheelRequest&&!this.props.onWheelRequest(n))return;n.preventDefault();const r=dn.getMousePoint(n),{pixelY:s}=BO(n),i=this.props.zoom-s*this.props.zoomSpeed/200;this.setNewZoom(i,r,{shouldUpdatePosition:!0}),this.state.hasWheelJustStarted||this.setState({hasWheelJustStarted:!0},()=>{var o,a;return(o=(a=this.props).onInteractionStart)===null||o===void 0?void 0:o.call(a,{source:"wheel"})}),this.wheelTimer&&clearTimeout(this.wheelTimer),this.wheelTimer=this.currentWindow.setTimeout(()=>this.setState({hasWheelJustStarted:!1},()=>{var o,a;return(o=(a=this.props).onInteractionEnd)===null||o===void 0?void 0:o.call(a,{source:"wheel"})}),250)},this.getPointOnContainer=({x:n,y:r},s)=>{if(!this.containerRect)throw new Error("The Cropper is not mounted");return{x:this.containerRect.width/2-(n-s.x),y:this.containerRect.height/2-(r-s.y)}},this.getPointOnMedia=({x:n,y:r})=>{const{crop:s,zoom:i}=this.props;return{x:(n+s.x)/i,y:(r+s.y)/i}},this.setNewZoom=(n,r,{shouldUpdatePosition:s=!0}={})=>{if(!this.state.cropSize||!this.props.onZoomChange)return;const i=Qd(n,this.props.minZoom,this.props.maxZoom);if(s){const o=this.getPointOnContainer(r,this.containerPosition),a=this.getPointOnMedia(o),l={x:a.x*i-o.x,y:a.y*i-o.y},u=this.props.restrictPosition?Do(l,this.mediaSize,this.state.cropSize,i,this.props.rotation):l;this.props.onCropChange(u)}this.props.onZoomChange(i)},this.getCropData=()=>this.state.cropSize?WO(this.props.restrictPosition?Do(this.props.crop,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):this.props.crop,this.mediaSize,this.state.cropSize,this.getAspect(),this.props.zoom,this.props.rotation,this.props.restrictPosition):null,this.emitCropData=()=>{this.resizeEmitTimer&&(clearTimeout(this.resizeEmitTimer),this.resizeEmitTimer=null);const n=this.getCropData();if(!n)return;const{croppedAreaPercentages:r,croppedAreaPixels:s}=n;this.props.onCropComplete&&this.props.onCropComplete(r,s),this.props.onCropAreaChange&&this.props.onCropAreaChange(r,s)},this.emitCropAreaChange=()=>{const n=this.getCropData();if(!n)return;const{croppedAreaPercentages:r,croppedAreaPixels:s}=n;this.props.onCropAreaChange&&this.props.onCropAreaChange(r,s)},this.recomputeCropPosition=({isResizeTriggered:n=!1}={})=>{var r,s;if(!this.state.cropSize)return;let i=this.props.crop;if(this.isInitialized&&(!((r=this.previousCropSize)===null||r===void 0)&&r.width)&&(!((s=this.previousCropSize)===null||s===void 0)&&s.height)&&(Math.abs(this.previousCropSize.width-this.state.cropSize.width)>1e-6||Math.abs(this.previousCropSize.height-this.state.cropSize.height)>1e-6)){const a=this.state.cropSize.width/this.previousCropSize.width,l=this.state.cropSize.height/this.previousCropSize.height;i={x:this.props.crop.x*a,y:this.props.crop.y*l}}const o=this.props.restrictPosition?Do(i,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):i;this.previousCropSize=this.state.cropSize,this.props.onCropChange(o),n?this.debouncedEmitCropData():this.emitCropData()},this.debouncedEmitCropData=()=>{this.currentWindow&&(this.resizeEmitTimer&&clearTimeout(this.resizeEmitTimer),this.resizeEmitTimer=this.currentWindow.setTimeout(()=>{this.emitCropData()},ZO))},this.onKeyDown=n=>{const{crop:r,onCropChange:s,keyboardStep:i,zoom:o,rotation:a}=this.props;let l=i;if(!this.state.cropSize)return;n.shiftKey&&(l*=.2);let u=Ke({},r);switch(n.key){case"ArrowUp":u.y-=l,n.preventDefault();break;case"ArrowDown":u.y+=l,n.preventDefault();break;case"ArrowLeft":u.x-=l,n.preventDefault();break;case"ArrowRight":u.x+=l,n.preventDefault();break;default:return}if(this.props.restrictPosition&&(u=Do(u,this.mediaSize,this.state.cropSize,o,a)),!n.repeat){var d,h;(d=(h=this.props).onInteractionStart)===null||d===void 0||d.call(h,{source:"keyboard"})}s(u)},this.onKeyUp=n=>{var r,s;switch(n.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":n.preventDefault();break;default:return}this.emitCropData(),(r=(s=this.props).onInteractionEnd)===null||r===void 0||r.call(s,{source:"keyboard"})}}componentDidMount(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.onWindowResize),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=XO,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))}componentWillUnmount(){var e;if(!(!this.currentDoc||!this.currentWindow)){if(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.onWindowResize),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.resizeEmitTimer&&clearTimeout(this.resizeEmitTimer),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef){var n;(n=this.styleRef.parentNode)===null||n===void 0||n.removeChild(this.styleRef)}this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()}}componentDidUpdate(e){var n,r,s,i,o,a,l,u;if(e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((n=e.cropSize)===null||n===void 0?void 0:n.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((s=e.cropSize)===null||s===void 0?void 0:s.width)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.width)?this.computeSizes():(((o=e.crop)===null||o===void 0?void 0:o.x)!==((a=this.props.crop)===null||a===void 0?void 0:a.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video){var d;(d=this.videoRef.current)===null||d===void 0||d.load()}const h=this.getObjectFit();h!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:h},this.computeSizes)}getAspect(){const{cropSize:e,aspect:n}=this.props;return e?e.width/e.height:n}getObjectFit(){if(this.props.objectFit==="cover"){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){var e,n,r,s;this.containerRect=this.containerRef.getBoundingClientRect();const i=this.containerRect.width/this.containerRect.height;return(((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((n=this.videoRef.current)===null||n===void 0?void 0:n.videoWidth)||0)/(((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((s=this.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0){const i=Av(n,r),o=this.props.zoom*(i/this.lastPinchDistance);this.setNewZoom(o,s,{shouldUpdatePosition:!1}),this.lastPinchDistance=i;const a=Dv(n,r),l=this.props.rotation+(a-this.lastPinchRotation);this.props.onRotationChange&&this.props.onRotationChange(l),this.lastPinchRotation=a})}render(){var e;const{image:n,video:r,mediaProps:s,cropperProps:i,transform:o,crop:{x:a,y:l},rotation:u,zoom:d,cropShape:h,showGrid:f,roundCropAreaPixels:p,style:{containerStyle:m,cropAreaStyle:g,mediaStyle:y},classes:{containerClassName:b,cropAreaClassName:x,mediaClassName:k}}=this.props,w=(e=this.state.mediaObjectFit)!==null&&e!==void 0?e:this.getObjectFit();return v.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:C=>this.containerRef=C,"data-testid":"container",style:m,className:rc("reactEasyCrop_Container",b)},n?v.createElement("img",Ke(Ke({alt:"",className:rc("reactEasyCrop_Image",w==="contain"&&"reactEasyCrop_Contain",w==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",w==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",k)},s),{},{src:n,ref:this.imageRef,style:Ke(Ke({},y),{},{transform:o||`translate(${a}px, ${l}px) rotate(${u}deg) scale(${d})`}),onLoad:this.onMediaLoad})):r&&v.createElement("video",Ke(Ke({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:rc("reactEasyCrop_Video",w==="contain"&&"reactEasyCrop_Contain",w==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",w==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",k)},s),{},{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Ke(Ke({},y),{},{transform:o||`translate(${a}px, ${l}px) rotate(${u}deg) scale(${d})`}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map(C=>v.createElement("source",Ke({key:C.src},C)))),this.state.cropSize&&v.createElement("div",Ke({ref:this.cropperRef,style:Ke(Ke({},g),{},{width:p?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:p?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:rc("reactEasyCrop_CropArea",h==="round"&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",x)},i)))}};eh.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:e5,minZoom:QO,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:t5};eh.getMousePoint=t=>({x:Number(t.clientX),y:Number(t.clientY)});eh.getTouchPoint=t=>({x:Number(t.clientX),y:Number(t.clientY)});var n5=eh;function r5(t){return new Promise((e,n)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",s=>n(s)),r.crossOrigin="anonymous",r.src=t})}async function s5(t,e,n="image/png"){const r=await r5(t),s=document.createElement("canvas");return s.width=Math.round(e.width),s.height=Math.round(e.height),s.getContext("2d").drawImage(r,e.x,e.y,e.width,e.height,0,0,s.width,s.height),new Promise((o,a)=>{s.toBlob(l=>{if(!l){a(new Error("Zuschneiden fehlgeschlagen"));return}o(l)},n)})}function i5(t){return t==="image/jpeg"?"jpg":t==="image/webp"?"webp":"png"}function tr({value:t,onChange:e,label:n="Bild",aspect:r}){const[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(null),[d,h]=v.useState("image/png"),[f,p]=v.useState({x:0,y:0}),[m,g]=v.useState(1),[y,b]=v.useState(null),[x,k]=v.useState(r||1),w=j=>{h(j.type||"image/png"),p({x:0,y:0}),g(1),b(null),k(r||1),u(URL.createObjectURL(j))},C=j=>{var R;const T=(R=j.target.files)==null?void 0:R[0];j.target.value="",T&&(a(""),w(T))},E=async()=>{if(t){a("");try{const T=await(await fetch(t)).blob();w(T)}catch{a("Bild konnte nicht zum Zuschneiden geladen werden.")}}},S=({width:j,height:T})=>{!r&&j&&T&&k(j/T)},N=()=>{l&&URL.revokeObjectURL(l),u(null)},M=async()=>{if(!(!l||!y)){i(!0),a("");try{const j=await s5(l,y,d),T=new FormData;T.append("file",j,`zugeschnitten.${i5(d)}`);const R=await A.post("/uploads",T);e(R.path),N()}catch(j){a(j.message)}finally{i(!1)}}};return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:n}),c.jsxs("div",{className:"flex items-center gap-3",children:[t&&c.jsxs("div",{className:"relative",children:[c.jsx("img",{src:t,alt:"",className:"h-12 w-12 rounded-md object-cover"}),c.jsx("button",{type:"button",onClick:()=>e(null),title:"Bild entfernen","aria-label":"Bild entfernen",className:"absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-red-600 text-xs font-bold leading-none text-white shadow hover:bg-red-700",children:"×"})]}),c.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp",onChange:C,className:"text-sm"}),t&&c.jsx("button",{type:"button",onClick:E,className:"rounded-md border border-neutral-300 px-2 py-1 text-xs font-medium text-neutral-600 hover:bg-neutral-50 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Zuschneiden"}),s&&c.jsx("span",{className:"text-sm text-neutral-500",children:"Lädt hoch…"})]}),o&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:o}),l&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",children:c.jsxs("div",{className:"w-full max-w-lg rounded-xl bg-white p-4 dark:bg-neutral-900",children:[c.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Bild zuschneiden"}),c.jsx("div",{className:"relative h-80 w-full overflow-hidden rounded-md bg-neutral-800 sm:h-96",children:c.jsx(n5,{image:l,crop:f,zoom:m,aspect:x,onCropChange:p,onZoomChange:g,onCropComplete:(j,T)=>b(T),onMediaLoaded:S})}),c.jsx("input",{type:"range",min:1,max:3,step:.01,value:m,onChange:j=>g(Number(j.target.value)),className:"mt-4 w-full"}),o&&c.jsx("p",{className:"mt-2 text-sm text-red-600",children:o}),c.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:N,disabled:s,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"}),c.jsx("button",{type:"button",onClick:M,disabled:s||!y,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Lädt hoch…":"Übernehmen"})]})]})})]})}const Rv={name:"",image_path:"",sort_order:0};function o5(){const[t,e]=v.useState([]),[n,r]=v.useState(Rv),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/brands").then(e);v.useEffect(()=>{l()},[]);const u=p=>{i(p.id),r({name:p.name,image_path:p.image_path||"",sort_order:p.sort_order})},d=()=>{i(null),r(Rv)},h=async p=>{p.preventDefault(),a("");try{s?await A.put(`/brands/${s}`,n):await A.post("/brands",n),d(),l()}catch(m){a(m.message)}},f=async p=>{confirm("Marke inkl. aller Modelle/Pakete/Produkte wirklich löschen?")&&(await A.delete(`/brands/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Marken"}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Bild"}),c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:p.image_path?c.jsx("img",{src:p.image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:c.jsx(ee,{to:`/marken/${p.slug}`,target:"_blank",className:"hover:text-brand-500",children:p.name})}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Marken angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:n.name,onChange:p=>r({...n,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:n.image_path,onChange:p=>r({...n,image_path:p}),label:"Bild (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const _v={name:"",brand_id:"",image_path:"",sort_order:0};function a5(){const[t,e]=v.useState([]),[n,r]=v.useState([]),[s,i]=v.useState(_v),[o,a]=v.useState(null),[l,u]=v.useState(""),[d,h]=v.useState("all"),f=v.useMemo(()=>d==="all"?t:t.filter(x=>String(x.brand_id)===d),[t,d]),p=()=>{A.get("/models").then(e),A.get("/brands").then(r)};v.useEffect(p,[]);const m=x=>{a(x.id),i({name:x.name,brand_id:x.brand_id,image_path:x.image_path||"",sort_order:x.sort_order})},g=()=>{a(null),i(_v)},y=async x=>{x.preventDefault(),u("");const k={...s,brand_id:Number(s.brand_id)};try{o?await A.put(`/models/${o}`,k):await A.post("/models",k),g(),p()}catch(w){u(w.message)}},b=async x=>{confirm("Modell inkl. aller Pakete/Produkte wirklich löschen?")&&(await A.delete(`/models/${x}`),p())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Modelle"}),c.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[c.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),c.jsxs("select",{value:d,onChange:x=>h(x.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"all",children:"Alle Marken"}),n.map(x=>c.jsx("option",{value:String(x.id),children:x.name},x.id))]}),d!=="all"&&c.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),c.jsxs("span",{className:"text-sm text-neutral-400",children:[f.length," von ",t.length]})]}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Bild"}),c.jsx("th",{className:"px-4 py-2",children:"Marke"}),c.jsx("th",{className:"px-4 py-2",children:"Modell"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[f.map(x=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:x.image_path?c.jsx("img",{src:x.image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),c.jsx("td",{className:"px-4 py-2",children:x.brand_name}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:x.name}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>m(x),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>b(x.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},x.id)),f.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:t.length===0?"Noch keine Modelle angelegt.":"Keine Modelle für diese Marke."})})]})]})})]}),c.jsxs("form",{onSubmit:y,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:o?"Modell bearbeiten":"Neues Modell"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),c.jsxs("select",{required:!0,value:s.brand_id,onChange:x=>i({...s,brand_id:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(x=>c.jsx("option",{value:x.id,children:x.name},x.id))]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Modellname *"}),c.jsx("input",{required:!0,value:s.name,onChange:x=>i({...s,name:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:s.image_path,onChange:x=>i({...s,image_path:x}),label:"Bild (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:s.sort_order,onChange:x=>i({...s,sort_order:Number(x.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o?"Speichern":"Anlegen"}),o&&c.jsx("button",{type:"button",onClick:g,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Iv={name:"",cover_image_path:"",sort_order:0};function l5(){const[t,e]=v.useState([]),[n,r]=v.useState(Iv),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/gallery-brands").then(e);v.useEffect(()=>{l()},[]);const u=p=>{i(p.id),r({name:p.name,cover_image_path:p.cover_image_path||"",sort_order:p.sort_order})},d=()=>{i(null),r(Iv)},h=async p=>{p.preventDefault(),a("");try{s?await A.put(`/gallery-brands/${s}`,n):await A.post("/gallery-brands",n),d(),l()}catch(m){a(m.message)}},f=async p=>{confirm("Marke inkl. aller Projekte/Fotos wirklich löschen?")&&(await A.delete(`/gallery-brands/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Marken"}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Bild"}),c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:p.cover_image_path?c.jsx("img",{src:p.cover_image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:c.jsx(ee,{to:`/galerie/${p.slug}`,target:"_blank",className:"hover:text-brand-500",children:p.name})}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Galerie-Marken angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:n.name,onChange:p=>r({...n,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:n.cover_image_path,onChange:p=>r({...n,cover_image_path:p}),aspect:4/3,label:"Titelbild (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Ov={name:"",gallery_brand_id:"",cover_image_path:"",sort_order:0};function c5(){const[t,e]=v.useState([]),[n,r]=v.useState([]),[s,i]=v.useState(Ov),[o,a]=v.useState(null),[l,u]=v.useState(""),[d,h]=v.useState("all"),f=v.useMemo(()=>d==="all"?t:t.filter(x=>String(x.gallery_brand_id)===d),[t,d]),p=()=>{A.get("/gallery-projects").then(e),A.get("/gallery-brands").then(r)};v.useEffect(p,[]);const m=x=>{a(x.id),i({name:x.name,gallery_brand_id:x.gallery_brand_id,cover_image_path:x.cover_image_path||"",sort_order:x.sort_order})},g=()=>{a(null),i(Ov)},y=async x=>{x.preventDefault(),u("");const k={...s,gallery_brand_id:Number(s.gallery_brand_id)};try{o?await A.put(`/gallery-projects/${o}`,k):await A.post("/gallery-projects",k),g(),p()}catch(w){u(w.message)}},b=async x=>{confirm("Projekt inkl. aller Fotos wirklich löschen?")&&(await A.delete(`/gallery-projects/${x}`),p())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Projekte"}),c.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[c.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),c.jsxs("select",{value:d,onChange:x=>h(x.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"all",children:"Alle Marken"}),n.map(x=>c.jsx("option",{value:String(x.id),children:x.name},x.id))]}),d!=="all"&&c.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),c.jsxs("span",{className:"text-sm text-neutral-400",children:[f.length," von ",t.length]})]}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Marke"}),c.jsx("th",{className:"px-4 py-2",children:"Projekt"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[f.map(x=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:x.brand_name}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:x.name}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx(ee,{to:`/admin/gallery-projects/${x.id}/photos`,className:"mr-3 text-brand-600 hover:underline",children:"Fotos"}),c.jsx("button",{onClick:()=>m(x),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>b(x.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},x.id)),f.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:t.length===0?"Noch keine Projekte angelegt.":"Keine Projekte für diese Marke."})})]})]})})]}),c.jsxs("form",{onSubmit:y,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:o?"Projekt bearbeiten":"Neues Projekt"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),c.jsxs("select",{required:!0,value:s.gallery_brand_id,onChange:x=>i({...s,gallery_brand_id:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(x=>c.jsx("option",{value:x.id,children:x.name},x.id))]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Projektname *"}),c.jsx("input",{required:!0,placeholder:"z. B. Audi TT",value:s.name,onChange:x=>i({...s,name:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:s.cover_image_path,onChange:x=>i({...s,cover_image_path:x}),aspect:4/3,label:"Titelbild (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:s.sort_order,onChange:x=>i({...s,sort_order:Number(x.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o?"Speichern":"Anlegen"}),o&&c.jsx("button",{type:"button",onClick:g,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}function u5(){const{projectId:t}=Qs(),[e,n]=v.useState([]),[r,s]=v.useState(""),[i,o]=v.useState(!1),[a,l]=v.useState(""),u=v.useRef(null),d=()=>A.get(`/gallery-projects/${t}/photos`).then(n);v.useEffect(()=>{d()},[t]);const h=async y=>{const b=Array.from(y.target.files||[]);if(b.length!==0){s(""),o(!0);try{for(let x=0;x{n(x=>x.map(k=>k.id===y.id?{...k,caption:b}:k))},p=(y,b)=>{n(x=>x.map(k=>k.id===y.id?{...k,sort_order:b}:k))},m=async y=>{await A.put(`/gallery-photos/${y.id}`,{caption:y.caption,sort_order:y.sort_order}),d()},g=async y=>{confirm("Foto wirklich entfernen?")&&(await A.delete(`/gallery-photos/${y}`),d())};return c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-sm",children:c.jsx(ee,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Fotos im Projekt"}),c.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),c.jsx("input",{ref:u,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:h,disabled:i,className:"text-sm"}),i&&c.jsx("p",{className:"mt-2 text-sm text-neutral-500",children:a})]}),r&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:r}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:[e.map(y=>c.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("img",{src:y.image_path,alt:y.caption||"",className:"aspect-square w-full object-cover"}),c.jsxs("div",{className:"space-y-2 p-3",children:[c.jsx("input",{value:y.caption||"",onChange:b=>f(y,b.target.value),onBlur:()=>m(y),placeholder:"Bildunterschrift (optional)",className:"w-full rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"number",value:y.sort_order,onChange:b=>p(y,Number(b.target.value)),onBlur:()=>m(y),className:"w-16 rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("button",{onClick:()=>g(y.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]},y.id)),e.length===0&&c.jsx("p",{className:"col-span-full py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})]})}const d5=["Base","Clear","Drive","Prime","Elite","Apex","The Statement","Limitless"],h5=t=>(t+1)*10,sc="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",Tm=t=>({description:t.description||"",markup_type:t.markup_type||"none",markup_value:t.markup_value||0,icon_name:t.icon_name||"",tagline:t.tagline||"",price_text:t.price_text||"",is_featured:!!t.is_featured,sort_order:t.sort_order??0}),f5=t=>({description:"",markup_type:"none",markup_value:0,icon_name:"",tagline:"",price_text:"",is_featured:!1,sort_order:h5(t)}),p5=["description","markup_type","markup_value","icon_name","tagline","price_text","is_featured","sort_order"],gf=t=>{if(!t.existing)return t.checked;const e=Tm(t.existing);return p5.some(n=>n==="is_featured"?!!e[n]!=!!t.form[n]:String(e[n])!==String(t.form[n]))},Lo=(t,e)=>{const n=e.filter(o=>o.car_model_id===t).slice().sort((o,a)=>o.sort_order-a.sort_order||o.name.localeCompare(a.name)),r=new Set,s=d5.map((o,a)=>{const l=n.find(u=>!r.has(u.id)&&u.name.trim().toLowerCase()===o.toLowerCase());return l&&r.add(l.id),{key:`tier-${a}`,tierName:o,existing:l||null,checked:!!l,form:l?Tm(l):f5(a)}}),i=n.filter(o=>!r.has(o.id)).map(o=>({key:`legacy-${o.id}`,tierName:null,existing:o,checked:!0,form:Tm(o)}));return[...s,...i]},m5=t=>{t.target.style.height="auto",t.target.style.height=`${t.target.scrollHeight}px`};function g5(){const[t,e]=v.useState([]),[n,r]=v.useState([]),[s,i]=v.useState(""),[o,a]=v.useState(""),[l,u]=v.useState([]),[d,h]=v.useState({}),[f,p]=v.useState(!1),[m,g]=v.useState(null),[y,b]=v.useState(""),[x,k]=v.useState(!1),[w,C]=v.useState(null),[E,S]=v.useState("all"),[N,M]=v.useState("all"),j=async()=>{const[P,X]=await Promise.all([A.get("/packages"),A.get("/models")]);return e(P),r(X),P};v.useEffect(()=>{j()},[]);const T=v.useMemo(()=>new Map(n.map(P=>[P.id,P])),[n]),R=v.useMemo(()=>{const P=new Map;return n.forEach(X=>{P.has(X.brand_id)||P.set(X.brand_id,X.brand_name)}),Array.from(P,([X,ie])=>({id:X,name:ie})).sort((X,ie)=>X.name.localeCompare(ie.name))},[n]),$=v.useMemo(()=>n.filter(P=>!s||String(P.brand_id)===s).sort((P,X)=>P.name.localeCompare(X.name)),[n,s]),L=o?T.get(Number(o)):null,W=v.useMemo(()=>l.some(gf),[l]),B=()=>!W||confirm("Ungespeicherte Änderungen verwerfen?"),Z=(P,X,ie=t)=>{i(String(P)),a(String(X)),u(Lo(Number(X),ie)),h({}),g(null),b(""),C(null)},_=P=>{B()&&(i(P),a(""),u([]),h({}),g(null),C(null))},I=P=>{if(!B())return;if(!P){a(""),u([]);return}const X=T.get(Number(P));Z(X?X.brand_id:s,P)},V=(P,X)=>u(ie=>ie.map(ct=>ct.key===P?{...ct,checked:X}:ct)),K=(P,X)=>u(ie=>ie.map(ct=>ct.key===P?{...ct,form:{...ct.form,...X}}:ct)),te=P=>({name:P.tierName??P.existing.name,car_model_id:Number(o),...P.form,markup_value:Number(P.form.markup_value),sort_order:Number(P.form.sort_order)}),Se=async()=>{p(!0),g(null);const P={},X=l;let ie=0,ct=0;for(const oe of l)try{oe.existing?gf(oe)&&(await A.put(`/packages/${oe.existing.id}`,te(oe)),ct+=1):oe.checked&&(await A.post("/packages",te(oe)),ie+=1)}catch(Me){P[oe.key]=Me.message}const ke=await j(),ds=Lo(Number(o),ke).map(oe=>{if(!P[oe.key])return oe;const Me=X.find(fs=>fs.key===oe.key);return Me?{...oe,checked:Me.checked,form:Me.form}:oe});u(ds),h(P);const hs=Object.keys(P).length,D=[];ie&&D.push(`${ie} neu angelegt`),ct&&D.push(`${ct} aktualisiert`),!D.length&&!hs&&D.push("Keine Änderungen"),g(hs?{kind:"error",text:`${D.join(", ")||"Nichts gespeichert"} – ${hs} Paket(e) fehlgeschlagen (Details an der Zeile).`}:{kind:"ok",text:`${D.join(", ")}.`}),p(!1)},se=async P=>{if(!confirm(`Paket "${P.tierName??P.existing.name}" inkl. aller Produkte wirklich löschen?`))return;await A.delete(`/packages/${P.existing.id}`);const X=await j();u(Lo(Number(o),X)),g(null)},he=async P=>{if(!confirm("Paket inkl. aller Produkte wirklich löschen?"))return;await A.delete(`/packages/${P.id}`);const X=await j();o&&u(Lo(Number(o),X))},Te=async()=>{if(!y||!B())return;const P=T.get(Number(y)),X=T.get(Number(o));if(confirm(`Alle Pakete von "${P.brand_name} ${P.name}" inkl. verknüpfter Produkte nach "${X.brand_name} ${X.name}" kopieren? +`;const QO=250,e5=1,t5=3,n5=1;var eh=class dn extends v.Component{constructor(...e){super(...e),this.cropperRef=v.createRef(),this.imageRef=v.createRef(),this.videoRef=v.createRef(),this.containerPosition={x:0,y:0},this.containerRef=null,this.styleRef=null,this.containerRect=null,this.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},this.dragStartPosition={x:0,y:0},this.dragStartCrop={x:0,y:0},this.gestureZoomStart=0,this.gestureRotationStart=0,this.isTouching=!1,this.lastPinchDistance=0,this.lastPinchRotation=0,this.rafDragTimeout=null,this.rafPinchTimeout=null,this.wheelTimer=null,this.resizeEmitTimer=null,this.currentDoc=typeof document<"u"?document:null,this.currentWindow=typeof window<"u"?window:null,this.resizeObserver=null,this.previousCropSize=null,this.isInitialized=!1,this.dragInteractionSource=null,this.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},this.initResizeObserver=()=>{if(typeof window.ResizeObserver>"u"||!this.containerRef)return;let n=!0;this.resizeObserver=new window.ResizeObserver(r=>{if(n){n=!1;return}this.computeSizes({isResizeTriggered:!0})}),this.resizeObserver.observe(this.containerRef)},this.onWindowResize=()=>{this.computeSizes({isResizeTriggered:!0})},this.preventZoomSafari=n=>n.preventDefault(),this.cleanEvents=()=>{this.currentDoc&&(this.currentDoc.removeEventListener("mousemove",this.onMouseMove),this.currentDoc.removeEventListener("mouseup",this.onDragStopped),this.currentDoc.removeEventListener("touchmove",this.onTouchMove),this.currentDoc.removeEventListener("touchend",this.onDragStopped),this.currentDoc.removeEventListener("gesturechange",this.onGestureChange),this.currentDoc.removeEventListener("gestureend",this.onGestureEnd),this.currentDoc.removeEventListener("scroll",this.onScroll))},this.clearScrollEvent=()=>{this.containerRef&&this.containerRef.removeEventListener("wheel",this.onWheel),this.wheelTimer&&clearTimeout(this.wheelTimer)},this.onMediaLoad=()=>{const n=this.computeSizes();n&&(this.previousCropSize=n,this.emitCropData(),this.setInitialCrop(n),this.isInitialized=!0),this.props.onMediaLoaded&&this.props.onMediaLoaded(this.mediaSize)},this.setInitialCrop=n=>{if(this.props.initialCroppedAreaPercentages){const{crop:r,zoom:s}=qO(this.props.initialCroppedAreaPercentages,this.mediaSize,this.props.rotation,n,this.props.minZoom,this.props.maxZoom);this.props.onCropChange(r),this.props.onZoomChange&&this.props.onZoomChange(s)}else if(this.props.initialCroppedAreaPixels){const{crop:r,zoom:s}=YO(this.props.initialCroppedAreaPixels,this.mediaSize,this.props.rotation,n,this.props.minZoom,this.props.maxZoom);this.props.onCropChange(r),this.props.onZoomChange&&this.props.onZoomChange(s)}},this.computeSizes=({isResizeTriggered:n=!1}={})=>{const r=this.imageRef.current||this.videoRef.current;if(r&&this.containerRef){var s,i,o,a,l,u;this.containerRect=this.containerRef.getBoundingClientRect(),this.saveContainerPosition();const d=this.containerRect.width/this.containerRect.height,h=((s=this.imageRef.current)===null||s===void 0?void 0:s.naturalWidth)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,f=((o=this.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=this.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,p=r.offsetWidthm?{width:this.containerRect.height*m,height:this.containerRect.height}:{width:this.containerRect.width,height:this.containerRect.width/m};break;case"horizontal-cover":g={width:this.containerRect.width,height:this.containerRect.width/m};break;case"vertical-cover":g={width:this.containerRect.height*m,height:this.containerRect.height};break}else g={width:r.offsetWidth,height:r.offsetHeight};this.mediaSize=Ke(Ke({},g),{},{naturalWidth:h,naturalHeight:f}),this.props.setMediaSize&&this.props.setMediaSize(this.mediaSize);const y=this.props.cropSize?this.props.cropSize:HO(this.mediaSize.width,this.mediaSize.height,this.containerRect.width,this.containerRect.height,this.props.aspect,this.props.rotation);return(((l=this.state.cropSize)===null||l===void 0?void 0:l.height)!==y.height||((u=this.state.cropSize)===null||u===void 0?void 0:u.width)!==y.width)&&this.props.onCropSizeChange&&this.props.onCropSizeChange(y),this.setState({cropSize:y},()=>this.recomputeCropPosition({isResizeTriggered:n})),this.props.setCropSize&&this.props.setCropSize(y),y}},this.saveContainerPosition=()=>{if(this.containerRef){const n=this.containerRef.getBoundingClientRect();this.containerPosition={x:n.left,y:n.top}}},this.onMouseDown=n=>{this.currentDoc&&(n.preventDefault(),this.currentDoc.addEventListener("mousemove",this.onMouseMove),this.currentDoc.addEventListener("mouseup",this.onDragStopped),this.saveContainerPosition(),this.onDragStart(dn.getMousePoint(n),"mouse"))},this.onMouseMove=n=>this.onDrag(dn.getMousePoint(n)),this.onScroll=n=>{this.currentDoc&&(n.preventDefault(),this.saveContainerPosition())},this.onTouchStart=n=>{this.currentDoc&&(this.isTouching=!0,!(this.props.onTouchRequest&&!this.props.onTouchRequest(n))&&(this.currentDoc.addEventListener("touchmove",this.onTouchMove,{passive:!1}),this.currentDoc.addEventListener("touchend",this.onDragStopped),this.saveContainerPosition(),n.touches.length===2?this.onPinchStart(n):n.touches.length===1&&this.onDragStart(dn.getTouchPoint(n.touches[0]),"touch")))},this.onTouchMove=n=>{n.preventDefault(),n.touches.length===2?this.onPinchMove(n):n.touches.length===1&&this.onDrag(dn.getTouchPoint(n.touches[0]))},this.onGestureStart=n=>{this.currentDoc&&(n.preventDefault(),this.currentDoc.addEventListener("gesturechange",this.onGestureChange),this.currentDoc.addEventListener("gestureend",this.onGestureEnd),this.gestureZoomStart=this.props.zoom,this.gestureRotationStart=this.props.rotation)},this.onGestureChange=n=>{if(n.preventDefault(),this.isTouching)return;const r=dn.getMousePoint(n),s=this.gestureZoomStart-1+n.scale;if(this.setNewZoom(s,r,{shouldUpdatePosition:!0}),this.props.onRotationChange){const i=this.gestureRotationStart+n.rotation;this.props.onRotationChange(i)}},this.onGestureEnd=n=>{this.cleanEvents()},this.onDragStart=({x:n,y:r},s)=>{var i,o;this.dragStartPosition={x:n,y:r},this.dragStartCrop=Ke({},this.props.crop),this.dragInteractionSource=s,(i=(o=this.props).onInteractionStart)===null||i===void 0||i.call(o,{source:s})},this.onDrag=({x:n,y:r})=>{this.currentWindow&&(this.rafDragTimeout&&this.currentWindow.cancelAnimationFrame(this.rafDragTimeout),this.rafDragTimeout=this.currentWindow.requestAnimationFrame(()=>{if(!this.state.cropSize||n===void 0||r===void 0)return;const s=n-this.dragStartPosition.x,i=r-this.dragStartPosition.y,o={x:this.dragStartCrop.x+s,y:this.dragStartCrop.y+i},a=this.props.restrictPosition?Do(o,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):o;this.props.onCropChange(a)}))},this.onDragStopped=()=>{var n,r,s;this.isTouching=!1,this.cleanEvents(),this.emitCropData(),(n=(r=this.props).onInteractionEnd)===null||n===void 0||n.call(r,{source:(s=this.dragInteractionSource)!==null&&s!==void 0?s:"mouse"}),this.dragInteractionSource=null},this.onWheel=n=>{if(!this.currentWindow||this.props.onWheelRequest&&!this.props.onWheelRequest(n))return;n.preventDefault();const r=dn.getMousePoint(n),{pixelY:s}=zO(n),i=this.props.zoom-s*this.props.zoomSpeed/200;this.setNewZoom(i,r,{shouldUpdatePosition:!0}),this.state.hasWheelJustStarted||this.setState({hasWheelJustStarted:!0},()=>{var o,a;return(o=(a=this.props).onInteractionStart)===null||o===void 0?void 0:o.call(a,{source:"wheel"})}),this.wheelTimer&&clearTimeout(this.wheelTimer),this.wheelTimer=this.currentWindow.setTimeout(()=>this.setState({hasWheelJustStarted:!1},()=>{var o,a;return(o=(a=this.props).onInteractionEnd)===null||o===void 0?void 0:o.call(a,{source:"wheel"})}),250)},this.getPointOnContainer=({x:n,y:r},s)=>{if(!this.containerRect)throw new Error("The Cropper is not mounted");return{x:this.containerRect.width/2-(n-s.x),y:this.containerRect.height/2-(r-s.y)}},this.getPointOnMedia=({x:n,y:r})=>{const{crop:s,zoom:i}=this.props;return{x:(n+s.x)/i,y:(r+s.y)/i}},this.setNewZoom=(n,r,{shouldUpdatePosition:s=!0}={})=>{if(!this.state.cropSize||!this.props.onZoomChange)return;const i=Qd(n,this.props.minZoom,this.props.maxZoom);if(s){const o=this.getPointOnContainer(r,this.containerPosition),a=this.getPointOnMedia(o),l={x:a.x*i-o.x,y:a.y*i-o.y},u=this.props.restrictPosition?Do(l,this.mediaSize,this.state.cropSize,i,this.props.rotation):l;this.props.onCropChange(u)}this.props.onZoomChange(i)},this.getCropData=()=>this.state.cropSize?UO(this.props.restrictPosition?Do(this.props.crop,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):this.props.crop,this.mediaSize,this.state.cropSize,this.getAspect(),this.props.zoom,this.props.rotation,this.props.restrictPosition):null,this.emitCropData=()=>{this.resizeEmitTimer&&(clearTimeout(this.resizeEmitTimer),this.resizeEmitTimer=null);const n=this.getCropData();if(!n)return;const{croppedAreaPercentages:r,croppedAreaPixels:s}=n;this.props.onCropComplete&&this.props.onCropComplete(r,s),this.props.onCropAreaChange&&this.props.onCropAreaChange(r,s)},this.emitCropAreaChange=()=>{const n=this.getCropData();if(!n)return;const{croppedAreaPercentages:r,croppedAreaPixels:s}=n;this.props.onCropAreaChange&&this.props.onCropAreaChange(r,s)},this.recomputeCropPosition=({isResizeTriggered:n=!1}={})=>{var r,s;if(!this.state.cropSize)return;let i=this.props.crop;if(this.isInitialized&&(!((r=this.previousCropSize)===null||r===void 0)&&r.width)&&(!((s=this.previousCropSize)===null||s===void 0)&&s.height)&&(Math.abs(this.previousCropSize.width-this.state.cropSize.width)>1e-6||Math.abs(this.previousCropSize.height-this.state.cropSize.height)>1e-6)){const a=this.state.cropSize.width/this.previousCropSize.width,l=this.state.cropSize.height/this.previousCropSize.height;i={x:this.props.crop.x*a,y:this.props.crop.y*l}}const o=this.props.restrictPosition?Do(i,this.mediaSize,this.state.cropSize,this.props.zoom,this.props.rotation):i;this.previousCropSize=this.state.cropSize,this.props.onCropChange(o),n?this.debouncedEmitCropData():this.emitCropData()},this.debouncedEmitCropData=()=>{this.currentWindow&&(this.resizeEmitTimer&&clearTimeout(this.resizeEmitTimer),this.resizeEmitTimer=this.currentWindow.setTimeout(()=>{this.emitCropData()},QO))},this.onKeyDown=n=>{const{crop:r,onCropChange:s,keyboardStep:i,zoom:o,rotation:a}=this.props;let l=i;if(!this.state.cropSize)return;n.shiftKey&&(l*=.2);let u=Ke({},r);switch(n.key){case"ArrowUp":u.y-=l,n.preventDefault();break;case"ArrowDown":u.y+=l,n.preventDefault();break;case"ArrowLeft":u.x-=l,n.preventDefault();break;case"ArrowRight":u.x+=l,n.preventDefault();break;default:return}if(this.props.restrictPosition&&(u=Do(u,this.mediaSize,this.state.cropSize,o,a)),!n.repeat){var d,h;(d=(h=this.props).onInteractionStart)===null||d===void 0||d.call(h,{source:"keyboard"})}s(u)},this.onKeyUp=n=>{var r,s;switch(n.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":n.preventDefault();break;default:return}this.emitCropData(),(r=(s=this.props).onInteractionEnd)===null||r===void 0||r.call(s,{source:"keyboard"})}}componentDidMount(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver>"u"&&this.currentWindow.addEventListener("resize",this.onWindowResize),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=ZO,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))}componentWillUnmount(){var e;if(!(!this.currentDoc||!this.currentWindow)){if(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.onWindowResize),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.resizeEmitTimer&&clearTimeout(this.resizeEmitTimer),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef){var n;(n=this.styleRef.parentNode)===null||n===void 0||n.removeChild(this.styleRef)}this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()}}componentDidUpdate(e){var n,r,s,i,o,a,l,u;if(e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((n=e.cropSize)===null||n===void 0?void 0:n.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((s=e.cropSize)===null||s===void 0?void 0:s.width)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.width)?this.computeSizes():(((o=e.crop)===null||o===void 0?void 0:o.x)!==((a=this.props.crop)===null||a===void 0?void 0:a.x)||((l=e.crop)===null||l===void 0?void 0:l.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video){var d;(d=this.videoRef.current)===null||d===void 0||d.load()}const h=this.getObjectFit();h!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:h},this.computeSizes)}getAspect(){const{cropSize:e,aspect:n}=this.props;return e?e.width/e.height:n}getObjectFit(){if(this.props.objectFit==="cover"){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){var e,n,r,s;this.containerRect=this.containerRef.getBoundingClientRect();const i=this.containerRect.width/this.containerRect.height;return(((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((n=this.videoRef.current)===null||n===void 0?void 0:n.videoWidth)||0)/(((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((s=this.videoRef.current)===null||s===void 0?void 0:s.videoHeight)||0){const i=Dv(n,r),o=this.props.zoom*(i/this.lastPinchDistance);this.setNewZoom(o,s,{shouldUpdatePosition:!1}),this.lastPinchDistance=i;const a=Lv(n,r),l=this.props.rotation+(a-this.lastPinchRotation);this.props.onRotationChange&&this.props.onRotationChange(l),this.lastPinchRotation=a})}render(){var e;const{image:n,video:r,mediaProps:s,cropperProps:i,transform:o,crop:{x:a,y:l},rotation:u,zoom:d,cropShape:h,showGrid:f,roundCropAreaPixels:p,style:{containerStyle:m,cropAreaStyle:g,mediaStyle:y},classes:{containerClassName:b,cropAreaClassName:x,mediaClassName:k}}=this.props,w=(e=this.state.mediaObjectFit)!==null&&e!==void 0?e:this.getObjectFit();return v.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:C=>this.containerRef=C,"data-testid":"container",style:m,className:rc("reactEasyCrop_Container",b)},n?v.createElement("img",Ke(Ke({alt:"",className:rc("reactEasyCrop_Image",w==="contain"&&"reactEasyCrop_Contain",w==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",w==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",k)},s),{},{src:n,ref:this.imageRef,style:Ke(Ke({},y),{},{transform:o||`translate(${a}px, ${l}px) rotate(${u}deg) scale(${d})`}),onLoad:this.onMediaLoad})):r&&v.createElement("video",Ke(Ke({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:rc("reactEasyCrop_Video",w==="contain"&&"reactEasyCrop_Contain",w==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",w==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",k)},s),{},{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Ke(Ke({},y),{},{transform:o||`translate(${a}px, ${l}px) rotate(${u}deg) scale(${d})`}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map(C=>v.createElement("source",Ke({key:C.src},C)))),this.state.cropSize&&v.createElement("div",Ke({ref:this.cropperRef,style:Ke(Ke({},g),{},{width:p?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:p?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:rc("reactEasyCrop_CropArea",h==="round"&&"reactEasyCrop_CropAreaRound",f&&"reactEasyCrop_CropAreaGrid",x)},i)))}};eh.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:t5,minZoom:e5,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:n5};eh.getMousePoint=t=>({x:Number(t.clientX),y:Number(t.clientY)});eh.getTouchPoint=t=>({x:Number(t.clientX),y:Number(t.clientY)});var r5=eh;function s5(t){return new Promise((e,n)=>{const r=new Image;r.addEventListener("load",()=>e(r)),r.addEventListener("error",s=>n(s)),r.crossOrigin="anonymous",r.src=t})}async function i5(t,e,n="image/png"){const r=await s5(t),s=document.createElement("canvas");return s.width=Math.round(e.width),s.height=Math.round(e.height),s.getContext("2d").drawImage(r,e.x,e.y,e.width,e.height,0,0,s.width,s.height),new Promise((o,a)=>{s.toBlob(l=>{if(!l){a(new Error("Zuschneiden fehlgeschlagen"));return}o(l)},n)})}function o5(t){return t==="image/jpeg"?"jpg":t==="image/webp"?"webp":"png"}function tr({value:t,onChange:e,label:n="Bild",aspect:r}){const[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(null),[d,h]=v.useState("image/png"),[f,p]=v.useState({x:0,y:0}),[m,g]=v.useState(1),[y,b]=v.useState(null),[x,k]=v.useState(r||1),w=j=>{h(j.type||"image/png"),p({x:0,y:0}),g(1),b(null),k(r||1),u(URL.createObjectURL(j))},C=j=>{var R;const T=(R=j.target.files)==null?void 0:R[0];j.target.value="",T&&(a(""),w(T))},E=async()=>{if(t){a("");try{const T=await(await fetch(t)).blob();w(T)}catch{a("Bild konnte nicht zum Zuschneiden geladen werden.")}}},S=({width:j,height:T})=>{!r&&j&&T&&k(j/T)},N=()=>{l&&URL.revokeObjectURL(l),u(null)},M=async()=>{if(!(!l||!y)){i(!0),a("");try{const j=await i5(l,y,d),T=new FormData;T.append("file",j,`zugeschnitten.${o5(d)}`);const R=await A.post("/uploads",T);e(R.path),N()}catch(j){a(j.message)}finally{i(!1)}}};return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:n}),c.jsxs("div",{className:"flex items-center gap-3",children:[t&&c.jsxs("div",{className:"relative",children:[c.jsx("img",{src:t,alt:"",className:"h-12 w-12 rounded-md object-cover"}),c.jsx("button",{type:"button",onClick:()=>e(null),title:"Bild entfernen","aria-label":"Bild entfernen",className:"absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-full bg-red-600 text-xs font-bold leading-none text-white shadow hover:bg-red-700",children:"×"})]}),c.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp",onChange:C,className:"text-sm"}),t&&c.jsx("button",{type:"button",onClick:E,className:"rounded-md border border-neutral-300 px-2 py-1 text-xs font-medium text-neutral-600 hover:bg-neutral-50 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Zuschneiden"}),s&&c.jsx("span",{className:"text-sm text-neutral-500",children:"Lädt hoch…"})]}),o&&c.jsx("p",{className:"mt-1 text-sm text-red-600",children:o}),l&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",children:c.jsxs("div",{className:"w-full max-w-lg rounded-xl bg-white p-4 dark:bg-neutral-900",children:[c.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Bild zuschneiden"}),c.jsx("div",{className:"relative h-80 w-full overflow-hidden rounded-md bg-neutral-800 sm:h-96",children:c.jsx(r5,{image:l,crop:f,zoom:m,aspect:x,onCropChange:p,onZoomChange:g,onCropComplete:(j,T)=>b(T),onMediaLoaded:S})}),c.jsx("input",{type:"range",min:1,max:3,step:.01,value:m,onChange:j=>g(Number(j.target.value)),className:"mt-4 w-full"}),o&&c.jsx("p",{className:"mt-2 text-sm text-red-600",children:o}),c.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:N,disabled:s,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"}),c.jsx("button",{type:"button",onClick:M,disabled:s||!y,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Lädt hoch…":"Übernehmen"})]})]})})]})}const _v={name:"",image_path:"",sort_order:0};function a5(){const[t,e]=v.useState([]),[n,r]=v.useState(_v),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/brands").then(e);v.useEffect(()=>{l()},[]);const u=p=>{i(p.id),r({name:p.name,image_path:p.image_path||"",sort_order:p.sort_order})},d=()=>{i(null),r(_v)},h=async p=>{p.preventDefault(),a("");try{s?await A.put(`/brands/${s}`,n):await A.post("/brands",n),d(),l()}catch(m){a(m.message)}},f=async p=>{confirm("Marke inkl. aller Modelle/Pakete/Produkte wirklich löschen?")&&(await A.delete(`/brands/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Marken"}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Bild"}),c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:p.image_path?c.jsx("img",{src:p.image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:c.jsx(ee,{to:`/marken/${p.slug}`,target:"_blank",className:"hover:text-brand-500",children:p.name})}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Marken angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:n.name,onChange:p=>r({...n,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:n.image_path,onChange:p=>r({...n,image_path:p}),label:"Bild (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Iv={name:"",brand_id:"",image_path:"",sort_order:0};function l5(){const[t,e]=v.useState([]),[n,r]=v.useState([]),[s,i]=v.useState(Iv),[o,a]=v.useState(null),[l,u]=v.useState(""),[d,h]=v.useState("all"),f=v.useMemo(()=>d==="all"?t:t.filter(x=>String(x.brand_id)===d),[t,d]),p=()=>{A.get("/models").then(e),A.get("/brands").then(r)};v.useEffect(p,[]);const m=x=>{a(x.id),i({name:x.name,brand_id:x.brand_id,image_path:x.image_path||"",sort_order:x.sort_order})},g=()=>{a(null),i(Iv)},y=async x=>{x.preventDefault(),u("");const k={...s,brand_id:Number(s.brand_id)};try{o?await A.put(`/models/${o}`,k):await A.post("/models",k),g(),p()}catch(w){u(w.message)}},b=async x=>{confirm("Modell inkl. aller Pakete/Produkte wirklich löschen?")&&(await A.delete(`/models/${x}`),p())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Modelle"}),c.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[c.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),c.jsxs("select",{value:d,onChange:x=>h(x.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"all",children:"Alle Marken"}),n.map(x=>c.jsx("option",{value:String(x.id),children:x.name},x.id))]}),d!=="all"&&c.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),c.jsxs("span",{className:"text-sm text-neutral-400",children:[f.length," von ",t.length]})]}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Bild"}),c.jsx("th",{className:"px-4 py-2",children:"Marke"}),c.jsx("th",{className:"px-4 py-2",children:"Modell"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[f.map(x=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:x.image_path?c.jsx("img",{src:x.image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),c.jsx("td",{className:"px-4 py-2",children:x.brand_name}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:x.name}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>m(x),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>b(x.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},x.id)),f.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:t.length===0?"Noch keine Modelle angelegt.":"Keine Modelle für diese Marke."})})]})]})})]}),c.jsxs("form",{onSubmit:y,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:o?"Modell bearbeiten":"Neues Modell"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),c.jsxs("select",{required:!0,value:s.brand_id,onChange:x=>i({...s,brand_id:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(x=>c.jsx("option",{value:x.id,children:x.name},x.id))]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Modellname *"}),c.jsx("input",{required:!0,value:s.name,onChange:x=>i({...s,name:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:s.image_path,onChange:x=>i({...s,image_path:x}),label:"Bild (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:s.sort_order,onChange:x=>i({...s,sort_order:Number(x.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o?"Speichern":"Anlegen"}),o&&c.jsx("button",{type:"button",onClick:g,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Ov={name:"",cover_image_path:"",sort_order:0};function c5(){const[t,e]=v.useState([]),[n,r]=v.useState(Ov),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/gallery-brands").then(e);v.useEffect(()=>{l()},[]);const u=p=>{i(p.id),r({name:p.name,cover_image_path:p.cover_image_path||"",sort_order:p.sort_order})},d=()=>{i(null),r(Ov)},h=async p=>{p.preventDefault(),a("");try{s?await A.put(`/gallery-brands/${s}`,n):await A.post("/gallery-brands",n),d(),l()}catch(m){a(m.message)}},f=async p=>{confirm("Marke inkl. aller Projekte/Fotos wirklich löschen?")&&(await A.delete(`/gallery-brands/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Marken"}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Bild"}),c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:p.cover_image_path?c.jsx("img",{src:p.cover_image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:c.jsx(ee,{to:`/galerie/${p.slug}`,target:"_blank",className:"hover:text-brand-500",children:p.name})}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Galerie-Marken angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:n.name,onChange:p=>r({...n,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:n.cover_image_path,onChange:p=>r({...n,cover_image_path:p}),aspect:4/3,label:"Titelbild (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Bv={name:"",gallery_brand_id:"",cover_image_path:"",sort_order:0};function u5(){const[t,e]=v.useState([]),[n,r]=v.useState([]),[s,i]=v.useState(Bv),[o,a]=v.useState(null),[l,u]=v.useState(""),[d,h]=v.useState("all"),f=v.useMemo(()=>d==="all"?t:t.filter(x=>String(x.gallery_brand_id)===d),[t,d]),p=()=>{A.get("/gallery-projects").then(e),A.get("/gallery-brands").then(r)};v.useEffect(p,[]);const m=x=>{a(x.id),i({name:x.name,gallery_brand_id:x.gallery_brand_id,cover_image_path:x.cover_image_path||"",sort_order:x.sort_order})},g=()=>{a(null),i(Bv)},y=async x=>{x.preventDefault(),u("");const k={...s,gallery_brand_id:Number(s.gallery_brand_id)};try{o?await A.put(`/gallery-projects/${o}`,k):await A.post("/gallery-projects",k),g(),p()}catch(w){u(w.message)}},b=async x=>{confirm("Projekt inkl. aller Fotos wirklich löschen?")&&(await A.delete(`/gallery-projects/${x}`),p())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Projekte"}),c.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[c.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),c.jsxs("select",{value:d,onChange:x=>h(x.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"all",children:"Alle Marken"}),n.map(x=>c.jsx("option",{value:String(x.id),children:x.name},x.id))]}),d!=="all"&&c.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),c.jsxs("span",{className:"text-sm text-neutral-400",children:[f.length," von ",t.length]})]}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Marke"}),c.jsx("th",{className:"px-4 py-2",children:"Projekt"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[f.map(x=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:x.brand_name}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:x.name}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx(ee,{to:`/admin/gallery-projects/${x.id}/photos`,className:"mr-3 text-brand-600 hover:underline",children:"Fotos"}),c.jsx("button",{onClick:()=>m(x),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>b(x.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},x.id)),f.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:t.length===0?"Noch keine Projekte angelegt.":"Keine Projekte für diese Marke."})})]})]})})]}),c.jsxs("form",{onSubmit:y,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:o?"Projekt bearbeiten":"Neues Projekt"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),c.jsxs("select",{required:!0,value:s.gallery_brand_id,onChange:x=>i({...s,gallery_brand_id:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(x=>c.jsx("option",{value:x.id,children:x.name},x.id))]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Projektname *"}),c.jsx("input",{required:!0,placeholder:"z. B. Audi TT",value:s.name,onChange:x=>i({...s,name:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:s.cover_image_path,onChange:x=>i({...s,cover_image_path:x}),aspect:4/3,label:"Titelbild (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:s.sort_order,onChange:x=>i({...s,sort_order:Number(x.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o?"Speichern":"Anlegen"}),o&&c.jsx("button",{type:"button",onClick:g,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}function d5(){const{projectId:t}=Qs(),[e,n]=v.useState([]),[r,s]=v.useState(""),[i,o]=v.useState(!1),[a,l]=v.useState(""),u=v.useRef(null),d=()=>A.get(`/gallery-projects/${t}/photos`).then(n);v.useEffect(()=>{d()},[t]);const h=async y=>{const b=Array.from(y.target.files||[]);if(b.length!==0){s(""),o(!0);try{for(let x=0;x{n(x=>x.map(k=>k.id===y.id?{...k,caption:b}:k))},p=(y,b)=>{n(x=>x.map(k=>k.id===y.id?{...k,sort_order:b}:k))},m=async y=>{await A.put(`/gallery-photos/${y.id}`,{caption:y.caption,sort_order:y.sort_order}),d()},g=async y=>{confirm("Foto wirklich entfernen?")&&(await A.delete(`/gallery-photos/${y}`),d())};return c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-sm",children:c.jsx(ee,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Fotos im Projekt"}),c.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),c.jsx("input",{ref:u,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:h,disabled:i,className:"text-sm"}),i&&c.jsx("p",{className:"mt-2 text-sm text-neutral-500",children:a})]}),r&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:r}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:[e.map(y=>c.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("img",{src:y.image_path,alt:y.caption||"",className:"aspect-square w-full object-cover"}),c.jsxs("div",{className:"space-y-2 p-3",children:[c.jsx("input",{value:y.caption||"",onChange:b=>f(y,b.target.value),onBlur:()=>m(y),placeholder:"Bildunterschrift (optional)",className:"w-full rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{type:"number",value:y.sort_order,onChange:b=>p(y,Number(b.target.value)),onBlur:()=>m(y),className:"w-16 rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("button",{onClick:()=>g(y.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]},y.id)),e.length===0&&c.jsx("p",{className:"col-span-full py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})]})}const h5=["Base","Clear","Drive","Prime","Elite","Apex","The Statement","Limitless"],f5=t=>(t+1)*10,sc="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",Tm=t=>({description:t.description||"",markup_type:t.markup_type||"none",markup_value:t.markup_value||0,icon_name:t.icon_name||"",tagline:t.tagline||"",price_text:t.price_text||"",is_featured:!!t.is_featured,sort_order:t.sort_order??0}),p5=t=>({description:"",markup_type:"none",markup_value:0,icon_name:"",tagline:"",price_text:"",is_featured:!1,sort_order:f5(t)}),m5=["description","markup_type","markup_value","icon_name","tagline","price_text","is_featured","sort_order"],gf=t=>{if(!t.existing)return t.checked;const e=Tm(t.existing);return m5.some(n=>n==="is_featured"?!!e[n]!=!!t.form[n]:String(e[n])!==String(t.form[n]))},Lo=(t,e)=>{const n=e.filter(o=>o.car_model_id===t).slice().sort((o,a)=>o.sort_order-a.sort_order||o.name.localeCompare(a.name)),r=new Set,s=h5.map((o,a)=>{const l=n.find(u=>!r.has(u.id)&&u.name.trim().toLowerCase()===o.toLowerCase());return l&&r.add(l.id),{key:`tier-${a}`,tierName:o,existing:l||null,checked:!!l,form:l?Tm(l):p5(a)}}),i=n.filter(o=>!r.has(o.id)).map(o=>({key:`legacy-${o.id}`,tierName:null,existing:o,checked:!0,form:Tm(o)}));return[...s,...i]},g5=t=>{t.target.style.height="auto",t.target.style.height=`${t.target.scrollHeight}px`};function x5(){const[t,e]=v.useState([]),[n,r]=v.useState([]),[s,i]=v.useState(""),[o,a]=v.useState(""),[l,u]=v.useState([]),[d,h]=v.useState({}),[f,p]=v.useState(!1),[m,g]=v.useState(null),[y,b]=v.useState(""),[x,k]=v.useState(!1),[w,C]=v.useState(null),[E,S]=v.useState("all"),[N,M]=v.useState("all"),j=async()=>{const[P,X]=await Promise.all([A.get("/packages"),A.get("/models")]);return e(P),r(X),P};v.useEffect(()=>{j()},[]);const T=v.useMemo(()=>new Map(n.map(P=>[P.id,P])),[n]),R=v.useMemo(()=>{const P=new Map;return n.forEach(X=>{P.has(X.brand_id)||P.set(X.brand_id,X.brand_name)}),Array.from(P,([X,ie])=>({id:X,name:ie})).sort((X,ie)=>X.name.localeCompare(ie.name))},[n]),$=v.useMemo(()=>n.filter(P=>!s||String(P.brand_id)===s).sort((P,X)=>P.name.localeCompare(X.name)),[n,s]),L=o?T.get(Number(o)):null,W=v.useMemo(()=>l.some(gf),[l]),B=()=>!W||confirm("Ungespeicherte Änderungen verwerfen?"),Z=(P,X,ie=t)=>{i(String(P)),a(String(X)),u(Lo(Number(X),ie)),h({}),g(null),b(""),C(null)},_=P=>{B()&&(i(P),a(""),u([]),h({}),g(null),C(null))},I=P=>{if(!B())return;if(!P){a(""),u([]);return}const X=T.get(Number(P));Z(X?X.brand_id:s,P)},V=(P,X)=>u(ie=>ie.map(ct=>ct.key===P?{...ct,checked:X}:ct)),K=(P,X)=>u(ie=>ie.map(ct=>ct.key===P?{...ct,form:{...ct.form,...X}}:ct)),te=P=>({name:P.tierName??P.existing.name,car_model_id:Number(o),...P.form,markup_value:Number(P.form.markup_value),sort_order:Number(P.form.sort_order)}),Se=async()=>{p(!0),g(null);const P={},X=l;let ie=0,ct=0;for(const oe of l)try{oe.existing?gf(oe)&&(await A.put(`/packages/${oe.existing.id}`,te(oe)),ct+=1):oe.checked&&(await A.post("/packages",te(oe)),ie+=1)}catch(Me){P[oe.key]=Me.message}const xe=await j(),ds=Lo(Number(o),xe).map(oe=>{if(!P[oe.key])return oe;const Me=X.find(fs=>fs.key===oe.key);return Me?{...oe,checked:Me.checked,form:Me.form}:oe});u(ds),h(P);const hs=Object.keys(P).length,D=[];ie&&D.push(`${ie} neu angelegt`),ct&&D.push(`${ct} aktualisiert`),!D.length&&!hs&&D.push("Keine Änderungen"),g(hs?{kind:"error",text:`${D.join(", ")||"Nichts gespeichert"} – ${hs} Paket(e) fehlgeschlagen (Details an der Zeile).`}:{kind:"ok",text:`${D.join(", ")}.`}),p(!1)},se=async P=>{if(!confirm(`Paket "${P.tierName??P.existing.name}" inkl. aller Produkte wirklich löschen?`))return;await A.delete(`/packages/${P.existing.id}`);const X=await j();u(Lo(Number(o),X)),g(null)},he=async P=>{if(!confirm("Paket inkl. aller Produkte wirklich löschen?"))return;await A.delete(`/packages/${P.id}`);const X=await j();o&&u(Lo(Number(o),X))},Te=async()=>{if(!y||!B())return;const P=T.get(Number(y)),X=T.get(Number(o));if(confirm(`Alle Pakete von "${P.brand_name} ${P.name}" inkl. verknüpfter Produkte nach "${X.brand_name} ${X.name}" kopieren? -Bereits vorhandene Paketstufen werden übersprungen. Upgrades werden nicht mitkopiert.`)){k(!0),C(null);try{const ie=await A.post(`/models/${o}/copy-packages`,{source_model_id:Number(y)}),ct=ie.copied.reduce((hs,D)=>hs+D.products,0),ke=[`${ie.copied.length} Paket(e) kopiert (${ct} Produkte)`];ie.skipped.length&&ke.push(`übersprungen: ${ie.skipped.join(", ")}`),C({text:`${ke.join(" – ")}.`});const ds=await j();u(Lo(Number(o),ds)),h({})}catch(ie){C({error:ie.message})}k(!1)}},lt=l.filter(P=>!P.existing&&P.checked).length,vh=l.filter(P=>P.existing&&gf(P)).length,ni=v.useMemo(()=>n.filter(P=>E==="all"||String(P.brand_id)===E).sort((P,X)=>P.name.localeCompare(X.name)),[n,E]),ri=v.useMemo(()=>t.filter(P=>{const X=T.get(P.car_model_id);return!(E!=="all"&&String(X==null?void 0:X.brand_id)!==E||N!=="all"&&String(P.car_model_id)!==N)}),[t,T,E,N]),ko=c.jsxs("div",{children:[c.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[c.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Filtern:"}),c.jsxs("select",{value:E,onChange:P=>{S(P.target.value),M("all")},className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"all",children:"Alle Marken"}),R.map(P=>c.jsx("option",{value:String(P.id),children:P.name},P.id))]}),c.jsxs("select",{value:N,onChange:P=>M(P.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"all",children:"Alle Modelle"}),ni.map(P=>c.jsxs("option",{value:String(P.id),children:[P.brand_name," ",P.name]},P.id))]}),(E!=="all"||N!=="all")&&c.jsx("button",{onClick:()=>{S("all"),M("all")},className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),c.jsxs("span",{className:"text-sm text-neutral-400",children:[ri.length," von ",t.length]})]}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Marke / Modell"}),c.jsx("th",{className:"px-4 py-2",children:"Paket"}),c.jsx("th",{className:"px-4 py-2",children:"Aufschlag"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[ri.map(P=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2",children:[P.brand_name," ",P.model_name]}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[P.name,P.is_featured&&c.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"})]})}),c.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[P.markup_type==="fixed"&&`+${P.markup_value} €`,P.markup_type==="percent"&&`+${P.markup_value} %`,(!P.markup_type||P.markup_type==="none")&&"–"]}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx(ee,{to:`/admin/packages/${P.id}/products`,className:"mr-3 text-brand-600 hover:underline",children:"Produkte"}),c.jsx(ee,{to:`/admin/packages/${P.id}/upgrades`,className:"mr-3 text-brand-600 hover:underline",children:"Upgrades"}),c.jsx("button",{onClick:()=>{if(!B())return;const X=T.get(P.car_model_id);Z(X.brand_id,P.car_model_id),window.scrollTo({top:0,behavior:"smooth"})},className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>he(P),className:"text-red-600 hover:underline",children:"Löschen"})]})]},P.id)),ri.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:t.length===0?"Noch keine Pakete angelegt.":"Keine Pakete für diesen Filter."})})]})]})})]});return c.jsxs("div",{className:"space-y-6",children:[c.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Pakete"}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-3 font-bold text-neutral-900 dark:text-white",children:"Modell wählen"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs("select",{value:s,onChange:P=>_(P.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Marke wählen…"}),R.map(P=>c.jsx("option",{value:String(P.id),children:P.name},P.id))]}),c.jsxs("select",{value:o,onChange:P=>I(P.target.value),className:"min-w-[220px] rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Modell wählen…"}),$.map(P=>c.jsxs("option",{value:String(P.id),children:[P.brand_name," ",P.name]},P.id))]})]}),!o&&c.jsx("p",{className:"mt-2 text-sm text-neutral-500 dark:text-neutral-400",children:"Modell auswählen, um dessen Pakete anzulegen oder zu bearbeiten – die Standard-Paketstufen stehen dann als Checkliste bereit."})]}),L&&c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"border-b border-neutral-200 px-5 py-4 dark:border-neutral-800",children:[c.jsxs("h2",{className:"font-bold text-neutral-900 dark:text-white",children:["Pakete für ",L.brand_name," ",L.name]}),c.jsx("p",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:"Paketstufen anhaken, Beschreibung und Aufschlag ausfüllen, unten alles auf einmal speichern."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 rounded-lg border border-neutral-200 bg-neutral-50 px-3 py-2.5 dark:border-neutral-800 dark:bg-neutral-950",children:[c.jsx("span",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Pakete von anderem Modell kopieren:"}),c.jsxs("select",{value:y,onChange:P=>b(P.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Quellmodell wählen…"}),n.filter(P=>String(P.id)!==o).sort((P,X)=>`${P.brand_name} ${P.name}`.localeCompare(`${X.brand_name} ${X.name}`)).map(P=>c.jsxs("option",{value:String(P.id),children:[P.brand_name," ",P.name]},P.id))]}),c.jsx("button",{type:"button",onClick:Te,disabled:!y||x,className:"rounded-md border border-brand-500 px-3 py-1.5 text-sm font-semibold text-brand-600 hover:bg-brand-50 disabled:opacity-50 dark:hover:bg-brand-900/20",children:x?"Kopiert…":"Kopieren"}),c.jsx("span",{className:"text-xs text-neutral-400",children:"inkl. Produkte, ohne Upgrades"}),w&&c.jsx("span",{className:`w-full text-sm ${w.error?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:w.error||w.text})]})]}),c.jsx("div",{children:l.map((P,X)=>c.jsxs("div",{children:[P.tierName===null&&X>0&&l[X-1].tierName!==null&&c.jsx("div",{className:"border-t border-neutral-200 bg-neutral-50 px-5 py-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-400",children:"Weitere Pakete (alte Namen)"}),c.jsxs("div",{className:`border-t border-neutral-100 dark:border-neutral-800 ${P.checked?"":"opacity-70"}`,children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-5 py-3",children:[c.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[c.jsx("input",{type:"checkbox",checked:P.checked,disabled:!!P.existing||f,onChange:ie=>V(P.key,ie.target.checked),className:"h-5 w-5 rounded border-neutral-300 text-brand-600 focus:ring-brand-500 disabled:opacity-60"}),c.jsx("span",{className:"font-semibold text-neutral-900 dark:text-white",children:P.tierName??P.existing.name})]}),P.tierName===null&&c.jsx("span",{className:"text-xs text-neutral-400",children:"(alter Name)"}),P.existing?c.jsx("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-semibold text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:"Vorhanden"}):P.checked&&c.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Neu"}),P.form.is_featured&&c.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"}),P.existing&&c.jsxs("span",{className:"ml-auto flex items-center gap-3 text-sm",children:[c.jsx(ee,{to:`/admin/packages/${P.existing.id}/products`,className:"text-brand-600 hover:underline",children:"Produkte"}),c.jsx(ee,{to:`/admin/packages/${P.existing.id}/upgrades`,className:"text-brand-600 hover:underline",children:"Upgrades"}),c.jsx("button",{type:"button",onClick:()=>se(P),className:"text-red-600 hover:underline",children:"Löschen"})]})]}),P.checked&&c.jsxs("div",{className:"space-y-4 px-5 pb-5 sm:pl-[52px]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),c.jsx("p",{className:"mb-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Jede Zeile erscheint als eigener Stichpunkt zusammen mit den Bauteilen."}),c.jsx("textarea",{rows:10,value:P.form.description,onChange:ie=>K(P.key,{description:ie.target.value}),onInput:m5,className:sc})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aufschlag"}),c.jsxs("div",{className:"flex max-w-md gap-2",children:[c.jsxs("select",{value:P.form.markup_type,onChange:ie=>K(P.key,{markup_type:ie.target.value}),className:"w-40 rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"none",children:"Kein Aufschlag"}),c.jsx("option",{value:"fixed",children:"Fester Betrag (€)"}),c.jsx("option",{value:"percent",children:"Prozent (%)"})]}),c.jsx("input",{type:"number",step:"0.01",min:"0",disabled:P.form.markup_type==="none",value:P.form.markup_value,onChange:ie=>K(P.key,{markup_value:ie.target.value}),className:`${sc} disabled:opacity-50`})]}),c.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Wird auf die Summe der Bauteilpreise aufgeschlagen und ergibt den Gesamtpreis für den Kunden."})]}),c.jsxs("details",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800",children:[c.jsx("summary",{className:"cursor-pointer select-none px-3 py-2 text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Weitere Optionen (Preis-Text, Empfohlen, Sortierung)"}),c.jsxs("div",{className:"space-y-4 border-t border-neutral-200 p-3 dark:border-neutral-800",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis-Text (optional)"}),c.jsx("input",{value:P.form.price_text,onChange:ie=>K(P.key,{price_text:ie.target.value}),placeholder:'z. B. "Coming soon" oder "Preis auf Anfrage"',className:sc}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Ersetzt auf der Kachel den berechneten Preis, solange ausgefüllt."})]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:P.form.is_featured,onChange:ie=>K(P.key,{is_featured:ie.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Als empfohlen hervorheben"]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:P.form.sort_order,onChange:ie=>K(P.key,{sort_order:ie.target.value}),className:`${sc} max-w-[160px]`})]})]})]}),d[P.key]&&c.jsx("p",{className:"text-sm text-red-600",children:d[P.key]})]})]})]},P.key))}),c.jsxs("div",{className:"sticky bottom-0 flex flex-wrap items-center gap-3 rounded-b-xl border-t border-neutral-200 bg-white px-5 py-3 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("button",{type:"button",onClick:Se,disabled:f||!W,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:f?"Speichert…":"Alle speichern"}),c.jsxs("span",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:[lt," neu, ",vh," geändert"]}),m&&c.jsx("span",{className:`text-sm ${m.kind==="error"?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:m.text})]})]}),L?c.jsxs("details",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("summary",{className:"cursor-pointer select-none px-5 py-3 font-bold text-neutral-900 dark:text-white",children:"Alle Pakete (Übersicht)"}),c.jsx("div",{className:"border-t border-neutral-200 p-5 dark:border-neutral-800",children:ko})]}):ko]})}const ic=[...Z2].sort(),x5=120,y5=200;function b5({value:t,onChange:e}){const[n,r]=v.useState(""),s=v.useMemo(()=>{const i=n.trim().toLowerCase();return i?ic.filter(o=>o.includes(i)).slice(0,y5):ic.slice(0,x5)},[n]);return c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex items-center gap-3 rounded-md border border-neutral-300 p-2 dark:border-neutral-700",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:t?c.jsx(Mt,{name:t,className:"h-6 w-6"}):c.jsx("span",{className:"text-xs text-neutral-400",children:"?"})}),c.jsxs("div",{className:"text-sm",children:[c.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:t||"Kein Icon gewählt"}),c.jsxs("p",{className:"text-xs text-neutral-400",children:[ic.length," Icons verfügbar"]})]})]}),c.jsx("input",{value:n,onChange:i=>r(i.target.value),placeholder:"Icon suchen (z. B. car, shield, zap)…",className:"mb-2 w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsxs("div",{className:"grid max-h-64 grid-cols-6 gap-1 overflow-y-auto rounded-md border border-neutral-200 p-2 sm:grid-cols-8 dark:border-neutral-700",children:[s.map(i=>c.jsx("button",{type:"button",title:i,onClick:()=>e(i),className:`flex h-10 w-10 items-center justify-center rounded-md transition ${t===i?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:c.jsx(Mt,{name:i,className:"h-5 w-5"})},i)),s.length===0&&c.jsx("p",{className:"col-span-full py-4 text-center text-sm text-neutral-400",children:"Keine Icons gefunden."})]}),!n&&c.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Tipp: Tippe einen Suchbegriff ein, um alle ",ic.length," Icons zu durchsuchen."]})]})}const Bv={icon_name:"",title:"",description:"",image_path:"",cta_label:"",cta_url:"",sort_order:0};function v5(){const[t,e]=v.useState([]),[n,r]=v.useState(Bv),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/services").then(e);v.useEffect(l,[]);const u=p=>{i(p.id),r({icon_name:p.icon_name,title:p.title,description:p.description,image_path:p.image_path||"",cta_label:p.cta_label||"",cta_url:p.cta_url||"",sort_order:p.sort_order})},d=()=>{i(null),r(Bv)},h=async p=>{if(p.preventDefault(),a(""),!n.icon_name){a("Bitte ein Icon auswählen");return}const m={...n,sort_order:Number(n.sort_order)};try{s?await A.put(`/services/${s}`,m):await A.post("/services",m),d(),l()}catch(g){a(g.message)}},f=async p=>{confirm("Diese Leistung wirklich löschen?")&&(await A.delete(`/services/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Leistungen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Karten erscheinen auf der öffentlichen Leistungen-Seite. Die 8 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Icon"}),c.jsx("th",{className:"px-4 py-2",children:"Titel"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:c.jsx(Mt,{name:p.icon_name,className:"h-5 w-5"})})}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.title}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Leistungen angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Leistung bearbeiten":"Neue Leistung"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Icon *"}),c.jsx(b5,{value:n.icon_name,onChange:p=>r({...n,icon_name:p})})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:n.title,onChange:p=>r({...n,title:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung *"}),c.jsx("textarea",{required:!0,rows:4,value:n.description,onChange:p=>r({...n,description:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:n.image_path,onChange:p=>r({...n,image_path:p}),aspect:4/3,label:"Bild"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Text (optional)"}),c.jsx("input",{value:n.cta_label,onChange:p=>r({...n,cta_label:p.target.value}),placeholder:"z. B. Fahrzeug konfigurieren",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Link (optional)"}),c.jsx("input",{value:n.cta_url,onChange:p=>r({...n,cta_url:p.target.value}),placeholder:"z. B. /fahrzeuge",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const zv={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function k5(){const[t,e]=v.useState([]),[n,r]=v.useState(zv),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/faqs").then(e);v.useEffect(l,[]);const u=p=>{i(p.id),r({question_de:p.question_de,answer_de:p.answer_de,question_en:p.question_en,answer_en:p.answer_en,sort_order:p.sort_order})},d=()=>{i(null),r(zv)},h=async p=>{p.preventDefault(),a("");const m={...n,sort_order:Number(n.sort_order)};try{s?await A.put(`/faqs/${s}`,m):await A.post("/faqs",m),d(),l()}catch(g){a(g.message)}},f=async p=>{confirm("Diese Frage wirklich löschen?")&&(await A.delete(`/faqs/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Häufig gestellte Fragen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Fragen erscheinen im FAQ-Bereich der Startseite, jeweils in der aktuell gewählten Sprache. Die 6 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Frage (DE)"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.question_de}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Fragen angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Frage bearbeiten":"Neue Frage"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Deutsch) *"}),c.jsx("input",{required:!0,value:n.question_de,onChange:p=>r({...n,question_de:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Deutsch) *"}),c.jsx("textarea",{required:!0,rows:3,value:n.answer_de,onChange:p=>r({...n,answer_de:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Englisch) *"}),c.jsx("input",{required:!0,value:n.question_en,onChange:p=>r({...n,question_en:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Englisch) *"}),c.jsx("textarea",{required:!0,rows:3,value:n.answer_en,onChange:p=>r({...n,answer_en:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Fv={name:"",logo_path:"",sort_order:0};function w5(){const[t,e]=v.useState([]),[n,r]=v.useState(Fv),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/partners").then(e);v.useEffect(()=>{l()},[]);const u=p=>{i(p.id),r({name:p.name,logo_path:p.logo_path||"",sort_order:p.sort_order})},d=()=>{i(null),r(Fv)},h=async p=>{p.preventDefault(),a("");try{s?await A.put(`/partners/${s}`,n):await A.post("/partners",n),d(),l()}catch(m){a(m.message)}},f=async p=>{confirm("Partner wirklich löschen?")&&(await A.delete(`/partners/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Partner"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Marken-Logozeile auf der Startseite. Ohne Logo wird der Name als Text angezeigt."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Logo"}),c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:p.logo_path?c.jsx("img",{src:p.logo_path,alt:"",className:"h-10 w-10 rounded-md object-contain"}):c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.name}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Partner angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Partner bearbeiten":"Neuer Partner"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:n.name,onChange:p=>r({...n,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:n.logo_path,onChange:p=>r({...n,logo_path:p}),label:"Logo (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}var fj={exports:{}},pj={};/** +Bereits vorhandene Paketstufen werden übersprungen. Upgrades werden nicht mitkopiert.`)){k(!0),C(null);try{const ie=await A.post(`/models/${o}/copy-packages`,{source_model_id:Number(y)}),ct=ie.copied.reduce((hs,D)=>hs+D.products,0),xe=[`${ie.copied.length} Paket(e) kopiert (${ct} Produkte)`];ie.skipped.length&&xe.push(`übersprungen: ${ie.skipped.join(", ")}`),C({text:`${xe.join(" – ")}.`});const ds=await j();u(Lo(Number(o),ds)),h({})}catch(ie){C({error:ie.message})}k(!1)}},lt=l.filter(P=>!P.existing&&P.checked).length,vh=l.filter(P=>P.existing&&gf(P)).length,ni=v.useMemo(()=>n.filter(P=>E==="all"||String(P.brand_id)===E).sort((P,X)=>P.name.localeCompare(X.name)),[n,E]),ri=v.useMemo(()=>t.filter(P=>{const X=T.get(P.car_model_id);return!(E!=="all"&&String(X==null?void 0:X.brand_id)!==E||N!=="all"&&String(P.car_model_id)!==N)}),[t,T,E,N]),ko=c.jsxs("div",{children:[c.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[c.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Filtern:"}),c.jsxs("select",{value:E,onChange:P=>{S(P.target.value),M("all")},className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"all",children:"Alle Marken"}),R.map(P=>c.jsx("option",{value:String(P.id),children:P.name},P.id))]}),c.jsxs("select",{value:N,onChange:P=>M(P.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"all",children:"Alle Modelle"}),ni.map(P=>c.jsxs("option",{value:String(P.id),children:[P.brand_name," ",P.name]},P.id))]}),(E!=="all"||N!=="all")&&c.jsx("button",{onClick:()=>{S("all"),M("all")},className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),c.jsxs("span",{className:"text-sm text-neutral-400",children:[ri.length," von ",t.length]})]}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Marke / Modell"}),c.jsx("th",{className:"px-4 py-2",children:"Paket"}),c.jsx("th",{className:"px-4 py-2",children:"Aufschlag"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[ri.map(P=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2",children:[P.brand_name," ",P.model_name]}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:c.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[P.name,P.is_featured&&c.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"})]})}),c.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[P.markup_type==="fixed"&&`+${P.markup_value} €`,P.markup_type==="percent"&&`+${P.markup_value} %`,(!P.markup_type||P.markup_type==="none")&&"–"]}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx(ee,{to:`/admin/packages/${P.id}/products`,className:"mr-3 text-brand-600 hover:underline",children:"Produkte"}),c.jsx(ee,{to:`/admin/packages/${P.id}/upgrades`,className:"mr-3 text-brand-600 hover:underline",children:"Upgrades"}),c.jsx("button",{onClick:()=>{if(!B())return;const X=T.get(P.car_model_id);Z(X.brand_id,P.car_model_id),window.scrollTo({top:0,behavior:"smooth"})},className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>he(P),className:"text-red-600 hover:underline",children:"Löschen"})]})]},P.id)),ri.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:t.length===0?"Noch keine Pakete angelegt.":"Keine Pakete für diesen Filter."})})]})]})})]});return c.jsxs("div",{className:"space-y-6",children:[c.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Pakete"}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-3 font-bold text-neutral-900 dark:text-white",children:"Modell wählen"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsxs("select",{value:s,onChange:P=>_(P.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Marke wählen…"}),R.map(P=>c.jsx("option",{value:String(P.id),children:P.name},P.id))]}),c.jsxs("select",{value:o,onChange:P=>I(P.target.value),className:"min-w-[220px] rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Modell wählen…"}),$.map(P=>c.jsxs("option",{value:String(P.id),children:[P.brand_name," ",P.name]},P.id))]})]}),!o&&c.jsx("p",{className:"mt-2 text-sm text-neutral-500 dark:text-neutral-400",children:"Modell auswählen, um dessen Pakete anzulegen oder zu bearbeiten – die Standard-Paketstufen stehen dann als Checkliste bereit."})]}),L&&c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"border-b border-neutral-200 px-5 py-4 dark:border-neutral-800",children:[c.jsxs("h2",{className:"font-bold text-neutral-900 dark:text-white",children:["Pakete für ",L.brand_name," ",L.name]}),c.jsx("p",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:"Paketstufen anhaken, Beschreibung und Aufschlag ausfüllen, unten alles auf einmal speichern."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 rounded-lg border border-neutral-200 bg-neutral-50 px-3 py-2.5 dark:border-neutral-800 dark:bg-neutral-950",children:[c.jsx("span",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Pakete von anderem Modell kopieren:"}),c.jsxs("select",{value:y,onChange:P=>b(P.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Quellmodell wählen…"}),n.filter(P=>String(P.id)!==o).sort((P,X)=>`${P.brand_name} ${P.name}`.localeCompare(`${X.brand_name} ${X.name}`)).map(P=>c.jsxs("option",{value:String(P.id),children:[P.brand_name," ",P.name]},P.id))]}),c.jsx("button",{type:"button",onClick:Te,disabled:!y||x,className:"rounded-md border border-brand-500 px-3 py-1.5 text-sm font-semibold text-brand-600 hover:bg-brand-50 disabled:opacity-50 dark:hover:bg-brand-900/20",children:x?"Kopiert…":"Kopieren"}),c.jsx("span",{className:"text-xs text-neutral-400",children:"inkl. Produkte, ohne Upgrades"}),w&&c.jsx("span",{className:`w-full text-sm ${w.error?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:w.error||w.text})]})]}),c.jsx("div",{children:l.map((P,X)=>c.jsxs("div",{children:[P.tierName===null&&X>0&&l[X-1].tierName!==null&&c.jsx("div",{className:"border-t border-neutral-200 bg-neutral-50 px-5 py-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-400",children:"Weitere Pakete (alte Namen)"}),c.jsxs("div",{className:`border-t border-neutral-100 dark:border-neutral-800 ${P.checked?"":"opacity-70"}`,children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-5 py-3",children:[c.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[c.jsx("input",{type:"checkbox",checked:P.checked,disabled:!!P.existing||f,onChange:ie=>V(P.key,ie.target.checked),className:"h-5 w-5 rounded border-neutral-300 text-brand-600 focus:ring-brand-500 disabled:opacity-60"}),c.jsx("span",{className:"font-semibold text-neutral-900 dark:text-white",children:P.tierName??P.existing.name})]}),P.tierName===null&&c.jsx("span",{className:"text-xs text-neutral-400",children:"(alter Name)"}),P.existing?c.jsx("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-semibold text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:"Vorhanden"}):P.checked&&c.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Neu"}),P.form.is_featured&&c.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"}),P.existing&&c.jsxs("span",{className:"ml-auto flex items-center gap-3 text-sm",children:[c.jsx(ee,{to:`/admin/packages/${P.existing.id}/products`,className:"text-brand-600 hover:underline",children:"Produkte"}),c.jsx(ee,{to:`/admin/packages/${P.existing.id}/upgrades`,className:"text-brand-600 hover:underline",children:"Upgrades"}),c.jsx("button",{type:"button",onClick:()=>se(P),className:"text-red-600 hover:underline",children:"Löschen"})]})]}),P.checked&&c.jsxs("div",{className:"space-y-4 px-5 pb-5 sm:pl-[52px]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),c.jsx("p",{className:"mb-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Jede Zeile erscheint als eigener Stichpunkt zusammen mit den Bauteilen."}),c.jsx("textarea",{rows:10,value:P.form.description,onChange:ie=>K(P.key,{description:ie.target.value}),onInput:g5,className:sc})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aufschlag"}),c.jsxs("div",{className:"flex max-w-md gap-2",children:[c.jsxs("select",{value:P.form.markup_type,onChange:ie=>K(P.key,{markup_type:ie.target.value}),className:"w-40 rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"none",children:"Kein Aufschlag"}),c.jsx("option",{value:"fixed",children:"Fester Betrag (€)"}),c.jsx("option",{value:"percent",children:"Prozent (%)"})]}),c.jsx("input",{type:"number",step:"0.01",min:"0",disabled:P.form.markup_type==="none",value:P.form.markup_value,onChange:ie=>K(P.key,{markup_value:ie.target.value}),className:`${sc} disabled:opacity-50`})]}),c.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Wird auf die Summe der Bauteilpreise aufgeschlagen und ergibt den Gesamtpreis für den Kunden."})]}),c.jsxs("details",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800",children:[c.jsx("summary",{className:"cursor-pointer select-none px-3 py-2 text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Weitere Optionen (Preis-Text, Empfohlen, Sortierung)"}),c.jsxs("div",{className:"space-y-4 border-t border-neutral-200 p-3 dark:border-neutral-800",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis-Text (optional)"}),c.jsx("input",{value:P.form.price_text,onChange:ie=>K(P.key,{price_text:ie.target.value}),placeholder:'z. B. "Coming soon" oder "Preis auf Anfrage"',className:sc}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Ersetzt auf der Kachel den berechneten Preis, solange ausgefüllt."})]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:P.form.is_featured,onChange:ie=>K(P.key,{is_featured:ie.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Als empfohlen hervorheben"]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:P.form.sort_order,onChange:ie=>K(P.key,{sort_order:ie.target.value}),className:`${sc} max-w-[160px]`})]})]})]}),d[P.key]&&c.jsx("p",{className:"text-sm text-red-600",children:d[P.key]})]})]})]},P.key))}),c.jsxs("div",{className:"sticky bottom-0 flex flex-wrap items-center gap-3 rounded-b-xl border-t border-neutral-200 bg-white px-5 py-3 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("button",{type:"button",onClick:Se,disabled:f||!W,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:f?"Speichert…":"Alle speichern"}),c.jsxs("span",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:[lt," neu, ",vh," geändert"]}),m&&c.jsx("span",{className:`text-sm ${m.kind==="error"?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:m.text})]})]}),L?c.jsxs("details",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("summary",{className:"cursor-pointer select-none px-5 py-3 font-bold text-neutral-900 dark:text-white",children:"Alle Pakete (Übersicht)"}),c.jsx("div",{className:"border-t border-neutral-200 p-5 dark:border-neutral-800",children:ko})]}):ko]})}const ic=[...Q2].sort(),y5=120,b5=200;function v5({value:t,onChange:e}){const[n,r]=v.useState(""),s=v.useMemo(()=>{const i=n.trim().toLowerCase();return i?ic.filter(o=>o.includes(i)).slice(0,b5):ic.slice(0,y5)},[n]);return c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex items-center gap-3 rounded-md border border-neutral-300 p-2 dark:border-neutral-700",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:t?c.jsx(Mt,{name:t,className:"h-6 w-6"}):c.jsx("span",{className:"text-xs text-neutral-400",children:"?"})}),c.jsxs("div",{className:"text-sm",children:[c.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:t||"Kein Icon gewählt"}),c.jsxs("p",{className:"text-xs text-neutral-400",children:[ic.length," Icons verfügbar"]})]})]}),c.jsx("input",{value:n,onChange:i=>r(i.target.value),placeholder:"Icon suchen (z. B. car, shield, zap)…",className:"mb-2 w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsxs("div",{className:"grid max-h-64 grid-cols-6 gap-1 overflow-y-auto rounded-md border border-neutral-200 p-2 sm:grid-cols-8 dark:border-neutral-700",children:[s.map(i=>c.jsx("button",{type:"button",title:i,onClick:()=>e(i),className:`flex h-10 w-10 items-center justify-center rounded-md transition ${t===i?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:c.jsx(Mt,{name:i,className:"h-5 w-5"})},i)),s.length===0&&c.jsx("p",{className:"col-span-full py-4 text-center text-sm text-neutral-400",children:"Keine Icons gefunden."})]}),!n&&c.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Tipp: Tippe einen Suchbegriff ein, um alle ",ic.length," Icons zu durchsuchen."]})]})}const zv={icon_name:"",title:"",description:"",image_path:"",cta_label:"",cta_url:"",sort_order:0};function k5(){const[t,e]=v.useState([]),[n,r]=v.useState(zv),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/services").then(e);v.useEffect(l,[]);const u=p=>{i(p.id),r({icon_name:p.icon_name,title:p.title,description:p.description,image_path:p.image_path||"",cta_label:p.cta_label||"",cta_url:p.cta_url||"",sort_order:p.sort_order})},d=()=>{i(null),r(zv)},h=async p=>{if(p.preventDefault(),a(""),!n.icon_name){a("Bitte ein Icon auswählen");return}const m={...n,sort_order:Number(n.sort_order)};try{s?await A.put(`/services/${s}`,m):await A.post("/services",m),d(),l()}catch(g){a(g.message)}},f=async p=>{confirm("Diese Leistung wirklich löschen?")&&(await A.delete(`/services/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Leistungen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Karten erscheinen auf der öffentlichen Leistungen-Seite. Die 8 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Icon"}),c.jsx("th",{className:"px-4 py-2",children:"Titel"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:c.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:c.jsx(Mt,{name:p.icon_name,className:"h-5 w-5"})})}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.title}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Leistungen angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Leistung bearbeiten":"Neue Leistung"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Icon *"}),c.jsx(v5,{value:n.icon_name,onChange:p=>r({...n,icon_name:p})})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:n.title,onChange:p=>r({...n,title:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung *"}),c.jsx("textarea",{required:!0,rows:4,value:n.description,onChange:p=>r({...n,description:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:n.image_path,onChange:p=>r({...n,image_path:p}),aspect:4/3,label:"Bild"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Text (optional)"}),c.jsx("input",{value:n.cta_label,onChange:p=>r({...n,cta_label:p.target.value}),placeholder:"z. B. Fahrzeug konfigurieren",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Link (optional)"}),c.jsx("input",{value:n.cta_url,onChange:p=>r({...n,cta_url:p.target.value}),placeholder:"z. B. /fahrzeuge",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Fv={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function w5(){const[t,e]=v.useState([]),[n,r]=v.useState(Fv),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/faqs").then(e);v.useEffect(l,[]);const u=p=>{i(p.id),r({question_de:p.question_de,answer_de:p.answer_de,question_en:p.question_en,answer_en:p.answer_en,sort_order:p.sort_order})},d=()=>{i(null),r(Fv)},h=async p=>{p.preventDefault(),a("");const m={...n,sort_order:Number(n.sort_order)};try{s?await A.put(`/faqs/${s}`,m):await A.post("/faqs",m),d(),l()}catch(g){a(g.message)}},f=async p=>{confirm("Diese Frage wirklich löschen?")&&(await A.delete(`/faqs/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Häufig gestellte Fragen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Fragen erscheinen im FAQ-Bereich der Startseite, jeweils in der aktuell gewählten Sprache. Die 6 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Frage (DE)"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.question_de}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Fragen angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Frage bearbeiten":"Neue Frage"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Deutsch) *"}),c.jsx("input",{required:!0,value:n.question_de,onChange:p=>r({...n,question_de:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Deutsch) *"}),c.jsx("textarea",{required:!0,rows:3,value:n.answer_de,onChange:p=>r({...n,answer_de:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Englisch) *"}),c.jsx("input",{required:!0,value:n.question_en,onChange:p=>r({...n,question_en:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Englisch) *"}),c.jsx("textarea",{required:!0,rows:3,value:n.answer_en,onChange:p=>r({...n,answer_en:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Vv={name:"",logo_path:"",sort_order:0};function S5(){const[t,e]=v.useState([]),[n,r]=v.useState(Vv),[s,i]=v.useState(null),[o,a]=v.useState(""),l=()=>A.get("/partners").then(e);v.useEffect(()=>{l()},[]);const u=p=>{i(p.id),r({name:p.name,logo_path:p.logo_path||"",sort_order:p.sort_order})},d=()=>{i(null),r(Vv)},h=async p=>{p.preventDefault(),a("");try{s?await A.put(`/partners/${s}`,n):await A.post("/partners",n),d(),l()}catch(m){a(m.message)}},f=async p=>{confirm("Partner wirklich löschen?")&&(await A.delete(`/partners/${p}`),l())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Partner"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Marken-Logozeile auf der Startseite. Ohne Logo wird der Name als Text angezeigt."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Logo"}),c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(p=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsx("td",{className:"px-4 py-2",children:p.logo_path?c.jsx("img",{src:p.logo_path,alt:"",className:"h-10 w-10 rounded-md object-contain"}):c.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),c.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.name}),c.jsx("td",{className:"px-4 py-2",children:p.sort_order}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>u(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>f(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Partner angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Partner bearbeiten":"Neuer Partner"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:n.name,onChange:p=>r({...n,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(tr,{value:n.logo_path,onChange:p=>r({...n,logo_path:p}),label:"Logo (optional)"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:n.sort_order,onChange:p=>r({...n,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&c.jsx("p",{className:"text-sm text-red-600",children:o}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&c.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}var pj={exports:{}},mj={};/** * @license React * use-sync-external-store-shim.production.js * @@ -169,32 +169,32 @@ Bereits vorhandene Paketstufen werden übersprungen. Upgrades werden nicht mitko * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Qi=v;function S5(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var N5=typeof Object.is=="function"?Object.is:S5,C5=Qi.useState,j5=Qi.useEffect,E5=Qi.useLayoutEffect,T5=Qi.useDebugValue;function M5(t,e){var n=e(),r=C5({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return E5(function(){s.value=n,s.getSnapshot=e,xf(s)&&i({inst:s})},[t,n,e]),j5(function(){return xf(s)&&i({inst:s}),t(function(){xf(s)&&i({inst:s})})},[t]),T5(n),n}function xf(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!N5(t,n)}catch{return!0}}function P5(t,e){return e()}var A5=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?P5:M5;pj.useSyncExternalStore=Qi.useSyncExternalStore!==void 0?Qi.useSyncExternalStore:A5;fj.exports=pj;var _0=fj.exports,Vv=Object.defineProperty,D5=(t,e)=>{let n={};for(var r in t)Vv(n,r,{get:t[r],enumerable:!0});return Vv(n,Symbol.toStringTag,{value:"Module"}),n};function tt(t){this.content=t}tt.prototype={constructor:tt,find:function(t){for(var e=0;e>1}};tt.from=function(t){if(t instanceof tt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new tt(e)};function mj(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),i=e.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){let o=s.text,a=i.text,l=0;for(;o[l]==a[l];l++)n++;return l&&l0&&f>0&&u[h-1]==d[f-1];)h--,f--,n--,r--;return h&&f&&h=56320&&t<57344}function yj(t){return t>=55296&&t<56320}class O{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;re&&r(l,s+a,i||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,s+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);ie)for(let i=0,o=0;oe&&((on)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),s+=a.nodeSize),o=l}return new O(r,s)}cutByIndex(e,n){return e==n?O.empty:e==0&&n==this.content.length?this:new O(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new O(s,i)}addToStart(e){return new O([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new O(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=e)return i==e?oc(n+1,i):oc(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return O.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return O.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return O.empty;let n,r=0;for(let s=0;sthis.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-s.type.rank),n}};me.none=[];class Za extends Error{}class H{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=vj(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new H(r,this.openStart,this.openEnd)}removeBetween(e,n){return new H(bj(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return H.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new H(O.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new H(e,r,s)}}H.empty=new H(O.empty,0,0);function bj(t,e,n){let{index:r,offset:s}=t.findIndex(e),i=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(s==e||i.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(bj(i.content,e-s-1,n-s-1)))}function vj(t,e,n,r,s,i){let{index:o,offset:a}=t.findIndex(e),l=t.maybeChild(o);if(a==e||l.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=vj(l.content,e-a-1,n,o==0?r-1:0,o==t.childCount-1?s-1:0,l);return u&&t.replaceChild(o,l.copy(u))}function L5(t,e,n){if(n.openStart>t.depth)throw new Za("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Za("Inconsistent open depths");return kj(t,e,n,0)}function kj(t,e,n,r){let s=t.index(r),i=t.node(r);if(s==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ha(t,e,n,r){let s=(e||t).node(n),i=0,o=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Is(t.nodeAfter,r),i++));for(let a=i;as&&Pm(t,e,s+1),o=r.depth>s&&Pm(n,r,s+1),a=[];return ha(null,t,s,a),i&&o&&e.index(s)==n.index(s)?(wj(i,o),Is(Os(i,Sj(t,e,n,r,s+1)),a)):(i&&Is(Os(i,_u(t,e,s+1)),a),ha(e,n,s,a),o&&Is(Os(o,_u(n,r,s+1)),a)),ha(r,null,s,a),new O(a)}function _u(t,e,n){let r=[];if(ha(null,t,n,r),t.depth>n){let s=Pm(t,e,n+1);Is(Os(s,_u(t,e,n+1)),r)}return ha(e,null,n,r),new O(r)}function R5(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)s=e.node(i).copy(O.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class Qa{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Iu(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(i),u=i-l;if(r.push(o,a,s+l),!u||(o=o.child(a),o.isText))break;i=u-1,s+=l+1}return new Qa(n,r,i)}static resolveCached(e,n){let r=$v.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Nj(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=O.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=s;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=O.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};Bs.prototype.text=void 0;class Ou extends Bs{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Nj(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ou(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ou(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Nj(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Gs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new B5(e,n);if(r.next==null)return Gs.empty;let s=Cj(r);r.next&&r.err("Unexpected trailing text");let i=U5(W5(s));return K5(i,r),i}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let s=0;s{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return i}).join(` -`)}}Gs.empty=new Gs(!0);class B5{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 Cj(t){let e=[];do e.push(z5(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function z5(t){let e=[];do e.push(F5(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function F5(t){let e=H5(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=V5(t,e);else break;return e}function Hv(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function V5(t,e){let n=Hv(t),r=n;return t.eat(",")&&(t.next!="}"?r=Hv(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function $5(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function H5(t){if(t.eat("(")){let e=Cj(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=$5(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 W5(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function s(o,a){o.forEach(l=>l.to=a)}function i(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(i(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=i(o.exprs[l],a);if(l==o.exprs.length-1)return u;s(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),s(i(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return s(i(o.expr,a),l),s(i(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(i(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let d=0;d{u||s.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let i=e[r.join(",")]=new Gs(r.indexOf(t.length-1)>-1);for(let o=0;o-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.defaultAttrs?this.defaultAttrs:Tj(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Bs(this,this.computeAttrs(e),O.from(n),me.setFrom(r))}createChecked(e=null,n,r){return n=O.from(n),this.checkContent(n),new Bs(this,this.computeAttrs(e),n,me.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=O.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(O.empty,!0);return i?new Bs(this,e,n.append(i),me.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[i]=new Aj(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function G5(t,e,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class q5{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?G5(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class th{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=Pj(e,s.attrs),this.excluded=null;let i=Ej(this.attrs);this.instance=i?new me(this,i):null}create(e=null){return!e&&this.instance?this.instance:new me(this,Tj(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new th(i,s++,n,o)),r}removeFromSet(e){for(var n=0;n-1}}class Dj{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=tt.from(e.nodes),n.marks=tt.from(e.marks||{}),this.nodes=Uv.compile(this.spec.nodes,this),this.marks=th.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Gs.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?Kv(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Kv(this,o.split(" "))}this.nodeFromJSON=s=>Bs.fromJSON(this,s),this.markFromJSON=s=>me.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Uv){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new Ou(r,r.defaultAttrs,e,me.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Kv(t,e){let n=[];for(let r=0;r-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function J5(t){return t.tag!=null}function Y5(t){return t.style!=null}class $r{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(J5(s))this.tags.push(s);else if(Y5(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new qv(this,n,!1);return r.addAll(e,me.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new qv(this,n,!0);return r.addAll(e,me.none,n.from,n.to),H.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;se.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o{r(o=Jv(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Jv(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $r(e,$r.schemaRules(e)))}}const Lj={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},X5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Rj={ol:!0,ul:!0},el=1,Dm=2,fa=4;function Gv(t,e,n){return e!=null?(e?el:0)|(e==="full"?Dm:0):t&&t.whitespace=="pre"?el|Dm:n&~fa}class ac{constructor(e,n,r,s,i,o){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=me.none,this.match=i||(o&fa?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(O.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&el)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=O.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(O.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Lj.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qv{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=Gv(null,n.preserveWhitespace,0)|(r?fa:0);s?i=new ac(s.type,s.attrs,me.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new ac(null,null,me.none,!0,null,o):i=new ac(e.schema.topNodeType,null,me.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,i=s.options&Dm?"full":this.localPreserveWS||(s.options&el)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,` -`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,s){let i,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=s==null?null:e.childNodes[s];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,n);this.findAtPoint(e,i)}findPlace(e,n,r){let s,i;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!s||s.length>u.length+a)&&(s=u,i=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!s)return null;this.sync(i);for(let o=0;o(o.type?o.type.allowsMarkType(u.type):Yv(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new ac(e,n,l,s,null,a)),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|=el)}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 s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&s?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(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 Z5(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Rj.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function Q5(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Jv(t){let e={};for(let n in t)e[n]=t[n];return e}function Yv(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let i=[],o=a=>{i.push(a);for(let l=0;l{if(i.length||o.marks.length){let a=0,l=0;for(;a=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&Kc(lc(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return typeof n=="string"?{dom:e.createTextNode(n)}:Kc(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ei(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Xv(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Xv(e.marks)}}function Xv(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function lc(t){return t.document||window.document}const Zv=new WeakMap;function eB(t){let e=Zv.get(t);return e===void 0&&Zv.set(t,e=tB(t)),e}function tB(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(n=s.slice(0,o),s=s.slice(o+1));let a,l=n?t.createElementNS(n,s):t.createElement(s),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let f=h.indexOf(" ");f>0?l.setAttributeNS(h.slice(0,f),h.slice(f+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=d;hd)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:p,contentDOM:m}=Kc(t,f,n,r);if(l.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const _j=65535,Ij=Math.pow(2,16);function nB(t,e){return t+e*Ij}function Qv(t){return t&_j}function rB(t){return(t-(t&_j))/Ij}const Oj=1,Bj=2,Gc=4,zj=8;class Lm{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&zj)>0}get deletedBefore(){return(this.delInfo&(Oj|Gc))>0}get deletedAfter(){return(this.delInfo&(Bj|Gc))>0}get deletedAcross(){return(this.delInfo&Gc)>0}}class It{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&It.empty)return It.empty}recover(e){let n=0,r=Qv(e);if(!this.inverted)for(let s=0;se)break;let u=this.ranges[a+i],d=this.ranges[a+o],h=l+u;if(e<=h){let f=u?e==l?-1:e==h?1:n:n,p=l+s+(f<0?0:d);if(r)return p;let m=e==(n<0?l:h)?null:nB(a/3,e-l),g=e==l?Bj:e==h?Oj:Gc;return(n<0?e!=l:e!=h)&&(g|=zj),new Lm(p,g,m)}s+=d-u}return r?e+s:new Lm(e+s,0,null)}touches(e,n){let r=0,s=Qv(n),i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;ae)break;let u=this.ranges[a+i],d=l+u;if(e<=d&&a==s*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new tl;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ri&&l!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),n.openStart,n.openEnd);return Be.fromReplace(e,this.from,this.to,i)}invert(){return new yn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Pr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Pr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Pr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Pr(n.from,n.to,e.markFromJSON(n.mark))}}gt.jsonID("addMark",Pr);class yn extends gt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new H(I0(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return Be.fromReplace(e,this.from,this.to,r)}invert(){return new Pr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new yn(n.pos,r.pos,this.mark)}merge(e){return e instanceof yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new yn(n.from,n.to,e.markFromJSON(n.mark))}}gt.jsonID("removeMark",yn);class Ar extends gt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Be.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Be.fromReplace(e,this.pos,this.pos+1,new H(O.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;sr.pos?null:new Ye(n.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ye(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(e,n.slice),n.insert,!!n.structure)}}gt.jsonID("replaceAround",Ye);function Rm(t,e,n){let r=t.resolve(e),s=n-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function sB(t,e,n,r){let s=[],i=[],o,a;t.doc.nodesBetween(e,n,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,n),m=r.addToSet(h);for(let g=0;gt.step(l)),i.forEach(l=>t.step(l))}function iB(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;i++;let l=null;if(r instanceof th){let u=o.marks,d;for(;d=r.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let d=0;dt.step(new yn(o.from,o.to,o.style)))}function O0(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l=0;l--)t.step(o[l])}function oB(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function vo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,i=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+s,l=t.$to.indexAfter(r)-i;if(rn;m--)g||r.index(m)>0?(g=!0,d=O.from(r.node(m).copy(d)),h++):l--;let f=O.empty,p=0;for(let m=i,g=!1;m>n;m--)g||s.after(m+1)=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=O.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new Ye(s,i,s,i,new H(r,0,0),n.length,!0))}function dB(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,l)&&hB(t.doc,t.mapping.slice(i).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?u=!1:!p&&m&&(u=!0)}u===!1&&Vj(t,o,a,i),O0(t,t.mapping.slice(i).map(a,1),r,void 0,u===null);let d=t.mapping.slice(i),h=d.map(a,1),f=d.map(a+o.nodeSize,1);return t.step(new Ye(h,f,h+1,f-1,new H(O.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&Fj(t,o,a,i),!1}})}function Fj(t,e,n,r){e.forEach((s,i)=>{if(s.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(s.text);){let l=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function Vj(t,e,n,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text(` -`))}})}function hB(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function fB(t,e,n,r,s){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let o=n.create(r,null,s||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ye(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new H(O.from(o),0,0),1,!0))}function nr(t,e,n=1,r){let s=t.resolve(e),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let u=s.depth-1,d=n-2;u>i;u--,d--){let h=s.node(u),f=s.index(u);if(h.type.spec.isolating)return!1;let p=h.content.cutByIndex(f,h.childCount),m=r&&r[d+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[d]||h;if(!h.canReplace(f+1,h.childCount)||!g.type.validContent(p))return!1}let a=s.indexAfter(i),l=r&&r[0];return s.node(i).canReplaceWith(a,a,l?l.type:s.node(i+1).type)}function pB(t,e,n=1,r){let s=t.doc.resolve(e),i=O.empty,o=O.empty;for(let a=s.depth,l=s.depth-n,u=n-1;a>l;a--,u--){i=O.from(s.node(a).copy(i));let d=r&&r[u];o=O.from(d?d.type.create(d.attrs,o):s.node(a).copy(o))}t.step(new Re(e,e,new H(i.append(o),n,n),!0))}function is(t,e){let n=t.resolve(e),r=n.index();return $j(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function mB(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let s=0;s0?(i=r.node(s+1),a++,o=r.node(s).maybeChild(a)):(i=r.node(s).maybeChild(a-1),o=r.node(s+1)),i&&!i.isTextblock&&$j(i,o)&&r.node(s).canReplace(a,a+1))return e;if(s==0)break;e=n<0?r.before(s):r.after(s)}}function gB(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(s);d&&!h?r=!1:!d&&h&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);Vj(t,d.node(),d.before(),a)}o.inlineContent&&O0(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Re(u,l.map(e+n,-1),H.empty,!0)),r===!0){let d=t.doc.resolve(u);Fj(t,d.node(),d.before(),t.steps.length)}return t}function xB(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 s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),d=!1;if(i==1)d=u.canReplace(l,l,s);else{let h=u.contentMatchAt(l).findWrapping(s.firstChild.type);d=h&&u.canReplaceWith(l,l,h[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function rh(t,e,n=e,r=H.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return Wj(s,i,r)?new Re(e,n,r):new yB(s,i,r).fit()}function Wj(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class yB{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=O.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=O.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,a=s.depth;for(;o&&a&&i.childCount==1;)i=i.firstChild.content,o--,a--;let l=new H(i,o,a);return e>-1?new Ye(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Re(r.pos,s.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=tk(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],d,h=null;if(n==1&&(o?u.matchType(o.type)||(h=u.fillBefore(O.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:h};if(n==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:d};if(i&&u.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced;return nk(e,-1)<=n?!1:(this.unplaced.size>1&&nk(e,1)>r&&r++,this.unplaced=new H(e,n+1,r),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=tk(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new H(Ko(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new H(Ko(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(h=y,d.push(Uj(g.mark(f.allowedMarks(g.marks)),u==1?l:0,u==a.childCount?p:-1)))}let m=u==a.childCount;m||(p=-1),this.placed=Go(this.placed,n,O.from(d)),this.frontier[n].match=h,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n=0;a--){let{match:l,type:u}=this.frontier[a],d=vf(e,a,u,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Go(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=Go(this.placed,this.depth,O.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(O.empty,!0);n.childCount&&(this.placed=Go(this.placed,this.frontier.length,n))}}function Ko(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ko(t.firstChild.content,e-1,n)))}function Go(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Go(t.lastChild.content,e-1,n)))}function tk(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Uj(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(O.empty,!0)))),t.copy(r)}function vf(t,e,n,r,s){let i=t.node(e),o=s?t.indexAfter(e):t.index(e);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,o);return a&&!bB(n,i.content,o)?a:null}function bB(t,e,n){for(let r=n;r0;f--,p--){let m=s.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(f)>-1?a=f:s.before(f)==p&&o.splice(1,0,-f)}let l=o.indexOf(a),u=[],d=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(u.push(m),p==r.openStart)break;f=m.content}for(let f=d-1;f>=0;f--){let p=u[f],m=vB(p.type);if(m&&!p.sameMarkup(s.node(Math.abs(a)-1)))d=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+d+1)%(r.openStart+1),m=u[p];if(m)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>h));f--){let p=o[f];p<0||(e=s.before(p),n=i.after(p))}}function Kj(t,e,n,r,s){if(er){let i=s.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(O.empty,!0))}return t}function wB(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=xB(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new H(O.from(r),0,0))}function SB(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=s.depth;l>o;l--)s.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=s.depth;l>0&&n==s.start(l);l--)n=s.before(l);r=t.doc.resolve(e),s=t.doc.resolve(n)}}let i=Gj(r,s);for(let o=0;o0&&(l||r.node(a-1).canReplace(r.index(a-1),s.indexAfter(a-1))))return t.delete(r.before(a),s.after(a))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&s.end(o)-n!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function Gj(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let s=r;s>=0;s--){let i=t.start(s);if(ie.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&n.push(s)}return n}class Bi extends gt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Be.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return Be.fromReplace(e,this.pos,this.pos+1,new H(O.from(s),0,n.isLeaf?0:1))}getMap(){return It.empty}invert(e){return new Bi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bi(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bi(n.pos,n.attr,n.value)}}gt.jsonID("attr",Bi);class nl extends gt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Be.ok(r)}getMap(){return It.empty}invert(e){return new nl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new nl(n.attr,n.value)}}gt.jsonID("docAttr",nl);let eo=class extends Error{};eo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};eo.prototype=Object.create(Error.prototype);eo.prototype.constructor=eo;eo.prototype.name="TransformError";class qj{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new tl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new eo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=H.empty){let s=rh(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new H(O.from(r),0,0))}delete(e,n){return this.replace(e,n,H.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return kB(this,e,n,r),this}replaceRangeWith(e,n,r){return wB(this,e,n,r),this}deleteRange(e,n){return SB(this,e,n),this}lift(e,n){return aB(this,e,n),this}join(e,n=1){return gB(this,e,n),this}wrap(e,n){return uB(this,e,n),this}setBlockType(e,n=e,r,s=null){return dB(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return fB(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new Bi(e,n,r)),this}setDocAttribute(e,n){return this.step(new nl(e,n)),this}addNodeMark(e,n){return this.step(new Ar(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof me)n.isInSet(r.marks)&&this.step(new qs(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new qs(e,i)),s=i.removeFromSet(s);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return pB(this,e,n,r),this}addMark(e,n,r){return sB(this,e,n,r),this}removeMark(e,n,r){return iB(this,e,n,r),this}clearIncompatible(e,n,r){return O0(this,e,n,r),this}}const kf=Object.create(null);class ne{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new NB(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;i--){let o=n<0?di(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):di(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ft(e.node(0))}static atStart(e){return di(e,e,0,0,1)||new Ft(e)}static atEnd(e){return di(e,e,e.content.size,e.childCount,-1)||new Ft(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=kf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in kf)throw new RangeError("Duplicate use of selection JSON ID "+e);return kf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Y.between(this.$anchor,this.$head).getBookmark()}}ne.prototype.visible=!0;class NB{constructor(e,n){this.$from=e,this.$to=n}}let rk=!1;function sk(t){!rk&&!t.parent.inlineContent&&(rk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Y extends ne{constructor(e,n=e){sk(e),sk(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ne.near(r);let s=e.resolve(n.map(this.anchor));return new Y(s.parent.inlineContent?s:r,r)}replace(e,n=H.empty){if(super.replace(e,n),n==H.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Y&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sh(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Y(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let s=e.resolve(n);return new this(s,r==n?s:e.resolve(r))}static between(e,n,r){let s=e.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=ne.findFrom(n,r,!0)||ne.findFrom(n,-r,!0);if(i)n=i.$head;else return ne.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(ne.findFrom(e,-r,!0)||ne.findFrom(e,r,!0)).$anchor,e.pos0?0:1);s>0?o=0;o+=s){let a=e.child(o);if(a.isAtom){if(!i&&J.isSelectable(a))return J.create(t,n-(s<0?a.nodeSize:0))}else{let l=di(t,a,n+s,s<0?a.childCount:0,s,i);if(l)return l}n+=a.nodeSize*s}return null}function ik(t,e,n){let r=t.steps.length-1;if(r{o==null&&(o=d)}),t.setSelection(ne.near(t.doc.resolve(o),n))}const ok=1,cc=2,ak=4;class jB extends qj{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=cc,this}ensureMarks(e){return me.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&cc)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~cc,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||me.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(n);i=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ne.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ak,this}get scrolledIntoView(){return(this.updated&ak)>0}}function lk(t,e){return!e||!t?t:t.bind(e)}class qo{constructor(e,n,r){this.name=e,this.init=lk(n.init,r),this.apply=lk(n.apply,r)}}const EB=[new qo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new qo("selection",{init(t,e){return t.selection||ne.atStart(e.doc)},apply(t){return t.selection}}),new qo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new qo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class wf{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=EB.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new qo(r.key,r.spec.state,r))})}}class js{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new wf(e.schema,e.plugins),i=new js(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Bs.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=ne.fromJSON(i.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[o.name]=u.fromJSON.call(l,e,n[a],i);return}}i[o.name]=o.init(e,i)}}),i}}function Jj(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=Jj(s,e,{})),n[r]=s}return n}class ve{constructor(e){this.spec=e,this.props={},e.props&&Jj(e.props,this,this.props),this.key=e.key?e.key.key:Yj("plugin")}getState(e){return e[this.key]}}const Sf=Object.create(null);function Yj(t){return t in Sf?t+"$"+ ++Sf[t]:(Sf[t]=0,t+"$")}class Fe{constructor(e="key"){this.key=Yj(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Xj=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Zj(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Qj=(t,e,n)=>{let r=Zj(t,n);if(!r)return!1;let s=F0(r);if(!s){let o=r.blockRange(),a=o&&vo(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let i=s.nodeBefore;if(lE(t,s,e,-1))return!0;if(r.parent.content.size==0&&(to(i,"end")||J.isSelectable(i)))for(let o=r.depth;;o--){let a=rh(t.doc,r.before(o),r.after(o),H.empty);if(a&&a.slice.size1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},TB=(t,e,n)=>{let r=Zj(t,n);if(!r)return!1;let s=F0(r);return s?eE(t,s,e):!1},MB=(t,e,n)=>{let r=nE(t,n);if(!r)return!1;let s=V0(r);return s?eE(t,s,e):!1};function eE(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let d=s.lastChild;if(!d)return!1;s=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let u=rh(t.doc,i,l,H.empty);if(!u||u.from!=i||u instanceof Re&&u.slice.size>=l-i)return!1;if(n){let d=t.tr.step(u);d.setSelection(Y.create(d.doc,i)),n(d.scrollIntoView())}return!0}function to(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const tE=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=F0(r)}let o=i&&i.nodeBefore;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function F0(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function nE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=nE(t,n);if(!r)return!1;let s=V0(r);if(!s)return!1;let i=s.nodeAfter;if(lE(t,s,e,1))return!0;if(r.parent.content.size==0&&(to(i,"start")||J.isSelectable(i))){let o=rh(t.doc,r.before(),r.after(),H.empty);if(o&&o.slice.size{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof J,s;if(r){if(n.node.isTextblock||!is(t.doc,n.from))return!1;s=n.from}else if(s=nh(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(J.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},AB=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!is(t.doc,n.to))return!1;r=n.to}else if(r=nh(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},DB=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&vo(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},iE=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` -`).scrollIntoView()),!0)};function $0(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),o=$0(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(ne.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},oE=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof Ft||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=$0(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index(){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(nr(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&vo(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)};function RB(t){return(e,n)=>{if(e.selection instanceof J&&e.selection.node.isBlock){let{$from:p}=e.selection;return!p.parentOffset||!nr(e.doc,p.pos)?!1:(n&&n(e.tr.split(p.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let r=e.tr;!e.selection.empty&&(e.selection instanceof Y||e.selection instanceof Ft)&&r.deleteSelection();let{$from:s}=r.selection,i=r.steps.length,o=[],a,l,u=!1,d=!1;for(let p=s.depth;;p--)if(s.node(p).isBlock){u=s.end(p)==s.pos+(s.depth-p),d=s.start(p)==s.pos-(s.depth-p),l=$0(s.node(p-1).contentMatchAt(s.indexAfter(p-1))),o.unshift(u&&l?{type:l}:null),a=p;break}else{if(p==1)return!1;o.unshift(null)}let h=s.pos,f=nr(r.doc,h,o.length,o);if(f||(o[0]=l?{type:l}:null,f=nr(r.doc,h,o.length,o)),!f)return!1;if(r.split(h,o.length,o),!u&&d&&s.node(a).type!=l){let p=r.mapping.slice(i),m=p.map(s.before(a)),g=r.doc.resolve(m);l&&s.node(a-1).canReplaceWith(g.index(),g.index()+1,l)&&r.setNodeMarkup(p.map(s.before(a)),l)}return n&&n(r.scrollIntoView()),!0}}const _B=RB(),IB=(t,e)=>{let{$from:n,to:r}=t.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),e&&e(t.tr.setSelection(J.create(t.doc,s))),!0)};function OB(t,e,n){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.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)||!(s.isTextblock||is(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function lE(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,a,l=s.type.spec.isolating||i.type.spec.isolating;if(!l&&OB(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let p=e.pos+i.nodeSize,m=O.empty;for(let b=o.length-1;b>=0;b--)m=O.from(o[b].create(null,m));m=O.from(s.copy(m));let g=t.tr.step(new Ye(e.pos-1,p,e.pos,p,new H(m,1,0),o.length,!0)),y=g.doc.resolve(p+2*o.length);y.nodeAfter&&y.nodeAfter.type==s.type&&is(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&l?null:ne.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),f=h&&vo(h);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(h,f).scrollIntoView()),!0;if(u&&to(i,"start",!0)&&to(s,"end")){let p=s,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=i,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=O.empty;for(let k=m.length-1;k>=0;k--)b=O.from(m[k].copy(b));let x=t.tr.step(new Ye(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new H(b,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function cE(t){return function(e,n){let r=e.selection,s=t<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(e.tr.setSelection(Y.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const BB=cE(-1),zB=cE(1);function FB(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),a=o&&B0(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function ck(t,e=null){return function(n,r){let s=!1;for(let i=0;i{if(s)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)s=!0;else{let d=n.doc.resolve(u),h=d.index();s=d.parent.canReplaceWith(h,h+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);i=new Iu(l,l,e.depth),e.endIndex=0;d--)i=O.from(n[d].type.create(n[d].attrs,i));t.step(new Ye(e.start-(r?2:0),e.end,e.start,e.end,new H(i,0,0),n.length,!0));let o=0;for(let d=0;do.childCount>0&&o.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?UB(e,n,t,i):KB(e,n,i):!0:!1}}function UB(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);ig;m--)p-=s.child(m).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),o=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==s.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(a?0:1),d+1,o.content.append(l?O.empty:O.from(s))))return!1;let h=i.pos,f=h+o.nodeSize;return r.step(new Ye(h-(a?1:0),f+(l?1:0),h+1,f-1,new H((a?O.empty:O.from(s.copy(O.empty))).append(l?O.empty:O.from(s.copy(O.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function GB(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,u=>u.childCount>0&&u.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let a=i.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,d=O.from(u?t.create():null),h=new H(O.from(t.create(null,O.from(a.type.create(null,d)))),u?3:1,0),f=i.start,p=i.end;n(e.tr.step(new Ye(f-(u?3:1),p,f,p,h,1,!0)).scrollIntoView())}return!0}}const nt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},no=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let _m=null;const Gn=function(t,e,n){let r=_m||(_m=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},qB=function(){_m=null},Js=function(t,e,n,r){return n&&(uk(t,e,n,r,-1)||uk(t,e,n,r,1))},JB=/^(img|br|input|textarea|hr)$/i;function uk(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Zt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Sl(t)||JB.test(t.nodeName)||t.contentEditable=="false")return!1;e=nt(t)+(s<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else t=o,e=s<0?Zt(t):0}else return!1}}function Zt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function YB(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Zt(t)}else if(t.parentNode&&!Sl(t))e=nt(t),t=t.parentNode;else return null}}function XB(t,e){for(;;){if(t.nodeType==3&&e2),Jt=ro||(On?/Mac/.test(On.platform):!1),hE=On?/Win/.test(On.platform):!1,Zn=/Android \d/.test(as),Nl=!!dk&&"webkitFontSmoothing"in dk.documentElement.style,t6=Nl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function n6(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Fn(t,e){return typeof t=="number"?t:t[e]}function r6(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function hk(t,e,n){if(!zm(e)&&e.left==0)return;let r=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=no(o);continue}let a=o,l=a==i.body,u=l?n6(i):r6(a),d=0,h=0;if(e.topu.bottom-Fn(r,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+Fn(s,"top")-u.top:e.bottom-u.bottom+Fn(s,"bottom")),e.leftu.right-Fn(r,"right")&&(d=e.right-u.right+Fn(s,"right")),d||h)if(l)i.defaultView.scrollBy(d,h);else{let p=a.scrollLeft,m=a.scrollTop;h&&(a.scrollTop+=h),d&&(a.scrollLeft+=d);let g=a.scrollLeft-p,y=a.scrollTop-m;e={left:e.left-g,top:e.top-y,right:e.right-g,bottom:e.bottom-y}}let f=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:no(o)}}function s6(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=n+1;o=n-20){r=a,s=l.top;break}}return{refDOM:r,refTop:s,stack:fE(t.dom)}}function fE(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=no(r));return e}function i6({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;pE(n,r==0?0:r-e)}function pE(t,e){for(let n=0;n=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=d,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=h+1)}}return!n&&l&&(n=l,s=u,r=0),n&&n.nodeType==3?a6(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:mE(n,s)}function a6(t,e){let n=t.nodeValue.length,r=document.createRange(),s;for(let i=0;i=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:t,offset:0}}function W0(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function l6(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,s,i)}function u6(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?s=a.posBefore:(!o&&l.right-1?s:t.docView.posFromDOM(e,n,-1)}function gE(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&s++}let u;Nl&&s&&r.nodeType==1&&(u=r.childNodes[s-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&s--,r==t.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(a=u6(t,r,s,e))}a==null&&(a=c6(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function zm(t){return t.top=0&&s==r.nodeValue.length?(l--,d=1):n<0?l--:u++,Ro(gr(Gn(r,l,u),d),d<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Zt(r))){let l=r.childNodes[s-1];if(l.nodeType==1)return Nf(l.getBoundingClientRect(),!1)}if(i==null&&s=0)}if(i==null&&s&&(n<0||s==Zt(r))){let l=r.childNodes[s-1],u=l.nodeType==3?Gn(l,Zt(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Ro(gr(u,1),!1)}if(i==null&&s=0)}function Ro(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Nf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function yE(t,e,n){let r=t.state,s=t.root.activeElement;r!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),s!=t.dom&&s&&s.focus()}}function f6(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return yE(t,e,()=>{let{node:i}=t.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let o=xE(t,s.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Gn(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;ud.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const p6=/[\u0590-\u08ac]/;function m6(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,a=t.domSelection();return a?!p6.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:o:yE(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&u==g;try{a.collapse(d,h),l&&(l!=d||u!=h)&&a.extend&&a.extend(l,u)}catch{}return f!=null&&(a.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let fk=null,pk=null,mk=!1;function g6(t,e,n){return fk==e&&pk==n?mk:(fk=e,pk=n,mk=n=="up"||n=="down"?f6(t,e,n):m6(t,e,n))}const rn=0,gk=1,Es=2,wn=3;class Cl{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=rn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nnt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!n||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||o instanceof vE){s=e-i;break}i=a}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof bE&&i.side>=0;r--);if(n<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&n&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?nt(i.dom)+1:0}}else{let i,o=!0;for(;i=r=d&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let h=a;h>0;h--){let f=this.children[h-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){s=nt(f.dom)+1;break}e-=f.size}s==-1&&(s=0)}if(s>-1&&(u>n||a==this.children.length-1)){n=u;for(let d=a+1;dm&&on){let m=a;a=l,l=m}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}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,s=0;s=r:er){let a=r+i.border,l=o-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Es:gk,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=wn:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Es:wn}r=o}this.dirty=Es}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Es:gk;n.dirty{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.hasAttribute("contenteditable")||(o.contentEditable="false"),o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==rn&&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}}class x6 extends Cl{constructor(e,n,r,s){super(e,[],n,null),this.textDOM=r,this.text=s}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}}class Wr extends Cl{constructor(e,n,r,s,i){super(e,[],r,s),this.mark=n,this.spec=i}static create(e,n,r,s){let i=s.nodeViews[n.type.name],o=i&&i(n,s,r);return(!o||!o.dom)&&(o=ei.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Wr(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&wn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=wn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=rn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=Vm(i,0,e,r));for(let a=0;a{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,s),d=u&&u.dom,h=u&&u.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:h}=ei.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=SE(d,r,n),u?l=new y6(e,n,r,s,d,h||null,f,u):n.isText?new oh(e,n,r,s,d,f):new Ur(e,n,r,s,d,h||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 s=this.children[r];if(this.dom.contains(s.dom.parentNode)){n.contentElement=s.dom.parentNode;break}}if(!n.contentElement){let r=e&&e.find(s=>s.nodeType==1&&e.indexOf(s.parentNode)<0&&this.dom.contains(s));r?n.contentElement=r:n.getContent=()=>O.empty}}return n}matchesNode(e,n,r){return this.dirty==rn&&e.eq(this.node)&&Bu(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new v6(this,o&&o.node,e);S6(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e,d):u.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?me.none:this.node.child(d).marks,r,e,d),l.placeWidget(u,e,s)},(u,d,h,f)=>{l.syncToMarks(u.marks,r,e,f);let p;l.findNodeMatch(u,d,h,f)||a&&e.state.selection.from>s&&e.state.selection.to-1&&l.updateNodeAt(u,d,h,p,e)||l.updateNextNode(u,d,h,e,f,s)||l.addNode(u,d,h,e,s),s+=u.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Es)&&(o&&this.protectLocalComposition(e,o),kE(this.contentDOM,this.children,e),ro&&N6(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof Y)||rn+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,a=C6(this.node.content,o,r-n,s-n);return a<0?null:{node:i,pos:a,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new x6(this,i,n,s);e.input.compositionNodes.push(o),this.children=Vm(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==wn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,s),!0)}updateInner(e,n,r,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=rn}updateOuterDeco(e){if(Bu(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=wE(this.dom,this.nodeDOM,Fm(this.outerDeco,this.node,n),Fm(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function xk(t,e,n,r,s){SE(r,e,t);let i=new Ur(void 0,t,e,n,r,r,r);return i.contentDOM&&i.updateChildren(s,0),i}class oh extends Ur{constructor(e,n,r,s,i,o){super(e,n,r,s,i,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,s){return this.dirty==wn||this.dirty!=rn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=rn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=rn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new oh(this.parent,s,this.outerDeco,this.innerDeco,i,i)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=wn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class vE extends Cl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==rn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class y6 extends Ur{constructor(e,n,r,s,i,o,a,l){super(e,n,r,s,i,o,a),this.spec=l}update(e,n,r,s){if(this.dirty==wn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,s){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function kE(t,e,n){let r=t.firstChild,s=!1;for(let i=0;i>1,a=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=Wr.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Wr)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(s-1))break;--s,i.set(a,s),o.push(a)}}return{index:s,matched:i,matches:o.reverse()}}function w6(t,e){return t.type.side-e.type.side}function S6(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let u=0;ui;)a.push(s[o++]);let m=i+f.nodeSize;if(f.isText){let y=m;o!y.inline):a.slice();r(f,g,e.forChild(i,f),p),i=m}}function N6(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function C6(t,e,n,r){for(let s=0,i=0;s=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Vm(t,e,n,r,s){let i=[];for(let o=0,a=0;o=n||d<=e?i.push(l):(un&&i.push(l.slice(n-u,l.size,r)))}return i}function U0(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(ih(n)){for(l=o;s&&!s.node;)s=s.parent;let h=s.node;if(s&&h.isAtom&&J.isSelectable(h)&&s.parent&&!(h.isInline&&ZB(n.focusNode,n.focusOffset,s.dom))){let f=s.posBefore;u=new J(o==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,f=o;for(let p=0;p{(n.anchorNode!=r||n.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!NE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function E6(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,nt(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Rt&&Hr<=11&&(n.disabled=!0,n.disabled=!1)}function CE(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(wk(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else wk(t)}function wk(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function K0(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||Y.between(e,n,r)}function Sk(t){return t.editable&&!t.hasFocus()?!1:jE(t)}function jE(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function T6(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Js(e.node,e.offset,n.anchorNode,n.anchorOffset)}function $m(t,e){let{$anchor:n,$head:r}=t.selection,s=e>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&ne.findFrom(i,e)}function vr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Nk(t,e,n){let r=t.state.selection;if(r instanceof Y)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return vr(t,new Y(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=$m(t.state,e);return s&&s instanceof J?vr(t,s):!1}else if(!(Jt&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let a=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?J.isSelectable(i)?vr(t,new J(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):Nl?vr(t,new Y(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return vr(t,new Y(e>0?r.$to:r.$from));{let s=$m(t.state,e);return s?vr(t,s):!1}}}function zu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ma(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ai(t,e){return e<0?M6(t):P6(t)}function M6(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(nn&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ma(a,-1))s=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(EE(n))break;{let a=n.previousSibling;for(;a&&ma(a,-1);)s=n.parentNode,i=nt(a),a=a.previousSibling;if(a)n=a,r=zu(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Hm(t,n,r):s&&Hm(t,s,i)}function P6(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=zu(n),i,o;for(;;)if(r{t.state==s&&rr(t)},50)}function Ck(t,e){let n=t.state.doc.resolve(e);if(!(st||hE)&&n.parent.inlineContent){let s=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o1)return i.lefts.top&&o1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function jk(t,e,n){let r=t.state.selection;if(r instanceof Y&&!r.empty||n.indexOf("s")>-1||Jt&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=$m(t.state,e);if(o&&o instanceof J)return vr(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,a=r instanceof Ft?ne.near(o,e):ne.findFrom(o,e);return a?vr(t,a):!1}return!1}function Ek(t,e){if(!(t.state.selection instanceof Y))return!0;let{$head:n,$anchor:r,empty:s}=t.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(n.pos-i.nodeSize,n.pos):o.delete(n.pos,n.pos+i.nodeSize),t.dispatch(o),!0}return!1}function Tk(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function L6(t){if(!mt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Tk(t,r,"true"),setTimeout(()=>Tk(t,r,"false"),20)}return!1}function R6(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function _6(t,e){let n=e.keyCode,r=R6(e);if(n==8||Jt&&n==72&&r=="c")return Ek(t,-1)||ai(t,-1);if(n==46&&!e.shiftKey||Jt&&n==68&&r=="c")return Ek(t,1)||ai(t,1);if(n==13||n==27)return!0;if(n==37||Jt&&n==66&&r=="c"){let s=n==37?Ck(t,t.state.selection.from)=="ltr"?-1:1:-1;return Nk(t,s,r)||ai(t,s)}else if(n==39||Jt&&n==70&&r=="c"){let s=n==39?Ck(t,t.state.selection.from)=="ltr"?1:-1:1;return Nk(t,s,r)||ai(t,s)}else{if(n==38||Jt&&n==80&&r=="c")return jk(t,-1,r)||ai(t,-1);if(n==40||Jt&&n==78&&r=="c")return L6(t)||jk(t,1,r)||ai(t,1);if(r==(Jt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function G0(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||ei.fromSchema(t.state.schema),a=LE(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=DE[u.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let m=a.createElement(d[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),h++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${s} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` + */var Qi=v;function N5(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var C5=typeof Object.is=="function"?Object.is:N5,j5=Qi.useState,E5=Qi.useEffect,T5=Qi.useLayoutEffect,M5=Qi.useDebugValue;function P5(t,e){var n=e(),r=j5({inst:{value:n,getSnapshot:e}}),s=r[0].inst,i=r[1];return T5(function(){s.value=n,s.getSnapshot=e,xf(s)&&i({inst:s})},[t,n,e]),E5(function(){return xf(s)&&i({inst:s}),t(function(){xf(s)&&i({inst:s})})},[t]),M5(n),n}function xf(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!C5(t,n)}catch{return!0}}function A5(t,e){return e()}var D5=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?A5:P5;mj.useSyncExternalStore=Qi.useSyncExternalStore!==void 0?Qi.useSyncExternalStore:D5;pj.exports=mj;var _0=pj.exports,$v=Object.defineProperty,L5=(t,e)=>{let n={};for(var r in t)$v(n,r,{get:t[r],enumerable:!0});return $v(n,Symbol.toStringTag,{value:"Module"}),n};function tt(t){this.content=t}tt.prototype={constructor:tt,find:function(t){for(var e=0;e>1}};tt.from=function(t){if(t instanceof tt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new tt(e)};function gj(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let s=t.child(r),i=e.child(r);if(s==i){n+=s.nodeSize;continue}if(!s.sameMarkup(i))return n;if(s.isText&&s.text!=i.text){let o=s.text,a=i.text,l=0;for(;o[l]==a[l];l++)n++;return l&&l0&&f>0&&u[h-1]==d[f-1];)h--,f--,n--,r--;return h&&f&&h=56320&&t<57344}function bj(t){return t>=55296&&t<56320}class O{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;re&&r(l,s+a,i||null,o)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,n-d),r,s+d)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,s){let i="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?s?typeof s=="function"?s(a):s:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:i+=r),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),i=1);ie)for(let i=0,o=0;oe&&((on)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),s+=a.nodeSize),o=l}return new O(r,s)}cutByIndex(e,n){return e==n?O.empty:e==0&&n==this.content.length?this:new O(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let s=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return s[e]=n,new O(s,i)}addToStart(e){return new O([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new O(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;nthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),i=r+s.nodeSize;if(i>=e)return i==e?oc(n+1,i):oc(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return O.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return O.fromArray(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return O.empty;let n,r=0;for(let s=0;sthis.type.rank&&(n||(n=e.slice(0,s)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;nr.type.rank-s.type.rank),n}};me.none=[];class Za extends Error{}class H{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=kj(this.content,e+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new H(r,this.openStart,this.openEnd)}removeBetween(e,n){return new H(vj(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return H.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new H(O.fromJSON(e,n.content),r,s)}static maxOpen(e,n=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)s++;return new H(e,r,s)}}H.empty=new H(O.empty,0,0);function vj(t,e,n){let{index:r,offset:s}=t.findIndex(e),i=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(s==e||i.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(vj(i.content,e-s-1,n-s-1)))}function kj(t,e,n,r,s,i){let{index:o,offset:a}=t.findIndex(e),l=t.maybeChild(o);if(a==e||l.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let u=kj(l.content,e-a-1,n,o==0?r-1:0,o==t.childCount-1?s-1:0,l);return u&&t.replaceChild(o,l.copy(u))}function R5(t,e,n){if(n.openStart>t.depth)throw new Za("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Za("Inconsistent open depths");return wj(t,e,n,0)}function wj(t,e,n,r){let s=t.index(r),i=t.node(r);if(s==e.index(r)&&r=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ha(t,e,n,r){let s=(e||t).node(n),i=0,o=e?e.index(n):s.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Is(t.nodeAfter,r),i++));for(let a=i;as&&Pm(t,e,s+1),o=r.depth>s&&Pm(n,r,s+1),a=[];return ha(null,t,s,a),i&&o&&e.index(s)==n.index(s)?(Sj(i,o),Is(Os(i,Nj(t,e,n,r,s+1)),a)):(i&&Is(Os(i,_u(t,e,s+1)),a),ha(e,n,s,a),o&&Is(Os(o,_u(n,r,s+1)),a)),ha(r,null,s,a),new O(a)}function _u(t,e,n){let r=[];if(ha(null,t,n,r),t.depth>n){let s=Pm(t,e,n+1);Is(Os(s,_u(t,e,n+1)),r)}return ha(e,null,n,r),new O(r)}function _5(t,e){let n=e.depth-t.openStart,s=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)s=e.node(i).copy(O.from(s));return{start:s.resolveNoCache(t.openStart+n),end:s.resolveNoCache(s.content.size-t.openEnd-n)}}class Qa{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(n);return r?e.child(n).cut(r):s}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let i=0;i0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Iu(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,i=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(i),u=i-l;if(r.push(o,a,s+l),!u||(o=o.child(a),o.isText))break;i=u-1,s+=l+1}return new Qa(n,r,i)}static resolveCached(e,n){let r=Hv.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Cj(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=O.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=s;ln.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let s=O.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};Bs.prototype.text=void 0;class Ou extends Bs{constructor(e,n,r,s){if(super(e,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cj(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ou(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ou(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Cj(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Gs{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new z5(e,n);if(r.next==null)return Gs.empty;let s=jj(r);r.next&&r.err("Unexpected trailing text");let i=K5(U5(s));return G5(i,r),i}matchType(e){for(let n=0;nu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let s=0;s{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return i}).join(` +`)}}Gs.empty=new Gs(!0);class z5{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 jj(t){let e=[];do e.push(F5(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function F5(t){let e=[];do e.push(V5(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function V5(t){let e=W5(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=$5(t,e);else break;return e}function Wv(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function $5(t,e){let n=Wv(t),r=n;return t.eat(",")&&(t.next!="}"?r=Wv(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function H5(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let s=[];for(let i in n){let o=n[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&t.err("No node type or group '"+e+"' found"),s}function W5(t){if(t.eat("(")){let e=jj(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=H5(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 U5(t){let e=[[]];return s(i(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function s(o,a){o.forEach(l=>l.to=a)}function i(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(i(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=i(o.exprs[l],a);if(l==o.exprs.length-1)return u;s(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),s(i(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return s(i(o.expr,a),l),s(i(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(i(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let d=0;d{u||s.push([a,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let i=e[r.join(",")]=new Gs(r.indexOf(t.length-1)>-1);for(let o=0;o-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.defaultAttrs?this.defaultAttrs:Mj(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Bs(this,this.computeAttrs(e),O.from(n),me.setFrom(r))}createChecked(e=null,n,r){return n=O.from(n),this.checkContent(n),new Bs(this,this.computeAttrs(e),n,me.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=O.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let s=this.contentMatch.matchFragment(n),i=s&&s.fillBefore(O.empty,!0);return i?new Bs(this,e,n.append(i),me.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;nr[i]=new Dj(i,n,o));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function q5(t,e,n){let r=n.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class J5{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?q5(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class th{constructor(e,n,r,s){this.name=e,this.rank=n,this.schema=r,this.spec=s,this.attrs=Aj(e,s.attrs),this.excluded=null;let i=Tj(this.attrs);this.instance=i?new me(this,i):null}create(e=null){return!e&&this.instance?this.instance:new me(this,Mj(this.attrs,e))}static compile(e,n){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new th(i,s++,n,o)),r}removeFromSet(e){for(var n=0;n-1}}class Lj{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in e)n[s]=e[s];n.nodes=tt.from(e.nodes),n.marks=tt.from(e.marks||{}),this.nodes=Kv.compile(this.spec.nodes,this),this.marks=th.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Gs.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?Gv(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Gv(this,o.split(" "))}this.nodeFromJSON=s=>Bs.fromJSON(this,s),this.markFromJSON=s=>me.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Kv){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,s)}text(e,n){let r=this.nodes.text;return new Ou(r,r.defaultAttrs,e,me.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Gv(t,e){let n=[];for(let r=0;r-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Y5(t){return t.tag!=null}function X5(t){return t.style!=null}class $r{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(Y5(s))this.tags.push(s);else if(X5(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Jv(this,n,!1);return r.addAll(e,me.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Jv(this,n,!0);return r.addAll(e,me.none,n.from,n.to),H.maxOpen(r.finish())}matchTag(e,n,r){for(let s=r?this.tags.indexOf(r)+1:0;se.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o{r(o=Yv(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=Yv(o)),o.node||o.ignore||o.mark||(o.node=s)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $r(e,$r.schemaRules(e)))}}const Rj={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Z5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},_j={ol:!0,ul:!0},el=1,Dm=2,fa=4;function qv(t,e,n){return e!=null?(e?el:0)|(e==="full"?Dm:0):t&&t.whitespace=="pre"?el|Dm:n&~fa}class ac{constructor(e,n,r,s,i,o){this.type=e,this.attrs=n,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=me.none,this.match=i||(o&fa?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(O.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&el)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let n=O.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(O.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Rj.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Jv{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,i,o=qv(null,n.preserveWhitespace,0)|(r?fa:0);s?i=new ac(s.type,s.attrs,me.none,!0,n.topMatch||s.type.contentMatch,o):r?i=new ac(null,null,me.none,!0,null,o):i=new ac(e.schema.topNodeType,null,me.none,!0,null,o),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,s=this.top,i=s.options&Dm?"full":this.localPreserveWS||(s.options&el)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,` +`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,s){let i,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=s==null?null:e.childNodes[s];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,n);this.findAtPoint(e,i)}findPlace(e,n,r){let s,i;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!s||s.length>u.length+a)&&(s=u,i=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!s)return null;this.sync(i);for(let o=0;o(o.type?o.type.allowsMarkType(u.type):Xv(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new ac(e,n,l,s,null,a)),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|=el)}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 s=r.length-1;s>=0;s--)e+=r[s].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(o(a-1,l))return!0;return!1}else{let d=l>0||l==0&&s?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(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 Q5(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&_j.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function eB(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Yv(t){let e={};for(let n in t)e[n]=t[n];return e}function Xv(t,e){let n=e.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(t))continue;let i=[],o=a=>{i.push(a);for(let l=0;l{if(i.length||o.marks.length){let a=0,l=0;for(;a=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let s=this.marks[e.type.name];return s&&Kc(lc(r),s(e,n),null,e.attrs)}static renderSpec(e,n,r=null,s){return typeof n=="string"?{dom:e.createTextNode(n)}:Kc(e,n,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ei(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Zv(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Zv(e.marks)}}function Zv(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function lc(t){return t.document||window.document}const Qv=new WeakMap;function tB(t){let e=Qv.get(t);return e===void 0&&Qv.set(t,e=nB(t)),e}function nB(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(n=s.slice(0,o),s=s.slice(o+1));let a,l=n?t.createElementNS(n,s):t.createElement(s),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let f=h.indexOf(" ");f>0?l.setAttributeNS(h.slice(0,f),h.slice(f+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=d;hd)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(t.createTextNode(f));else{let{dom:p,contentDOM:m}=Kc(t,f,n,r);if(l.appendChild(p),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const Ij=65535,Oj=Math.pow(2,16);function rB(t,e){return t+e*Oj}function ek(t){return t&Ij}function sB(t){return(t-(t&Ij))/Oj}const Bj=1,zj=2,Gc=4,Fj=8;class Lm{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Fj)>0}get deletedBefore(){return(this.delInfo&(Bj|Gc))>0}get deletedAfter(){return(this.delInfo&(zj|Gc))>0}get deletedAcross(){return(this.delInfo&Gc)>0}}class It{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&It.empty)return It.empty}recover(e){let n=0,r=ek(e);if(!this.inverted)for(let s=0;se)break;let u=this.ranges[a+i],d=this.ranges[a+o],h=l+u;if(e<=h){let f=u?e==l?-1:e==h?1:n:n,p=l+s+(f<0?0:d);if(r)return p;let m=e==(n<0?l:h)?null:rB(a/3,e-l),g=e==l?zj:e==h?Bj:Gc;return(n<0?e!=l:e!=h)&&(g|=Fj),new Lm(p,g,m)}s+=d-u}return r?e+s:new Lm(e+s,0,null)}touches(e,n){let r=0,s=ek(n),i=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;ae)break;let u=this.ranges[a+i],d=l+u;if(e<=d&&a==s*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s=0;n--){let s=e.getMirror(n);this.appendMap(e._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let e=new tl;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;ri&&l!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),n.openStart,n.openEnd);return Be.fromReplace(e,this.from,this.to,i)}invert(){return new yn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Pr(n.pos,r.pos,this.mark)}merge(e){return e instanceof Pr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Pr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Pr(n.from,n.to,e.markFromJSON(n.mark))}}gt.jsonID("addMark",Pr);class yn extends gt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new H(I0(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),n.openStart,n.openEnd);return Be.fromReplace(e,this.from,this.to,r)}invert(){return new Pr(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new yn(n.pos,r.pos,this.mark)}merge(e){return e instanceof yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new yn(n.from,n.to,e.markFromJSON(n.mark))}}gt.jsonID("removeMark",yn);class Ar extends gt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Be.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Be.fromReplace(e,this.pos,this.pos+1,new H(O.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;sr.pos?null:new Ye(n.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ye(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(e,n.slice),n.insert,!!n.structure)}}gt.jsonID("replaceAround",Ye);function Rm(t,e,n){let r=t.resolve(e),s=n-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function iB(t,e,n,r){let s=[],i=[],o,a;t.doc.nodesBetween(e,n,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&d.type.allowsMarkType(r.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,n),m=r.addToSet(h);for(let g=0;gt.step(l)),i.forEach(l=>t.step(l))}function oB(t,e,n,r){let s=[],i=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;i++;let l=null;if(r instanceof th){let u=o.marks,d;for(;d=r.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let d=0;dt.step(new yn(o.from,o.to,o.style)))}function O0(t,e,n,r=n.contentMatch,s=!0){let i=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l=0;l--)t.step(o[l])}function aB(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function vo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,s=0,i=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+s,l=t.$to.indexAfter(r)-i;if(rn;m--)g||r.index(m)>0?(g=!0,d=O.from(r.node(m).copy(d)),h++):l--;let f=O.empty,p=0;for(let m=i,g=!1;m>n;m--)g||s.after(m+1)=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=O.from(n[o].type.create(n[o].attrs,r))}let s=e.start,i=e.end;t.step(new Ye(s,i,s,i,new H(r,0,0),n.length,!0))}function hB(t,e,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,l)&&fB(t.doc,t.mapping.slice(i).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!m?u=!1:!p&&m&&(u=!0)}u===!1&&$j(t,o,a,i),O0(t,t.mapping.slice(i).map(a,1),r,void 0,u===null);let d=t.mapping.slice(i),h=d.map(a,1),f=d.map(a+o.nodeSize,1);return t.step(new Ye(h,f,h+1,f-1,new H(O.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&Vj(t,o,a,i),!1}})}function Vj(t,e,n,r){e.forEach((s,i)=>{if(s.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(s.text);){let l=t.mapping.slice(r).map(n+1+i+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function $j(t,e,n,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+i);t.replaceWith(o,o+1,e.type.schema.text(` +`))}})}function fB(t,e,n){let r=t.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function pB(t,e,n,r,s){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let o=n.create(r,null,s||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ye(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new H(O.from(o),0,0),1,!0))}function nr(t,e,n=1,r){let s=t.resolve(e),i=s.depth-n,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let u=s.depth-1,d=n-2;u>i;u--,d--){let h=s.node(u),f=s.index(u);if(h.type.spec.isolating)return!1;let p=h.content.cutByIndex(f,h.childCount),m=r&&r[d+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[d]||h;if(!h.canReplace(f+1,h.childCount)||!g.type.validContent(p))return!1}let a=s.indexAfter(i),l=r&&r[0];return s.node(i).canReplaceWith(a,a,l?l.type:s.node(i+1).type)}function mB(t,e,n=1,r){let s=t.doc.resolve(e),i=O.empty,o=O.empty;for(let a=s.depth,l=s.depth-n,u=n-1;a>l;a--,u--){i=O.from(s.node(a).copy(i));let d=r&&r[u];o=O.from(d?d.type.create(d.attrs,o):s.node(a).copy(o))}t.step(new Re(e,e,new H(i.append(o),n,n),!0))}function is(t,e){let n=t.resolve(e),r=n.index();return Hj(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function gB(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let s=0;s0?(i=r.node(s+1),a++,o=r.node(s).maybeChild(a)):(i=r.node(s).maybeChild(a-1),o=r.node(s+1)),i&&!i.isTextblock&&Hj(i,o)&&r.node(s).canReplace(a,a+1))return e;if(s==0)break;e=n<0?r.before(s):r.after(s)}}function xB(t,e,n){let r=null,{linebreakReplacement:s}=t.doc.type.schema,i=t.doc.resolve(e-n),o=i.node().type;if(s&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(s);d&&!h?r=!1:!d&&h&&(r=!0)}let a=t.steps.length;if(r===!1){let d=t.doc.resolve(e+n);$j(t,d.node(),d.before(),a)}o.inlineContent&&O0(t,e+n-1,o,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),u=l.map(e-n);if(t.step(new Re(u,l.map(e+n,-1),H.empty,!0)),r===!0){let d=t.doc.resolve(u);Vj(t,d.node(),d.before(),t.steps.length)}return t}function yB(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 s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,n))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,n))return r.after(s+1);if(i=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),u=r.node(o),d=!1;if(i==1)d=u.canReplace(l,l,s);else{let h=u.contentMatchAt(l).findWrapping(s.firstChild.type);d=h&&u.canReplaceWith(l,l,h[0])}if(d)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function rh(t,e,n=e,r=H.empty){if(e==n&&!r.size)return null;let s=t.resolve(e),i=t.resolve(n);return Uj(s,i,r)?new Re(e,n,r):new bB(s,i,r).fit()}function Uj(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class bB{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=O.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=O.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,a=s.depth;for(;o&&a&&i.childCount==1;)i=i.firstChild.content,o--,a--;let l=new H(i,o,a);return e>-1?new Ye(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Re(r.pos,s.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=nk(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],d,h=null;if(n==1&&(o?u.matchType(o.type)||(h=u.fillBefore(O.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:h};if(n==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:d};if(i&&u.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced;return rk(e,-1)<=n?!1:(this.unplaced.size>1&&rk(e,1)>r&&r++,this.unplaced=new H(e,n+1,r),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,s=nk(e,n);if(s.childCount<=1&&n>0){let i=e.size-n<=n+s.size;this.unplaced=new H(Ko(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new H(Ko(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:s,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g1||l==0||g.content.size)&&(h=y,d.push(Kj(g.mark(f.allowedMarks(g.marks)),u==1?l:0,u==a.childCount?p:-1)))}let m=u==a.childCount;m||(p=-1),this.placed=Go(this.placed,n,O.from(d)),this.frontier[n].match=h,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],i=n=0;a--){let{match:l,type:u}=this.frontier[a],d=vf(e,a,u,l,!0);if(!d||d.childCount)continue e}return{depth:n,fit:o,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Go(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=Go(this.placed,this.depth,O.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(O.empty,!0);n.childCount&&(this.placed=Go(this.placed,this.frontier.length,n))}}function Ko(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ko(t.firstChild.content,e-1,n)))}function Go(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Go(t.lastChild.content,e-1,n)))}function nk(t,e){for(let n=0;n1&&(r=r.replaceChild(0,Kj(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(O.empty,!0)))),t.copy(r)}function vf(t,e,n,r,s){let i=t.node(e),o=s?t.indexAfter(e):t.index(e);if(o==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,o);return a&&!vB(n,i.content,o)?a:null}function vB(t,e,n){for(let r=n;r0;f--,p--){let m=s.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(f)>-1?a=f:s.before(f)==p&&o.splice(1,0,-f)}let l=o.indexOf(a),u=[],d=r.openStart;for(let f=r.content,p=0;;p++){let m=f.firstChild;if(u.push(m),p==r.openStart)break;f=m.content}for(let f=d-1;f>=0;f--){let p=u[f],m=kB(p.type);if(m&&!p.sameMarkup(s.node(Math.abs(a)-1)))d=f;else if(m||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+d+1)%(r.openStart+1),m=u[p];if(m)for(let g=0;g=0&&(t.replace(e,n,r),!(t.steps.length>h));f--){let p=o[f];p<0||(e=s.before(p),n=i.after(p))}}function Gj(t,e,n,r,s){if(er){let i=s.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(O.empty,!0))}return t}function SB(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let s=yB(t.doc,e,r.type);s!=null&&(e=n=s)}t.replaceRange(e,n,new H(O.from(r),0,0))}function NB(t,e,n){let r=t.doc.resolve(e),s=t.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(n),a=!1;for(let l=r.depth;l>o;l--)r.node(l).type.spec.isolating&&(a=!0);for(let l=s.depth;l>o;l--)s.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=r.depth;l>0&&e==r.start(l);l--)e=r.before(l);for(let l=s.depth;l>0&&n==s.start(l);l--)n=s.before(l);r=t.doc.resolve(e),s=t.doc.resolve(n)}}let i=qj(r,s);for(let o=0;o0&&(l||r.node(a-1).canReplace(r.index(a-1),s.indexAfter(a-1))))return t.delete(r.before(a),s.after(a))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&s.end(o)-n!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return t.delete(r.before(o),n);t.delete(e,n)}function qj(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let s=r;s>=0;s--){let i=t.start(s);if(ie.pos+(e.depth-s)||t.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==t.depth&&s==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&n.push(s)}return n}class Bi extends gt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Be.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return Be.fromReplace(e,this.pos,this.pos+1,new H(O.from(s),0,n.isLeaf?0:1))}getMap(){return It.empty}invert(e){return new Bi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bi(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Bi(n.pos,n.attr,n.value)}}gt.jsonID("attr",Bi);class nl extends gt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let s in e.attrs)n[s]=e.attrs[s];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Be.ok(r)}getMap(){return It.empty}invert(e){return new nl(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new nl(n.attr,n.value)}}gt.jsonID("docAttr",nl);let eo=class extends Error{};eo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};eo.prototype=Object.create(Error.prototype);eo.prototype.constructor=eo;eo.prototype.name="TransformError";class Jj{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new tl}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new eo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,n=-1e9;for(let r=0;r{e=Math.min(e,a),n=Math.max(n,l)})}return e==1e9?null:{from:e,to:n}}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=H.empty){let s=rh(this.doc,e,n,r);return s&&this.step(s),this}replaceWith(e,n,r){return this.replace(e,n,new H(O.from(r),0,0))}delete(e,n){return this.replace(e,n,H.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return wB(this,e,n,r),this}replaceRangeWith(e,n,r){return SB(this,e,n,r),this}deleteRange(e,n){return NB(this,e,n),this}lift(e,n){return lB(this,e,n),this}join(e,n=1){return xB(this,e,n),this}wrap(e,n){return dB(this,e,n),this}setBlockType(e,n=e,r,s=null){return hB(this,e,n,r,s),this}setNodeMarkup(e,n,r=null,s){return pB(this,e,n,r,s),this}setNodeAttribute(e,n,r){return this.step(new Bi(e,n,r)),this}setDocAttribute(e,n){return this.step(new nl(e,n)),this}addNodeMark(e,n){return this.step(new Ar(e,n)),this}removeNodeMark(e,n){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n instanceof me)n.isInSet(r.marks)&&this.step(new qs(e,n));else{let s=r.marks,i,o=[];for(;i=n.isInSet(s);)o.push(new qs(e,i)),s=i.removeFromSet(s);for(let a=o.length-1;a>=0;a--)this.step(o[a])}return this}split(e,n=1,r){return mB(this,e,n,r),this}addMark(e,n,r){return iB(this,e,n,r),this}removeMark(e,n,r){return oB(this,e,n,r),this}clearIncompatible(e,n,r){return O0(this,e,n,r),this}}const kf=Object.create(null);class ne{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new CB(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n=0;i--){let o=n<0?di(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):di(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Ft(e.node(0))}static atStart(e){return di(e,e,0,0,1)||new Ft(e)}static atEnd(e){return di(e,e,e.content.size,e.childCount,-1)||new Ft(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=kf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in kf)throw new RangeError("Duplicate use of selection JSON ID "+e);return kf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Y.between(this.$anchor,this.$head).getBookmark()}}ne.prototype.visible=!0;class CB{constructor(e,n){this.$from=e,this.$to=n}}let sk=!1;function ik(t){!sk&&!t.parent.inlineContent&&(sk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Y extends ne{constructor(e,n=e){ik(e),ik(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ne.near(r);let s=e.resolve(n.map(this.anchor));return new Y(s.parent.inlineContent?s:r,r)}replace(e,n=H.empty){if(super.replace(e,n),n==H.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Y&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sh(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Y(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let s=e.resolve(n);return new this(s,r==n?s:e.resolve(r))}static between(e,n,r){let s=e.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let i=ne.findFrom(n,r,!0)||ne.findFrom(n,-r,!0);if(i)n=i.$head;else return ne.near(n,r)}return e.parent.inlineContent||(s==0?e=n:(e=(ne.findFrom(e,-r,!0)||ne.findFrom(e,r,!0)).$anchor,e.pos0?0:1);s>0?o=0;o+=s){let a=e.child(o);if(a.isAtom){if(!i&&J.isSelectable(a))return J.create(t,n-(s<0?a.nodeSize:0))}else{let l=di(t,a,n+s,s<0?a.childCount:0,s,i);if(l)return l}n+=a.nodeSize*s}return null}function ok(t,e,n){let r=t.steps.length-1;if(r{o==null&&(o=d)}),t.setSelection(ne.near(t.doc.resolve(o),n))}const ak=1,cc=2,lk=4;class EB extends Jj{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=cc,this}ensureMarks(e){return me.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&cc)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~cc,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||me.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let s=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(n);i=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(e,i)),!this.selection.empty&&this.selection.to==n+e.length&&this.setSelection(ne.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=lk,this}get scrolledIntoView(){return(this.updated&lk)>0}}function ck(t,e){return!e||!t?t:t.bind(e)}class qo{constructor(e,n,r){this.name=e,this.init=ck(n.init,r),this.apply=ck(n.apply,r)}}const TB=[new qo("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new qo("selection",{init(t,e){return t.selection||ne.atStart(e.doc)},apply(t){return t.selection}}),new qo("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new qo("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class wf{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=TB.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new qo(r.key,r.spec.state,r))})}}class js{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(s,this[s.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new wf(e.schema,e.plugins),i=new js(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=Bs.fromJSON(e.schema,n.doc);else if(o.name=="selection")i.selection=ne.fromJSON(i.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[o.name]=u.fromJSON.call(l,e,n[a],i);return}}i[o.name]=o.init(e,i)}}),i}}function Yj(t,e,n){for(let r in t){let s=t[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=Yj(s,e,{})),n[r]=s}return n}class ke{constructor(e){this.spec=e,this.props={},e.props&&Yj(e.props,this,this.props),this.key=e.key?e.key.key:Xj("plugin")}getState(e){return e[this.key]}}const Sf=Object.create(null);function Xj(t){return t in Sf?t+"$"+ ++Sf[t]:(Sf[t]=0,t+"$")}class Fe{constructor(e="key"){this.key=Xj(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Zj=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Qj(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const eE=(t,e,n)=>{let r=Qj(t,n);if(!r)return!1;let s=F0(r);if(!s){let o=r.blockRange(),a=o&&vo(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let i=s.nodeBefore;if(cE(t,s,e,-1))return!0;if(r.parent.content.size==0&&(to(i,"end")||J.isSelectable(i)))for(let o=r.depth;;o--){let a=rh(t.doc,r.before(o),r.after(o),H.empty);if(a&&a.slice.size1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(t.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},MB=(t,e,n)=>{let r=Qj(t,n);if(!r)return!1;let s=F0(r);return s?tE(t,s,e):!1},PB=(t,e,n)=>{let r=rE(t,n);if(!r)return!1;let s=V0(r);return s?tE(t,s,e):!1};function tE(t,e,n){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let d=s.lastChild;if(!d)return!1;s=d}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let u=rh(t.doc,i,l,H.empty);if(!u||u.from!=i||u instanceof Re&&u.slice.size>=l-i)return!1;if(n){let d=t.tr.step(u);d.setSelection(Y.create(d.doc,i)),n(d.scrollIntoView())}return!0}function to(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const nE=(t,e,n)=>{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=F0(r)}let o=i&&i.nodeBefore;return!o||!J.isSelectable(o)?!1:(e&&e(t.tr.setSelection(J.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function F0(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function rE(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset{let r=rE(t,n);if(!r)return!1;let s=V0(r);if(!s)return!1;let i=s.nodeAfter;if(cE(t,s,e,1))return!0;if(r.parent.content.size==0&&(to(i,"start")||J.isSelectable(i))){let o=rh(t.doc,r.before(),r.after(),H.empty);if(o&&o.slice.size{let{$head:r,empty:s}=t.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset=0;e--){let n=t.node(e);if(t.index(e)+1{let n=t.selection,r=n instanceof J,s;if(r){if(n.node.isTextblock||!is(t.doc,n.from))return!1;s=n.from}else if(s=nh(t.doc,n.from,-1),s==null)return!1;if(e){let i=t.tr.join(s);r&&i.setSelection(J.create(i.doc,s-t.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},DB=(t,e)=>{let n=t.selection,r;if(n instanceof J){if(n.node.isTextblock||!is(t.doc,n.to))return!1;r=n.to}else if(r=nh(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},LB=(t,e)=>{let{$from:n,$to:r}=t.selection,s=n.blockRange(r),i=s&&vo(s);return i==null?!1:(e&&e(t.tr.lift(s,i).scrollIntoView()),!0)},oE=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(` +`).scrollIntoView()),!0)};function $0(t){for(let e=0;e{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),i=n.indexAfter(-1),o=$0(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(ne.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},aE=(t,e)=>{let n=t.selection,{$from:r,$to:s}=n;if(n instanceof Ft||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=$0(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index(){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(nr(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),s=r&&vo(r);return s==null?!1:(e&&e(t.tr.lift(r,s).scrollIntoView()),!0)};function _B(t){return(e,n)=>{if(e.selection instanceof J&&e.selection.node.isBlock){let{$from:p}=e.selection;return!p.parentOffset||!nr(e.doc,p.pos)?!1:(n&&n(e.tr.split(p.pos).scrollIntoView()),!0)}if(!e.selection.$from.depth)return!1;let r=e.tr;!e.selection.empty&&(e.selection instanceof Y||e.selection instanceof Ft)&&r.deleteSelection();let{$from:s}=r.selection,i=r.steps.length,o=[],a,l,u=!1,d=!1;for(let p=s.depth;;p--)if(s.node(p).isBlock){u=s.end(p)==s.pos+(s.depth-p),d=s.start(p)==s.pos-(s.depth-p),l=$0(s.node(p-1).contentMatchAt(s.indexAfter(p-1))),o.unshift(u&&l?{type:l}:null),a=p;break}else{if(p==1)return!1;o.unshift(null)}let h=s.pos,f=nr(r.doc,h,o.length,o);if(f||(o[0]=l?{type:l}:null,f=nr(r.doc,h,o.length,o)),!f)return!1;if(r.split(h,o.length,o),!u&&d&&s.node(a).type!=l){let p=r.mapping.slice(i),m=p.map(s.before(a)),g=r.doc.resolve(m);l&&s.node(a-1).canReplaceWith(g.index(),g.index()+1,l)&&r.setNodeMarkup(p.map(s.before(a)),l)}return n&&n(r.scrollIntoView()),!0}}const IB=_B(),OB=(t,e)=>{let{$from:n,to:r}=t.selection,s,i=n.sharedDepth(r);return i==0?!1:(s=n.before(i),e&&e(t.tr.setSelection(J.create(t.doc,s))),!0)};function BB(t,e,n){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.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)||!(s.isTextblock||is(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function cE(t,e,n,r){let s=e.nodeBefore,i=e.nodeAfter,o,a,l=s.type.spec.isolating||i.type.spec.isolating;if(!l&&BB(t,e,n))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(a=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(n){let p=e.pos+i.nodeSize,m=O.empty;for(let b=o.length-1;b>=0;b--)m=O.from(o[b].create(null,m));m=O.from(s.copy(m));let g=t.tr.step(new Ye(e.pos-1,p,e.pos,p,new H(m,1,0),o.length,!0)),y=g.doc.resolve(p+2*o.length);y.nodeAfter&&y.nodeAfter.type==s.type&&is(g.doc,y.pos)&&g.join(y.pos),n(g.scrollIntoView())}return!0}let d=i.type.spec.isolating||r>0&&l?null:ne.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),f=h&&vo(h);if(f!=null&&f>=e.depth)return n&&n(t.tr.lift(h,f).scrollIntoView()),!0;if(u&&to(i,"start",!0)&&to(s,"end")){let p=s,m=[];for(;m.push(p),!p.isTextblock;)p=p.lastChild;let g=i,y=1;for(;!g.isTextblock;g=g.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,g.content)){if(n){let b=O.empty;for(let k=m.length-1;k>=0;k--)b=O.from(m[k].copy(b));let x=t.tr.step(new Ye(e.pos-m.length,e.pos+i.nodeSize,e.pos+y,e.pos+i.nodeSize-y,new H(b,m.length,0),0,!0));n(x.scrollIntoView())}return!0}}return!1}function uE(t){return function(e,n){let r=e.selection,s=t<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(n&&n(e.tr.setSelection(Y.create(e.doc,t<0?s.start(i):s.end(i)))),!0):!1}}const zB=uE(-1),FB=uE(1);function VB(t,e=null){return function(n,r){let{$from:s,$to:i}=n.selection,o=s.blockRange(i),a=o&&B0(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function uk(t,e=null){return function(n,r){let s=!1;for(let i=0;i{if(s)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)s=!0;else{let d=n.doc.resolve(u),h=d.index();s=d.parent.canReplaceWith(h,h+1,t)}})}if(!s)return!1;if(r){let i=n.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);i=new Iu(l,l,e.depth),e.endIndex=0;d--)i=O.from(n[d].type.create(n[d].attrs,i));t.step(new Ye(e.start-(r?2:0),e.end,e.start,e.end,new H(i,0,0),n.length,!0));let o=0;for(let d=0;do.childCount>0&&o.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?KB(e,n,t,i):GB(e,n,i):!0:!1}}function KB(t,e,n,r){let s=t.tr,i=r.end,o=r.$to.end(r.depth);ig;m--)p-=s.child(m).nodeSize,r.delete(p-1,p+1);let i=r.doc.resolve(n.start),o=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==s.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(a?0:1),d+1,o.content.append(l?O.empty:O.from(s))))return!1;let h=i.pos,f=h+o.nodeSize;return r.step(new Ye(h-(a?1:0),f+(l?1:0),h+1,f-1,new H((a?O.empty:O.from(s.copy(O.empty))).append(l?O.empty:O.from(s.copy(O.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function qB(t){return function(e,n){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,u=>u.childCount>0&&u.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let a=i.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,d=O.from(u?t.create():null),h=new H(O.from(t.create(null,O.from(a.type.create(null,d)))),u?3:1,0),f=i.start,p=i.end;n(e.tr.step(new Ye(f-(u?3:1),p,f,p,h,1,!0)).scrollIntoView())}return!0}}const nt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},no=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let _m=null;const Gn=function(t,e,n){let r=_m||(_m=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},JB=function(){_m=null},Js=function(t,e,n,r){return n&&(dk(t,e,n,r,-1)||dk(t,e,n,r,1))},YB=/^(img|br|input|textarea|hr)$/i;function dk(t,e,n,r,s){for(var i;;){if(t==n&&e==r)return!0;if(e==(s<0?0:Zt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||Sl(t)||YB.test(t.nodeName)||t.contentEditable=="false")return!1;e=nt(t)+(s<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else t=o,e=s<0?Zt(t):0}else return!1}}function Zt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function XB(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Zt(t)}else if(t.parentNode&&!Sl(t))e=nt(t),t=t.parentNode;else return null}}function ZB(t,e){for(;;){if(t.nodeType==3&&e2),Jt=ro||(On?/Mac/.test(On.platform):!1),fE=On?/Win/.test(On.platform):!1,Zn=/Android \d/.test(as),Nl=!!hk&&"webkitFontSmoothing"in hk.documentElement.style,n6=Nl?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function r6(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Fn(t,e){return typeof t=="number"?t:t[e]}function s6(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function fk(t,e,n){if(!zm(e)&&e.left==0)return;let r=t.someProp("scrollThreshold")||0,s=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=n||t.dom;o;){if(o.nodeType!=1){o=no(o);continue}let a=o,l=a==i.body,u=l?r6(i):s6(a),d=0,h=0;if(e.topu.bottom-Fn(r,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+Fn(s,"top")-u.top:e.bottom-u.bottom+Fn(s,"bottom")),e.leftu.right-Fn(r,"right")&&(d=e.right-u.right+Fn(s,"right")),d||h)if(l)i.defaultView.scrollBy(d,h);else{let p=a.scrollLeft,m=a.scrollTop;h&&(a.scrollTop+=h),d&&(a.scrollLeft+=d);let g=a.scrollLeft-p,y=a.scrollTop-m;e={left:e.left-g,top:e.top-y,right:e.right-g,bottom:e.bottom-y}}let f=l?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:no(o)}}function i6(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=n+1;o=n-20){r=a,s=l.top;break}}return{refDOM:r,refTop:s,stack:pE(t.dom)}}function pE(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=no(r));return e}function o6({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;mE(n,r==0?0:r-e)}function mE(t,e){for(let n=0;n=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=d,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=h+1)}}return!n&&l&&(n=l,s=u,r=0),n&&n.nodeType==3?l6(n,s):!n||r&&n.nodeType==1?{node:t,offset:i}:gE(n,s)}function l6(t,e){let n=t.nodeValue.length,r=document.createRange(),s;for(let i=0;i=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:t,offset:0}}function W0(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function c6(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,s,i)}function d6(t,e,n,r){let s=-1;for(let i=e,o=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!o&&l.left>r.left||l.top>r.top?s=a.posBefore:(!o&&l.right-1?s:t.docView.posFromDOM(e,n,-1)}function xE(t,e,n){let r=t.childNodes.length;if(r&&n.tope.top&&s++}let u;Nl&&s&&r.nodeType==1&&(u=r.childNodes[s-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&s--,r==t.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(a=d6(t,r,s,e))}a==null&&(a=u6(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function zm(t){return t.top=0&&s==r.nodeValue.length?(l--,d=1):n<0?l--:u++,Ro(gr(Gn(r,l,u),d),d<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(n<0||s==Zt(r))){let l=r.childNodes[s-1];if(l.nodeType==1)return Nf(l.getBoundingClientRect(),!1)}if(i==null&&s=0)}if(i==null&&s&&(n<0||s==Zt(r))){let l=r.childNodes[s-1],u=l.nodeType==3?Gn(l,Zt(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Ro(gr(u,1),!1)}if(i==null&&s=0)}function Ro(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Nf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function bE(t,e,n){let r=t.state,s=t.root.activeElement;r!=e&&t.updateState(e),s!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),s!=t.dom&&s&&s.focus()}}function p6(t,e,n){let r=e.selection,s=n=="up"?r.$from:r.$to;return bE(t,e,()=>{let{node:i}=t.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let o=yE(t,s.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Gn(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;ud.top+1&&(n=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const m6=/[\u0590-\u08ac]/;function g6(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,a=t.domSelection();return a?!m6.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:o:bE(t,e,()=>{let{focusNode:l,focusOffset:u,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&u==g;try{a.collapse(d,h),l&&(l!=d||u!=h)&&a.extend&&a.extend(l,u)}catch{}return f!=null&&(a.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let pk=null,mk=null,gk=!1;function x6(t,e,n){return pk==e&&mk==n?gk:(pk=e,mk=n,gk=n=="up"||n=="down"?p6(t,e,n):g6(t,e,n))}const rn=0,xk=1,Es=2,wn=3;class Cl{constructor(e,n,r,s){this.parent=e,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=rn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(e){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;nnt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!n||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;ne||o instanceof kE){s=e-i;break}i=a}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof vE&&i.side>=0;r--);if(n<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&n&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?nt(i.dom)+1:0}}else{let i,o=!0;for(;i=r=d&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,d);e=o;for(let h=a;h>0;h--){let f=this.children[h-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){s=nt(f.dom)+1;break}e-=f.size}s==-1&&(s=0)}if(s>-1&&(u>n||a==this.children.length-1)){n=u;for(let d=a+1;dm&&on){let m=a;a=l,l=m}let p=document.createRange();p.setEnd(l.node,l.offset),p.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(p)}}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,s=0;s=r:er){let a=r+i.border,l=o-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?Es:xk,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=wn:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Es:wn}r=o}this.dirty=Es}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Es:xk;n.dirty{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.hasAttribute("contenteditable")||(o.contentEditable="false"),o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==rn&&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}}class y6 extends Cl{constructor(e,n,r,s){super(e,[],n,null),this.textDOM=r,this.text=s}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}}class Wr extends Cl{constructor(e,n,r,s,i){super(e,[],r,s),this.mark=n,this.spec=i}static create(e,n,r,s){let i=s.nodeViews[n.type.name],o=i&&i(n,s,r);return(!o||!o.dom)&&(o=ei.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Wr(e,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&wn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=wn&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=rn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=Vm(i,0,e,r));for(let a=0;a{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,s),d=u&&u.dom,h=u&&u.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:h}=ei.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),n.type.spec.draggable&&(d.draggable=!0));let f=d;return d=NE(d,r,n),u?l=new b6(e,n,r,s,d,h||null,f,u):n.isText?new oh(e,n,r,s,d,f):new Ur(e,n,r,s,d,h||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 s=this.children[r];if(this.dom.contains(s.dom.parentNode)){n.contentElement=s.dom.parentNode;break}}if(!n.contentElement){let r=e&&e.find(s=>s.nodeType==1&&e.indexOf(s.parentNode)<0&&this.dom.contains(s));r?n.contentElement=r:n.getContent=()=>O.empty}}return n}matchesNode(e,n,r){return this.dirty==rn&&e.eq(this.node)&&Bu(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,s=n,i=e.composing?this.localCompositionInfo(e,n):null,o=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new k6(this,o&&o.node,e);N6(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e,d):u.type.side>=0&&!h&&l.syncToMarks(d==this.node.childCount?me.none:this.node.child(d).marks,r,e,d),l.placeWidget(u,e,s)},(u,d,h,f)=>{l.syncToMarks(u.marks,r,e,f);let p;l.findNodeMatch(u,d,h,f)||a&&e.state.selection.from>s&&e.state.selection.to-1&&l.updateNodeAt(u,d,h,p,e)||l.updateNextNode(u,d,h,e,f,s)||l.addNode(u,d,h,e,s),s+=u.nodeSize}),l.syncToMarks([],r,e,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==Es)&&(o&&this.protectLocalComposition(e,o),wE(this.contentDOM,this.children,e),ro&&C6(this.dom))}localCompositionInfo(e,n){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof Y)||rn+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,a=j6(this.node.content,o,r-n,s-n);return a<0?null:{node:i,pos:a,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new y6(this,i,n,s);e.input.compositionNodes.push(o),this.children=Vm(this.children,r,r+s.length,e,o)}update(e,n,r,s){return this.dirty==wn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,s),!0)}updateInner(e,n,r,s){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=rn}updateOuterDeco(e){if(Bu(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=SE(this.dom,this.nodeDOM,Fm(this.outerDeco,this.node,n),Fm(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function yk(t,e,n,r,s){NE(r,e,t);let i=new Ur(void 0,t,e,n,r,r,r);return i.contentDOM&&i.updateChildren(s,0),i}class oh extends Ur{constructor(e,n,r,s,i,o){super(e,n,r,s,i,null,o)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,s){return this.dirty==wn||this.dirty!=rn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=rn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=rn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let s=this.node.cut(e,n),i=document.createTextNode(s.text);return new oh(this.parent,s,this.outerDeco,this.innerDeco,i,i)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=wn)}get domAtom(){return!1}isText(e){return this.node.text==e}}class kE extends Cl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==rn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class b6 extends Ur{constructor(e,n,r,s,i,o,a,l){super(e,n,r,s,i,o,a),this.spec=l}update(e,n,r,s){if(this.dirty==wn)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,s){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function wE(t,e,n){let r=t.firstChild,s=!1;for(let i=0;i>1,a=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let d=Wr.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))i=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a0;){let a;for(;;)if(r){let u=n.children[r-1];if(u instanceof Wr)n=u,r=u.children.length;else{a=u,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(s-1))break;--s,i.set(a,s),o.push(a)}}return{index:s,matched:i,matches:o.reverse()}}function S6(t,e){return t.type.side-e.type.side}function N6(t,e,n,r){let s=e.locals(t),i=0;if(s.length==0){for(let u=0;ui;)a.push(s[o++]);let m=i+f.nodeSize;if(f.isText){let y=m;o!y.inline):a.slice();r(f,g,e.forChild(i,f),p),i=m}}function C6(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function j6(t,e,n,r){for(let s=0,i=0;s=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let u=a=0&&u+e.length+a>=n)return a+u;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Vm(t,e,n,r,s){let i=[];for(let o=0,a=0;o=n||d<=e?i.push(l):(un&&i.push(l.slice(n-u,l.size,r)))}return i}function U0(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let s=t.docView.nearestDesc(n.focusNode),i=s&&s.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,u;if(ih(n)){for(l=o;s&&!s.node;)s=s.parent;let h=s.node;if(s&&h.isAtom&&J.isSelectable(h)&&s.parent&&!(h.isInline&&QB(n.focusNode,n.focusOffset,s.dom))){let f=s.posBefore;u=new J(o==f?a:r.resolve(f))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=o,f=o;for(let p=0;p{(n.anchorNode!=r||n.anchorOffset!=s)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!CE(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function T6(t){let e=t.domSelection();if(!e)return;let n=t.cursorWrapper.dom,r=n.nodeName=="IMG";r?e.collapse(n.parentNode,nt(n)+1):e.collapse(n,0),!r&&!t.state.selection.visible&&Rt&&Hr<=11&&(n.disabled=!0,n.disabled=!1)}function jE(t,e){if(e instanceof J){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Sk(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Sk(t)}function Sk(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function K0(t,e,n,r){return t.someProp("createSelectionBetween",s=>s(t,e,n))||Y.between(e,n,r)}function Nk(t){return t.editable&&!t.hasFocus()?!1:EE(t)}function EE(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function M6(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Js(e.node,e.offset,n.anchorNode,n.anchorOffset)}function $m(t,e){let{$anchor:n,$head:r}=t.selection,s=e>0?n.max(r):n.min(r),i=s.parent.inlineContent?s.depth?t.doc.resolve(e>0?s.after():s.before()):null:s;return i&&ne.findFrom(i,e)}function vr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Ck(t,e,n){let r=t.state.selection;if(r instanceof Y)if(n.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return vr(t,new Y(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let s=$m(t.state,e);return s&&s instanceof J?vr(t,s):!1}else if(!(Jt&&n.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let a=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?J.isSelectable(i)?vr(t,new J(e<0?t.state.doc.resolve(s.pos-i.nodeSize):s)):Nl?vr(t,new Y(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof J&&r.node.isInline)return vr(t,new Y(e>0?r.$to:r.$from));{let s=$m(t.state,e);return s?vr(t,s):!1}}}function zu(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ma(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ai(t,e){return e<0?P6(t):A6(t)}function P6(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s,i,o=!1;for(nn&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ma(a,-1))s=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(TE(n))break;{let a=n.previousSibling;for(;a&&ma(a,-1);)s=n.parentNode,i=nt(a),a=a.previousSibling;if(a)n=a,r=zu(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Hm(t,n,r):s&&Hm(t,s,i)}function A6(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let s=zu(n),i,o;for(;;)if(r{t.state==s&&rr(t)},50)}function jk(t,e){let n=t.state.doc.resolve(e);if(!(st||fE)&&n.parent.inlineContent){let s=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o1)return i.lefts.top&&o1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Ek(t,e,n){let r=t.state.selection;if(r instanceof Y&&!r.empty||n.indexOf("s")>-1||Jt&&n.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=$m(t.state,e);if(o&&o instanceof J)return vr(t,o)}if(!s.parent.inlineContent){let o=e<0?s:i,a=r instanceof Ft?ne.near(o,e):ne.findFrom(o,e);return a?vr(t,a):!1}return!1}function Tk(t,e){if(!(t.state.selection instanceof Y))return!0;let{$head:n,$anchor:r,empty:s}=t.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(n.pos-i.nodeSize,n.pos):o.delete(n.pos,n.pos+i.nodeSize),t.dispatch(o),!0}return!1}function Mk(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function R6(t){if(!mt||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Mk(t,r,"true"),setTimeout(()=>Mk(t,r,"false"),20)}return!1}function _6(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function I6(t,e){let n=e.keyCode,r=_6(e);if(n==8||Jt&&n==72&&r=="c")return Tk(t,-1)||ai(t,-1);if(n==46&&!e.shiftKey||Jt&&n==68&&r=="c")return Tk(t,1)||ai(t,1);if(n==13||n==27)return!0;if(n==37||Jt&&n==66&&r=="c"){let s=n==37?jk(t,t.state.selection.from)=="ltr"?-1:1:-1;return Ck(t,s,r)||ai(t,s)}else if(n==39||Jt&&n==70&&r=="c"){let s=n==39?jk(t,t.state.selection.from)=="ltr"?1:-1:1;return Ck(t,s,r)||ai(t,s)}else{if(n==38||Jt&&n==80&&r=="c")return Ek(t,-1,r)||ai(t,-1);if(n==40||Jt&&n==78&&r=="c")return R6(t)||Ek(t,1,r)||ai(t,1);if(r==(Jt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function G0(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||ei.fromSchema(t.state.schema),a=RE(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let u=l.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=LE[u.nodeName.toLowerCase()]);){for(let p=d.length-1;p>=0;p--){let m=a.createElement(d[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),h++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${s} ${i}${h?` -${h}`:""} ${JSON.stringify(n)}`);let f=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,` -`);return{dom:l,text:f,slice:e}}function TE(t,e,n,r,s){let i=s.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return a=new H(O.from(t.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0),t.someProp("transformPasted",f=>{a=f(a,t,!0)}),a;let h=t.someProp("clipboardTextParser",f=>f(e,s,r,t));if(h)a=h;else{let f=s.marks(),{schema:p}=t.state,m=ei.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=o.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,f)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=z6(n),Nl&&F6(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||$r.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!I6.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)a=V6(Mk(a,+d[1],+d[2]),d[4]);else if(a=H.maxOpen(O6(a.content,s),!0),a.openStart||a.openEnd){let h=0,f=0;for(let p=a.content.firstChild;h{a=h(a,t,l)}),a}const I6=/^(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 O6(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(a=>{if(!o)return;let l=s.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&i.length&&PE(l,i,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=AE(o[o.length-1],i.length));let d=ME(a,l);o.push(d),s=s.matchType(d.type),i=l}}),o)return O.from(o)}return t}function ME(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,O.from(t));return t}function PE(t,e,n,r,s){if(s1&&(i=0),s=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,i<=s).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(O.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function Mk(t,e,n){return en})}return _o.createHTML(t)}function z6(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=LE(),r=n.body,s=/<([a-z][^>\s]+)/i.exec(t),i;if((i=s&&DE[s[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),r.innerHTML=B6(t),i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;try{l.checkAttrs(r[a+1])}catch{break}s=O.from(l.create(r[a+1],s)),i++,o++}return new H(s,i,o)}const wt={},St={},$6={touchstart:!0,touchmove:!0};class H6{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.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function W6(t){for(let e in wt){let n=wt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{K6(t,r)&&!q0(t,r)&&(t.editable||!(r.type in St))&&n(t,r)},$6[e]?{passive:!0}:void 0)}mt&&t.dom.addEventListener("input",()=>null),Um(t)}function Qn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function U6(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Um(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>q0(t,r))})}function q0(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function K6(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function G6(t,e){!q0(t,e)&&wt[e.type]&&(t.editable||!(e.type in St))&&wt[e.type](t,e)}St.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!OE(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Zn&&st&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ro&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",s=>s(t,vs(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||_6(t,n)?n.preventDefault():Qn(t,"key")};St.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};St.keypress=(t,e)=>{let n=e;if(OE(t)||!n.charCode||n.ctrlKey&&!n.altKey||Jt&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Y)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,s,i))&&t.dispatch(i()),n.preventDefault()}};function jl(t){return{left:t.clientX,top:t.clientY}}function q6(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function J0(t,e,n,r,s){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,a=>o>i.depth?a(t,n,i.nodeAfter,i.before(o),s,!0):a(t,n,i.node(o),i.before(o),s,!1)))return!0;return!1}function El(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function J6(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(El(t,new J(n)),!0):!1}function Y6(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof J&&(r=n.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o);if(J.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(o);break}}return s!=null?(El(t,J.create(t.state.doc,s)),!0):!1}function X6(t,e,n,r,s){return J0(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?Y6(t,n):J6(t,n))}function Z6(t,e,n,r){return J0(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function Q6(t,e,n,r){return J0(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||ez(t,n,r)}function ez(t,e,n){if(n.button!=0)return!1;let r=RE(t,e,!0),s=t.state.doc;return r?(El(t,r),r instanceof Y&&s.eq(t.state.doc)&&(t.input.mouseDown=new nz(t,r)),!0):!1}function RE(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?Y.create(r,0,r.content.size):null;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),a=s.before(i);if(o.inlineContent)return Y.create(r,a+1,a+1+o.content.size);if(n&&J.isSelectable(o))return J.create(r,a)}return null}function Y0(t){return Fu(t)}const _E=Jt?"metaKey":"ctrlKey";wt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Y0(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&q6(n,t.input.lastClick)&&!n[_E]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let o=t.posAtCoords(jl(n));o&&(i=="singleClick"?t.input.mouseDown=new tz(t,o,n,!!r):(i=="doubleClick"?Z6:Q6)(t,o.pos,o.inside,n)?n.preventDefault():Qn(t,"pointer"))};class IE{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class tz extends IE{constructor(e,n,r,s){super(e),this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[_E],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);i=d.parent,o=d.depth?d.before():0}const a=s?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||u instanceof J&&u.from<=o&&u.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&nn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Qn(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||rr(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(jl(e))),this.updateAllowDefault(e),this.allowDefault||!n?Qn(this.view,"pointer"):X6(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||mt&&this.mightDrag&&!this.mightDrag.node.isAtom||st&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(El(this.view,ne.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Qn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Qn(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class nz extends IE{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Qn(this.view,"pointer");let n=this.view.posAtCoords(jl(e)),r=n&&RE(this.view,n.inside,!1);if(!r)return;let{doc:s}=this.view.state,i=this.startSelection,[o,a]=r.from{t.input.lastTouch=Date.now(),Y0(t),Qn(t,"pointer")};wt.touchmove=t=>{t.input.lastTouch=Date.now(),Qn(t,"pointer")};wt.contextmenu=t=>Y0(t);function OE(t,e){return t.composing?!0:mt&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const rz=Zn?5e3:-1;St.compositionstart=St.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Y&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||st&&hE&&sz(t)))t.markCursor=t.state.storedMarks||n.marks(),Fu(t,!0),t.markCursor=null;else if(Fu(t,!e.selection.empty),nn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}t.input.composing=!0}BE(t,rz)};function sz(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}St.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,BE(t,20))};function BE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Fu(t),e))}function zE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function iz(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=YB(e.focusNode,e.focusOffset),r=XB(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function Fu(t,e=!1){if(!(Zn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),zE(t),e||t.docView&&t.docView.dirty){let n=U0(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function oz(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const rl=Rt&&Hr<15||ro&&t6<604;wt.copy=St.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=rl?null:n.clipboardData,o=r.content(),{dom:a,text:l}=G0(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):oz(t,a),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function az(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function lz(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?sl(t,r.value,null,s,e):sl(t,r.textContent,r.innerHTML,s,e)},50)}function sl(t,e,n,r,s){let i=TE(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,s,i||H.empty)))return!0;if(!i)return!1;let o=az(i),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function FE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}St.paste=(t,e)=>{let n=e;if(t.composing&&!Zn)return;let r=rl?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&sl(t,FE(r),r.getData("text/html"),s,n)?n.preventDefault():lz(t,n)};class VE{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const cz=Jt?"altKey":"ctrlKey";function $E(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[cz]}wt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=t.state.selection,i=s.empty?null:t.posAtCoords(jl(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof J?s.to-1:s.to))){if(r&&r.mightDrag)o=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=J.create(t.state.doc,h.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:d}=G0(t,a);(!n.dataTransfer.files.length||!st||dE>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(rl?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",rl||n.dataTransfer.setData("text/plain",u),t.dragging=new VE(d,$E(t,n),o)};wt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};St.dragover=St.dragenter=(t,e)=>e.preventDefault();St.drop=(t,e)=>{try{uz(t,e,t.dragging)}finally{t.dragging=null}};function uz(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(jl(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",p=>{i=p(i,t,!1)}):i=TE(t,FE(e.dataTransfer),rl?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&$E(t,e));if(t.someProp("handleDrop",p=>p(t,e,i||H.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let a=i?Hj(t.state.doc,s.pos,i):s.pos;a==null&&(a=s.pos);let l=t.state.tr;if(o){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(a),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=l.doc;if(d?l.replaceRangeWith(u,u,i.content.firstChild):l.replaceRange(u,u,i),l.doc.eq(h))return;let f=l.doc.resolve(u);if(d&&J.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new J(f));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,g,y,b)=>p=b),l.setSelection(K0(t,f,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}wt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&rr(t)},20))};wt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};wt.beforeinput=(t,e)=>{if(Zn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,vs(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in St)wt[t]=St[t];function il(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Vu{constructor(e,n){this.toDOM=e,this.spec=n||zs,this.side=this.spec.side||0}map(e,n,r,s){let{pos:i,deleted:o}=e.mapResult(n.from+s,this.side<0?-1:1);return o?null:new vt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Vu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&il(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Kr{constructor(e,n){this.attrs=e,this.spec=n||zs}map(e,n,r,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new vt(i,o,this)}valid(e,n){return n.from=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+s,a.to+s))}for(let o=0;oe){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,s+a,i)}}map(e,n,r){return this==ht||e.maps.length==0?this:this.mapInner(e,n,0,0,r||zs)}mapInner(e,n,r,s,i){let o;for(let a=0;a{let u=l+r,d;if(d=WE(n,a,u)){for(s||(s=this.children.slice());ia&&h.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,o=i+n.content.size;for(let a=0;ai&&l.type instanceof Kr){let u=Math.max(i,l.from)-i,d=Math.min(o,l.to)-i;us.map(e,n,zs));return Cr.from(r)}forChild(e,n){if(n.isLeaf)return ce.empty;let r=[];for(let s=0;sn instanceof ce)?e:e.reduce((n,r)=>n.concat(r instanceof ce?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let y=g-m-(p-f);for(let b=0;bx+d-h)continue;let k=a[b]+d-h;p>=k?a[b+1]=f<=k?-2:-1:f>=d&&y&&(a[b]+=y,a[b+1]+=y)}h+=y}),d=n.maps[u].map(d,-1)}let l=!1;for(let u=0;u=r.content.size){l=!0;continue}let f=n.map(t[u+1]+i,-1),p=f-s,{index:m,offset:g}=r.content.findIndex(h),y=r.maybeChild(m);if(y&&g==h&&g+y.nodeSize==p){let b=a[u+2].mapInner(n,y,d+1,t[u]+i+1,o);b!=ht?(a[u]=h,a[u+1]=p,a[u+2]=b):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=hz(a,t,e,n,s,i,o),d=$u(u,r,0,o);e=d.local;for(let h=0;hn&&o.to{let u=WE(t,a,l+n);if(u){i=!0;let d=$u(u,a,n+l+1,r);d!=ht&&s.push(l,l+a.nodeSize,d)}});let o=HE(i?UE(t):t,-n).sort(Fs);for(let a=0;a0;)e++;t.splice(e,0,n)}function jf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ht&&e.push(r)}),t.cursorWrapper&&e.push(ce.create(t.state.doc,[t.cursorWrapper.deco])),Cr.from(e)}const fz={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},pz=Rt&&Hr<=11;class mz{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class gz{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new mz,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;ss.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():mt&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),pz&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,fz)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Sk(this.view)){if(this.suppressingSelectionUpdates)return rr(this.view);if(Rt&&Hr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Js(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=no(i))n.add(i);for(let i=e.anchorNode;i;i=no(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Sk(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;dd.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||st&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(d=>d.type=="childList"&&d.removedNodes.length))){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){d.parentNode.removeChild(d);break}h=h.firstChild}}}else if(nn&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,f]=d;h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let f of d){let p=f.parentNode;p&&p.nodeName=="LI"&&(!h||bz(e,h)!=p)&&f.remove()}}}let u=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||s)&&(i>-1&&(e.docView.markDirty(i,o),xz(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,vz(e,l)),this.handleDOMChange(i,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||rr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;di;b--){let x=s.childNodes[b-1],k=x.pmViewDesc;if(x.nodeName=="BR"&&!k){o=b;break}if(!k||k.size)break}let f=t.state.doc,p=t.someProp("domParser")||$r.fromSchema(t.state.schema),m=f.resolve(a),g=null,y=p.parse(s,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:i,to:o,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:wz(r),context:m});if(d&&d[0].pos!=null){let b=d[0].pos,x=d[1]&&d[1].pos;x==null&&(x=b),g={anchor:b+a,head:x+a}}return{doc:y,sel:g,from:a,to:l}}const wz=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(mt&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||mt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},Sz=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Nz(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let S=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,N=U0(t,S);if(N&&!t.state.selection.eq(N)){if(st&&Zn&&t.input.lastKeyCode===13&&Date.now()-100j(t,vs(13,"Enter"))))return;let M=t.state.tr.setSelection(N);S=="pointer"?M.setMeta("pointer",!0):S=="key"&&M.scrollIntoView(),i&&M.setMeta("composition",i),t.dispatch(M)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=kz(t,e,n,s),d=t.state.doc,h=d.slice(u.from,u.to),f,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Zn)&&s.some(S=>S.nodeType==1&&!Sz.test(S.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",S=>S(t,vs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof Y&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let S=Rk(t,t.state.doc,u.sel);if(S&&!S.eq(t.state.selection)){let N=t.state.tr.setSelection(S);i&&N.setMeta("composition",i),t.dispatch(N)}}return}t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Rt&&Hr<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=u.doc.resolveNoCache(m.start-u.from),y=u.doc.resolveNoCache(m.endB-u.from),b=d.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA;if((ro&&t.input.lastIOSEnter>Date.now()-225&&(!x||s.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!x&&g.posS(t,vs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&jz(d,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",S=>S(t,vs(8,"Backspace")))){Zn&&st&&t.domObserver.suppressSelectionUpdates();return}st&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),Zn&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,y=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(S){return S(t,vs(13,"Enter"))})},20));let k=m.start,w=m.endA,C=S=>{let N=S||t.state.tr.replace(k,w,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let M=Rk(t,N.doc,u.sel);M&&!(st&&t.composing&&M.empty&&(m.start!=m.endB||t.input.lastChromeDeleterr(t),20));let S=C(t.state.tr.delete(k,w)),N=d.resolve(m.start).marksAcross(d.resolve(m.endA));N&&S.ensureMarks(N),t.dispatch(S)}else if(m.endA==m.endB&&(E=Cz(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let S=C(t.state.tr);E.type=="add"?S.addMark(k,w,E.mark):S.removeMark(k,w,E.mark),t.dispatch(S)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let S=g.parent.textBetween(g.parentOffset,y.parentOffset),N=()=>C(t.state.tr.insertText(S,k,w));t.someProp("handleTextInput",M=>M(t,k,w,S,N))||t.dispatch(N())}else t.dispatch(C());else t.dispatch(C())}function Rk(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:K0(t,e.resolve(n.anchor),e.resolve(n.head))}function Cz(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,a,l;for(let d=0;dd.mark(a.addToSet(d.marks));else if(s.length==0&&i.length==1)a=i[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let u=[];for(let d=0;dn||Ef(o,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,s++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function Ez(t,e,n,r,s){let i=t.findDiffStart(e,n),o=n+t.size,a=n+e.size;if(i==null)return null;let{a:l,b:u}=t.findDiffEnd(e,o,a);if(s=="end"){let d=Math.max(0,i-Math.min(l,u));r-=l+d-i}if(l=l?i-r:0;i-=d,u=i+(u-l),l=i}else if(u=u?i-r:0;i-=d,l=i+(l-u),u=i}return{start:i,endA:l,endB:u}}class KE{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new H6,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(zk),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ok(this),Ik(this),this.nodeViews=Bk(this),this.docView=xk(this.state.doc,_k(this),jf(this),this.dom,this),this.domObserver=new gz(this,(r,s,i,o)=>Nz(this,r,s,i,o)),this.domObserver.start(),W6(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Um(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(zk),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(zE(this),o=!0),this.state=e;let a=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=Bk(this);Mz(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Um(this),this.editable=Ok(this),Ik(this);let l=jf(this),u=_k(this),d=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,u,l);(h||!e.selection.eq(s.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&s6(this);if(o){this.domObserver.stop();let p=h&&(Rt||st)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&Tz(s.selection,e.selection);if(h){let g=st?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=iz(this)),(i||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=xk(e.doc,u,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}let m=this.input.mouseDown;p||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&T6(this)&&m.delaySelUpdate())?rr(this,p):(CE(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&i6(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&hk(this,n.getBoundingClientRect(),e)}else hk(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&in.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return d6(this,e)}coordsAtPos(e,n=1){return xE(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let s=this.docView.posFromDOM(e,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return g6(this,n||this.state,e)}pasteHTML(e,n){return sl(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return sl(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return G0(this,e)}destroy(){this.docView&&(U6(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],jf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,qB())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return G6(this,e)}domSelectionRange(){let e=this.domSelection();return e?mt&&this.root.nodeType===11&&QB(this.dom.ownerDocument)==this.dom&&yz(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}KE.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function _k(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[vt.node(0,t.state.doc.content.size,e)]}function Ik(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:vt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Ok(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Tz(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function Bk(t){let e=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Mz(t,e){let n=0,r=0;for(let s in t){if(t[s]!=e[s])return!0;n++}for(let s in e)r++;return n!=r}function zk(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Zr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Hu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Pz=typeof navigator<"u"&&/Mac/.test(navigator.platform),Az=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var rt=0;rt<10;rt++)Zr[48+rt]=Zr[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)Zr[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)Zr[rt]=String.fromCharCode(rt+32),Hu[rt]=String.fromCharCode(rt);for(var Tf in Zr)Hu.hasOwnProperty(Tf)||(Hu[Tf]=Zr[Tf]);function Dz(t){var e=Pz&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Az&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Hu:Zr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Lz=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Rz=typeof navigator<"u"&&/Win/.test(navigator.platform);function _z(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,s,i,o;for(let a=0;a[a,(...d)=>{const h=l(...d)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:s,state:i}=this,{view:o}=s,a=[],l=!!e,u=e||i.tr,d=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),a.every(f=>f===!0)),h={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...g)=>{const y=this.buildProps(u,n),b=p(...g)(y);return a.push(b),h}])),run:d};return h}static createFakeChain(){const e=new Proxy({},{get:(n,r)=>{if(r!=="then")return r==="run"?()=>!1:()=>e}});return e}createCan(e){const{rawCommands:n,state:r}=this,s=!1,i=e||r.tr,o=this.buildProps(i,s);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,s)}}static createFallbackCan(){const e=qE.createFakeChain();return new Proxy({chain:()=>e},{get:(n,r)=>{if(r!=="then")return r==="chain"?n.chain:()=>!1}})}buildProps(e,n=!0){const{rawCommands:r,editor:s,state:i}=this,{view:o}=s,a={tr:e,editor:s,view:o,state:ah({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...d)=>u(...d)(a)]))}};return a}};const Bz=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{if(!t.isDestroyed){var n;e.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),zz=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Fz=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:d}=e,h=u.resolve(d.map(l)),f=u.resolve(d.map(l+a.nodeSize)),p=h.blockRange(f);if(!p)return;const m=vo(p);if(a.type.isTextblock){const{defaultType:g}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},Vz=t=>e=>t(e),$z=()=>({state:t,dispatch:e})=>oE(t,e),Hz=(t,e)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new Y(r.doc.resolve(Math.max(o-1,0)))),!0},Wz=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const o=s.before(i),a=s.after(i);t.delete(o,a).scrollIntoView()}return!0}return!1};function Ue(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}const Uz=t=>({tr:e,state:n,dispatch:r})=>{const s=Ue(t,n.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},Kz=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},Gz=t=>t.content?/^text(\*|\+)/.test(t.content):!1,Fk=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos({from:Fk(t,n,"left"),to:Fk(e,n,"right")}),Jz=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const n=t.tr,{ranges:r}=t.selection,s=n.steps.length;r.forEach(i=>{const o=n.mapping.slice(s),a=n.doc.resolve(o.map(i.$from.pos)),l=n.doc.resolve(o.map(i.$to.pos)),{from:u,to:d}=qz(a,l,t.schema);n.deleteRange(u,d)}),n.selection.empty||n.setSelection(Y.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},Yz=()=>({commands:t})=>t.keyboardShortcut("Enter"),Xz=()=>({state:t,dispatch:e})=>LB(t,e);function Q0(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Wu(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:Q0(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function JE(t,e,n={}){return t.find(r=>r.type===e&&Wu(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function Vk(t,e,n={}){return!!JE(t,e,n)}function ex(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(l=>l.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(l=>l.type===e))return;if(!n){const l=r.node.marks.find(u=>u.type===e);l&&(n=l.attrs)}if(!JE([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,o=s+1,a=i+r.node.nodeSize;for(;s>0&&Vk([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;o({tr:n,state:r,dispatch:s})=>{const i=dr(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:d}=a;if(s){const h=ex(l,i,e);if(h&&h.from<=u&&h.to>=d){const f=Y.create(o,h.from,h.to);n.setSelection(f)}}return!0},Qz=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(Uu()||$k())&&r.dom.focus(),eF()&&!Uu()&&!$k()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!YE(n.state.selection))return o(),!0;const a=Km(s.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||s.setSelection(a),l&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},nF=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),rF=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),XE=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&XE(r)}return t};function uc(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return XE(n)}function ZE(t){return typeof(t==null?void 0:t.nodesBetween)=="function"}function so(t,e,n){if(ZE(t))return t;const r=typeof t=="object"&&t!==null;n={slice:!0,parseOptions:{},...n};const s=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return O.fromArray(t.map(o=>e.nodeFromJSON(o)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),so("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,a="";const l=new Dj({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?$r.fromSchema(l).parseSlice(uc(t),n.parseOptions):$r.fromSchema(l).parse(uc(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=$r.fromSchema(e);return n.slice?i.parseSlice(uc(t),n.parseOptions).content:i.parse(uc(t),n.parseOptions)}return so("",e,n)}function QE(t){return!("type"in t)}function eT(t,e,n){const r=t.steps.length-1;if(r{o===0&&(o=d)}),t.setSelection(ne.near(t.doc.resolve(o),n))}const sF=(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=y=>{i.emit("contentError",{editor:i,error:y,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{so(e,i.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{var o;a=so(e,i.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:i.options.enableContentCheck})}catch(y){return l(y),!1}let{from:d,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;const m=QE(a)?a.content:[a];if(m.forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),d===h&&p){const{parent:y}=r.doc.resolve(d);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(d-=1,h+=1)}let g;if(f)Array.isArray(e)?g=e.map(y=>y.text||"").join(""):ZE(e)?g=m.map(y=>{var b;return(b=y.text)!==null&&b!==void 0?b:""}).join(""):typeof e=="object"&&e&&e.text?g=e.text:g=e,r.insertText(g,d,h);else{g=O.from(m);const y=r.doc.resolve(d),b=y.node(),x=y.parentOffset===0,k=b.isText||b.isTextblock,w=b.content.size>0;x&&k&&w&&p&&(d=Math.max(0,d-1)),r.replaceWith(d,h,m)}n.updateSelection&&eT(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:g})}return!0};function tT(t){for(let e=0;e({tr:e,dispatch:n,editor:r})=>{const{pos:s,attrs:i,content:o,updateSelection:a=!0}=t;let l;typeof s=="number"?l=e.doc.resolve(s):s?l=s:l=e.selection.$from;const u=tT(l.parent.contentMatchAt(l.index()));if(!u)return!1;const d=Object.keys(u.spec.attrs||{}),h=i?Object.fromEntries(Object.entries(i).filter(([p])=>d.includes(p))):{};let f;if(o){const p=so(o,r.schema);f=u.createAndFill(h,p)}else f=u.createAndFill(h);return f?(n&&(e.insert(l.pos,f),a&&eT(e,e.steps.length-1,-1)),!0):!1},oF=()=>({state:t,dispatch:e})=>PB(t,e),aF=()=>({state:t,dispatch:e})=>AB(t,e),lF=()=>({state:t,dispatch:e})=>Qj(t,e),cF=()=>({state:t,dispatch:e})=>rE(t,e),uF=()=>({state:t,dispatch:e,tr:n})=>{try{const r=nh(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},dF=()=>({state:t,dispatch:e,tr:n})=>{try{const r=nh(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},hF=()=>({state:t,dispatch:e})=>TB(t,e),fF=()=>({state:t,dispatch:e})=>MB(t,e);function nT(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function pF(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,s,i,o;for(let a=0;a({editor:e,view:n,tr:r,dispatch:s})=>{const i=pF(t).split(/-(?!$)/),o=i.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const d=u.map(r.mapping);d&&s&&r.maybeStep(d)}),!0};function lr(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?Ue(e,t.schema):null,a=[];t.doc.nodesBetween(r,s,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(s,h+d.nodeSize);a.push({node:d,from:f,to:p})});const l=s-r,u=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>Wu(d.node.attrs,n,{strict:!1}));return i?!!u.length:u.reduce((d,h)=>d+h.to-h.from,0)>=l}const gF=(t,e={})=>({state:n,dispatch:r})=>lr(n,Ue(t,n.schema),e)?DB(n,r):!1,xF=()=>({state:t,dispatch:e})=>aE(t,e),yF=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return WB(r)(e,n)},bF=()=>({state:t,dispatch:e})=>iE(t,e);function lh(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Hk(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,s)=>(n.includes(s)||(r[s]=t[s]),r),{})}const vF=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=lh(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=Ue(t,r.schema)),a==="mark"&&(o=dr(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,h)=>{i&&i===d.type&&(l=!0,s&&n.setNodeMarkup(h,void 0,Hk(d.attrs,e))),o&&d.marks.length&&d.marks.forEach(f=>{o===f.type&&(l=!0,s&&n.addMark(h,h+d.nodeSize,o.create(Hk(f.attrs,e))))})})}),l},kF=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),wF=()=>({tr:t,dispatch:e})=>{if(e){const n=new Ft(t.doc);t.setSelection(n)}return!0},SF=()=>({state:t,dispatch:e})=>tE(t,e),NF=()=>({state:t,dispatch:e})=>sE(t,e),CF=()=>({state:t,dispatch:e})=>IB(t,e),jF=()=>({state:t,dispatch:e})=>zB(t,e),EF=()=>({state:t,dispatch:e})=>BB(t,e);function Gm(t,e,n={},r={}){return so(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const TF=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:a})=>{const{doc:l}=i;if(r.preserveWhitespace!=="full"){const u=Gm(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});if(o){const d=QE(u)?u.content:[u];i.replaceWith(0,l.content.size,d).setMeta("preventUpdate",!n)}return!0}return o&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function rT(t,e){const n=dr(e,t.schema),{from:r,to:s,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,s,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function sT(t,e){const n=new qj(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function MF(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function PF(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function ch(t){return e=>PF(e.$from,t)}function q(t,e,n){return t.config[e]===void 0&&t.parent?q(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?q(t.parent,e,n):null}):t.config[e]}function tx(t){return t.map(e=>{const n=q(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e,...tx(n())]:e}).flat(10)}function nx(t,e){const n=ei.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function iT(t){return typeof t=="function"}function ue(t,e=void 0,...n){return iT(t)?e?t.bind(e)(...n):t(...n):t}function AF(t={}){return Object.keys(t).length===0&&t.constructor===Object}function io(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function oT(t){const e=[],{nodeExtensions:n,markExtensions:r}=io(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),l=[...o,...a];return t.forEach(u=>{const d=q(u,"addGlobalAttributes",{name:u.name,options:u.options,storage:u.storage,extensions:s});d&&d().forEach(h=>{let f;Array.isArray(h.types)?f=h.types:h.types==="*"?f=l:h.types==="nodes"?f=o:h.types==="marks"?f=a:f=[],f.forEach(p=>{Object.entries(h.attributes).forEach(([m,g])=>{e.push({type:p,name:m,attribute:{...i,...g}})})})})}),s.forEach(u=>{const d=q(u,"addAttributes",{name:u.name,options:u.options,storage:u.storage});if(!d)return;const h=d();Object.entries(h).forEach(([f,p])=>{const m={...i,...p};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,e.push({type:u.name,name:f,attribute:m})})}),e}function DF(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let a=0;a0){i-=1,n+=l;continue}if(l===";"&&i===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function Wk(t){const e=[],n=DF(t||""),r=n.length;for(let s=0;s!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([s,i])=>{if(s==="__proto__"){Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:i,writable:!0});return}if(!r[s]){r[s]=i;return}if(s==="class"){const o=i?String(i).split(" "):[],a=r[s]?r[s].split(" "):[],l=o.filter(u=>!a.includes(u));r[s]=[...a,...l].join(" ")}else if(s==="style"){const o=new Map([...Wk(r[s]),...Wk(i)]);r[s]=Array.from(o.entries()).map(([a,l])=>`${a}: ${l}`).join("; ")}else r[s]=i}),r},{})}function ol(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ze(n,r),{})}function LF(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Uk(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):LF(n.getAttribute(o.name));return a==null?i:{...i,[o.name]:a}},{});return{...r,...s}}}}function Kk(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&AF(n)?!1:n!=null))}function Gk(t){var e,n;const r={};return!(!(t==null||(e=t.attribute)===null||e===void 0)&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),(t==null||(n=t.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function RF(t,e){var n;const r=oT(t),{nodeExtensions:s,markExtensions:i}=io(t),o=(n=s.find(u=>q(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(s.map(u=>{const d=r.filter(y=>y.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},f=Kk({...t.reduce((y,b)=>{const x=q(b,"extendNodeSchema",h);return{...y,...x?x(u):{}}},{}),content:ue(q(u,"content",h)),marks:ue(q(u,"marks",h)),group:ue(q(u,"group",h)),inline:ue(q(u,"inline",h)),atom:ue(q(u,"atom",h)),selectable:ue(q(u,"selectable",h)),draggable:ue(q(u,"draggable",h)),code:ue(q(u,"code",h)),whitespace:ue(q(u,"whitespace",h)),linebreakReplacement:ue(q(u,"linebreakReplacement",h)),defining:ue(q(u,"defining",h)),isolating:ue(q(u,"isolating",h)),attrs:Object.fromEntries(d.map(Gk))}),p=ue(q(u,"parseHTML",h));p&&(f.parseDOM=p.map(y=>Uk(y,d)));const m=q(u,"renderHTML",h);m&&(f.toDOM=y=>m({node:y,HTMLAttributes:ol(y,d)}));const g=q(u,"renderText",h);return g&&(f.toText=g),[u.name,f]})),l=Object.fromEntries(i.map(u=>{const d=r.filter(g=>g.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},f=Kk({...t.reduce((g,y)=>{const b=q(y,"extendMarkSchema",h);return{...g,...b?b(u):{}}},{}),inclusive:ue(q(u,"inclusive",h)),excludes:ue(q(u,"excludes",h)),group:ue(q(u,"group",h)),spanning:ue(q(u,"spanning",h)),code:ue(q(u,"code",h)),attrs:Object.fromEntries(d.map(Gk))}),p=ue(q(u,"parseHTML",h));p&&(f.parseDOM=p.map(g=>Uk(g,d)));const m=q(u,"renderHTML",h);return m&&(f.toDOM=g=>m({mark:g,HTMLAttributes:ol(g,d)})),[u.name,f]}));return new Dj({topNode:o,nodes:a,marks:l})}function _F(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function ga(t){return t.sort((n,r)=>{const s=q(n,"priority")||100,i=q(r,"priority")||100;return s>i?-1:sr.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function lT(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=` +`);return{dom:l,text:f,slice:e}}function ME(t,e,n,r,s){let i=s.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=!!e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",f=>{e=f(e,i||r,t)}),i)return a=new H(O.from(t.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0),t.someProp("transformPasted",f=>{a=f(a,t,!0)}),a;let h=t.someProp("clipboardTextParser",f=>f(e,s,r,t));if(h)a=h;else{let f=s.marks(),{schema:p}=t.state,m=ei.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=o.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,f)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),o=F6(n),Nl&&V6(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||$r.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||d),context:s,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!O6.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)a=$6(Pk(a,+d[1],+d[2]),d[4]);else if(a=H.maxOpen(B6(a.content,s),!0),a.openStart||a.openEnd){let h=0,f=0;for(let p=a.content.firstChild;h{a=h(a,t,l)}),a}const O6=/^(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 B6(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let s=e.node(n).contentMatchAt(e.index(n)),i,o=[];if(t.forEach(a=>{if(!o)return;let l=s.findWrapping(a.type),u;if(!l)return o=null;if(u=o.length&&i.length&&AE(l,i,a,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=DE(o[o.length-1],i.length));let d=PE(a,l);o.push(d),s=s.matchType(d.type),i=l}}),o)return O.from(o)}return t}function PE(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,O.from(t));return t}function AE(t,e,n,r,s){if(s1&&(i=0),s=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,i<=s).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(O.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function Pk(t,e,n){return en})}return _o.createHTML(t)}function F6(t){let e=/^(\s*]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=RE(),r=n.body,s=/<([a-z][^>\s]+)/i.exec(t),i;if((i=s&&LE[s[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"").reverse().join("")),r.innerHTML=z6(t),i)for(let o=0;o=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;try{l.checkAttrs(r[a+1])}catch{break}s=O.from(l.create(r[a+1],s)),i++,o++}return new H(s,i,o)}const wt={},St={},H6={touchstart:!0,touchmove:!0};class W6{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.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function U6(t){for(let e in wt){let n=wt[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{G6(t,r)&&!q0(t,r)&&(t.editable||!(r.type in St))&&n(t,r)},H6[e]?{passive:!0}:void 0)}mt&&t.dom.addEventListener("input",()=>null),Um(t)}function Qn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function K6(t){t.input.mouseDown&&t.input.mouseDown.done(),t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Um(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>q0(t,r))})}function q0(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function G6(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function q6(t,e){!q0(t,e)&&wt[e.type]&&(t.editable||!(e.type in St))&&wt[e.type](t,e)}St.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!BE(t)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Zn&&st&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ro&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",s=>s(t,vs(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||I6(t,n)?n.preventDefault():Qn(t,"key")};St.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};St.keypress=(t,e)=>{let n=e;if(BE(t)||!n.charCode||n.ctrlKey&&!n.altKey||Jt&&n.metaKey)return;if(t.someProp("handleKeyPress",s=>s(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Y)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),i=()=>t.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,s,i))&&t.dispatch(i()),n.preventDefault()}};function jl(t){return{left:t.clientX,top:t.clientY}}function J6(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function J0(t,e,n,r,s){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,a=>o>i.depth?a(t,n,i.nodeAfter,i.before(o),s,!0):a(t,n,i.node(o),i.before(o),s,!1)))return!0;return!1}function El(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function Y6(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&J.isSelectable(r)?(El(t,new J(n)),!0):!1}function X6(t,e){if(e==-1)return!1;let n=t.state.selection,r,s;n instanceof J&&(r=n.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o);if(J.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?s=i.before(n.$from.depth):s=i.before(o);break}}return s!=null?(El(t,J.create(t.state.doc,s)),!0):!1}function Z6(t,e,n,r,s){return J0(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(s?X6(t,n):Y6(t,n))}function Q6(t,e,n,r){return J0(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",s=>s(t,e,r))}function ez(t,e,n,r){return J0(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",s=>s(t,e,r))||tz(t,n,r)}function tz(t,e,n){if(n.button!=0)return!1;let r=_E(t,e,!0),s=t.state.doc;return r?(El(t,r),r instanceof Y&&s.eq(t.state.doc)&&(t.input.mouseDown=new rz(t,r)),!0):!1}function _E(t,e,n){let r=t.state.doc;if(e==-1)return r.inlineContent?Y.create(r,0,r.content.size):null;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),a=s.before(i);if(o.inlineContent)return Y.create(r,a+1,a+1+o.content.size);if(n&&J.isSelectable(o))return J.create(r,a)}return null}function Y0(t){return Fu(t)}const IE=Jt?"metaKey":"ctrlKey";wt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Y0(t),s=Date.now(),i="singleClick";s-t.input.lastClick.time<500&&J6(n,t.input.lastClick)&&!n[IE]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:i,button:n.button},t.input.mouseDown&&t.input.mouseDown.done();let o=t.posAtCoords(jl(n));o&&(i=="singleClick"?t.input.mouseDown=new nz(t,o,n,!!r):(i=="doubleClick"?Q6:ez)(t,o.pos,o.inside,n)?n.preventDefault():Qn(t,"pointer"))};class OE{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class nz extends OE{constructor(e,n,r,s){super(e),this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[IE],this.allowDefault=r.shiftKey;let i,o;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),o=n.inside;else{let d=e.state.doc.resolve(n.pos);i=d.parent,o=d.depth?d.before():0}const a=s?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:u}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||u instanceof J&&u.from<=o&&u.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&nn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Qn(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||rr(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(jl(e))),this.updateAllowDefault(e),this.allowDefault||!n?Qn(this.view,"pointer"):Z6(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||mt&&this.mightDrag&&!this.mightDrag.node.isAtom||st&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(El(this.view,ne.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Qn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Qn(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class rz extends OE{constructor(e,n){super(e),this.startSelection=n,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),Qn(this.view,"pointer");let n=this.view.posAtCoords(jl(e)),r=n&&_E(this.view,n.inside,!1);if(!r)return;let{doc:s}=this.view.state,i=this.startSelection,[o,a]=r.from{t.input.lastTouch=Date.now(),Y0(t),Qn(t,"pointer")};wt.touchmove=t=>{t.input.lastTouch=Date.now(),Qn(t,"pointer")};wt.contextmenu=t=>Y0(t);function BE(t,e){return t.composing?!0:mt&&Math.abs(Date.now()-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const sz=Zn?5e3:-1;St.compositionstart=St.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Y&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||st&&fE&&iz(t)))t.markCursor=t.state.storedMarks||n.marks(),Fu(t,!0),t.markCursor=null;else if(Fu(t,!e.selection.empty),nn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let a=t.domSelection();a&&a.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}t.input.composing=!0}zE(t,sz)};function iz(t){let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(!e||e.nodeType!=1||n>=e.childNodes.length)return!1;let r=e.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}St.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now(),t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,zE(t,20))};function zE(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Fu(t),e))}function FE(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Date.now());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function oz(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=XB(e.focusNode,e.focusOffset),r=ZB(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function Fu(t,e=!1){if(!(Zn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),FE(t),e||t.docView&&t.docView.dirty){let n=U0(t),r=t.state.selection;return n&&!n.eq(r)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function az(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const rl=Rt&&Hr<15||ro&&n6<604;wt.copy=St.cut=(t,e)=>{let n=e,r=t.state.selection,s=n.type=="cut";if(r.empty)return;let i=rl?null:n.clipboardData,o=r.content(),{dom:a,text:l}=G0(t,o);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):az(t,a),s&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function lz(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function cz(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?sl(t,r.value,null,s,e):sl(t,r.textContent,r.innerHTML,s,e)},50)}function sl(t,e,n,r,s){let i=ME(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,s,i||H.empty)))return!0;if(!i)return!1;let o=lz(i),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function VE(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}St.paste=(t,e)=>{let n=e;if(t.composing&&!Zn)return;let r=rl?null:n.clipboardData,s=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&sl(t,VE(r),r.getData("text/html"),s,n)?n.preventDefault():cz(t,n)};class $E{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const uz=Jt?"altKey":"ctrlKey";function HE(t,e){let n;return t.someProp("dragCopies",r=>{n=n||r(e)}),n!=null?!n:!e[uz]}wt.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=t.state.selection,i=s.empty?null:t.posAtCoords(jl(n)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof J?s.to-1:s.to))){if(r&&r.mightDrag)o=J.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=J.create(t.state.doc,h.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:u,slice:d}=G0(t,a);(!n.dataTransfer.files.length||!st||hE>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(rl?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",rl||n.dataTransfer.setData("text/plain",u),t.dragging=new $E(d,HE(t,n),o)};wt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};St.dragover=St.dragenter=(t,e)=>e.preventDefault();St.drop=(t,e)=>{try{dz(t,e,t.dragging)}finally{t.dragging=null}};function dz(t,e,n){if(!e.dataTransfer)return;let r=t.posAtCoords(jl(e));if(!r)return;let s=t.state.doc.resolve(r.pos),i=n&&n.slice;i?t.someProp("transformPasted",p=>{i=p(i,t,!1)}):i=ME(t,VE(e.dataTransfer),rl?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(n&&HE(t,e));if(t.someProp("handleDrop",p=>p(t,e,i||H.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let a=i?Wj(t.state.doc,s.pos,i):s.pos;a==null&&(a=s.pos);let l=t.state.tr;if(o){let{node:p}=n;p?p.replace(l):l.deleteSelection()}let u=l.mapping.map(a),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=l.doc;if(d?l.replaceRangeWith(u,u,i.content.firstChild):l.replaceRange(u,u,i),l.doc.eq(h))return;let f=l.doc.resolve(u);if(d&&J.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new J(f));else{let p=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((m,g,y,b)=>p=b),l.setSelection(K0(t,f,l.doc.resolve(p)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}wt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&rr(t)},20))};wt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};wt.beforeinput=(t,e)=>{if(Zn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,vs(8,"Backspace")))))return;let{$cursor:s}=t.state.selection;s&&s.pos>0&&t.dispatch(t.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let t in St)wt[t]=St[t];function il(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Vu{constructor(e,n){this.toDOM=e,this.spec=n||zs,this.side=this.spec.side||0}map(e,n,r,s){let{pos:i,deleted:o}=e.mapResult(n.from+s,this.side<0?-1:1);return o?null:new vt(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Vu&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&il(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Kr{constructor(e,n){this.attrs=e,this.spec=n||zs}map(e,n,r,s){let i=e.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new vt(i,o,this)}valid(e,n){return n.from=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+s,a.to+s))}for(let o=0;oe){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,s+a,i)}}map(e,n,r){return this==ht||e.maps.length==0?this:this.mapInner(e,n,0,0,r||zs)}mapInner(e,n,r,s,i){let o;for(let a=0;a{let u=l+r,d;if(d=UE(n,a,u)){for(s||(s=this.children.slice());ia&&h.to=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,o=i+n.content.size;for(let a=0;ai&&l.type instanceof Kr){let u=Math.max(i,l.from)-i,d=Math.min(o,l.to)-i;us.map(e,n,zs));return Cr.from(r)}forChild(e,n){if(n.isLeaf)return ce.empty;let r=[];for(let s=0;sn instanceof ce)?e:e.reduce((n,r)=>n.concat(r instanceof ce?r:r.members),[]))}}forEachSet(e){for(let n=0;n{let y=g-m-(p-f);for(let b=0;bx+d-h)continue;let k=a[b]+d-h;p>=k?a[b+1]=f<=k?-2:-1:f>=d&&y&&(a[b]+=y,a[b+1]+=y)}h+=y}),d=n.maps[u].map(d,-1)}let l=!1;for(let u=0;u=r.content.size){l=!0;continue}let f=n.map(t[u+1]+i,-1),p=f-s,{index:m,offset:g}=r.content.findIndex(h),y=r.maybeChild(m);if(y&&g==h&&g+y.nodeSize==p){let b=a[u+2].mapInner(n,y,d+1,t[u]+i+1,o);b!=ht?(a[u]=h,a[u+1]=p,a[u+2]=b):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=fz(a,t,e,n,s,i,o),d=$u(u,r,0,o);e=d.local;for(let h=0;hn&&o.to{let u=UE(t,a,l+n);if(u){i=!0;let d=$u(u,a,n+l+1,r);d!=ht&&s.push(l,l+a.nodeSize,d)}});let o=WE(i?KE(t):t,-n).sort(Fs);for(let a=0;a0;)e++;t.splice(e,0,n)}function jf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=ht&&e.push(r)}),t.cursorWrapper&&e.push(ce.create(t.state.doc,[t.cursorWrapper.deco])),Cr.from(e)}const pz={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},mz=Rt&&Hr<=11;class gz{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class xz{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new gz,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;ss.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():mt&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),mz&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,pz)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;nthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Nk(this.view)){if(this.suppressingSelectionUpdates)return rr(this.view);if(Rt&&Hr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Js(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let i=e.focusNode;i;i=no(i))n.add(i);for(let i=e.anchorNode;i;i=no(i))if(n.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Nk(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,a=!1,l=[];if(e.editable)for(let d=0;dd.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||st&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&n.some(d=>d.type=="childList"&&d.removedNodes.length))){for(let d of l)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;for(;h&&h.nodeType==1;){if(h.contentEditable=="false"){d.parentNode.removeChild(d);break}h=h.firstChild}}}else if(nn&&l.length){let d=l.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,f]=d;h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let f of d){let p=f.parentNode;p&&p.nodeName=="LI"&&(!h||vz(e,h)!=p)&&f.remove()}}}let u=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||s)&&(i>-1&&(e.docView.markDirty(i,o),yz(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,kz(e,l)),this.handleDOMChange(i,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||rr(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;di;b--){let x=s.childNodes[b-1],k=x.pmViewDesc;if(x.nodeName=="BR"&&!k){o=b;break}if(!k||k.size)break}let f=t.state.doc,p=t.someProp("domParser")||$r.fromSchema(t.state.schema),m=f.resolve(a),g=null,y=p.parse(s,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:i,to:o,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:Sz(r),context:m});if(d&&d[0].pos!=null){let b=d[0].pos,x=d[1]&&d[1].pos;x==null&&(x=b),g={anchor:b+a,head:x+a}}return{doc:y,sel:g,from:a,to:l}}const Sz=t=>e=>{let n=e.pmViewDesc;if(n)return n.parseRule(t);if(e.nodeName=="BR"&&e.parentNode){if(mt&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(e.parentNode.lastChild==e||mt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null},Nz=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Cz(t,e,n,r,s){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let S=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,N=U0(t,S);if(N&&!t.state.selection.eq(N)){if(st&&Zn&&t.input.lastKeyCode===13&&Date.now()-100j(t,vs(13,"Enter"))))return;let M=t.state.tr.setSelection(N);S=="pointer"?M.setMeta("pointer",!0):S=="key"&&M.scrollIntoView(),i&&M.setMeta("composition",i),t.dispatch(M)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,u=wz(t,e,n,s),d=t.state.doc,h=d.slice(u.from,u.to),f,p;t.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Zn)&&s.some(S=>S.nodeType==1&&!Nz.test(S.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",S=>S(t,vs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof Y&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let S=_k(t,t.state.doc,u.sel);if(S&&!S.eq(t.state.selection)){let N=t.state.tr.setSelection(S);i&&N.setMeta("composition",i),t.dispatch(N)}}return}t.state.selection.fromt.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?m.start=t.state.selection.from:m.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),Rt&&Hr<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>u.from&&u.doc.textBetween(m.start-u.from-1,m.start-u.from+1)=="  "&&(m.start--,m.endA--,m.endB--);let g=u.doc.resolveNoCache(m.start-u.from),y=u.doc.resolveNoCache(m.endB-u.from),b=d.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&b.end()>=m.endA;if((ro&&t.input.lastIOSEnter>Date.now()-225&&(!x||s.some(S=>S.nodeName=="DIV"||S.nodeName=="P"))||!x&&g.posS(t,vs(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&Ez(d,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",S=>S(t,vs(8,"Backspace")))){Zn&&st&&t.domObserver.suppressSelectionUpdates();return}st&&m.endB==m.start&&(t.input.lastChromeDelete=Date.now()),Zn&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==m.endA&&(m.endB-=2,y=u.doc.resolveNoCache(m.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(S){return S(t,vs(13,"Enter"))})},20));let k=m.start,w=m.endA,C=S=>{let N=S||t.state.tr.replace(k,w,u.doc.slice(m.start-u.from,m.endB-u.from));if(u.sel){let M=_k(t,N.doc,u.sel);M&&!(st&&t.composing&&M.empty&&(m.start!=m.endB||t.input.lastChromeDeleterr(t),20));let S=C(t.state.tr.delete(k,w)),N=d.resolve(m.start).marksAcross(d.resolve(m.endA));N&&S.ensureMarks(N),t.dispatch(S)}else if(m.endA==m.endB&&(E=jz(g.parent.content.cut(g.parentOffset,y.parentOffset),b.parent.content.cut(b.parentOffset,m.endA-b.start())))){let S=C(t.state.tr);E.type=="add"?S.addMark(k,w,E.mark):S.removeMark(k,w,E.mark),t.dispatch(S)}else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let S=g.parent.textBetween(g.parentOffset,y.parentOffset),N=()=>C(t.state.tr.insertText(S,k,w));t.someProp("handleTextInput",M=>M(t,k,w,S,N))||t.dispatch(N())}else t.dispatch(C());else t.dispatch(C())}function _k(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:K0(t,e.resolve(n.anchor),e.resolve(n.head))}function jz(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,s=n,i=r,o,a,l;for(let d=0;dd.mark(a.addToSet(d.marks));else if(s.length==0&&i.length==1)a=i[0],o="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let u=[];for(let d=0;dn||Ef(o,!0,!1)0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,s++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function Tz(t,e,n,r,s){let i=t.findDiffStart(e,n),o=n+t.size,a=n+e.size;if(i==null)return null;let{a:l,b:u}=t.findDiffEnd(e,o,a);if(s=="end"){let d=Math.max(0,i-Math.min(l,u));r-=l+d-i}if(l=l?i-r:0;i-=d,u=i+(u-l),l=i}else if(u=u?i-r:0;i-=d,l=i+(l-u),u=i}return{start:i,endA:l,endB:u}}class GE{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new W6,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Fk),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Bk(this),Ok(this),this.nodeViews=zk(this),this.docView=yk(this.state.doc,Ik(this),jf(this),this.dom,this),this.domObserver=new xz(this,(r,s,i,o)=>Cz(this,r,s,i,o)),this.domObserver.start(),U6(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Um(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Fk),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(FE(this),o=!0),this.state=e;let a=s.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=zk(this);Pz(p,this.nodeViews)&&(this.nodeViews=p,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Um(this),this.editable=Bk(this),Ok(this);let l=jf(this),u=Ik(this),d=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,u,l);(h||!e.selection.eq(s.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&i6(this);if(o){this.domObserver.stop();let p=h&&(Rt||st)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&Mz(s.selection,e.selection);if(h){let g=st?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=oz(this)),(i||!this.docView.update(e.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=yk(e.doc,u,l,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(p=!0)}let m=this.input.mouseDown;p||!(m&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&M6(this)&&m.delaySelUpdate())?rr(this,p):(jE(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&o6(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof J){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&fk(this,n.getBoundingClientRect(),e)}else fk(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&in.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return h6(this,e)}coordsAtPos(e,n=1){return yE(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let s=this.docView.posFromDOM(e,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,n){return x6(this,n||this.state,e)}pasteHTML(e,n){return sl(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return sl(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return G0(this,e)}destroy(){this.docView&&(K6(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],jf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,JB())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return q6(this,e)}domSelectionRange(){let e=this.domSelection();return e?mt&&this.root.nodeType===11&&e6(this.dom.ownerDocument)==this.dom&&bz(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}GE.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function Ik(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[vt.node(0,t.state.doc.content.size,e)]}function Ok(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:vt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Bk(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Mz(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function zk(t){let e=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Pz(t,e){let n=0,r=0;for(let s in t){if(t[s]!=e[s])return!0;n++}for(let s in e)r++;return n!=r}function Fk(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Zr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Hu={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Az=typeof navigator<"u"&&/Mac/.test(navigator.platform),Dz=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var rt=0;rt<10;rt++)Zr[48+rt]=Zr[96+rt]=String(rt);for(var rt=1;rt<=24;rt++)Zr[rt+111]="F"+rt;for(var rt=65;rt<=90;rt++)Zr[rt]=String.fromCharCode(rt+32),Hu[rt]=String.fromCharCode(rt);for(var Tf in Zr)Hu.hasOwnProperty(Tf)||(Hu[Tf]=Zr[Tf]);function Lz(t){var e=Az&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Dz&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Hu:Zr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const Rz=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),_z=typeof navigator<"u"&&/Win/.test(navigator.platform);function Iz(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,s,i,o;for(let a=0;a[a,(...d)=>{const h=l(...d)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:s,state:i}=this,{view:o}=s,a=[],l=!!e,u=e||i.tr,d=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),a.every(f=>f===!0)),h={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...g)=>{const y=this.buildProps(u,n),b=p(...g)(y);return a.push(b),h}])),run:d};return h}static createFakeChain(){const e=new Proxy({},{get:(n,r)=>{if(r!=="then")return r==="run"?()=>!1:()=>e}});return e}createCan(e){const{rawCommands:n,state:r}=this,s=!1,i=e||r.tr,o=this.buildProps(i,s);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,s)}}static createFallbackCan(){const e=JE.createFakeChain();return new Proxy({chain:()=>e},{get:(n,r)=>{if(r!=="then")return r==="chain"?n.chain:()=>!1}})}buildProps(e,n=!0){const{rawCommands:r,editor:s,state:i}=this,{view:o}=s,a={tr:e,editor:s,view:o,state:ah({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,u])=>[l,(...d)=>u(...d)(a)]))}};return a}};const zz=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{if(!t.isDestroyed){var n;e.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),Fz=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),Vz=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:s}=r;return n&&s.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:d}=e,h=u.resolve(d.map(l)),f=u.resolve(d.map(l+a.nodeSize)),p=h.blockRange(f);if(!p)return;const m=vo(p);if(a.type.isTextblock){const{defaultType:g}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},$z=t=>e=>t(e),Hz=()=>({state:t,dispatch:e})=>aE(t,e),Wz=(t,e)=>({editor:n,tr:r})=>{const{state:s}=n,i=s.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new Y(r.doc.resolve(Math.max(o-1,0)))),!0},Uz=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const s=t.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const o=s.before(i),a=s.after(i);t.delete(o,a).scrollIntoView()}return!0}return!1};function Ue(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}const Kz=t=>({tr:e,state:n,dispatch:r})=>{const s=Ue(t,n.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},Gz=t=>({tr:e,dispatch:n})=>{const{from:r,to:s}=t;return n&&e.delete(r,s),!0},qz=t=>t.content?/^text(\*|\+)/.test(t.content):!1,Vk=(t,e,n)=>{if(!t.parent.isInline||n==="left"&&t.pos>t.start()||n==="right"&&t.pos({from:Vk(t,n,"left"),to:Vk(e,n,"right")}),Yz=()=>({state:t,dispatch:e})=>{if(t.selection.empty)return!1;if(e){const n=t.tr,{ranges:r}=t.selection,s=n.steps.length;r.forEach(i=>{const o=n.mapping.slice(s),a=n.doc.resolve(o.map(i.$from.pos)),l=n.doc.resolve(o.map(i.$to.pos)),{from:u,to:d}=Jz(a,l,t.schema);n.deleteRange(u,d)}),n.selection.empty||n.setSelection(Y.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),e(n)}return!0},Xz=()=>({commands:t})=>t.keyboardShortcut("Enter"),Zz=()=>({state:t,dispatch:e})=>RB(t,e);function Q0(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Wu(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>n.strict?e[s]===t[s]:Q0(e[s])?e[s].test(t[s]):e[s]===t[s]):!0}function YE(t,e,n={}){return t.find(r=>r.type===e&&Wu(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function $k(t,e,n={}){return!!YE(t,e,n)}function ex(t,e,n){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if((!r.node||!r.node.marks.some(l=>l.type===e))&&(r=t.parent.childBefore(t.parentOffset)),!r.node||!r.node.marks.some(l=>l.type===e))return;if(!n){const l=r.node.marks.find(u=>u.type===e);l&&(n=l.attrs)}if(!YE([...r.node.marks],e,n))return;let s=r.index,i=t.start()+r.offset,o=s+1,a=i+r.node.nodeSize;for(;s>0&&$k([...t.parent.child(s-1).marks],e,n);)s-=1,i-=t.parent.child(s).nodeSize;for(;o({tr:n,state:r,dispatch:s})=>{const i=dr(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:d}=a;if(s){const h=ex(l,i,e);if(h&&h.from<=u&&h.to>=d){const f=Y.create(o,h.from,h.to);n.setSelection(f)}}return!0},eF=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r({editor:n,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(Uu()||Hk())&&r.dom.focus(),tF()&&!Uu()&&!Hk()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!XE(n.state.selection))return o(),!0;const a=Km(s.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||s.setSelection(a),l&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},rF=(t,e)=>n=>t.every((r,s)=>e(r,{...n,index:s})),sF=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),ZE=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&ZE(r)}return t};function uc(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${t}`,n=new window.DOMParser().parseFromString(e,"text/html").body;return ZE(n)}function QE(t){return typeof(t==null?void 0:t.nodesBetween)=="function"}function so(t,e,n){if(QE(t))return t;const r=typeof t=="object"&&t!==null;n={slice:!0,parseOptions:{},...n};const s=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return O.fromArray(t.map(o=>e.nodeFromJSON(o)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),so("",e,n)}if(s){if(n.errorOnInvalidContent){let o=!1,a="";const l=new Lj({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?$r.fromSchema(l).parseSlice(uc(t),n.parseOptions):$r.fromSchema(l).parse(uc(t),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=$r.fromSchema(e);return n.slice?i.parseSlice(uc(t),n.parseOptions).content:i.parse(uc(t),n.parseOptions)}return so("",e,n)}function eT(t){return!("type"in t)}function tT(t,e,n){const r=t.steps.length-1;if(r{o===0&&(o=d)}),t.setSelection(ne.near(t.doc.resolve(o),n))}const iF=(t,e,n)=>({tr:r,dispatch:s,editor:i})=>{if(s){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=y=>{i.emit("contentError",{editor:i,error:y,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{so(e,i.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(y){l(y)}try{var o;a=so(e,i.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!==null&&o!==void 0?o:i.options.enableContentCheck})}catch(y){return l(y),!1}let{from:d,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,p=!0;const m=eT(a)?a.content:[a];if(m.forEach(y=>{y.check(),f=f?y.isText&&y.marks.length===0:!1,p=p?y.isBlock:!1}),d===h&&p){const{parent:y}=r.doc.resolve(d);y.isTextblock&&!y.type.spec.code&&!y.childCount&&(d-=1,h+=1)}let g;if(f)Array.isArray(e)?g=e.map(y=>y.text||"").join(""):QE(e)?g=m.map(y=>{var b;return(b=y.text)!==null&&b!==void 0?b:""}).join(""):typeof e=="object"&&e&&e.text?g=e.text:g=e,r.insertText(g,d,h);else{g=O.from(m);const y=r.doc.resolve(d),b=y.node(),x=y.parentOffset===0,k=b.isText||b.isTextblock,w=b.content.size>0;x&&k&&w&&p&&(d=Math.max(0,d-1)),r.replaceWith(d,h,m)}n.updateSelection&&tT(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:d,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:d,text:g})}return!0};function nT(t){for(let e=0;e({tr:e,dispatch:n,editor:r})=>{const{pos:s,attrs:i,content:o,updateSelection:a=!0}=t;let l;typeof s=="number"?l=e.doc.resolve(s):s?l=s:l=e.selection.$from;const u=nT(l.parent.contentMatchAt(l.index()));if(!u)return!1;const d=Object.keys(u.spec.attrs||{}),h=i?Object.fromEntries(Object.entries(i).filter(([p])=>d.includes(p))):{};let f;if(o){const p=so(o,r.schema);f=u.createAndFill(h,p)}else f=u.createAndFill(h);return f?(n&&(e.insert(l.pos,f),a&&tT(e,e.steps.length-1,-1)),!0):!1},aF=()=>({state:t,dispatch:e})=>AB(t,e),lF=()=>({state:t,dispatch:e})=>DB(t,e),cF=()=>({state:t,dispatch:e})=>eE(t,e),uF=()=>({state:t,dispatch:e})=>sE(t,e),dF=()=>({state:t,dispatch:e,tr:n})=>{try{const r=nh(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},hF=()=>({state:t,dispatch:e,tr:n})=>{try{const r=nh(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},fF=()=>({state:t,dispatch:e})=>MB(t,e),pF=()=>({state:t,dispatch:e})=>PB(t,e);function rT(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function mF(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,s,i,o;for(let a=0;a({editor:e,view:n,tr:r,dispatch:s})=>{const i=mF(t).split(/-(?!$)/),o=i.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l==null||l.steps.forEach(u=>{const d=u.map(r.mapping);d&&s&&r.maybeStep(d)}),!0};function lr(t,e,n={}){const{from:r,to:s,empty:i}=t.selection,o=e?Ue(e,t.schema):null,a=[];t.doc.nodesBetween(r,s,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(s,h+d.nodeSize);a.push({node:d,from:f,to:p})});const l=s-r,u=a.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>Wu(d.node.attrs,n,{strict:!1}));return i?!!u.length:u.reduce((d,h)=>d+h.to-h.from,0)>=l}const xF=(t,e={})=>({state:n,dispatch:r})=>lr(n,Ue(t,n.schema),e)?LB(n,r):!1,yF=()=>({state:t,dispatch:e})=>lE(t,e),bF=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return UB(r)(e,n)},vF=()=>({state:t,dispatch:e})=>oE(t,e);function lh(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Wk(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,s)=>(n.includes(s)||(r[s]=t[s]),r),{})}const kF=(t,e)=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=lh(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=Ue(t,r.schema)),a==="mark"&&(o=dr(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(d,h)=>{i&&i===d.type&&(l=!0,s&&n.setNodeMarkup(h,void 0,Wk(d.attrs,e))),o&&d.marks.length&&d.marks.forEach(f=>{o===f.type&&(l=!0,s&&n.addMark(h,h+d.nodeSize,o.create(Wk(f.attrs,e))))})})}),l},wF=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),SF=()=>({tr:t,dispatch:e})=>{if(e){const n=new Ft(t.doc);t.setSelection(n)}return!0},NF=()=>({state:t,dispatch:e})=>nE(t,e),CF=()=>({state:t,dispatch:e})=>iE(t,e),jF=()=>({state:t,dispatch:e})=>OB(t,e),EF=()=>({state:t,dispatch:e})=>FB(t,e),TF=()=>({state:t,dispatch:e})=>zB(t,e);function Gm(t,e,n={},r={}){return so(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const MF=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:a})=>{const{doc:l}=i;if(r.preserveWhitespace!=="full"){const u=Gm(t,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});if(o){const d=eT(u)?u.content:[u];i.replaceWith(0,l.content.size,d).setMeta("preventUpdate",!n)}return!0}return o&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function sT(t,e){const n=dr(e,t.schema),{from:r,to:s,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,s,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function iT(t,e){const n=new Jj(t);return e.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function PF(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(s,i)=>{n(s)&&r.push({node:s,pos:i})}),r}function AF(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function ch(t){return e=>AF(e.$from,t)}function q(t,e,n){return t.config[e]===void 0&&t.parent?q(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?q(t.parent,e,n):null}):t.config[e]}function tx(t){return t.map(e=>{const n=q(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e,...tx(n())]:e}).flat(10)}function nx(t,e){const n=ei.fromSchema(e).serializeFragment(t),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function oT(t){return typeof t=="function"}function ue(t,e=void 0,...n){return oT(t)?e?t.bind(e)(...n):t(...n):t}function DF(t={}){return Object.keys(t).length===0&&t.constructor===Object}function io(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function aT(t){const e=[],{nodeExtensions:n,markExtensions:r}=io(t),s=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(u=>u.name!=="text").map(u=>u.name),a=r.map(u=>u.name),l=[...o,...a];return t.forEach(u=>{const d=q(u,"addGlobalAttributes",{name:u.name,options:u.options,storage:u.storage,extensions:s});d&&d().forEach(h=>{let f;Array.isArray(h.types)?f=h.types:h.types==="*"?f=l:h.types==="nodes"?f=o:h.types==="marks"?f=a:f=[],f.forEach(p=>{Object.entries(h.attributes).forEach(([m,g])=>{e.push({type:p,name:m,attribute:{...i,...g}})})})})}),s.forEach(u=>{const d=q(u,"addAttributes",{name:u.name,options:u.options,storage:u.storage});if(!d)return;const h=d();Object.entries(h).forEach(([f,p])=>{const m={...i,...p};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,e.push({type:u.name,name:f,attribute:m})})}),e}function LF(t){const e=[];let n="",r=!1,s=!1,i=0;const o=t.length;for(let a=0;a0){i-=1,n+=l;continue}if(l===";"&&i===0){e.push(n),n="";continue}}n+=l}return n&&e.push(n),e}function Uk(t){const e=[],n=LF(t||""),r=n.length;for(let s=0;s!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([s,i])=>{if(s==="__proto__"){Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:i,writable:!0});return}if(!r[s]){r[s]=i;return}if(s==="class"){const o=i?String(i).split(" "):[],a=r[s]?r[s].split(" "):[],l=o.filter(u=>!a.includes(u));r[s]=[...a,...l].join(" ")}else if(s==="style"){const o=new Map([...Uk(r[s]),...Uk(i)]);r[s]=Array.from(o.entries()).map(([a,l])=>`${a}: ${l}`).join("; ")}else r[s]=i}),r},{})}function ol(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>ze(n,r),{})}function RF(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Kk(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):RF(n.getAttribute(o.name));return a==null?i:{...i,[o.name]:a}},{});return{...r,...s}}}}function Gk(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&DF(n)?!1:n!=null))}function qk(t){var e,n;const r={};return!(!(t==null||(e=t.attribute)===null||e===void 0)&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(r.default=t.attribute.default),(t==null||(n=t.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(r.validate=t.attribute.validate),[t.name,r]}function _F(t,e){var n;const r=aT(t),{nodeExtensions:s,markExtensions:i}=io(t),o=(n=s.find(u=>q(u,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(s.map(u=>{const d=r.filter(y=>y.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},f=Gk({...t.reduce((y,b)=>{const x=q(b,"extendNodeSchema",h);return{...y,...x?x(u):{}}},{}),content:ue(q(u,"content",h)),marks:ue(q(u,"marks",h)),group:ue(q(u,"group",h)),inline:ue(q(u,"inline",h)),atom:ue(q(u,"atom",h)),selectable:ue(q(u,"selectable",h)),draggable:ue(q(u,"draggable",h)),code:ue(q(u,"code",h)),whitespace:ue(q(u,"whitespace",h)),linebreakReplacement:ue(q(u,"linebreakReplacement",h)),defining:ue(q(u,"defining",h)),isolating:ue(q(u,"isolating",h)),attrs:Object.fromEntries(d.map(qk))}),p=ue(q(u,"parseHTML",h));p&&(f.parseDOM=p.map(y=>Kk(y,d)));const m=q(u,"renderHTML",h);m&&(f.toDOM=y=>m({node:y,HTMLAttributes:ol(y,d)}));const g=q(u,"renderText",h);return g&&(f.toText=g),[u.name,f]})),l=Object.fromEntries(i.map(u=>{const d=r.filter(g=>g.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},f=Gk({...t.reduce((g,y)=>{const b=q(y,"extendMarkSchema",h);return{...g,...b?b(u):{}}},{}),inclusive:ue(q(u,"inclusive",h)),excludes:ue(q(u,"excludes",h)),group:ue(q(u,"group",h)),spanning:ue(q(u,"spanning",h)),code:ue(q(u,"code",h)),attrs:Object.fromEntries(d.map(qk))}),p=ue(q(u,"parseHTML",h));p&&(f.parseDOM=p.map(g=>Kk(g,d)));const m=q(u,"renderHTML",h);return m&&(f.toDOM=g=>m({mark:g,HTMLAttributes:ol(g,d)})),[u.name,f]}));return new Lj({topNode:o,nodes:a,marks:l})}function IF(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}function ga(t){return t.sort((n,r)=>{const s=q(n,"priority")||100,i=q(r,"priority")||100;return s>i?-1:sr.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function cT(t,e,n){const{from:r,to:s}=e,{blockSeparator:i=` -`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,s,(l,u,d,h)=>{l.isBlock&&u>r&&(a+=i);const f=o==null?void 0:o[l.type.name];if(f)return d&&(a+=f({node:l,pos:u,parent:d,index:h,range:e})),!1;if(l.isText){var p;a+=l==null||(p=l.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,s-u)}}),a}function IF(t,e){return lT(t,{from:0,to:t.content.size},e)}function cT(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function OF(t,e){const n=Ue(e,t.schema),{from:r,to:s}=t.selection,i=[];t.doc.nodesBetween(r,s,a=>{i.push(a)});const o=i.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function uT(t,e){const n=lh(typeof e=="string"?e:e.name,t.schema);return n==="node"?OF(t,e):n==="mark"?rT(t,e):{}}function BF(t,e=JSON.stringify){const n={};return t.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function zF(t){const e=BF(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,i)=>i!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function uh(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(i).map(a,-1),d=e.slice(i).map(l),h=e.invert().map(u,-1),f=e.invert().map(d);r.push({oldRange:{from:h,to:f},newRange:{from:u,to:d}})})}),zF(r)}function rx(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=ex(n.resolve(t),s.type);i&&r.push({mark:s,...i})}):n.nodesBetween(t,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}const FF=(t,e,n,r=20)=>{const s=t.doc.resolve(n);let i=r,o=null;for(;i>0&&o===null;){const a=s.node(i);(a==null?void 0:a.type.name)===e?o=a:i-=1}return[o,i]},VF=t=>{const e=t.depth-1;if(e<0)return null;const n=t.index(e);return n===0?null:t.node(e).child(n-1)};function li(t,e){return e.nodes[t]||e.marks[t]||null}function qc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=t.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}const $F=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,a)=>{var l,u;const d=((l=(u=s.type.spec).toText)===null||l===void 0?void 0:l.call(u,{node:s,pos:i,parent:o,index:a}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?d:d.slice(0,Math.max(0,r-i))}),n};function qm(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?dr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>Wu(d.attrs,n,{strict:!1}));let o=0;const a=[];if(s.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;t.doc.nodesBetween(f,p,(m,g)=>{if(i&&m.inlineContent&&!m.type.allowsMarkType(i))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(f,g),b=Math.min(p,g+m.nodeSize),x=b-y;o+=x,a.push(...m.marks.map(k=>({mark:k,from:y,to:b})))})}),o===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>Wu(d.mark.attrs,n,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),u=a.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+u:l)>=o}function HF(t,e,n={}){if(!e)return lr(t,null,n)||qm(t,null,n);const r=lh(e,t.schema);return r==="node"?lr(t,e,n):r==="mark"?qm(t,e,n):!1}const WF=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=ch(a=>a.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function qk(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Pf(t,e){const{nodeExtensions:n}=io(e),r=n.find(i=>i.name===t);if(!r)return!1;const s=ue(q(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof s!="string"?!1:s.split(" ").includes("list")}function Tl(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 s=!0;return t.content.forEach(i=>{s!==!1&&(Tl(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function dT(t){return t instanceof J}var hT=class fT{constructor(e){this.position=e}static fromJSON(e){return new fT(e.position)}toJSON(){return{position:this.position}}};function KF(t,e){const n=e.mapping.mapResult(t.position);return{position:new hT(n.pos),mapResult:n}}function GF(t){return new hT(t)}function qF(t,e,n){const{selection:r}=e;let s=null;if(YE(r)&&(s=r.$cursor),s){var i;const a=(i=t.storedMarks)!==null&&i!==void 0?i:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(l=>l.type.excludes(n)))}const{ranges:o}=r;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,h,f)=>{if(u)return!1;if(d.isInline){const p=!f||f.type.allowsMarkType(n),m=!!n.isInSet(d.marks)||!d.marks.some(g=>g.type.excludes(n));u=p&&m}return!u}),u})}const JF=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:a}=i,l=dr(t,r.schema);if(s)if(o){const u=rT(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(f,p)=>{const m=Math.max(p,d),g=Math.min(p+f.nodeSize,h);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&n.addMark(m,g,l.create({...y.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return qF(r,n,l)},YF=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),XF=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=Ue(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:a})=>ck(i,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>ck(i,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ZF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=Ms(t,0,r.content.size),i=J.create(r,s);e.setSelection(i)}return!0},QF=(t,e)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=i.from,a=i.to),s&&n.doc.nodesBetween(o,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},eV=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Y.atStart(r).from,a=Y.atEnd(r).to,l=Ms(s,o,a),u=Ms(i,o,a),d=Y.create(r,l,u);e.setSelection(d)}return!0},tV=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return GB(r)(e,n)};function Jk(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(r)}}const nV=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:a,$to:l}=i,u=s.extensionManager.attributes,d=qc(u,a.node().type.name,a.node().attrs);if(i instanceof J&&i.node.isBlock)return!a.parentOffset||!nr(o,a.pos)?!1:(r&&(t&&Jk(n,s.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:tT(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=h&&f?[{type:f,attrs:d}]:void 0,m=nr(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&nr(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:d}]:void 0),r){if(m&&(i instanceof Y&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),f&&!h&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&Jk(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return m},rV=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{const o=Ue(t,r.schema),{$from:a,$to:l}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const d=a.node(-1);if(d.type!==o)return!1;const h=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==o||a.index(-2)!==a.node(-2).childCount-1)return!1;if(s){var f;let b=O.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let N=a.depth-x;N>=a.depth-3;N-=1)b=O.from(a.node(N).copy(b));const k=a.indexAfter(-1){if(S>-1)return!1;N.isTextblock&&N.content.size===0&&(S=M+1)}),S>-1&&n.setSelection(Y.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const p=l.pos===a.end()?d.contentMatchAt(0).defaultType:null,m={...qc(h,d.type.name,d.attrs),...e},g={...qc(h,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,l.pos);const y=p?[{type:o,attrs:m},{type:p,attrs:g}]:[{type:o,attrs:m}];if(!nr(n.doc,a.pos,2))return!1;if(s){const{selection:b,storedMarks:x}=r,{splittableMarks:k}=i.extensionManager,w=x||b.$to.parentOffset&&b.$from.marks();if(n.split(a.pos,2,y).scrollIntoView(),!w||!s)return!0;const C=w.filter(E=>k.includes(E.type.name));n.ensureMarks(C)}return!0};function Yk(t){return!t||t==="1"?null:t}function pT(t,e){return Yk(t)===Yk(e)}const Af=(t,e)=>{const n=ch(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return!(n.node.type===(s==null?void 0:s.type)&&is(t.doc,n.pos))||!pT(n.node.attrs.type,s==null?void 0:s.attrs.type)||t.join(n.pos),!0},Df=(t,e)=>{const n=ch(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return!(n.node.type===(s==null?void 0:s.type)&&is(t.doc,r))||!pT(n.node.attrs.type,s==null?void 0:s.attrs.type)||t.join(r),!0};function sV(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),s=e.resolve(n.nodeSize-1);return Y.between(r,s)}const iV=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:a,chain:l,commands:u,can:d})=>{const{extensions:h,splittableMarks:f}=s.extensionManager,p=Ue(t,o.schema),m=Ue(e,o.schema),{selection:g,storedMarks:y}=o,{$from:b,$to:x}=g,k=b.blockRange(x),w=y||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const C=ch($=>Pf($.type.name,h))(g),E=g.from===0&&g.to===o.doc.content.size,S=o.doc.content.content,N=S.length===1?S[0]:null,M=E&&N&&Pf(N.type.name,h)?{node:N,pos:0}:null,j=C??M,T=!!C&&k.depth>=1&&k.depth-C.depth<=1,R=!!M;if((T||R)&&j){if(j.node.type===p)return E&&R?l().command(({tr:$,dispatch:L})=>{const W=sV($);return W?($.setSelection(W),L&&L($),!0):!1}).liftListItem(m).run():u.liftListItem(m);if(Pf(j.node.type.name,h)&&p.validContent(j.node.content))return l().command(()=>(i.setNodeMarkup(j.pos,p),!0)).command(()=>Af(i,p)).command(()=>Df(i,p)).run()}return!n||!w||!a?l().command(()=>d().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>Af(i,p)).command(()=>Df(i,p)).run():l().command(()=>{const $=d().wrapInList(p,r),L=w.filter(W=>f.includes(W.type.name));return i.ensureMarks(L),$?!0:u.clearNodes()}).wrapInList(p,r).command(()=>Af(i,p)).command(()=>Df(i,p)).run()},oV=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=dr(t,r.schema);return qm(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},aV=(t,e,n={})=>({state:r,commands:s})=>{const i=Ue(t,r.schema),o=Ue(e,r.schema),a=lr(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?s.setNode(o,l):s.setNode(i,{...l,...n})},lV=(t,e={})=>({state:n,commands:r})=>{const s=Ue(t,n.schema);return lr(n,s,e)?r.lift(s):r.wrapIn(s,e)},cV=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else o.delete(i.from,i.to)}return!0}}return!1},uV=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{ignoreClearable:s=!1}=t,{selection:i}=e,{empty:o,ranges:a}=i;if(o)return!0;const{nonClearableMarks:l}=r.extensionManager;if(n){const u=Object.values(r.schema.marks).filter(d=>s||!l.includes(d.name));a.forEach(d=>{for(const h of u)e.removeMark(d.$from.pos,d.$to.pos,h)})}return!0},dV=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{extendEmptyMarkRange:i=!1}=e,{selection:o}=n,a=dr(t,r.schema),{$from:l,empty:u,ranges:d}=o;if(!s)return!0;if(u&&i){var h;let{from:f,to:p}=o;const m=ex(l,a,(h=l.marks().find(g=>g.type===a))===null||h===void 0?void 0:h.attrs);m&&(f=m.from,p=m.to),n.removeMark(f,p,a)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},hV=t=>({tr:e,state:n,dispatch:r})=>{const{selection:s}=n;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(a,l)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},fV=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=lh(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=Ue(t,r.schema)),a==="mark"&&(o=dr(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;let f,p,m,g;n.selection.empty?r.doc.nodesBetween(d,h,(y,b)=>{i&&i===y.type&&(l=!0,m=Math.max(b,d),g=Math.min(b+y.nodeSize,h),f=b,p=y)}):r.doc.nodesBetween(d,h,(y,b)=>{b=d&&b<=h&&(i&&i===y.type&&(l=!0,s&&n.setNodeMarkup(b,void 0,{...y.attrs,...e})),o&&y.marks.length&&y.marks.forEach(x=>{if(o===x.type&&(l=!0,s)){const k=Math.max(b,d),w=Math.min(b+y.nodeSize,h);n.addMark(k,w,o.create({...x.attrs,...e}))}}))}),p&&(f!==void 0&&s&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(y=>{o===y.type&&s&&n.addMark(m,g,o.create({...y.attrs,...e}))}))}),l},fi=new Fe("__tiptap_decorations__"),pV=t=>({tr:e,dispatch:n})=>(n&&e.setMeta(fi,{type:"force",name:t}),!0),mV=(t,e={})=>({state:n,dispatch:r})=>{const s=Ue(t,n.schema);return FB(s,e)(n,r)},gV=(t,e={})=>({state:n,dispatch:r})=>{const s=Ue(t,n.schema);return VB(s,e)(n,r)};var xV=D5({blur:()=>Bz,clearContent:()=>zz,clearNodes:()=>Fz,command:()=>Vz,createParagraphNear:()=>$z,cut:()=>Hz,deleteCurrentNode:()=>Wz,deleteNode:()=>Uz,deleteRange:()=>Kz,deleteSelection:()=>Jz,enter:()=>Yz,exitCode:()=>Xz,extendMarkRange:()=>Zz,first:()=>Qz,focus:()=>tF,forEach:()=>nF,insertContent:()=>rF,insertContentAt:()=>sF,insertDefaultBlock:()=>iF,joinBackward:()=>lF,joinDown:()=>aF,joinForward:()=>cF,joinItemBackward:()=>uF,joinItemForward:()=>dF,joinTextblockBackward:()=>hF,joinTextblockForward:()=>fF,joinUp:()=>oF,keyboardShortcut:()=>mF,lift:()=>gF,liftEmptyBlock:()=>xF,liftListItem:()=>yF,newlineInCode:()=>bF,resetAttributes:()=>vF,scrollIntoView:()=>kF,selectAll:()=>wF,selectNodeBackward:()=>SF,selectNodeForward:()=>NF,selectParentNode:()=>CF,selectTextblockEnd:()=>jF,selectTextblockStart:()=>EF,setContent:()=>TF,setMark:()=>JF,setMeta:()=>YF,setNode:()=>XF,setNodeSelection:()=>ZF,setTextDirection:()=>QF,setTextSelection:()=>eV,sinkListItem:()=>tV,splitBlock:()=>nV,splitListItem:()=>rV,toggleList:()=>iV,toggleMark:()=>oV,toggleNode:()=>aV,toggleWrap:()=>lV,undoInputRule:()=>cV,unsetAllMarks:()=>uV,unsetMark:()=>dV,unsetTextDirection:()=>hV,updateAttributes:()=>fV,updateDecorations:()=>pV,wrapIn:()=>mV,wrapInList:()=>gV});const Io=new WeakMap;function yV(t,e){var n;Io.set(t,((n=Io.get(t))!==null&&n!==void 0?n:0)+1);try{return e()}finally{var r;const s=((r=Io.get(t))!==null&&r!==void 0?r:1)-1;s>0?Io.set(t,s):Io.delete(t)}}var bV=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function vV(t){return t.kind==="widget"}function mT(t,e){const n=[],r=new Set;for(const s of t)s.kind==="widget"&&vV(s)&&r.add(s.key),n.push(s.toPMDecoration(e));return{decorations:n,widgetKeys:r}}function kV(t,e,n){const{decorations:r,widgetKeys:s}=mT(e,n);return{set:ce.create(t,r),widgetKeys:s}}function gT({position:t,from:e,to:n,docSize:r}){return tgT({position:o.anchor,from:e,to:n,docSize:r})?!0:(o.anchor===n||i.has(s)||(i.add(s),console.warn(`[tiptap warn]: Extension "${s}" returned a decoration outside the requested range [${e}, ${n}). It was ignored.`)),!1))}function SV(t){var e;const n=(e=t.spec)===null||e===void 0?void 0:e.key;return typeof n=="string"?n:void 0}function xT(t){return t.jsonID==="attr"}function NV(t){let e=!1;if(t.getMap().forEach(()=>{e=!0}),e||xT(t))return!0;const n=t;return typeof n.from=="number"&&typeof n.to=="number"}function CV(t,e){let n=null,r=0,s=0;for(let i=0;ie.to);i+=1){const o=s+t.child(i).nodeSize;o>=e.from&&(n===null&&(n=s),r=o),s=o}return n===null?null:{from:n,to:r}}function jV(t,e){if(t.steps.some(i=>!NV(i)))return{type:"full"};const n=uh(t).map(({newRange:i})=>i);t.steps.forEach((i,o)=>{if(!xT(i))return;const a=t.mapping.slice(o);n.push({from:a.map(i.pos,-1),to:a.map(i.pos+1)})});const r=[];for(const i of n){const o=CV(e,i);o&&r.push(o)}r.sort((i,o)=>i.from-o.from);const s=[];for(const i of r){const o=s[s.length-1];o&&i.from<=o.to?o.to=Math.max(o.to,i.to):s.push({...i})}return{type:"ranges",ranges:s}}function yT(t,e,n,r){return t.map(e,n,{onRemove:s=>{const i=s==null?void 0:s.key;typeof i=="string"&&r.delete(i)}})}function EV(t,e,n){var r,s;const i=(r=e.decorationSetsByExtension[t])!==null&&r!==void 0?r:ce.empty,o=new Set((s=e.widgetKeysByExtension[t])!==null&&s!==void 0?s:[]);return{set:yT(i,n.mapping,n.doc,o),widgetKeys:o}}function Xk(t,e){const n=Object.values(e).flatMap(r=>r.find());return ce.create(t,n)}function Zk(t){const e=new Set;for(const n of Object.values(t))for(const r of n)e.add(r);return e}function TV(t,e){var n;switch((n=e.update)!==null&&n!==void 0?n:"document"){case"document":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension "${t}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${t}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function MV(t,e,n){return n?!0:t.update==="manual"?!1:t.shouldUpdate?t.shouldUpdate(e):e.tr.docChanged}const PV=new Set;var AV=class{constructor(t){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{const n=fi.getState(e);n&&this.warnDuplicateWidgetKeys(n)},this.editor=t.editor,this.entries=this.resolveEntries(t.entries),this.entries.forEach(({name:e,spec:n})=>TV(e,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var t,e;return(t=(e=fi.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&t!==void 0?t:PV}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(t){const e=[];for(const{name:n,addDecorations:r}of t){const s=r();s&&e.push({name:n,spec:s})}return e}createPlugin(){const{editor:t,entries:e}=this;return new ve({key:fi,state:{init:(n,r)=>{const s={},i={};for(const{name:a,spec:l}of e){const{set:u,widgetKeys:d}=this.buildFullSet(a,l,r);s[a]=u,i[a]=d}const o={decorationSetsByExtension:s,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(r.doc,s),widgetKeys:Zk(i)};return this.warnDuplicateWidgetKeys(o),o},apply:(n,r,s,i)=>{const o=n.getMeta(fi),a=(o==null?void 0:o.type)==="force"&&!o.name,l=(o==null?void 0:o.type)==="force"?o.name:void 0,u={},d={},h=new Set;return yV(t,()=>{for(const{name:f,spec:p}of e){const m=a||l===f;if(MV(p,{editor:t,tr:n,oldState:s,newState:i},m))if(p.update==="changedRanges"&&n.docChanged&&!m){const g=this.applyChangedRangesRecompute(f,p,r,n,i);u[f]=g.set,d[f]=g.widgetKeys,h.add(f)}else{const{set:g,widgetKeys:y}=this.buildFullSet(f,p,i);u[f]=g,d[f]=y,h.add(f)}else{const g=EV(f,r,n);u[f]=g.set,d[f]=g.widgetKeys}}}),h.size===0&&!n.docChanged?r:{decorationSetsByExtension:u,widgetKeysByExtension:d,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:r,tr:n,decorationSetsByExtension:u,recomputedNames:h}),widgetKeys:Zk(d)}}},props:{decorations(n){var r,s;return(r=(s=fi.getState(n))===null||s===void 0?void 0:s.mergedDecorationSet)!==null&&r!==void 0?r:ce.empty}}})}applyChangedRangesRecompute(t,e,n,r,s){const i=jV(r,s.doc);return i.type==="full"?this.buildFullSet(t,e,s):this.rebuildRanges(t,e,n,r,s,i.ranges)}rebuildRanges(t,e,n,r,s,i){var o,a;const l=(o=n.decorationSetsByExtension[t])!==null&&o!==void 0?o:ce.empty,u=new Set((a=n.widgetKeysByExtension[t])!==null&&a!==void 0?a:[]);let d=yT(l,r.mapping,r.doc,u);const h=s.doc.content.size;for(const{from:f,to:p}of i){const m=d.find(f,p).filter(b=>gT({position:b.from,from:f,to:p,docSize:h}));for(const b of m){const x=SV(b);x&&u.delete(x)}d=d.remove(m);const{decorations:g,widgetKeys:y}=mT(wV({decorations:this.runCreate(t,"createInRange",()=>e.createInRange({editor:this.editor,state:s,view:this.mountedView,from:f,to:p})),from:f,to:p,docSize:h,extensionName:t,warnedExtensions:this.warnedOutOfRangeExtensions}),t);d=d.add(s.doc,g);for(const b of y)u.add(b)}return{set:d,widgetKeys:u}}buildFullSet(t,e,n){const r=this.runCreate(t,"create",()=>e.create({editor:this.editor,state:n,view:this.mountedView}));return kV(n.doc,r,t)}runCreate(t,e,n){try{return n()}catch(r){return console.error(`[tiptap error]: Extension "${t}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(t){}buildMergedSet(t,e){const n=Object.keys(e);return n.length===1?e[n[0]]:Xk(t,e)}mergeAfterApply({entries:t,previous:e,tr:n,decorationSetsByExtension:r,recomputedNames:s}){return t.length===1?r[t[0].name]:s.size===0?e.mergedDecorationSet.map(n.mapping,n.doc):Xk(n.doc,r)}};function DV(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof J){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}function LV(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}function Ml(t,e){const n=t.getAttribute("style");if(!n)return null;const r=n.split(";").map(i=>i.trim()).filter(Boolean),s=e.toLowerCase();for(let i=r.length-1;i>=0;i-=1){const o=r[i],a=o.indexOf(":");if(a!==-1&&o.slice(0,a).trim().toLowerCase()===s)return o.slice(a+1).trim()}return null}function RV(t){return typeof t=="number"}function _V(t){return Object.prototype.toString.call(t).slice(8,-1)}function dc(t){return _V(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Qk(t,e,n){const r=t.split(` +`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,s,(l,u,d,h)=>{l.isBlock&&u>r&&(a+=i);const f=o==null?void 0:o[l.type.name];if(f)return d&&(a+=f({node:l,pos:u,parent:d,index:h,range:e})),!1;if(l.isText){var p;a+=l==null||(p=l.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,s-u)}}),a}function OF(t,e){return cT(t,{from:0,to:t.content.size},e)}function uT(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function BF(t,e){const n=Ue(e,t.schema),{from:r,to:s}=t.selection,i=[];t.doc.nodesBetween(r,s,a=>{i.push(a)});const o=i.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function dT(t,e){const n=lh(typeof e=="string"?e:e.name,t.schema);return n==="node"?BF(t,e):n==="mark"?sT(t,e):{}}function zF(t,e=JSON.stringify){const n={};return t.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function FF(t){const e=zF(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,i)=>i!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function uh(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(i).map(a,-1),d=e.slice(i).map(l),h=e.invert().map(u,-1),f=e.invert().map(d);r.push({oldRange:{from:h,to:f},newRange:{from:u,to:d}})})}),FF(r)}function rx(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(s=>{const i=ex(n.resolve(t),s.type);i&&r.push({mark:s,...i})}):n.nodesBetween(t,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}const VF=(t,e,n,r=20)=>{const s=t.doc.resolve(n);let i=r,o=null;for(;i>0&&o===null;){const a=s.node(i);(a==null?void 0:a.type.name)===e?o=a:i-=1}return[o,i]},$F=t=>{const e=t.depth-1;if(e<0)return null;const n=t.index(e);return n===0?null:t.node(e).child(n-1)};function li(t,e){return e.nodes[t]||e.marks[t]||null}function qc(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=t.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}const HF=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,a)=>{var l,u;const d=((l=(u=s.type.spec).toText)===null||l===void 0?void 0:l.call(u,{node:s,pos:i,parent:o,index:a}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?d:d.slice(0,Math.max(0,r-i))}),n};function qm(t,e,n={}){const{empty:r,ranges:s}=t.selection,i=e?dr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>Wu(d.attrs,n,{strict:!1}));let o=0;const a=[];if(s.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;t.doc.nodesBetween(f,p,(m,g)=>{if(i&&m.inlineContent&&!m.type.allowsMarkType(i))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(f,g),b=Math.min(p,g+m.nodeSize),x=b-y;o+=x,a.push(...m.marks.map(k=>({mark:k,from:y,to:b})))})}),o===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>Wu(d.mark.attrs,n,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),u=a.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+u:l)>=o}function WF(t,e,n={}){if(!e)return lr(t,null,n)||qm(t,null,n);const r=lh(e,t.schema);return r==="node"?lr(t,e,n):r==="mark"?qm(t,e,n):!1}const UF=(t,e)=>{const{$from:n,$to:r,$anchor:s}=t.selection;if(e){const i=ch(a=>a.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function Jk(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Pf(t,e){const{nodeExtensions:n}=io(e),r=n.find(i=>i.name===t);if(!r)return!1;const s=ue(q(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof s!="string"?!1:s.split(" ").includes("list")}function Tl(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 s=!0;return t.content.forEach(i=>{s!==!1&&(Tl(i,{ignoreWhitespace:n,checkChildren:e})||(s=!1))}),s}return!1}function hT(t){return t instanceof J}var fT=class pT{constructor(e){this.position=e}static fromJSON(e){return new pT(e.position)}toJSON(){return{position:this.position}}};function GF(t,e){const n=e.mapping.mapResult(t.position);return{position:new fT(n.pos),mapResult:n}}function qF(t){return new fT(t)}function JF(t,e,n){const{selection:r}=e;let s=null;if(XE(r)&&(s=r.$cursor),s){var i;const a=(i=t.storedMarks)!==null&&i!==void 0?i:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(l=>l.type.excludes(n)))}const{ranges:o}=r;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(d,h,f)=>{if(u)return!1;if(d.isInline){const p=!f||f.type.allowsMarkType(n),m=!!n.isInSet(d.marks)||!d.marks.some(g=>g.type.excludes(n));u=p&&m}return!u}),u})}const YF=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=n,{empty:o,ranges:a}=i,l=dr(t,r.schema);if(s)if(o){const u=sT(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(d,h,(f,p)=>{const m=Math.max(p,d),g=Math.min(p+f.nodeSize,h);f.marks.find(y=>y.type===l)?f.marks.forEach(y=>{l===y.type&&n.addMark(m,g,l.create({...y.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return JF(r,n,l)},XF=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),ZF=(t,e={})=>({state:n,dispatch:r,chain:s})=>{const i=Ue(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:a})=>uk(i,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>uk(i,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},QF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,s=Ms(t,0,r.content.size),i=J.create(r,s);e.setSelection(i)}return!0},eV=(t,e)=>({tr:n,state:r,dispatch:s})=>{const{selection:i}=r;let o,a;return typeof e=="number"?(o=e,a=e):e&&"from"in e&&"to"in e?(o=e.from,a=e.to):(o=i.from,a=i.to),s&&n.doc.nodesBetween(o,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:t})}),!0},tV=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:s,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Y.atStart(r).from,a=Y.atEnd(r).to,l=Ms(s,o,a),u=Ms(i,o,a),d=Y.create(r,l,u);e.setSelection(d)}return!0},nV=t=>({state:e,dispatch:n})=>{const r=Ue(t,e.schema);return qB(r)(e,n)};function Yk(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(s=>e==null?void 0:e.includes(s.type.name));t.tr.ensureMarks(r)}}const rV=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:a,$to:l}=i,u=s.extensionManager.attributes,d=qc(u,a.node().type.name,a.node().attrs);if(i instanceof J&&i.node.isBlock)return!a.parentOffset||!nr(o,a.pos)?!1:(r&&(t&&Yk(n,s.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:nT(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=h&&f?[{type:f,attrs:d}]:void 0,m=nr(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&nr(e.doc,e.mapping.map(a.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:d}]:void 0),r){if(m&&(i instanceof Y&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,p),f&&!h&&!a.parentOffset&&a.parent.type!==f)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&e.setNodeMarkup(e.mapping.map(a.before()),f)}t&&Yk(n,s.extensionManager.splittableMarks),e.scrollIntoView()}return m},sV=(t,e={})=>({tr:n,state:r,dispatch:s,editor:i})=>{const o=Ue(t,r.schema),{$from:a,$to:l}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const d=a.node(-1);if(d.type!==o)return!1;const h=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==o||a.index(-2)!==a.node(-2).childCount-1)return!1;if(s){var f;let b=O.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let N=a.depth-x;N>=a.depth-3;N-=1)b=O.from(a.node(N).copy(b));const k=a.indexAfter(-1){if(S>-1)return!1;N.isTextblock&&N.content.size===0&&(S=M+1)}),S>-1&&n.setSelection(Y.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const p=l.pos===a.end()?d.contentMatchAt(0).defaultType:null,m={...qc(h,d.type.name,d.attrs),...e},g={...qc(h,a.node().type.name,a.node().attrs),...e};n.delete(a.pos,l.pos);const y=p?[{type:o,attrs:m},{type:p,attrs:g}]:[{type:o,attrs:m}];if(!nr(n.doc,a.pos,2))return!1;if(s){const{selection:b,storedMarks:x}=r,{splittableMarks:k}=i.extensionManager,w=x||b.$to.parentOffset&&b.$from.marks();if(n.split(a.pos,2,y).scrollIntoView(),!w||!s)return!0;const C=w.filter(E=>k.includes(E.type.name));n.ensureMarks(C)}return!0};function Xk(t){return!t||t==="1"?null:t}function mT(t,e){return Xk(t)===Xk(e)}const Af=(t,e)=>{const n=ch(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return!(n.node.type===(s==null?void 0:s.type)&&is(t.doc,n.pos))||!mT(n.node.attrs.type,s==null?void 0:s.attrs.type)||t.join(n.pos),!0},Df=(t,e)=>{const n=ch(i=>i.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=t.doc.nodeAt(r);return!(n.node.type===(s==null?void 0:s.type)&&is(t.doc,r))||!mT(n.node.attrs.type,s==null?void 0:s.attrs.type)||t.join(r),!0};function iV(t){const e=t.doc,n=e.firstChild;if(!n)return null;const r=e.resolve(1),s=e.resolve(n.nodeSize-1);return Y.between(r,s)}const oV=(t,e,n,r={})=>({editor:s,tr:i,state:o,dispatch:a,chain:l,commands:u,can:d})=>{const{extensions:h,splittableMarks:f}=s.extensionManager,p=Ue(t,o.schema),m=Ue(e,o.schema),{selection:g,storedMarks:y}=o,{$from:b,$to:x}=g,k=b.blockRange(x),w=y||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const C=ch($=>Pf($.type.name,h))(g),E=g.from===0&&g.to===o.doc.content.size,S=o.doc.content.content,N=S.length===1?S[0]:null,M=E&&N&&Pf(N.type.name,h)?{node:N,pos:0}:null,j=C??M,T=!!C&&k.depth>=1&&k.depth-C.depth<=1,R=!!M;if((T||R)&&j){if(j.node.type===p)return E&&R?l().command(({tr:$,dispatch:L})=>{const W=iV($);return W?($.setSelection(W),L&&L($),!0):!1}).liftListItem(m).run():u.liftListItem(m);if(Pf(j.node.type.name,h)&&p.validContent(j.node.content))return l().command(()=>(i.setNodeMarkup(j.pos,p),!0)).command(()=>Af(i,p)).command(()=>Df(i,p)).run()}return!n||!w||!a?l().command(()=>d().wrapInList(p,r)?!0:u.clearNodes()).wrapInList(p,r).command(()=>Af(i,p)).command(()=>Df(i,p)).run():l().command(()=>{const $=d().wrapInList(p,r),L=w.filter(W=>f.includes(W.type.name));return i.ensureMarks(L),$?!0:u.clearNodes()}).wrapInList(p,r).command(()=>Af(i,p)).command(()=>Df(i,p)).run()},aV=(t,e={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=n,o=dr(t,r.schema);return qm(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},lV=(t,e,n={})=>({state:r,commands:s})=>{const i=Ue(t,r.schema),o=Ue(e,r.schema),a=lr(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?s.setNode(o,l):s.setNode(i,{...l,...n})},cV=(t,e={})=>({state:n,commands:r})=>{const s=Ue(t,n.schema);return lr(n,s,e)?r.lift(s):r.wrapIn(s,e)},uV=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else o.delete(i.from,i.to)}return!0}}return!1},dV=(t={})=>({tr:e,dispatch:n,editor:r})=>{const{ignoreClearable:s=!1}=t,{selection:i}=e,{empty:o,ranges:a}=i;if(o)return!0;const{nonClearableMarks:l}=r.extensionManager;if(n){const u=Object.values(r.schema.marks).filter(d=>s||!l.includes(d.name));a.forEach(d=>{for(const h of u)e.removeMark(d.$from.pos,d.$to.pos,h)})}return!0},hV=(t,e={})=>({tr:n,state:r,dispatch:s})=>{const{extendEmptyMarkRange:i=!1}=e,{selection:o}=n,a=dr(t,r.schema),{$from:l,empty:u,ranges:d}=o;if(!s)return!0;if(u&&i){var h;let{from:f,to:p}=o;const m=ex(l,a,(h=l.marks().find(g=>g.type===a))===null||h===void 0?void 0:h.attrs);m&&(f=m.from,p=m.to),n.removeMark(f,p,a)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},fV=t=>({tr:e,state:n,dispatch:r})=>{const{selection:s}=n;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(a,l)=>{if(a.isText)return;const u={...a.attrs};delete u.dir,e.setNodeMarkup(l,void 0,u)}),!0},pV=(t,e={})=>({tr:n,state:r,dispatch:s})=>{let i=null,o=null;const a=lh(typeof t=="string"?t:t.name,r.schema);if(!a)return!1;a==="node"&&(i=Ue(t,r.schema)),a==="mark"&&(o=dr(t,r.schema));let l=!1;return n.selection.ranges.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;let f,p,m,g;n.selection.empty?r.doc.nodesBetween(d,h,(y,b)=>{i&&i===y.type&&(l=!0,m=Math.max(b,d),g=Math.min(b+y.nodeSize,h),f=b,p=y)}):r.doc.nodesBetween(d,h,(y,b)=>{b=d&&b<=h&&(i&&i===y.type&&(l=!0,s&&n.setNodeMarkup(b,void 0,{...y.attrs,...e})),o&&y.marks.length&&y.marks.forEach(x=>{if(o===x.type&&(l=!0,s)){const k=Math.max(b,d),w=Math.min(b+y.nodeSize,h);n.addMark(k,w,o.create({...x.attrs,...e}))}}))}),p&&(f!==void 0&&s&&n.setNodeMarkup(f,void 0,{...p.attrs,...e}),o&&p.marks.length&&p.marks.forEach(y=>{o===y.type&&s&&n.addMark(m,g,o.create({...y.attrs,...e}))}))}),l},fi=new Fe("__tiptap_decorations__"),mV=t=>({tr:e,dispatch:n})=>(n&&e.setMeta(fi,{type:"force",name:t}),!0),gV=(t,e={})=>({state:n,dispatch:r})=>{const s=Ue(t,n.schema);return VB(s,e)(n,r)},xV=(t,e={})=>({state:n,dispatch:r})=>{const s=Ue(t,n.schema);return $B(s,e)(n,r)};var yV=L5({blur:()=>zz,clearContent:()=>Fz,clearNodes:()=>Vz,command:()=>$z,createParagraphNear:()=>Hz,cut:()=>Wz,deleteCurrentNode:()=>Uz,deleteNode:()=>Kz,deleteRange:()=>Gz,deleteSelection:()=>Yz,enter:()=>Xz,exitCode:()=>Zz,extendMarkRange:()=>Qz,first:()=>eF,focus:()=>nF,forEach:()=>rF,insertContent:()=>sF,insertContentAt:()=>iF,insertDefaultBlock:()=>oF,joinBackward:()=>cF,joinDown:()=>lF,joinForward:()=>uF,joinItemBackward:()=>dF,joinItemForward:()=>hF,joinTextblockBackward:()=>fF,joinTextblockForward:()=>pF,joinUp:()=>aF,keyboardShortcut:()=>gF,lift:()=>xF,liftEmptyBlock:()=>yF,liftListItem:()=>bF,newlineInCode:()=>vF,resetAttributes:()=>kF,scrollIntoView:()=>wF,selectAll:()=>SF,selectNodeBackward:()=>NF,selectNodeForward:()=>CF,selectParentNode:()=>jF,selectTextblockEnd:()=>EF,selectTextblockStart:()=>TF,setContent:()=>MF,setMark:()=>YF,setMeta:()=>XF,setNode:()=>ZF,setNodeSelection:()=>QF,setTextDirection:()=>eV,setTextSelection:()=>tV,sinkListItem:()=>nV,splitBlock:()=>rV,splitListItem:()=>sV,toggleList:()=>oV,toggleMark:()=>aV,toggleNode:()=>lV,toggleWrap:()=>cV,undoInputRule:()=>uV,unsetAllMarks:()=>dV,unsetMark:()=>hV,unsetTextDirection:()=>fV,updateAttributes:()=>pV,updateDecorations:()=>mV,wrapIn:()=>gV,wrapInList:()=>xV});const Io=new WeakMap;function bV(t,e){var n;Io.set(t,((n=Io.get(t))!==null&&n!==void 0?n:0)+1);try{return e()}finally{var r;const s=((r=Io.get(t))!==null&&r!==void 0?r:1)-1;s>0?Io.set(t,s):Io.delete(t)}}var vV=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(r=>r.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(r=>r!==e):delete this.callbacks[t]),this}once(t,e){const n=(...r)=>{this.off(t,n),e.apply(this,r)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}};function kV(t){return t.kind==="widget"}function gT(t,e){const n=[],r=new Set;for(const s of t)s.kind==="widget"&&kV(s)&&r.add(s.key),n.push(s.toPMDecoration(e));return{decorations:n,widgetKeys:r}}function wV(t,e,n){const{decorations:r,widgetKeys:s}=gT(e,n);return{set:ce.create(t,r),widgetKeys:s}}function xT({position:t,from:e,to:n,docSize:r}){return txT({position:o.anchor,from:e,to:n,docSize:r})?!0:(o.anchor===n||i.has(s)||(i.add(s),console.warn(`[tiptap warn]: Extension "${s}" returned a decoration outside the requested range [${e}, ${n}). It was ignored.`)),!1))}function NV(t){var e;const n=(e=t.spec)===null||e===void 0?void 0:e.key;return typeof n=="string"?n:void 0}function yT(t){return t.jsonID==="attr"}function CV(t){let e=!1;if(t.getMap().forEach(()=>{e=!0}),e||yT(t))return!0;const n=t;return typeof n.from=="number"&&typeof n.to=="number"}function jV(t,e){let n=null,r=0,s=0;for(let i=0;ie.to);i+=1){const o=s+t.child(i).nodeSize;o>=e.from&&(n===null&&(n=s),r=o),s=o}return n===null?null:{from:n,to:r}}function EV(t,e){if(t.steps.some(i=>!CV(i)))return{type:"full"};const n=uh(t).map(({newRange:i})=>i);t.steps.forEach((i,o)=>{if(!yT(i))return;const a=t.mapping.slice(o);n.push({from:a.map(i.pos,-1),to:a.map(i.pos+1)})});const r=[];for(const i of n){const o=jV(e,i);o&&r.push(o)}r.sort((i,o)=>i.from-o.from);const s=[];for(const i of r){const o=s[s.length-1];o&&i.from<=o.to?o.to=Math.max(o.to,i.to):s.push({...i})}return{type:"ranges",ranges:s}}function bT(t,e,n,r){return t.map(e,n,{onRemove:s=>{const i=s==null?void 0:s.key;typeof i=="string"&&r.delete(i)}})}function TV(t,e,n){var r,s;const i=(r=e.decorationSetsByExtension[t])!==null&&r!==void 0?r:ce.empty,o=new Set((s=e.widgetKeysByExtension[t])!==null&&s!==void 0?s:[]);return{set:bT(i,n.mapping,n.doc,o),widgetKeys:o}}function Zk(t,e){const n=Object.values(e).flatMap(r=>r.find());return ce.create(t,n)}function Qk(t){const e=new Set;for(const n of Object.values(t))for(const r of n)e.add(r);return e}function MV(t,e){var n;switch((n=e.update)!==null&&n!==void 0?n:"document"){case"document":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(e.createInRange)throw new Error(`[tiptap error]: Extension "${t}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(e.shouldUpdate)throw new Error(`[tiptap error]: Extension "${t}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${t}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function PV(t,e,n){return n?!0:t.update==="manual"?!1:t.shouldUpdate?t.shouldUpdate(e):e.tr.docChanged}const AV=new Set;var DV=class{constructor(t){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{const n=fi.getState(e);n&&this.warnDuplicateWidgetKeys(n)},this.editor=t.editor,this.entries=this.resolveEntries(t.entries),this.entries.forEach(({name:e,spec:n})=>MV(e,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var t,e;return(t=(e=fi.getState(this.editor.state))===null||e===void 0?void 0:e.widgetKeys)!==null&&t!==void 0?t:AV}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(t){const e=[];for(const{name:n,addDecorations:r}of t){const s=r();s&&e.push({name:n,spec:s})}return e}createPlugin(){const{editor:t,entries:e}=this;return new ke({key:fi,state:{init:(n,r)=>{const s={},i={};for(const{name:a,spec:l}of e){const{set:u,widgetKeys:d}=this.buildFullSet(a,l,r);s[a]=u,i[a]=d}const o={decorationSetsByExtension:s,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(r.doc,s),widgetKeys:Qk(i)};return this.warnDuplicateWidgetKeys(o),o},apply:(n,r,s,i)=>{const o=n.getMeta(fi),a=(o==null?void 0:o.type)==="force"&&!o.name,l=(o==null?void 0:o.type)==="force"?o.name:void 0,u={},d={},h=new Set;return bV(t,()=>{for(const{name:f,spec:p}of e){const m=a||l===f;if(PV(p,{editor:t,tr:n,oldState:s,newState:i},m))if(p.update==="changedRanges"&&n.docChanged&&!m){const g=this.applyChangedRangesRecompute(f,p,r,n,i);u[f]=g.set,d[f]=g.widgetKeys,h.add(f)}else{const{set:g,widgetKeys:y}=this.buildFullSet(f,p,i);u[f]=g,d[f]=y,h.add(f)}else{const g=TV(f,r,n);u[f]=g.set,d[f]=g.widgetKeys}}}),h.size===0&&!n.docChanged?r:{decorationSetsByExtension:u,widgetKeysByExtension:d,mergedDecorationSet:this.mergeAfterApply({entries:e,previous:r,tr:n,decorationSetsByExtension:u,recomputedNames:h}),widgetKeys:Qk(d)}}},props:{decorations(n){var r,s;return(r=(s=fi.getState(n))===null||s===void 0?void 0:s.mergedDecorationSet)!==null&&r!==void 0?r:ce.empty}}})}applyChangedRangesRecompute(t,e,n,r,s){const i=EV(r,s.doc);return i.type==="full"?this.buildFullSet(t,e,s):this.rebuildRanges(t,e,n,r,s,i.ranges)}rebuildRanges(t,e,n,r,s,i){var o,a;const l=(o=n.decorationSetsByExtension[t])!==null&&o!==void 0?o:ce.empty,u=new Set((a=n.widgetKeysByExtension[t])!==null&&a!==void 0?a:[]);let d=bT(l,r.mapping,r.doc,u);const h=s.doc.content.size;for(const{from:f,to:p}of i){const m=d.find(f,p).filter(b=>xT({position:b.from,from:f,to:p,docSize:h}));for(const b of m){const x=NV(b);x&&u.delete(x)}d=d.remove(m);const{decorations:g,widgetKeys:y}=gT(SV({decorations:this.runCreate(t,"createInRange",()=>e.createInRange({editor:this.editor,state:s,view:this.mountedView,from:f,to:p})),from:f,to:p,docSize:h,extensionName:t,warnedExtensions:this.warnedOutOfRangeExtensions}),t);d=d.add(s.doc,g);for(const b of y)u.add(b)}return{set:d,widgetKeys:u}}buildFullSet(t,e,n){const r=this.runCreate(t,"create",()=>e.create({editor:this.editor,state:n,view:this.mountedView}));return wV(n.doc,r,t)}runCreate(t,e,n){try{return n()}catch(r){return console.error(`[tiptap error]: Extension "${t}" threw in \`addDecorations().${e}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(t){}buildMergedSet(t,e){const n=Object.keys(e);return n.length===1?e[n[0]]:Zk(t,e)}mergeAfterApply({entries:t,previous:e,tr:n,decorationSetsByExtension:r,recomputedNames:s}){return t.length===1?r[t[0].name]:s.size===0?e.mergedDecorationSet.map(n.mapping,n.doc):Zk(n.doc,r)}};function LV(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof J){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}function RV(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(s),s}function Ml(t,e){const n=t.getAttribute("style");if(!n)return null;const r=n.split(";").map(i=>i.trim()).filter(Boolean),s=e.toLowerCase();for(let i=r.length-1;i>=0;i-=1){const o=r[i],a=o.indexOf(":");if(a!==-1&&o.slice(0,a).trim().toLowerCase()===s)return o.slice(a+1).trim()}return null}function _V(t){return typeof t=="number"}function IV(t){return Object.prototype.toString.call(t).slice(8,-1)}function dc(t){return IV(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ew(t,e,n){const r=t.split(` `),s=[];let i="",o=0;const a=e.baseIndentSize||2;for(;o0)break;if(d.trim()===""){o+=1,i=`${i}${d} `;continue}else return}const f=e.extractItemData(h),{indentLevel:p,mainContent:m}=f;i=`${i}${d} `;const g=[m];for(o+=1;oC.trim()!=="");if(w===-1)break;if((((u=r[o+1+w].match(/^(\s*)/))===null||u===void 0||(u=u[1])===null||u===void 0?void 0:u.length)||0)>p){g.push(k),i=`${i}${k} `,o+=1;continue}else break}if((((l=k.match(/^(\s*)/))===null||l===void 0||(l=l[1])===null||l===void 0?void 0:l.length)||0)>p)g.push(k),i=`${i}${k} `,o+=1;else break}let y;const b=g.slice(1);if(b.length>0){const k=b.map(w=>w.slice(p+a)).join(` -`);k.trim()&&(e.customNestedParser?y=e.customNestedParser(k):y=n.blockTokens(k))}const x=e.createToken(f,y);s.push(x)}if(s.length!==0)return{items:s,raw:i}}const ew=4;function tw(t){let e=0;for(const n of t)e=n===" "?e+ew-e%ew:e+1;return e}function bT(t,e,n,r,s){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[o,...a]=t.content;let l=`${i}${e.renderChildren([o])}`;return a&&a.length>0&&a.forEach((u,d)=>{var h,f;const p=(h=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,u,d+1))!==null&&h!==void 0?h:e.renderChildren([u]);if(p!=null){const m=y=>{if(!(s!=null&&s.alignNestedToPrefix))return e.indent(y);const b=e.indent(""),x=tw(i);return(tw(b)>=x?b:" ".repeat(x))+y},g=p.split(` +`);k.trim()&&(e.customNestedParser?y=e.customNestedParser(k):y=n.blockTokens(k))}const x=e.createToken(f,y);s.push(x)}if(s.length!==0)return{items:s,raw:i}}const tw=4;function nw(t){let e=0;for(const n of t)e=n===" "?e+tw-e%tw:e+1;return e}function vT(t,e,n,r,s){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(r):n,[o,...a]=t.content;let l=`${i}${e.renderChildren([o])}`;return a&&a.length>0&&a.forEach((u,d)=>{var h,f;const p=(h=(f=e.renderChild)===null||f===void 0?void 0:f.call(e,u,d+1))!==null&&h!==void 0?h:e.renderChildren([u]);if(p!=null){const m=y=>{if(!(s!=null&&s.alignNestedToPrefix))return e.indent(y);const b=e.indent(""),x=nw(i);return(nw(b)>=x?b:" ".repeat(x))+y},g=p.split(` `).map(y=>m(y||"")).join(` `);l+=u.type==="paragraph"?` ${g}`:` -${g}`}}),l}function vT(t,e){const n={...t};return dc(t)&&dc(e)&&Object.keys(e).forEach(r=>{dc(e[r])&&dc(t[r])?n[r]=vT(t[r],e[r]):n[r]=e[r]}),n}function IV(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((a,l)=>{const u=i.mapping.map(l),d=i.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(p=>{if(p!==o)return!1;h=p}),!h)return;let f=!1;if(Object.keys(n).forEach(p=>{n[p]!==h.attrs[p]&&(f=!0)}),f){const p=t.type.create({...t.attrs,...n});i.removeMark(u,d,t.type),i.addMark(u,d,p)}}),i.docChanged&&e.view.dispatch(i)}var Pl=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}};const OV=(t,e)=>{if(Q0(e))return e.exec(t);const n=e(t);if(!n)return null;const 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 hc(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1;const h=$F(u)+i;return o.forEach(f=>{if(d)return;const p=OV(h,f.find);if(!p)return;const m=p[0].length-i.length;if(m>0){const C=u.parentOffset-m;if(C<0||u.parent.textBetween(C,u.parentOffset)!==p[0].slice(0,m))return}const g=l.state.tr,y=ah({state:l.state,transaction:g}),b={from:r-(p[0].length-i.length),to:s},{commands:x,chain:k,can:w}=new zi({editor:n,state:y});f.handler({state:y,range:b,match:p,commands:x,chain:k,can:w})===null||!g.steps.length||(f.undoable&&g.setMeta(a,{transform:g,from:r,to:s,text:i}),l.dispatch(g),d=!0)}),d}function BV(t){const{editor:e,rules:n}=t,r=new ve({state:{init(){return null},apply(s,i,o){const a=s.getMeta(r);if(a)return a;const l=s.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=nx(O.from(u),o.schema);const{from:d}=l,h=d+u.length;hc({editor:e,from:d,to:h,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,a){return hc({editor:e,from:i,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&hc({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?hc({editor:e,from:o.pos,to:o.pos,text:` -`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var sx=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{...ue(q(this,"addOptions",{name:this.name}))}}get storage(){return{...ue(q(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>vT(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const 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}},ls=class kT extends sx{constructor(...e){super(...e),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new kT(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const i=s.marks();if(!i.find(a=>(a==null?void 0:a.type.name)===n.name))return!1;const o=i.find(a=>(a==null?void 0:a.type.name)===n.name);return o&&r.removeStoredMark(o),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},wT=class{constructor(t){this.find=t.find,this.handler=t.handler}};const zV=(t,e,n)=>{if(Q0(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=t,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function FV(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:d}=new zi({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,s,(f,p)=>{var m,g,y,b;if(!((m=f.type)===null||m===void 0||(m=m.spec)===null||m===void 0)&&m.code||!(f.isText||f.isTextblock||f.isInline))return;const x=(g=(y=(b=f.content)===null||b===void 0?void 0:b.size)!==null&&y!==void 0?y:f.nodeSize)!==null&&g!==void 0?g:0,k=Math.max(r,p),w=Math.min(s,p+x);if(k>=w)return;const C=f.isText?f.text||"":f.textBetween(k-p,w-p,void 0,"");zV(C,i.find,o).forEach(E=>{if(E.index===void 0)return;const S=k+E.index+1,N=S+E[0].length,M={from:n.tr.mapping.map(S),to:n.tr.mapping.map(N)},j=i.handler({state:n,range:M,match:E,commands:l,chain:u,can:d,pasteEvent:o,dropEvent:a});h.push(j)})}),h.every(f=>f!==null)}let fc=null;const VV=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function $V(t){const{editor:e,rules:n}=t;let r=null,s=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:d,to:h,rule:f,pasteEvt:p})=>{const m=u.tr,g=ah({state:u,transaction:m});if(!(!FV({editor:e,state:g,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(u=>new ve({view(d){const h=p=>{var m;r=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(p.target)?d.dom.parentElement:null,r&&(fc=e)},f=()=>{fc&&(fc=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(i=r===d.dom.parentElement,a=h,!i){const f=fc;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,h)=>{var f;const p=(f=h.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=h,s=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],m=p.getMeta("uiEvent")==="paste"&&!s,g=p.getMeta("uiEvent")==="drop"&&!i,y=p.getMeta("applyPasteRules"),b=!!y;if(!m&&!g&&!b)return;if(b){let{text:w}=y;typeof w=="string"?w=w:w=nx(O.from(w),f.schema);const{from:C}=y,E=C+w.length,S=VV(w);return l({rule:u,state:f,from:C,to:{b:E},pasteEvt:S})}const x=h.doc.content.findDiffStart(f.doc.content),k=h.doc.content.findDiffEnd(f.doc.content);if(!(!RV(x)||!k||x===k.b))return l({rule:u,state:f,from:x,to:k,pasteEvt:o})}}))}var dh=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=aT(t),this.schema=RF(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=q(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:li(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this,e=ga([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:li(r.name,this.schema)},i=[],o=q(r,"addKeyboardShortcuts",s);let a={};if(r.type==="mark"&&q(r,"exitable",s)&&(a.ArrowRight=()=>ls.handleExit({editor:t,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([p,m])=>[p,()=>m({editor:t})]));a={...a,...f}}const l=Oz(a);i.push(l);const u=q(r,"addInputRules",s);if(qk(r,t.options.enableInputRules)&&u){const f=u();if(f&&f.length){const p=BV({editor:t,rules:f}),m=Array.isArray(p)?p:[p];i.push(...m)}}const d=q(r,"addPasteRules",s);if(qk(r,t.options.enablePasteRules)&&d){const f=d();if(f&&f.length){const p=$V({editor:t,rules:f});i.push(...p)}}const h=q(r,"addProseMirrorPlugins",s);if(h){const f=h();i.push(...f)}return i}),n=this.createDecorationPlugin();return n&&e.push(n),e}createDecorationPlugin(){var t;const{editor:e}=this;(t=this.decorationManager)===null||t===void 0||t.destroy();const n=[];return this.extensions.forEach(r=>{const s=q(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:li(r.name,this.schema)});s&&n.push({name:r.name,addDecorations:s})}),this.decorationManager=new AV({editor:e,entries:n}),this.decorationManager.plugin}get attributes(){return oT(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=io(this.extensions);return Object.fromEntries(e.filter(n=>!!q(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),s=q(n,"addNodeView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ue(n.name,this.schema)});if(!s)return[];const i=s();if(!i)return[];const o=(a,l,u,d,h)=>{const f=ol(a,r);return i({node:a,view:l,getPos:u,decorations:d,innerDecorations:h,editor:t,extension:n,HTMLAttributes:f})};return[n.name,o]}))}dispatchTransaction(t){const{editor:e}=this;return ga([...this.extensions].reverse()).reduceRight((n,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:li(r.name,this.schema)},i=q(r,"dispatchTransaction",s);return i?o=>{i.call(s,{transaction:o,next:n})}:n},t)}transformPastedHTML(t){const{editor:e}=this;return ga([...this.extensions]).reduce((n,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:li(r.name,this.schema)},i=q(r,"transformPastedHTML",s);return i?(o,a)=>{const l=n(o,a);return i.call(s,l)}:n},t||(n=>n))}get markViews(){const{editor:t}=this,{markExtensions:e}=io(this.extensions);return Object.fromEntries(e.filter(n=>!!q(n,"addMarkView")).map(n=>{const r=this.attributes.filter(o=>o.type===n.name),s=q(n,"addMarkView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:dr(n.name,this.schema)});if(!s)return[];const i=(o,a,l)=>{const u=ol(o,r);return s()({mark:o,view:a,inline:l,editor:t,extension:n,HTMLAttributes:u,updateAttributes:d=>{IV(o,t,d)}})};return[n.name,i]}))}destroy(){var t;(t=this.decorationManager)===null||t===void 0||t.destroy(),this.extensions.forEach(e=>{let n=e;for(;n.parent;){const r=n.parent;r.child===n&&(r.child=null),n=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:li(e.name,this.schema)};if(e.type==="mark"){var r,s;(!((r=ue(q(e,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name),!((s=ue(q(e,"clearable",n)))!==null&&s!==void 0)||s||this.nonClearableMarks.push(e.name)}const i=q(e,"onBeforeCreate",n),o=q(e,"onCreate",n),a=q(e,"onUpdate",n),l=q(e,"onSelectionUpdate",n),u=q(e,"onTransaction",n),d=q(e,"onFocus",n),h=q(e,"onBlur",n),f=q(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),h&&this.editor.on("blur",h),f&&this.editor.on("destroy",f)})}};dh.resolve=aT;dh.sort=ga;dh.flatten=tx;var fe=class ST extends sx{constructor(...e){super(...e),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new ST(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};const HV=fe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ve({key:new Fe("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,i=cT(n),{blockSeparator:o}=this.options,a={...o!==void 0?{blockSeparator:o}:{},textSerializers:i};return[...s.ranges].sort((l,u)=>l.$from.pos-u.$from.pos).map(({$from:l,$to:u})=>lT(r,{from:l.pos,to:u.pos},a)).join(o??` +${g}`}}),l}function kT(t,e){const n={...t};return dc(t)&&dc(e)&&Object.keys(e).forEach(r=>{dc(e[r])&&dc(t[r])?n[r]=kT(t[r],e[r]):n[r]=e[r]}),n}function OV(t,e,n={}){const{state:r}=e,{doc:s,tr:i}=r,o=t;s.descendants((a,l)=>{const u=i.mapping.map(l),d=i.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(p=>{if(p!==o)return!1;h=p}),!h)return;let f=!1;if(Object.keys(n).forEach(p=>{n[p]!==h.attrs[p]&&(f=!0)}),f){const p=t.type.create({...t.attrs,...n});i.removeMark(u,d,t.type),i.addMark(u,d,p)}}),i.docChanged&&e.view.dispatch(i)}var Pl=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!==null&&e!==void 0?e:!0}};const BV=(t,e)=>{if(Q0(e))return e.exec(t);const n=e(t);if(!n)return null;const 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 hc(t){var e;const{editor:n,from:r,to:s,text:i,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1;const h=HF(u)+i;return o.forEach(f=>{if(d)return;const p=BV(h,f.find);if(!p)return;const m=p[0].length-i.length;if(m>0){const C=u.parentOffset-m;if(C<0||u.parent.textBetween(C,u.parentOffset)!==p[0].slice(0,m))return}const g=l.state.tr,y=ah({state:l.state,transaction:g}),b={from:r-(p[0].length-i.length),to:s},{commands:x,chain:k,can:w}=new zi({editor:n,state:y});f.handler({state:y,range:b,match:p,commands:x,chain:k,can:w})===null||!g.steps.length||(f.undoable&&g.setMeta(a,{transform:g,from:r,to:s,text:i}),l.dispatch(g),d=!0)}),d}function zV(t){const{editor:e,rules:n}=t,r=new ke({state:{init(){return null},apply(s,i,o){const a=s.getMeta(r);if(a)return a;const l=s.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=nx(O.from(u),o.schema);const{from:d}=l,h=d+u.length;hc({editor:e,from:d,to:h,text:u,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,a){return hc({editor:e,from:i,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&hc({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?hc({editor:e,from:o.pos,to:o.pos,text:` +`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var sx=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{...ue(q(this,"addOptions",{name:this.name}))}}get storage(){return{...ue(q(this,"addStorage",{name:this.name,options:this.options}))}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>kT(this.options,t)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(t={}){const 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}},ls=class wT extends sx{constructor(...e){super(...e),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new wT(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const i=s.marks();if(!i.find(a=>(a==null?void 0:a.type.name)===n.name))return!1;const o=i.find(a=>(a==null?void 0:a.type.name)===n.name);return o&&r.removeStoredMark(o),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},ST=class{constructor(t){this.find=t.find,this.handler=t.handler}};const FV=(t,e,n)=>{if(Q0(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=t,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function VV(t){const{editor:e,state:n,from:r,to:s,rule:i,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:d}=new zi({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,s,(f,p)=>{var m,g,y,b;if(!((m=f.type)===null||m===void 0||(m=m.spec)===null||m===void 0)&&m.code||!(f.isText||f.isTextblock||f.isInline))return;const x=(g=(y=(b=f.content)===null||b===void 0?void 0:b.size)!==null&&y!==void 0?y:f.nodeSize)!==null&&g!==void 0?g:0,k=Math.max(r,p),w=Math.min(s,p+x);if(k>=w)return;const C=f.isText?f.text||"":f.textBetween(k-p,w-p,void 0,"");FV(C,i.find,o).forEach(E=>{if(E.index===void 0)return;const S=k+E.index+1,N=S+E[0].length,M={from:n.tr.mapping.map(S),to:n.tr.mapping.map(N)},j=i.handler({state:n,range:M,match:E,commands:l,chain:u,can:d,pasteEvent:o,dropEvent:a});h.push(j)})}),h.every(f=>f!==null)}let fc=null;const $V=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function HV(t){const{editor:e,rules:n}=t;let r=null,s=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:d,to:h,rule:f,pasteEvt:p})=>{const m=u.tr,g=ah({state:u,transaction:m});if(!(!VV({editor:e,state:g,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(u=>new ke({view(d){const h=p=>{var m;r=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(p.target)?d.dom.parentElement:null,r&&(fc=e)},f=()=>{fc&&(fc=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(i=r===d.dom.parentElement,a=h,!i){const f=fc;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,h)=>{var f;const p=(f=h.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return o=h,s=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],m=p.getMeta("uiEvent")==="paste"&&!s,g=p.getMeta("uiEvent")==="drop"&&!i,y=p.getMeta("applyPasteRules"),b=!!y;if(!m&&!g&&!b)return;if(b){let{text:w}=y;typeof w=="string"?w=w:w=nx(O.from(w),f.schema);const{from:C}=y,E=C+w.length,S=$V(w);return l({rule:u,state:f,from:C,to:{b:E},pasteEvt:S})}const x=h.doc.content.findDiffStart(f.doc.content),k=h.doc.content.findDiffEnd(f.doc.content);if(!(!_V(x)||!k||x===k.b))return l({rule:u,state:f,from:x,to:k,pasteEvt:o})}}))}var dh=class{constructor(t,e){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=e,this.baseExtensions=t,this.extensions=lT(t),this.schema=_F(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=q(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:li(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this,e=ga([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:li(r.name,this.schema)},i=[],o=q(r,"addKeyboardShortcuts",s);let a={};if(r.type==="mark"&&q(r,"exitable",s)&&(a.ArrowRight=()=>ls.handleExit({editor:t,mark:r})),o){const f=Object.fromEntries(Object.entries(o()).map(([p,m])=>[p,()=>m({editor:t})]));a={...a,...f}}const l=Bz(a);i.push(l);const u=q(r,"addInputRules",s);if(Jk(r,t.options.enableInputRules)&&u){const f=u();if(f&&f.length){const p=zV({editor:t,rules:f}),m=Array.isArray(p)?p:[p];i.push(...m)}}const d=q(r,"addPasteRules",s);if(Jk(r,t.options.enablePasteRules)&&d){const f=d();if(f&&f.length){const p=HV({editor:t,rules:f});i.push(...p)}}const h=q(r,"addProseMirrorPlugins",s);if(h){const f=h();i.push(...f)}return i}),n=this.createDecorationPlugin();return n&&e.push(n),e}createDecorationPlugin(){var t;const{editor:e}=this;(t=this.decorationManager)===null||t===void 0||t.destroy();const n=[];return this.extensions.forEach(r=>{const s=q(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:li(r.name,this.schema)});s&&n.push({name:r.name,addDecorations:s})}),this.decorationManager=new DV({editor:e,entries:n}),this.decorationManager.plugin}get attributes(){return aT(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=io(this.extensions);return Object.fromEntries(e.filter(n=>!!q(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),s=q(n,"addNodeView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Ue(n.name,this.schema)});if(!s)return[];const i=s();if(!i)return[];const o=(a,l,u,d,h)=>{const f=ol(a,r);return i({node:a,view:l,getPos:u,decorations:d,innerDecorations:h,editor:t,extension:n,HTMLAttributes:f})};return[n.name,o]}))}dispatchTransaction(t){const{editor:e}=this;return ga([...this.extensions].reverse()).reduceRight((n,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:li(r.name,this.schema)},i=q(r,"dispatchTransaction",s);return i?o=>{i.call(s,{transaction:o,next:n})}:n},t)}transformPastedHTML(t){const{editor:e}=this;return ga([...this.extensions]).reduce((n,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:li(r.name,this.schema)},i=q(r,"transformPastedHTML",s);return i?(o,a)=>{const l=n(o,a);return i.call(s,l)}:n},t||(n=>n))}get markViews(){const{editor:t}=this,{markExtensions:e}=io(this.extensions);return Object.fromEntries(e.filter(n=>!!q(n,"addMarkView")).map(n=>{const r=this.attributes.filter(o=>o.type===n.name),s=q(n,"addMarkView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:dr(n.name,this.schema)});if(!s)return[];const i=(o,a,l)=>{const u=ol(o,r);return s()({mark:o,view:a,inline:l,editor:t,extension:n,HTMLAttributes:u,updateAttributes:d=>{OV(o,t,d)}})};return[n.name,i]}))}destroy(){var t;(t=this.decorationManager)===null||t===void 0||t.destroy(),this.extensions.forEach(e=>{let n=e;for(;n.parent;){const r=n.parent;r.child===n&&(r.child=null),n=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:li(e.name,this.schema)};if(e.type==="mark"){var r,s;(!((r=ue(q(e,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name),!((s=ue(q(e,"clearable",n)))!==null&&s!==void 0)||s||this.nonClearableMarks.push(e.name)}const i=q(e,"onBeforeCreate",n),o=q(e,"onCreate",n),a=q(e,"onUpdate",n),l=q(e,"onSelectionUpdate",n),u=q(e,"onTransaction",n),d=q(e,"onFocus",n),h=q(e,"onBlur",n),f=q(e,"onDestroy",n);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),d&&this.editor.on("focus",d),h&&this.editor.on("blur",h),f&&this.editor.on("destroy",f)})}};dh.resolve=lT;dh.sort=ga;dh.flatten=tx;var fe=class NT extends sx{constructor(...e){super(...e),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new NT(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};const WV=fe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ke({key:new Fe("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:s}=e,i=uT(n),{blockSeparator:o}=this.options,a={...o!==void 0?{blockSeparator:o}:{},textSerializers:i};return[...s.ranges].sort((l,u)=>l.$from.pos-u.$from.pos).map(({$from:l,$to:u})=>cT(r,{from:l.pos,to:u.pos},a)).join(o??` -`)}}})]}}),WV=fe.create({name:"commands",addCommands(){return{...xV}}}),UV=fe.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r;const s=()=>{var i,o,a;if((i=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0||(a=o.filterTransaction)===null||a===void 0?void 0:a.call(o,t))!==null&&i!==void 0?i:t.getMeta("y-sync$"))return;const l=sT(t.before,[t,...e]);uh(l).forEach(d=>{l.mapping.mapResult(d.oldRange.from).deletedAfter&&l.mapping.mapResult(d.oldRange.to).deletedBefore&&l.before.nodesBetween(d.oldRange.from,d.oldRange.to,(h,f)=>{const p=f+h.nodeSize-2,m=d.oldRange.from<=f&&p<=d.oldRange.to;this.editor.emit("delete",{type:"node",node:h,from:f,to:p,newFrom:l.mapping.map(f),newTo:l.mapping.map(p),deletedRange:d.oldRange,newRange:d.newRange,partial:!m,editor:this.editor,transaction:t,combinedTransform:l})})});const u=l.mapping;l.steps.forEach((d,h)=>{if(d instanceof yn){var f,p;const m=u.slice(h).map(d.from,-1),g=u.slice(h).map(d.to),y=u.invert().map(m,-1),b=u.invert().map(g),x=m>0?(f=l.doc.nodeAt(m-1))===null||f===void 0?void 0:f.marks.some(w=>w.eq(d.mark)):!1,k=(p=l.doc.nodeAt(g))===null||p===void 0?void 0:p.marks.some(w=>w.eq(d.mark));this.editor.emit("delete",{type:"mark",mark:d.mark,from:d.from,to:d.to,deletedRange:{from:y,to:b},newRange:{from:m,to:g},partial:!!(k||x),editor:this.editor,transaction:t,combinedTransform:l})}})};!((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(s,0):s()}}),KV=fe.create({name:"drop",addProseMirrorPlugins(){return[new ve({key:new Fe("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),GV=fe.create({name:"editable",addProseMirrorPlugins(){return[new ve({key:new Fe("editable"),props:{editable:()=>this.editor.options.editable}})]}}),qV=new Fe("focusEvents"),JV=fe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ve({key:qV,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),YV=fe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:d,$anchor:h}=l,{pos:f,parent:p}=h,m=h.parent.isTextblock&&f>0?a.doc.resolve(f-1):h,g=m.parent.type.spec.isolating,y=h.pos-h.parentOffset,b=g&&m.parent.childCount===1?y===h.pos:ne.atStart(u).from===f;return!d||!p.type.isTextblock||p.textContent.length||!b||b&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.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()},s={...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 Uu()||nT()?i:s},addProseMirrorPlugins(){return[new ve({key:new Fe("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(p=>p.getMeta("composition")))return;const r=t.some(p=>p.docChanged)&&!e.doc.eq(n.doc),s=t.some(p=>p.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:a}=e.selection,l=ne.atStart(e.doc).from,u=ne.atEnd(e.doc).to;if(i||!(o===l&&a===u)||!Tl(n.doc))return;const d=n.tr,h=ah({state:n,transaction:d}),{commands:f}=new zi({editor:this.editor,state:h});if(f.clearNodes(),!!d.steps.length)return d}})]}}),XV=fe.create({name:"paste",addProseMirrorPlugins(){return[new ve({key:new Fe("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),ZV=fe.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new ve({key:new Fe("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"}}}})]}}),QV=fe.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=io(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new ve({key:new Fe("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}});let nw=!1;function e8(t){if(nw)return;nw=!0;let e;try{e=Re.fromJSON(t,{from:0,to:0}).slice.content}catch{return}e instanceof O||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var t8=class Jo{get name(){return this.node.type.name}constructor(e,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Jo(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Jo(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Jo(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!s&&!o&&l.depth<=this.depth)return;const u=new Jo(l,this.editor,s,s||o?n:null);s&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,o=Object.keys(n);for(let a=0;a{r&&s.length>0||(o.node.type.name===e&&i.every(a=>n[a]===o.node.attrs[a])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,n,r))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}};const n8=`.ProseMirror { +`)}}})]}}),UV=fe.create({name:"commands",addCommands(){return{...yV}}}),KV=fe.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r;const s=()=>{var i,o,a;if((i=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0||(a=o.filterTransaction)===null||a===void 0?void 0:a.call(o,t))!==null&&i!==void 0?i:t.getMeta("y-sync$"))return;const l=iT(t.before,[t,...e]);uh(l).forEach(d=>{l.mapping.mapResult(d.oldRange.from).deletedAfter&&l.mapping.mapResult(d.oldRange.to).deletedBefore&&l.before.nodesBetween(d.oldRange.from,d.oldRange.to,(h,f)=>{const p=f+h.nodeSize-2,m=d.oldRange.from<=f&&p<=d.oldRange.to;this.editor.emit("delete",{type:"node",node:h,from:f,to:p,newFrom:l.mapping.map(f),newTo:l.mapping.map(p),deletedRange:d.oldRange,newRange:d.newRange,partial:!m,editor:this.editor,transaction:t,combinedTransform:l})})});const u=l.mapping;l.steps.forEach((d,h)=>{if(d instanceof yn){var f,p;const m=u.slice(h).map(d.from,-1),g=u.slice(h).map(d.to),y=u.invert().map(m,-1),b=u.invert().map(g),x=m>0?(f=l.doc.nodeAt(m-1))===null||f===void 0?void 0:f.marks.some(w=>w.eq(d.mark)):!1,k=(p=l.doc.nodeAt(g))===null||p===void 0?void 0:p.marks.some(w=>w.eq(d.mark));this.editor.emit("delete",{type:"mark",mark:d.mark,from:d.from,to:d.to,deletedRange:{from:y,to:b},newRange:{from:m,to:g},partial:!!(k||x),editor:this.editor,transaction:t,combinedTransform:l})}})};!((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(s,0):s()}}),GV=fe.create({name:"drop",addProseMirrorPlugins(){return[new ke({key:new Fe("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),qV=fe.create({name:"editable",addProseMirrorPlugins(){return[new ke({key:new Fe("editable"),props:{editable:()=>this.editor.options.editable}})]}}),JV=new Fe("focusEvents"),YV=fe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new ke({key:JV,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),XV=fe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:d,$anchor:h}=l,{pos:f,parent:p}=h,m=h.parent.isTextblock&&f>0?a.doc.resolve(f-1):h,g=m.parent.type.spec.isolating,y=h.pos-h.parentOffset,b=g&&m.parent.childCount===1?y===h.pos:ne.atStart(u).from===f;return!d||!p.type.isTextblock||p.textContent.length||!b||b&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.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()},s={...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 Uu()||rT()?i:s},addProseMirrorPlugins(){return[new ke({key:new Fe("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(p=>p.getMeta("composition")))return;const r=t.some(p=>p.docChanged)&&!e.doc.eq(n.doc),s=t.some(p=>p.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:a}=e.selection,l=ne.atStart(e.doc).from,u=ne.atEnd(e.doc).to;if(i||!(o===l&&a===u)||!Tl(n.doc))return;const d=n.tr,h=ah({state:n,transaction:d}),{commands:f}=new zi({editor:this.editor,state:h});if(f.clearNodes(),!!d.steps.length)return d}})]}}),ZV=fe.create({name:"paste",addProseMirrorPlugins(){return[new ke({key:new Fe("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),QV=fe.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new ke({key:new Fe("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"}}}})]}}),e8=fe.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=io(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const n=e.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new ke({key:new Fe("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}});let rw=!1;function t8(t){if(rw)return;rw=!0;let e;try{e=Re.fromJSON(t,{from:0,to:0}).slice.content}catch{return}e instanceof O||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var n8=class Jo{get name(){return this.node.type.name}constructor(e,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new Jo(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Jo(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Jo(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,o=n.isInline,a=this.pos+r+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!s&&!o&&l.depth<=this.depth)return;const u=new Jo(l,this.editor,s,s||o?n:null);s&&(u.actualDepth=this.depth+1),e.push(u)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(n).length>0){const i=s.node.attrs,o=Object.keys(n);for(let a=0;a{r&&s.length>0||(o.node.type.name===e&&i.every(a=>n[a]===o.node.attrs[a])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,n,r))))}),s}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}};const r8=`.ProseMirror { position: relative; } @@ -264,9 +264,9 @@ img.ProseMirror-separator { .ProseMirror-focused .ProseMirror-gapcursor { display: block; -}`;var r8=class extends bV{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:KF,createMappablePosition:GF},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:s})=>this.options.onDrop(n,r,s)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const n=Km(e,this.options.autofocus);this.editorState=js.create({doc:e,schema:this.schema,selection:n||void 0})}e8(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;const t=this.editorView.dom;t!=null&&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():zi.createFakeChain()}can(){return this.commandManager?this.commandManager.can():zi.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=LV(n8,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 this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=iT(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(o=>!o.key.startsWith(i))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[GV,HV.configure({blockSeparator:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),WV,JV,YV,ZV.configure({value:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.tabindex)===null||e===void 0?void 0:e.value}),KV,XV,UV,QV.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new dh(n,this)}createCommandManager(){this.commandManager=new zi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Gm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const n=Gm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=js.create({doc:n,schema:this.schema,selection:Km(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new KE(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var d;return(d=this.capturedTransaction)===null||d===void 0?void 0:d.step(u)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),s=n.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return uT(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return HF(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return nx(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=` +}`;var s8=class extends vV{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:GF,createMappablePosition:qF},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:s})=>this.options.onDrop(n,r,s)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const e=this.createDoc();if(!this.editorState){const n=Km(e,this.options.autofocus);this.editorState=js.create({doc:e,schema:this.schema,selection:n||void 0})}t8(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;const t=this.editorView.dom;t!=null&&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():zi.createFakeChain()}can(){return this.commandManager?this.commandManager.can():zi.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=RV(r8,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 this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=oT(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;n=n.filter(o=>!o.key.startsWith(i))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[qV,WV.configure({blockSeparator:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.clipboardTextSerializer)===null||t===void 0?void 0:t.blockSeparator}),UV,YV,XV,QV.configure({value:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.tabindex)===null||e===void 0?void 0:e.value}),GV,ZV,KV,e8.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new dh(n,this)}createCommandManager(){this.commandManager=new zi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Gm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;const n=Gm(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=js.create({doc:n,schema:this.schema,selection:Km(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:n}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new GE(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();const l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var d;return(d=this.capturedTransaction)===null||d===void 0?void 0:d.step(u)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),s=n.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o==null?void 0:o.getMeta("focus"),l=o==null?void 0:o.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return dT(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return WF(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return nx(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=` -`,textSerializers:n={}}=t||{};return IF(this.state.doc,{blockSeparator:e,textSerializers:{...cT(this.schema),...n}})}get isEmpty(){return Tl(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){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new t8(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Ys(t){return new Pl({find:t.find,handler:({state:e,range:n,match:r})=>{const s=ue(t.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),d=u+o.length;if(rx(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(p=>p===t.type&&p!==f.mark.type)).filter(f=>f.to>u).length)return null;dn.from&&i.delete(n.from+l,u);const h=n.from+l+o.length;i.addMark(n.from+l,h,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function s8(t){return new Pl({find:t.find,handler:({state:e,range:n,match:r})=>{const s=ue(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let a=n.to;const l=t.type.create(s);if(r[1]){let u=o+r[0].lastIndexOf(r[1]);u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,o+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;i.insert(u,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(a))}i.scrollIntoView()},undoable:t.undoable})}function Jm(t){return new Pl({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=ue(t.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.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 oo(t){return new Pl({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=ue(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),l=a&&B0(a,t.type,i);if(!l)return null;if(o.wrap(a,l),t.keepMarks&&t.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=t.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const m=p.filter(g=>f.includes(g.type.name));o.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(d,i).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&is(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)},undoable:t.undoable})}var Ut=class NT extends sx{constructor(...e){super(...e),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new NT(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Qr(t){return new wT({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=ue(t.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const d=l.search(/\S/),h=n.from+l.indexOf(a),f=h+a.length;if(rx(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>h).length)return null;fn.from&&o.delete(n.from+d,h),u=n.from+d+a.length,o.addMark(n.from+d,u,t.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:i8,getOwnPropertySymbols:o8}=Object,{hasOwnProperty:a8}=Object.prototype;function Oo(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function Bo(t){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,s);const{cache:i}=s,o=i.get(n),a=i.get(r);if(o&&a)return o===r&&a===n;i.set(n,r),i.set(r,n);const l=t(n,r,s);return i.delete(n),i.delete(r),l}}function l8(t){return t!=null?t[Symbol.toStringTag]:void 0}function rw(t){return i8(t).concat(o8(t))}const c8=Object.hasOwn||((t,e)=>a8.call(t,e));function ti(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const u8="__v",d8="__o",h8="_owner",f8=typeof Float16Array<"u",{getOwnPropertyDescriptor:sw,keys:iw}=Object;function p8(t,e){return t.byteLength===e.byteLength&&Ku(new Uint8Array(t),new Uint8Array(e))}function m8(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function g8(t,e){return t.byteLength===e.byteLength&&Ku(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function x8(t,e){return ti(t.getTime(),e.getTime())}function ow(t,e,n){return t.name===e.name&&t.message===e.message&&t.stack===e.stack&&n.equals(t.cause,e.cause,"cause","cause",t,e,n)}function y8(t,e){return t===e}function aw(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.entries();let o,a,l=0;for(;(o=i.next())&&!o.done;){const u=e.entries();let d=!1,h=0;for(;(a=u.next())&&!a.done;){if(s[h]){h++;continue}const f=o.value,p=a.value;if(n.equals(f[0],p[0],l,h,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){d=s[h]=!0;break}h++}if(!d)return!1;l++}return!0}const b8=ti;function lw(t,e,n){const r=iw(t);let s=r.length;if(iw(e).length!==s)return!1;for(;s-- >0;)if(!CT(t,e,n,r[s]))return!1;return!0}function ci(t,e,n){const r=rw(t);let s=r.length;if(rw(e).length!==s)return!1;let i,o,a;for(;s-- >0;)if(i=r[s],!CT(t,e,n,i)||(o=sw(t,i),a=sw(e,i),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function v8(t,e){return ti(t.valueOf(),e.valueOf())}function k8(t,e){return t.source===e.source&&t.flags===e.flags}function cw(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.values();let o,a;for(;(o=i.next())&&!o.done;){const l=e.values();let u=!1,d=0;for(;(a=l.next())&&!a.done;){if(!s[d]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function Ku(t,e){let n=t.length;if(e.length!==n||t.byteOffset!==e.byteOffset)return!1;if(t instanceof Float64Array||t instanceof Float32Array||f8&&t instanceof Float16Array){for(;n-- >0;)if(t[n]!==e[n]&&(t[n]===t[n]||e[n]===e[n]))return!1;return!0}for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function w8(t,e){return t.href===e.href?!0:t.protocol===e.protocol&&t.username===e.username&&t.password===e.password&&t.host===e.host&&t.pathname===e.pathname&&t.hash===e.hash&&S8(t.searchParams,e.searchParams)}function S8(t,e){const n=t.toString(),r=e.toString();return n===r||uw(n)===uw(r)}function uw(t){return t.split("&").sort().join("&")}function CT(t,e,n,r){return(r===h8||r===d8||r===u8)&&(t.$$typeof||e.$$typeof)?!0:c8(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const N8="[object ArrayBuffer]",C8="[object Arguments]",j8="[object Boolean]",E8="[object DataView]",T8="[object Date]",M8="[object Error]",P8="[object Map]",A8="[object Number]",D8="[object Object]",L8="[object RegExp]",R8="[object Set]",_8="[object String]",I8={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},O8="[object URL]",B8=Object.prototype.toString;function z8({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(y,b,x){if(y===b)return!0;if(y==null||b==null)return!1;const k=typeof y;if(k!==typeof b)return!1;if(k!=="object")return k==="number"?a(y,b,x):k==="function"?i(y,b,x):!1;const w=y.constructor;if(w!==b.constructor)return!1;if(w===Object)return l(y,b,x);if(Array.isArray(y))return e(y,b,x);if(w===Date)return r(y,b,x);if(w===RegExp)return d(y,b,x);if(w===Map)return o(y,b,x);if(w===Set)return h(y,b,x);const C=B8.call(y);if(C===T8)return r(y,b,x);if(C===L8)return d(y,b,x);if(C===P8)return o(y,b,x);if(C===R8)return h(y,b,x);if(C===D8)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,x);if(C===O8)return p(y,b,x);if(C===M8)return s(y,b,x);if(C===C8)return l(y,b,x);if(I8[C])return f(y,b,x);if(C===N8)return t(y,b,x);if(C===E8)return n(y,b,x);if(C===j8||C===A8||C===_8)return u(y,b,x);if(m){let E=m[C];if(!E){const S=l8(y);S&&(E=m[S])}if(E)return E(y,b,x)}return!1}}function F8({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:p8,areArraysEqual:n?ci:m8,areDataViewsEqual:g8,areDatesEqual:x8,areErrorsEqual:n?Oo(ow,ci):Oo(ow,lw),areFunctionsEqual:y8,areMapsEqual:n?Oo(aw,ci):aw,areNumbersEqual:b8,areObjectsEqual:n?ci:lw,arePrimitiveWrappersEqual:v8,areRegExpsEqual:k8,areSetsEqual:n?Oo(cw,ci):cw,areTypedArraysEqual:n?Oo(Ku,ci):Ku,areUrlsEqual:w8,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=Bo(r.areArraysEqual),i=Bo(r.areErrorsEqual),o=Bo(r.areMapsEqual),a=Bo(r.areObjectsEqual),l=Bo(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areErrorsEqual:i,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:l})}return r}function V8(t){return function(e,n,r,s,i,o,a){return t(e,n,a)}}function $8({circular:t,comparator:e,createState:n,equals:r,strict:s}){if(n)return function(a,l){const{cache:u=t?new WeakMap:void 0,meta:d}=n();return e(a,l,{cache:u,equals:r,meta:d,strict:s})};if(t)return function(a,l){return e(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(a,l){return e(a,l,i)}}const H8=cs();cs({strict:!0});cs({circular:!0});cs({circular:!0,strict:!0});cs({createInternalComparator:()=>ti});cs({strict:!0,createInternalComparator:()=>ti});cs({circular:!0,createInternalComparator:()=>ti});cs({circular:!0,createInternalComparator:()=>ti,strict:!0});function cs(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=F8(t),o=z8(i),a=n?n(o):V8(o);return $8({circular:e,comparator:o,createState:r,equals:a,strict:s})}var jT={exports:{}},ET={};/** +`,textSerializers:n={}}=t||{};return OF(this.state.doc,{blockSeparator:e,textSerializers:{...uT(this.schema),...n}})}get isEmpty(){return Tl(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){const e=this.state.doc.resolve(t),n=t>0&&e.nodeAfter&&!e.nodeAfter.isText&&e.nodeAfter.isAtom?e.nodeAfter:null;return new n8(e,this,!1,n)}get $doc(){return this.$pos(0)}};function Ys(t){return new Pl({find:t.find,handler:({state:e,range:n,match:r})=>{const s=ue(t.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),d=u+o.length;if(rx(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(p=>p===t.type&&p!==f.mark.type)).filter(f=>f.to>u).length)return null;dn.from&&i.delete(n.from+l,u);const h=n.from+l+o.length;i.addMark(n.from+l,h,t.type.create(s||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function i8(t){return new Pl({find:t.find,handler:({state:e,range:n,match:r})=>{const s=ue(t.getAttributes,void 0,r)||{},{tr:i}=e,o=n.from;let a=n.to;const l=t.type.create(s);if(r[1]){let u=o+r[0].lastIndexOf(r[1]);u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,o+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;i.insert(u,t.type.create(s)).delete(i.mapping.map(o),i.mapping.map(a))}i.scrollIntoView()},undoable:t.undoable})}function Jm(t){return new Pl({find:t.find,handler:({state:e,range:n,match:r})=>{const s=e.doc.resolve(n.from),i=ue(t.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.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 oo(t){return new Pl({find:t.find,handler:({state:e,range:n,match:r,chain:s})=>{const i=ue(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),a=o.doc.resolve(n.from).blockRange(),l=a&&B0(a,t.type,i);if(!l)return null;if(o.wrap(a,l),t.keepMarks&&t.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=t.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const m=p.filter(g=>f.includes(g.type.name));o.ensureMarks(m)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(d,i).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&is(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)},undoable:t.undoable})}var Ut=class CT extends sx{constructor(...e){super(...e),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new CT(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Qr(t){return new ST({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:s})=>{const i=ue(t.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const d=l.search(/\S/),h=n.from+l.indexOf(a),f=h+a.length;if(rx(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>h).length)return null;fn.from&&o.delete(n.from+d,h),u=n.from+d+a.length,o.addMark(n.from+d,u,t.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:o8,getOwnPropertySymbols:a8}=Object,{hasOwnProperty:l8}=Object.prototype;function Oo(t,e){return function(r,s,i){return t(r,s,i)&&e(r,s,i)}}function Bo(t){return function(n,r,s){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,s);const{cache:i}=s,o=i.get(n),a=i.get(r);if(o&&a)return o===r&&a===n;i.set(n,r),i.set(r,n);const l=t(n,r,s);return i.delete(n),i.delete(r),l}}function c8(t){return t!=null?t[Symbol.toStringTag]:void 0}function sw(t){return o8(t).concat(a8(t))}const u8=Object.hasOwn||((t,e)=>l8.call(t,e));function ti(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const d8="__v",h8="__o",f8="_owner",p8=typeof Float16Array<"u",{getOwnPropertyDescriptor:iw,keys:ow}=Object;function m8(t,e){return t.byteLength===e.byteLength&&Ku(new Uint8Array(t),new Uint8Array(e))}function g8(t,e,n){let r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function x8(t,e){return t.byteLength===e.byteLength&&Ku(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function y8(t,e){return ti(t.getTime(),e.getTime())}function aw(t,e,n){return t.name===e.name&&t.message===e.message&&t.stack===e.stack&&n.equals(t.cause,e.cause,"cause","cause",t,e,n)}function b8(t,e){return t===e}function lw(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.entries();let o,a,l=0;for(;(o=i.next())&&!o.done;){const u=e.entries();let d=!1,h=0;for(;(a=u.next())&&!a.done;){if(s[h]){h++;continue}const f=o.value,p=a.value;if(n.equals(f[0],p[0],l,h,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){d=s[h]=!0;break}h++}if(!d)return!1;l++}return!0}const v8=ti;function cw(t,e,n){const r=ow(t);let s=r.length;if(ow(e).length!==s)return!1;for(;s-- >0;)if(!jT(t,e,n,r[s]))return!1;return!0}function ci(t,e,n){const r=sw(t);let s=r.length;if(sw(e).length!==s)return!1;let i,o,a;for(;s-- >0;)if(i=r[s],!jT(t,e,n,i)||(o=iw(t,i),a=iw(e,i),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function k8(t,e){return ti(t.valueOf(),e.valueOf())}function w8(t,e){return t.source===e.source&&t.flags===e.flags}function uw(t,e,n){const r=t.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=t.values();let o,a;for(;(o=i.next())&&!o.done;){const l=e.values();let u=!1,d=0;for(;(a=l.next())&&!a.done;){if(!s[d]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function Ku(t,e){let n=t.length;if(e.length!==n||t.byteOffset!==e.byteOffset)return!1;if(t instanceof Float64Array||t instanceof Float32Array||p8&&t instanceof Float16Array){for(;n-- >0;)if(t[n]!==e[n]&&(t[n]===t[n]||e[n]===e[n]))return!1;return!0}for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function S8(t,e){return t.href===e.href?!0:t.protocol===e.protocol&&t.username===e.username&&t.password===e.password&&t.host===e.host&&t.pathname===e.pathname&&t.hash===e.hash&&N8(t.searchParams,e.searchParams)}function N8(t,e){const n=t.toString(),r=e.toString();return n===r||dw(n)===dw(r)}function dw(t){return t.split("&").sort().join("&")}function jT(t,e,n,r){return(r===f8||r===h8||r===d8)&&(t.$$typeof||e.$$typeof)?!0:u8(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}const C8="[object ArrayBuffer]",j8="[object Arguments]",E8="[object Boolean]",T8="[object DataView]",M8="[object Date]",P8="[object Error]",A8="[object Map]",D8="[object Number]",L8="[object Object]",R8="[object RegExp]",_8="[object Set]",I8="[object String]",O8={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},B8="[object URL]",z8=Object.prototype.toString;function F8({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:a,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:d,areSetsEqual:h,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(y,b,x){if(y===b)return!0;if(y==null||b==null)return!1;const k=typeof y;if(k!==typeof b)return!1;if(k!=="object")return k==="number"?a(y,b,x):k==="function"?i(y,b,x):!1;const w=y.constructor;if(w!==b.constructor)return!1;if(w===Object)return l(y,b,x);if(Array.isArray(y))return e(y,b,x);if(w===Date)return r(y,b,x);if(w===RegExp)return d(y,b,x);if(w===Map)return o(y,b,x);if(w===Set)return h(y,b,x);const C=z8.call(y);if(C===M8)return r(y,b,x);if(C===R8)return d(y,b,x);if(C===A8)return o(y,b,x);if(C===_8)return h(y,b,x);if(C===L8)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,x);if(C===B8)return p(y,b,x);if(C===P8)return s(y,b,x);if(C===j8)return l(y,b,x);if(O8[C])return f(y,b,x);if(C===C8)return t(y,b,x);if(C===T8)return n(y,b,x);if(C===E8||C===D8||C===I8)return u(y,b,x);if(m){let E=m[C];if(!E){const S=c8(y);S&&(E=m[S])}if(E)return E(y,b,x)}return!1}}function V8({circular:t,createCustomConfig:e,strict:n}){let r={areArrayBuffersEqual:m8,areArraysEqual:n?ci:g8,areDataViewsEqual:x8,areDatesEqual:y8,areErrorsEqual:n?Oo(aw,ci):Oo(aw,cw),areFunctionsEqual:b8,areMapsEqual:n?Oo(lw,ci):lw,areNumbersEqual:v8,areObjectsEqual:n?ci:cw,arePrimitiveWrappersEqual:k8,areRegExpsEqual:w8,areSetsEqual:n?Oo(uw,ci):uw,areTypedArraysEqual:n?Oo(Ku,ci):Ku,areUrlsEqual:S8,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),t){const s=Bo(r.areArraysEqual),i=Bo(r.areErrorsEqual),o=Bo(r.areMapsEqual),a=Bo(r.areObjectsEqual),l=Bo(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areErrorsEqual:i,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:l})}return r}function $8(t){return function(e,n,r,s,i,o,a){return t(e,n,a)}}function H8({circular:t,comparator:e,createState:n,equals:r,strict:s}){if(n)return function(a,l){const{cache:u=t?new WeakMap:void 0,meta:d}=n();return e(a,l,{cache:u,equals:r,meta:d,strict:s})};if(t)return function(a,l){return e(a,l,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(a,l){return e(a,l,i)}}const W8=cs();cs({strict:!0});cs({circular:!0});cs({circular:!0,strict:!0});cs({createInternalComparator:()=>ti});cs({strict:!0,createInternalComparator:()=>ti});cs({circular:!0,createInternalComparator:()=>ti});cs({circular:!0,createInternalComparator:()=>ti,strict:!0});function cs(t={}){const{circular:e=!1,createInternalComparator:n,createState:r,strict:s=!1}=t,i=V8(t),o=F8(i),a=n?n(o):$8(o);return H8({circular:e,comparator:o,createState:r,equals:a,strict:s})}var ET={exports:{}},TT={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -274,11 +274,11 @@ img.ProseMirror-separator { * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var hh=v,W8=_0;function U8(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var K8=typeof Object.is=="function"?Object.is:U8,G8=W8.useSyncExternalStore,q8=hh.useRef,J8=hh.useEffect,Y8=hh.useMemo,X8=hh.useDebugValue;ET.useSyncExternalStoreWithSelector=function(t,e,n,r,s){var i=q8(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=Y8(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return h=m}return h=p}if(m=h,K8(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,h=g)}var u=!1,d,h,f=n===void 0?null:n;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,n,r,s]);var a=G8(t,i[0],i[1]);return J8(function(){o.hasValue=!0,o.value=a},[a]),X8(a),a};jT.exports=ET;var Z8=jT.exports;const Q8=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},e$=({contentComponent:t})=>{const e=_0.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return c.jsx(c.Fragment,{children:Object.values(e)})};function t$(){const t=new Set;let e={},n=!1;const r=()=>{n||!t.size||(n=!0,queueMicrotask(()=>{n=!1,t.forEach(s=>s())}))};return{subscribe(s){return t.add(s),()=>{t.delete(s)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(s,i){e={...e,[s]:cA.createPortal(i.reactElement,i.element,s)},r()},removeRenderer(s){const i={...e};delete i[s],e=i,r()}}}var n$=class extends Gr.Component{constructor(t){super(t),this.editorContentRef=Gr.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&(!((t=e.view.dom)===null||t===void 0)&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=t$(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{var e;if(!(!((e=t.view.dom)===null||e===void 0)&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:Q8(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&c.jsx(e$,{contentComponent:t.contentComponent})]})}};const r$=v.forwardRef((t,e)=>{const n=Gr.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Gr.createElement(n$,{key:n,innerRef:e,...t})}),TT=Gr.memo(r$),s$=typeof window<"u"?v.useLayoutEffect:v.useEffect;var i$=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let e;const n=s=>{(s==null?void 0:s.transaction)!==void 0&&s.transaction===e||(e=s==null?void 0:s.transaction,this.transactionNumber+=1,this.subscribers.forEach(i=>i()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function o$(t){var e;const[n]=v.useState(()=>new i$(t.editor)),r=Z8.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:H8);return s$(()=>n.watch(t.editor),[t.editor,n]),v.useDebugValue(r),r}const a$=!1,MT=typeof window>"u",l$=MT||!!(typeof window<"u"&&window.next);var c$=class PT{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return MT?(n&&a$&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):l$&&e===void 0&&(n=!1),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var r,s;return(r=(s=this.options.current).onBeforeCreate)===null||r===void 0?void 0:r.call(s,...n)},onBlur:(...n)=>{var r,s;return(r=(s=this.options.current).onBlur)===null||r===void 0?void 0:r.call(s,...n)},onCreate:(...n)=>{var r,s;return(r=(s=this.options.current).onCreate)===null||r===void 0?void 0:r.call(s,...n)},onDestroy:(...n)=>{var r,s;return(r=(s=this.options.current).onDestroy)===null||r===void 0?void 0:r.call(s,...n)},onFocus:(...n)=>{var r,s;return(r=(s=this.options.current).onFocus)===null||r===void 0?void 0:r.call(s,...n)},onSelectionUpdate:(...n)=>{var r,s;return(r=(s=this.options.current).onSelectionUpdate)===null||r===void 0?void 0:r.call(s,...n)},onTransaction:(...n)=>{var r,s;return(r=(s=this.options.current).onTransaction)===null||r===void 0?void 0:r.call(s,...n)},onUpdate:(...n)=>{var r,s;return(r=(s=this.options.current).onUpdate)===null||r===void 0?void 0:r.call(s,...n)},onContentError:(...n)=>{var r,s;return(r=(s=this.options.current).onContentError)===null||r===void 0?void 0:r.call(s,...n)},onDrop:(...n)=>{var r,s;return(r=(s=this.options.current).onDrop)===null||r===void 0?void 0:r.call(s,...n)},onPaste:(...n)=>{var r,s;return(r=(s=this.options.current).onPaste)===null||r===void 0?void 0:r.call(s,...n)},onDelete:(...n)=>{var r,s;return(r=(s=this.options.current).onDelete)===null||r===void 0?void 0:r.call(s,...n)},onMount:(...n)=>{var r,s;return(r=(s=this.options.current).onMount)===null||r===void 0?void 0:r.call(s,...n)},onUnmount:(...n)=>{var r,s;return(r=(s=this.options.current).onUnmount)===null||r===void 0?void 0:r.call(s,...n)}};return new r8(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=n.extensions)===null||o===void 0?void 0:o[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?PT.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,r)=>n===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function u$(t={},e=[]){const n=v.useRef(t);n.current=t;const[r]=v.useState(()=>new c$(n)),s=_0.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return v.useDebugValue(s),v.useEffect(r.onRender(e)),o$({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}const AT=v.createContext({editor:null});AT.Consumer;const d$=v.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),h$=()=>v.useContext(d$);Gr.forwardRef((t,e)=>{const{onDragStart:n}=h$(),r=t.as||"div";return c.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});Gr.createContext({markViewContentRef:()=>{}});const ix=v.createContext({get editor(){throw new Error("useTiptap must be used within a provider")}});ix.displayName="TiptapContext";const f$=()=>v.useContext(ix);function DT({children:t,...e}){const n="editor"in e?e.editor:e.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=v.useMemo(()=>({editor:n}),[n]),s=v.useMemo(()=>({editor:n}),[n]);return c.jsx(AT.Provider,{value:s,children:c.jsx(ix.Provider,{value:r,children:t})})}DT.displayName="Tiptap";function LT({...t}){const{editor:e}=f$();return c.jsx(TT,{editor:e,...t})}LT.displayName="Tiptap.Content";Object.assign(DT,{Content:LT});const RT=new WeakSet,_T=new WeakSet;function ms(t){const e=t;return RT.add(e),e}function Ym(t){return Array.isArray(t)&&RT.has(t)}function IT(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&_T.has(e)&&!Ym(e)?IT(e):[e])}function p$(t,e){if(t==="slot")return 0;if(t instanceof Function){const s=t(e);return Array.isArray(s)&&!Ym(s)&&!_T.has(s)?ms(s):s}const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(n)){if(Ym(n))return ms([t,r,n]);if(n.length===0)return ms([t,r]);const s=IT(n);return s.length===0?ms([t,r]):ms([t,r,...s])}return n!=null?ms([t,r,n]):ms([t,r])}const Gu=(t,e)=>p$(t,e),m$=(t,e)=>{var n;const{state:r}=t,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0)return!1;const o=i.depth-1;if(o<0)return!1;const a=i.node(o),l=i.index(o);if(l===0)return!1;if(a.type===e)return t.commands.lift(e.name);const u=a.child(l-1);if(u.type!==e||!(!((n=u.lastChild)===null||n===void 0)&&n.isTextblock))return!1;const d=i.before()-1-1;return t.commands.command(({tr:h,dispatch:f})=>{if(!f)return!0;const p=i.parent.content,m=new H(p,0,0);return h.replace(d,i.after(),m),h.setSelection(Y.create(h.doc,d+p.size)),h.scrollIntoView(),f(h),!0})},g$=/^\s*>\s$/,x$=Ut.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Gu("blockquote",{...ze(this.options.HTMLAttributes,t),children:Gu("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((s,i)=>{var o,a;const l=((o=(a=e.renderChild)===null||a===void 0?void 0:a.call(e,s,i))!==null&&o!==void 0?o:e.renderChildren([s])).split(` + */var hh=v,U8=_0;function K8(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var G8=typeof Object.is=="function"?Object.is:K8,q8=U8.useSyncExternalStore,J8=hh.useRef,Y8=hh.useEffect,X8=hh.useMemo,Z8=hh.useDebugValue;TT.useSyncExternalStoreWithSelector=function(t,e,n,r,s){var i=J8(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=X8(function(){function l(p){if(!u){if(u=!0,d=p,p=r(p),s!==void 0&&o.hasValue){var m=o.value;if(s(m,p))return h=m}return h=p}if(m=h,G8(d,p))return m;var g=r(p);return s!==void 0&&s(m,g)?(d=p,m):(d=p,h=g)}var u=!1,d,h,f=n===void 0?null:n;return[function(){return l(e())},f===null?void 0:function(){return l(f())}]},[e,n,r,s]);var a=q8(t,i[0],i[1]);return Y8(function(){o.hasValue=!0,o.value=a},[a]),Z8(a),a};ET.exports=TT;var Q8=ET.exports;const e$=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},t$=({contentComponent:t})=>{const e=_0.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return c.jsx(c.Fragment,{children:Object.values(e)})};function n$(){const t=new Set;let e={},n=!1;const r=()=>{n||!t.size||(n=!0,queueMicrotask(()=>{n=!1,t.forEach(s=>s())}))};return{subscribe(s){return t.add(s),()=>{t.delete(s)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(s,i){e={...e,[s]:uA.createPortal(i.reactElement,i.element,s)},r()},removeRenderer(s){const i={...e};delete i[s],e=i,r()}}}var r$=class extends Gr.Component{constructor(t){super(t),this.editorContentRef=Gr.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&(!((t=e.view.dom)===null||t===void 0)&&t.parentNode)){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:n}),e.contentComponent=n$(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{var e;if(!(!((e=t.view.dom)===null||e===void 0)&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:t,innerRef:e,...n}=this.props;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:e$(e,this.editorContentRef),...n}),(t==null?void 0:t.contentComponent)&&c.jsx(t$,{contentComponent:t.contentComponent})]})}};const s$=v.forwardRef((t,e)=>{const n=Gr.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Gr.createElement(r$,{key:n,innerRef:e,...t})}),MT=Gr.memo(s$),i$=typeof window<"u"?v.useLayoutEffect:v.useEffect;var o$=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){let e;const n=s=>{(s==null?void 0:s.transaction)!==void 0&&s.transaction===e||(e=s==null?void 0:s.transaction,this.transactionNumber+=1,this.subscribers.forEach(i=>i()))},r=this.editor;return r.on("transaction",n),r.on("update",n),()=>{r.off("transaction",n),r.off("update",n)}}}};function a$(t){var e;const[n]=v.useState(()=>new o$(t.editor)),r=Q8.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:W8);return i$(()=>n.watch(t.editor),[t.editor,n]),v.useDebugValue(r),r}const l$=!1,PT=typeof window>"u",c$=PT||!!(typeof window<"u"&&window.next);var u$=class AT{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){const e=this.options.current.immediatelyRender;let n=e??!0;return PT?(n&&l$&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),n=!1):c$&&e===void 0&&(n=!1),n?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var r,s;return(r=(s=this.options.current).onBeforeCreate)===null||r===void 0?void 0:r.call(s,...n)},onBlur:(...n)=>{var r,s;return(r=(s=this.options.current).onBlur)===null||r===void 0?void 0:r.call(s,...n)},onCreate:(...n)=>{var r,s;return(r=(s=this.options.current).onCreate)===null||r===void 0?void 0:r.call(s,...n)},onDestroy:(...n)=>{var r,s;return(r=(s=this.options.current).onDestroy)===null||r===void 0?void 0:r.call(s,...n)},onFocus:(...n)=>{var r,s;return(r=(s=this.options.current).onFocus)===null||r===void 0?void 0:r.call(s,...n)},onSelectionUpdate:(...n)=>{var r,s;return(r=(s=this.options.current).onSelectionUpdate)===null||r===void 0?void 0:r.call(s,...n)},onTransaction:(...n)=>{var r,s;return(r=(s=this.options.current).onTransaction)===null||r===void 0?void 0:r.call(s,...n)},onUpdate:(...n)=>{var r,s;return(r=(s=this.options.current).onUpdate)===null||r===void 0?void 0:r.call(s,...n)},onContentError:(...n)=>{var r,s;return(r=(s=this.options.current).onContentError)===null||r===void 0?void 0:r.call(s,...n)},onDrop:(...n)=>{var r,s;return(r=(s=this.options.current).onDrop)===null||r===void 0?void 0:r.call(s,...n)},onPaste:(...n)=>{var r,s;return(r=(s=this.options.current).onPaste)===null||r===void 0?void 0:r.call(s,...n)},onDelete:(...n)=>{var r,s;return(r=(s=this.options.current).onDelete)===null||r===void 0?void 0:r.call(s,...n)},onMount:(...n)=>{var r,s;return(r=(s=this.options.current).onMount)===null||r===void 0?void 0:r.call(s,...n)},onUnmount:(...n)=>{var r,s;return(r=(s=this.options.current).onUnmount)===null||r===void 0?void 0:r.call(s,...n)}};return new s8(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=n.extensions)===null||o===void 0?void 0:o[i])}):e[r]===n[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?AT.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,r)=>n===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function d$(t={},e=[]){const n=v.useRef(t);n.current=t;const[r]=v.useState(()=>new u$(n)),s=_0.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return v.useDebugValue(s),v.useEffect(r.onRender(e)),a$({editor:s,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),s}const DT=v.createContext({editor:null});DT.Consumer;const h$=v.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),f$=()=>v.useContext(h$);Gr.forwardRef((t,e)=>{const{onDragStart:n}=f$(),r=t.as||"div";return c.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});Gr.createContext({markViewContentRef:()=>{}});const ix=v.createContext({get editor(){throw new Error("useTiptap must be used within a provider")}});ix.displayName="TiptapContext";const p$=()=>v.useContext(ix);function LT({children:t,...e}){const n="editor"in e?e.editor:e.instance;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=v.useMemo(()=>({editor:n}),[n]),s=v.useMemo(()=>({editor:n}),[n]);return c.jsx(DT.Provider,{value:s,children:c.jsx(ix.Provider,{value:r,children:t})})}LT.displayName="Tiptap";function RT({...t}){const{editor:e}=p$();return c.jsx(MT,{editor:e,...t})}RT.displayName="Tiptap.Content";Object.assign(LT,{Content:RT});const _T=new WeakSet,IT=new WeakSet;function ms(t){const e=t;return _T.add(e),e}function Ym(t){return Array.isArray(t)&&_T.has(t)}function OT(t){return t.flatMap(e=>e==null?[]:Array.isArray(e)&&IT.has(e)&&!Ym(e)?OT(e):[e])}function m$(t,e){if(t==="slot")return 0;if(t instanceof Function){const s=t(e);return Array.isArray(s)&&!Ym(s)&&!IT.has(s)?ms(s):s}const{children:n,...r}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(n)){if(Ym(n))return ms([t,r,n]);if(n.length===0)return ms([t,r]);const s=OT(n);return s.length===0?ms([t,r]):ms([t,r,...s])}return n!=null?ms([t,r,n]):ms([t,r])}const Gu=(t,e)=>m$(t,e),g$=(t,e)=>{var n;const{state:r}=t,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0)return!1;const o=i.depth-1;if(o<0)return!1;const a=i.node(o),l=i.index(o);if(l===0)return!1;if(a.type===e)return t.commands.lift(e.name);const u=a.child(l-1);if(u.type!==e||!(!((n=u.lastChild)===null||n===void 0)&&n.isTextblock))return!1;const d=i.before()-1-1;return t.commands.command(({tr:h,dispatch:f})=>{if(!f)return!0;const p=i.parent.content,m=new H(p,0,0);return h.replace(d,i.after(),m),h.setSelection(Y.create(h.doc,d+p.size)),h.scrollIntoView(),f(h),!0})},x$=/^\s*>\s$/,y$=Ut.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Gu("blockquote",{...ze(this.options.HTMLAttributes,t),children:Gu("slot",{})})},parseMarkdown:(t,e)=>{var n;const r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren;return e.createNode("blockquote",void 0,r(t.tokens||[]))},renderMarkdown:(t,e)=>{if(!t.content)return"";const n=">",r=[];return t.content.forEach((s,i)=>{var o,a;const l=((o=(a=e.renderChild)===null||a===void 0?void 0:a.call(e,s,i))!==null&&o!==void 0?o:e.renderChildren([s])).split(` `).map(u=>u.trim()===""?n:`${n} ${u}`);r.push(l.join(` `))}),r.join(` ${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:()=>m$(this.editor,this.type)}},addInputRules(){return[oo({find:g$,type:this.type})]}}),y$=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,b$=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,v$=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,k$=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,w$=ls.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 Gu("strong",{...ze(this.options.HTMLAttributes,t),children:Gu("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},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[Ys({find:y$,type:this.type}),Ys({find:v$,type:this.type})]},addPasteRules(){return[Qr({find:b$,type:this.type}),Qr({find:k$,type:this.type})]}}),S$=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},N$=t=>{const e=/`([^`]+)`(?!`)/g,n=[];let 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},C$=ls.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ze(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[Ys({find:S$,type:this.type})]},addPasteRules(){return[Qr({find:N$,type:this.type})]}}),Lf=4,j$=/^```([a-z]+)?[\s\n]$/,E$=/^~~~([a-z]+)?[\s\n]$/,T$=Ut.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Lf,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const r=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ze(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="";const s=((n=t.attrs)===null||n===void 0?void 0:n.language)||"";return t.content?r=[`\`\`\`${s}`,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:()=>g$(this.editor,this.type)}},addInputRules(){return[oo({find:x$,type:this.type})]}}),b$=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,v$=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,k$=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,w$=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,S$=ls.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 Gu("strong",{...ze(this.options.HTMLAttributes,t),children:Gu("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},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[Ys({find:b$,type:this.type}),Ys({find:k$,type:this.type})]},addPasteRules(){return[Qr({find:v$,type:this.type}),Qr({find:w$,type:this.type})]}}),N$=t=>{const e=/`([^`]+)`(?!`)$/.exec(t);return!e||e.index>0&&t[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},C$=t=>{const e=/`([^`]+)`(?!`)/g,n=[];let 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},j$=ls.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",ze(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[Ys({find:N$,type:this.type})]},addPasteRules(){return[Qr({find:C$,type:this.type})]}}),Lf=4,E$=/^```([a-z]+)?[\s\n]$/,T$=/^~~~([a-z]+)?[\s\n]$/,M$=Ut.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Lf,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;if(!n)return null;const r=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",ze(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="";const s=((n=t.attrs)===null||n===void 0?void 0:n.language)||"";return t.content?r=[`\`\`\`${s}`,e.renderChildren(t.content),"```"].join(` `):r=`\`\`\`${s} \`\`\``,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:()=>{const{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;const n=(e=this.options.tabSize)!==null&&e!==void 0?e:Lf,{state:r}=t,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const a=" ".repeat(n);return o?t.commands.insertContent(a):t.commands.command(({tr:l})=>{const{from:u,to:d}=s,h=r.doc.textBetween(u,d,` @@ -294,32 +294,32 @@ ${n} `).map(h=>{var f;const p=((f=h.match(/^ */))===null||f===void 0?void 0:f[0])||"",m=Math.min(p.length,n);return h.slice(m)}).join(` `);return a.replaceWith(l,u,r.schema.text(d)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` -`);return!i||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type||r.parentOffset!==0)return!1;const i=r.before();return i>0?!1:t.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||s.parentOffset!==s.parent.nodeSize-2)return!1;const o=s.after();return o===void 0?!1:r.nodeAt(o)?t.commands.command(({tr:a})=>(a.setSelection(ne.near(r.resolve(o))),!0)):t.commands.exitCode()}}},addInputRules(){return[Jm({find:j$,type:this.type,getAttributes:t=>({language:t[1]})}),Jm({find:E$,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ve({key:new Fe("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!n||!i)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,` -`));return o.replaceSelectionWith(this.type.create({language:i},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(Y.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),M$=Ut.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`);return!i||!o?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:t})=>{if(!this.options.exitOnArrowUp)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:s}=n;if(!s||r.parent.type!==this.type||r.parentOffset!==0)return!1;const i=r.before();return i>0?!1:t.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:s,empty:i}=n;if(!i||s.parent.type!==this.type||s.parentOffset!==s.parent.nodeSize-2)return!1;const o=s.after();return o===void 0?!1:r.nodeAt(o)?t.commands.command(({tr:a})=>(a.setSelection(ne.near(r.resolve(o))),!0)):t.commands.exitCode()}}},addInputRules(){return[Jm({find:E$,type:this.type,getAttributes:t=>({language:t[1]})}),Jm({find:T$,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new ke({key:new Fe("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!n||!i)return!1;const{tr:o,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,` +`));return o.replaceSelectionWith(this.type.create({language:i},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(Y.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),P$=Ut.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):""}),P$=Ut.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",ze(this.options.HTMLAttributes,t)]},renderText(){return` +`):""}),A$=Ut.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",ze(this.options.HTMLAttributes,t)]},renderText(){return` `},renderMarkdown:()=>` -`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&l&&o){const h=l.filter(f=>a.includes(f.type.name));u.ensureMarks(h)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),A$=Ut.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]}`,ze(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=!((n=t.attrs)===null||n===void 0)&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(r);return t.content?`${s} ${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=>Jm({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),D$=Ut.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ze(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!DV(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return dT(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(Y.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(J.create(o.doc,l.pos)):o.setSelection(Y.create(o.doc,l.pos));else{const d=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,h=d==null?void 0:d.create();h&&(o.insert(u,h),o.setSelection(Y.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[s8({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),L$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,R$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,_$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,I$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,O$=ls.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",ze(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Ys({find:L$,type:this.type}),Ys({find:_$,type:this.type})]},addPasteRules(){return[Qr({find:R$,type:this.type}),Qr({find:I$,type:this.type})]}}),B$="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",z$="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Xm="numeric",Zm="ascii",Qm="alpha",xa="asciinumeric",Yo="alphanumeric",eg="domain",OT="emoji",F$="scheme",V$="slashscheme",Rf="whitespace";function $$(t,e){return t in e||(e[t]=[]),e[t]}function Ps(t,e,n){e[Xm]&&(e[xa]=!0,e[Yo]=!0),e[Zm]&&(e[xa]=!0,e[Qm]=!0),e[xa]&&(e[Yo]=!0),e[Qm]&&(e[Yo]=!0),e[Yo]&&(e[eg]=!0),e[OT]&&(e[eg]=!0);for(const r in e){const s=$$(r,n);s.indexOf(t)<0&&s.push(t)}}function H$(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Et(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Et.groups={};Et.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,s),Pe=(t,e,n,r,s)=>t.tr(e,n,r,s),dw=(t,e,n,r,s)=>t.ts(e,n,r,s),F=(t,e,n,r,s)=>t.tt(e,n,r,s),Un="WORD",tg="UWORD",BT="ASCIINUMERICAL",zT="ALPHANUMERICAL",al="LOCALHOST",ng="TLD",rg="UTLD",Jc="SCHEME",pi="SLASH_SCHEME",ox="NUM",sg="WS",ax="NL",ya="OPENBRACE",ba="CLOSEBRACE",qu="OPENBRACKET",Ju="CLOSEBRACKET",Yu="OPENPAREN",Xu="CLOSEPAREN",Zu="OPENANGLEBRACKET",Qu="CLOSEANGLEBRACKET",ed="FULLWIDTHLEFTPAREN",td="FULLWIDTHRIGHTPAREN",nd="LEFTCORNERBRACKET",rd="RIGHTCORNERBRACKET",sd="LEFTWHITECORNERBRACKET",id="RIGHTWHITECORNERBRACKET",od="FULLWIDTHLESSTHAN",ad="FULLWIDTHGREATERTHAN",ld="AMPERSAND",cd="APOSTROPHE",ud="ASTERISK",kr="AT",dd="BACKSLASH",hd="BACKTICK",fd="CARET",As="COLON",lx="COMMA",pd="DOLLAR",Mn="DOT",md="EQUALS",cx="EXCLAMATION",qt="HYPHEN",va="PERCENT",gd="PIPE",xd="PLUS",yd="POUND",ka="QUERY",ux="QUOTE",FT="FULLWIDTHMIDDLEDOT",dx="SEMI",Pn="SLASH",wa="TILDE",bd="UNDERSCORE",VT="EMOJI",vd="SYM";var $T=Object.freeze({__proto__:null,ALPHANUMERICAL:zT,AMPERSAND:ld,APOSTROPHE:cd,ASCIINUMERICAL:BT,ASTERISK:ud,AT:kr,BACKSLASH:dd,BACKTICK:hd,CARET:fd,CLOSEANGLEBRACKET:Qu,CLOSEBRACE:ba,CLOSEBRACKET:Ju,CLOSEPAREN:Xu,COLON:As,COMMA:lx,DOLLAR:pd,DOT:Mn,EMOJI:VT,EQUALS:md,EXCLAMATION:cx,FULLWIDTHGREATERTHAN:ad,FULLWIDTHLEFTPAREN:ed,FULLWIDTHLESSTHAN:od,FULLWIDTHMIDDLEDOT:FT,FULLWIDTHRIGHTPAREN:td,HYPHEN:qt,LEFTCORNERBRACKET:nd,LEFTWHITECORNERBRACKET:sd,LOCALHOST:al,NL:ax,NUM:ox,OPENANGLEBRACKET:Zu,OPENBRACE:ya,OPENBRACKET:qu,OPENPAREN:Yu,PERCENT:va,PIPE:gd,PLUS:xd,POUND:yd,QUERY:ka,QUOTE:ux,RIGHTCORNERBRACKET:rd,RIGHTWHITECORNERBRACKET:id,SCHEME:Jc,SEMI:dx,SLASH:Pn,SLASH_SCHEME:pi,SYM:vd,TILDE:wa,TLD:ng,UNDERSCORE:bd,UTLD:rg,UWORD:tg,WORD:Un,WS:sg});const Vn=/[a-z]/,zo=new RegExp("\\p{L}","u"),_f=new RegExp("\\p{Emoji}","u"),$n=/\d/,If=/\s/,hw="\r",Of=` -`,W$="️",U$="‍",Bf="";let pc=null,mc=null;function K$(t=[]){const e={};Et.groups=e;const n=new Et;pc==null&&(pc=fw(B$)),mc==null&&(mc=fw(z$)),F(n,"'",cd),F(n,"{",ya),F(n,"}",ba),F(n,"[",qu),F(n,"]",Ju),F(n,"(",Yu),F(n,")",Xu),F(n,"<",Zu),F(n,">",Qu),F(n,"(",ed),F(n,")",td),F(n,"「",nd),F(n,"」",rd),F(n,"『",sd),F(n,"』",id),F(n,"<",od),F(n,">",ad),F(n,"&",ld),F(n,"*",ud),F(n,"@",kr),F(n,"`",hd),F(n,"^",fd),F(n,":",As),F(n,",",lx),F(n,"$",pd),F(n,".",Mn),F(n,"=",md),F(n,"!",cx),F(n,"-",qt),F(n,"%",va),F(n,"|",gd),F(n,"+",xd),F(n,"#",yd),F(n,"?",ka),F(n,'"',ux),F(n,"/",Pn),F(n,";",dx),F(n,"~",wa),F(n,"_",bd),F(n,"\\",dd),F(n,"・",FT);const r=Pe(n,$n,ox,{[Xm]:!0});Pe(r,$n,r);const s=Pe(r,Vn,BT,{[xa]:!0}),i=Pe(r,zo,zT,{[Yo]:!0}),o=Pe(n,Vn,Un,{[Zm]:!0});Pe(o,$n,s),Pe(o,Vn,o),Pe(s,$n,s),Pe(s,Vn,s);const a=Pe(n,zo,tg,{[Qm]:!0});Pe(a,Vn),Pe(a,$n,i),Pe(a,zo,a),Pe(i,$n,i),Pe(i,Vn),Pe(i,zo,i);const l=F(n,Of,ax,{[Rf]:!0}),u=F(n,hw,sg,{[Rf]:!0}),d=Pe(n,If,sg,{[Rf]:!0});F(n,Bf,d),F(u,Of,l),F(u,Bf,d),Pe(u,If,d),F(d,hw),F(d,Of),Pe(d,If,d),F(d,Bf,d);const h=Pe(n,_f,VT,{[OT]:!0});F(h,"#"),Pe(h,_f,h),F(h,W$,h);const f=F(h,U$);F(f,"#"),Pe(f,_f,h);const p=[[Vn,o],[$n,s]],m=[[Vn,null],[zo,a],[$n,i]];for(let g=0;gg[0]>y[0]?1:-1);for(let g=0;g=0?x[eg]=!0:Vn.test(y)?$n.test(y)?x[xa]=!0:x[Zm]=!0:x[Xm]=!0,dw(n,y,y,x)}return dw(n,"localhost",al,{ascii:!0}),n.jd=new Et(vd),{start:n,tokens:Object.assign({groups:e},$T)}}function HT(t,e){const n=G$(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o=0&&(h+=n[o].length,f++),u+=n[o].length,i+=n[o].length,o++;i-=h,o-=f,u-=h,s.push({t:d.t,v:e.slice(i-u,i),s:i-u,e:i})}return s}function G$(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function fr(t,e,n,r,s){let i;const o=e.length;for(let a=0;a=0;)i++;if(i>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(t[r]),r++}return e}const ll={defaultProtocol:"http",events:null,format:pw,formatHref:pw,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function hx(t,e=null){let n=Object.assign({},ll);t&&(n=Object.assign(n,t instanceof hx?t.o:t));const r=n.ignoreTags,s=[];for(let i=0;in?r.substring(0,n)+"…":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=ll.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){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),s=t.get("tagName",n,e),i=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),d=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),u&&(o.rel=u),d&&Object.assign(o,d),{tagName:s,attributes:o,content:i,eventListeners:h}}};function fh(t,e){class n extends WT{constructor(s,i){super(s,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const q$=fh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),mw=fh("text"),J$=fh("nl"),gc=fh("url",{isLink:!0,toHref(t=ll.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==al&&t[1].t===As}}),Gt=t=>new Et(t);function Y$({groups:t}){const e=t.domain.concat([ld,ud,kr,dd,hd,fd,pd,md,qt,ox,va,gd,xd,yd,Pn,vd,wa,bd]),n=[cd,As,lx,Mn,cx,va,ka,ux,dx,Zu,Qu,ya,ba,Ju,qu,Yu,Xu,ed,td,nd,rd,sd,id,od,ad],r=[ld,cd,ud,dd,hd,fd,pd,md,qt,ya,ba,va,gd,xd,yd,ka,Pn,vd,wa,bd],s=Gt(),i=F(s,wa);re(i,r,i),re(i,t.domain,i);const o=Gt(),a=Gt(),l=Gt();re(s,t.domain,o),re(s,t.scheme,a),re(s,t.slashscheme,l),re(o,r,i),re(o,t.domain,o);const u=F(o,kr);F(i,kr,u),F(a,kr,u),F(l,kr,u);const d=F(i,Mn);re(d,r,i),re(d,t.domain,i);const h=Gt();re(u,t.domain,h),re(h,t.domain,h);const f=F(h,Mn);re(f,t.domain,h);const p=Gt(q$);re(f,t.tld,p),re(f,t.utld,p),F(u,al,p);const m=F(h,qt);F(m,qt,m),re(m,t.domain,h),re(p,t.domain,h),F(p,Mn,f),F(p,qt,m);const g=F(o,qt),y=F(o,Mn);F(g,qt,g),re(g,t.domain,o),re(y,r,i),re(y,t.domain,o);const b=Gt(gc);re(y,t.tld,b),re(y,t.utld,b),re(b,t.domain,o),re(b,r,i),F(b,Mn,y),F(b,qt,g),F(b,kr,u);const x=F(b,As),k=Gt(gc);re(x,t.numeric,k);const w=Gt(gc),C=Gt();re(w,e,w),re(w,n,C),re(C,e,w),re(C,n,C),F(b,Pn,w),F(k,Pn,w);const E=F(a,As),S=F(l,As),N=F(S,Pn),M=F(N,Pn);re(a,t.domain,o),F(a,Mn,y),F(a,qt,g),re(l,t.domain,o),F(l,Mn,y),F(l,qt,g),re(E,t.domain,w),F(E,Pn,w),F(E,ka,w),re(M,t.domain,w),re(M,e,w),F(M,Pn,w);const j=[[ya,ba],[qu,Ju],[Yu,Xu],[Zu,Qu],[ed,td],[nd,rd],[sd,id],[od,ad]];for(let T=0;T=0&&f++,s++,d++;if(f<0)s-=d,s0&&(i.push(zf(mw,e,o)),o=[]),s-=f,d-=f;const p=h.t,m=n.slice(s-d,s);i.push(zf(p,e,m))}}return o.length>0&&i.push(zf(mw,e,o)),i}function zf(t,e,n){const r=n[0].s,s=n[n.length-1].e,i=e.slice(r,s);return new t(i,n)}const Z$=typeof console<"u"&&console&&console.warn||(()=>{}),Q$="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ye={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function e9(){return Et.groups={},ye.scanner=null,ye.parser=null,ye.tokenQueue=[],ye.pluginQueue=[],ye.customSchemes=[],ye.initialized=!1,ye}function gw(t,e=!1){if(ye.initialized&&Z$(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Q$}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. +`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:s,storedMarks:i}=n;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&l&&o){const h=l.filter(f=>a.includes(f.type.name));u.ensureMarks(h)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),D$=Ut.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]}`,ze(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const r=!((n=t.attrs)===null||n===void 0)&&n.level?parseInt(t.attrs.level,10):1,s="#".repeat(r);return t.content?`${s} ${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=>Jm({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),L$=Ut.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",ze(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!LV(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:r}=n,s=t();return hT(n)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:a})=>{if(a){const{$to:l}=o.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?o.setSelection(Y.create(o.doc,l.pos+1)):l.nodeAfter.isBlock?o.setSelection(J.create(o.doc,l.pos)):o.setSelection(Y.create(o.doc,l.pos));else{const d=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,h=d==null?void 0:d.create();h&&(o.insert(u,h),o.setSelection(Y.create(o.doc,u+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[i8({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),R$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_$=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,I$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,O$=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,B$=ls.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",ze(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Ys({find:R$,type:this.type}),Ys({find:I$,type:this.type})]},addPasteRules(){return[Qr({find:_$,type:this.type}),Qr({find:O$,type:this.type})]}}),z$="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",F$="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Xm="numeric",Zm="ascii",Qm="alpha",xa="asciinumeric",Yo="alphanumeric",eg="domain",BT="emoji",V$="scheme",$$="slashscheme",Rf="whitespace";function H$(t,e){return t in e||(e[t]=[]),e[t]}function Ps(t,e,n){e[Xm]&&(e[xa]=!0,e[Yo]=!0),e[Zm]&&(e[xa]=!0,e[Qm]=!0),e[xa]&&(e[Yo]=!0),e[Qm]&&(e[Yo]=!0),e[Yo]&&(e[eg]=!0),e[BT]&&(e[eg]=!0);for(const r in e){const s=H$(r,n);s.indexOf(t)<0&&s.push(t)}}function W$(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Et(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Et.groups={};Et.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;rt.ta(e,n,r,s),Pe=(t,e,n,r,s)=>t.tr(e,n,r,s),hw=(t,e,n,r,s)=>t.ts(e,n,r,s),F=(t,e,n,r,s)=>t.tt(e,n,r,s),Un="WORD",tg="UWORD",zT="ASCIINUMERICAL",FT="ALPHANUMERICAL",al="LOCALHOST",ng="TLD",rg="UTLD",Jc="SCHEME",pi="SLASH_SCHEME",ox="NUM",sg="WS",ax="NL",ya="OPENBRACE",ba="CLOSEBRACE",qu="OPENBRACKET",Ju="CLOSEBRACKET",Yu="OPENPAREN",Xu="CLOSEPAREN",Zu="OPENANGLEBRACKET",Qu="CLOSEANGLEBRACKET",ed="FULLWIDTHLEFTPAREN",td="FULLWIDTHRIGHTPAREN",nd="LEFTCORNERBRACKET",rd="RIGHTCORNERBRACKET",sd="LEFTWHITECORNERBRACKET",id="RIGHTWHITECORNERBRACKET",od="FULLWIDTHLESSTHAN",ad="FULLWIDTHGREATERTHAN",ld="AMPERSAND",cd="APOSTROPHE",ud="ASTERISK",kr="AT",dd="BACKSLASH",hd="BACKTICK",fd="CARET",As="COLON",lx="COMMA",pd="DOLLAR",Mn="DOT",md="EQUALS",cx="EXCLAMATION",qt="HYPHEN",va="PERCENT",gd="PIPE",xd="PLUS",yd="POUND",ka="QUERY",ux="QUOTE",VT="FULLWIDTHMIDDLEDOT",dx="SEMI",Pn="SLASH",wa="TILDE",bd="UNDERSCORE",$T="EMOJI",vd="SYM";var HT=Object.freeze({__proto__:null,ALPHANUMERICAL:FT,AMPERSAND:ld,APOSTROPHE:cd,ASCIINUMERICAL:zT,ASTERISK:ud,AT:kr,BACKSLASH:dd,BACKTICK:hd,CARET:fd,CLOSEANGLEBRACKET:Qu,CLOSEBRACE:ba,CLOSEBRACKET:Ju,CLOSEPAREN:Xu,COLON:As,COMMA:lx,DOLLAR:pd,DOT:Mn,EMOJI:$T,EQUALS:md,EXCLAMATION:cx,FULLWIDTHGREATERTHAN:ad,FULLWIDTHLEFTPAREN:ed,FULLWIDTHLESSTHAN:od,FULLWIDTHMIDDLEDOT:VT,FULLWIDTHRIGHTPAREN:td,HYPHEN:qt,LEFTCORNERBRACKET:nd,LEFTWHITECORNERBRACKET:sd,LOCALHOST:al,NL:ax,NUM:ox,OPENANGLEBRACKET:Zu,OPENBRACE:ya,OPENBRACKET:qu,OPENPAREN:Yu,PERCENT:va,PIPE:gd,PLUS:xd,POUND:yd,QUERY:ka,QUOTE:ux,RIGHTCORNERBRACKET:rd,RIGHTWHITECORNERBRACKET:id,SCHEME:Jc,SEMI:dx,SLASH:Pn,SLASH_SCHEME:pi,SYM:vd,TILDE:wa,TLD:ng,UNDERSCORE:bd,UTLD:rg,UWORD:tg,WORD:Un,WS:sg});const Vn=/[a-z]/,zo=new RegExp("\\p{L}","u"),_f=new RegExp("\\p{Emoji}","u"),$n=/\d/,If=/\s/,fw="\r",Of=` +`,U$="️",K$="‍",Bf="";let pc=null,mc=null;function G$(t=[]){const e={};Et.groups=e;const n=new Et;pc==null&&(pc=pw(z$)),mc==null&&(mc=pw(F$)),F(n,"'",cd),F(n,"{",ya),F(n,"}",ba),F(n,"[",qu),F(n,"]",Ju),F(n,"(",Yu),F(n,")",Xu),F(n,"<",Zu),F(n,">",Qu),F(n,"(",ed),F(n,")",td),F(n,"「",nd),F(n,"」",rd),F(n,"『",sd),F(n,"』",id),F(n,"<",od),F(n,">",ad),F(n,"&",ld),F(n,"*",ud),F(n,"@",kr),F(n,"`",hd),F(n,"^",fd),F(n,":",As),F(n,",",lx),F(n,"$",pd),F(n,".",Mn),F(n,"=",md),F(n,"!",cx),F(n,"-",qt),F(n,"%",va),F(n,"|",gd),F(n,"+",xd),F(n,"#",yd),F(n,"?",ka),F(n,'"',ux),F(n,"/",Pn),F(n,";",dx),F(n,"~",wa),F(n,"_",bd),F(n,"\\",dd),F(n,"・",VT);const r=Pe(n,$n,ox,{[Xm]:!0});Pe(r,$n,r);const s=Pe(r,Vn,zT,{[xa]:!0}),i=Pe(r,zo,FT,{[Yo]:!0}),o=Pe(n,Vn,Un,{[Zm]:!0});Pe(o,$n,s),Pe(o,Vn,o),Pe(s,$n,s),Pe(s,Vn,s);const a=Pe(n,zo,tg,{[Qm]:!0});Pe(a,Vn),Pe(a,$n,i),Pe(a,zo,a),Pe(i,$n,i),Pe(i,Vn),Pe(i,zo,i);const l=F(n,Of,ax,{[Rf]:!0}),u=F(n,fw,sg,{[Rf]:!0}),d=Pe(n,If,sg,{[Rf]:!0});F(n,Bf,d),F(u,Of,l),F(u,Bf,d),Pe(u,If,d),F(d,fw),F(d,Of),Pe(d,If,d),F(d,Bf,d);const h=Pe(n,_f,$T,{[BT]:!0});F(h,"#"),Pe(h,_f,h),F(h,U$,h);const f=F(h,K$);F(f,"#"),Pe(f,_f,h);const p=[[Vn,o],[$n,s]],m=[[Vn,null],[zo,a],[$n,i]];for(let g=0;gg[0]>y[0]?1:-1);for(let g=0;g=0?x[eg]=!0:Vn.test(y)?$n.test(y)?x[xa]=!0:x[Zm]=!0:x[Xm]=!0,hw(n,y,y,x)}return hw(n,"localhost",al,{ascii:!0}),n.jd=new Et(vd),{start:n,tokens:Object.assign({groups:e},HT)}}function WT(t,e){const n=q$(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,s=[];let i=0,o=0;for(;o=0&&(h+=n[o].length,f++),u+=n[o].length,i+=n[o].length,o++;i-=h,o-=f,u-=h,s.push({t:d.t,v:e.slice(i-u,i),s:i-u,e:i})}return s}function q$(t){const e=[],n=t.length;let r=0;for(;r56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(o),r+=o.length}return e}function fr(t,e,n,r,s){let i;const o=e.length;for(let a=0;a=0;)i++;if(i>0){e.push(n.join(""));for(let o=parseInt(t.substring(r,r+i),10);o>0;o--)n.pop();r+=i}else n.push(t[r]),r++}return e}const ll={defaultProtocol:"http",events:null,format:mw,formatHref:mw,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function hx(t,e=null){let n=Object.assign({},ll);t&&(n=Object.assign(n,t instanceof hx?t.o:t));const r=n.ignoreTags,s=[];for(let i=0;in?r.substring(0,n)+"…":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=ll.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){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),s=t.get("tagName",n,e),i=this.toFormattedString(t),o={},a=t.get("className",n,e),l=t.get("target",n,e),u=t.get("rel",n,e),d=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return o.href=r,a&&(o.class=a),l&&(o.target=l),u&&(o.rel=u),d&&Object.assign(o,d),{tagName:s,attributes:o,content:i,eventListeners:h}}};function fh(t,e){class n extends UT{constructor(s,i){super(s,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const J$=fh("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),gw=fh("text"),Y$=fh("nl"),gc=fh("url",{isLink:!0,toHref(t=ll.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==al&&t[1].t===As}}),Gt=t=>new Et(t);function X$({groups:t}){const e=t.domain.concat([ld,ud,kr,dd,hd,fd,pd,md,qt,ox,va,gd,xd,yd,Pn,vd,wa,bd]),n=[cd,As,lx,Mn,cx,va,ka,ux,dx,Zu,Qu,ya,ba,Ju,qu,Yu,Xu,ed,td,nd,rd,sd,id,od,ad],r=[ld,cd,ud,dd,hd,fd,pd,md,qt,ya,ba,va,gd,xd,yd,ka,Pn,vd,wa,bd],s=Gt(),i=F(s,wa);re(i,r,i),re(i,t.domain,i);const o=Gt(),a=Gt(),l=Gt();re(s,t.domain,o),re(s,t.scheme,a),re(s,t.slashscheme,l),re(o,r,i),re(o,t.domain,o);const u=F(o,kr);F(i,kr,u),F(a,kr,u),F(l,kr,u);const d=F(i,Mn);re(d,r,i),re(d,t.domain,i);const h=Gt();re(u,t.domain,h),re(h,t.domain,h);const f=F(h,Mn);re(f,t.domain,h);const p=Gt(J$);re(f,t.tld,p),re(f,t.utld,p),F(u,al,p);const m=F(h,qt);F(m,qt,m),re(m,t.domain,h),re(p,t.domain,h),F(p,Mn,f),F(p,qt,m);const g=F(o,qt),y=F(o,Mn);F(g,qt,g),re(g,t.domain,o),re(y,r,i),re(y,t.domain,o);const b=Gt(gc);re(y,t.tld,b),re(y,t.utld,b),re(b,t.domain,o),re(b,r,i),F(b,Mn,y),F(b,qt,g),F(b,kr,u);const x=F(b,As),k=Gt(gc);re(x,t.numeric,k);const w=Gt(gc),C=Gt();re(w,e,w),re(w,n,C),re(C,e,w),re(C,n,C),F(b,Pn,w),F(k,Pn,w);const E=F(a,As),S=F(l,As),N=F(S,Pn),M=F(N,Pn);re(a,t.domain,o),F(a,Mn,y),F(a,qt,g),re(l,t.domain,o),F(l,Mn,y),F(l,qt,g),re(E,t.domain,w),F(E,Pn,w),F(E,ka,w),re(M,t.domain,w),re(M,e,w),F(M,Pn,w);const j=[[ya,ba],[qu,Ju],[Yu,Xu],[Zu,Qu],[ed,td],[nd,rd],[sd,id],[od,ad]];for(let T=0;T=0&&f++,s++,d++;if(f<0)s-=d,s0&&(i.push(zf(gw,e,o)),o=[]),s-=f,d-=f;const p=h.t,m=n.slice(s-d,s);i.push(zf(p,e,m))}}return o.length>0&&i.push(zf(gw,e,o)),i}function zf(t,e,n){const r=n[0].s,s=n[n.length-1].e,i=e.slice(r,s);return new t(i,n)}const Q$=typeof console<"u"&&console&&console.warn||(()=>{}),e9="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",be={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function t9(){return Et.groups={},be.scanner=null,be.parser=null,be.tokenQueue=[],be.pluginQueue=[],be.customSchemes=[],be.initialized=!1,be}function xw(t,e=!1){if(be.initialized&&Q$(`linkifyjs: already initialized - will not register custom scheme "${t}" ${e9}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);ye.customSchemes.push([t,e])}function t9(){ye.scanner=K$(ye.customSchemes);for(let t=0;t{const s=e.some(l=>l.docChanged)&&!n.doc.eq(r.doc),i=e.some(l=>l.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,a=sT(n.doc,[...e]);if(uh(a).forEach(({newRange:l})=>{const u=MF(r.doc,l,f=>f.isTextblock);let d,h;if(u.length>1)d=u[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const f=r.doc.textBetween(l.from,l.to," "," ");if(!r9.test(f))return;d=u[0],h=r.doc.textBetween(d.pos,l.to,void 0," ")}if(d&&h){const f=h.split(n9).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=d.pos+h.lastIndexOf(p);if(!p)return!1;const g=fx(p).map(y=>y.toObject(t.defaultProtocol));if(!i9(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{rx(y.from,y.to,r.doc).some(b=>b.mark.type===t.type)||o.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function a9(t){return new ve({key:new Fe("handleClickLink"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const l=r.target;if(!l)return!1;const u=t.editor.view.dom;s=l.closest("a"),s&&!u.contains(s)&&(s=null)}if(!s)return!1;let i=!1;if(t.enableClickSelection&&(i=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var o,a;const l=uT(e.state,t.type.name),u=(o=s.href)!==null&&o!==void 0?o:l.href,d=(a=s.target)!==null&&a!==void 0?a:l.target;u&&(window.open(u,d),i=!0)}return i}}})}const l9=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,c9=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function KT(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function u9(t,e){let n=0,r=0;for(;r0}function GT(t,e,n){var r,s;const[,i,o]=e;return(e.index?t[e.index-1]:void 0)==="!"||KT(t,(r=e.index)!==null&&r!==void 0?r:0)||u9(t,(s=e.index)!==null&&s!==void 0?s:0)?!1:!!i.trim()&&n(o)}function qT(t){var e,n;const[r,s,i,,o,a,l]=t,u=(e=o??a)!==null&&e!==void 0?e:l;return{index:(n=t.index)!==null&&n!==void 0?n:0,text:r,replaceWith:s,data:{href:i,title:u||null,markdown:!0}}}function d9(t,e){return t.index{const r=l9.exec(n);return!r||!GT(n,r,t.isAllowedHref)?null:qT(r)},type:t.type,getAttributes:JT});return new Pl({find:e.find,handler:n=>{const r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function f9(t){const e=Qr({find:n=>{var r,s;const i=[];for(const a of n.matchAll(c9))GT(n,a,t.isAllowedHref)&&i.push(qT(a));const o=((r=(s=t.findPlainUrls)===null||s===void 0?void 0:s.call(t,n))!==null&&r!==void 0?r:[]).filter(a=>!i.some(l=>d9(l,a)));return[...i,...o]},type:t.type,getAttributes:JT});return new wT({find:e.find,handler:n=>{var r;const s=e.handler(n);return s!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),s}})}function p9(t){return new ve({key:new Fe("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:s}=t,{state:i}=e,{selection:o}=i,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const u=UT(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u||s!==void 0&&!s(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function Hn(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!t||t.replace(s9,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const YT=ls.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){gw(t);return}gw(t.scheme,t.optionalSlashes)})},onDestroy(){e9()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Hn(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const r=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){var t,e,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!==null&&t!==void 0?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(n=this.options.HTMLAttributes.class)!==null&&n!==void 0?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Hn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Hn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ze(this.options.HTMLAttributes,t),0]:["a",ze(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,s,i;const o=(n=(r=t.attrs)===null||r===void 0?void 0:r.href)!==null&&n!==void 0?n:"",a=(s=(i=t.attrs)===null||i===void 0?void 0:i.title)!==null&&s!==void 0?s:"",l=e.renderChildren(t);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Hn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Hn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[h9({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Hn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const n=[];if(e){const{protocols:r,defaultProtocol:s}=this.options;UT(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!Hn(o,r),protocols:r,defaultProtocol:s})).forEach(i=>{this.options.shouldAutoLink(i.value)&&n.push({text:i.value,data:{href:i.href},index:i.start})})}return n};return this.options.markdownLinks?[f9({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!Hn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Qr({find:t,type:this.type,getAttributes:e=>{var n;return{href:(n=e.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(o9({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!Hn(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(a9({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(p9({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),m9="listItem",xw="textStyle",yw=/^\s*([-+*])\s$/,XT=Ut.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(m9,this.editor.getAttributes(xw)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=oo({find:yw,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=oo({find:yw,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(xw),editor:this.editor})),[t]}}),g9=(t,e,n)=>{const{selection:r}=t;if(!r.empty)return null;const{$from:s}=r;if(!s.parent.isTextblock||s.parentOffset!==s.parent.content.size)return null;let i=-1;for(let p=s.depth;p>0;p-=1)if(s.node(p).type.name===e){i=p;break}if(i<0)return null;const o=s.node(i),a=s.index(i);if(a+1>=o.childCount)return null;const l=o.child(a+1);if(!n.includes(l.type.name))return null;const u=t.schema.nodes[e];let d=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(d=!0)}),!d)return null;const h=t.doc.resolve(s.after()).nodeAfter;if(!h||!n.includes(h.type.name))return null;const f=[];return h.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:i,nestedList:h,nestedListPos:s.after(),insertPos:s.after(i),items:f}},x9=(t,e,n,r)=>{const s=g9(t,n,r);if(!s)return!1;const{selection:i}=t,{nestedList:o,nestedListPos:a,insertPos:l,items:u}=s,d=t.tr;d.delete(a,a+o.nodeSize);const h=d.mapping.map(l);return d.insert(h,O.from(u)),d.setSelection(i.map(d.doc,d.mapping)),e&&e(d),!0},y9=(t,e,n)=>x9(t.state,t.view.dispatch,e,n),ZT=(t,e)=>fe.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>y9(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),QT=[[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"]],xc="abcdefghijklmnopqrstuvwxyz",e2=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function ph(t){let e=t,n="";for(const[r,s]of QT)for(;e>=r;)n+=s,e-=r;return n}function mx(t){return ph(t).toUpperCase()}function t2(t){const e=t.toLowerCase();let n=0,r=0;for(;n0?r:1}const n=parseInt(t,10);return Number.isNaN(n)?1:n}function k9(t,e){if(t==="numeric")return String(e);switch(t){case"a":return kd(e);case"A":return kd(e).toUpperCase();case"i":return ph(e);case"I":return mx(e);default:return String(e)}}function w9(t){var e;if(t.length===0)return!1;const n=(e=mh(t[0]))!==null&&e!==void 0?e:"numeric",r=gx(t[0]);if(r<1)return!1;for(let s=0;s{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren;let s=[];if(t.tokens&&t.tokens.length>0){if(j9(t))return{type:"listItem",content:[{type:"paragraph",content:E9(t.text||"",e)}]};if(t.tokens.some(i=>i.type==="paragraph"))s=r(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const o=r(t.tokens.slice(1));s.push(...o)}}else s=r(t.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,n)=>bT(t,e,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){var s,i;const o=((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.start)||1;return C9((i=r.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.type,o-1+(r.index||0),". ")}return"- "},n,{alignNestedToPrefix:(n==null?void 0:n.parentType)==="orderedList"}),addExtensions(){return[ZT(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),xx=(t,e)=>{const{$from:n}=e.selection,r=Ue(t,e.schema);let s=null,i=n.depth,o=n.pos,a=null;for(;i>0&&a===null;)s=n.node(i),s.type===r?a=i:(i-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},r2=(t,e)=>{const n=xx(t,e);if(!n)return!1;const[,r]=FF(e,t,n.$pos.pos+4);return r},T9=(t,e,n)=>{const{$anchor:r}=t.selection,s=Math.max(0,r.pos-2),i=t.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},bw=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!lr(t.state,e)&&T9(t.state,e,n)){const{$anchor:i}=t.state.selection,o=t.state.doc.resolve(i.before()-1),a=[];o.node().descendants((d,h)=>{d.type.name===e&&a.push({node:d,pos:h})});const l=a.at(-1);if(!l)return!1;const u=t.state.doc.resolve(o.start()+l.pos+1);return t.chain().cut({from:i.start()-1,to:i.end()+1},u.end()).joinForward().run()}if(!lr(t.state,e)||!UF(t.state))return!1;const{$from:r}=t.state.selection,s=r.depth-1;return r.node(s).type!==t.schema.nodes[e]||r.index(s)!==0?!1:t.chain().liftListItem(e).run()},M9=(t,e)=>{const n=r2(t,e),r=xx(t,e);return!r||!n?!1:n>r.depth},P9=(t,e)=>{const n=r2(t,e),r=xx(t,e);return!r||!n?!1:n{if(!lr(t.state,e)||!WF(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:M9(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():P9(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},A9=(t,e,n)=>{const{state:r}=t,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0||!i.parent.isTextblock||lr(r,e))return!1;const o=VF(i);if(!o||!n.includes(o.type.name))return!1;const a=o.lastChild;if(!a||a.type.name!==e)return!1;const l=i.parent;if(!a.canReplace(a.childCount,a.childCount,O.from(l)))return!1;const u=i.before(),d=i.after(),h=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,d).insert(h,O.from(l)),f.setSelection(Y.create(f.doc,h+1)),f.scrollIntoView()),!0))},s2=fe.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&vw(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&vw(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&bw(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&bw(t,n,r)&&(e=!0)}),e},Tab:({editor:t})=>{for(const{itemName:e,wrapperNames:n}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&A9(t,e,n))return!0;return!1}}}}),ig=new RegExp(`^(\\s*)(${e2})([.)])\\s+(.*)$`),D9=/^\s/,mi={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function L9(t){return ig.test(t.trimStart())}function R9(t){const e=t.trimStart();return mi.bulletItem.test(e)||L9(e)||mi.heading.test(e)||mi.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||mi.codeFence.test(e)||mi.blockMath.test(e)}function _9(t){return Object.values(mi).some(e=>e.test(t))}function I9(t){const e=[],n=[];let r=!1;return t.forEach(s=>{if(r){n.push(s);return}if(s.trim()===""){r=!0,n.push(s);return}if(e.length>0&&R9(s)){r=!0,n.push(s);return}e.push(s)}),{paragraphLines:e,blockLines:n}}function O9(t){const e=[];let n=0,r=0;for(;n{const s=e.some(l=>l.docChanged)&&!n.doc.eq(r.doc),i=e.some(l=>l.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,a=iT(n.doc,[...e]);if(uh(a).forEach(({newRange:l})=>{const u=PF(r.doc,l,f=>f.isTextblock);let d,h;if(u.length>1)d=u[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const f=r.doc.textBetween(l.from,l.to," "," ");if(!s9.test(f))return;d=u[0],h=r.doc.textBetween(d.pos,l.to,void 0," ")}if(d&&h){const f=h.split(r9).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=d.pos+h.lastIndexOf(p);if(!p)return!1;const g=fx(p).map(y=>y.toObject(t.defaultProtocol));if(!o9(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{rx(y.from,y.to,r.doc).some(b=>b.mark.type===t.type)||o.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function l9(t){return new ke({key:new Fe("handleClickLink"),props:{handleClick:(e,n,r)=>{if(r.button!==0||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{const l=r.target;if(!l)return!1;const u=t.editor.view.dom;s=l.closest("a"),s&&!u.contains(s)&&(s=null)}if(!s)return!1;let i=!1;if(t.enableClickSelection&&(i=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){var o,a;const l=dT(e.state,t.type.name),u=(o=s.href)!==null&&o!==void 0?o:l.href,d=(a=s.target)!==null&&a!==void 0?a:l.target;u&&(window.open(u,d),i=!0)}return i}}})}const c9=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,u9=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function GT(t,e){let n=0;for(let r=e-1;r>=0&&t[r]==="\\";r-=1)n+=1;return n%2===1}function d9(t,e){let n=0,r=0;for(;r0}function qT(t,e,n){var r,s;const[,i,o]=e;return(e.index?t[e.index-1]:void 0)==="!"||GT(t,(r=e.index)!==null&&r!==void 0?r:0)||d9(t,(s=e.index)!==null&&s!==void 0?s:0)?!1:!!i.trim()&&n(o)}function JT(t){var e,n;const[r,s,i,,o,a,l]=t,u=(e=o??a)!==null&&e!==void 0?e:l;return{index:(n=t.index)!==null&&n!==void 0?n:0,text:r,replaceWith:s,data:{href:i,title:u||null,markdown:!0}}}function h9(t,e){return t.index{const r=c9.exec(n);return!r||!qT(n,r,t.isAllowedHref)?null:JT(r)},type:t.type,getAttributes:YT});return new Pl({find:e.find,handler:n=>{const r=e.handler(n);return r!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),r}})}function p9(t){const e=Qr({find:n=>{var r,s;const i=[];for(const a of n.matchAll(u9))qT(n,a,t.isAllowedHref)&&i.push(JT(a));const o=((r=(s=t.findPlainUrls)===null||s===void 0?void 0:s.call(t,n))!==null&&r!==void 0?r:[]).filter(a=>!i.some(l=>h9(l,a)));return[...i,...o]},type:t.type,getAttributes:YT});return new ST({find:e.find,handler:n=>{var r;const s=e.handler(n);return s!==null&&n.state.tr.steps.length&&(!((r=n.match.data)===null||r===void 0)&&r.markdown)&&n.state.tr.setMeta("preventAutolink",!0),s}})}function m9(t){return new ke({key:new Fe("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{shouldAutoLink:s}=t,{state:i}=e,{selection:o}=i,{empty:a}=o;if(a)return!1;let l="";r.content.forEach(d=>{l+=d.textContent});const u=KT(l,{defaultProtocol:t.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!u||s!==void 0&&!s(u.value)?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}function Hn(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&n.push(s)}),!t||t.replace(i9,"").match(new RegExp(`^(?:(?:${n.map(r=>r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}const XT=ls.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){xw(t);return}xw(t.scheme,t.optionalSlashes)})},onDestroy(){t9()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Hn(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),n=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||n&&!t.includes("@"))return!0;const r=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){var t,e,n;return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:(t=this.options.HTMLAttributes.target)!==null&&t!==void 0?t:null},rel:{default:(e=this.options.HTMLAttributes.rel)!==null&&e!==void 0?e:null},class:{default:(n=this.options.HTMLAttributes.class)!==null&&n!==void 0?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!Hn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Hn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",ze(this.options.HTMLAttributes,t),0]:["a",ze(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n,r,s,i;const o=(n=(r=t.attrs)===null||r===void 0?void 0:r.href)!==null&&n!==void 0?n:"",a=(s=(i=t.attrs)===null||i===void 0?void 0:i.title)!==null&&s!==void 0?s:"",l=e.renderChildren(t);return a?`[${l}](${o} "${a}")`:`[${l}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Hn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Hn(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[f9({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:e=>!!Hn(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){const t=e=>{const n=[];if(e){const{protocols:r,defaultProtocol:s}=this.options;KT(e).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!Hn(o,r),protocols:r,defaultProtocol:s})).forEach(i=>{this.options.shouldAutoLink(i.value)&&n.push({text:i.value,data:{href:i.href},index:i.start})})}return n};return this.options.markdownLinks?[p9({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:n=>!!Hn(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:t})]:[Qr({find:t,type:this.type,getAttributes:e=>{var n;return{href:(n=e.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(a9({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!Hn(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),t.push(l9({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(m9({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),g9="listItem",yw="textStyle",bw=/^\s*([-+*])\s$/,ZT=Ut.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(g9,this.editor.getAttributes(yw)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=oo({find:bw,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=oo({find:bw,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(yw),editor:this.editor})),[t]}}),x9=(t,e,n)=>{const{selection:r}=t;if(!r.empty)return null;const{$from:s}=r;if(!s.parent.isTextblock||s.parentOffset!==s.parent.content.size)return null;let i=-1;for(let p=s.depth;p>0;p-=1)if(s.node(p).type.name===e){i=p;break}if(i<0)return null;const o=s.node(i),a=s.index(i);if(a+1>=o.childCount)return null;const l=o.child(a+1);if(!n.includes(l.type.name))return null;const u=t.schema.nodes[e];let d=!1;if(l.forEach(p=>{p.type===u&&p.childCount>1&&(d=!0)}),!d)return null;const h=t.doc.resolve(s.after()).nodeAfter;if(!h||!n.includes(h.type.name))return null;const f=[];return h.forEach(p=>{f.push(p)}),f.length===0?null:{listItemDepth:i,nestedList:h,nestedListPos:s.after(),insertPos:s.after(i),items:f}},y9=(t,e,n,r)=>{const s=x9(t,n,r);if(!s)return!1;const{selection:i}=t,{nestedList:o,nestedListPos:a,insertPos:l,items:u}=s,d=t.tr;d.delete(a,a+o.nodeSize);const h=d.mapping.map(l);return d.insert(h,O.from(u)),d.setSelection(i.map(d.doc,d.mapping)),e&&e(d),!0},b9=(t,e,n)=>y9(t.state,t.view.dispatch,e,n),QT=(t,e)=>fe.create({name:`${t}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const n=()=>b9(this.editor,t,e);return{Delete:n,"Mod-Delete":n}}}),e2=[[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"]],xc="abcdefghijklmnopqrstuvwxyz",t2=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function ph(t){let e=t,n="";for(const[r,s]of e2)for(;e>=r;)n+=s,e-=r;return n}function mx(t){return ph(t).toUpperCase()}function n2(t){const e=t.toLowerCase();let n=0,r=0;for(;n0?r:1}const n=parseInt(t,10);return Number.isNaN(n)?1:n}function w9(t,e){if(t==="numeric")return String(e);switch(t){case"a":return kd(e);case"A":return kd(e).toUpperCase();case"i":return ph(e);case"I":return mx(e);default:return String(e)}}function S9(t){var e;if(t.length===0)return!1;const n=(e=mh(t[0]))!==null&&e!==void 0?e:"numeric",r=gx(t[0]);if(r<1)return!1;for(let s=0;s{var n;if(t.type!=="list_item")return[];const r=(n=e.parseBlockChildren)!==null&&n!==void 0?n:e.parseChildren;let s=[];if(t.tokens&&t.tokens.length>0){if(E9(t))return{type:"listItem",content:[{type:"paragraph",content:T9(t.text||"",e)}]};if(t.tokens.some(i=>i.type==="paragraph"))s=r(t.tokens);else{const i=t.tokens[0];if(i&&i.type==="text"&&i.tokens&&i.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(i.tokens)}],t.tokens.length>1){const o=r(t.tokens.slice(1));s.push(...o)}}else s=r(t.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,n)=>vT(t,e,r=>{if(r.parentType==="bulletList")return"- ";if(r.parentType==="orderedList"){var s,i;const o=((s=r.meta)===null||s===void 0||(s=s.parentAttrs)===null||s===void 0?void 0:s.start)||1;return j9((i=r.meta)===null||i===void 0||(i=i.parentAttrs)===null||i===void 0?void 0:i.type,o-1+(r.index||0),". ")}return"- "},n,{alignNestedToPrefix:(n==null?void 0:n.parentType)==="orderedList"}),addExtensions(){return[QT(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),xx=(t,e)=>{const{$from:n}=e.selection,r=Ue(t,e.schema);let s=null,i=n.depth,o=n.pos,a=null;for(;i>0&&a===null;)s=n.node(i),s.type===r?a=i:(i-=1,o-=1);return a===null?null:{$pos:e.doc.resolve(o),depth:a}},s2=(t,e)=>{const n=xx(t,e);if(!n)return!1;const[,r]=VF(e,t,n.$pos.pos+4);return r},M9=(t,e,n)=>{const{$anchor:r}=t.selection,s=Math.max(0,r.pos-2),i=t.doc.resolve(s).node();return!(!i||!n.includes(i.type.name))},vw=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!lr(t.state,e)&&M9(t.state,e,n)){const{$anchor:i}=t.state.selection,o=t.state.doc.resolve(i.before()-1),a=[];o.node().descendants((d,h)=>{d.type.name===e&&a.push({node:d,pos:h})});const l=a.at(-1);if(!l)return!1;const u=t.state.doc.resolve(o.start()+l.pos+1);return t.chain().cut({from:i.start()-1,to:i.end()+1},u.end()).joinForward().run()}if(!lr(t.state,e)||!KF(t.state))return!1;const{$from:r}=t.state.selection,s=r.depth-1;return r.node(s).type!==t.schema.nodes[e]||r.index(s)!==0?!1:t.chain().liftListItem(e).run()},P9=(t,e)=>{const n=s2(t,e),r=xx(t,e);return!r||!n?!1:n>r.depth},A9=(t,e)=>{const n=s2(t,e),r=xx(t,e);return!r||!n?!1:n{if(!lr(t.state,e)||!UF(t.state,e))return!1;const{selection:n}=t.state,{$from:r,$to:s}=n;return!n.empty&&r.sameParent(s)?!1:P9(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():A9(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},D9=(t,e,n)=>{const{state:r}=t,{selection:s}=r;if(!s.empty)return!1;const{$from:i}=s;if(i.parentOffset!==0||!i.parent.isTextblock||lr(r,e))return!1;const o=$F(i);if(!o||!n.includes(o.type.name))return!1;const a=o.lastChild;if(!a||a.type.name!==e)return!1;const l=i.parent;if(!a.canReplace(a.childCount,a.childCount,O.from(l)))return!1;const u=i.before(),d=i.after(),h=u-2;return t.commands.command(({tr:f,dispatch:p})=>(p&&(f.delete(u,d).insert(h,O.from(l)),f.setSelection(Y.create(f.doc,h+1)),f.scrollIntoView()),!0))},i2=fe.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&kw(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&kw(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&vw(t,n,r)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{t.state.schema.nodes[n]!==void 0&&vw(t,n,r)&&(e=!0)}),e},Tab:({editor:t})=>{for(const{itemName:e,wrapperNames:n}of this.options.listTypes)if(t.state.schema.nodes[e]!==void 0&&D9(t,e,n))return!0;return!1}}}}),ig=new RegExp(`^(\\s*)(${t2})([.)])\\s+(.*)$`),L9=/^\s/,mi={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function R9(t){return ig.test(t.trimStart())}function _9(t){const e=t.trimStart();return mi.bulletItem.test(e)||R9(e)||mi.heading.test(e)||mi.thematicBreak.test(e)&&!e.startsWith("-")||/^>\s?/.test(e)||mi.codeFence.test(e)||mi.blockMath.test(e)}function I9(t){return Object.values(mi).some(e=>e.test(t))}function O9(t){const e=[],n=[];let r=!1;return t.forEach(s=>{if(r){n.push(s);return}if(s.trim()===""){r=!0,n.push(s);return}if(e.length>0&&_9(s)){r=!0,n.push(s);return}e.push(s)}),{paragraphLines:e,blockLines:n}}function B9(t){const e=[];let n=0,r=0;for(;nr.trim().length>0);if(e.length===0)return null;const n=[];for(const r of e){const s=r.trim().match(B9);if(!s)return null;n.push({marker:s[1],content:s[3]})}return w9(n.map(r=>r.marker))?{type:"orderedList",attrs:N9(n[0].marker),content:n.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function i2(t,e,n){const r=[];let s=0;for(;sr.trim().length>0);if(e.length===0)return null;const n=[];for(const r of e){const s=r.trim().match(z9);if(!s)return null;n.push({marker:s[1],content:s[3]})}return S9(n.map(r=>r.marker))?{type:"orderedList",attrs:C9(n[0].marker),content:n.map(r=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:r.content}]}]}))}:null}function o2(t,e,n){const r=[];let s=0;for(;se;)f.push(t[h]),h+=1;if(f.length>0){const p=i2(f,Math.min(...f.map(m=>m.indent)),n);u.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(m=>m.raw).join(` -`)})}r.push({type:"list_item",raw:i.raw,tokens:u}),s=h}else s+=1}return r}function F9(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}const V9="listItem",kw="textStyle",ww=/^(\d+)\.\s$/;function Sw(t){const 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}}const o2=Ut.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=>{const e=t.getAttribute("type");if(e)return e;const n=t.getAttribute("style");if(n){const s=Sw(n);if(s)return s}const r=t.querySelector("li");if(r){const s=r.getAttribute("style");if(s){const i=Sw(s);if(i)return i}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:n,...r}=t,s=ze(this.options.HTMLAttributes,r);return e!==1&&(s.start=e),n&&n!=="1"&&(s.type=n),["ol",s,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.typeMarker,s=t.items?F9(t.items,e):[],i={};return n!==1&&(i.start=n),r&&(i.type=r),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:s}:{type:"orderedList",content:s}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`).trim();if(d){const p=n.blockTokens(d);u.push(...p)}let h=s+1;const f=[];for(;he;)f.push(t[h]),h+=1;if(f.length>0){const p=o2(f,Math.min(...f.map(m=>m.indent)),n);u.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:p,raw:f.map(m=>m.raw).join(` +`)})}r.push({type:"list_item",raw:i.raw,tokens:u}),s=h}else s+=1}return r}function V9(t,e){return t.map(n=>{if(n.type!=="list_item")return e.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}const $9="listItem",ww="textStyle",Sw=/^(\d+)\.\s$/;function Nw(t){const 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}}const a2=Ut.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=>{const e=t.getAttribute("type");if(e)return e;const n=t.getAttribute("style");if(n){const s=Nw(n);if(s)return s}const r=t.querySelector("li");if(r){const s=r.getAttribute("style");if(s){const i=Nw(s);if(i)return i}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,type:n,...r}=t,s=ze(this.options.HTMLAttributes,r);return e!==1&&(s.start=e),n&&n!=="1"&&(s.type=n),["ol",s,0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,r=t.typeMarker,s=t.items?V9(t.items,e):[],i={};return n!==1&&(i.start=n),r&&(i.type=r),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:s}:{type:"orderedList",content:s}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` `):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(t,e,n)=>{var r,s;const i=t.split(` -`),[o,a]=O9(i);if(o.length===0)return;const l=i2(o,o[0].indent,n);if(l.length!==0)return{type:"list",ordered:!0,start:((r=o[0])===null||r===void 0?void 0:r.number)||1,typeMarker:(s=o[0])===null||s===void 0?void 0:s.type,items:l,raw:i.slice(0,a).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(V9,this.editor.getAttributes(kw)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new ve({props:{handlePaste:(t,e)=>{var n,r;const s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(s!=null&&s.trim())return!1;const i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i)return!1;const o=z9(i);if(!o)return!1;try{const a=t.state.schema.nodeFromJSON(o),l=t.state.tr.replaceSelectionWith(a);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let e=oo({find:ww,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=oo({find:ww,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(kw)}),joinPredicate:t,editor:this.editor})),[e]}}),$9=/^\s*(\[([( |x])?\])\s$/,H9="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",W9=(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"}`},U9=Ut.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=>{const 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",ze(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const 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){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const r=`- [${!((n=t.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return bT(t,e,r)},addExtensions(){return this.options.nested?[ZT(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const 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})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");o.style.cssText=H9;const u=h=>{const f=W9(h,h.attrs.checked,this.options.a11y);a.setAttribute("aria-label",f),o.textContent=f};u(t),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=n();if(typeof m!="number")return!1;const g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,f])=>{s.setAttribute(h,f)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,o),s.append(i,l),Object.entries(e).forEach(([h,f])=>{s.setAttribute(h,f)});let d=new Set(Object.keys(e));return{dom:s,contentDOM:l,update:h=>{if(h.type!==this.type)return!1;s.dataset.checked=h.attrs.checked,a.checked=h.attrs.checked,u(h);const f=r.extensionManager.attributes,p=ol(h,f),m=new Set(Object.keys(p)),g=this.options.HTMLAttributes;return d.forEach(y=>{m.has(y)||(y in g?s.setAttribute(y,g[y]):s.removeAttribute(y))}),Object.entries(p).forEach(([y,b])=>{b==null?y in g?s.setAttribute(y,g[y]):s.removeAttribute(y):s.setAttribute(y,b)}),d=m,!0}}}},addInputRules(){return[oo({find:$9,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),K9=Ut.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ze(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` -`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const 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){const r=i=>{const o=Qk(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(o){const a={type:"taskList",raw:o.raw,items:o.items},l=i.slice(o.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(i)},s=Qk(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.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()}}});fe.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(XT.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(n2.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(s2.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(o2.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(U9.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(K9.configure(this.options.taskList)),t}});const yc=" ",Ff=" ",G9=Ut.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ze(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===yc||n[0].text===yc||n[0].raw===Ff||n[0].text===Ff)&&r.length===1&&r[0].type==="text"&&(r[0].text===yc||r[0].text===Ff)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{if(!t)return"";const r=Array.isArray(t.content)?t.content:[];if(r.length===0){var s,i;const o=Array.isArray(n==null||(s=n.previousNode)===null||s===void 0?void 0:s.content)?n.previousNode.content:[];return(n==null||(i=n.previousNode)===null||i===void 0?void 0:i.type)==="paragraph"&&o.length===0?yc:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),q9=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,J9=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Y9=ls.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ys({find:q9,type:this.type})]},addPasteRules(){return[Qr({find:J9,type:this.type})]}}),X9=Ut.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),a2=ls.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",ze(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){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:n.inlineTokens(s)}}},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.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Z9(t={}){return new ve({view(e){return new Q9(e,t)}})}class Q9{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){if(this.cursorPos!=null&&n.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let h=e.nodeBefore,f=e.nodeAfter;if(h||f){let p=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=h?m.bottom:m.top;h&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:m.left,right:m.right,top:g-y,bottom:g+y}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:h.left-f,right:h.left+f,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),f=h.width/l.offsetWidth,p=h.height/l.offsetHeight;u=h.left-l.scrollLeft*f,d=h.top-l.scrollTop*p}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(!n||i)return null;let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Hj(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let n=this.computeTarget(e);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Le extends ne{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Le.valid(r)?new Le(r):ne.near(r)}content(){return H.empty}eq(e){return e instanceof Le&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Le(e.resolve(n.pos))}getBookmark(){return new yx(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!eH(e)||!tH(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Le.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)0){i=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let l=e.doc.resolve(s);if(Le.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!J.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let a=e.doc.resolve(s);if(Le.valid(a))return a}return null}}}Le.prototype.visible=!1;Le.findFrom=Le.findGapCursorFrom;ne.jsonID("gapcursor",Le);class yx{constructor(e){this.pos=e}map(e){return new yx(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Le.valid(n)?new Le(n):ne.near(n)}}function l2(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function eH(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||l2(s.type))return!0;if(s.inlineContent)return!1}}return!0}function tH(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||l2(s.type))return!0;if(s.inlineContent)return!1}}return!0}function nH(){return new ve({props:{decorations:oH,createSelectionBetween(t,e,n){return e.pos==n.pos&&Le.valid(n)?new Le(n):null},handleClick:sH,handleKeyDown:rH,handleDOMEvents:{beforeinput:iH}}})}const rH=GE({ArrowLeft:bc("horiz",-1),ArrowRight:bc("horiz",1),ArrowUp:bc("vert",-1),ArrowDown:bc("vert",1)});function bc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Y){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Le.findGapCursorFrom(a,e,l);return u?(s&&s(r.tr.setSelection(new Le(u))),!0):!1}}function sH(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Le.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&J.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Le(r))),!0)}function iH(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Le))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let s=O.empty;for(let o=r.length-1;o>=0;o--)s=O.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new H(s,0,0));return i.setSelection(Y.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function oH(t){if(!(t.selection instanceof Le))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ce.create(t.doc,[vt.widget(t.selection.head,e,{key:"gapcursor"})])}var wd=200,Xe=function(){};Xe.prototype.append=function(e){return e.length?(e=Xe.from(e),!this.length&&e||e.length=n?Xe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Xe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Xe.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Xe.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},n,r),s};Xe.from=function(e){return e instanceof Xe?e:e&&e.length?new c2(e):Xe.empty};var c2=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,a){for(var l=i;l=o;l--)if(s(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=wd)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=wd)return new e(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Xe);Xe.empty=new c2([]);var aH=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(s-a,0),Math.min(this.length,i)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var a=this.left.length;if(s>a&&this.right.forEachInvertedInner(r,s-a,Math.max(i,a)-a,o+a)===!1||i=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Xe);const lH=500;class gn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,a,l,u=[],d=[];return this.items.forEach((h,f)=>{if(!h.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,d.push(h);return}if(s){d.push(new An(h.map));let p=h.step.map(s.slice(i)),m;p&&o.maybeStep(p).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],u.push(new An(m,void 0,void 0,u.length+d.length))),i--,m&&s.appendMap(m,i)}else o.maybeStep(h.step);if(h.selection)return a=s?h.selection.map(s.slice(i)):h.selection,l=new gn(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,s){let i=[],o=this.eventCount,a=this.items,l=!s&&a.length?a.get(a.length-1):null;for(let d=0;duH&&(a=cH(a,u),o-=u),new gn(a.append(i),o)}remapping(e,n){let r=new tl;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new gn(this.items.append(e.map(n=>new An(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},s);let l=n;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;o=Math.min(o,p);let m=i.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(i.slice(l+1,p));y&&a++,r.push(new An(m,g,y))}else r.push(new An(m))},s);let u=[];for(let f=n;flH&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,a)=>{if(a>=e)s.push(o),o.selection&&i++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&i++;let h=new An(u.invert(),l,d),f,p=s.length-1;(f=s.length&&s[p].merge(h))?s[p]=f:s.push(h)}}else o.map&&r--},this.items.length,0),new gn(Xe.from(s.reverse()),i)}}gn.empty=new gn(Xe.empty,0);function cH(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class An{constructor(e,n,r,s){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new An(n.getMap().invert(),n,this.selection)}}}class wr{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const uH=20;function dH(t,e,n,r){let s=n.getMeta(Vs),i;if(s)return s.historyState;n.getMeta(pH)&&(t=new wr(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Vs))return o.getMeta(Vs).redo?new wr(t.done.addTransform(n,void 0,r,Yc(e)),t.undone,Nw(n.mapping.maps),t.prevTime,t.prevComposition):new wr(t.done,t.undone.addTransform(n,void 0,r,Yc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!hH(n,t.prevRanges)),u=o?Vf(t.prevRanges,n.mapping):Nw(n.mapping.maps);return new wr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Yc(e)),gn.empty,u,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new wr(t.done.rebased(n,i),t.undone.rebased(n,i),Vf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new wr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Vf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function hH(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,s)=>{for(let i=0;i=e[i]&&(n=!0)}),n}function Nw(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,s,i,o)=>e.push(i,o));return e}function Vf(t,e){if(!t)return null;let n=[];for(let r=0;r{let s=Vs.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=fH(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const d2=u2(!1,!0),h2=u2(!0,!0);fe.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new ve({key:new Fe("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const a=o-s,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,u);return t=!0,d}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,a=o-(i-r),l=o;return e.deleteRange(a,l),!(this.storage.characters({node:e.doc})>r)}})]}});const gH=fe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Z9(this.options)]}});fe.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new ve({key:new Fe("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return ce.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(!l.isText){if(!(s>=u&&s<=u+l.nodeSize-1))return!1;o+=1}});let a=0;return t.descendants((l,u)=>{if(l.isText||!(s>=u&&s<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(vt.node(u,u+l.nodeSize,{class:this.options.className}))}),ce.create(t,i)}}})]}});const xH=fe.create({name:"gapCursor",addProseMirrorPlugins(){return[nH()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ue(q(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),f2="placeholder",jw=new Fe("tiptap__placeholder");function p2(t){const{editor:e,placeholder:n,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:a,classes:{emptyNode:l,emptyEditor:u}}=t,d=[l];return o&&d.push(u),vt.node(s,s+i.nodeSize,{class:d.join(" "),[r]:typeof n=="function"?n({editor:e,node:i,pos:s,hasAnchor:a}):n})}function m2(t,e){return typeof t=="function"?t(e):t}function g2({editor:t,options:e,dataAttribute:n,doc:r,selection:s,from:i,to:o}){const{anchor:a}=s,l=[],u=t.isEmpty;return r.nodesBetween(i,o,(d,h)=>{const f=a>=h&&a<=h+d.nodeSize,p=!d.isLeaf&&Tl(d);return d.type.isTextblock&&(f||!e.showOnlyCurrent)&&p&&l.push(p2({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:m2(e.emptyNodeClass,{editor:t,node:d,pos:h,hasAnchor:f})},node:d,pos:h})),e.includeChildren}),l}function x2({editor:t,options:e,dataAttribute:n,doc:r,selection:s}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:i}=s,o=[],a=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const l=r.resolve(i),u=l.depth>0?l.node(1):l.nodeAfter,d=l.depth>0?l.before(1):i;if(u&&u.type.isTextblock&&Tl(u)){const h=i>=d&&i<=d+u.nodeSize;o.push(p2({editor:t,isEmptyDoc:a,dataAttribute:n,hasAnchor:h,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:m2(e.emptyNodeClass,{editor:t,node:u,pos:d,hasAnchor:h})},node:u,pos:d}))}}else o.push(...g2({editor:t,options:e,dataAttribute:n,doc:r,selection:s,from:0,to:r.content.size}));return ce.create(r,o)}function Sa(t,e){const n=t.resolve(e);if(n.depth===0){var r;const i=(r=n.nodeAfter)!==null&&r!==void 0?r:n.nodeBefore;if(!i)return{from:e,to:e};const o=n.nodeAfter?e:e-i.nodeSize;return{from:o,to:o+i.nodeSize}}const s=n.before(1);return{from:s,to:s+n.node(1).nodeSize}}function Na(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function yH(t,e,n){const r=[];return t.forEach((s,i)=>{const o=i,a=o+s.nodeSize,l=o+1,u=a+1;le&&r.push({from:o,to:a})}),r}function bH(t){if(t.length===0)return[];const e=[...t].sort((r,s)=>r.from-s.from),n=[{...e[0]}];for(let r=1;re.from?n.push(Na(t,Sa(t,Math.min(e.to,t.content.size+1)-1))):e.fromp.from>=u&&p.to<=d);h.length&&(a=a.remove(h));const f=g2({editor:n,options:r,dataAttribute:s,doc:i,selection:o,from:u,to:d});f.length&&(a=a.add(i,f))}return a}function NH({editor:t,options:e,dataAttribute:n}){return{init(r,s){const i=x2({editor:t,options:e,dataAttribute:n,doc:s.doc,selection:s.selection});return i??ce.empty},apply(r,s,i,o){return!r.docChanged&&!r.selectionSet?s:SH({decorations:s.map(r.mapping,r.doc),ranges:kH(r,i,o),editor:t,options:e,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function CH(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function jH({editor:t,options:e}){const n=e.dataAttribute?`data-${CH(e.dataAttribute)}`:`data-${f2}`,r=e.showOnlyCurrent&&!e.includeChildren;return new ve({key:jw,...r?{}:{state:NH({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:s,selection:i})=>x2({editor:t,options:e,dataAttribute:n,doc:s,selection:i}):s=>{var i;return e.showOnlyWhenEditable&&!t.isEditable?ce.empty:(i=jw.getState(s))!==null&&i!==void 0?i:ce.empty}}})}fe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:f2,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[jH({editor:this.editor,options:this.options})]}});function og(t,e){return!t.selection.empty&&!dT(t.selection)&&e.isEditable}function EH(t,e){return og(t,e)&&!e.isFocused&&!e.view.dragging}function TH(){var t;(t=window.getSelection())===null||t===void 0||t.removeAllRanges()}function MH(t){t.focus()}fe.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new ve({key:new Fe("selection"),props:{decorations(n){return EH(n,t)?ce.create(n.doc,[vt.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return og(n.state,t)&&TH(),!1},focus(n){return og(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&MH(n)}),!1}}}})]}});function Ew({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}const PH=fe.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Fe(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)===null||t===void 0?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new ve({key:e,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:u}=o,d=e.getState(o),h=a.content.size,f=u.nodes[n];if(!s.some(p=>p.getMeta("skipTrailingNode"))&&d)return l.insert(h,f.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!Ew({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!Ew({node:o,types:r})}}})]}}),AH=fe.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>d2(t,e),redo:()=>({state:t,dispatch:e})=>h2(t,e)}},addProseMirrorPlugins(){return[mH(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),DH=fe.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(w$.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(x$.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(XT.configure(this.options.bulletList)),this.options.code!==!1&&t.push(C$.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(T$.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(M$.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(gH.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(xH.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(P$.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(A$.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(AH.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(D$.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(O$.configure(this.options.italic)),this.options.listItem!==!1&&t.push(n2.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(s2.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var n;t.push(YT.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&t.push(o2.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(G9.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(Y9.configure(this.options.strike)),this.options.text!==!1&&t.push(X9.configure(this.options.text)),this.options.underline!==!1){var r;t.push(a2.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var s;t.push(PH.configure((s=this.options)===null||s===void 0?void 0:s.trailingNode))}return t}}),LH=20,y2=(t,e=0)=>{const n=[];return!t.children.length||e>LH||Array.from(t.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(...y2(r,e+1))}),n},RH=t=>{if(!t.children.length)return;const e=y2(t);e&&e.forEach(n=>{var r;const s=n.getAttribute("style"),i=(r=n.parentElement)===null||r===void 0||(r=r.closest("span"))===null||r===void 0?void 0:r.getAttribute("style");n.setAttribute("style",`${i};${s}`)})},b2=ls.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&RH(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ze(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(!n.isInline)return!0;n.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(i=>!!i))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),_H=fe.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const n=(e=Ml(t,"background-color"))!==null&&e!==void 0?e:t.style.backgroundColor;return n==null?void 0:n.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),IH=fe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const n=(e=Ml(t,"color"))!==null&&e!==void 0?e:t.style.color;return n==null?void 0:n.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),v2=fe.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>{var e;return(e=Ml(t,"font-family"))!==null&&e!==void 0?e:t.style.fontFamily},renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),OH=fe.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>{var e;return(e=Ml(t,"font-size"))!==null&&e!==void 0?e:t.style.fontSize},renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),BH=fe.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>{var e;return(e=Ml(t,"line-height"))!==null&&e!==void 0?e:t.style.lineHeight},renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});fe.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(_H.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(IH.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(v2.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(OH.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(BH.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(b2.configure(this.options.textStyle)),t}});const zH=[{label:"Systemschrift",value:""},{label:"Serifenlos (Arial)",value:"Arial, Helvetica, sans-serif"},{label:"Serif (Georgia)",value:'Georgia, "Times New Roman", serif'},{label:"Klassisch (Times New Roman)",value:'"Times New Roman", Times, serif'},{label:"Modern (Verdana)",value:"Verdana, Geneva, sans-serif"},{label:"Schreibmaschine (Courier New)",value:'"Courier New", Courier, monospace'}];function pr({active:t,onClick:e,title:n,children:r}){return c.jsx("button",{type:"button",onClick:e,title:n,className:`rounded px-2 py-1 text-sm font-semibold ${t?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:r})}function Sd({value:t,onChange:e,label:n}){const r=u$({extensions:[DH,a2,b2,v2,YT.configure({openOnClick:!1})],content:t||"",onUpdate:({editor:o})=>e(o.getHTML()),editorProps:{attributes:{class:"rte-content min-h-[10rem] px-3 py-2 text-sm text-neutral-800 focus:outline-none dark:text-neutral-100"}}});if(v.useEffect(()=>{if(!r)return;const o=t||"";o!==r.getHTML()&&r.commands.setContent(o)},[t,r]),!r)return null;const s=r.getAttributes("textStyle").fontFamily||"",i=()=>{const o=r.getAttributes("link").href||"",a=window.prompt("Link-Ziel (URL):",o);if(a!==null){if(a===""){r.chain().focus().extendMarkRange("link").unsetLink().run();return}r.chain().focus().extendMarkRange("link").setLink({href:a}).run()}};return c.jsxs("div",{children:[n&&c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:n}),c.jsxs("div",{className:"overflow-hidden rounded-md border border-neutral-300 dark:border-neutral-700",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-neutral-200 bg-neutral-50 px-2 py-1.5 dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx(pr,{active:r.isActive("bold"),onClick:()=>r.chain().focus().toggleBold().run(),title:"Fett",children:"F"}),c.jsx(pr,{active:r.isActive("italic"),onClick:()=>r.chain().focus().toggleItalic().run(),title:"Kursiv",children:c.jsx("span",{className:"italic",children:"K"})}),c.jsx(pr,{active:r.isActive("underline"),onClick:()=>r.chain().focus().toggleUnderline().run(),title:"Unterstrichen",children:c.jsx("span",{className:"underline",children:"U"})}),c.jsx(pr,{active:r.isActive("code"),onClick:()=>r.chain().focus().toggleCode().run(),title:"Code (Inline)",children:c.jsx("span",{className:"font-mono",children:""})}),c.jsx("span",{className:"mx-1 h-5 w-px bg-neutral-300 dark:bg-neutral-600"}),c.jsx(pr,{active:r.isActive("heading",{level:2}),onClick:()=>r.chain().focus().toggleHeading({level:2}).run(),title:"Überschrift",children:"H2"}),c.jsx("span",{className:"mx-1 h-5 w-px bg-neutral-300 dark:bg-neutral-600"}),c.jsx(pr,{active:r.isActive("bulletList"),onClick:()=>r.chain().focus().toggleBulletList().run(),title:"Aufzählung",children:"•≡"}),c.jsx(pr,{active:r.isActive("orderedList"),onClick:()=>r.chain().focus().toggleOrderedList().run(),title:"Nummerierte Liste",children:"1≡"}),c.jsx("span",{className:"mx-1 h-5 w-px bg-neutral-300 dark:bg-neutral-600"}),c.jsx(pr,{active:r.isActive("link"),onClick:i,title:"Link setzen/entfernen",children:"🔗"}),c.jsx("span",{className:"mx-1 h-5 w-px bg-neutral-300 dark:bg-neutral-600"}),c.jsx("select",{value:s,onChange:o=>{const a=o.target.value;a===""?r.chain().focus().unsetFontFamily().run():r.chain().focus().setFontFamily(a).run()},className:"rounded border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:zH.map(o=>c.jsx("option",{value:o.value,children:o.label},o.label))})]}),c.jsx(TT,{editor:r,className:"bg-white dark:bg-neutral-950"})]})]})}const Tw=[{slug:"hero",label:"Hero (ganz oben)"},{slug:"youtube",label:"YouTube-Sektion"},{slug:"craft",label:"Handwerk"},{slug:"advice",label:"Beratung"},{slug:"insights",label:"Einblicke (Bildergalerie-Intro)"},{slug:"more",label:"Mehr als Car-Hifi"}],FH=["hero","youtube"],VH=[{value:"left",label:"Links"},{value:"center",label:"Mittig"},{value:"right",label:"Rechts"}],$H={left:"text-left",center:"text-center",right:"text-right"};function HH(t){const e=document.createElement("div");return e.innerHTML=t||"",e.textContent||""}function WH(){var $;const[t,e]=v.useState(null),[n,r]=v.useState("hero"),[s,i]=v.useState("de"),[o,a]=v.useState(!1),[l,u]=v.useState(""),[d,h]=v.useState(!1),[f,p]=v.useState(""),m=v.useRef(null),[g,y]=v.useState(!1);if(v.useEffect(()=>{A.get("/home-sections").then(e),A.get("/site-settings").then(L=>p(L.hero_image_path||""))},[]),!t)return c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const b=t[n],x=FH.includes(n),k=(L,W)=>{e(B=>({...B,[n]:{...B[n],[L]:W}})),h(!1)},w=(L,W)=>{e(B=>({...B,[n]:{...B[n],text_align_x:L,text_align_y:W}})),h(!1)},C=(L,W)=>{const B=m.current.getBoundingClientRect();return{x:Math.max(0,Math.min(100,Math.round((L-B.left)/B.width*100))),y:Math.max(0,Math.min(100,Math.round((W-B.top)/B.height*100)))}},E=L=>{L.preventDefault(),L.currentTarget.setPointerCapture(L.pointerId),y(!0);const{x:W,y:B}=C(L.clientX,L.clientY);w(W,B)},S=L=>{if(!g)return;const{x:W,y:B}=C(L.clientX,L.clientY);w(W,B)},N=L=>{y(!1),L.currentTarget.releasePointerCapture(L.pointerId)},M=async()=>{a(!0),u(""),h(!1);try{await A.put(`/home-sections/${n}`,b),h(!0)}catch(L){u(L.message)}finally{a(!1)}},j=b[`eyebrow_${s}`]||"",T=b[`title_${s}`]||(($=Tw.find(L=>L.slug===n))==null?void 0:$.label)||"",R=HH(b[`body_html_${s}`]);return c.jsxs("div",{className:"max-w-3xl space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Startseite"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Text, Position/Ausrichtung und (falls vorhanden) Button-Ziel der wichtigsten Textabschnitte auf der Startseite. Bilder, Statistik-Kacheln, Marken-Streifen, Bewertungen und FAQ werden an anderer Stelle verwaltet."})]}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:Tw.map(L=>c.jsx("button",{type:"button",onClick:()=>{r(L.slug),h(!1),u("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${n===L.slug?"bg-brand-500 text-white":"border border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:L.label},L.slug))}),c.jsx("div",{className:"mb-4 flex gap-1 border-b border-neutral-200 pb-4 dark:border-neutral-800",children:[["de","Deutsch"],["en","English"]].map(([L,W])=>c.jsx("button",{type:"button",onClick:()=>i(L),className:`rounded-md px-3 py-1 text-sm font-medium transition ${s===L?"bg-neutral-800 text-white dark:bg-neutral-100 dark:text-neutral-900":"text-neutral-500 hover:bg-neutral-100 dark:text-neutral-400 dark:hover:bg-neutral-800"}`,children:W},L))}),x?c.jsxs("div",{className:"mb-5 grid gap-4 border-b border-neutral-200 pb-5 dark:border-neutral-800 sm:grid-cols-[16rem_1fr] sm:items-start",children:[c.jsxs("div",{children:[c.jsxs("div",{ref:m,className:"relative aspect-video select-none overflow-hidden rounded-xl bg-neutral-900 shadow-sm",children:[n==="hero"&&f?c.jsx("img",{src:f,alt:"",draggable:!1,className:"h-full w-full object-cover"}):c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gradient-to-br from-neutral-700 to-neutral-900 text-xs uppercase tracking-wide text-neutral-500",children:n==="youtube"?"Video-Hintergrund":"Hero-Bild"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-black/40"}),c.jsxs("div",{onPointerDown:E,onPointerMove:S,onPointerUp:N,style:{...Xi(b.text_align_x,b.text_align_y,{x:50,y:50}),touchAction:"none"},className:`absolute max-w-[85%] select-none whitespace-nowrap rounded p-2 text-center transition-colors ${g?"cursor-grabbing bg-white/10 ring-2 ring-brand-400":"cursor-grab hover:bg-white/10"}`,children:[j&&c.jsx("p",{className:"truncate text-[10px] font-semibold uppercase tracking-wide text-brand-300",children:j}),c.jsx("p",{className:"truncate text-sm font-extrabold text-white",children:T})]})]}),c.jsx("p",{className:"mt-1.5 text-center text-xs text-neutral-400",children:"Zum Verschieben ziehen"})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:pt-1",children:[c.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Position:"," ",c.jsxs("span",{className:"font-mono font-semibold text-neutral-700 dark:text-neutral-200",children:[b.text_align_x,"% / ",b.text_align_y,"%"]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl waagerecht"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:()=>w(0,b.text_align_y),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Links"}),c.jsx("button",{type:"button",onClick:()=>w(50,b.text_align_y),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Mittig"}),c.jsx("button",{type:"button",onClick:()=>w(100,b.text_align_y),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Rechts"})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl senkrecht"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:()=>w(b.text_align_x,0),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Oben"}),c.jsx("button",{type:"button",onClick:()=>w(b.text_align_x,50),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Mittig"}),c.jsx("button",{type:"button",onClick:()=>w(b.text_align_x,100),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Unten"})]})]})]})]}):c.jsxs("div",{className:"mb-5 grid gap-4 border-b border-neutral-200 pb-5 dark:border-neutral-800 sm:grid-cols-[10rem_1fr] sm:items-center",children:[c.jsx("div",{className:"aspect-square rounded-xl bg-neutral-100 dark:bg-neutral-800","aria-hidden":!0}),c.jsxs("div",{children:[c.jsxs("div",{className:`rounded-lg border border-neutral-200 p-3 dark:border-neutral-700 ${$H[b.text_align]||"text-left"}`,children:[j&&c.jsx("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:j}),c.jsx("p",{className:"mb-1 font-bold text-neutral-900 dark:text-white",children:T}),c.jsx("p",{className:"line-clamp-2 text-xs text-neutral-500 dark:text-neutral-400",children:R||"Text erscheint hier…"})]}),c.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:VH.map(L=>c.jsx("button",{type:"button",onClick:()=>k("text_align",L.value),className:`rounded-md border px-3 py-1.5 text-sm font-medium transition ${b.text_align===L.value?"border-brand-500 bg-brand-500 text-white":"border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:L.label},L.value))})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Kurzer Vorspann (optional)"}),c.jsx("input",{value:b[`eyebrow_${s}`]||"",onChange:L=>k(`eyebrow_${s}`,L.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),c.jsx("input",{value:b[`title_${s}`]||"",onChange:L=>k(`title_${s}`,L.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(Sd,{label:"Text",value:b[`body_html_${s}`]||"",onChange:L=>k(`body_html_${s}`,L)}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Beschriftung (optional)"}),c.jsx("input",{value:b[`button_label_${s}`]||"",onChange:L=>k(`button_label_${s}`,L.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Ziel (Link, für beide Sprachen gleich)"}),c.jsx("input",{value:b.button_url||"",onChange:L=>k("button_url",L.target.value),placeholder:"/leistungen oder https://…",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:'Ohne Beschriftung UND Ziel wird kein Button angezeigt. Mit "/" beginnende Ziele bleiben innerhalb der Seite, alles andere öffnet extern in einem neuen Tab.'})]})]})]}),b.updated_at&&c.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(b.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),l&&c.jsx("p",{className:"mt-3 text-sm text-red-600",children:l}),d&&c.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"button",onClick:M,disabled:o,className:"mt-4 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:o?"Speichere…":"Speichern"})]})]})}const UH=t=>t==null?"–":new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t),KH={ok:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"};function GH(){const{packageId:t}=Qs(),[e,n]=v.useState([]),[r,s]=v.useState(""),[i,o]=v.useState(""),[a,l]=v.useState(""),[u,d]=v.useState(!1),h=()=>A.get(`/packages/${t}/products`).then(n);v.useEffect(()=>{h()},[t]);const f=async g=>{g.preventDefault(),l(""),d(!0);try{await A.post("/products",{package_id:Number(t),source_url:r,name_override:i||null}),s(""),o(""),h()}catch(y){l(y.message)}finally{d(!1)}},p=async g=>{d(!0);try{await A.post(`/products/${g}/refresh-price`,{}),h()}finally{d(!1)}},m=async g=>{confirm("Produkt wirklich entfernen?")&&(await A.delete(`/products/${g}`),h())};return c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-sm",children:c.jsx(ee,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Produkte im Paket"}),c.jsxs("form",{onSubmit:f,className:"mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"flex-1 min-w-[240px]",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"audio4cars.de Produkt-URL *"}),c.jsx("input",{required:!0,type:"url",placeholder:"https://www.audio4cars.de/produkt/...",value:r,onChange:g=>s(g.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"w-56",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name überschreiben (optional)"}),c.jsx("input",{value:i,onChange:g=>o(g.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx("button",{disabled:u,type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Hinzufügen"})]}),a&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Produkt"}),c.jsx("th",{className:"px-4 py-2",children:"Preis"}),c.jsx("th",{className:"px-4 py-2",children:"Status"}),c.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktualisiert"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(g=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2",children:[c.jsx("a",{href:g.source_url,target:"_blank",rel:"noreferrer",className:"font-medium text-neutral-800 hover:underline dark:text-neutral-100",children:g.name_override||g.scraped_name||g.source_url}),g.scrape_status==="error"&&c.jsx("p",{className:"text-xs text-red-500",children:g.scrape_error})]}),c.jsx("td",{className:"px-4 py-2",children:UH(g.scraped_price)}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${KH[g.scrape_status]}`,children:g.scrape_status})}),c.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:g.price_updated_at?new Date(g.price_updated_at.replace(" ","T")).toLocaleString("de-DE"):"–"}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{disabled:u,onClick:()=>p(g.id),className:"mr-3 text-brand-600 hover:underline disabled:opacity-60",children:"Preis aktualisieren"}),c.jsx("button",{onClick:()=>m(g.id),className:"text-red-600 hover:underline",children:"Entfernen"})]})]},g.id)),e.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Produkte im Paket."})})]})]})})]})}const qH=t=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t),Mw={name:"",description:"",price:0,sort_order:0};function JH(){const{packageId:t}=Qs(),[e,n]=v.useState([]),[r,s]=v.useState(Mw),[i,o]=v.useState(null),[a,l]=v.useState(""),u=()=>A.get(`/packages/${t}/upgrades`).then(n);v.useEffect(()=>{u()},[t]);const d=m=>{o(m.id),s({name:m.name,description:m.description||"",price:m.price,sort_order:m.sort_order})},h=()=>{o(null),s(Mw)},f=async m=>{m.preventDefault(),l("");const g={...r,package_id:Number(t),price:Number(r.price)};try{i?await A.put(`/package-upgrades/${i}`,g):await A.post("/package-upgrades",g),h(),u()}catch(y){l(y.message)}},p=async m=>{confirm("Upgrade wirklich löschen?")&&(await A.delete(`/package-upgrades/${m}`),u())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("p",{className:"mb-2 text-sm",children:c.jsx(ee,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Optionale Upgrades"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Upgrades erscheinen nicht in der öffentlichen Paketübersicht, sondern erst als Auswahl im Kontaktformular."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Preis"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(m=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2",children:[c.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:m.name}),m.description&&c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:m.description})]}),c.jsx("td",{className:"px-4 py-2",children:qH(m.price)}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>d(m),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>p(m.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},m.id)),e.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Upgrades hinterlegt."})})]})]})})]}),c.jsxs("form",{onSubmit:f,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:i?"Upgrade bearbeiten":"Neues Upgrade"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:r.name,onChange:m=>s({...r,name:m.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),c.jsx("textarea",{rows:2,value:r.description,onChange:m=>s({...r,description:m.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis (€) *"}),c.jsx("input",{required:!0,type:"number",step:"0.01",min:"0",value:r.price,onChange:m=>s({...r,price:m.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:r.sort_order,onChange:m=>s({...r,sort_order:Number(m.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a&&c.jsx("p",{className:"text-sm text-red-600",children:a}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:i?"Speichern":"Anlegen"}),i&&c.jsx("button",{type:"button",onClick:h,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const YH=t=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t),XH={new:"Neu",in_progress:"In Bearbeitung",done:"Erledigt"},ZH={new:"bg-brand-100 text-brand-700 dark:bg-brand-900/40 dark:text-brand-300",in_progress:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",done:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300"},QH=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"h-4 w-4",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m3 0-.8 12.1a1 1 0 0 1-1 .9H7.8a1 1 0 0 1-1-.9L6 7h12ZM10 11v6M14 11v6"})});function e7(){const{hasPermission:t}=Cn(),[e,n]=v.useState([]),[r,s]=v.useState("all"),i=()=>A.get("/contact").then(n);v.useEffect(()=>{i()},[]);const o=async(h,f)=>{await A.patch(`/contact/${h}`,{status:f}),i()},a=async h=>{confirm("Diese Kontaktanfrage wirklich unwiderruflich löschen?")&&(await A.delete(`/contact/${h}`),i())},l=v.useMemo(()=>({all:e.length,new:e.filter(h=>h.status==="new").length,in_progress:e.filter(h=>h.status==="in_progress").length,done:e.filter(h=>h.status==="done").length}),[e]),u=r==="all"?e:e.filter(h=>h.status===r),d=[{value:"all",label:"Alle"},{value:"new",label:"Neu"},{value:"in_progress",label:"In Bearbeitung"},{value:"done",label:"Erledigt"}];return c.jsxs("div",{children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Kontaktanfragen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Alle Anfragen deiner Kunden. Wähle oben einen Reiter, um nur bestimmte Anfragen zu sehen."}),c.jsx("div",{className:"mb-5 flex flex-wrap gap-2",children:d.map(h=>c.jsxs("button",{onClick:()=>s(h.value),className:`rounded-full px-4 py-1.5 text-sm font-medium transition ${r===h.value?"bg-brand-500 text-white":"bg-neutral-100 text-neutral-600 hover:bg-neutral-200 dark:bg-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-700"}`,children:[h.label," (",l[h.value],")"]},h.value))}),c.jsxs("div",{className:"space-y-3",children:[u.map(h=>{var f;return c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-2 flex flex-wrap items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"font-semibold text-neutral-800 dark:text-neutral-100",children:[h.name," · ",h.email,h.phone?` · ${h.phone}`:""]}),h.vin&&c.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["FIN: ",c.jsx("span",{className:"font-mono",children:h.vin})]}),c.jsx("p",{className:"text-xs text-neutral-400",children:new Date(h.created_at.replace(" ","T")).toLocaleString("de-DE")})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("select",{value:h.status,onChange:p=>o(h.id,p.target.value),className:`rounded-full border-0 px-3 py-1 text-xs font-medium ${ZH[h.status]}`,children:Object.entries(XH).map(([p,m])=>c.jsx("option",{value:p,children:m},p))}),t("contact.delete")&&c.jsx("button",{onClick:()=>a(h.id),"aria-label":"Anfrage löschen",title:"Anfrage löschen",className:"rounded-md p-1.5 text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20",children:c.jsx(QH,{})})]})]}),(h.brand_name||h.model_name||h.package_name||h.product_name)&&c.jsx("p",{className:"mb-2 text-sm text-neutral-500 dark:text-neutral-400",children:[h.brand_name,h.model_name,h.package_name,h.product_name].filter(Boolean).join(" · ")}),((f=h.selected_upgrades)==null?void 0:f.length)>0&&c.jsxs("div",{className:"mb-2 rounded-md bg-brand-50 p-2 text-sm text-brand-800 dark:bg-brand-900/20 dark:text-brand-200",children:[c.jsx("p",{className:"font-semibold",children:"Gewünschte Upgrades:"}),c.jsx("ul",{className:"list-disc pl-5",children:h.selected_upgrades.map(p=>c.jsxs("li",{children:[p.name," – ",YH(p.price)]},p.id))})]}),h.message&&c.jsx("p",{className:"text-sm text-neutral-700 dark:text-neutral-300",children:h.message})]},h.id)}),u.length===0&&c.jsx("p",{className:"text-neutral-400",children:r==="all"?"Noch keine Kontaktanfragen eingegangen.":"Keine Anfragen mit diesem Status."})]})]})}var Al={},t7=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},k2={},Kt={};let bx;const n7=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Kt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Kt.getSymbolTotalCodewords=function(e){return n7[e]};Kt.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Kt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');bx=e};Kt.isKanjiModeEnabled=function(){return typeof bx<"u"};Kt.toSJIS=function(e){return bx(e)};var gh={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,s){if(t.isValid(r))return r;try{return e(r)}catch{return s}}})(gh);function w2(){this.buffer=[],this.length=0}w2.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var r7=w2;function Dl(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Dl.prototype.set=function(t,e,n,r){const s=t*this.size+e;this.data[s]=n,r&&(this.reservedBit[s]=!0)};Dl.prototype.get=function(t,e){return this.data[t*this.size+e]};Dl.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};Dl.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var s7=Dl,S2={};(function(t){const e=Kt.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,i=e(r),o=i===145?26:Math.ceil((i-13)/(2*s-2))*2,a=[i-7];for(let l=1;l=0&&s<=7},t.from=function(s){return t.isValid(s)?parseInt(s,10):void 0},t.getPenaltyN1=function(s){const i=s.size;let o=0,a=0,l=0,u=null,d=null;for(let h=0;h=5&&(o+=e.N1+(a-5)),u=p,a=1),p=s.get(f,h),p===d?l++:(l>=5&&(o+=e.N1+(l-5)),d=p,l=1)}a>=5&&(o+=e.N1+(a-5)),l>=5&&(o+=e.N1+(l-5))}return o},t.getPenaltyN2=function(s){const i=s.size;let o=0;for(let a=0;a=10&&(a===1488||a===93)&&o++,l=l<<1&2047|s.get(d,u),d>=10&&(l===1488||l===93)&&o++}return o*e.N3},t.getPenaltyN4=function(s){let i=0;const o=s.data.length;for(let l=0;l=0;){const o=i[0];for(let l=0;l0){const i=new Uint8Array(this.degree);return i.set(r,s),i}return r};var o7=vx,T2={},us={},kx={};kx.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var zn={};const M2="[0-9]+",a7="[A-Z $%*+\\-./:]+";let cl="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";cl=cl.replace(/u/g,"\\u");const l7="(?:(?![A-Z0-9 $%*+\\-./:]|"+cl+`)(?:.|[\r -]))+`;zn.KANJI=new RegExp(cl,"g");zn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");zn.BYTE=new RegExp(l7,"g");zn.NUMERIC=new RegExp(M2,"g");zn.ALPHANUMERIC=new RegExp(a7,"g");const c7=new RegExp("^"+cl+"$"),u7=new RegExp("^"+M2+"$"),d7=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");zn.testKanji=function(e){return c7.test(e)};zn.testNumeric=function(e){return u7.test(e)};zn.testAlphanumeric=function(e){return d7.test(e)};(function(t){const e=kx,n=zn;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(i,o){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?i.ccBits[0]:o<27?i.ccBits[1]:i.ccBits[2]},t.getBestModeForData=function(i){return n.testNumeric(i)?t.NUMERIC:n.testAlphanumeric(i)?t.ALPHANUMERIC:n.testKanji(i)?t.KANJI:t.BYTE},t.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},t.isValid=function(i){return i&&i.bit&&i.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+s)}}t.from=function(i,o){if(t.isValid(i))return i;try{return r(i)}catch{return o}}})(us);(function(t){const e=Kt,n=xh,r=gh,s=us,i=kx,o=7973,a=e.getBCHDigit(o);function l(f,p,m){for(let g=1;g<=40;g++)if(p<=t.getCapacity(g,m,f))return g}function u(f,p){return s.getCharCountIndicator(f,p)+4}function d(f,p){let m=0;return f.forEach(function(g){const y=u(g.mode,p);m+=y+g.getBitsLength()}),m}function h(f,p){for(let m=1;m<=40;m++)if(d(f,m)<=t.getCapacity(m,p,s.MIXED))return m}t.from=function(p,m){return i.isValid(p)?parseInt(p,10):m},t.getCapacity=function(p,m,g){if(!i.isValid(p))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=s.BYTE);const y=e.getSymbolTotalCodewords(p),b=n.getTotalCodewordsCount(p,m),x=(y-b)*8;if(g===s.MIXED)return x;const k=x-u(g,p);switch(g){case s.NUMERIC:return Math.floor(k/10*3);case s.ALPHANUMERIC:return Math.floor(k/11*2);case s.KANJI:return Math.floor(k/13);case s.BYTE:default:return Math.floor(k/8)}},t.getBestVersionForData=function(p,m){let g;const y=r.from(m,r.M);if(Array.isArray(p)){if(p.length>1)return h(p,y);if(p.length===0)return 1;g=p[0]}else g=p;return l(g.mode,g.getLength(),y)},t.getEncodedBits=function(p){if(!i.isValid(p)||p<7)throw new Error("Invalid QR Code version");let m=p<<12;for(;e.getBCHDigit(m)-a>=0;)m^=o<=0;)s^=A2<0&&(r=this.data.substr(n),s=parseInt(r,10),e.put(s,i*3+1))};var p7=ao;const m7=us,Hf=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function lo(t){this.mode=m7.ALPHANUMERIC,this.data=t}lo.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};lo.prototype.getLength=function(){return this.data.length};lo.prototype.getBitsLength=function(){return lo.getBitsLength(this.data.length)};lo.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let r=Hf.indexOf(this.data[n])*45;r+=Hf.indexOf(this.data[n+1]),e.put(r,11)}this.data.length%2&&e.put(Hf.indexOf(this.data[n]),6)};var g7=lo;const x7=us;function co(t){this.mode=x7.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}co.getBitsLength=function(e){return e*8};co.prototype.getLength=function(){return this.data.length};co.prototype.getBitsLength=function(){return co.getBitsLength(this.data.length)};co.prototype.write=function(t){for(let e=0,n=this.data.length;e=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` -Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var k7=uo,L2={exports:{}};(function(t){var e={single_source_shortest_paths:function(n,r,s){var i={},o={};o[r]=0;var a=e.PriorityQueue.make();a.push(r,0);for(var l,u,d,h,f,p,m,g,y;!a.empty();){l=a.pop(),u=l.value,h=l.cost,f=n[u]||{};for(d in f)f.hasOwnProperty(d)&&(p=f[d],m=h+p,g=o[d],y=typeof o[d]>"u",(y||g>m)&&(o[d]=m,a.push(d,m),i[d]=u))}if(typeof s<"u"&&typeof o[s]>"u"){var b=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(b)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],i=r;i;)s.push(i),n[i],i=n[i];return s.reverse(),s},find_path:function(n,r,s){var i=e.single_source_shortest_paths(n,r,s);return e.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(n){var r=e.PriorityQueue,s={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(L2);var w7=L2.exports;(function(t){const e=us,n=p7,r=g7,s=y7,i=k7,o=zn,a=Kt,l=w7;function u(b){return unescape(encodeURIComponent(b)).length}function d(b,x,k){const w=[];let C;for(;(C=b.exec(k))!==null;)w.push({data:C[0],index:C.index,mode:x,length:C[0].length});return w}function h(b){const x=d(o.NUMERIC,e.NUMERIC,b),k=d(o.ALPHANUMERIC,e.ALPHANUMERIC,b);let w,C;return a.isKanjiModeEnabled()?(w=d(o.BYTE,e.BYTE,b),C=d(o.KANJI,e.KANJI,b)):(w=d(o.BYTE_KANJI,e.BYTE,b),C=[]),x.concat(k,w,C).sort(function(S,N){return S.index-N.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function f(b,x){switch(x){case e.NUMERIC:return n.getBitsLength(b);case e.ALPHANUMERIC:return r.getBitsLength(b);case e.KANJI:return i.getBitsLength(b);case e.BYTE:return s.getBitsLength(b)}}function p(b){return b.reduce(function(x,k){const w=x.length-1>=0?x[x.length-1]:null;return w&&w.mode===k.mode?(x[x.length-1].data+=k.data,x):(x.push(k),x)},[])}function m(b){const x=[];for(let k=0;k=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(i+a,o+l,!0,!0):t.set(i+a,o+l,!1,!0))}}function A7(t){const e=t.size;for(let n=8;n>a&1)===1,t.set(s,i,o,!0),t.set(i,s,o,!0)}function Kf(t,e,n){const r=t.size,s=T7.getEncodedBits(e,n);let i,o;for(i=0;i<15;i++)o=(s>>i&1)===1,i<6?t.set(i,8,o,!0):i<8?t.set(i+1,8,o,!0):t.set(r-15+i,8,o,!0),i<8?t.set(8,r-i-1,o,!0):i<9?t.set(8,15-i-1+1,o,!0):t.set(8,15-i-1,o,!0);t.set(r-8,8,1,!0)}function R7(t,e){const n=t.size;let r=-1,s=n-1,i=7,o=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(s,a-l)){let u=!1;o>>i&1)===1),t.set(s,a-l,u),i--,i===-1&&(o++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function _7(t,e,n){const r=new S7;n.forEach(function(l){r.put(l.mode.bit,4),r.put(l.getLength(),M7.getCharCountIndicator(l.mode,t)),l.write(r)});const s=bh.getSymbolTotalCodewords(t),i=cg.getTotalCodewordsCount(t,e),o=(s-i)*8;for(r.getLengthInBits()+4<=o&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(o-r.getLengthInBits())/8;for(let l=0;l({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes($9,this.editor.getAttributes(ww)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new ke({props:{handlePaste:(t,e)=>{var n,r;const s=(n=e.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(s!=null&&s.trim())return!1;const i=(r=e.clipboardData)===null||r===void 0?void 0:r.getData("text/plain");if(!i)return!1;const o=F9(i);if(!o)return!1;try{const a=t.state.schema.nodeFromJSON(o),l=t.state.tr.replaceSelectionWith(a);return t.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){const t=(n,r)=>(!r.attrs.type||r.attrs.type==="1")&&r.childCount+r.attrs.start===+n[1];let e=oo({find:Sw,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:t});return(this.options.keepMarks||this.options.keepAttributes)&&(e=oo({find:Sw,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(ww)}),joinPredicate:t,editor:this.editor})),[e]}}),H9=/^\s*(\[([( |x])?\])\s$/,W9="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",U9=(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"}`},K9=Ut.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=>{const 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",ze(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const 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){const r=e.parseChildren(t.nestedTokens);n.push(...r)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;const r=`- [${!((n=t.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return vT(t,e,r)},addExtensions(){return this.options.nested?[QT(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const 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})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");o.style.cssText=W9;const u=h=>{const f=U9(h,h.attrs.checked,this.options.a11y);a.setAttribute("aria-label",f),o.textContent=f};u(t),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",h=>h.preventDefault()),a.addEventListener("change",h=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:f}=h.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:p})=>{const m=n();if(typeof m!="number")return!1;const g=p.doc.nodeAt(m);return p.setNodeMarkup(m,void 0,{...g==null?void 0:g.attrs,checked:f}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,f])=>{s.setAttribute(h,f)}),s.dataset.checked=t.attrs.checked,a.checked=t.attrs.checked,i.append(a,o),s.append(i,l),Object.entries(e).forEach(([h,f])=>{s.setAttribute(h,f)});let d=new Set(Object.keys(e));return{dom:s,contentDOM:l,update:h=>{if(h.type!==this.type)return!1;s.dataset.checked=h.attrs.checked,a.checked=h.attrs.checked,u(h);const f=r.extensionManager.attributes,p=ol(h,f),m=new Set(Object.keys(p)),g=this.options.HTMLAttributes;return d.forEach(y=>{m.has(y)||(y in g?s.setAttribute(y,g[y]):s.removeAttribute(y))}),Object.entries(p).forEach(([y,b])=>{b==null?y in g?s.setAttribute(y,g[y]):s.removeAttribute(y):s.setAttribute(y,b)}),d=m,!0}}}},addInputRules(){return[oo({find:H9,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),G9=Ut.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",ze(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` +`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const 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){const r=i=>{const o=ew(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:r},n);if(o){const a={type:"taskList",raw:o.raw,items:o.items},l=i.slice(o.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(i)},s=ew(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},n);if(s)return{type:"taskList",raw:s.raw,items:s.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()}}});fe.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(ZT.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(r2.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(i2.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(a2.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(K9.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(G9.configure(this.options.taskList)),t}});const yc=" ",Ff=" ",q9=Ut.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",ze(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];if(n.length===1&&n[0].type==="image")return e.parseChildren([n[0]]);const r=e.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===yc||n[0].text===yc||n[0].raw===Ff||n[0].text===Ff)&&r.length===1&&r[0].type==="text"&&(r[0].text===yc||r[0].text===Ff)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(t,e,n)=>{if(!t)return"";const r=Array.isArray(t.content)?t.content:[];if(r.length===0){var s,i;const o=Array.isArray(n==null||(s=n.previousNode)===null||s===void 0?void 0:s.content)?n.previousNode.content:[];return(n==null||(i=n.previousNode)===null||i===void 0?void 0:i.type)==="paragraph"&&o.length===0?yc:""}return e.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),J9=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Y9=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,X9=ls.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",ze(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ys({find:J9,type:this.type})]},addPasteRules(){return[Qr({find:Y9,type:this.type})]}}),Z9=Ut.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),l2=ls.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",ze(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){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:n.inlineTokens(s)}}},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.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Q9(t={}){return new ke({view(e){return new eH(e,t)}})}class eH{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){if(this.cursorPos!=null&&n.doc!=e.state.doc)if(this.lastDragEvent){let r=this.computeTarget(this.lastDragEvent);r==this.cursorPos?this.updateOverlay():this.setCursor(r)}else this.updateOverlay()}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,a=i.height/s.offsetHeight;if(n){let h=e.nodeBefore,f=e.nodeAfter;if(h||f){let p=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(p){let m=p.getBoundingClientRect(),g=h?m.bottom:m.top;h&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*a;r={left:m.left,right:m.right,top:g-y,bottom:g+y}}}}if(!r){let h=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;r={left:h.left-f,right:h.left+f,top:h.top,bottom:h.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,d=-pageYOffset;else{let h=l.getBoundingClientRect(),f=h.width/l.offsetWidth,p=h.height/l.offsetHeight;u=h.left-l.scrollLeft*f,d=h.top-l.scrollTop*p}this.element.style.left=(r.left-u)/o+"px",this.element.style.top=(r.top-d)/a+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}computeTarget(e){let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,n,e):s;if(!n||i)return null;let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Wj(this.editorView.state.doc,o,this.editorView.dragging.slice);a!=null&&(o=a)}return o}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let n=this.computeTarget(e);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Le extends ne{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Le.valid(r)?new Le(r):ne.near(r)}content(){return H.empty}eq(e){return e instanceof Le&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Le(e.resolve(n.pos))}getBookmark(){return new yx(this.anchor)}static valid(e){let n=e.parent;if(n.inlineContent||!tH(e)||!nH(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let s=n.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Le.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let a=e.node(o);if(n>0?e.indexAfter(o)0){i=a.child(n>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=n;let l=e.doc.resolve(s);if(Le.valid(l))return l}for(;;){let o=n>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!J.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*n),r=!1;continue e}break}i=o,s+=n;let a=e.doc.resolve(s);if(Le.valid(a))return a}return null}}}Le.prototype.visible=!1;Le.findFrom=Le.findGapCursorFrom;ne.jsonID("gapcursor",Le);class yx{constructor(e){this.pos=e}map(e){return new yx(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Le.valid(n)?new Le(n):ne.near(n)}}function c2(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function tH(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||c2(s.type))return!0;if(s.inlineContent)return!1}}return!0}function nH(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(n);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||c2(s.type))return!0;if(s.inlineContent)return!1}}return!0}function rH(){return new ke({props:{decorations:aH,createSelectionBetween(t,e,n){return e.pos==n.pos&&Le.valid(n)?new Le(n):null},handleClick:iH,handleKeyDown:sH,handleDOMEvents:{beforeinput:oH}}})}const sH=qE({ArrowLeft:bc("horiz",-1),ArrowRight:bc("horiz",1),ArrowUp:bc("vert",-1),ArrowDown:bc("vert",1)});function bc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,a=e>0?o.$to:o.$from,l=o.empty;if(o instanceof Y){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let u=Le.findGapCursorFrom(a,e,l);return u?(s&&s(r.tr.setSelection(new Le(u))),!0):!1}}function iH(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Le.valid(r))return!1;let s=t.posAtCoords({left:n.clientX,top:n.clientY});return s&&s.inside>-1&&J.isSelectable(t.state.doc.nodeAt(s.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Le(r))),!0)}function oH(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Le))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let s=O.empty;for(let o=r.length-1;o>=0;o--)s=O.from(r[o].createAndFill(null,s));let i=t.state.tr.replace(n.pos,n.pos,new H(s,0,0));return i.setSelection(Y.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function aH(t){if(!(t.selection instanceof Le))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ce.create(t.doc,[vt.widget(t.selection.head,e,{key:"gapcursor"})])}var wd=200,Xe=function(){};Xe.prototype.append=function(e){return e.length?(e=Xe.from(e),!this.length&&e||e.length=n?Xe.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))};Xe.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Xe.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)};Xe.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},n,r),s};Xe.from=function(e){return e instanceof Xe?e:e&&e.length?new u2(e):Xe.empty};var u2=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,a){for(var l=i;l=o;l--)if(s(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=wd)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=wd)return new e(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Xe);Xe.empty=new u2([]);var lH=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return ra&&this.right.forEachInner(r,Math.max(s-a,0),Math.min(this.length,i)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var a=this.left.length;if(s>a&&this.right.forEachInvertedInner(r,s-a,Math.max(i,a)-a,o+a)===!1||i=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Xe);const cH=500;class gn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;n&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,a,l,u=[],d=[];return this.items.forEach((h,f)=>{if(!h.step){s||(s=this.remapping(r,f+1),i=s.maps.length),i--,d.push(h);return}if(s){d.push(new An(h.map));let p=h.step.map(s.slice(i)),m;p&&o.maybeStep(p).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],u.push(new An(m,void 0,void 0,u.length+d.length))),i--,m&&s.appendMap(m,i)}else o.maybeStep(h.step);if(h.selection)return a=s?h.selection.map(s.slice(i)):h.selection,l=new gn(this.items.slice(0,r).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,s){let i=[],o=this.eventCount,a=this.items,l=!s&&a.length?a.get(a.length-1):null;for(let d=0;ddH&&(a=uH(a,u),o-=u),new gn(a.append(i),o)}remapping(e,n){let r=new tl;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new gn(this.items.append(e.map(n=>new An(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-n),i=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},s);let l=n;this.items.forEach(f=>{let p=i.getMirror(--l);if(p==null)return;o=Math.min(o,p);let m=i.maps[p];if(f.step){let g=e.steps[p].invert(e.docs[p]),y=f.selection&&f.selection.map(i.slice(l+1,p));y&&a++,r.push(new An(m,g,y))}else r.push(new An(m))},s);let u=[];for(let f=n;fcH&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,s=[],i=0;return this.items.forEach((o,a)=>{if(a>=e)s.push(o),o.selection&&i++;else if(o.step){let l=o.step.map(n.slice(r)),u=l&&l.getMap();if(r--,u&&n.appendMap(u,r),l){let d=o.selection&&o.selection.map(n.slice(r));d&&i++;let h=new An(u.invert(),l,d),f,p=s.length-1;(f=s.length&&s[p].merge(h))?s[p]=f:s.push(h)}}else o.map&&r--},this.items.length,0),new gn(Xe.from(s.reverse()),i)}}gn.empty=new gn(Xe.empty,0);function uH(t,e){let n;return t.forEach((r,s)=>{if(r.selection&&e--==0)return n=s,!1}),t.slice(n)}class An{constructor(e,n,r,s){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new An(n.getMap().invert(),n,this.selection)}}}class wr{constructor(e,n,r,s,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const dH=20;function hH(t,e,n,r){let s=n.getMeta(Vs),i;if(s)return s.historyState;n.getMeta(mH)&&(t=new wr(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(Vs))return o.getMeta(Vs).redo?new wr(t.done.addTransform(n,void 0,r,Yc(e)),t.undone,Cw(n.mapping.maps),t.prevTime,t.prevComposition):new wr(t.done,t.undone.addTransform(n,void 0,r,Yc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!fH(n,t.prevRanges)),u=o?Vf(t.prevRanges,n.mapping):Cw(n.mapping.maps);return new wr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Yc(e)),gn.empty,u,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new wr(t.done.rebased(n,i),t.undone.rebased(n,i),Vf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new wr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Vf(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function fH(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,s)=>{for(let i=0;i=e[i]&&(n=!0)}),n}function Cw(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,s,i,o)=>e.push(i,o));return e}function Vf(t,e){if(!t)return null;let n=[];for(let r=0;r{let s=Vs.getState(n);if(!s||(t?s.undone:s.done).eventCount==0)return!1;if(r){let i=pH(s,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const h2=d2(!1,!0),f2=d2(!0,!0);fe.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new ke({key:new Fe("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){t=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const a=o-s,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,u);return t=!0,d}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:n.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,a=o-(i-r),l=o;return e.deleteRange(a,l),!(this.storage.characters({node:e.doc})>r)}})]}});const xH=fe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Q9(this.options)]}});fe.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new ke({key:new Fe("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!n||!r)return ce.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((l,u)=>{if(!l.isText){if(!(s>=u&&s<=u+l.nodeSize-1))return!1;o+=1}});let a=0;return t.descendants((l,u)=>{if(l.isText||!(s>=u&&s<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&o-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(vt.node(u,u+l.nodeSize,{class:this.options.className}))}),ce.create(t,i)}}})]}});const yH=fe.create({name:"gapCursor",addProseMirrorPlugins(){return[rH()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ue(q(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),p2="placeholder",Ew=new Fe("tiptap__placeholder");function m2(t){const{editor:e,placeholder:n,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:a,classes:{emptyNode:l,emptyEditor:u}}=t,d=[l];return o&&d.push(u),vt.node(s,s+i.nodeSize,{class:d.join(" "),[r]:typeof n=="function"?n({editor:e,node:i,pos:s,hasAnchor:a}):n})}function g2(t,e){return typeof t=="function"?t(e):t}function x2({editor:t,options:e,dataAttribute:n,doc:r,selection:s,from:i,to:o}){const{anchor:a}=s,l=[],u=t.isEmpty;return r.nodesBetween(i,o,(d,h)=>{const f=a>=h&&a<=h+d.nodeSize,p=!d.isLeaf&&Tl(d);return d.type.isTextblock&&(f||!e.showOnlyCurrent)&&p&&l.push(m2({editor:t,isEmptyDoc:u,dataAttribute:n,hasAnchor:f,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:g2(e.emptyNodeClass,{editor:t,node:d,pos:h,hasAnchor:f})},node:d,pos:h})),e.includeChildren}),l}function y2({editor:t,options:e,dataAttribute:n,doc:r,selection:s}){if(!(t.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:i}=s,o=[],a=t.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const l=r.resolve(i),u=l.depth>0?l.node(1):l.nodeAfter,d=l.depth>0?l.before(1):i;if(u&&u.type.isTextblock&&Tl(u)){const h=i>=d&&i<=d+u.nodeSize;o.push(m2({editor:t,isEmptyDoc:a,dataAttribute:n,hasAnchor:h,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:g2(e.emptyNodeClass,{editor:t,node:u,pos:d,hasAnchor:h})},node:u,pos:d}))}}else o.push(...x2({editor:t,options:e,dataAttribute:n,doc:r,selection:s,from:0,to:r.content.size}));return ce.create(r,o)}function Sa(t,e){const n=t.resolve(e);if(n.depth===0){var r;const i=(r=n.nodeAfter)!==null&&r!==void 0?r:n.nodeBefore;if(!i)return{from:e,to:e};const o=n.nodeAfter?e:e-i.nodeSize;return{from:o,to:o+i.nodeSize}}const s=n.before(1);return{from:s,to:s+n.node(1).nodeSize}}function Na(t,e){return{from:Math.max(0,e.from-1),to:Math.min(t.content.size,e.to-1)}}function bH(t,e,n){const r=[];return t.forEach((s,i)=>{const o=i,a=o+s.nodeSize,l=o+1,u=a+1;le&&r.push({from:o,to:a})}),r}function vH(t){if(t.length===0)return[];const e=[...t].sort((r,s)=>r.from-s.from),n=[{...e[0]}];for(let r=1;re.from?n.push(Na(t,Sa(t,Math.min(e.to,t.content.size+1)-1))):e.fromp.from>=u&&p.to<=d);h.length&&(a=a.remove(h));const f=x2({editor:n,options:r,dataAttribute:s,doc:i,selection:o,from:u,to:d});f.length&&(a=a.add(i,f))}return a}function CH({editor:t,options:e,dataAttribute:n}){return{init(r,s){const i=y2({editor:t,options:e,dataAttribute:n,doc:s.doc,selection:s.selection});return i??ce.empty},apply(r,s,i,o){return!r.docChanged&&!r.selectionSet?s:NH({decorations:s.map(r.mapping,r.doc),ranges:wH(r,i,o),editor:t,options:e,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function jH(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function EH({editor:t,options:e}){const n=e.dataAttribute?`data-${jH(e.dataAttribute)}`:`data-${p2}`,r=e.showOnlyCurrent&&!e.includeChildren;return new ke({key:Ew,...r?{}:{state:CH({editor:t,options:e,dataAttribute:n})},props:{decorations:r?({doc:s,selection:i})=>y2({editor:t,options:e,dataAttribute:n,doc:s,selection:i}):s=>{var i;return e.showOnlyWhenEditable&&!t.isEditable?ce.empty:(i=Ew.getState(s))!==null&&i!==void 0?i:ce.empty}}})}fe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:p2,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[EH({editor:this.editor,options:this.options})]}});function og(t,e){return!t.selection.empty&&!hT(t.selection)&&e.isEditable}function TH(t,e){return og(t,e)&&!e.isFocused&&!e.view.dragging}function MH(){var t;(t=window.getSelection())===null||t===void 0||t.removeAllRanges()}function PH(t){t.focus()}fe.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new ke({key:new Fe("selection"),props:{decorations(n){return TH(n,t)?ce.create(n.doc,[vt.inline(n.selection.from,n.selection.to,{class:e.className})]):null},handleDOMEvents:{blur(n){return og(n.state,t)&&MH(),!1},focus(n){return og(n.state,t)&&requestAnimationFrame(()=>{!t.isDestroyed&&n.hasFocus()&&PH(n)}),!1}}}})]}});function Tw({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}const AH=fe.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new Fe(this.name),n=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)===null||t===void 0?void 0:t.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(n).includes(s.name));return[new ke({key:e,appendTransaction:(s,i,o)=>{const{doc:a,tr:l,schema:u}=o,d=e.getState(o),h=a.content.size,f=u.nodes[n];if(!s.some(p=>p.getMeta("skipTrailingNode"))&&d)return l.insert(h,f.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!Tw({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!Tw({node:o,types:r})}}})]}}),DH=fe.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>h2(t,e),redo:()=>({state:t,dispatch:e})=>f2(t,e)}},addProseMirrorPlugins(){return[gH(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),LH=fe.create({name:"starterKit",addExtensions(){const t=[];if(this.options.bold!==!1&&t.push(S$.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(y$.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(ZT.configure(this.options.bulletList)),this.options.code!==!1&&t.push(j$.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(M$.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(P$.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(xH.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(yH.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(A$.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(D$.configure(this.options.heading)),this.options.undoRedo!==!1&&t.push(DH.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&t.push(L$.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(B$.configure(this.options.italic)),this.options.listItem!==!1&&t.push(r2.configure(this.options.listItem)),this.options.listKeymap!==!1){var e;t.push(i2.configure((e=this.options)===null||e===void 0?void 0:e.listKeymap))}if(this.options.link!==!1){var n;t.push(XT.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&t.push(a2.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(q9.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(X9.configure(this.options.strike)),this.options.text!==!1&&t.push(Z9.configure(this.options.text)),this.options.underline!==!1){var r;t.push(l2.configure((r=this.options)===null||r===void 0?void 0:r.underline))}if(this.options.trailingNode!==!1){var s;t.push(AH.configure((s=this.options)===null||s===void 0?void 0:s.trailingNode))}return t}}),RH=20,b2=(t,e=0)=>{const n=[];return!t.children.length||e>RH||Array.from(t.children).forEach(r=>{r.tagName==="SPAN"?n.push(r):r.children.length&&n.push(...b2(r,e+1))}),n},_H=t=>{if(!t.children.length)return;const e=b2(t);e&&e.forEach(n=>{var r;const s=n.getAttribute("style"),i=(r=n.parentElement)===null||r===void 0||(r=r.closest("span"))===null||r===void 0?void 0:r.getAttribute("style");n.setAttribute("style",`${i};${s}`)})},v2=ls.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!0}},parseHTML(){return[{tag:"span",consuming:!1,getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&_H(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",ze(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleTextStyle:t=>({commands:e})=>e.toggleMark(this.name,t),removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(!n.isInline)return!0;n.marks.filter(s=>s.type===this.type).some(s=>Object.values(s.attrs).some(i=>!!i))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),IH=fe.create({name:"backgroundColor",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>{var e;const n=(e=Ml(t,"background-color"))!==null&&e!==void 0?e:t.style.backgroundColor;return n==null?void 0:n.replace(/['"]+/g,"")},renderHTML:t=>t.backgroundColor?{style:`background-color: ${t.backgroundColor}`}:{}}}}]},addCommands(){return{setBackgroundColor:t=>({chain:e})=>e().setMark("textStyle",{backgroundColor:t}).run(),unsetBackgroundColor:()=>({chain:t})=>t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}}}),OH=fe.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;const n=(e=Ml(t,"color"))!==null&&e!==void 0?e:t.style.color;return n==null?void 0:n.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),k2=fe.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>{var e;return(e=Ml(t,"font-family"))!==null&&e!==void 0?e:t.style.fontFamily},renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),BH=fe.create({name:"fontSize",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>{var e;return(e=Ml(t,"font-size"))!==null&&e!==void 0?e:t.style.fontSize},renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands(){return{setFontSize:t=>({chain:e})=>e().setMark("textStyle",{fontSize:t}).run(),unsetFontSize:()=>({chain:t})=>t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}),zH=fe.create({name:"lineHeight",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>{var e;return(e=Ml(t,"line-height"))!==null&&e!==void 0?e:t.style.lineHeight},renderHTML:t=>t.lineHeight?{style:`line-height: ${t.lineHeight}`}:{}}}}]},addCommands(){return{setLineHeight:t=>({chain:e})=>e().setMark("textStyle",{lineHeight:t}).run(),unsetLineHeight:()=>({chain:t})=>t().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()}}});fe.create({name:"textStyleKit",addExtensions(){const t=[];return this.options.backgroundColor!==!1&&t.push(IH.configure(this.options.backgroundColor)),this.options.color!==!1&&t.push(OH.configure(this.options.color)),this.options.fontFamily!==!1&&t.push(k2.configure(this.options.fontFamily)),this.options.fontSize!==!1&&t.push(BH.configure(this.options.fontSize)),this.options.lineHeight!==!1&&t.push(zH.configure(this.options.lineHeight)),this.options.textStyle!==!1&&t.push(v2.configure(this.options.textStyle)),t}});const bx=[{label:"Systemschrift",value:""},{label:"Serifenlos (Arial)",value:"Arial, Helvetica, sans-serif"},{label:"Serif (Georgia)",value:'Georgia, "Times New Roman", serif'},{label:"Klassisch (Times New Roman)",value:'"Times New Roman", Times, serif'},{label:"Modern (Verdana)",value:"Verdana, Geneva, sans-serif"},{label:"Schreibmaschine (Courier New)",value:'"Courier New", Courier, monospace'}];function pr({active:t,onClick:e,title:n,children:r}){return c.jsx("button",{type:"button",onClick:e,title:n,className:`rounded px-2 py-1 text-sm font-semibold ${t?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:r})}function Sd({value:t,onChange:e,label:n}){const r=d$({extensions:[LH,l2,v2,k2,XT.configure({openOnClick:!1})],content:t||"",onUpdate:({editor:o})=>e(o.getHTML()),editorProps:{attributes:{class:"rte-content min-h-[10rem] px-3 py-2 text-sm text-neutral-800 focus:outline-none dark:text-neutral-100"}}});if(v.useEffect(()=>{if(!r)return;const o=t||"";o!==r.getHTML()&&r.commands.setContent(o)},[t,r]),!r)return null;const s=r.getAttributes("textStyle").fontFamily||"",i=()=>{const o=r.getAttributes("link").href||"",a=window.prompt("Link-Ziel (URL):",o);if(a!==null){if(a===""){r.chain().focus().extendMarkRange("link").unsetLink().run();return}r.chain().focus().extendMarkRange("link").setLink({href:a}).run()}};return c.jsxs("div",{children:[n&&c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:n}),c.jsxs("div",{className:"overflow-hidden rounded-md border border-neutral-300 dark:border-neutral-700",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1 border-b border-neutral-200 bg-neutral-50 px-2 py-1.5 dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx(pr,{active:r.isActive("bold"),onClick:()=>r.chain().focus().toggleBold().run(),title:"Fett",children:"F"}),c.jsx(pr,{active:r.isActive("italic"),onClick:()=>r.chain().focus().toggleItalic().run(),title:"Kursiv",children:c.jsx("span",{className:"italic",children:"K"})}),c.jsx(pr,{active:r.isActive("underline"),onClick:()=>r.chain().focus().toggleUnderline().run(),title:"Unterstrichen",children:c.jsx("span",{className:"underline",children:"U"})}),c.jsx(pr,{active:r.isActive("code"),onClick:()=>r.chain().focus().toggleCode().run(),title:"Code (Inline)",children:c.jsx("span",{className:"font-mono",children:""})}),c.jsx("span",{className:"mx-1 h-5 w-px bg-neutral-300 dark:bg-neutral-600"}),c.jsx(pr,{active:r.isActive("heading",{level:2}),onClick:()=>r.chain().focus().toggleHeading({level:2}).run(),title:"Überschrift",children:"H2"}),c.jsx("span",{className:"mx-1 h-5 w-px bg-neutral-300 dark:bg-neutral-600"}),c.jsx(pr,{active:r.isActive("bulletList"),onClick:()=>r.chain().focus().toggleBulletList().run(),title:"Aufzählung",children:"•≡"}),c.jsx(pr,{active:r.isActive("orderedList"),onClick:()=>r.chain().focus().toggleOrderedList().run(),title:"Nummerierte Liste",children:"1≡"}),c.jsx("span",{className:"mx-1 h-5 w-px bg-neutral-300 dark:bg-neutral-600"}),c.jsx(pr,{active:r.isActive("link"),onClick:i,title:"Link setzen/entfernen",children:"🔗"}),c.jsx("span",{className:"mx-1 h-5 w-px bg-neutral-300 dark:bg-neutral-600"}),c.jsx("select",{value:s,onChange:o=>{const a=o.target.value;a===""?r.chain().focus().unsetFontFamily().run():r.chain().focus().setFontFamily(a).run()},className:"rounded border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:bx.map(o=>c.jsx("option",{value:o.value,children:o.label},o.label))})]}),c.jsx(MT,{editor:r,className:"bg-white dark:bg-neutral-950"})]})]})}const Mw=[{slug:"hero",label:"Hero (ganz oben)"},{slug:"youtube",label:"YouTube-Sektion"},{slug:"craft",label:"Handwerk"},{slug:"advice",label:"Beratung"},{slug:"insights",label:"Einblicke (Bildergalerie-Intro)"},{slug:"more",label:"Mehr als Car-Hifi"}],FH=["hero","youtube"],VH=[{value:"left",label:"Links"},{value:"center",label:"Mittig"},{value:"right",label:"Rechts"}],$H={left:"text-left",center:"text-center",right:"text-right"};function HH(t){const e=document.createElement("div");return e.innerHTML=t||"",e.textContent||""}function WH(){var $;const[t,e]=v.useState(null),[n,r]=v.useState("hero"),[s,i]=v.useState("de"),[o,a]=v.useState(!1),[l,u]=v.useState(""),[d,h]=v.useState(!1),[f,p]=v.useState(""),m=v.useRef(null),[g,y]=v.useState(!1);if(v.useEffect(()=>{A.get("/home-sections").then(e),A.get("/site-settings").then(L=>p(L.hero_image_path||""))},[]),!t)return c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const b=t[n],x=FH.includes(n),k=(L,W)=>{e(B=>({...B,[n]:{...B[n],[L]:W}})),h(!1)},w=(L,W)=>{e(B=>({...B,[n]:{...B[n],text_align_x:L,text_align_y:W}})),h(!1)},C=(L,W)=>{const B=m.current.getBoundingClientRect();return{x:Math.max(0,Math.min(100,Math.round((L-B.left)/B.width*100))),y:Math.max(0,Math.min(100,Math.round((W-B.top)/B.height*100)))}},E=L=>{L.preventDefault(),L.currentTarget.setPointerCapture(L.pointerId),y(!0);const{x:W,y:B}=C(L.clientX,L.clientY);w(W,B)},S=L=>{if(!g)return;const{x:W,y:B}=C(L.clientX,L.clientY);w(W,B)},N=L=>{y(!1),L.currentTarget.releasePointerCapture(L.pointerId)},M=async()=>{a(!0),u(""),h(!1);try{await A.put(`/home-sections/${n}`,b),h(!0)}catch(L){u(L.message)}finally{a(!1)}},j=b[`eyebrow_${s}`]||"",T=b[`title_${s}`]||(($=Mw.find(L=>L.slug===n))==null?void 0:$.label)||"",R=HH(b[`body_html_${s}`]);return c.jsxs("div",{className:"max-w-3xl space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Startseite"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Text, Position/Ausrichtung und (falls vorhanden) Button-Ziel der wichtigsten Textabschnitte auf der Startseite. Bilder, Statistik-Kacheln, Marken-Streifen, Bewertungen und FAQ werden an anderer Stelle verwaltet."})]}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:Mw.map(L=>c.jsx("button",{type:"button",onClick:()=>{r(L.slug),h(!1),u("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${n===L.slug?"bg-brand-500 text-white":"border border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:L.label},L.slug))}),c.jsx("div",{className:"mb-4 flex gap-1 border-b border-neutral-200 pb-4 dark:border-neutral-800",children:[["de","Deutsch"],["en","English"]].map(([L,W])=>c.jsx("button",{type:"button",onClick:()=>i(L),className:`rounded-md px-3 py-1 text-sm font-medium transition ${s===L?"bg-neutral-800 text-white dark:bg-neutral-100 dark:text-neutral-900":"text-neutral-500 hover:bg-neutral-100 dark:text-neutral-400 dark:hover:bg-neutral-800"}`,children:W},L))}),x?c.jsxs("div",{className:"mb-5 grid gap-4 border-b border-neutral-200 pb-5 dark:border-neutral-800 sm:grid-cols-[16rem_1fr] sm:items-start",children:[c.jsxs("div",{children:[c.jsxs("div",{ref:m,className:"relative aspect-video select-none overflow-hidden rounded-xl bg-neutral-900 shadow-sm",children:[n==="hero"&&f?c.jsx("img",{src:f,alt:"",draggable:!1,className:"h-full w-full object-cover"}):c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gradient-to-br from-neutral-700 to-neutral-900 text-xs uppercase tracking-wide text-neutral-500",children:n==="youtube"?"Video-Hintergrund":"Hero-Bild"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-black/40"}),c.jsxs("div",{onPointerDown:E,onPointerMove:S,onPointerUp:N,style:{...Xi(b.text_align_x,b.text_align_y,{x:50,y:50}),touchAction:"none"},className:`absolute max-w-[85%] select-none whitespace-nowrap rounded p-2 text-center transition-colors ${g?"cursor-grabbing bg-white/10 ring-2 ring-brand-400":"cursor-grab hover:bg-white/10"}`,children:[j&&c.jsx("p",{className:"truncate text-[10px] font-semibold uppercase tracking-wide text-brand-300",children:j}),c.jsx("p",{className:"truncate text-sm font-extrabold text-white",children:T})]})]}),c.jsx("p",{className:"mt-1.5 text-center text-xs text-neutral-400",children:"Zum Verschieben ziehen"})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:pt-1",children:[c.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Position:"," ",c.jsxs("span",{className:"font-mono font-semibold text-neutral-700 dark:text-neutral-200",children:[b.text_align_x,"% / ",b.text_align_y,"%"]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl waagerecht"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:()=>w(0,b.text_align_y),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Links"}),c.jsx("button",{type:"button",onClick:()=>w(50,b.text_align_y),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Mittig"}),c.jsx("button",{type:"button",onClick:()=>w(100,b.text_align_y),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Rechts"})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl senkrecht"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:()=>w(b.text_align_x,0),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Oben"}),c.jsx("button",{type:"button",onClick:()=>w(b.text_align_x,50),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Mittig"}),c.jsx("button",{type:"button",onClick:()=>w(b.text_align_x,100),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Unten"})]})]})]})]}):c.jsxs("div",{className:"mb-5 grid gap-4 border-b border-neutral-200 pb-5 dark:border-neutral-800 sm:grid-cols-[10rem_1fr] sm:items-center",children:[c.jsx("div",{className:"aspect-square rounded-xl bg-neutral-100 dark:bg-neutral-800","aria-hidden":!0}),c.jsxs("div",{children:[c.jsxs("div",{className:`rounded-lg border border-neutral-200 p-3 dark:border-neutral-700 ${$H[b.text_align]||"text-left"}`,children:[j&&c.jsx("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:j}),c.jsx("p",{className:"mb-1 font-bold text-neutral-900 dark:text-white",children:T}),c.jsx("p",{className:"line-clamp-2 text-xs text-neutral-500 dark:text-neutral-400",children:R||"Text erscheint hier…"})]}),c.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:VH.map(L=>c.jsx("button",{type:"button",onClick:()=>k("text_align",L.value),className:`rounded-md border px-3 py-1.5 text-sm font-medium transition ${b.text_align===L.value?"border-brand-500 bg-brand-500 text-white":"border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:L.label},L.value))})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Kurzer Vorspann (optional)"}),c.jsx("input",{value:b[`eyebrow_${s}`]||"",onChange:L=>k(`eyebrow_${s}`,L.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),c.jsx("input",{value:b[`title_${s}`]||"",onChange:L=>k(`title_${s}`,L.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(Sd,{label:"Text",value:b[`body_html_${s}`]||"",onChange:L=>k(`body_html_${s}`,L)}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Beschriftung (optional)"}),c.jsx("input",{value:b[`button_label_${s}`]||"",onChange:L=>k(`button_label_${s}`,L.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Ziel (Link, für beide Sprachen gleich)"}),c.jsx("input",{value:b.button_url||"",onChange:L=>k("button_url",L.target.value),placeholder:"/leistungen oder https://…",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:'Ohne Beschriftung UND Ziel wird kein Button angezeigt. Mit "/" beginnende Ziele bleiben innerhalb der Seite, alles andere öffnet extern in einem neuen Tab.'})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Schriftart (für beide Sprachen gleich)"}),c.jsxs("select",{value:b.font_family||"",onChange:L=>k("font_family",L.target.value||null),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"",children:"Standard (globale Schriftart)"}),bx.filter(L=>L.value).map(L=>c.jsx("option",{value:L.value,children:L.label},L.label))]})]})]}),b.updated_at&&c.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(b.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),l&&c.jsx("p",{className:"mt-3 text-sm text-red-600",children:l}),d&&c.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"button",onClick:M,disabled:o,className:"mt-4 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:o?"Speichere…":"Speichern"})]})]})}const UH=t=>t==null?"–":new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t),KH={ok:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"};function GH(){const{packageId:t}=Qs(),[e,n]=v.useState([]),[r,s]=v.useState(""),[i,o]=v.useState(""),[a,l]=v.useState(""),[u,d]=v.useState(!1),h=()=>A.get(`/packages/${t}/products`).then(n);v.useEffect(()=>{h()},[t]);const f=async g=>{g.preventDefault(),l(""),d(!0);try{await A.post("/products",{package_id:Number(t),source_url:r,name_override:i||null}),s(""),o(""),h()}catch(y){l(y.message)}finally{d(!1)}},p=async g=>{d(!0);try{await A.post(`/products/${g}/refresh-price`,{}),h()}finally{d(!1)}},m=async g=>{confirm("Produkt wirklich entfernen?")&&(await A.delete(`/products/${g}`),h())};return c.jsxs("div",{children:[c.jsx("p",{className:"mb-2 text-sm",children:c.jsx(ee,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),c.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Produkte im Paket"}),c.jsxs("form",{onSubmit:f,className:"mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"flex-1 min-w-[240px]",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"audio4cars.de Produkt-URL *"}),c.jsx("input",{required:!0,type:"url",placeholder:"https://www.audio4cars.de/produkt/...",value:r,onChange:g=>s(g.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"w-56",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name überschreiben (optional)"}),c.jsx("input",{value:i,onChange:g=>o(g.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx("button",{disabled:u,type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Hinzufügen"})]}),a&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Produkt"}),c.jsx("th",{className:"px-4 py-2",children:"Preis"}),c.jsx("th",{className:"px-4 py-2",children:"Status"}),c.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktualisiert"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(g=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2",children:[c.jsx("a",{href:g.source_url,target:"_blank",rel:"noreferrer",className:"font-medium text-neutral-800 hover:underline dark:text-neutral-100",children:g.name_override||g.scraped_name||g.source_url}),g.scrape_status==="error"&&c.jsx("p",{className:"text-xs text-red-500",children:g.scrape_error})]}),c.jsx("td",{className:"px-4 py-2",children:UH(g.scraped_price)}),c.jsx("td",{className:"px-4 py-2",children:c.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${KH[g.scrape_status]}`,children:g.scrape_status})}),c.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:g.price_updated_at?new Date(g.price_updated_at.replace(" ","T")).toLocaleString("de-DE"):"–"}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{disabled:u,onClick:()=>p(g.id),className:"mr-3 text-brand-600 hover:underline disabled:opacity-60",children:"Preis aktualisieren"}),c.jsx("button",{onClick:()=>m(g.id),className:"text-red-600 hover:underline",children:"Entfernen"})]})]},g.id)),e.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Produkte im Paket."})})]})]})})]})}const qH=t=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t),Pw={name:"",description:"",price:0,sort_order:0};function JH(){const{packageId:t}=Qs(),[e,n]=v.useState([]),[r,s]=v.useState(Pw),[i,o]=v.useState(null),[a,l]=v.useState(""),u=()=>A.get(`/packages/${t}/upgrades`).then(n);v.useEffect(()=>{u()},[t]);const d=m=>{o(m.id),s({name:m.name,description:m.description||"",price:m.price,sort_order:m.sort_order})},h=()=>{o(null),s(Pw)},f=async m=>{m.preventDefault(),l("");const g={...r,package_id:Number(t),price:Number(r.price)};try{i?await A.put(`/package-upgrades/${i}`,g):await A.post("/package-upgrades",g),h(),u()}catch(y){l(y.message)}},p=async m=>{confirm("Upgrade wirklich löschen?")&&(await A.delete(`/package-upgrades/${m}`),u())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("p",{className:"mb-2 text-sm",children:c.jsx(ee,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Optionale Upgrades"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Upgrades erscheinen nicht in der öffentlichen Paketübersicht, sondern erst als Auswahl im Kontaktformular."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Preis"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(m=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2",children:[c.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:m.name}),m.description&&c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:m.description})]}),c.jsx("td",{className:"px-4 py-2",children:qH(m.price)}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>d(m),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>p(m.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},m.id)),e.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Upgrades hinterlegt."})})]})]})})]}),c.jsxs("form",{onSubmit:f,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:i?"Upgrade bearbeiten":"Neues Upgrade"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:r.name,onChange:m=>s({...r,name:m.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),c.jsx("textarea",{rows:2,value:r.description,onChange:m=>s({...r,description:m.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis (€) *"}),c.jsx("input",{required:!0,type:"number",step:"0.01",min:"0",value:r.price,onChange:m=>s({...r,price:m.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),c.jsx("input",{type:"number",value:r.sort_order,onChange:m=>s({...r,sort_order:Number(m.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a&&c.jsx("p",{className:"text-sm text-red-600",children:a}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:i?"Speichern":"Anlegen"}),i&&c.jsx("button",{type:"button",onClick:h,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const YH=t=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t),XH={new:"Neu",in_progress:"In Bearbeitung",done:"Erledigt"},ZH={new:"bg-brand-100 text-brand-700 dark:bg-brand-900/40 dark:text-brand-300",in_progress:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",done:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300"},QH=()=>c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"h-4 w-4",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m3 0-.8 12.1a1 1 0 0 1-1 .9H7.8a1 1 0 0 1-1-.9L6 7h12ZM10 11v6M14 11v6"})});function e7(){const{hasPermission:t}=Cn(),[e,n]=v.useState([]),[r,s]=v.useState("all"),i=()=>A.get("/contact").then(n);v.useEffect(()=>{i()},[]);const o=async(h,f)=>{await A.patch(`/contact/${h}`,{status:f}),i()},a=async h=>{confirm("Diese Kontaktanfrage wirklich unwiderruflich löschen?")&&(await A.delete(`/contact/${h}`),i())},l=v.useMemo(()=>({all:e.length,new:e.filter(h=>h.status==="new").length,in_progress:e.filter(h=>h.status==="in_progress").length,done:e.filter(h=>h.status==="done").length}),[e]),u=r==="all"?e:e.filter(h=>h.status===r),d=[{value:"all",label:"Alle"},{value:"new",label:"Neu"},{value:"in_progress",label:"In Bearbeitung"},{value:"done",label:"Erledigt"}];return c.jsxs("div",{children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Kontaktanfragen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Alle Anfragen deiner Kunden. Wähle oben einen Reiter, um nur bestimmte Anfragen zu sehen."}),c.jsx("div",{className:"mb-5 flex flex-wrap gap-2",children:d.map(h=>c.jsxs("button",{onClick:()=>s(h.value),className:`rounded-full px-4 py-1.5 text-sm font-medium transition ${r===h.value?"bg-brand-500 text-white":"bg-neutral-100 text-neutral-600 hover:bg-neutral-200 dark:bg-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-700"}`,children:[h.label," (",l[h.value],")"]},h.value))}),c.jsxs("div",{className:"space-y-3",children:[u.map(h=>{var f;return c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-2 flex flex-wrap items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"font-semibold text-neutral-800 dark:text-neutral-100",children:[h.name," · ",h.email,h.phone?` · ${h.phone}`:""]}),h.vin&&c.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["FIN: ",c.jsx("span",{className:"font-mono",children:h.vin})]}),c.jsx("p",{className:"text-xs text-neutral-400",children:new Date(h.created_at.replace(" ","T")).toLocaleString("de-DE")})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("select",{value:h.status,onChange:p=>o(h.id,p.target.value),className:`rounded-full border-0 px-3 py-1 text-xs font-medium ${ZH[h.status]}`,children:Object.entries(XH).map(([p,m])=>c.jsx("option",{value:p,children:m},p))}),t("contact.delete")&&c.jsx("button",{onClick:()=>a(h.id),"aria-label":"Anfrage löschen",title:"Anfrage löschen",className:"rounded-md p-1.5 text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20",children:c.jsx(QH,{})})]})]}),(h.brand_name||h.model_name||h.package_name||h.product_name)&&c.jsx("p",{className:"mb-2 text-sm text-neutral-500 dark:text-neutral-400",children:[h.brand_name,h.model_name,h.package_name,h.product_name].filter(Boolean).join(" · ")}),((f=h.selected_upgrades)==null?void 0:f.length)>0&&c.jsxs("div",{className:"mb-2 rounded-md bg-brand-50 p-2 text-sm text-brand-800 dark:bg-brand-900/20 dark:text-brand-200",children:[c.jsx("p",{className:"font-semibold",children:"Gewünschte Upgrades:"}),c.jsx("ul",{className:"list-disc pl-5",children:h.selected_upgrades.map(p=>c.jsxs("li",{children:[p.name," – ",YH(p.price)]},p.id))})]}),h.message&&c.jsx("p",{className:"text-sm text-neutral-700 dark:text-neutral-300",children:h.message})]},h.id)}),u.length===0&&c.jsx("p",{className:"text-neutral-400",children:r==="all"?"Noch keine Kontaktanfragen eingegangen.":"Keine Anfragen mit diesem Status."})]})]})}var Al={},t7=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},w2={},Kt={};let vx;const n7=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Kt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Kt.getSymbolTotalCodewords=function(e){return n7[e]};Kt.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Kt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');vx=e};Kt.isKanjiModeEnabled=function(){return typeof vx<"u"};Kt.toSJIS=function(e){return vx(e)};var gh={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}t.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},t.from=function(r,s){if(t.isValid(r))return r;try{return e(r)}catch{return s}}})(gh);function S2(){this.buffer=[],this.length=0}S2.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let n=0;n>>e-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var r7=S2;function Dl(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Dl.prototype.set=function(t,e,n,r){const s=t*this.size+e;this.data[s]=n,r&&(this.reservedBit[s]=!0)};Dl.prototype.get=function(t,e){return this.data[t*this.size+e]};Dl.prototype.xor=function(t,e,n){this.data[t*this.size+e]^=n};Dl.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var s7=Dl,N2={};(function(t){const e=Kt.getSymbolSize;t.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,i=e(r),o=i===145?26:Math.ceil((i-13)/(2*s-2))*2,a=[i-7];for(let l=1;l=0&&s<=7},t.from=function(s){return t.isValid(s)?parseInt(s,10):void 0},t.getPenaltyN1=function(s){const i=s.size;let o=0,a=0,l=0,u=null,d=null;for(let h=0;h=5&&(o+=e.N1+(a-5)),u=p,a=1),p=s.get(f,h),p===d?l++:(l>=5&&(o+=e.N1+(l-5)),d=p,l=1)}a>=5&&(o+=e.N1+(a-5)),l>=5&&(o+=e.N1+(l-5))}return o},t.getPenaltyN2=function(s){const i=s.size;let o=0;for(let a=0;a=10&&(a===1488||a===93)&&o++,l=l<<1&2047|s.get(d,u),d>=10&&(l===1488||l===93)&&o++}return o*e.N3},t.getPenaltyN4=function(s){let i=0;const o=s.data.length;for(let l=0;l=0;){const o=i[0];for(let l=0;l0){const i=new Uint8Array(this.degree);return i.set(r,s),i}return r};var o7=kx,M2={},us={},wx={};wx.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var zn={};const P2="[0-9]+",a7="[A-Z $%*+\\-./:]+";let cl="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";cl=cl.replace(/u/g,"\\u");const l7="(?:(?![A-Z0-9 $%*+\\-./:]|"+cl+`)(?:.|[\r +]))+`;zn.KANJI=new RegExp(cl,"g");zn.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");zn.BYTE=new RegExp(l7,"g");zn.NUMERIC=new RegExp(P2,"g");zn.ALPHANUMERIC=new RegExp(a7,"g");const c7=new RegExp("^"+cl+"$"),u7=new RegExp("^"+P2+"$"),d7=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");zn.testKanji=function(e){return c7.test(e)};zn.testNumeric=function(e){return u7.test(e)};zn.testAlphanumeric=function(e){return d7.test(e)};(function(t){const e=wx,n=zn;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(i,o){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?i.ccBits[0]:o<27?i.ccBits[1]:i.ccBits[2]},t.getBestModeForData=function(i){return n.testNumeric(i)?t.NUMERIC:n.testAlphanumeric(i)?t.ALPHANUMERIC:n.testKanji(i)?t.KANJI:t.BYTE},t.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},t.isValid=function(i){return i&&i.bit&&i.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+s)}}t.from=function(i,o){if(t.isValid(i))return i;try{return r(i)}catch{return o}}})(us);(function(t){const e=Kt,n=xh,r=gh,s=us,i=wx,o=7973,a=e.getBCHDigit(o);function l(f,p,m){for(let g=1;g<=40;g++)if(p<=t.getCapacity(g,m,f))return g}function u(f,p){return s.getCharCountIndicator(f,p)+4}function d(f,p){let m=0;return f.forEach(function(g){const y=u(g.mode,p);m+=y+g.getBitsLength()}),m}function h(f,p){for(let m=1;m<=40;m++)if(d(f,m)<=t.getCapacity(m,p,s.MIXED))return m}t.from=function(p,m){return i.isValid(p)?parseInt(p,10):m},t.getCapacity=function(p,m,g){if(!i.isValid(p))throw new Error("Invalid QR Code version");typeof g>"u"&&(g=s.BYTE);const y=e.getSymbolTotalCodewords(p),b=n.getTotalCodewordsCount(p,m),x=(y-b)*8;if(g===s.MIXED)return x;const k=x-u(g,p);switch(g){case s.NUMERIC:return Math.floor(k/10*3);case s.ALPHANUMERIC:return Math.floor(k/11*2);case s.KANJI:return Math.floor(k/13);case s.BYTE:default:return Math.floor(k/8)}},t.getBestVersionForData=function(p,m){let g;const y=r.from(m,r.M);if(Array.isArray(p)){if(p.length>1)return h(p,y);if(p.length===0)return 1;g=p[0]}else g=p;return l(g.mode,g.getLength(),y)},t.getEncodedBits=function(p){if(!i.isValid(p)||p<7)throw new Error("Invalid QR Code version");let m=p<<12;for(;e.getBCHDigit(m)-a>=0;)m^=o<=0;)s^=D2<0&&(r=this.data.substr(n),s=parseInt(r,10),e.put(s,i*3+1))};var p7=ao;const m7=us,Hf=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function lo(t){this.mode=m7.ALPHANUMERIC,this.data=t}lo.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};lo.prototype.getLength=function(){return this.data.length};lo.prototype.getBitsLength=function(){return lo.getBitsLength(this.data.length)};lo.prototype.write=function(e){let n;for(n=0;n+2<=this.data.length;n+=2){let r=Hf.indexOf(this.data[n])*45;r+=Hf.indexOf(this.data[n+1]),e.put(r,11)}this.data.length%2&&e.put(Hf.indexOf(this.data[n]),6)};var g7=lo;const x7=us;function co(t){this.mode=x7.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}co.getBitsLength=function(e){return e*8};co.prototype.getLength=function(){return this.data.length};co.prototype.getBitsLength=function(){return co.getBitsLength(this.data.length)};co.prototype.write=function(t){for(let e=0,n=this.data.length;e=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` +Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),t.put(n,13)}};var k7=uo,R2={exports:{}};(function(t){var e={single_source_shortest_paths:function(n,r,s){var i={},o={};o[r]=0;var a=e.PriorityQueue.make();a.push(r,0);for(var l,u,d,h,f,p,m,g,y;!a.empty();){l=a.pop(),u=l.value,h=l.cost,f=n[u]||{};for(d in f)f.hasOwnProperty(d)&&(p=f[d],m=h+p,g=o[d],y=typeof o[d]>"u",(y||g>m)&&(o[d]=m,a.push(d,m),i[d]=u))}if(typeof s<"u"&&typeof o[s]>"u"){var b=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(b)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],i=r;i;)s.push(i),n[i],i=n[i];return s.reverse(),s},find_path:function(n,r,s){var i=e.single_source_shortest_paths(n,r,s);return e.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(n){var r=e.PriorityQueue,s={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(R2);var w7=R2.exports;(function(t){const e=us,n=p7,r=g7,s=y7,i=k7,o=zn,a=Kt,l=w7;function u(b){return unescape(encodeURIComponent(b)).length}function d(b,x,k){const w=[];let C;for(;(C=b.exec(k))!==null;)w.push({data:C[0],index:C.index,mode:x,length:C[0].length});return w}function h(b){const x=d(o.NUMERIC,e.NUMERIC,b),k=d(o.ALPHANUMERIC,e.ALPHANUMERIC,b);let w,C;return a.isKanjiModeEnabled()?(w=d(o.BYTE,e.BYTE,b),C=d(o.KANJI,e.KANJI,b)):(w=d(o.BYTE_KANJI,e.BYTE,b),C=[]),x.concat(k,w,C).sort(function(S,N){return S.index-N.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function f(b,x){switch(x){case e.NUMERIC:return n.getBitsLength(b);case e.ALPHANUMERIC:return r.getBitsLength(b);case e.KANJI:return i.getBitsLength(b);case e.BYTE:return s.getBitsLength(b)}}function p(b){return b.reduce(function(x,k){const w=x.length-1>=0?x[x.length-1]:null;return w&&w.mode===k.mode?(x[x.length-1].data+=k.data,x):(x.push(k),x)},[])}function m(b){const x=[];for(let k=0;k=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?t.set(i+a,o+l,!0,!0):t.set(i+a,o+l,!1,!0))}}function A7(t){const e=t.size;for(let n=8;n>a&1)===1,t.set(s,i,o,!0),t.set(i,s,o,!0)}function Kf(t,e,n){const r=t.size,s=T7.getEncodedBits(e,n);let i,o;for(i=0;i<15;i++)o=(s>>i&1)===1,i<6?t.set(i,8,o,!0):i<8?t.set(i+1,8,o,!0):t.set(r-15+i,8,o,!0),i<8?t.set(8,r-i-1,o,!0):i<9?t.set(8,15-i-1+1,o,!0):t.set(8,15-i-1,o,!0);t.set(r-8,8,1,!0)}function R7(t,e){const n=t.size;let r=-1,s=n-1,i=7,o=0;for(let a=n-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!t.isReserved(s,a-l)){let u=!1;o>>i&1)===1),t.set(s,a-l,u),i--,i===-1&&(o++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function _7(t,e,n){const r=new S7;n.forEach(function(l){r.put(l.mode.bit,4),r.put(l.getLength(),M7.getCharCountIndicator(l.mode,t)),l.write(r)});const s=bh.getSymbolTotalCodewords(t),i=cg.getTotalCodewordsCount(t,e),o=(s-i)*8;for(r.getLengthInBits()+4<=o&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(o-r.getLengthInBits())/8;for(let l=0;l=7&&L7(l,e),R7(l,o),isNaN(r)&&(r=lg.getBestMask(l,Kf.bind(null,l,n))),lg.applyMask(r,l),Kf(l,n,r),{modules:l,version:e,errorCorrectionLevel:n,maskPattern:r,segments:s}}k2.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let r=Wf.M,s,i;return typeof n<"u"&&(r=Wf.from(n.errorCorrectionLevel,Wf.M),s=Cd.from(n.version),i=lg.from(n.maskPattern),n.toSJISFunc&&bh.setToSJISFunction(n.toSJISFunc)),O7(e,s,r,i)};var R2={},wx={};(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:i,scale:i?4:o,margin:s,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},t.getImageWidth=function(r,s){const i=t.getScale(r,s);return Math.floor((r+s.margin*2)*i)},t.qrToImageData=function(r,s,i){const o=s.modules.size,a=s.modules.data,l=t.getScale(o,i),u=Math.floor((o+i.margin*2)*l),d=i.margin*l,h=[i.color.light,i.color.dark];for(let f=0;f=d&&p>=d&&f"u"&&(!o||!o.getContext)&&(l=o,o=void 0),o||(u=r()),l=e.getOptions(l);const d=e.getImageWidth(i.modules.size,l),h=u.getContext("2d"),f=h.createImageData(d,d);return e.qrToImageData(f.data,i,l),n(h,u,d),h.putImageData(f,0,0),u},t.renderToDataURL=function(i,o,a){let l=a;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),l||(l={});const u=t.render(i,o,l),d=l.type||"image/png",h=l.rendererOpts||{};return u.toDataURL(d,h.quality)}})(R2);var _2={};const B7=wx;function Dw(t,e){const n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function Gf(t,e,n){let r=t+e;return typeof n<"u"&&(r+=" "+n),r}function z7(t,e,n){let r="",s=0,i=!1,o=0;for(let a=0;a0&&l>0&&t[a-1]||(r+=i?Gf("M",l+n,.5+u+n):Gf("m",s,0),s=0,i=!1),l+1':"",u="',d='viewBox="0 0 '+a+" "+a+'"',f=''+l+u+` -`;return typeof r=="function"&&r(null,f),f};const F7=t7,ug=k2,I2=R2,V7=_2;function Sx(t,e,n,r,s){const i=[].slice.call(arguments,1),o=i.length,a=typeof i[o-1]=="function";if(!a&&!F7())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(s=n,n=e,e=r=void 0):o===3&&(e.getContext&&typeof s>"u"?(s=r,r=void 0):(s=r,r=n,n=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(n=e,e=r=void 0):o===2&&!e.getContext&&(r=n,n=e,e=void 0),new Promise(function(l,u){try{const d=ug.create(n,r);l(t(d,e,r))}catch(d){u(d)}})}try{const l=ug.create(n,r);s(null,t(l,e,r))}catch(l){s(l)}}Al.create=ug.create;Al.toCanvas=Sx.bind(null,I2.render);Al.toDataURL=Sx.bind(null,I2.renderToDataURL);Al.toString=Sx.bind(null,function(t,e,n){return V7.render(t,n)});const Lw={current_password:"",new_password:"",new_password_confirmation:"",two_factor_code:""};function $7(){const{user:t,refreshUser:e}=Cn(),[n,r]=v.useState("idle"),[s,i]=v.useState(""),[o,a]=v.useState(""),[l,u]=v.useState(""),[d,h]=v.useState(""),[f,p]=v.useState([]),[m,g]=v.useState(""),[y,b]=v.useState(!1),[x,k]=v.useState(Lw),[w,C]=v.useState(""),[E,S]=v.useState(""),[N,M]=v.useState(!1),j=async B=>{if(B.preventDefault(),C(""),S(""),x.new_password!==x.new_password_confirmation){C("Die neuen Passwörter stimmen nicht überein");return}M(!0);try{await A.post("/auth/change-password",x),k(Lw),S("Passwort erfolgreich geändert.")}catch(Z){C(Z.message)}finally{M(!1)}},T=async()=>{g(""),b(!0);try{const B=await A.get("/auth/2fa/setup");a(B.secret),i(await Al.toDataURL(B.otpauth_url)),u(""),r("setup")}catch(B){g(B.message)}finally{b(!1)}},R=async B=>{B.preventDefault(),g(""),b(!0);try{const Z=await A.post("/auth/2fa/enable",{code:l});p(Z.recovery_codes),r("recovery-codes"),await e()}catch(Z){g(Z.message)}finally{b(!1)}},$=()=>{r("idle"),p([]),h("")},L=async B=>{B.preventDefault(),g(""),b(!0);try{await A.post("/auth/2fa/disable",{password:d}),h(""),r("idle"),await e()}catch(Z){g(Z.message)}finally{b(!1)}},W=async B=>{B.preventDefault(),g(""),b(!0);try{const Z=await A.post("/auth/2fa/recovery-codes",{password:d});p(Z.recovery_codes),r("recovery-codes")}catch(Z){g(Z.message)}finally{b(!1)}};return c.jsxs("div",{className:"max-w-xl",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Mein Konto"}),c.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Angemeldet als ",c.jsx("strong",{children:t==null?void 0:t.username}),t!=null&&t.is_super_admin?" (Super-Admin)":"","."]}),c.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Passwort ändern"}),c.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Vergib ein neues Passwort für dein Konto.",(t==null?void 0:t.two_factor_enabled)&&" Da 2FA aktiv ist, musst du die Änderung zusätzlich mit deinem Code bestätigen."]}),c.jsxs("form",{onSubmit:j,children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aktuelles Passwort"}),c.jsx("input",{type:"password",value:x.current_password,onChange:B=>k({...x,current_password:B.target.value}),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort"}),c.jsx("input",{type:"password",value:x.new_password,onChange:B=>k({...x,new_password:B.target.value}),required:!0,minLength:8,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort wiederholen"}),c.jsx("input",{type:"password",value:x.new_password_confirmation,onChange:B=>k({...x,new_password_confirmation:B.target.value}),required:!0,minLength:8,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),(t==null?void 0:t.two_factor_enabled)&&c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"2FA-Code zur Bestätigung"}),c.jsx("input",{value:x.two_factor_code,onChange:B=>k({...x,two_factor_code:B.target.value}),required:!0,inputMode:"numeric",placeholder:"123456 oder Wiederherstellungscode",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),w&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),E&&c.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:E}),c.jsx("button",{type:"submit",disabled:N,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:N?"Wird geändert…":"Passwort ändern"})]})]}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Zwei-Faktor-Authentifizierung"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Schützt dein Konto zusätzlich mit einem Code aus der Google Authenticator App."}),n==="idle"&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"mb-4 text-sm",children:["Status:"," ",t!=null&&t.two_factor_enabled?c.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"Aktiv"}):c.jsx("span",{className:"font-semibold text-neutral-500 dark:text-neutral-400",children:"Nicht aktiv"})]}),t!=null&&t.two_factor_enabled?c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{onClick:()=>{r("regenerate"),g("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Neue Wiederherstellungscodes erzeugen"}),c.jsx("button",{onClick:()=>{r("disable"),g("")},className:"rounded-md border border-red-300 px-4 py-2 text-sm font-medium text-red-600 hover:bg-red-50 dark:border-red-900 dark:hover:bg-red-900/20",children:"2FA deaktivieren"})]}):c.jsx("button",{onClick:T,disabled:y,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"2FA aktivieren"})]}),n==="setup"&&c.jsxs("form",{onSubmit:R,children:[c.jsxs("ol",{className:"mb-4 list-decimal space-y-2 pl-5 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("li",{children:"Öffne die Google Authenticator App (oder eine kompatible App)."}),c.jsx("li",{children:"Scanne den folgenden QR-Code:"})]}),c.jsx("div",{className:"mb-4 flex justify-center",children:s&&c.jsx("img",{src:s,alt:"QR-Code für Zwei-Faktor-Authentifizierung",className:"h-48 w-48 rounded-lg border border-neutral-200 dark:border-neutral-700"})}),c.jsxs("p",{className:"mb-4 text-center text-xs text-neutral-500 dark:text-neutral-400",children:["Geht das Scannen nicht? Gib diesen Code manuell ein: ",c.jsx("br",{}),c.jsx("code",{className:"mt-1 inline-block rounded bg-neutral-100 px-2 py-1 font-mono tracking-wider dark:bg-neutral-800",children:o})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Bestätigungscode aus der App"}),c.jsx("input",{value:l,onChange:B=>u(B.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",disabled:y,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Bestätigen & aktivieren"}),c.jsx("button",{type:"button",onClick:()=>r("idle"),className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="recovery-codes"&&c.jsxs("div",{children:[c.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Wiederherstellungscodes – jetzt sicher speichern!"}),c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Jeder Code funktioniert einmalig, falls du keinen Zugriff mehr auf die Authenticator-App hast. Diese Codes werden nur jetzt angezeigt."}),c.jsx("div",{className:"mb-4 grid grid-cols-2 gap-2 rounded-md bg-neutral-100 p-4 font-mono text-sm dark:bg-neutral-800",children:f.map(B=>c.jsx("span",{children:B},B))}),c.jsx("button",{onClick:$,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Ich habe die Codes gespeichert"})]}),n==="disable"&&c.jsxs("form",{onSubmit:L,children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),c.jsx("input",{type:"password",value:d,onChange:B=>h(B.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",disabled:y,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-60",children:"2FA jetzt deaktivieren"}),c.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="regenerate"&&c.jsxs("form",{onSubmit:W,children:[c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Die bisherigen Wiederherstellungscodes werden ungültig."}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),c.jsx("input",{type:"password",value:d,onChange:B=>h(B.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",disabled:y,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Neue Codes erzeugen"}),c.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})]})}const Rw={username:"",password:"",is_super_admin:!1,permissions:[],group_ids:[]};function H7(t){return t?new Date(t.replace(" ","T")).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Noch nie"}function W7(){const{user:t,hasPermission:e}=Cn(),[n,r]=v.useState([]),[s,i]=v.useState([]),[o,a]=v.useState([]),[l,u]=v.useState(Rw),[d,h]=v.useState(null),[f,p]=v.useState(!1),[m,g]=v.useState(""),y=()=>{A.get("/admin-users").then(r),A.get("/permissions/catalog").then(i),(e("permission_groups.manage")||e("users.manage"))&&A.get("/permission-groups").then(a)};v.useEffect(y,[]);const b=S=>{h(S.id),p(S.is_primary),u({username:S.username,password:"",is_super_admin:S.is_super_admin,permissions:S.permissions,group_ids:S.groups.map(N=>N.id)})},x=()=>{h(null),p(!1),u(Rw)},k=S=>{u(N=>({...N,permissions:N.permissions.includes(S)?N.permissions.filter(M=>M!==S):[...N.permissions,S]}))},w=S=>{u(N=>({...N,group_ids:N.group_ids.includes(S)?N.group_ids.filter(M=>M!==S):[...N.group_ids,S]}))},C=async S=>{S.preventDefault(),g("");try{if(d)await A.put(`/admin-users/${d}`,l);else{if(l.password.length<8){g("Passwort muss mindestens 8 Zeichen lang sein");return}await A.post("/admin-users",l)}x(),y()}catch(N){g(N.message)}},E=async S=>{if(confirm("Diesen Benutzer wirklich löschen?"))try{await A.delete(`/admin-users/${S}`),y()}catch(N){alert(N.message)}};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Benutzer"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Jeder Mitarbeiter bekommt ein eigenes Konto mit genau den Rechten, die er braucht."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Benutzername"}),c.jsx("th",{className:"px-4 py-2",children:"Rolle"}),c.jsx("th",{className:"px-4 py-2",children:"Berechtigungsgruppen"}),c.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktiv"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[n.map(S=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:[S.username,S.id===(t==null?void 0:t.id)&&c.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(du)"}),S.is_primary&&c.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(Erst-Administrator)"})]}),c.jsx("td",{className:"px-4 py-2",children:S.is_super_admin?c.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-medium text-brand-700 dark:bg-brand-900/40 dark:text-brand-300",children:"Super-Admin"}):c.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400",children:[S.permissions.length," Einzelrechte"]})}),c.jsx("td",{className:"px-4 py-2",children:c.jsxs("div",{className:"flex flex-wrap gap-1",children:[S.groups.map(N=>c.jsx("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:N.name},N.id)),S.groups.length===0&&"–"]})}),c.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:H7(S.last_active_at)}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>b(S),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),S.id!==(t==null?void 0:t.id)&&!S.is_primary&&c.jsx("button",{onClick:()=>E(S.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},S.id)),n.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Benutzer angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:C,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:d?"Benutzer bearbeiten":"Neuer Benutzer"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername *"}),c.jsx("input",{required:!0,value:l.username,onChange:S=>u({...l,username:S.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",d?"(leer lassen = unverändert)":"*"]}),c.jsx("input",{type:"password",required:!d,value:l.password,onChange:S=>u({...l,password:S.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),(t==null?void 0:t.is_super_admin)&&c.jsxs("div",{children:[c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:l.is_super_admin,disabled:f,onChange:S=>u({...l,is_super_admin:S.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500 disabled:opacity-50"}),"Super-Admin (hat automatisch alle Rechte)"]}),f&&c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Der Erst-Administrator behält immer den Super-Admin-Status."})]}),!l.is_super_admin&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Einzelne Berechtigungen"}),c.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:s.map(S=>c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:l.permissions.includes(S.key),onChange:()=>k(S.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),S.label]},S.key))})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungsgruppen"}),c.jsxs("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:[o.map(S=>c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:l.group_ids.includes(S.id),onChange:()=>w(S.id),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),S.name]},S.id)),o.length===0&&c.jsx("p",{className:"text-sm text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})]})]})]}),m&&c.jsx("p",{className:"text-sm text-red-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:d?"Speichern":"Anlegen"}),d&&c.jsx("button",{type:"button",onClick:x,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const _w={name:"",description:"",permissions:[]};function U7(){const[t,e]=v.useState([]),[n,r]=v.useState([]),[s,i]=v.useState(_w),[o,a]=v.useState(null),[l,u]=v.useState(""),d=()=>{A.get("/permission-groups").then(e),A.get("/permissions/catalog").then(r)};v.useEffect(d,[]);const h=y=>{a(y.id),i({name:y.name,description:y.description||"",permissions:y.permissions})},f=()=>{a(null),i(_w)},p=y=>{i(b=>({...b,permissions:b.permissions.includes(y)?b.permissions.filter(x=>x!==y):[...b.permissions,y]}))},m=async y=>{y.preventDefault(),u("");try{o?await A.put(`/permission-groups/${o}`,s):await A.post("/permission-groups",s),f(),d()}catch(b){u(b.message)}},g=async y=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await A.delete(`/permission-groups/${y}`),d())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Fasse mehrere Berechtigungen zu einer Gruppe zusammen (z. B. „Werkstatt"), die du dann bequem einem oder mehreren Benutzern zuweisen kannst.'}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(y=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2",children:[c.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:y.name}),y.description&&c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:y.description})]}),c.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[y.permissions.length," von ",n.length]}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>h(y),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>g(y.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},y.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:m,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:o?"Gruppe bearbeiten":"Neue Gruppe"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:s.name,onChange:y=>i({...s,name:y.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),c.jsx("textarea",{rows:2,value:s.description,onChange:y=>i({...s,description:y.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),c.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:n.map(y=>c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:s.permissions.includes(y.key),onChange:()=>p(y.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),y.label]},y.key))})]}),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o?"Speichern":"Anlegen"}),o&&c.jsx("button",{type:"button",onClick:f,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const K7=[{to:"/admin/settings/website",label:"Website"},{to:"/admin/settings/legal",label:"Rechtstexte"},{to:"/admin/settings/email",label:"E-Mail"},{to:"/admin/settings/database",label:"Datenbank"},{to:"/admin/settings/export-import",label:"Export & Import"},{to:"/admin/settings/maintenance",label:"Wartungsmodus"},{to:"/admin/settings/update",label:"Updates",permission:"system.update"},{to:"/admin/settings/reset",label:"Zurücksetzen"}];function G7(){const{hasPermission:t}=Cn(),e=K7.filter(r=>!r.permission||t(r.permission)),n=({isActive:r})=>`rounded-md px-4 py-2 text-sm font-medium transition ${r?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`;return c.jsxs("div",{children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Einstellungen"}),c.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Werkzeuge rund um Datenbank, Server-Umzug und Zurücksetzen dieser Seite."}),c.jsx("nav",{className:"mb-6 flex flex-wrap gap-2",children:e.map(r=>c.jsx(QS,{to:r.to,className:n,children:r.label},r.to))}),c.jsx(Kd,{})]})}const O2=[{key:"mon",label:"Montag"},{key:"tue",label:"Dienstag"},{key:"wed",label:"Mittwoch"},{key:"thu",label:"Donnerstag"},{key:"fri",label:"Freitag"},{key:"sat",label:"Samstag"},{key:"sun",label:"Sonntag"}],B2=Object.fromEntries(O2.map(t=>[t.key,{open:"09:00",close:"18:00",closed:!1}])),q7={phone:"",whatsapp:"",contact_email:"",address_street:"",address_zip:"",address_city:"",logo_path:"",logo_dark_path:"",business_hours:B2,hero_image_path:"",ga_measurement_id:"",package_card_theme:"graphite",package_card_layout:"strip",package_wheel_hint_interval:8,gallery_card_text_x:0,gallery_card_text_y:100},J7=[{value:"graphite",label:"Graphite Green",description:"Graphit über Bronze/Silber/Gold/Platin bis zur Onyx-Krönung."},{value:"deep-blue",label:"Deep Blue Luxury",description:"Kühles Blau, das sich über Grün zu Gold erwärmt."},{value:"warm-bronze",label:"Warm Bronze",description:"Durchgehend warmes Kupfer/Bronze/Amber bis zum Gold."}],Y7=[{value:"grid",label:"Raster",description:"Breite Kacheln, die responsiv in mehrere Zeilen umbrechen."},{value:"strip",label:"Scroll-Band",description:"Schmale, hochkant Kacheln in einer horizontal scrollbaren Reihe."},{value:"coverflow",label:"3D-Coverflow",description:"Kacheln drehen sich beim Wischen räumlich – die mittlere steht im Fokus."}];function X7(){const[t,e]=v.useState(q7),[n,r]=v.useState(!0),[s,i]=v.useState(!1),[o,a]=v.useState(!1),[l,u]=v.useState(""),[d,h]=v.useState(null),f=v.useRef(null),[p,m]=v.useState(!1),g=(D,oe)=>{const Me=f.current.getBoundingClientRect();return{x:Math.max(0,Math.min(100,Math.round((D-Me.left)/Me.width*100))),y:Math.max(0,Math.min(100,Math.round((oe-Me.top)/Me.height*100)))}},y=(D,oe)=>{const{x:Me,y:fs}=g(D,oe);e(F2=>({...F2,gallery_card_text_x:Me,gallery_card_text_y:fs})),a(!1)},b=D=>{D.preventDefault(),D.currentTarget.setPointerCapture(D.pointerId),m(!0),y(D.clientX,D.clientY)},x=D=>{p&&y(D.clientX,D.clientY)},k=D=>{m(!1),D.currentTarget.releasePointerCapture(D.pointerId)},[w,C]=v.useState(""),[E,S]=v.useState(""),[N,M]=v.useState(!1),[j,T]=v.useState(!1),[R,$]=v.useState(""),[L,W]=v.useState(!1),[B,Z]=v.useState(""),[_,I]=v.useState(""),[V,K]=v.useState(!1),[te,Se]=v.useState(null),[se,he]=v.useState(!1),[Te,lt]=v.useState(""),[vh,ni]=v.useState(!1),[ri,ko]=v.useState(!1);v.useEffect(()=>{A.get("/site-settings").then(D=>e({phone:D.phone||"",whatsapp:D.whatsapp||"",contact_email:D.contact_email||"",address_street:D.address_street||"",address_zip:D.address_zip||"",address_city:D.address_city||"",logo_path:D.logo_path||"",logo_dark_path:D.logo_dark_path||"",business_hours:D.business_hours||B2,hero_image_path:D.hero_image_path||"",ga_measurement_id:D.ga_measurement_id||"",package_card_theme:D.package_card_theme||"graphite",package_card_layout:D.package_card_layout||"strip",package_wheel_hint_interval:D.package_wheel_hint_interval||8,gallery_card_text_x:D.gallery_card_text_x??0,gallery_card_text_y:D.gallery_card_text_y??100})).finally(()=>r(!1)),A.get("/gallery-brands").then(D=>h(D.find(oe=>oe.cover_image_path)||null)).catch(()=>{}),A.get("/settings/analytics").then(D=>{C(D.ga_property_id||""),M(D.has_credentials)}),P()},[]);const P=()=>{A.get("/settings/google-reviews").then(D=>{Z(D.place_id||""),K(D.has_api_key),Se(D)})},X=async()=>{he(!0),lt(""),ni(!1);try{const D=await A.post("/settings/google-reviews",{place_id:B,api_key:_});K(D.has_api_key),Se(D),I(""),ni(!0)}catch(D){lt(D.message)}finally{he(!1)}},ie=async()=>{ko(!0),lt("");try{const D=await A.post("/settings/google-reviews/refresh",{});Se(D)}catch(D){lt(D.message),P()}finally{ko(!1)}},ct=async()=>{T(!0),$(""),W(!1);try{const D=await A.post("/settings/analytics",{ga_property_id:w,service_account_json:E});M(D.has_credentials),S(""),W(!0)}catch(D){$(D.message)}finally{T(!1)}},ke=(D,oe)=>{e(Me=>({...Me,[D]:oe})),a(!1)},ds=(D,oe,Me)=>{e(fs=>({...fs,business_hours:{...fs.business_hours,[D]:{...fs.business_hours[D],[oe]:Me}}})),a(!1)},hs=async D=>{D.preventDefault(),i(!0),u(""),a(!1);try{await A.post("/site-settings",t),a(!0)}catch(oe){u(oe.message)}finally{i(!1)}};return n?c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):c.jsxs("form",{onSubmit:hs,className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Startseiten-Bild"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das große Hero-Bild ganz oben auf der Startseite. Ohne eigenes Bild wird das Standardbild verwendet."}),c.jsx(tr,{value:t.hero_image_path,onChange:D=>ke("hero_image_path",D),label:"Bild",aspect:16/9})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Firmenlogo"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Ohne eigenes Logo wird das Standard-Logo dieser Vorlage angezeigt. Für den Dunkelmodus kann eine eigene Variante hinterlegt werden (z. B. mit heller statt dunkler Wortmarke)."}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsx(tr,{value:t.logo_path,onChange:D=>ke("logo_path",D),label:"Logo (Hellmodus)"}),c.jsx(tr,{value:t.logo_dark_path,onChange:D=>ke("logo_dark_path",D),label:"Logo (Dunkelmodus)"})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktdaten"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird im Header, Footer und auf der Kontaktseite angezeigt."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Telefon"}),c.jsx("input",{value:t.phone,onChange:D=>ke("phone",D.target.value),placeholder:"09373 20 62 390",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"WhatsApp Business Nummer"}),c.jsx("input",{value:t.whatsapp,onChange:D=>ke("whatsapp",D.target.value),placeholder:"z. B. 09373 20 62 390",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Leer lassen, um den WhatsApp-Link im Header auszublenden."})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail"}),c.jsx("input",{type:"email",value:t.contact_email,onChange:D=>ke("contact_email",D.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px_1fr]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Straße & Hausnummer"}),c.jsx("input",{value:t.address_street,onChange:D=>ke("address_street",D.target.value),placeholder:"Boxbrunner Str. 20a",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"PLZ"}),c.jsx("input",{value:t.address_zip,onChange:D=>ke("address_zip",D.target.value),placeholder:"63916",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Ort"}),c.jsx("input",{value:t.address_city,onChange:D=>ke("address_city",D.target.value),placeholder:"Amorbach",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Öffnungszeiten"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Wird im Footer und auf der Kontaktseite angezeigt, inklusive dem "Geöffnet/Geschlossen"-Hinweis im Footer, der live gegen diese Zeiten rechnet.'}),c.jsx("div",{className:"space-y-2",children:O2.map(D=>{const oe=t.business_hours[D.key]||{open:"",close:"",closed:!1};return c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx("span",{className:"w-24 shrink-0 text-sm text-neutral-600 dark:text-neutral-300",children:D.label}),c.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-neutral-500 dark:text-neutral-400",children:[c.jsx("input",{type:"checkbox",checked:!oe.closed,onChange:Me=>ds(D.key,"closed",!Me.target.checked),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"geöffnet"]}),!oe.closed&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"time",value:oe.open,onChange:Me=>ds(D.key,"open",Me.target.value),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("span",{className:"text-neutral-400",children:"–"}),c.jsx("input",{type:"time",value:oe.close,onChange:Me=>ds(D.key,"close",Me.target.value),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]},D.key)})})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Paket-Kachel-Design"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Bestimmt die Farbgebung der Paket-Stufen auf jeder Fahrzeug-Modell-Seite (von der günstigsten bis zur teuersten Option)."}),c.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:J7.map(D=>c.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${t.package_card_theme===D.value?"border-brand-500 ring-2 ring-brand-500/40":"border-neutral-300 hover:border-neutral-400 dark:border-neutral-700 dark:hover:border-neutral-600"}`,children:[c.jsx("input",{type:"radio",name:"package_card_theme",value:D.value,checked:t.package_card_theme===D.value,onChange:oe=>ke("package_card_theme",oe.target.value),className:"sr-only"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:D.label}),c.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:D.description})]},D.value))})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kachel-Layout"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Bestimmt, wie die Paket-Stufen auf jeder Fahrzeug-Modell-Seite angeordnet werden."}),c.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:Y7.map(D=>c.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${t.package_card_layout===D.value?"border-brand-500 ring-2 ring-brand-500/40":"border-neutral-300 hover:border-neutral-400 dark:border-neutral-700 dark:hover:border-neutral-600"}`,children:[c.jsx("input",{type:"radio",name:"package_card_layout",value:D.value,checked:t.package_card_layout===D.value,onChange:oe=>ke("package_card_layout",oe.target.value),className:"sr-only"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:D.label}),c.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:D.description})]},D.value))}),c.jsxs("div",{className:"mt-5 max-w-xs",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Mausrad-Hinweis: Wiederholung (Sekunden)"}),c.jsx("input",{type:"number",min:"2",max:"120",value:t.package_wheel_hint_interval,onChange:D=>ke("package_wheel_hint_interval",D.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:'Nur bei Scroll-Band/3D-Coverflow: Solange ein Besucher noch auf der ersten Kachel steht, wird der "mit dem Mausrad blättern"-Hinweis in diesem Abstand wiederholt.'})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Bildergalerie-Kacheln"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Position des Marken-/Projekt-Namens auf den Kacheln der Bildergalerie-Übersicht und der Marken-Detailseite."}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-[16rem_1fr] sm:items-start",children:[c.jsxs("div",{children:[c.jsxs("div",{ref:f,className:"relative aspect-[4/3] select-none overflow-hidden rounded-xl bg-neutral-900 shadow-sm",children:[d?c.jsx("img",{src:d.cover_image_path,alt:"",draggable:!1,className:"h-full w-full object-cover"}):c.jsx("div",{className:"h-full w-full bg-gradient-to-br from-neutral-700 to-neutral-900"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent"}),c.jsx("span",{onPointerDown:b,onPointerMove:x,onPointerUp:k,style:{...Xi(t.gallery_card_text_x,t.gallery_card_text_y,{x:0,y:100}),touchAction:"none"},className:`absolute select-none whitespace-nowrap rounded p-3 text-sm font-extrabold text-white transition-colors ${p?"cursor-grabbing bg-white/10 ring-2 ring-brand-400":"cursor-grab hover:bg-white/10"}`,children:d?d.name:"Beispiel-Marke"})]}),c.jsx("p",{className:"mt-1.5 text-center text-xs text-neutral-400",children:"Namen zum Verschieben ziehen"})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:pt-1",children:[c.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Position:"," ",c.jsxs("span",{className:"font-mono font-semibold text-neutral-700 dark:text-neutral-200",children:[t.gallery_card_text_x,"% / ",t.gallery_card_text_y,"%"]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl waagerecht"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:()=>ke("gallery_card_text_x",0),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Links"}),c.jsx("button",{type:"button",onClick:()=>ke("gallery_card_text_x",50),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Mittig"}),c.jsx("button",{type:"button",onClick:()=>ke("gallery_card_text_x",100),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Rechts"})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl senkrecht"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:()=>ke("gallery_card_text_y",0),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Oben"}),c.jsx("button",{type:"button",onClick:()=>ke("gallery_card_text_y",50),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Mittig"}),c.jsx("button",{type:"button",onClick:()=>ke("gallery_card_text_y",100),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Unten"})]})]})]})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird erst geladen, nachdem ein Besucher der Statistik-Kategorie im Cookie-Banner zugestimmt hat. Leer lassen, um Google Analytics zu deaktivieren."}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Measurement-ID"}),c.jsx("input",{value:t.ga_measurement_id,onChange:D=>ke("ga_measurement_id",D.target.value),placeholder:"G-XXXXXXXXXX",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"mt-5 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[c.jsx("h3",{className:"mb-1 text-sm font-semibold text-neutral-900 dark:text-white",children:"Dashboard-Anbindung (optional)"}),c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Zeigt Besucherzahlen direkt in deinem Admin-Dashboard an. Braucht ein Google-Cloud-Service-Account mit Lesezugriff auf diese GA4-Property."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Property-ID"}),c.jsx("input",{value:w,onChange:D=>{C(D.target.value),W(!1)},placeholder:"z. B. 123456789",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Nicht die Measurement-ID (G-...) - zu finden unter GA4 → Verwaltung → Property-Details."})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Service-Account-JSON-Schlüssel ",N?"(leer lassen = unverändert)":""]}),c.jsx("textarea",{rows:4,value:E,onChange:D=>{S(D.target.value),W(!1)},placeholder:N?'{ "type": "service_account", ... } (bereits hinterlegt)':'{ "type": "service_account", ... }',className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 font-mono text-xs dark:border-neutral-700 dark:bg-neutral-900"})]})]}),R&&c.jsx("p",{className:"mt-2 text-sm text-red-600",children:R}),L&&c.jsx("p",{className:"mt-2 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"button",onClick:ct,disabled:j,className:"mt-3 rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:j?"Speichere…":"Dashboard-Anbindung speichern"})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google-Rezensionen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Zeigt die echte Google-Bewertung und die aktuellsten Rezensionen auf der Startseite an, statt der fest eingetragenen Beispiel-Texte. Wird einmal täglich automatisch aktualisiert (nie bei einem Seitenbesuch selbst) – die Seite zeigt also immer den letzten erfolgreich abgerufenen Stand."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Place-ID"}),c.jsx("input",{value:B,onChange:D=>{Z(D.target.value),ni(!1)},placeholder:"z. B. ChIJN1t_tDeuEmsRUsoyG83frY4",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Eindeutige Google-Kennung eures Eintrags – zu finden über den"," ",c.jsx("a",{href:"https://developers.google.com/maps/documentation/places/web-service/place-id#find-id",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-600",children:"Google Place ID Finder"}),"."]})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Places-API-Key ",V?"(leer lassen = unverändert)":""]}),c.jsx("input",{value:_,onChange:D=>{I(D.target.value),ni(!1)},placeholder:V?"••••••••••••••••••••• (bereits hinterlegt)":"AIzaSy…",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 font-mono text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Aus der Google-Cloud-Console, mit aktivierter „Places API (New)“."})]})]}),Te&&c.jsx("p",{className:"mt-3 text-sm text-red-600",children:Te}),vh&&c.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[c.jsx("button",{type:"button",onClick:X,disabled:se,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:se?"Speichere…":"Google-Rezensionen-Einstellungen speichern"}),c.jsx("button",{type:"button",onClick:ie,disabled:ri||!B||!V,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:ri?"Aktualisiere…":"Jetzt aktualisieren"})]}),te&&c.jsxs("div",{className:"mt-4 rounded-md bg-neutral-50 p-3 text-sm dark:bg-neutral-800/50",children:[te.rating!=null?c.jsxs("p",{className:"text-neutral-700 dark:text-neutral-300",children:["Aktuell hinterlegt: ",c.jsxs("strong",{children:[te.rating," ★"]})," (",te.rating_count," Bewertungen)",te.updated_at&&c.jsxs(c.Fragment,{children:[" – zuletzt aktualisiert am ",new Date(te.updated_at.replace(" ","T")).toLocaleString("de-DE")]})]}):c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:"Noch keine erfolgreiche Aktualisierung – die Startseite zeigt bis dahin weiter die Beispiel-Rezensionen."}),te.error&&c.jsxs("p",{className:"mt-1 text-red-600",children:["Letzter Fehler: ",te.error]})]})]}),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),o&&c.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}const Z7=[{slug:"impressum",label:"Impressum"},{slug:"datenschutz",label:"Datenschutzerklärung"},{slug:"agb",label:"AGB"}];function Q7(){const[t,e]=v.useState(null),[n,r]=v.useState("impressum"),[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(!1);if(v.useEffect(()=>{A.get("/legal-pages").then(e)},[]),!t)return c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const d=t[n],h=(p,m)=>{e(g=>({...g,[n]:{...g[n],[p]:m}})),u(!1)},f=async()=>{i(!0),a(""),u(!1);try{await A.put(`/legal-pages/${n}`,{title:d.title,body_html:d.body_html}),u(!0)}catch(p){a(p.message)}finally{i(!1)}};return c.jsx("div",{className:"max-w-3xl space-y-6",children:c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Rechtstexte"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Impressum, Datenschutzerklärung und AGB direkt hier pflegen, statt einen Deploy für jede Textänderung zu brauchen. Bitte bei Rechtstexten im Zweifel rechtlich beraten lassen, bevor du größere Änderungen veröffentlichst."}),c.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:Z7.map(p=>c.jsx("button",{type:"button",onClick:()=>{r(p.slug),u(!1),a("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${n===p.slug?"bg-brand-500 text-white":"border border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:p.label},p.slug))}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),c.jsx("input",{value:d.title,onChange:p=>h("title",p.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(Sd,{label:"Inhalt",value:d.body_html,onChange:p=>h("body_html",p)})]}),d.updated_at&&c.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(d.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),o&&c.jsx("p",{className:"mt-3 text-sm text-red-600",children:o}),l&&c.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"button",onClick:f,disabled:s,className:"mt-4 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})})}const eW={download:"Herunterladen",extract:"Entpacken",backup:"Sichern",apply:"Installieren"};function Iw(t){return t?t.slice(0,7):"–"}function tW(t){return t?new Date(t).toLocaleString("de-DE"):"–"}function nW(){const[t,e]=v.useState(null),[n,r]=v.useState(null),[s,i]=v.useState(!0),[o,a]=v.useState(""),[l,u]=v.useState(!1),[d,h]=v.useState({download:null,extract:null,backup:null,apply:null}),[f,p]=v.useState(""),[m,g]=v.useState(null),y=()=>{i(!0),a(""),Promise.all([A.get("/settings/update-status"),A.get("/settings/update-check")]).then(([C,E])=>{e(C),r(E)}).catch(C=>a(C.message)).finally(()=>i(!1))};v.useEffect(y,[]);const b=async()=>{u(!0),p(""),g(null),h({download:"busy",extract:null,backup:null,apply:null});try{const E=(await A.post("/settings/update-download",{})).run_id;h(N=>({...N,download:"done",extract:"busy"})),await A.post("/settings/update-extract",{run_id:E}),h(N=>({...N,extract:"done",backup:"busy"})),await A.post("/settings/update-backup",{}),h(N=>({...N,backup:"done",apply:"busy"}));const S=await A.post("/settings/update-apply",{run_id:E});h(N=>({...N,apply:"done"})),g(S.log||[]),y()}catch(C){h(E=>{const S=Object.keys(E).find(N=>E[N]==="busy");return S?{...E,[S]:"error"}:E}),p(C.message)}finally{u(!1)}};if(s)return c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const x=(t==null?void 0:t.capabilities)||{},k=x.zip?x.http_client?x.writable?null:"Das Website-Verzeichnis ist für PHP nicht beschreibbar - bitte Dateiberechtigungen prüfen.":"Diese Funktion benötigt ausgehende HTTPS-Verbindungen (curl oder allow_url_fopen), die auf diesem Server aktuell nicht verfügbar sind.":'Diese Funktion benötigt die PHP-Erweiterung "zip", die auf diesem Server aktuell nicht aktiviert ist. Bitte beim Hoster aktivieren lassen.',w=n==null?void 0:n.update_available;return c.jsx("div",{className:"max-w-2xl space-y-6",children:c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Updates aus Git"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Zieht den aktuellen Stand direkt vom Code-Repository und installiert ihn hier - ohne manuellen FTP-Upload. Passiert nur, wenn du unten aktiv auf "Update installieren" klickst, nie automatisch im Hintergrund.'}),o&&c.jsx("p",{className:"mb-3 text-sm text-red-600",children:o}),k?c.jsx("p",{className:"rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:k}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"mb-4 grid grid-cols-2 gap-3 text-sm",children:[c.jsxs("div",{className:"rounded-md bg-neutral-50 p-3 dark:bg-neutral-800/50",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:"Installiert"}),c.jsx("p",{className:"font-mono text-neutral-800 dark:text-neutral-100",children:Iw(t==null?void 0:t.deployed_sha)}),c.jsx("p",{className:"text-xs text-neutral-400",children:tW(t==null?void 0:t.deployed_at)})]}),c.jsxs("div",{className:"rounded-md bg-neutral-50 p-3 dark:bg-neutral-800/50",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:"Neuester Stand"}),c.jsx("p",{className:"font-mono text-neutral-800 dark:text-neutral-100",children:Iw(n==null?void 0:n.latest_sha)}),(n==null?void 0:n.latest_message)&&c.jsx("p",{className:"truncate text-xs text-neutral-400",title:n.latest_message,children:n.latest_message})]})]}),w?c.jsx("p",{className:"mb-3 text-sm font-medium text-brand-600 dark:text-brand-400",children:"Update verfügbar."}):c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Bereits auf dem neuesten Stand."}),c.jsxs("div",{className:"mb-3 flex gap-2",children:[c.jsx("button",{type:"button",onClick:y,disabled:l,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Nach Updates suchen"}),c.jsx("button",{type:"button",onClick:b,disabled:l||!w,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:l?"Installiere…":"Update installieren"})]}),(l||f)&&c.jsx("ul",{className:"mb-3 space-y-1 text-sm",children:Object.entries(eW).map(([C,E])=>c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:d[C]==="done"?"text-green-600 dark:text-green-400":d[C]==="error"?"text-red-600":d[C]==="busy"?"text-brand-600 dark:text-brand-400":"text-neutral-300 dark:text-neutral-600",children:d[C]==="done"?"✓":d[C]==="error"?"✕":d[C]==="busy"?"…":"○"}),E]},C))}),f&&c.jsx("p",{className:"text-sm text-red-600",children:f}),m&&c.jsxs("div",{className:"mt-3 rounded-md bg-green-50 p-3 text-sm text-green-800 dark:bg-green-900/20 dark:text-green-300",children:[c.jsx("p",{className:"mb-1 font-semibold",children:"Update installiert."}),m.length>0&&c.jsxs("details",{children:[c.jsx("summary",{className:"cursor-pointer text-xs",children:"Details anzeigen"}),c.jsx("ul",{className:"mt-2 list-disc pl-5 text-xs",children:m.map((C,E)=>c.jsx("li",{children:C},E))})]})]})]})]})})}function wc(t){if(!t)return"";if(/<[a-z][\s\S]*>/i.test(t))return t;const e=document.createElement("div");return e.textContent=t,`

${e.innerHTML.replace(/\n/g,"
")}

`}const rW={mail_host:"",mail_port:587,mail_username:"",mail_password:"",mail_encryption:"tls",mail_from_email:"",mail_from_name:"",mail_notify_email:"",mail_customer_subject:"",mail_customer_body:"",mail_owner_subject:"",mail_owner_body:""},sW=[["{{name}}","Name des Kunden"],["{{email}}","E-Mail des Kunden"],["{{phone}}","Telefonnummer"],["{{vin}}","Fahrgestellnummer (FIN)"],["{{message}}","Nachricht des Kunden"],["{{brand}}","Marke"],["{{model}}","Modell"],["{{package}}","Paket"],["{{product}}","Produkt"],["{{upgrades}}","Gewählte Upgrades"]];function Ow(){return c.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:sW.map(([t,e])=>c.jsx("span",{title:e,className:"rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:t},t))})}function iW(){const[t,e]=v.useState(rW),[n,r]=v.useState(!1),[s,i]=v.useState(!0),[o,a]=v.useState(!1),[l,u]=v.useState(!1),[d,h]=v.useState(""),[f,p]=v.useState(!1),[m,g]=v.useState(!1),[y,b]=v.useState(""),[x,k]=v.useState(""),[w,C]=v.useState(""),[E,S]=v.useState(null);v.useEffect(()=>{A.get("/settings/mail").then(T=>{e({...T,mail_password:"",mail_customer_body:wc(T.mail_customer_body),mail_owner_body:wc(T.mail_owner_body)}),r(T.has_password)}).finally(()=>i(!1))},[]);const N=(T,R)=>{e($=>({...$,[T]:R})),p(!1)},M=async T=>{T.preventDefault(),u(!0),h(""),p(!1);try{const R=await A.post("/settings/mail",t);e({...R,mail_password:"",mail_customer_body:wc(R.mail_customer_body),mail_owner_body:wc(R.mail_owner_body)}),r(R.has_password),p(!0)}catch(R){h(R.message)}finally{u(!1)}},j=async()=>{g(!0),b(""),k(""),C(""),S(null);try{const T=await A.post("/settings/mail/test",t);k(`Testmail gesendet an ${T.sent_to}. Der Server hat die Mail angenommen - prüfe auch den Spam-Ordner, das ist noch keine Garantie für die Zustellung.`),C(T.warning||""),S(T.smtp_log||null)}catch(T){b(T.message)}finally{g(!1)}};return s?c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):c.jsxs("form",{onSubmit:M,className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"SMTP-Server"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Zugangsdaten deines Mail-Postfachs oder Transactional-Mail-Anbieters. Solange kein Server eingetragen ist, werden keine E-Mails verschickt (Kontaktanfragen werden trotzdem in der Datenbank gespeichert)."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Server (Host)"}),c.jsx("input",{value:t.mail_host,onChange:T=>N("mail_host",T.target.value),placeholder:"smtp.beispiel.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Port"}),c.jsx("input",{type:"number",value:t.mail_port,onChange:T=>N("mail_port",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Verschlüsselung"}),c.jsxs("select",{value:t.mail_encryption,onChange:T=>N("mail_encryption",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"tls",children:"STARTTLS"}),c.jsx("option",{value:"ssl",children:"SSL"}),c.jsx("option",{value:"none",children:"Keine"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),c.jsx("input",{value:t.mail_username,onChange:T=>N("mail_username",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{type:o?"text":"password",value:t.mail_password,onChange:T=>N("mail_password",T.target.value),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("button",{type:"button",onClick:()=>a(T=>!T),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:o?"Verbergen":"Anzeigen"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-E-Mail"}),c.jsx("input",{type:"email",value:t.mail_from_email,onChange:T=>N("mail_from_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-Name"}),c.jsx("input",{value:t.mail_from_name,onChange:T=>N("mail_from_name",T.target.value),placeholder:"HifiPlanet",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),c.jsxs("div",{className:"mt-4 border-t border-neutral-200 pt-4 dark:border-neutral-800",children:[y&&c.jsx("p",{className:"mb-2 whitespace-pre-wrap text-sm text-red-600",children:y}),x&&c.jsx("p",{className:"mb-2 text-sm text-green-600 dark:text-green-400",children:x}),w&&c.jsx("p",{className:"mb-2 rounded-md bg-amber-50 p-2 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:w}),c.jsx("button",{type:"button",onClick:j,disabled:m,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:m?"Sende Testmail…":"Verbindung testen"}),E&&E.length>0&&c.jsxs("details",{className:"mt-3",children:[c.jsx("summary",{className:"cursor-pointer text-xs text-neutral-500 dark:text-neutral-400",children:"SMTP-Protokoll anzeigen"}),c.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-neutral-900 p-3 text-xs text-neutral-200",children:E.join(` -`)})]})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Empfänger"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"An diese Adresse geht die Benachrichtigung bei jeder neuen Kontaktanfrage."}),c.jsx("input",{type:"email",value:t.mail_notify_email,onChange:T=>N("mail_notify_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Kunden (Bestätigung)"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Geht automatisch an den Kunden, sobald er eine Kontaktanfrage abschickt."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),c.jsx("input",{value:t.mail_customer_subject,onChange:T=>N("mail_customer_subject",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(Sd,{label:"Text",value:t.mail_customer_body,onChange:T=>N("mail_customer_body",T)})]}),c.jsx(Ow,{})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Shop (Benachrichtigung)"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Geht an die oben eingestellte Empfänger-Adresse, sobald eine neue Kontaktanfrage eingeht."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),c.jsx("input",{value:t.mail_owner_subject,onChange:T=>N("mail_owner_subject",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(Sd,{label:"Text",value:t.mail_owner_body,onChange:T=>N("mail_owner_body",T)})]}),c.jsx(Ow,{})]}),d&&c.jsx("p",{className:"text-sm text-red-600",children:d}),f&&c.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"submit",disabled:l,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:l?"Speichere…":"Speichern"})]})}function oW(){const[t,e]=v.useState({host:"",name:"",user:"",password:"",charset:"utf8mb4"}),[n,r]=v.useState(!1),[s,i]=v.useState(!0),[o,a]=v.useState(!1),[l,u]=v.useState(!1),[d,h]=v.useState(""),[f,p]=v.useState(!1),[m,g]=v.useState(null),[y,b]=v.useState(!0),[x,k]=v.useState(!1),[w,C]=v.useState(null),E=()=>{i(!0),A.get("/settings/database").then(j=>{e({...j.config,password:""}),r(j.has_password)}).finally(()=>i(!1))},S=()=>{b(!0),A.get("/settings/schema-check").then(g).catch(j=>g({ok:!1,error:j.message,tables:[]})).finally(()=>b(!1))};v.useEffect(()=>{E(),S()},[]);const N=async()=>{k(!0),C(null);try{const j=await A.post("/settings/schema-migrate",{});C(j.actions),g(j.report)}catch(j){C(["Fehler: "+j.message])}finally{k(!1)}},M=async j=>{j.preventDefault(),u(!0),h(""),p(!1);try{await A.post("/settings/database",t),p(!0),e(T=>({...T,password:""})),r(!0),S()}catch(T){h(T.message)}finally{u(!1)}};return c.jsxs("div",{className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wichtig für einen Umzug auf einen anderen Server/Webspace: Trage hier die Zugangsdaten der dortigen Datenbank ein. Die Verbindung wird vor dem Speichern getestet, damit du dich nicht aussperrst."}),s?c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):c.jsxs("form",{onSubmit:M,className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Host *"}),c.jsx("input",{required:!0,value:t.host,onChange:j=>e({...t,host:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datenbankname *"}),c.jsx("input",{required:!0,value:t.name,onChange:j=>e({...t,name:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzer *"}),c.jsx("input",{required:!0,value:t.user,onChange:j=>e({...t,user:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{type:o?"text":"password",value:t.password,onChange:j=>e({...t,password:j.target.value}),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("button",{type:"button",onClick:()=>a(j=>!j),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:o?"Verbergen":"Anzeigen"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Zeichensatz"}),c.jsx("input",{value:t.charset,onChange:j=>e({...t,charset:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),d&&c.jsx("p",{className:"text-sm text-red-600",children:d}),f&&c.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Verbindung erfolgreich getestet und gespeichert."}),c.jsx("button",{type:"submit",disabled:l,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:l?"Teste & speichere…":"Verbindung testen & speichern"})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[c.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),!y&&m&&c.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${m.ok?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"}`,children:m.ok?"Datenbank OK":"Datenbank nicht OK"})]}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Prüft, ob diese Datenbank alle Tabellen und Spalten hat, die der aktuelle Code-Stand braucht – wichtig, wenn deine Live-Version auf einem anderen Server einen älteren Stand hat."}),y&&c.jsx("p",{className:"text-sm text-neutral-400",children:"Prüfe…"}),!y&&m&&!m.ok&&c.jsx("ul",{className:"mb-4 space-y-1 rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-300",children:m.tables.filter(j=>!j.ok).map(j=>c.jsx("li",{children:j.exists?c.jsxs(c.Fragment,{children:["Tabelle ",c.jsx("code",{className:"font-mono",children:j.table}),": Spalte(n) fehlen – ",j.missing_columns.join(", ")]}):c.jsxs(c.Fragment,{children:["Tabelle ",c.jsx("code",{className:"font-mono",children:j.table})," fehlt komplett"]})},j.table))}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{onClick:S,disabled:y,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Erneut prüfen"}),m&&!m.ok&&c.jsx("button",{onClick:N,disabled:x,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:x?"Aktualisiere…":"Datenbankstruktur aktualisieren"})]}),w&&c.jsx("ul",{className:"mt-3 space-y-1 rounded-md bg-neutral-50 p-3 text-sm text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:w.map((j,T)=>c.jsx("li",{children:j},T))})]})]})}const Sc=[{key:"catalog",label:"Fahrzeug-Katalog",hint:"Marken, Modelle (inkl. Bilder), Pakete, Produkte, Upgrades",tables:["brands","car_models","packages","package_products","package_upgrades"]},{key:"services",label:"Leistungen",hint:"Die Leistungen-Übersicht",tables:["services"]},{key:"faqs",label:"FAQs",hint:"Häufig gestellte Fragen",tables:["faqs"]},{key:"gallery",label:"Bildergalerie",hint:"Galerie-Marken, Projekte und Fotos (inkl. Bilder)",tables:["gallery_brands","gallery_projects","gallery_photos"]},{key:"settings",label:"Einstellungen",hint:"Telefon/Adresse/Öffnungszeiten, Logo, Wartungsmodus-Texte, Kachel-Design, Mail-Vorlagen (ohne Zugangsdaten)",tables:["app_settings"]},{key:"legal",label:"Rechtstexte",hint:"Impressum, Datenschutzerklärung, AGB",tables:["legal_pages"]},{key:"home",label:"Startseiten-Texte",hint:'Hero, YouTube-Sektion, Handwerk, Beratung, Einblicke, "Mehr als Car-Hifi"',tables:["home_sections"]},{key:"partners",label:"Partner",hint:"Marken-Logozeile auf der Startseite (inkl. Logos)",tables:["partners"]},{key:"permissions",label:"Berechtigungsgruppen",hint:"Rollen-Vorlagen und ihre Rechte (ohne Benutzerkonten selbst)",tables:["permission_groups","permission_group_permissions"]}],z2={brands:"Marken",car_models:"Modelle",packages:"Pakete",package_products:"Produkte",package_upgrades:"Upgrades",services:"Leistungen",faqs:"FAQs",gallery_brands:"Galerie-Marken",gallery_projects:"Galerie-Projekte",gallery_photos:"Galerie-Fotos",app_settings:"Einstellungen",legal_pages:"Rechtstexte",home_sections:"Startseiten-Texte",partners:"Partner",permission_groups:"Berechtigungsgruppen",permission_group_permissions:"Berechtigungsgruppen-Rechte",admin_users:"Benutzerkonten",admin_user_permissions:"Benutzer-Einzelrechte",admin_user_groups:"Benutzer-Gruppenzuweisungen"},aW=(t,e)=>{if(!t)return null;const n=e.map(r=>[r,Array.isArray(t[r])?t[r].length:0]).filter(([,r])=>r>0).map(([r,s])=>`${s} ${z2[r]||r}`);return n.length?n.join(", "):"leer in dieser Datei"};function lW(){const[t,e]=v.useState(null),[n,r]=v.useState(null),[s,i]=v.useState(""),[o,a]=v.useState(()=>new Set(Sc.map(N=>N.key))),[l,u]=v.useState(!1),[d,h]=v.useState(!1),[f,p]=v.useState(!1),[m,g]=v.useState(!1),[y,b]=v.useState(null),[x,k]=v.useState(""),w=async N=>{var j;const M=((j=N.target.files)==null?void 0:j[0])||null;if(e(M),b(null),k(""),r(null),i(""),a(new Set(Sc.map(T=>T.key))),h(!1),!!M)try{const T=await M.text(),R=JSON.parse(T);if(!R||typeof R.data!="object")throw new Error("kein gültiges Export-Format");r(R.data)}catch{i("Datei konnte nicht gelesen werden – Vorschau der Inhalte nicht möglich. Import würde trotzdem versucht (alle Bereiche).")}},C=N=>{a(M=>{const j=new Set(M);return j.has(N)?j.delete(N):j.add(N),j})},E=async N=>{if(N.preventDefault(),!(!t||!f||o.size===0)){g(!0),k(""),b(null);try{const M=new FormData;M.append("file",t),M.append("sections",JSON.stringify([...o])),M.append("include_accounts",d?"1":"0");const j=await A.post("/settings/import",M);b(j),e(null),r(null),p(!1),h(!1),N.target.reset()}catch(M){k(M.message)}finally{g(!1)}}},S=Sc.filter(N=>o.has(N.key)).map(N=>N.label);return d&&S.push("Benutzerkonten"),c.jsxs("div",{className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten exportieren"}),c.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Lädt eine Datei mit allen Marken, Modellen, Paketen, Produkten, Upgrades, Leistungen, FAQs, der kompletten Bildergalerie (inkl. Bilder), den Einstellungen und den Berechtigungsgruppen herunter (ohne Zugangsdaten wie SMTP-Passwort oder API-Keys – die müssen auf jedem Server neu eingetragen werden). Kontaktanfragen sind bewusst ",c.jsx("strong",{children:"nicht"})," enthalten."]}),c.jsxs("label",{className:"mb-3 flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:l,onChange:N=>u(N.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Benutzerkonten mit exportieren (enthält Passwort-Hashes und 2FA-Geheimnisse – nur für Backups an einem vertrauenswürdigen Ort)"]}),c.jsx("a",{href:`${eN}/settings/export${l?"?include_accounts=1":""}`,className:"inline-block rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Jetzt exportieren"})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten importieren"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Lädt eine zuvor exportierte Datei auf diesen Server. Ersetzt dabei die ausgewählten Bereiche komplett durch den Inhalt der Datei – das kann nicht rückgängig gemacht werden. Kontaktanfragen bleiben immer unangetastet, Benutzerkonten nur wenn unten explizit angehakt."}),c.jsxs("form",{onSubmit:E,className:"space-y-4",children:[c.jsx("input",{type:"file",accept:"application/json,.json",onChange:w,className:"text-sm"}),t&&c.jsxs("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-700",children:[c.jsx("div",{className:"border-b border-neutral-200 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-700 dark:text-neutral-400",children:"Was soll importiert werden?"}),s&&c.jsx("p",{className:"px-4 pt-3 text-sm text-amber-600 dark:text-amber-400",children:s}),c.jsxs("div",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[Sc.map(N=>c.jsxs("label",{className:"flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-neutral-50 dark:hover:bg-neutral-800/50",children:[c.jsx("input",{type:"checkbox",checked:o.has(N.key),onChange:()=>C(N.key),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:N.label}),c.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:n?aW(n,N.tables):N.hint})]})]},N.key)),c.jsxs("label",{className:"flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-neutral-50 dark:hover:bg-neutral-800/50",children:[c.jsx("input",{type:"checkbox",checked:d,onChange:N=>h(N.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:"Benutzerkonten"}),c.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:'Nur wenn die Datei mit "Benutzerkonten mit exportieren" erstellt wurde. Ersetzt auch dein eigenes Konto – danach ggf. mit den Zugangsdaten aus der Export-Datei neu einloggen.'})]})]})]})]}),c.jsxs("label",{className:"flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:f,onChange:N=>p(N.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Mir ist bewusst, dass dies"," ",S.length?c.jsx("strong",{children:S.join(", ")}):"die ausgewählten Bereiche"," auf diesem Server unwiderruflich ersetzt."]}),c.jsx("button",{type:"submit",disabled:!t||!f||m||o.size===0,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:m?"Importiere…":"Importieren"})]}),x&&c.jsx("p",{className:"mt-3 text-sm text-red-600",children:x}),y&&c.jsxs("div",{className:"mt-3 rounded-md bg-green-50 p-3 text-sm text-green-800 dark:bg-green-900/20 dark:text-green-300",children:[c.jsx("p",{className:"mb-1 font-semibold",children:"Import erfolgreich:"}),c.jsxs("ul",{className:"list-disc pl-5",children:[Object.entries(y.counts).map(([N,M])=>c.jsxs("li",{children:[M," ",z2[N]||N]},N)),y.images_restored>0&&c.jsxs("li",{children:[y.images_restored," Bilder wiederhergestellt"]})]})]})]})]})}const cW={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function uW(){const[t,e]=v.useState(cW),[n,r]=v.useState(!0),[s,i]=v.useState(!1),[o,a]=v.useState(!1),[l,u]=v.useState("");v.useEffect(()=>{A.get("/maintenance").then(p=>{e({global:{enabled:p.global.enabled,message:p.global.message||""},services:{enabled:p.services.enabled,message:p.services.message||""},vehicles:{enabled:p.vehicles.enabled,message:p.vehicles.message||""}})}).finally(()=>r(!1))},[]);const d=(p,m,g)=>{e(y=>({...y,[p]:{...y[p],[m]:g}})),a(!1)},h=async p=>{p.preventDefault(),i(!0),u(""),a(!1);try{const m=await A.post("/maintenance",t);e({global:{enabled:m.global.enabled,message:m.global.message||""},services:{enabled:m.services.enabled,message:m.services.message||""},vehicles:{enabled:m.vehicles.enabled,message:m.vehicles.message||""}}),a(!0)}catch(m){u(m.message)}finally{i(!1)}},f=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return n?c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):c.jsxs("form",{onSubmit:h,className:"max-w-2xl space-y-6",children:[c.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:'Ist "Gesamte Seite" aktiv, gewinnt das immer – die beiden anderen Schalter spielen dann keine Rolle mehr.'}),f.map(p=>c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[c.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:p.title}),c.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[c.jsx("input",{type:"checkbox",checked:t[p.key].enabled,onChange:m=>d(p.key,"enabled",m.target.checked),className:"peer sr-only"}),c.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),c.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:p.hint}),c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),c.jsx("textarea",{rows:2,value:t[p.key].message,onChange:m=>d(p.key,"message",m.target.value),placeholder:"z. B. Wir aktualisieren gerade unser Angebot. Schau bald wieder vorbei!",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]},p.key)),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),o&&c.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}function dW(){const[t,e]=v.useState(!1),[n,r]=v.useState(""),[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(!1),[d,h]=v.useState(""),[f,p]=v.useState(!1),[m,g]=v.useState(""),[y,b]=v.useState(!1),[x,k]=v.useState(""),w=async()=>{if(confirm("Alle aktuellen Leistungen werden gelöscht und durch die 8 Standard-Leistungen ersetzt. Fortfahren?")){e(!0),r("");try{const M=await A.post("/settings/reset-services",{});r(`${M.count} Standard-Leistungen wiederhergestellt.`)}catch(M){r("Fehler: "+M.message)}finally{e(!1)}}},C=async()=>{if(confirm("Alle aktuellen FAQ-Einträge werden gelöscht und durch die 6 Standard-Fragen ersetzt. Fortfahren?")){i(!0),a("");try{const M=await A.post("/settings/reset-faqs",{});a(`${M.count} Standard-Fragen wiederhergestellt.`)}catch(M){a("Fehler: "+M.message)}finally{i(!1)}}},E=async()=>{if(confirm("Die komplette Bildergalerie wird gelöscht und durch die 13 Marken/29 Projekte/207 Fotos der alten hifi-planet.de-Seite ersetzt. Fortfahren?")){u(!0),h("");try{const M=await A.post("/settings/reset-gallery",{});h(`${M.photos} Fotos wiederhergestellt.`)}catch(M){h("Fehler: "+M.message)}finally{u(!1)}}},S=async()=>{if(confirm("Alle Marken, Modelle, Pakete, Produkte und Upgrades werden unwiderruflich gelöscht. Leistungen und Kontaktanfragen bleiben erhalten. Fortfahren?")){p(!0),g("");try{const M=await A.post("/settings/reset-catalog",{});g(`Fahrzeugkatalog geleert (${M.brands_removed} Marken entfernt).`)}catch(M){g("Fehler: "+M.message)}finally{p(!1)}}},N=async()=>{if(confirm("WIRKLICH ALLES zurücksetzen? Marken, Modelle, Pakete, Produkte und Upgrades werden gelöscht, Leistungen, FAQs und die Bildergalerie auf Standard zurückgesetzt. Kontaktanfragen und Benutzerkonten bleiben erhalten. Das kann nicht rückgängig gemacht werden!")){b(!0),k("");try{const M=await A.post("/settings/reset-all",{});k(`Erledigt: ${M.brands_removed} Marken entfernt, ${M.services_reset} Standard-Leistungen, ${M.faqs_reset} Standard-Fragen und ${M.gallery_photos_reset} Galerie-Fotos wiederhergestellt.`)}catch(M){k("Fehler: "+M.message)}finally{b(!1)}}};return c.jsxs("div",{className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Leistungen zurücksetzen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Leistungen-Karten und stellt die 8 mitgelieferten Standard-Leistungen wieder her. Marken, Modelle und Pakete bleiben unangetastet."}),c.jsx("button",{onClick:w,disabled:t,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:t?"Setze zurück…":"Leistungen auf Standard zurücksetzen"}),n&&c.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:n})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur FAQs zurücksetzen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Fragen und stellt die 6 mitgelieferten Standard-Fragen (Deutsch & Englisch) wieder her. Leistungen, Marken, Modelle und Pakete bleiben unangetastet."}),c.jsx("button",{onClick:C,disabled:s,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:s?"Setze zurück…":"FAQs auf Standard zurücksetzen"}),o&&c.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:o})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Bildergalerie zurücksetzen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Galerie-Marken, -Projekte und -Fotos und stellt die komplette Galerie der alten hifi-planet.de-Seite wieder her (13 Marken, 29 Projekte, 207 Fotos). Fahrzeugkatalog, Leistungen und FAQs bleiben unangetastet."}),c.jsx("button",{onClick:E,disabled:l,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:l?"Setze zurück…":"Galerie auf Standard zurücksetzen"}),d&&c.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:d})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Fahrzeugkatalog leeren"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle Marken, Modelle, Pakete, Produkte und Upgrades unwiderruflich. Leistungen, Kontaktanfragen und Benutzerkonten bleiben erhalten."}),c.jsx("button",{onClick:S,disabled:f,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:f?"Leere…":"Fahrzeugkatalog leeren"}),m&&c.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:m})]}),c.jsxs("section",{className:"rounded-xl border border-red-300 bg-red-50/40 p-6 dark:border-red-900 dark:bg-red-900/10",children:[c.jsx("h2",{className:"mb-1 font-semibold text-red-700 dark:text-red-300",children:"Alles zurücksetzen"}),c.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:["Kombiniert alles: Fahrzeugkatalog wird komplett geleert ",c.jsx("strong",{children:"und"})," Leistungen, FAQs sowie die Bildergalerie werden auf Standard zurückgesetzt. Kontaktanfragen und Benutzerkonten bleiben erhalten. Nicht rückgängig zu machen."]}),c.jsx("button",{onClick:N,disabled:y,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:y?"Setze zurück…":"Wirklich alles zurücksetzen"}),x&&c.jsx("p",{className:"mt-3 text-sm text-neutral-700 dark:text-neutral-300",children:x})]})]})}function hW(){return c.jsxs(c.Fragment,{children:[c.jsx(xD,{}),c.jsx(vD,{}),c.jsx(kD,{children:c.jsxs(tD,{children:[c.jsx(Q,{path:"/setup",element:c.jsx(wO,{})}),c.jsxs(Q,{element:c.jsx(wI,{}),children:[c.jsx(Q,{path:"/",element:c.jsx(HI,{})}),c.jsx(Q,{path:"/fahrzeuge",element:c.jsx(WI,{})}),c.jsx(Q,{path:"/fahrzeuge/:brandSlug",element:c.jsx(UI,{})}),c.jsx(Q,{path:"/fahrzeuge/:brandSlug/:modelSlug",element:c.jsx(iO,{})}),c.jsx(Q,{path:"/galerie",element:c.jsx(oO,{})}),c.jsx(Q,{path:"/galerie/:brandSlug",element:c.jsx(aO,{})}),c.jsx(Q,{path:"/galerie/:brandSlug/:projectSlug",element:c.jsx(cO,{})}),c.jsx(Q,{path:"/leistungen",element:c.jsx(uO,{})}),c.jsx(Q,{path:"/kontakt",element:c.jsx(gO,{})}),c.jsx(Q,{path:"/impressum",element:c.jsx(xO,{})}),c.jsx(Q,{path:"/datenschutz",element:c.jsx(yO,{})}),c.jsx(Q,{path:"/agb",element:c.jsx(bO,{})})]}),c.jsx(Q,{path:"/admin/login",element:c.jsx(SO,{})}),c.jsx(Q,{path:"/admin",element:c.jsx(jI,{}),children:c.jsxs(Q,{element:c.jsx(CI,{}),children:[c.jsx(Q,{index:!0,element:c.jsx(EO,{})}),c.jsx(Q,{path:"account",element:c.jsx($7,{})}),c.jsx(Q,{path:"brands",element:c.jsx(Ze,{permission:"brands.manage",children:c.jsx(o5,{})})}),c.jsx(Q,{path:"models",element:c.jsx(Ze,{permission:"models.manage",children:c.jsx(a5,{})})}),c.jsx(Q,{path:"gallery-brands",element:c.jsx(Ze,{permission:"gallery.manage",children:c.jsx(l5,{})})}),c.jsx(Q,{path:"gallery-projects",element:c.jsx(Ze,{permission:"gallery.manage",children:c.jsx(c5,{})})}),c.jsx(Q,{path:"gallery-projects/:projectId/photos",element:c.jsx(Ze,{permission:"gallery.manage",children:c.jsx(u5,{})})}),c.jsx(Q,{path:"packages",element:c.jsx(Ze,{permission:"packages.manage",children:c.jsx(g5,{})})}),c.jsx(Q,{path:"packages/:packageId/products",element:c.jsx(Ze,{permission:"packages.manage",children:c.jsx(GH,{})})}),c.jsx(Q,{path:"packages/:packageId/upgrades",element:c.jsx(Ze,{permission:"packages.manage",children:c.jsx(JH,{})})}),c.jsx(Q,{path:"services",element:c.jsx(Ze,{permission:"services.manage",children:c.jsx(v5,{})})}),c.jsx(Q,{path:"faqs",element:c.jsx(Ze,{permission:"content.manage",children:c.jsx(k5,{})})}),c.jsx(Q,{path:"partners",element:c.jsx(Ze,{permission:"content.manage",children:c.jsx(w5,{})})}),c.jsx(Q,{path:"home-sections",element:c.jsx(Ze,{permission:"content.manage",children:c.jsx(WH,{})})}),c.jsx(Q,{path:"contact-requests",element:c.jsx(Ze,{permission:"contact.manage",children:c.jsx(e7,{})})}),c.jsx(Q,{path:"users",element:c.jsx(Ze,{permission:"users.manage",children:c.jsx(W7,{})})}),c.jsx(Q,{path:"permission-groups",element:c.jsx(Ze,{permission:"permission_groups.manage",children:c.jsx(U7,{})})}),c.jsxs(Q,{path:"settings",element:c.jsx(Ze,{permission:"settings.manage",children:c.jsx(G7,{})}),children:[c.jsx(Q,{index:!0,element:c.jsx(Ua,{to:"website",replace:!0})}),c.jsx(Q,{path:"website",element:c.jsx(X7,{})}),c.jsx(Q,{path:"legal",element:c.jsx(Q7,{})}),c.jsx(Q,{path:"email",element:c.jsx(iW,{})}),c.jsx(Q,{path:"database",element:c.jsx(oW,{})}),c.jsx(Q,{path:"export-import",element:c.jsx(lW,{})}),c.jsx(Q,{path:"maintenance",element:c.jsx(uW,{})}),c.jsx(Q,{path:"update",element:c.jsx(Ze,{permission:"system.update",children:c.jsx(nW,{})})}),c.jsx(Q,{path:"reset",element:c.jsx(dW,{})})]})]})})]})})]})}qf.createRoot(document.getElementById("root")).render(c.jsx(Gr.StrictMode,{children:c.jsx(uD,{basename:"/".replace(/\/$/,"")||"/",children:c.jsx(SD,{children:c.jsx(TD,{children:c.jsx(ID,{children:c.jsx(hW,{})})})})})})); +`);const o=_7(e,n,s),a=bh.getSymbolSize(e),l=new N7(a);return P7(l,e),A7(l),D7(l,e),Kf(l,n,0),e>=7&&L7(l,e),R7(l,o),isNaN(r)&&(r=lg.getBestMask(l,Kf.bind(null,l,n))),lg.applyMask(r,l),Kf(l,n,r),{modules:l,version:e,errorCorrectionLevel:n,maskPattern:r,segments:s}}w2.create=function(e,n){if(typeof e>"u"||e==="")throw new Error("No input text");let r=Wf.M,s,i;return typeof n<"u"&&(r=Wf.from(n.errorCorrectionLevel,Wf.M),s=Cd.from(n.version),i=lg.from(n.maskPattern),n.toSJISFunc&&bh.setToSJISFunction(n.toSJISFunc)),O7(e,s,r,i)};var _2={},Sx={};(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:i,scale:i?4:o,margin:s,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},t.getImageWidth=function(r,s){const i=t.getScale(r,s);return Math.floor((r+s.margin*2)*i)},t.qrToImageData=function(r,s,i){const o=s.modules.size,a=s.modules.data,l=t.getScale(o,i),u=Math.floor((o+i.margin*2)*l),d=i.margin*l,h=[i.color.light,i.color.dark];for(let f=0;f=d&&p>=d&&f"u"&&(!o||!o.getContext)&&(l=o,o=void 0),o||(u=r()),l=e.getOptions(l);const d=e.getImageWidth(i.modules.size,l),h=u.getContext("2d"),f=h.createImageData(d,d);return e.qrToImageData(f.data,i,l),n(h,u,d),h.putImageData(f,0,0),u},t.renderToDataURL=function(i,o,a){let l=a;typeof l>"u"&&(!o||!o.getContext)&&(l=o,o=void 0),l||(l={});const u=t.render(i,o,l),d=l.type||"image/png",h=l.rendererOpts||{};return u.toDataURL(d,h.quality)}})(_2);var I2={};const B7=Sx;function Lw(t,e){const n=t.a/255,r=e+'="'+t.hex+'"';return n<1?r+" "+e+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function Gf(t,e,n){let r=t+e;return typeof n<"u"&&(r+=" "+n),r}function z7(t,e,n){let r="",s=0,i=!1,o=0;for(let a=0;a0&&l>0&&t[a-1]||(r+=i?Gf("M",l+n,.5+u+n):Gf("m",s,0),s=0,i=!1),l+1':"",u="',d='viewBox="0 0 '+a+" "+a+'"',f=''+l+u+` +`;return typeof r=="function"&&r(null,f),f};const F7=t7,ug=w2,O2=_2,V7=I2;function Nx(t,e,n,r,s){const i=[].slice.call(arguments,1),o=i.length,a=typeof i[o-1]=="function";if(!a&&!F7())throw new Error("Callback required as last argument");if(a){if(o<2)throw new Error("Too few arguments provided");o===2?(s=n,n=e,e=r=void 0):o===3&&(e.getContext&&typeof s>"u"?(s=r,r=void 0):(s=r,r=n,n=e,e=void 0))}else{if(o<1)throw new Error("Too few arguments provided");return o===1?(n=e,e=r=void 0):o===2&&!e.getContext&&(r=n,n=e,e=void 0),new Promise(function(l,u){try{const d=ug.create(n,r);l(t(d,e,r))}catch(d){u(d)}})}try{const l=ug.create(n,r);s(null,t(l,e,r))}catch(l){s(l)}}Al.create=ug.create;Al.toCanvas=Nx.bind(null,O2.render);Al.toDataURL=Nx.bind(null,O2.renderToDataURL);Al.toString=Nx.bind(null,function(t,e,n){return V7.render(t,n)});const Rw={current_password:"",new_password:"",new_password_confirmation:"",two_factor_code:""};function $7(){const{user:t,refreshUser:e}=Cn(),[n,r]=v.useState("idle"),[s,i]=v.useState(""),[o,a]=v.useState(""),[l,u]=v.useState(""),[d,h]=v.useState(""),[f,p]=v.useState([]),[m,g]=v.useState(""),[y,b]=v.useState(!1),[x,k]=v.useState(Rw),[w,C]=v.useState(""),[E,S]=v.useState(""),[N,M]=v.useState(!1),j=async B=>{if(B.preventDefault(),C(""),S(""),x.new_password!==x.new_password_confirmation){C("Die neuen Passwörter stimmen nicht überein");return}M(!0);try{await A.post("/auth/change-password",x),k(Rw),S("Passwort erfolgreich geändert.")}catch(Z){C(Z.message)}finally{M(!1)}},T=async()=>{g(""),b(!0);try{const B=await A.get("/auth/2fa/setup");a(B.secret),i(await Al.toDataURL(B.otpauth_url)),u(""),r("setup")}catch(B){g(B.message)}finally{b(!1)}},R=async B=>{B.preventDefault(),g(""),b(!0);try{const Z=await A.post("/auth/2fa/enable",{code:l});p(Z.recovery_codes),r("recovery-codes"),await e()}catch(Z){g(Z.message)}finally{b(!1)}},$=()=>{r("idle"),p([]),h("")},L=async B=>{B.preventDefault(),g(""),b(!0);try{await A.post("/auth/2fa/disable",{password:d}),h(""),r("idle"),await e()}catch(Z){g(Z.message)}finally{b(!1)}},W=async B=>{B.preventDefault(),g(""),b(!0);try{const Z=await A.post("/auth/2fa/recovery-codes",{password:d});p(Z.recovery_codes),r("recovery-codes")}catch(Z){g(Z.message)}finally{b(!1)}};return c.jsxs("div",{className:"max-w-xl",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Mein Konto"}),c.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Angemeldet als ",c.jsx("strong",{children:t==null?void 0:t.username}),t!=null&&t.is_super_admin?" (Super-Admin)":"","."]}),c.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Passwort ändern"}),c.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Vergib ein neues Passwort für dein Konto.",(t==null?void 0:t.two_factor_enabled)&&" Da 2FA aktiv ist, musst du die Änderung zusätzlich mit deinem Code bestätigen."]}),c.jsxs("form",{onSubmit:j,children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aktuelles Passwort"}),c.jsx("input",{type:"password",value:x.current_password,onChange:B=>k({...x,current_password:B.target.value}),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort"}),c.jsx("input",{type:"password",value:x.new_password,onChange:B=>k({...x,new_password:B.target.value}),required:!0,minLength:8,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort wiederholen"}),c.jsx("input",{type:"password",value:x.new_password_confirmation,onChange:B=>k({...x,new_password_confirmation:B.target.value}),required:!0,minLength:8,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),(t==null?void 0:t.two_factor_enabled)&&c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"2FA-Code zur Bestätigung"}),c.jsx("input",{value:x.two_factor_code,onChange:B=>k({...x,two_factor_code:B.target.value}),required:!0,inputMode:"numeric",placeholder:"123456 oder Wiederherstellungscode",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),w&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),E&&c.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:E}),c.jsx("button",{type:"submit",disabled:N,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:N?"Wird geändert…":"Passwort ändern"})]})]}),c.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Zwei-Faktor-Authentifizierung"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Schützt dein Konto zusätzlich mit einem Code aus der Google Authenticator App."}),n==="idle"&&c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"mb-4 text-sm",children:["Status:"," ",t!=null&&t.two_factor_enabled?c.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"Aktiv"}):c.jsx("span",{className:"font-semibold text-neutral-500 dark:text-neutral-400",children:"Nicht aktiv"})]}),t!=null&&t.two_factor_enabled?c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{onClick:()=>{r("regenerate"),g("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Neue Wiederherstellungscodes erzeugen"}),c.jsx("button",{onClick:()=>{r("disable"),g("")},className:"rounded-md border border-red-300 px-4 py-2 text-sm font-medium text-red-600 hover:bg-red-50 dark:border-red-900 dark:hover:bg-red-900/20",children:"2FA deaktivieren"})]}):c.jsx("button",{onClick:T,disabled:y,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"2FA aktivieren"})]}),n==="setup"&&c.jsxs("form",{onSubmit:R,children:[c.jsxs("ol",{className:"mb-4 list-decimal space-y-2 pl-5 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("li",{children:"Öffne die Google Authenticator App (oder eine kompatible App)."}),c.jsx("li",{children:"Scanne den folgenden QR-Code:"})]}),c.jsx("div",{className:"mb-4 flex justify-center",children:s&&c.jsx("img",{src:s,alt:"QR-Code für Zwei-Faktor-Authentifizierung",className:"h-48 w-48 rounded-lg border border-neutral-200 dark:border-neutral-700"})}),c.jsxs("p",{className:"mb-4 text-center text-xs text-neutral-500 dark:text-neutral-400",children:["Geht das Scannen nicht? Gib diesen Code manuell ein: ",c.jsx("br",{}),c.jsx("code",{className:"mt-1 inline-block rounded bg-neutral-100 px-2 py-1 font-mono tracking-wider dark:bg-neutral-800",children:o})]}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Bestätigungscode aus der App"}),c.jsx("input",{value:l,onChange:B=>u(B.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",disabled:y,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Bestätigen & aktivieren"}),c.jsx("button",{type:"button",onClick:()=>r("idle"),className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="recovery-codes"&&c.jsxs("div",{children:[c.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Wiederherstellungscodes – jetzt sicher speichern!"}),c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Jeder Code funktioniert einmalig, falls du keinen Zugriff mehr auf die Authenticator-App hast. Diese Codes werden nur jetzt angezeigt."}),c.jsx("div",{className:"mb-4 grid grid-cols-2 gap-2 rounded-md bg-neutral-100 p-4 font-mono text-sm dark:bg-neutral-800",children:f.map(B=>c.jsx("span",{children:B},B))}),c.jsx("button",{onClick:$,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Ich habe die Codes gespeichert"})]}),n==="disable"&&c.jsxs("form",{onSubmit:L,children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),c.jsx("input",{type:"password",value:d,onChange:B=>h(B.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",disabled:y,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-60",children:"2FA jetzt deaktivieren"}),c.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="regenerate"&&c.jsxs("form",{onSubmit:W,children:[c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Die bisherigen Wiederherstellungscodes werden ungültig."}),c.jsxs("div",{className:"mb-4",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),c.jsx("input",{type:"password",value:d,onChange:B=>h(B.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&c.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",disabled:y,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Neue Codes erzeugen"}),c.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})]})}const _w={username:"",password:"",is_super_admin:!1,permissions:[],group_ids:[]};function H7(t){return t?new Date(t.replace(" ","T")).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Noch nie"}function W7(){const{user:t,hasPermission:e}=Cn(),[n,r]=v.useState([]),[s,i]=v.useState([]),[o,a]=v.useState([]),[l,u]=v.useState(_w),[d,h]=v.useState(null),[f,p]=v.useState(!1),[m,g]=v.useState(""),y=()=>{A.get("/admin-users").then(r),A.get("/permissions/catalog").then(i),(e("permission_groups.manage")||e("users.manage"))&&A.get("/permission-groups").then(a)};v.useEffect(y,[]);const b=S=>{h(S.id),p(S.is_primary),u({username:S.username,password:"",is_super_admin:S.is_super_admin,permissions:S.permissions,group_ids:S.groups.map(N=>N.id)})},x=()=>{h(null),p(!1),u(_w)},k=S=>{u(N=>({...N,permissions:N.permissions.includes(S)?N.permissions.filter(M=>M!==S):[...N.permissions,S]}))},w=S=>{u(N=>({...N,group_ids:N.group_ids.includes(S)?N.group_ids.filter(M=>M!==S):[...N.group_ids,S]}))},C=async S=>{S.preventDefault(),g("");try{if(d)await A.put(`/admin-users/${d}`,l);else{if(l.password.length<8){g("Passwort muss mindestens 8 Zeichen lang sein");return}await A.post("/admin-users",l)}x(),y()}catch(N){g(N.message)}},E=async S=>{if(confirm("Diesen Benutzer wirklich löschen?"))try{await A.delete(`/admin-users/${S}`),y()}catch(N){alert(N.message)}};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Benutzer"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Jeder Mitarbeiter bekommt ein eigenes Konto mit genau den Rechten, die er braucht."}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Benutzername"}),c.jsx("th",{className:"px-4 py-2",children:"Rolle"}),c.jsx("th",{className:"px-4 py-2",children:"Berechtigungsgruppen"}),c.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktiv"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[n.map(S=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:[S.username,S.id===(t==null?void 0:t.id)&&c.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(du)"}),S.is_primary&&c.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(Erst-Administrator)"})]}),c.jsx("td",{className:"px-4 py-2",children:S.is_super_admin?c.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-medium text-brand-700 dark:bg-brand-900/40 dark:text-brand-300",children:"Super-Admin"}):c.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400",children:[S.permissions.length," Einzelrechte"]})}),c.jsx("td",{className:"px-4 py-2",children:c.jsxs("div",{className:"flex flex-wrap gap-1",children:[S.groups.map(N=>c.jsx("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:N.name},N.id)),S.groups.length===0&&"–"]})}),c.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:H7(S.last_active_at)}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>b(S),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),S.id!==(t==null?void 0:t.id)&&!S.is_primary&&c.jsx("button",{onClick:()=>E(S.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},S.id)),n.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Benutzer angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:C,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:d?"Benutzer bearbeiten":"Neuer Benutzer"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername *"}),c.jsx("input",{required:!0,value:l.username,onChange:S=>u({...l,username:S.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",d?"(leer lassen = unverändert)":"*"]}),c.jsx("input",{type:"password",required:!d,value:l.password,onChange:S=>u({...l,password:S.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),(t==null?void 0:t.is_super_admin)&&c.jsxs("div",{children:[c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:l.is_super_admin,disabled:f,onChange:S=>u({...l,is_super_admin:S.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500 disabled:opacity-50"}),"Super-Admin (hat automatisch alle Rechte)"]}),f&&c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Der Erst-Administrator behält immer den Super-Admin-Status."})]}),!l.is_super_admin&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Einzelne Berechtigungen"}),c.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:s.map(S=>c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:l.permissions.includes(S.key),onChange:()=>k(S.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),S.label]},S.key))})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungsgruppen"}),c.jsxs("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:[o.map(S=>c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:l.group_ids.includes(S.id),onChange:()=>w(S.id),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),S.name]},S.id)),o.length===0&&c.jsx("p",{className:"text-sm text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})]})]})]}),m&&c.jsx("p",{className:"text-sm text-red-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:d?"Speichern":"Anlegen"}),d&&c.jsx("button",{type:"button",onClick:x,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Iw={name:"",description:"",permissions:[]};function U7(){const[t,e]=v.useState([]),[n,r]=v.useState([]),[s,i]=v.useState(Iw),[o,a]=v.useState(null),[l,u]=v.useState(""),d=()=>{A.get("/permission-groups").then(e),A.get("/permissions/catalog").then(r)};v.useEffect(d,[]);const h=y=>{a(y.id),i({name:y.name,description:y.description||"",permissions:y.permissions})},f=()=>{a(null),i(Iw)},p=y=>{i(b=>({...b,permissions:b.permissions.includes(y)?b.permissions.filter(x=>x!==y):[...b.permissions,y]}))},m=async y=>{y.preventDefault(),u("");try{o?await A.put(`/permission-groups/${o}`,s):await A.post("/permission-groups",s),f(),d()}catch(b){u(b.message)}},g=async y=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await A.delete(`/permission-groups/${y}`),d())};return c.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[c.jsxs("div",{className:"lg:col-span-2",children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Fasse mehrere Berechtigungen zu einer Gruppe zusammen (z. B. „Werkstatt"), die du dann bequem einem oder mehreren Benutzern zuweisen kannst.'}),c.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:c.jsxs("table",{className:"w-full text-left text-sm",children:[c.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:c.jsxs("tr",{children:[c.jsx("th",{className:"px-4 py-2",children:"Name"}),c.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),c.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),c.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(y=>c.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[c.jsxs("td",{className:"px-4 py-2",children:[c.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:y.name}),y.description&&c.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:y.description})]}),c.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[y.permissions.length," von ",n.length]}),c.jsxs("td",{className:"px-4 py-2 text-right",children:[c.jsx("button",{onClick:()=>h(y),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),c.jsx("button",{onClick:()=>g(y.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},y.id)),t.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),c.jsxs("form",{onSubmit:m,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:o?"Gruppe bearbeiten":"Neue Gruppe"}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),c.jsx("input",{required:!0,value:s.name,onChange:y=>i({...s,name:y.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),c.jsx("textarea",{rows:2,value:s.description,onChange:y=>i({...s,description:y.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),c.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:n.map(y=>c.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:s.permissions.includes(y.key),onChange:()=>p(y.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),y.label]},y.key))})]}),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o?"Speichern":"Anlegen"}),o&&c.jsx("button",{type:"button",onClick:f,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const K7=[{to:"/admin/settings/website",label:"Website"},{to:"/admin/settings/legal",label:"Rechtstexte"},{to:"/admin/settings/email",label:"E-Mail"},{to:"/admin/settings/database",label:"Datenbank"},{to:"/admin/settings/export-import",label:"Export & Import"},{to:"/admin/settings/maintenance",label:"Wartungsmodus"},{to:"/admin/settings/update",label:"Updates",permission:"system.update"},{to:"/admin/settings/reset",label:"Zurücksetzen"}];function G7(){const{hasPermission:t}=Cn(),e=K7.filter(r=>!r.permission||t(r.permission)),n=({isActive:r})=>`rounded-md px-4 py-2 text-sm font-medium transition ${r?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`;return c.jsxs("div",{children:[c.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Einstellungen"}),c.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Werkzeuge rund um Datenbank, Server-Umzug und Zurücksetzen dieser Seite."}),c.jsx("nav",{className:"mb-6 flex flex-wrap gap-2",children:e.map(r=>c.jsx(eN,{to:r.to,className:n,children:r.label},r.to))}),c.jsx(Kd,{})]})}const B2=[{key:"mon",label:"Montag"},{key:"tue",label:"Dienstag"},{key:"wed",label:"Mittwoch"},{key:"thu",label:"Donnerstag"},{key:"fri",label:"Freitag"},{key:"sat",label:"Samstag"},{key:"sun",label:"Sonntag"}],z2=Object.fromEntries(B2.map(t=>[t.key,{open:"09:00",close:"18:00",closed:!1}])),q7={phone:"",whatsapp:"",contact_email:"",address_street:"",address_zip:"",address_city:"",logo_path:"",logo_dark_path:"",business_hours:z2,hero_image_path:"",ga_measurement_id:"",package_card_theme:"graphite",package_card_layout:"strip",package_wheel_hint_interval:8,gallery_card_text_x:0,gallery_card_text_y:100,site_font:""},J7=[{value:"graphite",label:"Graphite Green",description:"Graphit über Bronze/Silber/Gold/Platin bis zur Onyx-Krönung."},{value:"deep-blue",label:"Deep Blue Luxury",description:"Kühles Blau, das sich über Grün zu Gold erwärmt."},{value:"warm-bronze",label:"Warm Bronze",description:"Durchgehend warmes Kupfer/Bronze/Amber bis zum Gold."}],Y7=[{value:"grid",label:"Raster",description:"Breite Kacheln, die responsiv in mehrere Zeilen umbrechen."},{value:"strip",label:"Scroll-Band",description:"Schmale, hochkant Kacheln in einer horizontal scrollbaren Reihe."},{value:"coverflow",label:"3D-Coverflow",description:"Kacheln drehen sich beim Wischen räumlich – die mittlere steht im Fokus."}];function X7(){const[t,e]=v.useState(q7),[n,r]=v.useState(!0),[s,i]=v.useState(!1),[o,a]=v.useState(!1),[l,u]=v.useState(""),[d,h]=v.useState(null),f=v.useRef(null),[p,m]=v.useState(!1),g=(D,oe)=>{const Me=f.current.getBoundingClientRect();return{x:Math.max(0,Math.min(100,Math.round((D-Me.left)/Me.width*100))),y:Math.max(0,Math.min(100,Math.round((oe-Me.top)/Me.height*100)))}},y=(D,oe)=>{const{x:Me,y:fs}=g(D,oe);e(V2=>({...V2,gallery_card_text_x:Me,gallery_card_text_y:fs})),a(!1)},b=D=>{D.preventDefault(),D.currentTarget.setPointerCapture(D.pointerId),m(!0),y(D.clientX,D.clientY)},x=D=>{p&&y(D.clientX,D.clientY)},k=D=>{m(!1),D.currentTarget.releasePointerCapture(D.pointerId)},[w,C]=v.useState(""),[E,S]=v.useState(""),[N,M]=v.useState(!1),[j,T]=v.useState(!1),[R,$]=v.useState(""),[L,W]=v.useState(!1),[B,Z]=v.useState(""),[_,I]=v.useState(""),[V,K]=v.useState(!1),[te,Se]=v.useState(null),[se,he]=v.useState(!1),[Te,lt]=v.useState(""),[vh,ni]=v.useState(!1),[ri,ko]=v.useState(!1);v.useEffect(()=>{A.get("/site-settings").then(D=>e({phone:D.phone||"",whatsapp:D.whatsapp||"",contact_email:D.contact_email||"",address_street:D.address_street||"",address_zip:D.address_zip||"",address_city:D.address_city||"",logo_path:D.logo_path||"",logo_dark_path:D.logo_dark_path||"",business_hours:D.business_hours||z2,hero_image_path:D.hero_image_path||"",ga_measurement_id:D.ga_measurement_id||"",package_card_theme:D.package_card_theme||"graphite",package_card_layout:D.package_card_layout||"strip",package_wheel_hint_interval:D.package_wheel_hint_interval||8,gallery_card_text_x:D.gallery_card_text_x??0,gallery_card_text_y:D.gallery_card_text_y??100,site_font:D.site_font||""})).finally(()=>r(!1)),A.get("/gallery-brands").then(D=>h(D.find(oe=>oe.cover_image_path)||null)).catch(()=>{}),A.get("/settings/analytics").then(D=>{C(D.ga_property_id||""),M(D.has_credentials)}),P()},[]);const P=()=>{A.get("/settings/google-reviews").then(D=>{Z(D.place_id||""),K(D.has_api_key),Se(D)})},X=async()=>{he(!0),lt(""),ni(!1);try{const D=await A.post("/settings/google-reviews",{place_id:B,api_key:_});K(D.has_api_key),Se(D),I(""),ni(!0)}catch(D){lt(D.message)}finally{he(!1)}},ie=async()=>{ko(!0),lt("");try{const D=await A.post("/settings/google-reviews/refresh",{});Se(D)}catch(D){lt(D.message),P()}finally{ko(!1)}},ct=async()=>{T(!0),$(""),W(!1);try{const D=await A.post("/settings/analytics",{ga_property_id:w,service_account_json:E});M(D.has_credentials),S(""),W(!0)}catch(D){$(D.message)}finally{T(!1)}},xe=(D,oe)=>{e(Me=>({...Me,[D]:oe})),a(!1)},ds=(D,oe,Me)=>{e(fs=>({...fs,business_hours:{...fs.business_hours,[D]:{...fs.business_hours[D],[oe]:Me}}})),a(!1)},hs=async D=>{D.preventDefault(),i(!0),u(""),a(!1);try{await A.post("/site-settings",t),a(!0)}catch(oe){u(oe.message)}finally{i(!1)}};return n?c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):c.jsxs("form",{onSubmit:hs,className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Startseiten-Bild"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das große Hero-Bild ganz oben auf der Startseite. Ohne eigenes Bild wird das Standardbild verwendet."}),c.jsx(tr,{value:t.hero_image_path,onChange:D=>xe("hero_image_path",D),label:"Bild",aspect:16/9})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Firmenlogo"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Ohne eigenes Logo wird das Standard-Logo dieser Vorlage angezeigt. Für den Dunkelmodus kann eine eigene Variante hinterlegt werden (z. B. mit heller statt dunkler Wortmarke)."}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsx(tr,{value:t.logo_path,onChange:D=>xe("logo_path",D),label:"Logo (Hellmodus)"}),c.jsx(tr,{value:t.logo_dark_path,onChange:D=>xe("logo_dark_path",D),label:"Logo (Dunkelmodus)"})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Schriftart"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Gilt für die gesamte Website. Einzelne Startseiten-Sektionen können unter „Startseite“ davon abweichen."}),c.jsx("select",{value:t.site_font,onChange:D=>xe("site_font",D.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:bx.map(D=>c.jsx("option",{value:D.value,children:D.label},D.label))})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktdaten"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird im Header, Footer und auf der Kontaktseite angezeigt."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Telefon"}),c.jsx("input",{value:t.phone,onChange:D=>xe("phone",D.target.value),placeholder:"09373 20 62 390",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"WhatsApp Business Nummer"}),c.jsx("input",{value:t.whatsapp,onChange:D=>xe("whatsapp",D.target.value),placeholder:"z. B. 09373 20 62 390",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Leer lassen, um den WhatsApp-Link im Header auszublenden."})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail"}),c.jsx("input",{type:"email",value:t.contact_email,onChange:D=>xe("contact_email",D.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px_1fr]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Straße & Hausnummer"}),c.jsx("input",{value:t.address_street,onChange:D=>xe("address_street",D.target.value),placeholder:"Boxbrunner Str. 20a",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"PLZ"}),c.jsx("input",{value:t.address_zip,onChange:D=>xe("address_zip",D.target.value),placeholder:"63916",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Ort"}),c.jsx("input",{value:t.address_city,onChange:D=>xe("address_city",D.target.value),placeholder:"Amorbach",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Öffnungszeiten"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Wird im Footer und auf der Kontaktseite angezeigt, inklusive dem "Geöffnet/Geschlossen"-Hinweis im Footer, der live gegen diese Zeiten rechnet.'}),c.jsx("div",{className:"space-y-2",children:B2.map(D=>{const oe=t.business_hours[D.key]||{open:"",close:"",closed:!1};return c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[c.jsx("span",{className:"w-24 shrink-0 text-sm text-neutral-600 dark:text-neutral-300",children:D.label}),c.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-neutral-500 dark:text-neutral-400",children:[c.jsx("input",{type:"checkbox",checked:!oe.closed,onChange:Me=>ds(D.key,"closed",!Me.target.checked),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"geöffnet"]}),!oe.closed&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"time",value:oe.open,onChange:Me=>ds(D.key,"open",Me.target.value),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("span",{className:"text-neutral-400",children:"–"}),c.jsx("input",{type:"time",value:oe.close,onChange:Me=>ds(D.key,"close",Me.target.value),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]},D.key)})})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Paket-Kachel-Design"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Bestimmt die Farbgebung der Paket-Stufen auf jeder Fahrzeug-Modell-Seite (von der günstigsten bis zur teuersten Option)."}),c.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:J7.map(D=>c.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${t.package_card_theme===D.value?"border-brand-500 ring-2 ring-brand-500/40":"border-neutral-300 hover:border-neutral-400 dark:border-neutral-700 dark:hover:border-neutral-600"}`,children:[c.jsx("input",{type:"radio",name:"package_card_theme",value:D.value,checked:t.package_card_theme===D.value,onChange:oe=>xe("package_card_theme",oe.target.value),className:"sr-only"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:D.label}),c.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:D.description})]},D.value))})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kachel-Layout"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Bestimmt, wie die Paket-Stufen auf jeder Fahrzeug-Modell-Seite angeordnet werden."}),c.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:Y7.map(D=>c.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${t.package_card_layout===D.value?"border-brand-500 ring-2 ring-brand-500/40":"border-neutral-300 hover:border-neutral-400 dark:border-neutral-700 dark:hover:border-neutral-600"}`,children:[c.jsx("input",{type:"radio",name:"package_card_layout",value:D.value,checked:t.package_card_layout===D.value,onChange:oe=>xe("package_card_layout",oe.target.value),className:"sr-only"}),c.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:D.label}),c.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:D.description})]},D.value))}),c.jsxs("div",{className:"mt-5 max-w-xs",children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Mausrad-Hinweis: Wiederholung (Sekunden)"}),c.jsx("input",{type:"number",min:"2",max:"120",value:t.package_wheel_hint_interval,onChange:D=>xe("package_wheel_hint_interval",D.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:'Nur bei Scroll-Band/3D-Coverflow: Solange ein Besucher noch auf der ersten Kachel steht, wird der "mit dem Mausrad blättern"-Hinweis in diesem Abstand wiederholt.'})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Bildergalerie-Kacheln"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Position des Marken-/Projekt-Namens auf den Kacheln der Bildergalerie-Übersicht und der Marken-Detailseite."}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-[16rem_1fr] sm:items-start",children:[c.jsxs("div",{children:[c.jsxs("div",{ref:f,className:"relative aspect-[4/3] select-none overflow-hidden rounded-xl bg-neutral-900 shadow-sm",children:[d?c.jsx("img",{src:d.cover_image_path,alt:"",draggable:!1,className:"h-full w-full object-cover"}):c.jsx("div",{className:"h-full w-full bg-gradient-to-br from-neutral-700 to-neutral-900"}),c.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent"}),c.jsx("span",{onPointerDown:b,onPointerMove:x,onPointerUp:k,style:{...Xi(t.gallery_card_text_x,t.gallery_card_text_y,{x:0,y:100}),touchAction:"none"},className:`absolute select-none whitespace-nowrap rounded p-3 text-sm font-extrabold text-white transition-colors ${p?"cursor-grabbing bg-white/10 ring-2 ring-brand-400":"cursor-grab hover:bg-white/10"}`,children:d?d.name:"Beispiel-Marke"})]}),c.jsx("p",{className:"mt-1.5 text-center text-xs text-neutral-400",children:"Namen zum Verschieben ziehen"})]}),c.jsxs("div",{className:"flex flex-col gap-3 sm:pt-1",children:[c.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Position:"," ",c.jsxs("span",{className:"font-mono font-semibold text-neutral-700 dark:text-neutral-200",children:[t.gallery_card_text_x,"% / ",t.gallery_card_text_y,"%"]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl waagerecht"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:()=>xe("gallery_card_text_x",0),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Links"}),c.jsx("button",{type:"button",onClick:()=>xe("gallery_card_text_x",50),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Mittig"}),c.jsx("button",{type:"button",onClick:()=>xe("gallery_card_text_x",100),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Rechts"})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl senkrecht"}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{type:"button",onClick:()=>xe("gallery_card_text_y",0),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Oben"}),c.jsx("button",{type:"button",onClick:()=>xe("gallery_card_text_y",50),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Mittig"}),c.jsx("button",{type:"button",onClick:()=>xe("gallery_card_text_y",100),className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800",children:"Unten"})]})]})]})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird erst geladen, nachdem ein Besucher der Statistik-Kategorie im Cookie-Banner zugestimmt hat. Leer lassen, um Google Analytics zu deaktivieren."}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Measurement-ID"}),c.jsx("input",{value:t.ga_measurement_id,onChange:D=>xe("ga_measurement_id",D.target.value),placeholder:"G-XXXXXXXXXX",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{className:"mt-5 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[c.jsx("h3",{className:"mb-1 text-sm font-semibold text-neutral-900 dark:text-white",children:"Dashboard-Anbindung (optional)"}),c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Zeigt Besucherzahlen direkt in deinem Admin-Dashboard an. Braucht ein Google-Cloud-Service-Account mit Lesezugriff auf diese GA4-Property."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Property-ID"}),c.jsx("input",{value:w,onChange:D=>{C(D.target.value),W(!1)},placeholder:"z. B. 123456789",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Nicht die Measurement-ID (G-...) - zu finden unter GA4 → Verwaltung → Property-Details."})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Service-Account-JSON-Schlüssel ",N?"(leer lassen = unverändert)":""]}),c.jsx("textarea",{rows:4,value:E,onChange:D=>{S(D.target.value),W(!1)},placeholder:N?'{ "type": "service_account", ... } (bereits hinterlegt)':'{ "type": "service_account", ... }',className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 font-mono text-xs dark:border-neutral-700 dark:bg-neutral-900"})]})]}),R&&c.jsx("p",{className:"mt-2 text-sm text-red-600",children:R}),L&&c.jsx("p",{className:"mt-2 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"button",onClick:ct,disabled:j,className:"mt-3 rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:j?"Speichere…":"Dashboard-Anbindung speichern"})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google-Rezensionen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Zeigt die echte Google-Bewertung und die aktuellsten Rezensionen auf der Startseite an, statt der fest eingetragenen Beispiel-Texte. Wird einmal täglich automatisch aktualisiert (nie bei einem Seitenbesuch selbst) – die Seite zeigt also immer den letzten erfolgreich abgerufenen Stand."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Place-ID"}),c.jsx("input",{value:B,onChange:D=>{Z(D.target.value),ni(!1)},placeholder:"z. B. ChIJN1t_tDeuEmsRUsoyG83frY4",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Eindeutige Google-Kennung eures Eintrags – zu finden über den"," ",c.jsx("a",{href:"https://developers.google.com/maps/documentation/places/web-service/place-id#find-id",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-600",children:"Google Place ID Finder"}),"."]})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Places-API-Key ",V?"(leer lassen = unverändert)":""]}),c.jsx("input",{value:_,onChange:D=>{I(D.target.value),ni(!1)},placeholder:V?"••••••••••••••••••••• (bereits hinterlegt)":"AIzaSy…",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 font-mono text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Aus der Google-Cloud-Console, mit aktivierter „Places API (New)“."})]})]}),Te&&c.jsx("p",{className:"mt-3 text-sm text-red-600",children:Te}),vh&&c.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[c.jsx("button",{type:"button",onClick:X,disabled:se,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:se?"Speichere…":"Google-Rezensionen-Einstellungen speichern"}),c.jsx("button",{type:"button",onClick:ie,disabled:ri||!B||!V,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:ri?"Aktualisiere…":"Jetzt aktualisieren"})]}),te&&c.jsxs("div",{className:"mt-4 rounded-md bg-neutral-50 p-3 text-sm dark:bg-neutral-800/50",children:[te.rating!=null?c.jsxs("p",{className:"text-neutral-700 dark:text-neutral-300",children:["Aktuell hinterlegt: ",c.jsxs("strong",{children:[te.rating," ★"]})," (",te.rating_count," Bewertungen)",te.updated_at&&c.jsxs(c.Fragment,{children:[" – zuletzt aktualisiert am ",new Date(te.updated_at.replace(" ","T")).toLocaleString("de-DE")]})]}):c.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:"Noch keine erfolgreiche Aktualisierung – die Startseite zeigt bis dahin weiter die Beispiel-Rezensionen."}),te.error&&c.jsxs("p",{className:"mt-1 text-red-600",children:["Letzter Fehler: ",te.error]})]})]}),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),o&&c.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}const Z7=[{slug:"impressum",label:"Impressum"},{slug:"datenschutz",label:"Datenschutzerklärung"},{slug:"agb",label:"AGB"}];function Q7(){const[t,e]=v.useState(null),[n,r]=v.useState("impressum"),[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(!1);if(v.useEffect(()=>{A.get("/legal-pages").then(e)},[]),!t)return c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const d=t[n],h=(p,m)=>{e(g=>({...g,[n]:{...g[n],[p]:m}})),u(!1)},f=async()=>{i(!0),a(""),u(!1);try{await A.put(`/legal-pages/${n}`,{title:d.title,body_html:d.body_html}),u(!0)}catch(p){a(p.message)}finally{i(!1)}};return c.jsx("div",{className:"max-w-3xl space-y-6",children:c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Rechtstexte"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Impressum, Datenschutzerklärung und AGB direkt hier pflegen, statt einen Deploy für jede Textänderung zu brauchen. Bitte bei Rechtstexten im Zweifel rechtlich beraten lassen, bevor du größere Änderungen veröffentlichst."}),c.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:Z7.map(p=>c.jsx("button",{type:"button",onClick:()=>{r(p.slug),u(!1),a("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${n===p.slug?"bg-brand-500 text-white":"border border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:p.label},p.slug))}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),c.jsx("input",{value:d.title,onChange:p=>h("title",p.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(Sd,{label:"Inhalt",value:d.body_html,onChange:p=>h("body_html",p)})]}),d.updated_at&&c.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(d.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),o&&c.jsx("p",{className:"mt-3 text-sm text-red-600",children:o}),l&&c.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"button",onClick:f,disabled:s,className:"mt-4 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})})}const eW={download:"Herunterladen",extract:"Entpacken",backup:"Sichern",apply:"Installieren"};function Ow(t){return t?t.slice(0,7):"–"}function tW(t){return t?new Date(t).toLocaleString("de-DE"):"–"}function nW(){const[t,e]=v.useState(null),[n,r]=v.useState(null),[s,i]=v.useState(!0),[o,a]=v.useState(""),[l,u]=v.useState(!1),[d,h]=v.useState({download:null,extract:null,backup:null,apply:null}),[f,p]=v.useState(""),[m,g]=v.useState(null),y=()=>{i(!0),a(""),Promise.all([A.get("/settings/update-status"),A.get("/settings/update-check")]).then(([C,E])=>{e(C),r(E)}).catch(C=>a(C.message)).finally(()=>i(!1))};v.useEffect(y,[]);const b=async()=>{u(!0),p(""),g(null),h({download:"busy",extract:null,backup:null,apply:null});try{const E=(await A.post("/settings/update-download",{})).run_id;h(N=>({...N,download:"done",extract:"busy"})),await A.post("/settings/update-extract",{run_id:E}),h(N=>({...N,extract:"done",backup:"busy"})),await A.post("/settings/update-backup",{}),h(N=>({...N,backup:"done",apply:"busy"}));const S=await A.post("/settings/update-apply",{run_id:E});h(N=>({...N,apply:"done"})),g(S.log||[]),y()}catch(C){h(E=>{const S=Object.keys(E).find(N=>E[N]==="busy");return S?{...E,[S]:"error"}:E}),p(C.message)}finally{u(!1)}};if(s)return c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const x=(t==null?void 0:t.capabilities)||{},k=x.zip?x.http_client?x.writable?null:"Das Website-Verzeichnis ist für PHP nicht beschreibbar - bitte Dateiberechtigungen prüfen.":"Diese Funktion benötigt ausgehende HTTPS-Verbindungen (curl oder allow_url_fopen), die auf diesem Server aktuell nicht verfügbar sind.":'Diese Funktion benötigt die PHP-Erweiterung "zip", die auf diesem Server aktuell nicht aktiviert ist. Bitte beim Hoster aktivieren lassen.',w=n==null?void 0:n.update_available;return c.jsx("div",{className:"max-w-2xl space-y-6",children:c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Updates aus Git"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Zieht den aktuellen Stand direkt vom Code-Repository und installiert ihn hier - ohne manuellen FTP-Upload. Passiert nur, wenn du unten aktiv auf "Update installieren" klickst, nie automatisch im Hintergrund.'}),o&&c.jsx("p",{className:"mb-3 text-sm text-red-600",children:o}),k?c.jsx("p",{className:"rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:k}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"mb-4 grid grid-cols-2 gap-3 text-sm",children:[c.jsxs("div",{className:"rounded-md bg-neutral-50 p-3 dark:bg-neutral-800/50",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:"Installiert"}),c.jsx("p",{className:"font-mono text-neutral-800 dark:text-neutral-100",children:Ow(t==null?void 0:t.deployed_sha)}),c.jsx("p",{className:"text-xs text-neutral-400",children:tW(t==null?void 0:t.deployed_at)})]}),c.jsxs("div",{className:"rounded-md bg-neutral-50 p-3 dark:bg-neutral-800/50",children:[c.jsx("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:"Neuester Stand"}),c.jsx("p",{className:"font-mono text-neutral-800 dark:text-neutral-100",children:Ow(n==null?void 0:n.latest_sha)}),(n==null?void 0:n.latest_message)&&c.jsx("p",{className:"truncate text-xs text-neutral-400",title:n.latest_message,children:n.latest_message})]})]}),w?c.jsx("p",{className:"mb-3 text-sm font-medium text-brand-600 dark:text-brand-400",children:"Update verfügbar."}):c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Bereits auf dem neuesten Stand."}),c.jsxs("div",{className:"mb-3 flex gap-2",children:[c.jsx("button",{type:"button",onClick:y,disabled:l,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Nach Updates suchen"}),c.jsx("button",{type:"button",onClick:b,disabled:l||!w,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:l?"Installiere…":"Update installieren"})]}),(l||f)&&c.jsx("ul",{className:"mb-3 space-y-1 text-sm",children:Object.entries(eW).map(([C,E])=>c.jsxs("li",{className:"flex items-center gap-2",children:[c.jsx("span",{className:d[C]==="done"?"text-green-600 dark:text-green-400":d[C]==="error"?"text-red-600":d[C]==="busy"?"text-brand-600 dark:text-brand-400":"text-neutral-300 dark:text-neutral-600",children:d[C]==="done"?"✓":d[C]==="error"?"✕":d[C]==="busy"?"…":"○"}),E]},C))}),f&&c.jsx("p",{className:"text-sm text-red-600",children:f}),m&&c.jsxs("div",{className:"mt-3 rounded-md bg-green-50 p-3 text-sm text-green-800 dark:bg-green-900/20 dark:text-green-300",children:[c.jsx("p",{className:"mb-1 font-semibold",children:"Update installiert."}),m.length>0&&c.jsxs("details",{children:[c.jsx("summary",{className:"cursor-pointer text-xs",children:"Details anzeigen"}),c.jsx("ul",{className:"mt-2 list-disc pl-5 text-xs",children:m.map((C,E)=>c.jsx("li",{children:C},E))})]})]})]})]})})}function wc(t){if(!t)return"";if(/<[a-z][\s\S]*>/i.test(t))return t;const e=document.createElement("div");return e.textContent=t,`

${e.innerHTML.replace(/\n/g,"
")}

`}const rW={mail_host:"",mail_port:587,mail_username:"",mail_password:"",mail_encryption:"tls",mail_from_email:"",mail_from_name:"",mail_notify_email:"",mail_customer_subject:"",mail_customer_body:"",mail_owner_subject:"",mail_owner_body:""},sW=[["{{name}}","Name des Kunden"],["{{email}}","E-Mail des Kunden"],["{{phone}}","Telefonnummer"],["{{vin}}","Fahrgestellnummer (FIN)"],["{{message}}","Nachricht des Kunden"],["{{brand}}","Marke"],["{{model}}","Modell"],["{{package}}","Paket"],["{{product}}","Produkt"],["{{upgrades}}","Gewählte Upgrades"]];function Bw(){return c.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:sW.map(([t,e])=>c.jsx("span",{title:e,className:"rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:t},t))})}function iW(){const[t,e]=v.useState(rW),[n,r]=v.useState(!1),[s,i]=v.useState(!0),[o,a]=v.useState(!1),[l,u]=v.useState(!1),[d,h]=v.useState(""),[f,p]=v.useState(!1),[m,g]=v.useState(!1),[y,b]=v.useState(""),[x,k]=v.useState(""),[w,C]=v.useState(""),[E,S]=v.useState(null);v.useEffect(()=>{A.get("/settings/mail").then(T=>{e({...T,mail_password:"",mail_customer_body:wc(T.mail_customer_body),mail_owner_body:wc(T.mail_owner_body)}),r(T.has_password)}).finally(()=>i(!1))},[]);const N=(T,R)=>{e($=>({...$,[T]:R})),p(!1)},M=async T=>{T.preventDefault(),u(!0),h(""),p(!1);try{const R=await A.post("/settings/mail",t);e({...R,mail_password:"",mail_customer_body:wc(R.mail_customer_body),mail_owner_body:wc(R.mail_owner_body)}),r(R.has_password),p(!0)}catch(R){h(R.message)}finally{u(!1)}},j=async()=>{g(!0),b(""),k(""),C(""),S(null);try{const T=await A.post("/settings/mail/test",t);k(`Testmail gesendet an ${T.sent_to}. Der Server hat die Mail angenommen - prüfe auch den Spam-Ordner, das ist noch keine Garantie für die Zustellung.`),C(T.warning||""),S(T.smtp_log||null)}catch(T){b(T.message)}finally{g(!1)}};return s?c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):c.jsxs("form",{onSubmit:M,className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"SMTP-Server"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Zugangsdaten deines Mail-Postfachs oder Transactional-Mail-Anbieters. Solange kein Server eingetragen ist, werden keine E-Mails verschickt (Kontaktanfragen werden trotzdem in der Datenbank gespeichert)."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px]",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Server (Host)"}),c.jsx("input",{value:t.mail_host,onChange:T=>N("mail_host",T.target.value),placeholder:"smtp.beispiel.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Port"}),c.jsx("input",{type:"number",value:t.mail_port,onChange:T=>N("mail_port",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Verschlüsselung"}),c.jsxs("select",{value:t.mail_encryption,onChange:T=>N("mail_encryption",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[c.jsx("option",{value:"tls",children:"STARTTLS"}),c.jsx("option",{value:"ssl",children:"SSL"}),c.jsx("option",{value:"none",children:"Keine"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),c.jsx("input",{value:t.mail_username,onChange:T=>N("mail_username",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{type:o?"text":"password",value:t.mail_password,onChange:T=>N("mail_password",T.target.value),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("button",{type:"button",onClick:()=>a(T=>!T),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:o?"Verbergen":"Anzeigen"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-E-Mail"}),c.jsx("input",{type:"email",value:t.mail_from_email,onChange:T=>N("mail_from_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-Name"}),c.jsx("input",{value:t.mail_from_name,onChange:T=>N("mail_from_name",T.target.value),placeholder:"HifiPlanet",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),c.jsxs("div",{className:"mt-4 border-t border-neutral-200 pt-4 dark:border-neutral-800",children:[y&&c.jsx("p",{className:"mb-2 whitespace-pre-wrap text-sm text-red-600",children:y}),x&&c.jsx("p",{className:"mb-2 text-sm text-green-600 dark:text-green-400",children:x}),w&&c.jsx("p",{className:"mb-2 rounded-md bg-amber-50 p-2 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:w}),c.jsx("button",{type:"button",onClick:j,disabled:m,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:m?"Sende Testmail…":"Verbindung testen"}),E&&E.length>0&&c.jsxs("details",{className:"mt-3",children:[c.jsx("summary",{className:"cursor-pointer text-xs text-neutral-500 dark:text-neutral-400",children:"SMTP-Protokoll anzeigen"}),c.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-neutral-900 p-3 text-xs text-neutral-200",children:E.join(` +`)})]})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Empfänger"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"An diese Adresse geht die Benachrichtigung bei jeder neuen Kontaktanfrage."}),c.jsx("input",{type:"email",value:t.mail_notify_email,onChange:T=>N("mail_notify_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Kunden (Bestätigung)"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Geht automatisch an den Kunden, sobald er eine Kontaktanfrage abschickt."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),c.jsx("input",{value:t.mail_customer_subject,onChange:T=>N("mail_customer_subject",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(Sd,{label:"Text",value:t.mail_customer_body,onChange:T=>N("mail_customer_body",T)})]}),c.jsx(Bw,{})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Shop (Benachrichtigung)"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Geht an die oben eingestellte Empfänger-Adresse, sobald eine neue Kontaktanfrage eingeht."}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),c.jsx("input",{value:t.mail_owner_subject,onChange:T=>N("mail_owner_subject",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsx(Sd,{label:"Text",value:t.mail_owner_body,onChange:T=>N("mail_owner_body",T)})]}),c.jsx(Bw,{})]}),d&&c.jsx("p",{className:"text-sm text-red-600",children:d}),f&&c.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"submit",disabled:l,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:l?"Speichere…":"Speichern"})]})}function oW(){const[t,e]=v.useState({host:"",name:"",user:"",password:"",charset:"utf8mb4"}),[n,r]=v.useState(!1),[s,i]=v.useState(!0),[o,a]=v.useState(!1),[l,u]=v.useState(!1),[d,h]=v.useState(""),[f,p]=v.useState(!1),[m,g]=v.useState(null),[y,b]=v.useState(!0),[x,k]=v.useState(!1),[w,C]=v.useState(null),E=()=>{i(!0),A.get("/settings/database").then(j=>{e({...j.config,password:""}),r(j.has_password)}).finally(()=>i(!1))},S=()=>{b(!0),A.get("/settings/schema-check").then(g).catch(j=>g({ok:!1,error:j.message,tables:[]})).finally(()=>b(!1))};v.useEffect(()=>{E(),S()},[]);const N=async()=>{k(!0),C(null);try{const j=await A.post("/settings/schema-migrate",{});C(j.actions),g(j.report)}catch(j){C(["Fehler: "+j.message])}finally{k(!1)}},M=async j=>{j.preventDefault(),u(!0),h(""),p(!1);try{await A.post("/settings/database",t),p(!0),e(T=>({...T,password:""})),r(!0),S()}catch(T){h(T.message)}finally{u(!1)}};return c.jsxs("div",{className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wichtig für einen Umzug auf einen anderen Server/Webspace: Trage hier die Zugangsdaten der dortigen Datenbank ein. Die Verbindung wird vor dem Speichern getestet, damit du dich nicht aussperrst."}),s?c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):c.jsxs("form",{onSubmit:M,className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Host *"}),c.jsx("input",{required:!0,value:t.host,onChange:j=>e({...t,host:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datenbankname *"}),c.jsx("input",{required:!0,value:t.name,onChange:j=>e({...t,name:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzer *"}),c.jsx("input",{required:!0,value:t.user,onChange:j=>e({...t,user:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{type:o?"text":"password",value:t.password,onChange:j=>e({...t,password:j.target.value}),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),c.jsx("button",{type:"button",onClick:()=>a(j=>!j),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:o?"Verbergen":"Anzeigen"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Zeichensatz"}),c.jsx("input",{value:t.charset,onChange:j=>e({...t,charset:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),d&&c.jsx("p",{className:"text-sm text-red-600",children:d}),f&&c.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Verbindung erfolgreich getestet und gespeichert."}),c.jsx("button",{type:"submit",disabled:l,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:l?"Teste & speichere…":"Verbindung testen & speichern"})]})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[c.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),!y&&m&&c.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${m.ok?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"}`,children:m.ok?"Datenbank OK":"Datenbank nicht OK"})]}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Prüft, ob diese Datenbank alle Tabellen und Spalten hat, die der aktuelle Code-Stand braucht – wichtig, wenn deine Live-Version auf einem anderen Server einen älteren Stand hat."}),y&&c.jsx("p",{className:"text-sm text-neutral-400",children:"Prüfe…"}),!y&&m&&!m.ok&&c.jsx("ul",{className:"mb-4 space-y-1 rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-300",children:m.tables.filter(j=>!j.ok).map(j=>c.jsx("li",{children:j.exists?c.jsxs(c.Fragment,{children:["Tabelle ",c.jsx("code",{className:"font-mono",children:j.table}),": Spalte(n) fehlen – ",j.missing_columns.join(", ")]}):c.jsxs(c.Fragment,{children:["Tabelle ",c.jsx("code",{className:"font-mono",children:j.table})," fehlt komplett"]})},j.table))}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx("button",{onClick:S,disabled:y,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Erneut prüfen"}),m&&!m.ok&&c.jsx("button",{onClick:N,disabled:x,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:x?"Aktualisiere…":"Datenbankstruktur aktualisieren"})]}),w&&c.jsx("ul",{className:"mt-3 space-y-1 rounded-md bg-neutral-50 p-3 text-sm text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:w.map((j,T)=>c.jsx("li",{children:j},T))})]})]})}const Sc=[{key:"catalog",label:"Fahrzeug-Katalog",hint:"Marken, Modelle (inkl. Bilder), Pakete, Produkte, Upgrades",tables:["brands","car_models","packages","package_products","package_upgrades"]},{key:"services",label:"Leistungen",hint:"Die Leistungen-Übersicht",tables:["services"]},{key:"faqs",label:"FAQs",hint:"Häufig gestellte Fragen",tables:["faqs"]},{key:"gallery",label:"Bildergalerie",hint:"Galerie-Marken, Projekte und Fotos (inkl. Bilder)",tables:["gallery_brands","gallery_projects","gallery_photos"]},{key:"settings",label:"Einstellungen",hint:"Telefon/Adresse/Öffnungszeiten, Logo, Wartungsmodus-Texte, Kachel-Design, Mail-Vorlagen (ohne Zugangsdaten)",tables:["app_settings"]},{key:"legal",label:"Rechtstexte",hint:"Impressum, Datenschutzerklärung, AGB",tables:["legal_pages"]},{key:"home",label:"Startseiten-Texte",hint:'Hero, YouTube-Sektion, Handwerk, Beratung, Einblicke, "Mehr als Car-Hifi"',tables:["home_sections"]},{key:"partners",label:"Partner",hint:"Marken-Logozeile auf der Startseite (inkl. Logos)",tables:["partners"]},{key:"permissions",label:"Berechtigungsgruppen",hint:"Rollen-Vorlagen und ihre Rechte (ohne Benutzerkonten selbst)",tables:["permission_groups","permission_group_permissions"]}],F2={brands:"Marken",car_models:"Modelle",packages:"Pakete",package_products:"Produkte",package_upgrades:"Upgrades",services:"Leistungen",faqs:"FAQs",gallery_brands:"Galerie-Marken",gallery_projects:"Galerie-Projekte",gallery_photos:"Galerie-Fotos",app_settings:"Einstellungen",legal_pages:"Rechtstexte",home_sections:"Startseiten-Texte",partners:"Partner",permission_groups:"Berechtigungsgruppen",permission_group_permissions:"Berechtigungsgruppen-Rechte",admin_users:"Benutzerkonten",admin_user_permissions:"Benutzer-Einzelrechte",admin_user_groups:"Benutzer-Gruppenzuweisungen"},aW=(t,e)=>{if(!t)return null;const n=e.map(r=>[r,Array.isArray(t[r])?t[r].length:0]).filter(([,r])=>r>0).map(([r,s])=>`${s} ${F2[r]||r}`);return n.length?n.join(", "):"leer in dieser Datei"};function lW(){const[t,e]=v.useState(null),[n,r]=v.useState(null),[s,i]=v.useState(""),[o,a]=v.useState(()=>new Set(Sc.map(N=>N.key))),[l,u]=v.useState(!1),[d,h]=v.useState(!1),[f,p]=v.useState(!1),[m,g]=v.useState(!1),[y,b]=v.useState(null),[x,k]=v.useState(""),w=async N=>{var j;const M=((j=N.target.files)==null?void 0:j[0])||null;if(e(M),b(null),k(""),r(null),i(""),a(new Set(Sc.map(T=>T.key))),h(!1),!!M)try{const T=await M.text(),R=JSON.parse(T);if(!R||typeof R.data!="object")throw new Error("kein gültiges Export-Format");r(R.data)}catch{i("Datei konnte nicht gelesen werden – Vorschau der Inhalte nicht möglich. Import würde trotzdem versucht (alle Bereiche).")}},C=N=>{a(M=>{const j=new Set(M);return j.has(N)?j.delete(N):j.add(N),j})},E=async N=>{if(N.preventDefault(),!(!t||!f||o.size===0)){g(!0),k(""),b(null);try{const M=new FormData;M.append("file",t),M.append("sections",JSON.stringify([...o])),M.append("include_accounts",d?"1":"0");const j=await A.post("/settings/import",M);b(j),e(null),r(null),p(!1),h(!1),N.target.reset()}catch(M){k(M.message)}finally{g(!1)}}},S=Sc.filter(N=>o.has(N.key)).map(N=>N.label);return d&&S.push("Benutzerkonten"),c.jsxs("div",{className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten exportieren"}),c.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Lädt eine Datei mit allen Marken, Modellen, Paketen, Produkten, Upgrades, Leistungen, FAQs, der kompletten Bildergalerie (inkl. Bilder), den Einstellungen und den Berechtigungsgruppen herunter (ohne Zugangsdaten wie SMTP-Passwort oder API-Keys – die müssen auf jedem Server neu eingetragen werden). Kontaktanfragen sind bewusst ",c.jsx("strong",{children:"nicht"})," enthalten."]}),c.jsxs("label",{className:"mb-3 flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:l,onChange:N=>u(N.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Benutzerkonten mit exportieren (enthält Passwort-Hashes und 2FA-Geheimnisse – nur für Backups an einem vertrauenswürdigen Ort)"]}),c.jsx("a",{href:`${tN}/settings/export${l?"?include_accounts=1":""}`,className:"inline-block rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Jetzt exportieren"})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten importieren"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Lädt eine zuvor exportierte Datei auf diesen Server. Ersetzt dabei die ausgewählten Bereiche komplett durch den Inhalt der Datei – das kann nicht rückgängig gemacht werden. Kontaktanfragen bleiben immer unangetastet, Benutzerkonten nur wenn unten explizit angehakt."}),c.jsxs("form",{onSubmit:E,className:"space-y-4",children:[c.jsx("input",{type:"file",accept:"application/json,.json",onChange:w,className:"text-sm"}),t&&c.jsxs("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-700",children:[c.jsx("div",{className:"border-b border-neutral-200 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-700 dark:text-neutral-400",children:"Was soll importiert werden?"}),s&&c.jsx("p",{className:"px-4 pt-3 text-sm text-amber-600 dark:text-amber-400",children:s}),c.jsxs("div",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[Sc.map(N=>c.jsxs("label",{className:"flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-neutral-50 dark:hover:bg-neutral-800/50",children:[c.jsx("input",{type:"checkbox",checked:o.has(N.key),onChange:()=>C(N.key),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:N.label}),c.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:n?aW(n,N.tables):N.hint})]})]},N.key)),c.jsxs("label",{className:"flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-neutral-50 dark:hover:bg-neutral-800/50",children:[c.jsx("input",{type:"checkbox",checked:d,onChange:N=>h(N.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),c.jsxs("span",{className:"flex-1",children:[c.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:"Benutzerkonten"}),c.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:'Nur wenn die Datei mit "Benutzerkonten mit exportieren" erstellt wurde. Ersetzt auch dein eigenes Konto – danach ggf. mit den Zugangsdaten aus der Export-Datei neu einloggen.'})]})]})]})]}),c.jsxs("label",{className:"flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[c.jsx("input",{type:"checkbox",checked:f,onChange:N=>p(N.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Mir ist bewusst, dass dies"," ",S.length?c.jsx("strong",{children:S.join(", ")}):"die ausgewählten Bereiche"," auf diesem Server unwiderruflich ersetzt."]}),c.jsx("button",{type:"submit",disabled:!t||!f||m||o.size===0,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:m?"Importiere…":"Importieren"})]}),x&&c.jsx("p",{className:"mt-3 text-sm text-red-600",children:x}),y&&c.jsxs("div",{className:"mt-3 rounded-md bg-green-50 p-3 text-sm text-green-800 dark:bg-green-900/20 dark:text-green-300",children:[c.jsx("p",{className:"mb-1 font-semibold",children:"Import erfolgreich:"}),c.jsxs("ul",{className:"list-disc pl-5",children:[Object.entries(y.counts).map(([N,M])=>c.jsxs("li",{children:[M," ",F2[N]||N]},N)),y.images_restored>0&&c.jsxs("li",{children:[y.images_restored," Bilder wiederhergestellt"]})]})]})]})]})}const cW={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function uW(){const[t,e]=v.useState(cW),[n,r]=v.useState(!0),[s,i]=v.useState(!1),[o,a]=v.useState(!1),[l,u]=v.useState("");v.useEffect(()=>{A.get("/maintenance").then(p=>{e({global:{enabled:p.global.enabled,message:p.global.message||""},services:{enabled:p.services.enabled,message:p.services.message||""},vehicles:{enabled:p.vehicles.enabled,message:p.vehicles.message||""}})}).finally(()=>r(!1))},[]);const d=(p,m,g)=>{e(y=>({...y,[p]:{...y[p],[m]:g}})),a(!1)},h=async p=>{p.preventDefault(),i(!0),u(""),a(!1);try{const m=await A.post("/maintenance",t);e({global:{enabled:m.global.enabled,message:m.global.message||""},services:{enabled:m.services.enabled,message:m.services.message||""},vehicles:{enabled:m.vehicles.enabled,message:m.vehicles.message||""}}),a(!0)}catch(m){u(m.message)}finally{i(!1)}},f=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return n?c.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):c.jsxs("form",{onSubmit:h,className:"max-w-2xl space-y-6",children:[c.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:'Ist "Gesamte Seite" aktiv, gewinnt das immer – die beiden anderen Schalter spielen dann keine Rolle mehr.'}),f.map(p=>c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[c.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:p.title}),c.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[c.jsx("input",{type:"checkbox",checked:t[p.key].enabled,onChange:m=>d(p.key,"enabled",m.target.checked),className:"peer sr-only"}),c.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),c.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),c.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:p.hint}),c.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),c.jsx("textarea",{rows:2,value:t[p.key].message,onChange:m=>d(p.key,"message",m.target.value),placeholder:"z. B. Wir aktualisieren gerade unser Angebot. Schau bald wieder vorbei!",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]},p.key)),l&&c.jsx("p",{className:"text-sm text-red-600",children:l}),o&&c.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),c.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}function dW(){const[t,e]=v.useState(!1),[n,r]=v.useState(""),[s,i]=v.useState(!1),[o,a]=v.useState(""),[l,u]=v.useState(!1),[d,h]=v.useState(""),[f,p]=v.useState(!1),[m,g]=v.useState(""),[y,b]=v.useState(!1),[x,k]=v.useState(""),w=async()=>{if(confirm("Alle aktuellen Leistungen werden gelöscht und durch die 8 Standard-Leistungen ersetzt. Fortfahren?")){e(!0),r("");try{const M=await A.post("/settings/reset-services",{});r(`${M.count} Standard-Leistungen wiederhergestellt.`)}catch(M){r("Fehler: "+M.message)}finally{e(!1)}}},C=async()=>{if(confirm("Alle aktuellen FAQ-Einträge werden gelöscht und durch die 6 Standard-Fragen ersetzt. Fortfahren?")){i(!0),a("");try{const M=await A.post("/settings/reset-faqs",{});a(`${M.count} Standard-Fragen wiederhergestellt.`)}catch(M){a("Fehler: "+M.message)}finally{i(!1)}}},E=async()=>{if(confirm("Die komplette Bildergalerie wird gelöscht und durch die 13 Marken/29 Projekte/207 Fotos der alten hifi-planet.de-Seite ersetzt. Fortfahren?")){u(!0),h("");try{const M=await A.post("/settings/reset-gallery",{});h(`${M.photos} Fotos wiederhergestellt.`)}catch(M){h("Fehler: "+M.message)}finally{u(!1)}}},S=async()=>{if(confirm("Alle Marken, Modelle, Pakete, Produkte und Upgrades werden unwiderruflich gelöscht. Leistungen und Kontaktanfragen bleiben erhalten. Fortfahren?")){p(!0),g("");try{const M=await A.post("/settings/reset-catalog",{});g(`Fahrzeugkatalog geleert (${M.brands_removed} Marken entfernt).`)}catch(M){g("Fehler: "+M.message)}finally{p(!1)}}},N=async()=>{if(confirm("WIRKLICH ALLES zurücksetzen? Marken, Modelle, Pakete, Produkte und Upgrades werden gelöscht, Leistungen, FAQs und die Bildergalerie auf Standard zurückgesetzt. Kontaktanfragen und Benutzerkonten bleiben erhalten. Das kann nicht rückgängig gemacht werden!")){b(!0),k("");try{const M=await A.post("/settings/reset-all",{});k(`Erledigt: ${M.brands_removed} Marken entfernt, ${M.services_reset} Standard-Leistungen, ${M.faqs_reset} Standard-Fragen und ${M.gallery_photos_reset} Galerie-Fotos wiederhergestellt.`)}catch(M){k("Fehler: "+M.message)}finally{b(!1)}}};return c.jsxs("div",{className:"max-w-2xl space-y-6",children:[c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Leistungen zurücksetzen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Leistungen-Karten und stellt die 8 mitgelieferten Standard-Leistungen wieder her. Marken, Modelle und Pakete bleiben unangetastet."}),c.jsx("button",{onClick:w,disabled:t,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:t?"Setze zurück…":"Leistungen auf Standard zurücksetzen"}),n&&c.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:n})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur FAQs zurücksetzen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Fragen und stellt die 6 mitgelieferten Standard-Fragen (Deutsch & Englisch) wieder her. Leistungen, Marken, Modelle und Pakete bleiben unangetastet."}),c.jsx("button",{onClick:C,disabled:s,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:s?"Setze zurück…":"FAQs auf Standard zurücksetzen"}),o&&c.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:o})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Bildergalerie zurücksetzen"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Galerie-Marken, -Projekte und -Fotos und stellt die komplette Galerie der alten hifi-planet.de-Seite wieder her (13 Marken, 29 Projekte, 207 Fotos). Fahrzeugkatalog, Leistungen und FAQs bleiben unangetastet."}),c.jsx("button",{onClick:E,disabled:l,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:l?"Setze zurück…":"Galerie auf Standard zurücksetzen"}),d&&c.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:d})]}),c.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[c.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Fahrzeugkatalog leeren"}),c.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle Marken, Modelle, Pakete, Produkte und Upgrades unwiderruflich. Leistungen, Kontaktanfragen und Benutzerkonten bleiben erhalten."}),c.jsx("button",{onClick:S,disabled:f,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:f?"Leere…":"Fahrzeugkatalog leeren"}),m&&c.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:m})]}),c.jsxs("section",{className:"rounded-xl border border-red-300 bg-red-50/40 p-6 dark:border-red-900 dark:bg-red-900/10",children:[c.jsx("h2",{className:"mb-1 font-semibold text-red-700 dark:text-red-300",children:"Alles zurücksetzen"}),c.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:["Kombiniert alles: Fahrzeugkatalog wird komplett geleert ",c.jsx("strong",{children:"und"})," Leistungen, FAQs sowie die Bildergalerie werden auf Standard zurückgesetzt. Kontaktanfragen und Benutzerkonten bleiben erhalten. Nicht rückgängig zu machen."]}),c.jsx("button",{onClick:N,disabled:y,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:y?"Setze zurück…":"Wirklich alles zurücksetzen"}),x&&c.jsx("p",{className:"mt-3 text-sm text-neutral-700 dark:text-neutral-300",children:x})]})]})}function hW(){return c.jsxs(c.Fragment,{children:[c.jsx(yD,{}),c.jsx(kD,{}),c.jsx(wD,{children:c.jsxs(nD,{children:[c.jsx(Q,{path:"/setup",element:c.jsx(SO,{})}),c.jsxs(Q,{element:c.jsx(SI,{}),children:[c.jsx(Q,{path:"/",element:c.jsx(WI,{})}),c.jsx(Q,{path:"/fahrzeuge",element:c.jsx(UI,{})}),c.jsx(Q,{path:"/fahrzeuge/:brandSlug",element:c.jsx(KI,{})}),c.jsx(Q,{path:"/fahrzeuge/:brandSlug/:modelSlug",element:c.jsx(oO,{})}),c.jsx(Q,{path:"/galerie",element:c.jsx(aO,{})}),c.jsx(Q,{path:"/galerie/:brandSlug",element:c.jsx(lO,{})}),c.jsx(Q,{path:"/galerie/:brandSlug/:projectSlug",element:c.jsx(uO,{})}),c.jsx(Q,{path:"/leistungen",element:c.jsx(dO,{})}),c.jsx(Q,{path:"/kontakt",element:c.jsx(xO,{})}),c.jsx(Q,{path:"/impressum",element:c.jsx(yO,{})}),c.jsx(Q,{path:"/datenschutz",element:c.jsx(bO,{})}),c.jsx(Q,{path:"/agb",element:c.jsx(vO,{})})]}),c.jsx(Q,{path:"/admin/login",element:c.jsx(NO,{})}),c.jsx(Q,{path:"/admin",element:c.jsx(EI,{}),children:c.jsxs(Q,{element:c.jsx(jI,{}),children:[c.jsx(Q,{index:!0,element:c.jsx(TO,{})}),c.jsx(Q,{path:"account",element:c.jsx($7,{})}),c.jsx(Q,{path:"brands",element:c.jsx(Ze,{permission:"brands.manage",children:c.jsx(a5,{})})}),c.jsx(Q,{path:"models",element:c.jsx(Ze,{permission:"models.manage",children:c.jsx(l5,{})})}),c.jsx(Q,{path:"gallery-brands",element:c.jsx(Ze,{permission:"gallery.manage",children:c.jsx(c5,{})})}),c.jsx(Q,{path:"gallery-projects",element:c.jsx(Ze,{permission:"gallery.manage",children:c.jsx(u5,{})})}),c.jsx(Q,{path:"gallery-projects/:projectId/photos",element:c.jsx(Ze,{permission:"gallery.manage",children:c.jsx(d5,{})})}),c.jsx(Q,{path:"packages",element:c.jsx(Ze,{permission:"packages.manage",children:c.jsx(x5,{})})}),c.jsx(Q,{path:"packages/:packageId/products",element:c.jsx(Ze,{permission:"packages.manage",children:c.jsx(GH,{})})}),c.jsx(Q,{path:"packages/:packageId/upgrades",element:c.jsx(Ze,{permission:"packages.manage",children:c.jsx(JH,{})})}),c.jsx(Q,{path:"services",element:c.jsx(Ze,{permission:"services.manage",children:c.jsx(k5,{})})}),c.jsx(Q,{path:"faqs",element:c.jsx(Ze,{permission:"content.manage",children:c.jsx(w5,{})})}),c.jsx(Q,{path:"partners",element:c.jsx(Ze,{permission:"content.manage",children:c.jsx(S5,{})})}),c.jsx(Q,{path:"home-sections",element:c.jsx(Ze,{permission:"content.manage",children:c.jsx(WH,{})})}),c.jsx(Q,{path:"contact-requests",element:c.jsx(Ze,{permission:"contact.manage",children:c.jsx(e7,{})})}),c.jsx(Q,{path:"users",element:c.jsx(Ze,{permission:"users.manage",children:c.jsx(W7,{})})}),c.jsx(Q,{path:"permission-groups",element:c.jsx(Ze,{permission:"permission_groups.manage",children:c.jsx(U7,{})})}),c.jsxs(Q,{path:"settings",element:c.jsx(Ze,{permission:"settings.manage",children:c.jsx(G7,{})}),children:[c.jsx(Q,{index:!0,element:c.jsx(Ua,{to:"website",replace:!0})}),c.jsx(Q,{path:"website",element:c.jsx(X7,{})}),c.jsx(Q,{path:"legal",element:c.jsx(Q7,{})}),c.jsx(Q,{path:"email",element:c.jsx(iW,{})}),c.jsx(Q,{path:"database",element:c.jsx(oW,{})}),c.jsx(Q,{path:"export-import",element:c.jsx(lW,{})}),c.jsx(Q,{path:"maintenance",element:c.jsx(uW,{})}),c.jsx(Q,{path:"update",element:c.jsx(Ze,{permission:"system.update",children:c.jsx(nW,{})})}),c.jsx(Q,{path:"reset",element:c.jsx(dW,{})})]})]})})]})})]})}qf.createRoot(document.getElementById("root")).render(c.jsx(Gr.StrictMode,{children:c.jsx(dD,{basename:"/".replace(/\/$/,"")||"/",children:c.jsx(ND,{children:c.jsx(MD,{children:c.jsx(OD,{children:c.jsx(hW,{})})})})})})); diff --git a/hifi/assets/index-DSF_8N3Q.css b/hifi/assets/index-DSF_8N3Q.css new file mode 100644 index 0000000..9a3567b --- /dev/null +++ b/hifi/assets/index-DSF_8N3Q.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--site-font, ui-sans-serif, system-ui, sans-serif);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-5{bottom:-1.25rem}.-left-1\/3{left:-33.333333%}.-right-1{right:-.25rem}.-right-1\.5{right:-.375rem}.-right-\[60px\]{right:-60px}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.-top-3{top:-.75rem}.-top-\[60px\]{top:-60px}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3\.5{left:.875rem}.left-5{left:1.25rem}.left-6{left:1.5rem}.left-\[14px\]{left:14px}.right-0{right:0}.right-2{right:.5rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-8{top:2rem}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[200\]{z-index:200}.z-\[60\]{z-index:60}.order-1{order:1}.order-2{order:2}.col-span-full{grid-column:1 / -1}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.-mt-\[89px\]{margin-top:-89px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-7{margin-bottom:1.75rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.line-clamp-6{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.contents{display:contents}.hidden{display:none}.aspect-\[4\/3\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:16 / 9}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-80{height:20rem}.h-9{height:2.25rem}.h-\[17px\]{height:17px}.h-\[18px\]{height:18px}.h-\[190px\]{height:190px}.h-\[210px\]{height:210px}.h-\[22px\]{height:22px}.h-\[46px\]{height:46px}.h-dvh{height:100dvh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-64{max-height:16rem}.max-h-\[85vh\]{max-height:85vh}.min-h-\[10rem\]{min-height:10rem}.min-h-\[420px\]{min-height:420px}.min-h-\[560px\]{min-height:560px}.min-h-\[70vh\]{min-height:70vh}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-24{width:6rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[17px\]{width:17px}.w-\[18px\]{width:18px}.w-\[190px\]{width:190px}.w-\[22px\]{width:22px}.w-\[230px\]{width:230px}.w-\[46px\]{width:46px}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.w-px{width:1px}.min-w-\[190px\]{min-width:190px}.min-w-\[220px\]{min-width:220px}.min-w-\[240px\]{min-width:240px}.min-w-\[9rem\]{min-width:9rem}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-6xl{max-width:72rem}.max-w-\[1280px\]{max-width:1280px}.max-w-\[160px\]{max-width:160px}.max-w-\[1880px\]{max-width:1880px}.max-w-\[240px\]{max-width:240px}.max-w-\[520px\]{max-width:520px}.max-w-\[85\%\]{max-width:85%}.max-w-\[8rem\]{max-width:8rem}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-\[190px\]{flex-basis:190px}.origin-left{transform-origin:left}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-12{--tw-rotate: 12deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y: pan-y;touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-start{scroll-snap-align:start}.snap-center{scroll-snap-align:center}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[18px\]{gap:18px}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.gap-y-3{row-gap:.75rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-neutral-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(245 245 245 / var(--tw-divide-opacity, 1))}.divide-neutral-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 229 229 / var(--tw-divide-opacity, 1))}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[18px\]{border-radius:18px}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-width:1px}.border-0{border-width:0px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-brand-300{--tw-border-opacity: 1;border-color:rgb(182 227 130 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.border-neutral-100{--tw-border-opacity: 1;border-color:rgb(245 245 245 / var(--tw-border-opacity, 1))}.border-neutral-200{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-neutral-300{--tw-border-opacity: 1;border-color:rgb(212 212 212 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/10{border-color:#ffffff1a}.border-white\/30{border-color:#ffffff4d}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/55{background-color:#0000008c}.bg-black\/60{background-color:#0009}.bg-black\/70{background-color:#000000b3}.bg-black\/90{background-color:#000000e6}.bg-brand-100{--tw-bg-opacity: 1;background-color:rgb(233 246 218 / var(--tw-bg-opacity, 1))}.bg-brand-400{--tw-bg-opacity: 1;background-color:rgb(146 212 68 / var(--tw-bg-opacity, 1))}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(245 251 238 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.bg-brand-500\/60{background-color:#6ba62699}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-neutral-100{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}.bg-neutral-200{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.bg-neutral-300{--tw-bg-opacity: 1;background-color:rgb(212 212 212 / var(--tw-bg-opacity, 1))}.bg-neutral-400{--tw-bg-opacity: 1;background-color:rgb(163 163 163 / var(--tw-bg-opacity, 1))}.bg-neutral-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}.bg-neutral-800{--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.bg-neutral-900\/10{background-color:#1717171a}.bg-neutral-900\/85{background-color:#171717d9}.bg-neutral-950{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-50\/40{background-color:#fef2f266}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/90{background-color:#ffffffe6}.bg-white\/95{background-color:#fffffff2}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-black\/70{--tw-gradient-from: rgb(0 0 0 / .7) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-black\/85{--tw-gradient-from: rgb(0 0 0 / .85) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-neutral-700{--tw-gradient-from: #404040 var(--tw-gradient-from-position);--tw-gradient-to: rgb(64 64 64 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-neutral-950{--tw-gradient-from: #0a0a0a var(--tw-gradient-from-position);--tw-gradient-to: rgb(10 10 10 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-black\/10{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(0 0 0 / .1) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-black\/20{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(0 0 0 / .2) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-neutral-950\/80{--tw-gradient-to: rgb(10 10 10 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(10 10 10 / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/40{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .4) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-black\/40{--tw-gradient-to: rgb(0 0 0 / .4) var(--tw-gradient-to-position)}.to-neutral-900{--tw-gradient-to: #171717 var(--tw-gradient-to-position)}.to-neutral-950\/40{--tw-gradient-to: rgb(10 10 10 / .4) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[22px\]{padding:22px}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[22px\]{padding-left:22px;padding-right:22px}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[22px\]{padding-top:22px;padding-bottom:22px}.py-\[26px\]{padding-top:26px;padding-bottom:26px}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.pb-24{padding-bottom:6rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-5{padding-left:1.25rem}.pl-6{padding-left:1.5rem}.pl-\[42px\]{padding-left:42px}.pr-4{padding-right:1rem}.pr-8{padding-right:2rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-3{padding-top:.75rem}.pt-3\.5{padding-top:.875rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--site-font, ui-sans-serif, system-ui, sans-serif)}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[17px\]{font-size:17px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-\[1\.08\]{line-height:1.08}.leading-\[1\.4\]{line-height:1.4}.leading-\[1\.55\]{line-height:1.55}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-\[2px\]{letter-spacing:2px}.tracking-\[3px\]{letter-spacing:3px}.tracking-\[6px\]{letter-spacing:6px}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-brand-300{--tw-text-opacity: 1;color:rgb(182 227 130 / var(--tw-text-opacity, 1))}.text-brand-400{--tw-text-opacity: 1;color:rgb(146 212 68 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(107 166 38 / var(--tw-text-opacity, 1))}.text-brand-500\/10{color:#6ba6261a}.text-brand-600{--tw-text-opacity: 1;color:rgb(88 137 31 / var(--tw-text-opacity, 1))}.text-brand-700{--tw-text-opacity: 1;color:rgb(72 112 26 / var(--tw-text-opacity, 1))}.text-brand-800{--tw-text-opacity: 1;color:rgb(59 91 21 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-neutral-200{--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity, 1))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.text-neutral-600{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.text-neutral-700{--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.text-neutral-800{--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.text-neutral-900{--tw-text-opacity: 1;color:rgb(23 23 23 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_-8px_24px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow: 0 -8px 24px rgba(0,0,0,.08);--tw-shadow-colored: 0 -8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(107\,166\,38\,0\.7\)\]{--tw-shadow: 0 0 10px rgba(107,166,38,.7);--tw-shadow-colored: 0 0 10px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-brand-500\/30{--tw-shadow-color: rgb(107 166 38 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-neutral-900\/20{--tw-shadow-color: rgb(23 23 23 / .2);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-brand-400{--tw-ring-opacity: 1;--tw-ring-color: rgb(146 212 68 / var(--tw-ring-opacity, 1))}.ring-brand-500\/40{--tw-ring-color: rgb(107 166 38 / .4)}.ring-neutral-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(212 212 212 / var(--tw-ring-opacity, 1))}.ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity, 1))}.ring-white\/50{--tw-ring-color: rgb(255 255 255 / .5)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.grayscale{--tw-grayscale: grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[filter\,box-shadow\]{transition-property:filter,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.will-change-transform{will-change:transform}.\[scrollbar-width\:none\]{scrollbar-width:none}html{scroll-behavior:smooth}.marquee-viewport{-webkit-mask-image:linear-gradient(to right,transparent,black 6%,black 94%,transparent);mask-image:linear-gradient(to right,transparent,black 6%,black 94%,transparent)}.page-texture{background-color:#f6f5f0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:180px 180px}.dark .page-texture{background-color:#0a0b07;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}.kf-page{--kf-pagebg: linear-gradient(120deg, #eef0ea 0%, #f6f8f3 45%, #fbfcf9 100%);--kf-card: #ffffff;--kf-cardbrd: #e4e8dc;--kf-text: #23271d;--kf-text2: #2a2e24;--kf-muted: #6c7360;--kf-label: #838a72;--kf-field: #fafcf6;--kf-fieldbrd: #dde2d3;--kf-fieldicon: #a7ad9d;--kf-accent: #a4d417;--kf-accent2: #8ec21a;--kf-accentsoft: #f2f8df;--kf-pill: #ffffff;--kf-pillbrd: #dfe4d6;--kf-shadow: 0 24px 60px rgba(60, 70, 40, .08);--kf-shadow2: 0 16px 40px rgba(60, 70, 40, .06);--kf-divider: #e8ecdf;--kf-topo: #d7dccd;--kf-pkgbg: #f4fbe4;--kf-pkgbrd: #cfe89a;--kf-btntext: #1f2417;--kf-scrim: linear-gradient(90deg, rgba(244, 246, 241, .35) 0%, rgba(244, 246, 241, .55) 55%, rgba(246, 248, 243, 1) 100%)}.dark .kf-page{--kf-pagebg: linear-gradient(120deg, #181b0f 0%, #111409 45%, #0a0c06 100%);--kf-card: #14170e;--kf-cardbrd: rgba(168, 225, 12, .16);--kf-text: #f3f6ea;--kf-text2: #e8ece0;--kf-muted: #9aa38c;--kf-label: #8f987f;--kf-field: rgba(0, 0, 0, .35);--kf-fieldbrd: #2c3323;--kf-fieldicon: #5f6852;--kf-accent: #a8e10c;--kf-accent2: #b6e619;--kf-accentsoft: rgba(168, 225, 12, .1);--kf-pill: #14170e;--kf-pillbrd: rgba(168, 225, 12, .28);--kf-shadow: 0 24px 60px rgba(0, 0, 0, .55);--kf-shadow2: 0 16px 40px rgba(0, 0, 0, .45);--kf-divider: rgba(168, 225, 12, .15);--kf-pkgbg: rgba(168, 225, 12, .08);--kf-pkgbrd: rgba(168, 225, 12, .4);--kf-btntext: #0f1208}.kontakt-sektion{background-image:url(/assets/bg-light-C_7mxjWZ.png);background-size:cover;background-position:center}.dark .kontakt-sektion{background-image:url(/assets/bg-dark-DX_vTCv2.png)}.kf-page input::-moz-placeholder,.kf-page textarea::-moz-placeholder{color:var(--kf-fieldicon)}.kf-page input::placeholder,.kf-page textarea::placeholder{color:var(--kf-fieldicon)}.kf-page input:focus,.kf-page textarea:focus{border-color:var(--kf-accent)!important;box-shadow:0 0 0 3px #a4d41733}.grain-band{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:180px 180px}.dark .grain-band{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}html.hifi-cursor-on,html.hifi-cursor-on *{cursor:none!important}html.hifi-cursor-on :is(input,textarea,[contenteditable=true]){cursor:auto!important}.hifi-cursor{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:99999;opacity:1;transition:opacity .2s ease}.hifi-cursor[data-hidden=true]{opacity:0}.hifi-cursor__core{position:fixed;top:0;left:0;width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:9999px;background:#7fd44a;box-shadow:0 0 0 1.5px #ffffffe6,0 0 10px #7fd44abf;transition:width .18s ease,height .18s ease,margin .18s ease,background-color .18s ease,opacity .15s ease}.hifi-cursor__orbit{position:fixed;top:0;left:0;opacity:0;transition:opacity .18s ease}.hifi-cursor__ring{position:absolute;width:38px;height:15px;margin:-7.5px 0 0 -19px;border:1px solid rgba(139,234,60,.85);border-radius:50%;transform:rotate(-24deg) scale(.6);transition:transform .22s ease}.hifi-cursor__sat{position:absolute;width:5px;height:5px;margin:-2.5px 0 0 -2.5px;border-radius:9999px;background:#eaffdb;box-shadow:0 0 6px #8bea3ce6}.hifi-cursor[data-state=hover] .hifi-cursor__orbit{opacity:1}.hifi-cursor[data-state=hover] .hifi-cursor__core{width:16px;height:16px;margin:-8px 0 0 -8px;background:#8bea3c;box-shadow:0 0 0 1.5px #fffffff2,0 0 12px #8bea3cd9}.hifi-cursor[data-state=hover] .hifi-cursor__ring{transform:rotate(-24deg) scale(1.45)}.hifi-cursor[data-state=text] .hifi-cursor__core,.hifi-cursor[data-state=text] .hifi-cursor__orbit{opacity:0}.hifi-cursor[data-down=true] .hifi-cursor__core{width:20px;height:20px;margin:-10px 0 0 -10px}.hifi-cursor__pulse{position:fixed;top:0;left:0;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:9999px;border:1.5px solid rgba(139,234,60,.9);opacity:0}.hifi-cursor__pulse.is-live{animation:hifi-cursor-pulse .45s ease-out forwards}@keyframes hifi-cursor-pulse{0%{opacity:.9;transform:scale(1)}to{opacity:0;transform:scale(3.2)}}.rte-content ul{list-style:disc;padding-left:1.5rem}.rte-content ol{list-style:decimal;padding-left:1.5rem}.rte-content a{color:#3b82f6;text-decoration:underline}.rte-content p{margin:.25rem 0}.rte-content h2{font-size:1.125rem;font-weight:700;margin:.75rem 0 .25rem}.rte-content code{font-family:ui-monospace,monospace;background:#7d7d7d26;border-radius:.25rem;padding:.1rem .3rem;font-size:.85em}.legal-content h2{margin:2rem 0 .5rem;font-weight:600;color:#171717}.dark .legal-content h2{color:#fff}.legal-content h2:first-child{margin-top:0}.legal-content p{margin:.5rem 0}.legal-content ul{list-style:disc;padding-left:1.25rem;margin:.5rem 0}.legal-content li{margin:.25rem 0}.legal-content a{color:#6ba626;text-decoration:underline}.legal-content code{font-family:ui-monospace,monospace;background:#7d7d7d26;border-radius:.25rem;padding:.1rem .3rem;font-size:.85em}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[var\(--kf-accent\)\]:hover{border-color:var(--kf-accent)}.hover\:border-brand-500:hover{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.hover\:border-neutral-400:hover{--tw-border-opacity: 1;border-color:rgb(163 163 163 / var(--tw-border-opacity, 1))}.hover\:bg-\[var\(--kf-accentsoft\)\]:hover{background-color:var(--kf-accentsoft)}.hover\:bg-brand-400:hover{--tw-bg-opacity: 1;background-color:rgb(146 212 68 / var(--tw-bg-opacity, 1))}.hover\:bg-brand-50:hover{--tw-bg-opacity: 1;background-color:rgb(245 251 238 / var(--tw-bg-opacity, 1))}.hover\:bg-brand-600:hover{--tw-bg-opacity: 1;background-color:rgb(88 137 31 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-100:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/10:hover{background-color:#ffffff1a}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(107 166 38 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(88 137 31 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\:grayscale-0:hover{--tw-grayscale: grayscale(0);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-brand-500:focus{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 166 38 / var(--tw-ring-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.group:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:from-black\/95{--tw-gradient-from: rgb(0 0 0 / .95) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.peer:checked~.peer-checked\:translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}.dark\:divide-neutral-800:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(38 38 38 / var(--tw-divide-opacity, 1))}.dark\:border-brand-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(48 75 17 / var(--tw-border-opacity, 1))}.dark\:border-neutral-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity, 1))}.dark\:border-neutral-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.dark\:border-red-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(127 29 29 / var(--tw-border-opacity, 1))}.dark\:bg-amber-900\/20:is(.dark *){background-color:#78350f33}.dark\:bg-amber-900\/40:is(.dark *){background-color:#78350f66}.dark\:bg-brand-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.dark\:bg-brand-900\/20:is(.dark *){background-color:#304b1133}.dark\:bg-brand-900\/40:is(.dark *){background-color:#304b1166}.dark\:bg-green-900\/20:is(.dark *){background-color:#14532d33}.dark\:bg-green-900\/40:is(.dark *){background-color:#14532d66}.dark\:bg-neutral-100:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(82 82 82 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-800\/50:is(.dark *){background-color:#26262680}.dark\:bg-neutral-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-900\/40:is(.dark *){background-color:#17171766}.dark\:bg-neutral-900\/95:is(.dark *){background-color:#171717f2}.dark\:bg-neutral-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-950\/90:is(.dark *){background-color:#0a0a0ae6}.dark\:bg-neutral-950\/95:is(.dark *){background-color:#0a0a0af2}.dark\:bg-red-900\/10:is(.dark *){background-color:#7f1d1d1a}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-red-900\/40:is(.dark *){background-color:#7f1d1d66}.dark\:bg-slate-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-brand-200:is(.dark *){--tw-text-opacity: 1;color:rgb(211 238 180 / var(--tw-text-opacity, 1))}.dark\:text-brand-300:is(.dark *){--tw-text-opacity: 1;color:rgb(182 227 130 / var(--tw-text-opacity, 1))}.dark\:text-brand-400:is(.dark *){--tw-text-opacity: 1;color:rgb(146 212 68 / var(--tw-text-opacity, 1))}.dark\:text-brand-400\/10:is(.dark *){color:#92d4441a}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-neutral-100:is(.dark *){--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.dark\:text-neutral-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity, 1))}.dark\:text-neutral-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.dark\:text-neutral-400:is(.dark *){--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.dark\:text-neutral-500:is(.dark *){--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.dark\:text-neutral-600:is(.dark *){--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.dark\:text-neutral-900:is(.dark *){--tw-text-opacity: 1;color:rgb(23 23 23 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-slate-100:is(.dark *){--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:shadow-black\/40:is(.dark *){--tw-shadow-color: rgb(0 0 0 / .4);--tw-shadow: var(--tw-shadow-colored)}.dark\:ring-neutral-600:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(82 82 82 / var(--tw-ring-opacity, 1))}.dark\:ring-neutral-900:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(23 23 23 / var(--tw-ring-opacity, 1))}.dark\:hover\:border-neutral-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-brand-900\/20:hover:is(.dark *){background-color:#304b1133}.dark\:hover\:bg-neutral-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-neutral-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-neutral-800\/50:hover:is(.dark *){background-color:#26262680}.dark\:hover\:bg-red-900\/20:hover:is(.dark *){background-color:#7f1d1d33}@media (min-width: 640px){.sm\:left-4{left:1rem}.sm\:left-8{left:2rem}.sm\:right-4{right:1rem}.sm\:top-\[65px\]{top:65px}.sm\:-mt-\[97px\]{margin-top:-97px}.sm\:block{display:block}.sm\:hidden{display:none}.sm\:h-16{height:4rem}.sm\:h-20{height:5rem}.sm\:h-96{height:24rem}.sm\:min-h-\[640px\]{min-height:640px}.sm\:min-h-\[85vh\]{min-height:85vh}.sm\:w-72{width:18rem}.sm\:w-auto{width:auto}.sm\:flex-none{flex:none}.sm\:shrink-0{flex-shrink:0}.sm\:basis-\[210px\]{flex-basis:210px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.sm\:grid-cols-\[10rem_1fr\]{grid-template-columns:10rem 1fr}.sm\:grid-cols-\[16rem_1fr\]{grid-template-columns:16rem 1fr}.sm\:grid-cols-\[1fr_120px\]{grid-template-columns:1fr 120px}.sm\:grid-cols-\[1fr_120px_1fr\]{grid-template-columns:1fr 120px 1fr}.sm\:flex-row{flex-direction:row}.sm\:items-start{align-items:flex-start}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:p-10{padding:2.5rem}.sm\:p-5{padding:1.25rem}.sm\:p-6{padding:1.5rem}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:px-8{padding-left:2rem;padding-right:2rem}.sm\:py-14{padding-top:3.5rem;padding-bottom:3.5rem}.sm\:py-\[34px\]{padding-top:34px;padding-bottom:34px}.sm\:pl-8{padding-left:2rem}.sm\:pl-\[52px\]{padding-left:52px}.sm\:pt-1{padding-top:.25rem}.sm\:pt-14{padding-top:3.5rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-5xl{font-size:3rem;line-height:1}.sm\:text-\[46px\]{font-size:46px}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 641px){.min-\[641px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.min-\[641px\]\:border-b-0{border-bottom-width:0px}.min-\[641px\]\:border-r{border-right-width:1px}.min-\[641px\]\:last\:border-r-0:last-child{border-right-width:0px}}@media (min-width: 768px){.md\:order-1{order:1}.md\:order-2{order:2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 901px){.min-\[901px\]\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 981px){.min-\[981px\]\:grid-cols-\[minmax\(0\,1\.35fr\)_minmax\(320px\,1fr\)\]{grid-template-columns:minmax(0,1.35fr) minmax(320px,1fr)}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:w-80{width:20rem}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:text-\[60px\]{font-size:60px}}@media (min-width: 1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none} diff --git a/hifi/index.html b/hifi/index.html index f76862e..fe4737e 100644 --- a/hifi/index.html +++ b/hifi/index.html @@ -43,9 +43,9 @@ "sameAs": ["https://www.youtube.com/@hifiplanet2812"] } - + - +