From 7cf8ef52b39933784d1e310663327c1e0b72bbed Mon Sep 17 00:00:00 2001 From: "max.olchov" Date: Fri, 23 Oct 2026 00:26:12 +0000 Subject: [PATCH] Login: Wahl zwischen App und Mail-Code, Passwort vergessen - Mit Authenticator-App und bestaetigter E-Mail laesst sich auf der Code-Seite zwischen beiden umschalten (POST /auth/2fa-method). - "Passwort vergessen" auf der Login-Seite: Link an die bestaetigte E-Mail (60 Min, einmalig, hoechstens einer pro Minute), Seite /admin/passwort-zuruecksetzen. Antwort verraet nicht, ob es das Konto gibt. - Neue Spalten password_reset_hash/_expires_at (Auto-Migration). Build neu. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01W444hnfrfEXf9f84YRuZtH --- hifi-src/src/App.jsx | 2 + hifi-src/src/context/AuthContext.jsx | 10 +- hifi-src/src/pages/admin/AccountSettings.jsx | 4 +- hifi-src/src/pages/admin/Login.jsx | 185 +++++++++++++----- hifi-src/src/pages/admin/ResetPassword.jsx | 102 ++++++++++ hifi/api/database/schema.sql | 2 + hifi/api/public/index.php | 3 + hifi/api/src/Controllers/AuthController.php | 134 +++++++++++-- hifi/api/src/Support/AccountEmail.php | 67 +++++++ hifi/api/src/Support/Schema.php | 4 + hifi/assets/AGB-BSBKNUL3.js | 1 + hifi/assets/AGB-R24E6RC9.js | 1 - ...AesEcDe.js => AccountSettings-ZKd2A3aS.js} | 4 +- ...ers-BRv6czlM.js => AdminUsers-17rwNs5P.js} | 2 +- ...{Brands-C2MO3iab.js => Brands-CPunktmg.js} | 2 +- ...l-DrPHnAcK.js => ConfirmEmail-fWy9MOY4.js} | 2 +- ...zQPM.js => ConnectionSettings-BDljX48v.js} | 2 +- ...FFVdlWu.js => ContactRequests-gigEl_0S.js} | 2 +- ...4QloC.js => CountdownSettings-iY834r7N.js} | 2 +- ...oard-Bb-z9N4S.js => Dashboard-CfZCB0xB.js} | 2 +- ...m6bks9.js => DatabaseSettings-Da6s1jBa.js} | 2 +- ...tz-BxRbkKHM.js => Datenschutz-BSZ59Ypg.js} | 2 +- ...oads-BySos-u0.js => Downloads-DX6hhxmA.js} | 2 +- ...-ZpsuO5y1.js => DownloadsPage-BAC2Bbij.js} | 2 +- ...-O9zitSOH.js => EmailSettings-4uXhtxt-.js} | 2 +- ...ist-CgZqBKVk.js => EntityList-DPxkbA95.js} | 2 +- ...qK.js => ExportImportSettings-CwuFp4rp.js} | 2 +- .../{Faqs-Dx6P5rru.js => Faqs-C6vUqhGa.js} | 2 +- ...mMjCa1.js => GalleryBrandPage-t_SqSVK1.js} | 2 +- ...-BZZtQ1we.js => GalleryBrands-D7kDEUzQ.js} | 2 +- ...P1qGopa.js => GalleryOverview-PXKemgAt.js} | 2 +- ...-B-ALbtsa.js => GalleryPhotos-CAByXSPv.js} | 2 +- ...haZs.js => GalleryProjectPage-FUov0YU4.js} | 2 +- ...lLNEVBB.js => GalleryProjects-DFKgMPpK.js} | 2 +- ...s-8nB12J9S.js => HomeSections-FR9MpCKa.js} | 2 +- ...Cv-egAvW.js => ImageOptimizer-C38AVHT-.js} | 2 +- ...i66K3r.js => ImageUploadField-DGJRkWaj.js} | 2 +- hifi/assets/Impressum-CngzqAQz.js | 1 + hifi/assets/Impressum-CuCyaRsx.js | 1 - ...-CmgDetEJ.js => LegalPageView-DxOTKnHx.js} | 2 +- ...-aQ858K4J.js => LegalSettings-Dyr-bPzl.js} | 2 +- hifi/assets/Login-BHhvb3aV.js | 1 + hifi/assets/Login-DmO7UGYK.js | 1 - ...WHo.js => MaintenanceSettings-BmZJ8yZN.js} | 2 +- ...{Models-CTKD_2al.js => Models-oOmkNQSs.js} | 2 +- ...kages-BHzawgo-.js => Packages-CIAy_ATE.js} | 2 +- ...tners-d4iHm0YC.js => Partners-BTaZQlM9.js} | 2 +- ...VO82nD.js => PermissionGroups-DAwy5PsY.js} | 2 +- hifi/assets/ResetPassword-CG8ba0ue.js | 1 + ...-DZpRgwCZ.js => ResetSettings-BPXgxMql.js} | 2 +- ...Da-meJrp.js => RichTextEditor-B7bZ3Yjh.js} | 2 +- ...aveBar-DDpMGtuu.js => SaveBar-D3LWnDZL.js} | 2 +- ...vices-Dv9GCIRs.js => Services-BKtVbfxC.js} | 2 +- ...uNCH_EVD.js => SettingsLayout-BFhAuThT.js} | 2 +- ...rd-B8-5hkmh.js => SetupWizard-DZDK0feK.js} | 2 +- ...t-B1XU_999.js => SortableList-Dgddukss.js} | 2 +- ...c-J2FBP.js => TextStyleWidget-DGEJ-L-L.js} | 2 +- ...raffic-C7K-vaXp.js => Traffic-BLOMES7J.js} | 2 +- ...C1uyyWm_.js => UpdateSettings-DmGZxm7K.js} | 2 +- ...Ns.js => VehicleCatalogDialog-BmzJprBQ.js} | 2 +- ...ite-B0vt49HS.js => ViewOnSite-Dn1Ym5u6.js} | 2 +- ...n9gk2Zi.js => WebsiteSettings-GXoKYAkf.js} | 2 +- ...-DJgsXpN7.js => grip-vertical-Cn5hJClA.js} | 2 +- ...y-7Dpzjhyo.js => iconRegistry-DXMu3JdV.js} | 2 +- .../{index-eQrgtQRM.js => index-CPMnKQBc.js} | 32 +-- .../{music-CfvjP45-.js => music-D2Ez1K-E.js} | 2 +- ...m-CN3X5f7p.js => sortable.esm-CUwm6pqJ.js} | 2 +- ...rash-2-DA4I3Jzq.js => trash-2-DwLXj_oo.js} | 2 +- hifi/index.html | 2 +- 69 files changed, 510 insertions(+), 146 deletions(-) create mode 100644 hifi-src/src/pages/admin/ResetPassword.jsx create mode 100644 hifi/assets/AGB-BSBKNUL3.js delete mode 100644 hifi/assets/AGB-R24E6RC9.js rename hifi/assets/{AccountSettings-CAesEcDe.js => AccountSettings-ZKd2A3aS.js} (64%) rename hifi/assets/{AdminUsers-BRv6czlM.js => AdminUsers-17rwNs5P.js} (98%) rename hifi/assets/{Brands-C2MO3iab.js => Brands-CPunktmg.js} (93%) rename hifi/assets/{ConfirmEmail-DrPHnAcK.js => ConfirmEmail-fWy9MOY4.js} (96%) rename hifi/assets/{ConnectionSettings-BKoUzQPM.js => ConnectionSettings-BDljX48v.js} (98%) rename hifi/assets/{ContactRequests-sFFVdlWu.js => ContactRequests-gigEl_0S.js} (98%) rename hifi/assets/{CountdownSettings-De04QloC.js => CountdownSettings-iY834r7N.js} (98%) rename hifi/assets/{Dashboard-Bb-z9N4S.js => Dashboard-CfZCB0xB.js} (99%) rename hifi/assets/{DatabaseSettings-DCm6bks9.js => DatabaseSettings-Da6s1jBa.js} (98%) rename hifi/assets/{Datenschutz-BxRbkKHM.js => Datenschutz-BSZ59Ypg.js} (54%) rename hifi/assets/{Downloads-BySos-u0.js => Downloads-DX6hhxmA.js} (95%) rename hifi/assets/{DownloadsPage-ZpsuO5y1.js => DownloadsPage-BAC2Bbij.js} (97%) rename hifi/assets/{EmailSettings-O9zitSOH.js => EmailSettings-4uXhtxt-.js} (98%) rename hifi/assets/{EntityList-CgZqBKVk.js => EntityList-DPxkbA95.js} (97%) rename hifi/assets/{ExportImportSettings-CPuYbSqK.js => ExportImportSettings-CwuFp4rp.js} (99%) rename hifi/assets/{Faqs-Dx6P5rru.js => Faqs-C6vUqhGa.js} (94%) rename hifi/assets/{GalleryBrandPage-COmMjCa1.js => GalleryBrandPage-t_SqSVK1.js} (96%) rename hifi/assets/{GalleryBrands-BZZtQ1we.js => GalleryBrands-D7kDEUzQ.js} (93%) rename hifi/assets/{GalleryOverview-nP1qGopa.js => GalleryOverview-PXKemgAt.js} (96%) rename hifi/assets/{GalleryPhotos-B-ALbtsa.js => GalleryPhotos-CAByXSPv.js} (94%) rename hifi/assets/{GalleryProjectPage-keVFhaZs.js => GalleryProjectPage-FUov0YU4.js} (98%) rename hifi/assets/{GalleryProjects-ClLNEVBB.js => GalleryProjects-DFKgMPpK.js} (95%) rename hifi/assets/{HomeSections-8nB12J9S.js => HomeSections-FR9MpCKa.js} (98%) rename hifi/assets/{ImageOptimizer-Cv-egAvW.js => ImageOptimizer-C38AVHT-.js} (97%) rename hifi/assets/{ImageUploadField-2si66K3r.js => ImageUploadField-DGJRkWaj.js} (99%) create mode 100644 hifi/assets/Impressum-CngzqAQz.js delete mode 100644 hifi/assets/Impressum-CuCyaRsx.js rename hifi/assets/{LegalPageView-CmgDetEJ.js => LegalPageView-DxOTKnHx.js} (82%) rename hifi/assets/{LegalSettings-aQ858K4J.js => LegalSettings-Dyr-bPzl.js} (95%) create mode 100644 hifi/assets/Login-BHhvb3aV.js delete mode 100644 hifi/assets/Login-DmO7UGYK.js rename hifi/assets/{MaintenanceSettings-CSuNtWHo.js => MaintenanceSettings-BmZJ8yZN.js} (98%) rename hifi/assets/{Models-CTKD_2al.js => Models-oOmkNQSs.js} (96%) rename hifi/assets/{Packages-BHzawgo-.js => Packages-CIAy_ATE.js} (99%) rename hifi/assets/{Partners-d4iHm0YC.js => Partners-BTaZQlM9.js} (86%) rename hifi/assets/{PermissionGroups-B5VO82nD.js => PermissionGroups-DAwy5PsY.js} (98%) create mode 100644 hifi/assets/ResetPassword-CG8ba0ue.js rename hifi/assets/{ResetSettings-DZpRgwCZ.js => ResetSettings-BPXgxMql.js} (99%) rename hifi/assets/{RichTextEditor-Da-meJrp.js => RichTextEditor-B7bZ3Yjh.js} (99%) rename hifi/assets/{SaveBar-DDpMGtuu.js => SaveBar-D3LWnDZL.js} (93%) rename hifi/assets/{Services-Dv9GCIRs.js => Services-BKtVbfxC.js} (94%) rename hifi/assets/{SettingsLayout-uNCH_EVD.js => SettingsLayout-BFhAuThT.js} (96%) rename hifi/assets/{SetupWizard-B8-5hkmh.js => SetupWizard-DZDK0feK.js} (98%) rename hifi/assets/{SortableList-B1XU_999.js => SortableList-Dgddukss.js} (89%) rename hifi/assets/{TextStyleWidget-Cc-J2FBP.js => TextStyleWidget-DGEJ-L-L.js} (97%) rename hifi/assets/{Traffic-C7K-vaXp.js => Traffic-BLOMES7J.js} (99%) rename hifi/assets/{UpdateSettings-C1uyyWm_.js => UpdateSettings-DmGZxm7K.js} (99%) rename hifi/assets/{VehicleCatalogDialog-wGVVg0Ns.js => VehicleCatalogDialog-BmzJprBQ.js} (99%) rename hifi/assets/{ViewOnSite-B0vt49HS.js => ViewOnSite-Dn1Ym5u6.js} (84%) rename hifi/assets/{WebsiteSettings-Cn9gk2Zi.js => WebsiteSettings-GXoKYAkf.js} (99%) rename hifi/assets/{grip-vertical-DJgsXpN7.js => grip-vertical-Cn5hJClA.js} (91%) rename hifi/assets/{iconRegistry-7Dpzjhyo.js => iconRegistry-DXMu3JdV.js} (99%) rename hifi/assets/{index-eQrgtQRM.js => index-CPMnKQBc.js} (87%) rename hifi/assets/{music-CfvjP45-.js => music-D2Ez1K-E.js} (98%) rename hifi/assets/{sortable.esm-CN3X5f7p.js => sortable.esm-CUwm6pqJ.js} (99%) rename hifi/assets/{trash-2-DA4I3Jzq.js => trash-2-DwLXj_oo.js} (95%) diff --git a/hifi-src/src/App.jsx b/hifi-src/src/App.jsx index 1288c53..ad657d6 100644 --- a/hifi-src/src/App.jsx +++ b/hifi-src/src/App.jsx @@ -62,6 +62,7 @@ const AGB = lazyPage(() => import('./pages/public/AGB.jsx')); const SetupWizard = lazyPage(() => import('./pages/public/SetupWizard.jsx')); const Login = lazyPage(() => import('./pages/admin/Login.jsx')); const ConfirmEmail = lazyPage(() => import('./pages/admin/ConfirmEmail.jsx')); +const ResetPassword = lazyPage(() => import('./pages/admin/ResetPassword.jsx')); const Dashboard = lazyPage(() => import('./pages/admin/Dashboard.jsx')); const Traffic = lazyPage(() => import('./pages/admin/Traffic.jsx')); const Brands = lazyPage(() => import('./pages/admin/Brands.jsx')); @@ -133,6 +134,7 @@ export default function App() { } /> } /> + } /> }> }> diff --git a/hifi-src/src/context/AuthContext.jsx b/hifi-src/src/context/AuthContext.jsx index 89e1bfa..d5eb7fe 100644 --- a/hifi-src/src/context/AuthContext.jsx +++ b/hifi-src/src/context/AuthContext.jsx @@ -18,7 +18,12 @@ export function AuthProvider({ children }) { const login = async (username, password) => { const data = await api.post('/auth/login', { username, password }); if (data.requires_2fa) { - return { requires2fa: true, method: data.method || 'totp', emailHint: data.email_hint || '' }; + return { + requires2fa: true, + method: data.method || 'totp', + methods: data.methods || [data.method || 'totp'], + emailHint: data.email_hint || '', + }; } setUser(data); return { requires2fa: false }; @@ -30,6 +35,7 @@ export function AuthProvider({ children }) { }; const resendLoginCode = () => api.post('/auth/resend-code', {}); + const switchTwoFactorMethod = (method) => api.post('/auth/2fa-method', { method }); const logout = async () => { await api.post('/auth/logout', {}); @@ -45,7 +51,7 @@ export function AuthProvider({ children }) { !!user && (user.is_super_admin || user.permissions?.includes(permission)); return ( - + {children} ); diff --git a/hifi-src/src/pages/admin/AccountSettings.jsx b/hifi-src/src/pages/admin/AccountSettings.jsx index 5692626..cbe0fe7 100644 --- a/hifi-src/src/pages/admin/AccountSettings.jsx +++ b/hifi-src/src/pages/admin/AccountSettings.jsx @@ -57,8 +57,8 @@ function EmailCard({ user, refreshUser }) {

E-Mail-Adresse

{user?.two_factor_enabled - ? 'Da die Authenticator-App aktiv ist, wird beim Login sie abgefragt, nicht die E-Mail.' - : 'Mit bestätigter Adresse bekommst du beim Login einen Code per Mail, den du zusätzlich zum Passwort eingibst.'} + ? 'Beim Login fragen wir die Authenticator-App ab. Mit bestätigter Adresse kannst du dort stattdessen einen Code per Mail anfordern. Außerdem brauchst du sie für „Passwort vergessen“.' + : 'Mit bestätigter Adresse bekommst du beim Login einen Code per Mail, den du zusätzlich zum Passwort eingibst. Außerdem brauchst du sie für „Passwort vergessen“.'}

{phase === 'idle' && ( diff --git a/hifi-src/src/pages/admin/Login.jsx b/hifi-src/src/pages/admin/Login.jsx index 28efac0..9bc5e4a 100644 --- a/hifi-src/src/pages/admin/Login.jsx +++ b/hifi-src/src/pages/admin/Login.jsx @@ -1,14 +1,24 @@ import { useState } from 'react'; import { Navigate, useNavigate } from 'react-router-dom'; +import { api } from '../../api/client.js'; import { useAuth } from '../../context/AuthContext.jsx'; import logo from '../../assets/logo.png'; import logoDark from '../../assets/logo-dark.png'; +const cardClass = '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'; +const inputClass = + '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'; +const primaryButtonClass = + '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'; +const linkButtonClass = 'mt-3 w-full text-sm text-brand-600 hover:underline dark:text-brand-400'; +const backButtonClass = 'mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400'; + export default function Login() { - const { user, login, verifyTwoFactor, resendLoginCode } = useAuth(); + const { user, login, verifyTwoFactor, resendLoginCode, switchTwoFactorMethod } = useAuth(); const navigate = useNavigate(); - const [step, setStep] = useState('credentials'); + const [step, setStep] = useState('credentials'); // credentials | code | forgot | forgot-sent const [method, setMethod] = useState('totp'); + const [methods, setMethods] = useState(['totp']); const [emailHint, setEmailHint] = useState(''); const [notice, setNotice] = useState(''); const [username, setUsername] = useState(''); @@ -21,58 +31,81 @@ export default function Login() { return ; } - const handleCredentials = async (e) => { - e.preventDefault(); + const goTo = (next) => { + setStep(next); + setCode(''); + setError(''); + setNotice(''); + }; + + // Gemeinsamer Ablauf fuer alle Formulare: Ladezustand + Fehlermeldung. + const run = async (fn) => { setLoading(true); setError(''); try { + await fn(); + } catch (err) { + setError(err.message); + } finally { + setLoading(false); + } + }; + + const handleCredentials = (e) => { + e.preventDefault(); + run(async () => { const result = await login(username, password); if (result.requires2fa) { setMethod(result.method); + setMethods(result.methods); setEmailHint(result.emailHint); - setNotice(''); - setStep('code'); + goTo('code'); } else { navigate('/admin'); } - } catch (err) { - setError(err.message); - } finally { - setLoading(false); - } + }); }; - const handleCode = async (e) => { + const handleCode = (e) => { e.preventDefault(); - setLoading(true); - setError(''); - try { + run(async () => { await verifyTwoFactor(code); navigate('/admin'); - } catch (err) { - setError(err.message); - } finally { - setLoading(false); - } + }); }; - const handleResend = async () => { - setError(''); + const handleResend = () => { setNotice(''); - try { + run(async () => { await resendLoginCode(); setNotice('Neuer Code ist unterwegs.'); - } catch (err) { - setError(err.message); - } + }); + }; + + const handleSwitch = (next) => { + setNotice(''); + run(async () => { + await switchTwoFactorMethod(next); + setMethod(next); + setCode(''); + }); + }; + + const handleForgot = (e) => { + e.preventDefault(); + run(async () => { + await api.post('/auth/forgot-password', { login: username }); + goTo('forgot-sent'); + }); }; return (
HifiPlanet HifiPlanet - {step === 'credentials' ? ( -
+ + {step === 'credentials' && ( +

Admin-Login

@@ -82,7 +115,8 @@ export default function Login() { onChange={(e) => setUsername(e.target.value)} required autoFocus - 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" + autoComplete="username" + className={inputClass} />
@@ -92,22 +126,24 @@ export default function Login() { value={password} onChange={(e) => setPassword(e.target.value)} required - 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" + autoComplete="current-password" + className={inputClass} />
{error &&

{error}

} - +
- ) : ( -
+ )} + + {step === 'code' && ( +

Bestätigungscode

{method === 'email' ? (

@@ -131,38 +167,81 @@ export default function Login() { inputMode="numeric" autoComplete="one-time-code" 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" + className={`${inputClass} text-center text-lg tracking-widest`} />

{error &&

{error}

} {notice &&

{notice}

} - {method === 'email' && ( - )} - + )} + {method === 'email' && methods.includes('totp') && ( + + )} + )} + + {step === 'forgot' && ( +
+

Passwort vergessen

+

+ Gib deinen Benutzernamen oder deine E-Mail-Adresse ein. Wir schicken dir einen Link, mit dem du ein neues + Passwort festlegen kannst. +

+
+ + setUsername(e.target.value)} + required + autoFocus + autoComplete="username" + className={inputClass} + /> +
+ {error &&

{error}

} + + +
+ )} + + {step === 'forgot-sent' && ( +
+

Schau in dein Postfach

+

+ Wenn zu diesem Konto eine bestätigte E-Mail-Adresse hinterlegt ist, haben wir dir einen Link geschickt. Er ist + 60 Minuten gültig. +

+

+ Keine Mail bekommen? Ohne hinterlegte E-Mail kann ein Administrator dein Passwort in der Benutzerverwaltung + neu setzen. +

+ +
+ )} ); } diff --git a/hifi-src/src/pages/admin/ResetPassword.jsx b/hifi-src/src/pages/admin/ResetPassword.jsx new file mode 100644 index 0000000..09cb256 --- /dev/null +++ b/hifi-src/src/pages/admin/ResetPassword.jsx @@ -0,0 +1,102 @@ +import { useState } from 'react'; +import { Link, useSearchParams } from 'react-router-dom'; +import { api } from '../../api/client.js'; +import logo from '../../assets/logo.png'; +import logoDark from '../../assets/logo-dark.png'; + +const inputClass = + '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'; + +// Ziel des Links aus der "Passwort vergessen"-Mail (AccountEmail::sendPasswordReset). +export default function ResetPassword() { + const [params] = useSearchParams(); + const [password, setPassword] = useState(''); + const [confirmation, setConfirmation] = useState(''); + const [error, setError] = useState(''); + const [done, setDone] = useState(false); + const [loading, setLoading] = useState(false); + + const handleSubmit = async (e) => { + e.preventDefault(); + setError(''); + if (password !== confirmation) { + setError('Die Passwörter stimmen nicht überein'); + return; + } + setLoading(true); + try { + await api.post('/auth/reset-password', { + token: params.get('token') || '', + password, + password_confirmation: confirmation, + }); + setDone(true); + } catch (err) { + setError(err.message); + } finally { + setLoading(false); + } + }; + + return ( +
+ HifiPlanet + HifiPlanet +
+ {done ? ( + <> +

Passwort geändert

+

Du kannst dich jetzt mit dem neuen Passwort anmelden.

+ + Zum Login + + + ) : ( +
+

Neues Passwort festlegen

+
+ + setPassword(e.target.value)} + required + minLength={8} + autoFocus + autoComplete="new-password" + className={inputClass} + /> +

Mindestens 8 Zeichen.

+
+
+ + setConfirmation(e.target.value)} + required + minLength={8} + autoComplete="new-password" + className={inputClass} + /> +
+ {error &&

{error}

} + + + Zurück zum Login + +
+ )} +
+
+ ); +} diff --git a/hifi/api/database/schema.sql b/hifi/api/database/schema.sql index 71eca1a..e8977a0 100644 --- a/hifi/api/database/schema.sql +++ b/hifi/api/database/schema.sql @@ -14,6 +14,8 @@ CREATE TABLE admin_users ( pending_email VARCHAR(190) NULL, email_token_hash CHAR(64) NULL, email_token_expires_at DATETIME NULL, + password_reset_hash CHAR(64) NULL, + password_reset_expires_at DATETIME NULL, last_active_at DATETIME NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB; diff --git a/hifi/api/public/index.php b/hifi/api/public/index.php index 8f741fa..0b9826e 100644 --- a/hifi/api/public/index.php +++ b/hifi/api/public/index.php @@ -124,6 +124,9 @@ $maint = fn(?string $scope, callable $handler) => function (array $params = []) $router->post('/auth/login', fn($p) => AuthController::login()); $router->post('/auth/verify-2fa', fn($p) => AuthController::verifyTwoFactor()); $router->post('/auth/resend-code', fn($p) => AuthController::resendLoginCode()); +$router->post('/auth/2fa-method', fn($p) => AuthController::switchMethod()); +$router->post('/auth/forgot-password', fn($p) => AuthController::forgotPassword()); +$router->post('/auth/reset-password', fn($p) => AuthController::resetPassword()); $router->post('/auth/email', $admin(fn($p) => AuthController::changeEmail())); $router->post('/auth/email/resend', $admin(fn($p) => AuthController::resendEmailVerification())); $router->post('/auth/email/cancel', $admin(fn($p) => AuthController::cancelEmailChange())); diff --git a/hifi/api/src/Controllers/AuthController.php b/hifi/api/src/Controllers/AuthController.php index fb2f2cf..8437fd8 100644 --- a/hifi/api/src/Controllers/AuthController.php +++ b/hifi/api/src/Controllers/AuthController.php @@ -21,45 +21,46 @@ class AuthController Http::error('Benutzername bzw. E-Mail und Passwort erforderlich', 422); } - $columns = 'id, username, password_hash, two_factor_enabled, email, email_verified_at'; - $stmt = Database::connection()->prepare("SELECT $columns FROM admin_users WHERE username = ?"); - $stmt->execute([$username]); - $user = $stmt->fetch(); - - // Statt des Benutzernamens geht auch die E-Mail-Adresse - aber nur eine bestaetigte - // und nur, wenn sie eindeutig einem Konto gehoert. - if (!$user && str_contains($username, '@')) { - $stmt = Database::connection()->prepare( - "SELECT $columns FROM admin_users WHERE email = ? AND email_verified_at IS NOT NULL LIMIT 2" - ); - $stmt->execute([$username]); - $matches = $stmt->fetchAll(); - $user = count($matches) === 1 ? $matches[0] : false; - } + $user = self::findByLogin($username); if (!$user || !password_verify($password, $user['password_hash'])) { Http::error('Benutzername/E-Mail oder Passwort falsch', 401); } + $hasEmail = !empty($user['email']) && !empty($user['email_verified_at']); + + // Mit Authenticator-App ist sie die Vorgabe; ist zusaetzlich eine bestaetigte E-Mail + // hinterlegt, kann man auf der Code-Seite auf "Code per Mail" umschalten (switchMethod). if ((bool) $user['two_factor_enabled']) { session_regenerate_id(true); $_SESSION['pending_2fa_user_id'] = (int) $user['id']; $_SESSION['pending_2fa_method'] = 'totp'; + $_SESSION['email_code_sends'] = 0; unset($_SESSION['admin_id'], $_SESSION['admin_username']); - Http::send(['requires_2fa' => true, 'method' => 'totp']); + Http::send([ + 'requires_2fa' => true, + 'method' => 'totp', + 'methods' => $hasEmail ? ['totp', 'email'] : ['totp'], + 'email_hint' => $hasEmail ? AccountEmail::mask($user['email']) : null, + ]); return; } // Ohne Authenticator-App, aber mit bestaetigter E-Mail: Code per Mail als zweiter Faktor. // Konten ohne beides melden sich wie bisher nur mit Passwort an. - if (!empty($user['email']) && !empty($user['email_verified_at'])) { + if ($hasEmail) { session_regenerate_id(true); unset($_SESSION['admin_id'], $_SESSION['admin_username']); $_SESSION['pending_2fa_user_id'] = (int) $user['id']; $_SESSION['pending_2fa_method'] = 'email'; $_SESSION['email_code_sends'] = 0; if (self::issueEmailCode($user['email'], $user['username'])) { - Http::send(['requires_2fa' => true, 'method' => 'email', 'email_hint' => AccountEmail::mask($user['email'])]); + Http::send([ + 'requires_2fa' => true, + 'method' => 'email', + 'methods' => ['email'], + 'email_hint' => AccountEmail::mask($user['email']), + ]); return; } // Mailversand nicht eingerichtet oder fehlgeschlagen: nicht aussperren, sondern wie @@ -69,6 +70,103 @@ class AuthController self::completeLogin((int) $user['id'], $user['username']); } + /** Wechselt bei laufender Anmeldung zwischen Authenticator-App und Code per Mail. */ + public static function switchMethod(): void + { + if (empty($_SESSION['pending_2fa_user_id'])) { + Http::error('Keine ausstehende Anmeldung. Bitte erneut einloggen.', 400); + } + $method = (string) (Http::jsonBody()['method'] ?? ''); + $stmt = Database::connection()->prepare( + 'SELECT username, two_factor_enabled, email, email_verified_at FROM admin_users WHERE id = ?' + ); + $stmt->execute([(int) $_SESSION['pending_2fa_user_id']]); + $user = $stmt->fetch(); + if (!$user) { + Http::error('Benutzer nicht gefunden', 404); + } + + if ($method === 'totp' && $user['two_factor_enabled']) { + $_SESSION['pending_2fa_method'] = 'totp'; + Http::send(['ok' => true, 'method' => 'totp']); + } + if ($method === 'email' && !empty($user['email']) && !empty($user['email_verified_at'])) { + // Bereits gesendeter, noch gueltiger Code bleibt gueltig - kein neuer Versand beim Hin- und Herschalten. + $hasValidCode = !empty($_SESSION['email_code_hash']) && time() < (int) ($_SESSION['email_code_expires'] ?? 0); + if (!$hasValidCode) { + if ((int) ($_SESSION['email_code_sends'] ?? 0) >= 5) { + Http::error('Zu viele Codes angefordert. Bitte melde dich erneut an.', 429); + } + if (!self::issueEmailCode($user['email'], $user['username'])) { + Http::error('Der Code konnte nicht gesendet werden. Bitte nutze die Authenticator-App.', 500); + } + } + $_SESSION['pending_2fa_method'] = 'email'; + Http::send(['ok' => true, 'method' => 'email']); + } + Http::error('Diese Bestätigungsart ist für dein Konto nicht eingerichtet', 422); + } + + /** + * "Passwort vergessen": schickt einen Link an die bestaetigte E-Mail des Kontos. Antwortet + * immer gleich, damit sich nicht herausfinden laesst, welche Konten/Adressen existieren. + */ + public static function forgotPassword(): void + { + $login = trim((string) (Http::jsonBody()['login'] ?? '')); + if ($login === '') { + Http::error('Bitte Benutzername oder E-Mail eingeben', 422); + } + $user = self::findByLogin($login); + if ($user && !empty($user['email']) && !empty($user['email_verified_at'])) { + try { + AccountEmail::sendPasswordReset((int) $user['id']); + } catch (\Throwable $e) { + error_log('Passwort-Link fehlgeschlagen: ' . $e->getMessage()); + } + } + Http::send(['ok' => true]); + } + + public static function resetPassword(): void + { + $body = Http::jsonBody(); + $password = (string) ($body['password'] ?? ''); + if (strlen($password) < 8) { + Http::error('Das neue Passwort muss mindestens 8 Zeichen lang sein', 422); + } + if ($password !== (string) ($body['password_confirmation'] ?? '')) { + Http::error('Die Passwörter stimmen nicht überein', 422); + } + if (!AccountEmail::resetPassword(trim((string) ($body['token'] ?? '')), $password)) { + Http::error('Der Link ist ungültig oder abgelaufen. Bitte fordere einen neuen an.', 410); + } + Http::send(['ok' => true]); + } + + /** + * Konto zum Login-Feld: Benutzername, oder alternativ eine bestaetigte E-Mail-Adresse, + * die eindeutig einem Konto gehoert. + */ + private static function findByLogin(string $login): array|false + { + $columns = 'id, username, password_hash, two_factor_enabled, email, email_verified_at'; + $stmt = Database::connection()->prepare("SELECT $columns FROM admin_users WHERE username = ?"); + $stmt->execute([$login]); + $user = $stmt->fetch(); + + if (!$user && str_contains($login, '@')) { + $stmt = Database::connection()->prepare( + "SELECT $columns FROM admin_users WHERE email = ? AND email_verified_at IS NOT NULL LIMIT 2" + ); + $stmt->execute([$login]); + $matches = $stmt->fetchAll(); + $user = count($matches) === 1 ? $matches[0] : false; + } + + return $user; + } + public static function resendLoginCode(): void { if (empty($_SESSION['pending_2fa_user_id']) || ($_SESSION['pending_2fa_method'] ?? '') !== 'email') { diff --git a/hifi/api/src/Support/AccountEmail.php b/hifi/api/src/Support/AccountEmail.php index 33dae01..d58d24f 100644 --- a/hifi/api/src/Support/AccountEmail.php +++ b/hifi/api/src/Support/AccountEmail.php @@ -13,6 +13,7 @@ use App\Config\Database; class AccountEmail { private const TOKEN_HOURS = 48; + private const RESET_MINUTES = 60; public const LOGIN_CODE_MINUTES = 10; public const LOGIN_CODE_MAX_ATTEMPTS = 5; @@ -159,6 +160,72 @@ class AccountEmail self::send($email, $username, 'Dein Anmeldecode: ' . $code, $html, $text); } + /** + * Link zum Zuruecksetzen des Passworts (1 h gueltig). Hoechstens ein Link pro Minute je + * Konto, damit sich das Postfach nicht von aussen fluten laesst. + */ + public static function sendPasswordReset(int $userId): void + { + $db = Database::connection(); + $stmt = $db->prepare( + 'SELECT username, email, password_reset_expires_at > DATE_ADD(NOW(), INTERVAL 59 MINUTE) AS recent + FROM admin_users WHERE id = ?' + ); + $stmt->execute([$userId]); + $user = $stmt->fetch(); + if (!$user || !empty($user['recent']) || !self::mailConfigured()) { + return; + } + + $token = bin2hex(random_bytes(32)); + $db->prepare( + 'UPDATE admin_users SET password_reset_hash = ?, + password_reset_expires_at = DATE_ADD(NOW(), INTERVAL ' . self::RESET_MINUTES . ' MINUTE) WHERE id = ?' + )->execute([hash('sha256', $token), $userId]); + + $link = self::baseUrl() . 'admin/passwort-zuruecksetzen?token=' . $token; + $username = $user['username']; + $minutes = self::RESET_MINUTES; + $text = "Hallo {$username},\n\n" + . "für dein Konto im HifiPlanet-Adminbereich wurde ein neues Passwort angefordert. " + . "Über diesen Link kannst du es festlegen:\n\n{$link}\n\n" + . "Der Link ist {$minutes} Minuten gültig und funktioniert einmal. " + . "Wenn du das nicht warst, ignoriere diese E-Mail einfach – dein Passwort bleibt dann unverändert.\n\n" + . "Dein HifiPlanet-Team"; + $html = '

Hallo ' . self::e($username) . ',

' + . '

für dein Konto im HifiPlanet-Adminbereich wurde ein neues Passwort angefordert.

' + . '

Neues Passwort festlegen

' + . '

Oder diesen Link öffnen: ' . self::e($link) . '

' + . "

Der Link ist {$minutes} Minuten gültig und funktioniert einmal. " + . 'Wenn du das nicht warst, ignoriere diese E-Mail einfach – dein Passwort bleibt dann unverändert.

' + . '

Dein HifiPlanet-Team

'; + + self::send($user['email'], $username, 'Passwort zurücksetzen', $html, $text); + } + + /** Setzt das Passwort per Link-Token; false, wenn der Link ungueltig oder abgelaufen ist. */ + public static function resetPassword(string $token, string $password): bool + { + if (!preg_match('/^[a-f0-9]{64}$/', $token)) { + return false; + } + $db = Database::connection(); + $stmt = $db->prepare( + 'SELECT id FROM admin_users WHERE password_reset_hash = ? AND password_reset_expires_at > NOW()' + ); + $stmt->execute([hash('sha256', $token)]); + $id = $stmt->fetchColumn(); + if (!$id) { + return false; + } + $db->prepare( + 'UPDATE admin_users SET password_hash = ?, password_reset_hash = NULL, password_reset_expires_at = NULL WHERE id = ?' + )->execute([password_hash($password, PASSWORD_DEFAULT), $id]); + + return true; + } + private static function sendVerificationLink(int $userId, string $email, string $token): void { $stmt = Database::connection()->prepare('SELECT username FROM admin_users WHERE id = ?'); diff --git a/hifi/api/src/Support/Schema.php b/hifi/api/src/Support/Schema.php index ddeecb8..6ebc256 100644 --- a/hifi/api/src/Support/Schema.php +++ b/hifi/api/src/Support/Schema.php @@ -25,6 +25,8 @@ class Schema pending_email VARCHAR(190) NULL, email_token_hash CHAR(64) NULL, email_token_expires_at DATETIME NULL, + password_reset_hash CHAR(64) NULL, + password_reset_expires_at DATETIME NULL, last_active_at DATETIME NULL, created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB", @@ -419,6 +421,8 @@ class Schema 'pending_email' => 'VARCHAR(190) NULL', 'email_token_hash' => 'CHAR(64) NULL', 'email_token_expires_at' => 'DATETIME NULL', + 'password_reset_hash' => 'CHAR(64) NULL', + 'password_reset_expires_at' => 'DATETIME NULL', 'last_active_at' => 'DATETIME NULL', 'created_at' => 'DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP', ], diff --git a/hifi/assets/AGB-BSBKNUL3.js b/hifi/assets/AGB-BSBKNUL3.js new file mode 100644 index 0000000..7a84501 --- /dev/null +++ b/hifi/assets/AGB-BSBKNUL3.js @@ -0,0 +1 @@ +import{j as e}from"./index-CPMnKQBc.js";import{L as i}from"./LegalPageView-DxOTKnHx.js";function n(){return e.jsx(i,{slug:"agb",fallbackTitle:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach."})}export{n as default}; diff --git a/hifi/assets/AGB-R24E6RC9.js b/hifi/assets/AGB-R24E6RC9.js deleted file mode 100644 index 0b78355..0000000 --- a/hifi/assets/AGB-R24E6RC9.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./index-eQrgtQRM.js";import{L as i}from"./LegalPageView-CmgDetEJ.js";function n(){return e.jsx(i,{slug:"agb",fallbackTitle:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach."})}export{n as default}; diff --git a/hifi/assets/AccountSettings-CAesEcDe.js b/hifi/assets/AccountSettings-ZKd2A3aS.js similarity index 64% rename from hifi/assets/AccountSettings-CAesEcDe.js rename to hifi/assets/AccountSettings-ZKd2A3aS.js index 5dcfd65..947d600 100644 --- a/hifi/assets/AccountSettings-CAesEcDe.js +++ b/hifi/assets/AccountSettings-ZKd2A3aS.js @@ -1,8 +1,8 @@ -import{k as Fe,r as B,j as d,c as _}from"./index-eQrgtQRM.js";var O={},Ue=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},ye={},S={};let ce;const ze=[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];S.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};S.getSymbolTotalCodewords=function(t){return ze[t]};S.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};S.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');ce=t};S.isKanjiModeEnabled=function(){return typeof ce<"u"};S.toSJIS=function(t){return ce(t)};var W={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+o)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})(W);function Ne(){this.buffer=[],this.length=0}Ne.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let o=0;o>>t-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Ke=Ne;function Y(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Y.prototype.set=function(e,t,o,n){const r=e*this.size+t;this.data[r]=o,n&&(this.reservedBit[r]=!0)};Y.prototype.get=function(e,t){return this.data[e*this.size+t]};Y.prototype.xor=function(e,t,o){this.data[e*this.size+t]^=o};Y.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Ve=Y,Ce={};(function(e){const t=S.getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const r=Math.floor(n/7)+2,s=t(n),i=s===145?26:Math.ceil((s-13)/(2*r-2))*2,l=[s-7];for(let a=1;a=0&&r<=7},e.from=function(r){return e.isValid(r)?parseInt(r,10):void 0},e.getPenaltyN1=function(r){const s=r.size;let i=0,l=0,a=0,u=null,c=null;for(let y=0;y=5&&(i+=t.N1+(l-5)),u=h,l=1),h=r.get(p,y),h===c?a++:(a>=5&&(i+=t.N1+(a-5)),c=h,a=1)}l>=5&&(i+=t.N1+(l-5)),a>=5&&(i+=t.N1+(a-5))}return i},e.getPenaltyN2=function(r){const s=r.size;let i=0;for(let l=0;l=10&&(l===1488||l===93)&&i++,a=a<<1&2047|r.get(c,u),c>=10&&(a===1488||a===93)&&i++}return i*t.N3},e.getPenaltyN4=function(r){let s=0;const i=r.data.length;for(let a=0;a=0;){const i=s[0];for(let a=0;a0){const s=new Uint8Array(this.degree);return s.set(n,r),s}return n};var Je=fe,je={},L={},he={};he.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var T={};const Se="[0-9]+",Oe="[A-Z $%*+\\-./:]+";let J="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";J=J.replace(/u/g,"\\u");const Ye="(?:(?![A-Z0-9 $%*+\\-./:]|"+J+`)(?:.|[\r +import{k as Fe,r as B,j as d,c as _}from"./index-CPMnKQBc.js";var O={},Ue=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},ye={},S={};let ce;const ze=[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];S.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};S.getSymbolTotalCodewords=function(t){return ze[t]};S.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};S.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');ce=t};S.isKanjiModeEnabled=function(){return typeof ce<"u"};S.toSJIS=function(t){return ce(t)};var W={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+o)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})(W);function Ne(){this.buffer=[],this.length=0}Ne.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let o=0;o>>t-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Ke=Ne;function Y(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Y.prototype.set=function(e,t,o,n){const r=e*this.size+t;this.data[r]=o,n&&(this.reservedBit[r]=!0)};Y.prototype.get=function(e,t){return this.data[e*this.size+t]};Y.prototype.xor=function(e,t,o){this.data[e*this.size+t]^=o};Y.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Ve=Y,Ce={};(function(e){const t=S.getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const r=Math.floor(n/7)+2,s=t(n),i=s===145?26:Math.ceil((s-13)/(2*r-2))*2,l=[s-7];for(let a=1;a=0&&r<=7},e.from=function(r){return e.isValid(r)?parseInt(r,10):void 0},e.getPenaltyN1=function(r){const s=r.size;let i=0,l=0,a=0,u=null,c=null;for(let y=0;y=5&&(i+=t.N1+(l-5)),u=h,l=1),h=r.get(p,y),h===c?a++:(a>=5&&(i+=t.N1+(a-5)),c=h,a=1)}l>=5&&(i+=t.N1+(l-5)),a>=5&&(i+=t.N1+(a-5))}return i},e.getPenaltyN2=function(r){const s=r.size;let i=0;for(let l=0;l=10&&(l===1488||l===93)&&i++,a=a<<1&2047|r.get(c,u),c>=10&&(a===1488||a===93)&&i++}return i*t.N3},e.getPenaltyN4=function(r){let s=0;const i=r.data.length;for(let a=0;a=0;){const i=s[0];for(let a=0;a0){const s=new Uint8Array(this.degree);return s.set(n,r),s}return n};var Je=fe,je={},L={},he={};he.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var T={};const Se="[0-9]+",Oe="[A-Z $%*+\\-./:]+";let J="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";J=J.replace(/u/g,"\\u");const Ye="(?:(?![A-Z0-9 $%*+\\-./:]|"+J+`)(?:.|[\r ]))+`;T.KANJI=new RegExp(J,"g");T.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");T.BYTE=new RegExp(Ye,"g");T.NUMERIC=new RegExp(Se,"g");T.ALPHANUMERIC=new RegExp(Oe,"g");const $e=new RegExp("^"+J+"$"),qe=new RegExp("^"+Se+"$"),Ge=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");T.testKanji=function(t){return $e.test(t)};T.testNumeric=function(t){return qe.test(t)};T.testAlphanumeric=function(t){return Ge.test(t)};(function(e){const t=he,o=T;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(s,i){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!t.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?s.ccBits[0]:i<27?s.ccBits[1]:s.ccBits[2]},e.getBestModeForData=function(s){return o.testNumeric(s)?e.NUMERIC:o.testAlphanumeric(s)?e.ALPHANUMERIC:o.testKanji(s)?e.KANJI:e.BYTE},e.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},e.isValid=function(s){return s&&s.bit&&s.ccBits};function n(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+r)}}e.from=function(s,i){if(e.isValid(s))return s;try{return n(s)}catch{return i}}})(L);(function(e){const t=S,o=Z,n=W,r=L,s=he,i=7973,l=t.getBCHDigit(i);function a(p,h,w){for(let x=1;x<=40;x++)if(h<=e.getCapacity(x,w,p))return x}function u(p,h){return r.getCharCountIndicator(p,h)+4}function c(p,h){let w=0;return p.forEach(function(x){const k=u(x.mode,h);w+=k+x.getBitsLength()}),w}function y(p,h){for(let w=1;w<=40;w++)if(c(p,w)<=e.getCapacity(w,h,r.MIXED))return w}e.from=function(h,w){return s.isValid(h)?parseInt(h,10):w},e.getCapacity=function(h,w,x){if(!s.isValid(h))throw new Error("Invalid QR Code version");typeof x>"u"&&(x=r.BYTE);const k=t.getSymbolTotalCodewords(h),g=o.getTotalCodewordsCount(h,w),f=(k-g)*8;if(x===r.MIXED)return f;const m=f-u(x,h);switch(x){case r.NUMERIC:return Math.floor(m/10*3);case r.ALPHANUMERIC:return Math.floor(m/11*2);case r.KANJI:return Math.floor(m/13);case r.BYTE:default:return Math.floor(m/8)}},e.getBestVersionForData=function(h,w){let x;const k=n.from(w,n.M);if(Array.isArray(h)){if(h.length>1)return y(h,k);if(h.length===0)return 1;x=h[0]}else x=h;return a(x.mode,x.getLength(),k)},e.getEncodedBits=function(h){if(!s.isValid(h)||h<7)throw new Error("Invalid QR Code version");let w=h<<12;for(;t.getBCHDigit(w)-l>=0;)w^=i<=0;)r^=Pe<0&&(n=this.data.substr(o),r=parseInt(n,10),t.put(r,s*3+1))};var Ze=F;const Xe=L,te=["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 U(e){this.mode=Xe.ALPHANUMERIC,this.data=e}U.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};U.prototype.getLength=function(){return this.data.length};U.prototype.getBitsLength=function(){return U.getBitsLength(this.data.length)};U.prototype.write=function(t){let o;for(o=0;o+2<=this.data.length;o+=2){let n=te.indexOf(this.data[o])*45;n+=te.indexOf(this.data[o+1]),t.put(n,11)}this.data.length%2&&t.put(te.indexOf(this.data[o]),6)};var et=U;const tt=L;function z(e){this.mode=tt.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}z.getBitsLength=function(t){return t*8};z.prototype.getLength=function(){return this.data.length};z.prototype.getBitsLength=function(){return z.getBitsLength(this.data.length)};z.prototype.write=function(e){for(let t=0,o=this.data.length;t=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),e.put(o,13)}};var ot=K,Ie={exports:{}};(function(e){var t={single_source_shortest_paths:function(o,n,r){var s={},i={};i[n]=0;var l=t.PriorityQueue.make();l.push(n,0);for(var a,u,c,y,p,h,w,x,k;!l.empty();){a=l.pop(),u=a.value,y=a.cost,p=o[u]||{};for(c in p)p.hasOwnProperty(c)&&(h=p[c],w=y+h,x=i[c],k=typeof i[c]>"u",(k||x>w)&&(i[c]=w,l.push(c,w),s[c]=u))}if(typeof r<"u"&&typeof i[r]>"u"){var g=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(g)}return s},extract_shortest_path_from_predecessor_list:function(o,n){for(var r=[],s=n;s;)r.push(s),o[s],s=o[s];return r.reverse(),r},find_path:function(o,n,r){var s=t.single_source_shortest_paths(o,n,r);return t.extract_shortest_path_from_predecessor_list(s,r)},PriorityQueue:{make:function(o){var n=t.PriorityQueue,r={},s;o=o||{};for(s in n)n.hasOwnProperty(s)&&(r[s]=n[s]);return r.queue=[],r.sorter=o.sorter||n.default_sorter,r},default_sorter:function(o,n){return o.cost-n.cost},push:function(o,n){var r={value:o,cost:n};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Ie);var it=Ie.exports;(function(e){const t=L,o=Ze,n=et,r=nt,s=ot,i=T,l=S,a=it;function u(g){return unescape(encodeURIComponent(g)).length}function c(g,f,m){const b=[];let N;for(;(N=g.exec(m))!==null;)b.push({data:N[0],index:N.index,mode:f,length:N[0].length});return b}function y(g){const f=c(i.NUMERIC,t.NUMERIC,g),m=c(i.ALPHANUMERIC,t.ALPHANUMERIC,g);let b,N;return l.isKanjiModeEnabled()?(b=c(i.BYTE,t.BYTE,g),N=c(i.KANJI,t.KANJI,g)):(b=c(i.BYTE_KANJI,t.BYTE,g),N=[]),f.concat(m,b,N).sort(function(A,j){return A.index-j.index}).map(function(A){return{data:A.data,mode:A.mode,length:A.length}})}function p(g,f){switch(f){case t.NUMERIC:return o.getBitsLength(g);case t.ALPHANUMERIC:return n.getBitsLength(g);case t.KANJI:return s.getBitsLength(g);case t.BYTE:return r.getBitsLength(g)}}function h(g){return g.reduce(function(f,m){const b=f.length-1>=0?f[f.length-1]:null;return b&&b.mode===m.mode?(f[f.length-1].data+=m.data,f):(f.push(m),f)},[])}function w(g){const f=[];for(let m=0;m=0&&l<=6&&(a===0||a===6)||a>=0&&a<=6&&(l===0||l===6)||l>=2&&l<=4&&a>=2&&a<=4?e.set(s+l,i+a,!0,!0):e.set(s+l,i+a,!1,!0))}}function mt(e){const t=e.size;for(let o=8;o>l&1)===1,e.set(r,s,i,!0),e.set(s,r,i,!0)}function se(e,t,o){const n=e.size,r=ft.getEncodedBits(t,o);let s,i;for(s=0;s<15;s++)i=(r>>s&1)===1,s<6?e.set(s,8,i,!0):s<8?e.set(s+1,8,i,!0):e.set(n-15+s,8,i,!0),s<8?e.set(8,n-s-1,i,!0):s<9?e.set(8,15-s-1+1,i,!0):e.set(8,15-s-1,i,!0);e.set(n-8,8,1,!0)}function wt(e,t){const o=e.size;let n=-1,r=o-1,s=7,i=0;for(let l=o-1;l>0;l-=2)for(l===6&&l--;;){for(let a=0;a<2;a++)if(!e.isReserved(r,l-a)){let u=!1;i>>s&1)===1),e.set(r,l-a,u),s--,s===-1&&(i++,s=7)}if(r+=n,r<0||o<=r){r-=n,n=-n;break}}}function xt(e,t,o){const n=new at;o.forEach(function(a){n.put(a.mode.bit,4),n.put(a.getLength(),ht.getCharCountIndicator(a.mode,e)),a.write(n)});const r=ee.getSymbolTotalCodewords(e),s=de.getTotalCodewordsCount(e,t),i=(r-s)*8;for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const l=(i-n.getLengthInBits())/8;for(let a=0;a=7&&pt(a,t),wt(a,i),isNaN(n)&&(n=le.getBestMask(a,se.bind(null,a,o))),le.applyMask(n,a),se(a,o,n),{modules:a,version:t,errorCorrectionLevel:o,maskPattern:n,segments:r}}ye.create=function(t,o){if(typeof t>"u"||t==="")throw new Error("No input text");let n=ne.M,r,s;return typeof o<"u"&&(n=ne.from(o.errorCorrectionLevel,ne.M),r=Q.from(o.version),s=le.from(o.maskPattern),o.toSJISFunc&&ee.setToSJISFunction(o.toSJISFunc)),Nt(t,r,n,s)};var Te={},ge={};(function(e){function t(o){if(typeof o=="number"&&(o=o.toString()),typeof o!="string")throw new Error("Color should be defined as hex string");let n=o.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+o);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(s){return[s,s]}))),n.length===6&&n.push("F","F");const r=parseInt(n.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const r=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,s=n.width&&n.width>=21?n.width:void 0,i=n.scale||4;return{width:s,scale:s?4:i,margin:r,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,r){return r.width&&r.width>=n+r.margin*2?r.width/(n+r.margin*2):r.scale},e.getImageWidth=function(n,r){const s=e.getScale(n,r);return Math.floor((n+r.margin*2)*s)},e.qrToImageData=function(n,r,s){const i=r.modules.size,l=r.modules.data,a=e.getScale(i,s),u=Math.floor((i+s.margin*2)*a),c=s.margin*a,y=[s.color.light,s.color.dark];for(let p=0;p=c&&h>=c&&p"u"&&(!i||!i.getContext)&&(a=i,i=void 0),i||(u=n()),a=t.getOptions(a);const c=t.getImageWidth(s.modules.size,a),y=u.getContext("2d"),p=y.createImageData(c,c);return t.qrToImageData(p.data,s,a),o(y,u,c),y.putImageData(p,0,0),u},e.renderToDataURL=function(s,i,l){let a=l;typeof a>"u"&&(!i||!i.getContext)&&(a=i,i=void 0),a||(a={});const u=e.render(s,i,a),c=a.type||"image/png",y=a.rendererOpts||{};return u.toDataURL(c,y.quality)}})(Te);var _e={};const Ct=ge;function we(e,t){const o=e.a/255,n=t+'="'+e.hex+'"';return o<1?n+" "+t+'-opacity="'+o.toFixed(2).slice(1)+'"':n}function oe(e,t,o){let n=e+t;return typeof o<"u"&&(n+=" "+o),n}function Et(e,t,o){let n="",r=0,s=!1,i=0;for(let l=0;l0&&a>0&&e[l-1]||(n+=s?oe("M",a+o,.5+u+o):oe("m",r,0),r=0,s=!1),a+1':"",u="',c='viewBox="0 0 '+l+" "+l+'"',p=''+a+u+` -`;return typeof n=="function"&&n(null,p),p};const kt=Ue,ue=ye,Re=Te,At=_e;function me(e,t,o,n,r){const s=[].slice.call(arguments,1),i=s.length,l=typeof s[i-1]=="function";if(!l&&!kt())throw new Error("Callback required as last argument");if(l){if(i<2)throw new Error("Too few arguments provided");i===2?(r=o,o=t,t=n=void 0):i===3&&(t.getContext&&typeof r>"u"?(r=n,n=void 0):(r=n,n=o,o=t,t=void 0))}else{if(i<1)throw new Error("Too few arguments provided");return i===1?(o=t,t=n=void 0):i===2&&!t.getContext&&(n=o,o=t,t=void 0),new Promise(function(a,u){try{const c=ue.create(o,n);a(e(c,t,n))}catch(c){u(c)}})}try{const a=ue.create(o,n);r(null,e(a,t,n))}catch(a){r(a)}}O.create=ue.create;O.toCanvas=me.bind(null,Re.render);O.toDataURL=me.bind(null,Re.renderToDataURL);O.toString=me.bind(null,function(e,t,o){return At.render(e,o)});const xe={current_password:"",new_password:"",new_password_confirmation:"",two_factor_code:""},ie="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900";function Bt({user:e,refreshUser:t}){const[o,n]=B.useState("idle"),[r,s]=B.useState(""),[i,l]=B.useState(""),[a,u]=B.useState(""),[c,y]=B.useState(""),[p,h]=B.useState(!1),w=async(f,m)=>{u(""),y(""),h(!0);try{await f(),await t(),n("idle"),l(""),m&&y(m)}catch(b){u(b.message)}finally{h(!1)}},x=f=>{f.preventDefault(),w(()=>_.post("/auth/email",{email:r,password:i}),`Bestätigungslink an ${r} gesendet. Die Adresse gilt erst nach dem Klick darauf.`)},k=f=>{f.preventDefault(),w(()=>_.post("/auth/email/remove",{password:i}),"E-Mail-Adresse entfernt.")},g=()=>{n("idle"),l(""),u("")};return d.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[d.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail-Adresse"}),d.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:e!=null&&e.two_factor_enabled?"Da die Authenticator-App aktiv ist, wird beim Login sie abgefragt, nicht die E-Mail.":"Mit bestätigter Adresse bekommst du beim Login einen Code per Mail, den du zusätzlich zum Passwort eingibst."}),o==="idle"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"mb-2 text-sm",children:e!=null&&e.email&&(e!=null&&e.email_verified)?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:e.email})," ",d.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"· bestätigt"})]}):d.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:"Keine E-Mail-Adresse hinterlegt."})}),(e==null?void 0:e.pending_email)&&d.jsxs("div",{className:"mb-4 rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300",children:[d.jsx("strong",{children:e.pending_email})," wartet auf Bestätigung. Klick auf den Link in der Mail.",d.jsxs("div",{className:"mt-2 flex flex-wrap gap-3",children:[d.jsx("button",{type:"button",disabled:p,onClick:()=>w(()=>_.post("/auth/email/resend",{}),`Neuer Link an ${e.pending_email} gesendet.`),className:"font-medium hover:underline disabled:opacity-60",children:"Link erneut senden"}),d.jsx("button",{type:"button",disabled:p,onClick:()=>w(()=>_.post("/auth/email/cancel",{})),className:"font-medium hover:underline disabled:opacity-60",children:"Änderung verwerfen"})]})]}),c&&d.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:c}),a&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx("button",{onClick:()=>{n("edit"),s(""),u(""),y("")},className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:e!=null&&e.email?"E-Mail-Adresse ändern":"E-Mail-Adresse hinterlegen"}),((e==null?void 0:e.email)||(e==null?void 0:e.pending_email))&&d.jsx("button",{onClick:()=>{n("remove"),u(""),y("")},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:"Entfernen"})]})]}),o==="edit"&&d.jsxs("form",{onSubmit:x,children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neue E-Mail-Adresse"}),d.jsx("input",{type:"email",value:r,onChange:f=>s(f.target.value),required:!0,autoFocus:!0,className:ie})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),d.jsx("input",{type:"password",value:i,onChange:f=>l(f.target.value),required:!0,className:ie})]}),a&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:p,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:p?"Wird gesendet…":"Bestätigungslink senden"}),d.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"})]})]}),o==="remove"&&d.jsxs("form",{onSubmit:k,children:[d.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Ohne E-Mail-Adresse (und ohne Authenticator-App) reicht beim Login wieder das Passwort."}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),d.jsx("input",{type:"password",value:i,onChange:f=>l(f.target.value),required:!0,autoFocus:!0,className:ie})]}),a&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:p,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-60",children:"E-Mail-Adresse entfernen"}),d.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 St(){const{user:e,refreshUser:t}=Fe(),[o,n]=B.useState("idle"),[r,s]=B.useState(""),[i,l]=B.useState(""),[a,u]=B.useState(""),[c,y]=B.useState(""),[p,h]=B.useState([]),[w,x]=B.useState(""),[k,g]=B.useState(!1),[f,m]=B.useState(xe),[b,N]=B.useState(""),[E,A]=B.useState(""),[j,P]=B.useState(!1),v=async C=>{if(C.preventDefault(),N(""),A(""),f.new_password!==f.new_password_confirmation){N("Die neuen Passwörter stimmen nicht überein");return}P(!0);try{await _.post("/auth/change-password",f),m(xe),A("Passwort erfolgreich geändert.")}catch(I){N(I.message)}finally{P(!1)}},D=async()=>{x(""),g(!0);try{const C=await _.get("/auth/2fa/setup");l(C.secret),s(await O.toDataURL(C.otpauth_url)),u(""),n("setup")}catch(C){x(C.message)}finally{g(!1)}},V=async C=>{C.preventDefault(),x(""),g(!0);try{const I=await _.post("/auth/2fa/enable",{code:a});h(I.recovery_codes),n("recovery-codes"),await t()}catch(I){x(I.message)}finally{g(!1)}},M=()=>{n("idle"),h([]),y("")},Le=async C=>{C.preventDefault(),x(""),g(!0);try{await _.post("/auth/2fa/disable",{password:c}),y(""),n("idle"),await t()}catch(I){x(I.message)}finally{g(!1)}},De=async C=>{C.preventDefault(),x(""),g(!0);try{const I=await _.post("/auth/2fa/recovery-codes",{password:c});h(I.recovery_codes),n("recovery-codes")}catch(I){x(I.message)}finally{g(!1)}};return d.jsxs("div",{className:"max-w-xl",children:[d.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Mein Konto"}),d.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Angemeldet als ",d.jsx("strong",{children:e==null?void 0:e.username}),e!=null&&e.is_super_admin?" (Super-Admin)":"","."]}),d.jsx(Bt,{user:e,refreshUser:t}),d.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[d.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Passwort ändern"}),d.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Vergib ein neues Passwort für dein Konto.",(e==null?void 0:e.two_factor_enabled)&&" Da 2FA aktiv ist, musst du die Änderung zusätzlich mit deinem Code bestätigen."]}),d.jsxs("form",{onSubmit:v,children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aktuelles Passwort"}),d.jsx("input",{type:"password",value:f.current_password,onChange:C=>m({...f,current_password:C.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"})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort"}),d.jsx("input",{type:"password",value:f.new_password,onChange:C=>m({...f,new_password:C.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"})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort wiederholen"}),d.jsx("input",{type:"password",value:f.new_password_confirmation,onChange:C=>m({...f,new_password_confirmation:C.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"})]}),(e==null?void 0:e.two_factor_enabled)&&d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"2FA-Code zur Bestätigung"}),d.jsx("input",{value:f.two_factor_code,onChange:C=>m({...f,two_factor_code:C.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"})]}),b&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:b}),E&&d.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:E}),d.jsx("button",{type:"submit",disabled:j,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:j?"Wird geändert…":"Passwort ändern"})]})]}),d.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[d.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Zwei-Faktor-Authentifizierung"}),d.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."}),o==="idle"&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"mb-4 text-sm",children:["Status:"," ",e!=null&&e.two_factor_enabled?d.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"Aktiv"}):d.jsx("span",{className:"font-semibold text-neutral-500 dark:text-neutral-400",children:"Nicht aktiv"})]}),e!=null&&e.two_factor_enabled?d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx("button",{onClick:()=>{n("regenerate"),x("")},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"}),d.jsx("button",{onClick:()=>{n("disable"),x("")},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"})]}):d.jsx("button",{onClick:D,disabled:k,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"})]}),o==="setup"&&d.jsxs("form",{onSubmit:V,children:[d.jsxs("ol",{className:"mb-4 list-decimal space-y-2 pl-5 text-sm text-neutral-700 dark:text-neutral-300",children:[d.jsx("li",{children:"Öffne die Google Authenticator App (oder eine kompatible App)."}),d.jsx("li",{children:"Scanne den folgenden QR-Code:"})]}),d.jsx("div",{className:"mb-4 flex justify-center",children:r&&d.jsx("img",{src:r,alt:"QR-Code für Zwei-Faktor-Authentifizierung",className:"h-48 w-48 rounded-lg border border-neutral-200 dark:border-neutral-700"})}),d.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: ",d.jsx("br",{}),d.jsx("code",{className:"mt-1 inline-block rounded bg-neutral-100 px-2 py-1 font-mono tracking-wider dark:bg-neutral-800",children:i})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Bestätigungscode aus der App"}),d.jsx("input",{value:a,onChange:C=>u(C.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"})]}),w&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:k,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"}),d.jsx("button",{type:"button",onClick:()=>n("idle"),className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),o==="recovery-codes"&&d.jsxs("div",{children:[d.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Wiederherstellungscodes – jetzt sicher speichern!"}),d.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."}),d.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:p.map(C=>d.jsx("span",{children:C},C))}),d.jsx("button",{onClick:M,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"})]}),o==="disable"&&d.jsxs("form",{onSubmit:Le,children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),d.jsx("input",{type:"password",value:c,onChange:C=>y(C.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"})]}),w&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:k,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"}),d.jsx("button",{type:"button",onClick:()=>{n("idle"),y("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),o==="regenerate"&&d.jsxs("form",{onSubmit:De,children:[d.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Die bisherigen Wiederherstellungscodes werden ungültig."}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),d.jsx("input",{type:"password",value:c,onChange:C=>y(C.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"})]}),w&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:k,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"}),d.jsx("button",{type:"button",onClick:()=>{n("idle"),y("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})]})}export{St as default}; +`;return typeof n=="function"&&n(null,p),p};const kt=Ue,ue=ye,Re=Te,At=_e;function me(e,t,o,n,r){const s=[].slice.call(arguments,1),i=s.length,l=typeof s[i-1]=="function";if(!l&&!kt())throw new Error("Callback required as last argument");if(l){if(i<2)throw new Error("Too few arguments provided");i===2?(r=o,o=t,t=n=void 0):i===3&&(t.getContext&&typeof r>"u"?(r=n,n=void 0):(r=n,n=o,o=t,t=void 0))}else{if(i<1)throw new Error("Too few arguments provided");return i===1?(o=t,t=n=void 0):i===2&&!t.getContext&&(n=o,o=t,t=void 0),new Promise(function(a,u){try{const c=ue.create(o,n);a(e(c,t,n))}catch(c){u(c)}})}try{const a=ue.create(o,n);r(null,e(a,t,n))}catch(a){r(a)}}O.create=ue.create;O.toCanvas=me.bind(null,Re.render);O.toDataURL=me.bind(null,Re.renderToDataURL);O.toString=me.bind(null,function(e,t,o){return At.render(e,o)});const xe={current_password:"",new_password:"",new_password_confirmation:"",two_factor_code:""},ie="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900";function Bt({user:e,refreshUser:t}){const[o,n]=B.useState("idle"),[r,s]=B.useState(""),[i,l]=B.useState(""),[a,u]=B.useState(""),[c,y]=B.useState(""),[p,h]=B.useState(!1),w=async(f,m)=>{u(""),y(""),h(!0);try{await f(),await t(),n("idle"),l(""),m&&y(m)}catch(b){u(b.message)}finally{h(!1)}},x=f=>{f.preventDefault(),w(()=>_.post("/auth/email",{email:r,password:i}),`Bestätigungslink an ${r} gesendet. Die Adresse gilt erst nach dem Klick darauf.`)},k=f=>{f.preventDefault(),w(()=>_.post("/auth/email/remove",{password:i}),"E-Mail-Adresse entfernt.")},g=()=>{n("idle"),l(""),u("")};return d.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[d.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail-Adresse"}),d.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:e!=null&&e.two_factor_enabled?"Beim Login fragen wir die Authenticator-App ab. Mit bestätigter Adresse kannst du dort stattdessen einen Code per Mail anfordern. Außerdem brauchst du sie für „Passwort vergessen“.":"Mit bestätigter Adresse bekommst du beim Login einen Code per Mail, den du zusätzlich zum Passwort eingibst. Außerdem brauchst du sie für „Passwort vergessen“."}),o==="idle"&&d.jsxs(d.Fragment,{children:[d.jsx("p",{className:"mb-2 text-sm",children:e!=null&&e.email&&(e!=null&&e.email_verified)?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:e.email})," ",d.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"· bestätigt"})]}):d.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:"Keine E-Mail-Adresse hinterlegt."})}),(e==null?void 0:e.pending_email)&&d.jsxs("div",{className:"mb-4 rounded-md border border-amber-200 bg-amber-50 p-3 text-sm text-amber-800 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300",children:[d.jsx("strong",{children:e.pending_email})," wartet auf Bestätigung. Klick auf den Link in der Mail.",d.jsxs("div",{className:"mt-2 flex flex-wrap gap-3",children:[d.jsx("button",{type:"button",disabled:p,onClick:()=>w(()=>_.post("/auth/email/resend",{}),`Neuer Link an ${e.pending_email} gesendet.`),className:"font-medium hover:underline disabled:opacity-60",children:"Link erneut senden"}),d.jsx("button",{type:"button",disabled:p,onClick:()=>w(()=>_.post("/auth/email/cancel",{})),className:"font-medium hover:underline disabled:opacity-60",children:"Änderung verwerfen"})]})]}),c&&d.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:c}),a&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx("button",{onClick:()=>{n("edit"),s(""),u(""),y("")},className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:e!=null&&e.email?"E-Mail-Adresse ändern":"E-Mail-Adresse hinterlegen"}),((e==null?void 0:e.email)||(e==null?void 0:e.pending_email))&&d.jsx("button",{onClick:()=>{n("remove"),u(""),y("")},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:"Entfernen"})]})]}),o==="edit"&&d.jsxs("form",{onSubmit:x,children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neue E-Mail-Adresse"}),d.jsx("input",{type:"email",value:r,onChange:f=>s(f.target.value),required:!0,autoFocus:!0,className:ie})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),d.jsx("input",{type:"password",value:i,onChange:f=>l(f.target.value),required:!0,className:ie})]}),a&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:p,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:p?"Wird gesendet…":"Bestätigungslink senden"}),d.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"})]})]}),o==="remove"&&d.jsxs("form",{onSubmit:k,children:[d.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Ohne E-Mail-Adresse (und ohne Authenticator-App) reicht beim Login wieder das Passwort."}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),d.jsx("input",{type:"password",value:i,onChange:f=>l(f.target.value),required:!0,autoFocus:!0,className:ie})]}),a&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:p,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-60",children:"E-Mail-Adresse entfernen"}),d.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 St(){const{user:e,refreshUser:t}=Fe(),[o,n]=B.useState("idle"),[r,s]=B.useState(""),[i,l]=B.useState(""),[a,u]=B.useState(""),[c,y]=B.useState(""),[p,h]=B.useState([]),[w,x]=B.useState(""),[k,g]=B.useState(!1),[f,m]=B.useState(xe),[b,N]=B.useState(""),[E,A]=B.useState(""),[j,P]=B.useState(!1),v=async C=>{if(C.preventDefault(),N(""),A(""),f.new_password!==f.new_password_confirmation){N("Die neuen Passwörter stimmen nicht überein");return}P(!0);try{await _.post("/auth/change-password",f),m(xe),A("Passwort erfolgreich geändert.")}catch(I){N(I.message)}finally{P(!1)}},D=async()=>{x(""),g(!0);try{const C=await _.get("/auth/2fa/setup");l(C.secret),s(await O.toDataURL(C.otpauth_url)),u(""),n("setup")}catch(C){x(C.message)}finally{g(!1)}},V=async C=>{C.preventDefault(),x(""),g(!0);try{const I=await _.post("/auth/2fa/enable",{code:a});h(I.recovery_codes),n("recovery-codes"),await t()}catch(I){x(I.message)}finally{g(!1)}},M=()=>{n("idle"),h([]),y("")},Le=async C=>{C.preventDefault(),x(""),g(!0);try{await _.post("/auth/2fa/disable",{password:c}),y(""),n("idle"),await t()}catch(I){x(I.message)}finally{g(!1)}},De=async C=>{C.preventDefault(),x(""),g(!0);try{const I=await _.post("/auth/2fa/recovery-codes",{password:c});h(I.recovery_codes),n("recovery-codes")}catch(I){x(I.message)}finally{g(!1)}};return d.jsxs("div",{className:"max-w-xl",children:[d.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Mein Konto"}),d.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Angemeldet als ",d.jsx("strong",{children:e==null?void 0:e.username}),e!=null&&e.is_super_admin?" (Super-Admin)":"","."]}),d.jsx(Bt,{user:e,refreshUser:t}),d.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[d.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Passwort ändern"}),d.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Vergib ein neues Passwort für dein Konto.",(e==null?void 0:e.two_factor_enabled)&&" Da 2FA aktiv ist, musst du die Änderung zusätzlich mit deinem Code bestätigen."]}),d.jsxs("form",{onSubmit:v,children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aktuelles Passwort"}),d.jsx("input",{type:"password",value:f.current_password,onChange:C=>m({...f,current_password:C.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"})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort"}),d.jsx("input",{type:"password",value:f.new_password,onChange:C=>m({...f,new_password:C.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"})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort wiederholen"}),d.jsx("input",{type:"password",value:f.new_password_confirmation,onChange:C=>m({...f,new_password_confirmation:C.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"})]}),(e==null?void 0:e.two_factor_enabled)&&d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"2FA-Code zur Bestätigung"}),d.jsx("input",{value:f.two_factor_code,onChange:C=>m({...f,two_factor_code:C.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"})]}),b&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:b}),E&&d.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:E}),d.jsx("button",{type:"submit",disabled:j,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:j?"Wird geändert…":"Passwort ändern"})]})]}),d.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[d.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Zwei-Faktor-Authentifizierung"}),d.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."}),o==="idle"&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"mb-4 text-sm",children:["Status:"," ",e!=null&&e.two_factor_enabled?d.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"Aktiv"}):d.jsx("span",{className:"font-semibold text-neutral-500 dark:text-neutral-400",children:"Nicht aktiv"})]}),e!=null&&e.two_factor_enabled?d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx("button",{onClick:()=>{n("regenerate"),x("")},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"}),d.jsx("button",{onClick:()=>{n("disable"),x("")},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"})]}):d.jsx("button",{onClick:D,disabled:k,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"})]}),o==="setup"&&d.jsxs("form",{onSubmit:V,children:[d.jsxs("ol",{className:"mb-4 list-decimal space-y-2 pl-5 text-sm text-neutral-700 dark:text-neutral-300",children:[d.jsx("li",{children:"Öffne die Google Authenticator App (oder eine kompatible App)."}),d.jsx("li",{children:"Scanne den folgenden QR-Code:"})]}),d.jsx("div",{className:"mb-4 flex justify-center",children:r&&d.jsx("img",{src:r,alt:"QR-Code für Zwei-Faktor-Authentifizierung",className:"h-48 w-48 rounded-lg border border-neutral-200 dark:border-neutral-700"})}),d.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: ",d.jsx("br",{}),d.jsx("code",{className:"mt-1 inline-block rounded bg-neutral-100 px-2 py-1 font-mono tracking-wider dark:bg-neutral-800",children:i})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Bestätigungscode aus der App"}),d.jsx("input",{value:a,onChange:C=>u(C.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"})]}),w&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:k,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"}),d.jsx("button",{type:"button",onClick:()=>n("idle"),className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),o==="recovery-codes"&&d.jsxs("div",{children:[d.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Wiederherstellungscodes – jetzt sicher speichern!"}),d.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."}),d.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:p.map(C=>d.jsx("span",{children:C},C))}),d.jsx("button",{onClick:M,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"})]}),o==="disable"&&d.jsxs("form",{onSubmit:Le,children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),d.jsx("input",{type:"password",value:c,onChange:C=>y(C.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"})]}),w&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:k,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"}),d.jsx("button",{type:"button",onClick:()=>{n("idle"),y("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),o==="regenerate"&&d.jsxs("form",{onSubmit:De,children:[d.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Die bisherigen Wiederherstellungscodes werden ungültig."}),d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),d.jsx("input",{type:"password",value:c,onChange:C=>y(C.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"})]}),w&&d.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{type:"submit",disabled:k,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"}),d.jsx("button",{type:"button",onClick:()=>{n("idle"),y("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})]})}export{St as default}; diff --git a/hifi/assets/AdminUsers-BRv6czlM.js b/hifi/assets/AdminUsers-17rwNs5P.js similarity index 98% rename from hifi/assets/AdminUsers-BRv6czlM.js rename to hifi/assets/AdminUsers-17rwNs5P.js index 1e2b374..eeb3560 100644 --- a/hifi/assets/AdminUsers-BRv6czlM.js +++ b/hifi/assets/AdminUsers-17rwNs5P.js @@ -1 +1 @@ -import{k as I,r as n,v as $,w as J,j as e,c}from"./index-eQrgtQRM.js";const o={username:"",email:"",password:"",is_super_admin:!1,permissions:[],group_ids:[]};function K({user:r}){return r.pending_email?e.jsxs("span",{className:"block text-xs font-normal text-amber-600 dark:text-amber-400",title:"Wartet auf Klick auf den Bestätigungslink",children:[r.pending_email," · unbestätigt"]}):r.email&&r.email_verified?e.jsx("span",{className:"block text-xs font-normal text-neutral-500 dark:text-neutral-400",children:r.email}):null}function M(r){return r?new Date(r.replace(" ","T")).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Noch nie"}function G(){const{user:r,hasPermission:g}=I(),[b,S]=n.useState([]),[B,E]=n.useState([]),[j,A]=n.useState([]),[a,i]=n.useState(o),[l,k]=n.useState(null),[f,N]=n.useState(!1),[m,y]=n.useState(null),[_,x]=n.useState(""),[z,v]=n.useState(o),w=n.useRef(null),u=$();J(JSON.stringify(a)!==JSON.stringify(z),"admin-users");const p=()=>{c.get("/admin-users").then(S),c.get("/permissions/catalog").then(E),(g("permission_groups.manage")||g("users.manage"))&&c.get("/permission-groups").then(A)};n.useEffect(p,[]);const C=t=>{var d;k(t.id),N(t.is_primary),y(t);const s={username:t.username,email:t.pending_email||t.email||"",password:"",is_super_admin:t.is_super_admin,permissions:t.permissions,group_ids:t.groups.map(R=>R.id)};i(s),v(s),(d=w.current)==null||d.scrollIntoView({behavior:"smooth",block:"start"})},h=()=>{k(null),N(!1),y(null),i(o),v(o)},D=t=>{i(s=>({...s,permissions:s.permissions.includes(t)?s.permissions.filter(d=>d!==t):[...s.permissions,t]}))},F=t=>{i(s=>({...s,group_ids:s.group_ids.includes(t)?s.group_ids.filter(d=>d!==t):[...s.group_ids,t]}))},L=async t=>{t.preventDefault(),x("");try{let s;if(l)s=await c.put(`/admin-users/${l}`,a);else{if(a.password.length<8){x("Passwort muss mindestens 8 Zeichen lang sein");return}s=await c.post("/admin-users",a)}u.success(l?"Benutzer gespeichert.":`Benutzer „${a.username}“ angelegt.`),s!=null&&s.email_notice&&u.info(s.email_notice),h(),p()}catch(s){x(s.message)}},P=async t=>{if(confirm("Diesen Benutzer wirklich löschen?"))try{await c.delete(`/admin-users/${t}`),l===t&&h(),u.success("Benutzer gelöscht."),p()}catch(s){u.error(`Löschen fehlgeschlagen: ${s.message}`)}};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Benutzer"}),e.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."}),e.jsx("div",{className:"overflow-x-auto rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Benutzername"}),e.jsx("th",{className:"px-4 py-2",children:"Rolle"}),e.jsx("th",{className:"px-4 py-2",children:"Berechtigungsgruppen"}),e.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktiv"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[b.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:[t.username,t.id===(r==null?void 0:r.id)&&e.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(du)"}),t.is_primary&&e.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(Erst-Administrator)"}),e.jsx(K,{user:t})]}),e.jsx("td",{className:"px-4 py-2",children:t.is_super_admin?e.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"}):e.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400",children:[t.permissions.length," Einzelrechte"]})}),e.jsx("td",{className:"px-4 py-2",children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.groups.map(s=>e.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:s.name},s.id)),t.groups.length===0&&"–"]})}),e.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:M(t.last_active_at)}),e.jsxs("td",{className:"whitespace-nowrap px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>C(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),t.id!==(r==null?void 0:r.id)&&!t.is_primary&&e.jsx("button",{onClick:()=>P(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),b.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Benutzer angelegt."})})]})]})})]}),e.jsxs("form",{ref:w,onSubmit:L,className:"h-fit scroll-mt-20 space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Benutzer bearbeiten":"Neuer Benutzer"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername *"}),e.jsx("input",{required:!0,value:a.username,onChange:t=>i({...a,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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail-Adresse"}),e.jsx("input",{type:"email",value:a.email,onChange:t=>i({...a,email:t.target.value}),placeholder:"optional",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"}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:m!=null&&m.pending_email&&a.email===m.pending_email?"Wartet auf Bestätigung. Erst nach Klick auf den Link in der Mail gilt die Adresse.":"Eine neue Adresse bekommt zuerst einen Bestätigungslink. Danach geht beim Login ein Code an sie, falls keine Authenticator-App eingerichtet ist."})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",l?"(leer lassen = unverändert)":"*"]}),e.jsx("input",{type:"password",required:!l,value:a.password,onChange:t=>i({...a,password: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"})]}),(r==null?void 0:r.is_super_admin)&&e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:a.is_super_admin,disabled:f,onChange:t=>i({...a,is_super_admin:t.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&&e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Der Erst-Administrator behält immer den Super-Admin-Status."})]}),!a.is_super_admin&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Einzelne Berechtigungen"}),e.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:B.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:a.permissions.includes(t.key),onChange:()=>D(t.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.label]},t.key))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungsgruppen"}),e.jsxs("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:[j.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:a.group_ids.includes(t.id),onChange:()=>F(t.id),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.name]},t.id)),j.length===0&&e.jsx("p",{className:"text-sm text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})]})]})]}),_&&e.jsx("p",{className:"text-sm text-red-600",children:_}),e.jsxs("div",{className:"flex gap-2",children:[e.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:l?"Speichern":"Anlegen"}),l&&e.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"})]})]})]})}export{G as default}; +import{k as I,r as n,v as $,w as J,j as e,c}from"./index-CPMnKQBc.js";const o={username:"",email:"",password:"",is_super_admin:!1,permissions:[],group_ids:[]};function K({user:r}){return r.pending_email?e.jsxs("span",{className:"block text-xs font-normal text-amber-600 dark:text-amber-400",title:"Wartet auf Klick auf den Bestätigungslink",children:[r.pending_email," · unbestätigt"]}):r.email&&r.email_verified?e.jsx("span",{className:"block text-xs font-normal text-neutral-500 dark:text-neutral-400",children:r.email}):null}function M(r){return r?new Date(r.replace(" ","T")).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Noch nie"}function G(){const{user:r,hasPermission:g}=I(),[b,S]=n.useState([]),[B,E]=n.useState([]),[j,A]=n.useState([]),[a,i]=n.useState(o),[l,k]=n.useState(null),[f,N]=n.useState(!1),[m,y]=n.useState(null),[_,x]=n.useState(""),[z,v]=n.useState(o),w=n.useRef(null),u=$();J(JSON.stringify(a)!==JSON.stringify(z),"admin-users");const p=()=>{c.get("/admin-users").then(S),c.get("/permissions/catalog").then(E),(g("permission_groups.manage")||g("users.manage"))&&c.get("/permission-groups").then(A)};n.useEffect(p,[]);const C=t=>{var d;k(t.id),N(t.is_primary),y(t);const s={username:t.username,email:t.pending_email||t.email||"",password:"",is_super_admin:t.is_super_admin,permissions:t.permissions,group_ids:t.groups.map(R=>R.id)};i(s),v(s),(d=w.current)==null||d.scrollIntoView({behavior:"smooth",block:"start"})},h=()=>{k(null),N(!1),y(null),i(o),v(o)},D=t=>{i(s=>({...s,permissions:s.permissions.includes(t)?s.permissions.filter(d=>d!==t):[...s.permissions,t]}))},F=t=>{i(s=>({...s,group_ids:s.group_ids.includes(t)?s.group_ids.filter(d=>d!==t):[...s.group_ids,t]}))},L=async t=>{t.preventDefault(),x("");try{let s;if(l)s=await c.put(`/admin-users/${l}`,a);else{if(a.password.length<8){x("Passwort muss mindestens 8 Zeichen lang sein");return}s=await c.post("/admin-users",a)}u.success(l?"Benutzer gespeichert.":`Benutzer „${a.username}“ angelegt.`),s!=null&&s.email_notice&&u.info(s.email_notice),h(),p()}catch(s){x(s.message)}},P=async t=>{if(confirm("Diesen Benutzer wirklich löschen?"))try{await c.delete(`/admin-users/${t}`),l===t&&h(),u.success("Benutzer gelöscht."),p()}catch(s){u.error(`Löschen fehlgeschlagen: ${s.message}`)}};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Benutzer"}),e.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."}),e.jsx("div",{className:"overflow-x-auto rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Benutzername"}),e.jsx("th",{className:"px-4 py-2",children:"Rolle"}),e.jsx("th",{className:"px-4 py-2",children:"Berechtigungsgruppen"}),e.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktiv"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[b.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:[t.username,t.id===(r==null?void 0:r.id)&&e.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(du)"}),t.is_primary&&e.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(Erst-Administrator)"}),e.jsx(K,{user:t})]}),e.jsx("td",{className:"px-4 py-2",children:t.is_super_admin?e.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"}):e.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400",children:[t.permissions.length," Einzelrechte"]})}),e.jsx("td",{className:"px-4 py-2",children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[t.groups.map(s=>e.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:s.name},s.id)),t.groups.length===0&&"–"]})}),e.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:M(t.last_active_at)}),e.jsxs("td",{className:"whitespace-nowrap px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>C(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),t.id!==(r==null?void 0:r.id)&&!t.is_primary&&e.jsx("button",{onClick:()=>P(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),b.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Benutzer angelegt."})})]})]})})]}),e.jsxs("form",{ref:w,onSubmit:L,className:"h-fit scroll-mt-20 space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Benutzer bearbeiten":"Neuer Benutzer"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername *"}),e.jsx("input",{required:!0,value:a.username,onChange:t=>i({...a,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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail-Adresse"}),e.jsx("input",{type:"email",value:a.email,onChange:t=>i({...a,email:t.target.value}),placeholder:"optional",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"}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:m!=null&&m.pending_email&&a.email===m.pending_email?"Wartet auf Bestätigung. Erst nach Klick auf den Link in der Mail gilt die Adresse.":"Eine neue Adresse bekommt zuerst einen Bestätigungslink. Danach geht beim Login ein Code an sie, falls keine Authenticator-App eingerichtet ist."})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",l?"(leer lassen = unverändert)":"*"]}),e.jsx("input",{type:"password",required:!l,value:a.password,onChange:t=>i({...a,password: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"})]}),(r==null?void 0:r.is_super_admin)&&e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:a.is_super_admin,disabled:f,onChange:t=>i({...a,is_super_admin:t.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&&e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Der Erst-Administrator behält immer den Super-Admin-Status."})]}),!a.is_super_admin&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Einzelne Berechtigungen"}),e.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:B.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:a.permissions.includes(t.key),onChange:()=>D(t.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.label]},t.key))})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungsgruppen"}),e.jsxs("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:[j.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:a.group_ids.includes(t.id),onChange:()=>F(t.id),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.name]},t.id)),j.length===0&&e.jsx("p",{className:"text-sm text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})]})]})]}),_&&e.jsx("p",{className:"text-sm text-red-600",children:_}),e.jsxs("div",{className:"flex gap-2",children:[e.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:l?"Speichern":"Anlegen"}),l&&e.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"})]})]})]})}export{G as default}; diff --git a/hifi/assets/Brands-C2MO3iab.js b/hifi/assets/Brands-CPunktmg.js similarity index 93% rename from hifi/assets/Brands-C2MO3iab.js rename to hifi/assets/Brands-CPunktmg.js index 7c98cb8..bc53338 100644 --- a/hifi/assets/Brands-C2MO3iab.js +++ b/hifi/assets/Brands-CPunktmg.js @@ -1 +1 @@ -import{v as O,r as n,w as P,j as e,P as T,B as o,C as U,I as W,x as F,s as q,y,z as D,F as J,c as m}from"./index-eQrgtQRM.js";import K from"./ImageUploadField-2si66K3r.js";import{T as G}from"./TextStyleWidget-Cc-J2FBP.js";import{S as H,s as Z}from"./SortableList-B1XU_999.js";import{V as Q}from"./VehicleCatalogDialog-wGVVg0Ns.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";const h={name:"",image_path:"",sort_order:0};function le(){const c=O(),[r,d]=n.useState(null),[g,$]=n.useState({}),[l,p]=n.useState(h),[B,j]=n.useState(h),[a,x]=n.useState(null),[z,b]=n.useState(""),[C,S]=n.useState(!1),[u,E]=n.useState(""),[I,v]=n.useState(!1),w=JSON.stringify(l)!==JSON.stringify(B);P(a!==null&&w,"brands");const f=()=>{m.get("/brands").then(d).catch(()=>d([])),m.get("/models").then(s=>$(s.reduce((t,i)=>({...t,[i.brand_id]:(t[i.brand_id]||0)+1}),{}))).catch(()=>{})};n.useEffect(()=>{f()},[]);const k=s=>{const t=s?{name:s.name,image_path:s.image_path||"",sort_order:s.sort_order}:h;x(s?s.id:"new"),p(t),j(t),b("")},M=()=>{w&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||(x(null),p(h),j(h))},R=async s=>{s.preventDefault(),b(""),S(!0);try{if(a!=="new")await m.put(`/brands/${a}`,l);else{const t=(r||[]).reduce((i,N)=>Math.max(i,Number(N.sort_order)||0),0)+10;await m.post("/brands",{...l,sort_order:t})}c.success(a!=="new"?"Marke gespeichert.":"Marke angelegt."),j(l),x(null),f()}catch(t){b(t.message)}finally{S(!1)}},L=async s=>{const t=g[s.id]||0,i=t>0?` und ${t} Modell${t===1?"":"e"} mit allen Paketen`:"";if(window.confirm(`„${s.name}“${i} wirklich löschen?`))try{await m.delete(`/brands/${s.id}`),a===s.id&&x(null),c.success("Marke gelöscht."),f()}catch(N){c.error(`Löschen fehlgeschlagen: ${N.message}`)}},V=async s=>{const t=r;d(s);try{d(await Z("brands",s)),c.success("Reihenfolge gespeichert.")}catch(i){d(t),c.error(`Reihenfolge konnte nicht gespeichert werden: ${i.message}`)}},_=n.useMemo(()=>{const s=u.trim().toLowerCase();return s?(r||[]).filter(t=>t.name.toLowerCase().includes(s)):r||[]},[r,u]),A=u.trim()!=="";return e.jsxs("div",{children:[e.jsx(T,{title:"Fahrzeugmarken",description:"Reihenfolge am Griff links per Ziehen ändern – so erscheinen die Marken auf der Website.",actions:e.jsxs(e.Fragment,{children:[e.jsx(o,{variant:"secondary",icon:"template",onClick:()=>v(!0),children:"Aus Vorlage laden"}),e.jsx(o,{icon:"plus",onClick:()=>k(null),children:"Neue Marke"})]})}),e.jsxs(U,{padded:!1,className:"overflow-hidden",children:[r!==null&&r.length>8&&e.jsx("div",{className:"border-b border-neutral-200 p-3 dark:border-neutral-800",children:e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(W,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),e.jsx(F,{value:u,onChange:s=>E(s.target.value),placeholder:"Marke suchen …",className:"h-9 pl-9"})]})}),r===null?e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[0,1,2,3].map(s=>e.jsxs("li",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsx("span",{className:"h-12 w-12 animate-pulse rounded-lg bg-neutral-100 dark:bg-neutral-800"}),e.jsx("span",{className:"h-4 w-40 animate-pulse rounded bg-neutral-100 dark:bg-neutral-800"})]},s))}):r.length===0?e.jsx(q,{icon:"tag",title:"Noch keine Marken",description:"Lege Marken einzeln an oder übernimm sie mit Modellen direkt aus der Fahrzeug-Vorlage.",actions:e.jsxs(e.Fragment,{children:[e.jsx(o,{variant:"secondary",icon:"template",onClick:()=>v(!0),children:"Aus Vorlage laden"}),e.jsx(o,{icon:"plus",onClick:()=>k(null),children:"Neue Marke"})]})}):_.length===0?e.jsxs("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Keine Marke passt zu „",u,"“."]}):e.jsx(H,{items:_,onReorder:V,disabled:A,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(s,t)=>e.jsxs("div",{className:`group flex items-center gap-3 bg-white px-3 py-2.5 transition hover:bg-neutral-50 dark:bg-neutral-900 dark:hover:bg-neutral-800/50 sm:gap-4 sm:px-4 ${a===s.id?"bg-brand-50/60 dark:bg-brand-900/20":""}`,children:[e.jsx("span",{className:"w-6 shrink-0",children:t}),e.jsxs("button",{type:"button",onClick:()=>k(s),className:"flex min-w-0 flex-1 items-center gap-4 text-left",children:[s.image_path?e.jsx("img",{src:s.image_path,alt:"",className:"h-12 w-12 shrink-0 rounded-lg border border-neutral-200 bg-white object-cover dark:border-neutral-700"}):e.jsx("span",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-sm font-bold text-neutral-400 dark:bg-neutral-800",children:s.name.slice(0,2).toUpperCase()}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:s.name}),e.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:g[s.id]?`${g[s.id]} Modell${g[s.id]===1?"":"e"}`:"Noch keine Modelle"})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(y,{icon:"eye",label:"Auf der Website ansehen",href:`/fahrzeuge/${s.slug}`,target:"_blank",rel:"noopener noreferrer",className:"hidden sm:inline-flex"}),e.jsx(y,{icon:"pencil",label:"Bearbeiten",onClick:()=>k(s)}),e.jsx(y,{icon:"trash",label:"Löschen",tone:"danger",onClick:()=>L(s)})]})]})})]}),e.jsxs(D,{as:"form",onSubmit:R,open:a!==null,onClose:M,title:a==="new"?"Neue Marke":"Marke bearbeiten",description:a==="new"?"Erscheint danach unter „Fahrzeuge“ auf der Website.":void 0,footer:e.jsxs(e.Fragment,{children:[e.jsx(o,{variant:"secondary",onClick:M,children:"Abbrechen"}),e.jsx(o,{type:"submit",disabled:C||a!=="new"&&!w,children:C?"Speichere…":a==="new"?"Anlegen":"Speichern"})]}),children:[e.jsx(J,{label:"Name",required:!0,error:z,children:e.jsx(F,{required:!0,autoFocus:!0,value:l.name,onChange:s=>p({...l,name:s.target.value}),placeholder:"z. B. Volkswagen"})}),a!=="new"&&a!==null&&e.jsx(G,{fieldKey:`brands.${a}.name`,previewText:l.name||"Beispieltext"}),e.jsx(K,{value:l.image_path,onChange:s=>p({...l,image_path:s}),label:"Bild (optional)"})]}),e.jsx(Q,{open:I,onClose:()=>v(!1),onImported:f})]})}export{le as default}; +import{v as O,r as n,w as P,j as e,P as T,B as o,C as U,I as W,x as F,s as q,y,z as D,F as J,c as m}from"./index-CPMnKQBc.js";import K from"./ImageUploadField-DGJRkWaj.js";import{T as G}from"./TextStyleWidget-DGEJ-L-L.js";import{S as H,s as Z}from"./SortableList-Dgddukss.js";import{V as Q}from"./VehicleCatalogDialog-BmzJprBQ.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";const h={name:"",image_path:"",sort_order:0};function le(){const c=O(),[r,d]=n.useState(null),[g,$]=n.useState({}),[l,p]=n.useState(h),[B,j]=n.useState(h),[a,x]=n.useState(null),[z,b]=n.useState(""),[C,S]=n.useState(!1),[u,E]=n.useState(""),[I,v]=n.useState(!1),w=JSON.stringify(l)!==JSON.stringify(B);P(a!==null&&w,"brands");const f=()=>{m.get("/brands").then(d).catch(()=>d([])),m.get("/models").then(s=>$(s.reduce((t,i)=>({...t,[i.brand_id]:(t[i.brand_id]||0)+1}),{}))).catch(()=>{})};n.useEffect(()=>{f()},[]);const k=s=>{const t=s?{name:s.name,image_path:s.image_path||"",sort_order:s.sort_order}:h;x(s?s.id:"new"),p(t),j(t),b("")},M=()=>{w&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||(x(null),p(h),j(h))},R=async s=>{s.preventDefault(),b(""),S(!0);try{if(a!=="new")await m.put(`/brands/${a}`,l);else{const t=(r||[]).reduce((i,N)=>Math.max(i,Number(N.sort_order)||0),0)+10;await m.post("/brands",{...l,sort_order:t})}c.success(a!=="new"?"Marke gespeichert.":"Marke angelegt."),j(l),x(null),f()}catch(t){b(t.message)}finally{S(!1)}},L=async s=>{const t=g[s.id]||0,i=t>0?` und ${t} Modell${t===1?"":"e"} mit allen Paketen`:"";if(window.confirm(`„${s.name}“${i} wirklich löschen?`))try{await m.delete(`/brands/${s.id}`),a===s.id&&x(null),c.success("Marke gelöscht."),f()}catch(N){c.error(`Löschen fehlgeschlagen: ${N.message}`)}},V=async s=>{const t=r;d(s);try{d(await Z("brands",s)),c.success("Reihenfolge gespeichert.")}catch(i){d(t),c.error(`Reihenfolge konnte nicht gespeichert werden: ${i.message}`)}},_=n.useMemo(()=>{const s=u.trim().toLowerCase();return s?(r||[]).filter(t=>t.name.toLowerCase().includes(s)):r||[]},[r,u]),A=u.trim()!=="";return e.jsxs("div",{children:[e.jsx(T,{title:"Fahrzeugmarken",description:"Reihenfolge am Griff links per Ziehen ändern – so erscheinen die Marken auf der Website.",actions:e.jsxs(e.Fragment,{children:[e.jsx(o,{variant:"secondary",icon:"template",onClick:()=>v(!0),children:"Aus Vorlage laden"}),e.jsx(o,{icon:"plus",onClick:()=>k(null),children:"Neue Marke"})]})}),e.jsxs(U,{padded:!1,className:"overflow-hidden",children:[r!==null&&r.length>8&&e.jsx("div",{className:"border-b border-neutral-200 p-3 dark:border-neutral-800",children:e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(W,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),e.jsx(F,{value:u,onChange:s=>E(s.target.value),placeholder:"Marke suchen …",className:"h-9 pl-9"})]})}),r===null?e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[0,1,2,3].map(s=>e.jsxs("li",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsx("span",{className:"h-12 w-12 animate-pulse rounded-lg bg-neutral-100 dark:bg-neutral-800"}),e.jsx("span",{className:"h-4 w-40 animate-pulse rounded bg-neutral-100 dark:bg-neutral-800"})]},s))}):r.length===0?e.jsx(q,{icon:"tag",title:"Noch keine Marken",description:"Lege Marken einzeln an oder übernimm sie mit Modellen direkt aus der Fahrzeug-Vorlage.",actions:e.jsxs(e.Fragment,{children:[e.jsx(o,{variant:"secondary",icon:"template",onClick:()=>v(!0),children:"Aus Vorlage laden"}),e.jsx(o,{icon:"plus",onClick:()=>k(null),children:"Neue Marke"})]})}):_.length===0?e.jsxs("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Keine Marke passt zu „",u,"“."]}):e.jsx(H,{items:_,onReorder:V,disabled:A,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(s,t)=>e.jsxs("div",{className:`group flex items-center gap-3 bg-white px-3 py-2.5 transition hover:bg-neutral-50 dark:bg-neutral-900 dark:hover:bg-neutral-800/50 sm:gap-4 sm:px-4 ${a===s.id?"bg-brand-50/60 dark:bg-brand-900/20":""}`,children:[e.jsx("span",{className:"w-6 shrink-0",children:t}),e.jsxs("button",{type:"button",onClick:()=>k(s),className:"flex min-w-0 flex-1 items-center gap-4 text-left",children:[s.image_path?e.jsx("img",{src:s.image_path,alt:"",className:"h-12 w-12 shrink-0 rounded-lg border border-neutral-200 bg-white object-cover dark:border-neutral-700"}):e.jsx("span",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-sm font-bold text-neutral-400 dark:bg-neutral-800",children:s.name.slice(0,2).toUpperCase()}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:s.name}),e.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:g[s.id]?`${g[s.id]} Modell${g[s.id]===1?"":"e"}`:"Noch keine Modelle"})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx(y,{icon:"eye",label:"Auf der Website ansehen",href:`/fahrzeuge/${s.slug}`,target:"_blank",rel:"noopener noreferrer",className:"hidden sm:inline-flex"}),e.jsx(y,{icon:"pencil",label:"Bearbeiten",onClick:()=>k(s)}),e.jsx(y,{icon:"trash",label:"Löschen",tone:"danger",onClick:()=>L(s)})]})]})})]}),e.jsxs(D,{as:"form",onSubmit:R,open:a!==null,onClose:M,title:a==="new"?"Neue Marke":"Marke bearbeiten",description:a==="new"?"Erscheint danach unter „Fahrzeuge“ auf der Website.":void 0,footer:e.jsxs(e.Fragment,{children:[e.jsx(o,{variant:"secondary",onClick:M,children:"Abbrechen"}),e.jsx(o,{type:"submit",disabled:C||a!=="new"&&!w,children:C?"Speichere…":a==="new"?"Anlegen":"Speichern"})]}),children:[e.jsx(J,{label:"Name",required:!0,error:z,children:e.jsx(F,{required:!0,autoFocus:!0,value:l.name,onChange:s=>p({...l,name:s.target.value}),placeholder:"z. B. Volkswagen"})}),a!=="new"&&a!==null&&e.jsx(G,{fieldKey:`brands.${a}.name`,previewText:l.name||"Beispieltext"}),e.jsx(K,{value:l.image_path,onChange:s=>p({...l,image_path:s}),label:"Bild (optional)"})]}),e.jsx(Q,{open:I,onClose:()=>v(!1),onImported:f})]})}export{le as default}; diff --git a/hifi/assets/ConfirmEmail-DrPHnAcK.js b/hifi/assets/ConfirmEmail-fWy9MOY4.js similarity index 96% rename from hifi/assets/ConfirmEmail-DrPHnAcK.js rename to hifi/assets/ConfirmEmail-fWy9MOY4.js index dc2b3aa..7524773 100644 --- a/hifi/assets/ConfirmEmail-DrPHnAcK.js +++ b/hifi/assets/ConfirmEmail-fWy9MOY4.js @@ -1 +1 @@ -import{p as m,k as u,r as s,c as x,j as e,l as h,o as g,L as b}from"./index-eQrgtQRM.js";function k(){const[l]=m(),{user:a,refreshUser:i}=u(),[t,r]=s.useState("loading"),[o,d]=s.useState(""),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,x.post("/auth/email/confirm",{token:l.get("token")||""}).then(()=>{r("ok"),i().catch(()=>{})}).catch(c=>{d(c.message),r("error")}))},[]),e.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:[e.jsx("img",{src:h,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:g,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),e.jsxs("div",{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:[t==="loading"&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"E-Mail-Adresse wird bestätigt…"}),t==="ok"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"E-Mail-Adresse bestätigt"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Ab jetzt bekommst du beim Login einen Code an diese Adresse, sofern keine Authenticator-App eingerichtet ist."})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigung fehlgeschlagen"}),e.jsx("p",{className:"mb-6 text-sm text-red-600",children:o})]}),t!=="loading"&&e.jsx(b,{to:a?"/admin/account":"/admin/login",className:"block w-full rounded-md bg-brand-500 px-4 py-2.5 text-center text-sm font-semibold text-white hover:bg-brand-600",children:a?"Zu meinem Konto":"Zum Login"})]})]})}export{k as default}; +import{p as m,k as u,r as s,c as x,j as e,l as h,o as g,L as b}from"./index-CPMnKQBc.js";function k(){const[l]=m(),{user:a,refreshUser:i}=u(),[t,r]=s.useState("loading"),[o,d]=s.useState(""),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,x.post("/auth/email/confirm",{token:l.get("token")||""}).then(()=>{r("ok"),i().catch(()=>{})}).catch(c=>{d(c.message),r("error")}))},[]),e.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:[e.jsx("img",{src:h,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:g,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),e.jsxs("div",{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:[t==="loading"&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"E-Mail-Adresse wird bestätigt…"}),t==="ok"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"E-Mail-Adresse bestätigt"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Ab jetzt bekommst du beim Login einen Code an diese Adresse, sofern keine Authenticator-App eingerichtet ist."})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigung fehlgeschlagen"}),e.jsx("p",{className:"mb-6 text-sm text-red-600",children:o})]}),t!=="loading"&&e.jsx(b,{to:a?"/admin/account":"/admin/login",className:"block w-full rounded-md bg-brand-500 px-4 py-2.5 text-center text-sm font-semibold text-white hover:bg-brand-600",children:a?"Zu meinem Konto":"Zum Login"})]})]})}export{k as default}; diff --git a/hifi/assets/ConnectionSettings-BKoUzQPM.js b/hifi/assets/ConnectionSettings-BDljX48v.js similarity index 98% rename from hifi/assets/ConnectionSettings-BKoUzQPM.js rename to hifi/assets/ConnectionSettings-BDljX48v.js index 0081caa..390ad86 100644 --- a/hifi/assets/ConnectionSettings-BKoUzQPM.js +++ b/hifi/assets/ConnectionSettings-BDljX48v.js @@ -1 +1 @@ -import{r as g,j as e,c as p,L as k}from"./index-eQrgtQRM.js";const h=[{title:"Google",tests:[{key:"google_analytics",label:"Google Analytics (Zahlen im Admin)",settings:"/admin/settings/google"},{key:"google_tracking",label:"Google Analytics (Zählen auf der Website)",settings:"/admin/settings/google"},{key:"google_reviews",label:"Google-Bewertungen",settings:"/admin/settings/google"}]},{title:"Weitere Verbindungen",tests:[{key:"mail",label:"Mail-Server",settings:"/admin/settings/email"},{key:"database",label:"Datenbank",settings:"/admin/settings/database"},{key:"update_server",label:"Update-Server",settings:"/admin/settings/update"},{key:"audio4cars",label:"Audio4Cars-Preise",settings:"/admin/packages"}]}],b=h.flatMap(n=>n.tests.map(a=>a.key)),x={ok:{label:"Funktioniert",dot:"bg-green-500",text:"text-green-700 dark:text-green-400"},warning:{label:"Eingeschränkt",dot:"bg-amber-500",text:"text-amber-700 dark:text-amber-400"},error:{label:"Fehler",dot:"bg-red-500",text:"text-red-700 dark:text-red-400"},not_configured:{label:"Nicht eingerichtet",dot:"bg-neutral-400",text:"text-neutral-500 dark:text-neutral-400"}};function N(){const[n,a]=g.useState({}),[r,d]=g.useState({}),l=async t=>{d(s=>({...s,[t]:!0}));try{const s=await p.post("/settings/connection-test",{key:t});a(c=>({...c,[t]:s}))}catch(s){a(c=>({...c,[t]:{status:"error",message:s.message,details:[]}}))}finally{d(s=>({...s,[t]:!1}))}},o=()=>Promise.all(b.map(l)),i=Object.values(r).some(Boolean),m=b.filter(t=>n[t]),u=m.reduce((t,s)=>({...t,[n[s].status]:(t[n[s].status]||0)+1}),{});return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Teste…":"Alle testen"}),m.length>0&&!i&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["ok","warning","error","not_configured"].filter(t=>u[t]).map(t=>`${u[t]} × ${x[t].label.toLowerCase()}`).join(" · ")})]}),h.map(t=>e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"border-b border-neutral-200 px-6 py-3 font-semibold text-neutral-900 dark:border-neutral-800 dark:text-white",children:t.title}),e.jsx("ul",{className:"divide-y divide-neutral-200 dark:divide-neutral-800",children:t.tests.map(s=>e.jsx(j,{test:s,result:n[s.key],running:!!r[s.key],onRun:()=>l(s.key)},s.key))})]},t.title)),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Die Tests ändern nichts und verschicken keine Mails. Der Test der Google-Bewertungen zählt bei Google als ein Abruf."})]})}function j({test:n,result:a,running:r,onRun:d}){var o;const l=a?x[a.status]||x.error:null;return e.jsx("li",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full ${r?"animate-pulse bg-brand-500":l?l.dot:"bg-neutral-200 dark:bg-neutral-700"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:n.label}),r?e.jsx("span",{className:"text-xs text-neutral-500",children:"wird getestet…"}):l&&e.jsxs("span",{className:`text-xs font-semibold ${l.text}`,children:[l.label,a.duration_ms!=null&&e.jsxs("span",{className:"font-normal text-neutral-400",children:[" · ",(a.duration_ms/1e3).toFixed(1)," s"]})]})]}),a&&!r&&e.jsxs("div",{className:"mt-1 space-y-1 text-sm",children:[e.jsx("p",{className:"whitespace-pre-line break-words text-neutral-700 dark:text-neutral-300",children:a.message}),a.hint&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a.hint}),((o=a.details)==null?void 0:o.length)>0&&e.jsx("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs",children:a.details.map(i=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:i.label}),e.jsx("dd",{className:"break-all text-neutral-700 dark:text-neutral-300",children:i.value})]},i.label))})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[a&&a.status!=="ok"&&e.jsx(k,{to:n.settings,className:"text-sm text-neutral-500 underline hover:text-neutral-800 dark:hover:text-neutral-200",children:"Einstellungen"}),e.jsx("button",{type:"button",onClick:d,disabled:r,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Testen"})]})]})})}export{N as default}; +import{r as g,j as e,c as p,L as k}from"./index-CPMnKQBc.js";const h=[{title:"Google",tests:[{key:"google_analytics",label:"Google Analytics (Zahlen im Admin)",settings:"/admin/settings/google"},{key:"google_tracking",label:"Google Analytics (Zählen auf der Website)",settings:"/admin/settings/google"},{key:"google_reviews",label:"Google-Bewertungen",settings:"/admin/settings/google"}]},{title:"Weitere Verbindungen",tests:[{key:"mail",label:"Mail-Server",settings:"/admin/settings/email"},{key:"database",label:"Datenbank",settings:"/admin/settings/database"},{key:"update_server",label:"Update-Server",settings:"/admin/settings/update"},{key:"audio4cars",label:"Audio4Cars-Preise",settings:"/admin/packages"}]}],b=h.flatMap(n=>n.tests.map(a=>a.key)),x={ok:{label:"Funktioniert",dot:"bg-green-500",text:"text-green-700 dark:text-green-400"},warning:{label:"Eingeschränkt",dot:"bg-amber-500",text:"text-amber-700 dark:text-amber-400"},error:{label:"Fehler",dot:"bg-red-500",text:"text-red-700 dark:text-red-400"},not_configured:{label:"Nicht eingerichtet",dot:"bg-neutral-400",text:"text-neutral-500 dark:text-neutral-400"}};function N(){const[n,a]=g.useState({}),[r,d]=g.useState({}),l=async t=>{d(s=>({...s,[t]:!0}));try{const s=await p.post("/settings/connection-test",{key:t});a(c=>({...c,[t]:s}))}catch(s){a(c=>({...c,[t]:{status:"error",message:s.message,details:[]}}))}finally{d(s=>({...s,[t]:!1}))}},o=()=>Promise.all(b.map(l)),i=Object.values(r).some(Boolean),m=b.filter(t=>n[t]),u=m.reduce((t,s)=>({...t,[n[s].status]:(t[n[s].status]||0)+1}),{});return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Teste…":"Alle testen"}),m.length>0&&!i&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["ok","warning","error","not_configured"].filter(t=>u[t]).map(t=>`${u[t]} × ${x[t].label.toLowerCase()}`).join(" · ")})]}),h.map(t=>e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"border-b border-neutral-200 px-6 py-3 font-semibold text-neutral-900 dark:border-neutral-800 dark:text-white",children:t.title}),e.jsx("ul",{className:"divide-y divide-neutral-200 dark:divide-neutral-800",children:t.tests.map(s=>e.jsx(j,{test:s,result:n[s.key],running:!!r[s.key],onRun:()=>l(s.key)},s.key))})]},t.title)),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Die Tests ändern nichts und verschicken keine Mails. Der Test der Google-Bewertungen zählt bei Google als ein Abruf."})]})}function j({test:n,result:a,running:r,onRun:d}){var o;const l=a?x[a.status]||x.error:null;return e.jsx("li",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full ${r?"animate-pulse bg-brand-500":l?l.dot:"bg-neutral-200 dark:bg-neutral-700"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:n.label}),r?e.jsx("span",{className:"text-xs text-neutral-500",children:"wird getestet…"}):l&&e.jsxs("span",{className:`text-xs font-semibold ${l.text}`,children:[l.label,a.duration_ms!=null&&e.jsxs("span",{className:"font-normal text-neutral-400",children:[" · ",(a.duration_ms/1e3).toFixed(1)," s"]})]})]}),a&&!r&&e.jsxs("div",{className:"mt-1 space-y-1 text-sm",children:[e.jsx("p",{className:"whitespace-pre-line break-words text-neutral-700 dark:text-neutral-300",children:a.message}),a.hint&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a.hint}),((o=a.details)==null?void 0:o.length)>0&&e.jsx("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs",children:a.details.map(i=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:i.label}),e.jsx("dd",{className:"break-all text-neutral-700 dark:text-neutral-300",children:i.value})]},i.label))})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[a&&a.status!=="ok"&&e.jsx(k,{to:n.settings,className:"text-sm text-neutral-500 underline hover:text-neutral-800 dark:hover:text-neutral-200",children:"Einstellungen"}),e.jsx("button",{type:"button",onClick:d,disabled:r,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Testen"})]})]})})}export{N as default}; diff --git a/hifi/assets/ContactRequests-sFFVdlWu.js b/hifi/assets/ContactRequests-gigEl_0S.js similarity index 98% rename from hifi/assets/ContactRequests-sFFVdlWu.js rename to hifi/assets/ContactRequests-gigEl_0S.js index 764cd34..cfdd0cd 100644 --- a/hifi/assets/ContactRequests-sFFVdlWu.js +++ b/hifi/assets/ContactRequests-gigEl_0S.js @@ -1 +1 @@ -import{k as z,q as _,p as M,r,j as t,c as b}from"./index-eQrgtQRM.js";import{t as R,m as F,a as K,v as y}from"./contactRequests-Qfsfq7Lb.js";const D=s=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(s),S={new:"Neu",in_progress:"In Bearbeitung",done:"Erledigt"},P={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"},T=()=>t.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:t.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 U({request:s,onSaved:u}){const[d,p]=r.useState(s.internal_note||""),[i,l]=r.useState(!1),{toast:m}=_(),x=s.internal_note||"",g=async()=>{if(d!==x){l(!0);try{await b.patch(`/contact/${s.id}`,{internal_note:d}),u(s.id,{internal_note:d}),m.success("Notiz gespeichert.")}catch(o){m.error(`Notiz nicht gespeichert: ${o.message}`)}finally{l(!1)}}};return t.jsxs("div",{className:"mt-3",children:[t.jsxs("label",{className:"mb-1 block text-xs font-semibold uppercase tracking-wide text-neutral-400",htmlFor:`note-${s.id}`,children:["Interne Notiz ",i&&t.jsx("span",{className:"normal-case",children:"– speichert…"})]}),t.jsx("textarea",{id:`note-${s.id}`,rows:2,value:d,onChange:o=>p(o.target.value),onBlur:g,placeholder:"Nur für dein Team sichtbar, z. B. „Angebot geschickt am …“",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"})]})}function H(){const{hasPermission:s}=z(),{toast:u,refreshCounters:d}=_(),[p]=M(),i=p.get("id"),[l,m]=r.useState(null),[x,g]=r.useState(""),[o,A]=r.useState(i?"all":"new"),[j,E]=r.useState(""),f=r.useRef(null),L=()=>b.get("/contact").then(e=>{m(e),g("")}).catch(e=>g(e.message));r.useEffect(()=>{L()},[]),r.useEffect(()=>{i&&l&&f.current&&f.current.scrollIntoView({behavior:"smooth",block:"center"})},[i,l]);const k=(e,a)=>m(n=>n.map(c=>c.id===e?{...c,...a}:c)),$=async(e,a)=>{var c;const n=(c=l.find(v=>v.id===e))==null?void 0:c.status;k(e,{status:a});try{await b.patch(`/contact/${e}`,{status:a}),u.success(`Status: ${S[a]}`),d()}catch(v){k(e,{status:n}),u.error(`Status nicht geändert: ${v.message}`)}},C=async e=>{if(confirm("Diese Kontaktanfrage wirklich unwiderruflich löschen?"))try{await b.delete(`/contact/${e}`),m(a=>a.filter(n=>n.id!==e)),u.success("Anfrage gelöscht."),d()}catch(a){u.error(`Löschen fehlgeschlagen: ${a.message}`)}},h=l||[],B=r.useMemo(()=>({all:h.length,new:h.filter(e=>e.status==="new").length,in_progress:h.filter(e=>e.status==="in_progress").length,done:h.filter(e=>e.status==="done").length}),[h]),w=j.trim().toLowerCase(),N=h.filter(e=>o==="all"||e.status===o).filter(e=>!w||[e.name,e.email,e.phone,e.brand_name,e.model_name,e.package_name,e.message,e.internal_note].filter(Boolean).some(a=>String(a).toLowerCase().includes(w))),I=[{value:"new",label:"Neu"},{value:"in_progress",label:"In Bearbeitung"},{value:"done",label:"Erledigt"},{value:"all",label:"Alle"}];return t.jsxs("div",{children:[t.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Anfragen"}),t.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Anfragen aus dem Kontaktformular. Mit „Antworten“ öffnet sich dein E-Mail-Programm mit fertigem Betreff. Setze den Status auf „Erledigt“, wenn alles geklärt ist."}),t.jsxs("div",{className:"mb-5 flex flex-wrap items-center gap-2",children:[I.map(e=>t.jsxs("button",{onClick:()=>A(e.value),className:`rounded-full px-4 py-1.5 text-sm font-medium transition ${o===e.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:[e.label," (",B[e.value],")"]},e.value)),t.jsx("input",{type:"search",value:j,onChange:e=>E(e.target.value),placeholder:"Suchen: Name, Fahrzeug, Text…",className:"ml-auto w-full rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900 sm:w-64"})]}),x&&t.jsxs("p",{className:"mb-4 text-sm text-red-600",children:["Anfragen konnten nicht geladen werden: ",x]}),l===null&&!x&&t.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),t.jsxs("div",{className:"space-y-3",children:[N.map(e=>{var a;return t.jsxs("div",{ref:String(e.id)===i?f:void 0,className:`rounded-xl border bg-white p-4 dark:bg-neutral-900 ${String(e.id)===i?"border-brand-500 ring-2 ring-brand-500/30":"border-neutral-200 dark:border-neutral-800"}`,children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"font-semibold text-neutral-800 dark:text-neutral-100",children:e.name}),t.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[e.email,e.phone?` · ${e.phone}`:""]}),e.vin&&t.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["FIN: ",t.jsx("span",{className:"font-mono",children:e.vin})]}),t.jsx("p",{className:"text-xs text-neutral-400",title:new Date(e.created_at.replace(" ","T")).toLocaleString("de-DE"),children:R(e.created_at)})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("a",{href:F(e),className:"rounded-md bg-brand-500 px-3 py-1.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Antworten"}),e.phone&&t.jsx("a",{href:K(e.phone),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:"Anrufen"}),t.jsx("select",{value:e.status,onChange:n=>$(e.id,n.target.value),"aria-label":"Status",className:`rounded-full border-0 px-3 py-1.5 text-xs font-medium ${P[e.status]}`,children:Object.entries(S).map(([n,c])=>t.jsx("option",{value:n,children:c},n))}),s("contact.delete")&&t.jsx("button",{onClick:()=>C(e.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:t.jsx(T,{})})]})]}),(y(e)||e.product_name)&&t.jsx("p",{className:"mb-2 text-sm text-neutral-500 dark:text-neutral-400",children:[y(e),e.product_name].filter(Boolean).join(" · ")}),((a=e.selected_upgrades)==null?void 0:a.length)>0&&t.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:[t.jsx("p",{className:"font-semibold",children:"Gewünschte Upgrades:"}),t.jsx("ul",{className:"list-disc pl-5",children:e.selected_upgrades.map(n=>t.jsxs("li",{children:[n.name," – ",D(n.price)]},n.id))})]}),e.message&&t.jsx("p",{className:"whitespace-pre-line text-sm text-neutral-700 dark:text-neutral-300",children:e.message}),t.jsx(U,{request:e,onSaved:k})]},e.id)}),l!==null&&N.length===0&&t.jsx("p",{className:"text-neutral-400",children:w?"Keine Anfrage passt zur Suche.":o==="new"?"Keine neuen Anfragen – alles beantwortet.":o==="all"?"Noch keine Kontaktanfragen eingegangen.":"Keine Anfragen mit diesem Status."})]})]})}export{H as default}; +import{k as z,q as _,p as M,r,j as t,c as b}from"./index-CPMnKQBc.js";import{t as R,m as F,a as K,v as y}from"./contactRequests-Qfsfq7Lb.js";const D=s=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(s),S={new:"Neu",in_progress:"In Bearbeitung",done:"Erledigt"},P={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"},T=()=>t.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:t.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 U({request:s,onSaved:u}){const[d,p]=r.useState(s.internal_note||""),[i,l]=r.useState(!1),{toast:m}=_(),x=s.internal_note||"",g=async()=>{if(d!==x){l(!0);try{await b.patch(`/contact/${s.id}`,{internal_note:d}),u(s.id,{internal_note:d}),m.success("Notiz gespeichert.")}catch(o){m.error(`Notiz nicht gespeichert: ${o.message}`)}finally{l(!1)}}};return t.jsxs("div",{className:"mt-3",children:[t.jsxs("label",{className:"mb-1 block text-xs font-semibold uppercase tracking-wide text-neutral-400",htmlFor:`note-${s.id}`,children:["Interne Notiz ",i&&t.jsx("span",{className:"normal-case",children:"– speichert…"})]}),t.jsx("textarea",{id:`note-${s.id}`,rows:2,value:d,onChange:o=>p(o.target.value),onBlur:g,placeholder:"Nur für dein Team sichtbar, z. B. „Angebot geschickt am …“",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"})]})}function H(){const{hasPermission:s}=z(),{toast:u,refreshCounters:d}=_(),[p]=M(),i=p.get("id"),[l,m]=r.useState(null),[x,g]=r.useState(""),[o,A]=r.useState(i?"all":"new"),[j,E]=r.useState(""),f=r.useRef(null),L=()=>b.get("/contact").then(e=>{m(e),g("")}).catch(e=>g(e.message));r.useEffect(()=>{L()},[]),r.useEffect(()=>{i&&l&&f.current&&f.current.scrollIntoView({behavior:"smooth",block:"center"})},[i,l]);const k=(e,a)=>m(n=>n.map(c=>c.id===e?{...c,...a}:c)),$=async(e,a)=>{var c;const n=(c=l.find(v=>v.id===e))==null?void 0:c.status;k(e,{status:a});try{await b.patch(`/contact/${e}`,{status:a}),u.success(`Status: ${S[a]}`),d()}catch(v){k(e,{status:n}),u.error(`Status nicht geändert: ${v.message}`)}},C=async e=>{if(confirm("Diese Kontaktanfrage wirklich unwiderruflich löschen?"))try{await b.delete(`/contact/${e}`),m(a=>a.filter(n=>n.id!==e)),u.success("Anfrage gelöscht."),d()}catch(a){u.error(`Löschen fehlgeschlagen: ${a.message}`)}},h=l||[],B=r.useMemo(()=>({all:h.length,new:h.filter(e=>e.status==="new").length,in_progress:h.filter(e=>e.status==="in_progress").length,done:h.filter(e=>e.status==="done").length}),[h]),w=j.trim().toLowerCase(),N=h.filter(e=>o==="all"||e.status===o).filter(e=>!w||[e.name,e.email,e.phone,e.brand_name,e.model_name,e.package_name,e.message,e.internal_note].filter(Boolean).some(a=>String(a).toLowerCase().includes(w))),I=[{value:"new",label:"Neu"},{value:"in_progress",label:"In Bearbeitung"},{value:"done",label:"Erledigt"},{value:"all",label:"Alle"}];return t.jsxs("div",{children:[t.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Anfragen"}),t.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Anfragen aus dem Kontaktformular. Mit „Antworten“ öffnet sich dein E-Mail-Programm mit fertigem Betreff. Setze den Status auf „Erledigt“, wenn alles geklärt ist."}),t.jsxs("div",{className:"mb-5 flex flex-wrap items-center gap-2",children:[I.map(e=>t.jsxs("button",{onClick:()=>A(e.value),className:`rounded-full px-4 py-1.5 text-sm font-medium transition ${o===e.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:[e.label," (",B[e.value],")"]},e.value)),t.jsx("input",{type:"search",value:j,onChange:e=>E(e.target.value),placeholder:"Suchen: Name, Fahrzeug, Text…",className:"ml-auto w-full rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900 sm:w-64"})]}),x&&t.jsxs("p",{className:"mb-4 text-sm text-red-600",children:["Anfragen konnten nicht geladen werden: ",x]}),l===null&&!x&&t.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),t.jsxs("div",{className:"space-y-3",children:[N.map(e=>{var a;return t.jsxs("div",{ref:String(e.id)===i?f:void 0,className:`rounded-xl border bg-white p-4 dark:bg-neutral-900 ${String(e.id)===i?"border-brand-500 ring-2 ring-brand-500/30":"border-neutral-200 dark:border-neutral-800"}`,children:[t.jsxs("div",{className:"mb-2 flex flex-wrap items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"font-semibold text-neutral-800 dark:text-neutral-100",children:e.name}),t.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[e.email,e.phone?` · ${e.phone}`:""]}),e.vin&&t.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["FIN: ",t.jsx("span",{className:"font-mono",children:e.vin})]}),t.jsx("p",{className:"text-xs text-neutral-400",title:new Date(e.created_at.replace(" ","T")).toLocaleString("de-DE"),children:R(e.created_at)})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("a",{href:F(e),className:"rounded-md bg-brand-500 px-3 py-1.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Antworten"}),e.phone&&t.jsx("a",{href:K(e.phone),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:"Anrufen"}),t.jsx("select",{value:e.status,onChange:n=>$(e.id,n.target.value),"aria-label":"Status",className:`rounded-full border-0 px-3 py-1.5 text-xs font-medium ${P[e.status]}`,children:Object.entries(S).map(([n,c])=>t.jsx("option",{value:n,children:c},n))}),s("contact.delete")&&t.jsx("button",{onClick:()=>C(e.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:t.jsx(T,{})})]})]}),(y(e)||e.product_name)&&t.jsx("p",{className:"mb-2 text-sm text-neutral-500 dark:text-neutral-400",children:[y(e),e.product_name].filter(Boolean).join(" · ")}),((a=e.selected_upgrades)==null?void 0:a.length)>0&&t.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:[t.jsx("p",{className:"font-semibold",children:"Gewünschte Upgrades:"}),t.jsx("ul",{className:"list-disc pl-5",children:e.selected_upgrades.map(n=>t.jsxs("li",{children:[n.name," – ",D(n.price)]},n.id))})]}),e.message&&t.jsx("p",{className:"whitespace-pre-line text-sm text-neutral-700 dark:text-neutral-300",children:e.message}),t.jsx(U,{request:e,onSaved:k})]},e.id)}),l!==null&&N.length===0&&t.jsx("p",{className:"text-neutral-400",children:w?"Keine Anfrage passt zur Suche.":o==="new"?"Keine neuen Anfragen – alles beantwortet.":o==="all"?"Noch keine Kontaktanfragen eingegangen.":"Keine Anfragen mit diesem Status."})]})]})}export{H as default}; diff --git a/hifi/assets/CountdownSettings-De04QloC.js b/hifi/assets/CountdownSettings-iY834r7N.js similarity index 98% rename from hifi/assets/CountdownSettings-De04QloC.js rename to hifi/assets/CountdownSettings-iY834r7N.js index 73caa87..7b4ad12 100644 --- a/hifi/assets/CountdownSettings-De04QloC.js +++ b/hifi/assets/CountdownSettings-iY834r7N.js @@ -1 +1 @@ -import{r as s,c as j,j as e}from"./index-eQrgtQRM.js";const S={enabled:!1,launch_at:"",title:"",title_en:"",message:"",message_en:""},w=(t={})=>({enabled:!!t.enabled,launch_at:t.launch_at_local||"",title:t.title||"",title_en:t.title_en||"",message:t.message||"",message_en:t.message_en||""});function y(t){if(!t)return null;const n=new Date(t).getTime()-Date.now();if(Number.isNaN(n))return null;if(n<=0)return{past:!0,text:"Der Zeitpunkt liegt in der Vergangenheit – der Countdown wird Besuchern nicht angezeigt."};const d=Math.floor(n/6e4),i=Math.floor(d/1440),c=Math.floor(d%1440/60),h=d%60;return{past:!1,text:`Noch ${[i&&`${i} ${i===1?"Tag":"Tage"}`,c&&`${c} Std.`,`${h} Min.`].filter(Boolean).join(" ")} bis zum Start.`}}const u="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="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300";function C(){const[t,n]=s.useState(S),[d,i]=s.useState(!0),[c,h]=s.useState(!1),[g,x]=s.useState(!1),[p,f]=s.useState(""),[,N]=s.useState(0);s.useEffect(()=>{j.get("/maintenance").then(a=>n(w(a.countdown))).finally(()=>i(!1))},[]),s.useEffect(()=>{const a=setInterval(()=>N(r=>r+1),3e4);return()=>clearInterval(a)},[]);const l=(a,r)=>{n(v=>({...v,[a]:r})),x(!1)},k=async a=>{a.preventDefault(),h(!0),f(""),x(!1);try{const r=await j.post("/countdown",t);n(w(r.countdown)),x(!0)}catch(r){f(r.message)}finally{h(!1)}};if(d)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const o=y(t.launch_at),b=t.enabled&&o&&!o.past;return e.jsxs("form",{onSubmit:k,className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Countdown anzeigen"}),e.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:a=>l("enabled",a.target.checked),className:"peer sr-only"}),e.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),e.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Besucher sehen statt der Website nur den Countdown bis zum Start. Ist der Zeitpunkt erreicht, öffnet sich die Website automatisch – du musst nichts mehr ausschalten. Eingeloggt siehst du weiterhin die normale Seite."}),e.jsx("label",{className:m,htmlFor:"countdown-launch",children:"Start (deutsche Zeit)"}),e.jsx("input",{id:"countdown-launch",type:"datetime-local",value:t.launch_at,onChange:a=>l("launch_at",a.target.value),required:t.enabled,className:`${u} max-w-xs`}),o&&e.jsx("p",{className:`mt-2 text-sm ${o.past?"text-amber-600 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:o.text}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[e.jsxs("span",{className:`inline-flex items-center gap-2 rounded-full px-3 py-1 text-xs font-semibold ${b?"bg-brand-100 text-brand-700 dark:bg-brand-900/40 dark:text-brand-300":"bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${b?"bg-brand-500":"bg-neutral-400"}`}),b?"Besucher sehen den Countdown (nach dem Speichern)":"Besucher sehen die normale Website"]}),e.jsx("a",{href:"/?countdown=vorschau",target:"_blank",rel:"noreferrer",className:"text-sm font-medium text-brand-600 underline hover:text-brand-700 dark:text-brand-400",children:"Vorschau öffnen"})]})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Texte (optional)"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Leer lassen für die Standardtexte („Bald wird’s laut.“). Ohne englischen Text sehen englische Besucher den Standardtext."}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:m,htmlFor:"countdown-title",children:"Überschrift"}),e.jsx("input",{id:"countdown-title",maxLength:150,value:t.title,onChange:a=>l("title",a.target.value),placeholder:"Bald wird’s laut.",className:u})]}),e.jsxs("div",{children:[e.jsx("label",{className:m,htmlFor:"countdown-title-en",children:"Überschrift (Englisch)"}),e.jsx("input",{id:"countdown-title-en",maxLength:150,value:t.title_en,onChange:a=>l("title_en",a.target.value),placeholder:"Things are about to get loud.",className:u})]}),e.jsxs("div",{children:[e.jsx("label",{className:m,htmlFor:"countdown-message",children:"Text"}),e.jsx("textarea",{id:"countdown-message",rows:3,maxLength:500,value:t.message,onChange:a=>l("message",a.target.value),placeholder:"Wir drehen gerade die letzten Schrauben fest …",className:u})]}),e.jsxs("div",{children:[e.jsx("label",{className:m,htmlFor:"countdown-message-en",children:"Text (Englisch)"}),e.jsx("textarea",{id:"countdown-message-en",rows:3,maxLength:500,value:t.message_en,onChange:a=>l("message_en",a.target.value),placeholder:"We are tightening the last screws …",className:u})]})]})]}),p&&e.jsx("p",{className:"text-sm text-red-600",children:p}),g&&e.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"submit",disabled:c,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:c?"Speichere…":"Speichern"})]})}export{C as default}; +import{r as s,c as j,j as e}from"./index-CPMnKQBc.js";const S={enabled:!1,launch_at:"",title:"",title_en:"",message:"",message_en:""},w=(t={})=>({enabled:!!t.enabled,launch_at:t.launch_at_local||"",title:t.title||"",title_en:t.title_en||"",message:t.message||"",message_en:t.message_en||""});function y(t){if(!t)return null;const n=new Date(t).getTime()-Date.now();if(Number.isNaN(n))return null;if(n<=0)return{past:!0,text:"Der Zeitpunkt liegt in der Vergangenheit – der Countdown wird Besuchern nicht angezeigt."};const d=Math.floor(n/6e4),i=Math.floor(d/1440),c=Math.floor(d%1440/60),h=d%60;return{past:!1,text:`Noch ${[i&&`${i} ${i===1?"Tag":"Tage"}`,c&&`${c} Std.`,`${h} Min.`].filter(Boolean).join(" ")} bis zum Start.`}}const u="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="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300";function C(){const[t,n]=s.useState(S),[d,i]=s.useState(!0),[c,h]=s.useState(!1),[g,x]=s.useState(!1),[p,f]=s.useState(""),[,N]=s.useState(0);s.useEffect(()=>{j.get("/maintenance").then(a=>n(w(a.countdown))).finally(()=>i(!1))},[]),s.useEffect(()=>{const a=setInterval(()=>N(r=>r+1),3e4);return()=>clearInterval(a)},[]);const l=(a,r)=>{n(v=>({...v,[a]:r})),x(!1)},k=async a=>{a.preventDefault(),h(!0),f(""),x(!1);try{const r=await j.post("/countdown",t);n(w(r.countdown)),x(!0)}catch(r){f(r.message)}finally{h(!1)}};if(d)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const o=y(t.launch_at),b=t.enabled&&o&&!o.past;return e.jsxs("form",{onSubmit:k,className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Countdown anzeigen"}),e.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:a=>l("enabled",a.target.checked),className:"peer sr-only"}),e.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),e.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Besucher sehen statt der Website nur den Countdown bis zum Start. Ist der Zeitpunkt erreicht, öffnet sich die Website automatisch – du musst nichts mehr ausschalten. Eingeloggt siehst du weiterhin die normale Seite."}),e.jsx("label",{className:m,htmlFor:"countdown-launch",children:"Start (deutsche Zeit)"}),e.jsx("input",{id:"countdown-launch",type:"datetime-local",value:t.launch_at,onChange:a=>l("launch_at",a.target.value),required:t.enabled,className:`${u} max-w-xs`}),o&&e.jsx("p",{className:`mt-2 text-sm ${o.past?"text-amber-600 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:o.text}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[e.jsxs("span",{className:`inline-flex items-center gap-2 rounded-full px-3 py-1 text-xs font-semibold ${b?"bg-brand-100 text-brand-700 dark:bg-brand-900/40 dark:text-brand-300":"bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"}`,children:[e.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${b?"bg-brand-500":"bg-neutral-400"}`}),b?"Besucher sehen den Countdown (nach dem Speichern)":"Besucher sehen die normale Website"]}),e.jsx("a",{href:"/?countdown=vorschau",target:"_blank",rel:"noreferrer",className:"text-sm font-medium text-brand-600 underline hover:text-brand-700 dark:text-brand-400",children:"Vorschau öffnen"})]})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Texte (optional)"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Leer lassen für die Standardtexte („Bald wird’s laut.“). Ohne englischen Text sehen englische Besucher den Standardtext."}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:m,htmlFor:"countdown-title",children:"Überschrift"}),e.jsx("input",{id:"countdown-title",maxLength:150,value:t.title,onChange:a=>l("title",a.target.value),placeholder:"Bald wird’s laut.",className:u})]}),e.jsxs("div",{children:[e.jsx("label",{className:m,htmlFor:"countdown-title-en",children:"Überschrift (Englisch)"}),e.jsx("input",{id:"countdown-title-en",maxLength:150,value:t.title_en,onChange:a=>l("title_en",a.target.value),placeholder:"Things are about to get loud.",className:u})]}),e.jsxs("div",{children:[e.jsx("label",{className:m,htmlFor:"countdown-message",children:"Text"}),e.jsx("textarea",{id:"countdown-message",rows:3,maxLength:500,value:t.message,onChange:a=>l("message",a.target.value),placeholder:"Wir drehen gerade die letzten Schrauben fest …",className:u})]}),e.jsxs("div",{children:[e.jsx("label",{className:m,htmlFor:"countdown-message-en",children:"Text (Englisch)"}),e.jsx("textarea",{id:"countdown-message-en",rows:3,maxLength:500,value:t.message_en,onChange:a=>l("message_en",a.target.value),placeholder:"We are tightening the last screws …",className:u})]})]})]}),p&&e.jsx("p",{className:"text-sm text-red-600",children:p}),g&&e.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"submit",disabled:c,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:c?"Speichere…":"Speichern"})]})}export{C as default}; diff --git a/hifi/assets/Dashboard-Bb-z9N4S.js b/hifi/assets/Dashboard-CfZCB0xB.js similarity index 99% rename from hifi/assets/Dashboard-Bb-z9N4S.js rename to hifi/assets/Dashboard-CfZCB0xB.js index b0e8e19..4299ee4 100644 --- a/hifi/assets/Dashboard-Bb-z9N4S.js +++ b/hifi/assets/Dashboard-CfZCB0xB.js @@ -1 +1 @@ -import{k,r as c,c as m,j as e,L as b,q as j,S as N}from"./index-eQrgtQRM.js";import{I as w}from"./ImageOptimizer-Cv-egAvW.js";import{t as v,v as y,m as A}from"./contactRequests-Qfsfq7Lb.js";function S(){const[a,t]=c.useState(null),[n,x]=c.useState(null),[u,r]=c.useState(""),{toast:h,refreshCounters:f}=j();c.useEffect(()=>{m.get("/site-settings").then(l=>t(l.hidden_areas||[])).catch(l=>r(l.message))},[]);const g=async l=>{const s=l.key,d=!a.includes(s);if(d&&s.startsWith("page.")&&!window.confirm(`„${l.label}“ wirklich für alle Besucher ausblenden? Die Seite verschwindet sofort aus dem Menü.`))return;const o=a,p=d?[...a,s]:a.filter(i=>i!==s);t(p),x(s),r("");try{const i=await m.put("/site-settings/visibility",{hidden_areas:p});t(i.hidden_areas),h.success(d?`„${l.label}“ ist jetzt ausgeblendet.`:`„${l.label}“ ist wieder sichtbar.`),f()}catch(i){t(o),r(i.message),h.error(i.message)}finally{x(null)}};return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Sichtbarkeit der Website"}),e.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Schalte Bereiche aus, die Besucher gerade nicht sehen sollen. Die Inhalte bleiben gespeichert und sind nach dem Wiedereinschalten sofort wieder da. Änderungen gelten sofort."}),u&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:u}),a===null?!u&&e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):e.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:N.map(l=>e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:l.title}),e.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:l.hint}),e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:l.areas.map(s=>{const d=!a.includes(s.key);return e.jsxs("li",{className:"flex items-center justify-between gap-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:`text-sm font-medium ${d?"text-neutral-800 dark:text-neutral-100":"text-neutral-400 line-through dark:text-neutral-500"}`,children:s.label}),s.note&&e.jsx("p",{className:"text-xs text-neutral-400",children:s.note})]}),e.jsxs("label",{className:"relative inline-flex shrink-0 cursor-pointer items-center",title:d?"Sichtbar – zum Ausblenden klicken":"Ausgeblendet – zum Einblenden klicken",children:[e.jsxs("span",{className:"sr-only",children:[s.label," sichtbar"]}),e.jsx("input",{type:"checkbox",checked:d,disabled:n!==null,onChange:()=>g(s),className:"peer sr-only"}),e.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 peer-disabled:opacity-60 dark:bg-neutral-700"}),e.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]},s.key)})})]},l.title))})]})}function _(){const[a,t]=c.useState(null),[n,x]=c.useState("");if(c.useEffect(()=>{m.get("/analytics/report").then(t).catch(r=>x(r.message))},[]),n)return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),e.jsx("p",{className:"text-sm text-red-600",children:n})]});if(!a)return null;if(!a.configured)return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),e.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Noch nicht eingerichtet. Unter"," ",e.jsx(b,{to:"/admin/settings/google",className:"text-brand-600 hover:underline dark:text-brand-400",children:"System → Google-Dienste"})," ","kannst du die Dashboard-Anbindung konfigurieren, um hier Besucherzahlen zu sehen."]})]});const u=Math.max(1,...a.daily.map(r=>r.pageviews));return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),e.jsx(b,{to:"/admin/traffic",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Details & Trends →"})]}),e.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Letzte 7 Tage."}),e.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:a.totals.users}),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Nutzer"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:a.totals.sessions}),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Sitzungen"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:a.totals.pageviews}),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Seitenaufrufe"})]})]}),a.daily.length>0&&e.jsx("div",{className:"mb-6 flex h-24 items-end gap-1.5",children:a.daily.map(r=>e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"w-full rounded-t bg-brand-400 dark:bg-brand-500",style:{height:`${Math.max(4,r.pageviews/u*80)}px`},title:`${r.date}: ${r.pageviews} Seitenaufrufe`}),e.jsxs("span",{className:"text-[10px] text-neutral-400",children:[r.date.slice(6,8),".",r.date.slice(4,6),"."]})]},r.date))}),a.top_pages.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Meistbesuchte Seiten"}),e.jsx("ul",{className:"space-y-1 text-sm",children:a.top_pages.map(r=>e.jsxs("li",{className:"flex items-center justify-between gap-3 text-neutral-700 dark:text-neutral-300",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:r.path}),e.jsx("span",{className:"shrink-0 font-semibold",children:r.pageviews})]},r.path))})]})]})}function z({requests:a}){if(a===null)return null;const t=a.filter(n=>n.status==="new");return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-4 flex flex-wrap items-baseline justify-between gap-2",children:[e.jsxs("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:["Neue Anfragen ",t.length>0&&e.jsx("span",{className:"ml-1 rounded-full bg-red-500 px-2 py-0.5 text-xs font-bold text-white",children:t.length})]}),e.jsx(b,{to:"/admin/contact-requests",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Alle Anfragen →"})]}),t.length===0?e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Keine offenen Anfragen – alles beantwortet. 👍"}):e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:t.slice(0,5).map(n=>e.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"font-medium text-neutral-900 dark:text-white",children:[n.name," ",e.jsxs("span",{className:"text-xs font-normal text-neutral-400",children:["· ",v(n.created_at)]})]}),e.jsx("p",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:y(n)||(n.message?n.message.slice(0,80):"Allgemeine Anfrage")})]}),e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsx("a",{href:A(n),className:"rounded-md bg-brand-500 px-3 py-1.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Antworten"}),e.jsx(b,{to:`/admin/contact-requests?id=${n.id}`,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:"Öffnen"})]})]},n.id))})]})}function W({hasPermission:a}){const t=[{to:"/admin/packages",label:"Pakete bearbeiten",show:a("packages.manage")},{to:"/admin/gallery-projects",label:"Galerie-Fotos hochladen",show:a("gallery.manage")},{to:"/admin/home-sections",label:"Startseiten-Texte ändern",show:a("content.manage")},{to:"/admin/settings/company",label:"Öffnungszeiten & Kontakt",show:a("settings.manage")},{to:"/admin/settings/maintenance",label:"Wartungsmodus",show:a("settings.manage")},{to:"/admin/settings/countdown",label:"Launch-Countdown",show:a("settings.manage")}].filter(n=>n.show);return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-3 font-semibold text-neutral-900 dark:text-white",children:"Schnellzugriff"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.map(n=>e.jsx(b,{to:n.to,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm font-medium text-neutral-700 hover:border-brand-500 hover:text-brand-600 dark:border-neutral-700 dark:text-neutral-200",children:n.label},n.to)),e.jsx("a",{href:"/",target:"_blank",rel:"noopener noreferrer",className:"rounded-md border border-neutral-300 px-3 py-2 text-sm font-medium text-neutral-700 hover:border-brand-500 hover:text-brand-600 dark:border-neutral-700 dark:text-neutral-200",children:"Website ansehen ↗"}),["content.manage","services.manage","packages.manage","gallery.manage","settings.manage"].some(a)&&e.jsx("a",{href:"/?bearbeiten=1",target:"_blank",rel:"noopener noreferrer",className:"rounded-md bg-brand-500 px-3 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"✎ Website live bearbeiten ↗"})]})]})}function B(){const{user:a,hasPermission:t}=k(),[n,x]=c.useState({}),[u,r]=c.useState(null),[h,f]=c.useState([]);c.useEffect(()=>{t("brands.manage")&&m.get("/brands").then(d=>x(o=>({...o,brands:d.length}))).catch(()=>{}),t("contact.manage")&&m.get("/contact").then(r).catch(()=>r([]));const s=t("models.manage")||t("packages.manage");s&&m.get("/models").then(d=>x(o=>({...o,models:d.length}))).catch(()=>{}),t("packages.manage")&&m.get("/packages").then(d=>x(o=>({...o,packages:d.length}))).catch(()=>{}),s&&t("packages.manage")&&Promise.all([m.get("/models"),m.get("/packages")]).then(([d,o])=>{const p=new Set(o.filter(i=>!i.is_hidden).map(i=>i.car_model_id));f(d.filter(i=>!p.has(i.id)))}).catch(()=>{})},[]);const g=[{key:"brands",label:"Fahrzeugmarken",value:n.brands,to:"/admin/brands",show:t("brands.manage")},{key:"models",label:"Modelle",value:n.models,to:"/admin/models",show:t("models.manage")},{key:"packages",label:"Pakete",value:n.packages,to:"/admin/packages",show:t("packages.manage")}].filter(s=>s.show),l=g.length===0&&!t("contact.manage")&&!t("content.manage")&&!t("settings.manage")&&!t("gallery.manage");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:["Willkommen, ",a==null?void 0:a.username,"!"]}),e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Das Wichtigste zuerst: offene Anfragen, Hinweise und die häufigsten Aufgaben."})]}),l&&e.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."}),t("contact.manage")&&e.jsx(z,{requests:u}),h.length>0&&e.jsxs("section",{className:"rounded-xl border border-amber-200 bg-amber-50 p-5 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-200",children:[e.jsxs("p",{className:"font-semibold",children:["Hinweis: ",h.length," Modell",h.length===1?"":"e"," ohne sichtbares Paket"]}),e.jsxs("p",{className:"mt-1",children:["Kunden sehen dort nur „noch keine Pakete“ und einen Anfrage-Knopf:"," ",h.slice(0,6).map(s=>`${s.brand_name||""} ${s.name}`.trim()).join(", "),h.length>6?" …":"","."," ",e.jsx(b,{to:"/admin/packages",className:"underline",children:"Pakete anlegen"})]})]}),e.jsx(W,{hasPermission:t}),(t("content.manage")||t("settings.manage"))&&e.jsx(S,{}),t("system.admin")&&e.jsx(_,{}),(t("gallery.manage")||t("settings.manage"))&&e.jsx(w,{compact:!0}),g.length>0&&e.jsxs("section",{children:[e.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Bestand"}),e.jsx("div",{className:"flex flex-wrap gap-3",children:g.map(s=>e.jsxs(b,{to:s.to,className:"rounded-lg border border-neutral-200 bg-white px-4 py-2 text-sm hover:border-brand-500 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("span",{className:"font-bold text-brand-600 dark:text-brand-400",children:s.value??"…"})," ",e.jsx("span",{className:"text-neutral-600 dark:text-neutral-300",children:s.label})]},s.key))})]})]})}export{B as default}; +import{k,r as c,c as m,j as e,L as b,q as j,S as N}from"./index-CPMnKQBc.js";import{I as w}from"./ImageOptimizer-C38AVHT-.js";import{t as v,v as y,m as A}from"./contactRequests-Qfsfq7Lb.js";function S(){const[a,t]=c.useState(null),[n,x]=c.useState(null),[u,r]=c.useState(""),{toast:h,refreshCounters:f}=j();c.useEffect(()=>{m.get("/site-settings").then(l=>t(l.hidden_areas||[])).catch(l=>r(l.message))},[]);const g=async l=>{const s=l.key,d=!a.includes(s);if(d&&s.startsWith("page.")&&!window.confirm(`„${l.label}“ wirklich für alle Besucher ausblenden? Die Seite verschwindet sofort aus dem Menü.`))return;const o=a,p=d?[...a,s]:a.filter(i=>i!==s);t(p),x(s),r("");try{const i=await m.put("/site-settings/visibility",{hidden_areas:p});t(i.hidden_areas),h.success(d?`„${l.label}“ ist jetzt ausgeblendet.`:`„${l.label}“ ist wieder sichtbar.`),f()}catch(i){t(o),r(i.message),h.error(i.message)}finally{x(null)}};return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Sichtbarkeit der Website"}),e.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Schalte Bereiche aus, die Besucher gerade nicht sehen sollen. Die Inhalte bleiben gespeichert und sind nach dem Wiedereinschalten sofort wieder da. Änderungen gelten sofort."}),u&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:u}),a===null?!u&&e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):e.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:N.map(l=>e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:l.title}),e.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:l.hint}),e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:l.areas.map(s=>{const d=!a.includes(s.key);return e.jsxs("li",{className:"flex items-center justify-between gap-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:`text-sm font-medium ${d?"text-neutral-800 dark:text-neutral-100":"text-neutral-400 line-through dark:text-neutral-500"}`,children:s.label}),s.note&&e.jsx("p",{className:"text-xs text-neutral-400",children:s.note})]}),e.jsxs("label",{className:"relative inline-flex shrink-0 cursor-pointer items-center",title:d?"Sichtbar – zum Ausblenden klicken":"Ausgeblendet – zum Einblenden klicken",children:[e.jsxs("span",{className:"sr-only",children:[s.label," sichtbar"]}),e.jsx("input",{type:"checkbox",checked:d,disabled:n!==null,onChange:()=>g(s),className:"peer sr-only"}),e.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 peer-disabled:opacity-60 dark:bg-neutral-700"}),e.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]},s.key)})})]},l.title))})]})}function _(){const[a,t]=c.useState(null),[n,x]=c.useState("");if(c.useEffect(()=>{m.get("/analytics/report").then(t).catch(r=>x(r.message))},[]),n)return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),e.jsx("p",{className:"text-sm text-red-600",children:n})]});if(!a)return null;if(!a.configured)return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),e.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Noch nicht eingerichtet. Unter"," ",e.jsx(b,{to:"/admin/settings/google",className:"text-brand-600 hover:underline dark:text-brand-400",children:"System → Google-Dienste"})," ","kannst du die Dashboard-Anbindung konfigurieren, um hier Besucherzahlen zu sehen."]})]});const u=Math.max(1,...a.daily.map(r=>r.pageviews));return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),e.jsx(b,{to:"/admin/traffic",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Details & Trends →"})]}),e.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Letzte 7 Tage."}),e.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:a.totals.users}),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Nutzer"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:a.totals.sessions}),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Sitzungen"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:a.totals.pageviews}),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Seitenaufrufe"})]})]}),a.daily.length>0&&e.jsx("div",{className:"mb-6 flex h-24 items-end gap-1.5",children:a.daily.map(r=>e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("div",{className:"w-full rounded-t bg-brand-400 dark:bg-brand-500",style:{height:`${Math.max(4,r.pageviews/u*80)}px`},title:`${r.date}: ${r.pageviews} Seitenaufrufe`}),e.jsxs("span",{className:"text-[10px] text-neutral-400",children:[r.date.slice(6,8),".",r.date.slice(4,6),"."]})]},r.date))}),a.top_pages.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Meistbesuchte Seiten"}),e.jsx("ul",{className:"space-y-1 text-sm",children:a.top_pages.map(r=>e.jsxs("li",{className:"flex items-center justify-between gap-3 text-neutral-700 dark:text-neutral-300",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:r.path}),e.jsx("span",{className:"shrink-0 font-semibold",children:r.pageviews})]},r.path))})]})]})}function z({requests:a}){if(a===null)return null;const t=a.filter(n=>n.status==="new");return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-4 flex flex-wrap items-baseline justify-between gap-2",children:[e.jsxs("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:["Neue Anfragen ",t.length>0&&e.jsx("span",{className:"ml-1 rounded-full bg-red-500 px-2 py-0.5 text-xs font-bold text-white",children:t.length})]}),e.jsx(b,{to:"/admin/contact-requests",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Alle Anfragen →"})]}),t.length===0?e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Keine offenen Anfragen – alles beantwortet. 👍"}):e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:t.slice(0,5).map(n=>e.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-3 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"font-medium text-neutral-900 dark:text-white",children:[n.name," ",e.jsxs("span",{className:"text-xs font-normal text-neutral-400",children:["· ",v(n.created_at)]})]}),e.jsx("p",{className:"truncate text-sm text-neutral-500 dark:text-neutral-400",children:y(n)||(n.message?n.message.slice(0,80):"Allgemeine Anfrage")})]}),e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsx("a",{href:A(n),className:"rounded-md bg-brand-500 px-3 py-1.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Antworten"}),e.jsx(b,{to:`/admin/contact-requests?id=${n.id}`,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:"Öffnen"})]})]},n.id))})]})}function W({hasPermission:a}){const t=[{to:"/admin/packages",label:"Pakete bearbeiten",show:a("packages.manage")},{to:"/admin/gallery-projects",label:"Galerie-Fotos hochladen",show:a("gallery.manage")},{to:"/admin/home-sections",label:"Startseiten-Texte ändern",show:a("content.manage")},{to:"/admin/settings/company",label:"Öffnungszeiten & Kontakt",show:a("settings.manage")},{to:"/admin/settings/maintenance",label:"Wartungsmodus",show:a("settings.manage")},{to:"/admin/settings/countdown",label:"Launch-Countdown",show:a("settings.manage")}].filter(n=>n.show);return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-3 font-semibold text-neutral-900 dark:text-white",children:"Schnellzugriff"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.map(n=>e.jsx(b,{to:n.to,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm font-medium text-neutral-700 hover:border-brand-500 hover:text-brand-600 dark:border-neutral-700 dark:text-neutral-200",children:n.label},n.to)),e.jsx("a",{href:"/",target:"_blank",rel:"noopener noreferrer",className:"rounded-md border border-neutral-300 px-3 py-2 text-sm font-medium text-neutral-700 hover:border-brand-500 hover:text-brand-600 dark:border-neutral-700 dark:text-neutral-200",children:"Website ansehen ↗"}),["content.manage","services.manage","packages.manage","gallery.manage","settings.manage"].some(a)&&e.jsx("a",{href:"/?bearbeiten=1",target:"_blank",rel:"noopener noreferrer",className:"rounded-md bg-brand-500 px-3 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"✎ Website live bearbeiten ↗"})]})]})}function B(){const{user:a,hasPermission:t}=k(),[n,x]=c.useState({}),[u,r]=c.useState(null),[h,f]=c.useState([]);c.useEffect(()=>{t("brands.manage")&&m.get("/brands").then(d=>x(o=>({...o,brands:d.length}))).catch(()=>{}),t("contact.manage")&&m.get("/contact").then(r).catch(()=>r([]));const s=t("models.manage")||t("packages.manage");s&&m.get("/models").then(d=>x(o=>({...o,models:d.length}))).catch(()=>{}),t("packages.manage")&&m.get("/packages").then(d=>x(o=>({...o,packages:d.length}))).catch(()=>{}),s&&t("packages.manage")&&Promise.all([m.get("/models"),m.get("/packages")]).then(([d,o])=>{const p=new Set(o.filter(i=>!i.is_hidden).map(i=>i.car_model_id));f(d.filter(i=>!p.has(i.id)))}).catch(()=>{})},[]);const g=[{key:"brands",label:"Fahrzeugmarken",value:n.brands,to:"/admin/brands",show:t("brands.manage")},{key:"models",label:"Modelle",value:n.models,to:"/admin/models",show:t("models.manage")},{key:"packages",label:"Pakete",value:n.packages,to:"/admin/packages",show:t("packages.manage")}].filter(s=>s.show),l=g.length===0&&!t("contact.manage")&&!t("content.manage")&&!t("settings.manage")&&!t("gallery.manage");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:["Willkommen, ",a==null?void 0:a.username,"!"]}),e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Das Wichtigste zuerst: offene Anfragen, Hinweise und die häufigsten Aufgaben."})]}),l&&e.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."}),t("contact.manage")&&e.jsx(z,{requests:u}),h.length>0&&e.jsxs("section",{className:"rounded-xl border border-amber-200 bg-amber-50 p-5 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-200",children:[e.jsxs("p",{className:"font-semibold",children:["Hinweis: ",h.length," Modell",h.length===1?"":"e"," ohne sichtbares Paket"]}),e.jsxs("p",{className:"mt-1",children:["Kunden sehen dort nur „noch keine Pakete“ und einen Anfrage-Knopf:"," ",h.slice(0,6).map(s=>`${s.brand_name||""} ${s.name}`.trim()).join(", "),h.length>6?" …":"","."," ",e.jsx(b,{to:"/admin/packages",className:"underline",children:"Pakete anlegen"})]})]}),e.jsx(W,{hasPermission:t}),(t("content.manage")||t("settings.manage"))&&e.jsx(S,{}),t("system.admin")&&e.jsx(_,{}),(t("gallery.manage")||t("settings.manage"))&&e.jsx(w,{compact:!0}),g.length>0&&e.jsxs("section",{children:[e.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Bestand"}),e.jsx("div",{className:"flex flex-wrap gap-3",children:g.map(s=>e.jsxs(b,{to:s.to,className:"rounded-lg border border-neutral-200 bg-white px-4 py-2 text-sm hover:border-brand-500 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("span",{className:"font-bold text-brand-600 dark:text-brand-400",children:s.value??"…"})," ",e.jsx("span",{className:"text-neutral-600 dark:text-neutral-300",children:s.label})]},s.key))})]})]})}export{B as default}; diff --git a/hifi/assets/DatabaseSettings-DCm6bks9.js b/hifi/assets/DatabaseSettings-Da6s1jBa.js similarity index 98% rename from hifi/assets/DatabaseSettings-DCm6bks9.js rename to hifi/assets/DatabaseSettings-Da6s1jBa.js index 2ddda3a..66e0b88 100644 --- a/hifi/assets/DatabaseSettings-DCm6bks9.js +++ b/hifi/assets/DatabaseSettings-Da6s1jBa.js @@ -1 +1 @@ -import{r as a,j as e,c as i}from"./index-eQrgtQRM.js";import{I as T}from"./ImageOptimizer-Cv-egAvW.js";function F(){const[r,n]=a.useState({host:"",name:"",user:"",password:"",charset:"utf8mb4"}),[m,b]=a.useState(!1),[y,x]=a.useState(!0),[h,C]=a.useState(!1),[g,p]=a.useState(!1),[k,f]=a.useState(""),[D,j]=a.useState(!1),[s,o]=a.useState(null),[d,w]=a.useState(!0),[v,N]=a.useState(!1),[S,u]=a.useState(null),P=()=>{x(!0),i.get("/settings/database").then(t=>{n({...t.config,password:""}),b(t.has_password)}).finally(()=>x(!1))},c=()=>{w(!0),i.get("/settings/schema-check").then(o).catch(t=>o({ok:!1,error:t.message,tables:[]})).finally(()=>w(!1))};a.useEffect(()=>{P(),c()},[]);const E=async()=>{N(!0),u(null);try{const t=await i.post("/settings/schema-migrate",{});u(t.actions),o(t.report)}catch(t){u(["Fehler: "+t.message])}finally{N(!1)}},z=async t=>{t.preventDefault(),p(!0),f(""),j(!1);try{await i.post("/settings/database",r),j(!0),n(l=>({...l,password:""})),b(!0),c()}catch(l){f(l.message)}finally{p(!1)}};return e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),e.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."}),y?e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):e.jsxs("form",{onSubmit:z,className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Host *"}),e.jsx("input",{required:!0,value:r.host,onChange:t=>n({...r,host: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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datenbankname *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>n({...r,name: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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzer *"}),e.jsx("input",{required:!0,value:r.user,onChange:t=>n({...r,user: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"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",m?"(leer lassen = unverändert)":""]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:h?"text":"password",value:r.password,onChange:t=>n({...r,password:t.target.value}),placeholder:m?"••••••••":"",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"}),e.jsx("button",{type:"button",onClick:()=>C(t=>!t),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:h?"Verbergen":"Anzeigen"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Zeichensatz"}),e.jsx("input",{value:r.charset,onChange:t=>n({...r,charset: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"})]}),k&&e.jsx("p",{className:"text-sm text-red-600",children:k}),D&&e.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Verbindung erfolgreich getestet und gespeichert."}),e.jsx("button",{type:"submit",disabled:g,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:g?"Teste & speichere…":"Verbindung testen & speichern"})]})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),!d&&s&&e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${s.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:s.ok?"Datenbank OK":"Datenbank nicht OK"})]}),e.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."}),d&&e.jsx("p",{className:"text-sm text-neutral-400",children:"Prüfe…"}),!d&&s&&!s.ok&&e.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:s.tables.filter(t=>!t.ok).map(t=>e.jsx("li",{children:t.exists?e.jsxs(e.Fragment,{children:["Tabelle ",e.jsx("code",{className:"font-mono",children:t.table}),": Spalte(n) fehlen – ",t.missing_columns.join(", ")]}):e.jsxs(e.Fragment,{children:["Tabelle ",e.jsx("code",{className:"font-mono",children:t.table})," fehlt komplett"]})},t.table))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{onClick:c,disabled:d,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"}),s&&!s.ok&&e.jsx("button",{onClick:E,disabled: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:v?"Aktualisiere…":"Datenbankstruktur aktualisieren"})]}),S&&e.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:S.map((t,l)=>e.jsx("li",{children:t},l))})]}),e.jsx(T,{})]})}export{F as default}; +import{r as a,j as e,c as i}from"./index-CPMnKQBc.js";import{I as T}from"./ImageOptimizer-C38AVHT-.js";function F(){const[r,n]=a.useState({host:"",name:"",user:"",password:"",charset:"utf8mb4"}),[m,b]=a.useState(!1),[y,x]=a.useState(!0),[h,C]=a.useState(!1),[g,p]=a.useState(!1),[k,f]=a.useState(""),[D,j]=a.useState(!1),[s,o]=a.useState(null),[d,w]=a.useState(!0),[v,N]=a.useState(!1),[S,u]=a.useState(null),P=()=>{x(!0),i.get("/settings/database").then(t=>{n({...t.config,password:""}),b(t.has_password)}).finally(()=>x(!1))},c=()=>{w(!0),i.get("/settings/schema-check").then(o).catch(t=>o({ok:!1,error:t.message,tables:[]})).finally(()=>w(!1))};a.useEffect(()=>{P(),c()},[]);const E=async()=>{N(!0),u(null);try{const t=await i.post("/settings/schema-migrate",{});u(t.actions),o(t.report)}catch(t){u(["Fehler: "+t.message])}finally{N(!1)}},z=async t=>{t.preventDefault(),p(!0),f(""),j(!1);try{await i.post("/settings/database",r),j(!0),n(l=>({...l,password:""})),b(!0),c()}catch(l){f(l.message)}finally{p(!1)}};return e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),e.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."}),y?e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):e.jsxs("form",{onSubmit:z,className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Host *"}),e.jsx("input",{required:!0,value:r.host,onChange:t=>n({...r,host: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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datenbankname *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>n({...r,name: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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzer *"}),e.jsx("input",{required:!0,value:r.user,onChange:t=>n({...r,user: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"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",m?"(leer lassen = unverändert)":""]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:h?"text":"password",value:r.password,onChange:t=>n({...r,password:t.target.value}),placeholder:m?"••••••••":"",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"}),e.jsx("button",{type:"button",onClick:()=>C(t=>!t),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:h?"Verbergen":"Anzeigen"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Zeichensatz"}),e.jsx("input",{value:r.charset,onChange:t=>n({...r,charset: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"})]}),k&&e.jsx("p",{className:"text-sm text-red-600",children:k}),D&&e.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Verbindung erfolgreich getestet und gespeichert."}),e.jsx("button",{type:"submit",disabled:g,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:g?"Teste & speichere…":"Verbindung testen & speichern"})]})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),!d&&s&&e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${s.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:s.ok?"Datenbank OK":"Datenbank nicht OK"})]}),e.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."}),d&&e.jsx("p",{className:"text-sm text-neutral-400",children:"Prüfe…"}),!d&&s&&!s.ok&&e.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:s.tables.filter(t=>!t.ok).map(t=>e.jsx("li",{children:t.exists?e.jsxs(e.Fragment,{children:["Tabelle ",e.jsx("code",{className:"font-mono",children:t.table}),": Spalte(n) fehlen – ",t.missing_columns.join(", ")]}):e.jsxs(e.Fragment,{children:["Tabelle ",e.jsx("code",{className:"font-mono",children:t.table})," fehlt komplett"]})},t.table))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{onClick:c,disabled:d,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"}),s&&!s.ok&&e.jsx("button",{onClick:E,disabled: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:v?"Aktualisiere…":"Datenbankstruktur aktualisieren"})]}),S&&e.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:S.map((t,l)=>e.jsx("li",{children:t},l))})]}),e.jsx(T,{})]})}export{F as default}; diff --git a/hifi/assets/Datenschutz-BxRbkKHM.js b/hifi/assets/Datenschutz-BSZ59Ypg.js similarity index 54% rename from hifi/assets/Datenschutz-BxRbkKHM.js rename to hifi/assets/Datenschutz-BSZ59Ypg.js index ab06b4c..0713651 100644 --- a/hifi/assets/Datenschutz-BxRbkKHM.js +++ b/hifi/assets/Datenschutz-BSZ59Ypg.js @@ -1 +1 @@ -import{j as t}from"./index-eQrgtQRM.js";import{L as e}from"./LegalPageView-CmgDetEJ.js";function n(){return t.jsx(e,{slug:"datenschutz",fallbackTitle:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO."})}export{n as default}; +import{j as t}from"./index-CPMnKQBc.js";import{L as e}from"./LegalPageView-DxOTKnHx.js";function n(){return t.jsx(e,{slug:"datenschutz",fallbackTitle:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO."})}export{n as default}; diff --git a/hifi/assets/Downloads-BySos-u0.js b/hifi/assets/Downloads-DX6hhxmA.js similarity index 95% rename from hifi/assets/Downloads-BySos-u0.js rename to hifi/assets/Downloads-DX6hhxmA.js index 83ba627..4b2e5f4 100644 --- a/hifi/assets/Downloads-BySos-u0.js +++ b/hifi/assets/Downloads-DX6hhxmA.js @@ -1 +1 @@ -import{v as S,r as h,j as s,P as $,B as g,y as P,U as D,z as C,F as b,_ as E,x as _,W as B,c as j,C as F,$ as A}from"./index-eQrgtQRM.js";import{b as v,f as I,A as L}from"./downloads-B9pqFegV.js";import{u as O,E as W,R as M}from"./EntityList-CgZqBKVk.js";import"./SortableList-B1XU_999.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";const T={title:"",description:"",sort_order:0},R={audio:"play",video:"play",image:"image"};function N(m,n,c){return new Promise((r,l)=>{const i=new XMLHttpRequest;i.open("POST",`${A}${m}`),i.withCredentials=!0,i.upload.onprogress=a=>{a.lengthComputable&&c(a.loaded/a.total)},i.onload=()=>{let a=null;try{a=JSON.parse(i.responseText)}catch{}i.status>=200&&i.status<300?r(a):l(new Error((a==null?void 0:a.error)||(i.status===413?"Die Datei ist zu groß für diesen Server.":`Fehler ${i.status}`)))},i.onerror=()=>l(new Error("Netzwerkfehler beim Hochladen")),i.send(n)})}function K(){const m=S(),[n,c]=h.useState(void 0),[r,l]=h.useState(""),[i,a]=h.useState(!1),[t,f]=h.useState("");h.useEffect(()=>{j.get("/settings/downloads").then(o=>{c(o.password),l(o.password||"")}).catch(o=>f(o.message))},[]);const w=async o=>{o.preventDefault(),a(!0),f("");try{const p=await j.put("/settings/downloads",{password:r});c(p.password),l(p.password||""),m.success(p.password?"Gespeichert – der Bereich ist jetzt geschützt.":"Gespeichert – der Bereich ist jetzt öffentlich.")}catch(p){f(p.message)}finally{a(!1)}},x=(n||"")===r.trim();return s.jsx(F,{title:"Zugriffsschutz",description:"Mit Passwort sehen nur Kunden die Dateien, denen ihr den Code gebt.",actions:n===void 0?null:n?s.jsx(D,{tone:"brand",children:"Geschützt"}):s.jsx(D,{tone:"amber",children:"Öffentlich"}),children:s.jsxs("form",{onSubmit:w,children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[s.jsx(b,{label:"Zugangspasswort",error:t,className:"flex-1",children:s.jsx(_,{value:r,maxLength:100,autoComplete:"off",onChange:o=>l(o.target.value),placeholder:"Leer lassen = öffentlich"})}),s.jsx(g,{type:"submit",disabled:i||n===void 0||x,children:"Speichern"})]}),s.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:"Das Passwort bleibt hier jederzeit einsehbar. Direkte Links zu einzelnen Dateien funktionieren auch ohne Passwort."})]})})}function J(){const m=S(),[n,c]=h.useState(null),[r,l]=h.useState(null),[i,a]=h.useState(null),t=O({endpoint:"/downloads",listEndpoint:"/downloads/manage",reorderKey:"downloads",source:"downloads",emptyForm:T,toForm:e=>({title:e.title,description:e.description||"",sort_order:e.sort_order}),labels:{created:"Datei hochgeladen.",saved:"Download gespeichert.",deleted:"Download gelöscht."},save:async({editing:e,form:u})=>{try{if(e!=="new"){if(await j.put(`/downloads/${e}`,u),n){const d=new FormData;d.append("file",n),l(0),await N(`/downloads/${e}/file`,d,l)}}else{const d=new FormData;d.append("file",n),d.append("title",u.title),d.append("description",u.description),l(0),await N("/downloads",d,l)}c(null)}finally{l(null)}}}),{form:f,change:w}=t,x=t.isNew?null:(t.items||[]).find(e=>e.id===t.editing),o=e=>{c(null),t.openPanel(e)},p=e=>{c(e),t.setExtraDirty(!0)},k=e=>{if(e.preventDefault(),t.isNew&&!n){t.setError("Bitte eine Datei auswählen.");return}t.submit()},z=async e=>{a(e.id);try{const u=await j.patch(`/downloads/${e.id}/visibility`,{is_hidden:!e.is_hidden});t.setItems(d=>d.map(y=>y.id===e.id?{...y,is_hidden:u.is_hidden}:y)),m.success(u.is_hidden?`„${e.title}“ ist jetzt ausgeblendet.`:`„${e.title}“ ist wieder sichtbar.`)}catch(u){m.error(`Sichtbarkeit konnte nicht geändert werden: ${u.message}`)}finally{a(null)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx($,{title:"Downloads",description:"Songs, Anleitungen und andere Dateien für eure Kunden. Der Menüpunkt erscheint auf der Website, sobald eine Datei sichtbar ist. Reihenfolge am Griff links ziehen.",className:"!mb-0",actions:s.jsxs(s.Fragment,{children:[s.jsx(g,{variant:"secondary",icon:"eye",href:"/downloads",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),s.jsx(g,{icon:"plus",onClick:()=>o(null),children:"Datei hochladen"})]})}),s.jsx(W,{items:t.items,editingId:t.editing,onReorder:t.reorder,onOpen:o,onDelete:e=>t.remove(e,`„${e.title}“ inkl. Datei wirklich löschen?`),searchText:e=>`${e.title} ${e.file_name}`,searchPlaceholder:"Datei suchen …",empty:{icon:"download",title:"Noch keine Dateien",description:"Lade z. B. Demo-Songs oder Bedienungsanleitungen hoch.",actions:s.jsx(g,{icon:"plus",onClick:()=>o(null),children:"Datei hochladen"})},renderRow:e=>({media:s.jsx(M,{icon:R[I(e.file_name)]||"file"}),title:e.title,subtitle:s.jsxs(s.Fragment,{children:[!!e.is_hidden&&s.jsx(D,{tone:"amber",className:"mr-2",children:"Ausgeblendet"}),e.file_name," · ",v(e.file_size)]}),muted:!!e.is_hidden,actions:s.jsx(P,{icon:e.is_hidden?"eyeOff":"eye",label:e.is_hidden?"Wieder auf der Website anzeigen":"Auf der Website ausblenden",disabled:i===e.id,onClick:()=>z(e)})})}),s.jsx(K,{}),s.jsxs(C,{as:"form",onSubmit:k,open:t.editing!==null,onClose:t.closePanel,size:"lg",title:t.isNew?"Datei hochladen":"Download bearbeiten",footer:s.jsxs(s.Fragment,{children:[s.jsx(g,{variant:"secondary",onClick:t.closePanel,disabled:t.saving,children:"Abbrechen"}),s.jsx(g,{type:"submit",disabled:t.saving||!t.isNew&&!t.dirty,children:t.saving?r!==null&&r<1?`Lädt hoch … ${Math.round(r*100)} %`:"Speichere…":t.isNew?"Hochladen":"Speichern"})]}),children:[t.error&&s.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:t.error}),s.jsx(b,{label:t.isNew?"Datei":"Datei ersetzen (optional)",required:t.isNew,children:s.jsx(E,{file:n,onChange:p,disabled:t.saving,accept:L.map(e=>`.${e}`).join(","),current:x?`${x.file_name} (${v(x.file_size)})`:null,hint:"Musik, Videos, PDFs, Bilder, Office-Dateien oder ZIP. Andere Typen bitte als ZIP."})}),r!==null&&s.jsxs("div",{children:[s.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-800",children:s.jsx("div",{className:"h-full rounded-full bg-brand-500 transition-[width]",style:{width:`${Math.round(r*100)}%`}})}),s.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:r<1?`Wird hochgeladen … ${Math.round(r*100)} %`:"Wird gespeichert …"})]}),s.jsx(b,{label:"Titel",required:!t.isNew,hint:t.isNew?"Leer lassen = Dateiname":null,children:s.jsx(_,{required:!t.isNew,maxLength:150,value:f.title,onChange:e=>w({title:e.target.value}),placeholder:t.isNew&&(n==null?void 0:n.name)||""})}),s.jsx(b,{label:"Beschreibung (optional)",children:s.jsx(B,{rows:3,value:f.description,onChange:e=>w({description:e.target.value})})})]})]})}export{J as default}; +import{v as S,r as h,j as s,P as $,B as g,y as P,U as D,z as C,F as b,_ as E,x as _,W as B,c as j,C as F,$ as A}from"./index-CPMnKQBc.js";import{b as v,f as I,A as L}from"./downloads-B9pqFegV.js";import{u as O,E as W,R as M}from"./EntityList-DPxkbA95.js";import"./SortableList-Dgddukss.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";const T={title:"",description:"",sort_order:0},R={audio:"play",video:"play",image:"image"};function N(m,n,c){return new Promise((r,l)=>{const i=new XMLHttpRequest;i.open("POST",`${A}${m}`),i.withCredentials=!0,i.upload.onprogress=a=>{a.lengthComputable&&c(a.loaded/a.total)},i.onload=()=>{let a=null;try{a=JSON.parse(i.responseText)}catch{}i.status>=200&&i.status<300?r(a):l(new Error((a==null?void 0:a.error)||(i.status===413?"Die Datei ist zu groß für diesen Server.":`Fehler ${i.status}`)))},i.onerror=()=>l(new Error("Netzwerkfehler beim Hochladen")),i.send(n)})}function K(){const m=S(),[n,c]=h.useState(void 0),[r,l]=h.useState(""),[i,a]=h.useState(!1),[t,f]=h.useState("");h.useEffect(()=>{j.get("/settings/downloads").then(o=>{c(o.password),l(o.password||"")}).catch(o=>f(o.message))},[]);const w=async o=>{o.preventDefault(),a(!0),f("");try{const p=await j.put("/settings/downloads",{password:r});c(p.password),l(p.password||""),m.success(p.password?"Gespeichert – der Bereich ist jetzt geschützt.":"Gespeichert – der Bereich ist jetzt öffentlich.")}catch(p){f(p.message)}finally{a(!1)}},x=(n||"")===r.trim();return s.jsx(F,{title:"Zugriffsschutz",description:"Mit Passwort sehen nur Kunden die Dateien, denen ihr den Code gebt.",actions:n===void 0?null:n?s.jsx(D,{tone:"brand",children:"Geschützt"}):s.jsx(D,{tone:"amber",children:"Öffentlich"}),children:s.jsxs("form",{onSubmit:w,children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end",children:[s.jsx(b,{label:"Zugangspasswort",error:t,className:"flex-1",children:s.jsx(_,{value:r,maxLength:100,autoComplete:"off",onChange:o=>l(o.target.value),placeholder:"Leer lassen = öffentlich"})}),s.jsx(g,{type:"submit",disabled:i||n===void 0||x,children:"Speichern"})]}),s.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:"Das Passwort bleibt hier jederzeit einsehbar. Direkte Links zu einzelnen Dateien funktionieren auch ohne Passwort."})]})})}function J(){const m=S(),[n,c]=h.useState(null),[r,l]=h.useState(null),[i,a]=h.useState(null),t=O({endpoint:"/downloads",listEndpoint:"/downloads/manage",reorderKey:"downloads",source:"downloads",emptyForm:T,toForm:e=>({title:e.title,description:e.description||"",sort_order:e.sort_order}),labels:{created:"Datei hochgeladen.",saved:"Download gespeichert.",deleted:"Download gelöscht."},save:async({editing:e,form:u})=>{try{if(e!=="new"){if(await j.put(`/downloads/${e}`,u),n){const d=new FormData;d.append("file",n),l(0),await N(`/downloads/${e}/file`,d,l)}}else{const d=new FormData;d.append("file",n),d.append("title",u.title),d.append("description",u.description),l(0),await N("/downloads",d,l)}c(null)}finally{l(null)}}}),{form:f,change:w}=t,x=t.isNew?null:(t.items||[]).find(e=>e.id===t.editing),o=e=>{c(null),t.openPanel(e)},p=e=>{c(e),t.setExtraDirty(!0)},k=e=>{if(e.preventDefault(),t.isNew&&!n){t.setError("Bitte eine Datei auswählen.");return}t.submit()},z=async e=>{a(e.id);try{const u=await j.patch(`/downloads/${e.id}/visibility`,{is_hidden:!e.is_hidden});t.setItems(d=>d.map(y=>y.id===e.id?{...y,is_hidden:u.is_hidden}:y)),m.success(u.is_hidden?`„${e.title}“ ist jetzt ausgeblendet.`:`„${e.title}“ ist wieder sichtbar.`)}catch(u){m.error(`Sichtbarkeit konnte nicht geändert werden: ${u.message}`)}finally{a(null)}};return s.jsxs("div",{className:"space-y-6",children:[s.jsx($,{title:"Downloads",description:"Songs, Anleitungen und andere Dateien für eure Kunden. Der Menüpunkt erscheint auf der Website, sobald eine Datei sichtbar ist. Reihenfolge am Griff links ziehen.",className:"!mb-0",actions:s.jsxs(s.Fragment,{children:[s.jsx(g,{variant:"secondary",icon:"eye",href:"/downloads",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),s.jsx(g,{icon:"plus",onClick:()=>o(null),children:"Datei hochladen"})]})}),s.jsx(W,{items:t.items,editingId:t.editing,onReorder:t.reorder,onOpen:o,onDelete:e=>t.remove(e,`„${e.title}“ inkl. Datei wirklich löschen?`),searchText:e=>`${e.title} ${e.file_name}`,searchPlaceholder:"Datei suchen …",empty:{icon:"download",title:"Noch keine Dateien",description:"Lade z. B. Demo-Songs oder Bedienungsanleitungen hoch.",actions:s.jsx(g,{icon:"plus",onClick:()=>o(null),children:"Datei hochladen"})},renderRow:e=>({media:s.jsx(M,{icon:R[I(e.file_name)]||"file"}),title:e.title,subtitle:s.jsxs(s.Fragment,{children:[!!e.is_hidden&&s.jsx(D,{tone:"amber",className:"mr-2",children:"Ausgeblendet"}),e.file_name," · ",v(e.file_size)]}),muted:!!e.is_hidden,actions:s.jsx(P,{icon:e.is_hidden?"eyeOff":"eye",label:e.is_hidden?"Wieder auf der Website anzeigen":"Auf der Website ausblenden",disabled:i===e.id,onClick:()=>z(e)})})}),s.jsx(K,{}),s.jsxs(C,{as:"form",onSubmit:k,open:t.editing!==null,onClose:t.closePanel,size:"lg",title:t.isNew?"Datei hochladen":"Download bearbeiten",footer:s.jsxs(s.Fragment,{children:[s.jsx(g,{variant:"secondary",onClick:t.closePanel,disabled:t.saving,children:"Abbrechen"}),s.jsx(g,{type:"submit",disabled:t.saving||!t.isNew&&!t.dirty,children:t.saving?r!==null&&r<1?`Lädt hoch … ${Math.round(r*100)} %`:"Speichere…":t.isNew?"Hochladen":"Speichern"})]}),children:[t.error&&s.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:t.error}),s.jsx(b,{label:t.isNew?"Datei":"Datei ersetzen (optional)",required:t.isNew,children:s.jsx(E,{file:n,onChange:p,disabled:t.saving,accept:L.map(e=>`.${e}`).join(","),current:x?`${x.file_name} (${v(x.file_size)})`:null,hint:"Musik, Videos, PDFs, Bilder, Office-Dateien oder ZIP. Andere Typen bitte als ZIP."})}),r!==null&&s.jsxs("div",{children:[s.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-800",children:s.jsx("div",{className:"h-full rounded-full bg-brand-500 transition-[width]",style:{width:`${Math.round(r*100)}%`}})}),s.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:r<1?`Wird hochgeladen … ${Math.round(r*100)} %`:"Wird gespeichert …"})]}),s.jsx(b,{label:"Titel",required:!t.isNew,hint:t.isNew?"Leer lassen = Dateiname":null,children:s.jsx(_,{required:!t.isNew,maxLength:150,value:f.title,onChange:e=>w({title:e.target.value}),placeholder:t.isNew&&(n==null?void 0:n.name)||""})}),s.jsx(b,{label:"Beschreibung (optional)",children:s.jsx(B,{rows:3,value:f.description,onChange:e=>w({description:e.target.value})})})]})]})}export{J as default}; diff --git a/hifi/assets/DownloadsPage-ZpsuO5y1.js b/hifi/assets/DownloadsPage-BAC2Bbij.js similarity index 97% rename from hifi/assets/DownloadsPage-ZpsuO5y1.js rename to hifi/assets/DownloadsPage-BAC2Bbij.js index 8c1e60e..e41a05b 100644 --- a/hifi/assets/DownloadsPage-ZpsuO5y1.js +++ b/hifi/assets/DownloadsPage-BAC2Bbij.js @@ -1 +1 @@ -import{r,u as y,b as v,j as e,e as S,R as D,c as I}from"./index-eQrgtQRM.js";import{f as _,a as E,b as F,i as L}from"./downloads-B9pqFegV.js";import{L as C,F as p,a as R,b as T,c as U,M,D as A}from"./music-CfvjP45-.js";const K={audio:M,video:U,pdf:p,image:T,archive:R,document:p},n="hifi-downloads-password",z=()=>{try{return localStorage.getItem(n)||""}catch{return""}},f=t=>{try{t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}},g=t=>I.get("/downloads",t?{headers:{"X-Download-Password":encodeURIComponent(t)}}:void 0);function W(){const[t,i]=r.useState(null),[c,x]=r.useState(!1),[o,b]=r.useState(""),[j,m]=r.useState(!1),[u,h]=r.useState(!1),[d,w]=r.useState(null),{t:s,language:k}=y();r.useEffect(()=>{const a=z();g(a).then(l=>{l.locked?(a&&f(""),x(!0)):i(l.items)}).catch(l=>w(l))},[]);const N=async a=>{a.preventDefault(),h(!0),m(!1);try{const l=await g(o);l.locked?m(!0):(f(o),x(!1),i(l.items))}catch(l){w(l.message)}finally{h(!1)}};return v({title:s("downloadsPage.metaTitle"),description:s("downloadsPage.metaDescription"),path:"/downloads"}),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-12 sm:px-6",children:[e.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("downloadsPage.title")}),e.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.intro")}),d&&e.jsx("p",{className:"text-red-600",children:typeof d=="string"?d:S(d,s)}),!d&&!c&&t===null&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.loading")}),(t==null?void 0:t.length)===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.empty")}),c&&e.jsxs("form",{onSubmit:N,className:"max-w-md rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(C,{className:"h-5 w-5 text-brand-500","aria-hidden":"true"}),e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:s("downloadsPage.lockedTitle")})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.lockedText")}),e.jsx("label",{htmlFor:"downloads-password",className:"sr-only",children:s("downloadsPage.passwordLabel")}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{id:"downloads-password",type:"password",required:!0,autoComplete:"off",value:o,onChange:a=>b(a.target.value),placeholder:s("downloadsPage.passwordLabel"),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 dark:border-neutral-700 dark:bg-neutral-950 dark:text-white"}),e.jsx("button",{type:"submit",disabled:u,className:"shrink-0 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s(u?"downloadsPage.unlocking":"downloadsPage.unlock")})]}),j&&e.jsx("p",{className:"mt-2 text-sm text-red-600",role:"alert",children:s("downloadsPage.wrongPassword")})]}),e.jsx("div",{className:"space-y-4",children:t==null?void 0:t.map((a,l)=>{const P=K[_(a.file_name)];return e.jsx(D,{index:l%4,className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-brand-500/10 text-brand-600 dark:text-brand-400",children:e.jsx(P,{className:"h-6 w-6","aria-hidden":"true"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:a.title}),a.description&&e.jsx("p",{className:"mt-1 whitespace-pre-line text-sm text-neutral-600 dark:text-neutral-300",children:a.description}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:[E(a.file_name).toUpperCase()," · ",F(a.file_size,k==="de"?"de-DE":"en-US")]}),L(a.file_name)&&e.jsx("audio",{controls:!0,preload:"none",src:a.file_path,className:"mt-3 w-full"})]}),e.jsxs("a",{href:a.file_path,download:a.file_name,className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:[e.jsx(A,{className:"h-4 w-4","aria-hidden":"true"}),s("downloadsPage.download")]})]})},a.id)})})]})}export{W as default}; +import{r,u as y,b as v,j as e,e as S,R as D,c as I}from"./index-CPMnKQBc.js";import{f as _,a as E,b as F,i as L}from"./downloads-B9pqFegV.js";import{L as C,F as p,a as R,b as T,c as U,M,D as A}from"./music-D2Ez1K-E.js";const K={audio:M,video:U,pdf:p,image:T,archive:R,document:p},n="hifi-downloads-password",z=()=>{try{return localStorage.getItem(n)||""}catch{return""}},f=t=>{try{t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}},g=t=>I.get("/downloads",t?{headers:{"X-Download-Password":encodeURIComponent(t)}}:void 0);function W(){const[t,i]=r.useState(null),[c,x]=r.useState(!1),[o,b]=r.useState(""),[j,m]=r.useState(!1),[u,h]=r.useState(!1),[d,w]=r.useState(null),{t:s,language:k}=y();r.useEffect(()=>{const a=z();g(a).then(l=>{l.locked?(a&&f(""),x(!0)):i(l.items)}).catch(l=>w(l))},[]);const N=async a=>{a.preventDefault(),h(!0),m(!1);try{const l=await g(o);l.locked?m(!0):(f(o),x(!1),i(l.items))}catch(l){w(l.message)}finally{h(!1)}};return v({title:s("downloadsPage.metaTitle"),description:s("downloadsPage.metaDescription"),path:"/downloads"}),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-12 sm:px-6",children:[e.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("downloadsPage.title")}),e.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.intro")}),d&&e.jsx("p",{className:"text-red-600",children:typeof d=="string"?d:S(d,s)}),!d&&!c&&t===null&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.loading")}),(t==null?void 0:t.length)===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.empty")}),c&&e.jsxs("form",{onSubmit:N,className:"max-w-md rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(C,{className:"h-5 w-5 text-brand-500","aria-hidden":"true"}),e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:s("downloadsPage.lockedTitle")})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.lockedText")}),e.jsx("label",{htmlFor:"downloads-password",className:"sr-only",children:s("downloadsPage.passwordLabel")}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{id:"downloads-password",type:"password",required:!0,autoComplete:"off",value:o,onChange:a=>b(a.target.value),placeholder:s("downloadsPage.passwordLabel"),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 dark:border-neutral-700 dark:bg-neutral-950 dark:text-white"}),e.jsx("button",{type:"submit",disabled:u,className:"shrink-0 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s(u?"downloadsPage.unlocking":"downloadsPage.unlock")})]}),j&&e.jsx("p",{className:"mt-2 text-sm text-red-600",role:"alert",children:s("downloadsPage.wrongPassword")})]}),e.jsx("div",{className:"space-y-4",children:t==null?void 0:t.map((a,l)=>{const P=K[_(a.file_name)];return e.jsx(D,{index:l%4,className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-brand-500/10 text-brand-600 dark:text-brand-400",children:e.jsx(P,{className:"h-6 w-6","aria-hidden":"true"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:a.title}),a.description&&e.jsx("p",{className:"mt-1 whitespace-pre-line text-sm text-neutral-600 dark:text-neutral-300",children:a.description}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:[E(a.file_name).toUpperCase()," · ",F(a.file_size,k==="de"?"de-DE":"en-US")]}),L(a.file_name)&&e.jsx("audio",{controls:!0,preload:"none",src:a.file_path,className:"mt-3 w-full"})]}),e.jsxs("a",{href:a.file_path,download:a.file_name,className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:[e.jsx(A,{className:"h-4 w-4","aria-hidden":"true"}),s("downloadsPage.download")]})]})},a.id)})})]})}export{W as default}; diff --git a/hifi/assets/EmailSettings-O9zitSOH.js b/hifi/assets/EmailSettings-4uXhtxt-.js similarity index 98% rename from hifi/assets/EmailSettings-O9zitSOH.js rename to hifi/assets/EmailSettings-4uXhtxt-.js index af34d7b..9bccfa1 100644 --- a/hifi/assets/EmailSettings-O9zitSOH.js +++ b/hifi/assets/EmailSettings-4uXhtxt-.js @@ -1,2 +1,2 @@ -import{r,c as m,j as e}from"./index-eQrgtQRM.js";import E from"./RichTextEditor-Da-meJrp.js";function d(a){if(!a)return"";if(/<[a-z][\s\S]*>/i.test(a))return a;const l=document.createElement("div");return l.textContent=a,`

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

`}const H={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:""},z=[["{{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 T(){return e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:z.map(([a,l])=>e.jsx("span",{title:l,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:a},a))})}function F(){const[a,l]=r.useState(H),[u,c]=r.useState(!1),[C,P]=r.useState(!0),[x,M]=r.useState(!1),[b,h]=r.useState(!1),[p,g]=r.useState(""),[B,o]=r.useState(!1),[f,k]=r.useState(!1),[_,j]=r.useState(""),[w,v]=r.useState(""),[y,N]=r.useState(""),[i,S]=r.useState(null);r.useEffect(()=>{m.get("/settings/mail").then(t=>{l({...t,mail_password:"",mail_customer_body:d(t.mail_customer_body),mail_owner_body:d(t.mail_owner_body)}),c(t.has_password)}).finally(()=>P(!1))},[]);const s=(t,n)=>{l(A=>({...A,[t]:n})),o(!1)},K=async t=>{t.preventDefault(),h(!0),g(""),o(!1);try{const n=await m.post("/settings/mail",a);l({...n,mail_password:"",mail_customer_body:d(n.mail_customer_body),mail_owner_body:d(n.mail_owner_body)}),c(n.has_password),o(!0)}catch(n){g(n.message)}finally{h(!1)}},L=async()=>{k(!0),j(""),v(""),N(""),S(null);try{const t=await m.post("/settings/mail/test",a);v(`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.`),N(t.warning||""),S(t.smtp_log||null)}catch(t){j(t.message)}finally{k(!1)}};return C?e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):e.jsxs("form",{onSubmit:K,className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"SMTP-Server"}),e.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)."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px]",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Server (Host)"}),e.jsx("input",{value:a.mail_host,onChange:t=>s("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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Port"}),e.jsx("input",{type:"number",value:a.mail_port,onChange:t=>s("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"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Verschlüsselung"}),e.jsxs("select",{value:a.mail_encryption,onChange:t=>s("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:[e.jsx("option",{value:"tls",children:"STARTTLS"}),e.jsx("option",{value:"ssl",children:"SSL"}),e.jsx("option",{value:"none",children:"Keine"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),e.jsx("input",{value:a.mail_username,onChange:t=>s("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"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",u?"(leer lassen = unverändert)":""]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:x?"text":"password",value:a.mail_password,onChange:t=>s("mail_password",t.target.value),placeholder:u?"••••••••":"",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"}),e.jsx("button",{type:"button",onClick:()=>M(t=>!t),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:x?"Verbergen":"Anzeigen"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-E-Mail"}),e.jsx("input",{type:"email",value:a.mail_from_email,onChange:t=>s("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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-Name"}),e.jsx("input",{value:a.mail_from_name,onChange:t=>s("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"})]})]}),e.jsxs("div",{className:"mt-4 border-t border-neutral-200 pt-4 dark:border-neutral-800",children:[_&&e.jsx("p",{className:"mb-2 whitespace-pre-wrap text-sm text-red-600",children:_}),w&&e.jsx("p",{className:"mb-2 text-sm text-green-600 dark:text-green-400",children:w}),y&&e.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:y}),e.jsx("button",{type:"button",onClick:L,disabled:f,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:f?"Sende Testmail…":"Verbindung testen"}),i&&i.length>0&&e.jsxs("details",{className:"mt-3",children:[e.jsx("summary",{className:"cursor-pointer text-xs text-neutral-500 dark:text-neutral-400",children:"SMTP-Protokoll anzeigen"}),e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-neutral-900 p-3 text-xs text-neutral-200",children:i.join(` +import{r,c as m,j as e}from"./index-CPMnKQBc.js";import E from"./RichTextEditor-B7bZ3Yjh.js";function d(a){if(!a)return"";if(/<[a-z][\s\S]*>/i.test(a))return a;const l=document.createElement("div");return l.textContent=a,`

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

`}const H={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:""},z=[["{{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 T(){return e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:z.map(([a,l])=>e.jsx("span",{title:l,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:a},a))})}function F(){const[a,l]=r.useState(H),[u,c]=r.useState(!1),[C,P]=r.useState(!0),[x,M]=r.useState(!1),[b,h]=r.useState(!1),[p,g]=r.useState(""),[B,o]=r.useState(!1),[f,k]=r.useState(!1),[_,j]=r.useState(""),[w,v]=r.useState(""),[y,N]=r.useState(""),[i,S]=r.useState(null);r.useEffect(()=>{m.get("/settings/mail").then(t=>{l({...t,mail_password:"",mail_customer_body:d(t.mail_customer_body),mail_owner_body:d(t.mail_owner_body)}),c(t.has_password)}).finally(()=>P(!1))},[]);const s=(t,n)=>{l(A=>({...A,[t]:n})),o(!1)},K=async t=>{t.preventDefault(),h(!0),g(""),o(!1);try{const n=await m.post("/settings/mail",a);l({...n,mail_password:"",mail_customer_body:d(n.mail_customer_body),mail_owner_body:d(n.mail_owner_body)}),c(n.has_password),o(!0)}catch(n){g(n.message)}finally{h(!1)}},L=async()=>{k(!0),j(""),v(""),N(""),S(null);try{const t=await m.post("/settings/mail/test",a);v(`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.`),N(t.warning||""),S(t.smtp_log||null)}catch(t){j(t.message)}finally{k(!1)}};return C?e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):e.jsxs("form",{onSubmit:K,className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"SMTP-Server"}),e.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)."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px]",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Server (Host)"}),e.jsx("input",{value:a.mail_host,onChange:t=>s("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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Port"}),e.jsx("input",{type:"number",value:a.mail_port,onChange:t=>s("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"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Verschlüsselung"}),e.jsxs("select",{value:a.mail_encryption,onChange:t=>s("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:[e.jsx("option",{value:"tls",children:"STARTTLS"}),e.jsx("option",{value:"ssl",children:"SSL"}),e.jsx("option",{value:"none",children:"Keine"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),e.jsx("input",{value:a.mail_username,onChange:t=>s("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"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",u?"(leer lassen = unverändert)":""]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:x?"text":"password",value:a.mail_password,onChange:t=>s("mail_password",t.target.value),placeholder:u?"••••••••":"",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"}),e.jsx("button",{type:"button",onClick:()=>M(t=>!t),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:x?"Verbergen":"Anzeigen"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-E-Mail"}),e.jsx("input",{type:"email",value:a.mail_from_email,onChange:t=>s("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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-Name"}),e.jsx("input",{value:a.mail_from_name,onChange:t=>s("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"})]})]}),e.jsxs("div",{className:"mt-4 border-t border-neutral-200 pt-4 dark:border-neutral-800",children:[_&&e.jsx("p",{className:"mb-2 whitespace-pre-wrap text-sm text-red-600",children:_}),w&&e.jsx("p",{className:"mb-2 text-sm text-green-600 dark:text-green-400",children:w}),y&&e.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:y}),e.jsx("button",{type:"button",onClick:L,disabled:f,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:f?"Sende Testmail…":"Verbindung testen"}),i&&i.length>0&&e.jsxs("details",{className:"mt-3",children:[e.jsx("summary",{className:"cursor-pointer text-xs text-neutral-500 dark:text-neutral-400",children:"SMTP-Protokoll anzeigen"}),e.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-neutral-900 p-3 text-xs text-neutral-200",children:i.join(` `)})]})]})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Empfänger"}),e.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."}),e.jsx("input",{type:"email",value:a.mail_notify_email,onChange:t=>s("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"})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Kunden (Bestätigung)"}),e.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."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),e.jsx("input",{value:a.mail_customer_subject,onChange:t=>s("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"})]}),e.jsx(E,{label:"Text",value:a.mail_customer_body,onChange:t=>s("mail_customer_body",t)})]}),e.jsx(T,{})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Shop (Benachrichtigung)"}),e.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."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),e.jsx("input",{value:a.mail_owner_subject,onChange:t=>s("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"})]}),e.jsx(E,{label:"Text",value:a.mail_owner_body,onChange:t=>s("mail_owner_body",t)})]}),e.jsx(T,{})]}),p&&e.jsx("p",{className:"text-sm text-red-600",children:p}),B&&e.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"submit",disabled:b,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:b?"Speichere…":"Speichern"})]})}export{F as default}; diff --git a/hifi/assets/EntityList-CgZqBKVk.js b/hifi/assets/EntityList-DPxkbA95.js similarity index 97% rename from hifi/assets/EntityList-CgZqBKVk.js rename to hifi/assets/EntityList-DPxkbA95.js index 3cba908..d522619 100644 --- a/hifi/assets/EntityList-CgZqBKVk.js +++ b/hifi/assets/EntityList-DPxkbA95.js @@ -1 +1 @@ -import{v as P,r as l,w as U,c as N,j as e,C as _,I as R,x as F,s as O,y as L}from"./index-eQrgtQRM.js";import{S as Q,s as z}from"./SortableList-B1XU_999.js";function X({endpoint:a,listEndpoint:g,reorderKey:m,emptyForm:o,toForm:k,toPayload:b=c=>c,save:w,labels:d,source:y}){const c=P(),[i,u]=l.useState(null),[n,j]=l.useState(null),[s,x]=l.useState(o),[h,E]=l.useState(o),[D,S]=l.useState(!1),[M,I]=l.useState(!1),[q,v]=l.useState(""),C=D||JSON.stringify(s)!==JSON.stringify(h);U(n!==null&&C,y);const f=l.useCallback(()=>N.get(g||a).then(u).catch(t=>{u(r=>r||[]),c.error(t.message)}),[a,g]);l.useEffect(()=>{f()},[f]);const B=t=>{const r=t?k(t):o;j(t?t.id:"new"),x(r),E(r),S(!1),v("")},$=()=>{j(null),S(!1)};return{items:i,setItems:u,load:f,editing:n,isNew:n==="new",form:s,setForm:x,change:t=>x(r=>({...r,...t})),setExtraDirty:S,dirty:C,saving:M,error:q,setError:v,openPanel:B,closePanel:()=>{C&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||$()},submit:async t=>{t==null||t.preventDefault(),v(""),I(!0);try{if(w)await w({editing:n,form:s,items:i||[]});else if(n!=="new")await N.put(`${a}/${n}`,b(s));else{const r=(i||[]).reduce((p,J)=>Math.max(p,Number(J.sort_order)||0),0)+10;await N.post(a,{...b(s),sort_order:r})}c.success(n==="new"?d.created:d.saved),E(s),$(),f()}catch(r){v(r.message)}finally{I(!1)}},remove:async(t,r)=>{if(window.confirm(r))try{await N.delete(`${a}/${t.id}`),n===t.id&&$(),c.success(d.deleted),f()}catch(p){c.error(`Löschen fehlgeschlagen: ${p.message}`)}},reorder:async t=>{const r=i;u(t);try{u(await z(m,t)),c.success("Reihenfolge gespeichert.")}catch(p){u(r),c.error(`Reihenfolge konnte nicht gespeichert werden: ${p.message}`)}}}}function Y({items:a,onReorder:g,onOpen:m,onDelete:o,renderRow:k,empty:b,searchFrom:w=10,searchText:d,searchPlaceholder:y="Suchen …",editingId:c}){const[i,u]=l.useState(""),n=l.useMemo(()=>{const s=i.trim().toLowerCase();return!s||!a?a||[]:a.filter(x=>(d?d(x):"").toLowerCase().includes(s))},[a,i,d]),j=i.trim()!=="";return e.jsxs(_,{padded:!1,className:"overflow-hidden",children:[a&&a.length>=w&&d&&e.jsx("div",{className:"border-b border-neutral-200 p-3 dark:border-neutral-800",children:e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(R,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),e.jsx(F,{value:i,onChange:s=>u(s.target.value),placeholder:y,className:"h-9 pl-9"})]})}),a===null?e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[0,1,2].map(s=>e.jsxs("li",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsx("span",{className:"h-11 w-11 animate-pulse rounded-lg bg-neutral-100 dark:bg-neutral-800"}),e.jsx("span",{className:"h-4 w-48 animate-pulse rounded bg-neutral-100 dark:bg-neutral-800"})]},s))}):a.length===0?e.jsx(O,{...b}):n.length===0?e.jsxs("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Nichts gefunden für „",i,"“."]}):e.jsx(Q,{items:n,onReorder:g,disabled:j,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(s,x)=>{const h=k(s);return e.jsxs("div",{className:`flex items-center gap-3 bg-white px-3 py-2.5 transition hover:bg-neutral-50 dark:bg-neutral-900 dark:hover:bg-neutral-800/50 sm:gap-4 sm:px-4 ${c===s.id?"bg-brand-50/60 dark:bg-brand-900/20":""}`,children:[e.jsx("span",{className:"w-6 shrink-0",children:x}),e.jsxs("button",{type:"button",onClick:()=>m(s),className:`flex min-w-0 flex-1 items-center gap-4 text-left ${h.muted?"opacity-60":""}`,children:[h.media,e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:h.title}),h.subtitle&&e.jsx("span",{className:"block truncate text-xs text-neutral-500 dark:text-neutral-400",children:h.subtitle})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[h.actions,e.jsx(L,{icon:"pencil",label:"Bearbeiten",onClick:()=>m(s)}),e.jsx(L,{icon:"trash",label:"Löschen",tone:"danger",onClick:()=>o(s)})]})]})}})]})}function Z({src:a,icon:g="image",contain:m=!1,className:o=""}){return a?e.jsx("img",{src:a,alt:"",className:`h-11 w-11 shrink-0 rounded-lg border border-neutral-200 bg-white dark:border-neutral-700 ${m?"object-contain p-1":"object-cover"} ${o}`}):e.jsx("span",{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-400 dark:bg-neutral-800 ${o}`,children:e.jsx(R,{name:g,className:"h-5 w-5"})})}export{Y as E,Z as R,X as u}; +import{v as P,r as l,w as U,c as N,j as e,C as _,I as R,x as F,s as O,y as L}from"./index-CPMnKQBc.js";import{S as Q,s as z}from"./SortableList-Dgddukss.js";function X({endpoint:a,listEndpoint:g,reorderKey:m,emptyForm:o,toForm:k,toPayload:b=c=>c,save:w,labels:d,source:y}){const c=P(),[i,u]=l.useState(null),[n,j]=l.useState(null),[s,x]=l.useState(o),[h,E]=l.useState(o),[D,S]=l.useState(!1),[M,I]=l.useState(!1),[q,v]=l.useState(""),C=D||JSON.stringify(s)!==JSON.stringify(h);U(n!==null&&C,y);const f=l.useCallback(()=>N.get(g||a).then(u).catch(t=>{u(r=>r||[]),c.error(t.message)}),[a,g]);l.useEffect(()=>{f()},[f]);const B=t=>{const r=t?k(t):o;j(t?t.id:"new"),x(r),E(r),S(!1),v("")},$=()=>{j(null),S(!1)};return{items:i,setItems:u,load:f,editing:n,isNew:n==="new",form:s,setForm:x,change:t=>x(r=>({...r,...t})),setExtraDirty:S,dirty:C,saving:M,error:q,setError:v,openPanel:B,closePanel:()=>{C&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||$()},submit:async t=>{t==null||t.preventDefault(),v(""),I(!0);try{if(w)await w({editing:n,form:s,items:i||[]});else if(n!=="new")await N.put(`${a}/${n}`,b(s));else{const r=(i||[]).reduce((p,J)=>Math.max(p,Number(J.sort_order)||0),0)+10;await N.post(a,{...b(s),sort_order:r})}c.success(n==="new"?d.created:d.saved),E(s),$(),f()}catch(r){v(r.message)}finally{I(!1)}},remove:async(t,r)=>{if(window.confirm(r))try{await N.delete(`${a}/${t.id}`),n===t.id&&$(),c.success(d.deleted),f()}catch(p){c.error(`Löschen fehlgeschlagen: ${p.message}`)}},reorder:async t=>{const r=i;u(t);try{u(await z(m,t)),c.success("Reihenfolge gespeichert.")}catch(p){u(r),c.error(`Reihenfolge konnte nicht gespeichert werden: ${p.message}`)}}}}function Y({items:a,onReorder:g,onOpen:m,onDelete:o,renderRow:k,empty:b,searchFrom:w=10,searchText:d,searchPlaceholder:y="Suchen …",editingId:c}){const[i,u]=l.useState(""),n=l.useMemo(()=>{const s=i.trim().toLowerCase();return!s||!a?a||[]:a.filter(x=>(d?d(x):"").toLowerCase().includes(s))},[a,i,d]),j=i.trim()!=="";return e.jsxs(_,{padded:!1,className:"overflow-hidden",children:[a&&a.length>=w&&d&&e.jsx("div",{className:"border-b border-neutral-200 p-3 dark:border-neutral-800",children:e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(R,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),e.jsx(F,{value:i,onChange:s=>u(s.target.value),placeholder:y,className:"h-9 pl-9"})]})}),a===null?e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[0,1,2].map(s=>e.jsxs("li",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsx("span",{className:"h-11 w-11 animate-pulse rounded-lg bg-neutral-100 dark:bg-neutral-800"}),e.jsx("span",{className:"h-4 w-48 animate-pulse rounded bg-neutral-100 dark:bg-neutral-800"})]},s))}):a.length===0?e.jsx(O,{...b}):n.length===0?e.jsxs("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Nichts gefunden für „",i,"“."]}):e.jsx(Q,{items:n,onReorder:g,disabled:j,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(s,x)=>{const h=k(s);return e.jsxs("div",{className:`flex items-center gap-3 bg-white px-3 py-2.5 transition hover:bg-neutral-50 dark:bg-neutral-900 dark:hover:bg-neutral-800/50 sm:gap-4 sm:px-4 ${c===s.id?"bg-brand-50/60 dark:bg-brand-900/20":""}`,children:[e.jsx("span",{className:"w-6 shrink-0",children:x}),e.jsxs("button",{type:"button",onClick:()=>m(s),className:`flex min-w-0 flex-1 items-center gap-4 text-left ${h.muted?"opacity-60":""}`,children:[h.media,e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:h.title}),h.subtitle&&e.jsx("span",{className:"block truncate text-xs text-neutral-500 dark:text-neutral-400",children:h.subtitle})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[h.actions,e.jsx(L,{icon:"pencil",label:"Bearbeiten",onClick:()=>m(s)}),e.jsx(L,{icon:"trash",label:"Löschen",tone:"danger",onClick:()=>o(s)})]})]})}})]})}function Z({src:a,icon:g="image",contain:m=!1,className:o=""}){return a?e.jsx("img",{src:a,alt:"",className:`h-11 w-11 shrink-0 rounded-lg border border-neutral-200 bg-white dark:border-neutral-700 ${m?"object-contain p-1":"object-cover"} ${o}`}):e.jsx("span",{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-400 dark:bg-neutral-800 ${o}`,children:e.jsx(R,{name:g,className:"h-5 w-5"})})}export{Y as E,Z as R,X as u}; diff --git a/hifi/assets/ExportImportSettings-CPuYbSqK.js b/hifi/assets/ExportImportSettings-CwuFp4rp.js similarity index 99% rename from hifi/assets/ExportImportSettings-CPuYbSqK.js rename to hifi/assets/ExportImportSettings-CwuFp4rp.js index 6aa55de..15b985a 100644 --- a/hifi/assets/ExportImportSettings-CPuYbSqK.js +++ b/hifi/assets/ExportImportSettings-CwuFp4rp.js @@ -1 +1 @@ -import{r as n,j as e,$ as D,c as F}from"./index-eQrgtQRM.js";const p=[{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:"translations",label:"Englische Texte",hint:"Englische Fassungen von Leistungen, Paketen und Upgrades",tables:["content_translations"]},{key:"permissions",label:"Berechtigungsgruppen",hint:"Rollen-Vorlagen und ihre Rechte (ohne Benutzerkonten selbst)",tables:["permission_groups","permission_group_permissions"]}],z={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",content_translations:"Englische Texte",permission_groups:"Berechtigungsgruppen",permission_group_permissions:"Berechtigungsgruppen-Rechte",admin_users:"Benutzerkonten",admin_user_permissions:"Benutzer-Einzelrechte",admin_user_groups:"Benutzer-Gruppenzuweisungen"},L=(l,d)=>{if(!l)return null;const i=d.map(s=>[s,Array.isArray(l[s])?l[s].length:0]).filter(([,s])=>s>0).map(([s,c])=>`${c} ${z[s]||s}`);return i.length?i.join(", "):"leer in dieser Datei"};function C(){const[l,d]=n.useState(null),[i,s]=n.useState(null),[c,y]=n.useState(""),[o,w]=n.useState(()=>new Set(p.map(t=>t.key))),[N,E]=n.useState(!1),[g,m]=n.useState(!1),[h,_]=n.useState(!1),[S,B]=n.useState(!1),[u,x]=n.useState(null),[v,b]=n.useState(""),I=async t=>{var a;const r=((a=t.target.files)==null?void 0:a[0])||null;if(d(r),x(null),b(""),s(null),y(""),w(new Set(p.map(f=>f.key))),m(!1),!!r)try{const f=await r.text(),j=JSON.parse(f);if(!j||typeof j.data!="object")throw new Error("kein gültiges Export-Format");s(j.data)}catch{y("Datei konnte nicht gelesen werden – Vorschau der Inhalte nicht möglich. Import würde trotzdem versucht (alle Bereiche).")}},P=t=>{w(r=>{const a=new Set(r);return a.has(t)?a.delete(t):a.add(t),a})},A=async t=>{if(t.preventDefault(),!(!l||!h||o.size===0)){B(!0),b(""),x(null);try{const r=new FormData;r.append("file",l),r.append("sections",JSON.stringify([...o])),r.append("include_accounts",g?"1":"0");const a=await F.post("/settings/import",r);x(a),d(null),s(null),_(!1),m(!1),t.target.reset()}catch(r){b(r.message)}finally{B(!1)}}},k=p.filter(t=>o.has(t.key)).map(t=>t.label);return g&&k.push("Benutzerkonten"),e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten exportieren"}),e.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 ",e.jsx("strong",{children:"nicht"})," enthalten."]}),e.jsxs("label",{className:"mb-3 flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:N,onChange:t=>E(t.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)"]}),e.jsx("a",{href:`${D}/settings/export${N?"?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"})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten importieren"}),e.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."}),e.jsxs("form",{onSubmit:A,className:"space-y-4",children:[e.jsx("input",{type:"file",accept:"application/json,.json",onChange:I,className:"text-sm"}),l&&e.jsxs("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-700",children:[e.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?"}),c&&e.jsx("p",{className:"px-4 pt-3 text-sm text-amber-600 dark:text-amber-400",children:c}),e.jsxs("div",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[p.map(t=>e.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:[e.jsx("input",{type:"checkbox",checked:o.has(t.key),onChange:()=>P(t.key),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:t.label}),e.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:i?L(i,t.tables):t.hint})]})]},t.key)),e.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:[e.jsx("input",{type:"checkbox",checked:g,onChange:t=>m(t.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:"Benutzerkonten"}),e.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.'})]})]})]})]}),e.jsxs("label",{className:"flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:h,onChange:t=>_(t.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"," ",k.length?e.jsx("strong",{children:k.join(", ")}):"die ausgewählten Bereiche"," auf diesem Server unwiderruflich ersetzt."]}),e.jsx("button",{type:"submit",disabled:!l||!h||S||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:S?"Importiere…":"Importieren"})]}),v&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:v}),u&&e.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:[e.jsx("p",{className:"mb-1 font-semibold",children:"Import erfolgreich:"}),e.jsxs("ul",{className:"list-disc pl-5",children:[Object.entries(u.counts).map(([t,r])=>e.jsxs("li",{children:[r," ",z[t]||t]},t)),u.images_restored>0&&e.jsxs("li",{children:[u.images_restored," Bilder wiederhergestellt"]})]})]})]})]})}export{C as default}; +import{r as n,j as e,$ as D,c as F}from"./index-CPMnKQBc.js";const p=[{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:"translations",label:"Englische Texte",hint:"Englische Fassungen von Leistungen, Paketen und Upgrades",tables:["content_translations"]},{key:"permissions",label:"Berechtigungsgruppen",hint:"Rollen-Vorlagen und ihre Rechte (ohne Benutzerkonten selbst)",tables:["permission_groups","permission_group_permissions"]}],z={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",content_translations:"Englische Texte",permission_groups:"Berechtigungsgruppen",permission_group_permissions:"Berechtigungsgruppen-Rechte",admin_users:"Benutzerkonten",admin_user_permissions:"Benutzer-Einzelrechte",admin_user_groups:"Benutzer-Gruppenzuweisungen"},L=(l,d)=>{if(!l)return null;const i=d.map(s=>[s,Array.isArray(l[s])?l[s].length:0]).filter(([,s])=>s>0).map(([s,c])=>`${c} ${z[s]||s}`);return i.length?i.join(", "):"leer in dieser Datei"};function C(){const[l,d]=n.useState(null),[i,s]=n.useState(null),[c,y]=n.useState(""),[o,w]=n.useState(()=>new Set(p.map(t=>t.key))),[N,E]=n.useState(!1),[g,m]=n.useState(!1),[h,_]=n.useState(!1),[S,B]=n.useState(!1),[u,x]=n.useState(null),[v,b]=n.useState(""),I=async t=>{var a;const r=((a=t.target.files)==null?void 0:a[0])||null;if(d(r),x(null),b(""),s(null),y(""),w(new Set(p.map(f=>f.key))),m(!1),!!r)try{const f=await r.text(),j=JSON.parse(f);if(!j||typeof j.data!="object")throw new Error("kein gültiges Export-Format");s(j.data)}catch{y("Datei konnte nicht gelesen werden – Vorschau der Inhalte nicht möglich. Import würde trotzdem versucht (alle Bereiche).")}},P=t=>{w(r=>{const a=new Set(r);return a.has(t)?a.delete(t):a.add(t),a})},A=async t=>{if(t.preventDefault(),!(!l||!h||o.size===0)){B(!0),b(""),x(null);try{const r=new FormData;r.append("file",l),r.append("sections",JSON.stringify([...o])),r.append("include_accounts",g?"1":"0");const a=await F.post("/settings/import",r);x(a),d(null),s(null),_(!1),m(!1),t.target.reset()}catch(r){b(r.message)}finally{B(!1)}}},k=p.filter(t=>o.has(t.key)).map(t=>t.label);return g&&k.push("Benutzerkonten"),e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten exportieren"}),e.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 ",e.jsx("strong",{children:"nicht"})," enthalten."]}),e.jsxs("label",{className:"mb-3 flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:N,onChange:t=>E(t.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)"]}),e.jsx("a",{href:`${D}/settings/export${N?"?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"})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten importieren"}),e.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."}),e.jsxs("form",{onSubmit:A,className:"space-y-4",children:[e.jsx("input",{type:"file",accept:"application/json,.json",onChange:I,className:"text-sm"}),l&&e.jsxs("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-700",children:[e.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?"}),c&&e.jsx("p",{className:"px-4 pt-3 text-sm text-amber-600 dark:text-amber-400",children:c}),e.jsxs("div",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[p.map(t=>e.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:[e.jsx("input",{type:"checkbox",checked:o.has(t.key),onChange:()=>P(t.key),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:t.label}),e.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:i?L(i,t.tables):t.hint})]})]},t.key)),e.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:[e.jsx("input",{type:"checkbox",checked:g,onChange:t=>m(t.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),e.jsxs("span",{className:"flex-1",children:[e.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:"Benutzerkonten"}),e.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.'})]})]})]})]}),e.jsxs("label",{className:"flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:h,onChange:t=>_(t.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"," ",k.length?e.jsx("strong",{children:k.join(", ")}):"die ausgewählten Bereiche"," auf diesem Server unwiderruflich ersetzt."]}),e.jsx("button",{type:"submit",disabled:!l||!h||S||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:S?"Importiere…":"Importieren"})]}),v&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:v}),u&&e.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:[e.jsx("p",{className:"mb-1 font-semibold",children:"Import erfolgreich:"}),e.jsxs("ul",{className:"list-disc pl-5",children:[Object.entries(u.counts).map(([t,r])=>e.jsxs("li",{children:[r," ",z[t]||t]},t)),u.images_restored>0&&e.jsxs("li",{children:[u.images_restored," Bilder wiederhergestellt"]})]})]})]})]})}export{C as default}; diff --git a/hifi/assets/Faqs-Dx6P5rru.js b/hifi/assets/Faqs-C6vUqhGa.js similarity index 94% rename from hifi/assets/Faqs-Dx6P5rru.js rename to hifi/assets/Faqs-C6vUqhGa.js index 8e4b573..e2cfe80 100644 --- a/hifi/assets/Faqs-Dx6P5rru.js +++ b/hifi/assets/Faqs-C6vUqhGa.js @@ -1 +1 @@ -import{j as e,P as d,B as t,z as c,F as i,x as o,W as l,U as u}from"./index-eQrgtQRM.js";import{u as h,E as g,R as p}from"./EntityList-CgZqBKVk.js";import"./SortableList-B1XU_999.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";const x={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function b(){const n=h({endpoint:"/faqs",reorderKey:"faqs",source:"faqs",emptyForm:x,toForm:r=>({question_de:r.question_de,answer_de:r.answer_de,question_en:r.question_en,answer_en:r.answer_en,sort_order:r.sort_order}),toPayload:r=>({...r,sort_order:Number(r.sort_order)}),labels:{created:"Frage angelegt.",saved:"Frage gespeichert.",deleted:"Frage gelöscht."}}),{form:s,change:a}=n;return e.jsxs("div",{children:[e.jsx(d,{title:"Häufige Fragen",description:"Erscheinen im FAQ-Bereich der Startseite, jeweils in der gewählten Sprache. Reihenfolge am Griff links ziehen.",actions:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"secondary",icon:"eye",href:"/#faq",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),e.jsx(t,{icon:"plus",onClick:()=>n.openPanel(null),children:"Neue Frage"})]})}),e.jsx(g,{items:n.items,editingId:n.editing,onReorder:n.reorder,onOpen:n.openPanel,onDelete:r=>n.remove(r,`Frage „${r.question_de}“ wirklich löschen?`),searchText:r=>`${r.question_de} ${r.answer_de}`,searchPlaceholder:"Frage suchen …",empty:{icon:"help",title:"Noch keine Fragen",description:"Typische Kundenfragen sparen dir Telefonate.",actions:e.jsx(t,{icon:"plus",onClick:()=>n.openPanel(null),children:"Neue Frage"})},renderRow:r=>({media:e.jsx(p,{icon:"help"}),title:r.question_de,subtitle:r.answer_de})}),e.jsxs(c,{as:"form",onSubmit:n.submit,open:n.editing!==null,onClose:n.closePanel,size:"lg",title:n.isNew?"Neue Frage":"Frage bearbeiten",footer:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"secondary",onClick:n.closePanel,children:"Abbrechen"}),e.jsx(t,{type:"submit",disabled:n.saving||!n.isNew&&!n.dirty,children:n.saving?"Speichere…":n.isNew?"Anlegen":"Speichern"})]}),children:[n.error&&e.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:n.error}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h3",{className:"flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Deutsch"}),e.jsx(i,{label:"Frage",required:!0,children:e.jsx(o,{required:!0,autoFocus:!0,value:s.question_de,onChange:r=>a({question_de:r.target.value}),placeholder:"z. B. Wie lange dauert ein Einbau?"})}),e.jsx(i,{label:"Antwort",required:!0,children:e.jsx(l,{required:!0,rows:4,value:s.answer_de,onChange:r=>a({answer_de:r.target.value})})})]}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:["Englisch ",(!s.question_en||!s.answer_en)&&e.jsx(u,{tone:"amber",children:"fehlt noch"})]}),e.jsx(i,{label:"Frage",required:!0,children:e.jsx(o,{required:!0,value:s.question_en,onChange:r=>a({question_en:r.target.value}),placeholder:"e.g. How long does an installation take?"})}),e.jsx(i,{label:"Antwort",required:!0,children:e.jsx(l,{required:!0,rows:4,value:s.answer_en,onChange:r=>a({answer_en:r.target.value})})})]})]})]})}export{b as default}; +import{j as e,P as d,B as t,z as c,F as i,x as o,W as l,U as u}from"./index-CPMnKQBc.js";import{u as h,E as g,R as p}from"./EntityList-DPxkbA95.js";import"./SortableList-Dgddukss.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";const x={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function b(){const n=h({endpoint:"/faqs",reorderKey:"faqs",source:"faqs",emptyForm:x,toForm:r=>({question_de:r.question_de,answer_de:r.answer_de,question_en:r.question_en,answer_en:r.answer_en,sort_order:r.sort_order}),toPayload:r=>({...r,sort_order:Number(r.sort_order)}),labels:{created:"Frage angelegt.",saved:"Frage gespeichert.",deleted:"Frage gelöscht."}}),{form:s,change:a}=n;return e.jsxs("div",{children:[e.jsx(d,{title:"Häufige Fragen",description:"Erscheinen im FAQ-Bereich der Startseite, jeweils in der gewählten Sprache. Reihenfolge am Griff links ziehen.",actions:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"secondary",icon:"eye",href:"/#faq",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),e.jsx(t,{icon:"plus",onClick:()=>n.openPanel(null),children:"Neue Frage"})]})}),e.jsx(g,{items:n.items,editingId:n.editing,onReorder:n.reorder,onOpen:n.openPanel,onDelete:r=>n.remove(r,`Frage „${r.question_de}“ wirklich löschen?`),searchText:r=>`${r.question_de} ${r.answer_de}`,searchPlaceholder:"Frage suchen …",empty:{icon:"help",title:"Noch keine Fragen",description:"Typische Kundenfragen sparen dir Telefonate.",actions:e.jsx(t,{icon:"plus",onClick:()=>n.openPanel(null),children:"Neue Frage"})},renderRow:r=>({media:e.jsx(p,{icon:"help"}),title:r.question_de,subtitle:r.answer_de})}),e.jsxs(c,{as:"form",onSubmit:n.submit,open:n.editing!==null,onClose:n.closePanel,size:"lg",title:n.isNew?"Neue Frage":"Frage bearbeiten",footer:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"secondary",onClick:n.closePanel,children:"Abbrechen"}),e.jsx(t,{type:"submit",disabled:n.saving||!n.isNew&&!n.dirty,children:n.saving?"Speichere…":n.isNew?"Anlegen":"Speichern"})]}),children:[n.error&&e.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:n.error}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h3",{className:"flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Deutsch"}),e.jsx(i,{label:"Frage",required:!0,children:e.jsx(o,{required:!0,autoFocus:!0,value:s.question_de,onChange:r=>a({question_de:r.target.value}),placeholder:"z. B. Wie lange dauert ein Einbau?"})}),e.jsx(i,{label:"Antwort",required:!0,children:e.jsx(l,{required:!0,rows:4,value:s.answer_de,onChange:r=>a({answer_de:r.target.value})})})]}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:["Englisch ",(!s.question_en||!s.answer_en)&&e.jsx(u,{tone:"amber",children:"fehlt noch"})]}),e.jsx(i,{label:"Frage",required:!0,children:e.jsx(o,{required:!0,value:s.question_en,onChange:r=>a({question_en:r.target.value}),placeholder:"e.g. How long does an installation take?"})}),e.jsx(i,{label:"Antwort",required:!0,children:e.jsx(l,{required:!0,rows:4,value:s.answer_en,onChange:r=>a({answer_en:r.target.value})})})]})]})]})}export{b as default}; diff --git a/hifi/assets/GalleryBrandPage-COmMjCa1.js b/hifi/assets/GalleryBrandPage-t_SqSVK1.js similarity index 96% rename from hifi/assets/GalleryBrandPage-COmMjCa1.js rename to hifi/assets/GalleryBrandPage-t_SqSVK1.js index ddd0689..e525f2f 100644 --- a/hifi/assets/GalleryBrandPage-COmMjCa1.js +++ b/hifi/assets/GalleryBrandPage-t_SqSVK1.js @@ -1 +1 @@ -import{g as c,r as n,u as g,a as m,c as u,b as p,j as a,N as h,e as f,L as b,d as y,f as v}from"./index-eQrgtQRM.js";function N(){const{brandSlug:r}=c(),[t,i]=n.useState(null),[l,d]=n.useState(null),{t:s}=g(),{gallery_card_text_x:o,gallery_card_text_y:x}=m();return n.useEffect(()=>{u.get(`/gallery-brands/${r}/projects`).then(i).catch(e=>d(e))},[r]),p({title:t?s("galleryBrandPage.metaTitle")(t.brand.name):s("galleryBrandPage.metaTitleFallback"),description:t?s("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${r}`}),l?l.status===404?a.jsx(h,{}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:f(l,s)}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",s("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(e=>a.jsxs(b,{to:`/galerie/${r}/${e.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[e.cover_image_path?a.jsx("img",{src:e.cover_image_path,alt:e.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):a.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),a.jsx(y,{entity:"gallery_projects",id:e.id,field:"name",lang:"de",value:e.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:v(o,x,{x:0,y:100})})]},e.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:s("galleryBrandPage.loading")})}export{N as default}; +import{g as c,r as n,u as g,a as m,c as u,b as p,j as a,N as h,e as f,L as b,d as y,f as v}from"./index-CPMnKQBc.js";function N(){const{brandSlug:r}=c(),[t,i]=n.useState(null),[l,d]=n.useState(null),{t:s}=g(),{gallery_card_text_x:o,gallery_card_text_y:x}=m();return n.useEffect(()=>{u.get(`/gallery-brands/${r}/projects`).then(i).catch(e=>d(e))},[r]),p({title:t?s("galleryBrandPage.metaTitle")(t.brand.name):s("galleryBrandPage.metaTitleFallback"),description:t?s("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${r}`}),l?l.status===404?a.jsx(h,{}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:f(l,s)}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",s("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(e=>a.jsxs(b,{to:`/galerie/${r}/${e.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[e.cover_image_path?a.jsx("img",{src:e.cover_image_path,alt:e.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):a.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),a.jsx(y,{entity:"gallery_projects",id:e.id,field:"name",lang:"de",value:e.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:v(o,x,{x:0,y:100})})]},e.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:s("galleryBrandPage.loading")})}export{N as default}; diff --git a/hifi/assets/GalleryBrands-BZZtQ1we.js b/hifi/assets/GalleryBrands-D7kDEUzQ.js similarity index 93% rename from hifi/assets/GalleryBrands-BZZtQ1we.js rename to hifi/assets/GalleryBrands-D7kDEUzQ.js index b31f30e..61a8bd4 100644 --- a/hifi/assets/GalleryBrands-BZZtQ1we.js +++ b/hifi/assets/GalleryBrands-D7kDEUzQ.js @@ -1 +1 @@ -import{r as l,v as R,w as M,j as e,c as m}from"./index-eQrgtQRM.js";import F from"./ImageUploadField-2si66K3r.js";import{S as C,s as E}from"./SortableList-B1XU_999.js";import{V as k}from"./ViewOnSite-B0vt49HS.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";const h={name:"",cover_image_path:"",sort_order:0};function V(){const[o,d]=l.useState([]),[a,c]=l.useState(h),[N,g]=l.useState(h),[s,p]=l.useState(null),[b,f]=l.useState(""),j=l.useRef(null),i=R();M(JSON.stringify(a)!==JSON.stringify(N),"gallery-brands");const x=()=>m.get("/gallery-brands").then(d);l.useEffect(()=>{x()},[]);const y=t=>{var n;const r={name:t.name,cover_image_path:t.cover_image_path||"",sort_order:t.sort_order};p(t.id),c(r),g(r),(n=j.current)==null||n.scrollIntoView({behavior:"smooth",block:"start"})},u=()=>{p(null),c(h),g(h)},v=async t=>{t.preventDefault(),f("");try{if(s)await m.put(`/gallery-brands/${s}`,a);else{const r=o.reduce((n,S)=>Math.max(n,Number(S.sort_order)||0),0)+10;await m.post("/gallery-brands",{...a,sort_order:r})}i.success(s?"Marke gespeichert.":"Marke angelegt."),u(),x()}catch(r){f(r.message)}},w=async t=>{if(confirm("Marke inkl. aller Projekte/Fotos wirklich löschen?"))try{await m.delete(`/gallery-brands/${t}`),s===t&&u(),i.success("Marke gelöscht."),x()}catch(r){i.error(`Löschen fehlgeschlagen: ${r.message}`)}},_=async t=>{const r=o;d(t);try{d(await E("gallery-brands",t)),i.success("Reihenfolge gespeichert.")}catch(n){d(r),i.error(`Reihenfolge konnte nicht gespeichert werden: ${n.message}`)}};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Marken"}),e.jsx(k,{to:"/galerie"})]}),e.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Reihenfolge am Griff links per Ziehen ändern."}),e.jsxs("div",{className:"overflow-x-auto rounded-xl border border-neutral-200 dark:border-neutral-800",children:[e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"w-10 px-2 py-2",children:e.jsx("span",{className:"sr-only",children:"Reihenfolge"})}),e.jsx("th",{className:"px-4 py-2",children:"Bild"}),e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsx(C,{items:o,onReorder:_,as:"tbody",className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(t,r)=>e.jsxs(e.Fragment,{children:[e.jsx("td",{className:"bg-white px-2 py-2 dark:bg-neutral-950",children:r}),e.jsx("td",{className:"bg-white px-4 py-2 dark:bg-neutral-950",children:t.cover_image_path?e.jsx("img",{src:t.cover_image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):e.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:"–"})}),e.jsxs("td",{className:"bg-white px-4 py-2 font-medium text-neutral-800 dark:bg-neutral-950 dark:text-neutral-100",children:[t.name,e.jsx(k,{to:`/galerie/${t.slug}`,className:"ml-2"})]}),e.jsxs("td",{className:"whitespace-nowrap bg-white px-4 py-2 text-right dark:bg-neutral-950",children:[e.jsx("button",{onClick:()=>y(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>w(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]})})]}),o.length===0&&e.jsx("p",{className:"px-4 py-6 text-center text-sm text-neutral-400",children:"Noch keine Galerie-Marken angelegt."})]})]}),e.jsxs("form",{ref:j,onSubmit:v,className:"h-fit scroll-mt-20 space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:a.name,onChange:t=>c({...a,name: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"})]}),e.jsx(F,{value:a.cover_image_path,onChange:t=>c({...a,cover_image_path:t}),aspect:4/3,label:"Titelbild (optional)"}),b&&e.jsx("p",{className:"text-sm text-red-600",children:b}),e.jsxs("div",{className:"flex gap-2",children:[e.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&&e.jsx("button",{type:"button",onClick:u,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{V as default}; +import{r as l,v as R,w as M,j as e,c as m}from"./index-CPMnKQBc.js";import F from"./ImageUploadField-DGJRkWaj.js";import{S as C,s as E}from"./SortableList-Dgddukss.js";import{V as k}from"./ViewOnSite-Dn1Ym5u6.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";const h={name:"",cover_image_path:"",sort_order:0};function V(){const[o,d]=l.useState([]),[a,c]=l.useState(h),[N,g]=l.useState(h),[s,p]=l.useState(null),[b,f]=l.useState(""),j=l.useRef(null),i=R();M(JSON.stringify(a)!==JSON.stringify(N),"gallery-brands");const x=()=>m.get("/gallery-brands").then(d);l.useEffect(()=>{x()},[]);const y=t=>{var n;const r={name:t.name,cover_image_path:t.cover_image_path||"",sort_order:t.sort_order};p(t.id),c(r),g(r),(n=j.current)==null||n.scrollIntoView({behavior:"smooth",block:"start"})},u=()=>{p(null),c(h),g(h)},v=async t=>{t.preventDefault(),f("");try{if(s)await m.put(`/gallery-brands/${s}`,a);else{const r=o.reduce((n,S)=>Math.max(n,Number(S.sort_order)||0),0)+10;await m.post("/gallery-brands",{...a,sort_order:r})}i.success(s?"Marke gespeichert.":"Marke angelegt."),u(),x()}catch(r){f(r.message)}},w=async t=>{if(confirm("Marke inkl. aller Projekte/Fotos wirklich löschen?"))try{await m.delete(`/gallery-brands/${t}`),s===t&&u(),i.success("Marke gelöscht."),x()}catch(r){i.error(`Löschen fehlgeschlagen: ${r.message}`)}},_=async t=>{const r=o;d(t);try{d(await E("gallery-brands",t)),i.success("Reihenfolge gespeichert.")}catch(n){d(r),i.error(`Reihenfolge konnte nicht gespeichert werden: ${n.message}`)}};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Marken"}),e.jsx(k,{to:"/galerie"})]}),e.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Reihenfolge am Griff links per Ziehen ändern."}),e.jsxs("div",{className:"overflow-x-auto rounded-xl border border-neutral-200 dark:border-neutral-800",children:[e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"w-10 px-2 py-2",children:e.jsx("span",{className:"sr-only",children:"Reihenfolge"})}),e.jsx("th",{className:"px-4 py-2",children:"Bild"}),e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsx(C,{items:o,onReorder:_,as:"tbody",className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(t,r)=>e.jsxs(e.Fragment,{children:[e.jsx("td",{className:"bg-white px-2 py-2 dark:bg-neutral-950",children:r}),e.jsx("td",{className:"bg-white px-4 py-2 dark:bg-neutral-950",children:t.cover_image_path?e.jsx("img",{src:t.cover_image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):e.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:"–"})}),e.jsxs("td",{className:"bg-white px-4 py-2 font-medium text-neutral-800 dark:bg-neutral-950 dark:text-neutral-100",children:[t.name,e.jsx(k,{to:`/galerie/${t.slug}`,className:"ml-2"})]}),e.jsxs("td",{className:"whitespace-nowrap bg-white px-4 py-2 text-right dark:bg-neutral-950",children:[e.jsx("button",{onClick:()=>y(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>w(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]})})]}),o.length===0&&e.jsx("p",{className:"px-4 py-6 text-center text-sm text-neutral-400",children:"Noch keine Galerie-Marken angelegt."})]})]}),e.jsxs("form",{ref:j,onSubmit:v,className:"h-fit scroll-mt-20 space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:a.name,onChange:t=>c({...a,name: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"})]}),e.jsx(F,{value:a.cover_image_path,onChange:t=>c({...a,cover_image_path:t}),aspect:4/3,label:"Titelbild (optional)"}),b&&e.jsx("p",{className:"text-sm text-red-600",children:b}),e.jsxs("div",{className:"flex gap-2",children:[e.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&&e.jsx("button",{type:"button",onClick:u,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{V as default}; diff --git a/hifi/assets/GalleryOverview-nP1qGopa.js b/hifi/assets/GalleryOverview-PXKemgAt.js similarity index 96% rename from hifi/assets/GalleryOverview-nP1qGopa.js rename to hifi/assets/GalleryOverview-PXKemgAt.js index 47128f2..17e323b 100644 --- a/hifi/assets/GalleryOverview-nP1qGopa.js +++ b/hifi/assets/GalleryOverview-PXKemgAt.js @@ -1 +1 @@ -import{r,u as d,a as g,b as u,c as m,j as e,E as i,e as p,L as v,d as h,f as y}from"./index-eQrgtQRM.js";function w(){const[a,o]=r.useState(null),[l,n]=r.useState(null),{t:s}=d(),{gallery_card_text_x:c,gallery_card_text_y:x}=g();return u({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),r.useEffect(()=>{m.get("/gallery-brands").then(o).catch(t=>n(t))},[]),e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(i,{k:"galleryOverview.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),e.jsx(i,{k:"galleryOverview.intro",as:"p",className:"mb-8 block text-neutral-600 dark:text-neutral-300"}),l&&e.jsx("p",{className:"text-red-600",children:typeof l=="string"?l:p(l,s)}),!a&&!l&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),a&&a.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:a==null?void 0:a.map(t=>e.jsxs(v,{to:`/galerie/${t.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[t.cover_image_path?e.jsx("img",{src:t.cover_image_path,alt:t.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),e.jsx(h,{entity:"gallery_brands",id:t.id,field:"name",lang:"de",value:t.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:y(c,x,{x:0,y:100})})]},t.id))})]})}export{w as default}; +import{r,u as d,a as g,b as u,c as m,j as e,E as i,e as p,L as v,d as h,f as y}from"./index-CPMnKQBc.js";function w(){const[a,o]=r.useState(null),[l,n]=r.useState(null),{t:s}=d(),{gallery_card_text_x:c,gallery_card_text_y:x}=g();return u({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),r.useEffect(()=>{m.get("/gallery-brands").then(o).catch(t=>n(t))},[]),e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(i,{k:"galleryOverview.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),e.jsx(i,{k:"galleryOverview.intro",as:"p",className:"mb-8 block text-neutral-600 dark:text-neutral-300"}),l&&e.jsx("p",{className:"text-red-600",children:typeof l=="string"?l:p(l,s)}),!a&&!l&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),a&&a.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:a==null?void 0:a.map(t=>e.jsxs(v,{to:`/galerie/${t.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[t.cover_image_path?e.jsx("img",{src:t.cover_image_path,alt:t.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),e.jsx(h,{entity:"gallery_brands",id:t.id,field:"name",lang:"de",value:t.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:y(c,x,{x:0,y:100})})]},t.id))})]})}export{w as default}; diff --git a/hifi/assets/GalleryPhotos-B-ALbtsa.js b/hifi/assets/GalleryPhotos-CAByXSPv.js similarity index 94% rename from hifi/assets/GalleryPhotos-B-ALbtsa.js rename to hifi/assets/GalleryPhotos-CAByXSPv.js index 4834d4d..73d4573 100644 --- a/hifi/assets/GalleryPhotos-B-ALbtsa.js +++ b/hifi/assets/GalleryPhotos-CAByXSPv.js @@ -1,3 +1,3 @@ -import{g as z,r as l,v as B,c as d,j as t,L as C}from"./index-eQrgtQRM.js";import{S as M,s as D}from"./SortableList-B1XU_999.js";import{V as G}from"./ViewOnSite-B0vt49HS.js";import{r as L,M as A,f as I}from"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";function J(){const{projectId:m}=z(),[u,h]=l.useState([]),[c,v]=l.useState(null),[f,j]=l.useState(""),[b,w]=l.useState(!1),[$,y]=l.useState(""),p=l.useRef(null),s=B(),x=()=>d.get(`/gallery-projects/${m}/photos`).then(h);l.useEffect(()=>{x(),d.get("/gallery-projects").then(e=>v(e.find(r=>String(r.id)===String(m))||null)).catch(()=>{})},[m]);const F=async e=>{const r=Array.from(e.target.files||[]);if(r.length===0)return;j(""),w(!0);let a=u.reduce((o,i)=>Math.max(o,Number(i.sort_order)||0),0),n=0;const g=[];for(let o=0;oA)throw new Error(`zu groß (${I(i.size)}, max. 5 MB)`);const k=new FormData;k.append("file",i);const E=await d.post("/uploads",k);a+=10,await d.post("/gallery-photos",{gallery_project_id:Number(m),image_path:E.path,sort_order:a}),n++}catch(i){g.push(`${r[o].name}: ${i.message}`)}}w(!1),y(""),p.current&&(p.current.value=""),x(),g.length===0?s.success(n===1?"1 Foto hochgeladen.":`${n} Fotos hochgeladen.`):(j(`Nicht hochgeladen: +import{g as z,r as l,v as B,c as d,j as t,L as C}from"./index-CPMnKQBc.js";import{S as M,s as D}from"./SortableList-Dgddukss.js";import{V as G}from"./ViewOnSite-Dn1Ym5u6.js";import{r as L,M as A,f as I}from"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";function J(){const{projectId:m}=z(),[u,h]=l.useState([]),[c,v]=l.useState(null),[f,j]=l.useState(""),[b,w]=l.useState(!1),[$,y]=l.useState(""),p=l.useRef(null),s=B(),x=()=>d.get(`/gallery-projects/${m}/photos`).then(h);l.useEffect(()=>{x(),d.get("/gallery-projects").then(e=>v(e.find(r=>String(r.id)===String(m))||null)).catch(()=>{})},[m]);const F=async e=>{const r=Array.from(e.target.files||[]);if(r.length===0)return;j(""),w(!0);let a=u.reduce((o,i)=>Math.max(o,Number(i.sort_order)||0),0),n=0;const g=[];for(let o=0;oA)throw new Error(`zu groß (${I(i.size)}, max. 5 MB)`);const k=new FormData;k.append("file",i);const E=await d.post("/uploads",k);a+=10,await d.post("/gallery-photos",{gallery_project_id:Number(m),image_path:E.path,sort_order:a}),n++}catch(i){g.push(`${r[o].name}: ${i.message}`)}}w(!1),y(""),p.current&&(p.current.value=""),x(),g.length===0?s.success(n===1?"1 Foto hochgeladen.":`${n} Fotos hochgeladen.`):(j(`Nicht hochgeladen: ${g.join(` `)}`),s.error(`${n} hochgeladen, ${g.length} fehlgeschlagen.`))},P=(e,r)=>{h(a=>a.map(n=>n.id===e.id?{...n,caption:r}:n))},N=l.useRef(null),S=async e=>{if((e.caption||"")!==N.current)try{await d.put(`/gallery-photos/${e.id}`,{caption:e.caption,sort_order:e.sort_order}),s.success("Bildunterschrift gespeichert.")}catch(r){s.error(`Speichern fehlgeschlagen: ${r.message}`)}},_=async e=>{if(confirm("Foto wirklich entfernen?"))try{await d.delete(`/gallery-photos/${e}`),s.success("Foto entfernt."),x()}catch(r){s.error(`Entfernen fehlgeschlagen: ${r.message}`)}},R=async e=>{const r=u;h(e);try{h(await D("gallery-photos",e)),s.success("Reihenfolge gespeichert.")}catch(a){h(r),s.error(`Reihenfolge konnte nicht gespeichert werden: ${a.message}`)}};return t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-sm",children:t.jsx(C,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),t.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t.jsxs("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:["Fotos im Projekt",c?`: ${c.brand_name} ${c.name}`:""]}),c&&t.jsx(G,{to:`/galerie/${c.brand_slug}/${c.slug}`})]}),t.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),t.jsx("input",{ref:p,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:F,disabled:b,className:"text-sm"}),t.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"JPG, PNG oder WebP, große Fotos werden automatisch verkleinert."}),b&&t.jsx("p",{className:"mt-2 text-sm text-neutral-500","aria-live":"polite",children:$})]}),f&&t.jsx("p",{className:"mb-4 whitespace-pre-line text-sm text-red-600",children:f}),u.length>1&&t.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:"Reihenfolge am Griff per Ziehen ändern."}),t.jsx(M,{items:u,onReorder:R,as:"grid",className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:(e,r)=>t.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("img",{src:e.image_path,alt:e.caption||"",className:"aspect-square w-full object-cover",loading:"lazy"}),t.jsxs("div",{className:"space-y-2 p-3",children:[t.jsx("input",{value:e.caption||"",onChange:a=>P(e,a.target.value),onFocus:()=>{N.current=e.caption||""},onBlur:()=>S(e),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"}),t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r,t.jsx("button",{onClick:()=>_(e.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]})}),u.length===0&&t.jsx("p",{className:"py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})}export{J as default}; diff --git a/hifi/assets/GalleryProjectPage-keVFhaZs.js b/hifi/assets/GalleryProjectPage-FUov0YU4.js similarity index 98% rename from hifi/assets/GalleryProjectPage-keVFhaZs.js rename to hifi/assets/GalleryProjectPage-FUov0YU4.js index d6a95f1..e8a638a 100644 --- a/hifi/assets/GalleryProjectPage-keVFhaZs.js +++ b/hifi/assets/GalleryProjectPage-FUov0YU4.js @@ -1 +1 @@ -import{u as g,r as x,h as j,j as e,g as b,c as w,b as f,N as k,e as y,d as v,R as P,E as h,L as N}from"./index-eQrgtQRM.js";function L({photos:o,index:s,onClose:t,onNavigate:n}){const{t:i}=g();if(x.useEffect(()=>{if(s==null)return;const a=r=>{r.key==="Escape"&&t(),r.key==="ArrowRight"&&n(1),r.key==="ArrowLeft"&&n(-1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,t,n]),s==null)return null;const d=o[s],c=a=>a.stopPropagation();return j.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:t,children:[e.jsx("button",{onClick:a=>{c(a),t()},"aria-label":i("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(-1)},"aria-label":i("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:e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),e.jsx("img",{src:d.image_path,alt:d.caption||"",onClick:c,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(1)},"aria-label":i("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:e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),d.caption&&e.jsx("p",{onClick:c,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:d.caption})]}),document.body)}function C(){const{brandSlug:o,projectSlug:s}=b(),[t,n]=x.useState(null),[i,d]=x.useState(null),[c,a]=x.useState(null),{t:r}=g();x.useEffect(()=>{w.get(`/gallery-brands/${o}/${s}/photos`).then(n).catch(l=>d(l))},[o,s]),f({title:t?`${t.project.name} – ${t.project.brand_name}`:r("galleryProjectPage.metaTitleFallback"),description:t?r("galleryProjectPage.metaDescription")(t.project.name):void 0,path:`/galerie/${o}/${s}`});const p=l=>{a(u=>{const m=t.photos.length;return(u+l+m)%m})};return i?i.status===404?e.jsx(k,{}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:y(i,r)}):t?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(v,{entity:"gallery_projects",id:t.project.id,field:"name",lang:"de",value:t.project.name,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),t.photos.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:r("galleryProjectPage.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:t.photos.map((l,u)=>e.jsx(P,{index:u%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:e.jsx("button",{onClick:()=>a(u),className:"block h-full w-full","aria-label":l.caption||r("galleryProjectPage.enlargeImage"),children:e.jsx("img",{src:l.image_path,alt:l.caption||"",loading:"lazy",decoding:"async",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},l.id))}),e.jsxs("div",{className:"mt-12 flex flex-col items-start gap-4 rounded-2xl border border-neutral-200 bg-white p-6 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(h,{k:"galleryProjectPage.ctaTitle",as:"h2",className:"block text-lg font-bold text-neutral-900 dark:text-white"}),e.jsx(h,{k:"galleryProjectPage.ctaText",as:"p",className:"mt-1 block text-sm text-neutral-600 dark:text-neutral-300"})]}),e.jsx(N,{to:`/kontakt?${new URLSearchParams({topic:r("galleryProjectPage.ctaTopic")(t.project.name)}).toString()}`,className:"shrink-0 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:e.jsx(h,{k:"galleryProjectPage.ctaButton"})})]}),e.jsx(L,{photos:t.photos,index:c,onClose:()=>a(null),onNavigate:p})]}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:r("galleryProjectPage.loading")})}export{C as default}; +import{u as g,r as x,h as j,j as e,g as b,c as w,b as f,N as k,e as y,d as v,R as P,E as h,L as N}from"./index-CPMnKQBc.js";function L({photos:o,index:s,onClose:t,onNavigate:n}){const{t:i}=g();if(x.useEffect(()=>{if(s==null)return;const a=r=>{r.key==="Escape"&&t(),r.key==="ArrowRight"&&n(1),r.key==="ArrowLeft"&&n(-1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,t,n]),s==null)return null;const d=o[s],c=a=>a.stopPropagation();return j.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:t,children:[e.jsx("button",{onClick:a=>{c(a),t()},"aria-label":i("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(-1)},"aria-label":i("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:e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),e.jsx("img",{src:d.image_path,alt:d.caption||"",onClick:c,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(1)},"aria-label":i("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:e.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:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),d.caption&&e.jsx("p",{onClick:c,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:d.caption})]}),document.body)}function C(){const{brandSlug:o,projectSlug:s}=b(),[t,n]=x.useState(null),[i,d]=x.useState(null),[c,a]=x.useState(null),{t:r}=g();x.useEffect(()=>{w.get(`/gallery-brands/${o}/${s}/photos`).then(n).catch(l=>d(l))},[o,s]),f({title:t?`${t.project.name} – ${t.project.brand_name}`:r("galleryProjectPage.metaTitleFallback"),description:t?r("galleryProjectPage.metaDescription")(t.project.name):void 0,path:`/galerie/${o}/${s}`});const p=l=>{a(u=>{const m=t.photos.length;return(u+l+m)%m})};return i?i.status===404?e.jsx(k,{}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:y(i,r)}):t?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(v,{entity:"gallery_projects",id:t.project.id,field:"name",lang:"de",value:t.project.name,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),t.photos.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:r("galleryProjectPage.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:t.photos.map((l,u)=>e.jsx(P,{index:u%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:e.jsx("button",{onClick:()=>a(u),className:"block h-full w-full","aria-label":l.caption||r("galleryProjectPage.enlargeImage"),children:e.jsx("img",{src:l.image_path,alt:l.caption||"",loading:"lazy",decoding:"async",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},l.id))}),e.jsxs("div",{className:"mt-12 flex flex-col items-start gap-4 rounded-2xl border border-neutral-200 bg-white p-6 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(h,{k:"galleryProjectPage.ctaTitle",as:"h2",className:"block text-lg font-bold text-neutral-900 dark:text-white"}),e.jsx(h,{k:"galleryProjectPage.ctaText",as:"p",className:"mt-1 block text-sm text-neutral-600 dark:text-neutral-300"})]}),e.jsx(N,{to:`/kontakt?${new URLSearchParams({topic:r("galleryProjectPage.ctaTopic")(t.project.name)}).toString()}`,className:"shrink-0 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:e.jsx(h,{k:"galleryProjectPage.ctaButton"})})]}),e.jsx(L,{photos:t.photos,index:c,onClose:()=>a(null),onNavigate:p})]}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:r("galleryProjectPage.loading")})}export{C as default}; diff --git a/hifi/assets/GalleryProjects-ClLNEVBB.js b/hifi/assets/GalleryProjects-DFKgMPpK.js similarity index 95% rename from hifi/assets/GalleryProjects-ClLNEVBB.js rename to hifi/assets/GalleryProjects-DFKgMPpK.js index cf5c9fc..8fc2726 100644 --- a/hifi/assets/GalleryProjects-ClLNEVBB.js +++ b/hifi/assets/GalleryProjects-DFKgMPpK.js @@ -1 +1 @@ -import{r as a,v as L,w as I,j as e,L as T,c as h}from"./index-eQrgtQRM.js";import z from"./ImageUploadField-2si66K3r.js";import{S as G,s as O}from"./SortableList-B1XU_999.js";import{V as F}from"./ViewOnSite-B0vt49HS.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";const b={name:"",gallery_brand_id:"",cover_image_path:"",sort_order:0};function H(){const[l,x]=a.useState([]),[y,C]=a.useState([]),[s,m]=a.useState(b),[R,N]=a.useState(b),[d,v]=a.useState(null),[_,w]=a.useState(""),[o,S]=a.useState("all"),P=a.useRef(null),u=L();I(JSON.stringify(s)!==JSON.stringify(R),"gallery-projects");const p=a.useMemo(()=>o==="all"?l:l.filter(t=>String(t.gallery_brand_id)===o),[l,o]),g=o!=="all",j=()=>{h.get("/gallery-projects").then(x),h.get("/gallery-brands").then(C)};a.useEffect(j,[]);const $=t=>{var n;const r={name:t.name,gallery_brand_id:t.gallery_brand_id,cover_image_path:t.cover_image_path||"",sort_order:t.sort_order};v(t.id),m(r),N(r),(n=P.current)==null||n.scrollIntoView({behavior:"smooth",block:"start"})},k=()=>{v(null),m(b),N(b)},M=async t=>{t.preventDefault(),w("");const r={...s,gallery_brand_id:Number(s.gallery_brand_id)};try{if(d)await h.put(`/gallery-projects/${d}`,r);else{const n=l.filter(c=>Number(c.gallery_brand_id)===r.gallery_brand_id).reduce((c,i)=>Math.max(c,Number(i.sort_order)||0),0)+10;await h.post("/gallery-projects",{...r,sort_order:n})}u.success(d?"Projekt gespeichert.":"Projekt angelegt."),k(),j()}catch(n){w(n.message)}},E=async t=>{if(confirm("Projekt inkl. aller Fotos wirklich löschen?"))try{await h.delete(`/gallery-projects/${t}`),d===t&&k(),u.success("Projekt gelöscht."),j()}catch(r){u.error(`Löschen fehlgeschlagen: ${r.message}`)}},A=async t=>{const r=l,n=new Set(t.map(i=>i.id)),c=i=>[...l.filter(B=>!n.has(B.id)),...i];x(c(t));try{x(c(await O("gallery-projects",t))),u.success("Reihenfolge gespeichert.")}catch(i){x(r),u.error(`Reihenfolge konnte nicht gespeichert werden: ${i.message}`)}},f="bg-white px-4 py-2 dark:bg-neutral-950";return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Projekte"}),e.jsx(F,{to:"/galerie"})]}),e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),e.jsxs("select",{value:o,onChange:t=>S(t.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:[e.jsx("option",{value:"all",children:"Alle Marken"}),y.map(t=>e.jsx("option",{value:String(t.id),children:t.name},t.id))]}),o!=="all"&&e.jsx("button",{onClick:()=>S("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),e.jsxs("span",{className:"text-sm text-neutral-400",children:[p.length," von ",l.length]})]}),e.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:g?"Reihenfolge am Griff links per Ziehen ändern.":"Zum Sortieren erst eine Marke auswählen."}),e.jsxs("div",{className:"overflow-x-auto rounded-xl border border-neutral-200 dark:border-neutral-800",children:[e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[g&&e.jsx("th",{className:"w-10 px-2 py-2",children:e.jsx("span",{className:"sr-only",children:"Reihenfolge"})}),e.jsx("th",{className:"px-4 py-2",children:"Marke"}),e.jsx("th",{className:"px-4 py-2",children:"Projekt"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsx(G,{items:p,onReorder:A,as:"tbody",disabled:!g,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(t,r)=>e.jsxs(e.Fragment,{children:[g&&e.jsx("td",{className:"bg-white px-2 py-2 dark:bg-neutral-950",children:r}),e.jsx("td",{className:f,children:t.brand_name}),e.jsxs("td",{className:`${f} font-medium text-neutral-800 dark:text-neutral-100`,children:[t.name,e.jsx(F,{to:`/galerie/${t.brand_slug}/${t.slug}`,className:"ml-2"})]}),e.jsxs("td",{className:`${f} whitespace-nowrap text-right`,children:[e.jsx(T,{to:`/admin/gallery-projects/${t.id}/photos`,className:"mr-3 text-brand-600 hover:underline",children:"Fotos"}),e.jsx("button",{onClick:()=>$(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>E(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]})})]}),p.length===0&&e.jsx("p",{className:"px-4 py-6 text-center text-sm text-neutral-400",children:l.length===0?"Noch keine Projekte angelegt.":"Keine Projekte für diese Marke."})]})]}),e.jsxs("form",{ref:P,onSubmit:M,className:"h-fit scroll-mt-20 space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:d?"Projekt bearbeiten":"Neues Projekt"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),e.jsxs("select",{required:!0,value:s.gallery_brand_id,onChange:t=>m({...s,gallery_brand_id: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:[e.jsx("option",{value:"",children:"Bitte wählen…"}),y.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Projektname *"}),e.jsx("input",{required:!0,placeholder:"z. B. Audi TT",value:s.name,onChange:t=>m({...s,name: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"})]}),e.jsx(z,{value:s.cover_image_path,onChange:t=>m({...s,cover_image_path:t}),aspect:4/3,label:"Titelbild (optional)"}),_&&e.jsx("p",{className:"text-sm text-red-600",children:_}),e.jsxs("div",{className:"flex gap-2",children:[e.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&&e.jsx("button",{type:"button",onClick:k,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{H as default}; +import{r as a,v as L,w as I,j as e,L as T,c as h}from"./index-CPMnKQBc.js";import z from"./ImageUploadField-DGJRkWaj.js";import{S as G,s as O}from"./SortableList-Dgddukss.js";import{V as F}from"./ViewOnSite-Dn1Ym5u6.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";const b={name:"",gallery_brand_id:"",cover_image_path:"",sort_order:0};function H(){const[l,x]=a.useState([]),[y,C]=a.useState([]),[s,m]=a.useState(b),[R,N]=a.useState(b),[d,v]=a.useState(null),[_,w]=a.useState(""),[o,S]=a.useState("all"),P=a.useRef(null),u=L();I(JSON.stringify(s)!==JSON.stringify(R),"gallery-projects");const p=a.useMemo(()=>o==="all"?l:l.filter(t=>String(t.gallery_brand_id)===o),[l,o]),g=o!=="all",j=()=>{h.get("/gallery-projects").then(x),h.get("/gallery-brands").then(C)};a.useEffect(j,[]);const $=t=>{var n;const r={name:t.name,gallery_brand_id:t.gallery_brand_id,cover_image_path:t.cover_image_path||"",sort_order:t.sort_order};v(t.id),m(r),N(r),(n=P.current)==null||n.scrollIntoView({behavior:"smooth",block:"start"})},k=()=>{v(null),m(b),N(b)},M=async t=>{t.preventDefault(),w("");const r={...s,gallery_brand_id:Number(s.gallery_brand_id)};try{if(d)await h.put(`/gallery-projects/${d}`,r);else{const n=l.filter(c=>Number(c.gallery_brand_id)===r.gallery_brand_id).reduce((c,i)=>Math.max(c,Number(i.sort_order)||0),0)+10;await h.post("/gallery-projects",{...r,sort_order:n})}u.success(d?"Projekt gespeichert.":"Projekt angelegt."),k(),j()}catch(n){w(n.message)}},E=async t=>{if(confirm("Projekt inkl. aller Fotos wirklich löschen?"))try{await h.delete(`/gallery-projects/${t}`),d===t&&k(),u.success("Projekt gelöscht."),j()}catch(r){u.error(`Löschen fehlgeschlagen: ${r.message}`)}},A=async t=>{const r=l,n=new Set(t.map(i=>i.id)),c=i=>[...l.filter(B=>!n.has(B.id)),...i];x(c(t));try{x(c(await O("gallery-projects",t))),u.success("Reihenfolge gespeichert.")}catch(i){x(r),u.error(`Reihenfolge konnte nicht gespeichert werden: ${i.message}`)}},f="bg-white px-4 py-2 dark:bg-neutral-950";return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Projekte"}),e.jsx(F,{to:"/galerie"})]}),e.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[e.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),e.jsxs("select",{value:o,onChange:t=>S(t.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:[e.jsx("option",{value:"all",children:"Alle Marken"}),y.map(t=>e.jsx("option",{value:String(t.id),children:t.name},t.id))]}),o!=="all"&&e.jsx("button",{onClick:()=>S("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),e.jsxs("span",{className:"text-sm text-neutral-400",children:[p.length," von ",l.length]})]}),e.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:g?"Reihenfolge am Griff links per Ziehen ändern.":"Zum Sortieren erst eine Marke auswählen."}),e.jsxs("div",{className:"overflow-x-auto rounded-xl border border-neutral-200 dark:border-neutral-800",children:[e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[g&&e.jsx("th",{className:"w-10 px-2 py-2",children:e.jsx("span",{className:"sr-only",children:"Reihenfolge"})}),e.jsx("th",{className:"px-4 py-2",children:"Marke"}),e.jsx("th",{className:"px-4 py-2",children:"Projekt"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsx(G,{items:p,onReorder:A,as:"tbody",disabled:!g,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(t,r)=>e.jsxs(e.Fragment,{children:[g&&e.jsx("td",{className:"bg-white px-2 py-2 dark:bg-neutral-950",children:r}),e.jsx("td",{className:f,children:t.brand_name}),e.jsxs("td",{className:`${f} font-medium text-neutral-800 dark:text-neutral-100`,children:[t.name,e.jsx(F,{to:`/galerie/${t.brand_slug}/${t.slug}`,className:"ml-2"})]}),e.jsxs("td",{className:`${f} whitespace-nowrap text-right`,children:[e.jsx(T,{to:`/admin/gallery-projects/${t.id}/photos`,className:"mr-3 text-brand-600 hover:underline",children:"Fotos"}),e.jsx("button",{onClick:()=>$(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>E(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]})})]}),p.length===0&&e.jsx("p",{className:"px-4 py-6 text-center text-sm text-neutral-400",children:l.length===0?"Noch keine Projekte angelegt.":"Keine Projekte für diese Marke."})]})]}),e.jsxs("form",{ref:P,onSubmit:M,className:"h-fit scroll-mt-20 space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:d?"Projekt bearbeiten":"Neues Projekt"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),e.jsxs("select",{required:!0,value:s.gallery_brand_id,onChange:t=>m({...s,gallery_brand_id: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:[e.jsx("option",{value:"",children:"Bitte wählen…"}),y.map(t=>e.jsx("option",{value:t.id,children:t.name},t.id))]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Projektname *"}),e.jsx("input",{required:!0,placeholder:"z. B. Audi TT",value:s.name,onChange:t=>m({...s,name: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"})]}),e.jsx(z,{value:s.cover_image_path,onChange:t=>m({...s,cover_image_path:t}),aspect:4/3,label:"Titelbild (optional)"}),_&&e.jsx("p",{className:"text-sm text-red-600",children:_}),e.jsxs("div",{className:"flex gap-2",children:[e.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&&e.jsx("button",{type:"button",onClick:k,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{H as default}; diff --git a/hifi/assets/HomeSections-8nB12J9S.js b/hifi/assets/HomeSections-FR9MpCKa.js similarity index 98% rename from hifi/assets/HomeSections-8nB12J9S.js rename to hifi/assets/HomeSections-FR9MpCKa.js index f464908..eea5729 100644 --- a/hifi/assets/HomeSections-8nB12J9S.js +++ b/hifi/assets/HomeSections-FR9MpCKa.js @@ -1 +1 @@ -import{a0 as q,r as i,v as Q,w as ee,c as _,j as e,A as z,C as L,f as te,t as b,F as h,x as m,U as ne,P as se,B as ae}from"./index-eQrgtQRM.js";import le from"./RichTextEditor-Da-meJrp.js";import{T as N}from"./TextStyleWidget-Cc-J2FBP.js";import{S as re}from"./SaveBar-DDpMGtuu.js";const p=[{slug:"hero",label:"Großes Titelbild",hint:"ganz oben"},{slug:"youtube",label:"Video-Abschnitt"},{slug:"craft",label:"Handwerk"},{slug:"advice",label:"Beratung"},{slug:"insights",label:"Einblicke",hint:"Bildergalerie-Intro"},{slug:"more",label:"Mehr als Car-Hifi"}],ie=[{value:"de",label:"Deutsch"},{value:"en",label:"English"}],oe=[{value:0,label:"Links"},{value:50,label:"Mittig"},{value:100,label:"Rechts"}],ce=[{value:0,label:"Oben"},{value:50,label:"Mittig"},{value:100,label:"Unten"}],de=["hero","youtube"],ue=[{value:"left",label:"Links"},{value:"center",label:"Mittig"},{value:"right",label:"Rechts"}],he={left:"text-left",center:"text-center",right:"text-right"};function ge(f){const o=document.createElement("div");return o.innerHTML=f||"",o.textContent||""}function fe(){const f=q(),[o,v]=i.useState(null),[r,D]=i.useState("hero"),[l,K]=i.useState("de"),[y,w]=i.useState(null),[H,S]=i.useState(!1),[k,j]=i.useState(""),[R,F]=i.useState(null),T=Q(),[$,G]=i.useState(""),A=i.useRef(null),[C,P]=i.useState(!1),c=o&&y?p.map(t=>t.slug).filter(t=>JSON.stringify(o[t])!==JSON.stringify(y[t])):[];ee(c.length>0,"home-sections"),i.useEffect(()=>{_.get("/home-sections").then(t=>{v(t),w(t)}),_.get("/site-settings").then(t=>G(t.hero_image_path||""))},[]);const B=e.jsx(se,{title:"Startseite",description:"Texte, Position und Knöpfe der großen Abschnitte auf der Startseite. Bilder, Kacheln, Bewertungen und FAQ haben eigene Seiten. Alle geänderten Abschnitte werden zusammen gespeichert.",actions:e.jsx(ae,{variant:"secondary",icon:"eye",href:"/",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"})});if(!o)return e.jsxs("div",{children:[B,e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[15rem_1fr]",children:[e.jsx("div",{className:"hidden h-72 animate-pulse rounded-xl bg-neutral-100 dark:bg-neutral-800 lg:block"}),e.jsx("div",{className:"h-96 animate-pulse rounded-xl bg-neutral-100 dark:bg-neutral-800"})]})]});const n=o[r],U=de.includes(r),d=(t,s)=>{v(a=>({...a,[r]:{...a[r],[t]:s}}))},g=(t,s)=>{v(a=>({...a,[r]:{...a[r],text_align_x:t,text_align_y:s}}))},E=(t,s)=>{const a=A.current.getBoundingClientRect();return{x:Math.max(0,Math.min(100,Math.round((t-a.left)/a.width*100))),y:Math.max(0,Math.min(100,Math.round((s-a.top)/a.height*100)))}},W=t=>{t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),P(!0);const{x:s,y:a}=E(t.clientX,t.clientY);g(s,a)},X=t=>{if(!C)return;const{x:s,y:a}=E(t.clientX,t.clientY);g(s,a)},Z=t=>{P(!1),t.currentTarget.releasePointerCapture(t.pointerId)},V=async()=>{S(!0),j("");const t=[];try{for(const s of c)await _.put(`/home-sections/${s}`,o[s]),t.push(s);F(new Date),T.success(c.length>1?`${c.length} Abschnitte gespeichert.`:"Gespeichert.")}catch(s){j(s.message),T.error(`Speichern fehlgeschlagen: ${s.message}`)}finally{t.length&&w(s=>{const a={...s};return t.forEach(I=>{a[I]=o[I]}),a}),S(!1)}},x=n[`eyebrow_${l}`]||"",u=p.find(t=>t.slug===r),O=n[`title_${l}`]||(u==null?void 0:u.label)||"",Y=ge(n[`body_html_${l}`]),J=!n.title_en,M=t=>{D(t),j("")};return e.jsxs("div",{children:[B,e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[15rem_1fr]",children:[e.jsx("div",{className:"lg:hidden",children:e.jsx(z,{value:r,onChange:t=>M(t.target.value),children:p.map(t=>e.jsxs("option",{value:t.slug,children:[t.label,c.includes(t.slug)?" ●":""]},t.slug))})}),e.jsxs(L,{padded:!1,className:"hidden p-2 lg:sticky lg:top-24 lg:block lg:self-start",children:[e.jsx("p",{className:"px-3 pb-1 pt-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Abschnitte von oben nach unten"}),e.jsx("nav",{className:"space-y-0.5",children:p.map((t,s)=>{const a=r===t.slug;return e.jsxs("button",{type:"button",onClick:()=>M(t.slug),className:`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition ${a?"bg-brand-50 font-semibold text-brand-700 dark:bg-brand-900/30 dark:text-brand-300":"text-neutral-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:[e.jsx("span",{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${a?"bg-brand-500 text-white":"bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400"}`,children:s+1}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate",children:t.label}),t.hint&&e.jsx("span",{className:"block truncate text-xs font-normal text-neutral-400",children:t.hint})]}),c.includes(t.slug)&&e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-amber-400",title:"Ungespeicherte Änderungen"})]},t.slug)})})]}),e.jsxs(L,{title:u==null?void 0:u.label,description:n.updated_at?`Zuletzt geändert: ${new Date(n.updated_at.replace(" ","T")).toLocaleString("de-DE")}`:null,actions:e.jsxs("div",{className:"flex items-center gap-2",children:[l==="de"&&J&&e.jsx(ne,{tone:"amber",children:"Englisch fehlt"}),e.jsx(b,{size:"sm",value:l,onChange:K,options:ie})]}),children:[U?e.jsxs("div",{className:"mb-6 grid gap-5 rounded-xl bg-neutral-50 p-4 dark:bg-neutral-800/40 sm:grid-cols-[18rem_1fr] sm:items-start",children:[e.jsxs("div",{children:[e.jsxs("div",{ref:A,className:"relative aspect-video select-none overflow-hidden rounded-lg bg-neutral-900 shadow-sm",children:[r==="hero"&&$?e.jsx("img",{src:$,alt:"",draggable:!1,className:"h-full w-full object-cover"}):e.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:r==="youtube"?"Video-Hintergrund":"Titelbild"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-black/40"}),e.jsxs("div",{onPointerDown:W,onPointerMove:X,onPointerUp:Z,style:{...te(n.text_align_x,n.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 ${C?"cursor-grabbing bg-white/10 ring-2 ring-brand-400":"cursor-grab ring-1 ring-white/30 hover:bg-white/10"}`,children:[x&&e.jsx("p",{className:"truncate text-[10px] font-semibold uppercase tracking-wide text-brand-300",children:x}),e.jsx("p",{className:"truncate text-sm font-extrabold text-white",children:O})]})]}),e.jsx("p",{className:"mt-1.5 text-center text-xs text-neutral-400",children:"Text mit der Maus an die gewünschte Stelle ziehen"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Waagerecht"}),e.jsx(b,{size:"sm",value:n.text_align_x,onChange:t=>g(t,n.text_align_y),options:oe})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Senkrecht"}),e.jsx(b,{size:"sm",value:n.text_align_y,onChange:t=>g(n.text_align_x,t),options:ce})]}),e.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["Position: ",e.jsxs("span",{className:"font-mono font-semibold text-neutral-700 dark:text-neutral-200",children:[n.text_align_x,"% / ",n.text_align_y,"%"]})]})]})]}):e.jsxs("div",{className:"mb-6 grid gap-5 rounded-xl bg-neutral-50 p-4 dark:bg-neutral-800/40 sm:grid-cols-[8rem_1fr] sm:items-center",children:[e.jsx("div",{className:"hidden aspect-square rounded-lg bg-neutral-200 dark:bg-neutral-700 sm:block","aria-hidden":!0}),e.jsxs("div",{children:[e.jsxs("div",{className:`rounded-lg border border-neutral-200 bg-white p-3 dark:border-neutral-700 dark:bg-neutral-900 ${he[n.text_align]||"text-left"}`,children:[x&&e.jsx("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:x}),e.jsx("p",{className:"mb-1 font-bold text-neutral-900 dark:text-white",children:O}),e.jsx("p",{className:"line-clamp-2 text-xs text-neutral-500 dark:text-neutral-400",children:Y||"Text erscheint hier…"})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Ausrichtung"}),e.jsx(b,{size:"sm",value:n.text_align,onChange:t=>d("text_align",t),options:ue})]})]})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsx(h,{label:"Kurzer Vorspann (optional)",hint:"Kleine Zeile über der Überschrift.",children:e.jsx(m,{value:n[`eyebrow_${l}`]||"",onChange:t=>d(`eyebrow_${l}`,t.target.value)})}),e.jsx(N,{fieldKey:`home_sections.${r}.eyebrow`,previewText:n[`eyebrow_${l}`]||"Beispieltext"}),e.jsx(h,{label:"Überschrift",children:e.jsx(m,{value:n[`title_${l}`]||"",onChange:t=>d(`title_${l}`,t.target.value)})}),e.jsx(N,{fieldKey:`home_sections.${r}.title`,previewText:n[`title_${l}`]||"Beispieltext"}),e.jsx(le,{label:"Text",value:n[`body_html_${l}`]||"",onChange:t=>d(`body_html_${l}`,t)}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Knopf (optional)"}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(h,{label:"Beschriftung",children:e.jsx(m,{value:n[`button_label_${l}`]||"",onChange:t=>d(`button_label_${l}`,t.target.value),placeholder:"z. B. Fahrzeug wählen"})}),e.jsx(N,{fieldKey:`home_sections.${r}.button_label`,previewText:n[`button_label_${l}`]||"Beispieltext"})]}),e.jsx(h,{label:"Ziel (für beide Sprachen)",hint:"Ohne Beschriftung und Ziel kein Knopf. Mit „/“ bleibt man auf der Website, alles andere öffnet in einem neuen Tab.",children:e.jsx(m,{value:n.button_url||"",onChange:t=>d("button_url",t.target.value),placeholder:"/leistungen oder https://…"})})]})]}),e.jsx("section",{className:"border-t border-neutral-200 pt-5 dark:border-neutral-800",children:e.jsx(h,{label:"Schriftart (für beide Sprachen)",className:"max-w-sm",children:e.jsxs(z,{value:n.font_family||"",onChange:t=>d("font_family",t.target.value||null),children:[e.jsx("option",{value:"",children:"Standard (globale Schriftart)"}),f.filter(t=>t.value).map(t=>e.jsx("option",{value:t.value,children:t.label},t.label))]})})})]}),k&&e.jsx("p",{className:"mt-4 rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:k})]})]}),e.jsx(re,{dirty:c.length>0,busy:H,savedAt:R,onSave:V,label:c.length>1?`Alle ${c.length} Abschnitte speichern`:"Speichern"})]})}export{fe as default}; +import{a0 as q,r as i,v as Q,w as ee,c as _,j as e,A as z,C as L,f as te,t as b,F as h,x as m,U as ne,P as se,B as ae}from"./index-CPMnKQBc.js";import le from"./RichTextEditor-B7bZ3Yjh.js";import{T as N}from"./TextStyleWidget-DGEJ-L-L.js";import{S as re}from"./SaveBar-D3LWnDZL.js";const p=[{slug:"hero",label:"Großes Titelbild",hint:"ganz oben"},{slug:"youtube",label:"Video-Abschnitt"},{slug:"craft",label:"Handwerk"},{slug:"advice",label:"Beratung"},{slug:"insights",label:"Einblicke",hint:"Bildergalerie-Intro"},{slug:"more",label:"Mehr als Car-Hifi"}],ie=[{value:"de",label:"Deutsch"},{value:"en",label:"English"}],oe=[{value:0,label:"Links"},{value:50,label:"Mittig"},{value:100,label:"Rechts"}],ce=[{value:0,label:"Oben"},{value:50,label:"Mittig"},{value:100,label:"Unten"}],de=["hero","youtube"],ue=[{value:"left",label:"Links"},{value:"center",label:"Mittig"},{value:"right",label:"Rechts"}],he={left:"text-left",center:"text-center",right:"text-right"};function ge(f){const o=document.createElement("div");return o.innerHTML=f||"",o.textContent||""}function fe(){const f=q(),[o,v]=i.useState(null),[r,D]=i.useState("hero"),[l,K]=i.useState("de"),[y,w]=i.useState(null),[H,S]=i.useState(!1),[k,j]=i.useState(""),[R,F]=i.useState(null),T=Q(),[$,G]=i.useState(""),A=i.useRef(null),[C,P]=i.useState(!1),c=o&&y?p.map(t=>t.slug).filter(t=>JSON.stringify(o[t])!==JSON.stringify(y[t])):[];ee(c.length>0,"home-sections"),i.useEffect(()=>{_.get("/home-sections").then(t=>{v(t),w(t)}),_.get("/site-settings").then(t=>G(t.hero_image_path||""))},[]);const B=e.jsx(se,{title:"Startseite",description:"Texte, Position und Knöpfe der großen Abschnitte auf der Startseite. Bilder, Kacheln, Bewertungen und FAQ haben eigene Seiten. Alle geänderten Abschnitte werden zusammen gespeichert.",actions:e.jsx(ae,{variant:"secondary",icon:"eye",href:"/",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"})});if(!o)return e.jsxs("div",{children:[B,e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[15rem_1fr]",children:[e.jsx("div",{className:"hidden h-72 animate-pulse rounded-xl bg-neutral-100 dark:bg-neutral-800 lg:block"}),e.jsx("div",{className:"h-96 animate-pulse rounded-xl bg-neutral-100 dark:bg-neutral-800"})]})]});const n=o[r],U=de.includes(r),d=(t,s)=>{v(a=>({...a,[r]:{...a[r],[t]:s}}))},g=(t,s)=>{v(a=>({...a,[r]:{...a[r],text_align_x:t,text_align_y:s}}))},E=(t,s)=>{const a=A.current.getBoundingClientRect();return{x:Math.max(0,Math.min(100,Math.round((t-a.left)/a.width*100))),y:Math.max(0,Math.min(100,Math.round((s-a.top)/a.height*100)))}},W=t=>{t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),P(!0);const{x:s,y:a}=E(t.clientX,t.clientY);g(s,a)},X=t=>{if(!C)return;const{x:s,y:a}=E(t.clientX,t.clientY);g(s,a)},Z=t=>{P(!1),t.currentTarget.releasePointerCapture(t.pointerId)},V=async()=>{S(!0),j("");const t=[];try{for(const s of c)await _.put(`/home-sections/${s}`,o[s]),t.push(s);F(new Date),T.success(c.length>1?`${c.length} Abschnitte gespeichert.`:"Gespeichert.")}catch(s){j(s.message),T.error(`Speichern fehlgeschlagen: ${s.message}`)}finally{t.length&&w(s=>{const a={...s};return t.forEach(I=>{a[I]=o[I]}),a}),S(!1)}},x=n[`eyebrow_${l}`]||"",u=p.find(t=>t.slug===r),O=n[`title_${l}`]||(u==null?void 0:u.label)||"",Y=ge(n[`body_html_${l}`]),J=!n.title_en,M=t=>{D(t),j("")};return e.jsxs("div",{children:[B,e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[15rem_1fr]",children:[e.jsx("div",{className:"lg:hidden",children:e.jsx(z,{value:r,onChange:t=>M(t.target.value),children:p.map(t=>e.jsxs("option",{value:t.slug,children:[t.label,c.includes(t.slug)?" ●":""]},t.slug))})}),e.jsxs(L,{padded:!1,className:"hidden p-2 lg:sticky lg:top-24 lg:block lg:self-start",children:[e.jsx("p",{className:"px-3 pb-1 pt-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Abschnitte von oben nach unten"}),e.jsx("nav",{className:"space-y-0.5",children:p.map((t,s)=>{const a=r===t.slug;return e.jsxs("button",{type:"button",onClick:()=>M(t.slug),className:`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm transition ${a?"bg-brand-50 font-semibold text-brand-700 dark:bg-brand-900/30 dark:text-brand-300":"text-neutral-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:[e.jsx("span",{className:`flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${a?"bg-brand-500 text-white":"bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400"}`,children:s+1}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate",children:t.label}),t.hint&&e.jsx("span",{className:"block truncate text-xs font-normal text-neutral-400",children:t.hint})]}),c.includes(t.slug)&&e.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full bg-amber-400",title:"Ungespeicherte Änderungen"})]},t.slug)})})]}),e.jsxs(L,{title:u==null?void 0:u.label,description:n.updated_at?`Zuletzt geändert: ${new Date(n.updated_at.replace(" ","T")).toLocaleString("de-DE")}`:null,actions:e.jsxs("div",{className:"flex items-center gap-2",children:[l==="de"&&J&&e.jsx(ne,{tone:"amber",children:"Englisch fehlt"}),e.jsx(b,{size:"sm",value:l,onChange:K,options:ie})]}),children:[U?e.jsxs("div",{className:"mb-6 grid gap-5 rounded-xl bg-neutral-50 p-4 dark:bg-neutral-800/40 sm:grid-cols-[18rem_1fr] sm:items-start",children:[e.jsxs("div",{children:[e.jsxs("div",{ref:A,className:"relative aspect-video select-none overflow-hidden rounded-lg bg-neutral-900 shadow-sm",children:[r==="hero"&&$?e.jsx("img",{src:$,alt:"",draggable:!1,className:"h-full w-full object-cover"}):e.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:r==="youtube"?"Video-Hintergrund":"Titelbild"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-black/40"}),e.jsxs("div",{onPointerDown:W,onPointerMove:X,onPointerUp:Z,style:{...te(n.text_align_x,n.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 ${C?"cursor-grabbing bg-white/10 ring-2 ring-brand-400":"cursor-grab ring-1 ring-white/30 hover:bg-white/10"}`,children:[x&&e.jsx("p",{className:"truncate text-[10px] font-semibold uppercase tracking-wide text-brand-300",children:x}),e.jsx("p",{className:"truncate text-sm font-extrabold text-white",children:O})]})]}),e.jsx("p",{className:"mt-1.5 text-center text-xs text-neutral-400",children:"Text mit der Maus an die gewünschte Stelle ziehen"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Waagerecht"}),e.jsx(b,{size:"sm",value:n.text_align_x,onChange:t=>g(t,n.text_align_y),options:oe})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Senkrecht"}),e.jsx(b,{size:"sm",value:n.text_align_y,onChange:t=>g(n.text_align_x,t),options:ce})]}),e.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["Position: ",e.jsxs("span",{className:"font-mono font-semibold text-neutral-700 dark:text-neutral-200",children:[n.text_align_x,"% / ",n.text_align_y,"%"]})]})]})]}):e.jsxs("div",{className:"mb-6 grid gap-5 rounded-xl bg-neutral-50 p-4 dark:bg-neutral-800/40 sm:grid-cols-[8rem_1fr] sm:items-center",children:[e.jsx("div",{className:"hidden aspect-square rounded-lg bg-neutral-200 dark:bg-neutral-700 sm:block","aria-hidden":!0}),e.jsxs("div",{children:[e.jsxs("div",{className:`rounded-lg border border-neutral-200 bg-white p-3 dark:border-neutral-700 dark:bg-neutral-900 ${he[n.text_align]||"text-left"}`,children:[x&&e.jsx("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:x}),e.jsx("p",{className:"mb-1 font-bold text-neutral-900 dark:text-white",children:O}),e.jsx("p",{className:"line-clamp-2 text-xs text-neutral-500 dark:text-neutral-400",children:Y||"Text erscheint hier…"})]}),e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Ausrichtung"}),e.jsx(b,{size:"sm",value:n.text_align,onChange:t=>d("text_align",t),options:ue})]})]})]}),e.jsxs("div",{className:"space-y-5",children:[e.jsx(h,{label:"Kurzer Vorspann (optional)",hint:"Kleine Zeile über der Überschrift.",children:e.jsx(m,{value:n[`eyebrow_${l}`]||"",onChange:t=>d(`eyebrow_${l}`,t.target.value)})}),e.jsx(N,{fieldKey:`home_sections.${r}.eyebrow`,previewText:n[`eyebrow_${l}`]||"Beispieltext"}),e.jsx(h,{label:"Überschrift",children:e.jsx(m,{value:n[`title_${l}`]||"",onChange:t=>d(`title_${l}`,t.target.value)})}),e.jsx(N,{fieldKey:`home_sections.${r}.title`,previewText:n[`title_${l}`]||"Beispieltext"}),e.jsx(le,{label:"Text",value:n[`body_html_${l}`]||"",onChange:t=>d(`body_html_${l}`,t)}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Knopf (optional)"}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx(h,{label:"Beschriftung",children:e.jsx(m,{value:n[`button_label_${l}`]||"",onChange:t=>d(`button_label_${l}`,t.target.value),placeholder:"z. B. Fahrzeug wählen"})}),e.jsx(N,{fieldKey:`home_sections.${r}.button_label`,previewText:n[`button_label_${l}`]||"Beispieltext"})]}),e.jsx(h,{label:"Ziel (für beide Sprachen)",hint:"Ohne Beschriftung und Ziel kein Knopf. Mit „/“ bleibt man auf der Website, alles andere öffnet in einem neuen Tab.",children:e.jsx(m,{value:n.button_url||"",onChange:t=>d("button_url",t.target.value),placeholder:"/leistungen oder https://…"})})]})]}),e.jsx("section",{className:"border-t border-neutral-200 pt-5 dark:border-neutral-800",children:e.jsx(h,{label:"Schriftart (für beide Sprachen)",className:"max-w-sm",children:e.jsxs(z,{value:n.font_family||"",onChange:t=>d("font_family",t.target.value||null),children:[e.jsx("option",{value:"",children:"Standard (globale Schriftart)"}),f.filter(t=>t.value).map(t=>e.jsx("option",{value:t.value,children:t.label},t.label))]})})})]}),k&&e.jsx("p",{className:"mt-4 rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:k})]})]}),e.jsx(re,{dirty:c.length>0,busy:H,savedAt:R,onSave:V,label:c.length>1?`Alle ${c.length} Abschnitte speichern`:"Speichern"})]})}export{fe as default}; diff --git a/hifi/assets/ImageOptimizer-Cv-egAvW.js b/hifi/assets/ImageOptimizer-C38AVHT-.js similarity index 97% rename from hifi/assets/ImageOptimizer-Cv-egAvW.js rename to hifi/assets/ImageOptimizer-C38AVHT-.js index ffedd85..c8808c0 100644 --- a/hifi/assets/ImageOptimizer-Cv-egAvW.js +++ b/hifi/assets/ImageOptimizer-C38AVHT-.js @@ -1 +1 @@ -import{r,c as u,j as e}from"./index-eQrgtQRM.js";function h({compact:m=!1}){const[n,i]=r.useState(!1),[s,l]=r.useState(null),[d,o]=r.useState(""),[t,c]=r.useState(null);r.useEffect(()=>{u.get("/settings/compress-status").then(a=>c(a.gd_available)).catch(()=>c(!1))},[]);const b=async()=>{i(!0),o(""),l(null);try{l(await u.post("/settings/compress-uploads",{}))}catch(a){o(a.message)}finally{i(!1)}};return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Bilder optimieren"}),t!==null&&e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${t?"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:t?"Aktiv":"Nicht verfügbar"})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:m?"Verkleinert alle bereits hochgeladenen Fotos, damit die Seite schneller lädt. Neue Bilder werden automatisch verkleinert.":"Neu hochgeladene Bilder werden automatisch verkleinert und komprimiert. Dieser Button holt das für alle bereits vorhandenen Bilder nach – nützlich, wenn die Seite durch zu hoch aufgelöste Fotos spürbar langsam lädt."}),t===!1&&e.jsx("p",{className:"mb-4 rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:'Diese Funktion braucht die PHP-Erweiterung "gd", die auf diesem Server aktuell nicht aktiv ist. Bei den meisten Hostern (auch All-Inkl) ist sie Teil jeder PHP-Version – bitte beim Hoster-Support nachfragen bzw. prüfen, ob in den Hosting-Einstellungen eine andere PHP-Version ausgewählt werden muss.'}),e.jsx("button",{type:"button",onClick:b,disabled:n||t===!1,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:n?"Optimiert… bitte warten":"Bestehende Bilder optimieren"}),d&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:d}),s&&e.jsxs("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:[s.processed," Bild(er) verkleinert: ",(s.before_bytes/1024/1024).toFixed(1)," MB"," → ",(s.after_bytes/1024/1024).toFixed(1)," MB."]})]})}export{h as I}; +import{r,c as u,j as e}from"./index-CPMnKQBc.js";function h({compact:m=!1}){const[n,i]=r.useState(!1),[s,l]=r.useState(null),[d,o]=r.useState(""),[t,c]=r.useState(null);r.useEffect(()=>{u.get("/settings/compress-status").then(a=>c(a.gd_available)).catch(()=>c(!1))},[]);const b=async()=>{i(!0),o(""),l(null);try{l(await u.post("/settings/compress-uploads",{}))}catch(a){o(a.message)}finally{i(!1)}};return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Bilder optimieren"}),t!==null&&e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${t?"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:t?"Aktiv":"Nicht verfügbar"})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:m?"Verkleinert alle bereits hochgeladenen Fotos, damit die Seite schneller lädt. Neue Bilder werden automatisch verkleinert.":"Neu hochgeladene Bilder werden automatisch verkleinert und komprimiert. Dieser Button holt das für alle bereits vorhandenen Bilder nach – nützlich, wenn die Seite durch zu hoch aufgelöste Fotos spürbar langsam lädt."}),t===!1&&e.jsx("p",{className:"mb-4 rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:'Diese Funktion braucht die PHP-Erweiterung "gd", die auf diesem Server aktuell nicht aktiv ist. Bei den meisten Hostern (auch All-Inkl) ist sie Teil jeder PHP-Version – bitte beim Hoster-Support nachfragen bzw. prüfen, ob in den Hosting-Einstellungen eine andere PHP-Version ausgewählt werden muss.'}),e.jsx("button",{type:"button",onClick:b,disabled:n||t===!1,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:n?"Optimiert… bitte warten":"Bestehende Bilder optimieren"}),d&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:d}),s&&e.jsxs("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:[s.processed," Bild(er) verkleinert: ",(s.before_bytes/1024/1024).toFixed(1)," MB"," → ",(s.after_bytes/1024/1024).toFixed(1)," MB."]})]})}export{h as I}; diff --git a/hifi/assets/ImageUploadField-2si66K3r.js b/hifi/assets/ImageUploadField-DGJRkWaj.js similarity index 99% rename from hifi/assets/ImageUploadField-2si66K3r.js rename to hifi/assets/ImageUploadField-DGJRkWaj.js index 4afea02..6e875e1 100644 --- a/hifi/assets/ImageUploadField-2si66K3r.js +++ b/hifi/assets/ImageUploadField-DGJRkWaj.js @@ -1,4 +1,4 @@ -import{ab as mt,r as m,j as u,c as ft}from"./index-eQrgtQRM.js";import{M as gt,f as vt}from"./resizeImage-C6PvAwh0.js";var V=!1,E,Z,k,N,_,rt,W,B,U,G,nt,H,X,st,at;function g(){if(!V){V=!0;var o=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(o),t=/(Mac OS X)|(Windows)|(Linux)/.exec(o);if(H=/\b(iPhone|iP[ao]d)/.exec(o),X=/\b(iP[ao]d)/.exec(o),G=/Android/i.exec(o),st=/FBAN\/\w+;/i.exec(o),at=/Mobile/i.exec(o),nt=!!/Win64/.exec(o),e){E=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,E&&document&&document.documentMode&&(E=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(o);rt=i?parseFloat(i[1])+4:E,Z=e[2]?parseFloat(e[2]):NaN,k=e[3]?parseFloat(e[3]):NaN,N=e[4]?parseFloat(e[4]):NaN,N?(e=/(?:Chrome\/(\d+\.\d+))/.exec(o),_=e&&e[1]?parseFloat(e[1]):NaN):_=NaN}else E=Z=k=_=N=NaN;if(t){if(t[1]){var r=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(o);W=r?parseFloat(r[1].replace("_",".")):!0}else W=!1;B=!!t[2],U=!!t[3]}else W=B=U=!1}}var Y={ie:function(){return g()||E},ieCompatibilityMode:function(){return g()||rt>E},ie64:function(){return Y.ie()&&nt},firefox:function(){return g()||Z},opera:function(){return g()||k},webkit:function(){return g()||N},safari:function(){return Y.webkit()},chrome:function(){return g()||_},windows:function(){return g()||B},osx:function(){return g()||W},linux:function(){return g()||U},iphone:function(){return g()||H},mobile:function(){return g()||H||X||G||at},nativeApp:function(){return g()||st},android:function(){return g()||G},ipad:function(){return g()||X}},wt=Y,bt=!!(typeof window<"u"&&window.document&&window.document.createElement),Ct={canUseDOM:bt},xt=Ct,ht=xt,ct;ht.canUseDOM&&(ct=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** +import{ab as mt,r as m,j as u,c as ft}from"./index-CPMnKQBc.js";import{M as gt,f as vt}from"./resizeImage-C6PvAwh0.js";var V=!1,E,Z,k,N,_,rt,W,B,U,G,nt,H,X,st,at;function g(){if(!V){V=!0;var o=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(o),t=/(Mac OS X)|(Windows)|(Linux)/.exec(o);if(H=/\b(iPhone|iP[ao]d)/.exec(o),X=/\b(iP[ao]d)/.exec(o),G=/Android/i.exec(o),st=/FBAN\/\w+;/i.exec(o),at=/Mobile/i.exec(o),nt=!!/Win64/.exec(o),e){E=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,E&&document&&document.documentMode&&(E=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(o);rt=i?parseFloat(i[1])+4:E,Z=e[2]?parseFloat(e[2]):NaN,k=e[3]?parseFloat(e[3]):NaN,N=e[4]?parseFloat(e[4]):NaN,N?(e=/(?:Chrome\/(\d+\.\d+))/.exec(o),_=e&&e[1]?parseFloat(e[1]):NaN):_=NaN}else E=Z=k=_=N=NaN;if(t){if(t[1]){var r=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(o);W=r?parseFloat(r[1].replace("_",".")):!0}else W=!1;B=!!t[2],U=!!t[3]}else W=B=U=!1}}var Y={ie:function(){return g()||E},ieCompatibilityMode:function(){return g()||rt>E},ie64:function(){return Y.ie()&&nt},firefox:function(){return g()||Z},opera:function(){return g()||k},webkit:function(){return g()||N},safari:function(){return Y.webkit()},chrome:function(){return g()||_},windows:function(){return g()||B},osx:function(){return g()||W},linux:function(){return g()||U},iphone:function(){return g()||H},mobile:function(){return g()||H||X||G||at},nativeApp:function(){return g()||st},android:function(){return g()||G},ipad:function(){return g()||X}},wt=Y,bt=!!(typeof window<"u"&&window.document&&window.document.createElement),Ct={canUseDOM:bt},xt=Ct,ht=xt,ct;ht.canUseDOM&&(ct=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`, diff --git a/hifi/assets/Impressum-CngzqAQz.js b/hifi/assets/Impressum-CngzqAQz.js new file mode 100644 index 0000000..20250db --- /dev/null +++ b/hifi/assets/Impressum-CngzqAQz.js @@ -0,0 +1 @@ +import{j as s}from"./index-CPMnKQBc.js";import{L as e}from"./LegalPageView-DxOTKnHx.js";function i(){return s.jsx(e,{slug:"impressum",fallbackTitle:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG."})}export{i as default}; diff --git a/hifi/assets/Impressum-CuCyaRsx.js b/hifi/assets/Impressum-CuCyaRsx.js deleted file mode 100644 index 0c0f4c9..0000000 --- a/hifi/assets/Impressum-CuCyaRsx.js +++ /dev/null @@ -1 +0,0 @@ -import{j as s}from"./index-eQrgtQRM.js";import{L as e}from"./LegalPageView-CmgDetEJ.js";function i(){return s.jsx(e,{slug:"impressum",fallbackTitle:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG."})}export{i as default}; diff --git a/hifi/assets/LegalPageView-CmgDetEJ.js b/hifi/assets/LegalPageView-DxOTKnHx.js similarity index 82% rename from hifi/assets/LegalPageView-CmgDetEJ.js rename to hifi/assets/LegalPageView-DxOTKnHx.js index 6316bc2..09695f0 100644 --- a/hifi/assets/LegalPageView-CmgDetEJ.js +++ b/hifi/assets/LegalPageView-DxOTKnHx.js @@ -1 +1 @@ -import{r as l,c as n,b as r,j as a,d,i as m}from"./index-eQrgtQRM.js";function c({slug:e,fallbackTitle:s,description:i}){const[t,x]=l.useState(null);return l.useEffect(()=>{n.get(`/legal-pages/${e}`).then(x).catch(()=>{})},[e]),r({title:(t==null?void 0:t.title)||s,description:i,path:`/${e}`}),t?a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx(d,{entity:"legal_pages",id:e,field:"title",lang:"de",value:t.title,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),a.jsx(m,{entity:"legal_pages",id:e,field:"body_html",lang:"de",value:t.body_html,label:t.title,className:"legal-content text-sm text-neutral-600 dark:text-neutral-300"})]}):null}export{c as L}; +import{r as l,c as n,b as r,j as a,d,i as m}from"./index-CPMnKQBc.js";function c({slug:e,fallbackTitle:s,description:i}){const[t,x]=l.useState(null);return l.useEffect(()=>{n.get(`/legal-pages/${e}`).then(x).catch(()=>{})},[e]),r({title:(t==null?void 0:t.title)||s,description:i,path:`/${e}`}),t?a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx(d,{entity:"legal_pages",id:e,field:"title",lang:"de",value:t.title,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),a.jsx(m,{entity:"legal_pages",id:e,field:"body_html",lang:"de",value:t.body_html,label:t.title,className:"legal-content text-sm text-neutral-600 dark:text-neutral-300"})]}):null}export{c as L}; diff --git a/hifi/assets/LegalSettings-aQ858K4J.js b/hifi/assets/LegalSettings-Dyr-bPzl.js similarity index 95% rename from hifi/assets/LegalSettings-aQ858K4J.js rename to hifi/assets/LegalSettings-Dyr-bPzl.js index 67b7007..f1605fc 100644 --- a/hifi/assets/LegalSettings-aQ858K4J.js +++ b/hifi/assets/LegalSettings-Dyr-bPzl.js @@ -1 +1 @@ -import{r as s,c as b,j as e}from"./index-eQrgtQRM.js";import v from"./RichTextEditor-Da-meJrp.js";const j=[{slug:"impressum",label:"Impressum"},{slug:"datenschutz",label:"Datenschutzerklärung"},{slug:"agb",label:"AGB"}];function k(){const[d,u]=s.useState(null),[r,h]=s.useState("impressum"),[c,i]=s.useState(!1),[o,n]=s.useState(""),[g,l]=s.useState(!1);if(s.useEffect(()=>{b.get("/legal-pages").then(u)},[]),!d)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const a=d[r],m=(t,f)=>{u(x=>({...x,[r]:{...x[r],[t]:f}})),l(!1)},p=async()=>{i(!0),n(""),l(!1);try{await b.put(`/legal-pages/${r}`,{title:a.title,body_html:a.body_html}),l(!0)}catch(t){n(t.message)}finally{i(!1)}};return e.jsx("div",{className:"max-w-3xl space-y-6",children:e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Rechtstexte"}),e.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."}),e.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:j.map(t=>e.jsx("button",{type:"button",onClick:()=>{h(t.slug),l(!1),n("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${r===t.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:t.label},t.slug))}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),e.jsx("input",{value:a.title,onChange:t=>m("title",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"})]}),e.jsx(v,{label:"Inhalt",value:a.body_html,onChange:t=>m("body_html",t)})]}),a.updated_at&&e.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(a.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),o&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:o}),g&&e.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"button",onClick:p,disabled:c,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:c?"Speichere…":"Speichern"})]})})}export{k as default}; +import{r as s,c as b,j as e}from"./index-CPMnKQBc.js";import v from"./RichTextEditor-B7bZ3Yjh.js";const j=[{slug:"impressum",label:"Impressum"},{slug:"datenschutz",label:"Datenschutzerklärung"},{slug:"agb",label:"AGB"}];function k(){const[d,u]=s.useState(null),[r,h]=s.useState("impressum"),[c,i]=s.useState(!1),[o,n]=s.useState(""),[g,l]=s.useState(!1);if(s.useEffect(()=>{b.get("/legal-pages").then(u)},[]),!d)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const a=d[r],m=(t,f)=>{u(x=>({...x,[r]:{...x[r],[t]:f}})),l(!1)},p=async()=>{i(!0),n(""),l(!1);try{await b.put(`/legal-pages/${r}`,{title:a.title,body_html:a.body_html}),l(!0)}catch(t){n(t.message)}finally{i(!1)}};return e.jsx("div",{className:"max-w-3xl space-y-6",children:e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Rechtstexte"}),e.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."}),e.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:j.map(t=>e.jsx("button",{type:"button",onClick:()=>{h(t.slug),l(!1),n("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${r===t.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:t.label},t.slug))}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),e.jsx("input",{value:a.title,onChange:t=>m("title",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"})]}),e.jsx(v,{label:"Inhalt",value:a.body_html,onChange:t=>m("body_html",t)})]}),a.updated_at&&e.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(a.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),o&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:o}),g&&e.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"button",onClick:p,disabled:c,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:c?"Speichere…":"Speichern"})]})})}export{k as default}; diff --git a/hifi/assets/Login-BHhvb3aV.js b/hifi/assets/Login-BHhvb3aV.js new file mode 100644 index 0000000..3104d29 --- /dev/null +++ b/hifi/assets/Login-BHhvb3aV.js @@ -0,0 +1 @@ +import{k as G,m as R,r as s,j as e,n as O,l as U,o as $,c as I}from"./index-CPMnKQBc.js";const m="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",x="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",h="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",p="mt-3 w-full text-sm text-brand-600 hover:underline dark:text-brand-400",k="mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400";function Q(){const{user:E,login:L,verifyTwoFactor:P,resendLoginCode:z,switchTwoFactorMethod:B}=G(),f=R(),[o,F]=s.useState("credentials"),[d,N]=s.useState("totp"),[j,q]=s.useState(["totp"]),[w,H]=s.useState(""),[v,c]=s.useState(""),[u,C]=s.useState(""),[y,W]=s.useState(""),[S,b]=s.useState(""),[a,g]=s.useState(""),[n,M]=s.useState(!1);if(E)return e.jsx(O,{to:"/admin",replace:!0});const r=t=>{F(t),b(""),g(""),c("")},i=async t=>{M(!0),g("");try{await t()}catch(l){g(l.message)}finally{M(!1)}},D=t=>{t.preventDefault(),i(async()=>{const l=await L(u,y);l.requires2fa?(N(l.method),q(l.methods),H(l.emailHint),r("code")):f("/admin")})},K=t=>{t.preventDefault(),i(async()=>{await P(S),f("/admin")})},T=()=>{c(""),i(async()=>{await z(),c("Neuer Code ist unterwegs.")})},A=t=>{c(""),i(async()=>{await B(t),N(t),b("")})},Z=t=>{t.preventDefault(),i(async()=>{await I.post("/auth/forgot-password",{login:u}),r("forgot-sent")})};return e.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:[e.jsx("img",{src:U,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:$,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),o==="credentials"&&e.jsxs("form",{onSubmit:D,className:m,children:[e.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername oder E-Mail"}),e.jsx("input",{value:u,onChange:t=>C(t.target.value),required:!0,autoFocus:!0,autoComplete:"username",className:x})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),e.jsx("input",{type:"password",value:y,onChange:t=>W(t.target.value),required:!0,autoComplete:"current-password",className:x})]}),a&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),e.jsx("button",{type:"submit",disabled:n,className:h,children:n?"Anmelden…":"Anmelden"}),e.jsx("button",{type:"button",onClick:()=>r("forgot"),className:k,children:"Passwort vergessen?"})]}),o==="code"&&e.jsxs("form",{onSubmit:K,className:m,children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),d==="email"?e.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Wir haben dir einen 6-stelligen Code an ",e.jsx("strong",{className:"text-neutral-700 dark:text-neutral-200",children:w})," geschickt. Er ist 10 Minuten gültig."]}):e.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."}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),e.jsx("input",{value:S,onChange:t=>b(t.target.value),required:!0,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",placeholder:"123456",className:`${x} text-center text-lg tracking-widest`})]}),a&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),v&&e.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:v}),e.jsx("button",{type:"submit",disabled:n,className:h,children:n?"Prüfe…":"Bestätigen"}),d==="email"&&e.jsx("button",{type:"button",onClick:T,disabled:n,className:p,children:"Keinen Code bekommen? Neu senden"}),d==="totp"&&j.includes("email")&&e.jsxs("button",{type:"button",onClick:()=>A("email"),disabled:n,className:p,children:["Stattdessen Code per E-Mail an ",w]}),d==="email"&&j.includes("totp")&&e.jsx("button",{type:"button",onClick:()=>A("totp"),disabled:n,className:p,children:"Stattdessen Authenticator-App verwenden"}),e.jsx("button",{type:"button",onClick:()=>r("credentials"),className:k,children:"Zurück zum Login"})]}),o==="forgot"&&e.jsxs("form",{onSubmit:Z,className:m,children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Passwort vergessen"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Gib deinen Benutzernamen oder deine E-Mail-Adresse ein. Wir schicken dir einen Link, mit dem du ein neues Passwort festlegen kannst."}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername oder E-Mail"}),e.jsx("input",{value:u,onChange:t=>C(t.target.value),required:!0,autoFocus:!0,autoComplete:"username",className:x})]}),a&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:a}),e.jsx("button",{type:"submit",disabled:n,className:h,children:n?"Wird gesendet…":"Link anfordern"}),e.jsx("button",{type:"button",onClick:()=>r("credentials"),className:k,children:"Zurück zum Login"})]}),o==="forgot-sent"&&e.jsxs("div",{className:m,children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Schau in dein Postfach"}),e.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Wenn zu diesem Konto eine bestätigte E-Mail-Adresse hinterlegt ist, haben wir dir einen Link geschickt. Er ist 60 Minuten gültig."}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Keine Mail bekommen? Ohne hinterlegte E-Mail kann ein Administrator dein Passwort in der Benutzerverwaltung neu setzen."}),e.jsx("button",{type:"button",onClick:()=>r("credentials"),className:h,children:"Zurück zum Login"})]})]})}export{Q as default}; diff --git a/hifi/assets/Login-DmO7UGYK.js b/hifi/assets/Login-DmO7UGYK.js deleted file mode 100644 index 738e331..0000000 --- a/hifi/assets/Login-DmO7UGYK.js +++ /dev/null @@ -1 +0,0 @@ -import{k as L,m as P,r as a,j as e,n as q,l as M,o as B}from"./index-eQrgtQRM.js";function F(){const{user:f,login:p,verifyTwoFactor:k,resendLoginCode:w}=L(),i=P(),[N,u]=a.useState("credentials"),[c,j]=a.useState("totp"),[v,y]=a.useState(""),[m,n]=a.useState(""),[x,C]=a.useState(""),[b,S]=a.useState(""),[h,g]=a.useState(""),[l,r]=a.useState(""),[d,o]=a.useState(!1);if(f)return e.jsx(q,{to:"/admin",replace:!0});const A=async t=>{t.preventDefault(),o(!0),r("");try{const s=await p(x,b);s.requires2fa?(j(s.method),y(s.emailHint),n(""),u("code")):i("/admin")}catch(s){r(s.message)}finally{o(!1)}},E=async t=>{t.preventDefault(),o(!0),r("");try{await k(h),i("/admin")}catch(s){r(s.message)}finally{o(!1)}},H=async()=>{r(""),n("");try{await w(),n("Neuer Code ist unterwegs.")}catch(t){r(t.message)}};return e.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:[e.jsx("img",{src:M,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:B,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),N==="credentials"?e.jsxs("form",{onSubmit:A,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:[e.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername oder E-Mail"}),e.jsx("input",{value:x,onChange:t=>C(t.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"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),e.jsx("input",{type:"password",value:b,onChange:t=>S(t.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"})]}),l&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:l}),e.jsx("button",{type:"submit",disabled:d,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:d?"Anmelden…":"Anmelden"})]}):e.jsxs("form",{onSubmit:E,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:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),c==="email"?e.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Wir haben dir einen 6-stelligen Code an ",e.jsx("strong",{className:"text-neutral-700 dark:text-neutral-200",children:v})," geschickt. Er ist 10 Minuten gültig."]}):e.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."}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),e.jsx("input",{value:h,onChange:t=>g(t.target.value),required:!0,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",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"})]}),l&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:l}),m&&e.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:m}),e.jsx("button",{type:"submit",disabled:d,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:d?"Prüfe…":"Bestätigen"}),c==="email"&&e.jsx("button",{type:"button",onClick:H,className:"mt-3 w-full text-sm text-brand-600 hover:underline dark:text-brand-400",children:"Keinen Code bekommen? Neu senden"}),e.jsx("button",{type:"button",onClick:()=>{u("credentials"),g(""),r(""),n("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}export{F as default}; diff --git a/hifi/assets/MaintenanceSettings-CSuNtWHo.js b/hifi/assets/MaintenanceSettings-BmZJ8yZN.js similarity index 98% rename from hifi/assets/MaintenanceSettings-CSuNtWHo.js rename to hifi/assets/MaintenanceSettings-BmZJ8yZN.js index 6a9d762..fe4f24c 100644 --- a/hifi/assets/MaintenanceSettings-CSuNtWHo.js +++ b/hifi/assets/MaintenanceSettings-BmZJ8yZN.js @@ -1 +1 @@ -import{r as s,c as o,j as a}from"./index-eQrgtQRM.js";const v={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function N(){const[l,n]=s.useState(v),[g,h]=s.useState(!0),[i,d]=s.useState(!1),[x,r]=s.useState(!1),[c,u]=s.useState("");s.useEffect(()=>{o.get("/maintenance").then(e=>{n({global:{enabled:e.global.enabled,message:e.global.message||""},services:{enabled:e.services.enabled,message:e.services.message||""},vehicles:{enabled:e.vehicles.enabled,message:e.vehicles.message||""}})}).finally(()=>h(!1))},[]);const m=(e,t,k)=>{n(b=>({...b,[e]:{...b[e],[t]:k}})),r(!1)},p=async e=>{e.preventDefault(),d(!0),u(""),r(!1);try{const t=await o.post("/maintenance",l);n({global:{enabled:t.global.enabled,message:t.global.message||""},services:{enabled:t.services.enabled,message:t.services.message||""},vehicles:{enabled:t.vehicles.enabled,message:t.vehicles.message||""}}),r(!0)}catch(t){u(t.message)}finally{d(!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 g?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:p,className:"max-w-2xl space-y-6",children:[a.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(e=>a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:e.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:l[e.key].enabled,onChange:t=>m(e.key,"enabled",t.target.checked),className:"peer sr-only"}),a.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),a.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:e.hint}),a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),a.jsx("textarea",{rows:2,value:l[e.key].message,onChange:t=>m(e.key,"message",t.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"})]},e.key)),c&&a.jsx("p",{className:"text-sm text-red-600",children:c}),x&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":"Speichern"})]})}export{N as default}; +import{r as s,c as o,j as a}from"./index-CPMnKQBc.js";const v={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function N(){const[l,n]=s.useState(v),[g,h]=s.useState(!0),[i,d]=s.useState(!1),[x,r]=s.useState(!1),[c,u]=s.useState("");s.useEffect(()=>{o.get("/maintenance").then(e=>{n({global:{enabled:e.global.enabled,message:e.global.message||""},services:{enabled:e.services.enabled,message:e.services.message||""},vehicles:{enabled:e.vehicles.enabled,message:e.vehicles.message||""}})}).finally(()=>h(!1))},[]);const m=(e,t,k)=>{n(b=>({...b,[e]:{...b[e],[t]:k}})),r(!1)},p=async e=>{e.preventDefault(),d(!0),u(""),r(!1);try{const t=await o.post("/maintenance",l);n({global:{enabled:t.global.enabled,message:t.global.message||""},services:{enabled:t.services.enabled,message:t.services.message||""},vehicles:{enabled:t.vehicles.enabled,message:t.vehicles.message||""}}),r(!0)}catch(t){u(t.message)}finally{d(!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 g?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:p,className:"max-w-2xl space-y-6",children:[a.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(e=>a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:e.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:l[e.key].enabled,onChange:t=>m(e.key,"enabled",t.target.checked),className:"peer sr-only"}),a.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),a.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:e.hint}),a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),a.jsx("textarea",{rows:2,value:l[e.key].message,onChange:t=>m(e.key,"message",t.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"})]},e.key)),c&&a.jsx("p",{className:"text-sm text-red-600",children:c}),x&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":"Speichern"})]})}export{N as default}; diff --git a/hifi/assets/Models-CTKD_2al.js b/hifi/assets/Models-oOmkNQSs.js similarity index 96% rename from hifi/assets/Models-CTKD_2al.js rename to hifi/assets/Models-oOmkNQSs.js index 3a80076..22659f8 100644 --- a/hifi/assets/Models-CTKD_2al.js +++ b/hifi/assets/Models-oOmkNQSs.js @@ -1 +1 @@ -import{v as ie,k as de,p as oe,r as i,w as ce,j as a,P as ue,B as c,C as z,s as G,A as T,I as U,x as W,y as S,z as me,F as J,c as b}from"./index-eQrgtQRM.js";import he from"./ImageUploadField-2si66K3r.js";import{T as ge}from"./TextStyleWidget-Cc-J2FBP.js";import{S as xe,s as pe}from"./SortableList-B1XU_999.js";import{V as be}from"./VehicleCatalogDialog-wGVVg0Ns.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";const j={name:"",brand_id:"",image_path:"",sort_order:0},K=h=>String(h||"").toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/ß/g,"ss");function Me(){var D;const h=ie(),{hasPermission:H}=de(),v=H("packages.manage"),[Z,Q]=oe(),[s,f]=i.useState(null),[g,X]=i.useState([]),[u,Y]=i.useState(null),[o,k]=i.useState(j),[ee,$]=i.useState(j),[l,N]=i.useState(null),[ae,C]=i.useState(""),[A,F]=i.useState(!1),[x,B]=i.useState(""),[ne,w]=i.useState(!1),P=JSON.stringify(o)!==JSON.stringify(ee);ce(l!==null&&P,"models");const y=()=>{b.get("/models").then(f).catch(()=>f([])),b.get("/brands").then(X).catch(()=>{}),v&&b.get("/packages").then(e=>Y(e.reduce((n,t)=>{const r=n[t.car_model_id]||{total:0,visible:0};return{...n,[t.car_model_id]:{total:r.total+1,visible:r.visible+(t.is_hidden?0:1)}}},{}))).catch(()=>{})};i.useEffect(y,[]);const I=Z.get("marke"),d=I==="alle"?"all":Number(I)||Number((D=g[0])==null?void 0:D.id)||null,m=g.find(e=>Number(e.id)===d)||null,E=d!=="all"&&!x.trim(),R=e=>{B(""),Q(e==="all"?{marke:"alle"}:{marke:String(e)})},V=i.useMemo(()=>{const e={};return(s||[]).forEach(n=>{var r,p;const t=e[r=n.brand_id]||(e[r]={count:0,empty:0});t.count+=1,u&&!((p=u[n.id])!=null&&p.visible)&&(t.empty+=1)}),e},[s,u]),_=i.useMemo(()=>{const e=d==="all"?s||[]:(s||[]).filter(t=>Number(t.brand_id)===d),n=K(x).split(/\s+/).filter(Boolean);return n.length?e.filter(t=>n.every(r=>K(`${t.brand_name} ${t.name}`).includes(r))):e},[s,d,x]),M=e=>{const n=e?{name:e.name,brand_id:e.brand_id,image_path:e.image_path||"",sort_order:e.sort_order}:{...j,brand_id:(m==null?void 0:m.id)??""};N(e?e.id:"new"),k(n),$(n),C("")},q=()=>{P&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||(N(null),k(j),$(j))},te=async e=>{e.preventDefault(),C(""),F(!0);const n={...o,brand_id:Number(o.brand_id)};try{if(l!=="new")await b.put(`/models/${l}`,n);else{const t=(s||[]).filter(r=>Number(r.brand_id)===n.brand_id).reduce((r,p)=>Math.max(r,Number(p.sort_order)||0),0)+10;await b.post("/models",{...n,sort_order:t})}h.success(l!=="new"?"Modell gespeichert.":"Modell angelegt."),$(o),N(null),y()}catch(t){C(t.message)}finally{F(!1)}},re=async e=>{var r;const n=((r=u==null?void 0:u[e.id])==null?void 0:r.total)||0,t=n>0?` und ${n} Paket${n===1?"":"e"} mit allen Produkten`:"";if(window.confirm(`„${e.brand_name} ${e.name}“${t} wirklich löschen?`))try{await b.delete(`/models/${e.id}`),l===e.id&&N(null),h.success("Modell gelöscht."),y()}catch(p){h.error(`Löschen fehlgeschlagen: ${p.message}`)}},L=(e,n)=>{const t=[...n];return e.map(r=>Number(r.brand_id)===d?t.shift():r)},le=async e=>{const n=s;f(L(s,e));try{const t=await pe("models",e);f(r=>L(r,t)),h.success("Reihenfolge gespeichert.")}catch(t){f(n),h.error(`Reihenfolge konnte nicht gespeichert werden: ${t.message}`)}},se=e=>{if(!u)return null;const n=u[e.id];return n!=null&&n.visible?`${n.visible} Paket${n.visible===1?"":"e"}${n.total>n.visible?` · ${n.total-n.visible} ausgeblendet`:""}`:a.jsx("span",{className:"font-medium text-amber-700 dark:text-amber-400",children:n!=null&&n.total?"Alle Pakete ausgeblendet":"Noch keine Pakete"})},O=(e,n,t)=>{const r=d===(e==="all"?"all":Number(e));return a.jsxs("button",{type:"button",onClick:()=>R(e==="all"?"all":Number(e)),className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition ${r?"bg-brand-50 font-semibold text-brand-800 dark:bg-brand-500/10 dark:text-brand-300":"text-neutral-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:[a.jsx("span",{className:"flex-1 truncate",children:n}),(t==null?void 0:t.empty)>0&&a.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-400",title:`${t.empty} Modell(e) ohne sichtbares Paket`}),a.jsx("span",{className:"text-xs font-normal text-neutral-400",children:(t==null?void 0:t.count)??0})]},e)};return a.jsxs("div",{children:[a.jsx(ue,{title:"Modelle",description:"Marke wählen, Modell anklicken zum Bearbeiten. Reihenfolge am Griff links ziehen – so erscheinen die Modelle auf der Website.",actions:a.jsxs(a.Fragment,{children:[a.jsx(c,{variant:"secondary",icon:"template",onClick:()=>w(!0),children:"Aus Vorlage laden"}),a.jsx(c,{icon:"plus",onClick:()=>M(null),disabled:!g.length,children:"Neues Modell"})]})}),s!==null&&g.length===0?a.jsx(z,{padded:!1,children:a.jsx(G,{icon:"tag",title:"Noch keine Marken",description:"Modelle gehören immer zu einer Marke. Lege zuerst Marken an oder übernimm Marken und Modelle aus der Vorlage.",actions:a.jsxs(a.Fragment,{children:[a.jsx(c,{variant:"secondary",icon:"template",onClick:()=>w(!0),children:"Aus Vorlage laden"}),a.jsx(c,{to:"/admin/brands",children:"Zu den Fahrzeugmarken"})]})})}):a.jsxs("div",{className:"grid gap-6 lg:grid-cols-[16rem_minmax(0,1fr)]",children:[a.jsx("div",{className:"lg:hidden",children:a.jsxs(T,{value:d==="all"?"all":String(d??""),onChange:e=>R(e.target.value==="all"?"all":Number(e.target.value)),children:[g.map(e=>{var n;return a.jsxs("option",{value:String(e.id),children:[e.name," (",((n=V[e.id])==null?void 0:n.count)??0,")"]},e.id)}),a.jsxs("option",{value:"all",children:["Alle Marken (",(s==null?void 0:s.length)??0,")"]})]})}),a.jsxs(z,{padded:!1,className:"hidden max-h-[calc(100vh-7rem)] flex-col overflow-hidden lg:sticky lg:top-24 lg:flex lg:self-start",children:[a.jsx("div",{className:"flex-1 space-y-0.5 overflow-y-auto p-2",children:g.map(e=>O(e.id,e.name,V[e.id]))}),a.jsx("div",{className:"border-t border-neutral-200 p-2 dark:border-neutral-800",children:O("all","Alle Marken",{count:(s==null?void 0:s.length)??0})})]}),a.jsx("div",{className:"min-w-0",children:a.jsxs(z,{padded:!1,className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-neutral-200 p-3 dark:border-neutral-800",children:[a.jsxs("div",{className:"relative w-full max-w-xs",children:[a.jsx(U,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),a.jsx(W,{value:x,onChange:e=>B(e.target.value),placeholder:d==="all"?"Alle Modelle durchsuchen …":`In ${(m==null?void 0:m.name)||"Marke"} suchen …`,className:"h-9 pl-9"})]}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[_.length," Modell",_.length===1?"":"e",d==="all"&&" · zum Sortieren eine Marke wählen"]})]}),s===null?a.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[0,1,2,3].map(e=>a.jsxs("li",{className:"flex items-center gap-4 px-4 py-3",children:[a.jsx("span",{className:"h-12 w-16 animate-pulse rounded-lg bg-neutral-100 dark:bg-neutral-800"}),a.jsx("span",{className:"h-4 w-40 animate-pulse rounded bg-neutral-100 dark:bg-neutral-800"})]},e))}):_.length===0?x.trim()?a.jsxs("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Kein Modell passt zu „",x,"“."]}):a.jsx(G,{icon:"car",title:`Noch keine Modelle${m?` für ${m.name}`:""}`,description:"Einzeln anlegen oder die Generationen dieser Marke aus der Vorlage übernehmen.",actions:a.jsxs(a.Fragment,{children:[a.jsx(c,{variant:"secondary",icon:"template",onClick:()=>w(!0),children:"Aus Vorlage laden"}),a.jsx(c,{icon:"plus",onClick:()=>M(null),children:"Neues Modell"})]})}):a.jsx(xe,{items:_,onReorder:le,disabled:!E,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(e,n)=>a.jsxs("div",{className:`flex items-center gap-3 bg-white px-3 py-2.5 transition hover:bg-neutral-50 dark:bg-neutral-900 dark:hover:bg-neutral-800/50 sm:gap-4 sm:px-4 ${l===e.id?"bg-brand-50/60 dark:bg-brand-900/20":""}`,children:[E&&a.jsx("span",{className:"w-6 shrink-0",children:n}),a.jsxs("button",{type:"button",onClick:()=>M(e),className:"flex min-w-0 flex-1 items-center gap-4 text-left",children:[e.image_path?a.jsx("img",{src:e.image_path,alt:"",className:"h-12 w-16 shrink-0 rounded-lg border border-neutral-200 object-cover dark:border-neutral-700"}):a.jsx("span",{className:"flex h-12 w-16 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-300 dark:bg-neutral-800 dark:text-neutral-600",children:a.jsx(U,{name:"car",className:"h-6 w-6"})}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:[d==="all"&&a.jsxs("span",{className:"font-normal text-neutral-500 dark:text-neutral-400",children:[e.brand_name," "]}),e.name]}),a.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:se(e)})]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[v&&a.jsx(c,{variant:"secondary",size:"sm",icon:"box",to:`/admin/packages?model=${e.id}`,className:"hidden md:inline-flex",children:"Pakete"}),v&&a.jsx(S,{icon:"box",label:"Pakete bearbeiten",to:`/admin/packages?model=${e.id}`,className:"md:hidden"}),a.jsx(S,{icon:"eye",label:"Auf der Website ansehen",href:`/fahrzeuge/${e.brand_slug}/${e.slug}`,target:"_blank",rel:"noopener noreferrer",className:"hidden sm:inline-flex"}),a.jsx(S,{icon:"pencil",label:"Bearbeiten",onClick:()=>M(e)}),a.jsx(S,{icon:"trash",label:"Löschen",tone:"danger",onClick:()=>re(e)})]})]})})]})})]}),a.jsxs(me,{as:"form",onSubmit:te,open:l!==null,onClose:q,size:"lg",title:l==="new"?"Neues Modell":"Modell bearbeiten",description:l==="new"?"Danach kannst du direkt Pakete dafür anlegen oder kopieren.":void 0,footer:a.jsxs(a.Fragment,{children:[l!=="new"&&l!==null&&v&&a.jsx(c,{variant:"ghost",icon:"box",to:`/admin/packages?model=${l}`,className:"mr-auto",children:"Pakete bearbeiten"}),a.jsx(c,{variant:"secondary",onClick:q,children:"Abbrechen"}),a.jsx(c,{type:"submit",disabled:A||l!=="new"&&!P,children:A?"Speichere…":l==="new"?"Anlegen":"Speichern"})]}),children:[a.jsx(J,{label:"Marke",required:!0,children:a.jsxs(T,{required:!0,value:o.brand_id,onChange:e=>k({...o,brand_id:e.target.value}),children:[a.jsx("option",{value:"",children:"Bitte wählen …"}),g.map(e=>a.jsx("option",{value:e.id,children:e.name},e.id))]})}),a.jsx(J,{label:"Modellname",required:!0,error:ae,hint:"Mit Generation, z. B. „Golf 7“ oder „A4 B9“.",children:a.jsx(W,{required:!0,autoFocus:!0,value:o.name,onChange:e=>k({...o,name:e.target.value})})}),l!=="new"&&l!==null&&a.jsx(ge,{fieldKey:`car_models.${l}.name`,previewText:o.name||"Beispieltext"}),a.jsx(he,{value:o.image_path,onChange:e=>k({...o,image_path:e}),label:"Bild (optional)"})]}),a.jsx(be,{open:ne,onClose:()=>w(!1),onImported:y})]})}export{Me as default}; +import{v as ie,k as de,p as oe,r as i,w as ce,j as a,P as ue,B as c,C as z,s as G,A as T,I as U,x as W,y as S,z as me,F as J,c as b}from"./index-CPMnKQBc.js";import he from"./ImageUploadField-DGJRkWaj.js";import{T as ge}from"./TextStyleWidget-DGEJ-L-L.js";import{S as xe,s as pe}from"./SortableList-Dgddukss.js";import{V as be}from"./VehicleCatalogDialog-BmzJprBQ.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";const j={name:"",brand_id:"",image_path:"",sort_order:0},K=h=>String(h||"").toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/ß/g,"ss");function Me(){var D;const h=ie(),{hasPermission:H}=de(),v=H("packages.manage"),[Z,Q]=oe(),[s,f]=i.useState(null),[g,X]=i.useState([]),[u,Y]=i.useState(null),[o,k]=i.useState(j),[ee,$]=i.useState(j),[l,N]=i.useState(null),[ae,C]=i.useState(""),[A,F]=i.useState(!1),[x,B]=i.useState(""),[ne,w]=i.useState(!1),P=JSON.stringify(o)!==JSON.stringify(ee);ce(l!==null&&P,"models");const y=()=>{b.get("/models").then(f).catch(()=>f([])),b.get("/brands").then(X).catch(()=>{}),v&&b.get("/packages").then(e=>Y(e.reduce((n,t)=>{const r=n[t.car_model_id]||{total:0,visible:0};return{...n,[t.car_model_id]:{total:r.total+1,visible:r.visible+(t.is_hidden?0:1)}}},{}))).catch(()=>{})};i.useEffect(y,[]);const I=Z.get("marke"),d=I==="alle"?"all":Number(I)||Number((D=g[0])==null?void 0:D.id)||null,m=g.find(e=>Number(e.id)===d)||null,E=d!=="all"&&!x.trim(),R=e=>{B(""),Q(e==="all"?{marke:"alle"}:{marke:String(e)})},V=i.useMemo(()=>{const e={};return(s||[]).forEach(n=>{var r,p;const t=e[r=n.brand_id]||(e[r]={count:0,empty:0});t.count+=1,u&&!((p=u[n.id])!=null&&p.visible)&&(t.empty+=1)}),e},[s,u]),_=i.useMemo(()=>{const e=d==="all"?s||[]:(s||[]).filter(t=>Number(t.brand_id)===d),n=K(x).split(/\s+/).filter(Boolean);return n.length?e.filter(t=>n.every(r=>K(`${t.brand_name} ${t.name}`).includes(r))):e},[s,d,x]),M=e=>{const n=e?{name:e.name,brand_id:e.brand_id,image_path:e.image_path||"",sort_order:e.sort_order}:{...j,brand_id:(m==null?void 0:m.id)??""};N(e?e.id:"new"),k(n),$(n),C("")},q=()=>{P&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||(N(null),k(j),$(j))},te=async e=>{e.preventDefault(),C(""),F(!0);const n={...o,brand_id:Number(o.brand_id)};try{if(l!=="new")await b.put(`/models/${l}`,n);else{const t=(s||[]).filter(r=>Number(r.brand_id)===n.brand_id).reduce((r,p)=>Math.max(r,Number(p.sort_order)||0),0)+10;await b.post("/models",{...n,sort_order:t})}h.success(l!=="new"?"Modell gespeichert.":"Modell angelegt."),$(o),N(null),y()}catch(t){C(t.message)}finally{F(!1)}},re=async e=>{var r;const n=((r=u==null?void 0:u[e.id])==null?void 0:r.total)||0,t=n>0?` und ${n} Paket${n===1?"":"e"} mit allen Produkten`:"";if(window.confirm(`„${e.brand_name} ${e.name}“${t} wirklich löschen?`))try{await b.delete(`/models/${e.id}`),l===e.id&&N(null),h.success("Modell gelöscht."),y()}catch(p){h.error(`Löschen fehlgeschlagen: ${p.message}`)}},L=(e,n)=>{const t=[...n];return e.map(r=>Number(r.brand_id)===d?t.shift():r)},le=async e=>{const n=s;f(L(s,e));try{const t=await pe("models",e);f(r=>L(r,t)),h.success("Reihenfolge gespeichert.")}catch(t){f(n),h.error(`Reihenfolge konnte nicht gespeichert werden: ${t.message}`)}},se=e=>{if(!u)return null;const n=u[e.id];return n!=null&&n.visible?`${n.visible} Paket${n.visible===1?"":"e"}${n.total>n.visible?` · ${n.total-n.visible} ausgeblendet`:""}`:a.jsx("span",{className:"font-medium text-amber-700 dark:text-amber-400",children:n!=null&&n.total?"Alle Pakete ausgeblendet":"Noch keine Pakete"})},O=(e,n,t)=>{const r=d===(e==="all"?"all":Number(e));return a.jsxs("button",{type:"button",onClick:()=>R(e==="all"?"all":Number(e)),className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition ${r?"bg-brand-50 font-semibold text-brand-800 dark:bg-brand-500/10 dark:text-brand-300":"text-neutral-700 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:[a.jsx("span",{className:"flex-1 truncate",children:n}),(t==null?void 0:t.empty)>0&&a.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-400",title:`${t.empty} Modell(e) ohne sichtbares Paket`}),a.jsx("span",{className:"text-xs font-normal text-neutral-400",children:(t==null?void 0:t.count)??0})]},e)};return a.jsxs("div",{children:[a.jsx(ue,{title:"Modelle",description:"Marke wählen, Modell anklicken zum Bearbeiten. Reihenfolge am Griff links ziehen – so erscheinen die Modelle auf der Website.",actions:a.jsxs(a.Fragment,{children:[a.jsx(c,{variant:"secondary",icon:"template",onClick:()=>w(!0),children:"Aus Vorlage laden"}),a.jsx(c,{icon:"plus",onClick:()=>M(null),disabled:!g.length,children:"Neues Modell"})]})}),s!==null&&g.length===0?a.jsx(z,{padded:!1,children:a.jsx(G,{icon:"tag",title:"Noch keine Marken",description:"Modelle gehören immer zu einer Marke. Lege zuerst Marken an oder übernimm Marken und Modelle aus der Vorlage.",actions:a.jsxs(a.Fragment,{children:[a.jsx(c,{variant:"secondary",icon:"template",onClick:()=>w(!0),children:"Aus Vorlage laden"}),a.jsx(c,{to:"/admin/brands",children:"Zu den Fahrzeugmarken"})]})})}):a.jsxs("div",{className:"grid gap-6 lg:grid-cols-[16rem_minmax(0,1fr)]",children:[a.jsx("div",{className:"lg:hidden",children:a.jsxs(T,{value:d==="all"?"all":String(d??""),onChange:e=>R(e.target.value==="all"?"all":Number(e.target.value)),children:[g.map(e=>{var n;return a.jsxs("option",{value:String(e.id),children:[e.name," (",((n=V[e.id])==null?void 0:n.count)??0,")"]},e.id)}),a.jsxs("option",{value:"all",children:["Alle Marken (",(s==null?void 0:s.length)??0,")"]})]})}),a.jsxs(z,{padded:!1,className:"hidden max-h-[calc(100vh-7rem)] flex-col overflow-hidden lg:sticky lg:top-24 lg:flex lg:self-start",children:[a.jsx("div",{className:"flex-1 space-y-0.5 overflow-y-auto p-2",children:g.map(e=>O(e.id,e.name,V[e.id]))}),a.jsx("div",{className:"border-t border-neutral-200 p-2 dark:border-neutral-800",children:O("all","Alle Marken",{count:(s==null?void 0:s.length)??0})})]}),a.jsx("div",{className:"min-w-0",children:a.jsxs(z,{padded:!1,className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-neutral-200 p-3 dark:border-neutral-800",children:[a.jsxs("div",{className:"relative w-full max-w-xs",children:[a.jsx(U,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),a.jsx(W,{value:x,onChange:e=>B(e.target.value),placeholder:d==="all"?"Alle Modelle durchsuchen …":`In ${(m==null?void 0:m.name)||"Marke"} suchen …`,className:"h-9 pl-9"})]}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[_.length," Modell",_.length===1?"":"e",d==="all"&&" · zum Sortieren eine Marke wählen"]})]}),s===null?a.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[0,1,2,3].map(e=>a.jsxs("li",{className:"flex items-center gap-4 px-4 py-3",children:[a.jsx("span",{className:"h-12 w-16 animate-pulse rounded-lg bg-neutral-100 dark:bg-neutral-800"}),a.jsx("span",{className:"h-4 w-40 animate-pulse rounded bg-neutral-100 dark:bg-neutral-800"})]},e))}):_.length===0?x.trim()?a.jsxs("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Kein Modell passt zu „",x,"“."]}):a.jsx(G,{icon:"car",title:`Noch keine Modelle${m?` für ${m.name}`:""}`,description:"Einzeln anlegen oder die Generationen dieser Marke aus der Vorlage übernehmen.",actions:a.jsxs(a.Fragment,{children:[a.jsx(c,{variant:"secondary",icon:"template",onClick:()=>w(!0),children:"Aus Vorlage laden"}),a.jsx(c,{icon:"plus",onClick:()=>M(null),children:"Neues Modell"})]})}):a.jsx(xe,{items:_,onReorder:le,disabled:!E,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(e,n)=>a.jsxs("div",{className:`flex items-center gap-3 bg-white px-3 py-2.5 transition hover:bg-neutral-50 dark:bg-neutral-900 dark:hover:bg-neutral-800/50 sm:gap-4 sm:px-4 ${l===e.id?"bg-brand-50/60 dark:bg-brand-900/20":""}`,children:[E&&a.jsx("span",{className:"w-6 shrink-0",children:n}),a.jsxs("button",{type:"button",onClick:()=>M(e),className:"flex min-w-0 flex-1 items-center gap-4 text-left",children:[e.image_path?a.jsx("img",{src:e.image_path,alt:"",className:"h-12 w-16 shrink-0 rounded-lg border border-neutral-200 object-cover dark:border-neutral-700"}):a.jsx("span",{className:"flex h-12 w-16 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-300 dark:bg-neutral-800 dark:text-neutral-600",children:a.jsx(U,{name:"car",className:"h-6 w-6"})}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:[d==="all"&&a.jsxs("span",{className:"font-normal text-neutral-500 dark:text-neutral-400",children:[e.brand_name," "]}),e.name]}),a.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:se(e)})]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[v&&a.jsx(c,{variant:"secondary",size:"sm",icon:"box",to:`/admin/packages?model=${e.id}`,className:"hidden md:inline-flex",children:"Pakete"}),v&&a.jsx(S,{icon:"box",label:"Pakete bearbeiten",to:`/admin/packages?model=${e.id}`,className:"md:hidden"}),a.jsx(S,{icon:"eye",label:"Auf der Website ansehen",href:`/fahrzeuge/${e.brand_slug}/${e.slug}`,target:"_blank",rel:"noopener noreferrer",className:"hidden sm:inline-flex"}),a.jsx(S,{icon:"pencil",label:"Bearbeiten",onClick:()=>M(e)}),a.jsx(S,{icon:"trash",label:"Löschen",tone:"danger",onClick:()=>re(e)})]})]})})]})})]}),a.jsxs(me,{as:"form",onSubmit:te,open:l!==null,onClose:q,size:"lg",title:l==="new"?"Neues Modell":"Modell bearbeiten",description:l==="new"?"Danach kannst du direkt Pakete dafür anlegen oder kopieren.":void 0,footer:a.jsxs(a.Fragment,{children:[l!=="new"&&l!==null&&v&&a.jsx(c,{variant:"ghost",icon:"box",to:`/admin/packages?model=${l}`,className:"mr-auto",children:"Pakete bearbeiten"}),a.jsx(c,{variant:"secondary",onClick:q,children:"Abbrechen"}),a.jsx(c,{type:"submit",disabled:A||l!=="new"&&!P,children:A?"Speichere…":l==="new"?"Anlegen":"Speichern"})]}),children:[a.jsx(J,{label:"Marke",required:!0,children:a.jsxs(T,{required:!0,value:o.brand_id,onChange:e=>k({...o,brand_id:e.target.value}),children:[a.jsx("option",{value:"",children:"Bitte wählen …"}),g.map(e=>a.jsx("option",{value:e.id,children:e.name},e.id))]})}),a.jsx(J,{label:"Modellname",required:!0,error:ae,hint:"Mit Generation, z. B. „Golf 7“ oder „A4 B9“.",children:a.jsx(W,{required:!0,autoFocus:!0,value:o.name,onChange:e=>k({...o,name:e.target.value})})}),l!=="new"&&l!==null&&a.jsx(ge,{fieldKey:`car_models.${l}.name`,previewText:o.name||"Beispieltext"}),a.jsx(he,{value:o.image_path,onChange:e=>k({...o,image_path:e}),label:"Bild (optional)"})]}),a.jsx(be,{open:ne,onClose:()=>w(!1),onImported:y})]})}export{Me as default}; diff --git a/hifi/assets/Packages-BHzawgo-.js b/hifi/assets/Packages-CIAy_ATE.js similarity index 99% rename from hifi/assets/Packages-BHzawgo-.js rename to hifi/assets/Packages-CIAy_ATE.js index d524d04..afb98a0 100644 --- a/hifi/assets/Packages-BHzawgo-.js +++ b/hifi/assets/Packages-CIAy_ATE.js @@ -1,2 +1,2 @@ -import{j as e,r as x,v as ae,M as ie,O as we,Q as Oe,c as z,p as Ve,P as ke,C as te,s as We,B as A,I as Z,T as de,t as oe,x as D,U as Se,V as re,y as Ze,w as qe,z as ce,F as W,W as je,A as Ge,Y as Qe}from"./index-eQrgtQRM.js";import{P as Pe,t as Ye}from"./packageTiers-DOLFlFAh.js";import{T as ve}from"./TextStyleWidget-Cc-J2FBP.js";import{u as He,a as _e,s as Je,K as Xe,P as et,D as tt,c as st,S as nt,v as at,b as rt,d as lt,C as it}from"./sortable.esm-CN3X5f7p.js";import{R as dt,T as $e}from"./trash-2-DA4I3Jzq.js";import{G as ct}from"./grip-vertical-DJgsXpN7.js";const se=Oe.replace("block w-full ",""),ee=`${se} w-full py-2`,Q=n=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(Number(n)||0);function Ce(n,l){const a=n.reduce((u,o)=>u+(Number(o.scraped_price)||0),0),m=Number(l.markup_value)||0;let d=0;return l.markup_type==="fixed"?d=m:l.markup_type==="percent"&&(d=a*m/100),{subtotal:a,markup:d,total:Math.round((a+d)*100)/100}}function H({title:n,onClick:l,disabled:a,danger:m,children:d}){return e.jsx("button",{type:"button",title:n,"aria-label":n,onClick:l,disabled:a,className:`rounded p-1.5 transition disabled:opacity-40 ${m?"text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/30":"text-neutral-400 hover:bg-neutral-100 hover:text-neutral-700 dark:hover:bg-neutral-800 dark:hover:text-neutral-200"}`,children:d})}function ze({items:n,onReorder:l,children:a}){const m=He(_e(et,{activationConstraint:{distance:4}}),_e(Xe,{coordinateGetter:Je})),d=({active:u,over:o})=>{if(!o||u.id===o.id)return;const g=n.findIndex(_=>_.id===u.id),v=n.findIndex(_=>_.id===o.id);l(rt(n,g,v))};return e.jsx(tt,{sensors:m,collisionDetection:st,onDragEnd:d,children:e.jsx(nt,{items:n.map(u=>u.id),strategy:at,children:e.jsx("ul",{className:"divide-y divide-neutral-100 overflow-hidden rounded-xl border border-neutral-200 dark:divide-neutral-800 dark:border-neutral-800",children:n.map(u=>e.jsx(ot,{id:u.id,children:o=>a(u,o)},u.id))})})})}function ot({id:n,children:l}){const{attributes:a,listeners:m,setNodeRef:d,setActivatorNodeRef:u,transform:o,transition:g,isDragging:v}=lt({id:n}),_=e.jsx("button",{type:"button",ref:u,...a,...m,title:"Ziehen, um die Reihenfolge zu ändern","aria-label":"Reihenfolge ändern",className:"mt-0.5 cursor-grab touch-none rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 active:cursor-grabbing dark:hover:bg-neutral-800",children:e.jsx(ct,{className:"h-4 w-4"})});return e.jsx("li",{ref:d,style:{transform:it.Transform.toString(o),transition:g,position:"relative",zIndex:v?10:void 0},className:`bg-white dark:bg-neutral-900 ${v?"shadow-lg ring-1 ring-brand-500":""}`,children:l(_)})}function Ee(n,l,a){const m=l.map((o,g)=>({...o,sort_order:(g+1)*10})),d=new Map(n.map(o=>[o.id,Number(o.sort_order)])),u=m.filter(o=>d.get(o.id)!==o.sort_order);return{next:m,persist:async()=>{for(const o of u)await a(o)}}}function ut({products:n,form:l}){const{subtotal:a,markup:m,total:d}=Ce(n,l),u=n.filter(o=>o.scraped_price==null).length;return e.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-neutral-50 p-4 text-sm dark:border-neutral-800 dark:bg-neutral-950",children:[e.jsxs("div",{className:"flex justify-between text-neutral-600 dark:text-neutral-300",children:[e.jsxs("span",{children:["Bauteile (",n.length,")"]}),e.jsx("span",{children:Q(a)})]}),e.jsxs("div",{className:"flex justify-between text-neutral-600 dark:text-neutral-300",children:[e.jsxs("span",{children:["Aufschlag",l.markup_type==="percent"&&` (${Number(l.markup_value)||0} %)`]}),e.jsxs("span",{children:["+ ",Q(m)]})]}),e.jsxs("div",{className:"mt-2 flex items-baseline justify-between border-t border-neutral-200 pt-2 font-semibold text-neutral-900 dark:border-neutral-800 dark:text-white",children:[e.jsx("span",{children:"Preis auf der Website"}),e.jsx("span",{className:"text-xl font-bold tracking-tight",children:Q(d)})]}),l.price_text&&e.jsxs("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:["Auf der Kachel steht stattdessen der Preis-Text „",l.price_text,"“."]}),u>0&&e.jsxs("p",{className:"mt-1 text-xs text-amber-700 dark:text-amber-400",children:[u===1?"1 Produkt hat":`${u} Produkte haben`," noch keinen Preis und ",u===1?"zählt":"zählen"," mit 0 €."]})]})}function mt({packageId:n,products:l,onChange:a}){const[m,d]=x.useState(""),[u,o]=x.useState(null),[g,v]=x.useState([]),[_,N]=x.useState(null),[c,r]=x.useState(null),i=ae(),p=async()=>{const s=m.split(/\r?\n/).map(w=>w.trim()).filter(Boolean);if(!s.length)return;v([]);const b=w=>/^https:\/\/www\.audio4cars\.de\//i.test(w),f=s.filter(b),h=s.filter(w=>!b(w)),S=h.map(w=>`${w}: keine audio4cars.de-Produktseite (muss mit https://www.audio4cars.de/ beginnen)`);let U=l,E=U.reduce((w,M)=>Math.max(w,Number(M.sort_order)||0),0),j=0;o({done:0,total:f.length});for(const[w,M]of f.entries()){E+=10;try{const L=await z.post("/products",{package_id:n,source_url:M,sort_order:E});U=[...U,L],a(U),j+=1,L.scrape_status==="error"&&S.push(`${M}: angelegt, aber Preis konnte nicht gelesen werden (${L.scrape_error||"unbekannter Fehler"})`)}catch(L){h.push(M),S.push(`${M}: ${L.message}`)}o({done:w+1,total:f.length})}o(null),v(S),j>0&&i.success(j===1?"Produkt hinzugefügt.":`${j} Produkte hinzugefügt.`),S.length&&i.error(`${S.length} Link(s) mit Problemen – Details unter dem Eingabefeld.`),d(h.join(` +import{j as e,r as x,v as ae,M as ie,O as we,Q as Oe,c as z,p as Ve,P as ke,C as te,s as We,B as A,I as Z,T as de,t as oe,x as D,U as Se,V as re,y as Ze,w as qe,z as ce,F as W,W as je,A as Ge,Y as Qe}from"./index-CPMnKQBc.js";import{P as Pe,t as Ye}from"./packageTiers-DOLFlFAh.js";import{T as ve}from"./TextStyleWidget-DGEJ-L-L.js";import{u as He,a as _e,s as Je,K as Xe,P as et,D as tt,c as st,S as nt,v as at,b as rt,d as lt,C as it}from"./sortable.esm-CUwm6pqJ.js";import{R as dt,T as $e}from"./trash-2-DwLXj_oo.js";import{G as ct}from"./grip-vertical-Cn5hJClA.js";const se=Oe.replace("block w-full ",""),ee=`${se} w-full py-2`,Q=n=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(Number(n)||0);function Ce(n,l){const a=n.reduce((u,o)=>u+(Number(o.scraped_price)||0),0),m=Number(l.markup_value)||0;let d=0;return l.markup_type==="fixed"?d=m:l.markup_type==="percent"&&(d=a*m/100),{subtotal:a,markup:d,total:Math.round((a+d)*100)/100}}function H({title:n,onClick:l,disabled:a,danger:m,children:d}){return e.jsx("button",{type:"button",title:n,"aria-label":n,onClick:l,disabled:a,className:`rounded p-1.5 transition disabled:opacity-40 ${m?"text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/30":"text-neutral-400 hover:bg-neutral-100 hover:text-neutral-700 dark:hover:bg-neutral-800 dark:hover:text-neutral-200"}`,children:d})}function ze({items:n,onReorder:l,children:a}){const m=He(_e(et,{activationConstraint:{distance:4}}),_e(Xe,{coordinateGetter:Je})),d=({active:u,over:o})=>{if(!o||u.id===o.id)return;const g=n.findIndex(_=>_.id===u.id),v=n.findIndex(_=>_.id===o.id);l(rt(n,g,v))};return e.jsx(tt,{sensors:m,collisionDetection:st,onDragEnd:d,children:e.jsx(nt,{items:n.map(u=>u.id),strategy:at,children:e.jsx("ul",{className:"divide-y divide-neutral-100 overflow-hidden rounded-xl border border-neutral-200 dark:divide-neutral-800 dark:border-neutral-800",children:n.map(u=>e.jsx(ot,{id:u.id,children:o=>a(u,o)},u.id))})})})}function ot({id:n,children:l}){const{attributes:a,listeners:m,setNodeRef:d,setActivatorNodeRef:u,transform:o,transition:g,isDragging:v}=lt({id:n}),_=e.jsx("button",{type:"button",ref:u,...a,...m,title:"Ziehen, um die Reihenfolge zu ändern","aria-label":"Reihenfolge ändern",className:"mt-0.5 cursor-grab touch-none rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 active:cursor-grabbing dark:hover:bg-neutral-800",children:e.jsx(ct,{className:"h-4 w-4"})});return e.jsx("li",{ref:d,style:{transform:it.Transform.toString(o),transition:g,position:"relative",zIndex:v?10:void 0},className:`bg-white dark:bg-neutral-900 ${v?"shadow-lg ring-1 ring-brand-500":""}`,children:l(_)})}function Ee(n,l,a){const m=l.map((o,g)=>({...o,sort_order:(g+1)*10})),d=new Map(n.map(o=>[o.id,Number(o.sort_order)])),u=m.filter(o=>d.get(o.id)!==o.sort_order);return{next:m,persist:async()=>{for(const o of u)await a(o)}}}function ut({products:n,form:l}){const{subtotal:a,markup:m,total:d}=Ce(n,l),u=n.filter(o=>o.scraped_price==null).length;return e.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-neutral-50 p-4 text-sm dark:border-neutral-800 dark:bg-neutral-950",children:[e.jsxs("div",{className:"flex justify-between text-neutral-600 dark:text-neutral-300",children:[e.jsxs("span",{children:["Bauteile (",n.length,")"]}),e.jsx("span",{children:Q(a)})]}),e.jsxs("div",{className:"flex justify-between text-neutral-600 dark:text-neutral-300",children:[e.jsxs("span",{children:["Aufschlag",l.markup_type==="percent"&&` (${Number(l.markup_value)||0} %)`]}),e.jsxs("span",{children:["+ ",Q(m)]})]}),e.jsxs("div",{className:"mt-2 flex items-baseline justify-between border-t border-neutral-200 pt-2 font-semibold text-neutral-900 dark:border-neutral-800 dark:text-white",children:[e.jsx("span",{children:"Preis auf der Website"}),e.jsx("span",{className:"text-xl font-bold tracking-tight",children:Q(d)})]}),l.price_text&&e.jsxs("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:["Auf der Kachel steht stattdessen der Preis-Text „",l.price_text,"“."]}),u>0&&e.jsxs("p",{className:"mt-1 text-xs text-amber-700 dark:text-amber-400",children:[u===1?"1 Produkt hat":`${u} Produkte haben`," noch keinen Preis und ",u===1?"zählt":"zählen"," mit 0 €."]})]})}function mt({packageId:n,products:l,onChange:a}){const[m,d]=x.useState(""),[u,o]=x.useState(null),[g,v]=x.useState([]),[_,N]=x.useState(null),[c,r]=x.useState(null),i=ae(),p=async()=>{const s=m.split(/\r?\n/).map(w=>w.trim()).filter(Boolean);if(!s.length)return;v([]);const b=w=>/^https:\/\/www\.audio4cars\.de\//i.test(w),f=s.filter(b),h=s.filter(w=>!b(w)),S=h.map(w=>`${w}: keine audio4cars.de-Produktseite (muss mit https://www.audio4cars.de/ beginnen)`);let U=l,E=U.reduce((w,M)=>Math.max(w,Number(M.sort_order)||0),0),j=0;o({done:0,total:f.length});for(const[w,M]of f.entries()){E+=10;try{const L=await z.post("/products",{package_id:n,source_url:M,sort_order:E});U=[...U,L],a(U),j+=1,L.scrape_status==="error"&&S.push(`${M}: angelegt, aber Preis konnte nicht gelesen werden (${L.scrape_error||"unbekannter Fehler"})`)}catch(L){h.push(M),S.push(`${M}: ${L.message}`)}o({done:w+1,total:f.length})}o(null),v(S),j>0&&i.success(j===1?"Produkt hinzugefügt.":`${j} Produkte hinzugefügt.`),S.length&&i.error(`${S.length} Link(s) mit Problemen – Details unter dem Eingabefeld.`),d(h.join(` `))},k=async s=>{N(s.id);try{const b=await z.post(`/products/${s.id}/refresh-price`,{});a(l.map(f=>f.id===s.id?b:f)),b.scrape_status==="error"?i.error(`Preis konnte nicht gelesen werden: ${b.scrape_error||"unbekannter Fehler"}`):i.success("Name und Preis aktualisiert.")}catch(b){v([`Preis konnte nicht aktualisiert werden: ${b.message}`]),i.error(`Preis konnte nicht aktualisiert werden: ${b.message}`)}finally{N(null)}},$=async s=>{if(confirm(`Produkt "${s.name_override||s.scraped_name||s.source_url}" aus dem Paket entfernen?`)){try{await z.delete(`/products/${s.id}`)}catch(b){i.error(`Entfernen fehlgeschlagen: ${b.message}`);return}a(l.filter(b=>b.id!==s.id)),i.success("Produkt entfernt.")}},P=async(s,b)=>{const f=b.trim()||null;try{await z.put(`/products/${s.id}`,{source_url:s.source_url,name_override:f,sort_order:s.sort_order})}catch(h){i.error(`Name konnte nicht gespeichert werden: ${h.message}`);return}a(l.map(h=>h.id===s.id?{...h,name_override:f}:h)),r(null),i.success("Anzeigename gespeichert.")},T=async s=>{const{next:b,persist:f}=Ee(l,s,h=>z.put(`/products/${h.id}`,{source_url:h.source_url,name_override:h.name_override,sort_order:h.sort_order}));a(b);try{await f()}catch(h){a(l),v([`Reihenfolge konnte nicht gespeichert werden: ${h.message}`]),i.error(`Reihenfolge konnte nicht gespeichert werden: ${h.message}`)}};return e.jsxs("div",{children:[e.jsxs("h4",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:["Produkte ",e.jsx("span",{className:"ml-1 font-normal normal-case tracking-normal",children:"– erscheinen als Stichpunkte auf der Kachel"})]}),l.length>0&&e.jsx(ze,{items:l,onReorder:T,children:(s,b)=>e.jsxs("div",{className:"flex items-start gap-2 px-2 py-2.5 text-sm",children:[b,e.jsxs("div",{className:"min-w-0 flex-1",children:[(c==null?void 0:c.id)===s.id?e.jsxs("form",{className:"flex gap-2",onSubmit:f=>{f.preventDefault(),P(s,c.value)},children:[e.jsx("input",{autoFocus:!0,value:c.value,onChange:f=>r({...c,value:f.target.value}),placeholder:s.scraped_name||"Anzeigename",className:`${se} w-full py-1`}),e.jsx("button",{type:"submit",className:ie({size:"sm"}),children:"OK"}),e.jsx("button",{type:"button",onClick:()=>r(null),className:"text-xs text-neutral-500 hover:underline",children:"Abbrechen"})]}):e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:s.name_override||s.scraped_name||"Name konnte nicht gelesen werden"}),e.jsx("a",{href:s.source_url,target:"_blank",rel:"noreferrer",className:"block truncate text-xs text-neutral-400 hover:text-brand-600",children:s.source_url.replace(/^https?:\/\/(www\.)?/,"")}),s.name_override&&s.scraped_name&&e.jsxs("p",{className:"text-xs text-neutral-400",children:["Original: ",s.scraped_name]}),s.scrape_status==="error"&&e.jsx("p",{className:"text-xs text-red-600",children:s.scrape_error})]}),e.jsx("span",{className:"whitespace-nowrap pt-0.5 font-medium text-neutral-700 dark:text-neutral-200",children:s.scraped_price!=null?Q(s.scraped_price):"–"}),e.jsxs("div",{className:"flex shrink-0 items-center",children:[e.jsx(H,{title:"Anzeigenamen ändern",onClick:()=>r({id:s.id,value:s.name_override||""}),children:e.jsx(we,{className:"h-3.5 w-3.5"})}),e.jsx(H,{title:"Name und Preis neu abrufen",onClick:()=>k(s),disabled:_===s.id,children:e.jsx(dt,{className:`h-3.5 w-3.5 ${_===s.id?"animate-spin":""}`})}),e.jsx(H,{title:"Aus dem Paket entfernen",danger:!0,onClick:()=>$(s),children:e.jsx($e,{className:"h-3.5 w-3.5"})})]})]})}),e.jsxs("div",{className:"mt-2",children:[e.jsx("textarea",{rows:2,value:m,onChange:s=>d(s.target.value),disabled:!!u,placeholder:"audio4cars.de-Links einfügen – auch mehrere, einer pro Zeile",className:ee}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:p,disabled:!!u||!m.trim(),className:ie({variant:"secondary",size:"sm"}),children:"Produkte hinzufügen"}),u&&e.jsxs("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["Name und Preis werden abgerufen … ",u.done,"/",u.total]})]}),g.map(s=>e.jsx("p",{className:"mt-1 text-xs text-red-600",children:s},s))]})]})}const Me={name:"",price:"",description:"",name_en:"",description_en:""};function ye({initial:n,submitLabel:l,onSubmit:a,onCancel:m}){const[d,u]=x.useState(n),[o,g]=x.useState(""),[v,_]=x.useState(!1),N=async c=>{c.preventDefault(),_(!0),g("");try{await a({...d,name:d.name.trim(),price:Number(d.price)||0,description:d.description.trim()||null,name_en:(d.name_en||"").trim(),description_en:(d.description_en||"").trim()}),m||u(Me)}catch(r){g(r.message)}finally{_(!1)}};return e.jsxs("form",{onSubmit:N,className:"space-y-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{required:!0,value:d.name,onChange:c=>u({...d,name:c.target.value}),placeholder:"Upgrade, z. B. Türdämmung vorne",className:`${se} min-w-0 flex-1 py-2`}),e.jsx("input",{required:!0,type:"number",step:"0.01",min:"0",value:d.price,onChange:c=>u({...d,price:c.target.value}),placeholder:"Preis €",className:`${se} w-28 shrink-0 py-2`})]}),e.jsx("input",{value:d.description||"",onChange:c=>u({...d,description:c.target.value}),placeholder:"Kurze Beschreibung (optional)",className:ee}),e.jsxs("details",{open:!!(n.name_en||n.description_en),children:[e.jsx("summary",{className:"cursor-pointer select-none text-xs text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-200",children:"Englisch (optional – leer = deutscher Text)"}),e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsx("input",{value:d.name_en||"",onChange:c=>u({...d,name_en:c.target.value}),placeholder:"Name auf Englisch, z. B. Front door insulation",className:ee}),e.jsx("input",{value:d.description_en||"",onChange:c=>u({...d,description_en:c.target.value}),placeholder:"Beschreibung auf Englisch (optional)",className:ee})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"submit",disabled:v,className:ie({variant:"secondary",size:"sm"}),children:l}),m&&e.jsx("button",{type:"button",onClick:m,className:"text-sm text-neutral-500 hover:underline",children:"Abbrechen"}),o&&e.jsx("span",{className:"text-xs text-red-600",children:o})]})]})}function ht({packageId:n,upgrades:l,onChange:a}){const[m,d]=x.useState(null),[u,o]=x.useState(""),g=ae(),v=async r=>{const i=l.reduce(($,P)=>Math.max($,Number(P.sort_order)||0),0)+10,p={...r,package_id:n,sort_order:i},k=await z.post("/package-upgrades",p);a([...l,{...p,id:k.id}]),g.success(`Upgrade „${r.name}“ hinzugefügt.`)},_=async(r,i)=>{const p={...i,sort_order:r.sort_order};await z.put(`/package-upgrades/${r.id}`,p),a(l.map(k=>k.id===r.id?{...k,...p}:k)),d(null),g.success("Upgrade gespeichert.")},N=async r=>{if(confirm(`Upgrade "${r.name}" löschen?`)){try{await z.delete(`/package-upgrades/${r.id}`)}catch(i){g.error(`Löschen fehlgeschlagen: ${i.message}`);return}a(l.filter(i=>i.id!==r.id)),g.success(`Upgrade „${r.name}“ gelöscht.`)}},c=async r=>{const{next:i,persist:p}=Ee(l,r,k=>z.put(`/package-upgrades/${k.id}`,{name:k.name,description:k.description,price:k.price,sort_order:k.sort_order,name_en:k.name_en||"",description_en:k.description_en||""}));a(i);try{await p()}catch(k){a(l),o(`Reihenfolge konnte nicht gespeichert werden: ${k.message}`),g.error(`Reihenfolge konnte nicht gespeichert werden: ${k.message}`)}};return e.jsxs("div",{children:[e.jsxs("h4",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:["Upgrades ",e.jsx("span",{className:"ml-1 font-normal normal-case tracking-normal",children:"– wählbar im Kontaktformular, nicht auf der Kachel"})]}),l.length>0&&e.jsx("div",{className:"mb-2",children:e.jsx(ze,{items:l,onReorder:c,children:(r,i)=>m===r.id?e.jsx("div",{className:"p-2",children:e.jsx(ye,{initial:{name:r.name,price:r.price,description:r.description||"",name_en:r.name_en||"",description_en:r.description_en||""},submitLabel:"Speichern",onSubmit:p=>_(r,p),onCancel:()=>d(null)})}):e.jsxs("div",{className:"flex items-start gap-2 px-2 py-2.5 text-sm",children:[i,e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:r.name}),r.description&&e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:r.description}),r.name_en&&e.jsxs("p",{className:"text-xs text-neutral-400",children:["EN: ",r.name_en]})]}),e.jsxs("span",{className:"whitespace-nowrap pt-0.5 font-medium text-neutral-700 dark:text-neutral-200",children:["+ ",Q(r.price)]}),e.jsxs("div",{className:"flex shrink-0 items-center",children:[e.jsx(H,{title:"Bearbeiten",onClick:()=>d(r.id),children:e.jsx(we,{className:"h-3.5 w-3.5"})}),e.jsx(H,{title:"Löschen",danger:!0,onClick:()=>N(r),children:e.jsx($e,{className:"h-3.5 w-3.5"})})]})]})})}),u&&e.jsx("p",{className:"mb-1 text-xs text-red-600",children:u}),e.jsx(ye,{initial:Me,submitLabel:"Upgrade hinzufügen",onSubmit:v})]})}const Be=[{value:"",label:"Keine"},{value:"recommended",label:"Empfohlen"},{value:"popular",label:"Am beliebtesten"},{value:"tip",label:"Tipp"},{value:"coming_soon",label:"Coming soon"},{value:"custom",label:"Eigener Text …"}],Ae=(n,l)=>{var a;return n==="custom"?l:(a=Be.find(m=>m.value===n&&m.value))==null?void 0:a.label},xt=n=>({description:n.description||"",markup_type:n.markup_type||"none",markup_value:n.markup_value||0,icon_name:n.icon_name||"",tagline:n.tagline||"",price_text:n.price_text||"",description_en:n.description_en||"",tagline_en:n.tagline_en||"",price_text_en:n.price_text_en||"",badge:n.badge||"",badge_text:n.badge_text||"",video_url:n.video_url||"",sort_order:n.sort_order??0}),pt=n=>({description:"",markup_type:"none",markup_value:0,icon_name:"",tagline:"",price_text:"",description_en:"",tagline_en:"",price_text_en:"",badge:"",badge_text:"",video_url:"",sort_order:Ye(n)}),gt=["description","markup_type","markup_value","icon_name","tagline","price_text","badge","badge_text","video_url","sort_order","description_en","tagline_en","price_text_en"],bt=(n,l)=>gt.some(a=>String(n[a])!==String(l[a])),ft=(n,l)=>{const a=l.filter(o=>o.car_model_id===n).slice().sort((o,g)=>o.sort_order-g.sort_order||o.name.localeCompare(g.name)),m=new Set,d=Pe.map((o,g)=>{const v=a.find(_=>!m.has(_.id)&&_.name.trim().toLowerCase()===o.toLowerCase());return v&&m.add(v.id),{key:`tier-${g}`,tierIndex:g,name:o,existing:v||null}}),u=a.filter(o=>!m.has(o.id)).map(o=>({key:`legacy-${o.id}`,tierIndex:null,name:o.name,existing:o}));return[...d,...u]},Ne=n=>n.reduce((l,a)=>{var m;return(l[m=a.package_id]||(l[m]=[])).push(a),l},{}),X=[],ne=n=>String(n||"").toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/ß/g,"ss"),R=n=>n?`${n.brand_name||""} ${n.name}`.trim():"";function kt({models:n,visibleCounts:l,selectedId:a,onSelect:m}){const[d,u]=x.useState(""),[o,g]=x.useState(()=>new Set),v=n.find(r=>r.id===a);x.useEffect(()=>{v&&g(r=>r.has(v.brand_id)?r:new Set(r).add(v.brand_id))},[v]);const _=x.useMemo(()=>{const r=ne(d).split(/\s+/).filter(Boolean),i=new Map;return n.filter(p=>!r.length||r.every(k=>ne(R(p)).includes(k))).forEach(p=>{i.has(p.brand_id)||i.set(p.brand_id,{id:p.brand_id,name:p.brand_name||"",models:[]}),i.get(p.brand_id).models.push(p)}),[...i.values()].sort((p,k)=>p.name.localeCompare(k.name)).map(p=>({...p,models:p.models.sort((k,$)=>k.name.localeCompare($.name))}))},[n,d]),N=d.trim()!=="",c=r=>g(i=>{const p=new Set(i);return p.has(r)?p.delete(r):p.add(r),p});return e.jsxs(te,{padded:!1,className:"flex max-h-[70vh] flex-col overflow-hidden lg:max-h-[calc(100vh-7rem)]",children:[e.jsx("div",{className:"border-b border-neutral-200 p-3 dark:border-neutral-800",children:e.jsxs("div",{className:"relative",children:[e.jsx(Z,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),e.jsx(D,{value:d,onChange:r=>u(r.target.value),placeholder:"Modell suchen, z. B. golf",className:"h-9 pl-9"})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[_.length===0&&e.jsx("p",{className:"px-3 py-6 text-center text-sm text-neutral-500 dark:text-neutral-400",children:"Kein Modell gefunden."}),_.map(r=>{const i=N||o.has(r.id),p=r.models.filter(k=>!l[k.id]).length;return e.jsxs("div",{className:"mb-0.5",children:[e.jsxs("button",{type:"button",onClick:()=>c(r.id),"aria-expanded":i,className:"flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm font-semibold text-neutral-800 hover:bg-neutral-100 dark:text-neutral-100 dark:hover:bg-neutral-800",children:[e.jsx(Z,{name:"chevron",className:`h-3.5 w-3.5 text-neutral-400 transition-transform ${i?"rotate-90":""}`}),e.jsx("span",{className:"flex-1 truncate",children:r.name}),p>0&&e.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-400",title:`${p} Modell(e) ohne sichtbares Paket`}),e.jsx("span",{className:"text-xs font-normal text-neutral-400",children:r.models.length})]}),i&&e.jsx("ul",{className:"mb-1 ml-4 border-l border-neutral-200 pl-2 dark:border-neutral-800",children:r.models.map(k=>{const $=l[k.id]||0,P=k.id===a;return e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:()=>m(k.id),className:`flex w-full items-center justify-between gap-2 rounded-lg px-2.5 py-1.5 text-left text-sm transition ${P?"bg-brand-50 font-semibold text-brand-800 dark:bg-brand-500/10 dark:text-brand-300":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:[e.jsx("span",{className:"truncate",children:k.name}),$>0?e.jsx("span",{className:"shrink-0 text-xs text-neutral-400",children:$}):e.jsx("span",{className:"shrink-0 rounded-full bg-amber-100 px-1.5 text-[10px] font-semibold text-amber-800 dark:bg-amber-900/40 dark:text-amber-300",children:"leer"})]})},k.id)})})]},r.id)})]})]})}function jt({row:n,products:l,upgrades:a,itemsLoaded:m,visibilityBusy:d,selectMode:u,selected:o,onOpen:g,onToggleSelect:v,onToggleVisibility:_}){const N=n.existing,c=n.tierIndex!==null?Qe[n.tierIndex]:null;if(!N)return e.jsxs("button",{type:"button",onClick:g,disabled:u,className:"group disabled:pointer-events-none disabled:opacity-40 flex min-h-[176px] flex-col overflow-hidden rounded-xl border-2 border-dashed border-neutral-300 text-left transition hover:border-brand-500 hover:bg-brand-50/40 dark:border-neutral-700 dark:hover:bg-brand-900/10",children:[e.jsxs("div",{className:"relative h-14 overflow-hidden",children:[c&&e.jsx("img",{src:c,alt:"",className:"h-full w-full object-cover opacity-25 grayscale"}),e.jsx("span",{className:"absolute inset-0 flex items-center px-4 text-sm font-bold text-neutral-500 dark:text-neutral-400",children:n.name})]}),e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-1 p-4 text-neutral-400 group-hover:text-brand-600 dark:group-hover:text-brand-400",children:[e.jsx(Z,{name:"plus",className:"h-5 w-5"}),e.jsx("span",{className:"text-sm font-medium",children:"Paket anlegen"})]})]});const{total:r}=Ce(l,N),i=l.filter(k=>k.scraped_price==null).length,p=Ae(N.badge,N.badge_text);return e.jsxs("div",{className:`group relative flex min-h-[176px] flex-col overflow-hidden rounded-xl border bg-white shadow-sm transition hover:-translate-y-0.5 hover:shadow-md dark:bg-neutral-900 ${o?"border-brand-500 ring-2 ring-brand-500":N.is_hidden?"border-dashed border-amber-300 dark:border-amber-800":"border-neutral-200 dark:border-neutral-800"}`,children:[e.jsxs("button",{type:"button",onClick:u?v:g,className:"flex flex-1 flex-col text-left","aria-label":u?`${n.name} ${o?"abwählen":"auswählen"}`:`${n.name} bearbeiten`,"aria-pressed":u?!!o:void 0,children:[e.jsxs("div",{className:"relative h-14 overflow-hidden bg-neutral-800",children:[u&&e.jsx("span",{className:`absolute right-3 top-1/2 z-10 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-md border-2 ${o?"border-brand-500 bg-brand-500 text-white":"border-white/80 bg-black/30 text-transparent"}`,children:e.jsx(Z,{name:"check",className:"h-4 w-4"})}),c&&e.jsx("img",{src:c,alt:"",className:`h-full w-full object-cover ${N.is_hidden?"opacity-40 grayscale":""}`}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black/60 to-transparent"}),e.jsxs("span",{className:"absolute inset-0 flex items-center gap-2 px-4 text-sm font-bold text-white",children:[n.name,p&&e.jsx("span",{className:"rounded-full bg-white/90 px-2 py-0.5 text-[10px] font-semibold text-neutral-900",children:p})]})]}),e.jsxs("div",{className:"flex flex-1 flex-col p-4",children:[e.jsx("p",{className:`text-2xl font-bold tracking-tight ${N.is_hidden?"text-neutral-400":"text-neutral-900 dark:text-white"}`,children:N.price_text?e.jsxs("span",{className:"text-lg",children:["„",N.price_text,"“"]}):m?Q(r):"…"}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:[l.length," ",l.length===1?"Produkt":"Produkte"," · ",a.length," ",a.length===1?"Upgrade":"Upgrades",N.video_url&&" · Video"]}),l.length===0&&m&&e.jsx("p",{className:"mt-2 text-xs font-medium text-amber-700 dark:text-amber-400",children:"Noch keine Produkte"}),i>0&&e.jsxs("p",{className:"mt-2 text-xs font-medium text-amber-700 dark:text-amber-400",children:[i," ohne Preis"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-neutral-100 px-4 py-2 dark:border-neutral-800",children:[e.jsx("span",{className:`text-xs font-medium ${N.is_hidden?"text-amber-700 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:N.is_hidden?"Ausgeblendet":"Sichtbar"}),e.jsx(re,{checked:!N.is_hidden,disabled:d||u,onChange:()=>_(N)})]})]})}function vt({row:n,model:l,products:a,upgrades:m,visibilityBusy:d,onClose:u,onSave:o,onDelete:g,onToggleVisibility:v,onProductsChange:_,onUpgradesChange:N}){const c=(n==null?void 0:n.existing)||null,r=x.useMemo(()=>n?c?xt(c):pt(n.tierIndex??0):null,[n,c]),[i,p]=x.useState(r),[k,$]=x.useState(!1),[P,T]=x.useState(""),s=x.useRef(null);x.useEffect(()=>{p(r),T("")},[n==null?void 0:n.key,c==null?void 0:c.id]);const b=!!i&&!!r&&(!c||bt(i,r));if(qe(!!c&&b,"package-editor"),!n||!i)return e.jsx(ce,{open:!1,onClose:u});const f=j=>p(w=>({...w,...j})),h=()=>{const j=s.current;if(!j)return;const{selectionStart:w,selectionEnd:M,value:L}=j;if(w===M)return;const B=L.slice(w,M),q=B.startsWith("**")&&B.endsWith("**")&&B.length>=4?B.slice(2,-2):`**${B}**`;f({description:L.slice(0,w)+q+L.slice(M)}),requestAnimationFrame(()=>{j.focus();const O=w+q.length;j.setSelectionRange(O,O)})},S=()=>{c&&b&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||u()},U=async()=>{$(!0),T("");try{await o(n,i)}catch(j){T(j.message)}finally{$(!1)}},E=!!(i.description_en||i.price_text_en);return e.jsxs(ce,{open:!0,size:"xl",onClose:S,title:c?n.name:`${n.name} anlegen`,description:c?R(l):`Neues Paket für ${R(l)}. Produkte und Upgrades kannst du direkt nach dem Anlegen hinzufügen.`,headerExtra:c&&e.jsx(re,{checked:!c.is_hidden,disabled:d,onChange:()=>v(c),label:c.is_hidden?"Ausgeblendet":"Sichtbar",className:"mr-1 gap-2"}),footer:e.jsxs(e.Fragment,{children:[c&&e.jsx(A,{variant:"ghost",icon:"trash",onClick:()=>g(n),className:"mr-auto text-red-600 hover:bg-red-50 hover:text-red-700 dark:text-red-400 dark:hover:bg-red-950/40",children:"Löschen"}),c&&b&&e.jsx("span",{className:"text-sm font-medium text-amber-600 dark:text-amber-400",children:"● Ungespeichert"}),e.jsx(A,{variant:"secondary",onClick:S,children:c?"Schließen":"Abbrechen"}),e.jsx(A,{onClick:U,disabled:k||!b,children:k?"Speichere…":c?"Speichern":"Paket anlegen"})]}),children:[P&&e.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:P}),e.jsxs("section",{className:"space-y-3",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Preis"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(oe,{value:i.markup_type,onChange:j=>f({markup_type:j}),options:[{value:"none",label:"Kein Aufschlag"},{value:"fixed",label:"Betrag €"},{value:"percent",label:"Prozent %"}]}),i.markup_type!=="none"&&e.jsxs("div",{className:"relative w-36",children:[e.jsx(D,{type:"number",step:"0.01",min:"0",value:i.markup_value,onChange:j=>f({markup_value:j.target.value}),className:"pr-8","aria-label":"Aufschlag"}),e.jsx("span",{className:"pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-neutral-400",children:i.markup_type==="percent"?"%":"€"})]})]}),c&&e.jsx(ut,{products:a,form:i})]}),c?e.jsxs(e.Fragment,{children:[e.jsx("section",{className:"border-t border-neutral-200 pt-5 dark:border-neutral-800",children:e.jsx(mt,{packageId:c.id,products:a,onChange:_})}),e.jsx("section",{className:"border-t border-neutral-200 pt-5 dark:border-neutral-800",children:e.jsx(ht,{packageId:c.id,upgrades:m,onChange:N})})]}):e.jsx("p",{className:"rounded-lg border border-dashed border-neutral-300 p-3 text-sm text-neutral-500 dark:border-neutral-700 dark:text-neutral-400",children:"Nach „Paket anlegen“ erscheinen hier Produkte und Upgrades."}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Auf der Kachel"}),e.jsx(W,{label:"Beschreibung",hint:"Jede Zeile wird ein Stichpunkt unter den Produkten. Text markieren und „Fett“ klicken, um ihn hervorzuheben.",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-1.5 flex",children:e.jsx(A,{size:"sm",variant:"secondary",onClick:h,className:"font-bold",children:"B Fett"})}),e.jsx(je,{ref:s,rows:5,value:i.description,onChange:j=>f({description:j.target.value})})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-sm font-medium text-neutral-800 dark:text-neutral-200",children:"Markierung"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Be.map(j=>e.jsx("button",{type:"button",onClick:()=>f({badge:j.value}),className:`rounded-full border px-3 py-1 text-sm font-medium transition ${i.badge===j.value?"border-brand-500 bg-brand-50 text-brand-800 dark:bg-brand-500/10 dark:text-brand-300":"border-neutral-300 text-neutral-600 hover:border-neutral-400 dark:border-neutral-700 dark:text-neutral-300"}`,children:j.label},j.value))}),i.badge==="custom"&&e.jsx(D,{value:i.badge_text,onChange:j=>f({badge_text:j.target.value}),maxLength:40,placeholder:'z. B. "Neu" oder "Angebot"',className:"mt-2 max-w-xs"})]}),e.jsx(W,{label:"Video-Link (optional)",hint:"Zeigt auf der Kachel „Zum Video“.",children:e.jsx(D,{type:"url",value:i.video_url,onChange:j=>f({video_url:j.target.value}),placeholder:"https://youtu.be/…"})})]}),e.jsxs("details",{className:"group rounded-xl border border-neutral-200 dark:border-neutral-800",children:[e.jsxs("summary",{className:"flex cursor-pointer select-none items-center gap-2 px-4 py-3 text-sm font-medium text-neutral-700 dark:text-neutral-200",children:[e.jsx(Z,{name:"chevron",className:"h-4 w-4 text-neutral-400 transition-transform group-open:rotate-90"}),"Weitere Optionen",e.jsx("span",{className:"text-xs font-normal text-neutral-400",children:"Preis-Text, Sortierung, Englisch, Schriftstil"}),E&&e.jsx(Se,{tone:"brand",className:"ml-auto",children:"EN ausgefüllt"})]}),e.jsxs("div",{className:"space-y-4 border-t border-neutral-200 p-4 dark:border-neutral-800",children:[e.jsx(W,{label:"Preis-Text (optional)",hint:"Ersetzt auf der Kachel den berechneten Preis, solange ausgefüllt.",children:e.jsx(D,{value:i.price_text,onChange:j=>f({price_text:j.target.value}),placeholder:'z. B. "Preis auf Anfrage"'})}),e.jsx(W,{label:"Sortierung",hint:"Kleinere Zahl = weiter links.",children:e.jsx(D,{type:"number",value:i.sort_order,onChange:j=>f({sort_order:j.target.value}),className:"max-w-[140px]"})}),e.jsx(W,{label:"Beschreibung (Englisch)",hint:"Leer = deutscher Text.",children:e.jsx(je,{rows:3,value:i.description_en,onChange:j=>f({description_en:j.target.value})})}),e.jsx(W,{label:"Preis-Text (Englisch)",children:e.jsx(D,{value:i.price_text_en,onChange:j=>f({price_text_en:j.target.value}),placeholder:'z. B. "Price on request"'})}),c&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-neutral-800 dark:text-neutral-200",children:"Schriftstil"}),e.jsx(ve,{fieldKey:`packages.${c.id}.description`,previewText:"Beschreibung"}),e.jsx(ve,{fieldKey:`packages.${c.id}.price_text`,previewText:"Preis-Text"})]})]})]})]})}function _t({open:n,onClose:l,models:a,packages:m,target:d,onCopied:u}){const o=ae(),[g,v]=x.useState(""),[_,N]=x.useState(!0),[c,r]=x.useState("replace"),[i,p]=x.useState(!1),[k,$]=x.useState(null),P=x.useMemo(()=>d?m.filter(h=>h.car_model_id===d.id).sort((h,S)=>h.sort_order-S.sort_order):[],[m,d]),T=x.useMemo(()=>m.filter(h=>h.car_model_id===Number(g)).sort((h,S)=>h.sort_order-S.sort_order).map(h=>h.name),[m,g]),s=P.length>0&&c==="replace";x.useEffect(()=>{n&&(v(""),$(null),r("replace"))},[n]);const b=x.useMemo(()=>a.filter(h=>h.id!==(d==null?void 0:d.id)).sort((h,S)=>R(h).localeCompare(R(S))),[a,d]),f=async()=>{const h=P.length===1?"Das vorhandene Paket":`Die ${P.length} vorhandenen Pakete`;if(!(s&&!window.confirm(`${h} von ${R(d)} inkl. Produkten und Upgrades löschen und durch die Kopie ersetzen?`))){p(!0),$(null);try{const S=await z.post(`/models/${d.id}/copy-packages`,{source_model_id:Number(g),include_upgrades:_,replace_existing:s}),U=S.copied.reduce((w,M)=>w+M.products,0),E=S.copied.reduce((w,M)=>w+(M.upgrades||0),0),j=[`${S.copied.length} Paket(e) kopiert (${U} Produkte${_?`, ${E} Upgrades`:""})`];S.removed&&j.unshift(`${S.removed} alte(s) Paket(e) ersetzt`),S.skipped.length&&j.push(`übersprungen, weil schon vorhanden: ${S.skipped.join(", ")}`),o.success(`${j.join(" – ")}.`),await u(),l()}catch(S){$(S.message),o.error(`Kopieren fehlgeschlagen: ${S.message}`)}finally{p(!1)}}};return e.jsxs(ce,{open:n,onClose:l,title:"Pakete kopieren",description:`Übernimmt alle Pakete eines anderen Modells nach ${R(d)}.`,footer:e.jsxs(e.Fragment,{children:[e.jsx(A,{variant:"secondary",onClick:l,children:"Abbrechen"}),e.jsx(A,{icon:"copy",variant:s?"danger":"primary",onClick:f,disabled:!g||i,children:i?"Kopiert…":s?"Ersetzen und kopieren":"Kopieren"})]}),children:[e.jsx(W,{label:"Von Modell",hint:g&&(T.length?`Wird kopiert: ${T.join(", ")}`:"Dieses Modell hat keine Pakete."),children:e.jsxs(Ge,{value:g,onChange:h=>v(h.target.value),children:[e.jsx("option",{value:"",children:"Bitte wählen …"}),b.map(h=>e.jsx("option",{value:String(h.id),children:R(h)},h.id))]})}),P.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm font-medium text-neutral-800 dark:text-neutral-200",children:[R(d)," hat schon ",P.length," ",P.length===1?"Paket":"Pakete"]}),e.jsx(oe,{value:c,onChange:r,options:[{value:"replace",label:"Alle ersetzen"},{value:"add",label:"Nur fehlende ergänzen"}]}),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:s?`Löscht vorher ${P.map(h=>h.name).join(", ")} – danach sind die Pakete genau wie beim gewählten Modell.`:"Vorhandene Stufen bleiben unverändert, nur fehlende werden kopiert."})]}),e.jsx(re,{checked:_,onChange:N,label:"Upgrades mitkopieren",description:"Sonst nur Pakete mit Produkten und Texten."}),k&&e.jsx("p",{className:"text-sm text-red-600",children:k})]})}function yt({packages:n,models:l,visibilityBusyId:a,onOpen:m,onToggleVisibility:d,onDeleteMany:u}){const[o,g]=x.useState(""),[v,_]=x.useState(()=>new Set),[N,c]=x.useState(!1),r=x.useMemo(()=>new Map(l.map(s=>[s.id,s])),[l]),i=x.useMemo(()=>{const s=ne(o).split(/\s+/).filter(Boolean);return n.filter(b=>!s.length||s.every(f=>ne(`${b.brand_name} ${b.model_name} ${b.name}`).includes(f)))},[n,o]);x.useEffect(()=>{_(s=>{const b=new Set(n.map(h=>h.id)),f=new Set([...s].filter(h=>b.has(h)));return f.size===s.size?s:f})},[n]);const p=i.length>0&&i.every(s=>v.has(s.id)),k=i.some(s=>v.has(s.id)),$=()=>_(s=>{const b=new Set(s);return i.forEach(f=>p?b.delete(f.id):b.add(f.id)),b}),P=s=>_(b=>{const f=new Set(b);return f.has(s)?f.delete(s):f.add(s),f}),T=async()=>{c(!0);try{await u(n.filter(s=>v.has(s.id)))&&_(new Set)}finally{c(!1)}};return e.jsxs(te,{padded:!1,className:"overflow-hidden",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-neutral-200 p-3 dark:border-neutral-800",children:[e.jsx(de,{checked:p,indeterminate:k,onChange:$,disabled:!i.length,label:"Alle angezeigten auswählen",className:"ml-1"}),e.jsxs("div",{className:"relative w-full max-w-xs",children:[e.jsx(Z,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),e.jsx(D,{value:o,onChange:s=>g(s.target.value),placeholder:"Suchen: Marke, Modell, Paket",className:"h-9 pl-9"})]}),e.jsxs("span",{className:"text-sm text-neutral-400",children:[i.length," von ",n.length]}),v.size>0&&e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-medium text-neutral-700 dark:text-neutral-200",children:[v.size," ausgewählt"]}),e.jsx(A,{size:"sm",variant:"ghost",onClick:()=>_(new Set),children:"Aufheben"}),e.jsx(A,{size:"sm",variant:"danger",icon:"trash",onClick:T,disabled:N,children:N?"Löscht…":"Löschen"})]})]}),i.length===0?e.jsx("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:n.length===0?"Noch keine Pakete angelegt.":"Keine Pakete gefunden."}):e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:i.map(s=>{const b=Ae(s.badge,s.badge_text);return e.jsxs("li",{className:`flex items-center gap-3 px-4 py-2.5 ${v.has(s.id)?"bg-brand-50/60 dark:bg-brand-500/10":"hover:bg-neutral-50 dark:hover:bg-neutral-800/50"}`,children:[e.jsx(de,{checked:v.has(s.id),onChange:()=>P(s.id),label:`${s.name} auswählen`}),e.jsxs("button",{type:"button",onClick:()=>m(s),className:`flex min-w-0 flex-1 items-center gap-3 text-left ${s.is_hidden?"opacity-60":""}`,children:[e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsxs("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:[s.name,b&&e.jsx(Se,{tone:"brand",className:"ml-2 align-middle",children:b})]}),e.jsx("span",{className:"block truncate text-xs text-neutral-500 dark:text-neutral-400",children:R(r.get(s.car_model_id))||`${s.brand_name} ${s.model_name}`})]}),e.jsxs("span",{className:"hidden shrink-0 text-xs text-neutral-500 dark:text-neutral-400 sm:block",children:[s.markup_type==="fixed"&&`+${s.markup_value} €`,s.markup_type==="percent"&&`+${s.markup_value} %`]})]}),e.jsx(re,{checked:!s.is_hidden,disabled:a===s.id,onChange:()=>d(s)}),e.jsx(Ze,{icon:"pencil",label:"Bearbeiten",onClick:()=>m(s)})]},s.id)})})]})}function zt(){var fe;const[n,l]=Ve(),a=Number(n.get("model"))||null,m=Number(n.get("paket"))||null,d=n.get("ansicht")==="liste"?"list":"model",[u,o]=x.useState([]),[g,v]=x.useState([]),[_,N]=x.useState(!1),[c,r]=x.useState({modelId:null,products:{},upgrades:{}}),[i,p]=x.useState(null),[k,$]=x.useState(!1),[P,T]=x.useState(null),[s,b]=x.useState(!1),[f,h]=x.useState(()=>new Set),[S,U]=x.useState(!1),E=ae(),j=x.useRef(a);j.current=a;const w=async()=>{const[t,y]=await Promise.all([z.get("/packages"),z.get("/models")]);return o(t),v(y),N(!0),t};x.useEffect(()=>{w().catch(t=>{N(!0),E.error(t.message)})},[]);const M=async t=>{const y=await z.get(`/models/${t}/package-items`);j.current===t&&r({modelId:t,products:Ne(y.products),upgrades:Ne(y.upgrades)})},L=x.useMemo(()=>new Map(g.map(t=>[t.id,t])),[g]),B=a?L.get(a):null,F=x.useMemo(()=>a?ft(a,u):[],[a,u]),q=x.useMemo(()=>u.reduce((t,y)=>y.is_hidden?t:{...t,[y.car_model_id]:(t[y.car_model_id]||0)+1},{}),[u]);x.useEffect(()=>{if(!_||a||!m)return;const t=u.find(y=>y.id===m);t&&l({model:String(t.car_model_id),paket:String(t.id)},{replace:!0})},[_,a,m,u,l]),x.useEffect(()=>{b(!1),h(new Set),r({modelId:null,products:{},upgrades:{}}),a&&M(a).catch(t=>E.error(t.message))},[a]),x.useEffect(()=>{if(!m)return;const t=F.find(y=>{var C;return((C=y.existing)==null?void 0:C.id)===m});t&&p(t.key)},[m,F]);const O=t=>{const y={};t.model&&(y.model=String(t.model)),t.paket&&(y.paket=String(t.paket)),t.view==="list"&&(y.ansicht="liste"),l(y)},Ie=t=>{p(null),O({model:t})},Te=t=>{p(t.key),t.existing&&l({model:String(a),paket:String(t.existing.id)},{replace:!0})},ue=()=>{p(null),a&&l({model:String(a)},{replace:!0})},I=F.find(t=>t.key===i)||null,Ue=c.modelId===a,me=(t,y,C)=>r(K=>({...K,[t]:{...K[t],[y]:C}})),Le=async(t,y)=>{const C={name:t.name,car_model_id:a,...y,markup_value:Number(y.markup_value),sort_order:Number(y.sort_order)};if(t.existing)await z.put(`/packages/${t.existing.id}`,C),await w(),E.success(`„${t.name}“ gespeichert.`);else{const K=await z.post("/packages",C);await w(),l({model:String(a),paket:String(K.id)},{replace:!0}),E.success(`„${t.name}“ angelegt – jetzt Produkte hinzufügen.`)}},Re=async t=>{if(window.confirm(`Paket „${t.name}“ inkl. aller Produkte und Upgrades wirklich löschen?`)){try{await z.delete(`/packages/${t.existing.id}`)}catch(y){E.error(`Löschen fehlgeschlagen: ${y.message}`);return}ue(),await w(),E.success(`Paket „${t.name}“ gelöscht.`)}},he=async t=>{if(!t.length)return!1;const y=t.length<=8?`: ${t.map(C=>C.name).join(", ")}`:"";if(!window.confirm(`${t.length} ${t.length===1?"Paket":"Pakete"} inkl. aller Produkte und Upgrades wirklich löschen${y}?`))return!1;try{const C=await z.post("/packages/delete",{ids:t.map(K=>K.id)});return await w(),E.success(`${C.deleted} ${C.deleted===1?"Paket":"Pakete"} gelöscht.`),!0}catch(C){return E.error(`Löschen fehlgeschlagen: ${C.message}`),!1}},Ke=t=>h(y=>{const C=new Set(y);return C.has(t)?C.delete(t):C.add(t),C}),xe=()=>{b(!1),h(new Set)},le=async t=>{T(t.id);try{const y=await z.patch(`/packages/${t.id}/visibility`,{is_hidden:!t.is_hidden});o(C=>C.map(K=>K.id===t.id?{...K,is_hidden:y.is_hidden}:K)),E.success(y.is_hidden?`„${t.name}“ ist jetzt auf der Website ausgeblendet.`:`„${t.name}“ ist wieder sichtbar.`)}catch(y){E.error(`Sichtbarkeit konnte nicht geändert werden: ${y.message}`)}finally{T(null)}},Fe=F.filter(t=>t.tierIndex!==null),pe=F.filter(t=>t.tierIndex===null),V=F.filter(t=>t.existing).length,Y=F.filter(t=>t.existing).map(t=>t.existing),G=Y.filter(t=>f.has(t.id)),J=Y.length>0&&G.length===Y.length,De=async()=>{U(!0);try{await he(G)&&xe()}finally{U(!1)}},ge=t=>{var y;return e.jsx(jt,{row:t,products:t.existing&&c.products[t.existing.id]||X,upgrades:t.existing&&c.upgrades[t.existing.id]||X,itemsLoaded:Ue,visibilityBusy:P===((y=t.existing)==null?void 0:y.id),selectMode:s,selected:!!t.existing&&f.has(t.existing.id),onOpen:()=>Te(t),onToggleSelect:()=>Ke(t.existing.id),onToggleVisibility:le},t.key)},be=e.jsx(oe,{value:d,onChange:t=>O({model:t==="model"?a:null,view:t}),options:[{value:"model",label:"Nach Modell"},{value:"list",label:"Alle Pakete"}]});return d==="list"?e.jsxs("div",{children:[e.jsx(ke,{title:"Pakete",description:"Alle Pakete aller Modelle auf einen Blick. Klick öffnet das Paket beim passenden Modell.",actions:be}),e.jsx(yt,{packages:u,models:g,visibilityBusyId:P,onOpen:t=>O({model:t.car_model_id,paket:t.id}),onToggleVisibility:le,onDeleteMany:he})]}):e.jsxs("div",{children:[e.jsx(ke,{title:"Pakete",description:"Modell wählen, dann eine Stufe anklicken. Produkte, Upgrades und Sichtbarkeit werden sofort gespeichert.",actions:be}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[18rem_minmax(0,1fr)]",children:[e.jsx("div",{className:`${B?"hidden lg:block":""} lg:sticky lg:top-24 lg:self-start`,children:_?e.jsx(kt,{models:g,visibleCounts:q,selectedId:a,onSelect:Ie}):e.jsx(te,{children:e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"})})}),e.jsx("div",{className:"min-w-0",children:B?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("button",{type:"button",onClick:()=>O({}),className:"mb-1 inline-flex items-center gap-1 text-sm font-medium text-brand-600 dark:text-brand-400 lg:hidden",children:[e.jsx(Z,{name:"chevron",className:"h-4 w-4 rotate-180"})," Anderes Modell"]}),e.jsx("h2",{className:"truncate text-xl font-bold text-neutral-900 dark:text-white",children:R(B)}),e.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:[V," von ",Pe.length," Stufen angelegt",q[B.id]!==V&&V>0&&` · ${V-(q[B.id]||0)} ausgeblendet`]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[B.brand_slug&&B.slug&&e.jsx(A,{variant:"secondary",size:"sm",icon:"eye",href:`/fahrzeuge/${B.brand_slug}/${B.slug}`,target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),V>0&&!s&&e.jsx(A,{variant:"secondary",size:"sm",icon:"check",onClick:()=>b(!0),children:"Auswählen"}),e.jsx(A,{variant:"secondary",size:"sm",icon:"copy",onClick:()=>$(!0),children:"Von anderem Modell kopieren"})]})]}),s&&e.jsxs("div",{className:"sticky top-16 z-20 mb-5 flex flex-wrap items-center gap-3 rounded-xl border border-brand-200 bg-brand-50 px-4 py-2.5 shadow-sm dark:border-brand-900 dark:bg-neutral-900",children:[e.jsx(de,{checked:J,indeterminate:G.length>0,onChange:()=>h(J?new Set:new Set(Y.map(t=>t.id))),label:"Alle auswählen"}),e.jsx("span",{className:"text-sm font-medium text-neutral-800 dark:text-neutral-100",children:G.length?`${G.length} von ${V} ausgewählt`:"Pakete anklicken, um sie auszuwählen"}),e.jsxs("div",{className:"ml-auto flex gap-2",children:[e.jsx(A,{size:"sm",variant:"ghost",onClick:()=>h(J?new Set:new Set(Y.map(t=>t.id))),children:J?"Keine":"Alle"}),e.jsx(A,{size:"sm",variant:"danger",icon:"trash",onClick:De,disabled:!G.length||S,children:S?"Löscht…":"Löschen"}),e.jsx(A,{size:"sm",variant:"secondary",onClick:xe,children:"Fertig"})]})]}),V===0&&e.jsxs("div",{className:"mb-5 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-amber-200 bg-amber-50 px-4 py-3 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-200",children:[e.jsx("span",{children:"Für dieses Modell gibt es noch keine Pakete. Am schnellsten geht es mit einer Kopie von einem ähnlichen Modell."}),e.jsx(A,{size:"sm",icon:"copy",onClick:()=>$(!0),children:"Pakete kopieren"})]}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 2xl:grid-cols-4",children:Fe.map(ge)}),pe.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3 mt-8 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Weitere Pakete (alte Namen)"}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 2xl:grid-cols-4",children:pe.map(ge)})]})]}):_&&e.jsx(te,{padded:!1,className:"hidden lg:block",children:e.jsx(We,{icon:"car",title:g.length?"Modell wählen":"Noch keine Modelle",description:g.length?"Links ein Modell anklicken oder oben über die Suche finden.":"Lege zuerst Marken und Modelle an.",actions:!g.length&&e.jsx(A,{to:"/admin/brands",children:"Zu den Fahrzeugmarken"})})})})]}),e.jsx(vt,{row:I,model:B,products:(I==null?void 0:I.existing)&&c.products[I.existing.id]||X,upgrades:(I==null?void 0:I.existing)&&c.upgrades[I.existing.id]||X,visibilityBusy:P===((fe=I==null?void 0:I.existing)==null?void 0:fe.id),onClose:ue,onSave:Le,onDelete:Re,onToggleVisibility:le,onProductsChange:t=>me("products",I.existing.id,t),onUpgradesChange:t=>me("upgrades",I.existing.id,t)}),e.jsx(_t,{open:k,onClose:()=>$(!1),models:g,packages:u,target:B,onCopied:async()=>{await w(),a&&await M(a)}})]})}export{zt as default}; diff --git a/hifi/assets/Partners-d4iHm0YC.js b/hifi/assets/Partners-BTaZQlM9.js similarity index 86% rename from hifi/assets/Partners-d4iHm0YC.js rename to hifi/assets/Partners-BTaZQlM9.js index bdb9dba..5099c44 100644 --- a/hifi/assets/Partners-d4iHm0YC.js +++ b/hifi/assets/Partners-BTaZQlM9.js @@ -1 +1 @@ -import{j as r,P as i,B as t,z as s,F as l,x as c}from"./index-eQrgtQRM.js";import d from"./ImageUploadField-2si66K3r.js";import{u as h,E as m,R as u}from"./EntityList-CgZqBKVk.js";import"./resizeImage-C6PvAwh0.js";import"./SortableList-B1XU_999.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";const p={name:"",logo_path:"",sort_order:0};function _(){const e=h({endpoint:"/partners",reorderKey:"partners",source:"partners",emptyForm:p,toForm:n=>({name:n.name,logo_path:n.logo_path||"",sort_order:n.sort_order}),labels:{created:"Partner angelegt.",saved:"Partner gespeichert.",deleted:"Partner gelöscht."}}),{form:o,change:a}=e;return r.jsxs("div",{children:[r.jsx(i,{title:"Partner-Logos",description:"Die Logozeile auf der Startseite. Ohne Logo erscheint der Name als Text. Reihenfolge am Griff links ziehen.",actions:r.jsxs(r.Fragment,{children:[r.jsx(t,{variant:"secondary",icon:"eye",href:"/",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),r.jsx(t,{icon:"plus",onClick:()=>e.openPanel(null),children:"Neuer Partner"})]})}),r.jsx(m,{items:e.items,editingId:e.editing,onReorder:e.reorder,onOpen:e.openPanel,onDelete:n=>e.remove(n,`Partner „${n.name}“ wirklich löschen?`),searchText:n=>n.name,searchPlaceholder:"Partner suchen …",empty:{icon:"shield",title:"Noch keine Partner",description:"Logos von Herstellern, mit denen ihr arbeitet, schaffen Vertrauen.",actions:r.jsx(t,{icon:"plus",onClick:()=>e.openPanel(null),children:"Neuer Partner"})},renderRow:n=>({media:r.jsx(u,{src:n.logo_path,icon:"shield",contain:!0,className:"w-20"}),title:n.name,subtitle:n.logo_path?null:"Ohne Logo – erscheint als Text"})}),r.jsxs(s,{as:"form",onSubmit:e.submit,open:e.editing!==null,onClose:e.closePanel,title:e.isNew?"Neuer Partner":"Partner bearbeiten",footer:r.jsxs(r.Fragment,{children:[r.jsx(t,{variant:"secondary",onClick:e.closePanel,children:"Abbrechen"}),r.jsx(t,{type:"submit",disabled:e.saving||!e.isNew&&!e.dirty,children:e.saving?"Speichere…":e.isNew?"Anlegen":"Speichern"})]}),children:[r.jsx(l,{label:"Name",required:!0,error:e.error,children:r.jsx(c,{required:!0,autoFocus:!0,value:o.name,onChange:n=>a({name:n.target.value}),placeholder:"z. B. Focal"})}),r.jsx(d,{value:o.logo_path,onChange:n=>a({logo_path:n}),label:"Logo (optional)"})]})]})}export{_ as default}; +import{j as r,P as i,B as t,z as s,F as l,x as c}from"./index-CPMnKQBc.js";import d from"./ImageUploadField-DGJRkWaj.js";import{u as h,E as m,R as u}from"./EntityList-DPxkbA95.js";import"./resizeImage-C6PvAwh0.js";import"./SortableList-Dgddukss.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";const p={name:"",logo_path:"",sort_order:0};function _(){const e=h({endpoint:"/partners",reorderKey:"partners",source:"partners",emptyForm:p,toForm:n=>({name:n.name,logo_path:n.logo_path||"",sort_order:n.sort_order}),labels:{created:"Partner angelegt.",saved:"Partner gespeichert.",deleted:"Partner gelöscht."}}),{form:o,change:a}=e;return r.jsxs("div",{children:[r.jsx(i,{title:"Partner-Logos",description:"Die Logozeile auf der Startseite. Ohne Logo erscheint der Name als Text. Reihenfolge am Griff links ziehen.",actions:r.jsxs(r.Fragment,{children:[r.jsx(t,{variant:"secondary",icon:"eye",href:"/",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),r.jsx(t,{icon:"plus",onClick:()=>e.openPanel(null),children:"Neuer Partner"})]})}),r.jsx(m,{items:e.items,editingId:e.editing,onReorder:e.reorder,onOpen:e.openPanel,onDelete:n=>e.remove(n,`Partner „${n.name}“ wirklich löschen?`),searchText:n=>n.name,searchPlaceholder:"Partner suchen …",empty:{icon:"shield",title:"Noch keine Partner",description:"Logos von Herstellern, mit denen ihr arbeitet, schaffen Vertrauen.",actions:r.jsx(t,{icon:"plus",onClick:()=>e.openPanel(null),children:"Neuer Partner"})},renderRow:n=>({media:r.jsx(u,{src:n.logo_path,icon:"shield",contain:!0,className:"w-20"}),title:n.name,subtitle:n.logo_path?null:"Ohne Logo – erscheint als Text"})}),r.jsxs(s,{as:"form",onSubmit:e.submit,open:e.editing!==null,onClose:e.closePanel,title:e.isNew?"Neuer Partner":"Partner bearbeiten",footer:r.jsxs(r.Fragment,{children:[r.jsx(t,{variant:"secondary",onClick:e.closePanel,children:"Abbrechen"}),r.jsx(t,{type:"submit",disabled:e.saving||!e.isNew&&!e.dirty,children:e.saving?"Speichere…":e.isNew?"Anlegen":"Speichern"})]}),children:[r.jsx(l,{label:"Name",required:!0,error:e.error,children:r.jsx(c,{required:!0,autoFocus:!0,value:o.name,onChange:n=>a({name:n.target.value}),placeholder:"z. B. Focal"})}),r.jsx(d,{value:o.logo_path,onChange:n=>a({logo_path:n}),label:"Logo (optional)"})]})]})}export{_ as default}; diff --git a/hifi/assets/PermissionGroups-B5VO82nD.js b/hifi/assets/PermissionGroups-DAwy5PsY.js similarity index 98% rename from hifi/assets/PermissionGroups-B5VO82nD.js rename to hifi/assets/PermissionGroups-DAwy5PsY.js index 309ce10..31c4430 100644 --- a/hifi/assets/PermissionGroups-B5VO82nD.js +++ b/hifi/assets/PermissionGroups-DAwy5PsY.js @@ -1 +1 @@ -import{r as n,j as e,c as i}from"./index-eQrgtQRM.js";const h={name:"",description:"",permissions:[]};function w(){const[c,b]=n.useState([]),[o,g]=n.useState([]),[r,a]=n.useState(h),[l,u]=n.useState(null),[m,x]=n.useState(""),d=()=>{i.get("/permission-groups").then(b),i.get("/permissions/catalog").then(g)};n.useEffect(d,[]);const j=t=>{u(t.id),a({name:t.name,description:t.description||"",permissions:t.permissions})},p=()=>{u(null),a(h)},N=t=>{a(s=>({...s,permissions:s.permissions.includes(t)?s.permissions.filter(y=>y!==t):[...s.permissions,t]}))},k=async t=>{t.preventDefault(),x("");try{l?await i.put(`/permission-groups/${l}`,r):await i.post("/permission-groups",r),p(),d()}catch(s){x(s.message)}},f=async t=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await i.delete(`/permission-groups/${t}`),d())};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),e.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.'}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[c.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]}),e.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[t.permissions.length," von ",o.length]}),e.jsxs("td",{className:"px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>j(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>f(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),c.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),e.jsxs("form",{onSubmit:k,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:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>a({...r,name: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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),e.jsx("textarea",{rows:2,value:r.description,onChange:t=>a({...r,description: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"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),e.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:o.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:r.permissions.includes(t.key),onChange:()=>N(t.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.label]},t.key))})]}),m&&e.jsx("p",{className:"text-sm text-red-600",children:m}),e.jsxs("div",{className:"flex gap-2",children:[e.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:l?"Speichern":"Anlegen"}),l&&e.jsx("button",{type:"button",onClick:p,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{w as default}; +import{r as n,j as e,c as i}from"./index-CPMnKQBc.js";const h={name:"",description:"",permissions:[]};function w(){const[c,b]=n.useState([]),[o,g]=n.useState([]),[r,a]=n.useState(h),[l,u]=n.useState(null),[m,x]=n.useState(""),d=()=>{i.get("/permission-groups").then(b),i.get("/permissions/catalog").then(g)};n.useEffect(d,[]);const j=t=>{u(t.id),a({name:t.name,description:t.description||"",permissions:t.permissions})},p=()=>{u(null),a(h)},N=t=>{a(s=>({...s,permissions:s.permissions.includes(t)?s.permissions.filter(y=>y!==t):[...s.permissions,t]}))},k=async t=>{t.preventDefault(),x("");try{l?await i.put(`/permission-groups/${l}`,r):await i.post("/permission-groups",r),p(),d()}catch(s){x(s.message)}},f=async t=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await i.delete(`/permission-groups/${t}`),d())};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),e.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.'}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[c.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]}),e.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[t.permissions.length," von ",o.length]}),e.jsxs("td",{className:"px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>j(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>f(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),c.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),e.jsxs("form",{onSubmit:k,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:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>a({...r,name: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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),e.jsx("textarea",{rows:2,value:r.description,onChange:t=>a({...r,description: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"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),e.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:o.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:r.permissions.includes(t.key),onChange:()=>N(t.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.label]},t.key))})]}),m&&e.jsx("p",{className:"text-sm text-red-600",children:m}),e.jsxs("div",{className:"flex gap-2",children:[e.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:l?"Speichern":"Anlegen"}),l&&e.jsx("button",{type:"button",onClick:p,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{w as default}; diff --git a/hifi/assets/ResetPassword-CG8ba0ue.js b/hifi/assets/ResetPassword-CG8ba0ue.js new file mode 100644 index 0000000..4fcbedf --- /dev/null +++ b/hifi/assets/ResetPassword-CG8ba0ue.js @@ -0,0 +1 @@ +import{p as g,r as s,j as e,l as f,o as j,L as i,c as k}from"./index-CPMnKQBc.js";const m="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";function v(){const[u]=g(),[a,c]=s.useState(""),[r,x]=s.useState(""),[l,n]=s.useState(""),[h,b]=s.useState(!1),[o,d]=s.useState(!1),p=async t=>{if(t.preventDefault(),n(""),a!==r){n("Die Passwörter stimmen nicht überein");return}d(!0);try{await k.post("/auth/reset-password",{token:u.get("token")||"",password:a,password_confirmation:r}),b(!0)}catch(w){n(w.message)}finally{d(!1)}};return e.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:[e.jsx("img",{src:f,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:j,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),e.jsx("div",{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:h?e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Passwort geändert"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Du kannst dich jetzt mit dem neuen Passwort anmelden."}),e.jsx(i,{to:"/admin/login",className:"block w-full rounded-md bg-brand-500 px-4 py-2.5 text-center text-sm font-semibold text-white hover:bg-brand-600",children:"Zum Login"})]}):e.jsxs("form",{onSubmit:p,children:[e.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Neues Passwort festlegen"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort"}),e.jsx("input",{type:"password",value:a,onChange:t=>c(t.target.value),required:!0,minLength:8,autoFocus:!0,autoComplete:"new-password",className:m}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Mindestens 8 Zeichen."})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort wiederholen"}),e.jsx("input",{type:"password",value:r,onChange:t=>x(t.target.value),required:!0,minLength:8,autoComplete:"new-password",className:m})]}),l&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:l}),e.jsx("button",{type:"submit",disabled:o,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:o?"Speichern…":"Passwort speichern"}),e.jsx(i,{to:"/admin/login",className:"mt-3 block text-center text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})})]})}export{v as default}; diff --git a/hifi/assets/ResetSettings-DZpRgwCZ.js b/hifi/assets/ResetSettings-BPXgxMql.js similarity index 99% rename from hifi/assets/ResetSettings-DZpRgwCZ.js rename to hifi/assets/ResetSettings-BPXgxMql.js index 05c677a..b0cddbc 100644 --- a/hifi/assets/ResetSettings-DZpRgwCZ.js +++ b/hifi/assets/ResetSettings-BPXgxMql.js @@ -1 +1 @@ -import{r,j as e,L as U,c as d,$ as P}from"./index-eQrgtQRM.js";const o="LÖSCHEN";async function L(){const s=await fetch(`${P}/settings/export`,{credentials:"include"});if(!s.ok)throw new Error("Sicherung konnte nicht erstellt werden – es wurde nichts gelöscht.");const l=await s.blob(),n=URL.createObjectURL(l),a=document.createElement("a");a.href=n,a.download=`hifiplanet-sicherung-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function q(){const[s,l]=r.useState(!1),[n,a]=r.useState(""),[b,x]=r.useState(!1),[k,i]=r.useState(""),[p,f]=r.useState(!1),[y,u]=r.useState(""),[w,j]=r.useState(!1),[z,c]=r.useState(""),[S,N]=r.useState(!1),[F,m]=r.useState(""),[g,v]=r.useState(""),[h,C]=r.useState(""),B=async()=>{if(confirm("Alle aktuellen Leistungen werden gelöscht und durch die 8 Standard-Leistungen ersetzt. Fortfahren?")){l(!0),a("");try{const t=await d.post("/settings/reset-services",{});a(`${t.count} Standard-Leistungen wiederhergestellt.`)}catch(t){a("Fehler: "+t.message)}finally{l(!1)}}},A=async()=>{if(confirm("Alle aktuellen FAQ-Einträge werden gelöscht und durch die 6 Standard-Fragen ersetzt. Fortfahren?")){x(!0),i("");try{const t=await d.post("/settings/reset-faqs",{});i(`${t.count} Standard-Fragen wiederhergestellt.`)}catch(t){i("Fehler: "+t.message)}finally{x(!1)}}},R=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?")){f(!0),u("");try{const t=await d.post("/settings/reset-gallery",{});u(`${t.photos} Fotos wiederhergestellt.`)}catch(t){u("Fehler: "+t.message)}finally{f(!1)}}},$=async()=>{if(g.trim().toUpperCase()===o){j(!0),c("");try{await L();const t=await d.post("/settings/reset-catalog",{});v(""),c(`Fahrzeugkatalog geleert (${t.brands_removed} Marken entfernt).`)}catch(t){c("Fehler: "+t.message)}finally{j(!1)}}},E=async()=>{if(h.trim().toUpperCase()===o){N(!0),m("");try{await L();const t=await d.post("/settings/reset-all",{});C(""),m(`Erledigt: ${t.brands_removed} Marken entfernt, ${t.services_reset} Standard-Leistungen, ${t.faqs_reset} Standard-Fragen und ${t.gallery_photos_reset} Galerie-Fotos wiederhergestellt.`)}catch(t){m("Fehler: "+t.message)}finally{N(!1)}}};return e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("p",{className:"rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:["Beim Leeren des Fahrzeugkatalogs und bei „Alles zurücksetzen“ wird vorher automatisch eine Sicherung heruntergeladen. Für die anderen Aktionen am besten vorher unter"," ",e.jsx(U,{to:"/admin/settings/export-import",className:"font-semibold underline",children:"Export & Import"})," sichern."]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Leistungen zurücksetzen"}),e.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."}),e.jsx("button",{onClick:B,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…":"Leistungen auf Standard zurücksetzen"}),n&&e.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:n})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur FAQs zurücksetzen"}),e.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."}),e.jsx("button",{onClick:A,disabled:b,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:b?"Setze zurück…":"FAQs auf Standard zurücksetzen"}),k&&e.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:k})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Bildergalerie zurücksetzen"}),e.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."}),e.jsx("button",{onClick:R,disabled:p,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:p?"Setze zurück…":"Galerie auf Standard zurücksetzen"}),y&&e.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:y})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Fahrzeugkatalog leeren"}),e.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."}),e.jsx(M,{value:g,onChange:v}),e.jsx("button",{onClick:$,disabled:w||g.trim().toUpperCase()!==o,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:w?"Leere…":"Fahrzeugkatalog leeren"}),z&&e.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:z})]}),e.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:[e.jsx("h2",{className:"mb-1 font-semibold text-red-700 dark:text-red-300",children:"Alles zurücksetzen"}),e.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:["Kombiniert alles: Fahrzeugkatalog wird komplett geleert ",e.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."]}),e.jsx(M,{value:h,onChange:C}),e.jsx("button",{onClick:E,disabled:S||h.trim().toUpperCase()!==o,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:S?"Setze zurück…":"Wirklich alles zurücksetzen"}),F&&e.jsx("p",{className:"mt-3 text-sm text-neutral-700 dark:text-neutral-300",children:F})]})]})}function M({value:s,onChange:l}){return e.jsxs("label",{className:"mb-3 block text-sm text-neutral-600 dark:text-neutral-300",children:["Zur Bestätigung ",e.jsx("strong",{className:"font-mono",children:o})," eintippen:",e.jsx("input",{value:s,onChange:n=>l(n.target.value),autoComplete:"off",className:"mt-1 block w-48 rounded-md border border-red-300 bg-white px-3 py-2 font-mono text-sm dark:border-red-900 dark:bg-neutral-900"})]})}export{q as default}; +import{r,j as e,L as U,c as d,$ as P}from"./index-CPMnKQBc.js";const o="LÖSCHEN";async function L(){const s=await fetch(`${P}/settings/export`,{credentials:"include"});if(!s.ok)throw new Error("Sicherung konnte nicht erstellt werden – es wurde nichts gelöscht.");const l=await s.blob(),n=URL.createObjectURL(l),a=document.createElement("a");a.href=n,a.download=`hifiplanet-sicherung-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}function q(){const[s,l]=r.useState(!1),[n,a]=r.useState(""),[b,x]=r.useState(!1),[k,i]=r.useState(""),[p,f]=r.useState(!1),[y,u]=r.useState(""),[w,j]=r.useState(!1),[z,c]=r.useState(""),[S,N]=r.useState(!1),[F,m]=r.useState(""),[g,v]=r.useState(""),[h,C]=r.useState(""),B=async()=>{if(confirm("Alle aktuellen Leistungen werden gelöscht und durch die 8 Standard-Leistungen ersetzt. Fortfahren?")){l(!0),a("");try{const t=await d.post("/settings/reset-services",{});a(`${t.count} Standard-Leistungen wiederhergestellt.`)}catch(t){a("Fehler: "+t.message)}finally{l(!1)}}},A=async()=>{if(confirm("Alle aktuellen FAQ-Einträge werden gelöscht und durch die 6 Standard-Fragen ersetzt. Fortfahren?")){x(!0),i("");try{const t=await d.post("/settings/reset-faqs",{});i(`${t.count} Standard-Fragen wiederhergestellt.`)}catch(t){i("Fehler: "+t.message)}finally{x(!1)}}},R=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?")){f(!0),u("");try{const t=await d.post("/settings/reset-gallery",{});u(`${t.photos} Fotos wiederhergestellt.`)}catch(t){u("Fehler: "+t.message)}finally{f(!1)}}},$=async()=>{if(g.trim().toUpperCase()===o){j(!0),c("");try{await L();const t=await d.post("/settings/reset-catalog",{});v(""),c(`Fahrzeugkatalog geleert (${t.brands_removed} Marken entfernt).`)}catch(t){c("Fehler: "+t.message)}finally{j(!1)}}},E=async()=>{if(h.trim().toUpperCase()===o){N(!0),m("");try{await L();const t=await d.post("/settings/reset-all",{});C(""),m(`Erledigt: ${t.brands_removed} Marken entfernt, ${t.services_reset} Standard-Leistungen, ${t.faqs_reset} Standard-Fragen und ${t.gallery_photos_reset} Galerie-Fotos wiederhergestellt.`)}catch(t){m("Fehler: "+t.message)}finally{N(!1)}}};return e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("p",{className:"rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:["Beim Leeren des Fahrzeugkatalogs und bei „Alles zurücksetzen“ wird vorher automatisch eine Sicherung heruntergeladen. Für die anderen Aktionen am besten vorher unter"," ",e.jsx(U,{to:"/admin/settings/export-import",className:"font-semibold underline",children:"Export & Import"})," sichern."]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Leistungen zurücksetzen"}),e.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."}),e.jsx("button",{onClick:B,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…":"Leistungen auf Standard zurücksetzen"}),n&&e.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:n})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur FAQs zurücksetzen"}),e.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."}),e.jsx("button",{onClick:A,disabled:b,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:b?"Setze zurück…":"FAQs auf Standard zurücksetzen"}),k&&e.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:k})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Bildergalerie zurücksetzen"}),e.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."}),e.jsx("button",{onClick:R,disabled:p,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:p?"Setze zurück…":"Galerie auf Standard zurücksetzen"}),y&&e.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:y})]}),e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Fahrzeugkatalog leeren"}),e.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."}),e.jsx(M,{value:g,onChange:v}),e.jsx("button",{onClick:$,disabled:w||g.trim().toUpperCase()!==o,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:w?"Leere…":"Fahrzeugkatalog leeren"}),z&&e.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:z})]}),e.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:[e.jsx("h2",{className:"mb-1 font-semibold text-red-700 dark:text-red-300",children:"Alles zurücksetzen"}),e.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:["Kombiniert alles: Fahrzeugkatalog wird komplett geleert ",e.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."]}),e.jsx(M,{value:h,onChange:C}),e.jsx("button",{onClick:E,disabled:S||h.trim().toUpperCase()!==o,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:S?"Setze zurück…":"Wirklich alles zurücksetzen"}),F&&e.jsx("p",{className:"mt-3 text-sm text-neutral-700 dark:text-neutral-300",children:F})]})]})}function M({value:s,onChange:l}){return e.jsxs("label",{className:"mb-3 block text-sm text-neutral-600 dark:text-neutral-300",children:["Zur Bestätigung ",e.jsx("strong",{className:"font-mono",children:o})," eintippen:",e.jsx("input",{value:s,onChange:n=>l(n.target.value),autoComplete:"off",className:"mt-1 block w-48 rounded-md border border-red-300 bg-white px-3 py-2 font-mono text-sm dark:border-red-900 dark:bg-neutral-900"})]})}export{q as default}; diff --git a/hifi/assets/RichTextEditor-Da-meJrp.js b/hifi/assets/RichTextEditor-B7bZ3Yjh.js similarity index 99% rename from hifi/assets/RichTextEditor-Da-meJrp.js rename to hifi/assets/RichTextEditor-B7bZ3Yjh.js index 705f05b..381b9a7 100644 --- a/hifi/assets/RichTextEditor-Da-meJrp.js +++ b/hifi/assets/RichTextEditor-B7bZ3Yjh.js @@ -1,4 +1,4 @@ -import{r as q,a9 as xt,j as R,aK as Gu,a0 as Yu}from"./index-eQrgtQRM.js";var Hl={exports:{}},jl={};/** +import{r as q,a9 as xt,j as R,aK as Gu,a0 as Yu}from"./index-CPMnKQBc.js";var Hl={exports:{}},jl={};/** * @license React * use-sync-external-store-shim.production.js * diff --git a/hifi/assets/SaveBar-DDpMGtuu.js b/hifi/assets/SaveBar-D3LWnDZL.js similarity index 93% rename from hifi/assets/SaveBar-DDpMGtuu.js rename to hifi/assets/SaveBar-D3LWnDZL.js index d6ca6de..ae3b1f2 100644 --- a/hifi/assets/SaveBar-DDpMGtuu.js +++ b/hifi/assets/SaveBar-D3LWnDZL.js @@ -1 +1 @@ -import{j as e}from"./index-eQrgtQRM.js";function l({dirty:t,busy:i,savedAt:a,onSave:n,label:s="Speichern",form:r}){return e.jsx("div",{className:"sticky bottom-0 z-20 -mx-4 mt-6 border-t border-neutral-200 bg-white/95 px-4 py-3 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:`text-sm ${t?"font-medium text-amber-600 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:t?"● Ungespeicherte Änderungen":a?`✓ Gespeichert um ${a.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})} Uhr`:"Alles gespeichert"}),e.jsx("button",{type:r?"submit":"button",form:r,onClick:r?void 0:n,disabled:i||!t,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":s})]})})}export{l as S}; +import{j as e}from"./index-CPMnKQBc.js";function l({dirty:t,busy:i,savedAt:a,onSave:n,label:s="Speichern",form:r}){return e.jsx("div",{className:"sticky bottom-0 z-20 -mx-4 mt-6 border-t border-neutral-200 bg-white/95 px-4 py-3 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:`text-sm ${t?"font-medium text-amber-600 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:t?"● Ungespeicherte Änderungen":a?`✓ Gespeichert um ${a.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})} Uhr`:"Alles gespeichert"}),e.jsx("button",{type:r?"submit":"button",form:r,onClick:r?void 0:n,disabled:i||!t,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":s})]})})}export{l as S}; diff --git a/hifi/assets/Services-Dv9GCIRs.js b/hifi/assets/Services-BKtVbfxC.js similarity index 94% rename from hifi/assets/Services-Dv9GCIRs.js rename to hifi/assets/Services-BKtVbfxC.js index 15484ca..7b53ba3 100644 --- a/hifi/assets/Services-Dv9GCIRs.js +++ b/hifi/assets/Services-BKtVbfxC.js @@ -1 +1 @@ -import{r as m,j as e,P as j,B as i,Z as h,z as _,F as l,x as o,W as x,I as f,U as N}from"./index-eQrgtQRM.js";import v from"./ImageUploadField-2si66K3r.js";import{toComponentName as p,ICON_NAMES as d,findIcon as k}from"./iconRegistry-7Dpzjhyo.js";import{u as w,E as y}from"./EntityList-CgZqBKVk.js";import"./resizeImage-C6PvAwh0.js";import"./music-CfvjP45-.js";import"./grip-vertical-DJgsXpN7.js";import"./trash-2-DA4I3Jzq.js";import"./SortableList-B1XU_999.js";import"./sortable.esm-CN3X5f7p.js";function g({name:r,className:n}){const a=k(r);return a?e.jsx(a,{className:n}):null}const C=120,I=200;function L({value:r,onChange:n}){const[a,c]=m.useState(""),u=r?p(r):null,t=m.useMemo(()=>{const s=a.trim().toLowerCase();return s?d.filter(b=>b.includes(s)).slice(0,I):d.slice(0,C)},[a]);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-center gap-3 rounded-md border border-neutral-300 p-2 dark:border-neutral-700",children:[e.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:r?e.jsx(g,{name:r,className:"h-6 w-6"}):e.jsx("span",{className:"text-xs text-neutral-400",children:"?"})}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:r||"Kein Icon gewählt"}),e.jsxs("p",{className:"text-xs text-neutral-400",children:[d.length," Icons verfügbar"]})]})]}),e.jsx("input",{value:a,onChange:s=>c(s.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"}),e.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:[t.map(s=>e.jsx("button",{type:"button",title:s,onClick:()=>n(s),className:`flex h-10 w-10 items-center justify-center rounded-md transition ${u===p(s)?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:e.jsx(g,{name:s,className:"h-5 w-5"})},s)),t.length===0&&e.jsx("p",{className:"col-span-full py-4 text-center text-sm text-neutral-400",children:"Keine Icons gefunden."})]}),!a&&e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Tipp: Tippe einen Suchbegriff ein, um alle ",d.length," Icons zu durchsuchen."]})]})}const E={icon_name:"",title:"",description:"",image_path:"",cta_label:"",cta_url:"",sort_order:0,title_en:"",description_en:"",cta_label_en:""};function R(){const r=w({endpoint:"/services",reorderKey:"services",source:"services",emptyForm:E,toForm:t=>({icon_name:t.icon_name,title:t.title,description:t.description,image_path:t.image_path||"",cta_label:t.cta_label||"",cta_url:t.cta_url||"",sort_order:t.sort_order,title_en:t.title_en||"",description_en:t.description_en||"",cta_label_en:t.cta_label_en||""}),toPayload:t=>({...t,sort_order:Number(t.sort_order)}),labels:{created:"Leistung angelegt.",saved:"Leistung gespeichert.",deleted:"Leistung gelöscht."}}),{form:n,change:a}=r,c=!!(n.title_en||n.description_en||n.cta_label_en),u=t=>{if(t.preventDefault(),!n.icon_name){r.setError("Bitte ein Symbol auswählen.");return}r.submit()};return e.jsxs("div",{children:[e.jsx(j,{title:"Leistungen",description:"Die Karten auf der Seite „Leistungen“. Reihenfolge am Griff links ziehen.",actions:e.jsxs(e.Fragment,{children:[e.jsx(i,{variant:"secondary",icon:"eye",href:"/leistungen",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),e.jsx(i,{icon:"plus",onClick:()=>r.openPanel(null),children:"Neue Leistung"})]})}),e.jsx(y,{items:r.items,editingId:r.editing,onReorder:r.reorder,onOpen:r.openPanel,onDelete:t=>r.remove(t,`Leistung „${t.title}“ wirklich löschen?`),searchText:t=>`${t.title} ${t.description}`,empty:{icon:"briefcase",title:"Noch keine Leistungen",actions:e.jsx(i,{icon:"plus",onClick:()=>r.openPanel(null),children:"Neue Leistung"})},renderRow:t=>({media:t.image_path?e.jsxs("span",{className:"relative shrink-0",children:[e.jsx("img",{src:t.image_path,alt:"",className:"h-11 w-16 rounded-lg border border-neutral-200 object-cover dark:border-neutral-700"}),e.jsx("span",{className:"absolute -bottom-1 -right-1 flex h-6 w-6 items-center justify-center rounded-full bg-brand-500 text-white ring-2 ring-white dark:ring-neutral-900",children:e.jsx(h,{name:t.icon_name,className:"h-3.5 w-3.5"})})]}):e.jsx("span",{className:"flex h-11 w-16 shrink-0 items-center justify-center rounded-lg bg-brand-50 text-brand-600 dark:bg-brand-900/30 dark:text-brand-400",children:e.jsx(h,{name:t.icon_name,className:"h-5 w-5"})}),title:t.title,subtitle:t.description})}),e.jsxs(_,{as:"form",onSubmit:u,open:r.editing!==null,onClose:r.closePanel,size:"lg",title:r.isNew?"Neue Leistung":"Leistung bearbeiten",footer:e.jsxs(e.Fragment,{children:[e.jsx(i,{variant:"secondary",onClick:r.closePanel,children:"Abbrechen"}),e.jsx(i,{type:"submit",disabled:r.saving||!r.isNew&&!r.dirty,children:r.saving?"Speichere…":r.isNew?"Anlegen":"Speichern"})]}),children:[r.error&&e.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:r.error}),e.jsx(l,{label:"Name",required:!0,children:e.jsx(o,{required:!0,autoFocus:!0,value:n.title,onChange:t=>a({title:t.target.value}),placeholder:"z. B. Car-HiFi"})}),e.jsx(l,{label:"Beschreibung",required:!0,children:e.jsx(x,{required:!0,rows:4,value:n.description,onChange:t=>a({description:t.target.value})})}),e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1.5 text-sm font-medium text-neutral-800 dark:text-neutral-200",children:["Symbol",e.jsx("span",{className:"ml-0.5 text-brand-600 dark:text-brand-400",children:"*"})]}),e.jsx(L,{value:n.icon_name,onChange:t=>a({icon_name:t})})]}),e.jsx(v,{value:n.image_path,onChange:t=>a({image_path:t}),aspect:4/3,label:"Bild"}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Knopf auf der Karte (optional)"}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(l,{label:"Text",children:e.jsx(o,{value:n.cta_label,onChange:t=>a({cta_label:t.target.value}),placeholder:"z. B. Fahrzeug wählen"})}),e.jsx(l,{label:"Link",children:e.jsx(o,{value:n.cta_url,onChange:t=>a({cta_url:t.target.value}),placeholder:"z. B. /fahrzeuge"})})]})]}),e.jsxs("details",{className:"group rounded-xl border border-neutral-200 dark:border-neutral-800",open:c||void 0,children:[e.jsxs("summary",{className:"flex cursor-pointer select-none items-center gap-2 px-4 py-3 text-sm font-medium text-neutral-700 dark:text-neutral-200",children:[e.jsx(f,{name:"chevron",className:"h-4 w-4 text-neutral-400 transition-transform group-open:rotate-90"}),"Englisch (optional)",c&&e.jsx(N,{tone:"brand",className:"ml-auto",children:"ausgefüllt"})]}),e.jsxs("div",{className:"space-y-4 border-t border-neutral-200 p-4 dark:border-neutral-800",children:[e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Leere Felder: Englische Besucher sehen den deutschen Text."}),e.jsx(l,{label:"Name (Englisch)",children:e.jsx(o,{value:n.title_en,onChange:t=>a({title_en:t.target.value}),placeholder:n.title})}),e.jsx(l,{label:"Beschreibung (Englisch)",children:e.jsx(x,{rows:4,value:n.description_en,onChange:t=>a({description_en:t.target.value})})}),e.jsx(l,{label:"Knopf-Text (Englisch)",children:e.jsx(o,{value:n.cta_label_en,onChange:t=>a({cta_label_en:t.target.value}),placeholder:n.cta_label})})]})]})]})]})}export{R as default}; +import{r as m,j as e,P as j,B as i,Z as h,z as _,F as l,x as o,W as x,I as f,U as N}from"./index-CPMnKQBc.js";import v from"./ImageUploadField-DGJRkWaj.js";import{toComponentName as p,ICON_NAMES as d,findIcon as k}from"./iconRegistry-DXMu3JdV.js";import{u as w,E as y}from"./EntityList-DPxkbA95.js";import"./resizeImage-C6PvAwh0.js";import"./music-D2Ez1K-E.js";import"./grip-vertical-Cn5hJClA.js";import"./trash-2-DwLXj_oo.js";import"./SortableList-Dgddukss.js";import"./sortable.esm-CUwm6pqJ.js";function g({name:r,className:n}){const a=k(r);return a?e.jsx(a,{className:n}):null}const C=120,I=200;function L({value:r,onChange:n}){const[a,c]=m.useState(""),u=r?p(r):null,t=m.useMemo(()=>{const s=a.trim().toLowerCase();return s?d.filter(b=>b.includes(s)).slice(0,I):d.slice(0,C)},[a]);return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-2 flex items-center gap-3 rounded-md border border-neutral-300 p-2 dark:border-neutral-700",children:[e.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:r?e.jsx(g,{name:r,className:"h-6 w-6"}):e.jsx("span",{className:"text-xs text-neutral-400",children:"?"})}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:r||"Kein Icon gewählt"}),e.jsxs("p",{className:"text-xs text-neutral-400",children:[d.length," Icons verfügbar"]})]})]}),e.jsx("input",{value:a,onChange:s=>c(s.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"}),e.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:[t.map(s=>e.jsx("button",{type:"button",title:s,onClick:()=>n(s),className:`flex h-10 w-10 items-center justify-center rounded-md transition ${u===p(s)?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:e.jsx(g,{name:s,className:"h-5 w-5"})},s)),t.length===0&&e.jsx("p",{className:"col-span-full py-4 text-center text-sm text-neutral-400",children:"Keine Icons gefunden."})]}),!a&&e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Tipp: Tippe einen Suchbegriff ein, um alle ",d.length," Icons zu durchsuchen."]})]})}const E={icon_name:"",title:"",description:"",image_path:"",cta_label:"",cta_url:"",sort_order:0,title_en:"",description_en:"",cta_label_en:""};function R(){const r=w({endpoint:"/services",reorderKey:"services",source:"services",emptyForm:E,toForm:t=>({icon_name:t.icon_name,title:t.title,description:t.description,image_path:t.image_path||"",cta_label:t.cta_label||"",cta_url:t.cta_url||"",sort_order:t.sort_order,title_en:t.title_en||"",description_en:t.description_en||"",cta_label_en:t.cta_label_en||""}),toPayload:t=>({...t,sort_order:Number(t.sort_order)}),labels:{created:"Leistung angelegt.",saved:"Leistung gespeichert.",deleted:"Leistung gelöscht."}}),{form:n,change:a}=r,c=!!(n.title_en||n.description_en||n.cta_label_en),u=t=>{if(t.preventDefault(),!n.icon_name){r.setError("Bitte ein Symbol auswählen.");return}r.submit()};return e.jsxs("div",{children:[e.jsx(j,{title:"Leistungen",description:"Die Karten auf der Seite „Leistungen“. Reihenfolge am Griff links ziehen.",actions:e.jsxs(e.Fragment,{children:[e.jsx(i,{variant:"secondary",icon:"eye",href:"/leistungen",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),e.jsx(i,{icon:"plus",onClick:()=>r.openPanel(null),children:"Neue Leistung"})]})}),e.jsx(y,{items:r.items,editingId:r.editing,onReorder:r.reorder,onOpen:r.openPanel,onDelete:t=>r.remove(t,`Leistung „${t.title}“ wirklich löschen?`),searchText:t=>`${t.title} ${t.description}`,empty:{icon:"briefcase",title:"Noch keine Leistungen",actions:e.jsx(i,{icon:"plus",onClick:()=>r.openPanel(null),children:"Neue Leistung"})},renderRow:t=>({media:t.image_path?e.jsxs("span",{className:"relative shrink-0",children:[e.jsx("img",{src:t.image_path,alt:"",className:"h-11 w-16 rounded-lg border border-neutral-200 object-cover dark:border-neutral-700"}),e.jsx("span",{className:"absolute -bottom-1 -right-1 flex h-6 w-6 items-center justify-center rounded-full bg-brand-500 text-white ring-2 ring-white dark:ring-neutral-900",children:e.jsx(h,{name:t.icon_name,className:"h-3.5 w-3.5"})})]}):e.jsx("span",{className:"flex h-11 w-16 shrink-0 items-center justify-center rounded-lg bg-brand-50 text-brand-600 dark:bg-brand-900/30 dark:text-brand-400",children:e.jsx(h,{name:t.icon_name,className:"h-5 w-5"})}),title:t.title,subtitle:t.description})}),e.jsxs(_,{as:"form",onSubmit:u,open:r.editing!==null,onClose:r.closePanel,size:"lg",title:r.isNew?"Neue Leistung":"Leistung bearbeiten",footer:e.jsxs(e.Fragment,{children:[e.jsx(i,{variant:"secondary",onClick:r.closePanel,children:"Abbrechen"}),e.jsx(i,{type:"submit",disabled:r.saving||!r.isNew&&!r.dirty,children:r.saving?"Speichere…":r.isNew?"Anlegen":"Speichern"})]}),children:[r.error&&e.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:r.error}),e.jsx(l,{label:"Name",required:!0,children:e.jsx(o,{required:!0,autoFocus:!0,value:n.title,onChange:t=>a({title:t.target.value}),placeholder:"z. B. Car-HiFi"})}),e.jsx(l,{label:"Beschreibung",required:!0,children:e.jsx(x,{required:!0,rows:4,value:n.description,onChange:t=>a({description:t.target.value})})}),e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1.5 text-sm font-medium text-neutral-800 dark:text-neutral-200",children:["Symbol",e.jsx("span",{className:"ml-0.5 text-brand-600 dark:text-brand-400",children:"*"})]}),e.jsx(L,{value:n.icon_name,onChange:t=>a({icon_name:t})})]}),e.jsx(v,{value:n.image_path,onChange:t=>a({image_path:t}),aspect:4/3,label:"Bild"}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsx("h3",{className:"text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Knopf auf der Karte (optional)"}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(l,{label:"Text",children:e.jsx(o,{value:n.cta_label,onChange:t=>a({cta_label:t.target.value}),placeholder:"z. B. Fahrzeug wählen"})}),e.jsx(l,{label:"Link",children:e.jsx(o,{value:n.cta_url,onChange:t=>a({cta_url:t.target.value}),placeholder:"z. B. /fahrzeuge"})})]})]}),e.jsxs("details",{className:"group rounded-xl border border-neutral-200 dark:border-neutral-800",open:c||void 0,children:[e.jsxs("summary",{className:"flex cursor-pointer select-none items-center gap-2 px-4 py-3 text-sm font-medium text-neutral-700 dark:text-neutral-200",children:[e.jsx(f,{name:"chevron",className:"h-4 w-4 text-neutral-400 transition-transform group-open:rotate-90"}),"Englisch (optional)",c&&e.jsx(N,{tone:"brand",className:"ml-auto",children:"ausgefüllt"})]}),e.jsxs("div",{className:"space-y-4 border-t border-neutral-200 p-4 dark:border-neutral-800",children:[e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Leere Felder: Englische Besucher sehen den deutschen Text."}),e.jsx(l,{label:"Name (Englisch)",children:e.jsx(o,{value:n.title_en,onChange:t=>a({title_en:t.target.value}),placeholder:n.title})}),e.jsx(l,{label:"Beschreibung (Englisch)",children:e.jsx(x,{rows:4,value:n.description_en,onChange:t=>a({description_en:t.target.value})})}),e.jsx(l,{label:"Knopf-Text (Englisch)",children:e.jsx(o,{value:n.cta_label_en,onChange:t=>a({cta_label_en:t.target.value}),placeholder:n.cta_label})})]})]})]})]})}export{R as default}; diff --git a/hifi/assets/SettingsLayout-uNCH_EVD.js b/hifi/assets/SettingsLayout-BFhAuThT.js similarity index 96% rename from hifi/assets/SettingsLayout-uNCH_EVD.js rename to hifi/assets/SettingsLayout-BFhAuThT.js index c037091..25f9283 100644 --- a/hifi/assets/SettingsLayout-uNCH_EVD.js +++ b/hifi/assets/SettingsLayout-BFhAuThT.js @@ -1 +1 @@ -import{a1 as a,j as e,r as i,a2 as d}from"./index-eQrgtQRM.js";const u={company:["Firmendaten","Telefon, Adresse, Öffnungszeiten und der Hinweis unter den Paketpreisen."],design:["Aussehen","Schriften und das Aussehen der Kacheln auf der Website."],images:["Bilder","Alle fest eingebauten Bilder der Website austauschen: Logo, Titelbild, Link-Vorschau, Startseiten-Fotos, Hintergründe und Paketkacheln. Ohne eigenes Bild gilt jeweils das Standardbild."],legal:["Rechtstexte","Impressum, Datenschutzerklärung und AGB."],maintenance:["Wartungsmodus","Die ganze Website oder einzelne Bereiche vorübergehend für Besucher sperren."],countdown:["Launch-Countdown","Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst."],email:["E-Mail-Versand","Zugangsdaten des Mail-Servers und die Texte der automatischen E-Mails."],google:["Google-Dienste","Google Analytics und Google-Bewertungen anbinden. Nur für Techniker."],connections:["Verbindungstest","Prüft auf Knopfdruck, ob Google, Mail-Server, Datenbank, Update-Server und Audio4Cars erreichbar sind und richtig eingerichtet."],database:["Datenbank","Verbindung und Struktur der Datenbank. Nur für Techniker."],"export-import":["Export & Import","Sicherung herunterladen oder auf einem anderen Server einspielen."],update:["Updates","Neue Versionen der Website installieren."],reset:["Zurücksetzen","Inhalte auf den Auslieferungszustand zurücksetzen. Vorher unbedingt exportieren."]};function l(){const{pathname:t}=a(),r=t.replace(/\/$/,"").split("/").pop(),[s,n]=u[r]||["Einstellungen",""];return e.jsxs("div",{children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:s}),n&&e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:n}),e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),children:e.jsx(d,{})})]})}export{l as default}; +import{a1 as a,j as e,r as i,a2 as d}from"./index-CPMnKQBc.js";const u={company:["Firmendaten","Telefon, Adresse, Öffnungszeiten und der Hinweis unter den Paketpreisen."],design:["Aussehen","Schriften und das Aussehen der Kacheln auf der Website."],images:["Bilder","Alle fest eingebauten Bilder der Website austauschen: Logo, Titelbild, Link-Vorschau, Startseiten-Fotos, Hintergründe und Paketkacheln. Ohne eigenes Bild gilt jeweils das Standardbild."],legal:["Rechtstexte","Impressum, Datenschutzerklärung und AGB."],maintenance:["Wartungsmodus","Die ganze Website oder einzelne Bereiche vorübergehend für Besucher sperren."],countdown:["Launch-Countdown","Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst."],email:["E-Mail-Versand","Zugangsdaten des Mail-Servers und die Texte der automatischen E-Mails."],google:["Google-Dienste","Google Analytics und Google-Bewertungen anbinden. Nur für Techniker."],connections:["Verbindungstest","Prüft auf Knopfdruck, ob Google, Mail-Server, Datenbank, Update-Server und Audio4Cars erreichbar sind und richtig eingerichtet."],database:["Datenbank","Verbindung und Struktur der Datenbank. Nur für Techniker."],"export-import":["Export & Import","Sicherung herunterladen oder auf einem anderen Server einspielen."],update:["Updates","Neue Versionen der Website installieren."],reset:["Zurücksetzen","Inhalte auf den Auslieferungszustand zurücksetzen. Vorher unbedingt exportieren."]};function l(){const{pathname:t}=a(),r=t.replace(/\/$/,"").split("/").pop(),[s,n]=u[r]||["Einstellungen",""];return e.jsxs("div",{children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:s}),n&&e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:n}),e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),children:e.jsx(d,{})})]})}export{l as default}; diff --git a/hifi/assets/SetupWizard-B8-5hkmh.js b/hifi/assets/SetupWizard-DZDK0feK.js similarity index 98% rename from hifi/assets/SetupWizard-B8-5hkmh.js rename to hifi/assets/SetupWizard-DZDK0feK.js index 19274c0..ed748d0 100644 --- a/hifi/assets/SetupWizard-B8-5hkmh.js +++ b/hifi/assets/SetupWizard-DZDK0feK.js @@ -1 +1 @@ -import{b as E,r as x,c as b,j as e,l as P,L as k}from"./index-eQrgtQRM.js";const F={host:"",name:"",user:"",password:"",charset:"utf8mb4"},L={username:"",password:"",password_confirmation:""};function z(){E({title:"Ersteinrichtung",path:"/setup"});const[n,c]=x.useState("loading"),[m,r]=x.useState(""),[u,o]=x.useState(!1),[f,v]=x.useState(""),[a,h]=x.useState(F),[l,p]=x.useState(L),[w,y]=x.useState(null),N=()=>b.get("/setup/status").then(t=>(t.needs_setup?t.steps.admin.ok?c("done"):t.steps.schema.ok?c("admin"):c(t.steps.database.ok?"schema":"database"):c("locked"),t));x.useEffect(()=>{b.get("/setup/status").then(t=>c(t.needs_setup?"password":"locked")).catch(()=>c("locked"))},[]);const D=async t=>{t.preventDefault(),r(""),o(!0);try{await b.post("/setup/verify-password",{password:f}),await N()}catch(s){r(s.message)}finally{o(!1)}},S=async t=>{t.preventDefault(),r(""),o(!0);try{await b.post("/setup/database",a),await N()}catch(s){r(s.message)}finally{o(!1)}},A=async()=>{r(""),o(!0);try{const t=await b.post("/setup/migrate",{});y(t.actions),t.status.steps.schema.ok&&c("admin")}catch(t){r(t.message)}finally{o(!1)}},C=async t=>{if(t.preventDefault(),r(""),l.password!==l.password_confirmation){r("Die Passwörter stimmen nicht überein");return}o(!0);try{await b.post("/setup/admin",l),c("done")}catch(s){r(s.message)}finally{o(!1)}},d="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",i="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",g=[{key:"database",label:"Datenbank"},{key:"schema",label:"Struktur"},{key:"admin",label:"Admin-Account"}],j=g.findIndex(t=>t.key===n);return e.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:[e.jsx("img",{src:P,alt:"HifiPlanet",className:"h-16 w-auto sm:h-20"}),e.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:[n==="loading"&&e.jsx("p",{className:"text-center text-sm text-neutral-400",children:"Lädt…"}),n==="locked"&&e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bereits eingerichtet"}),e.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."}),e.jsx(k,{to:"/admin/login",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Zum Login"})]}),["database","schema","admin"].includes(n)&&e.jsx("div",{className:"mb-6 flex items-center justify-center gap-2",children:g.map((t,s)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-semibold ${sv(t.target.value),required:!0,autoFocus:!0,className:d})]}),m&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),e.jsx("button",{type:"submit",disabled:u,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:u?"Prüfe…":"Weiter"})]}),n==="database"&&e.jsxs("form",{onSubmit:S,children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),e.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."}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Host *"}),e.jsx("input",{required:!0,value:a.host,onChange:t=>h({...a,host:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Datenbankname *"}),e.jsx("input",{required:!0,value:a.name,onChange:t=>h({...a,name:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Benutzer *"}),e.jsx("input",{required:!0,value:a.user,onChange:t=>h({...a,user:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Passwort"}),e.jsx("input",{type:"password",value:a.password,onChange:t=>h({...a,password:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:i,children:"Zeichensatz"}),e.jsx("input",{value:a.charset,onChange:t=>h({...a,charset:t.target.value}),className:d})]}),m&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),e.jsx("button",{type:"submit",disabled:u,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:u?"Teste Verbindung…":"Verbindung testen & speichern"})]}),n==="schema"&&e.jsxs("div",{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),e.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."}),w&&e.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:w.map((t,s)=>e.jsx("li",{children:t},s))}),m&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),e.jsx("button",{type:"button",onClick:A,disabled:u,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:u?"Richte ein…":"Datenbankstruktur einrichten"})]}),n==="admin"&&e.jsxs("form",{onSubmit:C,children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Erster Admin-Account"}),e.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."}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Benutzername"}),e.jsx("input",{required:!0,autoFocus:!0,value:l.username,onChange:t=>p({...l,username:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Passwort"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:l.password,onChange:t=>p({...l,password:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:i,children:"Passwort wiederholen"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:l.password_confirmation,onChange:t=>p({...l,password_confirmation:t.target.value}),className:d})]}),m&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),e.jsx("button",{type:"submit",disabled:u,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:u?"Lege an…":"Admin-Account anlegen"})]}),n==="done"&&e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Fertig!"}),e.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."}),e.jsx(k,{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"})]})]})]})}export{z as default}; +import{b as E,r as x,c as b,j as e,l as P,L as k}from"./index-CPMnKQBc.js";const F={host:"",name:"",user:"",password:"",charset:"utf8mb4"},L={username:"",password:"",password_confirmation:""};function z(){E({title:"Ersteinrichtung",path:"/setup"});const[n,c]=x.useState("loading"),[m,r]=x.useState(""),[u,o]=x.useState(!1),[f,v]=x.useState(""),[a,h]=x.useState(F),[l,p]=x.useState(L),[w,y]=x.useState(null),N=()=>b.get("/setup/status").then(t=>(t.needs_setup?t.steps.admin.ok?c("done"):t.steps.schema.ok?c("admin"):c(t.steps.database.ok?"schema":"database"):c("locked"),t));x.useEffect(()=>{b.get("/setup/status").then(t=>c(t.needs_setup?"password":"locked")).catch(()=>c("locked"))},[]);const D=async t=>{t.preventDefault(),r(""),o(!0);try{await b.post("/setup/verify-password",{password:f}),await N()}catch(s){r(s.message)}finally{o(!1)}},S=async t=>{t.preventDefault(),r(""),o(!0);try{await b.post("/setup/database",a),await N()}catch(s){r(s.message)}finally{o(!1)}},A=async()=>{r(""),o(!0);try{const t=await b.post("/setup/migrate",{});y(t.actions),t.status.steps.schema.ok&&c("admin")}catch(t){r(t.message)}finally{o(!1)}},C=async t=>{if(t.preventDefault(),r(""),l.password!==l.password_confirmation){r("Die Passwörter stimmen nicht überein");return}o(!0);try{await b.post("/setup/admin",l),c("done")}catch(s){r(s.message)}finally{o(!1)}},d="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",i="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",g=[{key:"database",label:"Datenbank"},{key:"schema",label:"Struktur"},{key:"admin",label:"Admin-Account"}],j=g.findIndex(t=>t.key===n);return e.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:[e.jsx("img",{src:P,alt:"HifiPlanet",className:"h-16 w-auto sm:h-20"}),e.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:[n==="loading"&&e.jsx("p",{className:"text-center text-sm text-neutral-400",children:"Lädt…"}),n==="locked"&&e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bereits eingerichtet"}),e.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."}),e.jsx(k,{to:"/admin/login",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Zum Login"})]}),["database","schema","admin"].includes(n)&&e.jsx("div",{className:"mb-6 flex items-center justify-center gap-2",children:g.map((t,s)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-semibold ${sv(t.target.value),required:!0,autoFocus:!0,className:d})]}),m&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),e.jsx("button",{type:"submit",disabled:u,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:u?"Prüfe…":"Weiter"})]}),n==="database"&&e.jsxs("form",{onSubmit:S,children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),e.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."}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Host *"}),e.jsx("input",{required:!0,value:a.host,onChange:t=>h({...a,host:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Datenbankname *"}),e.jsx("input",{required:!0,value:a.name,onChange:t=>h({...a,name:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Benutzer *"}),e.jsx("input",{required:!0,value:a.user,onChange:t=>h({...a,user:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Passwort"}),e.jsx("input",{type:"password",value:a.password,onChange:t=>h({...a,password:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:i,children:"Zeichensatz"}),e.jsx("input",{value:a.charset,onChange:t=>h({...a,charset:t.target.value}),className:d})]}),m&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),e.jsx("button",{type:"submit",disabled:u,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:u?"Teste Verbindung…":"Verbindung testen & speichern"})]}),n==="schema"&&e.jsxs("div",{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),e.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."}),w&&e.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:w.map((t,s)=>e.jsx("li",{children:t},s))}),m&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),e.jsx("button",{type:"button",onClick:A,disabled:u,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:u?"Richte ein…":"Datenbankstruktur einrichten"})]}),n==="admin"&&e.jsxs("form",{onSubmit:C,children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Erster Admin-Account"}),e.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."}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Benutzername"}),e.jsx("input",{required:!0,autoFocus:!0,value:l.username,onChange:t=>p({...l,username:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-3",children:[e.jsx("label",{className:i,children:"Passwort"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:l.password,onChange:t=>p({...l,password:t.target.value}),className:d})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:i,children:"Passwort wiederholen"}),e.jsx("input",{type:"password",required:!0,minLength:8,value:l.password_confirmation,onChange:t=>p({...l,password_confirmation:t.target.value}),className:d})]}),m&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),e.jsx("button",{type:"submit",disabled:u,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:u?"Lege an…":"Admin-Account anlegen"})]}),n==="done"&&e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Fertig!"}),e.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."}),e.jsx(k,{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"})]})]})]})}export{z as default}; diff --git a/hifi/assets/SortableList-B1XU_999.js b/hifi/assets/SortableList-Dgddukss.js similarity index 89% rename from hifi/assets/SortableList-B1XU_999.js rename to hifi/assets/SortableList-Dgddukss.js index 018c342..708f4ae 100644 --- a/hifi/assets/SortableList-B1XU_999.js +++ b/hifi/assets/SortableList-Dgddukss.js @@ -1 +1 @@ -import{j as o,c as x}from"./index-eQrgtQRM.js";import{u as p,a as f,D as m,c as v,S as y,r as j,v as C,b as R,s as w,K as D,T as N,P as T,d as E,C as G}from"./sortable.esm-CN3X5f7p.js";import{G as I}from"./grip-vertical-DJgsXpN7.js";function P({items:t,onReorder:s,children:n,as:e="ul",className:d="",disabled:i=!1}){const l=p(f(T,{activationConstraint:{distance:4}}),f(N,{activationConstraint:{delay:150,tolerance:6}}),f(D,{coordinateGetter:w})),c=({active:r,over:a})=>{if(!a||r.id===a.id)return;const h=t.findIndex(b=>b.id===r.id),S=t.findIndex(b=>b.id===a.id);s(R(t,h,S))},u=e==="tbody"?"tbody":e==="grid"?"div":"ul",g=e==="tbody"?"tr":e==="grid"?"div":"li";return o.jsx(m,{sensors:l,collisionDetection:v,onDragEnd:c,children:o.jsx(y,{items:t.map(r=>r.id),strategy:e==="grid"?j:C,disabled:i,children:o.jsx(u,{className:d,children:t.map(r=>o.jsx(K,{id:r.id,tag:g,disabled:i,children:a=>n(r,a)},r.id))})})})}function K({id:t,tag:s,disabled:n,children:e}){const{attributes:d,listeners:i,setNodeRef:l,setActivatorNodeRef:c,transform:u,transition:g,isDragging:r}=E({id:t,disabled:n}),a=n?null:o.jsx("button",{type:"button",ref:c,...d,...i,title:"Ziehen, um die Reihenfolge zu ändern","aria-label":"Reihenfolge ändern",className:"cursor-grab touch-none rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 active:cursor-grabbing dark:hover:bg-neutral-800",children:o.jsx(I,{className:"h-4 w-4"})});return o.jsx(s,{ref:l,style:{transform:G.Translate.toString(u),transition:g,position:"relative",zIndex:r?10:void 0},className:r?"bg-white shadow-lg ring-1 ring-brand-500 dark:bg-neutral-900":void 0,children:e(a)})}async function A(t,s){return await x.put(`/reorder/${t}`,{ids:s.map(n=>n.id)}),s.map((n,e)=>({...n,sort_order:(e+1)*10}))}export{P as S,A as s}; +import{j as o,c as x}from"./index-CPMnKQBc.js";import{u as p,a as f,D as m,c as v,S as y,r as j,v as C,b as R,s as w,K as D,T as N,P as T,d as E,C as G}from"./sortable.esm-CUwm6pqJ.js";import{G as I}from"./grip-vertical-Cn5hJClA.js";function P({items:t,onReorder:s,children:n,as:e="ul",className:d="",disabled:i=!1}){const l=p(f(T,{activationConstraint:{distance:4}}),f(N,{activationConstraint:{delay:150,tolerance:6}}),f(D,{coordinateGetter:w})),c=({active:r,over:a})=>{if(!a||r.id===a.id)return;const h=t.findIndex(b=>b.id===r.id),S=t.findIndex(b=>b.id===a.id);s(R(t,h,S))},u=e==="tbody"?"tbody":e==="grid"?"div":"ul",g=e==="tbody"?"tr":e==="grid"?"div":"li";return o.jsx(m,{sensors:l,collisionDetection:v,onDragEnd:c,children:o.jsx(y,{items:t.map(r=>r.id),strategy:e==="grid"?j:C,disabled:i,children:o.jsx(u,{className:d,children:t.map(r=>o.jsx(K,{id:r.id,tag:g,disabled:i,children:a=>n(r,a)},r.id))})})})}function K({id:t,tag:s,disabled:n,children:e}){const{attributes:d,listeners:i,setNodeRef:l,setActivatorNodeRef:c,transform:u,transition:g,isDragging:r}=E({id:t,disabled:n}),a=n?null:o.jsx("button",{type:"button",ref:c,...d,...i,title:"Ziehen, um die Reihenfolge zu ändern","aria-label":"Reihenfolge ändern",className:"cursor-grab touch-none rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 active:cursor-grabbing dark:hover:bg-neutral-800",children:o.jsx(I,{className:"h-4 w-4"})});return o.jsx(s,{ref:l,style:{transform:G.Translate.toString(u),transition:g,position:"relative",zIndex:r?10:void 0},className:r?"bg-white shadow-lg ring-1 ring-brand-500 dark:bg-neutral-900":void 0,children:e(a)})}async function A(t,s){return await x.put(`/reorder/${t}`,{ids:s.map(n=>n.id)}),s.map((n,e)=>({...n,sort_order:(e+1)*10}))}export{P as S,A as s}; diff --git a/hifi/assets/TextStyleWidget-Cc-J2FBP.js b/hifi/assets/TextStyleWidget-DGEJ-L-L.js similarity index 97% rename from hifi/assets/TextStyleWidget-Cc-J2FBP.js rename to hifi/assets/TextStyleWidget-DGEJ-L-L.js index 791cd35..7f5dd14 100644 --- a/hifi/assets/TextStyleWidget-Cc-J2FBP.js +++ b/hifi/assets/TextStyleWidget-DGEJ-L-L.js @@ -1 +1 @@ -import{a0 as g,r as l,c as x,j as t}from"./index-eQrgtQRM.js";const y=[{label:"Standard",value:""},{label:"S (14px)",value:"14px"},{label:"M (16px)",value:"16px"},{label:"L (18px)",value:"18px"},{label:"XL (20px)",value:"20px"},{label:"XXL (24px)",value:"24px"},{label:"XXXL (28px)",value:"28px"},{label:"Groß (36px)",value:"36px"},{label:"Riesig (48px)",value:"48px"}],s={font_family:"",font_size:"",color:""};function k({fieldKey:o,previewText:p="Beispieltext",label:c="Stil"}){const b=g(),[a,n]=l.useState(s),[m,u]=l.useState(!0),[d,i]=l.useState("");l.useEffect(()=>{u(!0),x.get(`/text-styles/one?key=${encodeURIComponent(o)}`).then(e=>n({font_family:e.font_family||"",font_size:e.font_size||"",color:e.color||""})).catch(()=>n(s)).finally(()=>u(!1))},[o]);const r=async e=>{n(e),i("");try{await x.put("/text-styles",{field_key:o,...e})}catch(v){i(v.message)}};if(m)return null;const f={fontFamily:a.font_family||void 0,fontSize:a.font_size||void 0,color:a.color||void 0};return t.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 rounded-md border border-neutral-200 bg-neutral-50 p-2 dark:border-neutral-700 dark:bg-neutral-800/50",children:[t.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-neutral-400",children:c}),t.jsx("select",{value:a.font_family,onChange:e=>r({...a,font_family:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:b.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("select",{value:a.font_size,onChange:e=>r({...a,font_size:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:y.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("input",{type:"color",value:a.color||"#000000",onChange:e=>r({...a,color:e.target.value}),className:"h-7 w-9 cursor-pointer rounded border border-neutral-300 bg-white p-0.5 dark:border-neutral-700 dark:bg-neutral-900",title:"Textfarbe"}),t.jsx("button",{type:"button",onClick:()=>r(s),className:"rounded-md border border-neutral-300 px-2 py-1 text-xs text-neutral-500 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-700",children:"Zurücksetzen"}),t.jsx("span",{className:"ml-1 rounded px-2 py-1 text-sm",style:f,children:p}),d&&t.jsx("span",{className:"text-xs text-red-600",children:d})]})}export{k as T}; +import{a0 as g,r as l,c as x,j as t}from"./index-CPMnKQBc.js";const y=[{label:"Standard",value:""},{label:"S (14px)",value:"14px"},{label:"M (16px)",value:"16px"},{label:"L (18px)",value:"18px"},{label:"XL (20px)",value:"20px"},{label:"XXL (24px)",value:"24px"},{label:"XXXL (28px)",value:"28px"},{label:"Groß (36px)",value:"36px"},{label:"Riesig (48px)",value:"48px"}],s={font_family:"",font_size:"",color:""};function k({fieldKey:o,previewText:p="Beispieltext",label:c="Stil"}){const b=g(),[a,n]=l.useState(s),[m,u]=l.useState(!0),[d,i]=l.useState("");l.useEffect(()=>{u(!0),x.get(`/text-styles/one?key=${encodeURIComponent(o)}`).then(e=>n({font_family:e.font_family||"",font_size:e.font_size||"",color:e.color||""})).catch(()=>n(s)).finally(()=>u(!1))},[o]);const r=async e=>{n(e),i("");try{await x.put("/text-styles",{field_key:o,...e})}catch(v){i(v.message)}};if(m)return null;const f={fontFamily:a.font_family||void 0,fontSize:a.font_size||void 0,color:a.color||void 0};return t.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 rounded-md border border-neutral-200 bg-neutral-50 p-2 dark:border-neutral-700 dark:bg-neutral-800/50",children:[t.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-neutral-400",children:c}),t.jsx("select",{value:a.font_family,onChange:e=>r({...a,font_family:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:b.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("select",{value:a.font_size,onChange:e=>r({...a,font_size:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:y.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("input",{type:"color",value:a.color||"#000000",onChange:e=>r({...a,color:e.target.value}),className:"h-7 w-9 cursor-pointer rounded border border-neutral-300 bg-white p-0.5 dark:border-neutral-700 dark:bg-neutral-900",title:"Textfarbe"}),t.jsx("button",{type:"button",onClick:()=>r(s),className:"rounded-md border border-neutral-300 px-2 py-1 text-xs text-neutral-500 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-700",children:"Zurücksetzen"}),t.jsx("span",{className:"ml-1 rounded px-2 py-1 text-sm",style:f,children:p}),d&&t.jsx("span",{className:"text-xs text-red-600",children:d})]})}export{k as T}; diff --git a/hifi/assets/Traffic-C7K-vaXp.js b/hifi/assets/Traffic-BLOMES7J.js similarity index 99% rename from hifi/assets/Traffic-C7K-vaXp.js rename to hifi/assets/Traffic-BLOMES7J.js index 7fe0d97..9e972f0 100644 --- a/hifi/assets/Traffic-C7K-vaXp.js +++ b/hifi/assets/Traffic-BLOMES7J.js @@ -1 +1 @@ -import{r as m,j as e,P as D,C as g,s as V,B as L,t as _,c as C}from"./index-eQrgtQRM.js";const F=[{value:7,label:"7 Tage"},{value:28,label:"28 Tage"},{value:90,label:"90 Tage"},{value:365,label:"12 Monate"}],I=[{value:"users",label:"Besucher"},{value:"sessions",label:"Sitzungen"},{value:"pageviews",label:"Seitenaufrufe"}],Z={Direct:"Direkt (Adresse/Lesezeichen)","Organic Search":"Google & Co. (unbezahlt)","Paid Search":"Suchanzeigen",Referral:"Verweise von anderen Seiten","Organic Social":"Social Media","Paid Social":"Social-Media-Anzeigen",Email:"E-Mail","Organic Maps":"Google Maps","Organic Video":"Video (YouTube & Co.)",Display:"Bannerwerbung",Unassigned:"Nicht zugeordnet"},R={desktop:"Computer",mobile:"Handy",tablet:"Tablet","smart tv":"Smart-TV"},z={generate_lead:"Anfrage gesendet",select_package:"Paket angeklickt",contact_call:"Telefonnummer angetippt",contact_whatsapp:"WhatsApp geöffnet",scroll:"Bis zum Seitenende gescrollt",click:"Link zu anderer Website",file_download:"Datei heruntergeladen",form_start:"Formular angefangen"},H=new Intl.NumberFormat("de-DE"),b=s=>H.format(Math.round(s)),U=s=>`${new Intl.NumberFormat("de-DE",{maximumFractionDigits:1}).format(s*100)} %`,X=s=>{const n=Math.round(s);return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")} min`},B=(s,n=!1)=>`${s.slice(6,8)}.${s.slice(4,6)}.${n?s.slice(0,4):""}`;function K(s,n){if(!n)return s>0?{label:"neu",tone:"up"}:null;const i=(s-n)/n*100;return Math.abs(i)<.5?{label:"±0 %",tone:"flat"}:{label:`${i>0?"+":"−"}${new Intl.NumberFormat("de-DE",{maximumFractionDigits:Math.abs(i)<10?1:0}).format(Math.abs(i))} %`,tone:i>0?"up":"down"}}const J={up:"bg-brand-100 text-brand-800 dark:bg-brand-900/50 dark:text-brand-300",down:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",flat:"bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300"};function G({current:s,previous:n,className:i=""}){const o=K(s,n);return o?e.jsxs("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[11px] font-semibold tabular-nums ${J[o.tone]} ${i}`,children:[o.tone==="up"?"▲ ":o.tone==="down"?"▼ ":"",o.label]}):null}function y({label:s,hint:n,value:i,previous:o,format:t}){return e.jsxs("div",{className:"rounded-xl border border-neutral-200/80 bg-white p-4 shadow-sm shadow-neutral-900/[0.03] dark:border-neutral-800 dark:bg-neutral-900 dark:shadow-none",children:[e.jsx("p",{className:"text-xs font-medium text-neutral-500 dark:text-neutral-400",title:n,children:s}),e.jsx("p",{className:"mt-1 text-2xl font-bold tabular-nums tracking-tight text-neutral-900 dark:text-white",children:t(i)}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.jsx(G,{current:i,previous:o}),e.jsxs("span",{className:"text-[11px] text-neutral-400",children:["vorher ",t(o)]})]})]})}function Q({current:s,previous:n,metric:i,days:o}){const[t,p]=m.useState(null),h=m.useRef(null),[r,l]=m.useState(720);m.useEffect(()=>{const a=h.current;if(!a)return;const x=new ResizeObserver(([S])=>l(Math.max(260,Math.round(S.contentRect.width))));return x.observe(a),()=>x.disconnect()},[]);const u=r<500?200:240,d={top:12,right:8,bottom:26,left:36},M=r-d.left-d.right,v=u-d.top-d.bottom,c=Math.max(1,...s.map(a=>a[i]),...n.map(a=>a[i])),w=(()=>{const a=10**Math.floor(Math.log10(c));return Math.ceil(c/a)*a})(),f=s.length,j=a=>d.left+(f<=1?M/2:a/(f-1)*M),$=a=>d.top+v-a/w*v,E=a=>a.map((x,S)=>`${S?"L":"M"}${j(S).toFixed(1)},${$(x[i]).toFixed(1)}`).join(""),W=`${E(s)}L${j(f-1).toFixed(1)},${d.top+v}L${j(0).toFixed(1)},${d.top+v}Z`,P=[0,.5,1].map(a=>Math.round(w*a)),A=Math.max(1,Math.ceil(f/Math.max(3,Math.floor(r/100)))),T=a=>{const x=a.currentTarget.getBoundingClientRect(),S=(a.clientX-x.left)/x.width*r,O=Math.round((S-d.left)/M*(f-1));p(Math.min(f-1,Math.max(0,O)))},k=t!==null?{cur:s[t],prev:n[t]}:null;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsxs("svg",{width:r,height:u,viewBox:`0 0 ${r} ${u}`,className:"block max-w-full touch-none select-none",onMouseMove:T,onTouchMove:a=>T(a.touches[0]?{...a,clientX:a.touches[0].clientX,currentTarget:a.currentTarget}:a),onMouseLeave:()=>p(null),role:"img","aria-label":"Verlauf im gewählten Zeitraum im Vergleich zum vorherigen",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"traffic-area",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#6ba626",stopOpacity:"0.28"}),e.jsx("stop",{offset:"100%",stopColor:"#6ba626",stopOpacity:"0"})]})}),P.map(a=>e.jsxs("g",{children:[e.jsx("line",{x1:d.left,x2:r-d.right,y1:$(a),y2:$(a),className:"stroke-neutral-200 dark:stroke-neutral-800",strokeWidth:"1"}),e.jsx("text",{x:d.left-6,y:$(a)+4,textAnchor:"end",className:"fill-neutral-400 text-[11px]",children:b(a)})]},a)),s.map((a,x)=>x%A===0&&f-1-x>=A/2||x===f-1?e.jsx("text",{x:j(x),y:u-6,textAnchor:x===0?"start":x===f-1?"end":"middle",className:"fill-neutral-400 text-[11px]",children:B(a.date)},a.date):null),e.jsx("path",{d:E(n),fill:"none",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"1.5",strokeDasharray:"4 4"}),e.jsx("path",{d:W,fill:"url(#traffic-area)"}),e.jsx("path",{d:E(s),fill:"none",stroke:"#6ba626",strokeWidth:"2.25",strokeLinejoin:"round",strokeLinecap:"round"}),k&&e.jsxs("g",{children:[e.jsx("line",{x1:j(t),x2:j(t),y1:d.top,y2:d.top+v,className:"stroke-neutral-300 dark:stroke-neutral-700"}),e.jsx("circle",{cx:j(t),cy:$(k.cur[i]),r:"4",fill:"#6ba626",className:"stroke-white dark:stroke-neutral-900",strokeWidth:"2"})]})]}),k&&e.jsxs("div",{className:"pointer-events-none absolute top-0 z-10 rounded-lg border border-neutral-200 bg-white px-3 py-2 text-xs shadow-lg dark:border-neutral-700 dark:bg-neutral-900",style:{left:`${j(t)/r*100}%`,transform:`translateX(${t>f/2?"-105%":"5%"})`},children:[e.jsxs("p",{className:"font-semibold text-neutral-900 dark:text-white",children:[B(k.cur.date,!0),": ",b(k.cur[i])]}),k.prev&&e.jsxs("p",{className:"text-neutral-500 dark:text-neutral-400",children:[o," Tage davor (",B(k.prev.date),"): ",b(k.prev[i])]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-4 text-xs text-neutral-500 dark:text-neutral-400",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"h-0.5 w-4 rounded bg-brand-500"})," Gewählter Zeitraum"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-4 border-t-2 border-dashed border-neutral-400"})," Zeitraum davor"]})]})]})}function N({rows:s,label:n=p=>p,mono:i=!1,showTrend:o=!0,empty:t="Noch keine Daten."}){if(!(s!=null&&s.length))return e.jsx("p",{className:"text-sm text-neutral-400",children:t});const p=s.reduce((r,l)=>r+l.current,0)||1,h=Math.max(...s.map(r=>r.current),1);return e.jsx("ul",{className:"space-y-2.5",children:s.map(r=>e.jsxs("li",{children:[e.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-3 text-sm",children:[e.jsx("span",{className:`min-w-0 truncate text-neutral-700 dark:text-neutral-200 ${i?"font-mono text-xs":""}`,title:r.name,children:n(r.name)||"(nicht gesetzt)"}),e.jsxs("span",{className:"flex shrink-0 items-center gap-2",children:[o&&e.jsx(G,{current:r.current,previous:r.previous}),e.jsx("span",{className:"w-12 text-right font-semibold tabular-nums text-neutral-900 dark:text-white",children:b(r.current)})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-neutral-100 dark:bg-neutral-800",children:e.jsx("div",{className:"h-full rounded-full bg-brand-500/80",style:{width:`${r.current/h*100}%`}})}),e.jsxs("span",{className:"w-10 text-right text-[11px] tabular-nums text-neutral-400",children:[Math.round(r.current/p*100)," %"]})]})]},r.name))})}const Y=s=>(s||"").replace(/\s*\|\s*HifiPlanet\s*$/i,"").trim()||"Startseite";function q({initial:s}){var r;const[n,i]=m.useState(s);if(m.useEffect(()=>i(s),[s]),m.useEffect(()=>{const l=setInterval(()=>{document.visibilityState==="visible"&&C.get("/analytics/realtime").then(u=>u.realtime&&i(u.realtime)).catch(()=>{})},6e4);return()=>clearInterval(l)},[]),!n)return null;const o=n.per_minute||[],t=Math.max(1,...o),p=Math.max(1,...n.pages.map(l=>l.users)),h=n.users>0;return e.jsx(g,{className:"mb-6",padded:!1,children:e.jsxs("div",{className:"grid lg:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]",children:[e.jsxs("div",{className:"border-b border-neutral-100 p-5 sm:p-6 lg:border-b-0 lg:border-r dark:border-neutral-800",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:text-neutral-400",children:[e.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[h&&e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-brand-400 opacity-75"}),e.jsx("span",{className:`relative inline-flex h-2.5 w-2.5 rounded-full ${h?"bg-brand-500":"bg-neutral-300 dark:bg-neutral-600"}`})]}),"Live · letzte 30 Minuten"]}),e.jsx("p",{className:"mt-3 text-4xl font-bold tabular-nums tracking-tight text-neutral-900 dark:text-white",children:b(n.users)}),e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Besucher auf der Website"}),o.length>0&&e.jsxs("div",{className:"mt-5",children:[e.jsx("div",{className:"flex h-16 items-end gap-[3px]","aria-label":"Besucher je Minute",children:o.map((l,u)=>e.jsx("div",{className:`flex-1 rounded-sm ${l>0?"bg-brand-500/80":"bg-neutral-100 dark:bg-neutral-800"}`,style:{height:l>0?`${Math.max(12,l/t*100)}%`:"4px"},title:`${u===29?"Gerade eben":`Vor ${29-u} Min.`}: ${l}`},u))}),e.jsxs("div",{className:"mt-1 flex justify-between text-[11px] text-neutral-400",children:[e.jsx("span",{children:"vor 30 Min."}),e.jsx("span",{children:"jetzt"})]})]}),((r=n.devices)==null?void 0:r.length)>0&&e.jsx("div",{className:"mt-4 flex flex-wrap gap-1.5",children:n.devices.map(l=>e.jsxs("span",{className:"rounded-full bg-neutral-100 px-2.5 py-1 text-xs font-medium text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:[R[l.name]||l.name,": ",l.users]},l.name))})]}),e.jsxs("div",{className:"p-5 sm:p-6",children:[e.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Gerade angesehene Seiten"}),n.pages.length===0?e.jsx("p",{className:"text-sm text-neutral-400",children:"Im Moment ist niemand auf der Website."}):e.jsx("ul",{className:"space-y-2",children:n.pages.map(l=>e.jsxs("li",{className:"relative overflow-hidden rounded-lg bg-neutral-50 dark:bg-neutral-800/50",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 bg-brand-500/15 dark:bg-brand-500/20",style:{width:`${l.users/p*100}%`}}),e.jsxs("div",{className:"relative flex items-center justify-between gap-3 px-3 py-2 text-sm",children:[e.jsx("span",{className:"min-w-0 truncate text-neutral-800 dark:text-neutral-100",title:l.name,children:Y(l.name)}),e.jsxs("span",{className:"shrink-0 font-semibold tabular-nums text-neutral-900 dark:text-white",children:[l.users," ",e.jsx("span",{className:"font-normal text-neutral-400",children:l.users===1?"Person":"Personen"})]})]})]},l.name))}),n.fetched_at&&e.jsxs("p",{className:"mt-3 text-[11px] text-neutral-400",children:["Stand ",new Date(n.fetched_at).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})," Uhr · aktualisiert sich jede Minute"]})]})]})})}function te(){const[s,n]=m.useState(28),[i,o]=m.useState("users"),[t,p]=m.useState(null),[h,r]=m.useState(""),[l,u]=m.useState(!1),d=(c=!1)=>{u(!0),r(""),C.get(`/analytics/traffic?days=${s}${c?"&refresh=1":""}`).then(p).catch(w=>r(w.message)).finally(()=>u(!1))};m.useEffect(()=>{d()},[s]);const M=m.useMemo(()=>((t==null?void 0:t.events)||[]).filter(c=>z[c.name]).sort((c,w)=>Object.keys(z).indexOf(c.name)-Object.keys(z).indexOf(w.name)),[t]),v=e.jsx(D,{title:"Besucher",description:"Zahlen aus Google Analytics. Jede Zahl zeigt den Vergleich zum gleich langen Zeitraum davor.",actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{value:s,onChange:n,options:F,size:"sm"}),e.jsx(L,{variant:"secondary",size:"sm",icon:"refresh",onClick:()=>d(!0),disabled:l,children:"Aktualisieren"})]})});return t&&!t.configured?e.jsxs("div",{children:[e.jsx(D,{title:"Besucher"}),e.jsx(g,{children:e.jsx(V,{icon:"gauge",title:"Google Analytics ist noch nicht verbunden",description:"Trage unter System › Google-Dienste die Property-ID und den Service-Account ein, dann erscheinen hier die Besucherzahlen.",actions:e.jsx(L,{to:"/admin/settings/google",children:"Zu den Google-Diensten"})})})]}):e.jsxs("div",{children:[v,h&&e.jsx(g,{className:"mb-6",children:e.jsx("p",{className:"text-sm text-red-600",children:h})}),!t&&!h&&e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),t&&e.jsxs("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:[e.jsx(q,{initial:t.realtime}),e.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-3 xl:grid-cols-6",children:[e.jsx(y,{label:"Besucher",hint:"Aktive Nutzer im Zeitraum",value:t.kpis.activeUsers.current,previous:t.kpis.activeUsers.previous,format:b}),e.jsx(y,{label:"Neue Besucher",hint:"Zum ersten Mal auf der Seite",value:t.kpis.newUsers.current,previous:t.kpis.newUsers.previous,format:b}),e.jsx(y,{label:"Sitzungen",hint:"Besuche (ein Besucher kann mehrmals kommen)",value:t.kpis.sessions.current,previous:t.kpis.sessions.previous,format:b}),e.jsx(y,{label:"Seitenaufrufe",value:t.kpis.screenPageViews.current,previous:t.kpis.screenPageViews.previous,format:b}),e.jsx(y,{label:"Ø Besuchsdauer",value:t.kpis.averageSessionDuration.current,previous:t.kpis.averageSessionDuration.previous,format:X}),e.jsx(y,{label:"Interessierte Besuche",hint:"Anteil der Sitzungen über 10 Sekunden, mit 2+ Seiten oder einer Aktion (GA: Engagement-Rate)",value:t.kpis.engagementRate.current,previous:t.kpis.engagementRate.previous,format:U})]}),e.jsx(g,{title:"Verlauf",actions:e.jsx(_,{value:i,onChange:o,options:I,size:"sm"}),className:"mb-6",children:e.jsx(Q,{current:t.daily.current,previous:t.daily.previous,metric:i,days:t.days})}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(g,{title:"Woher die Besucher kommen",description:"Sitzungen nach Kanal",children:e.jsx(N,{rows:t.channels,label:c=>Z[c]||c})}),e.jsx(g,{title:"Quellen",description:"Sitzungen nach Website bzw. Suchmaschine",children:e.jsx(N,{rows:t.sources,label:c=>c==="(direct)"?"direkt":c})}),e.jsx(g,{title:"Meistbesuchte Seiten",description:"Seitenaufrufe",children:e.jsx(N,{rows:t.pages,mono:!0})}),e.jsx(g,{title:"Einstiegsseiten",description:"Auf welcher Seite ein Besuch beginnt (Sitzungen)",children:e.jsx(N,{rows:t.landing_pages,mono:!0,showTrend:!1})}),e.jsx(g,{title:"Was Besucher tun",description:"Anzahl im Zeitraum – die wichtigsten Aktionen auf der Website",children:e.jsx(N,{rows:M,label:c=>z[c],empty:"Noch keine Aktionen erfasst."})}),e.jsxs("div",{className:"grid gap-6",children:[e.jsx(g,{title:"Geräte",description:"Besucher",children:e.jsx(N,{rows:t.devices,label:c=>R[c]||c})}),e.jsx(g,{title:"Orte",description:"Besucher nach Stadt (ungefähr, aus der IP-Adresse)",children:e.jsx(N,{rows:t.cities,showTrend:!1,label:c=>c==="(not set)"?"unbekannt":c})})]})]}),e.jsxs("p",{className:"mt-6 text-xs text-neutral-400",children:["Gezählt werden nur Besucher, die im Cookie-Banner der Statistik zugestimmt haben. Stand"," ",new Date(t.generated_at).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})," Uhr, wird bis zu 5 Minuten zwischengespeichert. Noch mehr Auswertungen gibt es direkt in"," ",e.jsx("a",{href:"https://analytics.google.com/",target:"_blank",rel:"noreferrer",className:"text-brand-600 hover:underline dark:text-brand-400",children:"Google Analytics"}),"."]})]})]})}export{te as default}; +import{r as m,j as e,P as D,C as g,s as V,B as L,t as _,c as C}from"./index-CPMnKQBc.js";const F=[{value:7,label:"7 Tage"},{value:28,label:"28 Tage"},{value:90,label:"90 Tage"},{value:365,label:"12 Monate"}],I=[{value:"users",label:"Besucher"},{value:"sessions",label:"Sitzungen"},{value:"pageviews",label:"Seitenaufrufe"}],Z={Direct:"Direkt (Adresse/Lesezeichen)","Organic Search":"Google & Co. (unbezahlt)","Paid Search":"Suchanzeigen",Referral:"Verweise von anderen Seiten","Organic Social":"Social Media","Paid Social":"Social-Media-Anzeigen",Email:"E-Mail","Organic Maps":"Google Maps","Organic Video":"Video (YouTube & Co.)",Display:"Bannerwerbung",Unassigned:"Nicht zugeordnet"},R={desktop:"Computer",mobile:"Handy",tablet:"Tablet","smart tv":"Smart-TV"},z={generate_lead:"Anfrage gesendet",select_package:"Paket angeklickt",contact_call:"Telefonnummer angetippt",contact_whatsapp:"WhatsApp geöffnet",scroll:"Bis zum Seitenende gescrollt",click:"Link zu anderer Website",file_download:"Datei heruntergeladen",form_start:"Formular angefangen"},H=new Intl.NumberFormat("de-DE"),b=s=>H.format(Math.round(s)),U=s=>`${new Intl.NumberFormat("de-DE",{maximumFractionDigits:1}).format(s*100)} %`,X=s=>{const n=Math.round(s);return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")} min`},B=(s,n=!1)=>`${s.slice(6,8)}.${s.slice(4,6)}.${n?s.slice(0,4):""}`;function K(s,n){if(!n)return s>0?{label:"neu",tone:"up"}:null;const i=(s-n)/n*100;return Math.abs(i)<.5?{label:"±0 %",tone:"flat"}:{label:`${i>0?"+":"−"}${new Intl.NumberFormat("de-DE",{maximumFractionDigits:Math.abs(i)<10?1:0}).format(Math.abs(i))} %`,tone:i>0?"up":"down"}}const J={up:"bg-brand-100 text-brand-800 dark:bg-brand-900/50 dark:text-brand-300",down:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300",flat:"bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300"};function G({current:s,previous:n,className:i=""}){const o=K(s,n);return o?e.jsxs("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[11px] font-semibold tabular-nums ${J[o.tone]} ${i}`,children:[o.tone==="up"?"▲ ":o.tone==="down"?"▼ ":"",o.label]}):null}function y({label:s,hint:n,value:i,previous:o,format:t}){return e.jsxs("div",{className:"rounded-xl border border-neutral-200/80 bg-white p-4 shadow-sm shadow-neutral-900/[0.03] dark:border-neutral-800 dark:bg-neutral-900 dark:shadow-none",children:[e.jsx("p",{className:"text-xs font-medium text-neutral-500 dark:text-neutral-400",title:n,children:s}),e.jsx("p",{className:"mt-1 text-2xl font-bold tabular-nums tracking-tight text-neutral-900 dark:text-white",children:t(i)}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.jsx(G,{current:i,previous:o}),e.jsxs("span",{className:"text-[11px] text-neutral-400",children:["vorher ",t(o)]})]})]})}function Q({current:s,previous:n,metric:i,days:o}){const[t,p]=m.useState(null),h=m.useRef(null),[r,l]=m.useState(720);m.useEffect(()=>{const a=h.current;if(!a)return;const x=new ResizeObserver(([S])=>l(Math.max(260,Math.round(S.contentRect.width))));return x.observe(a),()=>x.disconnect()},[]);const u=r<500?200:240,d={top:12,right:8,bottom:26,left:36},M=r-d.left-d.right,v=u-d.top-d.bottom,c=Math.max(1,...s.map(a=>a[i]),...n.map(a=>a[i])),w=(()=>{const a=10**Math.floor(Math.log10(c));return Math.ceil(c/a)*a})(),f=s.length,j=a=>d.left+(f<=1?M/2:a/(f-1)*M),$=a=>d.top+v-a/w*v,E=a=>a.map((x,S)=>`${S?"L":"M"}${j(S).toFixed(1)},${$(x[i]).toFixed(1)}`).join(""),W=`${E(s)}L${j(f-1).toFixed(1)},${d.top+v}L${j(0).toFixed(1)},${d.top+v}Z`,P=[0,.5,1].map(a=>Math.round(w*a)),A=Math.max(1,Math.ceil(f/Math.max(3,Math.floor(r/100)))),T=a=>{const x=a.currentTarget.getBoundingClientRect(),S=(a.clientX-x.left)/x.width*r,O=Math.round((S-d.left)/M*(f-1));p(Math.min(f-1,Math.max(0,O)))},k=t!==null?{cur:s[t],prev:n[t]}:null;return e.jsxs("div",{ref:h,className:"relative",children:[e.jsxs("svg",{width:r,height:u,viewBox:`0 0 ${r} ${u}`,className:"block max-w-full touch-none select-none",onMouseMove:T,onTouchMove:a=>T(a.touches[0]?{...a,clientX:a.touches[0].clientX,currentTarget:a.currentTarget}:a),onMouseLeave:()=>p(null),role:"img","aria-label":"Verlauf im gewählten Zeitraum im Vergleich zum vorherigen",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"traffic-area",x1:"0",x2:"0",y1:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#6ba626",stopOpacity:"0.28"}),e.jsx("stop",{offset:"100%",stopColor:"#6ba626",stopOpacity:"0"})]})}),P.map(a=>e.jsxs("g",{children:[e.jsx("line",{x1:d.left,x2:r-d.right,y1:$(a),y2:$(a),className:"stroke-neutral-200 dark:stroke-neutral-800",strokeWidth:"1"}),e.jsx("text",{x:d.left-6,y:$(a)+4,textAnchor:"end",className:"fill-neutral-400 text-[11px]",children:b(a)})]},a)),s.map((a,x)=>x%A===0&&f-1-x>=A/2||x===f-1?e.jsx("text",{x:j(x),y:u-6,textAnchor:x===0?"start":x===f-1?"end":"middle",className:"fill-neutral-400 text-[11px]",children:B(a.date)},a.date):null),e.jsx("path",{d:E(n),fill:"none",className:"stroke-neutral-400 dark:stroke-neutral-500",strokeWidth:"1.5",strokeDasharray:"4 4"}),e.jsx("path",{d:W,fill:"url(#traffic-area)"}),e.jsx("path",{d:E(s),fill:"none",stroke:"#6ba626",strokeWidth:"2.25",strokeLinejoin:"round",strokeLinecap:"round"}),k&&e.jsxs("g",{children:[e.jsx("line",{x1:j(t),x2:j(t),y1:d.top,y2:d.top+v,className:"stroke-neutral-300 dark:stroke-neutral-700"}),e.jsx("circle",{cx:j(t),cy:$(k.cur[i]),r:"4",fill:"#6ba626",className:"stroke-white dark:stroke-neutral-900",strokeWidth:"2"})]})]}),k&&e.jsxs("div",{className:"pointer-events-none absolute top-0 z-10 rounded-lg border border-neutral-200 bg-white px-3 py-2 text-xs shadow-lg dark:border-neutral-700 dark:bg-neutral-900",style:{left:`${j(t)/r*100}%`,transform:`translateX(${t>f/2?"-105%":"5%"})`},children:[e.jsxs("p",{className:"font-semibold text-neutral-900 dark:text-white",children:[B(k.cur.date,!0),": ",b(k.cur[i])]}),k.prev&&e.jsxs("p",{className:"text-neutral-500 dark:text-neutral-400",children:[o," Tage davor (",B(k.prev.date),"): ",b(k.prev[i])]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap gap-4 text-xs text-neutral-500 dark:text-neutral-400",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"h-0.5 w-4 rounded bg-brand-500"})," Gewählter Zeitraum"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-4 border-t-2 border-dashed border-neutral-400"})," Zeitraum davor"]})]})]})}function N({rows:s,label:n=p=>p,mono:i=!1,showTrend:o=!0,empty:t="Noch keine Daten."}){if(!(s!=null&&s.length))return e.jsx("p",{className:"text-sm text-neutral-400",children:t});const p=s.reduce((r,l)=>r+l.current,0)||1,h=Math.max(...s.map(r=>r.current),1);return e.jsx("ul",{className:"space-y-2.5",children:s.map(r=>e.jsxs("li",{children:[e.jsxs("div",{className:"mb-1 flex items-baseline justify-between gap-3 text-sm",children:[e.jsx("span",{className:`min-w-0 truncate text-neutral-700 dark:text-neutral-200 ${i?"font-mono text-xs":""}`,title:r.name,children:n(r.name)||"(nicht gesetzt)"}),e.jsxs("span",{className:"flex shrink-0 items-center gap-2",children:[o&&e.jsx(G,{current:r.current,previous:r.previous}),e.jsx("span",{className:"w-12 text-right font-semibold tabular-nums text-neutral-900 dark:text-white",children:b(r.current)})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-neutral-100 dark:bg-neutral-800",children:e.jsx("div",{className:"h-full rounded-full bg-brand-500/80",style:{width:`${r.current/h*100}%`}})}),e.jsxs("span",{className:"w-10 text-right text-[11px] tabular-nums text-neutral-400",children:[Math.round(r.current/p*100)," %"]})]})]},r.name))})}const Y=s=>(s||"").replace(/\s*\|\s*HifiPlanet\s*$/i,"").trim()||"Startseite";function q({initial:s}){var r;const[n,i]=m.useState(s);if(m.useEffect(()=>i(s),[s]),m.useEffect(()=>{const l=setInterval(()=>{document.visibilityState==="visible"&&C.get("/analytics/realtime").then(u=>u.realtime&&i(u.realtime)).catch(()=>{})},6e4);return()=>clearInterval(l)},[]),!n)return null;const o=n.per_minute||[],t=Math.max(1,...o),p=Math.max(1,...n.pages.map(l=>l.users)),h=n.users>0;return e.jsx(g,{className:"mb-6",padded:!1,children:e.jsxs("div",{className:"grid lg:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]",children:[e.jsxs("div",{className:"border-b border-neutral-100 p-5 sm:p-6 lg:border-b-0 lg:border-r dark:border-neutral-800",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:text-neutral-400",children:[e.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[h&&e.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-brand-400 opacity-75"}),e.jsx("span",{className:`relative inline-flex h-2.5 w-2.5 rounded-full ${h?"bg-brand-500":"bg-neutral-300 dark:bg-neutral-600"}`})]}),"Live · letzte 30 Minuten"]}),e.jsx("p",{className:"mt-3 text-4xl font-bold tabular-nums tracking-tight text-neutral-900 dark:text-white",children:b(n.users)}),e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Besucher auf der Website"}),o.length>0&&e.jsxs("div",{className:"mt-5",children:[e.jsx("div",{className:"flex h-16 items-end gap-[3px]","aria-label":"Besucher je Minute",children:o.map((l,u)=>e.jsx("div",{className:`flex-1 rounded-sm ${l>0?"bg-brand-500/80":"bg-neutral-100 dark:bg-neutral-800"}`,style:{height:l>0?`${Math.max(12,l/t*100)}%`:"4px"},title:`${u===29?"Gerade eben":`Vor ${29-u} Min.`}: ${l}`},u))}),e.jsxs("div",{className:"mt-1 flex justify-between text-[11px] text-neutral-400",children:[e.jsx("span",{children:"vor 30 Min."}),e.jsx("span",{children:"jetzt"})]})]}),((r=n.devices)==null?void 0:r.length)>0&&e.jsx("div",{className:"mt-4 flex flex-wrap gap-1.5",children:n.devices.map(l=>e.jsxs("span",{className:"rounded-full bg-neutral-100 px-2.5 py-1 text-xs font-medium text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:[R[l.name]||l.name,": ",l.users]},l.name))})]}),e.jsxs("div",{className:"p-5 sm:p-6",children:[e.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Gerade angesehene Seiten"}),n.pages.length===0?e.jsx("p",{className:"text-sm text-neutral-400",children:"Im Moment ist niemand auf der Website."}):e.jsx("ul",{className:"space-y-2",children:n.pages.map(l=>e.jsxs("li",{className:"relative overflow-hidden rounded-lg bg-neutral-50 dark:bg-neutral-800/50",children:[e.jsx("div",{className:"absolute inset-y-0 left-0 bg-brand-500/15 dark:bg-brand-500/20",style:{width:`${l.users/p*100}%`}}),e.jsxs("div",{className:"relative flex items-center justify-between gap-3 px-3 py-2 text-sm",children:[e.jsx("span",{className:"min-w-0 truncate text-neutral-800 dark:text-neutral-100",title:l.name,children:Y(l.name)}),e.jsxs("span",{className:"shrink-0 font-semibold tabular-nums text-neutral-900 dark:text-white",children:[l.users," ",e.jsx("span",{className:"font-normal text-neutral-400",children:l.users===1?"Person":"Personen"})]})]})]},l.name))}),n.fetched_at&&e.jsxs("p",{className:"mt-3 text-[11px] text-neutral-400",children:["Stand ",new Date(n.fetched_at).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})," Uhr · aktualisiert sich jede Minute"]})]})]})})}function te(){const[s,n]=m.useState(28),[i,o]=m.useState("users"),[t,p]=m.useState(null),[h,r]=m.useState(""),[l,u]=m.useState(!1),d=(c=!1)=>{u(!0),r(""),C.get(`/analytics/traffic?days=${s}${c?"&refresh=1":""}`).then(p).catch(w=>r(w.message)).finally(()=>u(!1))};m.useEffect(()=>{d()},[s]);const M=m.useMemo(()=>((t==null?void 0:t.events)||[]).filter(c=>z[c.name]).sort((c,w)=>Object.keys(z).indexOf(c.name)-Object.keys(z).indexOf(w.name)),[t]),v=e.jsx(D,{title:"Besucher",description:"Zahlen aus Google Analytics. Jede Zahl zeigt den Vergleich zum gleich langen Zeitraum davor.",actions:e.jsxs(e.Fragment,{children:[e.jsx(_,{value:s,onChange:n,options:F,size:"sm"}),e.jsx(L,{variant:"secondary",size:"sm",icon:"refresh",onClick:()=>d(!0),disabled:l,children:"Aktualisieren"})]})});return t&&!t.configured?e.jsxs("div",{children:[e.jsx(D,{title:"Besucher"}),e.jsx(g,{children:e.jsx(V,{icon:"gauge",title:"Google Analytics ist noch nicht verbunden",description:"Trage unter System › Google-Dienste die Property-ID und den Service-Account ein, dann erscheinen hier die Besucherzahlen.",actions:e.jsx(L,{to:"/admin/settings/google",children:"Zu den Google-Diensten"})})})]}):e.jsxs("div",{children:[v,h&&e.jsx(g,{className:"mb-6",children:e.jsx("p",{className:"text-sm text-red-600",children:h})}),!t&&!h&&e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),t&&e.jsxs("div",{className:l?"opacity-60 transition-opacity":"transition-opacity",children:[e.jsx(q,{initial:t.realtime}),e.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-3 xl:grid-cols-6",children:[e.jsx(y,{label:"Besucher",hint:"Aktive Nutzer im Zeitraum",value:t.kpis.activeUsers.current,previous:t.kpis.activeUsers.previous,format:b}),e.jsx(y,{label:"Neue Besucher",hint:"Zum ersten Mal auf der Seite",value:t.kpis.newUsers.current,previous:t.kpis.newUsers.previous,format:b}),e.jsx(y,{label:"Sitzungen",hint:"Besuche (ein Besucher kann mehrmals kommen)",value:t.kpis.sessions.current,previous:t.kpis.sessions.previous,format:b}),e.jsx(y,{label:"Seitenaufrufe",value:t.kpis.screenPageViews.current,previous:t.kpis.screenPageViews.previous,format:b}),e.jsx(y,{label:"Ø Besuchsdauer",value:t.kpis.averageSessionDuration.current,previous:t.kpis.averageSessionDuration.previous,format:X}),e.jsx(y,{label:"Interessierte Besuche",hint:"Anteil der Sitzungen über 10 Sekunden, mit 2+ Seiten oder einer Aktion (GA: Engagement-Rate)",value:t.kpis.engagementRate.current,previous:t.kpis.engagementRate.previous,format:U})]}),e.jsx(g,{title:"Verlauf",actions:e.jsx(_,{value:i,onChange:o,options:I,size:"sm"}),className:"mb-6",children:e.jsx(Q,{current:t.daily.current,previous:t.daily.previous,metric:i,days:t.days})}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsx(g,{title:"Woher die Besucher kommen",description:"Sitzungen nach Kanal",children:e.jsx(N,{rows:t.channels,label:c=>Z[c]||c})}),e.jsx(g,{title:"Quellen",description:"Sitzungen nach Website bzw. Suchmaschine",children:e.jsx(N,{rows:t.sources,label:c=>c==="(direct)"?"direkt":c})}),e.jsx(g,{title:"Meistbesuchte Seiten",description:"Seitenaufrufe",children:e.jsx(N,{rows:t.pages,mono:!0})}),e.jsx(g,{title:"Einstiegsseiten",description:"Auf welcher Seite ein Besuch beginnt (Sitzungen)",children:e.jsx(N,{rows:t.landing_pages,mono:!0,showTrend:!1})}),e.jsx(g,{title:"Was Besucher tun",description:"Anzahl im Zeitraum – die wichtigsten Aktionen auf der Website",children:e.jsx(N,{rows:M,label:c=>z[c],empty:"Noch keine Aktionen erfasst."})}),e.jsxs("div",{className:"grid gap-6",children:[e.jsx(g,{title:"Geräte",description:"Besucher",children:e.jsx(N,{rows:t.devices,label:c=>R[c]||c})}),e.jsx(g,{title:"Orte",description:"Besucher nach Stadt (ungefähr, aus der IP-Adresse)",children:e.jsx(N,{rows:t.cities,showTrend:!1,label:c=>c==="(not set)"?"unbekannt":c})})]})]}),e.jsxs("p",{className:"mt-6 text-xs text-neutral-400",children:["Gezählt werden nur Besucher, die im Cookie-Banner der Statistik zugestimmt haben. Stand"," ",new Date(t.generated_at).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})," Uhr, wird bis zu 5 Minuten zwischengespeichert. Noch mehr Auswertungen gibt es direkt in"," ",e.jsx("a",{href:"https://analytics.google.com/",target:"_blank",rel:"noreferrer",className:"text-brand-600 hover:underline dark:text-brand-400",children:"Google Analytics"}),"."]})]})]})}export{te as default}; diff --git a/hifi/assets/UpdateSettings-C1uyyWm_.js b/hifi/assets/UpdateSettings-DmGZxm7K.js similarity index 99% rename from hifi/assets/UpdateSettings-C1uyyWm_.js rename to hifi/assets/UpdateSettings-DmGZxm7K.js index abb4c78..2a6006e 100644 --- a/hifi/assets/UpdateSettings-C1uyyWm_.js +++ b/hifi/assets/UpdateSettings-DmGZxm7K.js @@ -1 +1 @@ -import{r,j as e,$ as M,c as i}from"./index-eQrgtQRM.js";const O={download:"Herunterladen",extract:"Entpacken",backup:"Sichern",apply:"Installieren"};function I(a){return a?a.slice(0,7):"–"}const V={5:"alle 5 Minuten",15:"alle 15 Minuten",60:"jede Stunde",360:"alle 6 Stunden",1440:"einmal am Tag"};function R(a){return a?new Date(a).toLocaleString("de-DE"):"–"}function G(){const[a,b]=r.useState(null),[l,S]=r.useState(null),[$,_]=r.useState(!0),[B,A]=r.useState(""),[h,E]=r.useState([]),[g,L]=r.useState(!1),[x,C]=r.useState(!1),[u,o]=r.useState({download:null,extract:null,backup:null,apply:null}),[k,m]=r.useState(""),[j,f]=r.useState(null),[U,D]=r.useState(!1),N=()=>{_(!0),A(""),Promise.all([i.get("/settings/update-status"),i.get("/settings/update-check")]).then(([t,n])=>{b(t),S(n)}).catch(t=>A(t.message)).finally(()=>_(!1)),i.get("/settings/update-branches").then(t=>E(t.branches||[])).catch(()=>E([]))},z=async t=>{L(!0),m(""),f(null);try{const n=await i.post("/settings/update-branch",{branch:t});S(n),b(s=>s&&{...s,branch:t})}catch(n){m(n.message)}finally{L(!1)}};r.useEffect(N,[]);const P=async t=>{const n=(a==null?void 0:a.auto)||{};D(!0),m("");try{const s=await i.post("/settings/update-auto",{enabled:n.enabled,interval:n.interval,...t});b(s)}catch(s){m(s.message)}finally{D(!1)}},F=async()=>{C(!0),m(""),f(null),o({download:"busy",extract:null,backup:null,apply:null});try{const n=(await i.post("/settings/update-download",{})).run_id;o(d=>({...d,download:"done",extract:"busy"})),await i.post("/settings/update-extract",{run_id:n}),o(d=>({...d,extract:"done",backup:"busy"})),await i.post("/settings/update-backup",{}),o(d=>({...d,backup:"done",apply:"busy"}));const s=await i.post("/settings/update-apply",{run_id:n});o(d=>({...d,apply:"done"})),f(s.log||[]),N()}catch(t){o(n=>{const s=Object.keys(n).find(d=>n[d]==="busy");return s?{...n,[s]:"error"}:n}),m(t.message)}finally{C(!1)}};if($)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const w=(a==null?void 0:a.capabilities)||{},v=w.zip?w.http_client?w.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.',y=l==null?void 0:l.update_available,c=(a==null?void 0:a.branch)||"main",p=a==null?void 0:a.deployed_branch,H=!!p&&p!==c,T=h.some(t=>t.name===c)?h:[{name:c},...h];return e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Updates aus Git"}),e.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. Entweder per Klick auf "Update installieren" oder automatisch, wenn du unten "Automatisch installieren" einschaltest.'}),B&&e.jsx("p",{className:"mb-3 text-sm text-red-600",children:B}),v?e.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:v}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"update-branch",className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-200",children:"Branch"}),e.jsx("select",{id:"update-branch",value:c,onChange:t=>z(t.target.value),disabled:x||g,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-100",children:T.map(t=>e.jsxs("option",{value:t.name,children:[t.name,t.message?` – ${t.message}`:""]},t.name))}),e.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Von diesem Branch wird installiert. Zum Zurückwechseln einfach wieder „main“ wählen und installieren – vorher wird wie immer eine Sicherung angelegt."})]}),e.jsxs("div",{className:"mb-4 grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"rounded-md bg-neutral-50 p-3 dark:bg-neutral-800/50",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:"Installiert"}),e.jsxs("p",{className:"font-mono text-neutral-800 dark:text-neutral-100",children:[I(a==null?void 0:a.deployed_sha),p&&e.jsxs("span",{className:"ml-2 font-sans text-xs text-neutral-400",children:["(",p,")"]})]}),e.jsx("p",{className:"text-xs text-neutral-400",children:R(a==null?void 0:a.deployed_at)})]}),e.jsxs("div",{className:"rounded-md bg-neutral-50 p-3 dark:bg-neutral-800/50",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:"Neuester Stand"}),e.jsxs("p",{className:"font-mono text-neutral-800 dark:text-neutral-100",children:[I(l==null?void 0:l.latest_sha),e.jsxs("span",{className:"ml-2 font-sans text-xs text-neutral-400",children:["(",c,")"]})]}),(l==null?void 0:l.latest_message)&&e.jsx("p",{className:"truncate text-xs text-neutral-400",title:l.latest_message,children:l.latest_message})]})]}),H&&y?e.jsxs("p",{className:"mb-3 text-sm font-medium text-brand-600 dark:text-brand-400",children:["Installiert ist „",p,"“ – mit „Update installieren“ wechselst du auf „",c,"“."]}):y?e.jsx("p",{className:"mb-3 text-sm font-medium text-brand-600 dark:text-brand-400",children:"Update verfügbar."}):e.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Bereits auf dem neuesten Stand."}),e.jsxs("div",{className:"mb-3 flex gap-2",children:[e.jsx("button",{type:"button",onClick:N,disabled:x||g,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"}),e.jsx("button",{type:"button",onClick:F,disabled:x||g||!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:x?"Installiere…":H?`Auf „${c}“ wechseln`:"Update installieren"})]}),(x||k)&&e.jsx("ul",{className:"mb-3 space-y-1 text-sm",children:Object.entries(O).map(([t,n])=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:u[t]==="done"?"text-green-600 dark:text-green-400":u[t]==="error"?"text-red-600":u[t]==="busy"?"text-brand-600 dark:text-brand-400":"text-neutral-300 dark:text-neutral-600",children:u[t]==="done"?"✓":u[t]==="error"?"✕":u[t]==="busy"?"…":"○"}),n]},t))}),k&&e.jsx("p",{className:"text-sm text-red-600",children:k}),j&&e.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:[e.jsx("p",{className:"mb-1 font-semibold",children:"Update installiert."}),j.length>0&&e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer text-xs",children:"Details anzeigen"}),e.jsx("ul",{className:"mt-2 list-disc pl-5 text-xs",children:j.map((t,n)=>e.jsx("li",{children:t},n))})]})]})]})]}),!v&&(a==null?void 0:a.auto)&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Automatisch installieren"}),e.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[e.jsx("input",{type:"checkbox",checked:!!a.auto.enabled,onChange:t=>P({enabled:t.target.checked}),disabled:U,className:"peer sr-only"}),e.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),e.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),e.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Neue Stände vom Branch „",c,"“ werden ohne Klick installiert – mit derselben Sicherung vorher wie beim manuellen Update. Gilt nur für diesen Server."]}),e.jsx("label",{htmlFor:"update-interval",className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-200",children:"Nach Updates schauen"}),e.jsx("select",{id:"update-interval",value:a.auto.interval,onChange:t=>P({interval:Number(t.target.value)}),disabled:U,className:"mb-4 w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-100",children:(a.auto.intervals||[]).map(t=>e.jsx("option",{value:t,children:V[t]||`alle ${t} Minuten`},t))}),a.auto.last_result&&e.jsxs("div",{className:`mb-4 rounded-md p-3 text-sm ${a.auto.last_result.ok?"bg-neutral-50 text-neutral-700 dark:bg-neutral-800/50 dark:text-neutral-200":"bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-300"}`,children:[e.jsxs("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:["Letzter automatischer Lauf · ",R(a.auto.last_result.at)," · ",a.auto.last_result.trigger]}),e.jsx("p",{children:a.auto.last_result.message})]}),a.auto.enabled&&e.jsxs("details",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:[e.jsx("summary",{className:"cursor-pointer",children:a.auto.background_supported?"Optional: Cronjob beim Hoster einrichten":"Wichtig: Cronjob beim Hoster einrichten"}),e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsx("p",{children:a.auto.background_supported?"Die Prüfung läuft nebenbei, sobald jemand die Seite aufruft. Soll sie auch ohne Besucher pünktlich laufen, kannst du beim Hoster einen Cronjob mit dieser Adresse anlegen:":"Dieser Server kann Updates nicht nebenbei bei Seitenaufrufen einspielen. Lege beim Hoster einen Cronjob an, der diese Adresse aufruft (z. B. alle 15 Minuten):"}),e.jsx("code",{className:"block break-all rounded bg-neutral-100 p-2 text-xs dark:bg-neutral-800",children:`${window.location.origin}${M}/update-cron?token=${a.auto.cron_token}`}),e.jsx("p",{className:"text-xs",children:"Die Adresse enthält einen geheimen Schlüssel – nicht weitergeben."})]})]})]})]})}export{G as default}; +import{r,j as e,$ as M,c as i}from"./index-CPMnKQBc.js";const O={download:"Herunterladen",extract:"Entpacken",backup:"Sichern",apply:"Installieren"};function I(a){return a?a.slice(0,7):"–"}const V={5:"alle 5 Minuten",15:"alle 15 Minuten",60:"jede Stunde",360:"alle 6 Stunden",1440:"einmal am Tag"};function R(a){return a?new Date(a).toLocaleString("de-DE"):"–"}function G(){const[a,b]=r.useState(null),[l,S]=r.useState(null),[$,_]=r.useState(!0),[B,A]=r.useState(""),[h,E]=r.useState([]),[g,L]=r.useState(!1),[x,C]=r.useState(!1),[u,o]=r.useState({download:null,extract:null,backup:null,apply:null}),[k,m]=r.useState(""),[j,f]=r.useState(null),[U,D]=r.useState(!1),N=()=>{_(!0),A(""),Promise.all([i.get("/settings/update-status"),i.get("/settings/update-check")]).then(([t,n])=>{b(t),S(n)}).catch(t=>A(t.message)).finally(()=>_(!1)),i.get("/settings/update-branches").then(t=>E(t.branches||[])).catch(()=>E([]))},z=async t=>{L(!0),m(""),f(null);try{const n=await i.post("/settings/update-branch",{branch:t});S(n),b(s=>s&&{...s,branch:t})}catch(n){m(n.message)}finally{L(!1)}};r.useEffect(N,[]);const P=async t=>{const n=(a==null?void 0:a.auto)||{};D(!0),m("");try{const s=await i.post("/settings/update-auto",{enabled:n.enabled,interval:n.interval,...t});b(s)}catch(s){m(s.message)}finally{D(!1)}},F=async()=>{C(!0),m(""),f(null),o({download:"busy",extract:null,backup:null,apply:null});try{const n=(await i.post("/settings/update-download",{})).run_id;o(d=>({...d,download:"done",extract:"busy"})),await i.post("/settings/update-extract",{run_id:n}),o(d=>({...d,extract:"done",backup:"busy"})),await i.post("/settings/update-backup",{}),o(d=>({...d,backup:"done",apply:"busy"}));const s=await i.post("/settings/update-apply",{run_id:n});o(d=>({...d,apply:"done"})),f(s.log||[]),N()}catch(t){o(n=>{const s=Object.keys(n).find(d=>n[d]==="busy");return s?{...n,[s]:"error"}:n}),m(t.message)}finally{C(!1)}};if($)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const w=(a==null?void 0:a.capabilities)||{},v=w.zip?w.http_client?w.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.',y=l==null?void 0:l.update_available,c=(a==null?void 0:a.branch)||"main",p=a==null?void 0:a.deployed_branch,H=!!p&&p!==c,T=h.some(t=>t.name===c)?h:[{name:c},...h];return e.jsxs("div",{className:"max-w-2xl space-y-6",children:[e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Updates aus Git"}),e.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. Entweder per Klick auf "Update installieren" oder automatisch, wenn du unten "Automatisch installieren" einschaltest.'}),B&&e.jsx("p",{className:"mb-3 text-sm text-red-600",children:B}),v?e.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:v}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"update-branch",className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-200",children:"Branch"}),e.jsx("select",{id:"update-branch",value:c,onChange:t=>z(t.target.value),disabled:x||g,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-100",children:T.map(t=>e.jsxs("option",{value:t.name,children:[t.name,t.message?` – ${t.message}`:""]},t.name))}),e.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Von diesem Branch wird installiert. Zum Zurückwechseln einfach wieder „main“ wählen und installieren – vorher wird wie immer eine Sicherung angelegt."})]}),e.jsxs("div",{className:"mb-4 grid grid-cols-2 gap-3 text-sm",children:[e.jsxs("div",{className:"rounded-md bg-neutral-50 p-3 dark:bg-neutral-800/50",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:"Installiert"}),e.jsxs("p",{className:"font-mono text-neutral-800 dark:text-neutral-100",children:[I(a==null?void 0:a.deployed_sha),p&&e.jsxs("span",{className:"ml-2 font-sans text-xs text-neutral-400",children:["(",p,")"]})]}),e.jsx("p",{className:"text-xs text-neutral-400",children:R(a==null?void 0:a.deployed_at)})]}),e.jsxs("div",{className:"rounded-md bg-neutral-50 p-3 dark:bg-neutral-800/50",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:"Neuester Stand"}),e.jsxs("p",{className:"font-mono text-neutral-800 dark:text-neutral-100",children:[I(l==null?void 0:l.latest_sha),e.jsxs("span",{className:"ml-2 font-sans text-xs text-neutral-400",children:["(",c,")"]})]}),(l==null?void 0:l.latest_message)&&e.jsx("p",{className:"truncate text-xs text-neutral-400",title:l.latest_message,children:l.latest_message})]})]}),H&&y?e.jsxs("p",{className:"mb-3 text-sm font-medium text-brand-600 dark:text-brand-400",children:["Installiert ist „",p,"“ – mit „Update installieren“ wechselst du auf „",c,"“."]}):y?e.jsx("p",{className:"mb-3 text-sm font-medium text-brand-600 dark:text-brand-400",children:"Update verfügbar."}):e.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Bereits auf dem neuesten Stand."}),e.jsxs("div",{className:"mb-3 flex gap-2",children:[e.jsx("button",{type:"button",onClick:N,disabled:x||g,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"}),e.jsx("button",{type:"button",onClick:F,disabled:x||g||!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:x?"Installiere…":H?`Auf „${c}“ wechseln`:"Update installieren"})]}),(x||k)&&e.jsx("ul",{className:"mb-3 space-y-1 text-sm",children:Object.entries(O).map(([t,n])=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:u[t]==="done"?"text-green-600 dark:text-green-400":u[t]==="error"?"text-red-600":u[t]==="busy"?"text-brand-600 dark:text-brand-400":"text-neutral-300 dark:text-neutral-600",children:u[t]==="done"?"✓":u[t]==="error"?"✕":u[t]==="busy"?"…":"○"}),n]},t))}),k&&e.jsx("p",{className:"text-sm text-red-600",children:k}),j&&e.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:[e.jsx("p",{className:"mb-1 font-semibold",children:"Update installiert."}),j.length>0&&e.jsxs("details",{children:[e.jsx("summary",{className:"cursor-pointer text-xs",children:"Details anzeigen"}),e.jsx("ul",{className:"mt-2 list-disc pl-5 text-xs",children:j.map((t,n)=>e.jsx("li",{children:t},n))})]})]})]})]}),!v&&(a==null?void 0:a.auto)&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Automatisch installieren"}),e.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[e.jsx("input",{type:"checkbox",checked:!!a.auto.enabled,onChange:t=>P({enabled:t.target.checked}),disabled:U,className:"peer sr-only"}),e.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),e.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),e.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Neue Stände vom Branch „",c,"“ werden ohne Klick installiert – mit derselben Sicherung vorher wie beim manuellen Update. Gilt nur für diesen Server."]}),e.jsx("label",{htmlFor:"update-interval",className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-200",children:"Nach Updates schauen"}),e.jsx("select",{id:"update-interval",value:a.auto.interval,onChange:t=>P({interval:Number(t.target.value)}),disabled:U,className:"mb-4 w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm disabled:opacity-50 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-100",children:(a.auto.intervals||[]).map(t=>e.jsx("option",{value:t,children:V[t]||`alle ${t} Minuten`},t))}),a.auto.last_result&&e.jsxs("div",{className:`mb-4 rounded-md p-3 text-sm ${a.auto.last_result.ok?"bg-neutral-50 text-neutral-700 dark:bg-neutral-800/50 dark:text-neutral-200":"bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-300"}`,children:[e.jsxs("p",{className:"text-xs uppercase tracking-wide text-neutral-400",children:["Letzter automatischer Lauf · ",R(a.auto.last_result.at)," · ",a.auto.last_result.trigger]}),e.jsx("p",{children:a.auto.last_result.message})]}),a.auto.enabled&&e.jsxs("details",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:[e.jsx("summary",{className:"cursor-pointer",children:a.auto.background_supported?"Optional: Cronjob beim Hoster einrichten":"Wichtig: Cronjob beim Hoster einrichten"}),e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsx("p",{children:a.auto.background_supported?"Die Prüfung läuft nebenbei, sobald jemand die Seite aufruft. Soll sie auch ohne Besucher pünktlich laufen, kannst du beim Hoster einen Cronjob mit dieser Adresse anlegen:":"Dieser Server kann Updates nicht nebenbei bei Seitenaufrufen einspielen. Lege beim Hoster einen Cronjob an, der diese Adresse aufruft (z. B. alle 15 Minuten):"}),e.jsx("code",{className:"block break-all rounded bg-neutral-100 p-2 text-xs dark:bg-neutral-800",children:`${window.location.origin}${M}/update-cron?token=${a.auto.cron_token}`}),e.jsx("p",{className:"text-xs",children:"Die Adresse enthält einen geheimen Schlüssel – nicht weitergeben."})]})]})]})]})}export{G as default}; diff --git a/hifi/assets/VehicleCatalogDialog-wGVVg0Ns.js b/hifi/assets/VehicleCatalogDialog-BmzJprBQ.js similarity index 99% rename from hifi/assets/VehicleCatalogDialog-wGVVg0Ns.js rename to hifi/assets/VehicleCatalogDialog-BmzJprBQ.js index 214bcc8..c1e6d07 100644 --- a/hifi/assets/VehicleCatalogDialog-wGVVg0Ns.js +++ b/hifi/assets/VehicleCatalogDialog-BmzJprBQ.js @@ -1 +1 @@ -import{v as ae,r as c,k as se,D as le,c as w,j as t,X as ne,G as re,H as de,J as ce}from"./index-eQrgtQRM.js";const P=x=>x.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),o=(x,m,u)=>`${x} ${x===1?m:u}`;function oe({open:x,onClose:m,onImported:u}){const f=ae(),z=c.useRef(null),[i,E]=c.useState(null),[B,q]=c.useState(null),[g,A]=c.useState(null),[j,D]=c.useState(""),[p,V]=c.useState(""),[F,_]=c.useState(()=>new Set),[h,k]=c.useState(()=>new Map),[v,L]=c.useState(!1),[O,N]=c.useState(""),{hasPermission:K}=se(),M=K("packages.manage"),[S,R]=c.useState([]),[$,G]=c.useState(!1),[y,T]=c.useState(""),[U,H]=c.useState(!0);le(z,x,m),c.useEffect(()=>{x&&(E(null),D(""),k(new Map),_(new Set),V(""),N(""),w.get("/vehicle-catalog").then(e=>{E(e.brands),q(e.brand_image),A(e.unstyled)}).catch(e=>D(e.message)),M&&w.get("/models").then(e=>{R(e);const s=e.find(a=>a.brand_slug==="volkswagen"&&a.slug==="golf-7");T(a=>{var l;return a||String((s==null?void 0:s.id)??((l=e[0])==null?void 0:l.id)??"")})}).catch(()=>R([])))},[x,M]);const C=c.useMemo(()=>{if(!i)return[];const e=P(p.trim());return i.map(s=>{const a=s.models.filter(r=>!r.exists);if(!e||P(s.brand).includes(e))return{...s,newModels:a,visibleModels:s.models};const l=s.models.filter(r=>P(`${s.brand} ${r.name}`).includes(e));return l.length?{...s,newModels:a,visibleModels:l}:null}).filter(Boolean)},[i,p]),b=c.useMemo(()=>{let e=0,s=0;return h.forEach((a,l)=>{e+=a.size,a.size&&(i!=null&&i.find(r=>r.brand===l&&!r.exists))&&(s+=1)}),{models:e,newBrands:s}},[h,i]),Q=c.useMemo(()=>(i||[]).reduce((e,s)=>e+s.models.filter(a=>!a.exists).length,0),[i]),J=(e,s)=>{k(a=>{const l=new Map(a);return s.size?l.set(e,s):l.delete(e),l})},X=e=>{const s=h.get(e.brand)||new Set,a=e.visibleModels.filter(d=>!d.exists).map(d=>d.name),l=a.every(d=>s.has(d)),r=new Set(s);a.forEach(d=>l?r.delete(d):r.add(d)),J(e.brand,r)},Y=(e,s)=>{const a=new Set(h.get(e)||[]);a.has(s)?a.delete(s):a.add(s),J(e,a)},Z=e=>{_(s=>{const a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a})},I=()=>{const e=new Map(h);C.forEach(s=>{const a=new Set(e.get(s.brand)||[]);s.visibleModels.filter(l=>!l.exists).forEach(l=>a.add(l.name)),a.size&&e.set(s.brand,a)}),k(e)},ee=async()=>{L(!0);const e=[...h].map(([r,d])=>({brand:r,models:[...d]})),s=$&&y?{packages_from:Number(y),include_upgrades:U}:{},a={brands:0,models:0,skipped:0,packages:0};let l="";try{for(const[r,d]of e.entries()){l=d.brand,N(`${d.brand} (${r+1} von ${e.length})`);const n=await w.post("/vehicle-catalog/import",{items:[d],...s});Object.keys(a).forEach(W=>{a[W]+=n[W]||0})}f.success(`${o(a.models,"Modell","Modelle")}${a.brands?` und ${o(a.brands,"Marke","Marken")}`:""} angelegt`+(a.packages?`, dazu ${o(a.packages,"Paket","Pakete")}.`:".")+(a.skipped?` ${o(a.skipped,"Modell war","Modelle waren")} schon vorhanden.`:"")),u==null||u(),m()}catch(r){f.error(`Laden fehlgeschlagen bei ${l}: ${r.message}`),a.models&&(u==null||u())}finally{L(!1),N("")}},te=async()=>{try{const e=await w.post("/vehicle-catalog/align-styles",{});f.success(`Schrift angeglichen: ${o(e.brands,"Marke","Marken")}, ${o(e.models,"Modell","Modelle")}.`),A({brands:0,models:0}),u==null||u()}catch(e){f.error(`Angleichen fehlgeschlagen: ${e.message}`)}};return x?t.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/50 p-4",onMouseDown:e=>e.target===e.currentTarget&&m(),children:t.jsxs("div",{ref:z,role:"dialog","aria-modal":"true","aria-labelledby":"vehicle-catalog-title",className:"flex max-h-[90vh] w-full max-w-2xl flex-col rounded-xl bg-white shadow-xl dark:bg-neutral-900",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-neutral-200 p-5 dark:border-neutral-800",children:[t.jsxs("div",{children:[t.jsx("h2",{id:"vehicle-catalog-title",className:"text-lg font-bold text-neutral-900 dark:text-white",children:"Fahrzeuge aus Vorlage laden"}),t.jsx("p",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:"In Europa verbreitete Marken und Modellgenerationen. Vorhandenes bleibt unverändert und wird nicht doppelt angelegt."})]}),t.jsx("button",{type:"button",onClick:m,"aria-label":"Schließen",className:"rounded-md p-1 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200",children:t.jsx(ne,{className:"h-5 w-5"})})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-neutral-200 px-5 py-3 dark:border-neutral-800",children:[t.jsxs("div",{className:"relative min-w-[12rem] flex-1",children:[t.jsx(re,{className:"pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),t.jsx("input",{value:p,onChange:e=>V(e.target.value),placeholder:"Marke oder Modell suchen…",className:"w-full rounded-md border border-neutral-300 bg-white py-1.5 pl-8 pr-3 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),t.jsx("button",{type:"button",onClick:I,className:"text-sm text-brand-600 hover:underline",children:p.trim()?"Treffer auswählen":"Alle auswählen"}),h.size>0&&t.jsx("button",{type:"button",onClick:()=>k(new Map),className:"text-sm text-neutral-500 hover:underline",children:"Auswahl leeren"})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2",children:[j&&t.jsx("p",{className:"px-3 py-4 text-sm text-red-600",children:j}),!i&&!j&&t.jsx("p",{className:"px-3 py-4 text-sm text-neutral-400",children:"Lade Vorlage…"}),i&&C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-neutral-400",children:"Keine Treffer."}),C.map(e=>{const s=h.get(e.brand)||new Set,a=e.visibleModels.filter(n=>!n.exists),l=a.length>0&&a.every(n=>s.has(n.name)),r=!l&&a.some(n=>s.has(n.name)),d=F.has(e.brand)||p.trim()!=="";return t.jsxs("div",{className:"rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-neutral-50 dark:hover:bg-neutral-800/60",children:[t.jsx("button",{type:"button",onClick:()=>Z(e.brand),"aria-expanded":d,"aria-label":`${e.brand} aufklappen`,className:"rounded p-0.5 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200",children:d?t.jsx(de,{className:"h-4 w-4"}):t.jsx(ce,{className:"h-4 w-4"})}),t.jsxs("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l,disabled:a.length===0,ref:n=>{n&&(n.indeterminate=r)},onChange:()=>X(e),className:"h-4 w-4 accent-brand-500"}),t.jsx("span",{className:"truncate font-medium text-neutral-800 dark:text-neutral-100",children:e.brand}),e.exists&&t.jsx("span",{className:"rounded bg-neutral-100 px-1.5 text-xs text-neutral-500 dark:bg-neutral-800",children:"vorhanden"})]}),t.jsxs("span",{className:"shrink-0 text-xs text-neutral-400",children:[s.size>0?`${s.size} gewählt · `:"",e.newModels.length===e.models.length?o(e.models.length,"Modell","Modelle"):`${e.newModels.length} von ${e.models.length} neu`]})]}),d&&t.jsx("ul",{className:"mb-2 ml-9 grid gap-x-4 sm:grid-cols-2",children:e.visibleModels.map(n=>t.jsx("li",{children:t.jsxs("label",{className:`flex items-center gap-2 py-0.5 text-sm ${n.exists?"text-neutral-400":"cursor-pointer text-neutral-700 dark:text-neutral-200"}`,children:[t.jsx("input",{type:"checkbox",checked:n.exists||s.has(n.name),disabled:n.exists,onChange:()=>Y(e.brand,n.name),className:"h-3.5 w-3.5 accent-brand-500"}),t.jsx("span",{className:"truncate",children:n.name}),t.jsx("span",{className:"ml-auto shrink-0 text-xs text-neutral-400",children:n.exists?"vorhanden":n.years})]})},n.name))})]},e.brand)})]}),g&&g.brands+g.models>0&&t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-amber-200 bg-amber-50 px-5 py-2 text-xs text-amber-800 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-300",children:[t.jsxs("span",{className:"flex-1",children:[[g.brands&&o(g.brands,"Marke","Marken"),g.models&&o(g.models,"Modell","Modelle")].filter(Boolean).join(" und ")," ","haben noch nicht die Schrift der übrigen."]}),t.jsx("button",{type:"button",onClick:te,className:"font-semibold underline hover:no-underline",children:"Jetzt angleichen"})]}),B&&b.newBrands>0&&t.jsxs("div",{className:"flex items-center gap-3 border-t border-neutral-200 px-5 py-2 text-xs text-neutral-500 dark:border-neutral-800 dark:text-neutral-400",children:[t.jsx("img",{src:B,alt:"",className:"h-8 w-8 rounded object-cover"}),"Neue Marken bekommen das Standardbild deiner übrigen Marken."]}),M&&t.jsxs("div",{className:"space-y-2 border-t border-neutral-200 px-5 py-3 text-sm dark:border-neutral-800",children:[t.jsxs("label",{className:"flex cursor-pointer items-center gap-2 font-medium text-neutral-800 dark:text-neutral-100",children:[t.jsx("input",{type:"checkbox",checked:$,disabled:S.length===0,onChange:e=>G(e.target.checked),className:"h-4 w-4 accent-brand-500"}),"Standard-Pakete direkt mit anlegen"]}),S.length===0&&t.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Dafür braucht es ein vorhandenes Modell mit fertigen Paketen als Vorlage."}),$&&t.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 pl-6",children:[t.jsxs("label",{className:"flex min-w-0 items-center gap-2 text-neutral-600 dark:text-neutral-300",children:["Pakete von",t.jsx("select",{value:y,onChange:e=>T(e.target.value),className:"min-w-0 max-w-[14rem] rounded-md border border-neutral-300 bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:S.map(e=>t.jsxs("option",{value:e.id,children:[e.brand_name," ",e.name]},e.id))})]}),t.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-neutral-600 dark:text-neutral-300",children:[t.jsx("input",{type:"checkbox",checked:U,onChange:e=>H(e.target.checked),className:"h-3.5 w-3.5 accent-brand-500"}),"inkl. Upgrades"]}),t.jsx("p",{className:"w-full text-xs text-neutral-500 dark:text-neutral-400",children:"Jedes neu angelegte Modell bekommt eine Kopie dieser Pakete samt Produkten und Preisaufschlag."})]})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-neutral-200 p-4 dark:border-neutral-800",children:[t.jsx("span",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:v&&O?`Lege an: ${O}`:b.models?`${o(b.models,"Modell","Modelle")}${b.newBrands?`, ${o(b.newBrands,"neue Marke","neue Marken")}`:""} ausgewählt`:i?`${i.length} Marken, ${o(Q,"Modell","Modelle")} noch nicht angelegt`:""}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{type:"button",onClick:m,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"}),t.jsx("button",{type:"button",onClick:ee,disabled:v||b.models===0,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:v?"Wird angelegt…":"Auswahl anlegen"})]})]})]})}):null}export{oe as V}; +import{v as ae,r as c,k as se,D as le,c as w,j as t,X as ne,G as re,H as de,J as ce}from"./index-CPMnKQBc.js";const P=x=>x.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),o=(x,m,u)=>`${x} ${x===1?m:u}`;function oe({open:x,onClose:m,onImported:u}){const f=ae(),z=c.useRef(null),[i,E]=c.useState(null),[B,q]=c.useState(null),[g,A]=c.useState(null),[j,D]=c.useState(""),[p,V]=c.useState(""),[F,_]=c.useState(()=>new Set),[h,k]=c.useState(()=>new Map),[v,L]=c.useState(!1),[O,N]=c.useState(""),{hasPermission:K}=se(),M=K("packages.manage"),[S,R]=c.useState([]),[$,G]=c.useState(!1),[y,T]=c.useState(""),[U,H]=c.useState(!0);le(z,x,m),c.useEffect(()=>{x&&(E(null),D(""),k(new Map),_(new Set),V(""),N(""),w.get("/vehicle-catalog").then(e=>{E(e.brands),q(e.brand_image),A(e.unstyled)}).catch(e=>D(e.message)),M&&w.get("/models").then(e=>{R(e);const s=e.find(a=>a.brand_slug==="volkswagen"&&a.slug==="golf-7");T(a=>{var l;return a||String((s==null?void 0:s.id)??((l=e[0])==null?void 0:l.id)??"")})}).catch(()=>R([])))},[x,M]);const C=c.useMemo(()=>{if(!i)return[];const e=P(p.trim());return i.map(s=>{const a=s.models.filter(r=>!r.exists);if(!e||P(s.brand).includes(e))return{...s,newModels:a,visibleModels:s.models};const l=s.models.filter(r=>P(`${s.brand} ${r.name}`).includes(e));return l.length?{...s,newModels:a,visibleModels:l}:null}).filter(Boolean)},[i,p]),b=c.useMemo(()=>{let e=0,s=0;return h.forEach((a,l)=>{e+=a.size,a.size&&(i!=null&&i.find(r=>r.brand===l&&!r.exists))&&(s+=1)}),{models:e,newBrands:s}},[h,i]),Q=c.useMemo(()=>(i||[]).reduce((e,s)=>e+s.models.filter(a=>!a.exists).length,0),[i]),J=(e,s)=>{k(a=>{const l=new Map(a);return s.size?l.set(e,s):l.delete(e),l})},X=e=>{const s=h.get(e.brand)||new Set,a=e.visibleModels.filter(d=>!d.exists).map(d=>d.name),l=a.every(d=>s.has(d)),r=new Set(s);a.forEach(d=>l?r.delete(d):r.add(d)),J(e.brand,r)},Y=(e,s)=>{const a=new Set(h.get(e)||[]);a.has(s)?a.delete(s):a.add(s),J(e,a)},Z=e=>{_(s=>{const a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a})},I=()=>{const e=new Map(h);C.forEach(s=>{const a=new Set(e.get(s.brand)||[]);s.visibleModels.filter(l=>!l.exists).forEach(l=>a.add(l.name)),a.size&&e.set(s.brand,a)}),k(e)},ee=async()=>{L(!0);const e=[...h].map(([r,d])=>({brand:r,models:[...d]})),s=$&&y?{packages_from:Number(y),include_upgrades:U}:{},a={brands:0,models:0,skipped:0,packages:0};let l="";try{for(const[r,d]of e.entries()){l=d.brand,N(`${d.brand} (${r+1} von ${e.length})`);const n=await w.post("/vehicle-catalog/import",{items:[d],...s});Object.keys(a).forEach(W=>{a[W]+=n[W]||0})}f.success(`${o(a.models,"Modell","Modelle")}${a.brands?` und ${o(a.brands,"Marke","Marken")}`:""} angelegt`+(a.packages?`, dazu ${o(a.packages,"Paket","Pakete")}.`:".")+(a.skipped?` ${o(a.skipped,"Modell war","Modelle waren")} schon vorhanden.`:"")),u==null||u(),m()}catch(r){f.error(`Laden fehlgeschlagen bei ${l}: ${r.message}`),a.models&&(u==null||u())}finally{L(!1),N("")}},te=async()=>{try{const e=await w.post("/vehicle-catalog/align-styles",{});f.success(`Schrift angeglichen: ${o(e.brands,"Marke","Marken")}, ${o(e.models,"Modell","Modelle")}.`),A({brands:0,models:0}),u==null||u()}catch(e){f.error(`Angleichen fehlgeschlagen: ${e.message}`)}};return x?t.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/50 p-4",onMouseDown:e=>e.target===e.currentTarget&&m(),children:t.jsxs("div",{ref:z,role:"dialog","aria-modal":"true","aria-labelledby":"vehicle-catalog-title",className:"flex max-h-[90vh] w-full max-w-2xl flex-col rounded-xl bg-white shadow-xl dark:bg-neutral-900",children:[t.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-neutral-200 p-5 dark:border-neutral-800",children:[t.jsxs("div",{children:[t.jsx("h2",{id:"vehicle-catalog-title",className:"text-lg font-bold text-neutral-900 dark:text-white",children:"Fahrzeuge aus Vorlage laden"}),t.jsx("p",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:"In Europa verbreitete Marken und Modellgenerationen. Vorhandenes bleibt unverändert und wird nicht doppelt angelegt."})]}),t.jsx("button",{type:"button",onClick:m,"aria-label":"Schließen",className:"rounded-md p-1 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200",children:t.jsx(ne,{className:"h-5 w-5"})})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-neutral-200 px-5 py-3 dark:border-neutral-800",children:[t.jsxs("div",{className:"relative min-w-[12rem] flex-1",children:[t.jsx(re,{className:"pointer-events-none absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),t.jsx("input",{value:p,onChange:e=>V(e.target.value),placeholder:"Marke oder Modell suchen…",className:"w-full rounded-md border border-neutral-300 bg-white py-1.5 pl-8 pr-3 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),t.jsx("button",{type:"button",onClick:I,className:"text-sm text-brand-600 hover:underline",children:p.trim()?"Treffer auswählen":"Alle auswählen"}),h.size>0&&t.jsx("button",{type:"button",onClick:()=>k(new Map),className:"text-sm text-neutral-500 hover:underline",children:"Auswahl leeren"})]}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 py-2",children:[j&&t.jsx("p",{className:"px-3 py-4 text-sm text-red-600",children:j}),!i&&!j&&t.jsx("p",{className:"px-3 py-4 text-sm text-neutral-400",children:"Lade Vorlage…"}),i&&C.length===0&&t.jsx("p",{className:"px-3 py-4 text-sm text-neutral-400",children:"Keine Treffer."}),C.map(e=>{const s=h.get(e.brand)||new Set,a=e.visibleModels.filter(n=>!n.exists),l=a.length>0&&a.every(n=>s.has(n.name)),r=!l&&a.some(n=>s.has(n.name)),d=F.has(e.brand)||p.trim()!=="";return t.jsxs("div",{className:"rounded-lg",children:[t.jsxs("div",{className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-neutral-50 dark:hover:bg-neutral-800/60",children:[t.jsx("button",{type:"button",onClick:()=>Z(e.brand),"aria-expanded":d,"aria-label":`${e.brand} aufklappen`,className:"rounded p-0.5 text-neutral-400 hover:text-neutral-700 dark:hover:text-neutral-200",children:d?t.jsx(de,{className:"h-4 w-4"}):t.jsx(ce,{className:"h-4 w-4"})}),t.jsxs("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-2",children:[t.jsx("input",{type:"checkbox",checked:l,disabled:a.length===0,ref:n=>{n&&(n.indeterminate=r)},onChange:()=>X(e),className:"h-4 w-4 accent-brand-500"}),t.jsx("span",{className:"truncate font-medium text-neutral-800 dark:text-neutral-100",children:e.brand}),e.exists&&t.jsx("span",{className:"rounded bg-neutral-100 px-1.5 text-xs text-neutral-500 dark:bg-neutral-800",children:"vorhanden"})]}),t.jsxs("span",{className:"shrink-0 text-xs text-neutral-400",children:[s.size>0?`${s.size} gewählt · `:"",e.newModels.length===e.models.length?o(e.models.length,"Modell","Modelle"):`${e.newModels.length} von ${e.models.length} neu`]})]}),d&&t.jsx("ul",{className:"mb-2 ml-9 grid gap-x-4 sm:grid-cols-2",children:e.visibleModels.map(n=>t.jsx("li",{children:t.jsxs("label",{className:`flex items-center gap-2 py-0.5 text-sm ${n.exists?"text-neutral-400":"cursor-pointer text-neutral-700 dark:text-neutral-200"}`,children:[t.jsx("input",{type:"checkbox",checked:n.exists||s.has(n.name),disabled:n.exists,onChange:()=>Y(e.brand,n.name),className:"h-3.5 w-3.5 accent-brand-500"}),t.jsx("span",{className:"truncate",children:n.name}),t.jsx("span",{className:"ml-auto shrink-0 text-xs text-neutral-400",children:n.exists?"vorhanden":n.years})]})},n.name))})]},e.brand)})]}),g&&g.brands+g.models>0&&t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-amber-200 bg-amber-50 px-5 py-2 text-xs text-amber-800 dark:border-amber-900/50 dark:bg-amber-950/30 dark:text-amber-300",children:[t.jsxs("span",{className:"flex-1",children:[[g.brands&&o(g.brands,"Marke","Marken"),g.models&&o(g.models,"Modell","Modelle")].filter(Boolean).join(" und ")," ","haben noch nicht die Schrift der übrigen."]}),t.jsx("button",{type:"button",onClick:te,className:"font-semibold underline hover:no-underline",children:"Jetzt angleichen"})]}),B&&b.newBrands>0&&t.jsxs("div",{className:"flex items-center gap-3 border-t border-neutral-200 px-5 py-2 text-xs text-neutral-500 dark:border-neutral-800 dark:text-neutral-400",children:[t.jsx("img",{src:B,alt:"",className:"h-8 w-8 rounded object-cover"}),"Neue Marken bekommen das Standardbild deiner übrigen Marken."]}),M&&t.jsxs("div",{className:"space-y-2 border-t border-neutral-200 px-5 py-3 text-sm dark:border-neutral-800",children:[t.jsxs("label",{className:"flex cursor-pointer items-center gap-2 font-medium text-neutral-800 dark:text-neutral-100",children:[t.jsx("input",{type:"checkbox",checked:$,disabled:S.length===0,onChange:e=>G(e.target.checked),className:"h-4 w-4 accent-brand-500"}),"Standard-Pakete direkt mit anlegen"]}),S.length===0&&t.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Dafür braucht es ein vorhandenes Modell mit fertigen Paketen als Vorlage."}),$&&t.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 pl-6",children:[t.jsxs("label",{className:"flex min-w-0 items-center gap-2 text-neutral-600 dark:text-neutral-300",children:["Pakete von",t.jsx("select",{value:y,onChange:e=>T(e.target.value),className:"min-w-0 max-w-[14rem] rounded-md border border-neutral-300 bg-white px-2 py-1 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:S.map(e=>t.jsxs("option",{value:e.id,children:[e.brand_name," ",e.name]},e.id))})]}),t.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-neutral-600 dark:text-neutral-300",children:[t.jsx("input",{type:"checkbox",checked:U,onChange:e=>H(e.target.checked),className:"h-3.5 w-3.5 accent-brand-500"}),"inkl. Upgrades"]}),t.jsx("p",{className:"w-full text-xs text-neutral-500 dark:text-neutral-400",children:"Jedes neu angelegte Modell bekommt eine Kopie dieser Pakete samt Produkten und Preisaufschlag."})]})]}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-neutral-200 p-4 dark:border-neutral-800",children:[t.jsx("span",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:v&&O?`Lege an: ${O}`:b.models?`${o(b.models,"Modell","Modelle")}${b.newBrands?`, ${o(b.newBrands,"neue Marke","neue Marken")}`:""} ausgewählt`:i?`${i.length} Marken, ${o(Q,"Modell","Modelle")} noch nicht angelegt`:""}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx("button",{type:"button",onClick:m,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"}),t.jsx("button",{type:"button",onClick:ee,disabled:v||b.models===0,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:v?"Wird angelegt…":"Auswahl anlegen"})]})]})]})}):null}export{oe as V}; diff --git a/hifi/assets/ViewOnSite-B0vt49HS.js b/hifi/assets/ViewOnSite-Dn1Ym5u6.js similarity index 84% rename from hifi/assets/ViewOnSite-B0vt49HS.js rename to hifi/assets/ViewOnSite-Dn1Ym5u6.js index ef60365..9c7d1bd 100644 --- a/hifi/assets/ViewOnSite-B0vt49HS.js +++ b/hifi/assets/ViewOnSite-Dn1Ym5u6.js @@ -1 +1 @@ -import{j as n,K as a}from"./index-eQrgtQRM.js";function i({to:e,label:r="Ansehen",className:t=""}){return e?n.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Auf der Website ansehen (neuer Tab)",className:`inline-flex items-center gap-1 text-xs font-medium text-neutral-500 hover:text-brand-600 dark:text-neutral-400 ${t}`,children:[n.jsx(a,{className:"h-3.5 w-3.5"}),r]}):null}export{i as V}; +import{j as n,K as a}from"./index-CPMnKQBc.js";function i({to:e,label:r="Ansehen",className:t=""}){return e?n.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Auf der Website ansehen (neuer Tab)",className:`inline-flex items-center gap-1 text-xs font-medium text-neutral-500 hover:text-brand-600 dark:text-neutral-400 ${t}`,children:[n.jsx(a,{className:"h-3.5 w-3.5"}),r]}):null}export{i as V}; diff --git a/hifi/assets/WebsiteSettings-Cn9gk2Zi.js b/hifi/assets/WebsiteSettings-GXoKYAkf.js similarity index 99% rename from hifi/assets/WebsiteSettings-Cn9gk2Zi.js rename to hifi/assets/WebsiteSettings-GXoKYAkf.js index 4dda46e..b08b37f 100644 --- a/hifi/assets/WebsiteSettings-Cn9gk2Zi.js +++ b/hifi/assets/WebsiteSettings-GXoKYAkf.js @@ -1 +1 @@ -import{a3 as ke,j as e,a4 as He,a5 as Oe,Y as fe,a6 as Xe,v as $e,a0 as Ue,a7 as Ve,a8 as Je,r as n,c as x,w as Ye,f as Ze,L as qe}from"./index-eQrgtQRM.js";import v from"./ImageUploadField-2si66K3r.js";import{S as Qe}from"./SaveBar-DDpMGtuu.js";import{S as et}from"./SortableList-B1XU_999.js";import{P as tt}from"./packageTiers-DOLFlFAh.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CN3X5f7p.js";import"./grip-vertical-DJgsXpN7.js";const S="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900";function W({src:m,custom:d,className:o="h-20 w-32"}){return e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("img",{src:m,alt:"",className:`${o} rounded-md border border-neutral-200 bg-neutral-100 object-cover dark:border-neutral-700 dark:bg-neutral-800`}),e.jsx("span",{className:`absolute bottom-1 left-1 rounded px-1.5 py-0.5 text-[10px] font-semibold ${d?"bg-brand-500 text-white":"bg-black/60 text-white"}`,children:d?"Eigenes Bild":"Standard"})]})}function E({slotKey:m,value:d,onChange:o,hint:b}){const h=Xe[m],p=d||"";return e.jsxs("div",{className:"flex flex-col gap-3 border-t border-neutral-100 pt-4 first:border-t-0 first:pt-0 dark:border-neutral-800 sm:flex-row sm:items-start",children:[e.jsx(W,{src:p||h.src,custom:!!p}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(v,{value:p,onChange:g=>o(g||""),label:h.label,aspect:h.aspect}),b&&e.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:b})]})]})}function at({value:m,onChange:d}){const o=m||{},b=(a,i)=>{const c={...o};i?c[a]=i:delete c[a],d(c)},h=Array.isArray(o.insights)?o.insights:ke(),p=h.map(a=>({id:a,token:a})),g=a=>d({...o,insights:a}),C=(a,i)=>{const c=[...h];i?c[a]=i:a{const a={...o};delete a.insights,d(a)},_=Array.isArray(o.package_tiers)?o.package_tiers:[],z=(a,i)=>{const c=fe.map((j,r)=>_[r]||null);c[a]=i||null;const k={...o};c.some(Boolean)?k.package_tiers=c:delete k.package_tiers,d(k)};return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:S,children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Link-Vorschau und Browser-Symbol"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das Vorschaubild erscheint, wenn jemand den Link zur Website in WhatsApp, Facebook, Signal & Co. teilt (ideal 1200 × 630 Pixel). WhatsApp merkt sich Vorschauen eine Weile, ein neues Bild kann daher erst nach einigen Tagen bei bereits geteilten Links auftauchen."}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(E,{slotKey:"og_image",value:o.og_image,onChange:a=>b("og_image",a)}),e.jsx(E,{slotKey:"favicon",value:o.favicon,onChange:a=>b("favicon",a),hint:"Das kleine Symbol im Browser-Tab. Am besten ein quadratisches PNG."})]})]}),e.jsxs("section",{className:S,children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Bilder auf der Startseite"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Tipp: Im Live-Bearbeiten-Modus der Website lassen sich diese Bilder auch direkt auf der Seite tauschen."}),e.jsx("div",{className:"space-y-4",children:["craft","advice","youtube_poster","more"].map(a=>e.jsx(E,{slotKey:a,value:o[a],onChange:i=>b(a,i),hint:a==="youtube_poster"?"Wird gezeigt, bis das Video startet, und dauerhaft auf Geräten, die keine Videos automatisch abspielen.":void 0},a))})]}),e.jsxs("section",{className:S,children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"„Einblicke in unsere Umbauten“"}),Array.isArray(o.insights)&&e.jsx("button",{type:"button",onClick:K,className:"text-xs font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Standardfotos wiederherstellen"})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Fotos unter der Überschrift auf der Startseite. Tauschen, entfernen, neue hinzufügen und am Griff in die gewünschte Reihenfolge ziehen. Angezeigt werden sie quadratisch, drei pro Reihe."}),e.jsx(et,{items:p,onReorder:a=>g(a.map(i=>i.token)),as:"grid",className:"grid gap-4 sm:grid-cols-2",children:(a,i)=>{const c=h.indexOf(a.token),k=a.token.startsWith("default:");return e.jsxs("div",{className:"rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:[i,"Foto ",c+1]}),e.jsx("button",{type:"button",onClick:()=>g(h.filter((j,r)=>r!==c)),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(W,{src:He(a.token),custom:!k,className:"h-20 w-20"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(v,{value:k?"":a.token,onChange:j=>C(c,j),label:"Tauschen",aspect:1})})]})]})}}),h.length===0&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Keine Fotos - die Rubrik zeigt dann nur Überschrift und Text."}),h.lengtha&&g([...h,a]),label:"Foto hinzufügen",aspect:1})})]}),e.jsxs("section",{className:S,children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktseite und Launch-Countdown"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Großflächige Hintergrundbilder. Text und Formular liegen darüber, ruhige und eher dunkle Motive wirken am besten."}),e.jsx("div",{className:"space-y-4",children:["contact_bg_light","contact_bg_dark","countdown_bg"].map(a=>e.jsx(E,{slotKey:a,value:o[a],onChange:i=>b(a,i)},a))})]}),e.jsxs("section",{className:S,children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Hintergründe der Paketkacheln"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das Motiv hinter jeder Preisstufe auf den Fahrzeugseiten (günstigstes Paket = Stufe 1). Eigene Bilder gelten in jedem Farbschema, ohne eigenes Bild bleibt das Straßenmotiv bzw. der Farbverlauf des Schemas."}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:fe.map((a,i)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(W,{src:_[i]||a,custom:!!_[i],className:"h-24 w-14"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(v,{value:_[i]||"",onChange:c=>z(i,c),label:`Stufe ${i+1}: ${tt[i]}`,aspect:210/480})})]},i))})]})]})}const ve=[{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"}],je=Object.fromEntries(ve.map(m=>[m.key,{open:"09:00",close:"18:00",closed:!1}])),_e={phone:"",whatsapp:"",contact_email:"",address_street:"",address_zip:"",address_city:"",logo_path:"",logo_dark_path:"",business_hours:je,hero_image_path:"",ga_measurement_id:"",package_card_theme:"graphite",package_card_layout:"strip",package_wheel_hint_interval:8,package_card_width:210,package_card_height:480,vehicle_tile_width:240,vehicle_tile_height:180,gallery_card_text_x:0,gallery_card_text_y:100,site_font:"",page_loader_enabled:!0,price_note:"",price_note_en:"",site_images:{}},rt=[{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."}],st=[{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 gt({section:m="company"}){const d=t=>t===m,o=$e(),b=Ue(),h=Ve(),p=Je(),[g,C]=n.useState(""),[K,_]=n.useState(null),[z,a]=n.useState(!1),[i,c]=n.useState(""),k=async t=>{t.preventDefault(),c(""),a(!0);try{const s=new FormData;s.append("name",g),s.append("file",K),await x.post("/custom-fonts",s),C(""),_(null),t.target.reset(),p(),o.success("Schriftart hochgeladen.")}catch(s){c(s.message)}finally{a(!1)}},j=async t=>{if(confirm("Schriftart wirklich löschen? Felder, die sie noch verwenden, fallen danach auf die Standardschrift zurück."))try{await x.delete(`/custom-fonts/${t}`),p(),o.success("Schriftart gelöscht.")}catch(s){o.error(s.message)}},[r,B]=n.useState(_e),[we,H]=n.useState(_e),[Ne,ye]=n.useState(null),[Se,Ce]=n.useState(!0),[ze,O]=n.useState(!1),[nt,w]=n.useState(!1),[X,$]=n.useState(""),[A,Be]=n.useState(null),U=n.useRef(null),[V,J]=n.useState(!1),Ae=(t,s)=>{const u=U.current.getBoundingClientRect();return{x:Math.max(0,Math.min(100,Math.round((t-u.left)/u.width*100))),y:Math.max(0,Math.min(100,Math.round((s-u.top)/u.height*100)))}},Y=(t,s)=>{const{x:u,y}=Ae(t,s);B(We=>({...We,gallery_card_text_x:u,gallery_card_text_y:y})),w(!1)},De=t=>{t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),J(!0),Y(t.clientX,t.clientY)},Fe=t=>{V&&Y(t.clientX,t.clientY)},Ge=t=>{J(!1),t.currentTarget.releasePointerCapture(t.pointerId)},[D,Z]=n.useState(""),[Pe,q]=n.useState(""),[L,Q]=n.useState(""),[ee,te]=n.useState(!1),[Ee,ae]=n.useState(!1),[re,se]=n.useState(""),[lt,F]=n.useState(!1),[N,ne]=n.useState(""),[Ke,le]=n.useState(""),[R,de]=n.useState(""),[I,ie]=n.useState(!1),[f,M]=n.useState(null),[Le,oe]=n.useState(!1),[ce,G]=n.useState(""),[dt,P]=n.useState(!1),[ue,me]=n.useState(!1);n.useEffect(()=>{x.get("/site-settings").then(t=>{const s={phone:t.phone||"",whatsapp:t.whatsapp||"",contact_email:t.contact_email||"",address_street:t.address_street||"",address_zip:t.address_zip||"",address_city:t.address_city||"",logo_path:t.logo_path||"",logo_dark_path:t.logo_dark_path||"",business_hours:t.business_hours||je,hero_image_path:t.hero_image_path||"",ga_measurement_id:t.ga_measurement_id||"",package_card_theme:t.package_card_theme||"graphite",package_card_layout:t.package_card_layout||"strip",package_wheel_hint_interval:t.package_wheel_hint_interval||8,package_card_width:t.package_card_width||210,package_card_height:t.package_card_height||480,vehicle_tile_width:t.vehicle_tile_width||240,vehicle_tile_height:t.vehicle_tile_height||180,gallery_card_text_x:t.gallery_card_text_x??0,gallery_card_text_y:t.gallery_card_text_y??100,site_font:t.site_font||"",page_loader_enabled:t.page_loader_enabled===void 0?!0:!!t.page_loader_enabled,price_note:t.price_note||"",price_note_en:t.price_note_en||"",site_images:t.site_images&&!Array.isArray(t.site_images)?t.site_images:{}};B(s),H(s)}).catch(t=>o.error(t.message)).finally(()=>Ce(!1)),m==="design"&&x.get("/gallery-brands").then(t=>Be(t.find(s=>s.cover_image_path)||null)).catch(()=>{}),m==="google"&&(x.get("/settings/analytics").then(t=>{Z(t.ga_property_id||""),q(t.ga_property_id||""),te(t.has_credentials)}).catch(()=>{}),he())},[m]);const he=()=>{x.get("/settings/google-reviews").then(t=>{ne(t.place_id||""),le(t.place_id||""),ie(t.has_api_key),M(t)}).catch(()=>{})},Re=async()=>{oe(!0),G(""),P(!1);try{const t=await x.post("/settings/google-reviews",{place_id:N,api_key:R});ie(t.has_api_key),M(t),de(""),le(N),P(!0)}catch(t){throw G(t.message),t}finally{oe(!1)}},Ie=async()=>{me(!0),G("");try{const t=await x.post("/settings/google-reviews/refresh",{});M(t)}catch(t){G(t.message),he()}finally{me(!1)}},Me=async()=>{ae(!0),se(""),F(!1);try{const t=await x.post("/settings/analytics",{ga_property_id:D,service_account_json:L});te(t.has_credentials),Q(""),q(D),F(!0)}catch(t){throw se(t.message),t}finally{ae(!1)}},l=(t,s)=>{B(u=>({...u,[t]:s})),w(!1)},T=(t,s,u)=>{B(y=>({...y,business_hours:{...y.business_hours,[t]:{...y.business_hours[t],[s]:u}}})),w(!1)},xe=JSON.stringify(r)!==JSON.stringify(we),be=D!==Pe||L!=="",ge=N!==Ke||R!=="",pe=xe||m==="google"&&(be||ge);Ye(pe,`website-settings-${m}`);const Te=async t=>{t.preventDefault(),O(!0),$(""),w(!1);try{if(xe){const{site_images:s,...u}=r;await x.post("/site-settings",m==="images"?r:u)}m==="google"&&be&&await Me(),m==="google"&&ge&&await Re(),H(r),w(!0),ye(new Date),o.success("Gespeichert.")}catch(s){$(s.message),o.error(`Speichern fehlgeschlagen: ${s.message}`)}finally{O(!1)}};return Se?e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):e.jsxs("form",{id:"website-settings-form",onSubmit:Te,className:"max-w-2xl space-y-6",children:[d("images")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Großes Titelbild der Startseite"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das große Bild ganz oben auf der Startseite. Ohne eigenes Bild wird das Standardbild verwendet."}),e.jsx(v,{value:r.hero_image_path,onChange:t=>l("hero_image_path",t),label:"Bild",aspect:16/9})]}),d("images")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Firmenlogo"}),e.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)."}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(v,{value:r.logo_path,onChange:t=>l("logo_path",t),label:"Logo (Hellmodus)"}),e.jsx(v,{value:r.logo_dark_path,onChange:t=>l("logo_dark_path",t),label:"Logo (Dunkelmodus)"})]})]}),d("images")&&e.jsx(at,{value:r.site_images,onChange:t=>l("site_images",t)}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Schriftart"}),e.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."}),e.jsx("select",{value:r.site_font,onChange:t=>l("site_font",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:b.map(t=>e.jsx("option",{value:t.value,children:t.label},t.label))})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Eigene Schriftarten"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Eigene Schriftart-Dateien (WOFF2, WOFF, TTF oder OTF) hochladen - stehen danach in jeder Schriftart-Auswahl im Dashboard zusätzlich zur Wahl."}),h.length>0&&e.jsx("ul",{className:"mb-4 space-y-2",children:h.map(t=>e.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border border-neutral-200 px-3 py-2 text-sm dark:border-neutral-700",children:[e.jsx("span",{style:{fontFamily:t.font_family},children:t.name}),e.jsx("button",{type:"button",onClick:()=>j(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]},t.id))}),e.jsxs("form",{onSubmit:k,className:"flex flex-wrap items-end gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name"}),e.jsx("input",{required:!0,value:g,onChange:t=>C(t.target.value),placeholder:"z. B. Firmenschrift",className:"rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datei"}),e.jsx("input",{required:!0,type:"file",accept:".woff2,.woff,.ttf,.otf",onChange:t=>{var s;return _(((s=t.target.files)==null?void 0:s[0])||null)},className:"text-sm"})]}),e.jsx("button",{type:"submit",disabled:z,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:z?"Lädt hoch…":"Hochladen"})]}),i&&e.jsx("p",{className:"mt-2 text-sm text-red-600",children:i})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Seiten-Ladeanzeige"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Solange Daten und Bilder im sichtbaren Bereich einer Seite noch laden, bleibt der Inhalt ausgeblendet – verhindert, dass Bilder nachträglich "einpoppen". Das Lade-Symbol erscheint nur, wenn das länger als einen Augenblick dauert. Wirkt sich nicht auf das Dashboard und die Startseite aus, nur auf die übrigen Seiten der öffentlichen Website.'}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:r.page_loader_enabled,onChange:t=>l("page_loader_enabled",t.target.checked),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Ladeanzeige aktivieren"]})]}),d("company")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktdaten"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird im Header, Footer und auf der Kontaktseite angezeigt."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Telefon"}),e.jsx("input",{value:r.phone,onChange:t=>l("phone",t.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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"WhatsApp Business Nummer"}),e.jsx("input",{value:r.whatsapp,onChange:t=>l("whatsapp",t.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"}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Leer lassen, um den WhatsApp-Link im Header auszublenden."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail"}),e.jsx("input",{type:"email",value:r.contact_email,onChange:t=>l("contact_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"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px_1fr]",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Straße & Hausnummer"}),e.jsx("input",{value:r.address_street,onChange:t=>l("address_street",t.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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"PLZ"}),e.jsx("input",{value:r.address_zip,onChange:t=>l("address_zip",t.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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Ort"}),e.jsx("input",{value:r.address_city,onChange:t=>l("address_city",t.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"})]})]})]})]}),d("company")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Öffnungszeiten"}),e.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.'}),e.jsx("div",{className:"space-y-2",children:ve.map(t=>{const s=r.business_hours[t.key]||{open:"",close:"",closed:!1};return e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"w-24 shrink-0 text-sm text-neutral-600 dark:text-neutral-300",children:t.label}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-neutral-500 dark:text-neutral-400",children:[e.jsx("input",{type:"checkbox",checked:!s.closed,onChange:u=>T(t.key,"closed",!u.target.checked),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"geöffnet"]}),!s.closed&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"time",value:s.open,onChange:u=>T(t.key,"open",u.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"}),e.jsx("span",{className:"text-neutral-400",children:"–"}),e.jsx("input",{type:"time",value:s.close,onChange:u=>T(t.key,"close",u.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"})]})]},t.key)})})]}),d("company")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Hinweis unter den Paketpreisen"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Erscheint klein unter jedem Paketpreis und im Kontaktformular – z. B. „inkl. MwSt. und Einbau“. So weiß der Kunde, was im Preis enthalten ist. Leer lassen, um keinen Hinweis anzuzeigen."}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Deutsch"}),e.jsx("input",{value:r.price_note,onChange:t=>l("price_note",t.target.value),maxLength:150,placeholder:"inkl. MwSt. und Einbau",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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Englisch (optional)"}),e.jsx("input",{value:r.price_note_en,onChange:t=>l("price_note_en",t.target.value),maxLength:150,placeholder:"incl. VAT and installation",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("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Paket-Kachel-Design"}),e.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)."}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:rt.map(t=>e.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${r.package_card_theme===t.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:[e.jsx("input",{type:"radio",name:"package_card_theme",value:t.value,checked:r.package_card_theme===t.value,onChange:s=>l("package_card_theme",s.target.value),className:"sr-only"}),e.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:t.label}),e.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]},t.value))})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kachel-Layout"}),e.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."}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:st.map(t=>e.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${r.package_card_layout===t.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:[e.jsx("input",{type:"radio",name:"package_card_layout",value:t.value,checked:r.package_card_layout===t.value,onChange:s=>l("package_card_layout",s.target.value),className:"sr-only"}),e.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:t.label}),e.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]},t.value))}),e.jsxs("div",{className:"mt-5 max-w-xs",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Mausrad-Hinweis: Wiederholung (Sekunden)"}),e.jsx("input",{type:"number",min:"2",max:"120",value:r.package_wheel_hint_interval,onChange:t=>l("package_wheel_hint_interval",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"}),e.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.'})]}),e.jsxs("div",{className:"mt-5 grid max-w-xs gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Breite (px)"}),e.jsx("input",{type:"number",min:"80",max:"600",value:r.package_card_width,onChange:t=>l("package_card_width",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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Höhe (px)"}),e.jsx("input",{type:"number",min:"80",max:"900",value:r.package_card_height,onChange:t=>l("package_card_height",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"})]}),e.jsx("p",{className:"text-xs text-neutral-400 sm:col-span-2",children:'Bei „Raster" bestimmt die Breite stattdessen, wie viele Kacheln pro Zeile passen.'})]})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Marken-/Modell-Kacheln"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Größe der Kacheln unter „Fahrzeuge wählen" und auf der Marken-Detailseite.'}),e.jsxs("div",{className:"grid max-w-xs gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Breite (px)"}),e.jsx("input",{type:"number",min:"80",max:"600",value:r.vehicle_tile_width,onChange:t=>l("vehicle_tile_width",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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Höhe (px)"}),e.jsx("input",{type:"number",min:"80",max:"600",value:r.vehicle_tile_height,onChange:t=>l("vehicle_tile_height",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"})]})]})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Bildergalerie-Kacheln"}),e.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."}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-[16rem_1fr] sm:items-start",children:[e.jsxs("div",{children:[e.jsxs("div",{ref:U,className:"relative aspect-[4/3] select-none overflow-hidden rounded-xl bg-neutral-900 shadow-sm",children:[A?e.jsx("img",{src:A.cover_image_path,alt:"",draggable:!1,className:"h-full w-full object-cover"}):e.jsx("div",{className:"h-full w-full bg-gradient-to-br from-neutral-700 to-neutral-900"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent"}),e.jsx("span",{onPointerDown:De,onPointerMove:Fe,onPointerUp:Ge,style:{...Ze(r.gallery_card_text_x,r.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 ${V?"cursor-grabbing bg-white/10 ring-2 ring-brand-400":"cursor-grab hover:bg-white/10"}`,children:A?A.name:"Beispiel-Marke"})]}),e.jsx("p",{className:"mt-1.5 text-center text-xs text-neutral-400",children:"Namen zum Verschieben ziehen"})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:pt-1",children:[e.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Position:"," ",e.jsxs("span",{className:"font-mono font-semibold text-neutral-700 dark:text-neutral-200",children:[r.gallery_card_text_x,"% / ",r.gallery_card_text_y,"%"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl waagerecht"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>l("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"}),e.jsx("button",{type:"button",onClick:()=>l("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"}),e.jsx("button",{type:"button",onClick:()=>l("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"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl senkrecht"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>l("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"}),e.jsx("button",{type:"button",onClick:()=>l("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"}),e.jsx("button",{type:"button",onClick:()=>l("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"})]})]})]})]})]}),d("google")&&e.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Ob alles funktioniert, zeigt der"," ",e.jsx(qe,{to:"/admin/settings/connections",className:"font-medium underline hover:text-neutral-800 dark:hover:text-neutral-200",children:"Verbindungstest"}),"."]}),d("google")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),e.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."}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Measurement-ID"}),e.jsx("input",{value:r.ga_measurement_id,onChange:t=>l("ga_measurement_id",t.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"})]}),e.jsxs("div",{className:"mt-5 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsx("h3",{className:"mb-1 text-sm font-semibold text-neutral-900 dark:text-white",children:"Dashboard-Anbindung (optional)"}),e.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."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Property-ID"}),e.jsx("input",{value:D,onChange:t=>{Z(t.target.value),F(!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"}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Nicht die Measurement-ID (G-...) - zu finden unter GA4 → Verwaltung → Property-Details."})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Service-Account-JSON-Schlüssel ",ee?"(leer lassen = unverändert)":""]}),e.jsx("textarea",{rows:4,value:L,onChange:t=>{Q(t.target.value),F(!1)},placeholder:ee?'{ "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"})]})]}),re&&e.jsx("p",{className:"mt-2 text-sm text-red-600",children:re})]})]}),d("google")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google-Rezensionen"}),e.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."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Place-ID"}),e.jsx("input",{value:N,onChange:t=>{ne(t.target.value),P(!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"}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Eindeutige Google-Kennung eures Eintrags – zu finden über den"," ",e.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"}),"."]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Places-API-Key ",I?"(leer lassen = unverändert)":""]}),e.jsx("input",{value:R,onChange:t=>{de(t.target.value),P(!1)},placeholder:I?"••••••••••••••••••••• (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"}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Aus der Google-Cloud-Console, mit aktivierter „Places API (New)“."})]})]}),ce&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:ce}),e.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:e.jsx("button",{type:"button",onClick:Ie,disabled:ue||!N||!I,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:ue?"Aktualisiere…":"Jetzt aktualisieren"})}),f&&e.jsxs("div",{className:"mt-4 rounded-md bg-neutral-50 p-3 text-sm dark:bg-neutral-800/50",children:[f.rating!=null?e.jsxs("p",{className:"text-neutral-700 dark:text-neutral-300",children:["Aktuell hinterlegt: ",e.jsxs("strong",{children:[f.rating," ★"]})," (",f.rating_count," Bewertungen)",f.updated_at&&e.jsxs(e.Fragment,{children:[" – zuletzt aktualisiert am ",new Date(f.updated_at.replace(" ","T")).toLocaleString("de-DE")]})]}):e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:"Noch keine erfolgreiche Aktualisierung – die Startseite zeigt bis dahin weiter die Beispiel-Rezensionen."}),f.error&&e.jsxs("p",{className:"mt-1 text-red-600",children:["Letzter Fehler: ",f.error]})]})]}),X&&e.jsx("p",{className:"text-sm text-red-600",children:X}),e.jsx(Qe,{dirty:pe,busy:ze||Ee||Le,savedAt:Ne,form:"website-settings-form"})]})}export{gt as default}; +import{a3 as ke,j as e,a4 as He,a5 as Oe,Y as fe,a6 as Xe,v as $e,a0 as Ue,a7 as Ve,a8 as Je,r as n,c as x,w as Ye,f as Ze,L as qe}from"./index-CPMnKQBc.js";import v from"./ImageUploadField-DGJRkWaj.js";import{S as Qe}from"./SaveBar-D3LWnDZL.js";import{S as et}from"./SortableList-Dgddukss.js";import{P as tt}from"./packageTiers-DOLFlFAh.js";import"./resizeImage-C6PvAwh0.js";import"./sortable.esm-CUwm6pqJ.js";import"./grip-vertical-Cn5hJClA.js";const S="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900";function W({src:m,custom:d,className:o="h-20 w-32"}){return e.jsxs("div",{className:"relative shrink-0",children:[e.jsx("img",{src:m,alt:"",className:`${o} rounded-md border border-neutral-200 bg-neutral-100 object-cover dark:border-neutral-700 dark:bg-neutral-800`}),e.jsx("span",{className:`absolute bottom-1 left-1 rounded px-1.5 py-0.5 text-[10px] font-semibold ${d?"bg-brand-500 text-white":"bg-black/60 text-white"}`,children:d?"Eigenes Bild":"Standard"})]})}function E({slotKey:m,value:d,onChange:o,hint:b}){const h=Xe[m],p=d||"";return e.jsxs("div",{className:"flex flex-col gap-3 border-t border-neutral-100 pt-4 first:border-t-0 first:pt-0 dark:border-neutral-800 sm:flex-row sm:items-start",children:[e.jsx(W,{src:p||h.src,custom:!!p}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(v,{value:p,onChange:g=>o(g||""),label:h.label,aspect:h.aspect}),b&&e.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:b})]})]})}function at({value:m,onChange:d}){const o=m||{},b=(a,i)=>{const c={...o};i?c[a]=i:delete c[a],d(c)},h=Array.isArray(o.insights)?o.insights:ke(),p=h.map(a=>({id:a,token:a})),g=a=>d({...o,insights:a}),C=(a,i)=>{const c=[...h];i?c[a]=i:a{const a={...o};delete a.insights,d(a)},_=Array.isArray(o.package_tiers)?o.package_tiers:[],z=(a,i)=>{const c=fe.map((j,r)=>_[r]||null);c[a]=i||null;const k={...o};c.some(Boolean)?k.package_tiers=c:delete k.package_tiers,d(k)};return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:S,children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Link-Vorschau und Browser-Symbol"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das Vorschaubild erscheint, wenn jemand den Link zur Website in WhatsApp, Facebook, Signal & Co. teilt (ideal 1200 × 630 Pixel). WhatsApp merkt sich Vorschauen eine Weile, ein neues Bild kann daher erst nach einigen Tagen bei bereits geteilten Links auftauchen."}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(E,{slotKey:"og_image",value:o.og_image,onChange:a=>b("og_image",a)}),e.jsx(E,{slotKey:"favicon",value:o.favicon,onChange:a=>b("favicon",a),hint:"Das kleine Symbol im Browser-Tab. Am besten ein quadratisches PNG."})]})]}),e.jsxs("section",{className:S,children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Bilder auf der Startseite"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Tipp: Im Live-Bearbeiten-Modus der Website lassen sich diese Bilder auch direkt auf der Seite tauschen."}),e.jsx("div",{className:"space-y-4",children:["craft","advice","youtube_poster","more"].map(a=>e.jsx(E,{slotKey:a,value:o[a],onChange:i=>b(a,i),hint:a==="youtube_poster"?"Wird gezeigt, bis das Video startet, und dauerhaft auf Geräten, die keine Videos automatisch abspielen.":void 0},a))})]}),e.jsxs("section",{className:S,children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-center justify-between gap-2",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"„Einblicke in unsere Umbauten“"}),Array.isArray(o.insights)&&e.jsx("button",{type:"button",onClick:K,className:"text-xs font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Standardfotos wiederherstellen"})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Fotos unter der Überschrift auf der Startseite. Tauschen, entfernen, neue hinzufügen und am Griff in die gewünschte Reihenfolge ziehen. Angezeigt werden sie quadratisch, drei pro Reihe."}),e.jsx(et,{items:p,onReorder:a=>g(a.map(i=>i.token)),as:"grid",className:"grid gap-4 sm:grid-cols-2",children:(a,i)=>{const c=h.indexOf(a.token),k=a.token.startsWith("default:");return e.jsxs("div",{className:"rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:[i,"Foto ",c+1]}),e.jsx("button",{type:"button",onClick:()=>g(h.filter((j,r)=>r!==c)),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(W,{src:He(a.token),custom:!k,className:"h-20 w-20"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(v,{value:k?"":a.token,onChange:j=>C(c,j),label:"Tauschen",aspect:1})})]})]})}}),h.length===0&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Keine Fotos - die Rubrik zeigt dann nur Überschrift und Text."}),h.lengtha&&g([...h,a]),label:"Foto hinzufügen",aspect:1})})]}),e.jsxs("section",{className:S,children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktseite und Launch-Countdown"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Großflächige Hintergrundbilder. Text und Formular liegen darüber, ruhige und eher dunkle Motive wirken am besten."}),e.jsx("div",{className:"space-y-4",children:["contact_bg_light","contact_bg_dark","countdown_bg"].map(a=>e.jsx(E,{slotKey:a,value:o[a],onChange:i=>b(a,i)},a))})]}),e.jsxs("section",{className:S,children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Hintergründe der Paketkacheln"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das Motiv hinter jeder Preisstufe auf den Fahrzeugseiten (günstigstes Paket = Stufe 1). Eigene Bilder gelten in jedem Farbschema, ohne eigenes Bild bleibt das Straßenmotiv bzw. der Farbverlauf des Schemas."}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:fe.map((a,i)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(W,{src:_[i]||a,custom:!!_[i],className:"h-24 w-14"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(v,{value:_[i]||"",onChange:c=>z(i,c),label:`Stufe ${i+1}: ${tt[i]}`,aspect:210/480})})]},i))})]})]})}const ve=[{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"}],je=Object.fromEntries(ve.map(m=>[m.key,{open:"09:00",close:"18:00",closed:!1}])),_e={phone:"",whatsapp:"",contact_email:"",address_street:"",address_zip:"",address_city:"",logo_path:"",logo_dark_path:"",business_hours:je,hero_image_path:"",ga_measurement_id:"",package_card_theme:"graphite",package_card_layout:"strip",package_wheel_hint_interval:8,package_card_width:210,package_card_height:480,vehicle_tile_width:240,vehicle_tile_height:180,gallery_card_text_x:0,gallery_card_text_y:100,site_font:"",page_loader_enabled:!0,price_note:"",price_note_en:"",site_images:{}},rt=[{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."}],st=[{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 gt({section:m="company"}){const d=t=>t===m,o=$e(),b=Ue(),h=Ve(),p=Je(),[g,C]=n.useState(""),[K,_]=n.useState(null),[z,a]=n.useState(!1),[i,c]=n.useState(""),k=async t=>{t.preventDefault(),c(""),a(!0);try{const s=new FormData;s.append("name",g),s.append("file",K),await x.post("/custom-fonts",s),C(""),_(null),t.target.reset(),p(),o.success("Schriftart hochgeladen.")}catch(s){c(s.message)}finally{a(!1)}},j=async t=>{if(confirm("Schriftart wirklich löschen? Felder, die sie noch verwenden, fallen danach auf die Standardschrift zurück."))try{await x.delete(`/custom-fonts/${t}`),p(),o.success("Schriftart gelöscht.")}catch(s){o.error(s.message)}},[r,B]=n.useState(_e),[we,H]=n.useState(_e),[Ne,ye]=n.useState(null),[Se,Ce]=n.useState(!0),[ze,O]=n.useState(!1),[nt,w]=n.useState(!1),[X,$]=n.useState(""),[A,Be]=n.useState(null),U=n.useRef(null),[V,J]=n.useState(!1),Ae=(t,s)=>{const u=U.current.getBoundingClientRect();return{x:Math.max(0,Math.min(100,Math.round((t-u.left)/u.width*100))),y:Math.max(0,Math.min(100,Math.round((s-u.top)/u.height*100)))}},Y=(t,s)=>{const{x:u,y}=Ae(t,s);B(We=>({...We,gallery_card_text_x:u,gallery_card_text_y:y})),w(!1)},De=t=>{t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),J(!0),Y(t.clientX,t.clientY)},Fe=t=>{V&&Y(t.clientX,t.clientY)},Ge=t=>{J(!1),t.currentTarget.releasePointerCapture(t.pointerId)},[D,Z]=n.useState(""),[Pe,q]=n.useState(""),[L,Q]=n.useState(""),[ee,te]=n.useState(!1),[Ee,ae]=n.useState(!1),[re,se]=n.useState(""),[lt,F]=n.useState(!1),[N,ne]=n.useState(""),[Ke,le]=n.useState(""),[R,de]=n.useState(""),[I,ie]=n.useState(!1),[f,M]=n.useState(null),[Le,oe]=n.useState(!1),[ce,G]=n.useState(""),[dt,P]=n.useState(!1),[ue,me]=n.useState(!1);n.useEffect(()=>{x.get("/site-settings").then(t=>{const s={phone:t.phone||"",whatsapp:t.whatsapp||"",contact_email:t.contact_email||"",address_street:t.address_street||"",address_zip:t.address_zip||"",address_city:t.address_city||"",logo_path:t.logo_path||"",logo_dark_path:t.logo_dark_path||"",business_hours:t.business_hours||je,hero_image_path:t.hero_image_path||"",ga_measurement_id:t.ga_measurement_id||"",package_card_theme:t.package_card_theme||"graphite",package_card_layout:t.package_card_layout||"strip",package_wheel_hint_interval:t.package_wheel_hint_interval||8,package_card_width:t.package_card_width||210,package_card_height:t.package_card_height||480,vehicle_tile_width:t.vehicle_tile_width||240,vehicle_tile_height:t.vehicle_tile_height||180,gallery_card_text_x:t.gallery_card_text_x??0,gallery_card_text_y:t.gallery_card_text_y??100,site_font:t.site_font||"",page_loader_enabled:t.page_loader_enabled===void 0?!0:!!t.page_loader_enabled,price_note:t.price_note||"",price_note_en:t.price_note_en||"",site_images:t.site_images&&!Array.isArray(t.site_images)?t.site_images:{}};B(s),H(s)}).catch(t=>o.error(t.message)).finally(()=>Ce(!1)),m==="design"&&x.get("/gallery-brands").then(t=>Be(t.find(s=>s.cover_image_path)||null)).catch(()=>{}),m==="google"&&(x.get("/settings/analytics").then(t=>{Z(t.ga_property_id||""),q(t.ga_property_id||""),te(t.has_credentials)}).catch(()=>{}),he())},[m]);const he=()=>{x.get("/settings/google-reviews").then(t=>{ne(t.place_id||""),le(t.place_id||""),ie(t.has_api_key),M(t)}).catch(()=>{})},Re=async()=>{oe(!0),G(""),P(!1);try{const t=await x.post("/settings/google-reviews",{place_id:N,api_key:R});ie(t.has_api_key),M(t),de(""),le(N),P(!0)}catch(t){throw G(t.message),t}finally{oe(!1)}},Ie=async()=>{me(!0),G("");try{const t=await x.post("/settings/google-reviews/refresh",{});M(t)}catch(t){G(t.message),he()}finally{me(!1)}},Me=async()=>{ae(!0),se(""),F(!1);try{const t=await x.post("/settings/analytics",{ga_property_id:D,service_account_json:L});te(t.has_credentials),Q(""),q(D),F(!0)}catch(t){throw se(t.message),t}finally{ae(!1)}},l=(t,s)=>{B(u=>({...u,[t]:s})),w(!1)},T=(t,s,u)=>{B(y=>({...y,business_hours:{...y.business_hours,[t]:{...y.business_hours[t],[s]:u}}})),w(!1)},xe=JSON.stringify(r)!==JSON.stringify(we),be=D!==Pe||L!=="",ge=N!==Ke||R!=="",pe=xe||m==="google"&&(be||ge);Ye(pe,`website-settings-${m}`);const Te=async t=>{t.preventDefault(),O(!0),$(""),w(!1);try{if(xe){const{site_images:s,...u}=r;await x.post("/site-settings",m==="images"?r:u)}m==="google"&&be&&await Me(),m==="google"&&ge&&await Re(),H(r),w(!0),ye(new Date),o.success("Gespeichert.")}catch(s){$(s.message),o.error(`Speichern fehlgeschlagen: ${s.message}`)}finally{O(!1)}};return Se?e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):e.jsxs("form",{id:"website-settings-form",onSubmit:Te,className:"max-w-2xl space-y-6",children:[d("images")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Großes Titelbild der Startseite"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das große Bild ganz oben auf der Startseite. Ohne eigenes Bild wird das Standardbild verwendet."}),e.jsx(v,{value:r.hero_image_path,onChange:t=>l("hero_image_path",t),label:"Bild",aspect:16/9})]}),d("images")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Firmenlogo"}),e.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)."}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsx(v,{value:r.logo_path,onChange:t=>l("logo_path",t),label:"Logo (Hellmodus)"}),e.jsx(v,{value:r.logo_dark_path,onChange:t=>l("logo_dark_path",t),label:"Logo (Dunkelmodus)"})]})]}),d("images")&&e.jsx(at,{value:r.site_images,onChange:t=>l("site_images",t)}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Schriftart"}),e.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."}),e.jsx("select",{value:r.site_font,onChange:t=>l("site_font",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:b.map(t=>e.jsx("option",{value:t.value,children:t.label},t.label))})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Eigene Schriftarten"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Eigene Schriftart-Dateien (WOFF2, WOFF, TTF oder OTF) hochladen - stehen danach in jeder Schriftart-Auswahl im Dashboard zusätzlich zur Wahl."}),h.length>0&&e.jsx("ul",{className:"mb-4 space-y-2",children:h.map(t=>e.jsxs("li",{className:"flex items-center justify-between gap-2 rounded-md border border-neutral-200 px-3 py-2 text-sm dark:border-neutral-700",children:[e.jsx("span",{style:{fontFamily:t.font_family},children:t.name}),e.jsx("button",{type:"button",onClick:()=>j(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]},t.id))}),e.jsxs("form",{onSubmit:k,className:"flex flex-wrap items-end gap-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name"}),e.jsx("input",{required:!0,value:g,onChange:t=>C(t.target.value),placeholder:"z. B. Firmenschrift",className:"rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datei"}),e.jsx("input",{required:!0,type:"file",accept:".woff2,.woff,.ttf,.otf",onChange:t=>{var s;return _(((s=t.target.files)==null?void 0:s[0])||null)},className:"text-sm"})]}),e.jsx("button",{type:"submit",disabled:z,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:z?"Lädt hoch…":"Hochladen"})]}),i&&e.jsx("p",{className:"mt-2 text-sm text-red-600",children:i})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Seiten-Ladeanzeige"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Solange Daten und Bilder im sichtbaren Bereich einer Seite noch laden, bleibt der Inhalt ausgeblendet – verhindert, dass Bilder nachträglich "einpoppen". Das Lade-Symbol erscheint nur, wenn das länger als einen Augenblick dauert. Wirkt sich nicht auf das Dashboard und die Startseite aus, nur auf die übrigen Seiten der öffentlichen Website.'}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:r.page_loader_enabled,onChange:t=>l("page_loader_enabled",t.target.checked),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Ladeanzeige aktivieren"]})]}),d("company")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktdaten"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird im Header, Footer und auf der Kontaktseite angezeigt."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Telefon"}),e.jsx("input",{value:r.phone,onChange:t=>l("phone",t.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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"WhatsApp Business Nummer"}),e.jsx("input",{value:r.whatsapp,onChange:t=>l("whatsapp",t.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"}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Leer lassen, um den WhatsApp-Link im Header auszublenden."})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail"}),e.jsx("input",{type:"email",value:r.contact_email,onChange:t=>l("contact_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"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px_1fr]",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Straße & Hausnummer"}),e.jsx("input",{value:r.address_street,onChange:t=>l("address_street",t.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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"PLZ"}),e.jsx("input",{value:r.address_zip,onChange:t=>l("address_zip",t.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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Ort"}),e.jsx("input",{value:r.address_city,onChange:t=>l("address_city",t.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"})]})]})]})]}),d("company")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Öffnungszeiten"}),e.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.'}),e.jsx("div",{className:"space-y-2",children:ve.map(t=>{const s=r.business_hours[t.key]||{open:"",close:"",closed:!1};return e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("span",{className:"w-24 shrink-0 text-sm text-neutral-600 dark:text-neutral-300",children:t.label}),e.jsxs("label",{className:"flex items-center gap-1.5 text-xs text-neutral-500 dark:text-neutral-400",children:[e.jsx("input",{type:"checkbox",checked:!s.closed,onChange:u=>T(t.key,"closed",!u.target.checked),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"geöffnet"]}),!s.closed&&e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"time",value:s.open,onChange:u=>T(t.key,"open",u.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"}),e.jsx("span",{className:"text-neutral-400",children:"–"}),e.jsx("input",{type:"time",value:s.close,onChange:u=>T(t.key,"close",u.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"})]})]},t.key)})})]}),d("company")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Hinweis unter den Paketpreisen"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Erscheint klein unter jedem Paketpreis und im Kontaktformular – z. B. „inkl. MwSt. und Einbau“. So weiß der Kunde, was im Preis enthalten ist. Leer lassen, um keinen Hinweis anzuzeigen."}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Deutsch"}),e.jsx("input",{value:r.price_note,onChange:t=>l("price_note",t.target.value),maxLength:150,placeholder:"inkl. MwSt. und Einbau",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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Englisch (optional)"}),e.jsx("input",{value:r.price_note_en,onChange:t=>l("price_note_en",t.target.value),maxLength:150,placeholder:"incl. VAT and installation",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("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Paket-Kachel-Design"}),e.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)."}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:rt.map(t=>e.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${r.package_card_theme===t.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:[e.jsx("input",{type:"radio",name:"package_card_theme",value:t.value,checked:r.package_card_theme===t.value,onChange:s=>l("package_card_theme",s.target.value),className:"sr-only"}),e.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:t.label}),e.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]},t.value))})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kachel-Layout"}),e.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."}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:st.map(t=>e.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${r.package_card_layout===t.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:[e.jsx("input",{type:"radio",name:"package_card_layout",value:t.value,checked:r.package_card_layout===t.value,onChange:s=>l("package_card_layout",s.target.value),className:"sr-only"}),e.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:t.label}),e.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]},t.value))}),e.jsxs("div",{className:"mt-5 max-w-xs",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Mausrad-Hinweis: Wiederholung (Sekunden)"}),e.jsx("input",{type:"number",min:"2",max:"120",value:r.package_wheel_hint_interval,onChange:t=>l("package_wheel_hint_interval",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"}),e.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.'})]}),e.jsxs("div",{className:"mt-5 grid max-w-xs gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Breite (px)"}),e.jsx("input",{type:"number",min:"80",max:"600",value:r.package_card_width,onChange:t=>l("package_card_width",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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Höhe (px)"}),e.jsx("input",{type:"number",min:"80",max:"900",value:r.package_card_height,onChange:t=>l("package_card_height",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"})]}),e.jsx("p",{className:"text-xs text-neutral-400 sm:col-span-2",children:'Bei „Raster" bestimmt die Breite stattdessen, wie viele Kacheln pro Zeile passen.'})]})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Marken-/Modell-Kacheln"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Größe der Kacheln unter „Fahrzeuge wählen" und auf der Marken-Detailseite.'}),e.jsxs("div",{className:"grid max-w-xs gap-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Breite (px)"}),e.jsx("input",{type:"number",min:"80",max:"600",value:r.vehicle_tile_width,onChange:t=>l("vehicle_tile_width",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"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Höhe (px)"}),e.jsx("input",{type:"number",min:"80",max:"600",value:r.vehicle_tile_height,onChange:t=>l("vehicle_tile_height",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"})]})]})]}),d("design")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Bildergalerie-Kacheln"}),e.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."}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-[16rem_1fr] sm:items-start",children:[e.jsxs("div",{children:[e.jsxs("div",{ref:U,className:"relative aspect-[4/3] select-none overflow-hidden rounded-xl bg-neutral-900 shadow-sm",children:[A?e.jsx("img",{src:A.cover_image_path,alt:"",draggable:!1,className:"h-full w-full object-cover"}):e.jsx("div",{className:"h-full w-full bg-gradient-to-br from-neutral-700 to-neutral-900"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent"}),e.jsx("span",{onPointerDown:De,onPointerMove:Fe,onPointerUp:Ge,style:{...Ze(r.gallery_card_text_x,r.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 ${V?"cursor-grabbing bg-white/10 ring-2 ring-brand-400":"cursor-grab hover:bg-white/10"}`,children:A?A.name:"Beispiel-Marke"})]}),e.jsx("p",{className:"mt-1.5 text-center text-xs text-neutral-400",children:"Namen zum Verschieben ziehen"})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:pt-1",children:[e.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Position:"," ",e.jsxs("span",{className:"font-mono font-semibold text-neutral-700 dark:text-neutral-200",children:[r.gallery_card_text_x,"% / ",r.gallery_card_text_y,"%"]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl waagerecht"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>l("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"}),e.jsx("button",{type:"button",onClick:()=>l("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"}),e.jsx("button",{type:"button",onClick:()=>l("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"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-xs font-medium uppercase tracking-wide text-neutral-400",children:"Schnellauswahl senkrecht"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{type:"button",onClick:()=>l("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"}),e.jsx("button",{type:"button",onClick:()=>l("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"}),e.jsx("button",{type:"button",onClick:()=>l("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"})]})]})]})]})]}),d("google")&&e.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Ob alles funktioniert, zeigt der"," ",e.jsx(qe,{to:"/admin/settings/connections",className:"font-medium underline hover:text-neutral-800 dark:hover:text-neutral-200",children:"Verbindungstest"}),"."]}),d("google")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),e.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."}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Measurement-ID"}),e.jsx("input",{value:r.ga_measurement_id,onChange:t=>l("ga_measurement_id",t.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"})]}),e.jsxs("div",{className:"mt-5 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsx("h3",{className:"mb-1 text-sm font-semibold text-neutral-900 dark:text-white",children:"Dashboard-Anbindung (optional)"}),e.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."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Property-ID"}),e.jsx("input",{value:D,onChange:t=>{Z(t.target.value),F(!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"}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Nicht die Measurement-ID (G-...) - zu finden unter GA4 → Verwaltung → Property-Details."})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Service-Account-JSON-Schlüssel ",ee?"(leer lassen = unverändert)":""]}),e.jsx("textarea",{rows:4,value:L,onChange:t=>{Q(t.target.value),F(!1)},placeholder:ee?'{ "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"})]})]}),re&&e.jsx("p",{className:"mt-2 text-sm text-red-600",children:re})]})]}),d("google")&&e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google-Rezensionen"}),e.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."}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Place-ID"}),e.jsx("input",{value:N,onChange:t=>{ne(t.target.value),P(!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"}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Eindeutige Google-Kennung eures Eintrags – zu finden über den"," ",e.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"}),"."]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Places-API-Key ",I?"(leer lassen = unverändert)":""]}),e.jsx("input",{value:R,onChange:t=>{de(t.target.value),P(!1)},placeholder:I?"••••••••••••••••••••• (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"}),e.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Aus der Google-Cloud-Console, mit aktivierter „Places API (New)“."})]})]}),ce&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:ce}),e.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:e.jsx("button",{type:"button",onClick:Ie,disabled:ue||!N||!I,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:ue?"Aktualisiere…":"Jetzt aktualisieren"})}),f&&e.jsxs("div",{className:"mt-4 rounded-md bg-neutral-50 p-3 text-sm dark:bg-neutral-800/50",children:[f.rating!=null?e.jsxs("p",{className:"text-neutral-700 dark:text-neutral-300",children:["Aktuell hinterlegt: ",e.jsxs("strong",{children:[f.rating," ★"]})," (",f.rating_count," Bewertungen)",f.updated_at&&e.jsxs(e.Fragment,{children:[" – zuletzt aktualisiert am ",new Date(f.updated_at.replace(" ","T")).toLocaleString("de-DE")]})]}):e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:"Noch keine erfolgreiche Aktualisierung – die Startseite zeigt bis dahin weiter die Beispiel-Rezensionen."}),f.error&&e.jsxs("p",{className:"mt-1 text-red-600",children:["Letzter Fehler: ",f.error]})]})]}),X&&e.jsx("p",{className:"text-sm text-red-600",children:X}),e.jsx(Qe,{dirty:pe,busy:ze||Ee||Le,savedAt:Ne,form:"website-settings-form"})]})}export{gt as default}; diff --git a/hifi/assets/grip-vertical-DJgsXpN7.js b/hifi/assets/grip-vertical-Cn5hJClA.js similarity index 91% rename from hifi/assets/grip-vertical-DJgsXpN7.js rename to hifi/assets/grip-vertical-Cn5hJClA.js index 3d602fc..1c00a17 100644 --- a/hifi/assets/grip-vertical-DJgsXpN7.js +++ b/hifi/assets/grip-vertical-Cn5hJClA.js @@ -1,4 +1,4 @@ -import{aa as c}from"./index-eQrgtQRM.js";/** +import{aa as c}from"./index-CPMnKQBc.js";/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. diff --git a/hifi/assets/iconRegistry-7Dpzjhyo.js b/hifi/assets/iconRegistry-DXMu3JdV.js similarity index 99% rename from hifi/assets/iconRegistry-7Dpzjhyo.js rename to hifi/assets/iconRegistry-DXMu3JdV.js index 44c3ea4..449f470 100644 --- a/hifi/assets/iconRegistry-7Dpzjhyo.js +++ b/hifi/assets/iconRegistry-DXMu3JdV.js @@ -1,4 +1,4 @@ -import{aa as e,ac as L0,ad as x0,ae as w0,af as f0,ag as I0,ah as C0,H as N0,ai as b0,J as $0,aj as q0,ak as s,al as z0,am as S0,K as A0,an as H0,ao as j0,ap as V0,aq as P0,ar as B0,as as D0,at as F0,au as R0,av as T0,aw as U0,ax as O0,O as G0,ay as Z0,az as W0,G as E0,aA as X0,aB as K0,aC as Q0,aD as J0,aE as Y0,aF as ea,X as aa,aG as ca,aH as fL,aI as IL,aJ as CL,j as NL}from"./index-eQrgtQRM.js";import{D as ta,a as oa,b as da,c as l,F as na,L as ha,M as ia}from"./music-CfvjP45-.js";import{G as ya}from"./grip-vertical-DJgsXpN7.js";import{R as ra,T as ka}from"./trash-2-DA4I3Jzq.js";/** +import{aa as e,ac as L0,ad as x0,ae as w0,af as f0,ag as I0,ah as C0,H as N0,ai as b0,J as $0,aj as q0,ak as s,al as z0,am as S0,K as A0,an as H0,ao as j0,ap as V0,aq as P0,ar as B0,as as D0,at as F0,au as R0,av as T0,aw as U0,ax as O0,O as G0,ay as Z0,az as W0,G as E0,aA as X0,aB as K0,aC as Q0,aD as J0,aE as Y0,aF as ea,X as aa,aG as ca,aH as fL,aI as IL,aJ as CL,j as NL}from"./index-CPMnKQBc.js";import{D as ta,a as oa,b as da,c as l,F as na,L as ha,M as ia}from"./music-D2Ez1K-E.js";import{G as ya}from"./grip-vertical-Cn5hJClA.js";import{R as ra,T as ka}from"./trash-2-DwLXj_oo.js";/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. diff --git a/hifi/assets/index-eQrgtQRM.js b/hifi/assets/index-CPMnKQBc.js similarity index 87% rename from hifi/assets/index-eQrgtQRM.js rename to hifi/assets/index-CPMnKQBc.js index e106ea8..8dab8b7 100644 --- a/hifi/assets/index-eQrgtQRM.js +++ b/hifi/assets/index-CPMnKQBc.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ImageUploadField-2si66K3r.js","assets/resizeImage-C6PvAwh0.js","assets/iconRegistry-7Dpzjhyo.js","assets/music-CfvjP45-.js","assets/grip-vertical-DJgsXpN7.js","assets/trash-2-DA4I3Jzq.js","assets/DownloadsPage-ZpsuO5y1.js","assets/downloads-B9pqFegV.js","assets/Impressum-CuCyaRsx.js","assets/LegalPageView-CmgDetEJ.js","assets/Datenschutz-BxRbkKHM.js","assets/AGB-R24E6RC9.js","assets/Dashboard-Bb-z9N4S.js","assets/ImageOptimizer-Cv-egAvW.js","assets/contactRequests-Qfsfq7Lb.js","assets/Brands-C2MO3iab.js","assets/TextStyleWidget-Cc-J2FBP.js","assets/SortableList-B1XU_999.js","assets/sortable.esm-CN3X5f7p.js","assets/VehicleCatalogDialog-wGVVg0Ns.js","assets/Models-CTKD_2al.js","assets/GalleryBrands-BZZtQ1we.js","assets/ViewOnSite-B0vt49HS.js","assets/GalleryProjects-ClLNEVBB.js","assets/GalleryPhotos-B-ALbtsa.js","assets/Packages-BHzawgo-.js","assets/packageTiers-DOLFlFAh.js","assets/Services-Dv9GCIRs.js","assets/EntityList-CgZqBKVk.js","assets/Faqs-Dx6P5rru.js","assets/Partners-d4iHm0YC.js","assets/Downloads-BySos-u0.js","assets/HomeSections-8nB12J9S.js","assets/RichTextEditor-Da-meJrp.js","assets/SaveBar-DDpMGtuu.js","assets/ContactRequests-sFFVdlWu.js","assets/WebsiteSettings-Cn9gk2Zi.js","assets/LegalSettings-aQ858K4J.js","assets/EmailSettings-O9zitSOH.js","assets/DatabaseSettings-DCm6bks9.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ImageUploadField-DGJRkWaj.js","assets/resizeImage-C6PvAwh0.js","assets/iconRegistry-DXMu3JdV.js","assets/music-D2Ez1K-E.js","assets/grip-vertical-Cn5hJClA.js","assets/trash-2-DwLXj_oo.js","assets/DownloadsPage-BAC2Bbij.js","assets/downloads-B9pqFegV.js","assets/Impressum-CngzqAQz.js","assets/LegalPageView-DxOTKnHx.js","assets/Datenschutz-BSZ59Ypg.js","assets/AGB-BSBKNUL3.js","assets/Dashboard-CfZCB0xB.js","assets/ImageOptimizer-C38AVHT-.js","assets/contactRequests-Qfsfq7Lb.js","assets/Brands-CPunktmg.js","assets/TextStyleWidget-DGEJ-L-L.js","assets/SortableList-Dgddukss.js","assets/sortable.esm-CUwm6pqJ.js","assets/VehicleCatalogDialog-BmzJprBQ.js","assets/Models-oOmkNQSs.js","assets/GalleryBrands-D7kDEUzQ.js","assets/ViewOnSite-Dn1Ym5u6.js","assets/GalleryProjects-DFKgMPpK.js","assets/GalleryPhotos-CAByXSPv.js","assets/Packages-CIAy_ATE.js","assets/packageTiers-DOLFlFAh.js","assets/Services-BKtVbfxC.js","assets/EntityList-DPxkbA95.js","assets/Faqs-C6vUqhGa.js","assets/Partners-BTaZQlM9.js","assets/Downloads-DX6hhxmA.js","assets/HomeSections-FR9MpCKa.js","assets/RichTextEditor-B7bZ3Yjh.js","assets/SaveBar-D3LWnDZL.js","assets/ContactRequests-gigEl_0S.js","assets/WebsiteSettings-GXoKYAkf.js","assets/LegalSettings-Dyr-bPzl.js","assets/EmailSettings-4uXhtxt-.js","assets/DatabaseSettings-Da6s1jBa.js"])))=>i.map(i=>d[i]); function Mv(e,t){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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)}})();function _p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mp={exports:{}},uo={},Lp={exports:{}},ee={};/** * @license React * react.production.min.js @@ -23,7 +23,7 @@ function Mv(e,t){for(var n=0;n>>1,H=T[R];if(0>>1;R<_;){var I=2*(R+1)-1,Y=T[I],Z=I+1,ue=T[Z];if(0>s(Y,A))Zs(ue,Y)?(T[R]=ue,T[Z]=A,R=Z):(T[R]=Y,T[I]=A,R=I);else if(Zs(ue,A))T[R]=ue,T[Z]=A,R=Z;else break e}}return M}function s(T,M){var A=T.sortIndex-M.sortIndex;return A!==0?A:T.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var u=[],c=[],d=1,f=null,h=3,g=!1,v=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,p=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 y(T){for(var M=n(c);M!==null;){if(M.callback===null)r(c);else if(M.startTime<=T)r(c),M.sortIndex=M.expirationTime,t(u,M);else break;M=n(c)}}function k(T){if(b=!1,y(T),!v)if(n(u)!==null)v=!0,G(E);else{var M=n(c);M!==null&&V(k,M.startTime-T)}}function E(T,M){v=!1,b&&(b=!1,p(S),S=-1),g=!0;var A=h;try{for(y(M),f=n(u);f!==null&&(!(f.expirationTime>M)||T&&!F());){var R=f.callback;if(typeof R=="function"){f.callback=null,h=f.priorityLevel;var H=R(f.expirationTime<=M);M=e.unstable_now(),typeof H=="function"?f.callback=H:f===n(u)&&r(u),y(M)}else r(u);f=n(u)}if(f!==null)var _=!0;else{var I=n(c);I!==null&&V(k,I.startTime-M),_=!1}return _}finally{f=null,h=A,g=!1}}var C=!1,j=null,S=-1,N=5,P=-1;function F(){return!(e.unstable_now()-PT||125R?(T.sortIndex=A,t(c,T),n(u)===null&&T===n(c)&&(b?(p(S),S=-1):b=!0,V(k,A-R))):(T.sortIndex=H,t(u,T),v||g||(v=!0,G(E))),T},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(T){var M=h;return function(){var A=h;h=M;try{return T.apply(this,arguments)}finally{h=A}}}})(Wp);Up.exports=Wp;var e1=Up.exports;/** + */(function(e){function t(T,M){var A=T.length;T.push(M);e:for(;0>>1,H=T[R];if(0>>1;R<_;){var I=2*(R+1)-1,Y=T[I],Z=I+1,ue=T[Z];if(0>s(Y,A))Zs(ue,Y)?(T[R]=ue,T[Z]=A,R=Z):(T[R]=Y,T[I]=A,R=I);else if(Zs(ue,A))T[R]=ue,T[Z]=A,R=Z;else break e}}return M}function s(T,M){var A=T.sortIndex-M.sortIndex;return A!==0?A:T.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var u=[],c=[],d=1,f=null,h=3,g=!1,y=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,p=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 v(T){for(var M=n(c);M!==null;){if(M.callback===null)r(c);else if(M.startTime<=T)r(c),M.sortIndex=M.expirationTime,t(u,M);else break;M=n(c)}}function k(T){if(b=!1,v(T),!y)if(n(u)!==null)y=!0,G(E);else{var M=n(c);M!==null&&V(k,M.startTime-T)}}function E(T,M){y=!1,b&&(b=!1,p(S),S=-1),g=!0;var A=h;try{for(v(M),f=n(u);f!==null&&(!(f.expirationTime>M)||T&&!F());){var R=f.callback;if(typeof R=="function"){f.callback=null,h=f.priorityLevel;var H=R(f.expirationTime<=M);M=e.unstable_now(),typeof H=="function"?f.callback=H:f===n(u)&&r(u),v(M)}else r(u);f=n(u)}if(f!==null)var _=!0;else{var I=n(c);I!==null&&V(k,I.startTime-M),_=!1}return _}finally{f=null,h=A,g=!1}}var C=!1,j=null,S=-1,N=5,P=-1;function F(){return!(e.unstable_now()-PT||125R?(T.sortIndex=A,t(c,T),n(u)===null&&T===n(c)&&(b?(p(S),S=-1):b=!0,V(k,A-R))):(T.sortIndex=H,t(u,T),y||g||(y=!0,G(E))),T},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(T){var M=h;return function(){var A=h;h=M;try{return T.apply(this,arguments)}finally{h=A}}}})(Wp);Up.exports=Wp;var e1=Up.exports;/** * @license React * react-dom.production.min.js * @@ -35,10 +35,10 @@ function Mv(e,t){for(var n=0;nl||s[a]!==i[l]){var u=` -`+s[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=l);break}}}finally{Ho=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?bs(e):""}function a1(e){switch(e.tag){case 5:return bs(e.type);case 16:return bs("Lazy");case 13:return bs("Suspense");case 19:return bs("SuspenseList");case 0:case 2:case 15:return e=Uo(e.type,!1),e;case 11:return e=Uo(e.type.render,!1),e;case 1:return e=Uo(e.type,!0),e;default:return""}}function Kl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case kr:return"Fragment";case br:return"Portal";case Ul:return"Profiler";case Cc:return"StrictMode";case Wl:return"Suspense";case Gl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qp:return(e.displayName||"Context")+".Consumer";case Kp:return(e._context.displayName||"Context")+".Provider";case Tc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pc:return t=e.displayName||null,t!==null?t:Kl(e.type)||"Memo";case mn:t=e._payload,e=e._init;try{return Kl(e(t))}catch{}}return null}function o1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Kl(t);case 8:return t===Cc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Rn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function l1(e){var t=Xp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ni(e){e._valueTracker||(e._valueTracker=l1(e))}function Zp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Xp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ka(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ql(e,t){var n=t.checked;return be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function yf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Rn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qp(e,t){t=t.checked,t!=null&&Ec(e,"checked",t,!1)}function Yl(e,t){Qp(e,t);var n=Rn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xl(e,t.type,Rn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Xl(e,t,n){(t!=="number"||ka(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ks=Array.isArray;function Vr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=_i.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Us(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ts={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},u1=["Webkit","ms","Moz","O"];Object.keys(Ts).forEach(function(e){u1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ts[t]=Ts[e]})});function ng(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ts.hasOwnProperty(e)&&Ts[e]?(""+t).trim():t+"px"}function rg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=ng(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var c1=be({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 Jl(e,t){if(t){if(c1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function eu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tu=null;function Nc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nu=null,Fr=null,Or=null;function kf(e){if(e=gi(e)){if(typeof nu!="function")throw Error(D(280));var t=e.stateNode;t&&(t=po(t),nu(e.stateNode,e.type,t))}}function sg(e){Fr?Or?Or.push(e):Or=[e]:Fr=e}function ig(){if(Fr){var e=Fr,t=Or;if(Or=Fr=null,kf(e),t)for(e=0;e>>=0,e===0?32:31-(b1(e)/k1|0)|0}var Mi=64,Li=4194304;function Ss(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ca(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~s;l!==0?r=Ss(l):(i&=a,i!==0&&(r=Ss(i)))}else a=n&~s,a!==0?r=Ss(a):i!==0&&(r=Ss(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function mi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-It(t),e[t]=n}function C1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Ns),Mf=" ",Lf=!1;function Eg(e,t){switch(e){case"keyup":return ew.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sr=!1;function nw(e,t){switch(e){case"compositionend":return Cg(t);case"keypress":return t.which!==32?null:(Lf=!0,Mf);case"textInput":return e=t.data,e===Mf&&Lf?null:e;default:return null}}function rw(e,t){if(Sr)return e==="compositionend"||!Vc&&Eg(e,t)?(e=Sg(),ra=Dc=vn=null,Sr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=If(n)}}function _g(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_g(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mg(){for(var e=window,t=ka();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ka(e.document)}return t}function Fc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function fw(e){var t=Mg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_g(n.ownerDocument.documentElement,n)){if(r!==null&&Fc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Vf(n,i);var a=Vf(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,jr=null,lu=null,Ms=null,uu=!1;function Ff(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uu||jr==null||jr!==ka(r)||(r=jr,"selectionStart"in r&&Fc(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}),Ms&&Xs(Ms,r)||(Ms=r,r=Na(lu,"onSelect"),0Tr||(e.current=pu[Tr],pu[Tr]=null,Tr--)}function fe(e,t){Tr++,pu[Tr]=e.current,e.current=t}var In={},qe=On(In),ot=On(!1),sr=In;function Ur(e,t){var n=e.type.contextTypes;if(!n)return In;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function lt(e){return e=e.childContextTypes,e!=null}function Ma(){pe(ot),pe(qe)}function Wf(e,t,n){if(qe.current!==In)throw Error(D(168));fe(qe,t),fe(ot,n)}function zg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(D(108,o1(e)||"Unknown",s));return be({},n,r)}function La(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,sr=qe.current,fe(qe,e),fe(ot,ot.current),!0}function Gf(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=zg(e,t,sr),r.__reactInternalMemoizedMergedChildContext=e,pe(ot),pe(qe),fe(qe,e)):pe(ot),fe(ot,n)}var Jt=null,go=!1,sl=!1;function Bg(e){Jt===null?Jt=[e]:Jt.push(e)}function jw(e){go=!0,Bg(e)}function zn(){if(!sl&&Jt!==null){sl=!0;var e=0,t=le;try{var n=Jt;for(le=1;e>=a,s-=a,en=1<<32-It(t)+s|n<S?(N=j,j=null):N=j.sibling;var P=h(p,j,y[S],k);if(P===null){j===null&&(j=N);break}e&&j&&P.alternate===null&&t(p,j),x=i(P,x,S),C===null?E=P:C.sibling=P,C=P,j=N}if(S===y.length)return n(p,j),ge&&Gn(p,S),E;if(j===null){for(;SS?(N=j,j=null):N=j.sibling;var F=h(p,j,P.value,k);if(F===null){j===null&&(j=N);break}e&&j&&F.alternate===null&&t(p,j),x=i(F,x,S),C===null?E=F:C.sibling=F,C=F,j=N}if(P.done)return n(p,j),ge&&Gn(p,S),E;if(j===null){for(;!P.done;S++,P=y.next())P=f(p,P.value,k),P!==null&&(x=i(P,x,S),C===null?E=P:C.sibling=P,C=P);return ge&&Gn(p,S),E}for(j=r(p,j);!P.done;S++,P=y.next())P=g(j,p,S,P.value,k),P!==null&&(e&&P.alternate!==null&&j.delete(P.key===null?S:P.key),x=i(P,x,S),C===null?E=P:C.sibling=P,C=P);return e&&j.forEach(function(B){return t(p,B)}),ge&&Gn(p,S),E}function w(p,x,y,k){if(typeof y=="object"&&y!==null&&y.type===kr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Pi:e:{for(var E=y.key,C=x;C!==null;){if(C.key===E){if(E=y.type,E===kr){if(C.tag===7){n(p,C.sibling),x=s(C,y.props.children),x.return=p,p=x;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===mn&&Yf(E)===C.type){n(p,C.sibling),x=s(C,y.props),x.ref=ms(p,C,y),x.return=p,p=x;break e}n(p,C);break}else t(p,C);C=C.sibling}y.type===kr?(x=tr(y.props.children,p.mode,k,y.key),x.return=p,p=x):(k=da(y.type,y.key,y.props,null,p.mode,k),k.ref=ms(p,x,y),k.return=p,p=k)}return a(p);case br:e:{for(C=y.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){n(p,x.sibling),x=s(x,y.children||[]),x.return=p,p=x;break e}else{n(p,x);break}else t(p,x);x=x.sibling}x=fl(y,p.mode,k),x.return=p,p=x}return a(p);case mn:return C=y._init,w(p,x,C(y._payload),k)}if(ks(y))return v(p,x,y,k);if(us(y))return b(p,x,y,k);Oi(p,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,x!==null&&x.tag===6?(n(p,x.sibling),x=s(x,y),x.return=p,p=x):(n(p,x),x=dl(y,p.mode,k),x.return=p,p=x),a(p)):n(p,x)}return w}var Gr=Wg(!0),Gg=Wg(!1),Ra=On(null),Ia=null,_r=null,$c=null;function Hc(){$c=_r=Ia=null}function Uc(e){var t=Ra.current;pe(Ra),e._currentValue=t}function yu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Br(e,t){Ia=e,$c=_r=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(at=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if($c!==e)if(e={context:e,memoizedValue:t,next:null},_r===null){if(Ia===null)throw Error(D(308));_r=e,Ia.dependencies={lanes:0,firstContext:e}}else _r=_r.next=e;return t}var Xn=null;function Wc(e){Xn===null?Xn=[e]:Xn.push(e)}function Kg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Wc(t)):(n.next=s.next,s.next=n),t.interleaved=n,on(e,r)}function on(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var pn=!1;function Gc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ie&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,on(e,n)}return s=r.interleaved,s===null?(t.next=t,Wc(r)):(t.next=s.next,s.next=t),r.interleaved=t,on(e,n)}function ia(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}function Xf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Va(e,t,n,r){var s=e.updateQueue;pn=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var u=l,c=u.next;u.next=null,a===null?i=c:a.next=c,a=u;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=u))}if(i!==null){var f=s.baseState;a=0,d=c=u=null,l=i;do{var h=l.lane,g=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,b=l;switch(h=t,g=n,b.tag){case 1:if(v=b.payload,typeof v=="function"){f=v.call(g,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=b.payload,h=typeof v=="function"?v.call(g,f,h):v,h==null)break e;f=be({},f,h);break e;case 2:pn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else g={eventTime:g,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(c=d=g,u=f):d=d.next=g,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(u=f),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);or|=a,e.lanes=a,e.memoizedState=f}}function Zf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=al.transition;al.transition={};try{e(!1),t()}finally{le=n,al.transition=r}}function d0(){return Ct().memoizedState}function Pw(e,t,n){var r=_n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},f0(e))h0(t,n);else if(n=Kg(e,t,n,r),n!==null){var s=nt();Vt(n,e,r,s),m0(n,t,r)}}function Nw(e,t,n){var r=_n(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(f0(e))h0(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,Ot(l,a)){var u=t.interleaved;u===null?(s.next=s,Wc(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Kg(e,t,s,r),n!==null&&(s=nt(),Vt(n,e,r,s),m0(n,t,r))}}function f0(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function h0(e,t){Ls=Oa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function m0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}var za={readContext:Et,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},_w={readContext:Et,useCallback:function(e,t){return $t().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Jf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,oa(4194308,4,a0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return oa(4194308,4,e,t)},useInsertionEffect:function(e,t){return oa(4,2,e,t)},useMemo:function(e,t){var n=$t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$t();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Pw.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=$t();return e={current:e},t.memoizedState=e},useState:Qf,useDebugValue:ed,useDeferredValue:function(e){return $t().memoizedState=e},useTransition:function(){var e=Qf(!1),t=e[0];return e=Tw.bind(null,e[1]),$t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,s=$t();if(ge){if(n===void 0)throw Error(D(407));n=n()}else{if(n=t(),Ve===null)throw Error(D(349));ar&30||Qg(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Jf(e0.bind(null,r,i,e),[e]),r.flags|=2048,si(9,Jg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=$t(),t=Ve.identifierPrefix;if(ge){var n=tn,r=en;n=(r&~(1<<32-It(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ni++,0")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=l);break}}}finally{Ho=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?bs(e):""}function a1(e){switch(e.tag){case 5:return bs(e.type);case 16:return bs("Lazy");case 13:return bs("Suspense");case 19:return bs("SuspenseList");case 0:case 2:case 15:return e=Uo(e.type,!1),e;case 11:return e=Uo(e.type.render,!1),e;case 1:return e=Uo(e.type,!0),e;default:return""}}function Kl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case kr:return"Fragment";case br:return"Portal";case Ul:return"Profiler";case Cc:return"StrictMode";case Wl:return"Suspense";case Gl:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qp:return(e.displayName||"Context")+".Consumer";case Kp:return(e._context.displayName||"Context")+".Provider";case Tc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pc:return t=e.displayName||null,t!==null?t:Kl(e.type)||"Memo";case mn:t=e._payload,e=e._init;try{return Kl(e(t))}catch{}}return null}function o1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Kl(t);case 8:return t===Cc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Rn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function l1(e){var t=Xp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ni(e){e._valueTracker||(e._valueTracker=l1(e))}function Zp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Xp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ka(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ql(e,t){var n=t.checked;return be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function yf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Rn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qp(e,t){t=t.checked,t!=null&&Ec(e,"checked",t,!1)}function Yl(e,t){Qp(e,t);var n=Rn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xl(e,t.type,Rn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vf(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Xl(e,t,n){(t!=="number"||ka(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var ks=Array.isArray;function Vr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=_i.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Us(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ts={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},u1=["Webkit","ms","Moz","O"];Object.keys(Ts).forEach(function(e){u1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ts[t]=Ts[e]})});function ng(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ts.hasOwnProperty(e)&&Ts[e]?(""+t).trim():t+"px"}function rg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=ng(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var c1=be({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 Jl(e,t){if(t){if(c1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function eu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tu=null;function Nc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nu=null,Fr=null,Or=null;function kf(e){if(e=gi(e)){if(typeof nu!="function")throw Error(D(280));var t=e.stateNode;t&&(t=po(t),nu(e.stateNode,e.type,t))}}function sg(e){Fr?Or?Or.push(e):Or=[e]:Fr=e}function ig(){if(Fr){var e=Fr,t=Or;if(Or=Fr=null,kf(e),t)for(e=0;e>>=0,e===0?32:31-(b1(e)/k1|0)|0}var Mi=64,Li=4194304;function Ss(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ca(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~s;l!==0?r=Ss(l):(i&=a,i!==0&&(r=Ss(i)))}else a=n&~s,a!==0?r=Ss(a):i!==0&&(r=Ss(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function mi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-It(t),e[t]=n}function C1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Ns),Mf=" ",Lf=!1;function Eg(e,t){switch(e){case"keyup":return ew.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sr=!1;function nw(e,t){switch(e){case"compositionend":return Cg(t);case"keypress":return t.which!==32?null:(Lf=!0,Mf);case"textInput":return e=t.data,e===Mf&&Lf?null:e;default:return null}}function rw(e,t){if(Sr)return e==="compositionend"||!Vc&&Eg(e,t)?(e=Sg(),ra=Dc=vn=null,Sr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=If(n)}}function _g(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_g(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mg(){for(var e=window,t=ka();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ka(e.document)}return t}function Fc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function fw(e){var t=Mg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&_g(n.ownerDocument.documentElement,n)){if(r!==null&&Fc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Vf(n,i);var a=Vf(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,jr=null,lu=null,Ms=null,uu=!1;function Ff(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uu||jr==null||jr!==ka(r)||(r=jr,"selectionStart"in r&&Fc(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}),Ms&&Xs(Ms,r)||(Ms=r,r=Na(lu,"onSelect"),0Tr||(e.current=pu[Tr],pu[Tr]=null,Tr--)}function fe(e,t){Tr++,pu[Tr]=e.current,e.current=t}var In={},qe=On(In),ot=On(!1),sr=In;function Ur(e,t){var n=e.type.contextTypes;if(!n)return In;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function lt(e){return e=e.childContextTypes,e!=null}function Ma(){pe(ot),pe(qe)}function Wf(e,t,n){if(qe.current!==In)throw Error(D(168));fe(qe,t),fe(ot,n)}function zg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(D(108,o1(e)||"Unknown",s));return be({},n,r)}function La(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||In,sr=qe.current,fe(qe,e),fe(ot,ot.current),!0}function Gf(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=zg(e,t,sr),r.__reactInternalMemoizedMergedChildContext=e,pe(ot),pe(qe),fe(qe,e)):pe(ot),fe(ot,n)}var Jt=null,go=!1,sl=!1;function Bg(e){Jt===null?Jt=[e]:Jt.push(e)}function jw(e){go=!0,Bg(e)}function zn(){if(!sl&&Jt!==null){sl=!0;var e=0,t=le;try{var n=Jt;for(le=1;e>=a,s-=a,en=1<<32-It(t)+s|n<S?(N=j,j=null):N=j.sibling;var P=h(p,j,v[S],k);if(P===null){j===null&&(j=N);break}e&&j&&P.alternate===null&&t(p,j),x=i(P,x,S),C===null?E=P:C.sibling=P,C=P,j=N}if(S===v.length)return n(p,j),ge&&Gn(p,S),E;if(j===null){for(;SS?(N=j,j=null):N=j.sibling;var F=h(p,j,P.value,k);if(F===null){j===null&&(j=N);break}e&&j&&F.alternate===null&&t(p,j),x=i(F,x,S),C===null?E=F:C.sibling=F,C=F,j=N}if(P.done)return n(p,j),ge&&Gn(p,S),E;if(j===null){for(;!P.done;S++,P=v.next())P=f(p,P.value,k),P!==null&&(x=i(P,x,S),C===null?E=P:C.sibling=P,C=P);return ge&&Gn(p,S),E}for(j=r(p,j);!P.done;S++,P=v.next())P=g(j,p,S,P.value,k),P!==null&&(e&&P.alternate!==null&&j.delete(P.key===null?S:P.key),x=i(P,x,S),C===null?E=P:C.sibling=P,C=P);return e&&j.forEach(function(B){return t(p,B)}),ge&&Gn(p,S),E}function w(p,x,v,k){if(typeof v=="object"&&v!==null&&v.type===kr&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Pi:e:{for(var E=v.key,C=x;C!==null;){if(C.key===E){if(E=v.type,E===kr){if(C.tag===7){n(p,C.sibling),x=s(C,v.props.children),x.return=p,p=x;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===mn&&Yf(E)===C.type){n(p,C.sibling),x=s(C,v.props),x.ref=ms(p,C,v),x.return=p,p=x;break e}n(p,C);break}else t(p,C);C=C.sibling}v.type===kr?(x=tr(v.props.children,p.mode,k,v.key),x.return=p,p=x):(k=da(v.type,v.key,v.props,null,p.mode,k),k.ref=ms(p,x,v),k.return=p,p=k)}return a(p);case br:e:{for(C=v.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===v.containerInfo&&x.stateNode.implementation===v.implementation){n(p,x.sibling),x=s(x,v.children||[]),x.return=p,p=x;break e}else{n(p,x);break}else t(p,x);x=x.sibling}x=fl(v,p.mode,k),x.return=p,p=x}return a(p);case mn:return C=v._init,w(p,x,C(v._payload),k)}if(ks(v))return y(p,x,v,k);if(us(v))return b(p,x,v,k);Oi(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,x!==null&&x.tag===6?(n(p,x.sibling),x=s(x,v),x.return=p,p=x):(n(p,x),x=dl(v,p.mode,k),x.return=p,p=x),a(p)):n(p,x)}return w}var Gr=Wg(!0),Gg=Wg(!1),Ra=On(null),Ia=null,_r=null,$c=null;function Hc(){$c=_r=Ia=null}function Uc(e){var t=Ra.current;pe(Ra),e._currentValue=t}function yu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Br(e,t){Ia=e,$c=_r=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(at=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if($c!==e)if(e={context:e,memoizedValue:t,next:null},_r===null){if(Ia===null)throw Error(D(308));_r=e,Ia.dependencies={lanes:0,firstContext:e}}else _r=_r.next=e;return t}var Xn=null;function Wc(e){Xn===null?Xn=[e]:Xn.push(e)}function Kg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Wc(t)):(n.next=s.next,s.next=n),t.interleaved=n,on(e,r)}function on(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var pn=!1;function Gc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ie&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,on(e,n)}return s=r.interleaved,s===null?(t.next=t,Wc(r)):(t.next=s.next,s.next=t),r.interleaved=t,on(e,n)}function ia(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}function Xf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Va(e,t,n,r){var s=e.updateQueue;pn=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var u=l,c=u.next;u.next=null,a===null?i=c:a.next=c,a=u;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=c:l.next=c,d.lastBaseUpdate=u))}if(i!==null){var f=s.baseState;a=0,d=c=u=null,l=i;do{var h=l.lane,g=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,b=l;switch(h=t,g=n,b.tag){case 1:if(y=b.payload,typeof y=="function"){f=y.call(g,f,h);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=b.payload,h=typeof y=="function"?y.call(g,f,h):y,h==null)break e;f=be({},f,h);break e;case 2:pn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[l]:h.push(l))}else g={eventTime:g,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(c=d=g,u=f):d=d.next=g,a|=h;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;h=l,l=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(u=f),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);or|=a,e.lanes=a,e.memoizedState=f}}function Zf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=al.transition;al.transition={};try{e(!1),t()}finally{le=n,al.transition=r}}function d0(){return Ct().memoizedState}function Pw(e,t,n){var r=_n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},f0(e))h0(t,n);else if(n=Kg(e,t,n,r),n!==null){var s=nt();Vt(n,e,r,s),m0(n,t,r)}}function Nw(e,t,n){var r=_n(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(f0(e))h0(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,Ot(l,a)){var u=t.interleaved;u===null?(s.next=s,Wc(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Kg(e,t,s,r),n!==null&&(s=nt(),Vt(n,e,r,s),m0(n,t,r))}}function f0(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function h0(e,t){Ls=Oa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function m0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}var za={readContext:Et,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},_w={readContext:Et,useCallback:function(e,t){return $t().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Jf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,oa(4194308,4,a0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return oa(4194308,4,e,t)},useInsertionEffect:function(e,t){return oa(4,2,e,t)},useMemo:function(e,t){var n=$t();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$t();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Pw.bind(null,ve,e),[r.memoizedState,e]},useRef:function(e){var t=$t();return e={current:e},t.memoizedState=e},useState:Qf,useDebugValue:ed,useDeferredValue:function(e){return $t().memoizedState=e},useTransition:function(){var e=Qf(!1),t=e[0];return e=Tw.bind(null,e[1]),$t().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ve,s=$t();if(ge){if(n===void 0)throw Error(D(407));n=n()}else{if(n=t(),Ve===null)throw Error(D(349));ar&30||Qg(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Jf(e0.bind(null,r,i,e),[e]),r.flags|=2048,si(9,Jg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=$t(),t=Ve.identifierPrefix;if(ge){var n=tn,r=en;n=(r&~(1<<32-It(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ni++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Wt]=t,e[Js]=r,j0(e,t,!1,!1),t.stateNode=e;e:{switch(a=eu(n,r),n){case"dialog":me("cancel",e),me("close",e),s=r;break;case"iframe":case"object":case"embed":me("load",e),s=r;break;case"video":case"audio":for(s=0;sYr&&(t.flags|=128,r=!0,ps(i,!1),t.lanes=4194304)}else{if(!r)if(e=Fa(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ps(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ge)return He(t),null}else 2*Ee()-i.renderingStartTime>Yr&&n!==1073741824&&(t.flags|=128,r=!0,ps(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ee(),t.sibling=null,n=ye.current,fe(ye,r?n&1|2:n&1),t):(He(t),null);case 22:case 23:return ad(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ht&1073741824&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function Fw(e,t){switch(zc(t),t.tag){case 1:return lt(t.type)&&Ma(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kr(),pe(ot),pe(qe),Yc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qc(t),null;case 13:if(pe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));Wr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ye),null;case 4:return Kr(),null;case 10:return Uc(t.type._context),null;case 22:case 23:return ad(),null;case 24:return null;default:return null}}var Bi=!1,Ke=!1,Ow=typeof WeakSet=="function"?WeakSet:Set,O=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){je(e,t,r)}else n.current=null}function Tu(e,t,n){try{n()}catch(r){je(e,t,r)}}var ch=!1;function zw(e,t){if(cu=Ta,e=Mg(),Fc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.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 a=0,l=-1,u=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var g;f!==n||s!==0&&f.nodeType!==3||(l=a+s),f!==i||r!==0&&f.nodeType!==3||(u=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===e)break t;if(h===n&&++c===s&&(l=a),h===i&&++d===r&&(u=a),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(du={focusedElem:e,selectionRange:n},Ta=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var b=v.memoizedProps,w=v.memoizedState,p=t.stateNode,x=p.getSnapshotBeforeUpdate(t.elementType===t.type?b:Lt(t.type,b),w);p.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(k){je(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return v=ch,ch=!1,v}function As(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Tu(t,n,i)}s=s.next}while(s!==r)}}function vo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function T0(e){var t=e.alternate;t!==null&&(e.alternate=null,T0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[Js],delete t[mu],delete t[kw],delete t[Sw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function P0(e){return e.tag===5||e.tag===3||e.tag===4}function dh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||P0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Nu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_a));else if(r!==4&&(e=e.child,e!==null))for(Nu(e,t,n),e=e.sibling;e!==null;)Nu(e,t,n),e=e.sibling}function _u(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(_u(e,t,n),e=e.sibling;e!==null;)_u(e,t,n),e=e.sibling}var Fe=null,At=!1;function fn(e,t,n){for(n=n.child;n!==null;)N0(e,t,n),n=n.sibling}function N0(e,t,n){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(co,n)}catch{}switch(n.tag){case 5:Ke||Mr(n,t);case 6:var r=Fe,s=At;Fe=null,fn(e,t,n),Fe=r,At=s,Fe!==null&&(At?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(At?(e=Fe,n=n.stateNode,e.nodeType===8?rl(e.parentNode,n):e.nodeType===1&&rl(e,n),qs(e)):rl(Fe,n.stateNode));break;case 4:r=Fe,s=At,Fe=n.stateNode.containerInfo,At=!0,fn(e,t,n),Fe=r,At=s;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Tu(n,t,a),s=s.next}while(s!==r)}fn(e,t,n);break;case 1:if(!Ke&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){je(n,t,l)}fn(e,t,n);break;case 21:fn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,fn(e,t,n),Ke=r):fn(e,t,n);break;default:fn(e,t,n)}}function fh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ow),t.forEach(function(r){var s=Yw.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$w(r/1960))-r,10e?16:e,wn===null)var r=!1;else{if(e=wn,wn=null,Ha=0,ie&6)throw Error(D(331));var s=ie;for(ie|=4,O=e.current;O!==null;){var i=O,a=i.child;if(O.flags&16){var l=i.deletions;if(l!==null){for(var u=0;uEe()-sd?er(e,0):rd|=n),ut(e,t)}function V0(e,t){t===0&&(e.mode&1?(t=Li,Li<<=1,!(Li&130023424)&&(Li=4194304)):t=1);var n=nt();e=on(e,t),e!==null&&(mi(e,t,n),ut(e,n))}function qw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),V0(e,n)}function Yw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(t),V0(e,n)}var F0;F0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)at=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return at=!1,Iw(e,t,n);at=!!(e.flags&131072)}else at=!1,ge&&t.flags&1048576&&$g(t,Da,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;la(e,t),e=t.pendingProps;var s=Ur(t,qe.current);Br(t,n),s=Zc(null,t,r,e,s,n);var i=Qc();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(i=!0,La(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Gc(t),s.updater=yo,t.stateNode=s,s._reactInternals=t,wu(t,r,e,n),t=Su(null,t,r,!0,i,n)):(t.tag=0,ge&&i&&Oc(t),Je(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(la(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Zw(r),e=Lt(r,e),s){case 0:t=ku(null,t,r,e,n);break e;case 1:t=oh(null,t,r,e,n);break e;case 11:t=ih(null,t,r,e,n);break e;case 14:t=ah(null,t,r,Lt(r.type,e),n);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Lt(r,s),ku(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Lt(r,s),oh(e,t,r,s,n);case 3:e:{if(b0(t),e===null)throw Error(D(387));r=t.pendingProps,i=t.memoizedState,s=i.element,qg(e,t),Va(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=qr(Error(D(423)),t),t=lh(e,t,r,n,s);break e}else if(r!==s){s=qr(Error(D(424)),t),t=lh(e,t,r,n,s);break e}else for(mt=Tn(t.stateNode.containerInfo.firstChild),pt=t,ge=!0,Dt=null,n=Gg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wr(),r===s){t=ln(e,t,n);break e}Je(e,t,r,n)}t=t.child}return t;case 5:return Yg(t),e===null&&xu(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,fu(r,s)?a=null:i!==null&&fu(r,i)&&(t.flags|=32),w0(e,t),Je(e,t,a,n),t.child;case 6:return e===null&&xu(t),null;case 13:return k0(e,t,n);case 4:return Kc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gr(t,null,r,n):Je(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Lt(r,s),ih(e,t,r,s,n);case 7:return Je(e,t,t.pendingProps,n),t.child;case 8:return Je(e,t,t.pendingProps.children,n),t.child;case 12:return Je(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,fe(Ra,r._currentValue),r._currentValue=a,i!==null)if(Ot(i.value,a)){if(i.children===s.children&&!ot.current){t=ln(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=rn(-1,n&-n),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),yu(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(D(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),yu(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Je(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Br(t,n),s=Et(s),r=r(s),t.flags|=1,Je(e,t,r,n),t.child;case 14:return r=t.type,s=Lt(r,t.pendingProps),s=Lt(r.type,s),ah(e,t,r,s,n);case 15:return y0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Lt(r,s),la(e,t),t.tag=1,lt(r)?(e=!0,La(t)):e=!1,Br(t,n),p0(t,r,s),wu(t,r,s,n),Su(null,t,r,!0,e,n);case 19:return S0(e,t,n);case 22:return v0(e,t,n)}throw Error(D(156,t.tag))};function O0(e,t){return fg(e,t)}function Xw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,n,r){return new Xw(e,t,n,r)}function ld(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zw(e){if(typeof e=="function")return ld(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Tc)return 11;if(e===Pc)return 14}return 2}function Mn(e,t){var n=e.alternate;return n===null?(n=kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function da(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")ld(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case kr:return tr(n.children,s,i,t);case Cc:a=8,s|=8;break;case Ul:return e=kt(12,n,t,s|2),e.elementType=Ul,e.lanes=i,e;case Wl:return e=kt(13,n,t,s),e.elementType=Wl,e.lanes=i,e;case Gl:return e=kt(19,n,t,s),e.elementType=Gl,e.lanes=i,e;case Yp:return bo(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kp:a=10;break e;case qp:a=9;break e;case Tc:a=11;break e;case Pc:a=14;break e;case mn:a=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=kt(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function tr(e,t,n,r){return e=kt(7,e,r,t),e.lanes=n,e}function bo(e,t,n,r){return e=kt(22,e,r,t),e.elementType=Yp,e.lanes=n,e.stateNode={isHidden:!1},e}function dl(e,t,n){return e=kt(6,e,null,t),e.lanes=n,e}function fl(e,t,n){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qw(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Go(0),this.expirationTimes=Go(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Go(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ud(e,t,n,r,s,i,a,l,u){return e=new Qw(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=kt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gc(i),e}function Jw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(H0)}catch(e){console.error(e)}}H0(),Hp.exports=yt;var hd=Hp.exports;const u4=_p(hd);var wh=hd;$l.createRoot=wh.createRoot,$l.hydrateRoot=wh.hydrateRoot;/** +`+i.stack}return{value:e,source:t,stack:s,digest:null}}function ul(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Aw=typeof WeakMap=="function"?WeakMap:Map;function g0(e,t,n){n=rn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$a||($a=!0,Mu=r),bu(e,t)},n}function x0(e,t,n){n=rn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){bu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){bu(e,t),typeof r!="function"&&(Nn===null?Nn=new Set([this]):Nn.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function nh(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Aw;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Kw.bind(null,e,t,n),t.then(e,e))}function rh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function sh(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=rn(-1,1),t.tag=2,Pn(n,t,1))),n.lanes|=1),e)}var Dw=cn.ReactCurrentOwner,at=!1;function Je(e,t,n,r){t.child=e===null?Gg(t,null,n,r):Gr(t,e.child,n,r)}function ih(e,t,n,r,s){n=n.render;var i=t.ref;return Br(t,s),r=Zc(e,t,n,r,i,s),n=Qc(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ln(e,t,s)):(ge&&n&&Oc(t),t.flags|=1,Je(e,t,r,s),t.child)}function ah(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!ld(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,y0(e,t,i,r,s)):(e=da(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:Xs,n(a,r)&&e.ref===t.ref)return ln(e,t,s)}return t.flags|=1,e=Mn(i,r),e.ref=t.ref,e.return=t,t.child=e}function y0(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Xs(i,r)&&e.ref===t.ref)if(at=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(at=!0);else return t.lanes=e.lanes,ln(e,t,s)}return ku(e,t,n,r,s)}function v0(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(Lr,ht),ht|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(Lr,ht),ht|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,fe(Lr,ht),ht|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,fe(Lr,ht),ht|=r;return Je(e,t,s,n),t.child}function w0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ku(e,t,n,r,s){var i=lt(n)?sr:qe.current;return i=Ur(t,i),Br(t,s),n=Zc(e,t,n,r,i,s),r=Qc(),e!==null&&!at?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ln(e,t,s)):(ge&&r&&Oc(t),t.flags|=1,Je(e,t,n,s),t.child)}function oh(e,t,n,r,s){if(lt(n)){var i=!0;La(t)}else i=!1;if(Br(t,s),t.stateNode===null)la(e,t),p0(t,n,r),wu(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var u=a.context,c=n.contextType;typeof c=="object"&&c!==null?c=Et(c):(c=lt(n)?sr:qe.current,c=Ur(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||u!==c)&&th(t,a,r,c),pn=!1;var h=t.memoizedState;a.state=h,Va(t,r,a,s),u=t.memoizedState,l!==r||h!==u||ot.current||pn?(typeof d=="function"&&(vu(t,n,d,r),u=t.memoizedState),(l=pn||eh(t,n,l,r,h,u,c))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=u),a.props=r,a.state=u,a.context=c,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,qg(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Lt(t.type,l),a.props=c,f=t.pendingProps,h=a.context,u=n.contextType,typeof u=="object"&&u!==null?u=Et(u):(u=lt(n)?sr:qe.current,u=Ur(t,u));var g=n.getDerivedStateFromProps;(d=typeof g=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||h!==u)&&th(t,a,r,u),pn=!1,h=t.memoizedState,a.state=h,Va(t,r,a,s);var y=t.memoizedState;l!==f||h!==y||ot.current||pn?(typeof g=="function"&&(vu(t,n,g,r),y=t.memoizedState),(c=pn||eh(t,n,c,r,h,y,u)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,y,u),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,y,u)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),a.props=r,a.state=y,a.context=u,r=c):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Su(e,t,n,r,i,s)}function Su(e,t,n,r,s,i){w0(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&Gf(t,n,!1),ln(e,t,i);r=t.stateNode,Dw.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Gr(t,e.child,null,i),t.child=Gr(t,null,l,i)):Je(e,t,l,i),t.memoizedState=r.state,s&&Gf(t,n,!0),t.child}function b0(e){var t=e.stateNode;t.pendingContext?Wf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wf(e,t.context,!1),Kc(e,t.containerInfo)}function lh(e,t,n,r,s){return Wr(),Bc(s),t.flags|=256,Je(e,t,n,r),t.child}var ju={dehydrated:null,treeContext:null,retryLane:0};function Eu(e){return{baseLanes:e,cachePool:null,transitions:null}}function k0(e,t,n){var r=t.pendingProps,s=ye.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),fe(ye,s&1),e===null)return xu(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=bo(a,r,0,null),e=tr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Eu(n),t.memoizedState=ju,e):td(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return Rw(e,t,a,r,l,s,n);if(i){i=r.fallback,a=t.mode,s=e.child,l=s.sibling;var u={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=u,t.deletions=null):(r=Mn(s,u),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Mn(l,i):(i=tr(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?Eu(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=ju,r}return i=e.child,e=i.sibling,r=Mn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function td(e,t){return t=bo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function zi(e,t,n,r){return r!==null&&Bc(r),Gr(t,e.child,null,n),e=td(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rw(e,t,n,r,s,i,a){if(n)return t.flags&256?(t.flags&=-257,r=ul(Error(D(422))),zi(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=bo({mode:"visible",children:r.children},s,0,null),i=tr(i,s,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Gr(t,e.child,null,a),t.child.memoizedState=Eu(a),t.memoizedState=ju,i);if(!(t.mode&1))return zi(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(D(419)),r=ul(i,r,void 0),zi(e,t,a,r)}if(l=(a&e.childLanes)!==0,at||l){if(r=Ve,r!==null){switch(a&-a){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|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,on(e,s),Vt(r,e,s,-1))}return od(),r=ul(Error(D(421))),zi(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=qw.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,mt=Tn(s.nextSibling),pt=t,ge=!0,Dt=null,e!==null&&(wt[bt++]=en,wt[bt++]=tn,wt[bt++]=ir,en=e.id,tn=e.overflow,ir=t),t=td(t,r.children),t.flags|=4096,t)}function uh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),yu(e.return,t,n)}function cl(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function S0(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Je(e,t,r.children,n),r=ye.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uh(e,n,t);else if(e.tag===19)uh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(fe(ye,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Fa(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),cl(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Fa(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}cl(t,!0,n,null,i);break;case"together":cl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function la(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),or|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(D(153));if(t.child!==null){for(e=t.child,n=Mn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Iw(e,t,n){switch(t.tag){case 3:b0(t),Wr();break;case 5:Yg(t);break;case 1:lt(t.type)&&La(t);break;case 4:Kc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;fe(Ra,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(ye,ye.current&1),t.flags|=128,null):n&t.child.childLanes?k0(e,t,n):(fe(ye,ye.current&1),e=ln(e,t,n),e!==null?e.sibling:null);fe(ye,ye.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return S0(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fe(ye,ye.current),r)break;return null;case 22:case 23:return t.lanes=0,v0(e,t,n)}return ln(e,t,n)}var j0,Cu,E0,C0;j0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Cu=function(){};E0=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Zn(Kt.current);var i=null;switch(n){case"input":s=ql(e,s),r=ql(e,r),i=[];break;case"select":s=be({},s,{value:void 0}),r=be({},r,{value:void 0}),i=[];break;case"textarea":s=Zl(e,s),r=Zl(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=_a)}Jl(n,r);var a;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var l=s[c];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Hs.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var u=r[c];if(l=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(u!=null||l!=null))if(c==="style")if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(i||(i=[]),i.push(c,n)),n=u;else c==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(i=i||[]).push(c,u)):c==="children"?typeof u!="string"&&typeof u!="number"||(i=i||[]).push(c,""+u):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Hs.hasOwnProperty(c)?(u!=null&&c==="onScroll"&&me("scroll",e),i||l===u||(i=[])):(i=i||[]).push(c,u))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};C0=function(e,t,n,r){n!==r&&(t.flags|=4)};function ps(e,t){if(!ge)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Vw(e,t,n){var r=t.pendingProps;switch(zc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return lt(t.type)&&Ma(),He(t),null;case 3:return r=t.stateNode,Kr(),pe(ot),pe(qe),Yc(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Dt!==null&&(Du(Dt),Dt=null))),Cu(e,t),He(t),null;case 5:qc(t);var s=Zn(ti.current);if(n=t.type,e!==null&&t.stateNode!=null)E0(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(D(166));return He(t),null}if(e=Zn(Kt.current),Fi(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Wt]=t,r[Js]=i,e=(t.mode&1)!==0,n){case"dialog":me("cancel",r),me("close",r);break;case"iframe":case"object":case"embed":me("load",r);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Wt]=t,e[Js]=r,j0(e,t,!1,!1),t.stateNode=e;e:{switch(a=eu(n,r),n){case"dialog":me("cancel",e),me("close",e),s=r;break;case"iframe":case"object":case"embed":me("load",e),s=r;break;case"video":case"audio":for(s=0;sYr&&(t.flags|=128,r=!0,ps(i,!1),t.lanes=4194304)}else{if(!r)if(e=Fa(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ps(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ge)return He(t),null}else 2*Ee()-i.renderingStartTime>Yr&&n!==1073741824&&(t.flags|=128,r=!0,ps(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ee(),t.sibling=null,n=ye.current,fe(ye,r?n&1|2:n&1),t):(He(t),null);case 22:case 23:return ad(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ht&1073741824&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function Fw(e,t){switch(zc(t),t.tag){case 1:return lt(t.type)&&Ma(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kr(),pe(ot),pe(qe),Yc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qc(t),null;case 13:if(pe(ye),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));Wr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pe(ye),null;case 4:return Kr(),null;case 10:return Uc(t.type._context),null;case 22:case 23:return ad(),null;case 24:return null;default:return null}}var Bi=!1,Ke=!1,Ow=typeof WeakSet=="function"?WeakSet:Set,O=null;function Mr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){je(e,t,r)}else n.current=null}function Tu(e,t,n){try{n()}catch(r){je(e,t,r)}}var ch=!1;function zw(e,t){if(cu=Ta,e=Mg(),Fc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.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 a=0,l=-1,u=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var g;f!==n||s!==0&&f.nodeType!==3||(l=a+s),f!==i||r!==0&&f.nodeType!==3||(u=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===e)break t;if(h===n&&++c===s&&(l=a),h===i&&++d===r&&(u=a),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(du={focusedElem:e,selectionRange:n},Ta=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var b=y.memoizedProps,w=y.memoizedState,p=t.stateNode,x=p.getSnapshotBeforeUpdate(t.elementType===t.type?b:Lt(t.type,b),w);p.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(k){je(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return y=ch,ch=!1,y}function As(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Tu(t,n,i)}s=s.next}while(s!==r)}}function vo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function T0(e){var t=e.alternate;t!==null&&(e.alternate=null,T0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[Js],delete t[mu],delete t[kw],delete t[Sw])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function P0(e){return e.tag===5||e.tag===3||e.tag===4}function dh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||P0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Nu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_a));else if(r!==4&&(e=e.child,e!==null))for(Nu(e,t,n),e=e.sibling;e!==null;)Nu(e,t,n),e=e.sibling}function _u(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(_u(e,t,n),e=e.sibling;e!==null;)_u(e,t,n),e=e.sibling}var Fe=null,At=!1;function fn(e,t,n){for(n=n.child;n!==null;)N0(e,t,n),n=n.sibling}function N0(e,t,n){if(Gt&&typeof Gt.onCommitFiberUnmount=="function")try{Gt.onCommitFiberUnmount(co,n)}catch{}switch(n.tag){case 5:Ke||Mr(n,t);case 6:var r=Fe,s=At;Fe=null,fn(e,t,n),Fe=r,At=s,Fe!==null&&(At?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(At?(e=Fe,n=n.stateNode,e.nodeType===8?rl(e.parentNode,n):e.nodeType===1&&rl(e,n),qs(e)):rl(Fe,n.stateNode));break;case 4:r=Fe,s=At,Fe=n.stateNode.containerInfo,At=!0,fn(e,t,n),Fe=r,At=s;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Tu(n,t,a),s=s.next}while(s!==r)}fn(e,t,n);break;case 1:if(!Ke&&(Mr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){je(n,t,l)}fn(e,t,n);break;case 21:fn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,fn(e,t,n),Ke=r):fn(e,t,n);break;default:fn(e,t,n)}}function fh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ow),t.forEach(function(r){var s=Yw.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=a),r&=~i}if(r=s,r=Ee()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$w(r/1960))-r,10e?16:e,wn===null)var r=!1;else{if(e=wn,wn=null,Ha=0,ie&6)throw Error(D(331));var s=ie;for(ie|=4,O=e.current;O!==null;){var i=O,a=i.child;if(O.flags&16){var l=i.deletions;if(l!==null){for(var u=0;uEe()-sd?er(e,0):rd|=n),ut(e,t)}function V0(e,t){t===0&&(e.mode&1?(t=Li,Li<<=1,!(Li&130023424)&&(Li=4194304)):t=1);var n=nt();e=on(e,t),e!==null&&(mi(e,t,n),ut(e,n))}function qw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),V0(e,n)}function Yw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(t),V0(e,n)}var F0;F0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)at=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return at=!1,Iw(e,t,n);at=!!(e.flags&131072)}else at=!1,ge&&t.flags&1048576&&$g(t,Da,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;la(e,t),e=t.pendingProps;var s=Ur(t,qe.current);Br(t,n),s=Zc(null,t,r,e,s,n);var i=Qc();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,lt(r)?(i=!0,La(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Gc(t),s.updater=yo,t.stateNode=s,s._reactInternals=t,wu(t,r,e,n),t=Su(null,t,r,!0,i,n)):(t.tag=0,ge&&i&&Oc(t),Je(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(la(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Zw(r),e=Lt(r,e),s){case 0:t=ku(null,t,r,e,n);break e;case 1:t=oh(null,t,r,e,n);break e;case 11:t=ih(null,t,r,e,n);break e;case 14:t=ah(null,t,r,Lt(r.type,e),n);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Lt(r,s),ku(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Lt(r,s),oh(e,t,r,s,n);case 3:e:{if(b0(t),e===null)throw Error(D(387));r=t.pendingProps,i=t.memoizedState,s=i.element,qg(e,t),Va(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=qr(Error(D(423)),t),t=lh(e,t,r,n,s);break e}else if(r!==s){s=qr(Error(D(424)),t),t=lh(e,t,r,n,s);break e}else for(mt=Tn(t.stateNode.containerInfo.firstChild),pt=t,ge=!0,Dt=null,n=Gg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wr(),r===s){t=ln(e,t,n);break e}Je(e,t,r,n)}t=t.child}return t;case 5:return Yg(t),e===null&&xu(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,fu(r,s)?a=null:i!==null&&fu(r,i)&&(t.flags|=32),w0(e,t),Je(e,t,a,n),t.child;case 6:return e===null&&xu(t),null;case 13:return k0(e,t,n);case 4:return Kc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gr(t,null,r,n):Je(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Lt(r,s),ih(e,t,r,s,n);case 7:return Je(e,t,t.pendingProps,n),t.child;case 8:return Je(e,t,t.pendingProps.children,n),t.child;case 12:return Je(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,fe(Ra,r._currentValue),r._currentValue=a,i!==null)if(Ot(i.value,a)){if(i.children===s.children&&!ot.current){t=ln(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=rn(-1,n&-n),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),yu(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(D(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),yu(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Je(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Br(t,n),s=Et(s),r=r(s),t.flags|=1,Je(e,t,r,n),t.child;case 14:return r=t.type,s=Lt(r,t.pendingProps),s=Lt(r.type,s),ah(e,t,r,s,n);case 15:return y0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Lt(r,s),la(e,t),t.tag=1,lt(r)?(e=!0,La(t)):e=!1,Br(t,n),p0(t,r,s),wu(t,r,s,n),Su(null,t,r,!0,e,n);case 19:return S0(e,t,n);case 22:return v0(e,t,n)}throw Error(D(156,t.tag))};function O0(e,t){return fg(e,t)}function Xw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(e,t,n,r){return new Xw(e,t,n,r)}function ld(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Zw(e){if(typeof e=="function")return ld(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Tc)return 11;if(e===Pc)return 14}return 2}function Mn(e,t){var n=e.alternate;return n===null?(n=kt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function da(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")ld(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case kr:return tr(n.children,s,i,t);case Cc:a=8,s|=8;break;case Ul:return e=kt(12,n,t,s|2),e.elementType=Ul,e.lanes=i,e;case Wl:return e=kt(13,n,t,s),e.elementType=Wl,e.lanes=i,e;case Gl:return e=kt(19,n,t,s),e.elementType=Gl,e.lanes=i,e;case Yp:return bo(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kp:a=10;break e;case qp:a=9;break e;case Tc:a=11;break e;case Pc:a=14;break e;case mn:a=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=kt(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function tr(e,t,n,r){return e=kt(7,e,r,t),e.lanes=n,e}function bo(e,t,n,r){return e=kt(22,e,r,t),e.elementType=Yp,e.lanes=n,e.stateNode={isHidden:!1},e}function dl(e,t,n){return e=kt(6,e,null,t),e.lanes=n,e}function fl(e,t,n){return t=kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Qw(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Go(0),this.expirationTimes=Go(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Go(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ud(e,t,n,r,s,i,a,l,u){return e=new Qw(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=kt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Gc(i),e}function Jw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(H0)}catch(e){console.error(e)}}H0(),Hp.exports=yt;var hd=Hp.exports;const c4=_p(hd);var wh=hd;$l.createRoot=wh.createRoot,$l.hydrateRoot=wh.hydrateRoot;/** * @remix-run/router v1.23.3 * * 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 ai(){return ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function md(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ib(){return Math.random().toString(36).substr(2,8)}function kh(e,t){return{usr:e.state,key:e.key,idx:t}}function Ru(e,t,n,r){return n===void 0&&(n=null),ai({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?rs(t):t,{state:n,key:t&&t.key||r||ib()})}function Ga(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function rs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ab(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,l=bn.Pop,u=null,c=d();c==null&&(c=0,a.replaceState(ai({},a.state,{idx:c}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=bn.Pop;let w=d(),p=w==null?null:w-c;c=w,u&&u({action:l,location:b.location,delta:p})}function h(w,p){l=bn.Push;let x=Ru(b.location,w,p);c=d()+1;let y=kh(x,c),k=b.createHref(x);try{a.pushState(y,"",k)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(k)}i&&u&&u({action:l,location:b.location,delta:1})}function g(w,p){l=bn.Replace;let x=Ru(b.location,w,p);c=d();let y=kh(x,c),k=b.createHref(x);a.replaceState(y,"",k),i&&u&&u({action:l,location:b.location,delta:0})}function v(w){let p=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof w=="string"?w:Ga(w);return x=x.replace(/ $/,"%20"),we(p,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,p)}let b={get action(){return l},get location(){return e(s,a)},listen(w){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(bh,f),u=w,()=>{s.removeEventListener(bh,f),u=null}},createHref(w){return t(s,w)},createURL:v,encodeLocation(w){let p=v(w);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:h,replace:g,go(w){return a.go(w)}};return b}var Sh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Sh||(Sh={}));function ob(e,t,n){return n===void 0&&(n="/"),lb(e,t,n)}function lb(e,t,n,r){let s=typeof t=="string"?rs(t):t,i=Xr(s.pathname||"/",n);if(i==null)return null;let a=U0(e);ub(a);let l=null,u=wb(i);for(let c=0;l==null&&c{let u={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};u.relativePath.startsWith("/")&&(we(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Ln([r,u.relativePath]),d=n.concat(u);i.children&&i.children.length>0&&(we(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),U0(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:gb(c,i.index),routesMeta:d})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,a);else for(let u of W0(i.path))s(i,a,u)}),t}function W0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=W0(r.join("/")),l=[];return l.push(...a.map(u=>u===""?i:[i,u].join("/"))),s&&l.push(...a),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function ub(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xb(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const cb=/^:[\w-]+$/,db=3,fb=2,hb=1,mb=10,pb=-2,jh=e=>e==="*";function gb(e,t){let n=e.split("/"),r=n.length;return n.some(jh)&&(r+=pb),t&&(r+=fb),n.filter(s=>!jh(s)).reduce((s,i)=>s+(cb.test(i)?db:i===""?hb:mb),r)}function xb(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function yb(e,t,n){let{routesMeta:r}=e,s={},i="/",a=[];for(let l=0;l{let{paramName:h,isOptional:g}=d;if(h==="*"){let b=l[f]||"";a=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const v=l[f];return g&&!v?c[h]=void 0:c[h]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:a,pattern:e}}function vb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),md(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function wb(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return md(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const bb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kb=e=>bb.test(e);function Sb(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?rs(e):e,i;if(n)if(kb(n))i=n;else{if(n.includes("//")){let a=n;n=G0(n),md(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?i=Eh(n.substring(1),"/"):i=Eh(n,t)}else i=t;return{pathname:i,search:Cb(r),hash:Tb(s)}}function Eh(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function hl(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` 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 jb(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pd(e,t){let n=jb(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function gd(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=rs(e):(s=ai({},e),we(!s.pathname||!s.pathname.includes("?"),hl("?","pathname","search",s)),we(!s.pathname||!s.pathname.includes("#"),hl("#","pathname","hash",s)),we(!s.search||!s.search.includes("#"),hl("#","search","hash",s)));let i=e===""||s.pathname==="",a=i?"/":s.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}l=f>=0?t[f]:"/"}let u=Sb(s,l),c=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const G0=e=>e.replace(/\/\/+/g,"/"),Ln=e=>G0(e.join("/")),Eb=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Cb=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Tb=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const K0=["post","put","patch","delete"];new Set(K0);const Nb=["get",...K0];new Set(Nb);/** + */function ai(){return ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function md(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ib(){return Math.random().toString(36).substr(2,8)}function kh(e,t){return{usr:e.state,key:e.key,idx:t}}function Ru(e,t,n,r){return n===void 0&&(n=null),ai({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?rs(t):t,{state:n,key:t&&t.key||r||ib()})}function Ga(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function rs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ab(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,l=bn.Pop,u=null,c=d();c==null&&(c=0,a.replaceState(ai({},a.state,{idx:c}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=bn.Pop;let w=d(),p=w==null?null:w-c;c=w,u&&u({action:l,location:b.location,delta:p})}function h(w,p){l=bn.Push;let x=Ru(b.location,w,p);c=d()+1;let v=kh(x,c),k=b.createHref(x);try{a.pushState(v,"",k)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(k)}i&&u&&u({action:l,location:b.location,delta:1})}function g(w,p){l=bn.Replace;let x=Ru(b.location,w,p);c=d();let v=kh(x,c),k=b.createHref(x);a.replaceState(v,"",k),i&&u&&u({action:l,location:b.location,delta:0})}function y(w){let p=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof w=="string"?w:Ga(w);return x=x.replace(/ $/,"%20"),we(p,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,p)}let b={get action(){return l},get location(){return e(s,a)},listen(w){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(bh,f),u=w,()=>{s.removeEventListener(bh,f),u=null}},createHref(w){return t(s,w)},createURL:y,encodeLocation(w){let p=y(w);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:h,replace:g,go(w){return a.go(w)}};return b}var Sh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Sh||(Sh={}));function ob(e,t,n){return n===void 0&&(n="/"),lb(e,t,n)}function lb(e,t,n,r){let s=typeof t=="string"?rs(t):t,i=Xr(s.pathname||"/",n);if(i==null)return null;let a=U0(e);ub(a);let l=null,u=wb(i);for(let c=0;l==null&&c{let u={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};u.relativePath.startsWith("/")&&(we(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=Ln([r,u.relativePath]),d=n.concat(u);i.children&&i.children.length>0&&(we(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),U0(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:gb(c,i.index),routesMeta:d})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,a);else for(let u of W0(i.path))s(i,a,u)}),t}function W0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=W0(r.join("/")),l=[];return l.push(...a.map(u=>u===""?i:[i,u].join("/"))),s&&l.push(...a),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function ub(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xb(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const cb=/^:[\w-]+$/,db=3,fb=2,hb=1,mb=10,pb=-2,jh=e=>e==="*";function gb(e,t){let n=e.split("/"),r=n.length;return n.some(jh)&&(r+=pb),t&&(r+=fb),n.filter(s=>!jh(s)).reduce((s,i)=>s+(cb.test(i)?db:i===""?hb:mb),r)}function xb(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function yb(e,t,n){let{routesMeta:r}=e,s={},i="/",a=[];for(let l=0;l{let{paramName:h,isOptional:g}=d;if(h==="*"){let b=l[f]||"";a=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const y=l[f];return g&&!y?c[h]=void 0:c[h]=(y||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:a,pattern:e}}function vb(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),md(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function wb(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return md(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Xr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const bb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kb=e=>bb.test(e);function Sb(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?rs(e):e,i;if(n)if(kb(n))i=n;else{if(n.includes("//")){let a=n;n=G0(n),md(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?i=Eh(n.substring(1),"/"):i=Eh(n,t)}else i=t;return{pathname:i,search:Cb(r),hash:Tb(s)}}function Eh(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function hl(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` 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 jb(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pd(e,t){let n=jb(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function gd(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=rs(e):(s=ai({},e),we(!s.pathname||!s.pathname.includes("?"),hl("?","pathname","search",s)),we(!s.pathname||!s.pathname.includes("#"),hl("#","pathname","hash",s)),we(!s.search||!s.search.includes("#"),hl("#","search","hash",s)));let i=e===""||s.pathname==="",a=i?"/":s.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}l=f>=0?t[f]:"/"}let u=Sb(s,l),c=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const G0=e=>e.replace(/\/\/+/g,"/"),Ln=e=>G0(e.join("/")),Eb=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Cb=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Tb=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const K0=["post","put","patch","delete"];new Set(K0);const Nb=["get",...K0];new Set(Nb);/** * React Router 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 oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),m.useCallback(function(c,d){if(d===void 0&&(d={}),!l.current)return;if(typeof c=="number"){r.go(c);return}let f=gd(c,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ln([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,a,i,e])}const Lb=m.createContext(null);function Ab(e){let t=m.useContext(Yt).outlet;return t&&m.createElement(Lb.Provider,{value:e},t)}function xd(){let{matches:e}=m.useContext(Yt),t=e[e.length-1];return t?t.params:{}}function Po(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(dn),{matches:s}=m.useContext(Yt),{pathname:i}=Ye(),a=JSON.stringify(pd(s,r.v7_relativeSplatPath));return m.useMemo(()=>gd(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function Db(e,t){return Rb(e,t)}function Rb(e,t,n,r){ss()||we(!1);let{navigator:s}=m.useContext(dn),{matches:i}=m.useContext(Yt),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Ye(),d;if(t){var f;let w=typeof t=="string"?rs(t):t;u==="/"||(f=w.pathname)!=null&&f.startsWith(u)||we(!1),d=w}else d=c;let h=d.pathname||"/",g=h;if(u!=="/"){let w=u.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(w.length).join("/")}let v=ob(e,{pathname:g}),b=zb(v&&v.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:Ln([u,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:Ln([u,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return t&&b?m.createElement(To.Provider,{value:{location:oi({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:bn.Pop}},b):b}function Ib(){let e=Ub(),t=Pb(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const Vb=m.createElement(Ib,null);class Fb extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Yt.Provider,{value:this.props.routeContext},m.createElement(Y0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ob(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(Co);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Yt.Provider,{value:t},r)}function zb(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||we(!1),a=a.slice(0,Math.min(a.length,d+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((d,f,h)=>{let g,v=!1,b=null,w=null;n&&(g=l&&f.route.id?l[f.route.id]:void 0,b=f.route.errorElement||Vb,u&&(c<0&&h===0?(Gb("route-fallback"),v=!0,w=null):c===h&&(v=!0,w=f.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,h+1)),x=()=>{let y;return g?y=b:v?y=w:f.route.Component?y=m.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=d,m.createElement(Ob,{match:f,routeContext:{outlet:d,matches:p,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(Fb,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:x(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):x()},null)}var Z0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Z0||{}),Q0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Q0||{});function Bb(e){let t=m.useContext(Co);return t||we(!1),t}function $b(e){let t=m.useContext(q0);return t||we(!1),t}function Hb(e){let t=m.useContext(Yt);return t||we(!1),t}function J0(e){let t=Hb(),n=t.matches[t.matches.length-1];return n.route.id||we(!1),n.route.id}function Ub(){var e;let t=m.useContext(Y0),n=$b(),r=J0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Wb(){let{router:e}=Bb(Z0.UseNavigateStable),t=J0(Q0.UseNavigateStable),n=m.useRef(!1);return X0(()=>{n.current=!0}),m.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,oi({fromRouteId:t},i)))},[e,t])}const Ch={};function Gb(e,t,n){Ch[e]||(Ch[e]=!0)}function Kb(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function ur(e){let{to:t,replace:n,state:r,relative:s}=e;ss()||we(!1);let{future:i,static:a}=m.useContext(dn),{matches:l}=m.useContext(Yt),{pathname:u}=Ye(),c=pr(),d=gd(t,pd(l,i.v7_relativeSplatPath),u,s==="path"),f=JSON.stringify(d);return m.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:s}),[c,f,s,n,r]),null}function yd(e){return Ab(e.context)}function U(e){we(!1)}function qb(e){let{basename:t="/",children:n=null,location:r,navigationType:s=bn.Pop,navigator:i,static:a=!1,future:l}=e;ss()&&we(!1);let u=t.replace(/^\/*/,"/"),c=m.useMemo(()=>({basename:u,navigator:i,static:a,future:oi({v7_relativeSplatPath:!1},l)}),[u,l,i,a]);typeof r=="string"&&(r=rs(r));let{pathname:d="/",search:f="",hash:h="",state:g=null,key:v="default"}=r,b=m.useMemo(()=>{let w=Xr(d,u);return w==null?null:{location:{pathname:w,search:f,hash:h,state:g,key:v},navigationType:s}},[u,d,f,h,g,v,s]);return b==null?null:m.createElement(dn.Provider,{value:c},m.createElement(To.Provider,{children:n,value:b}))}function Yb(e){let{children:t,location:n}=e;return Db(Vu(t),n)}new Promise(()=>{});function Vu(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let i=[...t,s];if(r.type===m.Fragment){n.push.apply(n,Vu(r.props.children,i));return}r.type!==U&&we(!1),!r.props.index||!r.props.children||we(!1);let a={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&&(a.children=Vu(r.props.children,i)),n.push(a)}),n}/** + */function oi(){return oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),m.useCallback(function(c,d){if(d===void 0&&(d={}),!l.current)return;if(typeof c=="number"){r.go(c);return}let f=gd(c,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ln([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,a,i,e])}const Lb=m.createContext(null);function Ab(e){let t=m.useContext(Yt).outlet;return t&&m.createElement(Lb.Provider,{value:e},t)}function xd(){let{matches:e}=m.useContext(Yt),t=e[e.length-1];return t?t.params:{}}function Po(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(dn),{matches:s}=m.useContext(Yt),{pathname:i}=Ye(),a=JSON.stringify(pd(s,r.v7_relativeSplatPath));return m.useMemo(()=>gd(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function Db(e,t){return Rb(e,t)}function Rb(e,t,n,r){ss()||we(!1);let{navigator:s}=m.useContext(dn),{matches:i}=m.useContext(Yt),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let c=Ye(),d;if(t){var f;let w=typeof t=="string"?rs(t):t;u==="/"||(f=w.pathname)!=null&&f.startsWith(u)||we(!1),d=w}else d=c;let h=d.pathname||"/",g=h;if(u!=="/"){let w=u.replace(/^\//,"").split("/");g="/"+h.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=ob(e,{pathname:g}),b=zb(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:Ln([u,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:Ln([u,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return t&&b?m.createElement(To.Provider,{value:{location:oi({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:bn.Pop}},b):b}function Ib(){let e=Ub(),t=Pb(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const Vb=m.createElement(Ib,null);class Fb extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Yt.Provider,{value:this.props.routeContext},m.createElement(Y0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ob(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(Co);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Yt.Provider,{value:t},r)}function zb(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let d=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||we(!1),a=a.slice(0,Math.min(a.length,d+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?a=a.slice(0,c+1):a=[a[0]];break}}}return a.reduceRight((d,f,h)=>{let g,y=!1,b=null,w=null;n&&(g=l&&f.route.id?l[f.route.id]:void 0,b=f.route.errorElement||Vb,u&&(c<0&&h===0?(Gb("route-fallback"),y=!0,w=null):c===h&&(y=!0,w=f.route.hydrateFallbackElement||null)));let p=t.concat(a.slice(0,h+1)),x=()=>{let v;return g?v=b:y?v=w:f.route.Component?v=m.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=d,m.createElement(Ob,{match:f,routeContext:{outlet:d,matches:p,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(Fb,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:x(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):x()},null)}var Z0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Z0||{}),Q0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Q0||{});function Bb(e){let t=m.useContext(Co);return t||we(!1),t}function $b(e){let t=m.useContext(q0);return t||we(!1),t}function Hb(e){let t=m.useContext(Yt);return t||we(!1),t}function J0(e){let t=Hb(),n=t.matches[t.matches.length-1];return n.route.id||we(!1),n.route.id}function Ub(){var e;let t=m.useContext(Y0),n=$b(),r=J0();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Wb(){let{router:e}=Bb(Z0.UseNavigateStable),t=J0(Q0.UseNavigateStable),n=m.useRef(!1);return X0(()=>{n.current=!0}),m.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,oi({fromRouteId:t},i)))},[e,t])}const Ch={};function Gb(e,t,n){Ch[e]||(Ch[e]=!0)}function Kb(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function ur(e){let{to:t,replace:n,state:r,relative:s}=e;ss()||we(!1);let{future:i,static:a}=m.useContext(dn),{matches:l}=m.useContext(Yt),{pathname:u}=Ye(),c=pr(),d=gd(t,pd(l,i.v7_relativeSplatPath),u,s==="path"),f=JSON.stringify(d);return m.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:s}),[c,f,s,n,r]),null}function yd(e){return Ab(e.context)}function U(e){we(!1)}function qb(e){let{basename:t="/",children:n=null,location:r,navigationType:s=bn.Pop,navigator:i,static:a=!1,future:l}=e;ss()&&we(!1);let u=t.replace(/^\/*/,"/"),c=m.useMemo(()=>({basename:u,navigator:i,static:a,future:oi({v7_relativeSplatPath:!1},l)}),[u,l,i,a]);typeof r=="string"&&(r=rs(r));let{pathname:d="/",search:f="",hash:h="",state:g=null,key:y="default"}=r,b=m.useMemo(()=>{let w=Xr(d,u);return w==null?null:{location:{pathname:w,search:f,hash:h,state:g,key:y},navigationType:s}},[u,d,f,h,g,y,s]);return b==null?null:m.createElement(dn.Provider,{value:c},m.createElement(To.Provider,{children:n,value:b}))}function Yb(e){let{children:t,location:n}=e;return Db(Vu(t),n)}new Promise(()=>{});function Vu(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let i=[...t,s];if(r.type===m.Fragment){n.push.apply(n,Vu(r.props.children,i));return}r.type!==U&&we(!1),!r.props.index||!r.props.children||we(!1);let a={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&&(a.children=Vu(r.props.children,i)),n.push(a)}),n}/** * React Router DOM v6.30.4 * * Copyright (c) Remix Software Inc. @@ -65,15 +65,15 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function Ka(){return Ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Qb(e,t){let n=Fu(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const Jb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ek=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],tk="6";try{window.__reactRouterVersion=tk}catch{}const nk=m.createContext({isTransitioning:!1}),rk="startTransition",Th=Kv[rk];function sk(e){let{basename:t,children:n,future:r,window:s}=e,i=m.useRef();i.current==null&&(i.current=sb({window:s,v5Compat:!0}));let a=i.current,[l,u]=m.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},d=m.useCallback(f=>{c&&Th?Th(()=>u(f)):u(f)},[u,c]);return m.useLayoutEffect(()=>a.listen(d),[a,d]),m.useEffect(()=>Kb(r),[r]),m.createElement(qb,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}const ik=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ak=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,K=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:a,state:l,target:u,to:c,preventScrollReset:d,viewTransition:f}=t,h=ex(t,Jb),{basename:g}=m.useContext(dn),v,b=!1;if(typeof c=="string"&&ak.test(c)&&(v=c,ik))try{let y=new URL(window.location.href),k=c.startsWith("//")?new URL(y.protocol+c):new URL(c),E=Xr(k.pathname,g);k.origin===y.origin&&E!=null?c=E+k.search+k.hash:b=!0}catch{}let w=_b(c,{relative:s}),p=uk(c,{replace:a,state:l,target:u,preventScrollReset:d,relative:s,viewTransition:f});function x(y){r&&r(y),y.defaultPrevented||p(y)}return m.createElement("a",Ka({},h,{href:v||w,onClick:b||i?r:x,ref:n,target:u}))}),ok=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:a=!1,style:l,to:u,viewTransition:c,children:d}=t,f=ex(t,ek),h=Po(u,{relative:f.relative}),g=Ye(),v=m.useContext(q0),{navigator:b,basename:w}=m.useContext(dn),p=v!=null&&dk(h)&&c===!0,x=b.encodeLocation?b.encodeLocation(h).pathname:h.pathname,y=g.pathname,k=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;s||(y=y.toLowerCase(),k=k?k.toLowerCase():null,x=x.toLowerCase()),k&&w&&(k=Xr(k,w)||k);const E=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=y===x||!a&&y.startsWith(x)&&y.charAt(E)==="/",j=k!=null&&(k===x||!a&&k.startsWith(x)&&k.charAt(x.length)==="/"),S={isActive:C,isPending:j,isTransitioning:p},N=C?r:void 0,P;typeof i=="function"?P=i(S):P=[i,C?"active":null,j?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let F=typeof l=="function"?l(S):l;return m.createElement(K,Ka({},f,{"aria-current":N,className:P,ref:n,style:F,to:u,viewTransition:c}),typeof d=="function"?d(S):d)});var Ou;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ou||(Ou={}));var Ph;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ph||(Ph={}));function lk(e){let t=m.useContext(Co);return t||we(!1),t}function uk(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:a,viewTransition:l}=t===void 0?{}:t,u=pr(),c=Ye(),d=Po(e,{relative:a});return m.useCallback(f=>{if(Zb(f,n)){f.preventDefault();let h=r!==void 0?r:Ga(c)===Ga(d);u(e,{replace:h,state:s,preventScrollReset:i,relative:a,viewTransition:l})}},[c,u,d,r,s,n,e,i,a,l])}function ck(e){let t=m.useRef(Fu(e)),n=m.useRef(!1),r=Ye(),s=m.useMemo(()=>Qb(r.search,n.current?null:t.current),[r.search]),i=pr(),a=m.useCallback((l,u)=>{const c=Fu(typeof l=="function"?l(s):l);n.current=!0,i("?"+c,u)},[i,s]);return[s,a]}function dk(e,t){t===void 0&&(t={});let n=m.useContext(nk);n==null&&we(!1);let{basename:r}=lk(Ou.useViewTransitionState),s=Po(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Xr(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Xr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Iu(s.pathname,a)!=null||Iu(s.pathname,i)!=null}const fk="modulepreload",hk=function(e){return"/"+e},Nh={},X=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(u=>{if(u=hk(u),u in Nh)return;Nh[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":fk,c||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),c)return new Promise((h,g)=>{f.addEventListener("load",h),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},vd=m.createContext({});function un(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const mk=typeof window<"u",yi=mk?m.useLayoutEffect:m.useEffect,No=m.createContext(null);function wd(e,t){e.indexOf(t)===-1&&e.push(t)}function qa(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const zt=(e,t,n)=>n>t?t:n{};const Vn={},tx=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),nx=e=>typeof e=="object"&&e!==null,rx=e=>/^0[^.\s]+$/u.test(e);function sx(e){let t;return()=>(t===void 0&&(t=e()),t)}const ct=e=>e,vi=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Zr=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class kd{constructor(){this.subscriptions=[]}add(t){return wd(this.subscriptions,t),()=>qa(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;ie*1e3,St=e=>e/1e3,Sd=(e,t)=>t?e*(1e3/t):0,ix=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,pk=1e-7,gk=12;function xk(e,t,n,r,s){let i,a,l=0;do a=t+(n-t)/2,i=ix(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>pk&&++lxk(i,0,1,e,n);return i=>i===0||i===1?i:ix(s(i),t,r)}const ax=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ox=e=>t=>1-e(1-t),lx=wi(.33,1.53,.69,.99),jd=ox(lx),ux=ax(jd),cx=e=>e>=1?1:(e*=2)<1?.5*jd(e):.5*(2-Math.pow(2,-10*(e-1))),Ed=e=>1-Math.sin(Math.acos(e)),dx=ox(Ed),fx=ax(Ed),yk=wi(.42,0,1,1),vk=wi(0,0,.58,1),hx=wi(.42,0,.58,1),wk=e=>Array.isArray(e)&&typeof e[0]!="number",mx=e=>Array.isArray(e)&&typeof e[0]=="number",bk={linear:ct,easeIn:yk,easeInOut:hx,easeOut:vk,circIn:Ed,circInOut:fx,circOut:dx,backIn:jd,backInOut:ux,backOut:lx,anticipate:cx},kk=e=>typeof e=="string",_h=e=>{if(mx(e)){bd(e.length===4);const[t,n,r,s]=e;return wi(t,n,r,s)}else if(kk(e))return bk[e];return e},Ui=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Sk(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){i.has(c)&&(u.schedule(c),e()),c(a)}const u={schedule:(c,d=!1,f=!1)=>{const g=f&&r?t:n;return d&&i.add(c),g.add(c),c},cancel:c=>{n.delete(c),i.delete(c)},process:c=>{if(a=c,r){s=!0;return}r=!0;const d=t;t=n,n=d,t.forEach(l),t.clear(),r=!1,s&&(s=!1,u.process(c))}};return u}const jk=40;function px(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Ui.reduce((y,k)=>(y[k]=Sk(i),y),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:d,update:f,preRender:h,render:g,postRender:v}=a,b=()=>{const y=Vn.useManualTiming,k=y?s.timestamp:performance.now();n=!1,y||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,jk),1)),s.timestamp=k,s.isProcessing=!0,l.process(s),u.process(s),c.process(s),d.process(s),f.process(s),h.process(s),g.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(b))},w=()=>{n=!0,r=!0,s.isProcessing||e(b)};return{schedule:Ui.reduce((y,k)=>{const E=a[k];return y[k]=(C,j=!1,S=!1)=>(n||w(),E.schedule(C,j,S)),y},{}),cancel:y=>{for(let k=0;k(fa===void 0&&et.set(Re.isProcessing||Vn.useManualTiming?Re.timestamp:performance.now()),fa),set:e=>{fa=e,queueMicrotask(Ek)}},gx=e=>t=>typeof t=="string"&&t.startsWith(e),xx=gx("--"),Ck=gx("var(--"),Cd=e=>Ck(e)?Tk.test(e.split("/*")[0].trim()):!1,Tk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mh(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const is={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},li={...is,transform:e=>zt(0,1,e)},Wi={...is,default:1},Is=e=>Math.round(e*1e5)/1e5,Td=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pk(e){return e==null}const Nk=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pd=(e,t)=>n=>!!(typeof n=="string"&&Nk.test(n)&&n.startsWith(e)||t&&!Pk(n)&&Object.prototype.hasOwnProperty.call(n,t)),yx=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,l]=r.match(Td);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},_k=e=>zt(0,255,e),pl={...is,transform:e=>Math.round(_k(e))},Qn={test:Pd("rgb","red"),parse:yx("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+pl.transform(e)+", "+pl.transform(t)+", "+pl.transform(n)+", "+Is(li.transform(r))+")"};function Mk(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const zu={test:Pd("#"),parse:Mk,transform:Qn.transform},bi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xt=bi("deg"),qt=bi("%"),z=bi("px"),Lk=bi("vh"),Ak=bi("vw"),Lh={...qt,parse:e=>qt.parse(e)/100,transform:e=>qt.transform(e*100)},Ar={test:Pd("hsl","hue"),parse:yx("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qt.transform(Is(t))+", "+qt.transform(Is(n))+", "+Is(li.transform(r))+")"},Ce={test:e=>Qn.test(e)||zu.test(e)||Ar.test(e),parse:e=>Qn.test(e)?Qn.parse(e):Ar.test(e)?Ar.parse(e):zu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Qn.transform(e):Ar.transform(e),getAnimatableNone:e=>{const t=Ce.parse(e);return t.alpha=0,Ce.transform(t)}},Dk=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rk(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Td))==null?void 0:t.length)||0)+(((n=e.match(Dk))==null?void 0:n.length)||0)>0}const vx="number",wx="color",Ik="var",Vk="var(",Ah="${}",Fk=/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 Qr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(Fk,u=>(Ce.test(u)?(r.color.push(i),s.push(wx),n.push(Ce.parse(u))):u.startsWith(Vk)?(r.var.push(i),s.push(Ik),n.push(u)):(r.number.push(i),s.push(vx),n.push(parseFloat(u))),++i,Ah)).split(Ah);return{values:n,split:l,indexes:r,types:s}}function Ok(e){return Qr(e).values}function bx({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;itypeof e=="number"?0:Ce.test(e)?Ce.getAnimatableNone(e):e,$k=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Bk(e);function Hk(e){const t=Qr(e);return bx(t)(t.values.map((r,s)=>$k(r,t.split[s])))}const Ft={test:Rk,parse:Ok,createTransformer:zk,getAnimatableNone:Hk};function gl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Uk({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,a=0;if(!t)s=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,u=2*n-l;s=gl(u,l,e+1/3),i=gl(u,l,e),a=gl(u,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Ya(e,t){return n=>n>0?t:e}const de=(e,t,n)=>e+(t-e)*n,xl=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Wk=[zu,Qn,Ar],Gk=e=>Wk.find(t=>t.test(e));function Dh(e){const t=Gk(e);if(!t)return!1;let n=t.parse(e);return t===Ar&&(n=Uk(n)),n}const Rh=(e,t)=>{const n=Dh(e),r=Dh(t);if(!n||!r)return Ya(e,t);const s={...n};return i=>(s.red=xl(n.red,r.red,i),s.green=xl(n.green,r.green,i),s.blue=xl(n.blue,r.blue,i),s.alpha=de(n.alpha,r.alpha,i),Qn.transform(s))},Bu=new Set(["none","hidden"]);function Kk(e,t){return Bu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qk(e,t){return n=>de(e,t,n)}function Nd(e){return typeof e=="number"?qk:typeof e=="string"?Cd(e)?Ya:Ce.test(e)?Rh:Zk:Array.isArray(e)?kx:typeof e=="object"?Ce.test(e)?Rh:Yk:Ya}function kx(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>Nd(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function Xk(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Ft.createTransformer(t),r=Qr(e),s=Qr(t);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?Bu.has(e)&&!s.values.length||Bu.has(t)&&!r.values.length?Kk(e,t):vi(kx(Xk(r,s),s.values),n):Ya(e,t)};function Sx(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?de(e,t,n):Nd(e)(e,t)}const Qk=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>re.update(t,n),stop:()=>Tt(t),now:()=>Re.isProcessing?Re.timestamp:et.now()}},jx=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i=Xa?1/0:t}function Jk(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(_d(r),Xa);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:St(s)}}const Se={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 $u(e,t){return e*Math.sqrt(1-t*t)}const e2=12;function t2(e,t,n){let r=n;for(let s=1;s{const d=c*a,f=d*e,h=d-n,g=$u(c,a),v=Math.exp(-f);return yl-h/g*v},i=c=>{const f=c*a*e,h=f*n+n,g=Math.pow(a,2)*Math.pow(c,2)*e,v=Math.exp(-f),b=$u(Math.pow(c,2),a);return(-s(c)+yl>0?-1:1)*((h-g)*v)/b}):(s=c=>{const d=Math.exp(-c*e),f=(c-n)*e+1;return-yl+d*f},i=c=>{const d=Math.exp(-c*e),f=(n-c)*(e*e);return d*f});const l=5/e,u=t2(s,i,l);if(e=gt(e),isNaN(u))return{stiffness:Se.stiffness,damping:Se.damping,duration:e};{const c=Math.pow(u,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:e}}}const r2=["duration","bounce"],s2=["stiffness","damping","mass"];function Ih(e,t){return t.some(n=>e[n]!==void 0)}function i2(e){let t={velocity:Se.velocity,stiffness:Se.stiffness,damping:Se.damping,mass:Se.mass,isResolvedFromDuration:!1,...e};if(!Ih(e,s2)&&Ih(e,r2))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*zt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Se.mass,stiffness:s,damping:i}}else{const n=n2({...e,velocity:0});t={...t,...n,mass:Se.mass},t.isResolvedFromDuration=!0}return t}function Za(e=Se.visualDuration,t=Se.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:c,mass:d,duration:f,velocity:h,isResolvedFromDuration:g}=i2({...n,velocity:-St(n.velocity||0)}),v=h||0,b=c/(2*Math.sqrt(u*d)),w=a-i,p=St(Math.sqrt(u/d)),x=Math.abs(w)<5;r||(r=x?Se.restSpeed.granular:Se.restSpeed.default),s||(s=x?Se.restDelta.granular:Se.restDelta.default);let y,k,E,C,j,S;if(b<1)E=$u(p,b),C=(v+b*p*w)/E,y=P=>{const F=Math.exp(-b*p*P);return a-F*(C*Math.sin(E*P)+w*Math.cos(E*P))},j=b*p*C+w*E,S=b*p*w-C*E,k=P=>Math.exp(-b*p*P)*(j*Math.sin(E*P)+S*Math.cos(E*P));else if(b===1){y=F=>a-Math.exp(-p*F)*(w+(v+p*w)*F);const P=v+p*w;k=F=>Math.exp(-p*F)*(p*P*F-v)}else{const P=p*Math.sqrt(b*b-1);y=ne=>{const q=Math.exp(-b*p*ne),G=Math.min(P*ne,300);return a-q*((v+b*p*w)*Math.sinh(G)+P*w*Math.cosh(G))/P};const F=(v+b*p*w)/P,B=b*p*F-w*P,se=b*p*w-F*P;k=ne=>{const q=Math.exp(-b*p*ne),G=Math.min(P*ne,300);return q*(B*Math.sinh(G)+se*Math.cosh(G))}}const N={calculatedDuration:g&&f||null,velocity:P=>gt(k(P)),next:P=>{if(!g&&b<1){const B=Math.exp(-b*p*P),se=Math.sin(E*P),ne=Math.cos(E*P),q=a-B*(C*se+w*ne),G=gt(B*(j*se+S*ne));return l.done=Math.abs(G)<=r&&Math.abs(a-q)<=s,l.value=l.done?a:q,l}const F=y(P);if(g)l.done=P>=f;else{const B=gt(k(P));l.done=Math.abs(B)<=r&&Math.abs(a-F)<=s}return l.value=l.done?a:F,l},toString:()=>{const P=Math.min(_d(N),Xa),F=jx(B=>N.next(P*B).value,P,30);return P+"ms "+F},toTransition:()=>{}};return N}Za.applyToOptions=e=>{const t=Jk(e,100,Za);return e.ease=t.ease,e.duration=gt(t.duration),e.type="keyframes",e};const a2=5;function Ex(e,t,n){const r=Math.max(t-a2,0);return Sd(n-e(r),t-r)}function Hu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:u,restDelta:c=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},g=S=>l!==void 0&&Su,v=S=>l===void 0?u:u===void 0||Math.abs(l-S)-b*Math.exp(-S/r),y=S=>p+x(S),k=S=>{const N=x(S),P=y(S);h.done=Math.abs(N)<=c,h.value=h.done?p:P};let E,C;const j=S=>{g(h.value)&&(E=S,C=Za({keyframes:[h.value,v(h.value)],velocity:Ex(y,S,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:d}))};return j(0),{calculatedDuration:null,next:S=>{let N=!1;return!C&&E===void 0&&(N=!0,k(S),j(S)),E!==void 0&&S>=E?C.next(S-E):(!N&&k(S),h)}}}function o2(e,t,n){const r=[],s=n||Vn.mix||Sx,i=e.length-1;for(let a=0;at[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=o2(t,r,s),u=l.length,c=d=>{if(a&&d1)for(;fc(zt(e[0],e[i-1],d)):c}function l2(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Zr(0,t,r);e.push(de(n,1,s))}}function Cx(e){const t=[0];return l2(t,e.length-1),t}function u2(e,t){return e.map(n=>n*t)}function c2(e,t){return e.map(()=>t||hx).splice(0,e.length-1)}function Vs({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=wk(r)?r.map(_h):_h(r),i={done:!1,value:t[0]},a=u2(n&&n.length===t.length?n:Cx(t),e),l=Md(a,t,{ease:Array.isArray(s)?s:c2(t,s)});return{calculatedDuration:e,next:u=>(i.value=l(u),i.done=u>=e,i)}}const d2=e=>e!==null;function _o(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(d2),l=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const f2={decay:Hu,inertia:Hu,tween:Vs,keyframes:Vs,spring:Za};function Tx(e){typeof e.type=="string"&&(e.type=f2[e.type])}class Ld{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const h2=e=>e/100;class ui extends Ld{constructor(t){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!==et.now()&&this.tick(et.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Tx(t);const{type:n=Vs,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=t;let{keyframes:l}=t;const u=n||Vs;u!==Vs&&typeof l[0]!="number"&&(this.mixKeyframes=vi(h2,Sx(l[0],l[1])),l=[0,100]);const c=u({...t,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...l].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=_d(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:g,type:v,onUpdate:b,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const p=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?p<0:p>s;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let y=this.currentTime,k=r;if(f){const S=Math.min(this.currentTime,s)/l;let N=Math.floor(S),P=S%1;!P&&S>=1&&(P=1),P===1&&N--,N=Math.min(N,f+1),!!(N%2)&&(h==="reverse"?(P=1-P,g&&(P-=g/l)):h==="mirror"&&(k=a)),y=zt(0,1,P)*l}let E;x?(this.delayState.value=d[0],E=this.delayState):E=k.next(y),i&&!x&&(E.value=i(E.value));let{done:C}=E;!x&&u!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return j&&v!==Hu&&(E.value=_o(d,this.options,w,this.speed)),b&&b(E.value),j&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return St(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+St(t)}get time(){return St(this.currentTime)}set time(t){t=gt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Ex(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(et.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=St(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=Qk,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(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(et.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function m2(e){for(let t=1;te*180/Math.PI,Uu=e=>{const t=Jn(Math.atan2(e[1],e[0]));return Wu(t)},p2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Uu,rotateZ:Uu,skewX:e=>Jn(Math.atan(e[1])),skewY:e=>Jn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Wu=e=>(e=e%360,e<0&&(e+=360),e),Vh=Uu,Fh=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Oh=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),g2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fh,scaleY:Oh,scale:e=>(Fh(e)+Oh(e))/2,rotateX:e=>Wu(Jn(Math.atan2(e[6],e[5]))),rotateY:e=>Wu(Jn(Math.atan2(-e[2],e[0]))),rotateZ:Vh,rotate:Vh,skewX:e=>Jn(Math.atan(e[4])),skewY:e=>Jn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Gu(e){return e.includes("scale")?1:0}function Ku(e,t){if(!e||e==="none")return Gu(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=g2,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=p2,s=l}if(!s)return Gu(t);const i=r[t],a=s[1].split(",").map(y2);return typeof i=="function"?i(a):a[i]}const x2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ku(n,t)};function y2(e){return parseFloat(e.trim())}const as=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],os=new Set([...as,"pathRotation"]),zh=e=>e===is||e===z,v2=new Set(["x","y","z"]),w2=as.filter(e=>!v2.has(e));function b2(e){const t=[];return w2.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const kn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ku(t,"x"),y:(e,{transform:t})=>Ku(t,"y")};kn.translateX=kn.x;kn.translateY=kn.y;const nr=new Set;let qu=!1,Yu=!1,Xu=!1;function Px(){if(Yu){const e=Array.from(nr).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=b2(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var l;(l=r.getValue(i))==null||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Yu=!1,qu=!1,nr.forEach(e=>e.complete(Xu)),nr.clear()}function Nx(){nr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Yu=!0)})}function k2(){Xu=!0,Nx(),Px(),Xu=!1}class Ad{constructor(t,n,r,s,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(nr.add(this),qu||(qu=!0,re.read(Nx),re.resolveKeyframes(Px))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&i===void 0&&s.set(t[0])}m2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),nr.delete(this)}cancel(){this.state==="scheduled"&&(nr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const S2=e=>e.startsWith("--");function _x(e,t,n){S2(t)?e.style.setProperty(t,n):e.style[t]=n}const j2={};function Dd(e,t){const n=sx(e);return()=>j2[t]??n()}const Rd=Dd(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Mx=Dd(()=>window.ViewTimeline!==void 0,"viewTimeline"),Lx=Dd(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Es=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Bh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Es([0,.65,.55,1]),circOut:Es([.55,0,1,.45]),backIn:Es([.31,.01,.66,-.59]),backOut:Es([.33,1.53,.69,.99])};function Ax(e,t){if(e)return typeof e=="function"?Lx()?jx(e,t):"ease-out":mx(e)?Es(e):Array.isArray(e)?e.map(n=>Ax(n,t)||Bh.easeOut):Bh[e]}function E2(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:l="easeOut",times:u}={},c=void 0){const d={[t]:n};u&&(d.offset=u);const f=Ax(l,s);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(d,h)}function Dx(e){return typeof e=="function"&&"applyToOptions"in e}function C2({type:e,...t}){return Dx(e)&&Lx()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Rx extends Ld{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=t,bd(typeof t.type!="string");const c=C2(t);this.animation=E2(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=_o(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(d),_x(n,r,d),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return St(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+St(t)}get time(){return St(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=gt(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Rd()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),ct):s(this)}}const Ix={anticipate:cx,backInOut:ux,circInOut:fx};function T2(e){return e in Ix}function P2(e){typeof e.ease=="string"&&T2(e.ease)&&(e.ease=Ix[e.ease])}const vl=10;class N2 extends Rx{constructor(t){P2(t),Tx(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new ui({...a,autoplay:!1}),u=Math.max(vl,et.now()-this.startTime),c=zt(0,vl,u-vl),d=l.sample(u).value,{name:f}=this.options;i&&f&&_x(i,f,d),n.setWithVelocity(l.sample(Math.max(0,u-c)).value,d,c),l.stop()}}const $h=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ft.test(e)||e==="0")&&!e.startsWith("url("));function _2(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function I2(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:l}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return R2()&&n&&(Vx.has(n)||D2.has(n)&&A2(l))&&(n!=="transform"||!d)&&!c&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const V2=40;class F2 extends Ld{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:l,name:u,motionValue:c,element:d,...f}){var v;super(),this.stop=()=>{var b,w;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=et.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:u,motionValue:c,element:d,...f},g=(d==null?void 0:d.KeyframeResolver)||Ad;this.keyframeResolver=new g(l,(b,w,p)=>this.onKeyframesResolved(b,w,h,!p),u,c,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){var p,x;this.keyframeResolver=void 0;const{name:i,type:a,velocity:l,delay:u,isHandoff:c,onUpdate:d}=r;this.resolvedAt=et.now();let f=!0;M2(t,i,a,l)||(f=!1,(Vn.instantAnimations||!u)&&(d==null||d(_o(t,r,n))),t[0]=t[t.length-1],Zu(r),r.repeat=0);const g={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>V2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},v=f&&!c&&I2(g),b=(x=(p=g.motionValue)==null?void 0:p.owner)==null?void 0:x.current;let w;if(v)try{w=new N2({...g,element:b})}catch{w=new ui(g)}else w=new ui(g);w.finished.then(()=>{this.notifyFinished()}).catch(ct),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),k2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Fx(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),a=e.size,l=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:l-i*r}const Hh=30,O2=e=>!isNaN(parseFloat(e)),Fs={current:void 0};class z2{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=et.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 a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=et.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=O2(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new kd);const r=this.events[t].add(n);return t==="change"?()=>{r(),re.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Fs.current&&Fs.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=et.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Hh)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Hh);return Sd(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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 t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rt(e,t){return new z2(e,t)}function Id(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Vd(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Id(n,e):n}const B2={type:"spring",stiffness:500,damping:25,restSpeed:10},$2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),H2={type:"keyframes",duration:.8},U2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},W2=(e,{keyframes:t})=>t.length>2?H2:os.has(e)?e.startsWith("scale")?$2(t[1]):B2:U2,G2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function K2(e){for(const t in e)if(!G2.has(t))return!0;return!1}const Fd=(e,t,n,r={},s,i)=>a=>{const l=Vd(r,e)||{},u=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-gt(u);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};K2(l)||Object.assign(d,W2(e,d)),d.duration&&(d.duration=gt(d.duration)),d.repeatDelay&&(d.repeatDelay=gt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Zu(d),d.delay===0&&(f=!0)),(Vn.instantAnimations||Vn.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(f=!0,Zu(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!i&&t.get()!==void 0){const h=_o(d.keyframes,l);if(h!==void 0){re.update(()=>{d.onUpdate(h),d.onComplete()});return}}return l.isSync?new ui(d):new F2(d)},q2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Y2(e){const t=q2.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function Ox(e,t,n=1){const[r,s]=Y2(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return tx(a)?parseFloat(a):a}return Cd(s)?Ox(s,t,n+1):s}function Uh(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Od(e,t,n,r){if(typeof t=="function"){const[s,i]=Uh(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=Uh(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function rr(e,t,n){const r=e.getProps();return Od(r,t,n!==void 0?n:r.custom,e)}const zx=new Set(["width","height","top","left","right","bottom",...as]),Qu=e=>Array.isArray(e);function X2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Rt(n))}function Z2(e){return Qu(e)?e[e.length-1]||0:e}function Q2(e,t){const n=rr(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const l=Z2(i[a]);X2(e,a,l)}}const Ae=e=>!!(e&&e.getVelocity);function J2(e){return!!(Ae(e)&&e.add)}function Ju(e,t){const n=e.getValue("willChange");if(J2(n))return n.add(t);if(!n&&Vn.WillChange){const r=new Vn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function zd(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const eS="framerAppearId",Bx="data-"+zd(eS);function $x(e){return e.props[Bx]}function tS({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Hx(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...l}=t;const u=e.getDefaultTransition();i=i?Id(i,u):u;const c=i==null?void 0:i.reduceMotion,d=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],h=s&&e.animationState&&e.animationState.getState()[s],g=i==null?void 0:i.path;g&&g.animateVisualElement(e,l,i,n,f);for(const v in l){const b=e.getValue(v,e.latestValues[v]??null),w=l[v];if(w===void 0||h&&tS(h,v))continue;const p={delay:n,...Vd(i||{},v)};d&&(p.skipAnimations=!0);const x=b.get();if(x!==void 0&&!b.isAnimating()&&!Array.isArray(w)&&w===x&&!p.velocity){re.update(()=>b.set(w));continue}let y=!1;if(window.MotionHandoffAnimation){const C=$x(e);if(C){const j=window.MotionHandoffAnimation(C,v,re);j!==null&&(p.startTime=j,y=!0)}}Ju(e,v);const k=c??e.shouldReduceMotion;b.start(Fd(v,b,w,k&&zx.has(v)?{type:!1}:p,e,y));const E=b.animation;E&&f.push(E)}if(a){const v=()=>re.update(()=>{a&&Q2(e,a)});f.length?Promise.all(f).then(v):v()}return f}function ec(e,t,n={}){var u;const r=rr(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(Hx(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return nS(e,t,c,d,f,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,d]=l==="beforeChildren"?[i,a]:[a,i];return c().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function nS(e,t,n=0,r=0,s=0,i=1,a){const l=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),l.push(ec(u,t,{...a,delay:n+(typeof r=="function"?0:r)+Fx(e.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(l)}function rS(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>ec(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=ec(e,t,n);else{const s=typeof t=="function"?rr(e,t,n.custom):t;r=Promise.all(Hx(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const sS={test:e=>e==="auto",parse:e=>e},Ux=e=>t=>t.test(e),Wx=[is,z,qt,Xt,Ak,Lk,sS],Wh=e=>Wx.find(Ux(e));function iS(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||rx(e):!0}const aS=new Set(["brightness","contrast","saturate","opacity"]);function oS(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Td)||[];if(!r)return e;const s=n.replace(r,"");let i=aS.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const lS=/\b([a-z-]*)\(.*?\)/gu,tc={...Ft,getAnimatableNone:e=>{const t=e.match(lS);return t?t.map(oS).join(" "):e}},nc={...Ft,getAnimatableNone:e=>{const t=Ft.parse(e);return Ft.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Gh={...is,transform:Math.round},uS={rotate:Xt,pathRotation:Xt,rotateX:Xt,rotateY:Xt,rotateZ:Xt,scale:Wi,scaleX:Wi,scaleY:Wi,scaleZ:Wi,skew:Xt,skewX:Xt,skewY:Xt,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z,perspective:z,transformPerspective:z,opacity:li,originX:Lh,originY:Lh,originZ:z},Qa={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,inset:z,insetBlock:z,insetBlockStart:z,insetBlockEnd:z,insetInline:z,insetInlineStart:z,insetInlineEnd:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,paddingBlock:z,paddingBlockStart:z,paddingBlockEnd:z,paddingInline:z,paddingInlineStart:z,paddingInlineEnd:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,marginBlock:z,marginBlockStart:z,marginBlockEnd:z,marginInline:z,marginInlineStart:z,marginInlineEnd:z,fontSize:z,backgroundPositionX:z,backgroundPositionY:z,...uS,zIndex:Gh,fillOpacity:li,strokeOpacity:li,numOctaves:Gh},cS={...Qa,color:Ce,backgroundColor:Ce,outlineColor:Ce,fill:Ce,stroke:Ce,borderColor:Ce,borderTopColor:Ce,borderRightColor:Ce,borderBottomColor:Ce,borderLeftColor:Ce,filter:tc,WebkitFilter:tc,mask:nc,WebkitMask:nc},Gx=e=>cS[e],dS=new Set([tc,nc]);function Kx(e,t){let n=Gx(e);return dS.has(n)||(n=Ft),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const fS=new Set(["auto","none","0"]);function hS(e,t,n){let r=0,s;for(;r{t.getValue(u).set(c)}),this.resolveNoneKeyframes()}}const Bd=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function qx(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const rc=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Os(e){return nx(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Jr,cancel:Yx}=px(queueMicrotask,!1),Mt={x:!1,y:!1};function Xx(){return Mt.x||Mt.y}function pS(e){return e==="x"||e==="y"?Mt[e]?null:(Mt[e]=!0,()=>{Mt[e]=!1}):Mt.x||Mt.y?null:(Mt.x=Mt.y=!0,()=>{Mt.x=Mt.y=!1})}function Zx(e,t){const n=qx(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function gS(e){return!(e.pointerType==="touch"||Xx())}function xS(e,t,n={}){const[r,s,i]=Zx(e,n);return r.forEach(a=>{let l=!1,u=!1,c;const d=()=>{a.removeEventListener("pointerleave",v)},f=w=>{c&&(c(w),c=void 0),d()},h=w=>{l=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),u&&(u=!1,f(w))},g=()=>{l=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},v=w=>{if(w.pointerType!=="touch"){if(l){u=!0;return}f(w)}},b=w=>{if(!gS(w))return;u=!1;const p=t(a,w);typeof p=="function"&&(c=p,a.addEventListener("pointerleave",v,s))};a.addEventListener("pointerenter",b,s),a.addEventListener("pointerdown",g,s)}),i}const Qx=(e,t)=>t?e===t?!0:Qx(e,t.parentElement):!1,$d=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,yS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function vS(e){return yS.has(e.tagName)||e.isContentEditable===!0}const wS=new Set(["INPUT","SELECT","TEXTAREA"]);function bS(e){return wS.has(e.tagName)||e.isContentEditable===!0}const ha=new WeakSet;function Kh(e){return t=>{t.key==="Enter"&&e(t)}}function wl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const kS=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Kh(()=>{if(ha.has(n))return;wl(n,"down");const s=Kh(()=>{wl(n,"up")}),i=()=>wl(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function qh(e){return $d(e)&&!Xx()}const Yh=new WeakSet;function SS(e,t,n={}){const[r,s,i]=Zx(e,n),a=l=>{const u=l.currentTarget;if(!qh(l)||Yh.has(l))return;ha.add(u),n.stopPropagation&&Yh.add(l);const c=t(u,l),d={...s,capture:!0},f=(v,b)=>{window.removeEventListener("pointerup",h,d),window.removeEventListener("pointercancel",g,d),ha.has(u)&&ha.delete(u),qh(v)&&typeof c=="function"&&c(v,{success:b})},h=v=>{f(v,u===window||u===document||n.useGlobalTarget||Qx(u,v.target))},g=v=>{f(v,!1)};window.addEventListener("pointerup",h,d),window.addEventListener("pointercancel",g,d)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),Os(l)&&(l.addEventListener("focus",c=>kS(c,s)),!vS(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function Hd(e){return nx(e)&&"ownerSVGElement"in e}const ma=new WeakMap;let hn;const Jx=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Hd(r)&&"getBBox"in r?r.getBBox()[t]:r[n],jS=Jx("inline","width","offsetWidth"),ES=Jx("block","height","offsetHeight");function CS({target:e,borderBoxSize:t}){var n;(n=ma.get(e))==null||n.forEach(r=>{r(e,{get width(){return jS(e,t)},get height(){return ES(e,t)}})})}function TS(e){e.forEach(CS)}function PS(){typeof ResizeObserver>"u"||(hn=new ResizeObserver(TS))}function NS(e,t){hn||PS();const n=qx(e);return n.forEach(r=>{let s=ma.get(r);s||(s=new Set,ma.set(r,s)),s.add(t),hn==null||hn.observe(r)}),()=>{n.forEach(r=>{const s=ma.get(r);s==null||s.delete(t),s!=null&&s.size||hn==null||hn.unobserve(r)})}}const pa=new Set;let Dr;function _S(){Dr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};pa.forEach(t=>t(e))},window.addEventListener("resize",Dr)}function MS(e){return pa.add(e),Dr||_S(),()=>{pa.delete(e),!pa.size&&typeof Dr=="function"&&(window.removeEventListener("resize",Dr),Dr=void 0)}}function sc(e,t){return typeof e=="function"?MS(e):NS(e,t)}function ey(e,t){let n;const r=()=>{const{currentTime:s}=t,a=(s===null?0:s.value)/100;n!==a&&e(a),n=a};return re.preUpdate(r,!0),()=>Tt(r)}function LS(e){return Hd(e)&&e.tagName==="svg"}function AS(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],i=e[2+n],a=e[3+n],l=Md(s,i,a);return t?l(r):l}function DS(e,t,n={}){const r=e.get();let s=null,i=r,a;const l=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,u=()=>{s&&(s.stop(),s=null),e.animation=void 0},c=()=>{const f=Xh(e.get()),h=Xh(i);if(f===h){u();return}const g=s?s.getGeneratorVelocity():e.getVelocity();u(),s=new ui({keyframes:[f,h],velocity:g,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:a})},d=()=>{var f;c(),e.animation=s??void 0,(f=e.events.animationStart)==null||f.notify(),s==null||s.then(()=>{var h;e.animation=void 0,(h=e.events.animationComplete)==null||h.notify()})};if(e.attach((f,h)=>{i=f,a=g=>h(bl(g,l)),re.postRender(d)},u),Ae(t)){let f=n.skipInitialAnimation===!0;const h=t.on("change",v=>{f?(f=!1,e.jump(bl(v,l),!1)):e.set(bl(v,l))}),g=e.on("destroy",h);return()=>{h(),g()}}return u}function bl(e,t){return t?e+t:e}function Xh(e){return typeof e=="number"?e:parseFloat(e)}const RS=[...Wx,Ce,Ft],IS=e=>RS.find(Ux(e)),Zh=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rr=()=>({x:Zh(),y:Zh()}),Qh=()=>({min:0,max:0}),_e=()=>({x:Qh(),y:Qh()}),VS=new WeakMap;function Mo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ci(e){return typeof e=="string"||Array.isArray(e)}const Ud=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wd=["initial",...Ud];function Lo(e){return Mo(e.animate)||Wd.some(t=>ci(e[t]))}function ty(e){return!!(Lo(e)||e.variants)}function FS(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Ae(s))e.addValue(r,s);else if(Ae(i))e.addValue(r,Rt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Rt(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ja={current:null},Gd={current:!1},OS=typeof window<"u";function ny(){if(Gd.current=!0,!!OS)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ja.current=e.matches;e.addEventListener("change",t),t()}else Ja.current=!1}const Jh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let eo={};function ry(e){eo=e}function zS(){return eo}class BS{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:l},u={}){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=Ad,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 g=et.now();this.renderScheduledAtthis.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Gd.current||ny(),this.shouldReduceMotion=Ja.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Tt(this.notifyUpdate),Tt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.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(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Vx.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:l,times:u,ease:c,duration:d}=n.accelerate,f=new Rx({element:this.current,name:t,keyframes:l,times:u,ease:c,duration:gt(d)}),h=a(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=os.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&re.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in eo){const n=eo[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];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):_e()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Rt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(tx(r)||rx(r))?r=parseFloat(r):!IS(r)&&Ft.test(n)&&(r=Kx(t,n)),this.setBaseTarget(t,Ae(r)?r.get():r)),Ae(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=Od(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ae(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Jr.render(this.render)}}class sy extends BS{constructor(){super(...arguments),this.KeyframeResolver=mS}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ae(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Bn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function iy({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $S({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function HS(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function kl(e){return e===void 0||e===1}function ic({scale:e,scaleX:t,scaleY:n}){return!kl(e)||!kl(t)||!kl(n)}function qn(e){return ic(e)||ay(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ay(e){return em(e.x)||em(e.y)}function em(e){return e&&e!=="0%"}function to(e,t,n){const r=e-n,s=t*r;return n+s}function tm(e,t,n,r,s){return s!==void 0&&(e=to(e,s,r)),to(e,n,r)+t}function ac(e,t=0,n=1,r,s){e.min=tm(e.min,t,n,r,s),e.max=tm(e.max,t,n,r,s)}function oy(e,{x:t,y:n}){ac(e.x,t.translate,t.scale,t.originPoint),ac(e.y,n.translate,n.scale,n.originPoint)}const nm=.999999999999,rm=1.0000000000001;function US(e,t,n,r=!1){var l;const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let u=0;unm&&(t.x=1),t.ynm&&(t.y=1)}function Ut(e,t){e.min+=t,e.max+=t}function sm(e,t,n,r,s=.5){const i=de(e.min,e.max,s);ac(e,t,n,i,r)}function im(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ga(e,t,n){const r=n??e;sm(e.x,im(t.x,r.x),t.scaleX,t.scale,t.originX),sm(e.y,im(t.y,r.y),t.scaleY,t.scale,t.originY)}function ly(e,t){return iy(HS(e.getBoundingClientRect(),t))}function WS(e,t,n){const r=ly(e,n),{scroll:s}=t;return s&&(Ut(r.x,s.offset.x),Ut(r.y,s.offset.y)),r}const GS={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},KS=as.length;function qS(e,t,n){let r="",s=!0;for(let a=0;a{if(!t.target)return e;if(typeof e=="string")if(z.test(e))e=parseFloat(e);else return e;const n=am(e,t.target.x),r=am(e,t.target.y);return`${n}% ${r}%`}},YS={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ft.parse(e);if(s.length>5)return r;const i=Ft.createTransformer(e),a=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,u=n.y.scale*t.y;s[0+a]/=l,s[1+a]/=u;const c=de(l,u,.5);return typeof s[2+a]=="number"&&(s[2+a]/=c),typeof s[3+a]=="number"&&(s[3+a]/=c),i(s)}},oc={borderRadius:{...xs,applyTo:[...Bd]},borderTopLeftRadius:xs,borderTopRightRadius:xs,borderBottomLeftRadius:xs,borderBottomRightRadius:xs,boxShadow:YS};function cy(e,{layout:t,layoutId:n}){return os.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!oc[e]||e==="opacity")}function qd(e,t,n){var a;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const l in r)(Ae(r[l])||s&&Ae(s[l])||cy(l,e)||((a=n==null?void 0:n.getValue(l))==null?void 0:a.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function XS(e){return window.getComputedStyle(e)}class ZS extends sy{constructor(){super(...arguments),this.type="html",this.renderInstance=uy}readValueFromInstance(t,n){var r;if(os.has(n))return(r=this.projection)!=null&&r.isProjecting?Gu(n):x2(t,n);{const s=XS(t),i=(xx(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ly(t,n)}build(t,n,r){Kd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return qd(t,n,r)}}const QS={offset:"stroke-dashoffset",array:"stroke-dasharray"},JS={offset:"strokeDashoffset",array:"strokeDasharray"};function ej(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?QS:JS;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const tj=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function dy(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...l},u,c,d){if(Kd(e,l,c),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const g of tj)f[g]!==void 0&&(h[g]=f[g],delete f[g]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&ej(f,s,i,a,!1)}const fy=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"]),hy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function nj(e,t,n,r){uy(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(fy.has(s)?s:zd(s),t.attrs[s])}function my(e,t,n){const r=qd(e,t,n);for(const s in e)if(Ae(e[s])||Ae(t[s])){const i=as.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class rj extends sy{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_e}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(os.has(n)){const r=Gx(n);return r&&r.default||0}return n=fy.has(n)?n:zd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return my(t,n,r)}build(t,n,r){dy(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){nj(t,n,r,s)}mount(t){this.isSVGTag=hy(t.tagName),super.mount(t)}}const sj=Wd.length;function py(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?py(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>rS(e,n,r)))}function lj(e){let t=oj(e),n=om(),r=!0,s=!1;const i=c=>(d,f)=>{var g;const h=rr(e,f,c==="exit"?(g=e.presenceContext)==null?void 0:g.custom:void 0);if(h){const{transition:v,transitionEnd:b,...w}=h;d={...d,...w,...b}}return d};function a(c){t=c(e)}function l(c){const{props:d}=e,f=py(e.parent)||{},h=[],g=new Set;let v={},b=1/0;for(let p=0;pb&&E,P=!1;const F=Array.isArray(k)?k:[k];let B=F.reduce(i(x),{});C===!1&&(B={});const{prevResolvedValues:se={}}=y,ne={...se,...B},q=T=>{N=!0,g.has(T)&&(P=!0,g.delete(T)),y.needsAnimating[T]=!0;const M=e.getValue(T);M&&(M.liveStyle=!1)};for(const T in ne){const M=B[T],A=se[T];if(v.hasOwnProperty(T))continue;let R=!1;Qu(M)&&Qu(A)?R=!gy(M,A)||S:R=M!==A,R?M!=null?q(T):g.add(T):M!==void 0&&g.has(T)?q(T):y.protectedKeys[T]=!0}y.prevProp=k,y.prevResolvedValues=B,y.isActive&&(v={...v,...B}),(r||s)&&e.blockInitialAnimation&&(N=!1);const G=j&&S;N&&(!G||P)&&h.push(...F.map(T=>{const M={type:x};if(typeof T=="string"&&(r||s)&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:A}=e,R=rr(A,T);if(A.enteringChildren&&R){const{delayChildren:H}=R.transition||{};M.delay=Fx(A.enteringChildren,e,H)}}return{animation:T,options:M}}))}if(g.size){const p={};if(typeof d.initial!="boolean"){const x=rr(e,Array.isArray(d.initial)?d.initial[0]:d.initial);x&&x.transition&&(p.transition=x.transition)}g.forEach(x=>{const y=e.getBaseTarget(x),k=e.getValue(x);k&&(k.liveStyle=!0),p[x]=y??null}),h.push({animation:p})}let w=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?t(h):Promise.resolve()}function u(c,d){var h;if(n[c].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(g=>{var v;return(v=g.animationState)==null?void 0:v.setActive(c,d)}),n[c].isActive=d;const f=l(c);for(const g in n)n[g].protectedKeys={};return f}return{animateChanges:l,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=om(),s=!0}}}function uj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gy(t,e):!1}function Un(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function om(){return{animate:Un(!0),whileInView:Un(),whileHover:Un(),whileTap:Un(),whileDrag:Un(),whileFocus:Un(),exit:Un()}}function lc(e,t){e.min=t.min,e.max=t.max}function _t(e,t){lc(e.x,t.x),lc(e.y,t.y)}function lm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const xy=1e-4,cj=1-xy,dj=1+xy,yy=.01,fj=0-yy,hj=0+yy;function tt(e){return e.max-e.min}function mj(e,t,n){return Math.abs(e-t)<=n}function um(e,t,n,r=.5){e.origin=r,e.originPoint=de(t.min,t.max,e.origin),e.scale=tt(n)/tt(t),e.translate=de(n.min,n.max,e.origin)-e.originPoint,(e.scale>=cj&&e.scale<=dj||isNaN(e.scale))&&(e.scale=1),(e.translate>=fj&&e.translate<=hj||isNaN(e.translate))&&(e.translate=0)}function zs(e,t,n,r){um(e.x,t.x,n.x,r?r.originX:void 0),um(e.y,t.y,n.y,r?r.originY:void 0)}function cm(e,t,n,r=0){const s=r?de(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+tt(t)}function pj(e,t,n,r){cm(e.x,t.x,n.x,r==null?void 0:r.x),cm(e.y,t.y,n.y,r==null?void 0:r.y)}function dm(e,t,n,r=0){const s=r?de(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+tt(t)}function no(e,t,n,r){dm(e.x,t.x,n.x,r==null?void 0:r.x),dm(e.y,t.y,n.y,r==null?void 0:r.y)}function fm(e,t,n,r,s){return e-=t,e=to(e,1/n,r),s!==void 0&&(e=to(e,1/s,r)),e}function gj(e,t=0,n=1,r=.5,s,i=e,a=e){if(qt.test(t)&&(t=parseFloat(t),t=de(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=de(i.min,i.max,r);e===i&&(l-=t),e.min=fm(e.min,t,n,l,s),e.max=fm(e.max,t,n,l,s)}function hm(e,t,[n,r,s],i,a){gj(e,t[n],t[r],t[s],t.scale,i,a)}const xj=["x","scaleX","originX"],yj=["y","scaleY","originY"];function mm(e,t,n,r){hm(e.x,t,xj,n?n.x:void 0,r?r.x:void 0),hm(e.y,t,yj,n?n.y:void 0,r?r.y:void 0)}function pm(e){return e.translate===0&&e.scale===1}function vy(e){return pm(e.x)&&pm(e.y)}function gm(e,t){return e.min===t.min&&e.max===t.max}function vj(e,t){return gm(e.x,t.x)&&gm(e.y,t.y)}function xm(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wy(e,t){return xm(e.x,t.x)&&xm(e.y,t.y)}function ym(e){return tt(e.x)/tt(e.y)}function vm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ht(e){return[e("x"),e("y")]}function wj(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,pathRotation:f,rotateX:h,rotateY:g,skewX:v,skewY:b}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),g&&(r+=`rotateY(${g}deg) `),v&&(r+=`skewX(${v}deg) `),b&&(r+=`skewY(${b}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const bj=Bd.length,wm=e=>typeof e=="string"?parseFloat(e):e,bm=e=>typeof e=="number"||z.test(e);function kj(e,t,n,r,s,i){s?(e.opacity=de(0,n.opacity??1,Sj(r)),e.opacityExit=de(t.opacity??1,0,jj(r))):i&&(e.opacity=de(t.opacity??1,n.opacity??1,r));for(let a=0;art?1:n(Zr(e,t,r))}function Ej(e,t,n){const r=Ae(e)?e:Rt(e);return r.start(Fd("",r,t,n)),r.animation}function di(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Cj=(e,t)=>e.depth-t.depth;class Tj{constructor(){this.children=[],this.isDirty=!1}add(t){wd(this.children,t),this.isDirty=!0}remove(t){qa(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Cj),this.isDirty=!1,this.children.forEach(t)}}function Pj(e,t){const n=et.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Tt(r),e(i-t))};return re.setup(r,!0),()=>Tt(r)}function xa(e){return Ae(e)?e.get():e}class Nj{constructor(){this.members=[]}add(t){wd(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(qa(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(qa(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-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(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:a}=t.options;(i===void 0||i!==a)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,a;(r=(n=t.options).onExitComplete)==null||r.call(n),(a=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const ya={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sl=["","X","Y","Z"],_j=1e3;let Mj=0;function jl(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ky(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=$x(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",re,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ky(r)}function Sy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=Mj++,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(Dj),this.nodes.forEach(zj),this.nodes.forEach(Bj),this.nodes.forEach(Rj)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;uthis.root.updateBlockedByResize=!1;re.read(()=>{f=window.innerWidth}),e(a,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=Pj(h,250),ya.hasAnimatedSinceResize&&(ya.hasAnimatedSinceResize=!1,this.nodes.forEach(Em)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||c.getDefaultTransition()||Gj,{onLayoutAnimationStart:b,onLayoutAnimationComplete:w}=c.getProps(),p=!this.targetLayout||!wy(this.targetLayout,g),x=!f&&h;if(this.options.layoutRoot||this.resumeFrom||x||f&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...Vd(v,"layout"),onPlay:b,onComplete:w};(c.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,x,y.path)}else f||Em(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Tt(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($j),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ky(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&&!tt(this.snapshot.measuredBox.x)&&!tt(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 u=0;u{const j=C/1e3,S=E==null?void 0:E(j);S?(h.x.translate=S.x,h.x.scale=de(a.x.scale,1,j),h.x.origin=a.x.origin,h.x.originPoint=a.x.originPoint,h.y.translate=S.y,h.y.scale=de(a.y.scale,1,j),h.y.origin=a.y.origin,h.y.originPoint=a.y.originPoint):(Cm(h.x,a.x,j),Cm(h.y,a.y,j)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(no(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Uj(this.relativeTarget,this.relativeTargetOrigin,g,j),k&&vj(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=_e()),_t(k,this.relativeTarget)),w&&(this.animationValues=f,kj(f,d,this.latestValues,j,y,x)),S&&S.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=S.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var l,u,c;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(c=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Tt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=re.update(()=>{ya.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Rt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ej(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_j),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:u,layout:c,latestValues:d}=a;if(!(!l||!u||!c)){if(this!==a&&this.layout&&c&&jy(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||_e();const f=tt(this.layout.layoutBox.x);u.x.min=a.target.x.min,u.x.max=u.x.min+f;const h=tt(this.layout.layoutBox.y);u.y.min=a.target.y.min,u.y.max=u.y.min+h}_t(l,u),ga(l,d),zs(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Nj),this.sharedNodes.get(a).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:u}=a;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const c={};u.z&&jl("z",a,c,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(Sm),this.root.sharedNodes.clear()}}}function Lj(e){e.updateLayout()}function Aj(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i==="size")Ht(f=>{const h=a?t.measuredBox[f]:t.layoutBox[f],g=tt(h);h.min=r[f].min,h.max=h.min+g});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";lc(a?t.measuredBox[f]:t.layoutBox[f],r[f])}else jy(i,t.layoutBox,r)&&Ht(f=>{const h=a?t.measuredBox[f]:t.layoutBox[f],g=tt(r[f]);h.max=h.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=Rr();zs(l,r,t.layoutBox);const u=Rr();a?zs(u,e.applyTransform(s,!0),t.measuredBox):zs(u,r,t.layoutBox);const c=!vy(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:g}=f;if(h&&g){const v=e.options.layoutAnchor||void 0,b=_e();no(b,t.layoutBox,h.layoutBox,v);const w=_e();no(w,r,g.layoutBox,v),wy(b,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=b,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Dj(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Rj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ij(e){e.clearSnapshot()}function Sm(e){e.clearMeasurements()}function Vj(e){e.isLayoutDirty=!0,e.updateLayout()}function jm(e){e.isLayoutDirty=!1}function Fj(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Oj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Em(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zj(e){e.resolveTargetDelta()}function Bj(e){e.calcProjection()}function $j(e){e.resetSkewAndRotation()}function Hj(e){e.removeLeadSnapshot()}function Cm(e,t,n){e.translate=de(t.translate,0,n),e.scale=de(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Tm(e,t,n,r){e.min=de(t.min,n.min,r),e.max=de(t.max,n.max,r)}function Uj(e,t,n,r){Tm(e.x,t.x,n.x,r),Tm(e.y,t.y,n.y,r)}function Wj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Gj={duration:.45,ease:[.4,0,.1,1]},Pm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Nm=Pm("applewebkit/")&&!Pm("chrome/")?Math.round:ct;function _m(e){e.min=Nm(e.min),e.max=Nm(e.max)}function Kj(e){_m(e.x),_m(e.y)}function jy(e,t,n){return e==="position"||e==="preserve-aspect"&&!mj(ym(t),ym(n),.2)}function qj(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Yj=Sy({attachResizeListener:(e,t)=>di(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),El={current:void 0},Ey=Sy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!El.current){const e=new Yj({});e.mount(window),e.setOptions({layoutScroll:!0}),El.current=e}return El.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),cr=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Mm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xj(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Mm(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{width:g,height:v,top:b,left:w,right:p,bottom:x,direction:y}=u.current;if(t||i===!1||!l.current||!g||!v)return;const k=y==="rtl",E=n==="left"?k?`right: ${p}`:`left: ${w}`:k?`left: ${w}`:`right: ${p}`,C=r==="bottom"?`bottom: ${x}`:`top: ${b}`;l.current.dataset.motionPopId=a;const j=document.createElement("style");c&&(j.nonce=c);const S=s??document.head;return S.appendChild(j),j.sheet&&j.sheet.insertRule(` + */function Ka(){return Ka=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Qb(e,t){let n=Fu(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const Jb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ek=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],tk="6";try{window.__reactRouterVersion=tk}catch{}const nk=m.createContext({isTransitioning:!1}),rk="startTransition",Th=Kv[rk];function sk(e){let{basename:t,children:n,future:r,window:s}=e,i=m.useRef();i.current==null&&(i.current=sb({window:s,v5Compat:!0}));let a=i.current,[l,u]=m.useState({action:a.action,location:a.location}),{v7_startTransition:c}=r||{},d=m.useCallback(f=>{c&&Th?Th(()=>u(f)):u(f)},[u,c]);return m.useLayoutEffect(()=>a.listen(d),[a,d]),m.useEffect(()=>Kb(r),[r]),m.createElement(qb,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}const ik=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ak=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,K=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:a,state:l,target:u,to:c,preventScrollReset:d,viewTransition:f}=t,h=ex(t,Jb),{basename:g}=m.useContext(dn),y,b=!1;if(typeof c=="string"&&ak.test(c)&&(y=c,ik))try{let v=new URL(window.location.href),k=c.startsWith("//")?new URL(v.protocol+c):new URL(c),E=Xr(k.pathname,g);k.origin===v.origin&&E!=null?c=E+k.search+k.hash:b=!0}catch{}let w=_b(c,{relative:s}),p=uk(c,{replace:a,state:l,target:u,preventScrollReset:d,relative:s,viewTransition:f});function x(v){r&&r(v),v.defaultPrevented||p(v)}return m.createElement("a",Ka({},h,{href:y||w,onClick:b||i?r:x,ref:n,target:u}))}),ok=m.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:a=!1,style:l,to:u,viewTransition:c,children:d}=t,f=ex(t,ek),h=Po(u,{relative:f.relative}),g=Ye(),y=m.useContext(q0),{navigator:b,basename:w}=m.useContext(dn),p=y!=null&&dk(h)&&c===!0,x=b.encodeLocation?b.encodeLocation(h).pathname:h.pathname,v=g.pathname,k=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;s||(v=v.toLowerCase(),k=k?k.toLowerCase():null,x=x.toLowerCase()),k&&w&&(k=Xr(k,w)||k);const E=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=v===x||!a&&v.startsWith(x)&&v.charAt(E)==="/",j=k!=null&&(k===x||!a&&k.startsWith(x)&&k.charAt(x.length)==="/"),S={isActive:C,isPending:j,isTransitioning:p},N=C?r:void 0,P;typeof i=="function"?P=i(S):P=[i,C?"active":null,j?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let F=typeof l=="function"?l(S):l;return m.createElement(K,Ka({},f,{"aria-current":N,className:P,ref:n,style:F,to:u,viewTransition:c}),typeof d=="function"?d(S):d)});var Ou;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ou||(Ou={}));var Ph;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ph||(Ph={}));function lk(e){let t=m.useContext(Co);return t||we(!1),t}function uk(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:a,viewTransition:l}=t===void 0?{}:t,u=pr(),c=Ye(),d=Po(e,{relative:a});return m.useCallback(f=>{if(Zb(f,n)){f.preventDefault();let h=r!==void 0?r:Ga(c)===Ga(d);u(e,{replace:h,state:s,preventScrollReset:i,relative:a,viewTransition:l})}},[c,u,d,r,s,n,e,i,a,l])}function ck(e){let t=m.useRef(Fu(e)),n=m.useRef(!1),r=Ye(),s=m.useMemo(()=>Qb(r.search,n.current?null:t.current),[r.search]),i=pr(),a=m.useCallback((l,u)=>{const c=Fu(typeof l=="function"?l(s):l);n.current=!0,i("?"+c,u)},[i,s]);return[s,a]}function dk(e,t){t===void 0&&(t={});let n=m.useContext(nk);n==null&&we(!1);let{basename:r}=lk(Ou.useViewTransitionState),s=Po(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Xr(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Xr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Iu(s.pathname,a)!=null||Iu(s.pathname,i)!=null}const fk="modulepreload",hk=function(e){return"/"+e},Nh={},X=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(u=>{if(u=hk(u),u in Nh)return;Nh[u]=!0;const c=u.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":fk,c||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),c)return new Promise((h,g)=>{f.addEventListener("load",h),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},vd=m.createContext({});function un(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const mk=typeof window<"u",yi=mk?m.useLayoutEffect:m.useEffect,No=m.createContext(null);function wd(e,t){e.indexOf(t)===-1&&e.push(t)}function qa(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const zt=(e,t,n)=>n>t?t:n{};const Vn={},tx=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),nx=e=>typeof e=="object"&&e!==null,rx=e=>/^0[^.\s]+$/u.test(e);function sx(e){let t;return()=>(t===void 0&&(t=e()),t)}const ct=e=>e,vi=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Zr=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class kd{constructor(){this.subscriptions=[]}add(t){return wd(this.subscriptions,t),()=>qa(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;ie*1e3,St=e=>e/1e3,Sd=(e,t)=>t?e*(1e3/t):0,ix=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,pk=1e-7,gk=12;function xk(e,t,n,r,s){let i,a,l=0;do a=t+(n-t)/2,i=ix(a,r,s)-e,i>0?n=a:t=a;while(Math.abs(i)>pk&&++lxk(i,0,1,e,n);return i=>i===0||i===1?i:ix(s(i),t,r)}const ax=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ox=e=>t=>1-e(1-t),lx=wi(.33,1.53,.69,.99),jd=ox(lx),ux=ax(jd),cx=e=>e>=1?1:(e*=2)<1?.5*jd(e):.5*(2-Math.pow(2,-10*(e-1))),Ed=e=>1-Math.sin(Math.acos(e)),dx=ox(Ed),fx=ax(Ed),yk=wi(.42,0,1,1),vk=wi(0,0,.58,1),hx=wi(.42,0,.58,1),wk=e=>Array.isArray(e)&&typeof e[0]!="number",mx=e=>Array.isArray(e)&&typeof e[0]=="number",bk={linear:ct,easeIn:yk,easeInOut:hx,easeOut:vk,circIn:Ed,circInOut:fx,circOut:dx,backIn:jd,backInOut:ux,backOut:lx,anticipate:cx},kk=e=>typeof e=="string",_h=e=>{if(mx(e)){bd(e.length===4);const[t,n,r,s]=e;return wi(t,n,r,s)}else if(kk(e))return bk[e];return e},Ui=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Sk(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(c){i.has(c)&&(u.schedule(c),e()),c(a)}const u={schedule:(c,d=!1,f=!1)=>{const g=f&&r?t:n;return d&&i.add(c),g.add(c),c},cancel:c=>{n.delete(c),i.delete(c)},process:c=>{if(a=c,r){s=!0;return}r=!0;const d=t;t=n,n=d,t.forEach(l),t.clear(),r=!1,s&&(s=!1,u.process(c))}};return u}const jk=40;function px(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Ui.reduce((v,k)=>(v[k]=Sk(i),v),{}),{setup:l,read:u,resolveKeyframes:c,preUpdate:d,update:f,preRender:h,render:g,postRender:y}=a,b=()=>{const v=Vn.useManualTiming,k=v?s.timestamp:performance.now();n=!1,v||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,jk),1)),s.timestamp=k,s.isProcessing=!0,l.process(s),u.process(s),c.process(s),d.process(s),f.process(s),h.process(s),g.process(s),y.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(b))},w=()=>{n=!0,r=!0,s.isProcessing||e(b)};return{schedule:Ui.reduce((v,k)=>{const E=a[k];return v[k]=(C,j=!1,S=!1)=>(n||w(),E.schedule(C,j,S)),v},{}),cancel:v=>{for(let k=0;k(fa===void 0&&et.set(Re.isProcessing||Vn.useManualTiming?Re.timestamp:performance.now()),fa),set:e=>{fa=e,queueMicrotask(Ek)}},gx=e=>t=>typeof t=="string"&&t.startsWith(e),xx=gx("--"),Ck=gx("var(--"),Cd=e=>Ck(e)?Tk.test(e.split("/*")[0].trim()):!1,Tk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Mh(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const is={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},li={...is,transform:e=>zt(0,1,e)},Wi={...is,default:1},Is=e=>Math.round(e*1e5)/1e5,Td=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Pk(e){return e==null}const Nk=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Pd=(e,t)=>n=>!!(typeof n=="string"&&Nk.test(n)&&n.startsWith(e)||t&&!Pk(n)&&Object.prototype.hasOwnProperty.call(n,t)),yx=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,a,l]=r.match(Td);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},_k=e=>zt(0,255,e),pl={...is,transform:e=>Math.round(_k(e))},Qn={test:Pd("rgb","red"),parse:yx("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+pl.transform(e)+", "+pl.transform(t)+", "+pl.transform(n)+", "+Is(li.transform(r))+")"};function Mk(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const zu={test:Pd("#"),parse:Mk,transform:Qn.transform},bi=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xt=bi("deg"),qt=bi("%"),z=bi("px"),Lk=bi("vh"),Ak=bi("vw"),Lh={...qt,parse:e=>qt.parse(e)/100,transform:e=>qt.transform(e*100)},Ar={test:Pd("hsl","hue"),parse:yx("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qt.transform(Is(t))+", "+qt.transform(Is(n))+", "+Is(li.transform(r))+")"},Ce={test:e=>Qn.test(e)||zu.test(e)||Ar.test(e),parse:e=>Qn.test(e)?Qn.parse(e):Ar.test(e)?Ar.parse(e):zu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Qn.transform(e):Ar.transform(e),getAnimatableNone:e=>{const t=Ce.parse(e);return t.alpha=0,Ce.transform(t)}},Dk=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Rk(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Td))==null?void 0:t.length)||0)+(((n=e.match(Dk))==null?void 0:n.length)||0)>0}const vx="number",wx="color",Ik="var",Vk="var(",Ah="${}",Fk=/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 Qr(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const l=t.replace(Fk,u=>(Ce.test(u)?(r.color.push(i),s.push(wx),n.push(Ce.parse(u))):u.startsWith(Vk)?(r.var.push(i),s.push(Ik),n.push(u)):(r.number.push(i),s.push(vx),n.push(parseFloat(u))),++i,Ah)).split(Ah);return{values:n,split:l,indexes:r,types:s}}function Ok(e){return Qr(e).values}function bx({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;itypeof e=="number"?0:Ce.test(e)?Ce.getAnimatableNone(e):e,$k=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Bk(e);function Hk(e){const t=Qr(e);return bx(t)(t.values.map((r,s)=>$k(r,t.split[s])))}const Ft={test:Rk,parse:Ok,createTransformer:zk,getAnimatableNone:Hk};function gl(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Uk({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,a=0;if(!t)s=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,u=2*n-l;s=gl(u,l,e+1/3),i=gl(u,l,e),a=gl(u,l,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Ya(e,t){return n=>n>0?t:e}const de=(e,t,n)=>e+(t-e)*n,xl=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},Wk=[zu,Qn,Ar],Gk=e=>Wk.find(t=>t.test(e));function Dh(e){const t=Gk(e);if(!t)return!1;let n=t.parse(e);return t===Ar&&(n=Uk(n)),n}const Rh=(e,t)=>{const n=Dh(e),r=Dh(t);if(!n||!r)return Ya(e,t);const s={...n};return i=>(s.red=xl(n.red,r.red,i),s.green=xl(n.green,r.green,i),s.blue=xl(n.blue,r.blue,i),s.alpha=de(n.alpha,r.alpha,i),Qn.transform(s))},Bu=new Set(["none","hidden"]);function Kk(e,t){return Bu.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qk(e,t){return n=>de(e,t,n)}function Nd(e){return typeof e=="number"?qk:typeof e=="string"?Cd(e)?Ya:Ce.test(e)?Rh:Zk:Array.isArray(e)?kx:typeof e=="object"?Ce.test(e)?Rh:Yk:Ya}function kx(e,t){const n=[...e],r=n.length,s=e.map((i,a)=>Nd(i)(i,t[a]));return i=>{for(let a=0;a{for(const i in r)n[i]=r[i](s);return n}}function Xk(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Ft.createTransformer(t),r=Qr(e),s=Qr(t);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?Bu.has(e)&&!s.values.length||Bu.has(t)&&!r.values.length?Kk(e,t):vi(kx(Xk(r,s),s.values),n):Ya(e,t)};function Sx(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?de(e,t,n):Nd(e)(e,t)}const Qk=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>re.update(t,n),stop:()=>Tt(t),now:()=>Re.isProcessing?Re.timestamp:et.now()}},jx=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i=Xa?1/0:t}function Jk(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(_d(r),Xa);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:St(s)}}const Se={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 $u(e,t){return e*Math.sqrt(1-t*t)}const e2=12;function t2(e,t,n){let r=n;for(let s=1;s{const d=c*a,f=d*e,h=d-n,g=$u(c,a),y=Math.exp(-f);return yl-h/g*y},i=c=>{const f=c*a*e,h=f*n+n,g=Math.pow(a,2)*Math.pow(c,2)*e,y=Math.exp(-f),b=$u(Math.pow(c,2),a);return(-s(c)+yl>0?-1:1)*((h-g)*y)/b}):(s=c=>{const d=Math.exp(-c*e),f=(c-n)*e+1;return-yl+d*f},i=c=>{const d=Math.exp(-c*e),f=(n-c)*(e*e);return d*f});const l=5/e,u=t2(s,i,l);if(e=gt(e),isNaN(u))return{stiffness:Se.stiffness,damping:Se.damping,duration:e};{const c=Math.pow(u,2)*r;return{stiffness:c,damping:a*2*Math.sqrt(r*c),duration:e}}}const r2=["duration","bounce"],s2=["stiffness","damping","mass"];function Ih(e,t){return t.some(n=>e[n]!==void 0)}function i2(e){let t={velocity:Se.velocity,stiffness:Se.stiffness,damping:Se.damping,mass:Se.mass,isResolvedFromDuration:!1,...e};if(!Ih(e,s2)&&Ih(e,r2))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*zt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Se.mass,stiffness:s,damping:i}}else{const n=n2({...e,velocity:0});t={...t,...n,mass:Se.mass},t.isResolvedFromDuration=!0}return t}function Za(e=Se.visualDuration,t=Se.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:c,mass:d,duration:f,velocity:h,isResolvedFromDuration:g}=i2({...n,velocity:-St(n.velocity||0)}),y=h||0,b=c/(2*Math.sqrt(u*d)),w=a-i,p=St(Math.sqrt(u/d)),x=Math.abs(w)<5;r||(r=x?Se.restSpeed.granular:Se.restSpeed.default),s||(s=x?Se.restDelta.granular:Se.restDelta.default);let v,k,E,C,j,S;if(b<1)E=$u(p,b),C=(y+b*p*w)/E,v=P=>{const F=Math.exp(-b*p*P);return a-F*(C*Math.sin(E*P)+w*Math.cos(E*P))},j=b*p*C+w*E,S=b*p*w-C*E,k=P=>Math.exp(-b*p*P)*(j*Math.sin(E*P)+S*Math.cos(E*P));else if(b===1){v=F=>a-Math.exp(-p*F)*(w+(y+p*w)*F);const P=y+p*w;k=F=>Math.exp(-p*F)*(p*P*F-y)}else{const P=p*Math.sqrt(b*b-1);v=ne=>{const q=Math.exp(-b*p*ne),G=Math.min(P*ne,300);return a-q*((y+b*p*w)*Math.sinh(G)+P*w*Math.cosh(G))/P};const F=(y+b*p*w)/P,B=b*p*F-w*P,se=b*p*w-F*P;k=ne=>{const q=Math.exp(-b*p*ne),G=Math.min(P*ne,300);return q*(B*Math.sinh(G)+se*Math.cosh(G))}}const N={calculatedDuration:g&&f||null,velocity:P=>gt(k(P)),next:P=>{if(!g&&b<1){const B=Math.exp(-b*p*P),se=Math.sin(E*P),ne=Math.cos(E*P),q=a-B*(C*se+w*ne),G=gt(B*(j*se+S*ne));return l.done=Math.abs(G)<=r&&Math.abs(a-q)<=s,l.value=l.done?a:q,l}const F=v(P);if(g)l.done=P>=f;else{const B=gt(k(P));l.done=Math.abs(B)<=r&&Math.abs(a-F)<=s}return l.value=l.done?a:F,l},toString:()=>{const P=Math.min(_d(N),Xa),F=jx(B=>N.next(P*B).value,P,30);return P+"ms "+F},toTransition:()=>{}};return N}Za.applyToOptions=e=>{const t=Jk(e,100,Za);return e.ease=t.ease,e.duration=gt(t.duration),e.type="keyframes",e};const a2=5;function Ex(e,t,n){const r=Math.max(t-a2,0);return Sd(n-e(r),t-r)}function Hu({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:u,restDelta:c=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},g=S=>l!==void 0&&Su,y=S=>l===void 0?u:u===void 0||Math.abs(l-S)-b*Math.exp(-S/r),v=S=>p+x(S),k=S=>{const N=x(S),P=v(S);h.done=Math.abs(N)<=c,h.value=h.done?p:P};let E,C;const j=S=>{g(h.value)&&(E=S,C=Za({keyframes:[h.value,y(h.value)],velocity:Ex(v,S,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:d}))};return j(0),{calculatedDuration:null,next:S=>{let N=!1;return!C&&E===void 0&&(N=!0,k(S),j(S)),E!==void 0&&S>=E?C.next(S-E):(!N&&k(S),h)}}}function o2(e,t,n){const r=[],s=n||Vn.mix||Sx,i=e.length-1;for(let a=0;at[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=o2(t,r,s),u=l.length,c=d=>{if(a&&d1)for(;fc(zt(e[0],e[i-1],d)):c}function l2(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Zr(0,t,r);e.push(de(n,1,s))}}function Cx(e){const t=[0];return l2(t,e.length-1),t}function u2(e,t){return e.map(n=>n*t)}function c2(e,t){return e.map(()=>t||hx).splice(0,e.length-1)}function Vs({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=wk(r)?r.map(_h):_h(r),i={done:!1,value:t[0]},a=u2(n&&n.length===t.length?n:Cx(t),e),l=Md(a,t,{ease:Array.isArray(s)?s:c2(t,s)});return{calculatedDuration:e,next:u=>(i.value=l(u),i.done=u>=e,i)}}const d2=e=>e!==null;function _o(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(d2),l=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const f2={decay:Hu,inertia:Hu,tween:Vs,keyframes:Vs,spring:Za};function Tx(e){typeof e.type=="string"&&(e.type=f2[e.type])}class Ld{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const h2=e=>e/100;class ui extends Ld{constructor(t){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!==et.now()&&this.tick(et.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Tx(t);const{type:n=Vs,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:a=0}=t;let{keyframes:l}=t;const u=n||Vs;u!==Vs&&typeof l[0]!="number"&&(this.mixKeyframes=vi(h2,Sx(l[0],l[1])),l=[0,100]);const c=u({...t,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...l].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=_d(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:g,type:y,onUpdate:b,finalKeyframe:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const p=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?p<0:p>s;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let v=this.currentTime,k=r;if(f){const S=Math.min(this.currentTime,s)/l;let N=Math.floor(S),P=S%1;!P&&S>=1&&(P=1),P===1&&N--,N=Math.min(N,f+1),!!(N%2)&&(h==="reverse"?(P=1-P,g&&(P-=g/l)):h==="mirror"&&(k=a)),v=zt(0,1,P)*l}let E;x?(this.delayState.value=d[0],E=this.delayState):E=k.next(v),i&&!x&&(E.value=i(E.value));let{done:C}=E;!x&&u!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return j&&y!==Hu&&(E.value=_o(d,this.options,w,this.speed)),b&&b(E.value),j&&this.finish(),E}then(t,n){return this.finished.then(t,n)}get duration(){return St(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+St(t)}get time(){return St(this.currentTime)}set time(t){t=gt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Ex(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(et.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=St(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=Qk,startTime:n}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),(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(et.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function m2(e){for(let t=1;te*180/Math.PI,Uu=e=>{const t=Jn(Math.atan2(e[1],e[0]));return Wu(t)},p2={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Uu,rotateZ:Uu,skewX:e=>Jn(Math.atan(e[1])),skewY:e=>Jn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Wu=e=>(e=e%360,e<0&&(e+=360),e),Vh=Uu,Fh=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Oh=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),g2={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fh,scaleY:Oh,scale:e=>(Fh(e)+Oh(e))/2,rotateX:e=>Wu(Jn(Math.atan2(e[6],e[5]))),rotateY:e=>Wu(Jn(Math.atan2(-e[2],e[0]))),rotateZ:Vh,rotate:Vh,skewX:e=>Jn(Math.atan(e[4])),skewY:e=>Jn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Gu(e){return e.includes("scale")?1:0}function Ku(e,t){if(!e||e==="none")return Gu(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=g2,s=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=p2,s=l}if(!s)return Gu(t);const i=r[t],a=s[1].split(",").map(y2);return typeof i=="function"?i(a):a[i]}const x2=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Ku(n,t)};function y2(e){return parseFloat(e.trim())}const as=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],os=new Set([...as,"pathRotation"]),zh=e=>e===is||e===z,v2=new Set(["x","y","z"]),w2=as.filter(e=>!v2.has(e));function b2(e){const t=[];return w2.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const kn={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ku(t,"x"),y:(e,{transform:t})=>Ku(t,"y")};kn.translateX=kn.x;kn.translateY=kn.y;const nr=new Set;let qu=!1,Yu=!1,Xu=!1;function Px(){if(Yu){const e=Array.from(nr).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=b2(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,a])=>{var l;(l=r.getValue(i))==null||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Yu=!1,qu=!1,nr.forEach(e=>e.complete(Xu)),nr.clear()}function Nx(){nr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Yu=!0)})}function k2(){Xu=!0,Nx(),Px(),Xu=!1}class Ad{constructor(t,n,r,s,i,a=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=a}scheduleResolve(){this.state="scheduled",this.isAsync?(nr.add(this),qu||(qu=!0,re.read(Nx),re.resolveKeyframes(Px))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&i===void 0&&s.set(t[0])}m2(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),nr.delete(this)}cancel(){this.state==="scheduled"&&(nr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const S2=e=>e.startsWith("--");function _x(e,t,n){S2(t)?e.style.setProperty(t,n):e.style[t]=n}const j2={};function Dd(e,t){const n=sx(e);return()=>j2[t]??n()}const Rd=Dd(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Mx=Dd(()=>window.ViewTimeline!==void 0,"viewTimeline"),Lx=Dd(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Es=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Bh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Es([0,.65,.55,1]),circOut:Es([.55,0,1,.45]),backIn:Es([.31,.01,.66,-.59]),backOut:Es([.33,1.53,.69,.99])};function Ax(e,t){if(e)return typeof e=="function"?Lx()?jx(e,t):"ease-out":mx(e)?Es(e):Array.isArray(e)?e.map(n=>Ax(n,t)||Bh.easeOut):Bh[e]}function E2(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:a="loop",ease:l="easeOut",times:u}={},c=void 0){const d={[t]:n};u&&(d.offset=u);const f=Ax(l,s);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(d,h)}function Dx(e){return typeof e=="function"&&"applyToOptions"in e}function C2({type:e,...t}){return Dx(e)&&Lx()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Rx extends Ld{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:l,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=t,bd(typeof t.type!="string");const c=C2(t);this.animation=E2(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=_o(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(d),_x(n,r,d),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return St(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+St(t)}get time(){return St(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=gt(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Rd()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),ct):s(this)}}const Ix={anticipate:cx,backInOut:ux,circInOut:fx};function T2(e){return e in Ix}function P2(e){typeof e.ease=="string"&&T2(e.ease)&&(e.ease=Ix[e.ease])}const vl=10;class N2 extends Rx{constructor(t){P2(t),Tx(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...a}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new ui({...a,autoplay:!1}),u=Math.max(vl,et.now()-this.startTime),c=zt(0,vl,u-vl),d=l.sample(u).value,{name:f}=this.options;i&&f&&_x(i,f,d),n.setWithVelocity(l.sample(Math.max(0,u-c)).value,d,c),l.stop()}}const $h=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ft.test(e)||e==="0")&&!e.startsWith("url("));function _2(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function I2(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:a,keyframes:l}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return R2()&&n&&(Vx.has(n)||D2.has(n)&&A2(l))&&(n!=="transform"||!d)&&!c&&!r&&s!=="mirror"&&i!==0&&a!=="inertia"}const V2=40;class F2 extends Ld{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:a="loop",keyframes:l,name:u,motionValue:c,element:d,...f}){var y;super(),this.stop=()=>{var b,w;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(w=this.keyframeResolver)==null||w.cancel()},this.createdAt=et.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:a,name:u,motionValue:c,element:d,...f},g=(d==null?void 0:d.KeyframeResolver)||Ad;this.keyframeResolver=new g(l,(b,w,p)=>this.onKeyframesResolved(b,w,h,!p),u,c,d),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(t,n,r,s){var p,x;this.keyframeResolver=void 0;const{name:i,type:a,velocity:l,delay:u,isHandoff:c,onUpdate:d}=r;this.resolvedAt=et.now();let f=!0;M2(t,i,a,l)||(f=!1,(Vn.instantAnimations||!u)&&(d==null||d(_o(t,r,n))),t[0]=t[t.length-1],Zu(r),r.repeat=0);const g={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>V2?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=f&&!c&&I2(g),b=(x=(p=g.motionValue)==null?void 0:p.owner)==null?void 0:x.current;let w;if(y)try{w=new N2({...g,element:b})}catch{w=new ui(g)}else w=new ui(g);w.finished.then(()=>{this.notifyFinished()}).catch(ct),this.pendingTimeline&&(this.stopTimeline=w.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=w}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),k2()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Fx(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),a=e.size,l=(a-1)*r;return typeof n=="function"?n(i,a):s===1?i*r:l-i*r}const Hh=30,O2=e=>!isNaN(parseFloat(e)),Fs={current:void 0};class z2{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=et.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 a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=et.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=O2(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new kd);const r=this.events[t].add(n);return t==="change"?()=>{r(),re.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return Fs.current&&Fs.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=et.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Hh)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Hh);return Sd(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(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 t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Rt(e,t){return new z2(e,t)}function Id(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Vd(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?Id(n,e):n}const B2={type:"spring",stiffness:500,damping:25,restSpeed:10},$2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),H2={type:"keyframes",duration:.8},U2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},W2=(e,{keyframes:t})=>t.length>2?H2:os.has(e)?e.startsWith("scale")?$2(t[1]):B2:U2,G2=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function K2(e){for(const t in e)if(!G2.has(t))return!0;return!1}const Fd=(e,t,n,r={},s,i)=>a=>{const l=Vd(r,e)||{},u=l.delay||r.delay||0;let{elapsed:c=0}=r;c=c-gt(u);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:s};K2(l)||Object.assign(d,W2(e,d)),d.duration&&(d.duration=gt(d.duration)),d.repeatDelay&&(d.repeatDelay=gt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Zu(d),d.delay===0&&(f=!0)),(Vn.instantAnimations||Vn.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(f=!0,Zu(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,f&&!i&&t.get()!==void 0){const h=_o(d.keyframes,l);if(h!==void 0){re.update(()=>{d.onUpdate(h),d.onComplete()});return}}return l.isSync?new ui(d):new F2(d)},q2=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Y2(e){const t=q2.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function Ox(e,t,n=1){const[r,s]=Y2(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return tx(a)?parseFloat(a):a}return Cd(s)?Ox(s,t,n+1):s}function Uh(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Od(e,t,n,r){if(typeof t=="function"){const[s,i]=Uh(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=Uh(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function rr(e,t,n){const r=e.getProps();return Od(r,t,n!==void 0?n:r.custom,e)}const zx=new Set(["width","height","top","left","right","bottom",...as]),Qu=e=>Array.isArray(e);function X2(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Rt(n))}function Z2(e){return Qu(e)?e[e.length-1]||0:e}function Q2(e,t){const n=rr(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const a in i){const l=Z2(i[a]);X2(e,a,l)}}const Ae=e=>!!(e&&e.getVelocity);function J2(e){return!!(Ae(e)&&e.add)}function Ju(e,t){const n=e.getValue("willChange");if(J2(n))return n.add(t);if(!n&&Vn.WillChange){const r=new Vn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function zd(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const eS="framerAppearId",Bx="data-"+zd(eS);function $x(e){return e.props[Bx]}function tS({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Hx(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:a,...l}=t;const u=e.getDefaultTransition();i=i?Id(i,u):u;const c=i==null?void 0:i.reduceMotion,d=i==null?void 0:i.skipAnimations;r&&(i=r);const f=[],h=s&&e.animationState&&e.animationState.getState()[s],g=i==null?void 0:i.path;g&&g.animateVisualElement(e,l,i,n,f);for(const y in l){const b=e.getValue(y,e.latestValues[y]??null),w=l[y];if(w===void 0||h&&tS(h,y))continue;const p={delay:n,...Vd(i||{},y)};d&&(p.skipAnimations=!0);const x=b.get();if(x!==void 0&&!b.isAnimating()&&!Array.isArray(w)&&w===x&&!p.velocity){re.update(()=>b.set(w));continue}let v=!1;if(window.MotionHandoffAnimation){const C=$x(e);if(C){const j=window.MotionHandoffAnimation(C,y,re);j!==null&&(p.startTime=j,v=!0)}}Ju(e,y);const k=c??e.shouldReduceMotion;b.start(Fd(y,b,w,k&&zx.has(y)?{type:!1}:p,e,v));const E=b.animation;E&&f.push(E)}if(a){const y=()=>re.update(()=>{a&&Q2(e,a)});f.length?Promise.all(f).then(y):y()}return f}function ec(e,t,n={}){var u;const r=rr(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(Hx(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return nS(e,t,c,d,f,h,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[c,d]=l==="beforeChildren"?[i,a]:[a,i];return c().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function nS(e,t,n=0,r=0,s=0,i=1,a){const l=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),l.push(ec(u,t,{...a,delay:n+(typeof r=="function"?0:r)+Fx(e.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(l)}function rS(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>ec(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=ec(e,t,n);else{const s=typeof t=="function"?rr(e,t,n.custom):t;r=Promise.all(Hx(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const sS={test:e=>e==="auto",parse:e=>e},Ux=e=>t=>t.test(e),Wx=[is,z,qt,Xt,Ak,Lk,sS],Wh=e=>Wx.find(Ux(e));function iS(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||rx(e):!0}const aS=new Set(["brightness","contrast","saturate","opacity"]);function oS(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Td)||[];if(!r)return e;const s=n.replace(r,"");let i=aS.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const lS=/\b([a-z-]*)\(.*?\)/gu,tc={...Ft,getAnimatableNone:e=>{const t=e.match(lS);return t?t.map(oS).join(" "):e}},nc={...Ft,getAnimatableNone:e=>{const t=Ft.parse(e);return Ft.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},Gh={...is,transform:Math.round},uS={rotate:Xt,pathRotation:Xt,rotateX:Xt,rotateY:Xt,rotateZ:Xt,scale:Wi,scaleX:Wi,scaleY:Wi,scaleZ:Wi,skew:Xt,skewX:Xt,skewY:Xt,distance:z,translateX:z,translateY:z,translateZ:z,x:z,y:z,z,perspective:z,transformPerspective:z,opacity:li,originX:Lh,originY:Lh,originZ:z},Qa={borderWidth:z,borderTopWidth:z,borderRightWidth:z,borderBottomWidth:z,borderLeftWidth:z,borderRadius:z,borderTopLeftRadius:z,borderTopRightRadius:z,borderBottomRightRadius:z,borderBottomLeftRadius:z,width:z,maxWidth:z,height:z,maxHeight:z,top:z,right:z,bottom:z,left:z,inset:z,insetBlock:z,insetBlockStart:z,insetBlockEnd:z,insetInline:z,insetInlineStart:z,insetInlineEnd:z,padding:z,paddingTop:z,paddingRight:z,paddingBottom:z,paddingLeft:z,paddingBlock:z,paddingBlockStart:z,paddingBlockEnd:z,paddingInline:z,paddingInlineStart:z,paddingInlineEnd:z,margin:z,marginTop:z,marginRight:z,marginBottom:z,marginLeft:z,marginBlock:z,marginBlockStart:z,marginBlockEnd:z,marginInline:z,marginInlineStart:z,marginInlineEnd:z,fontSize:z,backgroundPositionX:z,backgroundPositionY:z,...uS,zIndex:Gh,fillOpacity:li,strokeOpacity:li,numOctaves:Gh},cS={...Qa,color:Ce,backgroundColor:Ce,outlineColor:Ce,fill:Ce,stroke:Ce,borderColor:Ce,borderTopColor:Ce,borderRightColor:Ce,borderBottomColor:Ce,borderLeftColor:Ce,filter:tc,WebkitFilter:tc,mask:nc,WebkitMask:nc},Gx=e=>cS[e],dS=new Set([tc,nc]);function Kx(e,t){let n=Gx(e);return dS.has(n)||(n=Ft),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const fS=new Set(["auto","none","0"]);function hS(e,t,n){let r=0,s;for(;r{t.getValue(u).set(c)}),this.resolveNoneKeyframes()}}const Bd=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function qx(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const rc=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Os(e){return nx(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Jr,cancel:Yx}=px(queueMicrotask,!1),Mt={x:!1,y:!1};function Xx(){return Mt.x||Mt.y}function pS(e){return e==="x"||e==="y"?Mt[e]?null:(Mt[e]=!0,()=>{Mt[e]=!1}):Mt.x||Mt.y?null:(Mt.x=Mt.y=!0,()=>{Mt.x=Mt.y=!1})}function Zx(e,t){const n=qx(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function gS(e){return!(e.pointerType==="touch"||Xx())}function xS(e,t,n={}){const[r,s,i]=Zx(e,n);return r.forEach(a=>{let l=!1,u=!1,c;const d=()=>{a.removeEventListener("pointerleave",y)},f=w=>{c&&(c(w),c=void 0),d()},h=w=>{l=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),u&&(u=!1,f(w))},g=()=>{l=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},y=w=>{if(w.pointerType!=="touch"){if(l){u=!0;return}f(w)}},b=w=>{if(!gS(w))return;u=!1;const p=t(a,w);typeof p=="function"&&(c=p,a.addEventListener("pointerleave",y,s))};a.addEventListener("pointerenter",b,s),a.addEventListener("pointerdown",g,s)}),i}const Qx=(e,t)=>t?e===t?!0:Qx(e,t.parentElement):!1,$d=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,yS=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function vS(e){return yS.has(e.tagName)||e.isContentEditable===!0}const wS=new Set(["INPUT","SELECT","TEXTAREA"]);function bS(e){return wS.has(e.tagName)||e.isContentEditable===!0}const ha=new WeakSet;function Kh(e){return t=>{t.key==="Enter"&&e(t)}}function wl(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const kS=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Kh(()=>{if(ha.has(n))return;wl(n,"down");const s=Kh(()=>{wl(n,"up")}),i=()=>wl(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function qh(e){return $d(e)&&!Xx()}const Yh=new WeakSet;function SS(e,t,n={}){const[r,s,i]=Zx(e,n),a=l=>{const u=l.currentTarget;if(!qh(l)||Yh.has(l))return;ha.add(u),n.stopPropagation&&Yh.add(l);const c=t(u,l),d={...s,capture:!0},f=(y,b)=>{window.removeEventListener("pointerup",h,d),window.removeEventListener("pointercancel",g,d),ha.has(u)&&ha.delete(u),qh(y)&&typeof c=="function"&&c(y,{success:b})},h=y=>{f(y,u===window||u===document||n.useGlobalTarget||Qx(u,y.target))},g=y=>{f(y,!1)};window.addEventListener("pointerup",h,d),window.addEventListener("pointercancel",g,d)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,s),Os(l)&&(l.addEventListener("focus",c=>kS(c,s)),!vS(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function Hd(e){return nx(e)&&"ownerSVGElement"in e}const ma=new WeakMap;let hn;const Jx=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Hd(r)&&"getBBox"in r?r.getBBox()[t]:r[n],jS=Jx("inline","width","offsetWidth"),ES=Jx("block","height","offsetHeight");function CS({target:e,borderBoxSize:t}){var n;(n=ma.get(e))==null||n.forEach(r=>{r(e,{get width(){return jS(e,t)},get height(){return ES(e,t)}})})}function TS(e){e.forEach(CS)}function PS(){typeof ResizeObserver>"u"||(hn=new ResizeObserver(TS))}function NS(e,t){hn||PS();const n=qx(e);return n.forEach(r=>{let s=ma.get(r);s||(s=new Set,ma.set(r,s)),s.add(t),hn==null||hn.observe(r)}),()=>{n.forEach(r=>{const s=ma.get(r);s==null||s.delete(t),s!=null&&s.size||hn==null||hn.unobserve(r)})}}const pa=new Set;let Dr;function _S(){Dr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};pa.forEach(t=>t(e))},window.addEventListener("resize",Dr)}function MS(e){return pa.add(e),Dr||_S(),()=>{pa.delete(e),!pa.size&&typeof Dr=="function"&&(window.removeEventListener("resize",Dr),Dr=void 0)}}function sc(e,t){return typeof e=="function"?MS(e):NS(e,t)}function ey(e,t){let n;const r=()=>{const{currentTime:s}=t,a=(s===null?0:s.value)/100;n!==a&&e(a),n=a};return re.preUpdate(r,!0),()=>Tt(r)}function LS(e){return Hd(e)&&e.tagName==="svg"}function AS(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],i=e[2+n],a=e[3+n],l=Md(s,i,a);return t?l(r):l}function DS(e,t,n={}){const r=e.get();let s=null,i=r,a;const l=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,u=()=>{s&&(s.stop(),s=null),e.animation=void 0},c=()=>{const f=Xh(e.get()),h=Xh(i);if(f===h){u();return}const g=s?s.getGeneratorVelocity():e.getVelocity();u(),s=new ui({keyframes:[f,h],velocity:g,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:a})},d=()=>{var f;c(),e.animation=s??void 0,(f=e.events.animationStart)==null||f.notify(),s==null||s.then(()=>{var h;e.animation=void 0,(h=e.events.animationComplete)==null||h.notify()})};if(e.attach((f,h)=>{i=f,a=g=>h(bl(g,l)),re.postRender(d)},u),Ae(t)){let f=n.skipInitialAnimation===!0;const h=t.on("change",y=>{f?(f=!1,e.jump(bl(y,l),!1)):e.set(bl(y,l))}),g=e.on("destroy",h);return()=>{h(),g()}}return u}function bl(e,t){return t?e+t:e}function Xh(e){return typeof e=="number"?e:parseFloat(e)}const RS=[...Wx,Ce,Ft],IS=e=>RS.find(Ux(e)),Zh=()=>({translate:0,scale:1,origin:0,originPoint:0}),Rr=()=>({x:Zh(),y:Zh()}),Qh=()=>({min:0,max:0}),_e=()=>({x:Qh(),y:Qh()}),VS=new WeakMap;function Mo(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ci(e){return typeof e=="string"||Array.isArray(e)}const Ud=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wd=["initial",...Ud];function Lo(e){return Mo(e.animate)||Wd.some(t=>ci(e[t]))}function ty(e){return!!(Lo(e)||e.variants)}function FS(e,t,n){for(const r in t){const s=t[r],i=n[r];if(Ae(s))e.addValue(r,s);else if(Ae(i))e.addValue(r,Rt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,Rt(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ja={current:null},Gd={current:!1},OS=typeof window<"u";function ny(){if(Gd.current=!0,!!OS)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ja.current=e.matches;e.addEventListener("change",t),t()}else Ja.current=!1}const Jh=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let eo={};function ry(e){eo=e}function zS(){return eo}class BS{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:a,visualState:l},u={}){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=Ad,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 g=et.now();this.renderScheduledAtthis.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Gd.current||ny(),this.shouldReduceMotion=Ja.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),Tt(this.notifyUpdate),Tt(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.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(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Vx.has(t)&&this.current instanceof HTMLElement){const{factory:a,keyframes:l,times:u,ease:c,duration:d}=n.accelerate,f=new Rx({element:this.current,name:t,keyframes:l,times:u,ease:c,duration:gt(d)}),h=a(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=os.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&re.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in eo){const n=eo[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];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):_e()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Rt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(tx(r)||rx(r))?r=parseFloat(r):!IS(r)&&Ft.test(n)&&(r=Kx(t,n)),this.setBaseTarget(t,Ae(r)?r.get():r)),Ae(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=Od(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ae(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new kd),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Jr.render(this.render)}}class sy extends BS{constructor(){super(...arguments),this.KeyframeResolver=mS}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ae(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Bn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function iy({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function $S({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function HS(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function kl(e){return e===void 0||e===1}function ic({scale:e,scaleX:t,scaleY:n}){return!kl(e)||!kl(t)||!kl(n)}function qn(e){return ic(e)||ay(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ay(e){return em(e.x)||em(e.y)}function em(e){return e&&e!=="0%"}function to(e,t,n){const r=e-n,s=t*r;return n+s}function tm(e,t,n,r,s){return s!==void 0&&(e=to(e,s,r)),to(e,n,r)+t}function ac(e,t=0,n=1,r,s){e.min=tm(e.min,t,n,r,s),e.max=tm(e.max,t,n,r,s)}function oy(e,{x:t,y:n}){ac(e.x,t.translate,t.scale,t.originPoint),ac(e.y,n.translate,n.scale,n.originPoint)}const nm=.999999999999,rm=1.0000000000001;function US(e,t,n,r=!1){var l;const s=n.length;if(!s)return;t.x=t.y=1;let i,a;for(let u=0;unm&&(t.x=1),t.ynm&&(t.y=1)}function Ut(e,t){e.min+=t,e.max+=t}function sm(e,t,n,r,s=.5){const i=de(e.min,e.max,s);ac(e,t,n,i,r)}function im(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ga(e,t,n){const r=n??e;sm(e.x,im(t.x,r.x),t.scaleX,t.scale,t.originX),sm(e.y,im(t.y,r.y),t.scaleY,t.scale,t.originY)}function ly(e,t){return iy(HS(e.getBoundingClientRect(),t))}function WS(e,t,n){const r=ly(e,n),{scroll:s}=t;return s&&(Ut(r.x,s.offset.x),Ut(r.y,s.offset.y)),r}const GS={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},KS=as.length;function qS(e,t,n){let r="",s=!0;for(let a=0;a{if(!t.target)return e;if(typeof e=="string")if(z.test(e))e=parseFloat(e);else return e;const n=am(e,t.target.x),r=am(e,t.target.y);return`${n}% ${r}%`}},YS={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Ft.parse(e);if(s.length>5)return r;const i=Ft.createTransformer(e),a=typeof s[0]!="number"?1:0,l=n.x.scale*t.x,u=n.y.scale*t.y;s[0+a]/=l,s[1+a]/=u;const c=de(l,u,.5);return typeof s[2+a]=="number"&&(s[2+a]/=c),typeof s[3+a]=="number"&&(s[3+a]/=c),i(s)}},oc={borderRadius:{...xs,applyTo:[...Bd]},borderTopLeftRadius:xs,borderTopRightRadius:xs,borderBottomLeftRadius:xs,borderBottomRightRadius:xs,boxShadow:YS};function cy(e,{layout:t,layoutId:n}){return os.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!oc[e]||e==="opacity")}function qd(e,t,n){var a;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const l in r)(Ae(r[l])||s&&Ae(s[l])||cy(l,e)||((a=n==null?void 0:n.getValue(l))==null?void 0:a.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function XS(e){return window.getComputedStyle(e)}class ZS extends sy{constructor(){super(...arguments),this.type="html",this.renderInstance=uy}readValueFromInstance(t,n){var r;if(os.has(n))return(r=this.projection)!=null&&r.isProjecting?Gu(n):x2(t,n);{const s=XS(t),i=(xx(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return ly(t,n)}build(t,n,r){Kd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return qd(t,n,r)}}const QS={offset:"stroke-dashoffset",array:"stroke-dasharray"},JS={offset:"strokeDashoffset",array:"strokeDasharray"};function ej(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?QS:JS;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const tj=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function dy(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:a=0,...l},u,c,d){if(Kd(e,l,c),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const g of tj)f[g]!==void 0&&(h[g]=f[g],delete f[g]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&ej(f,s,i,a,!1)}const fy=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"]),hy=e=>typeof e=="string"&&e.toLowerCase()==="svg";function nj(e,t,n,r){uy(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(fy.has(s)?s:zd(s),t.attrs[s])}function my(e,t,n){const r=qd(e,t,n);for(const s in e)if(Ae(e[s])||Ae(t[s])){const i=as.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class rj extends sy{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_e}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(os.has(n)){const r=Gx(n);return r&&r.default||0}return n=fy.has(n)?n:zd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return my(t,n,r)}build(t,n,r){dy(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){nj(t,n,r,s)}mount(t){this.isSVGTag=hy(t.tagName),super.mount(t)}}const sj=Wd.length;function py(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?py(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>rS(e,n,r)))}function lj(e){let t=oj(e),n=om(),r=!0,s=!1;const i=c=>(d,f)=>{var g;const h=rr(e,f,c==="exit"?(g=e.presenceContext)==null?void 0:g.custom:void 0);if(h){const{transition:y,transitionEnd:b,...w}=h;d={...d,...w,...b}}return d};function a(c){t=c(e)}function l(c){const{props:d}=e,f=py(e.parent)||{},h=[],g=new Set;let y={},b=1/0;for(let p=0;pb&&E,P=!1;const F=Array.isArray(k)?k:[k];let B=F.reduce(i(x),{});C===!1&&(B={});const{prevResolvedValues:se={}}=v,ne={...se,...B},q=T=>{N=!0,g.has(T)&&(P=!0,g.delete(T)),v.needsAnimating[T]=!0;const M=e.getValue(T);M&&(M.liveStyle=!1)};for(const T in ne){const M=B[T],A=se[T];if(y.hasOwnProperty(T))continue;let R=!1;Qu(M)&&Qu(A)?R=!gy(M,A)||S:R=M!==A,R?M!=null?q(T):g.add(T):M!==void 0&&g.has(T)?q(T):v.protectedKeys[T]=!0}v.prevProp=k,v.prevResolvedValues=B,v.isActive&&(y={...y,...B}),(r||s)&&e.blockInitialAnimation&&(N=!1);const G=j&&S;N&&(!G||P)&&h.push(...F.map(T=>{const M={type:x};if(typeof T=="string"&&(r||s)&&!G&&e.manuallyAnimateOnMount&&e.parent){const{parent:A}=e,R=rr(A,T);if(A.enteringChildren&&R){const{delayChildren:H}=R.transition||{};M.delay=Fx(A.enteringChildren,e,H)}}return{animation:T,options:M}}))}if(g.size){const p={};if(typeof d.initial!="boolean"){const x=rr(e,Array.isArray(d.initial)?d.initial[0]:d.initial);x&&x.transition&&(p.transition=x.transition)}g.forEach(x=>{const v=e.getBaseTarget(x),k=e.getValue(x);k&&(k.liveStyle=!0),p[x]=v??null}),h.push({animation:p})}let w=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,s=!1,w?t(h):Promise.resolve()}function u(c,d){var h;if(n[c].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(g=>{var y;return(y=g.animationState)==null?void 0:y.setActive(c,d)}),n[c].isActive=d;const f=l(c);for(const g in n)n[g].protectedKeys={};return f}return{animateChanges:l,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=om(),s=!0}}}function uj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!gy(t,e):!1}function Un(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function om(){return{animate:Un(!0),whileInView:Un(),whileHover:Un(),whileTap:Un(),whileDrag:Un(),whileFocus:Un(),exit:Un()}}function lc(e,t){e.min=t.min,e.max=t.max}function _t(e,t){lc(e.x,t.x),lc(e.y,t.y)}function lm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const xy=1e-4,cj=1-xy,dj=1+xy,yy=.01,fj=0-yy,hj=0+yy;function tt(e){return e.max-e.min}function mj(e,t,n){return Math.abs(e-t)<=n}function um(e,t,n,r=.5){e.origin=r,e.originPoint=de(t.min,t.max,e.origin),e.scale=tt(n)/tt(t),e.translate=de(n.min,n.max,e.origin)-e.originPoint,(e.scale>=cj&&e.scale<=dj||isNaN(e.scale))&&(e.scale=1),(e.translate>=fj&&e.translate<=hj||isNaN(e.translate))&&(e.translate=0)}function zs(e,t,n,r){um(e.x,t.x,n.x,r?r.originX:void 0),um(e.y,t.y,n.y,r?r.originY:void 0)}function cm(e,t,n,r=0){const s=r?de(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+tt(t)}function pj(e,t,n,r){cm(e.x,t.x,n.x,r==null?void 0:r.x),cm(e.y,t.y,n.y,r==null?void 0:r.y)}function dm(e,t,n,r=0){const s=r?de(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+tt(t)}function no(e,t,n,r){dm(e.x,t.x,n.x,r==null?void 0:r.x),dm(e.y,t.y,n.y,r==null?void 0:r.y)}function fm(e,t,n,r,s){return e-=t,e=to(e,1/n,r),s!==void 0&&(e=to(e,1/s,r)),e}function gj(e,t=0,n=1,r=.5,s,i=e,a=e){if(qt.test(t)&&(t=parseFloat(t),t=de(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=de(i.min,i.max,r);e===i&&(l-=t),e.min=fm(e.min,t,n,l,s),e.max=fm(e.max,t,n,l,s)}function hm(e,t,[n,r,s],i,a){gj(e,t[n],t[r],t[s],t.scale,i,a)}const xj=["x","scaleX","originX"],yj=["y","scaleY","originY"];function mm(e,t,n,r){hm(e.x,t,xj,n?n.x:void 0,r?r.x:void 0),hm(e.y,t,yj,n?n.y:void 0,r?r.y:void 0)}function pm(e){return e.translate===0&&e.scale===1}function vy(e){return pm(e.x)&&pm(e.y)}function gm(e,t){return e.min===t.min&&e.max===t.max}function vj(e,t){return gm(e.x,t.x)&&gm(e.y,t.y)}function xm(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function wy(e,t){return xm(e.x,t.x)&&xm(e.y,t.y)}function ym(e){return tt(e.x)/tt(e.y)}function vm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ht(e){return[e("x"),e("y")]}function wj(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((s||i||a)&&(r=`translate3d(${s}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,pathRotation:f,rotateX:h,rotateY:g,skewX:y,skewY:b}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotate(${f}deg) `),h&&(r+=`rotateX(${h}deg) `),g&&(r+=`rotateY(${g}deg) `),y&&(r+=`skewX(${y}deg) `),b&&(r+=`skewY(${b}deg) `)}const l=e.x.scale*t.x,u=e.y.scale*t.y;return(l!==1||u!==1)&&(r+=`scale(${l}, ${u})`),r||"none"}const bj=Bd.length,wm=e=>typeof e=="string"?parseFloat(e):e,bm=e=>typeof e=="number"||z.test(e);function kj(e,t,n,r,s,i){s?(e.opacity=de(0,n.opacity??1,Sj(r)),e.opacityExit=de(t.opacity??1,0,jj(r))):i&&(e.opacity=de(t.opacity??1,n.opacity??1,r));for(let a=0;art?1:n(Zr(e,t,r))}function Ej(e,t,n){const r=Ae(e)?e:Rt(e);return r.start(Fd("",r,t,n)),r.animation}function di(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Cj=(e,t)=>e.depth-t.depth;class Tj{constructor(){this.children=[],this.isDirty=!1}add(t){wd(this.children,t),this.isDirty=!0}remove(t){qa(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Cj),this.isDirty=!1,this.children.forEach(t)}}function Pj(e,t){const n=et.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(Tt(r),e(i-t))};return re.setup(r,!0),()=>Tt(r)}function xa(e){return Ae(e)?e.get():e}class Nj{constructor(){this.members=[]}add(t){wd(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(qa(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(qa(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-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(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:a}=t.options;(i===void 0||i!==a)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,a;(r=(n=t.options).onExitComplete)==null||r.call(n),(a=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||a.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const ya={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Sl=["","X","Y","Z"],_j=1e3;let Mj=0;function jl(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ky(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=$x(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",re,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ky(r)}function Sy({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},l=t==null?void 0:t()){this.id=Mj++,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(Dj),this.nodes.forEach(zj),this.nodes.forEach(Bj),this.nodes.forEach(Rj)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;uthis.root.updateBlockedByResize=!1;re.read(()=>{f=window.innerWidth}),e(a,()=>{const g=window.innerWidth;g!==f&&(f=g,this.root.updateBlockedByResize=!0,d&&d(),d=Pj(h,250),ya.hasAnimatedSinceResize&&(ya.hasAnimatedSinceResize=!1,this.nodes.forEach(Em)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||c.getDefaultTransition()||Gj,{onLayoutAnimationStart:b,onLayoutAnimationComplete:w}=c.getProps(),p=!this.targetLayout||!wy(this.targetLayout,g),x=!f&&h;if(this.options.layoutRoot||this.resumeFrom||x||f&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const v={...Vd(y,"layout"),onPlay:b,onComplete:w};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v),this.setAnimationOrigin(d,x,v.path)}else f||Em(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Tt(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($j),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ky(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&&!tt(this.snapshot.measuredBox.x)&&!tt(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 u=0;u{const j=C/1e3,S=E==null?void 0:E(j);S?(h.x.translate=S.x,h.x.scale=de(a.x.scale,1,j),h.x.origin=a.x.origin,h.x.originPoint=a.x.originPoint,h.y.translate=S.y,h.y.scale=de(a.y.scale,1,j),h.y.origin=a.y.origin,h.y.originPoint=a.y.originPoint):(Cm(h.x,a.x,j),Cm(h.y,a.y,j)),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(no(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Uj(this.relativeTarget,this.relativeTargetOrigin,g,j),k&&vj(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=_e()),_t(k,this.relativeTarget)),w&&(this.animationValues=f,kj(f,d,this.latestValues,j,v,x)),S&&S.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=S.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){var l,u,c;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(c=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||c.stop(),this.pendingAnimation&&(Tt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=re.update(()=>{ya.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Rt(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ej(this.motionValue,[0,1e3],{...a,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(_j),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:u,layout:c,latestValues:d}=a;if(!(!l||!u||!c)){if(this!==a&&this.layout&&c&&jy(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||_e();const f=tt(this.layout.layoutBox.x);u.x.min=a.target.x.min,u.x.max=u.x.min+f;const h=tt(this.layout.layoutBox.y);u.y.min=a.target.y.min,u.y.max=u.y.min+h}_t(l,u),ga(l,d),zs(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new Nj),this.sharedNodes.get(a).add(l);const c=l.options.initialPromotionConfig;l.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:u}=a;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const c={};u.z&&jl("z",a,c,this.animationValues);for(let d=0;d{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(Sm),this.root.sharedNodes.clear()}}}function Lj(e){e.updateLayout()}function Aj(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i==="size")Ht(f=>{const h=a?t.measuredBox[f]:t.layoutBox[f],g=tt(h);h.min=r[f].min,h.max=h.min+g});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";lc(a?t.measuredBox[f]:t.layoutBox[f],r[f])}else jy(i,t.layoutBox,r)&&Ht(f=>{const h=a?t.measuredBox[f]:t.layoutBox[f],g=tt(r[f]);h.max=h.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const l=Rr();zs(l,r,t.layoutBox);const u=Rr();a?zs(u,e.applyTransform(s,!0),t.measuredBox):zs(u,r,t.layoutBox);const c=!vy(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:g}=f;if(h&&g){const y=e.options.layoutAnchor||void 0,b=_e();no(b,t.layoutBox,h.layoutBox,y);const w=_e();no(w,r,g.layoutBox,y),wy(b,w)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=b,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:l,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Dj(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Rj(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Ij(e){e.clearSnapshot()}function Sm(e){e.clearMeasurements()}function Vj(e){e.isLayoutDirty=!0,e.updateLayout()}function jm(e){e.isLayoutDirty=!1}function Fj(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function Oj(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Em(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function zj(e){e.resolveTargetDelta()}function Bj(e){e.calcProjection()}function $j(e){e.resetSkewAndRotation()}function Hj(e){e.removeLeadSnapshot()}function Cm(e,t,n){e.translate=de(t.translate,0,n),e.scale=de(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Tm(e,t,n,r){e.min=de(t.min,n.min,r),e.max=de(t.max,n.max,r)}function Uj(e,t,n,r){Tm(e.x,t.x,n.x,r),Tm(e.y,t.y,n.y,r)}function Wj(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Gj={duration:.45,ease:[.4,0,.1,1]},Pm=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Nm=Pm("applewebkit/")&&!Pm("chrome/")?Math.round:ct;function _m(e){e.min=Nm(e.min),e.max=Nm(e.max)}function Kj(e){_m(e.x),_m(e.y)}function jy(e,t,n){return e==="position"||e==="preserve-aspect"&&!mj(ym(t),ym(n),.2)}function qj(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const Yj=Sy({attachResizeListener:(e,t)=>di(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),El={current:void 0},Ey=Sy({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!El.current){const e=new Yj({});e.mount(window),e.setOptions({layoutScroll:!0}),El.current=e}return El.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),cr=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Mm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xj(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Mm(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{width:g,height:y,top:b,left:w,right:p,bottom:x,direction:v}=u.current;if(t||i===!1||!l.current||!g||!y)return;const k=v==="rtl",E=n==="left"?k?`right: ${p}`:`left: ${w}`:k?`left: ${w}`:`right: ${p}`,C=r==="bottom"?`bottom: ${x}`:`top: ${b}`;l.current.dataset.motionPopId=a;const j=document.createElement("style");c&&(j.nonce=c);const S=s??document.head;return S.appendChild(j),j.sheet&&j.sheet.insertRule(` [data-motion-pop-id="${a}"] { position: absolute !important; width: ${g}px !important; - height: ${v}px !important; + height: ${y}px !important; ${E}px !important; ${C}px !important; } - `),()=>{var N;(N=l.current)==null||N.removeAttribute("data-motion-pop-id"),S.contains(j)&&S.removeChild(j)}},[t]),o.jsx(Qj,{isPresent:t,childRef:l,sizeRef:u,pop:i,children:i===!1?e:m.cloneElement(e,{ref:f})})}const eE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:l,anchorY:u,root:c})=>{const d=un(tE),f=m.useId(),h=m.useRef(n),g=m.useRef(r);yi(()=>{h.current=n,g.current=r});let v=!0,b=m.useMemo(()=>(v=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:w=>{d.set(w,!0);for(const p of d.values())if(!p)return;r&&r()},register:w=>(d.set(w,!1),()=>{var p;d.delete(w),!h.current&&!d.size&&((p=g.current)==null||p.call(g))})}),[n,d,r]);return i&&v&&(b={...b}),m.useMemo(()=>{d.forEach((w,p)=>d.set(p,!1))},[n]),m.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=o.jsx(Jj,{pop:a==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:c,children:e}),o.jsx(No.Provider,{value:b,children:e})};function tE(){return new Map}function Cy(e=!0){const t=m.useContext(No);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=m.useId();m.useEffect(()=>{if(e)return s(i)},[e]);const a=m.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Gi=e=>e.key||"";function Lm(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const nE=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:l="left",anchorY:u="top",root:c})=>{const[d,f]=Cy(a),h=m.useMemo(()=>Lm(e),[e]),g=a&&!d?[]:h.map(Gi),v=m.useRef(!0),b=m.useRef(h),w=un(()=>new Map),p=m.useRef(new Set),[x,y]=m.useState(h),[k,E]=m.useState(h);yi(()=>{v.current=!1,b.current=h;for(let S=0;S{const N=Gi(S),P=a&&!d?!1:h===k||g.includes(N),F=()=>{if(p.current.has(N))return;if(w.has(N))p.current.add(N),w.set(N,!0);else return;let B=!0;w.forEach(se=>{se||(B=!1)}),B&&(j==null||j(),E(b.current),a&&(f==null||f()),r&&r())};return o.jsx(eE,{isPresent:P,initial:!v.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:P?void 0:F,anchorX:l,anchorY:u,children:S},N)})})},Ty=m.createContext({strict:!1}),Am={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 Dm=!1;function rE(){if(Dm)return;const e={};for(const t in Am)e[t]={isEnabled:n=>Am[t].some(r=>!!n[r])};ry(e),Dm=!0}function Py(){return rE(),zS()}function sE(e){const t=Py();for(const n in e)t[n]={...t[n],...e[n]};ry(t)}const iE=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 ro(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||iE.has(e)}let Ny=e=>!ro(e);function _y(e){typeof e=="function"&&(Ny=t=>t.startsWith("on")?!ro(t):e(t))}try{_y(require("@emotion/is-prop-valid").default)}catch{}function aE(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Ae(e[s])||(Ny(s)||n===!0&&ro(s)||!t&&!ro(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function oE({children:e,isValidProp:t,...n}){t&&_y(t);const r=m.useContext(cr);n={...r,...n},n.transition=Id(n.transition,r.transition),n.isStatic=un(()=>n.isStatic);const s=m.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return o.jsx(cr.Provider,{value:s,children:e})}const Ao=m.createContext({});function lE(e,t){if(Lo(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ci(n)?n:void 0,animate:ci(r)?r:void 0}}return e.inherit!==!1?t:{}}function uE(e){const{initial:t,animate:n}=lE(e,m.useContext(Ao));return m.useMemo(()=>({initial:t,animate:n}),[Rm(t),Rm(n)])}function Rm(e){return Array.isArray(e)?e.join(" "):e}const Yd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function My(e,t,n){for(const r in t)!Ae(t[r])&&!cy(r,n)&&(e[r]=t[r])}function cE({transformTemplate:e},t){return m.useMemo(()=>{const n=Yd();return Kd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function dE(e,t){const n=e.style||{},r={};return My(r,n,e),Object.assign(r,cE(e,t)),r}function fE(e,t){const n={},r=dE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ly=()=>({...Yd(),attrs:{}});function hE(e,t,n,r){const s=m.useMemo(()=>{const i=Ly();return dy(i,t,hy(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};My(i,e.style,e),s.style={...i,...s.style}}return s}const mE=["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 Xd(e){return typeof e!="string"||e.includes("-")?!1:!!(mE.indexOf(e)>-1||/[A-Z]/u.test(e))}function pE(e,t,n,{latestValues:r},s,i=!1,a){const u=(a??Xd(e)?hE:fE)(t,r,s,e),c=aE(t,typeof e=="string",i),d=e!==m.Fragment?{...c,...u,ref:n}:{},{children:f}=t,h=m.useMemo(()=>Ae(f)?f.get():f,[f]);return m.createElement(e,{...d,children:h})}function gE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:xE(n,r,s,e),renderState:t()}}function xE(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=xa(i[h]);let{initial:a,animate:l}=e;const u=Lo(e),c=ty(e);t&&c&&!u&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!Mo(f)){const h=Array.isArray(f)?f:[f];for(let g=0;g(t,n)=>{const r=m.useContext(Ao),s=m.useContext(No),i=()=>gE(e,t,r,s);return n?i():un(i)},yE=Ay({scrapeMotionValuesFromProps:qd,createRenderState:Yd}),vE=Ay({scrapeMotionValuesFromProps:my,createRenderState:Ly}),wE=Symbol.for("motionComponentSymbol");function bE(e,t,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(i=>{var l;i&&((l=e.onMount)==null||l.call(e,i)),t&&(i?t.mount(i):t.unmount());const a=r.current;if(typeof a=="function")if(i){const u=a(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[t])}const Dy=m.createContext({});function wr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function kE(e,t,n,r,s,i){var y,k;const{visualElement:a}=m.useContext(Ao),l=m.useContext(Ty),u=m.useContext(No),c=m.useContext(cr),d=c.reducedMotion,f=c.skipAnimations,h=m.useRef(null),g=m.useRef(!1);r=r||l.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:i}),g.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const v=h.current,b=m.useContext(Dy);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&SE(h.current,n,s,b);const w=m.useRef(!1);m.useInsertionEffect(()=>{v&&w.current&&v.update(n,u)});const p=n[Bx],x=m.useRef(!!p&&typeof window<"u"&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,p))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,p)));return yi(()=>{g.current=!0,v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),x.current&&v.animationState&&v.animationState.animateChanges())}),m.useEffect(()=>{v&&(!x.current&&v.animationState&&v.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,p)}),x.current=!1),v.enteringChildren=void 0)}),v}function SE(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:l,layoutScroll:u,layoutRoot:c,layoutAnchor:d,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ry(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||l&&wr(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:u,layoutRoot:c,layoutAnchor:d})}function Ry(e){if(e)return e.options.allowProjection!==!1?e.projection:Ry(e.parent)}function Cl(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&sE(r);const i=n?n==="svg":Xd(e),a=i?vE:yE;function l(c,d){let f;const h={...m.useContext(cr),...c,layoutId:jE(c)},{isStatic:g}=h,v=uE(c),b=a(c,g);if(!g&&typeof window<"u"){EE();const w=CE(h);f=w.MeasureLayout,v.visualElement=kE(e,b,h,s,w.ProjectionNode,i)}return o.jsxs(Ao.Provider,{value:v,children:[f&&v.visualElement?o.jsx(f,{visualElement:v.visualElement,...h}):null,pE(e,c,bE(b,v.visualElement,d),b,g,t,i)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=m.forwardRef(l);return u[wE]=e,u}function jE({layoutId:e}){const t=m.useContext(vd).id;return t&&e!==void 0?t+"-"+e:e}function EE(e,t){m.useContext(Ty).strict}function CE(e){const t=Py(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function TE(e,t){if(typeof Proxy>"u")return Cl;const n=new Map,r=(i,a)=>Cl(i,a,e,t),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,Cl(a,void 0,e,t)),n.get(a))})}const PE=(e,t)=>t.isSVG??Xd(e)?new rj(t):new ZS(t,{allowProjection:e!==m.Fragment});class NE extends Bn{constructor(t){super(t),t.animationState||(t.animationState=lj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let _E=0;class ME extends Bn{constructor(){super(...arguments),this.id=_E++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:a,custom:l}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const u=rr(this.node,a,l);if(u){const{transition:c,transitionEnd:d,...f}=u;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[h])}}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",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const LE={animation:{Feature:NE},exit:{Feature:ME}};function ki(e){return{point:{x:e.pageX,y:e.pageY}}}const AE=e=>t=>$d(t)&&e(t,ki(t));function Bs(e,t,n,r){return di(e,t,AE(n),r)}const Iy=({current:e})=>e?e.ownerDocument.defaultView:null,Im=(e,t)=>Math.abs(e-t);function DE(e,t){const n=Im(e.x,t.x),r=Im(e.y,t.y);return Math.sqrt(n**2+r**2)}const Vm=new Set(["auto","scroll"]);class Vy{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:l}={}){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=v=>{this.handleScroll(v.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ki(this.lastRawMoveEventInfo,this.transformPagePoint));const v=Tl(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,w=DE(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!w)return;const{point:p}=v,{timestamp:x}=Re;this.history.push({...p,timestamp:x});const{onStart:y,onMove:k}=this.handlers;b||(y&&y(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,v)},this.handlePointerMove=(v,b)=>{this.lastMoveEvent=v,this.lastRawMoveEventInfo=b,this.lastMoveEventInfo=Ki(b,this.transformPagePoint),re.update(this.updatePoint,!0)},this.handlePointerUp=(v,b)=>{this.end();const{onEnd:w,onSessionEnd:p,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=Tl(v.type==="pointercancel"?this.lastMoveEventInfo:Ki(b,this.transformPagePoint),this.history);this.startEvent&&w&&w(v,y),p&&p(v,y)},!$d(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const u=ki(t),c=Ki(u,this.transformPagePoint),{point:d}=c,{timestamp:f}=Re;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,Tl(c,this.history));const g={passive:!0,capture:!0};this.removeListeners=vi(Bs(this.contextWindow,"pointermove",this.handlePointerMove,g),Bs(this.contextWindow,"pointerup",this.handlePointerUp,g),Bs(this.contextWindow,"pointercancel",this.handlePointerUp,g)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Vm.has(r.overflowX)||Vm.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(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.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(t,s),re.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Tt(this.updatePoint)}}function Ki(e,t){return t?{point:t(e.point)}:e}function Fm(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tl({point:e},t){return{point:e,delta:Fm(e,Fy(t)),offset:Fm(e,RE(t)),velocity:IE(t,.1)}}function RE(e){return e[0]}function Fy(e){return e[e.length-1]}function IE(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Fy(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>gt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>gt(t)*2&&(r=e[1]);const i=St(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function VE(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?de(n,e,r.max):Math.min(e,n)),e}function Om(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function FE(e,{top:t,left:n,bottom:r,right:s}){return{x:Om(e.x,n,s),y:Om(e.y,t,r)}}function zm(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Zr(t.min,t.max-r,e.min):r>s&&(n=Zr(e.min,e.max-s,t.min)),zt(0,1,n)}function BE(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const uc=.35;function $E(e=uc){return e===!1?e=0:e===!0&&(e=uc),{x:Bm(e,"left","right"),y:Bm(e,"top","bottom")}}function Bm(e,t,n){return{min:$m(e,t),max:$m(e,n)}}function $m(e,t){return typeof e=="number"?e:e[t]||0}const HE=new WeakMap;class UE{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_e(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(ki(f).point),this.stopAnimation()},a=(f,h)=>{const{drag:g,dragPropagation:v,onDragStart:b}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=pS(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ht(p=>{let x=this.getAxisMotionValue(p).get()||0;if(qt.test(x)){const{projection:y}=this.visualElement;if(y&&y.layout){const k=y.layout.layoutBox[p];k&&(x=tt(k)*(parseFloat(x)/100))}}this.originPoint[p]=x}),b&&re.update(()=>b(f,h),!1,!0),Ju(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:g,dragDirectionLock:v,onDirectionLock:b,onDrag:w}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:p}=h;if(v&&this.currentDirection===null){this.currentDirection=GE(p),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",h.point,p),this.updateAxis("y",h.point,p),this.visualElement.render(),w&&re.update(()=>w(f,h),!1,!0)},u=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Vy(t,{onSessionStart:i,onStart:a,onMove:l,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Iy(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:l}=this.getProps();l&&re.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:s}=this.getProps();if(!r||!qi(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=VE(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,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;t&&wr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=FE(r.layoutBox,t):this.constraints=!1,this.elastic=$E(n),s!==this.constraints&&!wr(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ht(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=BE(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!wr(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=WS(r,s.root,this.visualElement.getTransformPagePoint());let a=OE(s.layout.layoutBox,i);if(n){const l=n($S(a));this.hasMutatedConstraints=!!l,l&&(a=iy(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},c=Ht(d=>{if(!qi(d,n,this.currentDirection))return;let f=u&&u[d]||{};(a===!0||a===d)&&(f={min:0,max:0});const h=s?200:1e6,g=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ju(this.visualElement,t),r.start(Fd(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ht(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ht(n=>{const{drag:r}=this.getProps();if(!qi(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[n],u=i.get()||0;i.set(t[n]-de(a,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!wr(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ht(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const u=l.get();s[a]=zE({min:u,max:u},this.constraints[a])}});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(),Ht(a=>{if(!qi(a,t,null))return;const l=this.getAxisMotionValue(a),{min:u,max:c}=this.constraints[a];l.set(de(u,c,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;HE.set(this.visualElement,this);const t=this.visualElement.current,n=Bs(t,"pointerdown",c=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=c.target,g=h!==t&&bS(h);d&&f&&!g&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();wr(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=WE(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),re.read(s);const l=di(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Ht(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].translate))}),this.visualElement.render())});return()=>{l(),n(),a(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=uc,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function Hm(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function WE(e,t,n){const r=sc(e,Hm(n)),s=sc(t,Hm(n));return()=>{r(),s()}}function qi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function GE(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class KE extends Bn{constructor(t){super(t),this.removeGroupControls=ct,this.removeListeners=ct,this.controls=new UE(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ct}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Pl=e=>(t,n)=>{e&&re.update(()=>e(t,n),!1,!0)};class qE extends Bn{constructor(){super(...arguments),this.removePointerDownListener=ct}onPointerDown(t){this.session=new Vy(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Iy(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Pl(t),onStart:Pl(n),onMove:Pl(r),onEnd:(i,a)=>{delete this.session,s&&re.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Bs(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Nl=!1;class YE extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Nl&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ya.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Nl=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||re.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Jr.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Nl=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Oy(e){const[t,n]=Cy(),r=m.useContext(vd);return o.jsx(YE,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(Dy),isPresent:t,safeToRemove:n})}const XE={pan:{Feature:qE},drag:{Feature:KE,ProjectionNode:Ey,MeasureLayout:Oy}};function Um(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&re.postRender(()=>i(t,ki(t)))}class ZE extends Bn{mount(){const{current:t}=this.node;t&&(this.unmount=xS(t,(n,r)=>(Um(this.node,r,"Start"),s=>Um(this.node,s,"End"))))}unmount(){}}class QE extends Bn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=vi(di(this.node.current,"focus",()=>this.onFocus()),di(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wm(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&re.postRender(()=>i(t,ki(t)))}class JE extends Bn{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=SS(t,(s,i)=>(Wm(this.node,i,"Start"),(a,{success:l})=>Wm(this.node,a,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const cc=new WeakMap,_l=new WeakMap,eC=e=>{const t=cc.get(e.target);t&&t(e)},tC=e=>{e.forEach(eC)};function nC({root:e,...t}){const n=e||document;_l.has(n)||_l.set(n,{});const r=_l.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(tC,{root:e,...t})),r[s]}function rC(e,t,n){const r=nC(t);return cc.set(e,n),r.observe(e),()=>{cc.delete(e),r.unobserve(e)}}const sC={some:0,all:1};class iC extends Bn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:sC[s]},l=c=>{const{isIntersecting:d}=c;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:f,onViewportLeave:h}=this.node.getProps(),g=d?f:h;g&&g(c)};this.stopObserver=rC(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(aC(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function aC({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const oC={inView:{Feature:iC},tap:{Feature:JE},focus:{Feature:QE},hover:{Feature:ZE}},lC={layout:{ProjectionNode:Ey,MeasureLayout:Oy}},uC={...LE,...oC,...XE,...lC},nn=TE(uC,PE);function so(e){return typeof window>"u"?!1:e?Mx():Rd()}const cC=50,Gm=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),dC=()=>({time:0,x:Gm(),y:Gm()}),fC={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Km(e,t,n,r){const s=n[t],{length:i,position:a}=fC[t],l=s.current,u=n.time;s.current=Math.abs(e[`scroll${a}`]),s.scrollLength=e[`scroll${i}`]-e[`client${i}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=Zr(0,s.scrollLength,s.current);const c=r-u;s.velocity=c>cC?0:Sd(s.current-l,c)}function hC(e,t,n){Km(e,"x",t,n),Km(e,"y",t,n),t.time=n}function mC(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(Os(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 a=null,l=r.parentNode;for(;!a;)l.tagName==="svg"&&(a=l),l=r.parentNode;r=a}else break;return n}const dc={start:0,center:.5,end:1};function qm(e,t,n=0){let r=0;if(e in dc&&(e=dc[e]),typeof e=="string"){const s=parseFloat(e);e.endsWith("px")?r=s:e.endsWith("%")?e=s/100:e.endsWith("vw")?r=s/100*document.documentElement.clientWidth:e.endsWith("vh")?r=s/100*document.documentElement.clientHeight:e=s}return typeof e=="number"&&(r=t*e),n+r}const pC=[0,0];function gC(e,t,n,r){let s=Array.isArray(e)?e:pC,i=0,a=0;return typeof e=="number"?s=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?s=e.split(" "):s=[e,dc[e]?e:"0"]),i=qm(s[0],n,r),a=qm(s[1],t),i-a}const Cs={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},xC={x:0,y:0};function yC(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function vC(e,t,n){const{offset:r=Cs.All}=n,{target:s=e,axis:i="y"}=n,a=i==="y"?"height":"width",l=s!==e?mC(s,e):xC,u=s===e?{width:e.scrollWidth,height:e.scrollHeight}:yC(s),c={width:e.clientWidth,height:e.clientHeight};t[i].offset.length=0;let d=!t[i].interpolate;const f=r.length;for(let h=0;h{wC(e,r.target,n),hC(e,n,s),(r.offset||r.target)&&vC(e,n,r)},notify:()=>t(n)}}const yr=new WeakMap,Ym=new WeakMap,Ml=new WeakMap,Xm=new WeakMap,Yi=new WeakMap,Zm=e=>e===document.scrollingElement?window:e;function zy(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return ct;let s=Ml.get(t);s||(s=new Set,Ml.set(t,s));const i=dC(),a=bC(t,e,i,r);if(s.add(a),!yr.has(t)){const u=()=>{for(const h of s)h.measure(Re.timestamp);re.preUpdate(c)},c=()=>{for(const h of s)h.notify()},d=()=>re.read(u);yr.set(t,d);const f=Zm(t);window.addEventListener("resize",d),t!==document.documentElement&&Ym.set(t,sc(t,d)),f.addEventListener("scroll",d),d()}if(n&&!Yi.has(t)){const u=yr.get(t),c={width:t.scrollWidth,height:t.scrollHeight};Xm.set(t,c);const d=()=>{const h=t.scrollWidth,g=t.scrollHeight;(c.width!==h||c.height!==g)&&(u(),c.width=h,c.height=g)},f=re.read(d,!0);Yi.set(t,f)}const l=yr.get(t);return re.read(l,!1,!0),()=>{var f;Tt(l);const u=Ml.get(t);if(!u||(u.delete(a),u.size))return;const c=yr.get(t);yr.delete(t),c&&(Zm(t).removeEventListener("scroll",c),(f=Ym.get(t))==null||f(),window.removeEventListener("resize",c));const d=Yi.get(t);d&&(Tt(d),Yi.delete(t)),Xm.delete(t)}}const kC=[[Cs.Enter,"entry"],[Cs.Exit,"exit"],[Cs.Any,"cover"],[Cs.All,"contain"]],Qm={start:0,end:1};function SC(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const n=Qm[t[0]],r=Qm[t[1]];if(!(n===void 0||r===void 0))return[n,r]}function jC(e){if(e.length!==2)return;const t=[];for(const n of e)if(Array.isArray(n))t.push(n);else if(typeof n=="string"){const r=SC(n);if(!r)return;t.push(r)}else return;return t}function EC(e,t){const n=jC(e);if(!n)return!1;for(let r=0;r<2;r++){const s=n[r],i=t[r];if(s[0]!==i[0]||s[1]!==i[1])return!1}return!0}function Zd(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of kC)if(EC(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Jm=new Map;function ep(e){const t={value:0},n=zy(r=>{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function By({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=Jm.get(t);s||(s=new Map,Jm.set(t,s));const i=n.target??"self";let a=s.get(i);a||(a={},s.set(i,a));const l=r+(n.offset??[]).join(",");return a[l]||(n.target&&so(n.target)?Zd(n.offset)?a[l]=new ViewTimeline({subject:n.target,axis:r}):a[l]=ep({container:t,...n}):so()?a[l]=new ScrollTimeline({source:t,axis:r}):a[l]=ep({container:t,...n})),a[l]}function CC(e,t){const n=By(t),r=t.target?Zd(t.offset):void 0,s=t.target?so(t.target)&&!!r:so();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:i=>(i.pause(),ey(a=>{i.time=i.iterationDuration*a},n))})}function TC(e){return e&&(e.target||e.offset)}function PC(e){return e.length===2}function NC(e,t){return PC(e)||TC(t)?zy(n=>{e(n[t.axis].progress,n)},t):ey(e,By(t))}function $y(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return ct;const s={axis:t,container:n,...r};return typeof e=="function"?NC(e,s):CC(e,s)}const _C=()=>({scrollX:Rt(0),scrollY:Rt(0),scrollXProgress:Rt(0),scrollYProgress:Rt(0)}),Ir=e=>e?!e.current:!1;function tp(e,t,n,r){return{factory:s=>{let i;const a=()=>{if(Ir(n)||Ir(r)){Jr.read(a);return}i=$y(s,{...t,axis:e,container:(n==null?void 0:n.current)||void 0,target:(r==null?void 0:r.current)||void 0})};return Jr.read(a),()=>{Yx(a),i==null||i()}},times:[0,1],keyframes:[0,1],ease:s=>s,duration:1}}function MC(e,t){return typeof window>"u"?!1:e?Mx()&&!!Zd(t):Rd()}function Hy({container:e,target:t,...n}={}){const r=un(_C);MC(t,n.offset)&&(r.scrollXProgress.accelerate=tp("x",n,e,t),r.scrollYProgress.accelerate=tp("y",n,e,t));const s=m.useRef(null),i=m.useRef(!1),a=m.useCallback(()=>(s.current=$y((l,{x:u,y:c})=>{r.scrollX.set(u.current),r.scrollXProgress.set(u.progress),r.scrollY.set(c.current),r.scrollYProgress.set(c.progress)},{...n,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var l;(l=s.current)==null||l.call(s)}),[e,t,JSON.stringify(n.offset)]);return yi(()=>{if(i.current=!1,Ir(e)||Ir(t)){i.current=!0;return}else return a()},[a]),m.useEffect(()=>{if(!i.current)return;let l;const u=()=>{const c=Ir(e),d=Ir(t);!c&&!d&&(l=a())};return Jr.read(u),()=>{Yx(u),l==null||l()}},[a]),r}function Uy(e){const t=un(()=>Rt(e)),{isStatic:n}=m.useContext(cr);if(n){const[,r]=m.useState(e);m.useEffect(()=>t.on("change",r),[])}return t}function Wy(e,t){const n=Uy(t()),r=()=>n.set(t());return r(),yi(()=>{const s=()=>re.preRender(r,!1,!0),i=e.map(a=>a.on("change",s));return()=>{i.forEach(a=>a()),Tt(r)}}),n}function LC(e){Fs.current=[],e();const t=Wy(Fs.current,e);return Fs.current=void 0,t}function gn(e,t,n,r){if(typeof e=="function")return LC(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!="function")return AC(e,t,n,r);const a=typeof t=="function"?t:AS(t,n,r),l=Array.isArray(e)?np(e,a):np([e],([c])=>a(c)),u=Array.isArray(e)?void 0:e.accelerate;return u&&!u.isTransformed&&typeof t!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(l.accelerate={...u,times:t,keyframes:n,isTransformed:!0}),l}function np(e,t){const n=un(()=>[]);return Wy(e,()=>{n.length=0;const r=e.length;for(let s=0;sObject.keys(n)),i=un(()=>({}));for(const a of s)i[a]=gn(e,t,n[a],r);return i}function DC(e,t={}){const{isStatic:n}=m.useContext(cr),r=()=>Ae(e)?e.get():e;if(n)return gn(r);const s=Uy(r());return m.useInsertionEffect(()=>DS(s,e,t),[s,JSON.stringify(t)]),s}function RC(e,t={}){return DC(e,{type:"spring",...t})}function IC(){!Gd.current&&ny();const[e]=m.useState(Ja.current);return e}function VC(){const{pathname:e}=Ye();return m.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[e]),null}const FC='a, button, [role="button"], label, select, summary, [data-cursor="hover"], .cursor-pointer',OC='input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="file"]), textarea, [contenteditable="true"]';function zC(){const e=m.useRef(null),t=m.useRef(null),n=m.useRef(null),r=m.useRef(null),s=m.useRef(null);return m.useEffect(()=>{const i=window.matchMedia("(pointer: fine)"),a=window.matchMedia("(prefers-reduced-motion: reduce)");if(!i.matches||a.matches)return;const l=e.current,u=t.current,c=n.current,d=r.current,f=s.current;if(!l||!u||!c||!d||!f)return;document.documentElement.classList.add("hifi-cursor-on");const h=-24*Math.PI/180,g=Math.cos(h),v=Math.sin(h);let b=-100,w=-100,p=0,x=2.4,y=2.4,k=16,E=6.5,C=16,j=6.5,S=!1,N,P=performance.now();const F=T=>{const M=Math.min((T-P)/1e3,.05);P=T,x+=(y-x)*Math.min(1,M*8),k+=(C-k)*Math.min(1,M*10),E+=(j-E)*Math.min(1,M*10),p+=x*M,u.style.transform=`translate3d(${b}px, ${w}px, 0)`,c.style.transform=`translate3d(${b}px, ${w}px, 0)`;const A=Math.cos(p)*k,R=Math.sin(p)*E;d.style.transform=`translate(${A*g-R*v}px, ${A*v+R*g}px)`,N=requestAnimationFrame(F)},B=T=>{l.dataset.state=T;const M=T==="hover";y=M?7:2.4,C=M?23:16,j=M?9.5:6.5},se=T=>{b=T.clientX,w=T.clientY,S||(S=!0,l.dataset.hidden="false")},ne=T=>{const M=T.target;M instanceof Element&&(M.closest(OC)?B("text"):M.closest(FC)?B("hover"):B("default"))},q=()=>{l.dataset.down="true",f.style.left=`${b}px`,f.style.top=`${w}px`,f.classList.remove("is-live"),f.offsetWidth,f.classList.add("is-live")},G=()=>{l.dataset.down="false"},V=()=>{S=!1,l.dataset.hidden="true"};return document.addEventListener("mousemove",se,{passive:!0}),document.addEventListener("mouseover",ne,{passive:!0}),document.addEventListener("mousedown",q,{passive:!0}),document.addEventListener("mouseup",G,{passive:!0}),document.documentElement.addEventListener("mouseleave",V),window.addEventListener("blur",V),N=requestAnimationFrame(F),()=>{cancelAnimationFrame(N),document.removeEventListener("mousemove",se),document.removeEventListener("mouseover",ne),document.removeEventListener("mousedown",q),document.removeEventListener("mouseup",G),document.documentElement.removeEventListener("mouseleave",V),window.removeEventListener("blur",V),document.documentElement.classList.remove("hifi-cursor-on")}},[]),o.jsxs("div",{ref:e,className:"hifi-cursor","data-state":"default","data-hidden":"true","data-down":"false","aria-hidden":"true",children:[o.jsxs("div",{ref:n,className:"hifi-cursor__orbit",children:[o.jsx("div",{className:"hifi-cursor__ring"}),o.jsx("div",{ref:r,className:"hifi-cursor__sat"})]}),o.jsx("div",{ref:t,className:"hifi-cursor__core"}),o.jsx("div",{ref:s,className:"hifi-cursor__pulse"})]})}const BC=`${"/".replace(/\/$/,"")}/api`;let fc=0;const hc=new Set,rp=e=>{fc+=e,hc.forEach(t=>t(fc))},$C=()=>fc,HC=e=>(hc.add(e),()=>hc.delete(e)),mc=new Set,UC=e=>(mc.add(e),()=>mc.delete(e));async function ys(e,t={}){rp(1);try{return await WC(e,t)}finally{rp(-1)}}async function WC(e,t){const n=await fetch(`${BC}${e}`,{credentials:"include",headers:t.body instanceof FormData?{}:{"Content-Type":"application/json"},...t}),r=await n.text();let s=null;if(r)try{s=JSON.parse(r)}catch{}if(!n.ok){const i=new Error((s==null?void 0:s.error)||`Fehler ${n.status}`);throw i.status=n.status,i.code=(s==null?void 0:s.code)||null,n.status===401&&!e.startsWith("/auth/")&&mc.forEach(a=>a()),i}if(s===null&&r){const i=new Error("Unerwartete Server-Antwort (kein gültiges JSON)");throw i.status=n.status,i.code="invalid_response",i}return s}const ae={get:(e,t)=>ys(e,t),post:(e,t)=>ys(e,{method:"POST",body:t instanceof FormData?t:JSON.stringify(t)}),put:(e,t)=>ys(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>ys(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>ys(e,{method:"DELETE"})};function GC({children:e}){const[t,n]=m.useState({pathname:null,needsSetup:null}),r=Ye(),s=t.needsSetup===!1;m.useEffect(()=>{if(s)return;let a=!1;return ae.get("/setup/status").then(l=>{a||n({pathname:r.pathname,needsSetup:l.needs_setup})}).catch(()=>{a||n({pathname:r.pathname,needsSetup:!1})}),()=>{a=!0}},[r.pathname,s]);const i=t.pathname===r.pathname;return r.pathname==="/setup"?s?o.jsx(ur,{to:"/",replace:!0}):!i||t.needsSetup===null?o.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"}):e:i&&t.needsSetup?o.jsx(ur,{to:"/setup",replace:!0}):e}/** + `),()=>{var N;(N=l.current)==null||N.removeAttribute("data-motion-pop-id"),S.contains(j)&&S.removeChild(j)}},[t]),o.jsx(Qj,{isPresent:t,childRef:l,sizeRef:u,pop:i,children:i===!1?e:m.cloneElement(e,{ref:f})})}const eE=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:a,anchorX:l,anchorY:u,root:c})=>{const d=un(tE),f=m.useId(),h=m.useRef(n),g=m.useRef(r);yi(()=>{h.current=n,g.current=r});let y=!0,b=m.useMemo(()=>(y=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:w=>{d.set(w,!0);for(const p of d.values())if(!p)return;r&&r()},register:w=>(d.set(w,!1),()=>{var p;d.delete(w),!h.current&&!d.size&&((p=g.current)==null||p.call(g))})}),[n,d,r]);return i&&y&&(b={...b}),m.useMemo(()=>{d.forEach((w,p)=>d.set(p,!1))},[n]),m.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=o.jsx(Jj,{pop:a==="popLayout",isPresent:n,anchorX:l,anchorY:u,root:c,children:e}),o.jsx(No.Provider,{value:b,children:e})};function tE(){return new Map}function Cy(e=!0){const t=m.useContext(No);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=m.useId();m.useEffect(()=>{if(e)return s(i)},[e]);const a=m.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Gi=e=>e.key||"";function Lm(e){const t=[];return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const nE=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:a=!1,anchorX:l="left",anchorY:u="top",root:c})=>{const[d,f]=Cy(a),h=m.useMemo(()=>Lm(e),[e]),g=a&&!d?[]:h.map(Gi),y=m.useRef(!0),b=m.useRef(h),w=un(()=>new Map),p=m.useRef(new Set),[x,v]=m.useState(h),[k,E]=m.useState(h);yi(()=>{y.current=!1,b.current=h;for(let S=0;S{const N=Gi(S),P=a&&!d?!1:h===k||g.includes(N),F=()=>{if(p.current.has(N))return;if(w.has(N))p.current.add(N),w.set(N,!0);else return;let B=!0;w.forEach(se=>{se||(B=!1)}),B&&(j==null||j(),E(b.current),a&&(f==null||f()),r&&r())};return o.jsx(eE,{isPresent:P,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:P?void 0:F,anchorX:l,anchorY:u,children:S},N)})})},Ty=m.createContext({strict:!1}),Am={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 Dm=!1;function rE(){if(Dm)return;const e={};for(const t in Am)e[t]={isEnabled:n=>Am[t].some(r=>!!n[r])};ry(e),Dm=!0}function Py(){return rE(),zS()}function sE(e){const t=Py();for(const n in e)t[n]={...t[n],...e[n]};ry(t)}const iE=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 ro(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||iE.has(e)}let Ny=e=>!ro(e);function _y(e){typeof e=="function"&&(Ny=t=>t.startsWith("on")?!ro(t):e(t))}try{_y(require("@emotion/is-prop-valid").default)}catch{}function aE(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||Ae(e[s])||(Ny(s)||n===!0&&ro(s)||!t&&!ro(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function oE({children:e,isValidProp:t,...n}){t&&_y(t);const r=m.useContext(cr);n={...r,...n},n.transition=Id(n.transition,r.transition),n.isStatic=un(()=>n.isStatic);const s=m.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion,n.skipAnimations]);return o.jsx(cr.Provider,{value:s,children:e})}const Ao=m.createContext({});function lE(e,t){if(Lo(e)){const{initial:n,animate:r}=e;return{initial:n===!1||ci(n)?n:void 0,animate:ci(r)?r:void 0}}return e.inherit!==!1?t:{}}function uE(e){const{initial:t,animate:n}=lE(e,m.useContext(Ao));return m.useMemo(()=>({initial:t,animate:n}),[Rm(t),Rm(n)])}function Rm(e){return Array.isArray(e)?e.join(" "):e}const Yd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function My(e,t,n){for(const r in t)!Ae(t[r])&&!cy(r,n)&&(e[r]=t[r])}function cE({transformTemplate:e},t){return m.useMemo(()=>{const n=Yd();return Kd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function dE(e,t){const n=e.style||{},r={};return My(r,n,e),Object.assign(r,cE(e,t)),r}function fE(e,t){const n={},r=dE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ly=()=>({...Yd(),attrs:{}});function hE(e,t,n,r){const s=m.useMemo(()=>{const i=Ly();return dy(i,t,hy(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};My(i,e.style,e),s.style={...i,...s.style}}return s}const mE=["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 Xd(e){return typeof e!="string"||e.includes("-")?!1:!!(mE.indexOf(e)>-1||/[A-Z]/u.test(e))}function pE(e,t,n,{latestValues:r},s,i=!1,a){const u=(a??Xd(e)?hE:fE)(t,r,s,e),c=aE(t,typeof e=="string",i),d=e!==m.Fragment?{...c,...u,ref:n}:{},{children:f}=t,h=m.useMemo(()=>Ae(f)?f.get():f,[f]);return m.createElement(e,{...d,children:h})}function gE({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:xE(n,r,s,e),renderState:t()}}function xE(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=xa(i[h]);let{initial:a,animate:l}=e;const u=Lo(e),c=ty(e);t&&c&&!u&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!Mo(f)){const h=Array.isArray(f)?f:[f];for(let g=0;g(t,n)=>{const r=m.useContext(Ao),s=m.useContext(No),i=()=>gE(e,t,r,s);return n?i():un(i)},yE=Ay({scrapeMotionValuesFromProps:qd,createRenderState:Yd}),vE=Ay({scrapeMotionValuesFromProps:my,createRenderState:Ly}),wE=Symbol.for("motionComponentSymbol");function bE(e,t,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(i=>{var l;i&&((l=e.onMount)==null||l.call(e,i)),t&&(i?t.mount(i):t.unmount());const a=r.current;if(typeof a=="function")if(i){const u=a(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):a(i);else a&&(a.current=i)},[t])}const Dy=m.createContext({});function wr(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function kE(e,t,n,r,s,i){var v,k;const{visualElement:a}=m.useContext(Ao),l=m.useContext(Ty),u=m.useContext(No),c=m.useContext(cr),d=c.reducedMotion,f=c.skipAnimations,h=m.useRef(null),g=m.useRef(!1);r=r||l.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:i}),g.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const y=h.current,b=m.useContext(Dy);y&&!y.projection&&s&&(y.type==="html"||y.type==="svg")&&SE(h.current,n,s,b);const w=m.useRef(!1);m.useInsertionEffect(()=>{y&&w.current&&y.update(n,u)});const p=n[Bx],x=m.useRef(!!p&&typeof window<"u"&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,p))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,p)));return yi(()=>{g.current=!0,y&&(w.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),x.current&&y.animationState&&y.animationState.animateChanges())}),m.useEffect(()=>{y&&(!x.current&&y.animationState&&y.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,p)}),x.current=!1),y.enteringChildren=void 0)}),y}function SE(e,t,n,r){const{layoutId:s,layout:i,drag:a,dragConstraints:l,layoutScroll:u,layoutRoot:c,layoutAnchor:d,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ry(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!a||l&&wr(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:u,layoutRoot:c,layoutAnchor:d})}function Ry(e){if(e)return e.options.allowProjection!==!1?e.projection:Ry(e.parent)}function Cl(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&sE(r);const i=n?n==="svg":Xd(e),a=i?vE:yE;function l(c,d){let f;const h={...m.useContext(cr),...c,layoutId:jE(c)},{isStatic:g}=h,y=uE(c),b=a(c,g);if(!g&&typeof window<"u"){EE();const w=CE(h);f=w.MeasureLayout,y.visualElement=kE(e,b,h,s,w.ProjectionNode,i)}return o.jsxs(Ao.Provider,{value:y,children:[f&&y.visualElement?o.jsx(f,{visualElement:y.visualElement,...h}):null,pE(e,c,bE(b,y.visualElement,d),b,g,t,i)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=m.forwardRef(l);return u[wE]=e,u}function jE({layoutId:e}){const t=m.useContext(vd).id;return t&&e!==void 0?t+"-"+e:e}function EE(e,t){m.useContext(Ty).strict}function CE(e){const t=Py(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function TE(e,t){if(typeof Proxy>"u")return Cl;const n=new Map,r=(i,a)=>Cl(i,a,e,t),s=(i,a)=>r(i,a);return new Proxy(s,{get:(i,a)=>a==="create"?r:(n.has(a)||n.set(a,Cl(a,void 0,e,t)),n.get(a))})}const PE=(e,t)=>t.isSVG??Xd(e)?new rj(t):new ZS(t,{allowProjection:e!==m.Fragment});class NE extends Bn{constructor(t){super(t),t.animationState||(t.animationState=lj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Mo(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let _E=0;class ME extends Bn{constructor(){super(...arguments),this.id=_E++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:a,custom:l}=this.node.getProps();if(typeof a=="string"||typeof a=="object"&&a!==null&&!Array.isArray(a)){const u=rr(this.node,a,l);if(u){const{transition:c,transitionEnd:d,...f}=u;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[h])}}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",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const LE={animation:{Feature:NE},exit:{Feature:ME}};function ki(e){return{point:{x:e.pageX,y:e.pageY}}}const AE=e=>t=>$d(t)&&e(t,ki(t));function Bs(e,t,n,r){return di(e,t,AE(n),r)}const Iy=({current:e})=>e?e.ownerDocument.defaultView:null,Im=(e,t)=>Math.abs(e-t);function DE(e,t){const n=Im(e.x,t.x),r=Im(e.y,t.y);return Math.sqrt(n**2+r**2)}const Vm=new Set(["auto","scroll"]);class Vy{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:l}={}){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=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ki(this.lastRawMoveEventInfo,this.transformPagePoint));const y=Tl(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,w=DE(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!w)return;const{point:p}=y,{timestamp:x}=Re;this.history.push({...p,timestamp:x});const{onStart:v,onMove:k}=this.handlers;b||(v&&v(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=b,this.lastMoveEventInfo=Ki(b,this.transformPagePoint),re.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:w,onSessionEnd:p,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Tl(y.type==="pointercancel"?this.lastMoveEventInfo:Ki(b,this.transformPagePoint),this.history);this.startEvent&&w&&w(y,v),p&&p(y,v)},!$d(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=a,this.contextWindow=s||window;const u=ki(t),c=Ki(u,this.transformPagePoint),{point:d}=c,{timestamp:f}=Re;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,Tl(c,this.history));const g={passive:!0,capture:!0};this.removeListeners=vi(Bs(this.contextWindow,"pointermove",this.handlePointerMove,g),Bs(this.contextWindow,"pointerup",this.handlePointerUp,g),Bs(this.contextWindow,"pointercancel",this.handlePointerUp,g)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Vm.has(r.overflowX)||Vm.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(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.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(t,s),re.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Tt(this.updatePoint)}}function Ki(e,t){return t?{point:t(e.point)}:e}function Fm(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tl({point:e},t){return{point:e,delta:Fm(e,Fy(t)),offset:Fm(e,RE(t)),velocity:IE(t,.1)}}function RE(e){return e[0]}function Fy(e){return e[e.length-1]}function IE(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Fy(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>gt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>gt(t)*2&&(r=e[1]);const i=St(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function VE(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?de(n,e,r.max):Math.min(e,n)),e}function Om(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function FE(e,{top:t,left:n,bottom:r,right:s}){return{x:Om(e.x,n,s),y:Om(e.y,t,r)}}function zm(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Zr(t.min,t.max-r,e.min):r>s&&(n=Zr(e.min,e.max-s,t.min)),zt(0,1,n)}function BE(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const uc=.35;function $E(e=uc){return e===!1?e=0:e===!0&&(e=uc),{x:Bm(e,"left","right"),y:Bm(e,"top","bottom")}}function Bm(e,t,n){return{min:$m(e,t),max:$m(e,n)}}function $m(e,t){return typeof e=="number"?e:e[t]||0}const HE=new WeakMap;class UE{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_e(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(ki(f).point),this.stopAnimation()},a=(f,h)=>{const{drag:g,dragPropagation:y,onDragStart:b}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=pS(g),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ht(p=>{let x=this.getAxisMotionValue(p).get()||0;if(qt.test(x)){const{projection:v}=this.visualElement;if(v&&v.layout){const k=v.layout.layoutBox[p];k&&(x=tt(k)*(parseFloat(x)/100))}}this.originPoint[p]=x}),b&&re.update(()=>b(f,h),!1,!0),Ju(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:b,onDrag:w}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:p}=h;if(y&&this.currentDirection===null){this.currentDirection=GE(p),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",h.point,p),this.updateAxis("y",h.point,p),this.visualElement.render(),w&&re.update(()=>w(f,h),!1,!0)},u=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Vy(t,{onSessionStart:i,onStart:a,onMove:l,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Iy(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:l}=this.getProps();l&&re.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.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(t,n,r){const{drag:s}=this.getProps();if(!r||!qi(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=VE(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,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;t&&wr(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=FE(r.layoutBox,t):this.constraints=!1,this.elastic=$E(n),s!==this.constraints&&!wr(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ht(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=BE(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!wr(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=WS(r,s.root,this.visualElement.getTransformPagePoint());let a=OE(s.layout.layoutBox,i);if(n){const l=n($S(a));this.hasMutatedConstraints=!!l,l&&(a=iy(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},c=Ht(d=>{if(!qi(d,n,this.currentDirection))return;let f=u&&u[d]||{};(a===!0||a===d)&&(f={min:0,max:0});const h=s?200:1e6,g=s?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(c).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ju(this.visualElement,t),r.start(Fd(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ht(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ht(n=>{const{drag:r}=this.getProps();if(!qi(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:l}=s.layout.layoutBox[n],u=i.get()||0;i.set(t[n]-de(a,l,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!wr(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ht(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const u=l.get();s[a]=zE({min:u,max:u},this.constraints[a])}});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(),Ht(a=>{if(!qi(a,t,null))return;const l=this.getAxisMotionValue(a),{min:u,max:c}=this.constraints[a];l.set(de(u,c,s[a]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;HE.set(this.visualElement,this);const t=this.visualElement.current,n=Bs(t,"pointerdown",c=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=c.target,g=h!==t&&bS(h);d&&f&&!g&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();wr(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=WE(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,a=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),re.read(s);const l=di(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Ht(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].translate))}),this.visualElement.render())});return()=>{l(),n(),a(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:a=uc,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function Hm(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function WE(e,t,n){const r=sc(e,Hm(n)),s=sc(t,Hm(n));return()=>{r(),s()}}function qi(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function GE(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class KE extends Bn{constructor(t){super(t),this.removeGroupControls=ct,this.removeListeners=ct,this.controls=new UE(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ct}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Pl=e=>(t,n)=>{e&&re.update(()=>e(t,n),!1,!0)};class qE extends Bn{constructor(){super(...arguments),this.removePointerDownListener=ct}onPointerDown(t){this.session=new Vy(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Iy(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Pl(t),onStart:Pl(n),onMove:Pl(r),onEnd:(i,a)=>{delete this.session,s&&re.postRender(()=>s(i,a))}}}mount(){this.removePointerDownListener=Bs(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Nl=!1;class YE extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Nl&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ya.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:a}=r;return a&&(a.isPresent=i,t.layoutDependency!==n&&a.setOptions({...a.options,layoutDependency:n}),Nl=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||re.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Jr.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Nl=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Oy(e){const[t,n]=Cy(),r=m.useContext(vd);return o.jsx(YE,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(Dy),isPresent:t,safeToRemove:n})}const XE={pan:{Feature:qE},drag:{Feature:KE,ProjectionNode:Ey,MeasureLayout:Oy}};function Um(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&re.postRender(()=>i(t,ki(t)))}class ZE extends Bn{mount(){const{current:t}=this.node;t&&(this.unmount=xS(t,(n,r)=>(Um(this.node,r,"Start"),s=>Um(this.node,s,"End"))))}unmount(){}}class QE extends Bn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!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=vi(di(this.node.current,"focus",()=>this.onFocus()),di(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wm(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&re.postRender(()=>i(t,ki(t)))}class JE extends Bn{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=SS(t,(s,i)=>(Wm(this.node,i,"Start"),(a,{success:l})=>Wm(this.node,a,l?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const cc=new WeakMap,_l=new WeakMap,eC=e=>{const t=cc.get(e.target);t&&t(e)},tC=e=>{e.forEach(eC)};function nC({root:e,...t}){const n=e||document;_l.has(n)||_l.set(n,{});const r=_l.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(tC,{root:e,...t})),r[s]}function rC(e,t,n){const r=nC(t);return cc.set(e,n),r.observe(e),()=>{cc.delete(e),r.unobserve(e)}}const sC={some:0,all:1};class iC extends Bn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:sC[s]},l=c=>{const{isIntersecting:d}=c;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:f,onViewportLeave:h}=this.node.getProps(),g=d?f:h;g&&g(c)};this.stopObserver=rC(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(aC(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function aC({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const oC={inView:{Feature:iC},tap:{Feature:JE},focus:{Feature:QE},hover:{Feature:ZE}},lC={layout:{ProjectionNode:Ey,MeasureLayout:Oy}},uC={...LE,...oC,...XE,...lC},nn=TE(uC,PE);function so(e){return typeof window>"u"?!1:e?Mx():Rd()}const cC=50,Gm=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),dC=()=>({time:0,x:Gm(),y:Gm()}),fC={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Km(e,t,n,r){const s=n[t],{length:i,position:a}=fC[t],l=s.current,u=n.time;s.current=Math.abs(e[`scroll${a}`]),s.scrollLength=e[`scroll${i}`]-e[`client${i}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=Zr(0,s.scrollLength,s.current);const c=r-u;s.velocity=c>cC?0:Sd(s.current-l,c)}function hC(e,t,n){Km(e,"x",t,n),Km(e,"y",t,n),t.time=n}function mC(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(Os(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 a=null,l=r.parentNode;for(;!a;)l.tagName==="svg"&&(a=l),l=r.parentNode;r=a}else break;return n}const dc={start:0,center:.5,end:1};function qm(e,t,n=0){let r=0;if(e in dc&&(e=dc[e]),typeof e=="string"){const s=parseFloat(e);e.endsWith("px")?r=s:e.endsWith("%")?e=s/100:e.endsWith("vw")?r=s/100*document.documentElement.clientWidth:e.endsWith("vh")?r=s/100*document.documentElement.clientHeight:e=s}return typeof e=="number"&&(r=t*e),n+r}const pC=[0,0];function gC(e,t,n,r){let s=Array.isArray(e)?e:pC,i=0,a=0;return typeof e=="number"?s=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?s=e.split(" "):s=[e,dc[e]?e:"0"]),i=qm(s[0],n,r),a=qm(s[1],t),i-a}const Cs={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},xC={x:0,y:0};function yC(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function vC(e,t,n){const{offset:r=Cs.All}=n,{target:s=e,axis:i="y"}=n,a=i==="y"?"height":"width",l=s!==e?mC(s,e):xC,u=s===e?{width:e.scrollWidth,height:e.scrollHeight}:yC(s),c={width:e.clientWidth,height:e.clientHeight};t[i].offset.length=0;let d=!t[i].interpolate;const f=r.length;for(let h=0;h{wC(e,r.target,n),hC(e,n,s),(r.offset||r.target)&&vC(e,n,r)},notify:()=>t(n)}}const yr=new WeakMap,Ym=new WeakMap,Ml=new WeakMap,Xm=new WeakMap,Yi=new WeakMap,Zm=e=>e===document.scrollingElement?window:e;function zy(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return ct;let s=Ml.get(t);s||(s=new Set,Ml.set(t,s));const i=dC(),a=bC(t,e,i,r);if(s.add(a),!yr.has(t)){const u=()=>{for(const h of s)h.measure(Re.timestamp);re.preUpdate(c)},c=()=>{for(const h of s)h.notify()},d=()=>re.read(u);yr.set(t,d);const f=Zm(t);window.addEventListener("resize",d),t!==document.documentElement&&Ym.set(t,sc(t,d)),f.addEventListener("scroll",d),d()}if(n&&!Yi.has(t)){const u=yr.get(t),c={width:t.scrollWidth,height:t.scrollHeight};Xm.set(t,c);const d=()=>{const h=t.scrollWidth,g=t.scrollHeight;(c.width!==h||c.height!==g)&&(u(),c.width=h,c.height=g)},f=re.read(d,!0);Yi.set(t,f)}const l=yr.get(t);return re.read(l,!1,!0),()=>{var f;Tt(l);const u=Ml.get(t);if(!u||(u.delete(a),u.size))return;const c=yr.get(t);yr.delete(t),c&&(Zm(t).removeEventListener("scroll",c),(f=Ym.get(t))==null||f(),window.removeEventListener("resize",c));const d=Yi.get(t);d&&(Tt(d),Yi.delete(t)),Xm.delete(t)}}const kC=[[Cs.Enter,"entry"],[Cs.Exit,"exit"],[Cs.Any,"cover"],[Cs.All,"contain"]],Qm={start:0,end:1};function SC(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const n=Qm[t[0]],r=Qm[t[1]];if(!(n===void 0||r===void 0))return[n,r]}function jC(e){if(e.length!==2)return;const t=[];for(const n of e)if(Array.isArray(n))t.push(n);else if(typeof n=="string"){const r=SC(n);if(!r)return;t.push(r)}else return;return t}function EC(e,t){const n=jC(e);if(!n)return!1;for(let r=0;r<2;r++){const s=n[r],i=t[r];if(s[0]!==i[0]||s[1]!==i[1])return!1}return!0}function Zd(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of kC)if(EC(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const Jm=new Map;function ep(e){const t={value:0},n=zy(r=>{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function By({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=Jm.get(t);s||(s=new Map,Jm.set(t,s));const i=n.target??"self";let a=s.get(i);a||(a={},s.set(i,a));const l=r+(n.offset??[]).join(",");return a[l]||(n.target&&so(n.target)?Zd(n.offset)?a[l]=new ViewTimeline({subject:n.target,axis:r}):a[l]=ep({container:t,...n}):so()?a[l]=new ScrollTimeline({source:t,axis:r}):a[l]=ep({container:t,...n})),a[l]}function CC(e,t){const n=By(t),r=t.target?Zd(t.offset):void 0,s=t.target?so(t.target)&&!!r:so();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:i=>(i.pause(),ey(a=>{i.time=i.iterationDuration*a},n))})}function TC(e){return e&&(e.target||e.offset)}function PC(e){return e.length===2}function NC(e,t){return PC(e)||TC(t)?zy(n=>{e(n[t.axis].progress,n)},t):ey(e,By(t))}function $y(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return ct;const s={axis:t,container:n,...r};return typeof e=="function"?NC(e,s):CC(e,s)}const _C=()=>({scrollX:Rt(0),scrollY:Rt(0),scrollXProgress:Rt(0),scrollYProgress:Rt(0)}),Ir=e=>e?!e.current:!1;function tp(e,t,n,r){return{factory:s=>{let i;const a=()=>{if(Ir(n)||Ir(r)){Jr.read(a);return}i=$y(s,{...t,axis:e,container:(n==null?void 0:n.current)||void 0,target:(r==null?void 0:r.current)||void 0})};return Jr.read(a),()=>{Yx(a),i==null||i()}},times:[0,1],keyframes:[0,1],ease:s=>s,duration:1}}function MC(e,t){return typeof window>"u"?!1:e?Mx()&&!!Zd(t):Rd()}function Hy({container:e,target:t,...n}={}){const r=un(_C);MC(t,n.offset)&&(r.scrollXProgress.accelerate=tp("x",n,e,t),r.scrollYProgress.accelerate=tp("y",n,e,t));const s=m.useRef(null),i=m.useRef(!1),a=m.useCallback(()=>(s.current=$y((l,{x:u,y:c})=>{r.scrollX.set(u.current),r.scrollXProgress.set(u.progress),r.scrollY.set(c.current),r.scrollYProgress.set(c.progress)},{...n,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var l;(l=s.current)==null||l.call(s)}),[e,t,JSON.stringify(n.offset)]);return yi(()=>{if(i.current=!1,Ir(e)||Ir(t)){i.current=!0;return}else return a()},[a]),m.useEffect(()=>{if(!i.current)return;let l;const u=()=>{const c=Ir(e),d=Ir(t);!c&&!d&&(l=a())};return Jr.read(u),()=>{Yx(u),l==null||l()}},[a]),r}function Uy(e){const t=un(()=>Rt(e)),{isStatic:n}=m.useContext(cr);if(n){const[,r]=m.useState(e);m.useEffect(()=>t.on("change",r),[])}return t}function Wy(e,t){const n=Uy(t()),r=()=>n.set(t());return r(),yi(()=>{const s=()=>re.preRender(r,!1,!0),i=e.map(a=>a.on("change",s));return()=>{i.forEach(a=>a()),Tt(r)}}),n}function LC(e){Fs.current=[],e();const t=Wy(Fs.current,e);return Fs.current=void 0,t}function gn(e,t,n,r){if(typeof e=="function")return LC(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!="function")return AC(e,t,n,r);const a=typeof t=="function"?t:AS(t,n,r),l=Array.isArray(e)?np(e,a):np([e],([c])=>a(c)),u=Array.isArray(e)?void 0:e.accelerate;return u&&!u.isTransformed&&typeof t!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(l.accelerate={...u,times:t,keyframes:n,isTransformed:!0}),l}function np(e,t){const n=un(()=>[]);return Wy(e,()=>{n.length=0;const r=e.length;for(let s=0;sObject.keys(n)),i=un(()=>({}));for(const a of s)i[a]=gn(e,t,n[a],r);return i}function DC(e,t={}){const{isStatic:n}=m.useContext(cr),r=()=>Ae(e)?e.get():e;if(n)return gn(r);const s=Uy(r());return m.useInsertionEffect(()=>DS(s,e,t),[s,JSON.stringify(t)]),s}function RC(e,t={}){return DC(e,{type:"spring",...t})}function IC(){!Gd.current&&ny();const[e]=m.useState(Ja.current);return e}function VC(){const{pathname:e}=Ye();return m.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[e]),null}const FC='a, button, [role="button"], label, select, summary, [data-cursor="hover"], .cursor-pointer',OC='input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="file"]), textarea, [contenteditable="true"]';function zC(){const e=m.useRef(null),t=m.useRef(null),n=m.useRef(null),r=m.useRef(null),s=m.useRef(null);return m.useEffect(()=>{const i=window.matchMedia("(pointer: fine)"),a=window.matchMedia("(prefers-reduced-motion: reduce)");if(!i.matches||a.matches)return;const l=e.current,u=t.current,c=n.current,d=r.current,f=s.current;if(!l||!u||!c||!d||!f)return;document.documentElement.classList.add("hifi-cursor-on");const h=-24*Math.PI/180,g=Math.cos(h),y=Math.sin(h);let b=-100,w=-100,p=0,x=2.4,v=2.4,k=16,E=6.5,C=16,j=6.5,S=!1,N,P=performance.now();const F=T=>{const M=Math.min((T-P)/1e3,.05);P=T,x+=(v-x)*Math.min(1,M*8),k+=(C-k)*Math.min(1,M*10),E+=(j-E)*Math.min(1,M*10),p+=x*M,u.style.transform=`translate3d(${b}px, ${w}px, 0)`,c.style.transform=`translate3d(${b}px, ${w}px, 0)`;const A=Math.cos(p)*k,R=Math.sin(p)*E;d.style.transform=`translate(${A*g-R*y}px, ${A*y+R*g}px)`,N=requestAnimationFrame(F)},B=T=>{l.dataset.state=T;const M=T==="hover";v=M?7:2.4,C=M?23:16,j=M?9.5:6.5},se=T=>{b=T.clientX,w=T.clientY,S||(S=!0,l.dataset.hidden="false")},ne=T=>{const M=T.target;M instanceof Element&&(M.closest(OC)?B("text"):M.closest(FC)?B("hover"):B("default"))},q=()=>{l.dataset.down="true",f.style.left=`${b}px`,f.style.top=`${w}px`,f.classList.remove("is-live"),f.offsetWidth,f.classList.add("is-live")},G=()=>{l.dataset.down="false"},V=()=>{S=!1,l.dataset.hidden="true"};return document.addEventListener("mousemove",se,{passive:!0}),document.addEventListener("mouseover",ne,{passive:!0}),document.addEventListener("mousedown",q,{passive:!0}),document.addEventListener("mouseup",G,{passive:!0}),document.documentElement.addEventListener("mouseleave",V),window.addEventListener("blur",V),N=requestAnimationFrame(F),()=>{cancelAnimationFrame(N),document.removeEventListener("mousemove",se),document.removeEventListener("mouseover",ne),document.removeEventListener("mousedown",q),document.removeEventListener("mouseup",G),document.documentElement.removeEventListener("mouseleave",V),window.removeEventListener("blur",V),document.documentElement.classList.remove("hifi-cursor-on")}},[]),o.jsxs("div",{ref:e,className:"hifi-cursor","data-state":"default","data-hidden":"true","data-down":"false","aria-hidden":"true",children:[o.jsxs("div",{ref:n,className:"hifi-cursor__orbit",children:[o.jsx("div",{className:"hifi-cursor__ring"}),o.jsx("div",{ref:r,className:"hifi-cursor__sat"})]}),o.jsx("div",{ref:t,className:"hifi-cursor__core"}),o.jsx("div",{ref:s,className:"hifi-cursor__pulse"})]})}const BC=`${"/".replace(/\/$/,"")}/api`;let fc=0;const hc=new Set,rp=e=>{fc+=e,hc.forEach(t=>t(fc))},$C=()=>fc,HC=e=>(hc.add(e),()=>hc.delete(e)),mc=new Set,UC=e=>(mc.add(e),()=>mc.delete(e));async function ys(e,t={}){rp(1);try{return await WC(e,t)}finally{rp(-1)}}async function WC(e,t){const n=await fetch(`${BC}${e}`,{credentials:"include",headers:t.body instanceof FormData?{}:{"Content-Type":"application/json"},...t}),r=await n.text();let s=null;if(r)try{s=JSON.parse(r)}catch{}if(!n.ok){const i=new Error((s==null?void 0:s.error)||`Fehler ${n.status}`);throw i.status=n.status,i.code=(s==null?void 0:s.code)||null,n.status===401&&!e.startsWith("/auth/")&&mc.forEach(a=>a()),i}if(s===null&&r){const i=new Error("Unerwartete Server-Antwort (kein gültiges JSON)");throw i.status=n.status,i.code="invalid_response",i}return s}const ae={get:(e,t)=>ys(e,t),post:(e,t)=>ys(e,{method:"POST",body:t instanceof FormData?t:JSON.stringify(t)}),put:(e,t)=>ys(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>ys(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>ys(e,{method:"DELETE"})};function GC({children:e}){const[t,n]=m.useState({pathname:null,needsSetup:null}),r=Ye(),s=t.needsSetup===!1;m.useEffect(()=>{if(s)return;let a=!1;return ae.get("/setup/status").then(l=>{a||n({pathname:r.pathname,needsSetup:l.needs_setup})}).catch(()=>{a||n({pathname:r.pathname,needsSetup:!1})}),()=>{a=!0}},[r.pathname,s]);const i=t.pathname===r.pathname;return r.pathname==="/setup"?s?o.jsx(ur,{to:"/",replace:!0}):!i||t.needsSetup===null?o.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"}):e:i&&t.needsSetup?o.jsx(ur,{to:"/setup",replace:!0}):e}/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -103,7 +103,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Ky=m.createContext({});function d4({children:e,size:t,color:n,strokeWidth:r,absoluteStrokeWidth:s,className:i}){const a=m.useMemo(()=>({size:t,color:n,strokeWidth:r,absoluteStrokeWidth:s,className:i}),[t,n,r,s,i]);return m.createElement(Ky.Provider,{value:a},e)}const XC=()=>m.useContext(Ky),ZC=m.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},u)=>{const{size:c=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:g=""}=XC()??{},v=r??f?Number(n??d)*24/Number(t??c):n??d;return m.createElement("svg",{ref:u,...Ll,width:t??c??Ll.width,height:t??c??Ll.height,stroke:e??h,strokeWidth:v,className:Gy("lucide",g,s),...!i&&!YC(l)&&{"aria-hidden":"true"},...l},[...a.map(([b,w])=>m.createElement(b,w)),...Array.isArray(i)?i:[i]])});/** + */const YC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Ky=m.createContext({});function f4({children:e,size:t,color:n,strokeWidth:r,absoluteStrokeWidth:s,className:i}){const a=m.useMemo(()=>({size:t,color:n,strokeWidth:r,absoluteStrokeWidth:s,className:i}),[t,n,r,s,i]);return m.createElement(Ky.Provider,{value:a},e)}const XC=()=>m.useContext(Ky),ZC=m.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},u)=>{const{size:c=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:h="currentColor",className:g=""}=XC()??{},y=r??f?Number(n??d)*24/Number(t??c):n??d;return m.createElement("svg",{ref:u,...Ll,width:t??c??Ll.width,height:t??c??Ll.height,stroke:e??h,strokeWidth:y,className:Gy("lucide",g,s),...!i&&!YC(l)&&{"aria-hidden":"true"},...l},[...a.map(([b,w])=>m.createElement(b,w)),...Array.isArray(i)?i:[i]])});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. @@ -293,9 +293,9 @@ Error generating stack: `+i.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aP=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],oP=te("zap",aP),ev=m.createContext(null);function lP(){const e=new Date,t=e.getHours()+e.getMinutes()/60;return t>=6.5&&t<21?"light":"dark"}function uP({children:e}){const[t,n]=m.useState(()=>{const s=localStorage.getItem("hifi-theme");return s==="light"||s==="dark"?s:lP()});m.useEffect(()=>{document.documentElement.classList.toggle("dark",t==="dark"),localStorage.setItem("hifi-theme",t)},[t]);const r=()=>n(s=>s==="dark"?"light":"dark");return o.jsx(ev.Provider,{value:{theme:t,toggleTheme:r},children:e})}function tv(){return m.useContext(ev)}const cP={nav:{mainNav:"Hauptnavigation",menu:"Menü",call:"Anrufen",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",downloads:"Downloads"},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:e=>`© ${e} HifiPlanet. Alle Angaben ohne Gewähr.`,imprint:"Impressum",privacy:"Datenschutz",terms:"AGB",downloads:"Downloads",cookieSettings:"Cookie-Einstellungen"},cookieConsent:{bannerText:"Wir verwenden nur technisch notwendige Cookies. Für Google Maps 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 (Kontaktseite). 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.",login:"Anmelden"},countdown:{eyebrow:"Neue Website",title:"Bald wird’s laut.",message:"Wir drehen gerade die letzten Schrauben fest. Unsere neue Website mit allen Paketen für dein Fahrzeug startet in Kürze.",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden",launchPrefix:"Start",launchAt:"um",clock:"Uhr",addToCalendar:"In den Kalender",calendarTitle:"Launch der neuen HifiPlanet-Website",questions:"Fragen vorab?",liveEyebrow:"Jetzt online",liveTitle:"Wir sind live!",liveMessage:"Einen Moment, die Seite öffnet sich …",preview:"Vorschau – nur für dich sichtbar",closePreview:"Vorschau schließen",adminActive:"Countdown aktiv – Besucher sehen bis {date} nur den Teaser.",adminPreview:"Vorschau ansehen"},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:(e,t)=>`${e.toFixed(1).replace(".",",")} von ${t} 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:{loading:"Marken werden geladen…",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."},vehicleSearch:{label:"Fahrzeug direkt suchen",placeholder:"Direkt suchen, z. B. Golf 7 oder BMW 3er",clear:"Suche leeren",loading:"Suche läuft…",noResults:"Kein passendes Fahrzeug gefunden.",contact:"Frag uns einfach direkt.",allModels:"Alle Modelle"},brandPage:{metaTitleFallback:"Modell auswählen",metaDescription:e=>`Wähle dein ${e} 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:{customRequest:"Individuell anfragen",customHint:"Nicht das Passende dabei? Wir stellen dir gerne ein Paket nach deinen Wünschen zusammen.",whatsappText:(e,t)=>`Hallo HifiPlanet, ich interessiere mich für einen Car-Hifi-Umbau für meinen ${e} ${t}.`,metaTitleFallback:"Sound-Pakete",metaTitle:(e,t)=>`${e} ${t} Sound-Pakete`,metaDescription:(e,t)=>`Car-Hifi Sound-Pakete für ${e} ${t} 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",badges:{recommended:"Empfohlen",popular:"Am beliebtesten",tip:"Tipp",coming_soon:"Coming soon"},videoLink:"Zum Video",moreBullets:e=>e===1?"+ 1 weitere Leistung":`+ ${e} weitere Leistungen`,showMore:"Mehr anzeigen",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:{sendAnother:"Weitere Anfrage senden",vehicleBoxTitle:"Dein Fahrzeug:",privacyPre:"Mit dem Absenden stimmst du zu, dass wir deine Angaben zur Bearbeitung der Anfrage verwenden. Mehr dazu in der ",privacyLink:"Datenschutzerklärung",privacyPost:".",mapIframeTitle:"Standort von HifiPlanet in Amorbach auf Google Maps",whatsappText:(e,t,n)=>`Hallo HifiPlanet, ich interessiere mich für das Paket "${n}" für meinen ${e} ${t}.`,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:e=>`${e} Umbauten`,metaDescription:e=>`Einblicke in unsere ${e} Car-Hifi Umbauten.`,loading:"Lädt…",breadcrumbGallery:"Galerie",titleSuffix:"Projekt wählen",empty:"Für diese Marke sind noch keine Projekte hinterlegt."},galleryProjectPage:{ctaTitle:"So etwas für dein Auto?",ctaText:"Erzähl uns von deinem Fahrzeug – wir planen einen ähnlichen Umbau für dich.",ctaButton:"Ähnlichen Umbau anfragen",ctaTopic:e=>`Mich interessiert ein ähnlicher Umbau wie "${e}" aus eurer Galerie.`,metaTitleFallback:"Bildergalerie",metaDescription:e=>`Fotos unseres ${e} Umbaus.`,loading:"Lädt…",breadcrumbGallery:"Galerie",empty:"Für dieses Projekt sind noch keine Fotos hinterlegt.",enlargeImage:"Bild vergrößern"},downloadsPage:{metaTitle:"Downloads",metaDescription:"Dateien und Songs von HifiPlanet zum Anhören und Herunterladen.",title:"Downloads",intro:"Hier stellen wir dir Dateien und Songs bereit – direkt anhören oder herunterladen.",loading:"Lädt…",empty:"Aktuell stehen keine Downloads bereit.",download:"Herunterladen",lockedTitle:"Geschützter Bereich",lockedText:"Bitte gib das Passwort ein, das du von uns bekommen hast.",passwordLabel:"Passwort",unlock:"Freischalten",unlocking:"Wird geprüft…",wrongPassword:"Das Passwort stimmt leider nicht."},errors:{generic:"Da ist etwas schiefgelaufen. Bitte versuche es noch einmal.",network:"Keine Verbindung zum Server. Bitte prüfe deine Internetverbindung.",notFound:"Diese Seite gibt es nicht (mehr).",rateLimited:"Zu viele Anfragen in kurzer Zeit. Bitte versuche es später noch einmal oder ruf uns an.",invalidInput:"Bitte gib deinen Namen und eine gültige E-Mail-Adresse an.",server:"Auf dem Server ist ein Fehler aufgetreten. Bitte versuche es später noch einmal.",maintenance:"Dieser Bereich wird gerade überarbeitet. Bitte schau später wieder vorbei."},notFound:{metaTitle:"Seite nicht gefunden",title:"Diese Seite haben wir nicht gefunden",text:"Vielleicht ist der Link veraltet oder hat einen Tippfehler. Hier geht es direkt weiter:",toVehicles:"Fahrzeug wählen",toContact:"Kontakt aufnehmen",toHome:"Zur Startseite"}},dP={nav:{mainNav:"Main navigation",menu:"Menu",call:"Call",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",downloads:"Downloads"},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:e=>`© ${e} HifiPlanet. All information without guarantee.`,imprint:"Legal notice",privacy:"Privacy",terms:"Terms",downloads:"Downloads",cookieSettings:"Cookie settings"},cookieConsent:{bannerText:"We only use technically necessary cookies. For Google Maps 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 (contact page). Loading it 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.",login:"Log in"},countdown:{eyebrow:"New website",title:"Things are about to get loud.",message:"We are tightening the last screws. Our new website with every package for your vehicle launches shortly.",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds",launchPrefix:"Launch",launchAt:"at",clock:"",addToCalendar:"Add to calendar",calendarTitle:"Launch of the new HifiPlanet website",questions:"Questions?",liveEyebrow:"Now online",liveTitle:"We are live!",liveMessage:"One moment, the site is opening …",preview:"Preview – only visible to you",closePreview:"Close preview",adminActive:"Countdown active – visitors only see the teaser until {date}.",adminPreview:"Open preview"},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:(e,t)=>`Rated ${e.toFixed(1)} by ${t} 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:{loading:"Loading brands…",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."},vehicleSearch:{label:"Search for your vehicle",placeholder:"Search directly, e.g. Golf 7 or BMW 3 Series",clear:"Clear search",loading:"Searching…",noResults:"No matching vehicle found.",contact:"Just ask us directly.",allModels:"All models"},brandPage:{metaTitleFallback:"Select a model",metaDescription:e=>`Choose your ${e} 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:{customRequest:"Request a custom setup",customHint:"Nothing quite right? We will happily put together a package to suit you.",whatsappText:(e,t)=>`Hello HifiPlanet, I am interested in a car audio upgrade for my ${e} ${t}.`,metaTitleFallback:"Sound packages",metaTitle:(e,t)=>`${e} ${t} sound packages`,metaDescription:(e,t)=>`Car-hifi sound packages for the ${e} ${t} 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",badges:{recommended:"Recommended",popular:"Most popular",tip:"Tip",coming_soon:"Coming soon"},videoLink:"Watch video",moreBullets:e=>e===1?"+ 1 more feature":`+ ${e} more features`,showMore:"Show more",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:{sendAnother:"Send another request",vehicleBoxTitle:"Your vehicle:",privacyPre:"By sending this form you agree that we use your details to handle your request. Learn more in our ",privacyLink:"privacy policy",privacyPost:".",mapIframeTitle:"HifiPlanet location in Amorbach on Google Maps",whatsappText:(e,t,n)=>`Hello HifiPlanet, I am interested in the "${n}" package for my ${e} ${t}.`,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:e=>`${e} installations`,metaDescription:e=>`A look at our ${e} car-hifi installations.`,loading:"Loading…",breadcrumbGallery:"Gallery",titleSuffix:"Select a project",empty:"No projects have been added for this brand yet."},galleryProjectPage:{ctaTitle:"Want something like this for your car?",ctaText:"Tell us about your vehicle and we will plan a similar build for you.",ctaButton:"Request a similar build",ctaTopic:e=>`I am interested in a build similar to "${e}" from your gallery.`,metaTitleFallback:"Photo gallery",metaDescription:e=>`Photos of our ${e} installation.`,loading:"Loading…",breadcrumbGallery:"Gallery",empty:"No photos have been added for this project yet.",enlargeImage:"Enlarge image"},downloadsPage:{metaTitle:"Downloads",metaDescription:"Files and songs from HifiPlanet to listen to and download.",title:"Downloads",intro:"Here you will find files and songs we provide for you – listen right here or download them.",loading:"Loading…",empty:"There are no downloads available right now.",download:"Download",lockedTitle:"Protected area",lockedText:"Please enter the password you received from us.",passwordLabel:"Password",unlock:"Unlock",unlocking:"Checking…",wrongPassword:"Sorry, that password is not correct."},errors:{generic:"Something went wrong. Please try again.",network:"No connection to the server. Please check your internet connection.",notFound:"This page does not exist (anymore).",rateLimited:"Too many requests in a short time. Please try again later or give us a call.",invalidInput:"Please enter your name and a valid email address.",server:"A server error occurred. Please try again later.",maintenance:"This section is being updated. Please check back later."},notFound:{metaTitle:"Page not found",title:"We could not find this page",text:"The link may be outdated or contain a typo. Continue here:",toVehicles:"Choose your vehicle",toContact:"Get in touch",toHome:"Back to the homepage"}},Sn={de:cP,en:dP},nv=m.createContext(null);function fP({children:e}){const[t,n]=m.useState(null),[r,s]=m.useState(!0);m.useEffect(()=>{ae.get("/auth/me").then(f=>n(f.authenticated===!1?null:f)).catch(()=>n(null)).finally(()=>s(!1))},[]);const i=async(f,h)=>{const g=await ae.post("/auth/login",{username:f,password:h});return g.requires_2fa?{requires2fa:!0,method:g.method||"totp",emailHint:g.email_hint||""}:(n(g),{requires2fa:!1})},a=async f=>{const h=await ae.post("/auth/verify-2fa",{code:f});n(h)},l=()=>ae.post("/auth/resend-code",{}),u=async()=>{await ae.post("/auth/logout",{}),n(null)},c=async()=>{const f=await ae.get("/auth/me");n(f.authenticated===!1?null:f)},d=f=>{var h;return!!t&&(t.is_super_admin||((h=t.permissions)==null?void 0:h.includes(f)))};return o.jsx(nv.Provider,{value:{user:t,loading:r,login:i,verifyTwoFactor:a,resendLoginCode:l,logout:u,refreshUser:c,hasPermission:d},children:e})}function $n(){return m.useContext(nv)}const Al={home_sections:"content.manage",faqs:"content.manage",partners:"content.manage",text:"content.manage",site_images:"content.manage",services:"services.manage",packages:"packages.manage",brands:"brands.manage",car_models:"models.manage",gallery_brands:"gallery.manage",gallery_projects:"gallery.manage",gallery_photos:"gallery.manage",legal_pages:"settings.manage"},gc="hifi-live-edit",hP={de:{},en:{}},vs=(e,t,n,r)=>`${e}|${t}|${n}|${r}`;function mP(){try{const e=new URLSearchParams(window.location.search);if(e.get("bearbeiten")==="1"){sessionStorage.setItem(gc,"1"),e.delete("bearbeiten");const t=e.toString();return window.history.replaceState(window.history.state,"",window.location.pathname+(t?`?${t}`:"")+window.location.hash),!0}return sessionStorage.getItem(gc)==="1"}catch{return!1}}const Wn=()=>{},rv=m.createContext({available:!1,enabled:!1,setEnabled:Wn,canEdit:()=>!1,getValue:(e,t,n,r,s)=>s,setValue:Wn,resetValue:Wn,hasPending:()=>!1,textOverride:()=>{},trackTextKey:Wn,usedTextKeys:()=>[],pendingCount:0,saving:!1,error:"",save:async()=>{},discard:Wn,editor:null,openEditor:Wn,closeEditor:Wn});function Dl({serverOverrides:e,children:t}){const{user:n,hasPermission:r}=$n(),s=!!n&&Object.values(Al).some(A=>r(A)),[i,a]=m.useState(mP),l=s&&i,[u,c]=m.useState({}),[d,f]=m.useState({}),[h,g]=m.useState(!1),[v,b]=m.useState(""),[w,p]=m.useState(null),x=m.useRef(l);x.current=l;const y=m.useRef(new Map),k=m.useCallback(A=>{a(A);try{sessionStorage.setItem(gc,A?"1":"0")}catch{}A||p(null)},[]),E=m.useCallback(A=>l&&!!Al[A]&&r(Al[A]),[l,r]),C=m.useCallback((A,R,H,_,I)=>{const Y=vs(A,R,H,_);return Y in u?u[Y]:Y in d?d[Y]:I},[u,d]),j=m.useCallback((A,R,H,_,I)=>{b(""),c(Y=>({...Y,[vs(A,R,H,_)]:I}))},[]),S=m.useCallback((A,R,H,_)=>{c(I=>{const Y=vs(A,R,H,_);if(!(Y in I))return I;const Z={...I};return delete Z[Y],Z})},[]),N=m.useCallback((A,R,H,_)=>vs(A,R,H,_)in u,[u]),P=e||hP,F=m.useCallback((A,R)=>{var I;const H=vs("text",R,"value",A),_=H in u?u[H]:H in d?d[H]:(I=P[A])==null?void 0:I[R];return _||void 0},[u,d,P]),B=m.useCallback(A=>{if(!x.current)return;const R=window.location.pathname,H=y.current.get(A);H?H.add(R):y.current.set(A,new Set([R]))},[]),se=m.useCallback(A=>{const R=[];return y.current.forEach((H,_)=>{H.has(A)&&R.push(_)}),R.sort()},[]),ne=Object.keys(u).length,q=m.useCallback(async()=>{const A=Object.entries(u);if(!A.length)return;const R=A.map(([H,_])=>{const[I,Y,Z,ue]=H.split("|");return{entity:I,id:Y,field:Z,lang:ue,value:_??""}});g(!0),b("");try{await ae.put("/live-edit",{changes:R}),f(H=>({...H,...u})),c({})}catch(H){b(H.status===401?"Deine Anmeldung ist abgelaufen. Bitte im Admin-Bereich neu anmelden, die Änderungen bleiben hier so lange erhalten.":H.message)}finally{g(!1)}},[u]),G=m.useCallback(()=>{c({}),b(""),p(null)},[]),V=m.useCallback(A=>p(A),[]),T=m.useCallback(()=>p(null),[]);m.useEffect(()=>{if(!ne)return;const A=R=>{R.preventDefault(),R.returnValue=""};return window.addEventListener("beforeunload",A),()=>window.removeEventListener("beforeunload",A)},[ne]);const M=m.useMemo(()=>({available:s,enabled:l,setEnabled:k,canEdit:E,getValue:C,setValue:j,resetValue:S,hasPending:N,textOverride:F,trackTextKey:B,usedTextKeys:se,pendingCount:ne,saving:h,error:v,save:q,discard:G,editor:w,openEditor:V,closeEditor:T}),[s,l,k,E,C,j,S,N,F,B,se,ne,h,v,q,G,w,V,T]);return o.jsx(rv.Provider,{value:M,children:t})}function Xe(){return m.useContext(rv)}function pP(){const e=localStorage.getItem("hifi-lang");return e==="de"||e==="en"?e:(navigator.language||"de").toLowerCase().startsWith("de")?"de":"en"}function va(e,t){return t.split(".").reduce((n,r)=>n==null?void 0:n[r],e)}const sv=m.createContext({language:"de",setLanguage:()=>{},toggleLanguage:()=>{},t:e=>{const t=va(Sn.de,e);return t!==void 0?t:e}});function Rl({children:e}){const[t,n]=m.useState(pP),{textOverride:r,trackTextKey:s}=Xe();m.useEffect(()=>{document.documentElement.setAttribute("lang",t),localStorage.setItem("hifi-lang",t)},[t]);const i=()=>n(l=>l==="de"?"en":"de"),a=l=>{const u=Sn[t]||Sn.de,c=va(u,l);if(typeof c=="string"||c===void 0&&typeof va(Sn.de,l)=="string"){s(l);const f=r(t,l);if(f!==void 0)return f}if(c!==void 0)return c;const d=va(Sn.de,l);return d!==void 0?d:l};return o.jsx(sv.Provider,{value:{language:t,setLanguage:n,toggleLanguage:i,t:a},children:e})}function xe(){return m.useContext(sv)}function gP({overHero:e=!1,forceDark:t=!1}){const{theme:n,toggleTheme:r}=tv(),{t:s}=xe();return o.jsx("button",{onClick:r,"aria-label":s("themeToggle.label"),className:`rounded-full p-2 transition ${e?"text-white hover:bg-white/10":t?"text-neutral-300 hover:bg-neutral-800":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:n==="dark"?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:o.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"})}):o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:o.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"})})})}const Qd=m.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,page_loader_enabled:1,package_card_width:210,package_card_height:480,vehicle_tile_width:240,vehicle_tile_height:180,hidden_areas:[]}),xP=Qd.Provider;function Pt(){return m.useContext(Qd)}function Do(){const{hidden_areas:e}=m.useContext(Qd);return t=>(e||[]).includes(t)}const Jd="/assets/logo-dark-R-ckaBhx.png",iv=e=>(e||"").replace(/[^\d+]/g,""),fi=e=>`tel:${iv(e)}`,ef=(e,t="")=>`https://wa.me/${iv(e).replace(/^0/,"49").replace("+","")}${t?`?text=${encodeURIComponent(t)}`:""}`;function An(e,t={}){typeof window>"u"||typeof window.gtag!="function"||window.gtag("event",e,t)}const yP="https://www.audio4cars.de/",ip=70,vP=500;function wP({className:e}){return o.jsxs("svg",{viewBox:"0 0 3 2",className:e,"aria-hidden":"true",children:[o.jsx("rect",{width:"3",height:"0.667",y:"0",fill:"#000"}),o.jsx("rect",{width:"3",height:"0.667",y:"0.667",fill:"#D00"}),o.jsx("rect",{width:"3",height:"0.666",y:"1.334",fill:"#FFCE00"})]})}function bP({className:e}){return o.jsxs("svg",{viewBox:"0 0 60 30",className:e,"aria-hidden":"true",children:[o.jsx("clipPath",{id:"fgb-t",children:o.jsx("path",{d:"M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"})}),o.jsx("path",{d:"M0,0 v30 h60 v-30 z",fill:"#00247d"}),o.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#fff",strokeWidth:"6"}),o.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",clipPath:"url(#fgb-t)",stroke:"#cf142b",strokeWidth:"4"}),o.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#fff",strokeWidth:"10"}),o.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#cf142b",strokeWidth:"6"})]})}const Il=[{code:"de",label:"Deutsch",Flag:wP},{code:"en",label:"English",Flag:bP}];function kP({overHero:e=!1}){const{language:t,setLanguage:n,t:r}=xe(),[s,i]=m.useState(!1),a=m.useRef(null),l=Il.find(u=>u.code===t)||Il[0];return m.useEffect(()=>{if(!s)return;const u=d=>{a.current&&!a.current.contains(d.target)&&i(!1)},c=d=>{d.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",c)}},[s]),o.jsxs("div",{className:"relative",ref:a,children:[o.jsxs("button",{type:"button",onClick:()=>i(u=>!u),"aria-haspopup":"listbox","aria-expanded":s,"aria-label":r("languageToggle.label"),className:`flex items-center gap-1 rounded-full p-1.5 transition ${e?"hover:bg-white/10":"hover:bg-neutral-800"}`,children:[o.jsx("span",{className:`block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ${e?"ring-white/50":"ring-neutral-600"}`,children:o.jsx(l.Flag,{className:"h-full w-full"})}),o.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:`h-3 w-3 transition-transform ${e?"text-white/70":"text-neutral-400"} ${s?"rotate-180":""}`,children:o.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&&o.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-2 min-w-[9rem] overflow-hidden rounded-lg border border-neutral-700 bg-neutral-900 py-1 shadow-lg",children:Il.map(u=>o.jsxs("button",{type:"button",role:"option","aria-selected":u.code===t,onClick:()=>{n(u.code),i(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition hover:bg-neutral-800 ${u.code===t?"font-semibold text-brand-400":"text-neutral-200"}`,children:[o.jsx("span",{className:"block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ring-neutral-600",children:o.jsx(u.Flag,{className:"h-full w-full"})}),u.label]},u.code))})]})}function SP(){const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,i]=m.useState(!1),{user:a}=$n(),{phone:l,whatsapp:u,logo_dark_path:c,has_downloads:d}=Pt(),f=Do(),{t:h}=xe(),g=!f("page.vehicles"),v=!f("page.services"),b=!f("page.gallery"),w=d&&!f("page.downloads"),p=3+[g,v,b,w,l,u].filter(Boolean).length,y=Ye().pathname==="/",[k,E]=m.useState(!y);m.useEffect(()=>{if(!y){E(!0);return}const G=()=>E(window.scrollY>24);return G(),window.addEventListener("scroll",G,{passive:!0}),()=>window.removeEventListener("scroll",G)},[y]);const C=y&&!k,j=m.useRef(null),S=m.useRef(null);m.useEffect(()=>{if(!e)return;const G=document.body.style.overflow;document.body.style.overflow="hidden";const V=setTimeout(()=>{var M,A;return(A=(M=j.current)==null?void 0:M.querySelector("button, a"))==null?void 0:A.focus()},50),T=M=>{if(M.key==="Escape"){t(!1);return}if(M.key!=="Tab"||!j.current)return;const A=[...j.current.querySelectorAll("a[href], button")];if(!A.length)return;const R=A[0],H=A[A.length-1];M.shiftKey&&document.activeElement===R?(M.preventDefault(),H.focus()):!M.shiftKey&&document.activeElement===H&&(M.preventDefault(),R.focus())};return document.addEventListener("keydown",T),()=>{var M;clearTimeout(V),document.body.style.overflow=G,document.removeEventListener("keydown",T),(M=S.current)==null||M.focus({preventScroll:!0})}},[e]),m.useEffect(()=>{if(e){r(!0);let T;const M=requestAnimationFrame(()=>{T=requestAnimationFrame(()=>i(!0))});return()=>{cancelAnimationFrame(M),T&&cancelAnimationFrame(T)}}i(!1);const G=vP+(p-1)*ip,V=setTimeout(()=>r(!1),G);return()=>clearTimeout(V)},[e,p]);const N=()=>`transition-all duration-500 ease-out ${s?"opacity-100":"opacity-0"}`,P=G=>({transitionDelay:`${(s?G:p-1-G)*ip}ms`,transform:s?"translateY(0)":"translateY(-140px)"}),F=a&&o.jsx(K,{to:"/admin","aria-label":h("nav.adminPanel"),title:h("nav.adminPanel"),className:`rounded-full p-2 transition ${C?"text-white hover:bg-white/10":"text-neutral-300 hover:bg-neutral-800"}`,children:o.jsx(CT,{className:"h-5 w-5"})}),B=Xe(),se=B.available&&o.jsx("button",{type:"button",onClick:()=>B.setEnabled(!B.enabled),"aria-pressed":B.enabled,"aria-label":"Seite bearbeiten",title:B.enabled?"Bearbeiten beenden":"Seite bearbeiten",className:`rounded-full p-2 transition ${B.enabled?"bg-brand-500 text-white hover:bg-brand-600":C?"text-white hover:bg-white/10":"text-neutral-300 hover:bg-neutral-800"}`,children:o.jsx(Jy,{className:"h-5 w-5"})});let ne=0;const q=()=>P(ne++);return o.jsxs("header",{className:`sticky top-0 z-30 border-b transition-colors duration-300 ${C?"border-transparent bg-transparent":"border-neutral-800 bg-neutral-950/90 backdrop-blur"}`,children:[o.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:[o.jsx("div",{className:"flex items-center justify-self-start",children:o.jsx("button",{ref:S,onClick:()=>t(!0),"aria-label":h("nav.openMenu"),"aria-expanded":e,"aria-haspopup":"dialog",className:`rounded-md p-2 transition ${C?"text-white hover:bg-white/10":"text-neutral-300 hover:bg-neutral-800"}`,children:o.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:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})}),o.jsx(K,{to:"/",className:"flex items-center justify-self-center rounded-lg px-2 py-1",children:o.jsx("img",{src:c||Jd,alt:"HifiPlanet",className:"h-14 w-auto sm:h-16"})}),o.jsxs("div",{className:"flex items-center justify-self-end gap-1",children:[se,F,!e&&o.jsx(kP,{overHero:C}),o.jsx(gP,{overHero:C,forceDark:!0})]})]}),n&&hd.createPortal(o.jsx("div",{ref:j,role:"dialog","aria-modal":"true","aria-label":h("nav.menu"),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:o.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:[o.jsxs("button",{onClick:()=>t(!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:[o.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:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})}),o.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:h("nav.close")})]}),g&&o.jsx(K,{to:"/fahrzeuge",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.vehicles")}),v&&o.jsx(K,{to:"/leistungen",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.services")}),b&&o.jsx(K,{to:"/galerie",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.gallery")}),o.jsx(K,{to:"/kontakt",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.contact")}),w&&o.jsx(K,{to:"/downloads",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.downloads")}),o.jsx("div",{className:`h-px w-16 bg-brand-500/60 ${N()}`,style:q()}),l&&o.jsxs("a",{href:fi(l),onClick:()=>An("contact_call"),className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${N()}`,style:q(),children:[o.jsx(dr,{className:"h-4 w-4"}),l]}),u&&o.jsxs("a",{href:ef(u),onClick:()=>An("contact_whatsapp"),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 ${N()}`,style:q(),children:[o.jsx(Qy,{className:"h-4 w-4"}),h("nav.whatsapp")]}),o.jsxs("a",{href:yP,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 ${N()}`,style:q(),children:[o.jsx(QT,{className:"h-4 w-4"}),h("nav.shop")]})]})}),document.body)]})}const ap="hifiplanet-cookie-consent",av={necessary:!0,external:!1,analytics:!1},ov=m.createContext({consent:av,decided:!1,settingsOpen:!1,acceptAll:()=>{},rejectNonEssential:()=>{},saveCustom:()=>{},openSettings:()=>{},closeSettings:()=>{}});function jP({children:e}){const[t,n]=m.useState(av),[r,s]=m.useState(!1),[i,a]=m.useState(!1);m.useEffect(()=>{try{const g=localStorage.getItem(ap);if(g){const v=JSON.parse(g);n({necessary:!0,external:!!v.external,analytics:!!v.analytics}),s(!0)}}catch{}},[]);const l=m.useCallback(g=>{n(g),s(!0),a(!1),localStorage.setItem(ap,JSON.stringify({...g,decidedAt:new Date().toISOString()}))},[]),u=m.useCallback(()=>l({necessary:!0,external:!0,analytics:!0}),[l]),c=m.useCallback(()=>l({necessary:!0,external:!1,analytics:!1}),[l]),d=m.useCallback(g=>l({necessary:!0,external:!!g.external,analytics:!!g.analytics}),[l]),f=m.useCallback(()=>a(!0),[]),h=m.useCallback(()=>a(!1),[]);return o.jsx(ov.Provider,{value:{consent:t,decided:r,settingsOpen:i,acceptAll:u,rejectNonEssential:c,saveCustom:d,openSettings:f,closeSettings:h},children:e})}function ls(){return m.useContext(ov)}const EP=["mon","tue","wed","thu","fri","sat","sun"],CP=["sun","mon","tue","wed","thu","fri","sat"],Vl={mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",sun:"So"};function TP(e){const t=new Date,n=e==null?void 0:e[CP[t.getDay()]];if(!n||n.closed||!n.open||!n.close)return!1;const r=t.getHours()*60+t.getMinutes(),[s,i]=n.open.split(":").map(Number),[a,l]=n.close.split(":").map(Number);return r>=s*60+i&&r{const s=PP(e==null?void 0:e[r])||t,i=n[n.length-1];i&&i.label===s?i.days=`${i.firstLabel}-${Vl[r]}`:n.push({key:r,days:Vl[r],firstLabel:Vl[r],label:s})}),n}const NP=e=>(e||"").replace(/[^\d+]/g,"");function _P(){const{phone:e,contact_email:t,address_street:n,address_zip:r,address_city:s,business_hours:i,has_downloads:a}=Pt(),l=Do(),u=a&&!l("page.downloads"),c=TP(i),{openSettings:d}=ls(),{pathname:f}=Ye(),h=f==="/",{t:g}=xe(),v=[n,[r,s].filter(Boolean).join(" ")].filter(Boolean).join(", "),b=`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(v)}`,w=lv(i,g("footer.closed"));return o.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 ${h?"pb-24":""}`,children:[o.jsxs("div",{className:"mx-auto grid max-w-6xl gap-4 px-4 sm:grid-cols-3 sm:px-6",children:[o.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[o.jsx(Zy,{className:"h-4 w-4 text-brand-500"}),o.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:"HifiPlanet"})]}),n&&o.jsx("p",{children:n}),(r||s)&&o.jsx("p",{children:[r,s].filter(Boolean).join(" ")}),o.jsxs("a",{href:b,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:[o.jsx(FT,{className:"h-3.5 w-3.5"}),g("footer.routePlan")]})]}),o.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[o.jsx(dr,{className:"h-4 w-4 text-brand-500"}),o.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:g("footer.contactHeading")})]}),o.jsx("p",{children:o.jsx("a",{href:`tel:${NP(e)}`,className:"inline-block py-1 hover:text-brand-500",children:e})}),o.jsx("p",{children:o.jsx("a",{href:`mailto:${t}`,className:"inline-block py-1 hover:text-brand-500",children:t})}),o.jsx(K,{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:g("footer.contactForm")})]}),o.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Yy,{className:"h-4 w-4 text-brand-500"}),o.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:g("footer.hoursHeading")})]}),o.jsxs("span",{className:`flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-semibold ${c?"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:[o.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${c?"bg-green-500":"bg-neutral-400"}`}),g(c?"footer.open":"footer.closed")]})]}),o.jsx("dl",{className:"space-y-1.5",children:w.map(p=>o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:p.days}),o.jsx("dd",{className:"font-medium text-neutral-700 dark:text-neutral-200",children:p.label})]},p.key))})]})]}),o.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:o.jsxs("p",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[o.jsx("span",{children:g("footer.copyright")(new Date().getFullYear())}),o.jsx("span",{children:"·"}),o.jsx(K,{to:"/impressum",className:"hover:text-brand-500",children:g("footer.imprint")}),o.jsx("span",{children:"·"}),o.jsx(K,{to:"/datenschutz",className:"hover:text-brand-500",children:g("footer.privacy")}),o.jsx("span",{children:"·"}),o.jsx(K,{to:"/agb",className:"hover:text-brand-500",children:g("footer.terms")}),o.jsx("span",{children:"·"}),u&&o.jsxs(o.Fragment,{children:[o.jsx(K,{to:"/downloads",className:"hover:text-brand-500",children:g("footer.downloads")}),o.jsx("span",{children:"·"})]}),o.jsx("button",{type:"button",onClick:d,className:"hover:text-brand-500",children:g("footer.cookieSettings")})]})})]})}function MP(){const{scrollYProgress:e}=Hy(),t=RC(e,{stiffness:200,damping:30,restDelta:.001});return o.jsx(nn.div,{style:{scaleX:t},className:"fixed left-0 top-0 z-40 h-0.5 w-full origin-left bg-brand-500"})}const LP=()=>o.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:o.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 ji({message:e,fullScreen:t=!1}){const{t:n}=xe(),r=o.jsxs("div",{className:"mx-auto max-w-md text-center",children:[o.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:o.jsx(LP,{})}),o.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:n("maintenance.title")}),o.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:e||n("maintenance.defaultMessage")})]});return t?o.jsxs("div",{className:"relative flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950",children:[r,o.jsxs(K,{to:"/admin/login","aria-label":n("maintenance.login"),title:n("maintenance.login"),className:"fixed bottom-4 right-4 flex items-center gap-2 rounded-full border border-neutral-200 bg-white px-3 py-2 text-sm font-medium text-neutral-600 shadow-sm transition hover:border-brand-500 hover:text-brand-600 dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-300 dark:hover:text-brand-400",children:[o.jsx(Xy,{className:"h-4 w-4"}),n("maintenance.login")]})]}):o.jsx("div",{className:"mx-auto max-w-6xl px-4 py-20 sm:px-6",children:r})}const op=o.jsx(o.Fragment,{children:'Wartungsmodus aktiv – Besucher sehen aktuell eine Wartungsmeldung. Du siehst diese Seite nur, weil du die Berechtigung "Wartungsmodus umgehen" hast.'});function Ei({inline:e=!1}){return e?o.jsx("div",{className:"mb-8 rounded-lg bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:op}):o.jsx("div",{className:"bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:op})}const lp='a[href], button:not([disabled]), input:not([disabled]), select, textarea, [tabindex]:not([tabindex="-1"])';function Ci(e,t,n){m.useEffect(()=>{if(!t)return;const r=document.activeElement,s=document.body.style.overflow;document.body.style.overflow="hidden";const i=setTimeout(()=>{var l,u;return(u=(l=e.current)==null?void 0:l.querySelector(lp))==null?void 0:u.focus()},30),a=l=>{if(l.key==="Escape"){l.stopPropagation(),n==null||n();return}if(l.key!=="Tab"||!e.current)return;const u=[...e.current.querySelectorAll(lp)];if(!u.length)return;const c=u[0],d=u[u.length-1];l.shiftKey&&document.activeElement===c?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),c.focus())};return document.addEventListener("keydown",a),()=>{clearTimeout(i),document.body.style.overflow=s,document.removeEventListener("keydown",a),r instanceof HTMLElement&&r.focus({preventScroll:!0})}},[t,e])}function AP({onClose:e}){const{consent:t,saveCustom:n}=ls(),[r,s]=m.useState(t.external),[i,a]=m.useState(t.analytics),{t:l}=xe(),u=m.useRef(null);return Ci(u,!0,e),o.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:e,children:o.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":l("cookieConsent.modalTitle"),className:"w-full max-w-md rounded-xl bg-white p-6 dark:bg-neutral-900",onClick:c=>c.stopPropagation(),children:[o.jsx("h2",{className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:l("cookieConsent.modalTitle")}),o.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:[l("cookieConsent.modalIntro")," ",o.jsx(K,{to:"/datenschutz",className:"underline hover:text-brand-500",onClick:e,children:l("cookieConsent.privacyPolicy")}),"."]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:l("cookieConsent.necessaryTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:l("cookieConsent.necessaryDesc")})]}),o.jsx("input",{type:"checkbox",checked:!0,disabled:!0,className:"mt-1 h-4 w-4 shrink-0"})]}),o.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:l("cookieConsent.externalTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:l("cookieConsent.externalDesc")})]}),o.jsx("input",{type:"checkbox",checked:r,onChange:c=>s(c.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]}),o.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:l("cookieConsent.analyticsTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:l("cookieConsent.analyticsDesc")})]}),o.jsx("input",{type:"checkbox",checked:i,onChange:c=>a(c.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]})]}),o.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:l("cookieConsent.cancel")}),o.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:l("cookieConsent.saveSelection")})]})]})})}function DP(){const{decided:e,settingsOpen:t,acceptAll:n,rejectNonEssential:r,openSettings:s,closeSettings:i}=ls(),{t:a}=xe();return o.jsxs(o.Fragment,{children:[!e&&o.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:o.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[a("cookieConsent.bannerText")," ",a("cookieConsent.moreInfo")," ",o.jsx(K,{to:"/datenschutz",className:"underline hover:text-brand-500",children:a("cookieConsent.privacyPolicy")}),"."]}),o.jsxs("div",{className:"flex flex-wrap gap-2 sm:shrink-0",children:[o.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:a("cookieConsent.settings")}),o.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:a("cookieConsent.onlyNecessary")}),o.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:a("cookieConsent.acceptAll")})]})]})}),t&&o.jsx(AP,{onClose:i})]})}const uv="/assets/gallery-subs-COSd4seJ.webp",cv="/assets/gallery-amp-purple-CESAKuOf.webp",RP="/assets/gallery-speaker-CUXQZ49Q.webp",dv="/assets/gallery-dash-Cg-7v9qo.webp",IP="/assets/hero-trunk-Dp4_JHDh.webp",VP="/assets/gallery-rear-8cIXPC7T.webp",FP="/assets/hero-highlight-Co4f1Kj5.webp",OP="/assets/bg-light-CBAG2tPV.webp",up="/assets/bg-dark-B4R1klEI.webp",fv="/assets/base-BKOm0Bib.webp",hv="/assets/clear-DZZMSrMX.webp",mv="/assets/drive-BE2W1yna.webp",pv="/assets/prime-BTVNe2Gb.webp",gv="/assets/elite_r-BRvz_pyr.webp",xv="/assets/apex-CFy2qup8.webp",yv="/assets/statement-pTO-wTPx.webp",vv="/assets/limitless-DDs0S_PU.webp",Zt={og_image:{src:"/og-image.jpg",label:"Link-Vorschaubild",aspect:1200/630},favicon:{src:"/favicon.png",label:"Browser-Symbol (Favicon)",aspect:1},craft:{src:uv,label:"Startseite: Bild bei „Präzisionsarbeit“",aspect:3/2},advice:{src:cv,label:"Startseite: Bild bei „Von der ersten Idee …“",aspect:3/2},youtube_poster:{src:dv,label:"Startseite: Standbild des Videos",aspect:16/9},more:{src:FP,label:"Startseite: Bild bei „Mehr als nur Car-Hifi“",aspect:16/9},contact_bg_light:{src:OP,label:"Kontaktseite: Hintergrund hell"},contact_bg_dark:{src:up,label:"Kontaktseite: Hintergrund dunkel"},countdown_bg:{src:up,label:"Launch-Countdown: Hintergrund"}},ao=[{src:uv,width:900,height:600},{src:cv,width:900,height:600},{src:RP,width:900,height:1200},{src:dv,width:900,height:814},{src:VP,width:900,height:1200},{src:IP,width:1920,height:1280}],f4=24,zP=()=>ao.map((e,t)=>`default:${t}`),BP=[fv,hv,mv,pv,gv,xv,yv,vv];function $P(e){var n;const t=/^default:(\d+)$/.exec(e||"");return t?((n=ao[Number(t[1])])==null?void 0:n.src)||null:e||null}function Ro(e){const t=Pt(),n=Xe(),r=(e||t).site_images||{},s=(u,c)=>n.getValue("site_images",u,"path","de",c||"")||"";return{slot:u=>{const c=s(u,r[u]);return{src:c||Zt[u].src,custom:c}},insights:()=>(Array.isArray(r.insights)?r.insights:zP()).map((c,d)=>{let f=s(`insights.${d}`,c);f||(f=dc.src),packageTier:u=>{const c=Array.isArray(r.package_tiers)?r.package_tiers:[],d=s(`package_tiers.${u}`,c[u]);return{src:d||BP[u],custom:d}}}}const Ne={card:"#14170e",cardBorder:"rgba(168,225,12,0.16)",divider:"rgba(168,225,12,0.15)",text:"#f3f6ea",muted:"#9aa38c",label:"#8f987f",accent:"#b6e619",pillBorder:"rgba(168,225,12,0.28)"},cp={fontFamily:"'Michroma', sans-serif"};function oo(e,t=0){return e!=null&&e.launch_at?new Date(e.launch_at).getTime()-(Date.now()+t):0}function HP(e,t){return!(e!=null&&e.server_time)||!t?0:new Date(e.server_time).getTime()-t}function UP(e){const t=Math.max(0,Math.floor(e/1e3));return{days:Math.floor(t/86400),hours:Math.floor(t%86400/3600),minutes:Math.floor(t%3600/60),seconds:t%60}}function WP(e,t){const n=new Date(e),r=new Date(n.getTime()+60*60*1e3),s=a=>a.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),i=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//HifiPlanet//Countdown//DE","BEGIN:VEVENT",`UID:launch-${s(n)}@hifi-planet.de`,`DTSTAMP:${s(new Date)}`,`DTSTART:${s(n)}`,`DTEND:${s(r)}`,`SUMMARY:${t}`,`URL:${window.location.origin}`,"END:VEVENT","END:VCALENDAR"].join(`\r -`);return`data:text/calendar;charset=utf-8,${encodeURIComponent(i)}`}function GP({text:e}){const t=e.trimEnd().lastIndexOf(" ");return t<0?e:o.jsxs(o.Fragment,{children:[e.slice(0,t+1),o.jsx("span",{style:{color:Ne.accent},children:e.slice(t+1)})]})}function KP({countdown:e,clockOffset:t=0,settings:n={},preview:r=!1,onClosePreview:s,onLaunch:i}){const{t:a,language:l,toggleLanguage:u}=xe(),[c,d]=m.useState(()=>oo(e,t)),f=Ro(n).slot("countdown_bg"),h=c<=0;m.useEffect(()=>{const k=()=>d(oo(e,t));k();const E=setInterval(k,250);return()=>clearInterval(E)},[e,t]),m.useEffect(()=>{if(!h||r)return;const k=setTimeout(()=>i==null?void 0:i(),2600);return()=>clearTimeout(k)},[h,r,i]),m.useEffect(()=>{const k=document.title;return document.title=`HifiPlanet – ${a("countdown.eyebrow")}`,()=>{document.title=k}},[a]);const g=UP(c),v=l==="en",b=h?a("countdown.liveTitle"):(v?e.title_en:e.title)||a("countdown.title"),w=h?a("countdown.liveMessage"):(v?e.message_en:e.message)||a("countdown.message"),p=e.launch_at?new Date(e.launch_at):null,x=p?p.toLocaleString(v?"en-GB":"de-DE",{weekday:"long",day:"numeric",month:"long",hour:"2-digit",minute:"2-digit",timeZone:"Europe/Berlin"}):"",y=[[g.days,a("countdown.days")],[g.hours,a("countdown.hours")],[g.minutes,a("countdown.minutes")],[g.seconds,a("countdown.seconds")]];return o.jsxs("div",{className:"flex min-h-[100svh] flex-col bg-[#0a0c06] bg-cover bg-center",style:{backgroundImage:`url(${f.src})`,color:Ne.text,fontFamily:"'Barlow', sans-serif"},children:[r&&o.jsxs("div",{className:"flex items-center justify-center gap-3 px-4 py-2 text-xs font-semibold",style:{background:Ne.accent,color:"#0f1208"},children:[a("countdown.preview"),o.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1 underline",children:[o.jsx(Si,{className:"h-3.5 w-3.5"}),a("countdown.closePreview")]})]}),o.jsxs("div",{className:"mx-auto flex w-full max-w-[1280px] flex-1 flex-col px-4 pb-6 sm:px-10 sm:pb-10",children:[o.jsxs("header",{className:"flex items-center justify-between gap-4 border-b pb-5 pt-6 sm:pt-8",style:{borderColor:Ne.divider},children:[o.jsx("img",{src:n.logo_dark_path||Jd,alt:"HifiPlanet",className:"h-12 w-auto sm:h-14"}),o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsx("button",{type:"button",onClick:u,"aria-label":a("languageToggle.label"),className:"text-xs font-semibold uppercase tracking-[3px] hover:text-white",style:{color:Ne.muted},children:l==="de"?"EN":"DE"}),n.phone&&o.jsxs("a",{href:fi(n.phone),className:"hidden items-center gap-2.5 rounded-full border py-2 pl-2 pr-5 text-sm font-semibold sm:inline-flex",style:{borderColor:Ne.pillBorder,background:Ne.card},children:[o.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full",style:{background:"rgba(168,225,12,0.1)",color:Ne.accent},children:o.jsx(dr,{className:"h-3.5 w-3.5"})}),n.phone]})]})]}),o.jsxs("main",{className:"flex flex-1 flex-col justify-center py-12 sm:py-16",children:[o.jsx("p",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:Ne.accent},children:a(h?"countdown.liveEyebrow":"countdown.eyebrow")}),o.jsx("h1",{style:cp,className:"max-w-3xl text-[34px] leading-[1.08] sm:text-[clamp(34px,5vw,60px)]",children:o.jsx(GP,{text:b})}),o.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:Ne.muted},children:w}),o.jsx("div",{className:"grid w-full max-w-[720px] grid-cols-4 rounded-[14px] border shadow-[0_24px_60px_rgba(0,0,0,0.55)]",style:{background:Ne.card,borderColor:Ne.cardBorder},children:y.map(([k,E],C)=>o.jsxs("div",{className:`px-2 py-5 text-center sm:px-6 sm:py-7 ${C>0?"border-l":""}`,style:{borderColor:Ne.divider},children:[o.jsx("div",{style:cp,className:"text-[22px] tabular-nums leading-none min-[400px]:text-[26px] sm:text-[44px]",children:String(k).padStart(2,"0")}),o.jsx("div",{className:"mt-3 text-[10px] font-semibold uppercase tracking-[2px] sm:text-[11px] sm:tracking-[3px]",style:{color:Ne.label},children:E})]},E))}),p&&!h&&o.jsxs("div",{className:"mt-6 flex flex-col gap-3 text-[15px] sm:flex-row sm:items-center sm:gap-8",children:[o.jsxs("p",{style:{color:Ne.muted},children:[a("countdown.launchPrefix"),": ",o.jsx("span",{className:"font-semibold",style:{color:Ne.text},children:x}),a("countdown.clock")&&` ${a("countdown.clock")}`]}),o.jsxs("a",{href:WP(e.launch_at,a("countdown.calendarTitle")),download:"hifiplanet-launch.ics",className:"text-[13px] font-bold uppercase tracking-[3px] hover:underline",style:{color:Ne.accent},children:[a("countdown.addToCalendar")," →"]})]})]}),o.jsxs("footer",{className:"flex flex-wrap gap-x-6 gap-y-2 border-t pt-5 text-[13px]",style:{borderColor:Ne.divider,color:Ne.label},children:[n.phone&&o.jsx("a",{href:fi(n.phone),className:"hover:text-white sm:hidden",children:n.phone}),n.address_city&&o.jsxs("span",{children:[n.address_street,", ",n.address_zip," ",n.address_city]}),o.jsx(K,{to:"/impressum",className:"hover:text-white",children:"Impressum"}),o.jsx(K,{to:"/datenschutz",className:"hover:text-white",children:v?"Privacy":"Datenschutz"}),o.jsx(K,{to:"/admin/login","aria-label":a("maintenance.login"),title:a("maintenance.login"),className:"hover:text-white",children:o.jsx(Xy,{className:"h-3.5 w-3.5"})})]})]})]})}function qP({countdown:e}){const{t,language:n}=xe(),r=new Date(e.launch_at).toLocaleString(n==="en"?"en-GB":"de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"Europe/Berlin"});return o.jsxs("div",{className:"bg-neutral-900 px-4 py-2 text-center text-xs font-semibold text-neutral-200",children:[t("countdown.adminActive").replace("{date}",r)," ",o.jsx(K,{to:"/?countdown=vorschau",className:"text-brand-300 underline hover:text-brand-200",children:t("countdown.adminPreview")})]})}function YP(){const{consent:e}=ls(),{ga_measurement_id:t}=Pt(),n=m.useRef(!1),r=Ye();return m.useEffect(()=>{if(!t||!e.analytics||n.current)return;n.current=!0;const s=document.createElement("script");s.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,s.async=!0,document.head.appendChild(s),window.dataLayer=window.dataLayer||[];function i(){window.dataLayer.push(arguments)}window.gtag=i,i("js",new Date),i("config",t,{anonymize_ip:!0,send_page_view:!1})},[t,e.analytics]),m.useEffect(()=>{!n.current||typeof window.gtag!="function"||window.gtag("consent","update",{analytics_storage:e.analytics?"granted":"denied"})},[e.analytics]),m.useEffect(()=>{!e.analytics||typeof window.gtag!="function"||window.gtag("event","page_view",{page_path:r.pathname+r.search,page_location:window.location.href,page_title:document.title})},[r.pathname,r.search,e.analytics,t]),null}const wv=m.createContext({global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null},bypass:!1}),XP=wv.Provider;function Io(){return m.useContext(wv)}const tf=m.createContext({}),ZP=tf.Provider;function fr(e,t){const n=e[t];if(!n)return{};const r={};return n.font_family&&(r.fontFamily=n.font_family),n.font_size&&(r.fontSize=n.font_size),n.color&&(r.color=n.color),r}function We(e){const t=m.useContext(tf);return fr(t,e)}function nf(){return m.useContext(tf)}const QP=[{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'}],rf=m.createContext({fonts:[],refresh:()=>{}}),bv=rf.Provider;function kv(){return m.useContext(rf).fonts}function h4(){return m.useContext(rf).refresh}function m4(){const e=kv();return[...QP,...e.map(t=>({label:t.name,value:t.font_family}))]}function JP(e){const t=/\.([a-z0-9]+)$/i.exec(e||"");return t?t[1].toLowerCase():""}const eN={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype"};function Sv(){const e=kv();if(e.length===0)return null;const t=e.map(n=>{const r=eN[JP(n.file_path)]||"woff2";return`@font-face { font-family: "${n.font_family}"; src: url("${n.file_path}") format("${r}"); font-display: swap; }`}).join(` -`);return o.jsx("style",{children:t})}const tN=150,nN=300,rN=80,sN=5e3;function iN(){return o.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-white dark:bg-neutral-950",children:o.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-4 border-neutral-200 border-t-brand-500 dark:border-neutral-800 dark:border-t-brand-500"})})}function aN({enabled:e,children:t}){const n=Ye(),[r,s]=m.useState(!e),[i,a]=m.useState(!1),l=m.useRef(null);return m.useLayoutEffect(()=>{const u=l.current;if(!e||!u){s(!0),a(!1);return}s(!1),a(!1);let c=!1,d=0,f=null;const h=new Set,g=setTimeout(()=>{d=Date.now(),a(!0)},tN),v=()=>{s(!0),a(!1)},b=()=>{c=!0,clearTimeout(g),clearTimeout(f),clearTimeout(C),k.disconnect(),E()},w=()=>{if(c)return;b();const j=d?nN-(Date.now()-d):0;j>0?setTimeout(v,j):v()},p=()=>{clearTimeout(f),f=setTimeout(()=>{h.size===0&&$C()===0&&w()},rN)},x=j=>{if(h.has(j)||j.complete||j.getBoundingClientRect().top>=window.innerHeight)return;j.loading==="lazy"&&(j.loading="eager"),h.add(j);const S=()=>{h.delete(j),j.removeEventListener("load",S),j.removeEventListener("error",S),p()};j.addEventListener("load",S),j.addEventListener("error",S)},y=j=>{var S;j.nodeType===1&&(j.tagName==="IMG"&&x(j),(S=j.querySelectorAll)==null||S.call(j,"img").forEach(x))},k=new MutationObserver(j=>{j.forEach(S=>S.addedNodes.forEach(y)),p()});k.observe(u,{childList:!0,subtree:!0});const E=HC(p),C=setTimeout(w,sN);return u.querySelectorAll("img").forEach(x),p(),()=>{c||b()}},[n.pathname,e]),o.jsxs("div",{className:"relative",children:[o.jsx("div",{ref:l,style:e?{visibility:r?"visible":"hidden"}:void 0,children:t}),e&&i&&o.jsx(iN,{})]})}const oN=m.lazy(()=>X(()=>import("./RichTextEditor-Da-meJrp.js"),[])),lN=m.lazy(()=>X(()=>import("./ImageUploadField-2si66K3r.js"),__vite__mapDeps([0,1]))),sf={de:"Deutsch",en:"Englisch"},uN=["nav.","footer.","cookieConsent.","languageToggle.","themeToggle.","maintenance."],Xi=e=>uN.some(t=>e.startsWith(t));function Fl(e,t){return t.split(".").reduce((n,r)=>n==null?void 0:n[r],e)}function cN({editor:e}){const t=Xe(),{entity:n,id:r,field:s,lang:i,kind:a,label:l,hint:u,original:c,aspect:d}=e,[f]=m.useState(()=>({value:c,wasPending:t.hasPending(n,r,s,i)})),[h,g]=m.useState(c),v=w=>{g(w),t.setValue(n,r,s,i,w)},b=()=>{f.wasPending?t.setValue(n,r,s,i,f.value):t.resetValue(n,r,s,i),t.closeEditor()};return o.jsxs("div",{className:"pointer-events-auto w-full rounded-xl border border-neutral-200 bg-white p-4 text-neutral-900 shadow-2xl dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 sm:w-[min(92vw,520px)]",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("p",{className:"text-sm font-semibold",children:[l," ",a!=="image"&&o.jsxs("span",{className:"font-normal text-neutral-500",children:["(",sf[i],")"]})]}),o.jsx("button",{type:"button",onClick:b,"aria-label":"Abbrechen",className:"rounded p-1 text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",children:o.jsx(Si,{className:"h-4 w-4"})})]}),u&&o.jsx("p",{className:"mb-2 text-xs text-neutral-500 dark:text-neutral-400",children:u}),a==="image"?o.jsxs(m.Suspense,{fallback:o.jsx("p",{className:"p-3 text-sm text-neutral-500",children:"Lädt…"}),children:[o.jsx(lN,{value:h,onChange:w=>v(w||""),label:"Eigenes Bild",aspect:d}),o.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:"Ohne eigenes Bild (× am Vorschaubild) erscheint wieder das Standardbild."})]}):a==="html"?o.jsx("div",{className:"max-h-[45vh] overflow-y-auto rounded-md border border-neutral-300 dark:border-neutral-700",children:o.jsx(m.Suspense,{fallback:o.jsx("p",{className:"p-3 text-sm text-neutral-500",children:"Editor lädt…"}),children:o.jsx(oN,{value:h,onChange:v})})}):a==="input"?o.jsx("input",{autoFocus:!0,value:h,onChange:w=>v(w.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-800"}):o.jsx("textarea",{autoFocus:!0,rows:7,value:h,onChange:w=>v(w.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-800"}),o.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:b,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Abbrechen"}),o.jsx("button",{type:"button",onClick:t.closeEditor,className:"rounded-md bg-brand-500 px-3 py-1.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Übernehmen"})]})]})}function dN({onClose:e}){const t=Xe(),{language:n,t:r}=xe(),s=Ye(),[i,a]=m.useState(""),[l,u]=m.useState(0);m.useEffect(()=>{const h=setTimeout(()=>u(g=>g+1),400);return()=>clearTimeout(h)},[s.pathname]);const c=m.useMemo(()=>t.usedTextKeys(s.pathname).filter(h=>typeof Fl(Sn.de,h)=="string").sort((h,g)=>Xi(h)-Xi(g)||h.localeCompare(g)),[s.pathname,l,t.usedTextKeys]),d=i.trim().toLowerCase(),f=c.filter(h=>!d||h.toLowerCase().includes(d)||r(h).toLowerCase().includes(d));return o.jsxs("div",{className:"pointer-events-auto flex max-h-[60vh] w-full flex-col rounded-xl border border-neutral-200 bg-white text-neutral-900 shadow-2xl dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 sm:w-[min(92vw,520px)]",children:[o.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-neutral-200 p-4 pb-3 dark:border-neutral-800",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"text-sm font-semibold",children:["Feste Texte auf dieser Seite ",o.jsxs("span",{className:"font-normal text-neutral-500",children:["(",sf[n],")"]})]}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Buttons, Beschriftungen, Menü und Fußzeile. Leer lassen = Standardtext."})]}),o.jsx("button",{type:"button",onClick:e,"aria-label":"Schließen",className:"rounded p-1 text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",children:o.jsx(Si,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"px-4 pt-3",children:o.jsx("input",{type:"search",value:i,onChange:h=>a(h.target.value),placeholder:"Suchen…",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-800"})}),o.jsxs("ul",{className:"flex-1 space-y-3 overflow-y-auto p-4",children:[f.length===0&&o.jsx("li",{className:"text-sm text-neutral-500",children:"Keine Texte gefunden."}),f.map((h,g)=>{const v=Fl(Sn[n],h)??Fl(Sn.de,h),b=t.textOverride(n,h)!==void 0,w=r(h);return o.jsxs("li",{children:[Xi(h)&&(g===0||!Xi(f[g-1]))&&o.jsx("p",{className:"mb-3 border-t border-neutral-200 pt-3 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-800",children:"Auf allen Seiten (Menü, Fußzeile, Cookie-Hinweis)"}),o.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[o.jsx("label",{htmlFor:`live-text-${h}`,className:"truncate font-mono text-[11px] text-neutral-500",title:h,children:h}),b&&o.jsxs("button",{type:"button",onClick:()=>t.setValue("text",h,"value",n,""),className:"flex shrink-0 items-center gap-1 text-[11px] text-neutral-500 hover:text-brand-600",title:`Standard: ${v}`,children:[o.jsx(UT,{className:"h-3 w-3"})," Standard"]})]}),o.jsx("textarea",{id:`live-text-${h}`,rows:w.length>60?3:1,value:w,onChange:p=>t.setValue("text",h,"value",n,p.target.value===v?"":p.target.value),className:`w-full resize-y rounded-md border bg-white px-2.5 py-1.5 text-sm dark:bg-neutral-800 ${b?"border-amber-400 dark:border-amber-500":"border-neutral-300 dark:border-neutral-700"}`})]},h)})]})]})}function fN(){const e=Xe(),{language:t}=xe(),[n,r]=m.useState(!1);if(!e.enabled)return null;const s=()=>{e.pendingCount&&!window.confirm("Es gibt ungespeicherte Änderungen. Bearbeiten trotzdem beenden? Die Änderungen gehen dann verloren.")||(e.discard(),e.setEnabled(!1))},i=e.editor&&`${e.editor.entity}|${e.editor.id}|${e.editor.field}|${e.editor.lang}`;return o.jsxs("div",{className:"pointer-events-none fixed inset-x-0 bottom-0 z-[150] flex flex-col items-end gap-2 p-2 sm:p-4",children:[e.editor?o.jsx(cN,{editor:e.editor},i):n&&o.jsx(dN,{onClose:()=>r(!1)}),o.jsxs("div",{className:"pointer-events-auto flex w-full flex-wrap items-center justify-between gap-2 rounded-xl border border-neutral-700 bg-neutral-950/95 px-3 py-2.5 text-sm text-neutral-100 shadow-2xl backdrop-blur sm:px-4",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Jy,{className:"h-4 w-4 shrink-0 text-brand-400"}),o.jsxs("p",{className:"min-w-0 truncate",children:[o.jsx("span",{className:"font-semibold",children:"Bearbeiten"}),o.jsxs("span",{className:"hidden text-neutral-400 sm:inline",children:[" · ",sf[t]," · gestrichelte Stellen anklicken"]})]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.error&&o.jsx("span",{className:"max-w-xs text-xs text-red-400",children:e.error}),o.jsxs("button",{type:"button",onClick:()=>{e.closeEditor(),r(a=>!a)},className:`flex items-center gap-1.5 rounded-md border px-3 py-1.5 font-medium ${n?"border-brand-400 text-brand-300":"border-neutral-700 hover:bg-neutral-800"}`,children:[o.jsx(_T,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"Feste Texte"})]}),e.pendingCount>0&&o.jsx("button",{type:"button",onClick:e.discard,className:"rounded-md border border-neutral-700 px-3 py-1.5 font-medium hover:bg-neutral-800",children:"Verwerfen"}),o.jsxs("button",{type:"button",onClick:e.save,disabled:!e.pendingCount||e.saving,className:"flex items-center gap-1.5 rounded-md bg-brand-500 px-3 py-1.5 font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:[o.jsx(qy,{className:"h-4 w-4"}),e.saving?"Speichere…":e.pendingCount?`Speichern (${e.pendingCount})`:"Gespeichert"]}),o.jsx("button",{type:"button",onClick:s,"aria-label":"Bearbeiten beenden",title:"Bearbeiten beenden",className:"rounded-md p-1.5 text-neutral-400 hover:bg-neutral-800 hover:text-white",children:o.jsx(Si,{className:"h-4 w-4"})})]})]})]})}const jv=[{title:"Seiten",hint:"Ausgeblendete Seiten verschwinden aus dem Menü und leiten Besucher auf die Startseite um.",areas:[{key:"page.vehicles",label:"Fahrzeuge & Pakete",path:"/fahrzeuge"},{key:"page.services",label:"Leistungen",path:"/leistungen"},{key:"page.gallery",label:"Galerie",path:"/galerie"},{key:"page.downloads",label:"Downloads",path:"/downloads",note:"Erscheint ohnehin nur, wenn Downloads hinterlegt sind."}]},{title:"Startseite",hint:"Einzelne Abschnitte der Startseite. Das große Titelbild oben bleibt immer sichtbar.",areas:[{key:"home.stats",label:"Zahlen-Leiste"},{key:"home.partners",label:"Marken / Partner-Logos"},{key:"home.youtube",label:"Video-Abschnitt"},{key:"home.craft",label:"Handwerk & Beratung"},{key:"home.insights",label:"Einblicke (Bilder)"},{key:"home.reviews",label:"Kundenbewertungen"},{key:"home.more",label:'„Mehr als Car-Hifi"'},{key:"home.faq",label:"Häufige Fragen (FAQ)"}]}],hN=jv[0].areas;function mN(e){if(!e)return null;const t=hN.find(n=>e===n.path||e.startsWith(`${n.path}/`));return t?t.key:null}function Ev(e,t=[]){const n=mN(e);return!!n&&t.includes(n)}const pN=jv.flatMap(e=>e.areas),gN={global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null}},xN={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}},Ol={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:xN,hero_image_path:null,ga_measurement_id:null,package_card_theme:"graphite",package_card_layout:"strip",package_wheel_hint_interval:8,package_card_width:210,package_card_height:480,vehicle_tile_width:240,vehicle_tile_height:180,gallery_card_text_x:0,gallery_card_text_y:100,site_font:null,page_loader_enabled:1,has_downloads:!1,hidden_areas:[],price_note:null,price_note_en:null},yN=["/impressum","/datenschutz","/agb"],dp="hifi-site-settings",fp="hifi-maintenance";function hp(e){try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function mp(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const vN={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"};function wN(e){var n,r,s;const t=document.getElementById("ld-business");if(t)try{const i=JSON.parse(t.textContent),a=(e.phone||"").replace(/[^\d+]/g,"");a&&(i.telephone=a.startsWith("+")?a:`+49${a.replace(/^0/,"")}`),e.contact_email&&(i.email=e.contact_email),i.address={"@type":"PostalAddress",streetAddress:e.address_street||((n=i.address)==null?void 0:n.streetAddress),postalCode:e.address_zip||((r=i.address)==null?void 0:r.postalCode),addressLocality:e.address_city||((s=i.address)==null?void 0:s.addressLocality),addressCountry:"DE"};const l=e.business_hours;l&&typeof l=="object"&&(i.openingHoursSpecification=Object.entries(vN).filter(([u])=>l[u]&&!l[u].closed&&l[u].open&&l[u].close).map(([u,c])=>({"@type":"OpeningHoursSpecification",dayOfWeek:c,opens:l[u].open,closes:l[u].close}))),t.textContent=JSON.stringify(i)}catch{}}function bN(){var N;const[e]=m.useState(()=>hp(dp)),[t,n]=m.useState(()=>hp(fp)),[r,s]=m.useState(()=>e?{...Ol,...e}:Ol),[i,a]=m.useState(!!e),[l,u]=m.useState({}),[c,d]=m.useState([]),{loading:f,hasPermission:h,user:g}=$n(),v=Ye(),b=pr(),[w,p]=m.useState(!1),[x]=m.useState(()=>new Date(Date.now()+(7*24+3)*3600*1e3+42*60*1e3).toISOString());m.useEffect(()=>{ae.get("/maintenance").then(P=>{const F={...P,_received_at:Date.now()};n(F),mp(fp,F)}).catch(()=>n(P=>P||gN)),ae.get("/site-settings").then(P=>{s({...Ol,...P}),mp(dp,P)}).catch(()=>{}).finally(()=>a(!0)),ae.get("/text-styles").then(u).catch(()=>{}),ae.get("/custom-fonts").then(d).catch(()=>{})},[]),m.useEffect(()=>{r.site_font?document.documentElement.style.setProperty("--site-font",r.site_font):document.documentElement.style.removeProperty("--site-font")},[r.site_font]),m.useEffect(()=>{i&&wN(r)},[r,i]);const y=t==null?void 0:t.countdown,k=HP(y,t==null?void 0:t._received_at),E=!!(y!=null&&y.active)&&!w&&oo(y,k)>0;if(t===null||!i||((N=t.global)!=null&&N.enabled||E)&&f)return o.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});const C=h("maintenance.bypass"),j=yN.includes(v.pathname),S=!!g&&new URLSearchParams(v.search).get("countdown")==="vorschau";if(!j&&(E&&!g||S)){const P=S&&!(y!=null&&y.launch_at&&oo(y,k)>0)?{...y,launch_at:x}:y;return o.jsx(Dl,{serverOverrides:r.text_overrides,children:o.jsx(Rl,{children:o.jsx(KP,{countdown:P,clockOffset:P===y?k:0,settings:r,preview:S,onClosePreview:()=>b("/",{replace:!0}),onLaunch:()=>p(!0)})})})}return t.global.enabled&&!C&&!j?o.jsx(Dl,{serverOverrides:r.text_overrides,children:o.jsx(Rl,{children:o.jsx(ji,{message:t.global.message,fullScreen:!0})})}):o.jsx(Dl,{serverOverrides:r.text_overrides,children:o.jsx(Rl,{children:o.jsx(XP,{value:{...t,bypass:C},children:o.jsx(xP,{value:r,children:o.jsx(ZP,{value:l,children:o.jsx(bv,{value:{fonts:c,refresh:()=>{}},children:o.jsxs("div",{className:"page-texture flex min-h-screen flex-col text-neutral-900 dark:text-neutral-100",children:[o.jsx(Sv,{}),C&&t.global.enabled&&o.jsx(Ei,{}),!!g&&E&&o.jsx(qP,{countdown:y}),o.jsx(MP,{}),o.jsx(SP,{}),o.jsx("main",{className:"flex-1",children:o.jsx(aN,{enabled:v.pathname!=="/"&&!!r.page_loader_enabled,children:Ev(v.pathname,r.hidden_areas)?o.jsx(ur,{to:"/",replace:!0}):o.jsx(m.Suspense,{fallback:o.jsx("div",{className:"min-h-[60vh]"}),children:o.jsx(yd,{})})})}),o.jsx(_P,{}),o.jsx(DP,{}),o.jsx(YP,{}),o.jsx(fN,{})]})})})})})})})}const Vo=m.createContext({toast:{success:()=>{},error:()=>{},info:()=>{}},setDirty:()=>{},confirmLeave:()=>!0,refreshCounters:()=>{}});let kN=0;function SN({children:e,onRefreshCounters:t}){const[n,r]=m.useState([]),s=m.useRef(new Set),i=m.useCallback(f=>r(h=>h.filter(g=>g.id!==f)),[]),a=m.useCallback((f,h,g={})=>{const v=++kN;return r(b=>[...b.slice(-3),{id:v,type:f,message:h,action:g.action}]),setTimeout(()=>i(v),g.duration||(f==="error"?7e3:3500)),v},[i]),l=m.useMemo(()=>({success:(f,h)=>a("success",f,h),error:(f,h)=>a("error",f,h),info:(f,h)=>a("info",f,h)}),[a]),u=m.useCallback((f,h)=>{h?s.current.add(f):s.current.delete(f)},[]),c=m.useCallback(()=>{if(s.current.size===0)return!0;const f=window.confirm("Du hast ungespeicherte Änderungen. Seite trotzdem verlassen? Die Änderungen gehen dann verloren.");return f&&s.current.clear(),f},[]);m.useEffect(()=>{const f=g=>{s.current.size!==0&&(g.preventDefault(),g.returnValue="")},h=g=>{var w,p;if(s.current.size===0||g.defaultPrevented||g.button!==0)return;const v=(p=(w=g.target).closest)==null?void 0:p.call(w,"a[href]");if(!v||v.target==="_blank"||g.metaKey||g.ctrlKey||g.shiftKey)return;const b=new URL(v.href,window.location.href);b.origin!==window.location.origin||b.pathname===window.location.pathname||c()||(g.preventDefault(),g.stopPropagation())};return window.addEventListener("beforeunload",f),document.addEventListener("click",h,!0),()=>{window.removeEventListener("beforeunload",f),document.removeEventListener("click",h,!0)}},[c]);const d=m.useMemo(()=>({toast:l,setDirty:u,confirmLeave:c,refreshCounters:t||(()=>{})}),[l,u,c,t]);return o.jsxs(Vo.Provider,{value:d,children:[e,o.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[300] flex w-[min(92vw,380px)] flex-col gap-2","aria-live":"polite",children:n.map(f=>o.jsxs("div",{role:f.type==="error"?"alert":"status",className:`pointer-events-auto flex items-start justify-between gap-3 rounded-lg border px-4 py-3 text-sm shadow-lg ${f.type==="error"?"border-red-200 bg-red-50 text-red-800 dark:border-red-900 dark:bg-red-950 dark:text-red-200":f.type==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-900 dark:bg-green-950 dark:text-green-200":"border-neutral-200 bg-white text-neutral-800 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100"}`,children:[o.jsxs("span",{children:[f.type==="success"?"✓ ":"",f.message]}),o.jsxs("span",{className:"flex shrink-0 items-center gap-3",children:[f.action&&o.jsx("button",{type:"button",onClick:()=>{f.action.onClick(),i(f.id)},className:"font-semibold underline",children:f.action.label}),o.jsx("button",{type:"button",onClick:()=>i(f.id),"aria-label":"Meldung schließen",className:"opacity-60 hover:opacity-100",children:"✕"})]})]},f.id))})]})}function p4(){return m.useContext(Vo)}function g4(){return m.useContext(Vo).toast}function x4(e,t="page"){const{setDirty:n}=m.useContext(Vo);m.useEffect(()=>{n(t,!!e)},[e,t,n]),m.useEffect(()=>()=>n(t,!1),[t,n])}const jN=5*60*1e3,EN=30*60*1e3;function CN(){const{user:e,login:t,verifyTwoFactor:n}=$n(),[r,s]=m.useState(!1),[i,a]=m.useState("credentials"),[l,u]=m.useState((e==null?void 0:e.username)||""),[c,d]=m.useState(""),[f,h]=m.useState(""),[g,v]=m.useState(""),[b,w]=m.useState(""),[p,x]=m.useState(!1),y=m.useRef(Date.now()),k=m.useRef(null);if(Ci(k,r,()=>{}),m.useEffect(()=>UC(()=>s(!0)),[]),m.useEffect(()=>{const N=()=>{y.current=Date.now()},P=["keydown","pointerdown","scroll"];P.forEach(B=>window.addEventListener(B,N,{passive:!0}));const F=setInterval(()=>{document.hidden||Date.now()-y.current>EN||ae.get("/auth/me").then(B=>{(B==null?void 0:B.authenticated)===!1&&s(!0)}).catch(()=>{})},jN);return()=>{P.forEach(B=>window.removeEventListener(B,N)),clearInterval(F)}},[]),!r)return null;const E=()=>{s(!1),a("credentials"),d(""),h(""),w("")},C=async N=>{N.preventDefault(),x(!0),w("");try{const P=await t(l,c);P.requires2fa?(v(P.method==="email"?`6-stelliger Code aus der Mail an ${P.emailHint}`:"6-stelliger Code aus der App"),a("code")):E()}catch(P){w(P.message)}finally{x(!1)}},j=async N=>{N.preventDefault(),x(!0),w("");try{await n(f),E()}catch(P){w(P.message)}finally{x(!1)}},S="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";return o.jsx("div",{className:"fixed inset-0 z-[400] flex items-center justify-center bg-black/50 p-4",children:o.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":"session-expired-title",className:"w-full max-w-sm rounded-xl bg-white p-6 shadow-xl dark:bg-neutral-900",children:[o.jsx("h2",{id:"session-expired-title",className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:"Bitte erneut anmelden"}),o.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Deine Sitzung ist abgelaufen. Deine Eingaben auf dieser Seite bleiben erhalten – nach dem Anmelden einfach noch einmal speichern."}),i==="credentials"?o.jsxs("form",{onSubmit:C,className:"space-y-3",children:[o.jsx("input",{value:l,onChange:N=>u(N.target.value),required:!0,placeholder:"Benutzername oder E-Mail",autoComplete:"username",className:S}),o.jsx("input",{type:"password",value:c,onChange:N=>d(N.target.value),required:!0,placeholder:"Passwort",autoComplete:"current-password",className:S}),b&&o.jsx("p",{className:"text-sm text-red-600",children:b}),o.jsx("button",{type:"submit",disabled:p,className:"w-full rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:p?"Melde an…":"Anmelden"})]}):o.jsxs("form",{onSubmit:j,className:"space-y-3",children:[o.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:g}),o.jsx("input",{value:f,onChange:N=>h(N.target.value),required:!0,inputMode:"numeric",autoComplete:"one-time-code",placeholder:"123456",className:S}),b&&o.jsx("p",{className:"text-sm text-red-600",children:b}),o.jsx("button",{type:"submit",disabled:p,className:"w-full rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:p?"Prüfe…":"Bestätigen"})]})]})})}const Pe=(...e)=>e.filter(Boolean).join(" "),Fo="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/60 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-neutral-950",TN={primary:"bg-brand-500 text-white shadow-sm hover:bg-brand-600 active:bg-brand-700",secondary:"border border-neutral-300 bg-white text-neutral-700 shadow-sm hover:bg-neutral-50 hover:border-neutral-400 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:hover:bg-neutral-800",danger:"bg-red-600 text-white shadow-sm hover:bg-red-700",ghost:"text-neutral-600 hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:hover:text-white"},PN={sm:"h-8 gap-1.5 px-3 text-sm",md:"h-10 gap-2 px-4 text-sm"};function xc({variant:e="primary",size:t="md",className:n}={}){return Pe("inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-lg font-semibold transition disabled:cursor-not-allowed disabled:opacity-50",Fo,TN[e],PN[t],n)}function y4({variant:e,size:t,className:n,icon:r,children:s,to:i,href:a,type:l="button",...u}){const c=xc({variant:e,size:t,className:n}),d=o.jsxs(o.Fragment,{children:[r&&o.jsx(Oe,{name:r,className:"h-4 w-4"}),s]});return i?o.jsx(K,{to:i,className:c,...u,children:d}):a?o.jsx("a",{href:a,className:c,...u,children:d}):o.jsx("button",{type:l,className:c,...u,children:d})}const NN={default:"text-neutral-500 hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-white",danger:"text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:text-neutral-500 dark:hover:bg-red-950/50 dark:hover:text-red-400"};function _N({icon:e,label:t,tone:n="default",className:r,to:s,href:i,...a}){const l=Pe("inline-flex h-8 w-8 items-center justify-center rounded-lg transition",Fo,NN[n],r),u=o.jsx(Oe,{name:e,className:"h-[18px] w-[18px]"});return s?o.jsx(K,{to:s,className:l,title:t,"aria-label":t,...a,children:u}):i?o.jsx("a",{href:i,className:l,title:t,"aria-label":t,...a,children:u}):o.jsx("button",{type:"button",className:l,title:t,"aria-label":t,...a,children:u})}const af=Pe("block w-full rounded-lg border border-neutral-300 bg-white px-3 text-sm text-neutral-900 shadow-sm transition placeholder:text-neutral-400","focus:border-brand-500 focus:outline-none focus:ring-2 focus:ring-brand-500/25","disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-500","dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:placeholder:text-neutral-500 dark:disabled:bg-neutral-800"),v4=m.forwardRef(function({className:t,...n},r){return o.jsx("input",{ref:r,className:Pe(af,"h-10",t),...n})}),w4=m.forwardRef(function({className:t,rows:n=4,...r},s){return o.jsx("textarea",{ref:s,rows:n,className:Pe(af,"py-2",t),...r})}),b4=m.forwardRef(function({className:t,children:n,...r},s){return o.jsx("select",{ref:s,className:Pe(af,"h-10 pr-8",t),...r,children:n})});function k4({label:e,hint:t,error:n,required:r,children:s,className:i}){const a=m.useId(),l=typeof s=="function"?s(a):s;return o.jsxs("div",{className:i,children:[e&&o.jsxs("label",{htmlFor:a,className:"mb-1.5 block text-sm font-medium text-neutral-800 dark:text-neutral-200",children:[e,r&&o.jsx("span",{className:"ml-0.5 text-brand-600 dark:text-brand-400",children:"*"})]}),m.isValidElement(l)&&!l.props.id?m.cloneElement(l,{id:a}):l,n?o.jsx("p",{className:"mt-1.5 text-xs font-medium text-red-600 dark:text-red-400",children:n}):t&&o.jsx("p",{className:"mt-1.5 text-xs text-neutral-500 dark:text-neutral-400",children:t})]})}function S4({checked:e,indeterminate:t=!1,onChange:n,label:r,disabled:s,className:i}){const a=m.useRef(null);return m.useEffect(()=>{a.current&&(a.current.indeterminate=!!t&&!e)},[t,e]),o.jsx("input",{ref:a,type:"checkbox",checked:!!e,disabled:s,"aria-label":r,onChange:l=>n==null?void 0:n(l.target.checked),onClick:l=>l.stopPropagation(),className:Pe("h-4 w-4 shrink-0 cursor-pointer accent-brand-500 disabled:cursor-not-allowed disabled:opacity-50",i)})}function j4({checked:e,onChange:t,label:n,description:r,disabled:s,className:i}){const a=m.useId();return o.jsxs("div",{className:Pe("flex items-center justify-between gap-4",i),children:[(n||r)&&o.jsxs("label",{htmlFor:a,className:"min-w-0 cursor-pointer",children:[n&&o.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:n}),r&&o.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:r})]}),o.jsx("button",{id:a,type:"button",role:"switch","aria-checked":!!e,disabled:s,onClick:()=>t==null?void 0:t(!e),className:Pe("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-50",Fo,e?"bg-brand-500":"bg-neutral-300 dark:bg-neutral-700"),children:o.jsx("span",{className:Pe("inline-block h-5 w-5 rounded-full bg-white shadow transition",e?"translate-x-[22px]":"translate-x-0.5")})})]})}function E4({title:e,description:t,actions:n,children:r,className:s,padded:i=!0}){return o.jsxs("section",{className:Pe("rounded-xl border border-neutral-200/80 bg-white shadow-sm shadow-neutral-900/[0.03] dark:border-neutral-800 dark:bg-neutral-900 dark:shadow-none",i&&"p-5 sm:p-6",s),children:[(e||n)&&o.jsxs("div",{className:Pe("flex flex-wrap items-start justify-between gap-3",(t||r)&&"mb-4"),children:[o.jsxs("div",{className:"min-w-0",children:[e&&o.jsx("h2",{className:"text-base font-semibold text-neutral-900 dark:text-white",children:e}),t&&o.jsx("p",{className:"mt-0.5 text-sm text-neutral-500 dark:text-neutral-400",children:t})]}),n&&o.jsx("div",{className:"flex shrink-0 flex-wrap gap-2",children:n})]}),r]})}function C4({title:e,description:t,actions:n,className:r}){return o.jsxs("div",{className:Pe("mb-6 flex flex-wrap items-end justify-between gap-4",r),children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"text-2xl font-bold tracking-tight text-neutral-900 dark:text-white",children:e}),t&&o.jsx("p",{className:"mt-1 max-w-2xl text-sm text-neutral-500 dark:text-neutral-400",children:t})]}),n&&o.jsx("div",{className:"flex flex-wrap items-center gap-2",children:n})]})}const MN={neutral:"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",brand:"bg-brand-100 text-brand-800 dark:bg-brand-900/50 dark:text-brand-300",amber:"bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300",red:"bg-red-500 text-white"};function T4({tone:e="neutral",children:t,className:n}){return o.jsx("span",{className:Pe("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-semibold",MN[e],n),children:t})}function P4({icon:e="inbox",title:t,description:n,actions:r}){return o.jsxs("div",{className:"flex flex-col items-center px-6 py-12 text-center",children:[o.jsx("span",{className:"mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-brand-50 text-brand-600 dark:bg-brand-900/30 dark:text-brand-400",children:o.jsx(Oe,{name:e,className:"h-6 w-6"})}),o.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:t}),n&&o.jsx("p",{className:"mt-1 max-w-sm text-sm text-neutral-500 dark:text-neutral-400",children:n}),r&&o.jsx("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:r})]})}const LN={md:"max-w-md",lg:"max-w-xl",xl:"max-w-3xl"};function N4({open:e,onClose:t,title:n,description:r,headerExtra:s,children:i,footer:a,size:l="md",as:u="div",...c}){const d=m.useRef(null);return Ci(d,e,t),e?o.jsxs("div",{className:"fixed inset-0 z-50",children:[o.jsx("div",{className:"absolute inset-0 bg-neutral-950/40 backdrop-blur-[2px]",onClick:t}),o.jsxs(u,{ref:d,role:"dialog","aria-modal":"true","aria-label":n,className:Pe("absolute inset-y-0 right-0 flex w-full flex-col bg-white shadow-2xl dark:bg-neutral-900",LN[l]),...c,children:[o.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-neutral-200 px-6 py-5 dark:border-neutral-800",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h2",{className:"text-lg font-semibold text-neutral-900 dark:text-white",children:n}),r&&o.jsx("p",{className:"mt-0.5 text-sm text-neutral-500 dark:text-neutral-400",children:r})]}),s&&o.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:s}),o.jsx(_N,{icon:"close",label:"Schließen",onClick:t,className:"-mr-2 -mt-1"})]}),o.jsx("div",{className:"flex-1 space-y-5 overflow-y-auto px-6 py-6",children:i}),a&&o.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-neutral-200 bg-neutral-50 px-6 py-4 dark:border-neutral-800 dark:bg-neutral-900/60",children:a})]})]}):null}function _4({file:e,onChange:t,accept:n,hint:r,current:s,disabled:i}){const a=m.useId(),[l,u]=m.useState(!1),c=f=>!i&&f&&t(f),d=f=>f>=1048576?`${(f/1048576).toFixed(1).replace(".",",")} MB`:`${Math.max(1,Math.round(f/1024))} KB`;return o.jsxs("label",{htmlFor:a,onDragOver:f=>{f.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:f=>{var h;f.preventDefault(),u(!1),c((h=f.dataTransfer.files)==null?void 0:h[0])},className:Pe("flex cursor-pointer flex-col items-center justify-center gap-1.5 rounded-xl border-2 border-dashed px-4 py-6 text-center transition",l?"border-brand-500 bg-brand-50 dark:bg-brand-900/20":"border-neutral-300 hover:border-brand-400 hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-800/50",i&&"pointer-events-none opacity-60"),children:[o.jsx("input",{id:a,type:"file",accept:n,className:"sr-only",disabled:i,onChange:f=>{var h;return c((h=f.target.files)==null?void 0:h[0])}}),o.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-brand-50 text-brand-600 dark:bg-brand-900/30 dark:text-brand-400",children:o.jsx(Oe,{name:e?"file":"download",className:Pe("h-5 w-5",!e&&"rotate-180")})}),e?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"max-w-full truncate text-sm font-semibold text-neutral-900 dark:text-white",children:e.name}),o.jsxs("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:[d(e.size)," · Klicken, um eine andere Datei zu wählen"]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:["Datei hierher ziehen oder ",o.jsx("span",{className:"text-brand-600 dark:text-brand-400",children:"auswählen"})]}),s&&o.jsxs("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["Aktuell: ",s]}),r&&o.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}function M4({value:e,onChange:t,options:n,size:r="md",className:s}){return o.jsx("div",{role:"radiogroup",className:Pe("inline-flex rounded-lg bg-neutral-100 p-1 dark:bg-neutral-800",s),children:n.map(i=>o.jsx("button",{type:"button",role:"radio","aria-checked":e===i.value,onClick:()=>t(i.value),className:Pe("rounded-md font-medium transition",Fo,r==="sm"?"px-2.5 py-1 text-xs":"px-3 py-1.5 text-sm",e===i.value?"bg-white text-neutral-900 shadow-sm dark:bg-neutral-950 dark:text-white":"text-neutral-500 hover:text-neutral-800 dark:text-neutral-400 dark:hover:text-neutral-200"),children:i.label},i.value))})}const AN={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:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 9v-1a6 6 0 0 1 12 0v1M16 3.5a4 4 0 0 1 0 7.5M22 20v-1a6 6 0 0 0-4-5.6",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8a7 7 0 0 1 14 0",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",key:"M15 7a3 3 0 1 1 0 .01M21 3l-6.5 6.5M8.5 13.5a5 5 0 1 0 2 2L21 5M17 7l2 2",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",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",images:"M7 3h13a1 1 0 0 1 1 1v11M3 7h13a1 1 0 0 1 1 1v12H4a1 1 0 0 1-1-1V7Zm2 11 3.5-4 2.5 3 2-2 3 3",camera:"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Zm8 9a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z",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",download:"M12 4v11m0 0-4-4m4 4 4-4M5 19h14",transfer:"M7 4v13m0 0-3-3m3 3 3-3M17 20V7m0 0-3 3m3-3 3 3",gauge:"M4 13a8 8 0 1 1 16 0M12 13l3.5-3.5M6 17h12",inbox:"M3 13h5l1.5 2.5h5L16 13h5M5 5h14l2 8v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-5l2-8Z",building:"M4 21V5a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v16M15 9h4a1 1 0 0 1 1 1v11M3 21h18M8 8h3M8 12h3M8 16h3",palette:"M12 3a9 9 0 1 0 0 18c1 0 1.5-.7 1.5-1.5 0-.4-.2-.8-.4-1.1-.3-.3-.4-.7-.4-1.1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-7.8-9-7.8ZM7.5 12h.01M10 7.5h.01M15 7.5h.01",file:"M7 3h7l5 5v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5M9 13h6M9 17h6",server:"M4 4h16v6H4V4Zm0 10h16v6H4v-6Zm3-7h.01M7 17h.01",link:"M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 0 0-7.07-7.07l-1.5 1.5M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 0 0 7.07 7.07l1.5-1.5",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-9-9h18M12 3c2.5 2.5 3.5 5.5 3.5 9s-1 6.5-3.5 9c-2.5-2.5-3.5-5.5-3.5-9s1-6.5 3.5-9Z",send:"M4 12 20 4l-4 16-4-7-8-1Zm8 1 8-9",refresh:"M20 11a8 8 0 0 0-14.9-3M4 4v4h4m-4 5a8 8 0 0 0 14.9 3M20 20v-4h-4",trash:"M5 7h14M10 11v6m4-6v6M6 7l1 13h10l1-13M9 7V4h6v3",external:"M14 4h6v6m0-6-9 9M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5",pause:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-2-12v6m4-6v6",timer:"M10 2h4M12 14l3-3M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",pencil:"M4 20h4L19 9l-4-4L4 16v4Zm9-13 4 4",eye:"M2.5 12S6 5 12 5s9.5 7 9.5 7-3.5 7-9.5 7-9.5-7-9.5-7Zm9.5 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",plus:"M12 5v14M5 12h14",search:"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5-2 4 4",chevron:"m9 6 6 6-6 6",menu:"M4 6h16M4 12h16M4 18h16",close:"M6 6l12 12M18 6 6 18",logout:"M15 4h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3M10 8l-4 4 4 4M6 12h10",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0-13v2m0 14v2M3 12h2m14 0h2M5.6 5.6 7 7m10 10 1.4 1.4M5.6 18.4 7 17M17 7l1.4-1.4",moon:"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z",wand:"M5 19 15 9m2-6v2m0 4v2m-3-5h2m4 0h2M4 20l1-1",template:"M4 4h16v5H4V4Zm0 9h7v7H4v-7Zm11 0h5v7h-5v-7Z",copy:"M8 8h11a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Zm-4 8V4a1 1 0 0 1 1-1h12",eyeOff:"M3 3l18 18M10.6 5.1A10 10 0 0 1 12 5c6 0 9.5 7 9.5 7a17 17 0 0 1-3 3.9M6.6 6.6A17 17 0 0 0 2.5 12S6 19 12 19a9.6 9.6 0 0 0 4.4-1.1M9.9 9.9a3 3 0 0 0 4.2 4.2",play:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-2-12.5v7l6-3.5-6-3.5Z",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",grip:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01",check:"M5 12.5l4.5 4.5L19 7.5",chart:"M4 4v15a1 1 0 0 0 1 1h15M8 15l3.5-4 3 2.5L20 7"};function Oe({name:e,className:t="h-5 w-5"}){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:Pe("shrink-0",t),"aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:AN[e]||""})})}const Cv=e=>String(e||"").toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/ß/g,"ss").normalize("NFD").replace(/[̀-ͯ]/g,""),pp=(e,t)=>{const n=Cv(`${e.label} ${e.group||""} ${e.keywords||""}`);return t.every(r=>n.includes(r))};function DN({open:e,onClose:t,pages:n}){const r=pr(),{hasPermission:s}=$n(),i=m.useRef(null),a=m.useRef(null),[l,u]=m.useState(""),[c,d]=m.useState(0),[f,h]=m.useState(null);Ci(i,e,t),m.useEffect(()=>{e&&(u(""),d(0),f===null&&(s("packages.manage")||s("models.manage"))&&ae.get("/models").then(w=>h(w)).catch(()=>h([])))},[e]);const g=m.useMemo(()=>{const w=Cv(l).split(/\s+/).filter(Boolean),p=n.map(y=>({...y,kind:"page"}));if(w.length===0)return p.slice(0,8);const x=(f||[]).map(y=>({key:`model-${y.id}`,kind:"model",icon:"car",label:`${y.brand_name||""} ${y.name}`.trim(),group:s("packages.manage")?"Pakete bearbeiten":"Modelle",to:s("packages.manage")?`/admin/packages?model=${y.id}`:"/admin/models"}));return[...p.filter(y=>pp(y,w)),...x.filter(y=>pp(y,w)).slice(0,8)]},[l,n,f,s]);if(m.useEffect(()=>{d(0)},[l]),m.useEffect(()=>{var w,p;(p=(w=a.current)==null?void 0:w.querySelector('[data-active="true"]'))==null||p.scrollIntoView({block:"nearest"})},[c]),!e)return null;const v=w=>{t(),w.href?window.open(w.href,"_blank","noopener"):r(w.to)},b=w=>{w.key==="ArrowDown"?(w.preventDefault(),d(p=>Math.min(p+1,g.length-1))):w.key==="ArrowUp"?(w.preventDefault(),d(p=>Math.max(p-1,0))):w.key==="Enter"&&g[c]&&(w.preventDefault(),v(g[c]))};return o.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-neutral-950/40 px-4 pt-[12vh] backdrop-blur-sm",onMouseDown:t,children:o.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":"Schnellsuche",onMouseDown:w=>w.stopPropagation(),className:"w-full max-w-xl overflow-hidden rounded-2xl border border-neutral-200 bg-white shadow-2xl dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"flex items-center gap-3 border-b border-neutral-200 px-4 dark:border-neutral-800",children:[o.jsx(Oe,{name:"search",className:"h-5 w-5 text-neutral-400"}),o.jsx("input",{value:l,onChange:w=>u(w.target.value),onKeyDown:b,placeholder:"Seite oder Fahrzeug suchen …",className:"h-14 flex-1 bg-transparent text-base text-neutral-900 placeholder:text-neutral-400 focus:outline-none dark:text-white"}),o.jsx("kbd",{className:"hidden rounded border border-neutral-200 px-1.5 py-0.5 text-[11px] font-medium text-neutral-400 dark:border-neutral-700 sm:block",children:"Esc"})]}),o.jsxs("ul",{ref:a,className:"max-h-[50vh] overflow-y-auto p-2",children:[g.length===0&&o.jsxs("li",{className:"px-3 py-8 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Nichts gefunden für „",l,"“."]}),g.map((w,p)=>o.jsx("li",{children:o.jsxs("button",{type:"button","data-active":p===c,onMouseMove:()=>d(p),onClick:()=>v(w),className:`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-sm ${p===c?"bg-brand-50 text-brand-800 dark:bg-brand-900/30 dark:text-brand-200":"text-neutral-700 dark:text-neutral-200"}`,children:[o.jsx(Oe,{name:w.icon,className:"h-[18px] w-[18px] opacity-70"}),o.jsx("span",{className:"flex-1 truncate font-medium",children:w.label}),w.group&&o.jsx("span",{className:"shrink-0 text-xs text-neutral-400",children:w.group})]})},w.key||w.to))]}),o.jsxs("div",{className:"flex items-center gap-4 border-t border-neutral-200 px-4 py-2 text-[11px] text-neutral-400 dark:border-neutral-800",children:[o.jsx("span",{children:"↑ ↓ auswählen"}),o.jsx("span",{children:"↵ öffnen"})]})]})})}const RN="/assets/logo-BNfZDkmN.png",Tv="hifi-admin-nav-collapsed",gp={system:!0};function IN(){try{return{...gp,...JSON.parse(localStorage.getItem(Tv)||"{}")}}catch{return gp}}const xp=(e,t)=>t.end?e===t.to:e===t.to||e.startsWith(`${t.to}/`);function VN({user:e,onLogout:t}){const[n,r]=m.useState(!1),s=m.useRef(null),{theme:i,toggleTheme:a}=tv(),l=(e==null?void 0:e.username)||"",u=l.slice(0,2).toUpperCase();m.useEffect(()=>{if(!n)return;const d=h=>{var g;return!((g=s.current)!=null&&g.contains(h.target))&&r(!1)},f=h=>h.key==="Escape"&&r(!1);return document.addEventListener("mousedown",d),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",f)}},[n]);const c="flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800";return o.jsxs("div",{ref:s,className:"relative",children:[o.jsx("button",{type:"button",onClick:()=>r(d=>!d),"aria-haspopup":"menu","aria-expanded":n,title:`Angemeldet als ${l}`,className:"flex h-9 w-9 items-center justify-center rounded-full bg-brand-500 text-xs font-bold text-white ring-2 ring-white transition hover:bg-brand-600 focus-visible:outline-none focus-visible:ring-brand-500/60 dark:ring-neutral-950",children:u}),n&&o.jsxs("div",{role:"menu",className:"absolute right-0 top-11 z-40 w-60 rounded-xl border border-neutral-200 bg-white p-1.5 shadow-xl dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"px-3 pb-2 pt-1.5",children:[o.jsx("p",{className:"truncate text-sm font-semibold text-neutral-900 dark:text-white",children:l}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:e!=null&&e.is_super_admin?"Super-Admin":"Admin"})]}),o.jsx("div",{className:"my-1 border-t border-neutral-100 dark:border-neutral-800"}),o.jsxs(K,{to:"/admin/account",role:"menuitem",onClick:()=>r(!1),className:c,children:[o.jsx(Oe,{name:"user",className:"h-4 w-4"})," Mein Konto"]}),o.jsxs("button",{type:"button",role:"menuitem",onClick:a,className:c,children:[o.jsx(Oe,{name:i==="dark"?"sun":"moon",className:"h-4 w-4"}),i==="dark"?"Helles Design":"Dunkles Design"]}),o.jsx("div",{className:"my-1 border-t border-neutral-100 dark:border-neutral-800"}),o.jsxs("button",{type:"button",role:"menuitem",onClick:t,className:`${c} text-red-600 dark:text-red-400`,children:[o.jsx(Oe,{name:"logout",className:"h-4 w-4"})," Abmelden"]})]})]})}function FN(){const{logout:e,user:t,hasPermission:n}=$n(),r=pr(),{pathname:s}=Ye(),[i,a]=m.useState(!1),[l,u]=m.useState(!1),[c,d]=m.useState(IN),[f,h]=m.useState(0),[g,v]=m.useState([]),b=m.useRef(null),[w,p]=m.useState([]),[x,y]=m.useState(!1),[k,E]=m.useState(null);Ci(b,i,()=>a(!1));const C=m.useCallback(()=>{n("contact.manage")&&ae.get("/contact").then(V=>h(V.filter(T=>T.status==="new").length)).catch(()=>{}),ae.get("/site-settings").then(V=>p(V.hidden_areas||[])).catch(()=>{}),ae.get("/maintenance").then(V=>{var T,M;y(!!((T=V==null?void 0:V.global)!=null&&T.enabled)),E((M=V==null?void 0:V.countdown)!=null&&M.active?V.countdown.launch_at:null)}).catch(()=>{})},[t==null?void 0:t.id]);m.useEffect(()=>{C();const V=setInterval(C,2*60*1e3);return()=>clearInterval(V)},[C]),m.useEffect(()=>{const V=T=>{(T.ctrlKey||T.metaKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),u(!0))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[]),m.useEffect(()=>{a(!1)},[s]);const j=pN.filter(V=>w.includes(V.key)).map(V=>V.label),S=()=>ae.get("/custom-fonts").then(v).catch(()=>{});m.useEffect(()=>{S()},[]);const N=m.useMemo(()=>[{id:"main",title:null,links:[{to:"/admin",label:"Übersicht",icon:"gauge",end:!0,keywords:"dashboard start"},{to:"/admin/traffic",label:"Besucher",icon:"chart",permission:"system.admin",keywords:"statistik analytics traffic zugriffe trend"},{to:"/admin/contact-requests",label:"Anfragen",icon:"inbox",permission:"contact.manage",badge:f,keywords:"kontakt kunden nachrichten"}]},{id:"vehicles",title:"Fahrzeuge & Pakete",links:[{to:"/admin/brands",label:"Fahrzeugmarken",icon:"tag",permission:"brands.manage",keywords:"hersteller vorlage"},{to:"/admin/models",label:"Modelle",icon:"car",permission:"models.manage",keywords:"fahrzeuge"},{to:"/admin/packages",label:"Pakete",icon:"box",permission:"packages.manage",keywords:"preise produkte upgrades"}]},{id:"content",title:"Website-Inhalte",links:[{to:"/admin/home-sections",label:"Startseite",icon:"home",permission:"content.manage",keywords:"titelbild texte"},{to:"/admin/services",label:"Leistungen",icon:"briefcase",permission:"services.manage"},{to:"/admin/faqs",label:"FAQ",icon:"help",permission:"content.manage",keywords:"fragen"},{to:"/admin/partners",label:"Partner-Logos",icon:"shield",permission:"content.manage"},{to:"/admin/downloads",label:"Downloads",icon:"download",permission:"downloads.manage",keywords:"dateien pdf"}]},{id:"gallery",title:"Bildergalerie",links:[{to:"/admin/gallery-brands",label:"Galerie-Marken",icon:"images",permission:"gallery.manage"},{to:"/admin/gallery-projects",label:"Projekte & Fotos",icon:"camera",permission:"gallery.manage",keywords:"bilder hochladen"}]},{id:"company",title:"Firma & Aussehen",links:[{to:"/admin/settings/company",label:"Firmendaten",icon:"building",permission:"settings.manage",keywords:"oeffnungszeiten telefon adresse whatsapp email preis hinweis"},{to:"/admin/settings/design",label:"Aussehen",icon:"palette",permission:"settings.manage",keywords:"schrift farben kacheln"},{to:"/admin/settings/images",label:"Bilder",icon:"image",permission:"settings.manage",keywords:"logo favicon hintergrund"},{to:"/admin/settings/legal",label:"Rechtstexte",icon:"file",permission:"settings.manage",keywords:"impressum datenschutz agb"},{to:"/admin/settings/maintenance",label:"Wartungsmodus",icon:"pause",permission:"settings.manage",keywords:"wartung offline"},{to:"/admin/settings/countdown",label:"Launch-Countdown",icon:"timer",permission:"settings.manage",keywords:"start eroeffnung"}]},{id:"system",title:"System (Experten)",links:[{to:"/admin/users",label:"Benutzer",icon:"users",permission:"users.manage",keywords:"mitarbeiter konten"},{to:"/admin/permission-groups",label:"Berechtigungsgruppen",icon:"key",permission:"permission_groups.manage",keywords:"rechte rollen"},{to:"/admin/settings/email",label:"E-Mail-Versand",icon:"send",permission:"system.admin",keywords:"smtp mail"},{to:"/admin/settings/google",label:"Google-Dienste",icon:"globe",permission:"system.admin",keywords:"analytics rezensionen bewertungen"},{to:"/admin/settings/connections",label:"Verbindungstest",icon:"link",permission:"system.admin"},{to:"/admin/settings/database",label:"Datenbank",icon:"server",permission:"system.admin"},{to:"/admin/settings/export-import",label:"Export & Import",icon:"transfer",permission:"system.admin",keywords:"sicherung backup"},{to:"/admin/settings/update",label:"Updates",icon:"refresh",permission:"system.update",keywords:"git version"},{to:"/admin/settings/reset",label:"Zurücksetzen",icon:"trash",permission:"system.admin",keywords:"loeschen"}]}].map(V=>({...V,links:V.links.filter(T=>!T.permission||n(T.permission))})).filter(V=>V.links.length>0),[t==null?void 0:t.id,f]),P=m.useMemo(()=>[...N.flatMap(V=>V.links.map(T=>({...T,group:V.title}))),{to:"/admin/account",label:"Mein Konto",icon:"user",keywords:"passwort 2fa profil"}],[N]),F=P.filter(V=>xp(s,V)).sort((V,T)=>T.to.length-V.to.length)[0],B=V=>{d(T=>{const M={...T,[V]:!T[V]};try{localStorage.setItem(Tv,JSON.stringify(M))}catch{}return M})},se=async()=>{await e(),r("/admin/login")},ne=["content.manage","services.manage","packages.manage","gallery.manage","settings.manage"].some(n),q=({isActive:V})=>`group relative flex items-center justify-between gap-2 rounded-lg px-3 py-2 text-sm transition ${V?"bg-brand-50 font-semibold text-brand-800 before:absolute before:inset-y-1.5 before:left-0 before:w-[3px] before:rounded-full before:bg-brand-500 dark:bg-brand-500/10 dark:text-brand-300":"font-medium text-neutral-600 hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-100"}`,G=o.jsxs("div",{className:"flex h-full flex-col",children:[o.jsxs("div",{className:"flex items-center gap-2 px-5 pb-4 pt-5",children:[o.jsxs(K,{to:"/admin",className:"rounded-lg",children:[o.jsx("img",{src:RN,alt:"HifiPlanet",className:"h-7 w-auto dark:hidden"}),o.jsx("img",{src:Jd,alt:"HifiPlanet",className:"hidden h-7 w-auto dark:block"})]}),o.jsx("span",{className:"rounded-md bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold uppercase tracking-wide text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400",children:"Admin"})]}),o.jsx("div",{className:"px-3 pb-3",children:o.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex h-9 w-full items-center gap-2 rounded-lg border border-neutral-200 bg-white px-3 text-sm text-neutral-400 shadow-sm transition hover:border-neutral-300 hover:text-neutral-600 dark:border-neutral-800 dark:bg-neutral-900 dark:hover:border-neutral-700 dark:hover:text-neutral-300",children:[o.jsx(Oe,{name:"search",className:"h-4 w-4"}),o.jsx("span",{className:"flex-1 text-left",children:"Suchen …"}),o.jsx("kbd",{className:"hidden rounded border border-neutral-200 px-1 text-[10px] font-medium dark:border-neutral-700 lg:block",children:"Strg K"})]})}),o.jsx("nav",{className:"flex-1 space-y-4 overflow-y-auto px-3 pb-6",children:N.map(V=>{const T=V.links.some(R=>xp(s,R)),M=V.title&&c[V.id]&&!T,A=V.links.reduce((R,H)=>R+(H.badge||0),0);return o.jsxs("div",{children:[V.title&&o.jsxs("button",{type:"button",onClick:()=>B(V.id),"aria-expanded":!M,className:"mb-1 flex w-full items-center justify-between rounded-md px-3 py-1 text-[11px] font-semibold uppercase tracking-wider text-neutral-400 hover:text-neutral-600 dark:text-neutral-500 dark:hover:text-neutral-300",children:[o.jsx("span",{children:V.title}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[M&&A>0&&o.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"}),o.jsx(Oe,{name:"chevron",className:`h-3.5 w-3.5 transition-transform ${M?"":"rotate-90"}`})]})]}),!M&&o.jsx("div",{className:"space-y-0.5",children:V.links.map(R=>o.jsxs(ok,{to:R.to,end:R.end,className:q,children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[o.jsx(Oe,{name:R.icon,className:"h-[18px] w-[18px] opacity-80"}),o.jsx("span",{className:"truncate",children:R.label})]}),!!R.badge&&o.jsx("span",{className:"min-w-[20px] rounded-full bg-red-500 px-1.5 py-0.5 text-center text-[11px] font-bold leading-none text-white",children:R.badge})]},R.to))})]},V.id)})})]});return o.jsxs(SN,{onRefreshCounters:C,children:[o.jsx(CN,{}),o.jsxs(bv,{value:{fonts:g,refresh:S},children:[o.jsxs("div",{className:"flex min-h-screen bg-neutral-100/60 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[o.jsx(Sv,{}),o.jsx("aside",{className:"sticky top-0 hidden h-screen w-64 shrink-0 border-r border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900/40 lg:block",children:G}),i&&o.jsxs("div",{className:"fixed inset-0 z-40 lg:hidden",children:[o.jsx("div",{className:"absolute inset-0 bg-neutral-950/50 backdrop-blur-sm",onClick:()=>a(!1)}),o.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":"Menü",className:"absolute inset-y-0 left-0 w-72 max-w-[85vw] bg-white shadow-2xl dark:bg-neutral-900",children:[o.jsx("button",{type:"button",onClick:()=>a(!1),"aria-label":"Menü schließen",className:"absolute right-3 top-4 rounded-lg p-1.5 text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",children:o.jsx(Oe,{name:"close",className:"h-5 w-5"})}),G]})]}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx("header",{className:"sticky top-0 z-30 border-b border-neutral-200 bg-white/85 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/85",children:o.jsxs("div",{className:"flex h-16 items-center gap-3 px-4 sm:px-6",children:[o.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":"Menü öffnen",className:"-ml-1 rounded-lg p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800 lg:hidden",children:o.jsx(Oe,{name:"menu",className:"h-6 w-6"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[(F==null?void 0:F.group)&&o.jsx("p",{className:"hidden truncate text-xs font-medium text-neutral-400 sm:block",children:F.group}),o.jsx("p",{className:"truncate text-sm font-semibold text-neutral-900 dark:text-white",children:(F==null?void 0:F.label)||"Admin"})]}),o.jsx("button",{type:"button",onClick:()=>u(!0),"aria-label":"Suchen",className:"rounded-lg p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800 lg:hidden",children:o.jsx(Oe,{name:"search",className:"h-5 w-5"})}),ne&&o.jsxs("a",{href:"/?bearbeiten=1",target:"_blank",rel:"noopener noreferrer",className:xc({variant:"secondary",size:"sm",className:"hidden sm:inline-flex"}),children:[o.jsx(Oe,{name:"pencil",className:"h-4 w-4"}),"Live bearbeiten"]}),o.jsxs("a",{href:"/",target:"_blank",rel:"noopener noreferrer",title:"Website in neuem Tab öffnen",className:xc({variant:"secondary",size:"sm",className:"px-2 sm:px-3"}),children:[o.jsx(Oe,{name:"external",className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"Website"})]}),o.jsx(VN,{user:t,onLogout:se})]})}),(x||k||j.length>0)&&o.jsxs("div",{className:"border-b border-amber-200 bg-amber-50 px-4 py-2 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-200 sm:px-6",children:[x&&o.jsxs("p",{children:[o.jsx("strong",{children:"Wartungsmodus ist aktiv"})," – Besucher sehen gerade nur die Wartungsseite."," ",n("settings.manage")&&o.jsx(K,{to:"/admin/settings/maintenance",className:"underline",children:"Ändern"})]}),k&&o.jsxs("p",{children:[o.jsx("strong",{children:"Launch-Countdown läuft"})," – Besucher sehen bis"," ",new Date(k).toLocaleString("de-DE",{dateStyle:"medium",timeStyle:"short",timeZone:"Europe/Berlin"})," Uhr nur den Countdown."," ",n("settings.manage")&&o.jsx(K,{to:"/admin/settings/countdown",className:"underline",children:"Ändern"})]}),j.length>0&&o.jsxs("p",{children:[o.jsx("strong",{children:"Ausgeblendet für Besucher:"})," ",j.join(", "),"."," ",o.jsx(K,{to:"/admin",className:"underline",children:"Auf der Übersicht ändern"})]})]}),o.jsx("main",{className:"mx-auto w-full max-w-7xl flex-1 p-4 sm:p-6 lg:p-8",children:o.jsx(m.Suspense,{fallback:o.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),children:o.jsx(yd,{})})})]})]}),o.jsx(DN,{open:l,onClose:()=>u(!1),pages:P})]})]})}function ON(){const{user:e,loading:t}=$n();return t?o.jsx("div",{className:"flex min-h-screen items-center justify-center text-neutral-500",children:"Lädt…"}):e?o.jsx(yd,{}):o.jsx(ur,{to:"/admin/login",replace:!0})}function oe({permission:e,children:t}){const{hasPermission:n}=$n();return(Array.isArray(e)?e:[e]).some(i=>n(i))?t:o.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-8 text-center dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsx("h1",{className:"mb-2 text-lg font-bold text-neutral-900 dark:text-white",children:"Keine Berechtigung"}),o.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 wa(e,t,n="name"){if(!t)return;let r=document.head.querySelector(`meta[${n}="${e}"]`);r||(r=document.createElement("meta"),r.setAttribute(n,e),document.head.appendChild(r)),r.setAttribute("content",t)}function zN(e){let t=document.head.querySelector('link[rel="canonical"]');t||(t=document.createElement("link"),t.setAttribute("rel","canonical"),document.head.appendChild(t)),t.setAttribute("href",`https://hifi-planet.de${e}`),wa("og:url",`https://hifi-planet.de${e}`,"property")}function yp(e){let t=document.head.querySelector('meta[name="robots"]');if(!e){t==null||t.remove();return}t||(t=document.createElement("meta"),t.setAttribute("name","robots"),document.head.appendChild(t)),t.setAttribute("content","noindex")}function gr({title:e,description:t,path:n,noindex:r=!1}){m.useEffect(()=>(yp(r),()=>yp(!1)),[r]),m.useEffect(()=>{e&&(document.title=`${e} | HifiPlanet`,wa("og:title",`${e} | HifiPlanet`,"property")),t&&(wa("description",t),wa("og:description",t,"property")),n&&zN(n)},[e,t,n])}const BN=[.16,1,.3,1],vp={up:{y:40},left:{x:-56},right:{x:56}};function $N(e){return{hidden:{opacity:0,scale:.96,filter:"blur(8px)",...vp[e]||vp.up},visible:{opacity:1,scale:1,x:0,y:0,filter:"blur(0px)"}}}const HN={hidden:{x:"-130%"},visible:{x:"230%",transition:{duration:1.1,ease:"easeInOut",delay:.4}}};function Ue({children:e,direction:t="up",className:n="",index:r=0,shine:s=!1,style:i}){const a=Math.min(r*.09,.45);return o.jsxs(nn.div,{className:n,style:{position:"relative",overflow:"hidden",...i},initial:"hidden",whileInView:"visible",viewport:{once:!0,amount:.25,margin:"-100px"},variants:$N(t),transition:{duration:.75,ease:BN,delay:a},children:[e,s&&o.jsx(nn.div,{"aria-hidden":!0,variants:HN,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"})]})}const Oo=e=>{e.preventDefault(),e.stopPropagation()};function UN(e){e.preventDefault();const t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)}function ce({entity:e,id:t,field:n,lang:r,value:s,as:i="span",multiline:a=!1,placeholder:l="Text eingeben…",className:u="",...c}){const{language:d}=xe(),f=Xe(),h=r||d,g=f.getValue(e,t,n,h,s??"")??"";if(!f.canEdit(e))return o.jsx(i,{className:u,...c,children:g});const v=b=>{const w=a?b.innerText.replace(/\n{3,}/g,` + */const aP=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],oP=te("zap",aP),ev=m.createContext(null);function lP(){const e=new Date,t=e.getHours()+e.getMinutes()/60;return t>=6.5&&t<21?"light":"dark"}function uP({children:e}){const[t,n]=m.useState(()=>{const s=localStorage.getItem("hifi-theme");return s==="light"||s==="dark"?s:lP()});m.useEffect(()=>{document.documentElement.classList.toggle("dark",t==="dark"),localStorage.setItem("hifi-theme",t)},[t]);const r=()=>n(s=>s==="dark"?"light":"dark");return o.jsx(ev.Provider,{value:{theme:t,toggleTheme:r},children:e})}function tv(){return m.useContext(ev)}const cP={nav:{mainNav:"Hauptnavigation",menu:"Menü",call:"Anrufen",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",downloads:"Downloads"},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:e=>`© ${e} HifiPlanet. Alle Angaben ohne Gewähr.`,imprint:"Impressum",privacy:"Datenschutz",terms:"AGB",downloads:"Downloads",cookieSettings:"Cookie-Einstellungen"},cookieConsent:{bannerText:"Wir verwenden nur technisch notwendige Cookies. Für Google Maps 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 (Kontaktseite). 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.",login:"Anmelden"},countdown:{eyebrow:"Neue Website",title:"Bald wird’s laut.",message:"Wir drehen gerade die letzten Schrauben fest. Unsere neue Website mit allen Paketen für dein Fahrzeug startet in Kürze.",days:"Tage",hours:"Stunden",minutes:"Minuten",seconds:"Sekunden",launchPrefix:"Start",launchAt:"um",clock:"Uhr",addToCalendar:"In den Kalender",calendarTitle:"Launch der neuen HifiPlanet-Website",questions:"Fragen vorab?",liveEyebrow:"Jetzt online",liveTitle:"Wir sind live!",liveMessage:"Einen Moment, die Seite öffnet sich …",preview:"Vorschau – nur für dich sichtbar",closePreview:"Vorschau schließen",adminActive:"Countdown aktiv – Besucher sehen bis {date} nur den Teaser.",adminPreview:"Vorschau ansehen"},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:(e,t)=>`${e.toFixed(1).replace(".",",")} von ${t} 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:{loading:"Marken werden geladen…",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."},vehicleSearch:{label:"Fahrzeug direkt suchen",placeholder:"Direkt suchen, z. B. Golf 7 oder BMW 3er",clear:"Suche leeren",loading:"Suche läuft…",noResults:"Kein passendes Fahrzeug gefunden.",contact:"Frag uns einfach direkt.",allModels:"Alle Modelle"},brandPage:{metaTitleFallback:"Modell auswählen",metaDescription:e=>`Wähle dein ${e} 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:{customRequest:"Individuell anfragen",customHint:"Nicht das Passende dabei? Wir stellen dir gerne ein Paket nach deinen Wünschen zusammen.",whatsappText:(e,t)=>`Hallo HifiPlanet, ich interessiere mich für einen Car-Hifi-Umbau für meinen ${e} ${t}.`,metaTitleFallback:"Sound-Pakete",metaTitle:(e,t)=>`${e} ${t} Sound-Pakete`,metaDescription:(e,t)=>`Car-Hifi Sound-Pakete für ${e} ${t} 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",badges:{recommended:"Empfohlen",popular:"Am beliebtesten",tip:"Tipp",coming_soon:"Coming soon"},videoLink:"Zum Video",moreBullets:e=>e===1?"+ 1 weitere Leistung":`+ ${e} weitere Leistungen`,showMore:"Mehr anzeigen",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:{sendAnother:"Weitere Anfrage senden",vehicleBoxTitle:"Dein Fahrzeug:",privacyPre:"Mit dem Absenden stimmst du zu, dass wir deine Angaben zur Bearbeitung der Anfrage verwenden. Mehr dazu in der ",privacyLink:"Datenschutzerklärung",privacyPost:".",mapIframeTitle:"Standort von HifiPlanet in Amorbach auf Google Maps",whatsappText:(e,t,n)=>`Hallo HifiPlanet, ich interessiere mich für das Paket "${n}" für meinen ${e} ${t}.`,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:e=>`${e} Umbauten`,metaDescription:e=>`Einblicke in unsere ${e} Car-Hifi Umbauten.`,loading:"Lädt…",breadcrumbGallery:"Galerie",titleSuffix:"Projekt wählen",empty:"Für diese Marke sind noch keine Projekte hinterlegt."},galleryProjectPage:{ctaTitle:"So etwas für dein Auto?",ctaText:"Erzähl uns von deinem Fahrzeug – wir planen einen ähnlichen Umbau für dich.",ctaButton:"Ähnlichen Umbau anfragen",ctaTopic:e=>`Mich interessiert ein ähnlicher Umbau wie "${e}" aus eurer Galerie.`,metaTitleFallback:"Bildergalerie",metaDescription:e=>`Fotos unseres ${e} Umbaus.`,loading:"Lädt…",breadcrumbGallery:"Galerie",empty:"Für dieses Projekt sind noch keine Fotos hinterlegt.",enlargeImage:"Bild vergrößern"},downloadsPage:{metaTitle:"Downloads",metaDescription:"Dateien und Songs von HifiPlanet zum Anhören und Herunterladen.",title:"Downloads",intro:"Hier stellen wir dir Dateien und Songs bereit – direkt anhören oder herunterladen.",loading:"Lädt…",empty:"Aktuell stehen keine Downloads bereit.",download:"Herunterladen",lockedTitle:"Geschützter Bereich",lockedText:"Bitte gib das Passwort ein, das du von uns bekommen hast.",passwordLabel:"Passwort",unlock:"Freischalten",unlocking:"Wird geprüft…",wrongPassword:"Das Passwort stimmt leider nicht."},errors:{generic:"Da ist etwas schiefgelaufen. Bitte versuche es noch einmal.",network:"Keine Verbindung zum Server. Bitte prüfe deine Internetverbindung.",notFound:"Diese Seite gibt es nicht (mehr).",rateLimited:"Zu viele Anfragen in kurzer Zeit. Bitte versuche es später noch einmal oder ruf uns an.",invalidInput:"Bitte gib deinen Namen und eine gültige E-Mail-Adresse an.",server:"Auf dem Server ist ein Fehler aufgetreten. Bitte versuche es später noch einmal.",maintenance:"Dieser Bereich wird gerade überarbeitet. Bitte schau später wieder vorbei."},notFound:{metaTitle:"Seite nicht gefunden",title:"Diese Seite haben wir nicht gefunden",text:"Vielleicht ist der Link veraltet oder hat einen Tippfehler. Hier geht es direkt weiter:",toVehicles:"Fahrzeug wählen",toContact:"Kontakt aufnehmen",toHome:"Zur Startseite"}},dP={nav:{mainNav:"Main navigation",menu:"Menu",call:"Call",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",downloads:"Downloads"},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:e=>`© ${e} HifiPlanet. All information without guarantee.`,imprint:"Legal notice",privacy:"Privacy",terms:"Terms",downloads:"Downloads",cookieSettings:"Cookie settings"},cookieConsent:{bannerText:"We only use technically necessary cookies. For Google Maps 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 (contact page). Loading it 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.",login:"Log in"},countdown:{eyebrow:"New website",title:"Things are about to get loud.",message:"We are tightening the last screws. Our new website with every package for your vehicle launches shortly.",days:"Days",hours:"Hours",minutes:"Minutes",seconds:"Seconds",launchPrefix:"Launch",launchAt:"at",clock:"",addToCalendar:"Add to calendar",calendarTitle:"Launch of the new HifiPlanet website",questions:"Questions?",liveEyebrow:"Now online",liveTitle:"We are live!",liveMessage:"One moment, the site is opening …",preview:"Preview – only visible to you",closePreview:"Close preview",adminActive:"Countdown active – visitors only see the teaser until {date}.",adminPreview:"Open preview"},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:(e,t)=>`Rated ${e.toFixed(1)} by ${t} 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:{loading:"Loading brands…",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."},vehicleSearch:{label:"Search for your vehicle",placeholder:"Search directly, e.g. Golf 7 or BMW 3 Series",clear:"Clear search",loading:"Searching…",noResults:"No matching vehicle found.",contact:"Just ask us directly.",allModels:"All models"},brandPage:{metaTitleFallback:"Select a model",metaDescription:e=>`Choose your ${e} 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:{customRequest:"Request a custom setup",customHint:"Nothing quite right? We will happily put together a package to suit you.",whatsappText:(e,t)=>`Hello HifiPlanet, I am interested in a car audio upgrade for my ${e} ${t}.`,metaTitleFallback:"Sound packages",metaTitle:(e,t)=>`${e} ${t} sound packages`,metaDescription:(e,t)=>`Car-hifi sound packages for the ${e} ${t} 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",badges:{recommended:"Recommended",popular:"Most popular",tip:"Tip",coming_soon:"Coming soon"},videoLink:"Watch video",moreBullets:e=>e===1?"+ 1 more feature":`+ ${e} more features`,showMore:"Show more",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:{sendAnother:"Send another request",vehicleBoxTitle:"Your vehicle:",privacyPre:"By sending this form you agree that we use your details to handle your request. Learn more in our ",privacyLink:"privacy policy",privacyPost:".",mapIframeTitle:"HifiPlanet location in Amorbach on Google Maps",whatsappText:(e,t,n)=>`Hello HifiPlanet, I am interested in the "${n}" package for my ${e} ${t}.`,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:e=>`${e} installations`,metaDescription:e=>`A look at our ${e} car-hifi installations.`,loading:"Loading…",breadcrumbGallery:"Gallery",titleSuffix:"Select a project",empty:"No projects have been added for this brand yet."},galleryProjectPage:{ctaTitle:"Want something like this for your car?",ctaText:"Tell us about your vehicle and we will plan a similar build for you.",ctaButton:"Request a similar build",ctaTopic:e=>`I am interested in a build similar to "${e}" from your gallery.`,metaTitleFallback:"Photo gallery",metaDescription:e=>`Photos of our ${e} installation.`,loading:"Loading…",breadcrumbGallery:"Gallery",empty:"No photos have been added for this project yet.",enlargeImage:"Enlarge image"},downloadsPage:{metaTitle:"Downloads",metaDescription:"Files and songs from HifiPlanet to listen to and download.",title:"Downloads",intro:"Here you will find files and songs we provide for you – listen right here or download them.",loading:"Loading…",empty:"There are no downloads available right now.",download:"Download",lockedTitle:"Protected area",lockedText:"Please enter the password you received from us.",passwordLabel:"Password",unlock:"Unlock",unlocking:"Checking…",wrongPassword:"Sorry, that password is not correct."},errors:{generic:"Something went wrong. Please try again.",network:"No connection to the server. Please check your internet connection.",notFound:"This page does not exist (anymore).",rateLimited:"Too many requests in a short time. Please try again later or give us a call.",invalidInput:"Please enter your name and a valid email address.",server:"A server error occurred. Please try again later.",maintenance:"This section is being updated. Please check back later."},notFound:{metaTitle:"Page not found",title:"We could not find this page",text:"The link may be outdated or contain a typo. Continue here:",toVehicles:"Choose your vehicle",toContact:"Get in touch",toHome:"Back to the homepage"}},Sn={de:cP,en:dP},nv=m.createContext(null);function fP({children:e}){const[t,n]=m.useState(null),[r,s]=m.useState(!0);m.useEffect(()=>{ae.get("/auth/me").then(h=>n(h.authenticated===!1?null:h)).catch(()=>n(null)).finally(()=>s(!1))},[]);const i=async(h,g)=>{const y=await ae.post("/auth/login",{username:h,password:g});return y.requires_2fa?{requires2fa:!0,method:y.method||"totp",methods:y.methods||[y.method||"totp"],emailHint:y.email_hint||""}:(n(y),{requires2fa:!1})},a=async h=>{const g=await ae.post("/auth/verify-2fa",{code:h});n(g)},l=()=>ae.post("/auth/resend-code",{}),u=h=>ae.post("/auth/2fa-method",{method:h}),c=async()=>{await ae.post("/auth/logout",{}),n(null)},d=async()=>{const h=await ae.get("/auth/me");n(h.authenticated===!1?null:h)},f=h=>{var g;return!!t&&(t.is_super_admin||((g=t.permissions)==null?void 0:g.includes(h)))};return o.jsx(nv.Provider,{value:{user:t,loading:r,login:i,verifyTwoFactor:a,resendLoginCode:l,switchTwoFactorMethod:u,logout:c,refreshUser:d,hasPermission:f},children:e})}function $n(){return m.useContext(nv)}const Al={home_sections:"content.manage",faqs:"content.manage",partners:"content.manage",text:"content.manage",site_images:"content.manage",services:"services.manage",packages:"packages.manage",brands:"brands.manage",car_models:"models.manage",gallery_brands:"gallery.manage",gallery_projects:"gallery.manage",gallery_photos:"gallery.manage",legal_pages:"settings.manage"},gc="hifi-live-edit",hP={de:{},en:{}},vs=(e,t,n,r)=>`${e}|${t}|${n}|${r}`;function mP(){try{const e=new URLSearchParams(window.location.search);if(e.get("bearbeiten")==="1"){sessionStorage.setItem(gc,"1"),e.delete("bearbeiten");const t=e.toString();return window.history.replaceState(window.history.state,"",window.location.pathname+(t?`?${t}`:"")+window.location.hash),!0}return sessionStorage.getItem(gc)==="1"}catch{return!1}}const Wn=()=>{},rv=m.createContext({available:!1,enabled:!1,setEnabled:Wn,canEdit:()=>!1,getValue:(e,t,n,r,s)=>s,setValue:Wn,resetValue:Wn,hasPending:()=>!1,textOverride:()=>{},trackTextKey:Wn,usedTextKeys:()=>[],pendingCount:0,saving:!1,error:"",save:async()=>{},discard:Wn,editor:null,openEditor:Wn,closeEditor:Wn});function Dl({serverOverrides:e,children:t}){const{user:n,hasPermission:r}=$n(),s=!!n&&Object.values(Al).some(A=>r(A)),[i,a]=m.useState(mP),l=s&&i,[u,c]=m.useState({}),[d,f]=m.useState({}),[h,g]=m.useState(!1),[y,b]=m.useState(""),[w,p]=m.useState(null),x=m.useRef(l);x.current=l;const v=m.useRef(new Map),k=m.useCallback(A=>{a(A);try{sessionStorage.setItem(gc,A?"1":"0")}catch{}A||p(null)},[]),E=m.useCallback(A=>l&&!!Al[A]&&r(Al[A]),[l,r]),C=m.useCallback((A,R,H,_,I)=>{const Y=vs(A,R,H,_);return Y in u?u[Y]:Y in d?d[Y]:I},[u,d]),j=m.useCallback((A,R,H,_,I)=>{b(""),c(Y=>({...Y,[vs(A,R,H,_)]:I}))},[]),S=m.useCallback((A,R,H,_)=>{c(I=>{const Y=vs(A,R,H,_);if(!(Y in I))return I;const Z={...I};return delete Z[Y],Z})},[]),N=m.useCallback((A,R,H,_)=>vs(A,R,H,_)in u,[u]),P=e||hP,F=m.useCallback((A,R)=>{var I;const H=vs("text",R,"value",A),_=H in u?u[H]:H in d?d[H]:(I=P[A])==null?void 0:I[R];return _||void 0},[u,d,P]),B=m.useCallback(A=>{if(!x.current)return;const R=window.location.pathname,H=v.current.get(A);H?H.add(R):v.current.set(A,new Set([R]))},[]),se=m.useCallback(A=>{const R=[];return v.current.forEach((H,_)=>{H.has(A)&&R.push(_)}),R.sort()},[]),ne=Object.keys(u).length,q=m.useCallback(async()=>{const A=Object.entries(u);if(!A.length)return;const R=A.map(([H,_])=>{const[I,Y,Z,ue]=H.split("|");return{entity:I,id:Y,field:Z,lang:ue,value:_??""}});g(!0),b("");try{await ae.put("/live-edit",{changes:R}),f(H=>({...H,...u})),c({})}catch(H){b(H.status===401?"Deine Anmeldung ist abgelaufen. Bitte im Admin-Bereich neu anmelden, die Änderungen bleiben hier so lange erhalten.":H.message)}finally{g(!1)}},[u]),G=m.useCallback(()=>{c({}),b(""),p(null)},[]),V=m.useCallback(A=>p(A),[]),T=m.useCallback(()=>p(null),[]);m.useEffect(()=>{if(!ne)return;const A=R=>{R.preventDefault(),R.returnValue=""};return window.addEventListener("beforeunload",A),()=>window.removeEventListener("beforeunload",A)},[ne]);const M=m.useMemo(()=>({available:s,enabled:l,setEnabled:k,canEdit:E,getValue:C,setValue:j,resetValue:S,hasPending:N,textOverride:F,trackTextKey:B,usedTextKeys:se,pendingCount:ne,saving:h,error:y,save:q,discard:G,editor:w,openEditor:V,closeEditor:T}),[s,l,k,E,C,j,S,N,F,B,se,ne,h,y,q,G,w,V,T]);return o.jsx(rv.Provider,{value:M,children:t})}function Xe(){return m.useContext(rv)}function pP(){const e=localStorage.getItem("hifi-lang");return e==="de"||e==="en"?e:(navigator.language||"de").toLowerCase().startsWith("de")?"de":"en"}function va(e,t){return t.split(".").reduce((n,r)=>n==null?void 0:n[r],e)}const sv=m.createContext({language:"de",setLanguage:()=>{},toggleLanguage:()=>{},t:e=>{const t=va(Sn.de,e);return t!==void 0?t:e}});function Rl({children:e}){const[t,n]=m.useState(pP),{textOverride:r,trackTextKey:s}=Xe();m.useEffect(()=>{document.documentElement.setAttribute("lang",t),localStorage.setItem("hifi-lang",t)},[t]);const i=()=>n(l=>l==="de"?"en":"de"),a=l=>{const u=Sn[t]||Sn.de,c=va(u,l);if(typeof c=="string"||c===void 0&&typeof va(Sn.de,l)=="string"){s(l);const f=r(t,l);if(f!==void 0)return f}if(c!==void 0)return c;const d=va(Sn.de,l);return d!==void 0?d:l};return o.jsx(sv.Provider,{value:{language:t,setLanguage:n,toggleLanguage:i,t:a},children:e})}function xe(){return m.useContext(sv)}function gP({overHero:e=!1,forceDark:t=!1}){const{theme:n,toggleTheme:r}=tv(),{t:s}=xe();return o.jsx("button",{onClick:r,"aria-label":s("themeToggle.label"),className:`rounded-full p-2 transition ${e?"text-white hover:bg-white/10":t?"text-neutral-300 hover:bg-neutral-800":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:n==="dark"?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:o.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"})}):o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:o.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"})})})}const Qd=m.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,page_loader_enabled:1,package_card_width:210,package_card_height:480,vehicle_tile_width:240,vehicle_tile_height:180,hidden_areas:[]}),xP=Qd.Provider;function Pt(){return m.useContext(Qd)}function Do(){const{hidden_areas:e}=m.useContext(Qd);return t=>(e||[]).includes(t)}const Jd="/assets/logo-dark-R-ckaBhx.png",iv=e=>(e||"").replace(/[^\d+]/g,""),fi=e=>`tel:${iv(e)}`,ef=(e,t="")=>`https://wa.me/${iv(e).replace(/^0/,"49").replace("+","")}${t?`?text=${encodeURIComponent(t)}`:""}`;function An(e,t={}){typeof window>"u"||typeof window.gtag!="function"||window.gtag("event",e,t)}const yP="https://www.audio4cars.de/",ip=70,vP=500;function wP({className:e}){return o.jsxs("svg",{viewBox:"0 0 3 2",className:e,"aria-hidden":"true",children:[o.jsx("rect",{width:"3",height:"0.667",y:"0",fill:"#000"}),o.jsx("rect",{width:"3",height:"0.667",y:"0.667",fill:"#D00"}),o.jsx("rect",{width:"3",height:"0.666",y:"1.334",fill:"#FFCE00"})]})}function bP({className:e}){return o.jsxs("svg",{viewBox:"0 0 60 30",className:e,"aria-hidden":"true",children:[o.jsx("clipPath",{id:"fgb-t",children:o.jsx("path",{d:"M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"})}),o.jsx("path",{d:"M0,0 v30 h60 v-30 z",fill:"#00247d"}),o.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#fff",strokeWidth:"6"}),o.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",clipPath:"url(#fgb-t)",stroke:"#cf142b",strokeWidth:"4"}),o.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#fff",strokeWidth:"10"}),o.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#cf142b",strokeWidth:"6"})]})}const Il=[{code:"de",label:"Deutsch",Flag:wP},{code:"en",label:"English",Flag:bP}];function kP({overHero:e=!1}){const{language:t,setLanguage:n,t:r}=xe(),[s,i]=m.useState(!1),a=m.useRef(null),l=Il.find(u=>u.code===t)||Il[0];return m.useEffect(()=>{if(!s)return;const u=d=>{a.current&&!a.current.contains(d.target)&&i(!1)},c=d=>{d.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",c)}},[s]),o.jsxs("div",{className:"relative",ref:a,children:[o.jsxs("button",{type:"button",onClick:()=>i(u=>!u),"aria-haspopup":"listbox","aria-expanded":s,"aria-label":r("languageToggle.label"),className:`flex items-center gap-1 rounded-full p-1.5 transition ${e?"hover:bg-white/10":"hover:bg-neutral-800"}`,children:[o.jsx("span",{className:`block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ${e?"ring-white/50":"ring-neutral-600"}`,children:o.jsx(l.Flag,{className:"h-full w-full"})}),o.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:`h-3 w-3 transition-transform ${e?"text-white/70":"text-neutral-400"} ${s?"rotate-180":""}`,children:o.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&&o.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-2 min-w-[9rem] overflow-hidden rounded-lg border border-neutral-700 bg-neutral-900 py-1 shadow-lg",children:Il.map(u=>o.jsxs("button",{type:"button",role:"option","aria-selected":u.code===t,onClick:()=>{n(u.code),i(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition hover:bg-neutral-800 ${u.code===t?"font-semibold text-brand-400":"text-neutral-200"}`,children:[o.jsx("span",{className:"block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ring-neutral-600",children:o.jsx(u.Flag,{className:"h-full w-full"})}),u.label]},u.code))})]})}function SP(){const[e,t]=m.useState(!1),[n,r]=m.useState(!1),[s,i]=m.useState(!1),{user:a}=$n(),{phone:l,whatsapp:u,logo_dark_path:c,has_downloads:d}=Pt(),f=Do(),{t:h}=xe(),g=!f("page.vehicles"),y=!f("page.services"),b=!f("page.gallery"),w=d&&!f("page.downloads"),p=3+[g,y,b,w,l,u].filter(Boolean).length,v=Ye().pathname==="/",[k,E]=m.useState(!v);m.useEffect(()=>{if(!v){E(!0);return}const G=()=>E(window.scrollY>24);return G(),window.addEventListener("scroll",G,{passive:!0}),()=>window.removeEventListener("scroll",G)},[v]);const C=v&&!k,j=m.useRef(null),S=m.useRef(null);m.useEffect(()=>{if(!e)return;const G=document.body.style.overflow;document.body.style.overflow="hidden";const V=setTimeout(()=>{var M,A;return(A=(M=j.current)==null?void 0:M.querySelector("button, a"))==null?void 0:A.focus()},50),T=M=>{if(M.key==="Escape"){t(!1);return}if(M.key!=="Tab"||!j.current)return;const A=[...j.current.querySelectorAll("a[href], button")];if(!A.length)return;const R=A[0],H=A[A.length-1];M.shiftKey&&document.activeElement===R?(M.preventDefault(),H.focus()):!M.shiftKey&&document.activeElement===H&&(M.preventDefault(),R.focus())};return document.addEventListener("keydown",T),()=>{var M;clearTimeout(V),document.body.style.overflow=G,document.removeEventListener("keydown",T),(M=S.current)==null||M.focus({preventScroll:!0})}},[e]),m.useEffect(()=>{if(e){r(!0);let T;const M=requestAnimationFrame(()=>{T=requestAnimationFrame(()=>i(!0))});return()=>{cancelAnimationFrame(M),T&&cancelAnimationFrame(T)}}i(!1);const G=vP+(p-1)*ip,V=setTimeout(()=>r(!1),G);return()=>clearTimeout(V)},[e,p]);const N=()=>`transition-all duration-500 ease-out ${s?"opacity-100":"opacity-0"}`,P=G=>({transitionDelay:`${(s?G:p-1-G)*ip}ms`,transform:s?"translateY(0)":"translateY(-140px)"}),F=a&&o.jsx(K,{to:"/admin","aria-label":h("nav.adminPanel"),title:h("nav.adminPanel"),className:`rounded-full p-2 transition ${C?"text-white hover:bg-white/10":"text-neutral-300 hover:bg-neutral-800"}`,children:o.jsx(CT,{className:"h-5 w-5"})}),B=Xe(),se=B.available&&o.jsx("button",{type:"button",onClick:()=>B.setEnabled(!B.enabled),"aria-pressed":B.enabled,"aria-label":"Seite bearbeiten",title:B.enabled?"Bearbeiten beenden":"Seite bearbeiten",className:`rounded-full p-2 transition ${B.enabled?"bg-brand-500 text-white hover:bg-brand-600":C?"text-white hover:bg-white/10":"text-neutral-300 hover:bg-neutral-800"}`,children:o.jsx(Jy,{className:"h-5 w-5"})});let ne=0;const q=()=>P(ne++);return o.jsxs("header",{className:`sticky top-0 z-30 border-b transition-colors duration-300 ${C?"border-transparent bg-transparent":"border-neutral-800 bg-neutral-950/90 backdrop-blur"}`,children:[o.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:[o.jsx("div",{className:"flex items-center justify-self-start",children:o.jsx("button",{ref:S,onClick:()=>t(!0),"aria-label":h("nav.openMenu"),"aria-expanded":e,"aria-haspopup":"dialog",className:`rounded-md p-2 transition ${C?"text-white hover:bg-white/10":"text-neutral-300 hover:bg-neutral-800"}`,children:o.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:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})}),o.jsx(K,{to:"/",className:"flex items-center justify-self-center rounded-lg px-2 py-1",children:o.jsx("img",{src:c||Jd,alt:"HifiPlanet",className:"h-14 w-auto sm:h-16"})}),o.jsxs("div",{className:"flex items-center justify-self-end gap-1",children:[se,F,!e&&o.jsx(kP,{overHero:C}),o.jsx(gP,{overHero:C,forceDark:!0})]})]}),n&&hd.createPortal(o.jsx("div",{ref:j,role:"dialog","aria-modal":"true","aria-label":h("nav.menu"),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:o.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:[o.jsxs("button",{onClick:()=>t(!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:[o.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:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})}),o.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:h("nav.close")})]}),g&&o.jsx(K,{to:"/fahrzeuge",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.vehicles")}),y&&o.jsx(K,{to:"/leistungen",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.services")}),b&&o.jsx(K,{to:"/galerie",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.gallery")}),o.jsx(K,{to:"/kontakt",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.contact")}),w&&o.jsx(K,{to:"/downloads",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${N()}`,style:q(),children:h("nav.downloads")}),o.jsx("div",{className:`h-px w-16 bg-brand-500/60 ${N()}`,style:q()}),l&&o.jsxs("a",{href:fi(l),onClick:()=>An("contact_call"),className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${N()}`,style:q(),children:[o.jsx(dr,{className:"h-4 w-4"}),l]}),u&&o.jsxs("a",{href:ef(u),onClick:()=>An("contact_whatsapp"),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 ${N()}`,style:q(),children:[o.jsx(Qy,{className:"h-4 w-4"}),h("nav.whatsapp")]}),o.jsxs("a",{href:yP,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 ${N()}`,style:q(),children:[o.jsx(QT,{className:"h-4 w-4"}),h("nav.shop")]})]})}),document.body)]})}const ap="hifiplanet-cookie-consent",av={necessary:!0,external:!1,analytics:!1},ov=m.createContext({consent:av,decided:!1,settingsOpen:!1,acceptAll:()=>{},rejectNonEssential:()=>{},saveCustom:()=>{},openSettings:()=>{},closeSettings:()=>{}});function jP({children:e}){const[t,n]=m.useState(av),[r,s]=m.useState(!1),[i,a]=m.useState(!1);m.useEffect(()=>{try{const g=localStorage.getItem(ap);if(g){const y=JSON.parse(g);n({necessary:!0,external:!!y.external,analytics:!!y.analytics}),s(!0)}}catch{}},[]);const l=m.useCallback(g=>{n(g),s(!0),a(!1),localStorage.setItem(ap,JSON.stringify({...g,decidedAt:new Date().toISOString()}))},[]),u=m.useCallback(()=>l({necessary:!0,external:!0,analytics:!0}),[l]),c=m.useCallback(()=>l({necessary:!0,external:!1,analytics:!1}),[l]),d=m.useCallback(g=>l({necessary:!0,external:!!g.external,analytics:!!g.analytics}),[l]),f=m.useCallback(()=>a(!0),[]),h=m.useCallback(()=>a(!1),[]);return o.jsx(ov.Provider,{value:{consent:t,decided:r,settingsOpen:i,acceptAll:u,rejectNonEssential:c,saveCustom:d,openSettings:f,closeSettings:h},children:e})}function ls(){return m.useContext(ov)}const EP=["mon","tue","wed","thu","fri","sat","sun"],CP=["sun","mon","tue","wed","thu","fri","sat"],Vl={mon:"Mo",tue:"Di",wed:"Mi",thu:"Do",fri:"Fr",sat:"Sa",sun:"So"};function TP(e){const t=new Date,n=e==null?void 0:e[CP[t.getDay()]];if(!n||n.closed||!n.open||!n.close)return!1;const r=t.getHours()*60+t.getMinutes(),[s,i]=n.open.split(":").map(Number),[a,l]=n.close.split(":").map(Number);return r>=s*60+i&&r{const s=PP(e==null?void 0:e[r])||t,i=n[n.length-1];i&&i.label===s?i.days=`${i.firstLabel}-${Vl[r]}`:n.push({key:r,days:Vl[r],firstLabel:Vl[r],label:s})}),n}const NP=e=>(e||"").replace(/[^\d+]/g,"");function _P(){const{phone:e,contact_email:t,address_street:n,address_zip:r,address_city:s,business_hours:i,has_downloads:a}=Pt(),l=Do(),u=a&&!l("page.downloads"),c=TP(i),{openSettings:d}=ls(),{pathname:f}=Ye(),h=f==="/",{t:g}=xe(),y=[n,[r,s].filter(Boolean).join(" ")].filter(Boolean).join(", "),b=`https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(y)}`,w=lv(i,g("footer.closed"));return o.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 ${h?"pb-24":""}`,children:[o.jsxs("div",{className:"mx-auto grid max-w-6xl gap-4 px-4 sm:grid-cols-3 sm:px-6",children:[o.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[o.jsx(Zy,{className:"h-4 w-4 text-brand-500"}),o.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:"HifiPlanet"})]}),n&&o.jsx("p",{children:n}),(r||s)&&o.jsx("p",{children:[r,s].filter(Boolean).join(" ")}),o.jsxs("a",{href:b,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:[o.jsx(FT,{className:"h-3.5 w-3.5"}),g("footer.routePlan")]})]}),o.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[o.jsx(dr,{className:"h-4 w-4 text-brand-500"}),o.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:g("footer.contactHeading")})]}),o.jsx("p",{children:o.jsx("a",{href:`tel:${NP(e)}`,className:"inline-block py-1 hover:text-brand-500",children:e})}),o.jsx("p",{children:o.jsx("a",{href:`mailto:${t}`,className:"inline-block py-1 hover:text-brand-500",children:t})}),o.jsx(K,{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:g("footer.contactForm")})]}),o.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Yy,{className:"h-4 w-4 text-brand-500"}),o.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:g("footer.hoursHeading")})]}),o.jsxs("span",{className:`flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-semibold ${c?"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:[o.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${c?"bg-green-500":"bg-neutral-400"}`}),g(c?"footer.open":"footer.closed")]})]}),o.jsx("dl",{className:"space-y-1.5",children:w.map(p=>o.jsxs("div",{className:"flex items-center justify-between gap-3",children:[o.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:p.days}),o.jsx("dd",{className:"font-medium text-neutral-700 dark:text-neutral-200",children:p.label})]},p.key))})]})]}),o.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:o.jsxs("p",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[o.jsx("span",{children:g("footer.copyright")(new Date().getFullYear())}),o.jsx("span",{children:"·"}),o.jsx(K,{to:"/impressum",className:"hover:text-brand-500",children:g("footer.imprint")}),o.jsx("span",{children:"·"}),o.jsx(K,{to:"/datenschutz",className:"hover:text-brand-500",children:g("footer.privacy")}),o.jsx("span",{children:"·"}),o.jsx(K,{to:"/agb",className:"hover:text-brand-500",children:g("footer.terms")}),o.jsx("span",{children:"·"}),u&&o.jsxs(o.Fragment,{children:[o.jsx(K,{to:"/downloads",className:"hover:text-brand-500",children:g("footer.downloads")}),o.jsx("span",{children:"·"})]}),o.jsx("button",{type:"button",onClick:d,className:"hover:text-brand-500",children:g("footer.cookieSettings")})]})})]})}function MP(){const{scrollYProgress:e}=Hy(),t=RC(e,{stiffness:200,damping:30,restDelta:.001});return o.jsx(nn.div,{style:{scaleX:t},className:"fixed left-0 top-0 z-40 h-0.5 w-full origin-left bg-brand-500"})}const LP=()=>o.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:o.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 ji({message:e,fullScreen:t=!1}){const{t:n}=xe(),r=o.jsxs("div",{className:"mx-auto max-w-md text-center",children:[o.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:o.jsx(LP,{})}),o.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:n("maintenance.title")}),o.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:e||n("maintenance.defaultMessage")})]});return t?o.jsxs("div",{className:"relative flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950",children:[r,o.jsxs(K,{to:"/admin/login","aria-label":n("maintenance.login"),title:n("maintenance.login"),className:"fixed bottom-4 right-4 flex items-center gap-2 rounded-full border border-neutral-200 bg-white px-3 py-2 text-sm font-medium text-neutral-600 shadow-sm transition hover:border-brand-500 hover:text-brand-600 dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-300 dark:hover:text-brand-400",children:[o.jsx(Xy,{className:"h-4 w-4"}),n("maintenance.login")]})]}):o.jsx("div",{className:"mx-auto max-w-6xl px-4 py-20 sm:px-6",children:r})}const op=o.jsx(o.Fragment,{children:'Wartungsmodus aktiv – Besucher sehen aktuell eine Wartungsmeldung. Du siehst diese Seite nur, weil du die Berechtigung "Wartungsmodus umgehen" hast.'});function Ei({inline:e=!1}){return e?o.jsx("div",{className:"mb-8 rounded-lg bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:op}):o.jsx("div",{className:"bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:op})}const lp='a[href], button:not([disabled]), input:not([disabled]), select, textarea, [tabindex]:not([tabindex="-1"])';function Ci(e,t,n){m.useEffect(()=>{if(!t)return;const r=document.activeElement,s=document.body.style.overflow;document.body.style.overflow="hidden";const i=setTimeout(()=>{var l,u;return(u=(l=e.current)==null?void 0:l.querySelector(lp))==null?void 0:u.focus()},30),a=l=>{if(l.key==="Escape"){l.stopPropagation(),n==null||n();return}if(l.key!=="Tab"||!e.current)return;const u=[...e.current.querySelectorAll(lp)];if(!u.length)return;const c=u[0],d=u[u.length-1];l.shiftKey&&document.activeElement===c?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),c.focus())};return document.addEventListener("keydown",a),()=>{clearTimeout(i),document.body.style.overflow=s,document.removeEventListener("keydown",a),r instanceof HTMLElement&&r.focus({preventScroll:!0})}},[t,e])}function AP({onClose:e}){const{consent:t,saveCustom:n}=ls(),[r,s]=m.useState(t.external),[i,a]=m.useState(t.analytics),{t:l}=xe(),u=m.useRef(null);return Ci(u,!0,e),o.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:e,children:o.jsxs("div",{ref:u,role:"dialog","aria-modal":"true","aria-label":l("cookieConsent.modalTitle"),className:"w-full max-w-md rounded-xl bg-white p-6 dark:bg-neutral-900",onClick:c=>c.stopPropagation(),children:[o.jsx("h2",{className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:l("cookieConsent.modalTitle")}),o.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:[l("cookieConsent.modalIntro")," ",o.jsx(K,{to:"/datenschutz",className:"underline hover:text-brand-500",onClick:e,children:l("cookieConsent.privacyPolicy")}),"."]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:l("cookieConsent.necessaryTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:l("cookieConsent.necessaryDesc")})]}),o.jsx("input",{type:"checkbox",checked:!0,disabled:!0,className:"mt-1 h-4 w-4 shrink-0"})]}),o.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:l("cookieConsent.externalTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:l("cookieConsent.externalDesc")})]}),o.jsx("input",{type:"checkbox",checked:r,onChange:c=>s(c.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]}),o.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[o.jsxs("div",{children:[o.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:l("cookieConsent.analyticsTitle")}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:l("cookieConsent.analyticsDesc")})]}),o.jsx("input",{type:"checkbox",checked:i,onChange:c=>a(c.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]})]}),o.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:l("cookieConsent.cancel")}),o.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:l("cookieConsent.saveSelection")})]})]})})}function DP(){const{decided:e,settingsOpen:t,acceptAll:n,rejectNonEssential:r,openSettings:s,closeSettings:i}=ls(),{t:a}=xe();return o.jsxs(o.Fragment,{children:[!e&&o.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:o.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[o.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[a("cookieConsent.bannerText")," ",a("cookieConsent.moreInfo")," ",o.jsx(K,{to:"/datenschutz",className:"underline hover:text-brand-500",children:a("cookieConsent.privacyPolicy")}),"."]}),o.jsxs("div",{className:"flex flex-wrap gap-2 sm:shrink-0",children:[o.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:a("cookieConsent.settings")}),o.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:a("cookieConsent.onlyNecessary")}),o.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:a("cookieConsent.acceptAll")})]})]})}),t&&o.jsx(AP,{onClose:i})]})}const uv="/assets/gallery-subs-COSd4seJ.webp",cv="/assets/gallery-amp-purple-CESAKuOf.webp",RP="/assets/gallery-speaker-CUXQZ49Q.webp",dv="/assets/gallery-dash-Cg-7v9qo.webp",IP="/assets/hero-trunk-Dp4_JHDh.webp",VP="/assets/gallery-rear-8cIXPC7T.webp",FP="/assets/hero-highlight-Co4f1Kj5.webp",OP="/assets/bg-light-CBAG2tPV.webp",up="/assets/bg-dark-B4R1klEI.webp",fv="/assets/base-BKOm0Bib.webp",hv="/assets/clear-DZZMSrMX.webp",mv="/assets/drive-BE2W1yna.webp",pv="/assets/prime-BTVNe2Gb.webp",gv="/assets/elite_r-BRvz_pyr.webp",xv="/assets/apex-CFy2qup8.webp",yv="/assets/statement-pTO-wTPx.webp",vv="/assets/limitless-DDs0S_PU.webp",Zt={og_image:{src:"/og-image.jpg",label:"Link-Vorschaubild",aspect:1200/630},favicon:{src:"/favicon.png",label:"Browser-Symbol (Favicon)",aspect:1},craft:{src:uv,label:"Startseite: Bild bei „Präzisionsarbeit“",aspect:3/2},advice:{src:cv,label:"Startseite: Bild bei „Von der ersten Idee …“",aspect:3/2},youtube_poster:{src:dv,label:"Startseite: Standbild des Videos",aspect:16/9},more:{src:FP,label:"Startseite: Bild bei „Mehr als nur Car-Hifi“",aspect:16/9},contact_bg_light:{src:OP,label:"Kontaktseite: Hintergrund hell"},contact_bg_dark:{src:up,label:"Kontaktseite: Hintergrund dunkel"},countdown_bg:{src:up,label:"Launch-Countdown: Hintergrund"}},ao=[{src:uv,width:900,height:600},{src:cv,width:900,height:600},{src:RP,width:900,height:1200},{src:dv,width:900,height:814},{src:VP,width:900,height:1200},{src:IP,width:1920,height:1280}],h4=24,zP=()=>ao.map((e,t)=>`default:${t}`),BP=[fv,hv,mv,pv,gv,xv,yv,vv];function $P(e){var n;const t=/^default:(\d+)$/.exec(e||"");return t?((n=ao[Number(t[1])])==null?void 0:n.src)||null:e||null}function Ro(e){const t=Pt(),n=Xe(),r=(e||t).site_images||{},s=(u,c)=>n.getValue("site_images",u,"path","de",c||"")||"";return{slot:u=>{const c=s(u,r[u]);return{src:c||Zt[u].src,custom:c}},insights:()=>(Array.isArray(r.insights)?r.insights:zP()).map((c,d)=>{let f=s(`insights.${d}`,c);f||(f=dc.src),packageTier:u=>{const c=Array.isArray(r.package_tiers)?r.package_tiers:[],d=s(`package_tiers.${u}`,c[u]);return{src:d||BP[u],custom:d}}}}const Ne={card:"#14170e",cardBorder:"rgba(168,225,12,0.16)",divider:"rgba(168,225,12,0.15)",text:"#f3f6ea",muted:"#9aa38c",label:"#8f987f",accent:"#b6e619",pillBorder:"rgba(168,225,12,0.28)"},cp={fontFamily:"'Michroma', sans-serif"};function oo(e,t=0){return e!=null&&e.launch_at?new Date(e.launch_at).getTime()-(Date.now()+t):0}function HP(e,t){return!(e!=null&&e.server_time)||!t?0:new Date(e.server_time).getTime()-t}function UP(e){const t=Math.max(0,Math.floor(e/1e3));return{days:Math.floor(t/86400),hours:Math.floor(t%86400/3600),minutes:Math.floor(t%3600/60),seconds:t%60}}function WP(e,t){const n=new Date(e),r=new Date(n.getTime()+60*60*1e3),s=a=>a.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),i=["BEGIN:VCALENDAR","VERSION:2.0","PRODID:-//HifiPlanet//Countdown//DE","BEGIN:VEVENT",`UID:launch-${s(n)}@hifi-planet.de`,`DTSTAMP:${s(new Date)}`,`DTSTART:${s(n)}`,`DTEND:${s(r)}`,`SUMMARY:${t}`,`URL:${window.location.origin}`,"END:VEVENT","END:VCALENDAR"].join(`\r +`);return`data:text/calendar;charset=utf-8,${encodeURIComponent(i)}`}function GP({text:e}){const t=e.trimEnd().lastIndexOf(" ");return t<0?e:o.jsxs(o.Fragment,{children:[e.slice(0,t+1),o.jsx("span",{style:{color:Ne.accent},children:e.slice(t+1)})]})}function KP({countdown:e,clockOffset:t=0,settings:n={},preview:r=!1,onClosePreview:s,onLaunch:i}){const{t:a,language:l,toggleLanguage:u}=xe(),[c,d]=m.useState(()=>oo(e,t)),f=Ro(n).slot("countdown_bg"),h=c<=0;m.useEffect(()=>{const k=()=>d(oo(e,t));k();const E=setInterval(k,250);return()=>clearInterval(E)},[e,t]),m.useEffect(()=>{if(!h||r)return;const k=setTimeout(()=>i==null?void 0:i(),2600);return()=>clearTimeout(k)},[h,r,i]),m.useEffect(()=>{const k=document.title;return document.title=`HifiPlanet – ${a("countdown.eyebrow")}`,()=>{document.title=k}},[a]);const g=UP(c),y=l==="en",b=h?a("countdown.liveTitle"):(y?e.title_en:e.title)||a("countdown.title"),w=h?a("countdown.liveMessage"):(y?e.message_en:e.message)||a("countdown.message"),p=e.launch_at?new Date(e.launch_at):null,x=p?p.toLocaleString(y?"en-GB":"de-DE",{weekday:"long",day:"numeric",month:"long",hour:"2-digit",minute:"2-digit",timeZone:"Europe/Berlin"}):"",v=[[g.days,a("countdown.days")],[g.hours,a("countdown.hours")],[g.minutes,a("countdown.minutes")],[g.seconds,a("countdown.seconds")]];return o.jsxs("div",{className:"flex min-h-[100svh] flex-col bg-[#0a0c06] bg-cover bg-center",style:{backgroundImage:`url(${f.src})`,color:Ne.text,fontFamily:"'Barlow', sans-serif"},children:[r&&o.jsxs("div",{className:"flex items-center justify-center gap-3 px-4 py-2 text-xs font-semibold",style:{background:Ne.accent,color:"#0f1208"},children:[a("countdown.preview"),o.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1 underline",children:[o.jsx(Si,{className:"h-3.5 w-3.5"}),a("countdown.closePreview")]})]}),o.jsxs("div",{className:"mx-auto flex w-full max-w-[1280px] flex-1 flex-col px-4 pb-6 sm:px-10 sm:pb-10",children:[o.jsxs("header",{className:"flex items-center justify-between gap-4 border-b pb-5 pt-6 sm:pt-8",style:{borderColor:Ne.divider},children:[o.jsx("img",{src:n.logo_dark_path||Jd,alt:"HifiPlanet",className:"h-12 w-auto sm:h-14"}),o.jsxs("div",{className:"flex items-center gap-5",children:[o.jsx("button",{type:"button",onClick:u,"aria-label":a("languageToggle.label"),className:"text-xs font-semibold uppercase tracking-[3px] hover:text-white",style:{color:Ne.muted},children:l==="de"?"EN":"DE"}),n.phone&&o.jsxs("a",{href:fi(n.phone),className:"hidden items-center gap-2.5 rounded-full border py-2 pl-2 pr-5 text-sm font-semibold sm:inline-flex",style:{borderColor:Ne.pillBorder,background:Ne.card},children:[o.jsx("span",{className:"flex h-7 w-7 items-center justify-center rounded-full",style:{background:"rgba(168,225,12,0.1)",color:Ne.accent},children:o.jsx(dr,{className:"h-3.5 w-3.5"})}),n.phone]})]})]}),o.jsxs("main",{className:"flex flex-1 flex-col justify-center py-12 sm:py-16",children:[o.jsx("p",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:Ne.accent},children:a(h?"countdown.liveEyebrow":"countdown.eyebrow")}),o.jsx("h1",{style:cp,className:"max-w-3xl text-[34px] leading-[1.08] sm:text-[clamp(34px,5vw,60px)]",children:o.jsx(GP,{text:b})}),o.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:Ne.muted},children:w}),o.jsx("div",{className:"grid w-full max-w-[720px] grid-cols-4 rounded-[14px] border shadow-[0_24px_60px_rgba(0,0,0,0.55)]",style:{background:Ne.card,borderColor:Ne.cardBorder},children:v.map(([k,E],C)=>o.jsxs("div",{className:`px-2 py-5 text-center sm:px-6 sm:py-7 ${C>0?"border-l":""}`,style:{borderColor:Ne.divider},children:[o.jsx("div",{style:cp,className:"text-[22px] tabular-nums leading-none min-[400px]:text-[26px] sm:text-[44px]",children:String(k).padStart(2,"0")}),o.jsx("div",{className:"mt-3 text-[10px] font-semibold uppercase tracking-[2px] sm:text-[11px] sm:tracking-[3px]",style:{color:Ne.label},children:E})]},E))}),p&&!h&&o.jsxs("div",{className:"mt-6 flex flex-col gap-3 text-[15px] sm:flex-row sm:items-center sm:gap-8",children:[o.jsxs("p",{style:{color:Ne.muted},children:[a("countdown.launchPrefix"),": ",o.jsx("span",{className:"font-semibold",style:{color:Ne.text},children:x}),a("countdown.clock")&&` ${a("countdown.clock")}`]}),o.jsxs("a",{href:WP(e.launch_at,a("countdown.calendarTitle")),download:"hifiplanet-launch.ics",className:"text-[13px] font-bold uppercase tracking-[3px] hover:underline",style:{color:Ne.accent},children:[a("countdown.addToCalendar")," →"]})]})]}),o.jsxs("footer",{className:"flex flex-wrap gap-x-6 gap-y-2 border-t pt-5 text-[13px]",style:{borderColor:Ne.divider,color:Ne.label},children:[n.phone&&o.jsx("a",{href:fi(n.phone),className:"hover:text-white sm:hidden",children:n.phone}),n.address_city&&o.jsxs("span",{children:[n.address_street,", ",n.address_zip," ",n.address_city]}),o.jsx(K,{to:"/impressum",className:"hover:text-white",children:"Impressum"}),o.jsx(K,{to:"/datenschutz",className:"hover:text-white",children:y?"Privacy":"Datenschutz"}),o.jsx(K,{to:"/admin/login","aria-label":a("maintenance.login"),title:a("maintenance.login"),className:"hover:text-white",children:o.jsx(Xy,{className:"h-3.5 w-3.5"})})]})]})]})}function qP({countdown:e}){const{t,language:n}=xe(),r=new Date(e.launch_at).toLocaleString(n==="en"?"en-GB":"de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"Europe/Berlin"});return o.jsxs("div",{className:"bg-neutral-900 px-4 py-2 text-center text-xs font-semibold text-neutral-200",children:[t("countdown.adminActive").replace("{date}",r)," ",o.jsx(K,{to:"/?countdown=vorschau",className:"text-brand-300 underline hover:text-brand-200",children:t("countdown.adminPreview")})]})}function YP(){const{consent:e}=ls(),{ga_measurement_id:t}=Pt(),n=m.useRef(!1),r=Ye();return m.useEffect(()=>{if(!t||!e.analytics||n.current)return;n.current=!0;const s=document.createElement("script");s.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,s.async=!0,document.head.appendChild(s),window.dataLayer=window.dataLayer||[];function i(){window.dataLayer.push(arguments)}window.gtag=i,i("js",new Date),i("config",t,{anonymize_ip:!0,send_page_view:!1})},[t,e.analytics]),m.useEffect(()=>{!n.current||typeof window.gtag!="function"||window.gtag("consent","update",{analytics_storage:e.analytics?"granted":"denied"})},[e.analytics]),m.useEffect(()=>{!e.analytics||typeof window.gtag!="function"||window.gtag("event","page_view",{page_path:r.pathname+r.search,page_location:window.location.href,page_title:document.title})},[r.pathname,r.search,e.analytics,t]),null}const wv=m.createContext({global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null},bypass:!1}),XP=wv.Provider;function Io(){return m.useContext(wv)}const tf=m.createContext({}),ZP=tf.Provider;function fr(e,t){const n=e[t];if(!n)return{};const r={};return n.font_family&&(r.fontFamily=n.font_family),n.font_size&&(r.fontSize=n.font_size),n.color&&(r.color=n.color),r}function We(e){const t=m.useContext(tf);return fr(t,e)}function nf(){return m.useContext(tf)}const QP=[{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'}],rf=m.createContext({fonts:[],refresh:()=>{}}),bv=rf.Provider;function kv(){return m.useContext(rf).fonts}function m4(){return m.useContext(rf).refresh}function p4(){const e=kv();return[...QP,...e.map(t=>({label:t.name,value:t.font_family}))]}function JP(e){const t=/\.([a-z0-9]+)$/i.exec(e||"");return t?t[1].toLowerCase():""}const eN={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"opentype"};function Sv(){const e=kv();if(e.length===0)return null;const t=e.map(n=>{const r=eN[JP(n.file_path)]||"woff2";return`@font-face { font-family: "${n.font_family}"; src: url("${n.file_path}") format("${r}"); font-display: swap; }`}).join(` +`);return o.jsx("style",{children:t})}const tN=150,nN=300,rN=80,sN=5e3;function iN(){return o.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-white dark:bg-neutral-950",children:o.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-4 border-neutral-200 border-t-brand-500 dark:border-neutral-800 dark:border-t-brand-500"})})}function aN({enabled:e,children:t}){const n=Ye(),[r,s]=m.useState(!e),[i,a]=m.useState(!1),l=m.useRef(null);return m.useLayoutEffect(()=>{const u=l.current;if(!e||!u){s(!0),a(!1);return}s(!1),a(!1);let c=!1,d=0,f=null;const h=new Set,g=setTimeout(()=>{d=Date.now(),a(!0)},tN),y=()=>{s(!0),a(!1)},b=()=>{c=!0,clearTimeout(g),clearTimeout(f),clearTimeout(C),k.disconnect(),E()},w=()=>{if(c)return;b();const j=d?nN-(Date.now()-d):0;j>0?setTimeout(y,j):y()},p=()=>{clearTimeout(f),f=setTimeout(()=>{h.size===0&&$C()===0&&w()},rN)},x=j=>{if(h.has(j)||j.complete||j.getBoundingClientRect().top>=window.innerHeight)return;j.loading==="lazy"&&(j.loading="eager"),h.add(j);const S=()=>{h.delete(j),j.removeEventListener("load",S),j.removeEventListener("error",S),p()};j.addEventListener("load",S),j.addEventListener("error",S)},v=j=>{var S;j.nodeType===1&&(j.tagName==="IMG"&&x(j),(S=j.querySelectorAll)==null||S.call(j,"img").forEach(x))},k=new MutationObserver(j=>{j.forEach(S=>S.addedNodes.forEach(v)),p()});k.observe(u,{childList:!0,subtree:!0});const E=HC(p),C=setTimeout(w,sN);return u.querySelectorAll("img").forEach(x),p(),()=>{c||b()}},[n.pathname,e]),o.jsxs("div",{className:"relative",children:[o.jsx("div",{ref:l,style:e?{visibility:r?"visible":"hidden"}:void 0,children:t}),e&&i&&o.jsx(iN,{})]})}const oN=m.lazy(()=>X(()=>import("./RichTextEditor-B7bZ3Yjh.js"),[])),lN=m.lazy(()=>X(()=>import("./ImageUploadField-DGJRkWaj.js"),__vite__mapDeps([0,1]))),sf={de:"Deutsch",en:"Englisch"},uN=["nav.","footer.","cookieConsent.","languageToggle.","themeToggle.","maintenance."],Xi=e=>uN.some(t=>e.startsWith(t));function Fl(e,t){return t.split(".").reduce((n,r)=>n==null?void 0:n[r],e)}function cN({editor:e}){const t=Xe(),{entity:n,id:r,field:s,lang:i,kind:a,label:l,hint:u,original:c,aspect:d}=e,[f]=m.useState(()=>({value:c,wasPending:t.hasPending(n,r,s,i)})),[h,g]=m.useState(c),y=w=>{g(w),t.setValue(n,r,s,i,w)},b=()=>{f.wasPending?t.setValue(n,r,s,i,f.value):t.resetValue(n,r,s,i),t.closeEditor()};return o.jsxs("div",{className:"pointer-events-auto w-full rounded-xl border border-neutral-200 bg-white p-4 text-neutral-900 shadow-2xl dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 sm:w-[min(92vw,520px)]",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between gap-3",children:[o.jsxs("p",{className:"text-sm font-semibold",children:[l," ",a!=="image"&&o.jsxs("span",{className:"font-normal text-neutral-500",children:["(",sf[i],")"]})]}),o.jsx("button",{type:"button",onClick:b,"aria-label":"Abbrechen",className:"rounded p-1 text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",children:o.jsx(Si,{className:"h-4 w-4"})})]}),u&&o.jsx("p",{className:"mb-2 text-xs text-neutral-500 dark:text-neutral-400",children:u}),a==="image"?o.jsxs(m.Suspense,{fallback:o.jsx("p",{className:"p-3 text-sm text-neutral-500",children:"Lädt…"}),children:[o.jsx(lN,{value:h,onChange:w=>y(w||""),label:"Eigenes Bild",aspect:d}),o.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:"Ohne eigenes Bild (× am Vorschaubild) erscheint wieder das Standardbild."})]}):a==="html"?o.jsx("div",{className:"max-h-[45vh] overflow-y-auto rounded-md border border-neutral-300 dark:border-neutral-700",children:o.jsx(m.Suspense,{fallback:o.jsx("p",{className:"p-3 text-sm text-neutral-500",children:"Editor lädt…"}),children:o.jsx(oN,{value:h,onChange:y})})}):a==="input"?o.jsx("input",{autoFocus:!0,value:h,onChange:w=>y(w.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-800"}):o.jsx("textarea",{autoFocus:!0,rows:7,value:h,onChange:w=>y(w.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-800"}),o.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[o.jsx("button",{type:"button",onClick:b,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Abbrechen"}),o.jsx("button",{type:"button",onClick:t.closeEditor,className:"rounded-md bg-brand-500 px-3 py-1.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Übernehmen"})]})]})}function dN({onClose:e}){const t=Xe(),{language:n,t:r}=xe(),s=Ye(),[i,a]=m.useState(""),[l,u]=m.useState(0);m.useEffect(()=>{const h=setTimeout(()=>u(g=>g+1),400);return()=>clearTimeout(h)},[s.pathname]);const c=m.useMemo(()=>t.usedTextKeys(s.pathname).filter(h=>typeof Fl(Sn.de,h)=="string").sort((h,g)=>Xi(h)-Xi(g)||h.localeCompare(g)),[s.pathname,l,t.usedTextKeys]),d=i.trim().toLowerCase(),f=c.filter(h=>!d||h.toLowerCase().includes(d)||r(h).toLowerCase().includes(d));return o.jsxs("div",{className:"pointer-events-auto flex max-h-[60vh] w-full flex-col rounded-xl border border-neutral-200 bg-white text-neutral-900 shadow-2xl dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 sm:w-[min(92vw,520px)]",children:[o.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-neutral-200 p-4 pb-3 dark:border-neutral-800",children:[o.jsxs("div",{children:[o.jsxs("p",{className:"text-sm font-semibold",children:["Feste Texte auf dieser Seite ",o.jsxs("span",{className:"font-normal text-neutral-500",children:["(",sf[n],")"]})]}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Buttons, Beschriftungen, Menü und Fußzeile. Leer lassen = Standardtext."})]}),o.jsx("button",{type:"button",onClick:e,"aria-label":"Schließen",className:"rounded p-1 text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",children:o.jsx(Si,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"px-4 pt-3",children:o.jsx("input",{type:"search",value:i,onChange:h=>a(h.target.value),placeholder:"Suchen…",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-800"})}),o.jsxs("ul",{className:"flex-1 space-y-3 overflow-y-auto p-4",children:[f.length===0&&o.jsx("li",{className:"text-sm text-neutral-500",children:"Keine Texte gefunden."}),f.map((h,g)=>{const y=Fl(Sn[n],h)??Fl(Sn.de,h),b=t.textOverride(n,h)!==void 0,w=r(h);return o.jsxs("li",{children:[Xi(h)&&(g===0||!Xi(f[g-1]))&&o.jsx("p",{className:"mb-3 border-t border-neutral-200 pt-3 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-800",children:"Auf allen Seiten (Menü, Fußzeile, Cookie-Hinweis)"}),o.jsxs("div",{className:"mb-1 flex items-center justify-between gap-2",children:[o.jsx("label",{htmlFor:`live-text-${h}`,className:"truncate font-mono text-[11px] text-neutral-500",title:h,children:h}),b&&o.jsxs("button",{type:"button",onClick:()=>t.setValue("text",h,"value",n,""),className:"flex shrink-0 items-center gap-1 text-[11px] text-neutral-500 hover:text-brand-600",title:`Standard: ${y}`,children:[o.jsx(UT,{className:"h-3 w-3"})," Standard"]})]}),o.jsx("textarea",{id:`live-text-${h}`,rows:w.length>60?3:1,value:w,onChange:p=>t.setValue("text",h,"value",n,p.target.value===y?"":p.target.value),className:`w-full resize-y rounded-md border bg-white px-2.5 py-1.5 text-sm dark:bg-neutral-800 ${b?"border-amber-400 dark:border-amber-500":"border-neutral-300 dark:border-neutral-700"}`})]},h)})]})]})}function fN(){const e=Xe(),{language:t}=xe(),[n,r]=m.useState(!1);if(!e.enabled)return null;const s=()=>{e.pendingCount&&!window.confirm("Es gibt ungespeicherte Änderungen. Bearbeiten trotzdem beenden? Die Änderungen gehen dann verloren.")||(e.discard(),e.setEnabled(!1))},i=e.editor&&`${e.editor.entity}|${e.editor.id}|${e.editor.field}|${e.editor.lang}`;return o.jsxs("div",{className:"pointer-events-none fixed inset-x-0 bottom-0 z-[150] flex flex-col items-end gap-2 p-2 sm:p-4",children:[e.editor?o.jsx(cN,{editor:e.editor},i):n&&o.jsx(dN,{onClose:()=>r(!1)}),o.jsxs("div",{className:"pointer-events-auto flex w-full flex-wrap items-center justify-between gap-2 rounded-xl border border-neutral-700 bg-neutral-950/95 px-3 py-2.5 text-sm text-neutral-100 shadow-2xl backdrop-blur sm:px-4",children:[o.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[o.jsx(Jy,{className:"h-4 w-4 shrink-0 text-brand-400"}),o.jsxs("p",{className:"min-w-0 truncate",children:[o.jsx("span",{className:"font-semibold",children:"Bearbeiten"}),o.jsxs("span",{className:"hidden text-neutral-400 sm:inline",children:[" · ",sf[t]," · gestrichelte Stellen anklicken"]})]})]}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.error&&o.jsx("span",{className:"max-w-xs text-xs text-red-400",children:e.error}),o.jsxs("button",{type:"button",onClick:()=>{e.closeEditor(),r(a=>!a)},className:`flex items-center gap-1.5 rounded-md border px-3 py-1.5 font-medium ${n?"border-brand-400 text-brand-300":"border-neutral-700 hover:bg-neutral-800"}`,children:[o.jsx(_T,{className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"Feste Texte"})]}),e.pendingCount>0&&o.jsx("button",{type:"button",onClick:e.discard,className:"rounded-md border border-neutral-700 px-3 py-1.5 font-medium hover:bg-neutral-800",children:"Verwerfen"}),o.jsxs("button",{type:"button",onClick:e.save,disabled:!e.pendingCount||e.saving,className:"flex items-center gap-1.5 rounded-md bg-brand-500 px-3 py-1.5 font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:[o.jsx(qy,{className:"h-4 w-4"}),e.saving?"Speichere…":e.pendingCount?`Speichern (${e.pendingCount})`:"Gespeichert"]}),o.jsx("button",{type:"button",onClick:s,"aria-label":"Bearbeiten beenden",title:"Bearbeiten beenden",className:"rounded-md p-1.5 text-neutral-400 hover:bg-neutral-800 hover:text-white",children:o.jsx(Si,{className:"h-4 w-4"})})]})]})]})}const jv=[{title:"Seiten",hint:"Ausgeblendete Seiten verschwinden aus dem Menü und leiten Besucher auf die Startseite um.",areas:[{key:"page.vehicles",label:"Fahrzeuge & Pakete",path:"/fahrzeuge"},{key:"page.services",label:"Leistungen",path:"/leistungen"},{key:"page.gallery",label:"Galerie",path:"/galerie"},{key:"page.downloads",label:"Downloads",path:"/downloads",note:"Erscheint ohnehin nur, wenn Downloads hinterlegt sind."}]},{title:"Startseite",hint:"Einzelne Abschnitte der Startseite. Das große Titelbild oben bleibt immer sichtbar.",areas:[{key:"home.stats",label:"Zahlen-Leiste"},{key:"home.partners",label:"Marken / Partner-Logos"},{key:"home.youtube",label:"Video-Abschnitt"},{key:"home.craft",label:"Handwerk & Beratung"},{key:"home.insights",label:"Einblicke (Bilder)"},{key:"home.reviews",label:"Kundenbewertungen"},{key:"home.more",label:'„Mehr als Car-Hifi"'},{key:"home.faq",label:"Häufige Fragen (FAQ)"}]}],hN=jv[0].areas;function mN(e){if(!e)return null;const t=hN.find(n=>e===n.path||e.startsWith(`${n.path}/`));return t?t.key:null}function Ev(e,t=[]){const n=mN(e);return!!n&&t.includes(n)}const pN=jv.flatMap(e=>e.areas),gN={global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null}},xN={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}},Ol={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:xN,hero_image_path:null,ga_measurement_id:null,package_card_theme:"graphite",package_card_layout:"strip",package_wheel_hint_interval:8,package_card_width:210,package_card_height:480,vehicle_tile_width:240,vehicle_tile_height:180,gallery_card_text_x:0,gallery_card_text_y:100,site_font:null,page_loader_enabled:1,has_downloads:!1,hidden_areas:[],price_note:null,price_note_en:null},yN=["/impressum","/datenschutz","/agb"],dp="hifi-site-settings",fp="hifi-maintenance";function hp(e){try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function mp(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const vN={mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday",sun:"Sunday"};function wN(e){var n,r,s;const t=document.getElementById("ld-business");if(t)try{const i=JSON.parse(t.textContent),a=(e.phone||"").replace(/[^\d+]/g,"");a&&(i.telephone=a.startsWith("+")?a:`+49${a.replace(/^0/,"")}`),e.contact_email&&(i.email=e.contact_email),i.address={"@type":"PostalAddress",streetAddress:e.address_street||((n=i.address)==null?void 0:n.streetAddress),postalCode:e.address_zip||((r=i.address)==null?void 0:r.postalCode),addressLocality:e.address_city||((s=i.address)==null?void 0:s.addressLocality),addressCountry:"DE"};const l=e.business_hours;l&&typeof l=="object"&&(i.openingHoursSpecification=Object.entries(vN).filter(([u])=>l[u]&&!l[u].closed&&l[u].open&&l[u].close).map(([u,c])=>({"@type":"OpeningHoursSpecification",dayOfWeek:c,opens:l[u].open,closes:l[u].close}))),t.textContent=JSON.stringify(i)}catch{}}function bN(){var N;const[e]=m.useState(()=>hp(dp)),[t,n]=m.useState(()=>hp(fp)),[r,s]=m.useState(()=>e?{...Ol,...e}:Ol),[i,a]=m.useState(!!e),[l,u]=m.useState({}),[c,d]=m.useState([]),{loading:f,hasPermission:h,user:g}=$n(),y=Ye(),b=pr(),[w,p]=m.useState(!1),[x]=m.useState(()=>new Date(Date.now()+(7*24+3)*3600*1e3+42*60*1e3).toISOString());m.useEffect(()=>{ae.get("/maintenance").then(P=>{const F={...P,_received_at:Date.now()};n(F),mp(fp,F)}).catch(()=>n(P=>P||gN)),ae.get("/site-settings").then(P=>{s({...Ol,...P}),mp(dp,P)}).catch(()=>{}).finally(()=>a(!0)),ae.get("/text-styles").then(u).catch(()=>{}),ae.get("/custom-fonts").then(d).catch(()=>{})},[]),m.useEffect(()=>{r.site_font?document.documentElement.style.setProperty("--site-font",r.site_font):document.documentElement.style.removeProperty("--site-font")},[r.site_font]),m.useEffect(()=>{i&&wN(r)},[r,i]);const v=t==null?void 0:t.countdown,k=HP(v,t==null?void 0:t._received_at),E=!!(v!=null&&v.active)&&!w&&oo(v,k)>0;if(t===null||!i||((N=t.global)!=null&&N.enabled||E)&&f)return o.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});const C=h("maintenance.bypass"),j=yN.includes(y.pathname),S=!!g&&new URLSearchParams(y.search).get("countdown")==="vorschau";if(!j&&(E&&!g||S)){const P=S&&!(v!=null&&v.launch_at&&oo(v,k)>0)?{...v,launch_at:x}:v;return o.jsx(Dl,{serverOverrides:r.text_overrides,children:o.jsx(Rl,{children:o.jsx(KP,{countdown:P,clockOffset:P===v?k:0,settings:r,preview:S,onClosePreview:()=>b("/",{replace:!0}),onLaunch:()=>p(!0)})})})}return t.global.enabled&&!C&&!j?o.jsx(Dl,{serverOverrides:r.text_overrides,children:o.jsx(Rl,{children:o.jsx(ji,{message:t.global.message,fullScreen:!0})})}):o.jsx(Dl,{serverOverrides:r.text_overrides,children:o.jsx(Rl,{children:o.jsx(XP,{value:{...t,bypass:C},children:o.jsx(xP,{value:r,children:o.jsx(ZP,{value:l,children:o.jsx(bv,{value:{fonts:c,refresh:()=>{}},children:o.jsxs("div",{className:"page-texture flex min-h-screen flex-col text-neutral-900 dark:text-neutral-100",children:[o.jsx(Sv,{}),C&&t.global.enabled&&o.jsx(Ei,{}),!!g&&E&&o.jsx(qP,{countdown:v}),o.jsx(MP,{}),o.jsx(SP,{}),o.jsx("main",{className:"flex-1",children:o.jsx(aN,{enabled:y.pathname!=="/"&&!!r.page_loader_enabled,children:Ev(y.pathname,r.hidden_areas)?o.jsx(ur,{to:"/",replace:!0}):o.jsx(m.Suspense,{fallback:o.jsx("div",{className:"min-h-[60vh]"}),children:o.jsx(yd,{})})})}),o.jsx(_P,{}),o.jsx(DP,{}),o.jsx(YP,{}),o.jsx(fN,{})]})})})})})})})}const Vo=m.createContext({toast:{success:()=>{},error:()=>{},info:()=>{}},setDirty:()=>{},confirmLeave:()=>!0,refreshCounters:()=>{}});let kN=0;function SN({children:e,onRefreshCounters:t}){const[n,r]=m.useState([]),s=m.useRef(new Set),i=m.useCallback(f=>r(h=>h.filter(g=>g.id!==f)),[]),a=m.useCallback((f,h,g={})=>{const y=++kN;return r(b=>[...b.slice(-3),{id:y,type:f,message:h,action:g.action}]),setTimeout(()=>i(y),g.duration||(f==="error"?7e3:3500)),y},[i]),l=m.useMemo(()=>({success:(f,h)=>a("success",f,h),error:(f,h)=>a("error",f,h),info:(f,h)=>a("info",f,h)}),[a]),u=m.useCallback((f,h)=>{h?s.current.add(f):s.current.delete(f)},[]),c=m.useCallback(()=>{if(s.current.size===0)return!0;const f=window.confirm("Du hast ungespeicherte Änderungen. Seite trotzdem verlassen? Die Änderungen gehen dann verloren.");return f&&s.current.clear(),f},[]);m.useEffect(()=>{const f=g=>{s.current.size!==0&&(g.preventDefault(),g.returnValue="")},h=g=>{var w,p;if(s.current.size===0||g.defaultPrevented||g.button!==0)return;const y=(p=(w=g.target).closest)==null?void 0:p.call(w,"a[href]");if(!y||y.target==="_blank"||g.metaKey||g.ctrlKey||g.shiftKey)return;const b=new URL(y.href,window.location.href);b.origin!==window.location.origin||b.pathname===window.location.pathname||c()||(g.preventDefault(),g.stopPropagation())};return window.addEventListener("beforeunload",f),document.addEventListener("click",h,!0),()=>{window.removeEventListener("beforeunload",f),document.removeEventListener("click",h,!0)}},[c]);const d=m.useMemo(()=>({toast:l,setDirty:u,confirmLeave:c,refreshCounters:t||(()=>{})}),[l,u,c,t]);return o.jsxs(Vo.Provider,{value:d,children:[e,o.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[300] flex w-[min(92vw,380px)] flex-col gap-2","aria-live":"polite",children:n.map(f=>o.jsxs("div",{role:f.type==="error"?"alert":"status",className:`pointer-events-auto flex items-start justify-between gap-3 rounded-lg border px-4 py-3 text-sm shadow-lg ${f.type==="error"?"border-red-200 bg-red-50 text-red-800 dark:border-red-900 dark:bg-red-950 dark:text-red-200":f.type==="success"?"border-green-200 bg-green-50 text-green-800 dark:border-green-900 dark:bg-green-950 dark:text-green-200":"border-neutral-200 bg-white text-neutral-800 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100"}`,children:[o.jsxs("span",{children:[f.type==="success"?"✓ ":"",f.message]}),o.jsxs("span",{className:"flex shrink-0 items-center gap-3",children:[f.action&&o.jsx("button",{type:"button",onClick:()=>{f.action.onClick(),i(f.id)},className:"font-semibold underline",children:f.action.label}),o.jsx("button",{type:"button",onClick:()=>i(f.id),"aria-label":"Meldung schließen",className:"opacity-60 hover:opacity-100",children:"✕"})]})]},f.id))})]})}function g4(){return m.useContext(Vo)}function x4(){return m.useContext(Vo).toast}function y4(e,t="page"){const{setDirty:n}=m.useContext(Vo);m.useEffect(()=>{n(t,!!e)},[e,t,n]),m.useEffect(()=>()=>n(t,!1),[t,n])}const jN=5*60*1e3,EN=30*60*1e3;function CN(){const{user:e,login:t,verifyTwoFactor:n}=$n(),[r,s]=m.useState(!1),[i,a]=m.useState("credentials"),[l,u]=m.useState((e==null?void 0:e.username)||""),[c,d]=m.useState(""),[f,h]=m.useState(""),[g,y]=m.useState(""),[b,w]=m.useState(""),[p,x]=m.useState(!1),v=m.useRef(Date.now()),k=m.useRef(null);if(Ci(k,r,()=>{}),m.useEffect(()=>UC(()=>s(!0)),[]),m.useEffect(()=>{const N=()=>{v.current=Date.now()},P=["keydown","pointerdown","scroll"];P.forEach(B=>window.addEventListener(B,N,{passive:!0}));const F=setInterval(()=>{document.hidden||Date.now()-v.current>EN||ae.get("/auth/me").then(B=>{(B==null?void 0:B.authenticated)===!1&&s(!0)}).catch(()=>{})},jN);return()=>{P.forEach(B=>window.removeEventListener(B,N)),clearInterval(F)}},[]),!r)return null;const E=()=>{s(!1),a("credentials"),d(""),h(""),w("")},C=async N=>{N.preventDefault(),x(!0),w("");try{const P=await t(l,c);P.requires2fa?(y(P.method==="email"?`6-stelliger Code aus der Mail an ${P.emailHint}`:"6-stelliger Code aus der App"),a("code")):E()}catch(P){w(P.message)}finally{x(!1)}},j=async N=>{N.preventDefault(),x(!0),w("");try{await n(f),E()}catch(P){w(P.message)}finally{x(!1)}},S="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";return o.jsx("div",{className:"fixed inset-0 z-[400] flex items-center justify-center bg-black/50 p-4",children:o.jsxs("div",{ref:k,role:"dialog","aria-modal":"true","aria-labelledby":"session-expired-title",className:"w-full max-w-sm rounded-xl bg-white p-6 shadow-xl dark:bg-neutral-900",children:[o.jsx("h2",{id:"session-expired-title",className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:"Bitte erneut anmelden"}),o.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Deine Sitzung ist abgelaufen. Deine Eingaben auf dieser Seite bleiben erhalten – nach dem Anmelden einfach noch einmal speichern."}),i==="credentials"?o.jsxs("form",{onSubmit:C,className:"space-y-3",children:[o.jsx("input",{value:l,onChange:N=>u(N.target.value),required:!0,placeholder:"Benutzername oder E-Mail",autoComplete:"username",className:S}),o.jsx("input",{type:"password",value:c,onChange:N=>d(N.target.value),required:!0,placeholder:"Passwort",autoComplete:"current-password",className:S}),b&&o.jsx("p",{className:"text-sm text-red-600",children:b}),o.jsx("button",{type:"submit",disabled:p,className:"w-full rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:p?"Melde an…":"Anmelden"})]}):o.jsxs("form",{onSubmit:j,className:"space-y-3",children:[o.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:g}),o.jsx("input",{value:f,onChange:N=>h(N.target.value),required:!0,inputMode:"numeric",autoComplete:"one-time-code",placeholder:"123456",className:S}),b&&o.jsx("p",{className:"text-sm text-red-600",children:b}),o.jsx("button",{type:"submit",disabled:p,className:"w-full rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:p?"Prüfe…":"Bestätigen"})]})]})})}const Pe=(...e)=>e.filter(Boolean).join(" "),Fo="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500/60 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-neutral-950",TN={primary:"bg-brand-500 text-white shadow-sm hover:bg-brand-600 active:bg-brand-700",secondary:"border border-neutral-300 bg-white text-neutral-700 shadow-sm hover:bg-neutral-50 hover:border-neutral-400 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:hover:bg-neutral-800",danger:"bg-red-600 text-white shadow-sm hover:bg-red-700",ghost:"text-neutral-600 hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:hover:text-white"},PN={sm:"h-8 gap-1.5 px-3 text-sm",md:"h-10 gap-2 px-4 text-sm"};function xc({variant:e="primary",size:t="md",className:n}={}){return Pe("inline-flex shrink-0 items-center justify-center whitespace-nowrap rounded-lg font-semibold transition disabled:cursor-not-allowed disabled:opacity-50",Fo,TN[e],PN[t],n)}function v4({variant:e,size:t,className:n,icon:r,children:s,to:i,href:a,type:l="button",...u}){const c=xc({variant:e,size:t,className:n}),d=o.jsxs(o.Fragment,{children:[r&&o.jsx(Oe,{name:r,className:"h-4 w-4"}),s]});return i?o.jsx(K,{to:i,className:c,...u,children:d}):a?o.jsx("a",{href:a,className:c,...u,children:d}):o.jsx("button",{type:l,className:c,...u,children:d})}const NN={default:"text-neutral-500 hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-white",danger:"text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:text-neutral-500 dark:hover:bg-red-950/50 dark:hover:text-red-400"};function _N({icon:e,label:t,tone:n="default",className:r,to:s,href:i,...a}){const l=Pe("inline-flex h-8 w-8 items-center justify-center rounded-lg transition",Fo,NN[n],r),u=o.jsx(Oe,{name:e,className:"h-[18px] w-[18px]"});return s?o.jsx(K,{to:s,className:l,title:t,"aria-label":t,...a,children:u}):i?o.jsx("a",{href:i,className:l,title:t,"aria-label":t,...a,children:u}):o.jsx("button",{type:"button",className:l,title:t,"aria-label":t,...a,children:u})}const af=Pe("block w-full rounded-lg border border-neutral-300 bg-white px-3 text-sm text-neutral-900 shadow-sm transition placeholder:text-neutral-400","focus:border-brand-500 focus:outline-none focus:ring-2 focus:ring-brand-500/25","disabled:cursor-not-allowed disabled:bg-neutral-50 disabled:text-neutral-500","dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:placeholder:text-neutral-500 dark:disabled:bg-neutral-800"),w4=m.forwardRef(function({className:t,...n},r){return o.jsx("input",{ref:r,className:Pe(af,"h-10",t),...n})}),b4=m.forwardRef(function({className:t,rows:n=4,...r},s){return o.jsx("textarea",{ref:s,rows:n,className:Pe(af,"py-2",t),...r})}),k4=m.forwardRef(function({className:t,children:n,...r},s){return o.jsx("select",{ref:s,className:Pe(af,"h-10 pr-8",t),...r,children:n})});function S4({label:e,hint:t,error:n,required:r,children:s,className:i}){const a=m.useId(),l=typeof s=="function"?s(a):s;return o.jsxs("div",{className:i,children:[e&&o.jsxs("label",{htmlFor:a,className:"mb-1.5 block text-sm font-medium text-neutral-800 dark:text-neutral-200",children:[e,r&&o.jsx("span",{className:"ml-0.5 text-brand-600 dark:text-brand-400",children:"*"})]}),m.isValidElement(l)&&!l.props.id?m.cloneElement(l,{id:a}):l,n?o.jsx("p",{className:"mt-1.5 text-xs font-medium text-red-600 dark:text-red-400",children:n}):t&&o.jsx("p",{className:"mt-1.5 text-xs text-neutral-500 dark:text-neutral-400",children:t})]})}function j4({checked:e,indeterminate:t=!1,onChange:n,label:r,disabled:s,className:i}){const a=m.useRef(null);return m.useEffect(()=>{a.current&&(a.current.indeterminate=!!t&&!e)},[t,e]),o.jsx("input",{ref:a,type:"checkbox",checked:!!e,disabled:s,"aria-label":r,onChange:l=>n==null?void 0:n(l.target.checked),onClick:l=>l.stopPropagation(),className:Pe("h-4 w-4 shrink-0 cursor-pointer accent-brand-500 disabled:cursor-not-allowed disabled:opacity-50",i)})}function E4({checked:e,onChange:t,label:n,description:r,disabled:s,className:i}){const a=m.useId();return o.jsxs("div",{className:Pe("flex items-center justify-between gap-4",i),children:[(n||r)&&o.jsxs("label",{htmlFor:a,className:"min-w-0 cursor-pointer",children:[n&&o.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:n}),r&&o.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:r})]}),o.jsx("button",{id:a,type:"button",role:"switch","aria-checked":!!e,disabled:s,onClick:()=>t==null?void 0:t(!e),className:Pe("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-50",Fo,e?"bg-brand-500":"bg-neutral-300 dark:bg-neutral-700"),children:o.jsx("span",{className:Pe("inline-block h-5 w-5 rounded-full bg-white shadow transition",e?"translate-x-[22px]":"translate-x-0.5")})})]})}function C4({title:e,description:t,actions:n,children:r,className:s,padded:i=!0}){return o.jsxs("section",{className:Pe("rounded-xl border border-neutral-200/80 bg-white shadow-sm shadow-neutral-900/[0.03] dark:border-neutral-800 dark:bg-neutral-900 dark:shadow-none",i&&"p-5 sm:p-6",s),children:[(e||n)&&o.jsxs("div",{className:Pe("flex flex-wrap items-start justify-between gap-3",(t||r)&&"mb-4"),children:[o.jsxs("div",{className:"min-w-0",children:[e&&o.jsx("h2",{className:"text-base font-semibold text-neutral-900 dark:text-white",children:e}),t&&o.jsx("p",{className:"mt-0.5 text-sm text-neutral-500 dark:text-neutral-400",children:t})]}),n&&o.jsx("div",{className:"flex shrink-0 flex-wrap gap-2",children:n})]}),r]})}function T4({title:e,description:t,actions:n,className:r}){return o.jsxs("div",{className:Pe("mb-6 flex flex-wrap items-end justify-between gap-4",r),children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h1",{className:"text-2xl font-bold tracking-tight text-neutral-900 dark:text-white",children:e}),t&&o.jsx("p",{className:"mt-1 max-w-2xl text-sm text-neutral-500 dark:text-neutral-400",children:t})]}),n&&o.jsx("div",{className:"flex flex-wrap items-center gap-2",children:n})]})}const MN={neutral:"bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",brand:"bg-brand-100 text-brand-800 dark:bg-brand-900/50 dark:text-brand-300",amber:"bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300",red:"bg-red-500 text-white"};function P4({tone:e="neutral",children:t,className:n}){return o.jsx("span",{className:Pe("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-semibold",MN[e],n),children:t})}function N4({icon:e="inbox",title:t,description:n,actions:r}){return o.jsxs("div",{className:"flex flex-col items-center px-6 py-12 text-center",children:[o.jsx("span",{className:"mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-brand-50 text-brand-600 dark:bg-brand-900/30 dark:text-brand-400",children:o.jsx(Oe,{name:e,className:"h-6 w-6"})}),o.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:t}),n&&o.jsx("p",{className:"mt-1 max-w-sm text-sm text-neutral-500 dark:text-neutral-400",children:n}),r&&o.jsx("div",{className:"mt-4 flex flex-wrap justify-center gap-2",children:r})]})}const LN={md:"max-w-md",lg:"max-w-xl",xl:"max-w-3xl"};function _4({open:e,onClose:t,title:n,description:r,headerExtra:s,children:i,footer:a,size:l="md",as:u="div",...c}){const d=m.useRef(null);return Ci(d,e,t),e?o.jsxs("div",{className:"fixed inset-0 z-50",children:[o.jsx("div",{className:"absolute inset-0 bg-neutral-950/40 backdrop-blur-[2px]",onClick:t}),o.jsxs(u,{ref:d,role:"dialog","aria-modal":"true","aria-label":n,className:Pe("absolute inset-y-0 right-0 flex w-full flex-col bg-white shadow-2xl dark:bg-neutral-900",LN[l]),...c,children:[o.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-neutral-200 px-6 py-5 dark:border-neutral-800",children:[o.jsxs("div",{className:"min-w-0",children:[o.jsx("h2",{className:"text-lg font-semibold text-neutral-900 dark:text-white",children:n}),r&&o.jsx("p",{className:"mt-0.5 text-sm text-neutral-500 dark:text-neutral-400",children:r})]}),s&&o.jsx("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:s}),o.jsx(_N,{icon:"close",label:"Schließen",onClick:t,className:"-mr-2 -mt-1"})]}),o.jsx("div",{className:"flex-1 space-y-5 overflow-y-auto px-6 py-6",children:i}),a&&o.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-neutral-200 bg-neutral-50 px-6 py-4 dark:border-neutral-800 dark:bg-neutral-900/60",children:a})]})]}):null}function M4({file:e,onChange:t,accept:n,hint:r,current:s,disabled:i}){const a=m.useId(),[l,u]=m.useState(!1),c=f=>!i&&f&&t(f),d=f=>f>=1048576?`${(f/1048576).toFixed(1).replace(".",",")} MB`:`${Math.max(1,Math.round(f/1024))} KB`;return o.jsxs("label",{htmlFor:a,onDragOver:f=>{f.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:f=>{var h;f.preventDefault(),u(!1),c((h=f.dataTransfer.files)==null?void 0:h[0])},className:Pe("flex cursor-pointer flex-col items-center justify-center gap-1.5 rounded-xl border-2 border-dashed px-4 py-6 text-center transition",l?"border-brand-500 bg-brand-50 dark:bg-brand-900/20":"border-neutral-300 hover:border-brand-400 hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-800/50",i&&"pointer-events-none opacity-60"),children:[o.jsx("input",{id:a,type:"file",accept:n,className:"sr-only",disabled:i,onChange:f=>{var h;return c((h=f.target.files)==null?void 0:h[0])}}),o.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-brand-50 text-brand-600 dark:bg-brand-900/30 dark:text-brand-400",children:o.jsx(Oe,{name:e?"file":"download",className:Pe("h-5 w-5",!e&&"rotate-180")})}),e?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"max-w-full truncate text-sm font-semibold text-neutral-900 dark:text-white",children:e.name}),o.jsxs("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:[d(e.size)," · Klicken, um eine andere Datei zu wählen"]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("span",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:["Datei hierher ziehen oder ",o.jsx("span",{className:"text-brand-600 dark:text-brand-400",children:"auswählen"})]}),s&&o.jsxs("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["Aktuell: ",s]}),r&&o.jsx("span",{className:"text-xs text-neutral-400",children:r})]})]})}function L4({value:e,onChange:t,options:n,size:r="md",className:s}){return o.jsx("div",{role:"radiogroup",className:Pe("inline-flex rounded-lg bg-neutral-100 p-1 dark:bg-neutral-800",s),children:n.map(i=>o.jsx("button",{type:"button",role:"radio","aria-checked":e===i.value,onClick:()=>t(i.value),className:Pe("rounded-md font-medium transition",Fo,r==="sm"?"px-2.5 py-1 text-xs":"px-3 py-1.5 text-sm",e===i.value?"bg-white text-neutral-900 shadow-sm dark:bg-neutral-950 dark:text-white":"text-neutral-500 hover:text-neutral-800 dark:text-neutral-400 dark:hover:text-neutral-200"),children:i.label},i.value))})}const AN={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:"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 9v-1a6 6 0 0 1 12 0v1M16 3.5a4 4 0 0 1 0 7.5M22 20v-1a6 6 0 0 0-4-5.6",user:"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 8a7 7 0 0 1 14 0",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",key:"M15 7a3 3 0 1 1 0 .01M21 3l-6.5 6.5M8.5 13.5a5 5 0 1 0 2 2L21 5M17 7l2 2",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",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",images:"M7 3h13a1 1 0 0 1 1 1v11M3 7h13a1 1 0 0 1 1 1v12H4a1 1 0 0 1-1-1V7Zm2 11 3.5-4 2.5 3 2-2 3 3",camera:"M4 8h3l2-3h6l2 3h3a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Zm8 9a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z",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",download:"M12 4v11m0 0-4-4m4 4 4-4M5 19h14",transfer:"M7 4v13m0 0-3-3m3 3 3-3M17 20V7m0 0-3 3m3-3 3 3",gauge:"M4 13a8 8 0 1 1 16 0M12 13l3.5-3.5M6 17h12",inbox:"M3 13h5l1.5 2.5h5L16 13h5M5 5h14l2 8v5a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-5l2-8Z",building:"M4 21V5a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v16M15 9h4a1 1 0 0 1 1 1v11M3 21h18M8 8h3M8 12h3M8 16h3",palette:"M12 3a9 9 0 1 0 0 18c1 0 1.5-.7 1.5-1.5 0-.4-.2-.8-.4-1.1-.3-.3-.4-.7-.4-1.1 0-.8.7-1.5 1.5-1.5H16a5 5 0 0 0 5-5c0-4.4-4-7.8-9-7.8ZM7.5 12h.01M10 7.5h.01M15 7.5h.01",file:"M7 3h7l5 5v12a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5M9 13h6M9 17h6",server:"M4 4h16v6H4V4Zm0 10h16v6H4v-6Zm3-7h.01M7 17h.01",link:"M10 13a5 5 0 0 0 7.07 0l3-3a5 5 0 0 0-7.07-7.07l-1.5 1.5M14 11a5 5 0 0 0-7.07 0l-3 3a5 5 0 0 0 7.07 7.07l1.5-1.5",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-9-9h18M12 3c2.5 2.5 3.5 5.5 3.5 9s-1 6.5-3.5 9c-2.5-2.5-3.5-5.5-3.5-9s1-6.5 3.5-9Z",send:"M4 12 20 4l-4 16-4-7-8-1Zm8 1 8-9",refresh:"M20 11a8 8 0 0 0-14.9-3M4 4v4h4m-4 5a8 8 0 0 0 14.9 3M20 20v-4h-4",trash:"M5 7h14M10 11v6m4-6v6M6 7l1 13h10l1-13M9 7V4h6v3",external:"M14 4h6v6m0-6-9 9M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5",pause:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-2-12v6m4-6v6",timer:"M10 2h4M12 14l3-3M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",pencil:"M4 20h4L19 9l-4-4L4 16v4Zm9-13 4 4",eye:"M2.5 12S6 5 12 5s9.5 7 9.5 7-3.5 7-9.5 7-9.5-7-9.5-7Zm9.5 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z",plus:"M12 5v14M5 12h14",search:"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5-2 4 4",chevron:"m9 6 6 6-6 6",menu:"M4 6h16M4 12h16M4 18h16",close:"M6 6l12 12M18 6 6 18",logout:"M15 4h3a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-3M10 8l-4 4 4 4M6 12h10",sun:"M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm0-13v2m0 14v2M3 12h2m14 0h2M5.6 5.6 7 7m10 10 1.4 1.4M5.6 18.4 7 17M17 7l1.4-1.4",moon:"M20 14.5A8 8 0 0 1 9.5 4a8 8 0 1 0 10.5 10.5Z",wand:"M5 19 15 9m2-6v2m0 4v2m-3-5h2m4 0h2M4 20l1-1",template:"M4 4h16v5H4V4Zm0 9h7v7H4v-7Zm11 0h5v7h-5v-7Z",copy:"M8 8h11a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1Zm-4 8V4a1 1 0 0 1 1-1h12",eyeOff:"M3 3l18 18M10.6 5.1A10 10 0 0 1 12 5c6 0 9.5 7 9.5 7a17 17 0 0 1-3 3.9M6.6 6.6A17 17 0 0 0 2.5 12S6 19 12 19a9.6 9.6 0 0 0 4.4-1.1M9.9 9.9a3 3 0 0 0 4.2 4.2",play:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm-2-12.5v7l6-3.5-6-3.5Z",list:"M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01",grip:"M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01",check:"M5 12.5l4.5 4.5L19 7.5",chart:"M4 4v15a1 1 0 0 0 1 1h15M8 15l3.5-4 3 2.5L20 7"};function Oe({name:e,className:t="h-5 w-5"}){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:Pe("shrink-0",t),"aria-hidden":"true",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:AN[e]||""})})}const Cv=e=>String(e||"").toLowerCase().replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ü/g,"ue").replace(/ß/g,"ss").normalize("NFD").replace(/[̀-ͯ]/g,""),pp=(e,t)=>{const n=Cv(`${e.label} ${e.group||""} ${e.keywords||""}`);return t.every(r=>n.includes(r))};function DN({open:e,onClose:t,pages:n}){const r=pr(),{hasPermission:s}=$n(),i=m.useRef(null),a=m.useRef(null),[l,u]=m.useState(""),[c,d]=m.useState(0),[f,h]=m.useState(null);Ci(i,e,t),m.useEffect(()=>{e&&(u(""),d(0),f===null&&(s("packages.manage")||s("models.manage"))&&ae.get("/models").then(w=>h(w)).catch(()=>h([])))},[e]);const g=m.useMemo(()=>{const w=Cv(l).split(/\s+/).filter(Boolean),p=n.map(v=>({...v,kind:"page"}));if(w.length===0)return p.slice(0,8);const x=(f||[]).map(v=>({key:`model-${v.id}`,kind:"model",icon:"car",label:`${v.brand_name||""} ${v.name}`.trim(),group:s("packages.manage")?"Pakete bearbeiten":"Modelle",to:s("packages.manage")?`/admin/packages?model=${v.id}`:"/admin/models"}));return[...p.filter(v=>pp(v,w)),...x.filter(v=>pp(v,w)).slice(0,8)]},[l,n,f,s]);if(m.useEffect(()=>{d(0)},[l]),m.useEffect(()=>{var w,p;(p=(w=a.current)==null?void 0:w.querySelector('[data-active="true"]'))==null||p.scrollIntoView({block:"nearest"})},[c]),!e)return null;const y=w=>{t(),w.href?window.open(w.href,"_blank","noopener"):r(w.to)},b=w=>{w.key==="ArrowDown"?(w.preventDefault(),d(p=>Math.min(p+1,g.length-1))):w.key==="ArrowUp"?(w.preventDefault(),d(p=>Math.max(p-1,0))):w.key==="Enter"&&g[c]&&(w.preventDefault(),y(g[c]))};return o.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-neutral-950/40 px-4 pt-[12vh] backdrop-blur-sm",onMouseDown:t,children:o.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":"Schnellsuche",onMouseDown:w=>w.stopPropagation(),className:"w-full max-w-xl overflow-hidden rounded-2xl border border-neutral-200 bg-white shadow-2xl dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"flex items-center gap-3 border-b border-neutral-200 px-4 dark:border-neutral-800",children:[o.jsx(Oe,{name:"search",className:"h-5 w-5 text-neutral-400"}),o.jsx("input",{value:l,onChange:w=>u(w.target.value),onKeyDown:b,placeholder:"Seite oder Fahrzeug suchen …",className:"h-14 flex-1 bg-transparent text-base text-neutral-900 placeholder:text-neutral-400 focus:outline-none dark:text-white"}),o.jsx("kbd",{className:"hidden rounded border border-neutral-200 px-1.5 py-0.5 text-[11px] font-medium text-neutral-400 dark:border-neutral-700 sm:block",children:"Esc"})]}),o.jsxs("ul",{ref:a,className:"max-h-[50vh] overflow-y-auto p-2",children:[g.length===0&&o.jsxs("li",{className:"px-3 py-8 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Nichts gefunden für „",l,"“."]}),g.map((w,p)=>o.jsx("li",{children:o.jsxs("button",{type:"button","data-active":p===c,onMouseMove:()=>d(p),onClick:()=>y(w),className:`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-sm ${p===c?"bg-brand-50 text-brand-800 dark:bg-brand-900/30 dark:text-brand-200":"text-neutral-700 dark:text-neutral-200"}`,children:[o.jsx(Oe,{name:w.icon,className:"h-[18px] w-[18px] opacity-70"}),o.jsx("span",{className:"flex-1 truncate font-medium",children:w.label}),w.group&&o.jsx("span",{className:"shrink-0 text-xs text-neutral-400",children:w.group})]})},w.key||w.to))]}),o.jsxs("div",{className:"flex items-center gap-4 border-t border-neutral-200 px-4 py-2 text-[11px] text-neutral-400 dark:border-neutral-800",children:[o.jsx("span",{children:"↑ ↓ auswählen"}),o.jsx("span",{children:"↵ öffnen"})]})]})})}const RN="/assets/logo-BNfZDkmN.png",Tv="hifi-admin-nav-collapsed",gp={system:!0};function IN(){try{return{...gp,...JSON.parse(localStorage.getItem(Tv)||"{}")}}catch{return gp}}const xp=(e,t)=>t.end?e===t.to:e===t.to||e.startsWith(`${t.to}/`);function VN({user:e,onLogout:t}){const[n,r]=m.useState(!1),s=m.useRef(null),{theme:i,toggleTheme:a}=tv(),l=(e==null?void 0:e.username)||"",u=l.slice(0,2).toUpperCase();m.useEffect(()=>{if(!n)return;const d=h=>{var g;return!((g=s.current)!=null&&g.contains(h.target))&&r(!1)},f=h=>h.key==="Escape"&&r(!1);return document.addEventListener("mousedown",d),document.addEventListener("keydown",f),()=>{document.removeEventListener("mousedown",d),document.removeEventListener("keydown",f)}},[n]);const c="flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800";return o.jsxs("div",{ref:s,className:"relative",children:[o.jsx("button",{type:"button",onClick:()=>r(d=>!d),"aria-haspopup":"menu","aria-expanded":n,title:`Angemeldet als ${l}`,className:"flex h-9 w-9 items-center justify-center rounded-full bg-brand-500 text-xs font-bold text-white ring-2 ring-white transition hover:bg-brand-600 focus-visible:outline-none focus-visible:ring-brand-500/60 dark:ring-neutral-950",children:u}),n&&o.jsxs("div",{role:"menu",className:"absolute right-0 top-11 z-40 w-60 rounded-xl border border-neutral-200 bg-white p-1.5 shadow-xl dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"px-3 pb-2 pt-1.5",children:[o.jsx("p",{className:"truncate text-sm font-semibold text-neutral-900 dark:text-white",children:l}),o.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:e!=null&&e.is_super_admin?"Super-Admin":"Admin"})]}),o.jsx("div",{className:"my-1 border-t border-neutral-100 dark:border-neutral-800"}),o.jsxs(K,{to:"/admin/account",role:"menuitem",onClick:()=>r(!1),className:c,children:[o.jsx(Oe,{name:"user",className:"h-4 w-4"})," Mein Konto"]}),o.jsxs("button",{type:"button",role:"menuitem",onClick:a,className:c,children:[o.jsx(Oe,{name:i==="dark"?"sun":"moon",className:"h-4 w-4"}),i==="dark"?"Helles Design":"Dunkles Design"]}),o.jsx("div",{className:"my-1 border-t border-neutral-100 dark:border-neutral-800"}),o.jsxs("button",{type:"button",role:"menuitem",onClick:t,className:`${c} text-red-600 dark:text-red-400`,children:[o.jsx(Oe,{name:"logout",className:"h-4 w-4"})," Abmelden"]})]})]})}function FN(){const{logout:e,user:t,hasPermission:n}=$n(),r=pr(),{pathname:s}=Ye(),[i,a]=m.useState(!1),[l,u]=m.useState(!1),[c,d]=m.useState(IN),[f,h]=m.useState(0),[g,y]=m.useState([]),b=m.useRef(null),[w,p]=m.useState([]),[x,v]=m.useState(!1),[k,E]=m.useState(null);Ci(b,i,()=>a(!1));const C=m.useCallback(()=>{n("contact.manage")&&ae.get("/contact").then(V=>h(V.filter(T=>T.status==="new").length)).catch(()=>{}),ae.get("/site-settings").then(V=>p(V.hidden_areas||[])).catch(()=>{}),ae.get("/maintenance").then(V=>{var T,M;v(!!((T=V==null?void 0:V.global)!=null&&T.enabled)),E((M=V==null?void 0:V.countdown)!=null&&M.active?V.countdown.launch_at:null)}).catch(()=>{})},[t==null?void 0:t.id]);m.useEffect(()=>{C();const V=setInterval(C,2*60*1e3);return()=>clearInterval(V)},[C]),m.useEffect(()=>{const V=T=>{(T.ctrlKey||T.metaKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),u(!0))};return document.addEventListener("keydown",V),()=>document.removeEventListener("keydown",V)},[]),m.useEffect(()=>{a(!1)},[s]);const j=pN.filter(V=>w.includes(V.key)).map(V=>V.label),S=()=>ae.get("/custom-fonts").then(y).catch(()=>{});m.useEffect(()=>{S()},[]);const N=m.useMemo(()=>[{id:"main",title:null,links:[{to:"/admin",label:"Übersicht",icon:"gauge",end:!0,keywords:"dashboard start"},{to:"/admin/traffic",label:"Besucher",icon:"chart",permission:"system.admin",keywords:"statistik analytics traffic zugriffe trend"},{to:"/admin/contact-requests",label:"Anfragen",icon:"inbox",permission:"contact.manage",badge:f,keywords:"kontakt kunden nachrichten"}]},{id:"vehicles",title:"Fahrzeuge & Pakete",links:[{to:"/admin/brands",label:"Fahrzeugmarken",icon:"tag",permission:"brands.manage",keywords:"hersteller vorlage"},{to:"/admin/models",label:"Modelle",icon:"car",permission:"models.manage",keywords:"fahrzeuge"},{to:"/admin/packages",label:"Pakete",icon:"box",permission:"packages.manage",keywords:"preise produkte upgrades"}]},{id:"content",title:"Website-Inhalte",links:[{to:"/admin/home-sections",label:"Startseite",icon:"home",permission:"content.manage",keywords:"titelbild texte"},{to:"/admin/services",label:"Leistungen",icon:"briefcase",permission:"services.manage"},{to:"/admin/faqs",label:"FAQ",icon:"help",permission:"content.manage",keywords:"fragen"},{to:"/admin/partners",label:"Partner-Logos",icon:"shield",permission:"content.manage"},{to:"/admin/downloads",label:"Downloads",icon:"download",permission:"downloads.manage",keywords:"dateien pdf"}]},{id:"gallery",title:"Bildergalerie",links:[{to:"/admin/gallery-brands",label:"Galerie-Marken",icon:"images",permission:"gallery.manage"},{to:"/admin/gallery-projects",label:"Projekte & Fotos",icon:"camera",permission:"gallery.manage",keywords:"bilder hochladen"}]},{id:"company",title:"Firma & Aussehen",links:[{to:"/admin/settings/company",label:"Firmendaten",icon:"building",permission:"settings.manage",keywords:"oeffnungszeiten telefon adresse whatsapp email preis hinweis"},{to:"/admin/settings/design",label:"Aussehen",icon:"palette",permission:"settings.manage",keywords:"schrift farben kacheln"},{to:"/admin/settings/images",label:"Bilder",icon:"image",permission:"settings.manage",keywords:"logo favicon hintergrund"},{to:"/admin/settings/legal",label:"Rechtstexte",icon:"file",permission:"settings.manage",keywords:"impressum datenschutz agb"},{to:"/admin/settings/maintenance",label:"Wartungsmodus",icon:"pause",permission:"settings.manage",keywords:"wartung offline"},{to:"/admin/settings/countdown",label:"Launch-Countdown",icon:"timer",permission:"settings.manage",keywords:"start eroeffnung"}]},{id:"system",title:"System (Experten)",links:[{to:"/admin/users",label:"Benutzer",icon:"users",permission:"users.manage",keywords:"mitarbeiter konten"},{to:"/admin/permission-groups",label:"Berechtigungsgruppen",icon:"key",permission:"permission_groups.manage",keywords:"rechte rollen"},{to:"/admin/settings/email",label:"E-Mail-Versand",icon:"send",permission:"system.admin",keywords:"smtp mail"},{to:"/admin/settings/google",label:"Google-Dienste",icon:"globe",permission:"system.admin",keywords:"analytics rezensionen bewertungen"},{to:"/admin/settings/connections",label:"Verbindungstest",icon:"link",permission:"system.admin"},{to:"/admin/settings/database",label:"Datenbank",icon:"server",permission:"system.admin"},{to:"/admin/settings/export-import",label:"Export & Import",icon:"transfer",permission:"system.admin",keywords:"sicherung backup"},{to:"/admin/settings/update",label:"Updates",icon:"refresh",permission:"system.update",keywords:"git version"},{to:"/admin/settings/reset",label:"Zurücksetzen",icon:"trash",permission:"system.admin",keywords:"loeschen"}]}].map(V=>({...V,links:V.links.filter(T=>!T.permission||n(T.permission))})).filter(V=>V.links.length>0),[t==null?void 0:t.id,f]),P=m.useMemo(()=>[...N.flatMap(V=>V.links.map(T=>({...T,group:V.title}))),{to:"/admin/account",label:"Mein Konto",icon:"user",keywords:"passwort 2fa profil"}],[N]),F=P.filter(V=>xp(s,V)).sort((V,T)=>T.to.length-V.to.length)[0],B=V=>{d(T=>{const M={...T,[V]:!T[V]};try{localStorage.setItem(Tv,JSON.stringify(M))}catch{}return M})},se=async()=>{await e(),r("/admin/login")},ne=["content.manage","services.manage","packages.manage","gallery.manage","settings.manage"].some(n),q=({isActive:V})=>`group relative flex items-center justify-between gap-2 rounded-lg px-3 py-2 text-sm transition ${V?"bg-brand-50 font-semibold text-brand-800 before:absolute before:inset-y-1.5 before:left-0 before:w-[3px] before:rounded-full before:bg-brand-500 dark:bg-brand-500/10 dark:text-brand-300":"font-medium text-neutral-600 hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800/70 dark:hover:text-neutral-100"}`,G=o.jsxs("div",{className:"flex h-full flex-col",children:[o.jsxs("div",{className:"flex items-center gap-2 px-5 pb-4 pt-5",children:[o.jsxs(K,{to:"/admin",className:"rounded-lg",children:[o.jsx("img",{src:RN,alt:"HifiPlanet",className:"h-7 w-auto dark:hidden"}),o.jsx("img",{src:Jd,alt:"HifiPlanet",className:"hidden h-7 w-auto dark:block"})]}),o.jsx("span",{className:"rounded-md bg-neutral-100 px-1.5 py-0.5 text-[11px] font-semibold uppercase tracking-wide text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400",children:"Admin"})]}),o.jsx("div",{className:"px-3 pb-3",children:o.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex h-9 w-full items-center gap-2 rounded-lg border border-neutral-200 bg-white px-3 text-sm text-neutral-400 shadow-sm transition hover:border-neutral-300 hover:text-neutral-600 dark:border-neutral-800 dark:bg-neutral-900 dark:hover:border-neutral-700 dark:hover:text-neutral-300",children:[o.jsx(Oe,{name:"search",className:"h-4 w-4"}),o.jsx("span",{className:"flex-1 text-left",children:"Suchen …"}),o.jsx("kbd",{className:"hidden rounded border border-neutral-200 px-1 text-[10px] font-medium dark:border-neutral-700 lg:block",children:"Strg K"})]})}),o.jsx("nav",{className:"flex-1 space-y-4 overflow-y-auto px-3 pb-6",children:N.map(V=>{const T=V.links.some(R=>xp(s,R)),M=V.title&&c[V.id]&&!T,A=V.links.reduce((R,H)=>R+(H.badge||0),0);return o.jsxs("div",{children:[V.title&&o.jsxs("button",{type:"button",onClick:()=>B(V.id),"aria-expanded":!M,className:"mb-1 flex w-full items-center justify-between rounded-md px-3 py-1 text-[11px] font-semibold uppercase tracking-wider text-neutral-400 hover:text-neutral-600 dark:text-neutral-500 dark:hover:text-neutral-300",children:[o.jsx("span",{children:V.title}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[M&&A>0&&o.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"}),o.jsx(Oe,{name:"chevron",className:`h-3.5 w-3.5 transition-transform ${M?"":"rotate-90"}`})]})]}),!M&&o.jsx("div",{className:"space-y-0.5",children:V.links.map(R=>o.jsxs(ok,{to:R.to,end:R.end,className:q,children:[o.jsxs("span",{className:"flex min-w-0 items-center gap-3",children:[o.jsx(Oe,{name:R.icon,className:"h-[18px] w-[18px] opacity-80"}),o.jsx("span",{className:"truncate",children:R.label})]}),!!R.badge&&o.jsx("span",{className:"min-w-[20px] rounded-full bg-red-500 px-1.5 py-0.5 text-center text-[11px] font-bold leading-none text-white",children:R.badge})]},R.to))})]},V.id)})})]});return o.jsxs(SN,{onRefreshCounters:C,children:[o.jsx(CN,{}),o.jsxs(bv,{value:{fonts:g,refresh:S},children:[o.jsxs("div",{className:"flex min-h-screen bg-neutral-100/60 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[o.jsx(Sv,{}),o.jsx("aside",{className:"sticky top-0 hidden h-screen w-64 shrink-0 border-r border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900/40 lg:block",children:G}),i&&o.jsxs("div",{className:"fixed inset-0 z-40 lg:hidden",children:[o.jsx("div",{className:"absolute inset-0 bg-neutral-950/50 backdrop-blur-sm",onClick:()=>a(!1)}),o.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":"Menü",className:"absolute inset-y-0 left-0 w-72 max-w-[85vw] bg-white shadow-2xl dark:bg-neutral-900",children:[o.jsx("button",{type:"button",onClick:()=>a(!1),"aria-label":"Menü schließen",className:"absolute right-3 top-4 rounded-lg p-1.5 text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",children:o.jsx(Oe,{name:"close",className:"h-5 w-5"})}),G]})]}),o.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[o.jsx("header",{className:"sticky top-0 z-30 border-b border-neutral-200 bg-white/85 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/85",children:o.jsxs("div",{className:"flex h-16 items-center gap-3 px-4 sm:px-6",children:[o.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":"Menü öffnen",className:"-ml-1 rounded-lg p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800 lg:hidden",children:o.jsx(Oe,{name:"menu",className:"h-6 w-6"})}),o.jsxs("div",{className:"min-w-0 flex-1",children:[(F==null?void 0:F.group)&&o.jsx("p",{className:"hidden truncate text-xs font-medium text-neutral-400 sm:block",children:F.group}),o.jsx("p",{className:"truncate text-sm font-semibold text-neutral-900 dark:text-white",children:(F==null?void 0:F.label)||"Admin"})]}),o.jsx("button",{type:"button",onClick:()=>u(!0),"aria-label":"Suchen",className:"rounded-lg p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800 lg:hidden",children:o.jsx(Oe,{name:"search",className:"h-5 w-5"})}),ne&&o.jsxs("a",{href:"/?bearbeiten=1",target:"_blank",rel:"noopener noreferrer",className:xc({variant:"secondary",size:"sm",className:"hidden sm:inline-flex"}),children:[o.jsx(Oe,{name:"pencil",className:"h-4 w-4"}),"Live bearbeiten"]}),o.jsxs("a",{href:"/",target:"_blank",rel:"noopener noreferrer",title:"Website in neuem Tab öffnen",className:xc({variant:"secondary",size:"sm",className:"px-2 sm:px-3"}),children:[o.jsx(Oe,{name:"external",className:"h-4 w-4"}),o.jsx("span",{className:"hidden sm:inline",children:"Website"})]}),o.jsx(VN,{user:t,onLogout:se})]})}),(x||k||j.length>0)&&o.jsxs("div",{className:"border-b border-amber-200 bg-amber-50 px-4 py-2 text-sm text-amber-900 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-200 sm:px-6",children:[x&&o.jsxs("p",{children:[o.jsx("strong",{children:"Wartungsmodus ist aktiv"})," – Besucher sehen gerade nur die Wartungsseite."," ",n("settings.manage")&&o.jsx(K,{to:"/admin/settings/maintenance",className:"underline",children:"Ändern"})]}),k&&o.jsxs("p",{children:[o.jsx("strong",{children:"Launch-Countdown läuft"})," – Besucher sehen bis"," ",new Date(k).toLocaleString("de-DE",{dateStyle:"medium",timeStyle:"short",timeZone:"Europe/Berlin"})," Uhr nur den Countdown."," ",n("settings.manage")&&o.jsx(K,{to:"/admin/settings/countdown",className:"underline",children:"Ändern"})]}),j.length>0&&o.jsxs("p",{children:[o.jsx("strong",{children:"Ausgeblendet für Besucher:"})," ",j.join(", "),"."," ",o.jsx(K,{to:"/admin",className:"underline",children:"Auf der Übersicht ändern"})]})]}),o.jsx("main",{className:"mx-auto w-full max-w-7xl flex-1 p-4 sm:p-6 lg:p-8",children:o.jsx(m.Suspense,{fallback:o.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),children:o.jsx(yd,{})})})]})]}),o.jsx(DN,{open:l,onClose:()=>u(!1),pages:P})]})]})}function ON(){const{user:e,loading:t}=$n();return t?o.jsx("div",{className:"flex min-h-screen items-center justify-center text-neutral-500",children:"Lädt…"}):e?o.jsx(yd,{}):o.jsx(ur,{to:"/admin/login",replace:!0})}function oe({permission:e,children:t}){const{hasPermission:n}=$n();return(Array.isArray(e)?e:[e]).some(i=>n(i))?t:o.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-8 text-center dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsx("h1",{className:"mb-2 text-lg font-bold text-neutral-900 dark:text-white",children:"Keine Berechtigung"}),o.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 wa(e,t,n="name"){if(!t)return;let r=document.head.querySelector(`meta[${n}="${e}"]`);r||(r=document.createElement("meta"),r.setAttribute(n,e),document.head.appendChild(r)),r.setAttribute("content",t)}function zN(e){let t=document.head.querySelector('link[rel="canonical"]');t||(t=document.createElement("link"),t.setAttribute("rel","canonical"),document.head.appendChild(t)),t.setAttribute("href",`https://hifi-planet.de${e}`),wa("og:url",`https://hifi-planet.de${e}`,"property")}function yp(e){let t=document.head.querySelector('meta[name="robots"]');if(!e){t==null||t.remove();return}t||(t=document.createElement("meta"),t.setAttribute("name","robots"),document.head.appendChild(t)),t.setAttribute("content","noindex")}function gr({title:e,description:t,path:n,noindex:r=!1}){m.useEffect(()=>(yp(r),()=>yp(!1)),[r]),m.useEffect(()=>{e&&(document.title=`${e} | HifiPlanet`,wa("og:title",`${e} | HifiPlanet`,"property")),t&&(wa("description",t),wa("og:description",t,"property")),n&&zN(n)},[e,t,n])}const BN=[.16,1,.3,1],vp={up:{y:40},left:{x:-56},right:{x:56}};function $N(e){return{hidden:{opacity:0,scale:.96,filter:"blur(8px)",...vp[e]||vp.up},visible:{opacity:1,scale:1,x:0,y:0,filter:"blur(0px)"}}}const HN={hidden:{x:"-130%"},visible:{x:"230%",transition:{duration:1.1,ease:"easeInOut",delay:.4}}};function Ue({children:e,direction:t="up",className:n="",index:r=0,shine:s=!1,style:i}){const a=Math.min(r*.09,.45);return o.jsxs(nn.div,{className:n,style:{position:"relative",overflow:"hidden",...i},initial:"hidden",whileInView:"visible",viewport:{once:!0,amount:.25,margin:"-100px"},variants:$N(t),transition:{duration:.75,ease:BN,delay:a},children:[e,s&&o.jsx(nn.div,{"aria-hidden":!0,variants:HN,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"})]})}const Oo=e=>{e.preventDefault(),e.stopPropagation()};function UN(e){e.preventDefault();const t=e.clipboardData.getData("text/plain");document.execCommand("insertText",!1,t)}function ce({entity:e,id:t,field:n,lang:r,value:s,as:i="span",multiline:a=!1,placeholder:l="Text eingeben…",className:u="",...c}){const{language:d}=xe(),f=Xe(),h=r||d,g=f.getValue(e,t,n,h,s??"")??"";if(!f.canEdit(e))return o.jsx(i,{className:u,...c,children:g});const y=b=>{const w=a?b.innerText.replace(/\n{3,}/g,` -`).trim():b.innerText.replace(/\s+/g," ").trim();w!==g.trim()&&f.setValue(e,t,n,h,w),b.innerText!==w&&(b.innerText=w)};return o.jsx(i,{...c,className:`${u} live-editable${f.hasPending(e,t,n,h)?" live-editable-changed":""}`,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!0,"data-live-placeholder":l,onClick:Oo,onPaste:UN,onKeyDown:b=>{b.key==="Enter"&&!a?(b.preventDefault(),b.currentTarget.blur()):b.key==="Escape"&&(b.currentTarget.innerText=g,b.currentTarget.blur()),b.stopPropagation()},onKeyUp:b=>b.stopPropagation(),onBlur:b=>v(b.currentTarget),children:g},`${h}:${g}`)}function Ge({k:e,...t}){const{t:n}=xe();return o.jsx(ce,{entity:"text",id:e,field:"value",value:n(e),placeholder:"Leer = Standardtext",...t})}function vr({entity:e,id:t,field:n,lang:r,value:s,label:i="Text",className:a="",...l}){const{language:u}=xe(),c=Xe(),d=r||u,f=c.getValue(e,t,n,d,s??"")??"";if(!c.canEdit(e))return o.jsx("div",{className:a,...l,dangerouslySetInnerHTML:{__html:f}});const h=g=>{Oo(g),c.openEditor({kind:"html",entity:e,id:t,field:n,lang:d,label:i,original:f})};return o.jsx("div",{...l,className:`${a} live-editable live-editable-block${c.hasPending(e,t,n,d)?" live-editable-changed":""}`,role:"button",tabIndex:0,title:"Klicken zum Bearbeiten",onClick:h,onKeyDown:g=>g.key==="Enter"&&h(g),"data-live-placeholder":"Text hinzufügen…",dangerouslySetInnerHTML:{__html:f}})}function yc({entity:e,id:t,field:n,lang:r,value:s,label:i,kind:a="textarea",hint:l,as:u="div",className:c="",children:d,...f}){const{language:h}=xe(),g=Xe(),v=r||h;if(!g.canEdit(e))return o.jsx(u,{className:c,...f,children:d});const b=g.getValue(e,t,n,v,s??"")??"",w=p=>{Oo(p),g.openEditor({kind:a,entity:e,id:t,field:n,lang:v,label:i,hint:l,original:b})};return o.jsx(u,{...f,className:`${c} live-editable live-editable-block${g.hasPending(e,t,n,v)?" live-editable-changed":""}`,role:"button",tabIndex:0,title:`${i} bearbeiten`,onClickCapture:w,onKeyDown:p=>p.key==="Enter"&&w(p),children:d})}function ws({id:e,value:t,label:n="Bild",aspect:r,buttonLabel:s="Bild tauschen",as:i="div",className:a="",children:l,...u}){const c=Xe();if(!c.canEdit("site_images"))return l?o.jsx(i,{className:a,...u,children:l}):null;const d=f=>{Oo(f),c.openEditor({kind:"image",entity:"site_images",id:e,field:"path",lang:"de",label:n,aspect:r,original:t||""})};return o.jsxs(i,{...u,className:`${a}${/\babsolute\b/.test(a)?"":" relative"}${c.hasPending("site_images",e,"path","de")?" live-editable-changed":""}`,children:[l,o.jsxs("button",{type:"button",onClick:d,className:"absolute left-2 top-2 z-10 inline-flex items-center gap-1.5 rounded-full bg-black/75 px-3 py-1.5 text-xs font-semibold text-white shadow-lg ring-1 ring-white/30 backdrop-blur hover:bg-black/90",children:[o.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[o.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),o.jsx("circle",{cx:"9",cy:"9",r:"2"}),o.jsx("path",{d:"m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21"})]}),s]})]})}function WN({items:e,entity:t="faqs"}){const[n,r]=m.useState(null),s=Xe(),{language:i}=xe();return s.canEdit(t)?o.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:e.map((a,l)=>o.jsxs("div",{className:"space-y-3 px-5 py-4",children:[o.jsx(ce,{entity:t,id:a.id,field:"question",value:a.question,as:"p",className:"block font-medium text-neutral-900 dark:text-white",placeholder:"Frage"}),o.jsx(ce,{entity:t,id:a.id,field:"answer",value:a.answer,as:"p",multiline:!0,className:"block whitespace-pre-line text-sm text-neutral-600 dark:text-neutral-300",placeholder:"Antwort"})]},a.id??l))}):o.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:e.map((a,l)=>{const u=n===l,c=a.id?{...a,question:s.getValue(t,a.id,"question",i,a.question),answer:s.getValue(t,a.id,"answer",i,a.answer)}:a;return o.jsxs("div",{children:[o.jsxs("button",{onClick:()=>r(u?null:l),className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left","aria-expanded":u,children:[o.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:c.question}),o.jsx(nn.svg,{animate:{rotate:u?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:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6 9 6 6 6-6"})})]}),o.jsx(nE,{initial:!1,children:u&&o.jsx(nn.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:o.jsx("p",{className:"px-5 pb-4 text-sm text-neutral-600 dark:text-neutral-300",children:c.answer})})})]},c.id??c.question)})})}function Pv({count:e=5,className:t="h-4 w-4"}){return o.jsx("div",{className:"flex gap-0.5 text-amber-400",children:Array.from({length:e}).map((n,r)=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:t,children:o.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 GN=70;function KN({testimonials:e}){const t=m.useRef(null),n=m.useRef(null),r=m.useRef({pos:0,half:0,hovering:!1,dragging:!1,dragStartX:0,dragStartPos:0,lastTime:null,rafId:null}).current;m.useLayoutEffect(()=>{const i=n.current,a=window.matchMedia("(prefers-reduced-motion: reduce)").matches,l=()=>{i.style.transform=`translateX(${r.pos}px)`},u=x=>{if(r.half<=0)return x;for(;x>0;)x-=r.half;for(;x<=-r.half;)x+=r.half;return x},c=()=>{r.half=i.scrollWidth/2,r.pos===0?r.pos=-r.half:r.pos=u(r.pos),l()};c();const d=new ResizeObserver(c);d.observe(i);const f=x=>{r.lastTime===null&&(r.lastTime=x);const y=(x-r.lastTime)/1e3;r.lastTime=x,!r.dragging&&!r.hovering&&!a&&(r.pos=u(r.pos+GN*y),l()),r.rafId=requestAnimationFrame(f)};r.rafId=requestAnimationFrame(f);const h=t.current,g=()=>{r.hovering=!0},v=()=>{r.hovering=!1},b=x=>{r.dragging=!0,r.dragStartX=x.clientX,r.dragStartPos=r.pos,h.setPointerCapture(x.pointerId),h.classList.add("cursor-grabbing"),h.classList.remove("cursor-grab")},w=x=>{r.dragging&&(r.pos=u(r.dragStartPos+(x.clientX-r.dragStartX)),l())},p=x=>{r.dragging&&(r.dragging=!1,h.hasPointerCapture(x.pointerId)&&h.releasePointerCapture(x.pointerId),h.classList.remove("cursor-grabbing"),h.classList.add("cursor-grab"))};return h.addEventListener("pointerenter",g),h.addEventListener("pointerleave",v),h.addEventListener("pointerdown",b),h.addEventListener("pointermove",w),h.addEventListener("pointerup",p),h.addEventListener("pointercancel",p),()=>{cancelAnimationFrame(r.rafId),d.disconnect(),h.removeEventListener("pointerenter",g),h.removeEventListener("pointerleave",v),h.removeEventListener("pointerdown",b),h.removeEventListener("pointermove",w),h.removeEventListener("pointerup",p),h.removeEventListener("pointercancel",p)}},[e.length]);const s=[...e,...e];return o.jsx("div",{ref:t,className:"marquee-viewport cursor-grab touch-pan-y select-none overflow-hidden",children:o.jsx("div",{ref:n,className:"marquee-track flex w-max gap-5",children:s.map((i,a)=>o.jsx("div",{className:"w-64 shrink-0 sm:w-72 lg:w-80",children:o.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:[o.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:o.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"})}),o.jsx(Pv,{className:"relative z-10 mb-3 h-4 w-4",count:i.rating||5}),o.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,'"']}),o.jsxs("div",{className:"relative z-10 mt-auto flex items-center gap-3",children:[i.photo?o.jsx("img",{src:i.photo,alt:"",referrerPolicy:"no-referrer",className:"h-9 w-9 shrink-0 rounded-full object-cover"}):o.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()}),o.jsx("p",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:i.name})]})]})},`${i.name}-${a}`))})})}function wp(e,t,n={x:0,y:0}){const r=Math.max(0,Math.min(100,e==null?n.x:Number(e)||0)),s=Math.max(0,Math.min(100,t==null?n.y:Number(t)||0));return{left:`${r}%`,top:`${s}%`,transform:`translate(-${r}%, -${s}%)`}}const qN="/assets/gallery-dash2-CEVCErVK.webp",YN="/assets/youtube-hintergrund-BqSbCrLQ.mp4",XN="/assets/youtube-hintergrund-mobil-BolxAIc0.mp4",Zi={left:"text-left",center:"text-center",right:"text-right"},ZN={left:"",center:"mx-auto",right:"ml-auto"},QN={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 bp({slug:e,label:t,url:n,className:r,style:s}){const{hidden_areas:i}=Pt(),a=Xe();return e&&a.canEdit("home_sections")?o.jsxs("span",{className:"inline-flex flex-wrap items-center justify-center gap-2",children:[o.jsx(ce,{entity:"home_sections",id:e,field:"button_label",value:t,className:r,style:s,placeholder:"Button-Text (leer = kein Button)"}),o.jsxs(yc,{entity:"home_sections",id:e,field:"button_url",lang:"de",value:n,kind:"input",label:"Button-Ziel",hint:"Interne Seite mit / am Anfang (z. B. /leistungen) oder volle Adresse (https://...).",as:"span",className:"rounded bg-black/60 px-2 py-1 text-xs font-medium text-white",children:["Ziel: ",n||"–"]})]}):!t||!n||Ev(n,i)?null:n.startsWith("/")?o.jsx(K,{to:n,className:r,style:s,children:t}):o.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:r,style:s,children:t})}function JN(){const{hero_image_path:e}=Pt(),t=e||qN,{t:n,language:r}=xe(),s=Do(),i=Xe(),a=i.canEdit("home_sections"),l=!s("page.vehicles"),u=n("home.stats"),c=Ro(),d=c.slot("craft"),f=c.slot("advice"),h=c.slot("youtube_poster"),g=c.slot("more"),v=n("home.galleryAlts"),b=c.insights().map((L,$)=>({...L,alt:v[$]||v[0]||""})),[w,p]=m.useState([]),[x,y]=m.useState({}),[k,E]=m.useState(!1),[C,j]=m.useState([]),S=L=>{const $=x[L]||QN,Qe=k&&{hero:n("home.heroTitle"),craft:n("home.craftTitle")}[L]||"",Hn=k&&L==="hero"?`

${n("home.heroSubtitle")}

`:"";return{eyebrow:i.getValue("home_sections",L,"eyebrow",r,$[`eyebrow_${r}`]||""),title:i.getValue("home_sections",L,"title",r,$[`title_${r}`]||Qe),bodyHtml:i.getValue("home_sections",L,"body_html",r,$[`body_html_${r}`]||Hn),align:$.text_align||"center",alignX:$.text_align_x,alignY:$.text_align_y,buttonLabel:i.getValue("home_sections",L,"button_label",r,$[`button_label_${r}`]||""),buttonUrl:i.getValue("home_sections",L,"button_url","de",$.button_url||""),fontFamily:$.font_family||void 0}},N=We("home_sections.hero.eyebrow"),P=We("home_sections.hero.title"),F=We("home_sections.youtube.eyebrow"),B=We("home_sections.youtube.title"),se=We("home_sections.youtube.button_label"),ne=We("home_sections.craft.eyebrow"),q=We("home_sections.craft.title"),G=We("home_sections.advice.eyebrow"),V=We("home_sections.advice.title"),T=We("home_sections.insights.eyebrow"),M=We("home_sections.insights.title"),A=We("home_sections.more.eyebrow"),R=We("home_sections.more.title"),H=We("home_sections.more.button_label");m.useEffect(()=>{ae.get("/home-sections").then(y).catch(()=>E(!0))},[]),m.useEffect(()=>{ae.get("/partners").then(j).catch(()=>{})},[]);const[_,I]=m.useState(null),Y=_?_.reviews.filter(L=>L.review_text).map(L=>({name:L.author_name,text:L.review_text,rating:L.rating,photo:L.profile_photo_url})):n("home.testimonials");m.useEffect(()=>{ae.get("/faqs").then(L=>{p(L.map($=>({id:$.id,question:r==="de"?$.question_de:$.question_en,answer:r==="de"?$.answer_de:$.answer_en})))}).catch(()=>{})},[r]),m.useEffect(()=>{ae.get("/google-reviews").then(L=>{L.rating!=null&&L.reviews.some($=>$.review_text)&&I(L)}).catch(()=>{})},[]),gr({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),m.useEffect(()=>{if(w.length===0||s("home.faq"))return;const L=document.createElement("script");return L.type="application/ld+json",L.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:w.map($=>({"@type":"Question",name:$.question,acceptedAnswer:{"@type":"Answer",text:$.answer}}))}),document.head.appendChild(L),()=>document.head.removeChild(L)},[w]),m.useEffect(()=>{var L;w.length>0&&window.location.hash==="#faq"&&((L=document.getElementById("faq"))==null||L.scrollIntoView())},[w]);const Z=m.useRef(null);m.useEffect(()=>{var uf,cf,df;const L=Z.current;if(!L)return;const $=(uf=window.matchMedia)==null?void 0:uf.call(window,"(prefers-reduced-motion: reduce)").matches,Qe=(cf=navigator.connection)==null?void 0:cf.saveData;if($||Qe)return;const Nv=((df=window.matchMedia)==null?void 0:df.call(window,"(max-width: 767px), (pointer: coarse)").matches)?XN:YN,lf=new IntersectionObserver(([_v])=>{_v.isIntersecting?(L.getAttribute("src")||(L.src=Nv),L.play().catch(()=>{})):L.paused||L.pause()},{rootMargin:"300px 0px"});return lf.observe(L),()=>lf.disconnect()},[]);const ue=m.useRef(null),{scrollYProgress:Q}=Hy({target:ue,offset:["start start","end start"]}),ke=IC(),De=gn(Q,[0,1],ke?["0%","0%"]:["-6%","6%"]),Ze=gn(Q,[0,1],ke?["0%","0%"]:["0%","60%"]),dt=gn(Q,[0,.8],[1,0]),he=gn(Q,[.5,1],[0,1]),ft=gn(he,L=>L>.05?"auto":"none"),W=gn(Q,[.5,1],[16,0]);return o.jsxs("div",{children:[o.jsx(nn.div,{style:{opacity:he,pointerEvents:ft,y:W},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:o.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[o.jsx(Ge,{k:"home.stickyCta",as:"p",className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block"}),o.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[l&&o.jsx(K,{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:o.jsx(Ge,{k:"home.selectVehicle"})}),o.jsx(K,{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:o.jsx(Ge,{k:"home.getInTouch"})})]})]})}),o.jsxs("section",{ref:ue,className:"relative -mt-[89px] h-svh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[o.jsx(nn.img,{style:{y:De,scale:1.15},src:t,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),o.jsx(nn.div,{style:{y:Ze,opacity:dt},className:"absolute inset-0",children:o.jsx("div",{className:"absolute w-full max-w-2xl px-4 text-center sm:px-6",style:{...wp(S("hero").alignX,S("hero").alignY,{x:50,y:50}),fontFamily:S("hero").fontFamily},children:o.jsxs(nn.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[(S("hero").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"hero",field:"eyebrow",value:S("hero").eyebrow,as:"p",className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",style:N,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"hero",field:"title",value:S("hero").title,as:"h1",className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",style:P,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"hero",field:"body_html",value:S("hero").bodyHtml,label:"Text",className:"legal-content mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg"}),o.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[l&&o.jsx(K,{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:o.jsx(Ge,{k:"home.selectVehicle"})}),o.jsx(K,{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:o.jsx(Ge,{k:"home.getInTouch"})})]})]})})})]}),!s("home.stats")&&o.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:o.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:u.map((L,$)=>o.jsxs(Ue,{index:$,children:[o.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:L.value}),o.jsx("p",{className:"text-sm text-neutral-400",children:L.label})]},L.label))})}),!s("home.partners")&&o.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:o.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[o.jsx(Ge,{k:"home.brandsHeading",as:"p",className:"mb-4 block text-center text-xs font-semibold uppercase tracking-wide text-neutral-400"}),o.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:C.map((L,$)=>o.jsx(Ue,{index:$,children:L.logo_path?o.jsx("img",{src:L.logo_path,alt:L.name,className:"h-8 max-w-[8rem] object-contain opacity-70 grayscale transition hover:opacity-100 hover:grayscale-0"}):o.jsx(ce,{entity:"partners",id:L.id,field:"name",lang:"de",value:L.name,className:"text-lg font-bold text-neutral-400 dark:text-neutral-600"})},L.id))})]})}),!s("home.youtube")&&o.jsxs("section",{className:"relative min-h-[70vh] overflow-hidden sm:min-h-[85vh]",children:[o.jsx("video",{ref:Z,loop:!0,muted:!0,playsInline:!0,preload:"none",poster:h.src,className:"absolute inset-0 h-full w-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-black/55"}),o.jsx(ws,{id:"youtube_poster",value:h.custom,label:Zt.youtube_poster.label,aspect:Zt.youtube_poster.aspect,buttonLabel:"Video-Standbild tauschen",className:"absolute left-0 top-0 h-12 w-64"}),o.jsx("div",{className:"absolute w-full max-w-3xl px-4 text-center sm:px-6",style:{...wp(S("youtube").alignX,S("youtube").alignY,{x:50,y:50}),fontFamily:S("youtube").fontFamily},children:o.jsxs(Ue,{children:[(S("youtube").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"youtube",field:"eyebrow",value:S("youtube").eyebrow,as:"p",className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",style:F,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"youtube",field:"title",value:S("youtube").title,as:"h2",className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",style:B,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"youtube",field:"body_html",value:S("youtube").bodyHtml,label:"Text",className:"legal-content mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm"}),o.jsx(bp,{slug:"youtube",label:S("youtube").buttonLabel,url:S("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",style:se})]})})]}),!s("home.craft")&&o.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:o.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[o.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[o.jsx(Ue,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:o.jsx(ws,{id:"craft",value:d.custom,label:Zt.craft.label,aspect:Zt.craft.aspect,children:o.jsx("img",{src:d.src,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})}),o.jsxs(Ue,{direction:"right",index:1,className:Zi[S("craft").align],style:{fontFamily:S("craft").fontFamily},children:[(S("craft").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"craft",field:"eyebrow",value:S("craft").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:ne,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"craft",field:"title",value:S("craft").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:q,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"craft",field:"body_html",value:S("craft").bodyHtml,label:"Text",className:"legal-content text-neutral-600 dark:text-neutral-300"})]})]}),o.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[o.jsxs(Ue,{direction:"left",className:`order-2 md:order-1 ${Zi[S("advice").align]}`,style:{fontFamily:S("advice").fontFamily},children:[(S("advice").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"advice",field:"eyebrow",value:S("advice").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:G,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"advice",field:"title",value:S("advice").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:V,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"advice",field:"body_html",value:S("advice").bodyHtml,label:"Text",className:"legal-content text-neutral-600 dark:text-neutral-300"})]}),o.jsx(Ue,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:o.jsx(ws,{id:"advice",value:f.custom,label:Zt.advice.label,aspect:Zt.advice.aspect,children:o.jsx("img",{src:f.src,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})})]})]})}),!s("home.insights")&&o.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[o.jsxs(Ue,{className:`mb-8 ${Zi[S("insights").align]}`,style:{fontFamily:S("insights").fontFamily},children:[(S("insights").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"insights",field:"eyebrow",value:S("insights").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:T,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"insights",field:"title",value:S("insights").title,as:"h2",className:"text-2xl font-bold text-neutral-900 dark:text-white",style:M,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"insights",field:"body_html",value:S("insights").bodyHtml,label:"Text",className:"legal-content mt-2 text-neutral-600 dark:text-neutral-300"})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:b.map((L,$)=>o.jsx(Ue,{index:$%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:o.jsx(ws,{id:L.id,value:L.custom,label:`Einblicke: Foto ${$+1}`,aspect:1,className:"h-full w-full",children:o.jsx("img",{src:L.src,alt:L.alt,width:L.width,height:L.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},L.id))})]}),!s("home.reviews")&&o.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:o.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[o.jsxs(Ue,{className:"mb-10 text-center",children:[o.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:o.jsx(Pv,{className:"h-6 w-6",count:_?Math.round(_.rating):5})}),o.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:_?n("home.reviewsRatingDynamic")(_.rating,_.rating_count):n("home.reviewsRating")}),o.jsx(Ge,{k:"home.reviewsText",as:"p",className:"mt-1 text-neutral-600 dark:text-neutral-300"}),o.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:o.jsx(Ge,{k:"home.reviewsLink"})})]}),o.jsx(Ue,{children:o.jsx(KN,{testimonials:Y})})]})}),!s("home.more")&&o.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:o.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[o.jsx(Ue,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:o.jsx(ws,{id:"more",value:g.custom,label:Zt.more.label,aspect:Zt.more.aspect,className:"h-full w-full",children:o.jsx("img",{src:g.src,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})})}),o.jsxs(Ue,{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 ${Zi[S("more").align]}`,style:{fontFamily:S("more").fontFamily},children:[(S("more").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"more",field:"eyebrow",value:S("more").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:A,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"more",field:"title",value:S("more").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:R,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"more",field:"body_html",value:S("more").bodyHtml,label:"Text",className:`legal-content mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 ${ZN[S("more").align]}`}),o.jsx(bp,{slug:"more",label:S("more").buttonLabel,url:S("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",style:H})]})]})}),!s("home.faq")&&o.jsx("section",{id:"faq",className:"scroll-mt-20 border-t border-neutral-300 py-16 dark:border-neutral-700",children:o.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[o.jsx(Ue,{className:"mb-8 text-center",children:o.jsx(Ge,{k:"home.faqHeading",as:"h2",className:"text-2xl font-bold text-neutral-900 dark:text-white"})}),o.jsx(Ue,{index:1,children:o.jsx(WN,{items:w})})]})})]})}function zo(e,t){return e?e.code==="rate_limited"||e.status===429?t("errors.rateLimited"):e.code==="invalid_input"||e.status===422?t("errors.invalidInput"):e.status===404?t("errors.notFound"):e.status===503?t("errors.maintenance"):e.status>=500?t("errors.server"):e.status?t("errors.generic"):t("errors.network"):""}const kp={vw:"volkswagen",mercedes:"mercedes-benz",benz:"mercedes-benz",mb:"mercedes-benz",chevy:"chevrolet",alfa:"alfa romeo"},e5=8,$s=e=>String(e||"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/ß/g,"ss").replace(/[-_./]+/g," ").replace(/\s+/g," ").trim(),lo=e=>e.replace(/\s/g,"");function t5(e,t){const n=(e||[]).map(s=>{const i=$s(s.name);return{key:`b${s.id}`,type:"brand",label:s.name,to:`/fahrzeuge/${s.slug}`,text:i,flat:lo(i)}}),r=(t||[]).map(s=>{const i=$s(`${s.brand_name} ${s.name}`);return{key:`m${s.id}`,type:"model",label:s.name,brand:s.brand_name,image:s.image_path,to:`/fahrzeuge/${s.brand_slug}/${s.slug}`,text:i,flat:lo(i),modelText:$s(s.name)}});return[...n,...r]}function n5(e,t){const n=$s(t).split(" ").filter(Boolean);if(n.length===0)return[];const r=n.map(a=>kp[a]?[a,$s(kp[a])]:[a]),s=lo(n.join("")),i=[];for(const a of e){const l=c=>a.text.includes(c)||a.flat.includes(lo(c));if(!r.every(c=>c.some(l))&&!a.flat.includes(s))continue;let u=0;for(const c of r)c.some(d=>a.text.startsWith(d))?u+=3:c.some(d=>` ${a.text}`.includes(` ${d}`))&&(u+=2),c.some(d=>{var f;return(f=a.modelText)==null?void 0:f.startsWith(d)})&&(u+=2);a.type==="brand"&&(u+=1),i.push({entry:a,score:u})}return i.sort((a,l)=>l.score-a.score||a.entry.text.localeCompare(l.entry.text,void 0,{numeric:!0})),i.slice(0,e5).map(a=>a.entry)}function r5({brands:e,width:t}){const{t:n}=xe(),r=pr(),s=m.useId(),i=m.useRef(null),[a,l]=m.useState(null),[u,c]=m.useState(""),[d,f]=m.useState(!1),[h,g]=m.useState(0),v=m.useRef(!1),b=()=>{a||v.current||(v.current=!0,ae.get("/vehicle-search").then(l).catch(()=>l([])).finally(()=>{v.current=!1}))},w=m.useMemo(()=>t5(e,a),[e,a]),p=m.useMemo(()=>n5(w,u),[w,u]),x=d&&u.trim()!=="",y=p.some(j=>j.image);m.useEffect(()=>g(0),[u]),m.useEffect(()=>{if(!x)return;const j=S=>{var N;(N=i.current)!=null&&N.contains(S.target)||f(!1)};return document.addEventListener("pointerdown",j),()=>document.removeEventListener("pointerdown",j)},[x]);const k=j=>{f(!1),r(j.to)},E=j=>{j.key==="ArrowDown"&&p.length?(j.preventDefault(),f(!0),g(S=>(S+1)%p.length)):j.key==="ArrowUp"&&p.length?(j.preventDefault(),g(S=>(S-1+p.length)%p.length)):j.key==="Enter"&&x&&p[h]?(j.preventDefault(),k(p[h])):j.key==="Escape"&&(x?f(!1):c(""))},C=a===null&&u.trim()!=="";return o.jsxs("div",{ref:i,className:"relative mb-8 max-w-full",style:{width:t?`${t}px`:"100%"},children:[o.jsx("label",{htmlFor:`${s}-input`,className:"sr-only",children:n("vehicleSearch.label")}),o.jsxs("div",{className:"relative flex items-center",children:[o.jsx(GT,{className:"pointer-events-none absolute left-4 h-[18px] w-[18px] text-neutral-400","aria-hidden":"true"}),o.jsx("input",{id:`${s}-input`,type:"search",role:"combobox","aria-expanded":x,"aria-controls":`${s}-list`,"aria-autocomplete":"list","aria-activedescendant":x&&p[h]?`${s}-${p[h].key}`:void 0,autoComplete:"off",spellCheck:!1,value:u,placeholder:n("vehicleSearch.placeholder"),onFocus:()=>{b(),f(!0)},onChange:j=>{b(),c(j.target.value),f(!0)},onKeyDown:E,className:"vehicle-search-input w-full rounded-xl border border-neutral-300 bg-gradient-to-b from-white to-neutral-50 py-3.5 pl-11 pr-11 text-[15px] text-neutral-900 outline-none transition-[border-color,box-shadow] duration-200 placeholder:text-neutral-400 focus:border-brand-500 dark:border-neutral-700 dark:from-neutral-800 dark:to-neutral-900 dark:text-white dark:placeholder:text-neutral-500 [&::-webkit-search-cancel-button]:hidden"}),u&&o.jsx("button",{type:"button",onClick:()=>c(""),"aria-label":n("vehicleSearch.clear"),className:"absolute right-3 rounded-md p-1 text-neutral-400 transition hover:text-neutral-700 dark:hover:text-neutral-200",children:o.jsx(Si,{className:"h-4 w-4"})})]}),x&&o.jsx("div",{className:"absolute inset-x-0 top-full z-30 mt-2 overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-lg dark:border-neutral-800 dark:bg-neutral-900",children:p.length>0?o.jsx("ul",{id:`${s}-list`,role:"listbox",className:"max-h-[360px] overflow-y-auto py-1",children:p.map((j,S)=>o.jsx("li",{id:`${s}-${j.key}`,role:"option","aria-selected":S===h,children:o.jsxs(K,{to:j.to,onClick:()=>f(!1),onMouseEnter:()=>g(S),className:`flex items-center gap-3 px-4 py-2.5 text-[15px] ${S===h?"bg-neutral-100 dark:bg-neutral-800":""}`,children:[j.type==="model"?o.jsxs(o.Fragment,{children:[j.image?o.jsx("img",{src:j.image,alt:"",loading:"lazy",className:"h-9 w-14 shrink-0 rounded object-cover"}):y&&o.jsx("span",{className:"h-9 w-14 shrink-0 rounded bg-neutral-100 dark:bg-neutral-800"}),o.jsxs("span",{className:"min-w-0 flex-1 truncate text-neutral-900 dark:text-white",children:[o.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:j.brand})," ",j.label]})]}):o.jsxs("span",{className:"min-w-0 flex-1 truncate text-neutral-900 dark:text-white",children:[j.label,o.jsx("span",{className:"ml-2 text-xs uppercase tracking-wider text-neutral-500 dark:text-neutral-400",children:n("vehicleSearch.allModels")})]}),o.jsx(JC,{className:`h-4 w-4 shrink-0 text-brand-500 transition-opacity ${S===h?"opacity-100":"opacity-0"}`,"aria-hidden":"true"})]})},j.key))}):o.jsx("div",{id:`${s}-list`,className:"px-4 py-3 text-sm text-neutral-500 dark:text-neutral-400",children:C?n("vehicleSearch.loading"):o.jsxs(o.Fragment,{children:[n("vehicleSearch.noResults")," ",o.jsx(K,{to:"/kontakt",className:"font-semibold text-brand-500 hover:underline",children:n("vehicleSearch.contact")})]})})})]})}function s5(){const[e,t]=m.useState(null),[n,r]=m.useState(null),s=Io(),{t:i}=xe(),a=nf(),{vehicle_tile_width:l,vehicle_tile_height:u}=Pt(),c={width:`${l}px`,height:`${u}px`},d=m.useRef(null),[f,h]=m.useState(0);m.useEffect(()=>{const p=d.current;if(!p)return;const x=new ResizeObserver(([y])=>h(y.contentRect.width));return x.observe(p),()=>x.disconnect()},[]);const g=16,v=e?e.length:6,b=Math.max(1,Math.min(v,Math.floor((f+g)/(Number(l)+g)))),w=f&&v?b*Number(l)+(b-1)*g:void 0;return gr({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),m.useEffect(()=>{s.vehicles.enabled&&!s.bypass||ae.get("/brands").then(t).catch(p=>r(p))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?o.jsx(ji,{message:s.vehicles.message}):o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[o.jsx("div",{ref:d}),s.vehicles.enabled&&s.bypass&&o.jsx(Ei,{inline:!0}),o.jsx(Ge,{k:"vehicleSelect.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),o.jsx(Ge,{k:"vehicleSelect.intro",as:"p",className:"mb-6 block text-neutral-600 dark:text-neutral-300"}),o.jsx(r5,{brands:e,width:w}),n&&o.jsx("p",{className:"text-red-600",children:typeof n=="string"?n:zo(n,i)}),e===null&&!n&&o.jsx("div",{className:"flex flex-wrap gap-4","aria-busy":"true","aria-label":i("vehicleSelect.loading"),children:Array.from({length:6},(p,x)=>o.jsx("div",{style:c,className:"shrink-0 animate-pulse rounded-xl bg-neutral-200 dark:bg-neutral-800"},x))}),(e==null?void 0:e.length)===0&&!n&&o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),o.jsx("div",{className:"flex flex-wrap gap-4",children:(e||[]).map(p=>p.image_path?o.jsxs(K,{to:`/fahrzeuge/${p.slug}`,style:c,className:"group relative block shrink-0 overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[o.jsx("img",{src:p.image_path,alt:"",loading:"lazy",decoding:"async",width:l,height:u,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),o.jsx(ce,{entity:"brands",id:p.id,field:"name",lang:"de",value:p.name,className:"absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white",style:fr(a,`brands.${p.id}.name`)})]},p.id):o.jsx(K,{to:`/fahrzeuge/${p.slug}`,style:c,className:"flex shrink-0 flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 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.jsx(ce,{entity:"brands",id:p.id,field:"name",lang:"de",value:p.name,style:fr(a,`brands.${p.id}.name`)})},p.id))})]})}function of(){const{t:e}=xe(),{phone:t}=Pt(),n=Do();return gr({title:e("notFound.metaTitle"),noindex:!0}),o.jsxs("div",{className:"mx-auto max-w-2xl px-4 py-20 text-center sm:px-6",children:[o.jsx("p",{className:"text-sm font-semibold uppercase tracking-[4px] text-brand-500",children:"404"}),o.jsx("h1",{className:"mt-3 text-3xl font-bold text-neutral-900 dark:text-white sm:text-4xl",children:e("notFound.title")}),o.jsx("p",{className:"mx-auto mt-4 max-w-md text-neutral-600 dark:text-neutral-300",children:e("notFound.text")}),o.jsxs("div",{className:"mt-10 flex flex-wrap justify-center gap-3",children:[!n("page.vehicles")&&o.jsxs(K,{to:"/fahrzeuge",className:"inline-flex items-center gap-2 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:[o.jsx(io,{className:"h-4 w-4"}),e("notFound.toVehicles")]}),o.jsxs(K,{to:"/kontakt",className:"inline-flex items-center gap-2 rounded-md border border-neutral-300 px-5 py-3 text-sm font-semibold text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:[o.jsx(pc,{className:"h-4 w-4"}),e("notFound.toContact")]}),t&&o.jsxs("a",{href:fi(t),className:"inline-flex items-center gap-2 rounded-md border border-neutral-300 px-5 py-3 text-sm font-semibold text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:[o.jsx(dr,{className:"h-4 w-4"}),t]})]}),o.jsx(K,{to:"/",className:"mt-8 inline-block text-sm text-neutral-500 underline hover:text-brand-500",children:e("notFound.toHome")})]})}function i5(){const{brandSlug:e}=xd(),[t,n]=m.useState(null),[r,s]=m.useState(null),i=Io(),{t:a}=xe(),l=nf(),u=We(t?`brands.${t.brand.id}.name`:""),{vehicle_tile_width:c,vehicle_tile_height:d}=Pt(),f={width:`${c}px`,height:`${d}px`};return m.useEffect(()=>{i.vehicles.enabled&&!i.bypass||ae.get(`/brands/${e}/models`).then(n).catch(h=>s(h))},[e,i.vehicles.enabled,i.bypass]),gr({title:t?`${t.brand.name} ${a("brandPage.titleSuffix")}`:a("brandPage.metaTitleFallback"),description:t?a("brandPage.metaDescription")(t.brand.name):void 0,path:`/fahrzeuge/${e}`}),i.vehicles.enabled&&!i.bypass?o.jsx(ji,{message:i.vehicles.message}):r?r.status===404?o.jsx(of,{}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:zo(r,a)}):t?o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&o.jsx(Ei,{inline:!0}),o.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[o.jsx("span",{style:u,children:t.brand.name})," – ",a("brandPage.titleSuffix")]}),t.models.length===0&&o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a("brandPage.empty")}),o.jsx("div",{className:"flex flex-wrap gap-4",children:t.models.map(h=>h.image_path?o.jsxs(K,{to:`/fahrzeuge/${e}/${h.slug}`,style:f,className:"group relative block shrink-0 overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[o.jsx("img",{src:h.image_path,alt:"",loading:"lazy",decoding:"async",width:c,height:d,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),o.jsx(ce,{entity:"car_models",id:h.id,field:"name",lang:"de",value:h.name,className:"absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white",style:fr(l,`car_models.${h.id}.name`)})]},h.id):o.jsx(K,{to:`/fahrzeuge/${e}/${h.slug}`,style:f,className:"flex shrink-0 flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 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.jsx(ce,{entity:"car_models",id:h.id,field:"name",lang:"de",value:h.name,style:fr(l,`car_models.${h.id}.name`)})},h.id))})]}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:a("brandPage.loading")})}function a5({text:e}){return e?e.split(/(\*\*[^*]+\*\*)/g).map((n,r)=>{const s=n.match(/^\*\*([^*]+)\*\*$/);return s?o.jsx("strong",{children:s[1]},r):o.jsx("span",{children:n},r)}):null}const Sp="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==";function Dn(e,t,n){if(!e)return"";if(n==="en"){const r=e[`${t}_en`];if(r)return r}return e[t]}const o5=(e,t,n)=>{t/=100,n/=100;const r=a=>(a+e/30)%12,s=t*Math.min(n,1-n),i=a=>n-s*Math.max(-1,Math.min(r(a)-3,Math.min(9-r(a),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},zl=(e,t,n)=>`rgb(${o5(e,t,n).join(", ")})`,jp=e=>e.map(([t,n,r,s,i,a])=>({bgTop:zl(t,n,r),border:zl(t,n,r+8),accent:zl(s,i,a),img:null})),Ep={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:fv},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:hv},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:mv},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:pv},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:gv},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:xv},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:yv},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:vv}],"deep-blue":jp([[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":jp([[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]])},l5="#f2f2f2",Cp="#8a8a8a",Tp="#c4c4c4",Pp=5,u5=3,c5={recommended:{Icon:eP,className:"bg-brand-500 text-white"},popular:{Icon:jT,className:"bg-amber-400 text-neutral-950"},tip:{Icon:PT,className:"bg-sky-500 text-white"},coming_soon:{Icon:Yy,className:"bg-white text-neutral-900"},custom:{Icon:null,className:"bg-brand-500 text-white"}};function d5({pkg:e,tier:t,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:a,priceNote:l,t:u}){const[c,d]=m.useState(!1),f=Xe().canEdit("packages"),[h,g]=m.useState(!1),v=m.useRef(null),b=s.length-Pp,w=c?s:s.slice(0,Pp);m.useLayoutEffect(()=>{const N=v.current;if(!N||c){g(!1);return}const P=()=>g([...N.querySelectorAll("[data-clamp]")].some(B=>B.scrollHeight>B.clientHeight+1));P();const F=new ResizeObserver(P);return F.observe(N),()=>F.disconnect()},[c,s.length,e.description]);const p=nf(),x=fr(p,`packages.${e.id}.description`),y=fr(p,`packages.${e.id}.price_text`),{package_card_height:k}=Pt(),E=c5[e.badge],C=r!=="grid",j=e.badge==="custom"?e.badge_text:e.badge&&u(`modelPage.badges.${e.badge}`),S=t.img?null:{backgroundColor:t.accent,WebkitMaskImage:`url(${Sp})`,maskImage:`url(${Sp})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return o.jsxs("div",{style:{borderColor:t.border,background:`linear-gradient(180deg, ${t.bgTop} 0%, #0b0b0b 55%, #080808 100%)`,...C?{gridRow:"span 4",gridTemplateRows:"subgrid",rowGap:0}:{minHeight:`${k}px`}},className:r==="strip"?"relative grid snap-start overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40":r==="coverflow"?"relative grid snap-center overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40":"relative flex flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40",children:[t.img?o.jsx("img",{src:t.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...S,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),o.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...S,opacity:.55+n*.45},"aria-hidden":"true"})]}),E&&j&&o.jsxs("span",{className:`absolute top-2 left-1/2 z-10 flex max-w-[calc(100%-16px)] -translate-x-1/2 items-center gap-1 whitespace-nowrap rounded-full px-3 py-1 text-xs font-bold shadow ${E.className}`,children:[E.Icon&&o.jsx(E.Icon,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:j})]}),o.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0",gridRow:1},children:[o.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:t.accent,textTransform:"uppercase",lineHeight:1.1},children:o.jsx(ce,{entity:"packages",id:e.id,field:"name",lang:"de",value:e.name,placeholder:"Paketname"})}),o.jsx("div",{style:{width:"44px",height:"2px",margin:"14px auto 0",background:`linear-gradient(90deg, rgba(255,255,255,0) 0%, ${t.accent} 50%, rgba(255,255,255,0) 100%)`}})]}),s.length>0&&o.jsxs("div",{className:"relative z-10",style:{gridRow:2,padding:"18px 20px 14px",background:c?"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:[o.jsx(yc,{entity:"packages",id:e.id,field:"description",value:e.description,label:"Zusätzliche Stichpunkte",hint:"Eine Zeile = ein Stichpunkt (unter den Produkten). **fett** wird fett dargestellt. Die Produkte selbst pflegst du im Admin unter Pakete.",children:o.jsx("ul",{ref:v,className:"space-y-1.5 text-left",children:w.map((N,P)=>o.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:Tp,...N.fromDescription?x:null},children:[o.jsx(qy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:t.accent}}),o.jsx("span",{"data-clamp":!0,className:"leading-snug",style:c?void 0:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:u5,overflow:"hidden"},children:N.fromDescription?o.jsx(a5,{text:N.text}):N.text})]},P))})}),(c||b>0||h)&&o.jsxs("button",{type:"button",onClick:()=>d(N=>!N),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:t.accent},children:[c?u("modelPage.lessBullets"):b>0?u("modelPage.moreBullets")(b):u("modelPage.showMore"),c?o.jsx(pT,{className:"h-3.5 w-3.5"}):o.jsx(uT,{className:"h-3.5 w-3.5"})]})]}),s.length===0&&f&&o.jsx(yc,{entity:"packages",id:e.id,field:"description",value:e.description,label:"Zusätzliche Stichpunkte",hint:"Eine Zeile = ein Stichpunkt. **fett** wird fett dargestellt.",className:"relative z-10 mx-5 mt-4 text-center text-xs",style:{gridRow:2,color:Tp},children:"+ Stichpunkte hinzufügen"}),o.jsx("div",{className:"relative z-10 flex-1",style:{gridRow:3}}),o.jsx("div",{className:"relative z-10",style:{gridRow:4,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:o.jsxs("div",{className:"text-center",children:[!e.price_text&&o.jsx("div",{style:{fontSize:"13px",color:Cp},children:u("modelPage.totalPrice")}),o.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:l5,...e.price_text?y:null},children:f?o.jsx(ce,{entity:"packages",id:e.id,field:"price_text",value:e.price_text,placeholder:i(e.total_price),title:"Leer lassen = Preis automatisch aus den Produkten"}):e.price_text||i(e.total_price)}),!e.price_text&&l&&o.jsx("div",{style:{marginTop:"2px",fontSize:"11px",color:Cp},children:l}),o.jsx(K,{to:a(e),onClick:()=>An("select_package",{package_name:e.name,value:Number(e.total_price)||void 0,currency:"EUR"}),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:u("modelPage.requestContact")}),e.video_url&&o.jsx("div",{className:"mt-3",children:o.jsxs("a",{href:e.video_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full border border-white/15 bg-white/5 px-3 py-1 text-xs font-semibold text-white transition hover:bg-white/15",children:[o.jsx(xT,{className:"h-4 w-4 text-red-500","aria-hidden":"true"}),u("modelPage.videoLink")]})})]})})]})}function f5(){const{brandSlug:e,modelSlug:t}=xd(),[n,r]=m.useState(null),[s,i]=m.useState(null),a=Io(),{t:l,language:u}=xe(),c=Xe(),{package_card_theme:d,package_card_layout:f,package_wheel_hint_interval:h,package_card_width:g,package_card_height:v,phone:b,whatsapp:w,price_note:p,price_note_en:x}=Pt(),y=u==="en"&&x||p,k=Ro(),E=(Ep[d]||Ep.graphite).map((_,I)=>{const{custom:Y}=k.packageTier(I);return Y?{..._,img:Y}:_}),C=["grid","strip","coverflow"].includes(f)?f:"strip",j=Math.max(2,Number(h)||8)*1e3,S=m.useRef(null),N=m.useRef(null),P=m.useRef(null),[F,B]=m.useState(!1),se=_=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(_);m.useEffect(()=>{a.vehicles.enabled&&!a.bypass||ae.get(`/models/${e}/${t}/packages`).then(r).catch(_=>i(_))},[e,t,a.vehicles.enabled,a.bypass]),m.useEffect(()=>{const _=S.current;if(C!=="coverflow"||!_)return;let I=0;const Y=()=>{I=0;const Q=_.scrollLeft+_.clientWidth/2;for(const ke of _.children){const De=ke.offsetLeft+ke.offsetWidth/2,Ze=Math.max(-1,Math.min(1,(De-Q)/(ke.offsetWidth*1.4))),dt=Math.abs(Ze);ke.style.transform=`rotateY(${(-Ze*35).toFixed(2)}deg) scale(${(1-dt*.13).toFixed(3)}) translateZ(${(-dt*60).toFixed(1)}px)`,ke.style.zIndex=String(100-Math.round(dt*50))}},Z=()=>{I||(I=requestAnimationFrame(Y))};Y(),_.addEventListener("scroll",Z,{passive:!0});const ue=new ResizeObserver(Z);return ue.observe(_),()=>{_.removeEventListener("scroll",Z),ue.disconnect(),cancelAnimationFrame(I)}},[C,n]),m.useEffect(()=>{const _=S.current;if(C==="grid"||!_)return;const I=window.matchMedia("(pointer: coarse)").matches;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let Z=[],ue=0;const Q=()=>{const De=Math.min(_.clientWidth*.4,160);Z.push(setTimeout(()=>_.scrollTo({left:De,behavior:"smooth"}),500)),Z.push(setTimeout(()=>_.scrollTo({left:0,behavior:"smooth"}),1250)),I||(Z.push(setTimeout(()=>B(!0),450)),Z.push(setTimeout(()=>B(!1),1700)))},ke=new IntersectionObserver(([De])=>{De.isIntersecting&&(ke.disconnect(),Q(),ue=setInterval(()=>{_.scrollLeft<=1&&Q()},j))},{threshold:.35});return ke.observe(_),()=>{ke.disconnect(),clearInterval(ue),Z.forEach(clearTimeout)}},[C,n,j]),m.useEffect(()=>{const _=S.current;if(C==="grid"||!_)return;let I=0,Y=0,Z=!1,ue=0,Q=0;const ke=()=>[..._.children].map(he=>he.offsetLeft+he.offsetWidth/2),De=(he,ft)=>{let W=0,L=1/0;return he.forEach(($,Qe)=>{const Hn=Math.abs($-ft);Hn{Z=!1;const he=ke();if(!he.length)return;const ft=_.scrollLeft+_.clientWidth/2,W=De(he,ft);let L=W;W===ue&&Math.abs(Q)>4&&(L=Q>0?Math.min(ue+1,he.length-1):Math.max(ue-1,0));const $=_.scrollWidth-_.clientWidth,Qe=Math.max(0,Math.min(he[L]-_.clientWidth/2,$));_.scrollTo({left:Qe,behavior:"smooth"}),clearTimeout(Y),Y=setTimeout(()=>{_.style.scrollSnapType=""},450)},dt=he=>{if(Math.abs(he.deltaX)>Math.abs(he.deltaY))return;const ft=_.scrollWidth-_.clientWidth;if(ft<=1)return;const W=_.scrollLeft<=1,L=_.scrollLeft>=ft-1;he.deltaY<0&&W||he.deltaY>0&&L||(he.preventDefault(),Z||(Z=!0,Q=0,ue=De(ke(),_.scrollLeft+_.clientWidth/2)),Q+=he.deltaY,_.style.scrollSnapType="none",_.scrollLeft+=he.deltaY,clearTimeout(I),I=setTimeout(Ze,150))};return _.addEventListener("wheel",dt,{passive:!1}),()=>{_.removeEventListener("wheel",dt),clearTimeout(I),clearTimeout(Y)}},[C,n]),m.useEffect(()=>{const _=S.current,I=N.current,Y=P.current;if(C==="grid"||!_||!I||!Y)return;let Z=0;const ue=()=>{Z=0;const L=_.scrollWidth-_.clientWidth;if(L<=1){I.style.opacity="0",I.style.pointerEvents="none";return}I.style.opacity="1",I.style.pointerEvents="auto";const $=I.clientWidth,Qe=Math.max(32,_.clientWidth/_.scrollWidth*$);Y.style.width=`${Qe}px`,Y.style.transform=`translateX(${(_.scrollLeft/L*($-Qe)).toFixed(1)}px)`},Q=()=>{Z||(Z=requestAnimationFrame(ue))};ue(),_.addEventListener("scroll",Q,{passive:!0});const ke=new ResizeObserver(Q);ke.observe(_);let De=!1,Ze=0;const dt=L=>{const $=I.getBoundingClientRect(),Qe=Y.clientWidth,Hn=Math.min(Math.max(L-$.left-Ze,0),$.width-Qe);_.scrollLeft=Hn/($.width-Qe)*(_.scrollWidth-_.clientWidth)},he=L=>{De=!0,I.setPointerCapture(L.pointerId),_.style.scrollSnapType="none";const $=Y.getBoundingClientRect();Ze=L.clientX>=$.left&&L.clientX<=$.right?L.clientX-$.left:Y.clientWidth/2,L.clientX>=$.left&&L.clientX<=$.right||dt(L.clientX)},ft=L=>{De&&dt(L.clientX)},W=L=>{var $;De&&(De=!1,($=I.hasPointerCapture)!=null&&$.call(I,L.pointerId)&&I.releasePointerCapture(L.pointerId),_.style.scrollSnapType="")};return I.addEventListener("pointerdown",he),I.addEventListener("pointermove",ft),I.addEventListener("pointerup",W),I.addEventListener("pointercancel",W),()=>{_.removeEventListener("scroll",Q),ke.disconnect(),cancelAnimationFrame(Z),I.removeEventListener("pointerdown",he),I.removeEventListener("pointermove",ft),I.removeEventListener("pointerup",W),I.removeEventListener("pointercancel",W)}},[C,n]),gr({title:n?l("modelPage.metaTitle")(n.model.brand_name,n.model.name):l("modelPage.metaTitleFallback"),description:n?l("modelPage.metaDescription")(n.model.brand_name,n.model.name):void 0,path:`/fahrzeuge/${e}/${t}`});const ne=We(n?`car_models.${n.model.id}.name`:"");if(a.vehicles.enabled&&!a.bypass)return o.jsx(ji,{message:a.vehicles.message});if(s)return s.status===404?o.jsx(of,{}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:zo(s,l)});if(!n)return o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:l("modelPage.loading")});const{model:q}=n,G=n.packages.map(_=>({..._,name:c.getValue("packages",_.id,"name","de",_.name),description:c.getValue("packages",_.id,"description",u,Dn(_,"description",u)),tagline:Dn(_,"tagline",u),price_text:c.getValue("packages",_.id,"price_text",u,Dn(_,"price_text",u))})),V=new Map([...G].sort((_,I)=>_.total_price-I.total_price).map((_,I)=>[_.id,I])),T=_=>{const I=_.tier_count??G.length,Y=_.tier_rank??V.get(_.id)??0,Z=I<=1?0:Y/(I-1),ue=Math.round(Z*(E.length-1));return{tier:E[ue],tierT:Z}},M=_=>[..._.products.map(I=>({text:I.name_override||I.scraped_name||l("modelPage.productLoading"),fromDescription:!1})),...(_.description||"").split(` -`).map(I=>I.trim()).filter(Boolean).map(I=>({text:I,fromDescription:!0}))],A=_=>`/kontakt?${new URLSearchParams({brand:q.brand_name,model:q.name,package:_.name,packageId:_.id,total:_.total_price,brandSlug:e,modelSlug:t}).toString()}`,R=`/kontakt?${new URLSearchParams({brand:q.brand_name,model:q.name}).toString()}`,H=l("modelPage.whatsappText")(q.brand_name,q.name);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-12 sm:px-6",children:[a.vehicles.enabled&&a.bypass&&o.jsx(Ei,{inline:!0}),o.jsxs("h1",{className:`text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl ${G.length?"mb-2":"mb-8"}`,children:[q.brand_name," ",o.jsx(ce,{entity:"car_models",id:q.id,field:"name",lang:"de",value:q.name,style:ne})," – ",l("modelPage.titleSuffix")]}),G.length===0&&o.jsxs("div",{className:"pb-12",children:[o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:l("modelPage.empty")}),o.jsx(K,{to:R,className:"mt-5 inline-block rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:l("modelPage.customRequest")})]})]}),G.length>0&&o.jsx("section",{className:"py-10 sm:py-14",style:{fontFamily:"'Barlow', sans-serif"},children:o.jsxs("div",{className:C==="grid"?"mx-auto max-w-6xl px-4 sm:px-6":"relative mx-auto max-w-[1880px] px-4 sm:px-6",children:[o.jsx("div",{ref:C==="grid"?void 0:S,className:C==="grid"?"grid items-stretch gap-[18px]":"grid select-none gap-x-[18px] overflow-x-auto pb-3 snap-x snap-mandatory [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:C==="grid"?{gridTemplateColumns:`repeat(auto-fill, minmax(${g}px, 1fr))`,gridAutoRows:"1fr"}:{gridAutoFlow:"column",gridAutoColumns:`${g}px`,gridTemplateRows:"auto auto 1fr auto",minHeight:`${Number(v)+(C==="coverflow"?22:12)}px`,...C==="coverflow"?{perspective:"1200px",paddingLeft:`calc(50% - ${g/2}px)`,paddingRight:`calc(50% - ${g/2}px)`,paddingTop:"10px"}:null},children:G.map(_=>{const{tier:I,tierT:Y}=T(_);return o.jsx(d5,{pkg:_,tier:I,tierT:Y,layout:C,bullets:M(_),formatPrice:se,contactUrl:A,priceNote:y,t:l},_.id)})}),C!=="grid"&&o.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 ${F?"opacity-100":"opacity-0"}`,"aria-hidden":"true",children:o.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:[o.jsx(dT,{className:"h-3.5 w-3.5 text-brand-400"}),o.jsx(IT,{className:"h-4 w-4 text-brand-400"}),o.jsx(hT,{className:"h-3.5 w-3.5 text-brand-400"}),o.jsx("span",{children:l("modelPage.wheelHint")})]})}),C!=="grid"&&o.jsx("div",{ref:N,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:o.jsx("div",{ref:P,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"}})})]})}),G.length>0&&o.jsxs("div",{className:"mx-auto max-w-6xl px-4 pb-24 text-center sm:px-6 sm:pb-14",children:[o.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:l("modelPage.customHint")}),o.jsx(K,{to:R,className:"mt-2 inline-block text-sm font-semibold text-brand-600 underline hover:text-brand-500",children:l("modelPage.customRequest")})]}),(b||w)&&o.jsxs("div",{className:"fixed inset-x-0 bottom-0 z-20 flex gap-3 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:hidden",children:[b&&o.jsxs("a",{href:fi(b),onClick:()=>An("contact_call"),className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white",children:[o.jsx(dr,{className:"h-4 w-4"}),l("nav.call")]}),w&&o.jsxs("a",{href:ef(w,H),target:"_blank",rel:"noopener noreferrer",onClick:()=>An("contact_whatsapp"),className:"flex flex-1 items-center justify-center gap-2 rounded-md border border-neutral-300 px-4 py-2.5 text-sm font-semibold text-neutral-700 dark:border-neutral-700 dark:text-neutral-200",children:[o.jsx(Qy,{className:"h-4 w-4"}),l("nav.whatsapp")]})]})]})}const h5={car:io,caravan:aT,"car-front":rT,cog:wT,zap:oP,boxes:tT,"shield-alert":XT,video:sP},m5=m.lazy(()=>X(()=>import("./iconRegistry-7Dpzjhyo.js"),__vite__mapDeps([2,3,4,5])));function p5({name:e,className:t="h-6 w-6",...n}){if(!e)return null;const r=h5[e];return r?o.jsx(r,{className:t,...n}):o.jsx(m.Suspense,{fallback:o.jsx("span",{className:`inline-block ${t}`,"aria-hidden":"true"}),children:o.jsx(m5,{name:e,className:t,...n})})}function g5(){const[e,t]=m.useState([]),n=Io(),{t:r,language:s}=xe(),i=Xe();return m.useEffect(()=>{ae.get("/services").then(t).catch(()=>t([]))},[]),gr({title:r("leistungen.metaTitle"),description:r("leistungen.metaDescription"),path:"/leistungen"}),n.services.enabled&&!n.bypass?o.jsx(ji,{message:n.services.message}):o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[n.services.enabled&&n.bypass&&o.jsx(Ei,{inline:!0}),o.jsx(Ge,{k:"leistungen.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),o.jsx(Ge,{k:"leistungen.intro",as:"p",className:"mb-10 block max-w-2xl text-neutral-600 dark:text-neutral-300"}),o.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:e.map(a=>({...a,title:Dn(a,"title",s),description:Dn(a,"description",s),cta_label:Dn(a,"cta_label",s)})).map((a,l)=>o.jsxs(Ue,{index:l%3,shine:!0,className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"relative aspect-[4/3]",children:[a.image_path&&o.jsx("img",{src:a.image_path,alt:a.title,className:"h-full w-full object-cover",loading:"lazy"}),o.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:o.jsx(p5,{name:a.icon_name,className:"h-6 w-6"})})]}),o.jsxs("div",{className:"p-6 pt-8",children:[o.jsx(ce,{entity:"services",id:a.id,field:"title",value:a.title,as:"h2",className:"mb-2 block font-semibold text-neutral-900 dark:text-white"}),o.jsx(ce,{entity:"services",id:a.id,field:"description",value:a.description,as:"p",multiline:!0,className:"mb-3 block text-sm text-neutral-600 dark:text-neutral-300"}),o.jsxs(K,{to:a.cta_url||"/kontakt",className:"text-sm font-semibold text-brand-600 hover:underline dark:text-brand-400",children:[i.canEdit("services")||a.cta_label?o.jsx(ce,{entity:"services",id:a.id,field:"cta_label",value:a.cta_label,placeholder:r("leistungen.contact")}):r("leistungen.contact")," ","→"]})]})]},a.id))}),o.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:[o.jsx(Ge,{k:"leistungen.notListedTitle",as:"h2",className:"mb-2 block text-xl font-bold text-neutral-900 dark:text-white"}),o.jsx(Ge,{k:"leistungen.notListedText",as:"p",className:"mb-5 block text-neutral-600 dark:text-neutral-300"}),o.jsx(K,{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:o.jsx(Ge,{k:"leistungen.contact"})})]})]})}function x5({name:e,description:t,className:n="",children:r}){const{consent:s,acceptAll:i,openSettings:a}=ls();return s.external?r:o.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:[o.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:t||`${e} wird erst nach deiner Zustimmung geladen, da dabei Daten an Google übertragen werden.`}),o.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[o.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"}),o.jsx("button",{type:"button",onClick:a,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Cookie-Einstellungen"})]})]})}const y5=e=>(e||"").replace(/[^\d+]/g,""),ba={fontFamily:"'Michroma', sans-serif"};function v5({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:o.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 w5({path:e,className:t}){return o.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:e})})}const b5={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 Np({formatted:e,color:t}){const[n,r]=e.split("€");return o.jsxs("span",{style:{...ba,color:t},children:[n,o.jsx("span",{style:{fontFamily:"'Barlow', sans-serif"},children:"€"}),r]})}function Qi({icon:e,label:t,name:n,type:r="text",required:s,value:i,onChange:a,placeholder:l,autoComplete:u,inputMode:c}){return o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("label",{htmlFor:`kf-${n}`,className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:t}),o.jsxs("div",{className:"relative flex items-center",children:[o.jsx(e,{className:"pointer-events-none absolute left-[14px] h-[17px] w-[17px]",style:{color:"var(--kf-fieldicon)"}}),o.jsx("input",{id:`kf-${n}`,name:n,type:r,required:s,autoComplete:u,inputMode:c,value:i,onChange:a,placeholder:l,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 k5(){const[e]=ck(),{phone:t,whatsapp:n,contact_email:r,address_street:s,address_zip:i,address_city:a,business_hours:l,price_note:u,price_note_en:c}=Pt(),{t:d,language:f}=xe(),h=Ro(),g=h.slot("contact_bg_light").custom,v=h.slot("contact_bg_dark").custom,b={...g&&{"--kontakt-bg-light":`url("${g}")`},...v&&{"--kontakt-bg-dark":`url("${v}")`}},{consent:w}=ls(),p=[s,[i,a].filter(Boolean).join(" ")].filter(Boolean).join(", "),x=encodeURIComponent(p),y=`https://www.google.com/maps/dir/?api=1&destination=${x}`,k=lv(l,d("footer.closed")),E=W=>new Intl.NumberFormat(f==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(W),[C,j]=m.useState(()=>({name:"",email:"",phone:"",vin:"",message:e.get("topic")||""})),[S,N]=m.useState("idle"),[P,F]=m.useState(""),[B,se]=m.useState([]),[ne,q]=m.useState([]),G=m.useRef(Date.now()),V=m.useRef(null),T=e.get("packageId"),M=e.get("brandSlug"),A=e.get("modelSlug"),[R,H]=m.useState(e.get("total")?Number(e.get("total")):null),[_,I]=m.useState(null),Y=f==="en"&&c||u;m.useEffect(()=>{!T||!M||!A||ae.get(`/models/${encodeURIComponent(M)}/${encodeURIComponent(A)}/packages`).then(W=>{var $;const L=($=W==null?void 0:W.packages)==null?void 0:$.find(Qe=>String(Qe.id)===String(T));L&&(H(Number(L.total_price)),I(L.price_text||null))}).catch(()=>{})},[T,M,A]),m.useEffect(()=>{if(!T){se([]);return}ae.get(`/packages/${T}/upgrades`).then(se).catch(()=>se([]))},[T]);const Z=W=>{q(L=>L.includes(W)?L.filter($=>$!==W):[...L,W])},ue=B.filter(W=>ne.includes(W.id)).reduce((W,L)=>W+Number(L.price),0);gr({title:d("contactPage.metaTitle"),description:d("contactPage.metaDescription"),path:"/kontakt"});const Q={brand:e.get("brand")||"",model:e.get("model")||"",package:e.get("package")||""},ke=!!(Q.brand&&Q.model&&Q.package),De=!ke&&!!(Q.brand&&Q.model),Ze=W=>j(L=>({...L,[W.target.name]:W.target.value})),dt=async W=>{var L;W.preventDefault(),N("sending"),F("");try{await ae.post("/contact",{...C,website:((L=W.target.elements.website)==null?void 0:L.value)||"",fill_ms:Date.now()-G.current,brand_name:Q.brand||null,model_name:Q.model||null,package_name:Q.package||null,product_name:e.get("product")||null,package_id:T||null,package_product_id:e.get("productId")||null,upgrade_ids:ne}),N("sent"),j({name:"",email:"",phone:"",vin:"",message:""}),An("generate_lead",{package_name:Q.package||void 0,value:R||void 0,currency:"EUR"})}catch($){F(zo($,d)),N("idle")}};m.useEffect(()=>{S==="sent"&&V.current&&(V.current.scrollIntoView({behavior:"smooth",block:"center"}),V.current.focus({preventScroll:!0}))},[S]);const he=ke?d("contactPage.whatsappText")(Q.brand,Q.model,Q.package):De?d("modelPage.whatsappText")(Q.brand,Q.model):"",ft=[{key:"premium",title:d("contactPage.featurePremiumTitle"),sub:d("contactPage.featurePremiumSub")},{key:"germany",title:d("contactPage.featureGermanyTitle"),sub:d("contactPage.featureGermanySub")},{key:"individual",title:d("contactPage.featureIndividualTitle"),sub:d("contactPage.featureIndividualSub")},{key:"experts",title:d("contactPage.featureExpertsTitle"),sub:d("contactPage.featureExpertsSub")}];return o.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",...b},children:o.jsxs("div",{className:"relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14",children:[o.jsx("div",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.heroEyebrow")}),o.jsxs("h1",{className:"text-[34px] leading-[1.08] sm:text-[46px] lg:text-[60px]",style:{...ba,color:"var(--kf-text)"},children:[d("contactPage.heroTitlePre")," ",o.jsx("span",{style:{color:"var(--kf-accent2)"},children:d("contactPage.heroTitleAccent")})," ",d("contactPage.heroTitlePost")]}),o.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:"var(--kf-muted)"},children:d("contactPage.heroSubtitle")}),o.jsxs("div",{className:"grid grid-cols-1 items-start gap-10 min-[981px]:grid-cols-[minmax(0,1.35fr)_minmax(320px,1fr)]",children:[o.jsx("div",{children:o.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:[ke&&o.jsxs("div",{className:"mb-8 rounded-xl border px-6 py-[22px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[o.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:[o.jsx(zT,{className:"h-4 w-4"}),d("contactPage.packageBoxTitle")]}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-5 gap-y-2 text-[15px]",children:[o.jsx("span",{style:{color:"var(--kf-label)"},children:d("contactPage.contextBrand")}),o.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:Q.brand}),o.jsx("span",{style:{color:"var(--kf-label)"},children:d("contactPage.contextModel")}),o.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:Q.model}),o.jsx("span",{style:{color:"var(--kf-label)"},children:d("contactPage.contextPackage")}),o.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:Q.package})]}),o.jsxs("div",{className:"mt-3.5 flex items-baseline justify-between border-t pt-3.5",style:{borderColor:"var(--kf-pkgbrd)"},children:[o.jsx("span",{className:"text-[13px] font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:d("contactPage.packagePrice")}),o.jsx("span",{className:"text-xl",children:_||(R!=null?o.jsx(Np,{formatted:E(R),color:"var(--kf-text)"}):"—")})]}),Y&&!_&&o.jsx("div",{className:"mt-1 text-right text-xs",style:{color:"var(--kf-muted)"},children:Y})]}),De&&o.jsxs("div",{className:"mb-8 flex items-center gap-3 rounded-xl border px-6 py-4 text-[15px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[o.jsx(io,{className:"h-4 w-4",style:{color:"var(--kf-accent2)"}}),o.jsx("span",{style:{color:"var(--kf-label)"},children:d("contactPage.vehicleBoxTitle")}),o.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:[Q.brand," ",Q.model]})]}),B.length>0&&o.jsxs("div",{className:"mb-8 rounded-xl border p-5",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)"},children:[o.jsx("div",{className:"mb-3 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.optionalUpgrades")}),o.jsx("div",{className:"space-y-2",children:B.map(W=>o.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border p-3 text-sm",style:{borderColor:"var(--kf-fieldbrd)"},children:[o.jsx("input",{type:"checkbox",checked:ne.includes(W.id),onChange:()=>Z(W.id),className:"mt-0.5 h-4 w-4 rounded",style:{accentColor:"var(--kf-accent)"}}),o.jsxs("span",{className:"flex-1",children:[o.jsx("span",{className:"block font-semibold",style:{color:"var(--kf-text2)"},children:Dn(W,"name",f)}),W.description&&o.jsx("span",{className:"block text-xs",style:{color:"var(--kf-muted)"},children:Dn(W,"description",f)})]}),o.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-accent2)"},children:["+",E(W.price)]})]},W.id))}),ne.length>0&&R!=null&&!_&&o.jsxs("div",{className:"mt-3 flex items-baseline justify-between border-t pt-3 text-sm",style:{borderColor:"var(--kf-pkgbrd)"},children:[o.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:d("contactPage.totalWithUpgrades")}),o.jsx(Np,{formatted:E(R+ue),color:"var(--kf-text)"})]})]}),o.jsx("h2",{className:"mb-8 text-xl",style:{...ba,color:"var(--kf-text)"},children:d("contactPage.formTitle")}),o.jsx("div",{role:"status","aria-live":"polite",children:S==="sent"&&o.jsxs("div",{ref:V,tabIndex:-1,className:"rounded-[10px] border p-5 outline-none",style:{borderColor:"var(--kf-accent)",background:"var(--kf-accentsoft)"},children:[o.jsx("div",{className:"text-base font-bold",style:{color:"var(--kf-accent2)"},children:d("contactPage.sentTitle")}),o.jsx("div",{className:"mt-1 text-sm",style:{color:"var(--kf-muted)"},children:d("contactPage.sentText")}),o.jsx("button",{type:"button",onClick:()=>{G.current=Date.now(),N("idle")},className:"mt-4 text-sm font-semibold underline",style:{color:"var(--kf-text2)"},children:d("contactPage.sendAnother")})]})}),S!=="sent"&&o.jsxs("form",{onSubmit:dt,noValidate:!1,children:[o.jsxs("div",{"aria-hidden":"true",style:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"},children:[o.jsx("label",{htmlFor:"kf-website",children:"Website"}),o.jsx("input",{id:"kf-website",name:"website",type:"text",tabIndex:-1,autoComplete:"off",defaultValue:""})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-6 min-[641px]:grid-cols-2",children:[o.jsx(Qi,{icon:nP,label:d("contactPage.nameLabel"),name:"name",autoComplete:"name",required:!0,value:C.name,onChange:Ze,placeholder:d("contactPage.namePlaceholder")}),o.jsx(Qi,{icon:pc,label:d("contactPage.emailLabel"),name:"email",type:"email",autoComplete:"email",required:!0,value:C.email,onChange:Ze,placeholder:d("contactPage.emailPlaceholder")}),o.jsx(Qi,{icon:dr,label:d("contactPage.phoneLabel"),name:"phone",type:"tel",inputMode:"tel",autoComplete:"tel",value:C.phone,onChange:Ze,placeholder:d("contactPage.phonePlaceholder")}),o.jsx(Qi,{icon:io,label:d("contactPage.vinLabel"),name:"vin",value:C.vin,onChange:Ze,placeholder:d("contactPage.vinPlaceholder")})]}),o.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[o.jsx("label",{htmlFor:"kf-message",className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:d("contactPage.messageLabel")}),o.jsx("textarea",{id:"kf-message",name:"message",rows:5,value:C.message,onChange:Ze,placeholder:d("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)"}})]}),o.jsx("div",{role:"alert","aria-live":"assertive",children:P&&o.jsx("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:P})}),o.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-5",children:[o.jsxs("button",{type:"submit",disabled:S==="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:[o.jsx(qT,{className:"h-[18px] w-[18px]"}),d(S==="sending"?"contactPage.sending":"contactPage.submit")]}),o.jsx("div",{className:"text-[13px]",style:{color:"var(--kf-label)"},children:d("contactPage.requiredHint")})]}),o.jsxs("p",{className:"mt-5 text-[13px] leading-relaxed",style:{color:"var(--kf-muted)"},children:[d("contactPage.privacyPre"),o.jsx(K,{to:"/datenschutz",className:"underline",style:{color:"var(--kf-text2)"},children:d("contactPage.privacyLink")}),d("contactPage.privacyPost")]})]})]})}),o.jsxs("div",{className:"flex flex-col gap-6",children:[o.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:[o.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)"}}),o.jsx("h2",{className:"mb-7 text-[17px]",style:{...ba,color:"var(--kf-text)"},children:d("contactPage.cardTitle")}),o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:o.jsx(dr,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.phone")}),o.jsx("a",{href:`tel:${y5(t)}`,onClick:()=>An("contact_call"),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:t})]})]}),o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:o.jsx(pc,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.email")}),o.jsx("a",{href:`mailto:${r}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:r})]})]}),o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:o.jsx(Zy,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.address")}),o.jsxs("div",{className:"text-base font-semibold leading-[1.4]",style:{color:"var(--kf-text2)"},children:[s,o.jsx("br",{}),[i,a].filter(Boolean).join(" ")]})]})]}),n&&o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:o.jsx(v5,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("nav.whatsapp")}),o.jsx("a",{href:ef(n,he),target:"_blank",rel:"noopener noreferrer",onClick:()=>An("contact_whatsapp"),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:n})]})]})]}),o.jsxs("div",{className:"mt-7 border-t pt-6",style:{borderColor:"var(--kf-divider)"},children:[o.jsx("div",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.hours")}),o.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-[15px]",children:k.map(W=>o.jsxs("span",{style:{display:"contents"},children:[o.jsx("span",{style:{color:"var(--kf-label)"},children:W.days}),o.jsx("span",{children:W.label})]},W.key))})]})]}),o.jsxs("div",{className:"relative overflow-hidden rounded-2xl border",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[w.external&&o.jsxs("a",{href:y,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:[d("contactPage.mapOpenChip"),o.jsx(kT,{className:"h-3.5 w-3.5",style:{color:"var(--kf-accent2)"}})]}),o.jsx(x5,{name:d("contactPage.mapEmbedName"),className:"h-[210px] w-full",children:o.jsx("div",{className:"h-[210px] overflow-hidden",children:o.jsx("iframe",{title:d("contactPage.mapIframeTitle"),src:`https://www.google.com/maps?q=${x}&output=embed`,width:"100%",height:"290",style:{border:0,display:"block",marginTop:"-60px"},loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"})})}),o.jsxs("a",{href:y,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:[d("contactPage.routePlan")," →"]})]})]})]}),o.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:ft.map(W=>o.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:[o.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:o.jsx(w5,{path:b5[W.key],className:"h-[22px] w-[22px]"})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[15px] font-bold",style:{color:"var(--kf-text)"},children:W.title}),o.jsx("div",{className:"mt-0.5 text-[13px]",style:{color:"var(--kf-muted)"},children:W.sub})]})]},W.key))})]})})}const Bl="hifi-chunk-reload",J=e=>m.lazy(()=>e().then(t=>{try{sessionStorage.removeItem(Bl)}catch{}return t},t=>{let n=!0;try{n=!!sessionStorage.getItem(Bl),sessionStorage.setItem(Bl,"1")}catch{}if(n)throw t;return window.location.reload(),new Promise(()=>{})})),S5=J(()=>X(()=>import("./GalleryOverview-nP1qGopa.js"),[])),j5=J(()=>X(()=>import("./GalleryBrandPage-COmMjCa1.js"),[])),E5=J(()=>X(()=>import("./GalleryProjectPage-keVFhaZs.js"),[])),C5=J(()=>X(()=>import("./DownloadsPage-ZpsuO5y1.js"),__vite__mapDeps([6,7,3]))),T5=J(()=>X(()=>import("./Impressum-CuCyaRsx.js"),__vite__mapDeps([8,9]))),P5=J(()=>X(()=>import("./Datenschutz-BxRbkKHM.js"),__vite__mapDeps([10,9]))),N5=J(()=>X(()=>import("./AGB-R24E6RC9.js"),__vite__mapDeps([11,9]))),_5=J(()=>X(()=>import("./SetupWizard-B8-5hkmh.js"),[])),M5=J(()=>X(()=>import("./Login-DmO7UGYK.js"),[])),L5=J(()=>X(()=>import("./ConfirmEmail-DrPHnAcK.js"),[])),A5=J(()=>X(()=>import("./Dashboard-Bb-z9N4S.js"),__vite__mapDeps([12,13,14]))),D5=J(()=>X(()=>import("./Traffic-C7K-vaXp.js"),[])),R5=J(()=>X(()=>import("./Brands-C2MO3iab.js"),__vite__mapDeps([15,0,1,16,17,18,4,19]))),I5=J(()=>X(()=>import("./Models-CTKD_2al.js"),__vite__mapDeps([20,0,1,16,17,18,4,19]))),V5=J(()=>X(()=>import("./GalleryBrands-BZZtQ1we.js"),__vite__mapDeps([21,0,1,17,18,4,22]))),F5=J(()=>X(()=>import("./GalleryProjects-ClLNEVBB.js"),__vite__mapDeps([23,0,1,17,18,4,22]))),O5=J(()=>X(()=>import("./GalleryPhotos-B-ALbtsa.js"),__vite__mapDeps([24,17,18,4,22,1]))),z5=J(()=>X(()=>import("./Packages-BHzawgo-.js"),__vite__mapDeps([25,26,16,18,5,4]))),B5=J(()=>X(()=>import("./Services-Dv9GCIRs.js"),__vite__mapDeps([27,0,1,2,3,4,5,28,17,18]))),$5=J(()=>X(()=>import("./Faqs-Dx6P5rru.js"),__vite__mapDeps([29,28,17,18,4]))),H5=J(()=>X(()=>import("./Partners-d4iHm0YC.js"),__vite__mapDeps([30,0,1,28,17,18,4]))),U5=J(()=>X(()=>import("./Downloads-BySos-u0.js"),__vite__mapDeps([31,7,28,17,18,4]))),W5=J(()=>X(()=>import("./HomeSections-8nB12J9S.js"),__vite__mapDeps([32,33,16,34]))),G5=J(()=>X(()=>import("./ContactRequests-sFFVdlWu.js"),__vite__mapDeps([35,14]))),K5=J(()=>X(()=>import("./AccountSettings-CAesEcDe.js"),[])),q5=J(()=>X(()=>import("./AdminUsers-BRv6czlM.js"),[])),Y5=J(()=>X(()=>import("./PermissionGroups-B5VO82nD.js"),[])),X5=J(()=>X(()=>import("./SettingsLayout-uNCH_EVD.js"),[])),Ji=J(()=>X(()=>import("./WebsiteSettings-Cn9gk2Zi.js"),__vite__mapDeps([36,0,1,34,17,18,4,26]))),Z5=J(()=>X(()=>import("./LegalSettings-aQ858K4J.js"),__vite__mapDeps([37,33]))),Q5=J(()=>X(()=>import("./UpdateSettings-C1uyyWm_.js"),[])),J5=J(()=>X(()=>import("./EmailSettings-O9zitSOH.js"),__vite__mapDeps([38,33]))),e4=J(()=>X(()=>import("./DatabaseSettings-DCm6bks9.js"),__vite__mapDeps([39,13]))),t4=J(()=>X(()=>import("./ExportImportSettings-CPuYbSqK.js"),[])),n4=J(()=>X(()=>import("./MaintenanceSettings-CSuNtWHo.js"),[])),r4=J(()=>X(()=>import("./CountdownSettings-De04QloC.js"),[])),s4=J(()=>X(()=>import("./ConnectionSettings-BKoUzQPM.js"),[])),i4=J(()=>X(()=>import("./ResetSettings-DZpRgwCZ.js"),[])),a4=o.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});function o4(){const{packageId:e}=xd();return o.jsx(ur,{to:`/admin/packages?paket=${e}`,replace:!0})}function l4(){return o.jsxs(oE,{reducedMotion:"user",children:[o.jsx(VC,{}),o.jsx(zC,{}),o.jsx(GC,{children:o.jsx(m.Suspense,{fallback:a4,children:o.jsxs(Yb,{children:[o.jsx(U,{path:"/setup",element:o.jsx(_5,{})}),o.jsxs(U,{element:o.jsx(bN,{}),children:[o.jsx(U,{path:"/",element:o.jsx(JN,{})}),o.jsx(U,{path:"/fahrzeuge",element:o.jsx(s5,{})}),o.jsx(U,{path:"/fahrzeuge/:brandSlug",element:o.jsx(i5,{})}),o.jsx(U,{path:"/fahrzeuge/:brandSlug/:modelSlug",element:o.jsx(f5,{})}),o.jsx(U,{path:"/galerie",element:o.jsx(S5,{})}),o.jsx(U,{path:"/galerie/:brandSlug",element:o.jsx(j5,{})}),o.jsx(U,{path:"/galerie/:brandSlug/:projectSlug",element:o.jsx(E5,{})}),o.jsx(U,{path:"/leistungen",element:o.jsx(g5,{})}),o.jsx(U,{path:"/kontakt",element:o.jsx(k5,{})}),o.jsx(U,{path:"/downloads",element:o.jsx(C5,{})}),o.jsx(U,{path:"/impressum",element:o.jsx(T5,{})}),o.jsx(U,{path:"/datenschutz",element:o.jsx(P5,{})}),o.jsx(U,{path:"/agb",element:o.jsx(N5,{})}),o.jsx(U,{path:"*",element:o.jsx(of,{})})]}),o.jsx(U,{path:"/admin/login",element:o.jsx(M5,{})}),o.jsx(U,{path:"/admin/email-bestaetigen",element:o.jsx(L5,{})}),o.jsx(U,{path:"/admin",element:o.jsx(ON,{}),children:o.jsxs(U,{element:o.jsx(FN,{}),children:[o.jsx(U,{index:!0,element:o.jsx(A5,{})}),o.jsx(U,{path:"traffic",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(D5,{})})}),o.jsx(U,{path:"account",element:o.jsx(K5,{})}),o.jsx(U,{path:"brands",element:o.jsx(oe,{permission:"brands.manage",children:o.jsx(R5,{})})}),o.jsx(U,{path:"models",element:o.jsx(oe,{permission:"models.manage",children:o.jsx(I5,{})})}),o.jsx(U,{path:"gallery-brands",element:o.jsx(oe,{permission:"gallery.manage",children:o.jsx(V5,{})})}),o.jsx(U,{path:"gallery-projects",element:o.jsx(oe,{permission:"gallery.manage",children:o.jsx(F5,{})})}),o.jsx(U,{path:"gallery-projects/:projectId/photos",element:o.jsx(oe,{permission:"gallery.manage",children:o.jsx(O5,{})})}),o.jsx(U,{path:"packages",element:o.jsx(oe,{permission:"packages.manage",children:o.jsx(z5,{})})}),o.jsx(U,{path:"packages/:packageId/*",element:o.jsx(o4,{})}),o.jsx(U,{path:"services",element:o.jsx(oe,{permission:"services.manage",children:o.jsx(B5,{})})}),o.jsx(U,{path:"faqs",element:o.jsx(oe,{permission:"content.manage",children:o.jsx($5,{})})}),o.jsx(U,{path:"partners",element:o.jsx(oe,{permission:"content.manage",children:o.jsx(H5,{})})}),o.jsx(U,{path:"downloads",element:o.jsx(oe,{permission:"downloads.manage",children:o.jsx(U5,{})})}),o.jsx(U,{path:"home-sections",element:o.jsx(oe,{permission:"content.manage",children:o.jsx(W5,{})})}),o.jsx(U,{path:"contact-requests",element:o.jsx(oe,{permission:"contact.manage",children:o.jsx(G5,{})})}),o.jsx(U,{path:"users",element:o.jsx(oe,{permission:"users.manage",children:o.jsx(q5,{})})}),o.jsx(U,{path:"permission-groups",element:o.jsx(oe,{permission:"permission_groups.manage",children:o.jsx(Y5,{})})}),o.jsxs(U,{path:"settings",element:o.jsx(oe,{permission:["settings.manage","system.admin","system.update"],children:o.jsx(X5,{})}),children:[o.jsx(U,{index:!0,element:o.jsx(ur,{to:"company",replace:!0})}),o.jsx(U,{path:"website",element:o.jsx(ur,{to:"../company",replace:!0})}),o.jsx(U,{path:"company",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(Ji,{section:"company"})})}),o.jsx(U,{path:"design",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(Ji,{section:"design"})})}),o.jsx(U,{path:"images",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(Ji,{section:"images"})})}),o.jsx(U,{path:"legal",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(Z5,{})})}),o.jsx(U,{path:"maintenance",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(n4,{})})}),o.jsx(U,{path:"countdown",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(r4,{})})}),o.jsx(U,{path:"google",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(Ji,{section:"google"})})}),o.jsx(U,{path:"connections",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(s4,{})})}),o.jsx(U,{path:"email",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(J5,{})})}),o.jsx(U,{path:"database",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(e4,{})})}),o.jsx(U,{path:"export-import",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(t4,{})})}),o.jsx(U,{path:"update",element:o.jsx(oe,{permission:"system.update",children:o.jsx(Q5,{})})}),o.jsx(U,{path:"reset",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(i4,{})})})]})]})})]})})})]})}$l.createRoot(document.getElementById("root")).render(o.jsx(Bp.StrictMode,{children:o.jsx(sk,{basename:"/".replace(/\/$/,"")||"/",children:o.jsx(uP,{children:o.jsx(fP,{children:o.jsx(jP,{children:o.jsx(l4,{})})})})})}));export{BC as $,b4 as A,y4 as B,E4 as C,Ci as D,Ge as E,k4 as F,GT as G,uT as H,Oe as I,hT as J,kT as K,K as L,xc as M,of as N,Jy as O,C4 as P,af as Q,Ue as R,jv as S,S4 as T,T4 as U,j4 as V,w4 as W,Si as X,BP as Y,p5 as Z,_4 as _,Pt as a,m4 as a0,Ye as a1,yd as a2,zP as a3,$P as a4,f4 as a5,Zt as a6,kv as a7,h4 as a8,Bp as a9,qT as aA,XT as aB,QT as aC,eP as aD,nP as aE,sP as aF,oP as aG,ZC as aH,d4 as aI,XC as aJ,u4 as aK,te as aa,_p as ab,JC as ac,tT as ad,io as ae,rT as af,aT as ag,qy as ah,dT as ai,pT as aj,xT as ak,Yy as al,wT as am,jT as an,CT as ao,PT as ap,_T as aq,Xy as ar,pc as as,Zy as at,Qy as au,IT as av,FT as aw,zT as ax,dr as ay,UT as az,gr as b,ae as c,ce as d,zo as e,wp as f,xd as g,hd as h,vr as i,o as j,$n as k,RN as l,pr as m,ur as n,Jd as o,ck as p,p4 as q,m as r,P4 as s,M4 as t,xe as u,g4 as v,x4 as w,v4 as x,_N as y,N4 as z}; +`).trim():b.innerText.replace(/\s+/g," ").trim();w!==g.trim()&&f.setValue(e,t,n,h,w),b.innerText!==w&&(b.innerText=w)};return o.jsx(i,{...c,className:`${u} live-editable${f.hasPending(e,t,n,h)?" live-editable-changed":""}`,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!0,"data-live-placeholder":l,onClick:Oo,onPaste:UN,onKeyDown:b=>{b.key==="Enter"&&!a?(b.preventDefault(),b.currentTarget.blur()):b.key==="Escape"&&(b.currentTarget.innerText=g,b.currentTarget.blur()),b.stopPropagation()},onKeyUp:b=>b.stopPropagation(),onBlur:b=>y(b.currentTarget),children:g},`${h}:${g}`)}function Ge({k:e,...t}){const{t:n}=xe();return o.jsx(ce,{entity:"text",id:e,field:"value",value:n(e),placeholder:"Leer = Standardtext",...t})}function vr({entity:e,id:t,field:n,lang:r,value:s,label:i="Text",className:a="",...l}){const{language:u}=xe(),c=Xe(),d=r||u,f=c.getValue(e,t,n,d,s??"")??"";if(!c.canEdit(e))return o.jsx("div",{className:a,...l,dangerouslySetInnerHTML:{__html:f}});const h=g=>{Oo(g),c.openEditor({kind:"html",entity:e,id:t,field:n,lang:d,label:i,original:f})};return o.jsx("div",{...l,className:`${a} live-editable live-editable-block${c.hasPending(e,t,n,d)?" live-editable-changed":""}`,role:"button",tabIndex:0,title:"Klicken zum Bearbeiten",onClick:h,onKeyDown:g=>g.key==="Enter"&&h(g),"data-live-placeholder":"Text hinzufügen…",dangerouslySetInnerHTML:{__html:f}})}function yc({entity:e,id:t,field:n,lang:r,value:s,label:i,kind:a="textarea",hint:l,as:u="div",className:c="",children:d,...f}){const{language:h}=xe(),g=Xe(),y=r||h;if(!g.canEdit(e))return o.jsx(u,{className:c,...f,children:d});const b=g.getValue(e,t,n,y,s??"")??"",w=p=>{Oo(p),g.openEditor({kind:a,entity:e,id:t,field:n,lang:y,label:i,hint:l,original:b})};return o.jsx(u,{...f,className:`${c} live-editable live-editable-block${g.hasPending(e,t,n,y)?" live-editable-changed":""}`,role:"button",tabIndex:0,title:`${i} bearbeiten`,onClickCapture:w,onKeyDown:p=>p.key==="Enter"&&w(p),children:d})}function ws({id:e,value:t,label:n="Bild",aspect:r,buttonLabel:s="Bild tauschen",as:i="div",className:a="",children:l,...u}){const c=Xe();if(!c.canEdit("site_images"))return l?o.jsx(i,{className:a,...u,children:l}):null;const d=f=>{Oo(f),c.openEditor({kind:"image",entity:"site_images",id:e,field:"path",lang:"de",label:n,aspect:r,original:t||""})};return o.jsxs(i,{...u,className:`${a}${/\babsolute\b/.test(a)?"":" relative"}${c.hasPending("site_images",e,"path","de")?" live-editable-changed":""}`,children:[l,o.jsxs("button",{type:"button",onClick:d,className:"absolute left-2 top-2 z-10 inline-flex items-center gap-1.5 rounded-full bg-black/75 px-3 py-1.5 text-xs font-semibold text-white shadow-lg ring-1 ring-white/30 backdrop-blur hover:bg-black/90",children:[o.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[o.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),o.jsx("circle",{cx:"9",cy:"9",r:"2"}),o.jsx("path",{d:"m21 15-3.1-3.1a2 2 0 0 0-2.8 0L6 21"})]}),s]})]})}function WN({items:e,entity:t="faqs"}){const[n,r]=m.useState(null),s=Xe(),{language:i}=xe();return s.canEdit(t)?o.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:e.map((a,l)=>o.jsxs("div",{className:"space-y-3 px-5 py-4",children:[o.jsx(ce,{entity:t,id:a.id,field:"question",value:a.question,as:"p",className:"block font-medium text-neutral-900 dark:text-white",placeholder:"Frage"}),o.jsx(ce,{entity:t,id:a.id,field:"answer",value:a.answer,as:"p",multiline:!0,className:"block whitespace-pre-line text-sm text-neutral-600 dark:text-neutral-300",placeholder:"Antwort"})]},a.id??l))}):o.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:e.map((a,l)=>{const u=n===l,c=a.id?{...a,question:s.getValue(t,a.id,"question",i,a.question),answer:s.getValue(t,a.id,"answer",i,a.answer)}:a;return o.jsxs("div",{children:[o.jsxs("button",{onClick:()=>r(u?null:l),className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left","aria-expanded":u,children:[o.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:c.question}),o.jsx(nn.svg,{animate:{rotate:u?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:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6 9 6 6 6-6"})})]}),o.jsx(nE,{initial:!1,children:u&&o.jsx(nn.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:o.jsx("p",{className:"px-5 pb-4 text-sm text-neutral-600 dark:text-neutral-300",children:c.answer})})})]},c.id??c.question)})})}function Pv({count:e=5,className:t="h-4 w-4"}){return o.jsx("div",{className:"flex gap-0.5 text-amber-400",children:Array.from({length:e}).map((n,r)=>o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:t,children:o.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 GN=70;function KN({testimonials:e}){const t=m.useRef(null),n=m.useRef(null),r=m.useRef({pos:0,half:0,hovering:!1,dragging:!1,dragStartX:0,dragStartPos:0,lastTime:null,rafId:null}).current;m.useLayoutEffect(()=>{const i=n.current,a=window.matchMedia("(prefers-reduced-motion: reduce)").matches,l=()=>{i.style.transform=`translateX(${r.pos}px)`},u=x=>{if(r.half<=0)return x;for(;x>0;)x-=r.half;for(;x<=-r.half;)x+=r.half;return x},c=()=>{r.half=i.scrollWidth/2,r.pos===0?r.pos=-r.half:r.pos=u(r.pos),l()};c();const d=new ResizeObserver(c);d.observe(i);const f=x=>{r.lastTime===null&&(r.lastTime=x);const v=(x-r.lastTime)/1e3;r.lastTime=x,!r.dragging&&!r.hovering&&!a&&(r.pos=u(r.pos+GN*v),l()),r.rafId=requestAnimationFrame(f)};r.rafId=requestAnimationFrame(f);const h=t.current,g=()=>{r.hovering=!0},y=()=>{r.hovering=!1},b=x=>{r.dragging=!0,r.dragStartX=x.clientX,r.dragStartPos=r.pos,h.setPointerCapture(x.pointerId),h.classList.add("cursor-grabbing"),h.classList.remove("cursor-grab")},w=x=>{r.dragging&&(r.pos=u(r.dragStartPos+(x.clientX-r.dragStartX)),l())},p=x=>{r.dragging&&(r.dragging=!1,h.hasPointerCapture(x.pointerId)&&h.releasePointerCapture(x.pointerId),h.classList.remove("cursor-grabbing"),h.classList.add("cursor-grab"))};return h.addEventListener("pointerenter",g),h.addEventListener("pointerleave",y),h.addEventListener("pointerdown",b),h.addEventListener("pointermove",w),h.addEventListener("pointerup",p),h.addEventListener("pointercancel",p),()=>{cancelAnimationFrame(r.rafId),d.disconnect(),h.removeEventListener("pointerenter",g),h.removeEventListener("pointerleave",y),h.removeEventListener("pointerdown",b),h.removeEventListener("pointermove",w),h.removeEventListener("pointerup",p),h.removeEventListener("pointercancel",p)}},[e.length]);const s=[...e,...e];return o.jsx("div",{ref:t,className:"marquee-viewport cursor-grab touch-pan-y select-none overflow-hidden",children:o.jsx("div",{ref:n,className:"marquee-track flex w-max gap-5",children:s.map((i,a)=>o.jsx("div",{className:"w-64 shrink-0 sm:w-72 lg:w-80",children:o.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:[o.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:o.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"})}),o.jsx(Pv,{className:"relative z-10 mb-3 h-4 w-4",count:i.rating||5}),o.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,'"']}),o.jsxs("div",{className:"relative z-10 mt-auto flex items-center gap-3",children:[i.photo?o.jsx("img",{src:i.photo,alt:"",referrerPolicy:"no-referrer",className:"h-9 w-9 shrink-0 rounded-full object-cover"}):o.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()}),o.jsx("p",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:i.name})]})]})},`${i.name}-${a}`))})})}function wp(e,t,n={x:0,y:0}){const r=Math.max(0,Math.min(100,e==null?n.x:Number(e)||0)),s=Math.max(0,Math.min(100,t==null?n.y:Number(t)||0));return{left:`${r}%`,top:`${s}%`,transform:`translate(-${r}%, -${s}%)`}}const qN="/assets/gallery-dash2-CEVCErVK.webp",YN="/assets/youtube-hintergrund-BqSbCrLQ.mp4",XN="/assets/youtube-hintergrund-mobil-BolxAIc0.mp4",Zi={left:"text-left",center:"text-center",right:"text-right"},ZN={left:"",center:"mx-auto",right:"ml-auto"},QN={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 bp({slug:e,label:t,url:n,className:r,style:s}){const{hidden_areas:i}=Pt(),a=Xe();return e&&a.canEdit("home_sections")?o.jsxs("span",{className:"inline-flex flex-wrap items-center justify-center gap-2",children:[o.jsx(ce,{entity:"home_sections",id:e,field:"button_label",value:t,className:r,style:s,placeholder:"Button-Text (leer = kein Button)"}),o.jsxs(yc,{entity:"home_sections",id:e,field:"button_url",lang:"de",value:n,kind:"input",label:"Button-Ziel",hint:"Interne Seite mit / am Anfang (z. B. /leistungen) oder volle Adresse (https://...).",as:"span",className:"rounded bg-black/60 px-2 py-1 text-xs font-medium text-white",children:["Ziel: ",n||"–"]})]}):!t||!n||Ev(n,i)?null:n.startsWith("/")?o.jsx(K,{to:n,className:r,style:s,children:t}):o.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:r,style:s,children:t})}function JN(){const{hero_image_path:e}=Pt(),t=e||qN,{t:n,language:r}=xe(),s=Do(),i=Xe(),a=i.canEdit("home_sections"),l=!s("page.vehicles"),u=n("home.stats"),c=Ro(),d=c.slot("craft"),f=c.slot("advice"),h=c.slot("youtube_poster"),g=c.slot("more"),y=n("home.galleryAlts"),b=c.insights().map((L,$)=>({...L,alt:y[$]||y[0]||""})),[w,p]=m.useState([]),[x,v]=m.useState({}),[k,E]=m.useState(!1),[C,j]=m.useState([]),S=L=>{const $=x[L]||QN,Qe=k&&{hero:n("home.heroTitle"),craft:n("home.craftTitle")}[L]||"",Hn=k&&L==="hero"?`

${n("home.heroSubtitle")}

`:"";return{eyebrow:i.getValue("home_sections",L,"eyebrow",r,$[`eyebrow_${r}`]||""),title:i.getValue("home_sections",L,"title",r,$[`title_${r}`]||Qe),bodyHtml:i.getValue("home_sections",L,"body_html",r,$[`body_html_${r}`]||Hn),align:$.text_align||"center",alignX:$.text_align_x,alignY:$.text_align_y,buttonLabel:i.getValue("home_sections",L,"button_label",r,$[`button_label_${r}`]||""),buttonUrl:i.getValue("home_sections",L,"button_url","de",$.button_url||""),fontFamily:$.font_family||void 0}},N=We("home_sections.hero.eyebrow"),P=We("home_sections.hero.title"),F=We("home_sections.youtube.eyebrow"),B=We("home_sections.youtube.title"),se=We("home_sections.youtube.button_label"),ne=We("home_sections.craft.eyebrow"),q=We("home_sections.craft.title"),G=We("home_sections.advice.eyebrow"),V=We("home_sections.advice.title"),T=We("home_sections.insights.eyebrow"),M=We("home_sections.insights.title"),A=We("home_sections.more.eyebrow"),R=We("home_sections.more.title"),H=We("home_sections.more.button_label");m.useEffect(()=>{ae.get("/home-sections").then(v).catch(()=>E(!0))},[]),m.useEffect(()=>{ae.get("/partners").then(j).catch(()=>{})},[]);const[_,I]=m.useState(null),Y=_?_.reviews.filter(L=>L.review_text).map(L=>({name:L.author_name,text:L.review_text,rating:L.rating,photo:L.profile_photo_url})):n("home.testimonials");m.useEffect(()=>{ae.get("/faqs").then(L=>{p(L.map($=>({id:$.id,question:r==="de"?$.question_de:$.question_en,answer:r==="de"?$.answer_de:$.answer_en})))}).catch(()=>{})},[r]),m.useEffect(()=>{ae.get("/google-reviews").then(L=>{L.rating!=null&&L.reviews.some($=>$.review_text)&&I(L)}).catch(()=>{})},[]),gr({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),m.useEffect(()=>{if(w.length===0||s("home.faq"))return;const L=document.createElement("script");return L.type="application/ld+json",L.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:w.map($=>({"@type":"Question",name:$.question,acceptedAnswer:{"@type":"Answer",text:$.answer}}))}),document.head.appendChild(L),()=>document.head.removeChild(L)},[w]),m.useEffect(()=>{var L;w.length>0&&window.location.hash==="#faq"&&((L=document.getElementById("faq"))==null||L.scrollIntoView())},[w]);const Z=m.useRef(null);m.useEffect(()=>{var uf,cf,df;const L=Z.current;if(!L)return;const $=(uf=window.matchMedia)==null?void 0:uf.call(window,"(prefers-reduced-motion: reduce)").matches,Qe=(cf=navigator.connection)==null?void 0:cf.saveData;if($||Qe)return;const Nv=((df=window.matchMedia)==null?void 0:df.call(window,"(max-width: 767px), (pointer: coarse)").matches)?XN:YN,lf=new IntersectionObserver(([_v])=>{_v.isIntersecting?(L.getAttribute("src")||(L.src=Nv),L.play().catch(()=>{})):L.paused||L.pause()},{rootMargin:"300px 0px"});return lf.observe(L),()=>lf.disconnect()},[]);const ue=m.useRef(null),{scrollYProgress:Q}=Hy({target:ue,offset:["start start","end start"]}),ke=IC(),De=gn(Q,[0,1],ke?["0%","0%"]:["-6%","6%"]),Ze=gn(Q,[0,1],ke?["0%","0%"]:["0%","60%"]),dt=gn(Q,[0,.8],[1,0]),he=gn(Q,[.5,1],[0,1]),ft=gn(he,L=>L>.05?"auto":"none"),W=gn(Q,[.5,1],[16,0]);return o.jsxs("div",{children:[o.jsx(nn.div,{style:{opacity:he,pointerEvents:ft,y:W},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:o.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[o.jsx(Ge,{k:"home.stickyCta",as:"p",className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block"}),o.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[l&&o.jsx(K,{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:o.jsx(Ge,{k:"home.selectVehicle"})}),o.jsx(K,{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:o.jsx(Ge,{k:"home.getInTouch"})})]})]})}),o.jsxs("section",{ref:ue,className:"relative -mt-[89px] h-svh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[o.jsx(nn.img,{style:{y:De,scale:1.15},src:t,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),o.jsx(nn.div,{style:{y:Ze,opacity:dt},className:"absolute inset-0",children:o.jsx("div",{className:"absolute w-full max-w-2xl px-4 text-center sm:px-6",style:{...wp(S("hero").alignX,S("hero").alignY,{x:50,y:50}),fontFamily:S("hero").fontFamily},children:o.jsxs(nn.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[(S("hero").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"hero",field:"eyebrow",value:S("hero").eyebrow,as:"p",className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",style:N,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"hero",field:"title",value:S("hero").title,as:"h1",className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",style:P,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"hero",field:"body_html",value:S("hero").bodyHtml,label:"Text",className:"legal-content mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg"}),o.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[l&&o.jsx(K,{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:o.jsx(Ge,{k:"home.selectVehicle"})}),o.jsx(K,{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:o.jsx(Ge,{k:"home.getInTouch"})})]})]})})})]}),!s("home.stats")&&o.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:o.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:u.map((L,$)=>o.jsxs(Ue,{index:$,children:[o.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:L.value}),o.jsx("p",{className:"text-sm text-neutral-400",children:L.label})]},L.label))})}),!s("home.partners")&&o.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:o.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[o.jsx(Ge,{k:"home.brandsHeading",as:"p",className:"mb-4 block text-center text-xs font-semibold uppercase tracking-wide text-neutral-400"}),o.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:C.map((L,$)=>o.jsx(Ue,{index:$,children:L.logo_path?o.jsx("img",{src:L.logo_path,alt:L.name,className:"h-8 max-w-[8rem] object-contain opacity-70 grayscale transition hover:opacity-100 hover:grayscale-0"}):o.jsx(ce,{entity:"partners",id:L.id,field:"name",lang:"de",value:L.name,className:"text-lg font-bold text-neutral-400 dark:text-neutral-600"})},L.id))})]})}),!s("home.youtube")&&o.jsxs("section",{className:"relative min-h-[70vh] overflow-hidden sm:min-h-[85vh]",children:[o.jsx("video",{ref:Z,loop:!0,muted:!0,playsInline:!0,preload:"none",poster:h.src,className:"absolute inset-0 h-full w-full object-cover"}),o.jsx("div",{className:"absolute inset-0 bg-black/55"}),o.jsx(ws,{id:"youtube_poster",value:h.custom,label:Zt.youtube_poster.label,aspect:Zt.youtube_poster.aspect,buttonLabel:"Video-Standbild tauschen",className:"absolute left-0 top-0 h-12 w-64"}),o.jsx("div",{className:"absolute w-full max-w-3xl px-4 text-center sm:px-6",style:{...wp(S("youtube").alignX,S("youtube").alignY,{x:50,y:50}),fontFamily:S("youtube").fontFamily},children:o.jsxs(Ue,{children:[(S("youtube").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"youtube",field:"eyebrow",value:S("youtube").eyebrow,as:"p",className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",style:F,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"youtube",field:"title",value:S("youtube").title,as:"h2",className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",style:B,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"youtube",field:"body_html",value:S("youtube").bodyHtml,label:"Text",className:"legal-content mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm"}),o.jsx(bp,{slug:"youtube",label:S("youtube").buttonLabel,url:S("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",style:se})]})})]}),!s("home.craft")&&o.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:o.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[o.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[o.jsx(Ue,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:o.jsx(ws,{id:"craft",value:d.custom,label:Zt.craft.label,aspect:Zt.craft.aspect,children:o.jsx("img",{src:d.src,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})}),o.jsxs(Ue,{direction:"right",index:1,className:Zi[S("craft").align],style:{fontFamily:S("craft").fontFamily},children:[(S("craft").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"craft",field:"eyebrow",value:S("craft").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:ne,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"craft",field:"title",value:S("craft").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:q,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"craft",field:"body_html",value:S("craft").bodyHtml,label:"Text",className:"legal-content text-neutral-600 dark:text-neutral-300"})]})]}),o.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[o.jsxs(Ue,{direction:"left",className:`order-2 md:order-1 ${Zi[S("advice").align]}`,style:{fontFamily:S("advice").fontFamily},children:[(S("advice").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"advice",field:"eyebrow",value:S("advice").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:G,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"advice",field:"title",value:S("advice").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:V,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"advice",field:"body_html",value:S("advice").bodyHtml,label:"Text",className:"legal-content text-neutral-600 dark:text-neutral-300"})]}),o.jsx(Ue,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:o.jsx(ws,{id:"advice",value:f.custom,label:Zt.advice.label,aspect:Zt.advice.aspect,children:o.jsx("img",{src:f.src,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})})]})]})}),!s("home.insights")&&o.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[o.jsxs(Ue,{className:`mb-8 ${Zi[S("insights").align]}`,style:{fontFamily:S("insights").fontFamily},children:[(S("insights").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"insights",field:"eyebrow",value:S("insights").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:T,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"insights",field:"title",value:S("insights").title,as:"h2",className:"text-2xl font-bold text-neutral-900 dark:text-white",style:M,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"insights",field:"body_html",value:S("insights").bodyHtml,label:"Text",className:"legal-content mt-2 text-neutral-600 dark:text-neutral-300"})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:b.map((L,$)=>o.jsx(Ue,{index:$%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:o.jsx(ws,{id:L.id,value:L.custom,label:`Einblicke: Foto ${$+1}`,aspect:1,className:"h-full w-full",children:o.jsx("img",{src:L.src,alt:L.alt,width:L.width,height:L.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},L.id))})]}),!s("home.reviews")&&o.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:o.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[o.jsxs(Ue,{className:"mb-10 text-center",children:[o.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:o.jsx(Pv,{className:"h-6 w-6",count:_?Math.round(_.rating):5})}),o.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:_?n("home.reviewsRatingDynamic")(_.rating,_.rating_count):n("home.reviewsRating")}),o.jsx(Ge,{k:"home.reviewsText",as:"p",className:"mt-1 text-neutral-600 dark:text-neutral-300"}),o.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:o.jsx(Ge,{k:"home.reviewsLink"})})]}),o.jsx(Ue,{children:o.jsx(KN,{testimonials:Y})})]})}),!s("home.more")&&o.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:o.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[o.jsx(Ue,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:o.jsx(ws,{id:"more",value:g.custom,label:Zt.more.label,aspect:Zt.more.aspect,className:"h-full w-full",children:o.jsx("img",{src:g.src,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})})}),o.jsxs(Ue,{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 ${Zi[S("more").align]}`,style:{fontFamily:S("more").fontFamily},children:[(S("more").eyebrow||a)&&o.jsx(ce,{entity:"home_sections",id:"more",field:"eyebrow",value:S("more").eyebrow,as:"p",className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",style:A,placeholder:"Vorspann (optional)"}),o.jsx(ce,{entity:"home_sections",id:"more",field:"title",value:S("more").title,as:"h2",className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",style:R,placeholder:"Überschrift"}),o.jsx(vr,{entity:"home_sections",id:"more",field:"body_html",value:S("more").bodyHtml,label:"Text",className:`legal-content mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 ${ZN[S("more").align]}`}),o.jsx(bp,{slug:"more",label:S("more").buttonLabel,url:S("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",style:H})]})]})}),!s("home.faq")&&o.jsx("section",{id:"faq",className:"scroll-mt-20 border-t border-neutral-300 py-16 dark:border-neutral-700",children:o.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[o.jsx(Ue,{className:"mb-8 text-center",children:o.jsx(Ge,{k:"home.faqHeading",as:"h2",className:"text-2xl font-bold text-neutral-900 dark:text-white"})}),o.jsx(Ue,{index:1,children:o.jsx(WN,{items:w})})]})})]})}function zo(e,t){return e?e.code==="rate_limited"||e.status===429?t("errors.rateLimited"):e.code==="invalid_input"||e.status===422?t("errors.invalidInput"):e.status===404?t("errors.notFound"):e.status===503?t("errors.maintenance"):e.status>=500?t("errors.server"):e.status?t("errors.generic"):t("errors.network"):""}const kp={vw:"volkswagen",mercedes:"mercedes-benz",benz:"mercedes-benz",mb:"mercedes-benz",chevy:"chevrolet",alfa:"alfa romeo"},e5=8,$s=e=>String(e||"").toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/ß/g,"ss").replace(/[-_./]+/g," ").replace(/\s+/g," ").trim(),lo=e=>e.replace(/\s/g,"");function t5(e,t){const n=(e||[]).map(s=>{const i=$s(s.name);return{key:`b${s.id}`,type:"brand",label:s.name,to:`/fahrzeuge/${s.slug}`,text:i,flat:lo(i)}}),r=(t||[]).map(s=>{const i=$s(`${s.brand_name} ${s.name}`);return{key:`m${s.id}`,type:"model",label:s.name,brand:s.brand_name,image:s.image_path,to:`/fahrzeuge/${s.brand_slug}/${s.slug}`,text:i,flat:lo(i),modelText:$s(s.name)}});return[...n,...r]}function n5(e,t){const n=$s(t).split(" ").filter(Boolean);if(n.length===0)return[];const r=n.map(a=>kp[a]?[a,$s(kp[a])]:[a]),s=lo(n.join("")),i=[];for(const a of e){const l=c=>a.text.includes(c)||a.flat.includes(lo(c));if(!r.every(c=>c.some(l))&&!a.flat.includes(s))continue;let u=0;for(const c of r)c.some(d=>a.text.startsWith(d))?u+=3:c.some(d=>` ${a.text}`.includes(` ${d}`))&&(u+=2),c.some(d=>{var f;return(f=a.modelText)==null?void 0:f.startsWith(d)})&&(u+=2);a.type==="brand"&&(u+=1),i.push({entry:a,score:u})}return i.sort((a,l)=>l.score-a.score||a.entry.text.localeCompare(l.entry.text,void 0,{numeric:!0})),i.slice(0,e5).map(a=>a.entry)}function r5({brands:e,width:t}){const{t:n}=xe(),r=pr(),s=m.useId(),i=m.useRef(null),[a,l]=m.useState(null),[u,c]=m.useState(""),[d,f]=m.useState(!1),[h,g]=m.useState(0),y=m.useRef(!1),b=()=>{a||y.current||(y.current=!0,ae.get("/vehicle-search").then(l).catch(()=>l([])).finally(()=>{y.current=!1}))},w=m.useMemo(()=>t5(e,a),[e,a]),p=m.useMemo(()=>n5(w,u),[w,u]),x=d&&u.trim()!=="",v=p.some(j=>j.image);m.useEffect(()=>g(0),[u]),m.useEffect(()=>{if(!x)return;const j=S=>{var N;(N=i.current)!=null&&N.contains(S.target)||f(!1)};return document.addEventListener("pointerdown",j),()=>document.removeEventListener("pointerdown",j)},[x]);const k=j=>{f(!1),r(j.to)},E=j=>{j.key==="ArrowDown"&&p.length?(j.preventDefault(),f(!0),g(S=>(S+1)%p.length)):j.key==="ArrowUp"&&p.length?(j.preventDefault(),g(S=>(S-1+p.length)%p.length)):j.key==="Enter"&&x&&p[h]?(j.preventDefault(),k(p[h])):j.key==="Escape"&&(x?f(!1):c(""))},C=a===null&&u.trim()!=="";return o.jsxs("div",{ref:i,className:"relative mb-8 max-w-full",style:{width:t?`${t}px`:"100%"},children:[o.jsx("label",{htmlFor:`${s}-input`,className:"sr-only",children:n("vehicleSearch.label")}),o.jsxs("div",{className:"relative flex items-center",children:[o.jsx(GT,{className:"pointer-events-none absolute left-4 h-[18px] w-[18px] text-neutral-400","aria-hidden":"true"}),o.jsx("input",{id:`${s}-input`,type:"search",role:"combobox","aria-expanded":x,"aria-controls":`${s}-list`,"aria-autocomplete":"list","aria-activedescendant":x&&p[h]?`${s}-${p[h].key}`:void 0,autoComplete:"off",spellCheck:!1,value:u,placeholder:n("vehicleSearch.placeholder"),onFocus:()=>{b(),f(!0)},onChange:j=>{b(),c(j.target.value),f(!0)},onKeyDown:E,className:"vehicle-search-input w-full rounded-xl border border-neutral-300 bg-gradient-to-b from-white to-neutral-50 py-3.5 pl-11 pr-11 text-[15px] text-neutral-900 outline-none transition-[border-color,box-shadow] duration-200 placeholder:text-neutral-400 focus:border-brand-500 dark:border-neutral-700 dark:from-neutral-800 dark:to-neutral-900 dark:text-white dark:placeholder:text-neutral-500 [&::-webkit-search-cancel-button]:hidden"}),u&&o.jsx("button",{type:"button",onClick:()=>c(""),"aria-label":n("vehicleSearch.clear"),className:"absolute right-3 rounded-md p-1 text-neutral-400 transition hover:text-neutral-700 dark:hover:text-neutral-200",children:o.jsx(Si,{className:"h-4 w-4"})})]}),x&&o.jsx("div",{className:"absolute inset-x-0 top-full z-30 mt-2 overflow-hidden rounded-xl border border-neutral-200 bg-white shadow-lg dark:border-neutral-800 dark:bg-neutral-900",children:p.length>0?o.jsx("ul",{id:`${s}-list`,role:"listbox",className:"max-h-[360px] overflow-y-auto py-1",children:p.map((j,S)=>o.jsx("li",{id:`${s}-${j.key}`,role:"option","aria-selected":S===h,children:o.jsxs(K,{to:j.to,onClick:()=>f(!1),onMouseEnter:()=>g(S),className:`flex items-center gap-3 px-4 py-2.5 text-[15px] ${S===h?"bg-neutral-100 dark:bg-neutral-800":""}`,children:[j.type==="model"?o.jsxs(o.Fragment,{children:[j.image?o.jsx("img",{src:j.image,alt:"",loading:"lazy",className:"h-9 w-14 shrink-0 rounded object-cover"}):v&&o.jsx("span",{className:"h-9 w-14 shrink-0 rounded bg-neutral-100 dark:bg-neutral-800"}),o.jsxs("span",{className:"min-w-0 flex-1 truncate text-neutral-900 dark:text-white",children:[o.jsx("span",{className:"text-neutral-500 dark:text-neutral-400",children:j.brand})," ",j.label]})]}):o.jsxs("span",{className:"min-w-0 flex-1 truncate text-neutral-900 dark:text-white",children:[j.label,o.jsx("span",{className:"ml-2 text-xs uppercase tracking-wider text-neutral-500 dark:text-neutral-400",children:n("vehicleSearch.allModels")})]}),o.jsx(JC,{className:`h-4 w-4 shrink-0 text-brand-500 transition-opacity ${S===h?"opacity-100":"opacity-0"}`,"aria-hidden":"true"})]})},j.key))}):o.jsx("div",{id:`${s}-list`,className:"px-4 py-3 text-sm text-neutral-500 dark:text-neutral-400",children:C?n("vehicleSearch.loading"):o.jsxs(o.Fragment,{children:[n("vehicleSearch.noResults")," ",o.jsx(K,{to:"/kontakt",className:"font-semibold text-brand-500 hover:underline",children:n("vehicleSearch.contact")})]})})})]})}function s5(){const[e,t]=m.useState(null),[n,r]=m.useState(null),s=Io(),{t:i}=xe(),a=nf(),{vehicle_tile_width:l,vehicle_tile_height:u}=Pt(),c={width:`${l}px`,height:`${u}px`},d=m.useRef(null),[f,h]=m.useState(0);m.useEffect(()=>{const p=d.current;if(!p)return;const x=new ResizeObserver(([v])=>h(v.contentRect.width));return x.observe(p),()=>x.disconnect()},[]);const g=16,y=e?e.length:6,b=Math.max(1,Math.min(y,Math.floor((f+g)/(Number(l)+g)))),w=f&&y?b*Number(l)+(b-1)*g:void 0;return gr({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),m.useEffect(()=>{s.vehicles.enabled&&!s.bypass||ae.get("/brands").then(t).catch(p=>r(p))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?o.jsx(ji,{message:s.vehicles.message}):o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[o.jsx("div",{ref:d}),s.vehicles.enabled&&s.bypass&&o.jsx(Ei,{inline:!0}),o.jsx(Ge,{k:"vehicleSelect.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),o.jsx(Ge,{k:"vehicleSelect.intro",as:"p",className:"mb-6 block text-neutral-600 dark:text-neutral-300"}),o.jsx(r5,{brands:e,width:w}),n&&o.jsx("p",{className:"text-red-600",children:typeof n=="string"?n:zo(n,i)}),e===null&&!n&&o.jsx("div",{className:"flex flex-wrap gap-4","aria-busy":"true","aria-label":i("vehicleSelect.loading"),children:Array.from({length:6},(p,x)=>o.jsx("div",{style:c,className:"shrink-0 animate-pulse rounded-xl bg-neutral-200 dark:bg-neutral-800"},x))}),(e==null?void 0:e.length)===0&&!n&&o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),o.jsx("div",{className:"flex flex-wrap gap-4",children:(e||[]).map(p=>p.image_path?o.jsxs(K,{to:`/fahrzeuge/${p.slug}`,style:c,className:"group relative block shrink-0 overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[o.jsx("img",{src:p.image_path,alt:"",loading:"lazy",decoding:"async",width:l,height:u,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),o.jsx(ce,{entity:"brands",id:p.id,field:"name",lang:"de",value:p.name,className:"absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white",style:fr(a,`brands.${p.id}.name`)})]},p.id):o.jsx(K,{to:`/fahrzeuge/${p.slug}`,style:c,className:"flex shrink-0 flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 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.jsx(ce,{entity:"brands",id:p.id,field:"name",lang:"de",value:p.name,style:fr(a,`brands.${p.id}.name`)})},p.id))})]})}function of(){const{t:e}=xe(),{phone:t}=Pt(),n=Do();return gr({title:e("notFound.metaTitle"),noindex:!0}),o.jsxs("div",{className:"mx-auto max-w-2xl px-4 py-20 text-center sm:px-6",children:[o.jsx("p",{className:"text-sm font-semibold uppercase tracking-[4px] text-brand-500",children:"404"}),o.jsx("h1",{className:"mt-3 text-3xl font-bold text-neutral-900 dark:text-white sm:text-4xl",children:e("notFound.title")}),o.jsx("p",{className:"mx-auto mt-4 max-w-md text-neutral-600 dark:text-neutral-300",children:e("notFound.text")}),o.jsxs("div",{className:"mt-10 flex flex-wrap justify-center gap-3",children:[!n("page.vehicles")&&o.jsxs(K,{to:"/fahrzeuge",className:"inline-flex items-center gap-2 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:[o.jsx(io,{className:"h-4 w-4"}),e("notFound.toVehicles")]}),o.jsxs(K,{to:"/kontakt",className:"inline-flex items-center gap-2 rounded-md border border-neutral-300 px-5 py-3 text-sm font-semibold text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:[o.jsx(pc,{className:"h-4 w-4"}),e("notFound.toContact")]}),t&&o.jsxs("a",{href:fi(t),className:"inline-flex items-center gap-2 rounded-md border border-neutral-300 px-5 py-3 text-sm font-semibold text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:[o.jsx(dr,{className:"h-4 w-4"}),t]})]}),o.jsx(K,{to:"/",className:"mt-8 inline-block text-sm text-neutral-500 underline hover:text-brand-500",children:e("notFound.toHome")})]})}function i5(){const{brandSlug:e}=xd(),[t,n]=m.useState(null),[r,s]=m.useState(null),i=Io(),{t:a}=xe(),l=nf(),u=We(t?`brands.${t.brand.id}.name`:""),{vehicle_tile_width:c,vehicle_tile_height:d}=Pt(),f={width:`${c}px`,height:`${d}px`};return m.useEffect(()=>{i.vehicles.enabled&&!i.bypass||ae.get(`/brands/${e}/models`).then(n).catch(h=>s(h))},[e,i.vehicles.enabled,i.bypass]),gr({title:t?`${t.brand.name} ${a("brandPage.titleSuffix")}`:a("brandPage.metaTitleFallback"),description:t?a("brandPage.metaDescription")(t.brand.name):void 0,path:`/fahrzeuge/${e}`}),i.vehicles.enabled&&!i.bypass?o.jsx(ji,{message:i.vehicles.message}):r?r.status===404?o.jsx(of,{}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:zo(r,a)}):t?o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&o.jsx(Ei,{inline:!0}),o.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[o.jsx("span",{style:u,children:t.brand.name})," – ",a("brandPage.titleSuffix")]}),t.models.length===0&&o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a("brandPage.empty")}),o.jsx("div",{className:"flex flex-wrap gap-4",children:t.models.map(h=>h.image_path?o.jsxs(K,{to:`/fahrzeuge/${e}/${h.slug}`,style:f,className:"group relative block shrink-0 overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[o.jsx("img",{src:h.image_path,alt:"",loading:"lazy",decoding:"async",width:c,height:d,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}),o.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),o.jsx(ce,{entity:"car_models",id:h.id,field:"name",lang:"de",value:h.name,className:"absolute inset-x-0 bottom-0 p-4 text-center text-lg font-extrabold text-white",style:fr(l,`car_models.${h.id}.name`)})]},h.id):o.jsx(K,{to:`/fahrzeuge/${e}/${h.slug}`,style:f,className:"flex shrink-0 flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-white px-6 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.jsx(ce,{entity:"car_models",id:h.id,field:"name",lang:"de",value:h.name,style:fr(l,`car_models.${h.id}.name`)})},h.id))})]}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:a("brandPage.loading")})}function a5({text:e}){return e?e.split(/(\*\*[^*]+\*\*)/g).map((n,r)=>{const s=n.match(/^\*\*([^*]+)\*\*$/);return s?o.jsx("strong",{children:s[1]},r):o.jsx("span",{children:n},r)}):null}const Sp="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==";function Dn(e,t,n){if(!e)return"";if(n==="en"){const r=e[`${t}_en`];if(r)return r}return e[t]}const o5=(e,t,n)=>{t/=100,n/=100;const r=a=>(a+e/30)%12,s=t*Math.min(n,1-n),i=a=>n-s*Math.max(-1,Math.min(r(a)-3,Math.min(9-r(a),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},zl=(e,t,n)=>`rgb(${o5(e,t,n).join(", ")})`,jp=e=>e.map(([t,n,r,s,i,a])=>({bgTop:zl(t,n,r),border:zl(t,n,r+8),accent:zl(s,i,a),img:null})),Ep={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:fv},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:hv},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:mv},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:pv},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:gv},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:xv},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:yv},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:vv}],"deep-blue":jp([[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":jp([[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]])},l5="#f2f2f2",Cp="#8a8a8a",Tp="#c4c4c4",Pp=5,u5=3,c5={recommended:{Icon:eP,className:"bg-brand-500 text-white"},popular:{Icon:jT,className:"bg-amber-400 text-neutral-950"},tip:{Icon:PT,className:"bg-sky-500 text-white"},coming_soon:{Icon:Yy,className:"bg-white text-neutral-900"},custom:{Icon:null,className:"bg-brand-500 text-white"}};function d5({pkg:e,tier:t,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:a,priceNote:l,t:u}){const[c,d]=m.useState(!1),f=Xe().canEdit("packages"),[h,g]=m.useState(!1),y=m.useRef(null),b=s.length-Pp,w=c?s:s.slice(0,Pp);m.useLayoutEffect(()=>{const N=y.current;if(!N||c){g(!1);return}const P=()=>g([...N.querySelectorAll("[data-clamp]")].some(B=>B.scrollHeight>B.clientHeight+1));P();const F=new ResizeObserver(P);return F.observe(N),()=>F.disconnect()},[c,s.length,e.description]);const p=nf(),x=fr(p,`packages.${e.id}.description`),v=fr(p,`packages.${e.id}.price_text`),{package_card_height:k}=Pt(),E=c5[e.badge],C=r!=="grid",j=e.badge==="custom"?e.badge_text:e.badge&&u(`modelPage.badges.${e.badge}`),S=t.img?null:{backgroundColor:t.accent,WebkitMaskImage:`url(${Sp})`,maskImage:`url(${Sp})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return o.jsxs("div",{style:{borderColor:t.border,background:`linear-gradient(180deg, ${t.bgTop} 0%, #0b0b0b 55%, #080808 100%)`,...C?{gridRow:"span 4",gridTemplateRows:"subgrid",rowGap:0}:{minHeight:`${k}px`}},className:r==="strip"?"relative grid snap-start overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40":r==="coverflow"?"relative grid snap-center overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40":"relative flex flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40",children:[t.img?o.jsx("img",{src:t.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...S,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),o.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...S,opacity:.55+n*.45},"aria-hidden":"true"})]}),E&&j&&o.jsxs("span",{className:`absolute top-2 left-1/2 z-10 flex max-w-[calc(100%-16px)] -translate-x-1/2 items-center gap-1 whitespace-nowrap rounded-full px-3 py-1 text-xs font-bold shadow ${E.className}`,children:[E.Icon&&o.jsx(E.Icon,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"}),o.jsx("span",{className:"truncate",children:j})]}),o.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0",gridRow:1},children:[o.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:t.accent,textTransform:"uppercase",lineHeight:1.1},children:o.jsx(ce,{entity:"packages",id:e.id,field:"name",lang:"de",value:e.name,placeholder:"Paketname"})}),o.jsx("div",{style:{width:"44px",height:"2px",margin:"14px auto 0",background:`linear-gradient(90deg, rgba(255,255,255,0) 0%, ${t.accent} 50%, rgba(255,255,255,0) 100%)`}})]}),s.length>0&&o.jsxs("div",{className:"relative z-10",style:{gridRow:2,padding:"18px 20px 14px",background:c?"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:[o.jsx(yc,{entity:"packages",id:e.id,field:"description",value:e.description,label:"Zusätzliche Stichpunkte",hint:"Eine Zeile = ein Stichpunkt (unter den Produkten). **fett** wird fett dargestellt. Die Produkte selbst pflegst du im Admin unter Pakete.",children:o.jsx("ul",{ref:y,className:"space-y-1.5 text-left",children:w.map((N,P)=>o.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:Tp,...N.fromDescription?x:null},children:[o.jsx(qy,{className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:t.accent}}),o.jsx("span",{"data-clamp":!0,className:"leading-snug",style:c?void 0:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:u5,overflow:"hidden"},children:N.fromDescription?o.jsx(a5,{text:N.text}):N.text})]},P))})}),(c||b>0||h)&&o.jsxs("button",{type:"button",onClick:()=>d(N=>!N),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:t.accent},children:[c?u("modelPage.lessBullets"):b>0?u("modelPage.moreBullets")(b):u("modelPage.showMore"),c?o.jsx(pT,{className:"h-3.5 w-3.5"}):o.jsx(uT,{className:"h-3.5 w-3.5"})]})]}),s.length===0&&f&&o.jsx(yc,{entity:"packages",id:e.id,field:"description",value:e.description,label:"Zusätzliche Stichpunkte",hint:"Eine Zeile = ein Stichpunkt. **fett** wird fett dargestellt.",className:"relative z-10 mx-5 mt-4 text-center text-xs",style:{gridRow:2,color:Tp},children:"+ Stichpunkte hinzufügen"}),o.jsx("div",{className:"relative z-10 flex-1",style:{gridRow:3}}),o.jsx("div",{className:"relative z-10",style:{gridRow:4,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:o.jsxs("div",{className:"text-center",children:[!e.price_text&&o.jsx("div",{style:{fontSize:"13px",color:Cp},children:u("modelPage.totalPrice")}),o.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:l5,...e.price_text?v:null},children:f?o.jsx(ce,{entity:"packages",id:e.id,field:"price_text",value:e.price_text,placeholder:i(e.total_price),title:"Leer lassen = Preis automatisch aus den Produkten"}):e.price_text||i(e.total_price)}),!e.price_text&&l&&o.jsx("div",{style:{marginTop:"2px",fontSize:"11px",color:Cp},children:l}),o.jsx(K,{to:a(e),onClick:()=>An("select_package",{package_name:e.name,value:Number(e.total_price)||void 0,currency:"EUR"}),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:u("modelPage.requestContact")}),e.video_url&&o.jsx("div",{className:"mt-3",children:o.jsxs("a",{href:e.video_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-full border border-white/15 bg-white/5 px-3 py-1 text-xs font-semibold text-white transition hover:bg-white/15",children:[o.jsx(xT,{className:"h-4 w-4 text-red-500","aria-hidden":"true"}),u("modelPage.videoLink")]})})]})})]})}function f5(){const{brandSlug:e,modelSlug:t}=xd(),[n,r]=m.useState(null),[s,i]=m.useState(null),a=Io(),{t:l,language:u}=xe(),c=Xe(),{package_card_theme:d,package_card_layout:f,package_wheel_hint_interval:h,package_card_width:g,package_card_height:y,phone:b,whatsapp:w,price_note:p,price_note_en:x}=Pt(),v=u==="en"&&x||p,k=Ro(),E=(Ep[d]||Ep.graphite).map((_,I)=>{const{custom:Y}=k.packageTier(I);return Y?{..._,img:Y}:_}),C=["grid","strip","coverflow"].includes(f)?f:"strip",j=Math.max(2,Number(h)||8)*1e3,S=m.useRef(null),N=m.useRef(null),P=m.useRef(null),[F,B]=m.useState(!1),se=_=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(_);m.useEffect(()=>{a.vehicles.enabled&&!a.bypass||ae.get(`/models/${e}/${t}/packages`).then(r).catch(_=>i(_))},[e,t,a.vehicles.enabled,a.bypass]),m.useEffect(()=>{const _=S.current;if(C!=="coverflow"||!_)return;let I=0;const Y=()=>{I=0;const Q=_.scrollLeft+_.clientWidth/2;for(const ke of _.children){const De=ke.offsetLeft+ke.offsetWidth/2,Ze=Math.max(-1,Math.min(1,(De-Q)/(ke.offsetWidth*1.4))),dt=Math.abs(Ze);ke.style.transform=`rotateY(${(-Ze*35).toFixed(2)}deg) scale(${(1-dt*.13).toFixed(3)}) translateZ(${(-dt*60).toFixed(1)}px)`,ke.style.zIndex=String(100-Math.round(dt*50))}},Z=()=>{I||(I=requestAnimationFrame(Y))};Y(),_.addEventListener("scroll",Z,{passive:!0});const ue=new ResizeObserver(Z);return ue.observe(_),()=>{_.removeEventListener("scroll",Z),ue.disconnect(),cancelAnimationFrame(I)}},[C,n]),m.useEffect(()=>{const _=S.current;if(C==="grid"||!_)return;const I=window.matchMedia("(pointer: coarse)").matches;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let Z=[],ue=0;const Q=()=>{const De=Math.min(_.clientWidth*.4,160);Z.push(setTimeout(()=>_.scrollTo({left:De,behavior:"smooth"}),500)),Z.push(setTimeout(()=>_.scrollTo({left:0,behavior:"smooth"}),1250)),I||(Z.push(setTimeout(()=>B(!0),450)),Z.push(setTimeout(()=>B(!1),1700)))},ke=new IntersectionObserver(([De])=>{De.isIntersecting&&(ke.disconnect(),Q(),ue=setInterval(()=>{_.scrollLeft<=1&&Q()},j))},{threshold:.35});return ke.observe(_),()=>{ke.disconnect(),clearInterval(ue),Z.forEach(clearTimeout)}},[C,n,j]),m.useEffect(()=>{const _=S.current;if(C==="grid"||!_)return;let I=0,Y=0,Z=!1,ue=0,Q=0;const ke=()=>[..._.children].map(he=>he.offsetLeft+he.offsetWidth/2),De=(he,ft)=>{let W=0,L=1/0;return he.forEach(($,Qe)=>{const Hn=Math.abs($-ft);Hn{Z=!1;const he=ke();if(!he.length)return;const ft=_.scrollLeft+_.clientWidth/2,W=De(he,ft);let L=W;W===ue&&Math.abs(Q)>4&&(L=Q>0?Math.min(ue+1,he.length-1):Math.max(ue-1,0));const $=_.scrollWidth-_.clientWidth,Qe=Math.max(0,Math.min(he[L]-_.clientWidth/2,$));_.scrollTo({left:Qe,behavior:"smooth"}),clearTimeout(Y),Y=setTimeout(()=>{_.style.scrollSnapType=""},450)},dt=he=>{if(Math.abs(he.deltaX)>Math.abs(he.deltaY))return;const ft=_.scrollWidth-_.clientWidth;if(ft<=1)return;const W=_.scrollLeft<=1,L=_.scrollLeft>=ft-1;he.deltaY<0&&W||he.deltaY>0&&L||(he.preventDefault(),Z||(Z=!0,Q=0,ue=De(ke(),_.scrollLeft+_.clientWidth/2)),Q+=he.deltaY,_.style.scrollSnapType="none",_.scrollLeft+=he.deltaY,clearTimeout(I),I=setTimeout(Ze,150))};return _.addEventListener("wheel",dt,{passive:!1}),()=>{_.removeEventListener("wheel",dt),clearTimeout(I),clearTimeout(Y)}},[C,n]),m.useEffect(()=>{const _=S.current,I=N.current,Y=P.current;if(C==="grid"||!_||!I||!Y)return;let Z=0;const ue=()=>{Z=0;const L=_.scrollWidth-_.clientWidth;if(L<=1){I.style.opacity="0",I.style.pointerEvents="none";return}I.style.opacity="1",I.style.pointerEvents="auto";const $=I.clientWidth,Qe=Math.max(32,_.clientWidth/_.scrollWidth*$);Y.style.width=`${Qe}px`,Y.style.transform=`translateX(${(_.scrollLeft/L*($-Qe)).toFixed(1)}px)`},Q=()=>{Z||(Z=requestAnimationFrame(ue))};ue(),_.addEventListener("scroll",Q,{passive:!0});const ke=new ResizeObserver(Q);ke.observe(_);let De=!1,Ze=0;const dt=L=>{const $=I.getBoundingClientRect(),Qe=Y.clientWidth,Hn=Math.min(Math.max(L-$.left-Ze,0),$.width-Qe);_.scrollLeft=Hn/($.width-Qe)*(_.scrollWidth-_.clientWidth)},he=L=>{De=!0,I.setPointerCapture(L.pointerId),_.style.scrollSnapType="none";const $=Y.getBoundingClientRect();Ze=L.clientX>=$.left&&L.clientX<=$.right?L.clientX-$.left:Y.clientWidth/2,L.clientX>=$.left&&L.clientX<=$.right||dt(L.clientX)},ft=L=>{De&&dt(L.clientX)},W=L=>{var $;De&&(De=!1,($=I.hasPointerCapture)!=null&&$.call(I,L.pointerId)&&I.releasePointerCapture(L.pointerId),_.style.scrollSnapType="")};return I.addEventListener("pointerdown",he),I.addEventListener("pointermove",ft),I.addEventListener("pointerup",W),I.addEventListener("pointercancel",W),()=>{_.removeEventListener("scroll",Q),ke.disconnect(),cancelAnimationFrame(Z),I.removeEventListener("pointerdown",he),I.removeEventListener("pointermove",ft),I.removeEventListener("pointerup",W),I.removeEventListener("pointercancel",W)}},[C,n]),gr({title:n?l("modelPage.metaTitle")(n.model.brand_name,n.model.name):l("modelPage.metaTitleFallback"),description:n?l("modelPage.metaDescription")(n.model.brand_name,n.model.name):void 0,path:`/fahrzeuge/${e}/${t}`});const ne=We(n?`car_models.${n.model.id}.name`:"");if(a.vehicles.enabled&&!a.bypass)return o.jsx(ji,{message:a.vehicles.message});if(s)return s.status===404?o.jsx(of,{}):o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:zo(s,l)});if(!n)return o.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:l("modelPage.loading")});const{model:q}=n,G=n.packages.map(_=>({..._,name:c.getValue("packages",_.id,"name","de",_.name),description:c.getValue("packages",_.id,"description",u,Dn(_,"description",u)),tagline:Dn(_,"tagline",u),price_text:c.getValue("packages",_.id,"price_text",u,Dn(_,"price_text",u))})),V=new Map([...G].sort((_,I)=>_.total_price-I.total_price).map((_,I)=>[_.id,I])),T=_=>{const I=_.tier_count??G.length,Y=_.tier_rank??V.get(_.id)??0,Z=I<=1?0:Y/(I-1),ue=Math.round(Z*(E.length-1));return{tier:E[ue],tierT:Z}},M=_=>[..._.products.map(I=>({text:I.name_override||I.scraped_name||l("modelPage.productLoading"),fromDescription:!1})),...(_.description||"").split(` +`).map(I=>I.trim()).filter(Boolean).map(I=>({text:I,fromDescription:!0}))],A=_=>`/kontakt?${new URLSearchParams({brand:q.brand_name,model:q.name,package:_.name,packageId:_.id,total:_.total_price,brandSlug:e,modelSlug:t}).toString()}`,R=`/kontakt?${new URLSearchParams({brand:q.brand_name,model:q.name}).toString()}`,H=l("modelPage.whatsappText")(q.brand_name,q.name);return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-12 sm:px-6",children:[a.vehicles.enabled&&a.bypass&&o.jsx(Ei,{inline:!0}),o.jsxs("h1",{className:`text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl ${G.length?"mb-2":"mb-8"}`,children:[q.brand_name," ",o.jsx(ce,{entity:"car_models",id:q.id,field:"name",lang:"de",value:q.name,style:ne})," – ",l("modelPage.titleSuffix")]}),G.length===0&&o.jsxs("div",{className:"pb-12",children:[o.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:l("modelPage.empty")}),o.jsx(K,{to:R,className:"mt-5 inline-block rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:l("modelPage.customRequest")})]})]}),G.length>0&&o.jsx("section",{className:"py-10 sm:py-14",style:{fontFamily:"'Barlow', sans-serif"},children:o.jsxs("div",{className:C==="grid"?"mx-auto max-w-6xl px-4 sm:px-6":"relative mx-auto max-w-[1880px] px-4 sm:px-6",children:[o.jsx("div",{ref:C==="grid"?void 0:S,className:C==="grid"?"grid items-stretch gap-[18px]":"grid select-none gap-x-[18px] overflow-x-auto pb-3 snap-x snap-mandatory [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:C==="grid"?{gridTemplateColumns:`repeat(auto-fill, minmax(${g}px, 1fr))`,gridAutoRows:"1fr"}:{gridAutoFlow:"column",gridAutoColumns:`${g}px`,gridTemplateRows:"auto auto 1fr auto",minHeight:`${Number(y)+(C==="coverflow"?22:12)}px`,...C==="coverflow"?{perspective:"1200px",paddingLeft:`calc(50% - ${g/2}px)`,paddingRight:`calc(50% - ${g/2}px)`,paddingTop:"10px"}:null},children:G.map(_=>{const{tier:I,tierT:Y}=T(_);return o.jsx(d5,{pkg:_,tier:I,tierT:Y,layout:C,bullets:M(_),formatPrice:se,contactUrl:A,priceNote:v,t:l},_.id)})}),C!=="grid"&&o.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 ${F?"opacity-100":"opacity-0"}`,"aria-hidden":"true",children:o.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:[o.jsx(dT,{className:"h-3.5 w-3.5 text-brand-400"}),o.jsx(IT,{className:"h-4 w-4 text-brand-400"}),o.jsx(hT,{className:"h-3.5 w-3.5 text-brand-400"}),o.jsx("span",{children:l("modelPage.wheelHint")})]})}),C!=="grid"&&o.jsx("div",{ref:N,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:o.jsx("div",{ref:P,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"}})})]})}),G.length>0&&o.jsxs("div",{className:"mx-auto max-w-6xl px-4 pb-24 text-center sm:px-6 sm:pb-14",children:[o.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:l("modelPage.customHint")}),o.jsx(K,{to:R,className:"mt-2 inline-block text-sm font-semibold text-brand-600 underline hover:text-brand-500",children:l("modelPage.customRequest")})]}),(b||w)&&o.jsxs("div",{className:"fixed inset-x-0 bottom-0 z-20 flex gap-3 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:hidden",children:[b&&o.jsxs("a",{href:fi(b),onClick:()=>An("contact_call"),className:"flex flex-1 items-center justify-center gap-2 rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white",children:[o.jsx(dr,{className:"h-4 w-4"}),l("nav.call")]}),w&&o.jsxs("a",{href:ef(w,H),target:"_blank",rel:"noopener noreferrer",onClick:()=>An("contact_whatsapp"),className:"flex flex-1 items-center justify-center gap-2 rounded-md border border-neutral-300 px-4 py-2.5 text-sm font-semibold text-neutral-700 dark:border-neutral-700 dark:text-neutral-200",children:[o.jsx(Qy,{className:"h-4 w-4"}),l("nav.whatsapp")]})]})]})}const h5={car:io,caravan:aT,"car-front":rT,cog:wT,zap:oP,boxes:tT,"shield-alert":XT,video:sP},m5=m.lazy(()=>X(()=>import("./iconRegistry-DXMu3JdV.js"),__vite__mapDeps([2,3,4,5])));function p5({name:e,className:t="h-6 w-6",...n}){if(!e)return null;const r=h5[e];return r?o.jsx(r,{className:t,...n}):o.jsx(m.Suspense,{fallback:o.jsx("span",{className:`inline-block ${t}`,"aria-hidden":"true"}),children:o.jsx(m5,{name:e,className:t,...n})})}function g5(){const[e,t]=m.useState([]),n=Io(),{t:r,language:s}=xe(),i=Xe();return m.useEffect(()=>{ae.get("/services").then(t).catch(()=>t([]))},[]),gr({title:r("leistungen.metaTitle"),description:r("leistungen.metaDescription"),path:"/leistungen"}),n.services.enabled&&!n.bypass?o.jsx(ji,{message:n.services.message}):o.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[n.services.enabled&&n.bypass&&o.jsx(Ei,{inline:!0}),o.jsx(Ge,{k:"leistungen.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),o.jsx(Ge,{k:"leistungen.intro",as:"p",className:"mb-10 block max-w-2xl text-neutral-600 dark:text-neutral-300"}),o.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:e.map(a=>({...a,title:Dn(a,"title",s),description:Dn(a,"description",s),cta_label:Dn(a,"cta_label",s)})).map((a,l)=>o.jsxs(Ue,{index:l%3,shine:!0,className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[o.jsxs("div",{className:"relative aspect-[4/3]",children:[a.image_path&&o.jsx("img",{src:a.image_path,alt:a.title,className:"h-full w-full object-cover",loading:"lazy"}),o.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:o.jsx(p5,{name:a.icon_name,className:"h-6 w-6"})})]}),o.jsxs("div",{className:"p-6 pt-8",children:[o.jsx(ce,{entity:"services",id:a.id,field:"title",value:a.title,as:"h2",className:"mb-2 block font-semibold text-neutral-900 dark:text-white"}),o.jsx(ce,{entity:"services",id:a.id,field:"description",value:a.description,as:"p",multiline:!0,className:"mb-3 block text-sm text-neutral-600 dark:text-neutral-300"}),o.jsxs(K,{to:a.cta_url||"/kontakt",className:"text-sm font-semibold text-brand-600 hover:underline dark:text-brand-400",children:[i.canEdit("services")||a.cta_label?o.jsx(ce,{entity:"services",id:a.id,field:"cta_label",value:a.cta_label,placeholder:r("leistungen.contact")}):r("leistungen.contact")," ","→"]})]})]},a.id))}),o.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:[o.jsx(Ge,{k:"leistungen.notListedTitle",as:"h2",className:"mb-2 block text-xl font-bold text-neutral-900 dark:text-white"}),o.jsx(Ge,{k:"leistungen.notListedText",as:"p",className:"mb-5 block text-neutral-600 dark:text-neutral-300"}),o.jsx(K,{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:o.jsx(Ge,{k:"leistungen.contact"})})]})]})}function x5({name:e,description:t,className:n="",children:r}){const{consent:s,acceptAll:i,openSettings:a}=ls();return s.external?r:o.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:[o.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:t||`${e} wird erst nach deiner Zustimmung geladen, da dabei Daten an Google übertragen werden.`}),o.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[o.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"}),o.jsx("button",{type:"button",onClick:a,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Cookie-Einstellungen"})]})]})}const y5=e=>(e||"").replace(/[^\d+]/g,""),ba={fontFamily:"'Michroma', sans-serif"};function v5({className:e}){return o.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:o.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 w5({path:e,className:t}){return o.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:e})})}const b5={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 Np({formatted:e,color:t}){const[n,r]=e.split("€");return o.jsxs("span",{style:{...ba,color:t},children:[n,o.jsx("span",{style:{fontFamily:"'Barlow', sans-serif"},children:"€"}),r]})}function Qi({icon:e,label:t,name:n,type:r="text",required:s,value:i,onChange:a,placeholder:l,autoComplete:u,inputMode:c}){return o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("label",{htmlFor:`kf-${n}`,className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:t}),o.jsxs("div",{className:"relative flex items-center",children:[o.jsx(e,{className:"pointer-events-none absolute left-[14px] h-[17px] w-[17px]",style:{color:"var(--kf-fieldicon)"}}),o.jsx("input",{id:`kf-${n}`,name:n,type:r,required:s,autoComplete:u,inputMode:c,value:i,onChange:a,placeholder:l,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 k5(){const[e]=ck(),{phone:t,whatsapp:n,contact_email:r,address_street:s,address_zip:i,address_city:a,business_hours:l,price_note:u,price_note_en:c}=Pt(),{t:d,language:f}=xe(),h=Ro(),g=h.slot("contact_bg_light").custom,y=h.slot("contact_bg_dark").custom,b={...g&&{"--kontakt-bg-light":`url("${g}")`},...y&&{"--kontakt-bg-dark":`url("${y}")`}},{consent:w}=ls(),p=[s,[i,a].filter(Boolean).join(" ")].filter(Boolean).join(", "),x=encodeURIComponent(p),v=`https://www.google.com/maps/dir/?api=1&destination=${x}`,k=lv(l,d("footer.closed")),E=W=>new Intl.NumberFormat(f==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(W),[C,j]=m.useState(()=>({name:"",email:"",phone:"",vin:"",message:e.get("topic")||""})),[S,N]=m.useState("idle"),[P,F]=m.useState(""),[B,se]=m.useState([]),[ne,q]=m.useState([]),G=m.useRef(Date.now()),V=m.useRef(null),T=e.get("packageId"),M=e.get("brandSlug"),A=e.get("modelSlug"),[R,H]=m.useState(e.get("total")?Number(e.get("total")):null),[_,I]=m.useState(null),Y=f==="en"&&c||u;m.useEffect(()=>{!T||!M||!A||ae.get(`/models/${encodeURIComponent(M)}/${encodeURIComponent(A)}/packages`).then(W=>{var $;const L=($=W==null?void 0:W.packages)==null?void 0:$.find(Qe=>String(Qe.id)===String(T));L&&(H(Number(L.total_price)),I(L.price_text||null))}).catch(()=>{})},[T,M,A]),m.useEffect(()=>{if(!T){se([]);return}ae.get(`/packages/${T}/upgrades`).then(se).catch(()=>se([]))},[T]);const Z=W=>{q(L=>L.includes(W)?L.filter($=>$!==W):[...L,W])},ue=B.filter(W=>ne.includes(W.id)).reduce((W,L)=>W+Number(L.price),0);gr({title:d("contactPage.metaTitle"),description:d("contactPage.metaDescription"),path:"/kontakt"});const Q={brand:e.get("brand")||"",model:e.get("model")||"",package:e.get("package")||""},ke=!!(Q.brand&&Q.model&&Q.package),De=!ke&&!!(Q.brand&&Q.model),Ze=W=>j(L=>({...L,[W.target.name]:W.target.value})),dt=async W=>{var L;W.preventDefault(),N("sending"),F("");try{await ae.post("/contact",{...C,website:((L=W.target.elements.website)==null?void 0:L.value)||"",fill_ms:Date.now()-G.current,brand_name:Q.brand||null,model_name:Q.model||null,package_name:Q.package||null,product_name:e.get("product")||null,package_id:T||null,package_product_id:e.get("productId")||null,upgrade_ids:ne}),N("sent"),j({name:"",email:"",phone:"",vin:"",message:""}),An("generate_lead",{package_name:Q.package||void 0,value:R||void 0,currency:"EUR"})}catch($){F(zo($,d)),N("idle")}};m.useEffect(()=>{S==="sent"&&V.current&&(V.current.scrollIntoView({behavior:"smooth",block:"center"}),V.current.focus({preventScroll:!0}))},[S]);const he=ke?d("contactPage.whatsappText")(Q.brand,Q.model,Q.package):De?d("modelPage.whatsappText")(Q.brand,Q.model):"",ft=[{key:"premium",title:d("contactPage.featurePremiumTitle"),sub:d("contactPage.featurePremiumSub")},{key:"germany",title:d("contactPage.featureGermanyTitle"),sub:d("contactPage.featureGermanySub")},{key:"individual",title:d("contactPage.featureIndividualTitle"),sub:d("contactPage.featureIndividualSub")},{key:"experts",title:d("contactPage.featureExpertsTitle"),sub:d("contactPage.featureExpertsSub")}];return o.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",...b},children:o.jsxs("div",{className:"relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14",children:[o.jsx("div",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.heroEyebrow")}),o.jsxs("h1",{className:"text-[34px] leading-[1.08] sm:text-[46px] lg:text-[60px]",style:{...ba,color:"var(--kf-text)"},children:[d("contactPage.heroTitlePre")," ",o.jsx("span",{style:{color:"var(--kf-accent2)"},children:d("contactPage.heroTitleAccent")})," ",d("contactPage.heroTitlePost")]}),o.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:"var(--kf-muted)"},children:d("contactPage.heroSubtitle")}),o.jsxs("div",{className:"grid grid-cols-1 items-start gap-10 min-[981px]:grid-cols-[minmax(0,1.35fr)_minmax(320px,1fr)]",children:[o.jsx("div",{children:o.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:[ke&&o.jsxs("div",{className:"mb-8 rounded-xl border px-6 py-[22px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[o.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:[o.jsx(zT,{className:"h-4 w-4"}),d("contactPage.packageBoxTitle")]}),o.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-5 gap-y-2 text-[15px]",children:[o.jsx("span",{style:{color:"var(--kf-label)"},children:d("contactPage.contextBrand")}),o.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:Q.brand}),o.jsx("span",{style:{color:"var(--kf-label)"},children:d("contactPage.contextModel")}),o.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:Q.model}),o.jsx("span",{style:{color:"var(--kf-label)"},children:d("contactPage.contextPackage")}),o.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:Q.package})]}),o.jsxs("div",{className:"mt-3.5 flex items-baseline justify-between border-t pt-3.5",style:{borderColor:"var(--kf-pkgbrd)"},children:[o.jsx("span",{className:"text-[13px] font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:d("contactPage.packagePrice")}),o.jsx("span",{className:"text-xl",children:_||(R!=null?o.jsx(Np,{formatted:E(R),color:"var(--kf-text)"}):"—")})]}),Y&&!_&&o.jsx("div",{className:"mt-1 text-right text-xs",style:{color:"var(--kf-muted)"},children:Y})]}),De&&o.jsxs("div",{className:"mb-8 flex items-center gap-3 rounded-xl border px-6 py-4 text-[15px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[o.jsx(io,{className:"h-4 w-4",style:{color:"var(--kf-accent2)"}}),o.jsx("span",{style:{color:"var(--kf-label)"},children:d("contactPage.vehicleBoxTitle")}),o.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:[Q.brand," ",Q.model]})]}),B.length>0&&o.jsxs("div",{className:"mb-8 rounded-xl border p-5",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)"},children:[o.jsx("div",{className:"mb-3 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.optionalUpgrades")}),o.jsx("div",{className:"space-y-2",children:B.map(W=>o.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border p-3 text-sm",style:{borderColor:"var(--kf-fieldbrd)"},children:[o.jsx("input",{type:"checkbox",checked:ne.includes(W.id),onChange:()=>Z(W.id),className:"mt-0.5 h-4 w-4 rounded",style:{accentColor:"var(--kf-accent)"}}),o.jsxs("span",{className:"flex-1",children:[o.jsx("span",{className:"block font-semibold",style:{color:"var(--kf-text2)"},children:Dn(W,"name",f)}),W.description&&o.jsx("span",{className:"block text-xs",style:{color:"var(--kf-muted)"},children:Dn(W,"description",f)})]}),o.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-accent2)"},children:["+",E(W.price)]})]},W.id))}),ne.length>0&&R!=null&&!_&&o.jsxs("div",{className:"mt-3 flex items-baseline justify-between border-t pt-3 text-sm",style:{borderColor:"var(--kf-pkgbrd)"},children:[o.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:d("contactPage.totalWithUpgrades")}),o.jsx(Np,{formatted:E(R+ue),color:"var(--kf-text)"})]})]}),o.jsx("h2",{className:"mb-8 text-xl",style:{...ba,color:"var(--kf-text)"},children:d("contactPage.formTitle")}),o.jsx("div",{role:"status","aria-live":"polite",children:S==="sent"&&o.jsxs("div",{ref:V,tabIndex:-1,className:"rounded-[10px] border p-5 outline-none",style:{borderColor:"var(--kf-accent)",background:"var(--kf-accentsoft)"},children:[o.jsx("div",{className:"text-base font-bold",style:{color:"var(--kf-accent2)"},children:d("contactPage.sentTitle")}),o.jsx("div",{className:"mt-1 text-sm",style:{color:"var(--kf-muted)"},children:d("contactPage.sentText")}),o.jsx("button",{type:"button",onClick:()=>{G.current=Date.now(),N("idle")},className:"mt-4 text-sm font-semibold underline",style:{color:"var(--kf-text2)"},children:d("contactPage.sendAnother")})]})}),S!=="sent"&&o.jsxs("form",{onSubmit:dt,noValidate:!1,children:[o.jsxs("div",{"aria-hidden":"true",style:{position:"absolute",left:"-10000px",width:"1px",height:"1px",overflow:"hidden"},children:[o.jsx("label",{htmlFor:"kf-website",children:"Website"}),o.jsx("input",{id:"kf-website",name:"website",type:"text",tabIndex:-1,autoComplete:"off",defaultValue:""})]}),o.jsxs("div",{className:"grid grid-cols-1 gap-6 min-[641px]:grid-cols-2",children:[o.jsx(Qi,{icon:nP,label:d("contactPage.nameLabel"),name:"name",autoComplete:"name",required:!0,value:C.name,onChange:Ze,placeholder:d("contactPage.namePlaceholder")}),o.jsx(Qi,{icon:pc,label:d("contactPage.emailLabel"),name:"email",type:"email",autoComplete:"email",required:!0,value:C.email,onChange:Ze,placeholder:d("contactPage.emailPlaceholder")}),o.jsx(Qi,{icon:dr,label:d("contactPage.phoneLabel"),name:"phone",type:"tel",inputMode:"tel",autoComplete:"tel",value:C.phone,onChange:Ze,placeholder:d("contactPage.phonePlaceholder")}),o.jsx(Qi,{icon:io,label:d("contactPage.vinLabel"),name:"vin",value:C.vin,onChange:Ze,placeholder:d("contactPage.vinPlaceholder")})]}),o.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[o.jsx("label",{htmlFor:"kf-message",className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:d("contactPage.messageLabel")}),o.jsx("textarea",{id:"kf-message",name:"message",rows:5,value:C.message,onChange:Ze,placeholder:d("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)"}})]}),o.jsx("div",{role:"alert","aria-live":"assertive",children:P&&o.jsx("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:P})}),o.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-5",children:[o.jsxs("button",{type:"submit",disabled:S==="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:[o.jsx(qT,{className:"h-[18px] w-[18px]"}),d(S==="sending"?"contactPage.sending":"contactPage.submit")]}),o.jsx("div",{className:"text-[13px]",style:{color:"var(--kf-label)"},children:d("contactPage.requiredHint")})]}),o.jsxs("p",{className:"mt-5 text-[13px] leading-relaxed",style:{color:"var(--kf-muted)"},children:[d("contactPage.privacyPre"),o.jsx(K,{to:"/datenschutz",className:"underline",style:{color:"var(--kf-text2)"},children:d("contactPage.privacyLink")}),d("contactPage.privacyPost")]})]})]})}),o.jsxs("div",{className:"flex flex-col gap-6",children:[o.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:[o.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)"}}),o.jsx("h2",{className:"mb-7 text-[17px]",style:{...ba,color:"var(--kf-text)"},children:d("contactPage.cardTitle")}),o.jsxs("div",{className:"flex flex-col gap-5",children:[o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:o.jsx(dr,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.phone")}),o.jsx("a",{href:`tel:${y5(t)}`,onClick:()=>An("contact_call"),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:t})]})]}),o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:o.jsx(pc,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.email")}),o.jsx("a",{href:`mailto:${r}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:r})]})]}),o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:o.jsx(Zy,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.address")}),o.jsxs("div",{className:"text-base font-semibold leading-[1.4]",style:{color:"var(--kf-text2)"},children:[s,o.jsx("br",{}),[i,a].filter(Boolean).join(" ")]})]})]}),n&&o.jsxs("div",{className:"flex items-start gap-4",children:[o.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:o.jsx(v5,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("nav.whatsapp")}),o.jsx("a",{href:ef(n,he),target:"_blank",rel:"noopener noreferrer",onClick:()=>An("contact_whatsapp"),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:n})]})]})]}),o.jsxs("div",{className:"mt-7 border-t pt-6",style:{borderColor:"var(--kf-divider)"},children:[o.jsx("div",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:d("contactPage.hours")}),o.jsx("div",{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-[15px]",children:k.map(W=>o.jsxs("span",{style:{display:"contents"},children:[o.jsx("span",{style:{color:"var(--kf-label)"},children:W.days}),o.jsx("span",{children:W.label})]},W.key))})]})]}),o.jsxs("div",{className:"relative overflow-hidden rounded-2xl border",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[w.external&&o.jsxs("a",{href:v,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:[d("contactPage.mapOpenChip"),o.jsx(kT,{className:"h-3.5 w-3.5",style:{color:"var(--kf-accent2)"}})]}),o.jsx(x5,{name:d("contactPage.mapEmbedName"),className:"h-[210px] w-full",children:o.jsx("div",{className:"h-[210px] overflow-hidden",children:o.jsx("iframe",{title:d("contactPage.mapIframeTitle"),src:`https://www.google.com/maps?q=${x}&output=embed`,width:"100%",height:"290",style:{border:0,display:"block",marginTop:"-60px"},loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"})})}),o.jsxs("a",{href:v,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:[d("contactPage.routePlan")," →"]})]})]})]}),o.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:ft.map(W=>o.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:[o.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:o.jsx(w5,{path:b5[W.key],className:"h-[22px] w-[22px]"})}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[15px] font-bold",style:{color:"var(--kf-text)"},children:W.title}),o.jsx("div",{className:"mt-0.5 text-[13px]",style:{color:"var(--kf-muted)"},children:W.sub})]})]},W.key))})]})})}const Bl="hifi-chunk-reload",J=e=>m.lazy(()=>e().then(t=>{try{sessionStorage.removeItem(Bl)}catch{}return t},t=>{let n=!0;try{n=!!sessionStorage.getItem(Bl),sessionStorage.setItem(Bl,"1")}catch{}if(n)throw t;return window.location.reload(),new Promise(()=>{})})),S5=J(()=>X(()=>import("./GalleryOverview-PXKemgAt.js"),[])),j5=J(()=>X(()=>import("./GalleryBrandPage-t_SqSVK1.js"),[])),E5=J(()=>X(()=>import("./GalleryProjectPage-FUov0YU4.js"),[])),C5=J(()=>X(()=>import("./DownloadsPage-BAC2Bbij.js"),__vite__mapDeps([6,7,3]))),T5=J(()=>X(()=>import("./Impressum-CngzqAQz.js"),__vite__mapDeps([8,9]))),P5=J(()=>X(()=>import("./Datenschutz-BSZ59Ypg.js"),__vite__mapDeps([10,9]))),N5=J(()=>X(()=>import("./AGB-BSBKNUL3.js"),__vite__mapDeps([11,9]))),_5=J(()=>X(()=>import("./SetupWizard-DZDK0feK.js"),[])),M5=J(()=>X(()=>import("./Login-BHhvb3aV.js"),[])),L5=J(()=>X(()=>import("./ConfirmEmail-fWy9MOY4.js"),[])),A5=J(()=>X(()=>import("./ResetPassword-CG8ba0ue.js"),[])),D5=J(()=>X(()=>import("./Dashboard-CfZCB0xB.js"),__vite__mapDeps([12,13,14]))),R5=J(()=>X(()=>import("./Traffic-BLOMES7J.js"),[])),I5=J(()=>X(()=>import("./Brands-CPunktmg.js"),__vite__mapDeps([15,0,1,16,17,18,4,19]))),V5=J(()=>X(()=>import("./Models-oOmkNQSs.js"),__vite__mapDeps([20,0,1,16,17,18,4,19]))),F5=J(()=>X(()=>import("./GalleryBrands-D7kDEUzQ.js"),__vite__mapDeps([21,0,1,17,18,4,22]))),O5=J(()=>X(()=>import("./GalleryProjects-DFKgMPpK.js"),__vite__mapDeps([23,0,1,17,18,4,22]))),z5=J(()=>X(()=>import("./GalleryPhotos-CAByXSPv.js"),__vite__mapDeps([24,17,18,4,22,1]))),B5=J(()=>X(()=>import("./Packages-CIAy_ATE.js"),__vite__mapDeps([25,26,16,18,5,4]))),$5=J(()=>X(()=>import("./Services-BKtVbfxC.js"),__vite__mapDeps([27,0,1,2,3,4,5,28,17,18]))),H5=J(()=>X(()=>import("./Faqs-C6vUqhGa.js"),__vite__mapDeps([29,28,17,18,4]))),U5=J(()=>X(()=>import("./Partners-BTaZQlM9.js"),__vite__mapDeps([30,0,1,28,17,18,4]))),W5=J(()=>X(()=>import("./Downloads-DX6hhxmA.js"),__vite__mapDeps([31,7,28,17,18,4]))),G5=J(()=>X(()=>import("./HomeSections-FR9MpCKa.js"),__vite__mapDeps([32,33,16,34]))),K5=J(()=>X(()=>import("./ContactRequests-gigEl_0S.js"),__vite__mapDeps([35,14]))),q5=J(()=>X(()=>import("./AccountSettings-ZKd2A3aS.js"),[])),Y5=J(()=>X(()=>import("./AdminUsers-17rwNs5P.js"),[])),X5=J(()=>X(()=>import("./PermissionGroups-DAwy5PsY.js"),[])),Z5=J(()=>X(()=>import("./SettingsLayout-BFhAuThT.js"),[])),Ji=J(()=>X(()=>import("./WebsiteSettings-GXoKYAkf.js"),__vite__mapDeps([36,0,1,34,17,18,4,26]))),Q5=J(()=>X(()=>import("./LegalSettings-Dyr-bPzl.js"),__vite__mapDeps([37,33]))),J5=J(()=>X(()=>import("./UpdateSettings-DmGZxm7K.js"),[])),e4=J(()=>X(()=>import("./EmailSettings-4uXhtxt-.js"),__vite__mapDeps([38,33]))),t4=J(()=>X(()=>import("./DatabaseSettings-Da6s1jBa.js"),__vite__mapDeps([39,13]))),n4=J(()=>X(()=>import("./ExportImportSettings-CwuFp4rp.js"),[])),r4=J(()=>X(()=>import("./MaintenanceSettings-BmZJ8yZN.js"),[])),s4=J(()=>X(()=>import("./CountdownSettings-iY834r7N.js"),[])),i4=J(()=>X(()=>import("./ConnectionSettings-BDljX48v.js"),[])),a4=J(()=>X(()=>import("./ResetSettings-BPXgxMql.js"),[])),o4=o.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});function l4(){const{packageId:e}=xd();return o.jsx(ur,{to:`/admin/packages?paket=${e}`,replace:!0})}function u4(){return o.jsxs(oE,{reducedMotion:"user",children:[o.jsx(VC,{}),o.jsx(zC,{}),o.jsx(GC,{children:o.jsx(m.Suspense,{fallback:o4,children:o.jsxs(Yb,{children:[o.jsx(U,{path:"/setup",element:o.jsx(_5,{})}),o.jsxs(U,{element:o.jsx(bN,{}),children:[o.jsx(U,{path:"/",element:o.jsx(JN,{})}),o.jsx(U,{path:"/fahrzeuge",element:o.jsx(s5,{})}),o.jsx(U,{path:"/fahrzeuge/:brandSlug",element:o.jsx(i5,{})}),o.jsx(U,{path:"/fahrzeuge/:brandSlug/:modelSlug",element:o.jsx(f5,{})}),o.jsx(U,{path:"/galerie",element:o.jsx(S5,{})}),o.jsx(U,{path:"/galerie/:brandSlug",element:o.jsx(j5,{})}),o.jsx(U,{path:"/galerie/:brandSlug/:projectSlug",element:o.jsx(E5,{})}),o.jsx(U,{path:"/leistungen",element:o.jsx(g5,{})}),o.jsx(U,{path:"/kontakt",element:o.jsx(k5,{})}),o.jsx(U,{path:"/downloads",element:o.jsx(C5,{})}),o.jsx(U,{path:"/impressum",element:o.jsx(T5,{})}),o.jsx(U,{path:"/datenschutz",element:o.jsx(P5,{})}),o.jsx(U,{path:"/agb",element:o.jsx(N5,{})}),o.jsx(U,{path:"*",element:o.jsx(of,{})})]}),o.jsx(U,{path:"/admin/login",element:o.jsx(M5,{})}),o.jsx(U,{path:"/admin/email-bestaetigen",element:o.jsx(L5,{})}),o.jsx(U,{path:"/admin/passwort-zuruecksetzen",element:o.jsx(A5,{})}),o.jsx(U,{path:"/admin",element:o.jsx(ON,{}),children:o.jsxs(U,{element:o.jsx(FN,{}),children:[o.jsx(U,{index:!0,element:o.jsx(D5,{})}),o.jsx(U,{path:"traffic",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(R5,{})})}),o.jsx(U,{path:"account",element:o.jsx(q5,{})}),o.jsx(U,{path:"brands",element:o.jsx(oe,{permission:"brands.manage",children:o.jsx(I5,{})})}),o.jsx(U,{path:"models",element:o.jsx(oe,{permission:"models.manage",children:o.jsx(V5,{})})}),o.jsx(U,{path:"gallery-brands",element:o.jsx(oe,{permission:"gallery.manage",children:o.jsx(F5,{})})}),o.jsx(U,{path:"gallery-projects",element:o.jsx(oe,{permission:"gallery.manage",children:o.jsx(O5,{})})}),o.jsx(U,{path:"gallery-projects/:projectId/photos",element:o.jsx(oe,{permission:"gallery.manage",children:o.jsx(z5,{})})}),o.jsx(U,{path:"packages",element:o.jsx(oe,{permission:"packages.manage",children:o.jsx(B5,{})})}),o.jsx(U,{path:"packages/:packageId/*",element:o.jsx(l4,{})}),o.jsx(U,{path:"services",element:o.jsx(oe,{permission:"services.manage",children:o.jsx($5,{})})}),o.jsx(U,{path:"faqs",element:o.jsx(oe,{permission:"content.manage",children:o.jsx(H5,{})})}),o.jsx(U,{path:"partners",element:o.jsx(oe,{permission:"content.manage",children:o.jsx(U5,{})})}),o.jsx(U,{path:"downloads",element:o.jsx(oe,{permission:"downloads.manage",children:o.jsx(W5,{})})}),o.jsx(U,{path:"home-sections",element:o.jsx(oe,{permission:"content.manage",children:o.jsx(G5,{})})}),o.jsx(U,{path:"contact-requests",element:o.jsx(oe,{permission:"contact.manage",children:o.jsx(K5,{})})}),o.jsx(U,{path:"users",element:o.jsx(oe,{permission:"users.manage",children:o.jsx(Y5,{})})}),o.jsx(U,{path:"permission-groups",element:o.jsx(oe,{permission:"permission_groups.manage",children:o.jsx(X5,{})})}),o.jsxs(U,{path:"settings",element:o.jsx(oe,{permission:["settings.manage","system.admin","system.update"],children:o.jsx(Z5,{})}),children:[o.jsx(U,{index:!0,element:o.jsx(ur,{to:"company",replace:!0})}),o.jsx(U,{path:"website",element:o.jsx(ur,{to:"../company",replace:!0})}),o.jsx(U,{path:"company",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(Ji,{section:"company"})})}),o.jsx(U,{path:"design",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(Ji,{section:"design"})})}),o.jsx(U,{path:"images",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(Ji,{section:"images"})})}),o.jsx(U,{path:"legal",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(Q5,{})})}),o.jsx(U,{path:"maintenance",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(r4,{})})}),o.jsx(U,{path:"countdown",element:o.jsx(oe,{permission:"settings.manage",children:o.jsx(s4,{})})}),o.jsx(U,{path:"google",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(Ji,{section:"google"})})}),o.jsx(U,{path:"connections",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(i4,{})})}),o.jsx(U,{path:"email",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(e4,{})})}),o.jsx(U,{path:"database",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(t4,{})})}),o.jsx(U,{path:"export-import",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(n4,{})})}),o.jsx(U,{path:"update",element:o.jsx(oe,{permission:"system.update",children:o.jsx(J5,{})})}),o.jsx(U,{path:"reset",element:o.jsx(oe,{permission:"system.admin",children:o.jsx(a4,{})})})]})]})})]})})})]})}$l.createRoot(document.getElementById("root")).render(o.jsx(Bp.StrictMode,{children:o.jsx(sk,{basename:"/".replace(/\/$/,"")||"/",children:o.jsx(uP,{children:o.jsx(fP,{children:o.jsx(jP,{children:o.jsx(u4,{})})})})})}));export{BC as $,k4 as A,v4 as B,C4 as C,Ci as D,Ge as E,S4 as F,GT as G,uT as H,Oe as I,hT as J,kT as K,K as L,xc as M,of as N,Jy as O,T4 as P,af as Q,Ue as R,jv as S,j4 as T,P4 as U,E4 as V,b4 as W,Si as X,BP as Y,p5 as Z,M4 as _,Pt as a,p4 as a0,Ye as a1,yd as a2,zP as a3,$P as a4,h4 as a5,Zt as a6,kv as a7,m4 as a8,Bp as a9,qT as aA,XT as aB,QT as aC,eP as aD,nP as aE,sP as aF,oP as aG,ZC as aH,f4 as aI,XC as aJ,c4 as aK,te as aa,_p as ab,JC as ac,tT as ad,io as ae,rT as af,aT as ag,qy as ah,dT as ai,pT as aj,xT as ak,Yy as al,wT as am,jT as an,CT as ao,PT as ap,_T as aq,Xy as ar,pc as as,Zy as at,Qy as au,IT as av,FT as aw,zT as ax,dr as ay,UT as az,gr as b,ae as c,ce as d,zo as e,wp as f,xd as g,hd as h,vr as i,o as j,$n as k,RN as l,pr as m,ur as n,Jd as o,ck as p,g4 as q,m as r,N4 as s,L4 as t,xe as u,x4 as v,y4 as w,w4 as x,_N as y,_4 as z}; diff --git a/hifi/assets/music-CfvjP45-.js b/hifi/assets/music-D2Ez1K-E.js similarity index 98% rename from hifi/assets/music-CfvjP45-.js rename to hifi/assets/music-D2Ez1K-E.js index f7761b0..bed34db 100644 --- a/hifi/assets/music-CfvjP45-.js +++ b/hifi/assets/music-D2Ez1K-E.js @@ -1,4 +1,4 @@ -import{aa as a}from"./index-eQrgtQRM.js";/** +import{aa as a}from"./index-CPMnKQBc.js";/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. diff --git a/hifi/assets/sortable.esm-CN3X5f7p.js b/hifi/assets/sortable.esm-CUwm6pqJ.js similarity index 99% rename from hifi/assets/sortable.esm-CN3X5f7p.js rename to hifi/assets/sortable.esm-CUwm6pqJ.js index 2596b69..61af8fa 100644 --- a/hifi/assets/sortable.esm-CN3X5f7p.js +++ b/hifi/assets/sortable.esm-CUwm6pqJ.js @@ -1,4 +1,4 @@ -import{r as c,a9 as P,h as Oe}from"./index-eQrgtQRM.js";function Rn(){for(var e=arguments.length,t=new Array(e),n=0;nr=>{t.forEach(o=>o(r))},t)}const et=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:pt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Ut(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:pt(e)?bt(e)?e:Be(e)||Ut(e)?e.ownerDocument:document:document:document}const Q=et?c.useLayoutEffect:c.useEffect;function wt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ge(e){const t=wt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function dt(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let at={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=at[e]==null?0:at[e]+1;return at[e]=n,e+"-"+n},[e,t])}function Wt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Wt(1),ze=Wt(-1);function En(e){return"clientX"in e&&"clientY"in e}function mt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Mn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ft(e){if(Mn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return En(e)?{x:e.clientX,y:e.clientY}:null}const Je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Je.Translate.toString(e),Je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ot="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function In(e){return e.matches(Ot)?e:e.querySelector(Ot)}const An={display:"none"};function On(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:An},n)}function Tn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Nn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ht=c.createContext(null);function Ln(e){const t=c.useContext(Ht);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function kn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const zn={draggable:` +import{r as c,a9 as P,h as Oe}from"./index-CPMnKQBc.js";function Rn(){for(var e=arguments.length,t=new Array(e),n=0;nr=>{t.forEach(o=>o(r))},t)}const et=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:pt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Ut(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:pt(e)?bt(e)?e:Be(e)||Ut(e)?e.ownerDocument:document:document:document}const Q=et?c.useLayoutEffect:c.useEffect;function wt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ge(e){const t=wt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function dt(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let at={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=at[e]==null?0:at[e]+1;return at[e]=n,e+"-"+n},[e,t])}function Wt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Wt(1),ze=Wt(-1);function En(e){return"clientX"in e&&"clientY"in e}function mt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Mn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ft(e){if(Mn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return En(e)?{x:e.clientX,y:e.clientY}:null}const Je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Je.Translate.toString(e),Je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ot="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function In(e){return e.matches(Ot)?e:e.querySelector(Ot)}const An={display:"none"};function On(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:An},n)}function Tn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Nn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ht=c.createContext(null);function Ln(e){const t=c.useContext(Ht);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function kn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const zn={draggable:` To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. diff --git a/hifi/assets/trash-2-DA4I3Jzq.js b/hifi/assets/trash-2-DwLXj_oo.js similarity index 95% rename from hifi/assets/trash-2-DA4I3Jzq.js rename to hifi/assets/trash-2-DwLXj_oo.js index 1062ae2..89fa130 100644 --- a/hifi/assets/trash-2-DA4I3Jzq.js +++ b/hifi/assets/trash-2-DwLXj_oo.js @@ -1,4 +1,4 @@ -import{aa as a}from"./index-eQrgtQRM.js";/** +import{aa as a}from"./index-CPMnKQBc.js";/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. diff --git a/hifi/index.html b/hifi/index.html index 099d13c..c1ce1e4 100644 --- a/hifi/index.html +++ b/hifi/index.html @@ -49,7 +49,7 @@ "sameAs": ["https://www.youtube.com/@hifiplanet2812"] } - +