Object.keys(n)),i=bn(()=>({}));for(const l of s)i[l]=Qt(e,t,n[l],r);return i}function ZS(e,t={}){const{isStatic:n}=g.useContext(aa),r=()=>ge(e)?e.get():e;if(n)return Qt(r);const s=sb(r());return g.useInsertionEffect(()=>Xj(s,e,t),[s,JSON.stringify(t)]),s}function QS(e,t={}){return ZS(e,{type:"spring",...t})}function JS(){const{scrollYProgress:e}=rb(),t=QS(e,{stiffness:200,damping:30,restDelta:.001});return a.jsx(Ft.div,{style:{scaleX:t},className:"fixed left-0 top-0 z-40 h-0.5 w-full origin-left bg-brand-500"})}const eC=()=>a.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:a.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 la({message:e,fullScreen:t=!1}){const{t:n}=Ne(),r=a.jsxs("div",{className:"mx-auto max-w-md text-center",children:[a.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:a.jsx(eC,{})}),a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:n("maintenance.title")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:e||n("maintenance.defaultMessage")})]});return t?a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950",children:r}):a.jsx("div",{className:"mx-auto max-w-6xl px-4 py-20 sm:px-6",children:r})}const Nf=a.jsx(a.Fragment,{children:'Wartungsmodus aktiv – Besucher sehen aktuell eine Wartungsmeldung. Du siehst diese Seite nur, weil du die Berechtigung "Wartungsmodus umgehen" hast.'});function oa({inline:e=!1}){return e?a.jsx("div",{className:"mb-8 rounded-lg bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:Nf}):a.jsx("div",{className:"bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:Nf})}function tC({onClose:e}){const{consent:t,saveCustom:n}=Rr(),[r,s]=g.useState(t.external),[i,l]=g.useState(t.analytics),{t:o}=Ne();return a.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:e,children:a.jsxs("div",{className:"w-full max-w-md rounded-xl bg-white p-6 dark:bg-neutral-900",onClick:u=>u.stopPropagation(),children:[a.jsx("h2",{className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:o("cookieConsent.modalTitle")}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:[o("cookieConsent.modalIntro")," ",a.jsx(O,{to:"/datenschutz",className:"underline hover:text-brand-500",onClick:e,children:o("cookieConsent.privacyPolicy")}),"."]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.necessaryTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.necessaryDesc")})]}),a.jsx("input",{type:"checkbox",checked:!0,disabled:!0,className:"mt-1 h-4 w-4 shrink-0"})]}),a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.externalTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.externalDesc")})]}),a.jsx("input",{type:"checkbox",checked:r,onChange:u=>s(u.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]}),a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.analyticsTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.analyticsDesc")})]}),a.jsx("input",{type:"checkbox",checked:i,onChange:u=>l(u.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]})]}),a.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[a.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:o("cookieConsent.cancel")}),a.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:o("cookieConsent.saveSelection")})]})]})})}function nC(){const{decided:e,settingsOpen:t,acceptAll:n,rejectNonEssential:r,openSettings:s,closeSettings:i}=Rr(),{t:l}=Ne();return a.jsxs(a.Fragment,{children:[!e&&a.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:a.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[l("cookieConsent.bannerText")," ",l("cookieConsent.moreInfo")," ",a.jsx(O,{to:"/datenschutz",className:"underline hover:text-brand-500",children:l("cookieConsent.privacyPolicy")}),"."]}),a.jsxs("div",{className:"flex flex-wrap gap-2 sm:shrink-0",children:[a.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:l("cookieConsent.settings")}),a.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:l("cookieConsent.onlyNecessary")}),a.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:l("cookieConsent.acceptAll")})]})]})}),t&&a.jsx(tC,{onClose:i})]})}function rC(){const{consent:e}=Rr(),{ga_measurement_id:t}=Ir(),n=g.useRef(!1);return g.useEffect(()=>{if(!t||!e.analytics||n.current)return;n.current=!0;const r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,r.async=!0,document.head.appendChild(r),window.dataLayer=window.dataLayer||[];function s(...i){window.dataLayer.push(i)}window.gtag=s,s("js",new Date),s("config",t,{anonymize_ip:!0})},[t,e.analytics]),null}const ib=g.createContext({global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null},bypass:!1}),sC=ib.Provider;function fl(){return g.useContext(ib)}const aC={global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null}},iC={phone:"09373 20 62 390",whatsapp:null,contact_email:"info@hifi-planet-amorbach.de",hero_image_path:null,ga_measurement_id:null,package_card_theme:"graphite",package_card_layout:"strip"},lC=["/impressum","/datenschutz","/agb"];function oC(){const[e,t]=g.useState(null),[n,r]=g.useState(iC),{loading:s,hasPermission:i}=Mt(),l=ot();if(g.useEffect(()=>{M.get("/maintenance").then(t).catch(()=>t(aC)),M.get("/site-settings").then(r).catch(()=>{})},[]),e===null||s)return a.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});const o=i("maintenance.bypass"),u=lC.includes(l.pathname);return e.global.enabled&&!o&&!u?a.jsx(Gh,{children:a.jsx(la,{message:e.global.message,fullScreen:!0})}):a.jsx(Gh,{children:a.jsx(sC,{value:{...e,bypass:o},children:a.jsx(xw,{value:n,children:a.jsxs("div",{className:"page-texture flex min-h-screen flex-col text-neutral-900 dark:text-neutral-100",children:[o&&e.global.enabled&&a.jsx(oa,{}),a.jsx(JS,{}),a.jsx(jw,{}),a.jsx("main",{className:"flex-1",children:a.jsx(ol,{})}),a.jsx(Tw,{}),a.jsx(nC,{}),a.jsx(rC,{})]})})})})}const uC={home:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9",tag:"M4 4h7l9 9-7 7-9-9V4Zm3.5 3.5h.01",car:"M3 13.5 4.5 9A2 2 0 0 1 6.4 7.5h11.2A2 2 0 0 1 19.5 9L21 13.5M3 13.5v4a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1h12v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-4M3 13.5h18M6.5 16.5h.01M17.5 16.5h.01",box:"M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Zm0 9 8-4.5M12 12v9M12 12 4 7.5",mail:"M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm0 0 8 7 8-7",users:"M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-4 6c-4 0-7 2-7 4.5V19h14v-1.5C19 15 16 13 12 13Z",shield:"M12 3 4 6v6c0 4.5 3.4 7.7 8 9 4.6-1.3 8-4.5 8-9V6l-8-3Zm-1.5 9.5 4-4 1 1-5 5-2.5-2.5 1-1 1.5 1.5Z",lock:"M6 10V8a6 6 0 1 1 12 0v2m-13 0h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1Zm7 5v2",briefcase:"M4 7h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm4 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12h18",sliders:"M4 6h16M4 6a2 2 0 1 0 4 0 2 2 0 0 0-4 0Zm16 6H4m10 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0ZM4 18h16m-12 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0Z",image:"M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Zm2 12 4.5-5.5L14 16l2.5-3L20 17H6ZM8 9.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-5.5v.01M9.5 9.25a2.5 2.5 0 1 1 3.5 2.29c-.7.32-1 .77-1 1.46v.3"},cC=({path:e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"h-5 w-5 shrink-0",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})});function dC(){const{logout:e,user:t,hasPermission:n}=Mt(),r=ea(),[s,i]=g.useState(!1),[l,o]=g.useState(0);g.useEffect(()=>{n("contact.manage")&&M.get("/contact").then(m=>o(m.filter(f=>f.status==="new").length)).catch(()=>{})},[]);const u=[{title:null,links:[{to:"/admin",label:"Dashboard",icon:"home",end:!0},{to:"/admin/account",label:"Mein Konto",icon:"lock"}]},{title:"Fahrzeug-Katalog",links:[{to:"/admin/brands",label:"Marken",icon:"tag",permission:"brands.manage"},{to:"/admin/models",label:"Modelle",icon:"car",permission:"models.manage"},{to:"/admin/packages",label:"Pakete",icon:"box",permission:"packages.manage"}]},{title:"Website",links:[{to:"/admin/services",label:"Leistungen",icon:"briefcase",permission:"services.manage"},{to:"/admin/faqs",label:"FAQ",icon:"help",permission:"content.manage"}]},{title:"Bildergalerie",links:[{to:"/admin/gallery-brands",label:"Marken",icon:"tag",permission:"gallery.manage"},{to:"/admin/gallery-projects",label:"Projekte",icon:"image",permission:"gallery.manage"}]},{title:"Kunden",links:[{to:"/admin/contact-requests",label:"Kontaktanfragen",icon:"mail",permission:"contact.manage",badge:l}]},{title:"Verwaltung",links:[{to:"/admin/users",label:"Benutzer",icon:"users",permission:"users.manage"},{to:"/admin/permission-groups",label:"Berechtigungsgruppen",icon:"shield",permission:"permission_groups.manage"},{to:"/admin/settings",label:"Einstellungen",icon:"sliders",permission:"settings.manage"}]}].map(m=>({...m,links:m.links.filter(f=>!f.permission||n(f.permission))})).filter(m=>m.links.length>0),c=async()=>{await e(),r("/admin/login")},d=({isActive:m})=>`flex items-center justify-between gap-2 rounded-md px-3 py-2 text-sm font-medium transition ${m?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,h=({onNavigate:m})=>a.jsx("nav",{className:"space-y-5",children:u.map((f,b)=>a.jsxs("div",{children:[f.title&&a.jsx("p",{className:"mb-1.5 px-3 text-xs font-semibold uppercase tracking-wide text-neutral-400 dark:text-neutral-500",children:f.title}),a.jsx("div",{className:"space-y-1",children:f.links.map(y=>a.jsxs(ig,{to:y.to,end:y.end,className:d,onClick:m,children:[a.jsxs("span",{className:"flex items-center gap-2.5",children:[a.jsx(cC,{path:uC[y.icon]}),y.label]}),!!y.badge&&a.jsx("span",{className:"rounded-full bg-red-500 px-2 py-0.5 text-xs font-bold text-white",children:y.badge})]},y.to))})]},b))});return a.jsxs("div",{className:"flex min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[a.jsxs("aside",{className:"hidden w-60 shrink-0 border-r border-neutral-200 p-4 dark:border-neutral-800 sm:block",children:[a.jsxs("div",{className:"mb-6 flex items-center gap-2 px-3",children:[a.jsxs("span",{className:"rounded-lg px-2 py-1",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-7 w-auto dark:hidden"}),a.jsx("img",{src:Ai,alt:"HifiPlanet",className:"hidden h-7 w-auto dark:block"})]}),a.jsx("span",{className:"text-sm font-semibold text-neutral-500 dark:text-neutral-400",children:"Admin"})]}),a.jsx(h,{})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("header",{className:"border-b border-neutral-200 dark:border-neutral-800",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 sm:px-6",children:[a.jsxs("div",{className:"flex items-center gap-2 sm:hidden",children:[a.jsx("button",{onClick:()=>i(m=>!m),"aria-label":"Menü öffnen",className:"rounded-md p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800",children:a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),a.jsxs("span",{className:"rounded-lg px-1.5 py-0.5",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-6 w-auto dark:hidden"}),a.jsx("img",{src:Ai,alt:"HifiPlanet",className:"hidden h-6 w-auto dark:block"})]})]}),a.jsxs("p",{className:"hidden text-sm text-neutral-500 dark:text-neutral-400 sm:block",children:["Angemeldet als ",t==null?void 0:t.username,t!=null&&t.is_super_admin?" · Super-Admin":""]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(cg,{}),a.jsx("button",{onClick:c,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:"Abmelden"})]})]}),s&&a.jsx("div",{className:"border-t border-neutral-200 px-4 py-3 dark:border-neutral-800 sm:hidden",children:a.jsx(h,{onNavigate:()=>i(!1)})})]}),a.jsx("main",{className:"p-4 sm:p-6",children:a.jsx(ol,{})})]})]})}function hC(){const{user:e,loading:t}=Mt();return t?a.jsx("div",{className:"flex min-h-screen items-center justify-center text-neutral-500",children:"Lädt…"}):e?a.jsx(ol,{}):a.jsx(Ws,{to:"/admin/login",replace:!0})}function Be({permission:e,children:t}){const{hasPermission:n}=Mt();return(Array.isArray(e)?e:[e]).some(i=>n(i))?t:a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-8 text-center dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h1",{className:"mb-2 text-lg font-bold text-neutral-900 dark:text-white",children:"Keine Berechtigung"}),a.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 fo(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 mC(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}`)}function Ze({title:e,description:t,path:n}){g.useEffect(()=>{e&&(document.title=`${e} | HifiPlanet`,fo("og:title",`${e} | HifiPlanet`,"property")),t&&(fo("description",t),fo("og:description",t,"property")),n&&mC(n)},[e,t,n])}const fC=[.16,1,.3,1],Sf={up:{y:40},left:{x:-56},right:{x:56}};function pC(e){return{hidden:{opacity:0,scale:.96,filter:"blur(8px)",...Sf[e]||Sf.up},visible:{opacity:1,scale:1,x:0,y:0,filter:"blur(0px)"}}}const gC={hidden:{x:"-130%"},visible:{x:"230%",transition:{duration:1.1,ease:"easeInOut",delay:.4}}};function ye({children:e,direction:t="up",className:n="",index:r=0,shine:s=!1}){const i=Math.min(r*.09,.45);return a.jsxs(Ft.div,{className:n,style:{position:"relative",overflow:"hidden"},initial:"hidden",whileInView:"visible",viewport:{once:!0,amount:.25,margin:"-100px"},variants:pC(t),transition:{duration:.75,ease:fC,delay:i},children:[e,s&&a.jsx(Ft.div,{"aria-hidden":!0,variants:gC,className:"pointer-events-none absolute inset-y-0 -left-1/3 w-1/3 rotate-12 bg-gradient-to-r from-transparent via-white/40 to-transparent"})]})}function xC({items:e}){const[t,n]=g.useState(null);return a.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((r,s)=>{const i=t===s;return a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>n(i?null:s),className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left","aria-expanded":i,children:[a.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:r.question}),a.jsx(Ft.svg,{animate:{rotate:i?180:0},transition:{duration:.2},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0 text-neutral-500",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6 9 6 6 6-6"})})]}),a.jsx(v2,{initial:!1,children:i&&a.jsx(Ft.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:a.jsx("p",{className:"px-5 pb-4 text-sm text-neutral-600 dark:text-neutral-300",children:r.answer})})})]},r.question)})})}function lb({count:e=5,className:t="h-4 w-4"}){return a.jsx("div",{className:"flex gap-0.5 text-amber-400",children:Array.from({length:e}).map((n,r)=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:t,children:a.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 bC=70;function vC({testimonials:e}){const t=g.useRef(null),n=g.useRef(null),r=g.useRef({pos:0,half:0,hovering:!1,dragging:!1,dragStartX:0,dragStartPos:0,lastTime:null,rafId:null}).current;g.useLayoutEffect(()=>{const i=n.current,l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,o=()=>{i.style.transform=`translateX(${r.pos}px)`},u=p=>{if(r.half<=0)return p;for(;p>0;)p-=r.half;for(;p<=-r.half;)p+=r.half;return p},c=()=>{r.half=i.scrollWidth/2,r.pos===0?r.pos=-r.half:r.pos=u(r.pos),o()};c();const d=new ResizeObserver(c);d.observe(i);const h=p=>{r.lastTime===null&&(r.lastTime=p);const v=(p-r.lastTime)/1e3;r.lastTime=p,!r.dragging&&!r.hovering&&!l&&(r.pos=u(r.pos+bC*v),o()),r.rafId=requestAnimationFrame(h)};r.rafId=requestAnimationFrame(h);const m=t.current,f=()=>{r.hovering=!0},b=()=>{r.hovering=!1},y=p=>{r.dragging=!0,r.dragStartX=p.clientX,r.dragStartPos=r.pos,m.setPointerCapture(p.pointerId),m.classList.add("cursor-grabbing"),m.classList.remove("cursor-grab")},k=p=>{r.dragging&&(r.pos=u(r.dragStartPos+(p.clientX-r.dragStartX)),o())},x=p=>{r.dragging&&(r.dragging=!1,m.hasPointerCapture(p.pointerId)&&m.releasePointerCapture(p.pointerId),m.classList.remove("cursor-grabbing"),m.classList.add("cursor-grab"))};return m.addEventListener("pointerenter",f),m.addEventListener("pointerleave",b),m.addEventListener("pointerdown",y),m.addEventListener("pointermove",k),m.addEventListener("pointerup",x),m.addEventListener("pointercancel",x),()=>{cancelAnimationFrame(r.rafId),d.disconnect(),m.removeEventListener("pointerenter",f),m.removeEventListener("pointerleave",b),m.removeEventListener("pointerdown",y),m.removeEventListener("pointermove",k),m.removeEventListener("pointerup",x),m.removeEventListener("pointercancel",x)}},[e.length]);const s=[...e,...e];return a.jsx("div",{ref:t,className:"marquee-viewport cursor-grab touch-pan-y select-none overflow-hidden",children:a.jsx("div",{ref:n,className:"marquee-track flex w-max gap-5",children:s.map((i,l)=>a.jsx("div",{className:"w-64 shrink-0 sm:w-72 lg:w-80",children:a.jsxs("div",{className:"flex h-full flex-col rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx(lb,{className:"mb-3 h-4 w-4"}),a.jsxs("p",{className:"mb-4 flex-1 text-sm text-neutral-600 dark:text-neutral-300",children:["„",i.text,'"']}),a.jsx("p",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:i.name})]})},`${i.name}-${l}`))})})}const yC="/assets/gallery-dash2-CEVCErVK.webp",ob="/assets/gallery-amp-purple-CESAKuOf.webp",kC="/assets/gallery-speaker-CUXQZ49Q.webp",ub="/assets/gallery-subs-COSd4seJ.webp",cb="/assets/gallery-dash-Cg-7v9qo.webp",wC="/assets/hero-trunk-Dp4_JHDh.webp",jC="/assets/gallery-rear-8cIXPC7T.webp",NC="/assets/hero-highlight-Co4f1Kj5.webp",SC="/assets/youtube-hintergrund-C0osNxn7.mp4",CC="ostj2mKDVUc",PC=["Ground Zero Audio","Audison","Hertz","Helix","Brax","Gladen","Alpine","Pioneer","Kenwood","JVC"],EC=[{src:ub,width:900,height:600},{src:ob,width:900,height:600},{src:kC,width:900,height:1200},{src:cb,width:900,height:814},{src:jC,width:900,height:1200},{src:wC,width:1920,height:1280}];function TC(){const{hero_image_path:e}=Ir(),t=e||yC,{t:n,language:r}=Ne(),s=n("home.stats"),i=n("home.galleryAlts"),l=EC.map((p,v)=>({...p,alt:i[v]})),o=n("home.testimonials"),[u,c]=g.useState([]);g.useEffect(()=>{M.get("/faqs").then(p=>{c(p.map(v=>({question:r==="de"?v.question_de:v.question_en,answer:r==="de"?v.answer_de:v.answer_en})))}).catch(()=>{})},[r]),Ze({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),g.useEffect(()=>{if(u.length===0)return;const p=document.createElement("script");return p.type="application/ld+json",p.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:u.map(v=>({"@type":"Question",name:v.question,acceptedAnswer:{"@type":"Answer",text:v.answer}}))}),document.head.appendChild(p),()=>document.head.removeChild(p)},[u]);const d=g.useRef(null),{scrollYProgress:h}=rb({target:d,offset:["start start","end start"]}),m=Qt(h,[0,1],["-6%","6%"]),f=Qt(h,[0,1],["0%","60%"]),b=Qt(h,[0,.8],[1,0]),y=Qt(h,[.5,1],[0,1]),k=Qt(y,p=>p>.05?"auto":"none"),x=Qt(h,[.5,1],[16,0]);return a.jsxs("div",{children:[a.jsx(Ft.div,{style:{opacity:y,pointerEvents:k,y:x},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:a.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[a.jsx("p",{className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block",children:n("home.stickyCta")}),a.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[a.jsx(O,{to:"/fahrzeuge",className:"flex-1 rounded-md bg-brand-500 px-5 py-2.5 text-center text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 sm:flex-none",children:n("home.selectVehicle")}),a.jsx(O,{to:"/kontakt",className:"flex-1 rounded-md border border-neutral-300 px-5 py-2.5 text-center text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800 sm:flex-none",children:n("home.getInTouch")})]})]})}),a.jsxs("section",{ref:d,className:"relative -mt-[89px] h-dvh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[a.jsx(Ft.img,{style:{y:m,scale:1.15},src:t,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),a.jsx(Ft.div,{style:{y:f,opacity:b},className:"relative flex h-full max-w-6xl flex-col items-center justify-center px-4 mx-auto text-center sm:px-6",children:a.jsxs(Ft.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[a.jsx("p",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",children:n("home.welcome")}),a.jsx("h1",{className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",children:n("home.heroTitle")}),a.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg",children:n("home.heroSubtitle")}),a.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[a.jsx(O,{to:"/fahrzeuge",className:"rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 hover:shadow-lg",children:n("home.selectVehicle")}),a.jsx(O,{to:"/kontakt",className:"rounded-md border border-white/30 bg-white/10 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:-translate-y-0.5 hover:bg-white/20",children:n("home.getInTouch")})]})]})})]}),a.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:a.jsx("div",{className:"mx-auto grid max-w-6xl grid-cols-2 gap-6 px-4 text-center sm:grid-cols-4 sm:px-6",children:s.map((p,v)=>a.jsxs(ye,{index:v,children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:p.value}),a.jsx("p",{className:"text-sm text-neutral-400",children:p.label})]},p.label))})}),a.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:a.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[a.jsx("p",{className:"mb-4 text-center text-xs font-semibold uppercase tracking-wide text-neutral-400",children:n("home.brandsHeading")}),a.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:PC.map((p,v)=>a.jsx(ye,{index:v,className:"text-lg font-bold text-neutral-400 dark:text-neutral-600",children:p},p))})]})}),a.jsxs("section",{className:"relative flex min-h-[70vh] items-center justify-center overflow-hidden sm:min-h-[85vh]",children:[a.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,poster:cb,className:"absolute inset-0 h-full w-full object-cover",children:a.jsx("source",{src:SC,type:"video/mp4"})}),a.jsx("div",{className:"absolute inset-0 bg-black/55"}),a.jsxs(ye,{className:"relative mx-auto max-w-3xl px-4 text-center sm:px-6",children:[a.jsx("p",{className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",children:n("home.youtubeBadge")}),a.jsx("h2",{className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",children:n("home.youtubeTitle")}),a.jsx("p",{className:"mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm",children:n("home.youtubeText")}),a.jsx("a",{href:`https://www.youtube.com/watch?v=${CC}`,target:"_blank",rel:"noopener noreferrer",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",children:n("home.youtubeCta")})]})]}),a.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:a.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[a.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[a.jsx(ye,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:a.jsx("img",{src:ub,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})}),a.jsxs(ye,{direction:"right",index:1,children:[a.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:n("home.craftEyebrow")}),a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.craftTitle")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:n("home.craftText")})]})]}),a.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[a.jsxs(ye,{direction:"left",className:"order-2 md:order-1",children:[a.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:n("home.adviceEyebrow")}),a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.adviceTitle")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:n("home.adviceText")})]}),a.jsx(ye,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:a.jsx("img",{src:ob,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})]})]})}),a.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[a.jsxs(ye,{className:"mb-8 text-center",children:[a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.insightsTitle")}),a.jsx("p",{className:"mt-2 text-neutral-600 dark:text-neutral-300",children:n("home.insightsText")})]}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:l.map((p,v)=>a.jsx(ye,{index:v%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsx("img",{src:p.src,alt:p.alt,width:p.width,height:p.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})},p.src))})]}),a.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:a.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[a.jsxs(ye,{className:"mb-10 text-center",children:[a.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:a.jsx(lb,{className:"h-6 w-6"})}),a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.reviewsRating")}),a.jsx("p",{className:"mt-1 text-neutral-600 dark:text-neutral-300",children:n("home.reviewsText")}),a.jsx("a",{href:"https://www.google.com/maps/search/?api=1&query=Hifi+Planet+Amorbach+Boxbrunner+Stra%C3%9Fe+20a",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-block text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:n("home.reviewsLink")})]}),a.jsx(ye,{children:a.jsx(vC,{testimonials:o})})]})}),a.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:a.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[a.jsx(ye,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:a.jsx("img",{src:NC,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})}),a.jsxs(ye,{direction:"right",index:1,className:"rounded-xl border border-neutral-200 bg-white p-8 text-center shadow-sm dark:border-neutral-800 dark:bg-neutral-900 md:text-left",children:[a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.moreTitle")}),a.jsx("p",{className:"mx-auto mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 md:mx-0",children:n("home.moreText")}),a.jsx(O,{to:"/leistungen",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",children:n("home.moreCta")})]})]})}),a.jsx("section",{className:"border-t border-neutral-300 py-16 dark:border-neutral-700",children:a.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[a.jsx(ye,{className:"mb-8 text-center",children:a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.faqHeading")})}),a.jsx(ye,{index:1,children:a.jsx(xC,{items:u})})]})})]})}function AC(){const[e,t]=g.useState([]),[n,r]=g.useState(""),s=fl(),{t:i}=Ne();return Ze({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),g.useEffect(()=>{s.vehicles.enabled&&!s.bypass||M.get("/brands").then(t).catch(l=>r(l.message))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?a.jsx(la,{message:s.vehicles.message}):a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[s.vehicles.enabled&&s.bypass&&a.jsx(oa,{inline:!0}),a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:i("vehicleSelect.title")}),a.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:i("vehicleSelect.intro")}),n&&a.jsx("p",{className:"text-red-600",children:n}),e.length===0&&!n&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:e.map(l=>a.jsx(O,{to:`/fahrzeuge/${l.slug}`,className:"flex items-center justify-center rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:l.name},l.id))})]})}function MC(){const{brandSlug:e}=$n(),[t,n]=g.useState(null),[r,s]=g.useState(""),i=fl(),{t:l}=Ne();return g.useEffect(()=>{i.vehicles.enabled&&!i.bypass||M.get(`/brands/${e}/models`).then(n).catch(o=>s(o.message))},[e,i.vehicles.enabled,i.bypass]),Ze({title:t?`${t.brand.name} ${l("brandPage.titleSuffix")}`:l("brandPage.metaTitleFallback"),description:t?l("brandPage.metaDescription")(t.brand.name):void 0,path:`/fahrzeuge/${e}`}),i.vehicles.enabled&&!i.bypass?a.jsx(la,{message:i.vehicles.message}):r?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&a.jsx(oa,{inline:!0}),a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(O,{to:"/fahrzeuge",className:"hover:text-brand-500",children:l("brandPage.breadcrumbVehicles")})," / ",t.brand.name]}),a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",l("brandPage.titleSuffix")]}),t.models.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:l("brandPage.empty")}),a.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:t.models.map(o=>a.jsx(O,{to:`/fahrzeuge/${e}/${o.slug}`,className:"flex items-center justify-center rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:o.name},o.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:l("brandPage.loading")})}const Cf="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==",_C="/assets/base-BKOm0Bib.webp",DC="/assets/clear-DZZMSrMX.webp",LC="/assets/drive-BE2W1yna.webp",BC="/assets/prime-BTVNe2Gb.webp",zC="/assets/elite_r-BRvz_pyr.webp",IC="/assets/apex-CFy2qup8.webp",RC="/assets/statement-pTO-wTPx.webp",FC="/assets/limitless-DDs0S_PU.webp",VC=(e,t,n)=>{t/=100,n/=100;const r=l=>(l+e/30)%12,s=t*Math.min(n,1-n),i=l=>n-s*Math.max(-1,Math.min(r(l)-3,Math.min(9-r(l),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},po=(e,t,n)=>`rgb(${VC(e,t,n).join(", ")})`,Pf=e=>e.map(([t,n,r,s,i,l])=>({bgTop:po(t,n,r),border:po(t,n,r+8),accent:po(s,i,l),img:null})),Ef={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:_C},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:DC},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:LC},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:BC},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:zC},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:IC},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:RC},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:FC}],"deep-blue":Pf([[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":Pf([[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]])},OC="#f2f2f2",UC="#8a8a8a",WC="#c4c4c4",Tf=5;function HC({pkg:e,tier:t,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:l,t:o}){const[u,c]=g.useState(!1),d=s.length-Tf,h=u?s:s.slice(0,Tf),m=t.img?null:{backgroundColor:t.accent,WebkitMaskImage:`url(${Cf})`,maskImage:`url(${Cf})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return a.jsxs("div",{style:{borderColor:t.border,background:`linear-gradient(180deg, ${t.bgTop} 0%, #0b0b0b 55%, #080808 100%)`},className:r==="strip"?"relative flex min-h-[640px] grow shrink basis-[190px] min-w-[190px] max-w-[240px] snap-start flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40 sm:basis-[210px]":r==="coverflow"?"relative flex min-h-[640px] w-[230px] shrink-0 snap-center flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40":"relative flex min-h-[640px] flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40",children:[t.img?a.jsx("img",{src:t.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...m,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),a.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...m,opacity:.55+n*.45},"aria-hidden":"true"})]}),e.is_featured&&a.jsx("span",{className:"absolute top-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-brand-500 px-3 py-1 text-xs font-bold text-white shadow",children:o("modelPage.featuredBadge")}),a.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0"},children:[a.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:t.accent,textTransform:"uppercase",lineHeight:1.1},children:e.name}),a.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&&a.jsxs("div",{className:"relative z-10",style:{padding:"18px 20px 14px",background:u?"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:[a.jsx("ul",{className:"space-y-1.5 text-left",children:h.map((f,b)=>a.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:WC},children:[a.jsx(Re,{name:"check",className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:t.accent}}),a.jsx("span",{className:"leading-snug",children:f})]},b))}),d>0&&a.jsxs("button",{type:"button",onClick:()=>c(f=>!f),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:t.accent},children:[u?o("modelPage.lessBullets"):o("modelPage.moreBullets")(d),a.jsx(Re,{name:u?"chevron-up":"chevron-down",className:"h-3.5 w-3.5"})]})]}),a.jsx("div",{className:"relative z-10 flex-1"}),a.jsx("div",{className:"relative z-10",style:{padding:"20px 20px 28px",background:"linear-gradient(180deg, rgba(8,8,8,0) 0%, rgba(8,8,8,0.85) 45%, rgba(8,8,8,0.95) 100%)"},children:a.jsxs("div",{className:"text-center",children:[!e.price_text&&a.jsx("div",{style:{fontSize:"13px",color:UC},children:o("modelPage.totalPrice")}),a.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:OC},children:e.price_text||i(e.total_price)}),a.jsx(O,{to:l(e),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:o("modelPage.requestContact")})]})})]})}function $C(){const{brandSlug:e,modelSlug:t}=$n(),[n,r]=g.useState(null),[s,i]=g.useState(""),l=fl(),{t:o,language:u}=Ne(),{package_card_theme:c,package_card_layout:d}=Ir(),h=Ef[c]||Ef.graphite,m=["grid","strip","coverflow"].includes(d)?d:"strip",f=g.useRef(null),b=g.useRef(null),y=g.useRef(null),k=g.useRef(!1),x=N=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(N);if(g.useEffect(()=>{l.vehicles.enabled&&!l.bypass||M.get(`/models/${e}/${t}/packages`).then(r).catch(N=>i(N.message))},[e,t,l.vehicles.enabled,l.bypass]),g.useEffect(()=>{const N=f.current;if(m!=="coverflow"||!N)return;let S=0;const E=()=>{S=0;const U=N.scrollLeft+N.clientWidth/2;for(const Y of N.children){const J=Y.offsetLeft+Y.offsetWidth/2,R=Math.max(-1,Math.min(1,(J-U)/(Y.offsetWidth*1.4))),X=Math.abs(R);Y.style.transform=`rotateY(${(-R*35).toFixed(2)}deg) scale(${(1-X*.13).toFixed(3)}) translateZ(${(-X*60).toFixed(1)}px)`,Y.style.zIndex=String(100-Math.round(X*50))}},T=()=>{S||(S=requestAnimationFrame(E))};E(),N.addEventListener("scroll",T,{passive:!0});const I=new ResizeObserver(T);return I.observe(N),()=>{N.removeEventListener("scroll",T),I.disconnect(),cancelAnimationFrame(S)}},[m,n]),g.useEffect(()=>{const N=f.current;if(m==="grid"||!N||k.current)return;const S=window.matchMedia("(pointer: coarse)").matches,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!S||E)return;k.current=!0;const T=Math.min(N.clientWidth*.4,160),I=setTimeout(()=>N.scrollTo({left:T,behavior:"smooth"}),500),U=setTimeout(()=>N.scrollTo({left:0,behavior:"smooth"}),1250);return()=>{clearTimeout(I),clearTimeout(U)}},[m,n]),g.useEffect(()=>{const N=f.current,S=b.current,E=y.current;if(m==="grid"||!N||!S||!E)return;let T=0;const I=()=>{T=0;const V=N.scrollWidth-N.clientWidth;if(V<=1){S.style.opacity="0",S.style.pointerEvents="none";return}S.style.opacity="1",S.style.pointerEvents="auto";const $=S.clientWidth,Je=Math.max(32,N.clientWidth/N.scrollWidth*$);E.style.width=`${Je}px`,E.style.transform=`translateX(${(N.scrollLeft/V*($-Je)).toFixed(1)}px)`},U=()=>{T||(T=requestAnimationFrame(I))};I(),N.addEventListener("scroll",U,{passive:!0});const Y=new ResizeObserver(U);Y.observe(N);let J=!1,R=0;const X=V=>{const $=S.getBoundingClientRect(),Je=E.clientWidth,ut=Math.min(Math.max(V-$.left-R,0),$.width-Je);N.scrollLeft=ut/($.width-Je)*(N.scrollWidth-N.clientWidth)},_=V=>{J=!0,S.setPointerCapture(V.pointerId),N.style.scrollSnapType="none";const $=E.getBoundingClientRect();R=V.clientX>=$.left&&V.clientX<=$.right?V.clientX-$.left:E.clientWidth/2,V.clientX>=$.left&&V.clientX<=$.right||X(V.clientX)},L=V=>{J&&X(V.clientX)},F=V=>{var $;J&&(J=!1,($=S.hasPointerCapture)!=null&&$.call(S,V.pointerId)&&S.releasePointerCapture(V.pointerId),N.style.scrollSnapType="")};return S.addEventListener("pointerdown",_),S.addEventListener("pointermove",L),S.addEventListener("pointerup",F),S.addEventListener("pointercancel",F),()=>{N.removeEventListener("scroll",U),Y.disconnect(),cancelAnimationFrame(T),S.removeEventListener("pointerdown",_),S.removeEventListener("pointermove",L),S.removeEventListener("pointerup",F),S.removeEventListener("pointercancel",F)}},[m,n]),Ze({title:n?o("modelPage.metaTitle")(n.model.brand_name,n.model.name):o("modelPage.metaTitleFallback"),description:n?o("modelPage.metaDescription")(n.model.brand_name,n.model.name):void 0,path:`/fahrzeuge/${e}/${t}`}),l.vehicles.enabled&&!l.bypass)return a.jsx(la,{message:l.vehicles.message});if(s)return a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s});if(!n)return a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:o("modelPage.loading")});const{model:p,packages:v}=n,w=new Map([...v].sort((N,S)=>N.total_price-S.total_price).map((N,S)=>[N.id,S])),j=N=>{const S=v.length,E=w.get(N.id)??0,T=S<=1?0:E/(S-1),I=Math.round(T*(h.length-1));return{tier:h[I],tierT:T}},P=N=>[...N.products.map(S=>S.name_override||S.scraped_name||o("modelPage.productLoading")),...(N.description||"").split(`
-`).map(S=>S.trim()).filter(Boolean)],C=N=>`/kontakt?${new URLSearchParams({brand:p.brand_name,model:p.name,package:N.name,packageId:N.id,total:N.total_price}).toString()}`;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-12 sm:px-6",children:[l.vehicles.enabled&&l.bypass&&a.jsx(oa,{inline:!0}),a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(O,{to:"/fahrzeuge",className:"hover:text-brand-500",children:o("modelPage.breadcrumbVehicles")})," /"," ",a.jsx(O,{to:`/fahrzeuge/${e}`,className:"hover:text-brand-500",children:p.brand_name})," / ",p.name]}),a.jsxs("h1",{className:`text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl ${v.length?"mb-2":"mb-8"}`,children:[p.brand_name," ",p.name," – ",o("modelPage.titleSuffix")]}),v.length===0&&a.jsx("p",{className:"pb-12 text-neutral-500 dark:text-neutral-400",children:o("modelPage.empty")})]}),v.length>0&&a.jsx("section",{className:"py-10 sm:py-14",style:{fontFamily:"'Barlow', sans-serif"},children:a.jsxs("div",{className:m==="grid"?"mx-auto max-w-6xl px-4 sm:px-6":"mx-auto max-w-[1880px] px-4 sm:px-6",children:[a.jsx("div",{ref:m==="grid"?void 0:f,className:m==="grid"?"grid items-start gap-[18px] sm:grid-cols-2 xl:grid-cols-3":"flex select-none items-start gap-[18px] overflow-x-auto pb-3 snap-x snap-mandatory [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:m==="coverflow"?{perspective:"1200px",paddingLeft:"calc(50% - 115px)",paddingRight:"calc(50% - 115px)",paddingTop:"10px"}:void 0,children:v.map(N=>{const{tier:S,tierT:E}=j(N);return a.jsx(HC,{pkg:N,tier:S,tierT:E,layout:m,bullets:P(N),formatPrice:x,contactUrl:C,t:o},N.id)})}),m!=="grid"&&a.jsx("div",{ref:b,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:a.jsx("div",{ref:y,className:"absolute left-0 top-0 h-full rounded-full bg-brand-500 shadow-[0_0_10px_rgba(107,166,38,0.7)]",style:{width:"48px"}})})]})})]})}function GC(){const[e,t]=g.useState(null),[n,r]=g.useState(""),{t:s}=Ne();return Ze({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),g.useEffect(()=>{M.get("/gallery-brands").then(t).catch(i=>r(i.message))},[]),a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("galleryOverview.title")}),a.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:s("galleryOverview.intro")}),n&&a.jsx("p",{className:"text-red-600",children:n}),!e&&!n&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),e&&e.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:e==null?void 0:e.map(i=>a.jsxs(O,{to:`/galerie/${i.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[i.cover_image_path?a.jsx("img",{src:i.cover_image_path,alt:i.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("span",{className:"absolute inset-x-0 bottom-0 p-4 text-lg font-extrabold text-white",children:i.name})]},i.id))})]})}function KC(){const{brandSlug:e}=$n(),[t,n]=g.useState(null),[r,s]=g.useState(""),{t:i}=Ne();return g.useEffect(()=>{M.get(`/gallery-brands/${e}/projects`).then(n).catch(l=>s(l.message))},[e]),Ze({title:t?i("galleryBrandPage.metaTitle")(t.brand.name):i("galleryBrandPage.metaTitleFallback"),description:t?i("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${e}`}),r?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(O,{to:"/galerie",className:"hover:text-brand-500",children:i("galleryBrandPage.breadcrumbGallery")})," / ",t.brand.name]}),a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",i("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(l=>a.jsxs(O,{to:`/galerie/${e}/${l.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[l.cover_image_path?a.jsx("img",{src:l.cover_image_path,alt:l.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("span",{className:"absolute inset-x-0 bottom-0 p-4 text-lg font-extrabold text-white",children:l.name})]},l.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:i("galleryBrandPage.loading")})}function qC({photos:e,index:t,onClose:n,onNavigate:r}){const{t:s}=Ne();if(g.useEffect(()=>{if(t==null)return;const o=u=>{u.key==="Escape"&&n(),u.key==="ArrowRight"&&r(1),u.key==="ArrowLeft"&&r(-1)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t,n,r]),t==null)return null;const i=e[t],l=o=>o.stopPropagation();return Wc.createPortal(a.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:n,children:[a.jsx("button",{onClick:o=>{l(o),n()},"aria-label":s("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),e.length>1&&a.jsx("button",{onClick:o=>{l(o),r(-1)},"aria-label":s("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),a.jsx("img",{src:i.image_path,alt:i.caption||"",onClick:l,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),e.length>1&&a.jsx("button",{onClick:o=>{l(o),r(1)},"aria-label":s("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),i.caption&&a.jsx("p",{onClick:l,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:i.caption})]}),document.body)}function YC(){const{brandSlug:e,projectSlug:t}=$n(),[n,r]=g.useState(null),[s,i]=g.useState(""),[l,o]=g.useState(null),{t:u}=Ne();g.useEffect(()=>{M.get(`/gallery-brands/${e}/${t}/photos`).then(r).catch(d=>i(d.message))},[e,t]),Ze({title:n?`${n.project.name} – ${n.project.brand_name}`:u("galleryProjectPage.metaTitleFallback"),description:n?u("galleryProjectPage.metaDescription")(n.project.name):void 0,path:`/galerie/${e}/${t}`});const c=d=>{o(h=>{const m=n.photos.length;return(h+d+m)%m})};return s?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s}):n?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(O,{to:"/galerie",className:"hover:text-brand-500",children:u("galleryProjectPage.breadcrumbGallery")})," /"," ",a.jsx(O,{to:`/galerie/${e}`,className:"hover:text-brand-500",children:n.project.brand_name})," / ",n.project.name]}),a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:n.project.name}),n.photos.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:u("galleryProjectPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:n.photos.map((d,h)=>a.jsx(ye,{index:h%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:a.jsx("button",{onClick:()=>o(h),className:"block h-full w-full","aria-label":d.caption||u("galleryProjectPage.enlargeImage"),children:a.jsx("img",{src:d.image_path,alt:d.caption||"",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},d.id))}),a.jsx(qC,{photos:n.photos,index:l,onClose:()=>o(null),onNavigate:c})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:u("galleryProjectPage.loading")})}function XC(){const[e,t]=g.useState([]),n=fl(),{t:r}=Ne();return g.useEffect(()=>{M.get("/services").then(t).catch(()=>t([]))},[]),Ze({title:r("leistungen.metaTitle"),description:r("leistungen.metaDescription"),path:"/leistungen"}),n.services.enabled&&!n.bypass?a.jsx(la,{message:n.services.message}):a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[n.services.enabled&&n.bypass&&a.jsx(oa,{inline:!0}),a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:r("leistungen.title")}),a.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:r("leistungen.intro")}),a.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:e.map((s,i)=>a.jsxs(ye,{index:i%3,shine:!0,className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"relative aspect-[4/3]",children:[s.image_path&&a.jsx("img",{src:s.image_path,alt:s.title,className:"h-full w-full object-cover",loading:"lazy"}),a.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:a.jsx(Re,{name:s.icon_name,className:"h-6 w-6"})})]}),a.jsxs("div",{className:"p-6 pt-8",children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:s.title}),a.jsx("p",{className:"mb-3 text-sm text-neutral-600 dark:text-neutral-300",children:s.description}),s.cta_label&&s.cta_url&&a.jsxs(O,{to:s.cta_url,className:"text-sm font-semibold text-brand-600 hover:underline dark:text-brand-400",children:[s.cta_label," →"]})]})]},s.id))}),a.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:[a.jsx("h2",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:r("leistungen.notListedTitle")}),a.jsx("p",{className:"mb-5 text-neutral-600 dark:text-neutral-300",children:r("leistungen.notListedText")}),a.jsx(O,{to:"/kontakt",className:"inline-block rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white hover:bg-brand-600",children:r("leistungen.contact")})]})]})}function ZC({name:e,description:t,className:n="",children:r}){const{consent:s,acceptAll:i,openSettings:l}=Rr();return s.external?r:a.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:[a.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.`}),a.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[a.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"}),a.jsx("button",{type:"button",onClick:l,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Cookie-Einstellungen"})]})]})}const QC="/assets/grunge-Ct6SL4uw.png",JC="/assets/splatter-ChpwEetv.png",eP="/assets/car-light-CV3-PIkV.png",db=e=>(e||"").replace(/[^\d+]/g,""),tP=e=>`https://wa.me/${db(e).replace(/^0/,"49").replace("+","")}`,hb=encodeURIComponent("Boxbrunner Str. 20a, 63916 Amorbach"),Af=`https://www.google.com/maps/dir/?api=1&destination=${hb}`,ri={fontFamily:"'Michroma', sans-serif"};function nP({className:e}){return a.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.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 rP({path:e,className:t}){return a.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:e})})}const sP={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 Mf({formatted:e,color:t}){const[n,r]=e.split("€");return a.jsxs("span",{style:{...ri,color:t},children:[n,a.jsx("span",{style:{fontFamily:"'Barlow', sans-serif"},children:"€"}),r]})}function La({icon:e,label:t,name:n,type:r="text",required:s,value:i,onChange:l,placeholder:o}){return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("label",{htmlFor:`kf-${n}`,className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:t}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx(e,{className:"pointer-events-none absolute left-[14px] h-[17px] w-[17px]",style:{color:"var(--kf-fieldicon)"}}),a.jsx("input",{id:`kf-${n}`,name:n,type:r,required:s,value:i,onChange:l,placeholder:o,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 aP(){const[e]=rw(),{phone:t,whatsapp:n,contact_email:r}=Ir(),{t:s,language:i}=Ne(),{consent:l}=Rr(),o=T=>new Intl.NumberFormat(i==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(T),[u,c]=g.useState({name:"",email:"",phone:"",vin:"",message:""}),[d,h]=g.useState("idle"),[m,f]=g.useState(""),[b,y]=g.useState([]),[k,x]=g.useState([]),p=e.get("packageId"),v=e.get("total")?Number(e.get("total")):null;g.useEffect(()=>{if(!p){y([]);return}M.get(`/packages/${p}/upgrades`).then(y).catch(()=>y([]))},[p]);const w=T=>{x(I=>I.includes(T)?I.filter(U=>U!==T):[...I,T])},j=b.filter(T=>k.includes(T.id)).reduce((T,I)=>T+Number(I.price),0);Ze({title:s("contactPage.metaTitle"),description:s("contactPage.metaDescription"),path:"/kontakt"});const P={brand:e.get("brand")||"",model:e.get("model")||"",package:e.get("package")||""},C=!!(P.brand&&P.model&&P.package),N=T=>c(I=>({...I,[T.target.name]:T.target.value})),S=async T=>{T.preventDefault(),h("sending"),f("");try{await M.post("/contact",{...u,brand_name:P.brand||null,model_name:P.model||null,package_name:P.package||null,product_name:e.get("product")||null,package_id:p||null,package_product_id:e.get("productId")||null,upgrade_ids:k}),h("sent"),c({name:"",email:"",phone:"",vin:"",message:""})}catch(I){f(I.message),h("idle")}},E=[{key:"premium",title:s("contactPage.featurePremiumTitle"),sub:s("contactPage.featurePremiumSub")},{key:"germany",title:s("contactPage.featureGermanyTitle"),sub:s("contactPage.featureGermanySub")},{key:"individual",title:s("contactPage.featureIndividualTitle"),sub:s("contactPage.featureIndividualSub")},{key:"experts",title:s("contactPage.featureExpertsTitle"),sub:s("contactPage.featureExpertsSub")}];return a.jsxs("div",{className:"kf-page relative w-full overflow-hidden px-4 pb-10 sm:px-10",style:{background:"var(--kf-pagebg)",color:"var(--kf-text2)"},children:[a.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 hidden bg-cover bg-center dark:block",style:{backgroundImage:`url(${QC})`}}),a.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute -right-[4%] -top-[8%] hidden h-[122%] w-[46%] bg-contain bg-right bg-no-repeat dark:block",style:{backgroundImage:`url(${JC})`,filter:"drop-shadow(0 0 22px rgba(164,212,23,0.35))"}}),a.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 600 1000",preserveAspectRatio:"xMaxYMid slice",className:"pointer-events-none absolute right-0 top-0 hidden h-full w-[60%] dark:block",children:[a.jsx("path",{d:"M 900 -200 A 720 720 0 0 1 900 1200",fill:"none",stroke:"rgba(168,225,12,0.5)",strokeWidth:"1.5"}),a.jsx("path",{d:"M 860 -160 A 700 700 0 0 1 860 1160",fill:"none",stroke:"rgba(168,225,12,0.18)",strokeWidth:"1",strokeDasharray:"2 9"})]}),a.jsx("img",{src:eP,alt:"","aria-hidden":"true",className:"kontakt-bg-foto hidden dark:!hidden min-[981px]:block"}),a.jsxs("div",{"aria-hidden":"true",className:"pointer-events-none absolute right-0 top-0 hidden h-full w-[42%] rotate-6 dark:!hidden min-[981px]:block",children:[a.jsx("div",{className:"absolute right-1/2 top-0 h-full w-[3px] opacity-[0.85] blur-[1px]",style:{background:"linear-gradient(180deg, transparent, #b6e619 30%, #cfef5a 55%, transparent)"}}),a.jsx("div",{className:"absolute right-1/2 top-0 h-full w-[90px] translate-x-1/2 opacity-70 blur-[26px]",style:{background:"linear-gradient(180deg, transparent, #cfef5a 40%, transparent)"}}),a.jsx("div",{className:"absolute right-[40%] top-0 h-full w-[2px] opacity-60 blur-[1px]",style:{background:"linear-gradient(180deg, transparent, #b6e619 35%, transparent)"}}),a.jsx("div",{className:"absolute right-1/2 top-1/3 h-[420px] w-[420px] translate-x-1/2 rounded-full opacity-70 blur-[20px]",style:{background:"radial-gradient(circle, rgba(207,239,90,0.35), transparent 70%)"}})]}),a.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 360 280",className:"pointer-events-none absolute left-0 top-0 block h-[280px] w-[360px] opacity-50 dark:hidden",fill:"none",stroke:"var(--kf-topo)",strokeWidth:"1",children:[a.jsx("path",{d:"M -20 40 C 60 10, 140 70, 220 40 S 360 10, 400 50"}),a.jsx("path",{d:"M -20 90 C 70 55, 150 115, 230 85 S 370 60, 400 100"}),a.jsx("path",{d:"M -20 140 C 60 105, 150 165, 235 135 S 365 110, 400 150"}),a.jsx("path",{d:"M -20 190 C 70 155, 145 215, 230 185 S 370 160, 400 200"}),a.jsx("path",{d:"M -20 240 C 60 205, 150 265, 235 235 S 365 210, 400 250"})]}),a.jsxs("div",{className:"relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14",children:[a.jsx("div",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.heroEyebrow")}),a.jsxs("h1",{className:"text-[34px] leading-[1.08] sm:text-[46px] lg:text-[60px]",style:{...ri,color:"var(--kf-text)"},children:[s("contactPage.heroTitlePre")," ",a.jsx("span",{style:{color:"var(--kf-accent2)"},children:s("contactPage.heroTitleAccent")})," ",s("contactPage.heroTitlePost")]}),a.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:"var(--kf-muted)"},children:s("contactPage.heroSubtitle")}),a.jsxs("div",{className:"grid grid-cols-1 items-start gap-10 min-[981px]:grid-cols-[minmax(0,1.35fr)_minmax(320px,1fr)]",children:[a.jsx("div",{children:a.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:[C&&a.jsxs("div",{className:"mb-8 rounded-xl border px-6 py-[22px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[a.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:[a.jsx(Lb,{className:"h-4 w-4"}),s("contactPage.packageBoxTitle")]}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-5 gap-y-2 text-[15px]",children:[a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextBrand")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:P.brand}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextModel")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:P.model}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextPackage")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:P.package})]}),a.jsxs("div",{className:"mt-3.5 flex items-baseline justify-between border-t pt-3.5",style:{borderColor:"var(--kf-pkgbrd)"},children:[a.jsx("span",{className:"text-[13px] font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:s("contactPage.packagePrice")}),a.jsx("span",{className:"text-xl",children:v!=null?a.jsx(Mf,{formatted:o(v),color:"var(--kf-text)"}):"—"})]})]}),b.length>0&&a.jsxs("div",{className:"mb-8 rounded-xl border p-5",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)"},children:[a.jsx("div",{className:"mb-3 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.optionalUpgrades")}),a.jsx("div",{className:"space-y-2",children:b.map(T=>a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border p-3 text-sm",style:{borderColor:"var(--kf-fieldbrd)"},children:[a.jsx("input",{type:"checkbox",checked:k.includes(T.id),onChange:()=>w(T.id),className:"mt-0.5 h-4 w-4 rounded",style:{accentColor:"var(--kf-accent)"}}),a.jsxs("span",{className:"flex-1",children:[a.jsx("span",{className:"block font-semibold",style:{color:"var(--kf-text2)"},children:T.name}),T.description&&a.jsx("span",{className:"block text-xs",style:{color:"var(--kf-muted)"},children:T.description})]}),a.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-accent2)"},children:["+",o(T.price)]})]},T.id))}),k.length>0&&v!=null&&a.jsxs("div",{className:"mt-3 flex items-baseline justify-between border-t pt-3 text-sm",style:{borderColor:"var(--kf-pkgbrd)"},children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:s("contactPage.totalWithUpgrades")}),a.jsx(Mf,{formatted:o(v+j),color:"var(--kf-text)"})]})]}),a.jsx("h2",{className:"mb-8 text-xl",style:{...ri,color:"var(--kf-text)"},children:s("contactPage.formTitle")}),d==="sent"&&a.jsxs("div",{className:"mb-6 rounded-[10px] border p-5",style:{borderColor:"var(--kf-accent)",background:"var(--kf-accentsoft)"},children:[a.jsx("div",{className:"text-base font-bold",style:{color:"var(--kf-accent2)"},children:s("contactPage.sentTitle")}),a.jsx("div",{className:"mt-1 text-sm",style:{color:"var(--kf-muted)"},children:s("contactPage.sentText")})]}),a.jsxs("form",{onSubmit:S,children:[a.jsxs("div",{className:"grid grid-cols-1 gap-6 min-[641px]:grid-cols-2",children:[a.jsx(La,{icon:Bb,label:s("contactPage.nameLabel"),name:"name",required:!0,value:u.name,onChange:N,placeholder:s("contactPage.namePlaceholder")}),a.jsx(La,{icon:Ad,label:s("contactPage.emailLabel"),name:"email",type:"email",required:!0,value:u.email,onChange:N,placeholder:s("contactPage.emailPlaceholder")}),a.jsx(La,{icon:Md,label:s("contactPage.phoneLabel"),name:"phone",value:u.phone,onChange:N,placeholder:s("contactPage.phonePlaceholder")}),a.jsx(La,{icon:zb,label:s("contactPage.vinLabel"),name:"vin",value:u.vin,onChange:N,placeholder:s("contactPage.vinPlaceholder")})]}),a.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[a.jsx("label",{htmlFor:"kf-message",className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:s("contactPage.messageLabel")}),a.jsx("textarea",{id:"kf-message",name:"message",rows:5,value:u.message,onChange:N,placeholder:s("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)"}})]}),m&&a.jsx("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:m}),a.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-5",children:[a.jsxs("button",{type:"submit",disabled:d==="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:[a.jsx(Ib,{className:"h-[18px] w-[18px]"}),s(d==="sending"?"contactPage.sending":"contactPage.submit")]}),a.jsx("div",{className:"text-[13px]",style:{color:"var(--kf-label)"},children:s("contactPage.requiredHint")})]})]})]})}),a.jsxs("div",{className:"flex flex-col gap-6",children:[a.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:[a.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)"}}),a.jsx("h2",{className:"mb-7 text-[17px]",style:{...ri,color:"var(--kf-text)"},children:s("contactPage.cardTitle")}),a.jsxs("div",{className:"flex flex-col gap-5",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(Md,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.phone")}),a.jsx("a",{href:`tel:${db(t)}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:t})]})]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(Ad,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.email")}),a.jsx("a",{href:`mailto:${r}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:r})]})]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(Rb,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.address")}),a.jsxs("div",{className:"text-base font-semibold leading-[1.4]",style:{color:"var(--kf-text2)"},children:["Boxbrunner Straße 20a",a.jsx("br",{}),"63916 Amorbach"]})]})]}),n&&a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(nP,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("nav.whatsapp")}),a.jsx("a",{href:tP(n),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:n})]})]})]}),a.jsxs("div",{className:"mt-7 border-t pt-6",style:{borderColor:"var(--kf-divider)"},children:[a.jsx("div",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.hours")}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-[15px]",children:[a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.hoursWeekDays")}),a.jsx("span",{children:s("contactPage.hoursWeekTime")}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.hoursSatDay")}),a.jsx("span",{children:s("contactPage.hoursSatTime")})]})]})]}),a.jsxs("div",{className:"relative overflow-hidden rounded-2xl border",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[l.external&&a.jsxs("a",{href:Af,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:[s("contactPage.mapOpenChip"),a.jsx(Fb,{className:"h-3.5 w-3.5",style:{color:"var(--kf-accent2)"}})]}),a.jsx(ZC,{name:s("contactPage.mapEmbedName"),className:"h-[210px] w-full",children:a.jsx("div",{className:"h-[210px] overflow-hidden",children:a.jsx("iframe",{title:"HifiPlanet Amorbach – Standort",src:`https://www.google.com/maps?q=${hb}&output=embed`,width:"100%",height:"280",style:{border:0,display:"block",marginTop:"-70px"},loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"})})}),a.jsxs("a",{href:Af,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:[s("contactPage.routePlan")," →"]})]})]})]}),a.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:E.map(T=>a.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:[a.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:a.jsx(rP,{path:sP[T.key],className:"h-[22px] w-[22px]"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-bold",style:{color:"var(--kf-text)"},children:T.title}),a.jsx("div",{className:"mt-0.5 text-[13px]",style:{color:"var(--kf-muted)"},children:T.sub})]})]},T.key))})]})]})}function iP(){return Ze({title:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG.",path:"/impressum"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Impressum"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Angaben gemäß § 5 DDG"}),a.jsxs("p",{children:["Hifi Planet e.K.",a.jsx("br",{}),"Inhaber: Christopher Horndasch",a.jsx("br",{}),"Boxbrunner Str. 20a",a.jsx("br",{}),"63916 Amorbach"]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Kontakt"}),a.jsxs("p",{children:["Telefon: ",a.jsx("a",{href:"tel:+4993732062390",className:"hover:text-brand-500",children:"09373 20 62 390"}),a.jsx("br",{}),"E-Mail: ",a.jsx("a",{href:"mailto:info@hifi-planet-amorbach.de",className:"hover:text-brand-500",children:"info@hifi-planet-amorbach.de"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Umsatzsteuer-ID"}),a.jsx("p",{children:"Umsatzsteuer-Identifikationsnummer gemäß § 27a Umsatzsteuergesetz: DE 275084766"})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Zuständige Kammer"}),a.jsx("p",{children:"IHK Aschaffenburg"})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Verantwortlich für den Inhalt nach § 18 Abs. 2 MStV"}),a.jsxs("p",{children:["Christopher Horndasch",a.jsx("br",{}),"Anschrift wie oben"]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Verbraucherstreitbeilegung"}),a.jsx("p",{children:"Wir sind nicht bereit und nicht verpflichtet, an Streitbeilegungsverfahren vor einer Verbraucherschlichtungsstelle im Sinne des Verbraucherstreitbeilegungsgesetzes (VSBG) teilzunehmen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Haftung für Inhalte"}),a.jsx("p",{children:"Als Diensteanbieter sind wir gemäß § 7 Abs. 1 DDG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 DDG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntnis einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von entsprechenden Rechtsverletzungen werden wir diese Inhalte umgehend entfernen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Haftung für Links"}),a.jsx("p",{children:"Unser Angebot enthält Links zu externen Websites Dritter, auf deren Inhalte wir keinen Einfluss haben. Deshalb können wir für diese fremden Inhalte auch keine Gewähr übernehmen. Für die Inhalte der verlinkten Seiten ist stets der jeweilige Anbieter oder Betreiber der Seiten verantwortlich. Eine permanente inhaltliche Kontrolle der verlinkten Seiten ist ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht zumutbar. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Links umgehend entfernen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Urheberrecht"}),a.jsx("p",{children:"Die durch die Seitenbetreiber erstellten Inhalte und Werke auf diesen Seiten unterliegen dem deutschen Urheberrecht. Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung außerhalb der Grenzen des Urheberrechtes bedürfen der schriftlichen Zustimmung des jeweiligen Autors bzw. Erstellers. Downloads und Kopien dieser Seite sind nur für den privaten, nicht kommerziellen Gebrauch gestattet. Soweit die Inhalte auf dieser Seite nicht vom Betreiber erstellt wurden, werden die Urheberrechte Dritter beachtet. Insbesondere werden Inhalte Dritter als solche gekennzeichnet. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte umgehend entfernen."})]})]})]})}function lP(){return Ze({title:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO.",path:"/datenschutz"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Datenschutzerklärung"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"1. Verantwortlicher"}),a.jsxs("p",{children:["Verantwortlicher im Sinne der Datenschutz-Grundverordnung (DSGVO) ist:",a.jsx("br",{}),"Hifi Planet e.K., Christopher Horndasch",a.jsx("br",{}),"Boxbrunner Str. 20a, 63916 Amorbach",a.jsx("br",{}),"Telefon: 09373 20 62 390 · E-Mail:"," ",a.jsx("a",{href:"mailto:info@hifi-planet-amorbach.de",className:"hover:text-brand-500",children:"info@hifi-planet-amorbach.de"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"2. Ihre Rechte als betroffene Person"}),a.jsx("p",{className:"mb-2",children:"Sie haben jederzeit das Recht,"}),a.jsxs("ul",{className:"list-disc space-y-1 pl-5",children:[a.jsx("li",{children:"Auskunft über Ihre bei uns gespeicherten personenbezogenen Daten zu erhalten (Art. 15 DSGVO),"}),a.jsx("li",{children:"die Berichtigung unrichtiger Daten zu verlangen (Art. 16 DSGVO),"}),a.jsx("li",{children:"die Löschung Ihrer Daten zu verlangen (Art. 17 DSGVO),"}),a.jsx("li",{children:"die Verarbeitung Ihrer Daten einschränken zu lassen (Art. 18 DSGVO),"}),a.jsx("li",{children:"der Verarbeitung Ihrer Daten zu widersprechen (Art. 21 DSGVO),"}),a.jsx("li",{children:"Ihre Daten in einem gängigen Format zu erhalten (Datenübertragbarkeit, Art. 20 DSGVO), und"}),a.jsx("li",{children:"eine erteilte Einwilligung jederzeit mit Wirkung für die Zukunft zu widerrufen (Art. 7 Abs. 3 DSGVO)."})]}),a.jsx("p",{className:"mt-2",children:"Außerdem haben Sie das Recht, sich bei einer Datenschutz-Aufsichtsbehörde über die Verarbeitung Ihrer personenbezogenen Daten durch uns zu beschweren, zum Beispiel beim Bayerischen Landesamt für Datenschutzaufsicht (BayLDA)."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"3. Hosting und Server-Logfiles"}),a.jsx("p",{children:"Beim Aufruf dieser Website erhebt der Webserver automatisch Daten in sogenannten Server-Logfiles, die Ihr Browser übermittelt. Dazu gehören: IP-Adresse, Datum und Uhrzeit der Anfrage, aufgerufene Seite, verwendeter Browser und Betriebssystem sowie die zuvor besuchte Seite (Referrer-URL). Diese Daten dienen ausschließlich der technisch fehlerfreien Auslieferung der Website sowie der IT-Sicherheit (z. B. zur Abwehr von Angriffen) und werden nicht mit anderen Datenquellen zusammengeführt. Rechtsgrundlage ist unser berechtigtes Interesse an einem sicheren und stabilen Betrieb der Website (Art. 6 Abs. 1 lit. f DSGVO)."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"4. Kontaktformular"}),a.jsx("p",{children:"Wenn Sie uns über das Kontaktformular eine Anfrage zukommen lassen, werden Ihre Angaben aus dem Formular (Name, E-Mail-Adresse, optional Telefonnummer, Nachricht sowie ggf. der Kontext Ihrer Anfrage wie Marke, Modell oder Paket) inklusive der von Ihnen dort angegebenen Kontaktdaten bei uns gespeichert, um Ihre Anfrage zu bearbeiten und zu beantworten. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung durch Absenden des Formulars (Art. 6 Abs. 1 lit. a DSGVO) bzw., sofern Ihre Anfrage der Vorbereitung eines Vertrags dient, auf Grundlage von Art. 6 Abs. 1 lit. b DSGVO. Wir löschen die Anfrage inklusive der Kontaktdaten, sobald der jeweilige Sachverhalt abschließend geklärt ist und keine gesetzlichen Aufbewahrungspflichten entgegenstehen. Diese Einwilligung können Sie jederzeit widerrufen, indem Sie uns formlos per E-Mail kontaktieren."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"5. Cookies und lokale Speicherung"}),a.jsx("p",{className:"mb-2",children:"Diese Website verwendet technisch notwendige Cookies bzw. Speichertechnologien, die für den Betrieb der Seite erforderlich sind und ohne die einzelne Funktionen nicht funktionieren würden. Dazu gehören:"}),a.jsxs("ul",{className:"list-disc space-y-1 pl-5",children:[a.jsxs("li",{children:["ein Session-Cookie (",a.jsx("code",{children:"hifi_admin_session"}),"), das für den Anmeldestatus im Mitarbeiter-Login benötigt wird und mit Ende der Browsersitzung abläuft,"]}),a.jsxs("li",{children:["eine lokale Speicherung (",a.jsx("code",{children:"localStorage"}),") Ihrer Hell-/Dunkelmodus-Einstellung sowie Ihrer Cookie-Auswahl, damit wir Sie nicht bei jedem Besuch erneut danach fragen müssen."]})]}),a.jsx("p",{className:"mt-2",children:'Für diese technisch notwendigen Cookies ist gemäß § 25 Abs. 2 Nr. 2 TTDSG keine Einwilligung erforderlich. Rechtsgrundlage ist unser berechtigtes Interesse am technischen Betrieb der Website (Art. 6 Abs. 1 lit. f DSGVO). Für alle darüber hinausgehenden Inhalte und Dienste – aktuell die eingebundenen Google Maps- und YouTube-Elemente sowie Google Analytics – fragen wir Sie beim ersten Besuch aktiv nach Ihrer Einwilligung. Sie können Ihre Auswahl jederzeit über den Link „Cookie-Einstellungen" im Footer ändern.'})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"6. Google Maps"}),a.jsxs("p",{children:['Auf unserer Kontaktseite und im Footer binden wir Kartenmaterial des Dienstes „Google Maps" ein, um Ihnen die Anfahrt zu unserem Standort zu erleichtern. Anbieter ist Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland. Die eingebettete Karte wird erst geladen, nachdem Sie dem im Cookie-Banner unter „Externe Medien" zugestimmt haben. Beim Laden der Karte wird Ihre IP-Adresse an Google übertragen; eine Verarbeitung kann dabei auch auf Servern außerhalb der EU/des EWR erfolgen. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"7. YouTube"}),a.jsxs("p",{children:['Auf unserer Startseite binden wir ein Video des Anbieters YouTube (Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland) im „erweiterten Datenschutzmodus" ein (Domain youtube-nocookie.com). Auch dieses Video wird erst geladen, nachdem Sie unter „Externe Medien" zugestimmt haben. Nach Angaben von Google werden dabei bis zum Start der Wiedergabe keine Cookies gesetzt; beim Laden des Players wird jedoch bereits eine Verbindung zu Google-Servern aufgebaut und Ihre IP-Adresse übertragen. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"8. Google Analytics"}),a.jsxs("p",{children:['Sofern Sie der Statistik-Kategorie im Cookie-Banner zugestimmt haben, setzen wir „Google Analytics" ein, einen Webanalysedienst der Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland. Google Analytics verwendet Cookies und ähnliche Technologien, die eine Analyse der Benutzung dieser Website durch Sie ermöglichen. Die dabei erzeugten Informationen (u. a. Ihre IP-Adresse, die vor der Verarbeitung durch die Aktivierung der IP-Anonymisierung gekürzt wird) werden an einen Server von Google übertragen und dort gespeichert; eine Verarbeitung kann dabei auch auf Servern außerhalb der EU/des EWR erfolgen. Die Verarbeitung erfolgt ausschließlich auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen mit Wirkung für die Zukunft widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"9. Empfänger der Daten"}),a.jsx("p",{children:"Ihre Daten werden grundsätzlich nur innerhalb unseres Unternehmens verarbeitet. Eine Weitergabe an Dritte erfolgt nur, soweit dies zur Bearbeitung Ihrer Anfrage erforderlich ist (z. B. an unseren Hosting-Provider zum Betrieb dieser Website und an unseren E-Mail-Anbieter zur Zustellung Ihrer Kontaktanfrage) oder soweit wir gesetzlich dazu verpflichtet sind."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"10. Speicherdauer"}),a.jsx("p",{children:"Sofern in dieser Erklärung keine speziellere Speicherdauer genannt wurde, verbleiben Ihre personenbezogenen Daten bei uns, bis der Zweck für die Datenspeicherung entfällt. Gesetzliche Aufbewahrungsfristen (z. B. aus dem Handels- oder Steuerrecht) bleiben hiervon unberührt und können eine längere Speicherung erforderlich machen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"11. SSL-/TLS-Verschlüsselung"}),a.jsx("p",{children:"Diese Seite nutzt aus Sicherheitsgründen eine SSL-/TLS-Verschlüsselung zur Übertragung Ihrer Daten. Eine verschlüsselte Verbindung erkennen Sie an dem Schloss-Symbol in der Adresszeile Ihres Browsers."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"12. Änderung dieser Datenschutzerklärung"}),a.jsx("p",{children:"Wir passen diese Datenschutzerklärung an, sobald sich die von uns eingesetzten Datenverarbeitungen ändern. Es gilt jeweils die zum Zeitpunkt Ihres Besuchs aktuelle, auf dieser Seite veröffentlichte Fassung."})]}),a.jsxs("p",{children:["Fragen zum Datenschutz beantworten wir Ihnen gerne über unser"," ",a.jsx(O,{to:"/kontakt",className:"underline hover:text-brand-500",children:"Kontaktformular"})," oder direkt per E-Mail."]})]})]})}function oP(){return Ze({title:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach.",path:"/agb"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Allgemeine Geschäftsbedingungen"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"1. Geltungsbereich"}),a.jsx("p",{children:'Diese Allgemeinen Geschäftsbedingungen (AGB) gelten für alle Beratungs-, Werkstatt- und Umbauleistungen, die die Hifi Planet e.K., Boxbrunner Str. 20a, 63916 Amorbach („wir", „HifiPlanet") gegenüber ihren Kunden erbringt, sowie für die Nutzung des Kontaktformulars auf dieser Website.'})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"2. Anfragen über die Website"}),a.jsx("p",{children:"Über das Kontaktformular können Sie unverbindlich eine Beratung oder ein Angebot zu einem einzelnen Produkt oder einem ganzen Paket anfragen. Die auf der Website angezeigten Preise sind, soweit sie von Drittanbietern automatisiert übernommen werden, unverbindliche Circa-Preise ohne Einbau und können sich bis zur Erstellung eines konkreten Angebots ändern. Mit dem Absenden einer Anfrage kommt noch kein Vertrag zustande."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"3. Vertragsschluss"}),a.jsx("p",{children:"Ein verbindlicher Vertrag über Beratung, Material und Einbauleistungen kommt erst zustande, wenn wir Ihnen nach persönlicher oder schriftlicher Abstimmung ein konkretes Angebot unterbreitet haben und Sie dieses angenommen haben, spätestens jedoch mit der Übergabe Ihres Fahrzeugs zur vereinbarten Auftragsdurchführung in unserer Werkstatt in Amorbach."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"4. Preise und Zahlung"}),a.jsx("p",{children:"Es gelten die im jeweiligen Einzelangebot genannten Preise inklusive der zum Zeitpunkt der Rechnungsstellung gesetzlich geltenden Umsatzsteuer. Sofern nichts anderes vereinbart ist, ist die Rechnung nach Abnahme der Leistung bzw. Übergabe des Fahrzeugs ohne Abzug fällig."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"5. Termine und Fahrzeugübergabe"}),a.jsx("p",{children:"Vereinbarte Termine zur Fahrzeugübergabe sind von beiden Seiten einzuhalten. Verschiebungen sind möglichst frühzeitig mitzuteilen. Für Gegenstände, die sich zum Zeitpunkt der Übergabe im Fahrzeug befinden und nicht Gegenstand des Auftrags sind, übernehmen wir keine Haftung."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"6. Gewährleistung"}),a.jsx("p",{children:"Es gelten die gesetzlichen Gewährleistungsrechte. Mängel sind uns unverzüglich nach Feststellung anzuzeigen, damit wir Ihnen Nacherfüllung anbieten können. Für Verschleißteile sowie für Schäden, die auf unsachgemäße Behandlung, Fremdeingriffe Dritter oder normalen Verschleiß zurückzuführen sind, besteht kein Gewährleistungsanspruch."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"7. Eigentumsvorbehalt"}),a.jsx("p",{children:"Verbautes Material und gelieferte Ware bleiben bis zur vollständigen Bezahlung unser Eigentum."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"8. Haftung"}),a.jsx("p",{children:"Wir haften unbeschränkt bei Vorsatz und grober Fahrlässigkeit sowie nach Maßgabe des Produkthaftungsgesetzes. Bei leichter Fahrlässigkeit haften wir nur bei Verletzung einer wesentlichen Vertragspflicht (Kardinalpflicht) und begrenzt auf den vertragstypisch vorhersehbaren Schaden. Die Haftung für Schäden aus der Verletzung des Lebens, des Körpers oder der Gesundheit bleibt hiervon unberührt."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"9. Widerrufsrecht"}),a.jsx("p",{children:"Ein gesetzliches Widerrufsrecht für Verbraucher besteht bei Verträgen, die außerhalb von Geschäftsräumen oder im Fernabsatz geschlossen werden. Da der eigentliche Werkvertrag über Beratung und Einbauleistungen erst bei persönlicher Fahrzeugübergabe in unseren Geschäftsräumen in Amorbach geschlossen wird, handelt es sich hierbei nicht um einen Fernabsatzvertrag; ein gesetzliches Widerrufsrecht besteht in diesem Fall nicht. Sollte im Einzelfall ausnahmsweise ein Vertrag im Fernabsatz zustande kommen, informieren wir Sie gesondert über Ihr gesetzliches Widerrufsrecht."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"10. Anwendbares Recht und Gerichtsstand"}),a.jsx("p",{children:"Es gilt das Recht der Bundesrepublik Deutschland unter Ausschluss des UN-Kaufrechts. Ist der Kunde Kaufmann, juristische Person des öffentlichen Rechts oder öffentlich-rechtliches Sondervermögen, ist Gerichtsstand für alle Streitigkeiten aus diesem Vertragsverhältnis unser Geschäftssitz in Amorbach."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"11. Schlussbestimmungen"}),a.jsx("p",{children:"Sollte eine Bestimmung dieser AGB unwirksam sein oder werden, bleibt die Wirksamkeit der übrigen Bestimmungen hiervon unberührt."})]})]})]})}const uP={host:"",name:"",user:"",password:"",charset:"utf8mb4"},cP={username:"",password:"",password_confirmation:""};function dP(){Ze({title:"Ersteinrichtung",path:"/setup"});const[e,t]=g.useState("loading"),[n,r]=g.useState(""),[s,i]=g.useState(!1),[l,o]=g.useState(""),[u,c]=g.useState(uP),[d,h]=g.useState(cP),[m,f]=g.useState(null),b=()=>M.get("/setup/status").then(C=>(C.needs_setup?C.steps.admin.ok?t("done"):C.steps.schema.ok?t("admin"):t(C.steps.database.ok?"schema":"database"):t("locked"),C));g.useEffect(()=>{M.get("/setup/status").then(C=>t(C.needs_setup?"password":"locked")).catch(()=>t("locked"))},[]);const y=async C=>{C.preventDefault(),r(""),i(!0);try{await M.post("/setup/verify-password",{password:l}),await b()}catch(N){r(N.message)}finally{i(!1)}},k=async C=>{C.preventDefault(),r(""),i(!0);try{await M.post("/setup/database",u),await b()}catch(N){r(N.message)}finally{i(!1)}},x=async()=>{r(""),i(!0);try{const C=await M.post("/setup/migrate",{});f(C.actions),C.status.steps.schema.ok&&t("admin")}catch(C){r(C.message)}finally{i(!1)}},p=async C=>{if(C.preventDefault(),r(""),d.password!==d.password_confirmation){r("Die Passwörter stimmen nicht überein");return}i(!0);try{await M.post("/setup/admin",d),t("done")}catch(N){r(N.message)}finally{i(!1)}},v="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900",w="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",j=[{key:"database",label:"Datenbank"},{key:"schema",label:"Struktur"},{key:"admin",label:"Admin-Account"}],P=j.findIndex(C=>C.key===e);return a.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:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-16 w-auto sm:h-20"}),a.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:[e==="loading"&&a.jsx("p",{className:"text-center text-sm text-neutral-400",children:"Lädt…"}),e==="locked"&&a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bereits eingerichtet"}),a.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."}),a.jsx(O,{to:"/admin/login",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Zum Login"})]}),["database","schema","admin"].includes(e)&&a.jsx("div",{className:"mb-6 flex items-center justify-center gap-2",children:j.map((C,N)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-semibold ${No(C.target.value),required:!0,autoFocus:!0,className:v})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Prüfe…":"Weiter"})]}),e==="database"&&a.jsxs("form",{onSubmit:k,children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),a.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."}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Host *"}),a.jsx("input",{required:!0,value:u.host,onChange:C=>c({...u,host:C.target.value}),className:v})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Datenbankname *"}),a.jsx("input",{required:!0,value:u.name,onChange:C=>c({...u,name:C.target.value}),className:v})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Benutzer *"}),a.jsx("input",{required:!0,value:u.user,onChange:C=>c({...u,user:C.target.value}),className:v})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Passwort"}),a.jsx("input",{type:"password",value:u.password,onChange:C=>c({...u,password:C.target.value}),className:v})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:w,children:"Zeichensatz"}),a.jsx("input",{value:u.charset,onChange:C=>c({...u,charset:C.target.value}),className:v})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Teste Verbindung…":"Verbindung testen & speichern"})]}),e==="schema"&&a.jsxs("div",{children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),a.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."}),m&&a.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:m.map((C,N)=>a.jsx("li",{children:C},N))}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"button",onClick:x,disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Richte ein…":"Datenbankstruktur einrichten"})]}),e==="admin"&&a.jsxs("form",{onSubmit:p,children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Erster Admin-Account"}),a.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."}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Benutzername"}),a.jsx("input",{required:!0,autoFocus:!0,value:d.username,onChange:C=>h({...d,username:C.target.value}),className:v})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Passwort"}),a.jsx("input",{type:"password",required:!0,minLength:8,value:d.password,onChange:C=>h({...d,password:C.target.value}),className:v})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:w,children:"Passwort wiederholen"}),a.jsx("input",{type:"password",required:!0,minLength:8,value:d.password_confirmation,onChange:C=>h({...d,password_confirmation:C.target.value}),className:v})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Lege an…":"Admin-Account anlegen"})]}),e==="done"&&a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Fertig!"}),a.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."}),a.jsx(O,{to:"/admin/login",className:"inline-block w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Zum Login"})]})]})]})}function hP(){const{user:e,login:t,verifyTwoFactor:n}=Mt(),r=ea(),[s,i]=g.useState("credentials"),[l,o]=g.useState(""),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState(""),[b,y]=g.useState(!1);if(e)return a.jsx(Ws,{to:"/admin",replace:!0});const k=async p=>{p.preventDefault(),y(!0),f("");try{(await t(l,u)).requires2fa?i("code"):r("/admin")}catch(v){f(v.message)}finally{y(!1)}},x=async p=>{p.preventDefault(),y(!0),f("");try{await n(d),r("/admin")}catch(v){f(v.message)}finally{y(!1)}};return a.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:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),a.jsx("img",{src:Ai,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),s==="credentials"?a.jsxs("form",{onSubmit:k,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:[a.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),a.jsx("input",{value:l,onChange:p=>o(p.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"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),a.jsx("input",{type:"password",value:u,onChange:p=>c(p.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"})]}),m&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),a.jsx("button",{type:"submit",disabled:b,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:b?"Anmelden…":"Anmelden"})]}):a.jsxs("form",{onSubmit:x,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:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),a.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."}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),a.jsx("input",{value:d,onChange:p=>h(p.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),a.jsx("button",{type:"submit",disabled:b,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:b?"Prüfe…":"Bestätigen"}),a.jsx("button",{type:"button",onClick:()=>{i("credentials"),h(""),f("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}const mP={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"},fP=({path:e,className:t="h-6 w-6"})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:t,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})});function pP(){const[e,t]=g.useState(null),[n,r]=g.useState("");if(g.useEffect(()=>{M.get("/analytics/report").then(t).catch(i=>r(i.message))},[]),n)return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsx("p",{className:"text-sm text-red-600",children:n})]});if(!e)return null;if(!e.configured)return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Noch nicht eingerichtet. Unter"," ",a.jsx(O,{to:"/admin/settings/website",className:"text-brand-600 hover:underline dark:text-brand-400",children:"Einstellungen → Website"})," ","kannst du die Dashboard-Anbindung konfigurieren, um hier Besucherzahlen zu sehen."]})]});const s=Math.max(1,...e.daily.map(i=>i.pageviews));return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Letzte 7 Tage."}),a.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.users}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Nutzer"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.sessions}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Sitzungen"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.pageviews}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Seitenaufrufe"})]})]}),e.daily.length>0&&a.jsx("div",{className:"mb-6 flex h-24 items-end gap-1.5",children:e.daily.map(i=>a.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[a.jsx("div",{className:"w-full rounded-t bg-brand-400 dark:bg-brand-500",style:{height:`${Math.max(4,i.pageviews/s*80)}px`},title:`${i.date}: ${i.pageviews} Seitenaufrufe`}),a.jsxs("span",{className:"text-[10px] text-neutral-400",children:[i.date.slice(6,8),".",i.date.slice(4,6),"."]})]},i.date))}),e.top_pages.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Meistbesuchte Seiten"}),a.jsx("ul",{className:"space-y-1 text-sm",children:e.top_pages.map(i=>a.jsxs("li",{className:"flex items-center justify-between gap-3 text-neutral-700 dark:text-neutral-300",children:[a.jsx("span",{className:"truncate font-mono text-xs",children:i.path}),a.jsx("span",{className:"shrink-0 font-semibold",children:i.pageviews})]},i.path))})]})]})}function gP(){const{user:e,hasPermission:t}=Mt(),[n,r]=g.useState({});g.useEffect(()=>{t("brands.manage")&&M.get("/brands").then(i=>r(l=>({...l,brands:i.length}))),(t("models.manage")||t("packages.manage"))&&M.get("/models").then(i=>r(l=>({...l,models:i.length}))),t("packages.manage")&&M.get("/packages").then(i=>r(l=>({...l,packages:i.length}))),t("contact.manage")&&M.get("/contact").then(i=>r(l=>({...l,newContacts:i.filter(o=>o.status==="new").length})))},[]);const s=[{key:"brands",label:"Marken",icon:"tag",hint:"Die Hersteller, z. B. Audi oder BMW.",value:n.brands,to:"/admin/brands",show:t("brands.manage")},{key:"models",label:"Modelle",icon:"car",hint:"Die Fahrzeuge einer Marke, z. B. A4.",value:n.models,to:"/admin/models",show:t("models.manage")},{key:"packages",label:"Pakete",icon:"box",hint:"Die Sound-Pakete für ein Modell.",value:n.packages,to:"/admin/packages",show:t("packages.manage")},{key:"contacts",label:"Neue Anfragen",icon:"mail",hint:"Kunden, die noch auf Antwort warten.",value:n.newContacts,to:"/admin/contact-requests",show:t("contact.manage"),highlight:!0}].filter(i=>i.show);return a.jsxs("div",{children:[a.jsxs("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:["Willkommen, ",e==null?void 0:e.username,"!"]}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Hier siehst du auf einen Blick, wie viel in deinem Shop hinterlegt ist. Klicke auf eine Kachel, um dorthin zu gelangen."}),s.length===0?a.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."}):a.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:s.map(i=>a.jsxs(O,{to:i.to,className:`rounded-xl border p-5 shadow-sm transition hover:-translate-y-0.5 hover:shadow-md ${i.highlight&&i.value>0?"border-brand-300 bg-brand-50 dark:border-brand-900 dark:bg-brand-900/20":"border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900"}`,children:[a.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:a.jsx(fP,{path:mP[i.icon]})}),a.jsx("p",{className:"text-sm font-semibold text-neutral-700 dark:text-neutral-200",children:i.label}),a.jsx("p",{className:"mt-1 text-3xl font-extrabold text-brand-600 dark:text-brand-400",children:i.value??"…"}),a.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:i.hint})]},i.key))}),t("settings.manage")&&a.jsx(pP,{})]})}const _f={name:"",sort_order:0};function xP(){const[e,t]=g.useState([]),[n,r]=g.useState(_f),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/brands").then(t);g.useEffect(()=>{u()},[]);const c=f=>{i(f.id),r({name:f.name,sort_order:f.sort_order})},d=()=>{i(null),r(_f)},h=async f=>{f.preventDefault(),o("");try{s?await M.put(`/brands/${s}`,n):await M.post("/brands",n),d(),u()}catch(b){o(b.message)}},m=async f=>{confirm("Marke inkl. aller Modelle/Pakete/Produkte wirklich löschen?")&&(await M.delete(`/brands/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Marken"}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsx(O,{to:`/marken/${f.slug}`,target:"_blank",className:"hover:text-brand-500",children:f.name})}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Marken angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.name,onChange:f=>r({...n,name:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Df={name:"",brand_id:"",sort_order:0};function bP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(Df),[l,o]=g.useState(null),[u,c]=g.useState(""),[d,h]=g.useState("all"),m=g.useMemo(()=>d==="all"?e:e.filter(p=>String(p.brand_id)===d),[e,d]),f=()=>{M.get("/models").then(t),M.get("/brands").then(r)};g.useEffect(f,[]);const b=p=>{o(p.id),i({name:p.name,brand_id:p.brand_id,sort_order:p.sort_order})},y=()=>{o(null),i(Df)},k=async p=>{p.preventDefault(),c("");const v={...s,brand_id:Number(s.brand_id)};try{l?await M.put(`/models/${l}`,v):await M.post("/models",v),y(),f()}catch(w){c(w.message)}},x=async p=>{confirm("Modell inkl. aller Pakete/Produkte wirklich löschen?")&&(await M.delete(`/models/${p}`),f())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Modelle"}),a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),a.jsxs("select",{value:d,onChange:p=>h(p.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),n.map(p=>a.jsx("option",{value:String(p.id),children:p.name},p.id))]}),d!=="all"&&a.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[m.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke"}),a.jsx("th",{className:"px-4 py-2",children:"Modell"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[m.map(p=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:p.brand_name}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.name}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>b(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>x(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),m.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Modelle angelegt.":"Keine Modelle für diese Marke."})})]})]})})]}),a.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:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Modell bearbeiten":"Neues Modell"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),a.jsxs("select",{required:!0,value:s.brand_id,onChange:p=>i({...s,brand_id:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(p=>a.jsx("option",{value:p.id,children:p.name},p.id))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Modellname *"}),a.jsx("input",{required:!0,value:s.name,onChange:p=>i({...s,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:s.sort_order,onChange:p=>i({...s,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:y,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}function pl({value:e,onChange:t,label:n="Bild"}){const[r,s]=g.useState(!1),[i,l]=g.useState(""),o=async u=>{var d;const c=(d=u.target.files)==null?void 0:d[0];if(c){s(!0),l("");try{const h=new FormData;h.append("file",c);const m=await M.post("/uploads",h);t(m.path)}catch(h){l(h.message)}finally{s(!1)}}};return a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:n}),a.jsxs("div",{className:"flex items-center gap-3",children:[e&&a.jsx("img",{src:e,alt:"",className:"h-12 w-12 rounded-md object-cover"}),a.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp",onChange:o,className:"text-sm"}),r&&a.jsx("span",{className:"text-sm text-neutral-500",children:"Lädt hoch…"})]}),i&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:i})]})}const Lf={name:"",cover_image_path:"",sort_order:0};function vP(){const[e,t]=g.useState([]),[n,r]=g.useState(Lf),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/gallery-brands").then(t);g.useEffect(()=>{u()},[]);const c=f=>{i(f.id),r({name:f.name,cover_image_path:f.cover_image_path||"",sort_order:f.sort_order})},d=()=>{i(null),r(Lf)},h=async f=>{f.preventDefault(),o("");try{s?await M.put(`/gallery-brands/${s}`,n):await M.post("/gallery-brands",n),d(),u()}catch(b){o(b.message)}},m=async f=>{confirm("Marke inkl. aller Projekte/Fotos wirklich löschen?")&&(await M.delete(`/gallery-brands/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Marken"}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Bild"}),a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:f.cover_image_path?a.jsx("img",{src:f.cover_image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):a.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:"–"})}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsx(O,{to:`/galerie/${f.slug}`,target:"_blank",className:"hover:text-brand-500",children:f.name})}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Galerie-Marken angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.name,onChange:f=>r({...n,name:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(pl,{value:n.cover_image_path,onChange:f=>r({...n,cover_image_path:f}),label:"Titelbild (optional)"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Bf={name:"",gallery_brand_id:"",cover_image_path:"",sort_order:0};function yP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(Bf),[l,o]=g.useState(null),[u,c]=g.useState(""),[d,h]=g.useState("all"),m=g.useMemo(()=>d==="all"?e:e.filter(p=>String(p.gallery_brand_id)===d),[e,d]),f=()=>{M.get("/gallery-projects").then(t),M.get("/gallery-brands").then(r)};g.useEffect(f,[]);const b=p=>{o(p.id),i({name:p.name,gallery_brand_id:p.gallery_brand_id,cover_image_path:p.cover_image_path||"",sort_order:p.sort_order})},y=()=>{o(null),i(Bf)},k=async p=>{p.preventDefault(),c("");const v={...s,gallery_brand_id:Number(s.gallery_brand_id)};try{l?await M.put(`/gallery-projects/${l}`,v):await M.post("/gallery-projects",v),y(),f()}catch(w){c(w.message)}},x=async p=>{confirm("Projekt inkl. aller Fotos wirklich löschen?")&&(await M.delete(`/gallery-projects/${p}`),f())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Projekte"}),a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),a.jsxs("select",{value:d,onChange:p=>h(p.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),n.map(p=>a.jsx("option",{value:String(p.id),children:p.name},p.id))]}),d!=="all"&&a.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[m.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke"}),a.jsx("th",{className:"px-4 py-2",children:"Projekt"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[m.map(p=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:p.brand_name}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.name}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx(O,{to:`/admin/gallery-projects/${p.id}/photos`,className:"mr-3 text-brand-600 hover:underline",children:"Fotos"}),a.jsx("button",{onClick:()=>b(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>x(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),m.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Projekte angelegt.":"Keine Projekte für diese Marke."})})]})]})})]}),a.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:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Projekt bearbeiten":"Neues Projekt"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),a.jsxs("select",{required:!0,value:s.gallery_brand_id,onChange:p=>i({...s,gallery_brand_id:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(p=>a.jsx("option",{value:p.id,children:p.name},p.id))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Projektname *"}),a.jsx("input",{required:!0,placeholder:"z. B. Audi TT",value:s.name,onChange:p=>i({...s,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(pl,{value:s.cover_image_path,onChange:p=>i({...s,cover_image_path:p}),label:"Titelbild (optional)"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:s.sort_order,onChange:p=>i({...s,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:y,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}function kP(){const{projectId:e}=$n(),[t,n]=g.useState([]),[r,s]=g.useState(""),[i,l]=g.useState(!1),[o,u]=g.useState(""),c=g.useRef(null),d=()=>M.get(`/gallery-projects/${e}/photos`).then(n);g.useEffect(()=>{d()},[e]);const h=async k=>{const x=Array.from(k.target.files||[]);if(x.length!==0){s(""),l(!0);try{for(let p=0;p{n(p=>p.map(v=>v.id===k.id?{...v,caption:x}:v))},f=(k,x)=>{n(p=>p.map(v=>v.id===k.id?{...v,sort_order:x}:v))},b=async k=>{await M.put(`/gallery-photos/${k.id}`,{caption:k.caption,sort_order:k.sort_order}),d()},y=async k=>{confirm("Foto wirklich entfernen?")&&(await M.delete(`/gallery-photos/${k}`),d())};return a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(O,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Fotos im Projekt"}),a.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),a.jsx("input",{ref:c,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:h,disabled:i,className:"text-sm"}),i&&a.jsx("p",{className:"mt-2 text-sm text-neutral-500",children:o})]}),r&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:r}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:[t.map(k=>a.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("img",{src:k.image_path,alt:k.caption||"",className:"aspect-square w-full object-cover"}),a.jsxs("div",{className:"space-y-2 p-3",children:[a.jsx("input",{value:k.caption||"",onChange:x=>m(k,x.target.value),onBlur:()=>b(k),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"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"number",value:k.sort_order,onChange:x=>f(k,Number(x.target.value)),onBlur:()=>b(k),className:"w-16 rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{onClick:()=>y(k.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]},k.id)),t.length===0&&a.jsx("p",{className:"col-span-full py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})]})}const wP=["Base","Clear","Drive","Prime","Elite","Apex","The Statement","Limitless"],jP=e=>(e+1)*10,Ba="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",qu=e=>({description:e.description||"",markup_type:e.markup_type||"none",markup_value:e.markup_value||0,icon_name:e.icon_name||"",tagline:e.tagline||"",price_text:e.price_text||"",is_featured:!!e.is_featured,sort_order:e.sort_order??0}),NP=e=>({description:"",markup_type:"none",markup_value:0,icon_name:"",tagline:"",price_text:"",is_featured:!1,sort_order:jP(e)}),SP=["description","markup_type","markup_value","icon_name","tagline","price_text","is_featured","sort_order"],go=e=>{if(!e.existing)return e.checked;const t=qu(e.existing);return SP.some(n=>n==="is_featured"?!!t[n]!=!!e.form[n]:String(t[n])!==String(e.form[n]))},ts=(e,t)=>{const n=t.filter(l=>l.car_model_id===e).slice().sort((l,o)=>l.sort_order-o.sort_order||l.name.localeCompare(o.name)),r=new Set,s=wP.map((l,o)=>{const u=n.find(c=>!r.has(c.id)&&c.name.trim().toLowerCase()===l.toLowerCase());return u&&r.add(u.id),{key:`tier-${o}`,tierName:l,existing:u||null,checked:!!u,form:u?qu(u):NP(o)}}),i=n.filter(l=>!r.has(l.id)).map(l=>({key:`legacy-${l.id}`,tierName:null,existing:l,checked:!0,form:qu(l)}));return[...s,...i]},CP=e=>{e.target.style.height="auto",e.target.style.height=`${e.target.scrollHeight}px`};function PP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(""),[l,o]=g.useState(""),[u,c]=g.useState([]),[d,h]=g.useState({}),[m,f]=g.useState(!1),[b,y]=g.useState(null),[k,x]=g.useState(""),[p,v]=g.useState(!1),[w,j]=g.useState(null),[P,C]=g.useState("all"),[N,S]=g.useState("all"),E=async()=>{const[A,W]=await Promise.all([M.get("/packages"),M.get("/models")]);return t(A),r(W),A};g.useEffect(()=>{E()},[]);const T=g.useMemo(()=>new Map(n.map(A=>[A.id,A])),[n]),I=g.useMemo(()=>{const A=new Map;return n.forEach(W=>{A.has(W.brand_id)||A.set(W.brand_id,W.brand_name)}),Array.from(A,([W,G])=>({id:W,name:G})).sort((W,G)=>W.name.localeCompare(G.name))},[n]),U=g.useMemo(()=>n.filter(A=>!s||String(A.brand_id)===s).sort((A,W)=>A.name.localeCompare(W.name)),[n,s]),Y=l?T.get(Number(l)):null,J=g.useMemo(()=>u.some(go),[u]),R=()=>!J||confirm("Ungespeicherte Änderungen verwerfen?"),X=(A,W,G=e)=>{i(String(A)),o(String(W)),c(ts(Number(W),G)),h({}),y(null),x(""),j(null)},_=A=>{R()&&(i(A),o(""),c([]),h({}),y(null),j(null))},L=A=>{if(!R())return;if(!A){o(""),c([]);return}const W=T.get(Number(A));X(W?W.brand_id:s,A)},F=(A,W)=>c(G=>G.map(Le=>Le.key===A?{...Le,checked:W}:Le)),V=(A,W)=>c(G=>G.map(Le=>Le.key===A?{...Le,form:{...Le.form,...W}}:Le)),$=A=>({name:A.tierName??A.existing.name,car_model_id:Number(l),...A.form,markup_value:Number(A.form.markup_value),sort_order:Number(A.form.sort_order)}),Je=async()=>{f(!0),y(null);const A={},W=u;let G=0,Le=0;for(const We of u)try{We.existing?go(We)&&(await M.put(`/packages/${We.existing.id}`,$(We)),Le+=1):We.checked&&(await M.post("/packages",$(We)),G+=1)}catch(Hr){A[We.key]=Hr.message}const da=await E(),kl=ts(Number(l),da).map(We=>{if(!A[We.key])return We;const Hr=W.find(Mb=>Mb.key===We.key);return Hr?{...We,checked:Hr.checked,form:Hr.form}:We});c(kl),h(A);const Wr=Object.keys(A).length,Kt=[];G&&Kt.push(`${G} neu angelegt`),Le&&Kt.push(`${Le} aktualisiert`),!Kt.length&&!Wr&&Kt.push("Keine Änderungen"),y(Wr?{kind:"error",text:`${Kt.join(", ")||"Nichts gespeichert"} – ${Wr} Paket(e) fehlgeschlagen (Details an der Zeile).`}:{kind:"ok",text:`${Kt.join(", ")}.`}),f(!1)},ut=async A=>{if(!confirm(`Paket "${A.tierName??A.existing.name}" inkl. aller Produkte wirklich löschen?`))return;await M.delete(`/packages/${A.existing.id}`);const W=await E();c(ts(Number(l),W)),y(null)},Ur=async A=>{if(!confirm("Paket inkl. aller Produkte wirklich löschen?"))return;await M.delete(`/packages/${A.id}`);const W=await E();l&&c(ts(Number(l),W))},Dt=async()=>{if(!k||!R())return;const A=T.get(Number(k)),W=T.get(Number(l));if(confirm(`Alle Pakete von "${A.brand_name} ${A.name}" inkl. verknüpfter Produkte nach "${W.brand_name} ${W.name}" kopieren?
+ `),()=>{var S;(S=o.current)==null||S.removeAttribute("data-motion-pop-id"),N.contains(C)&&N.removeChild(C)}},[t]),a.jsx(pS,{isPresent:t,childRef:o,sizeRef:u,pop:i,children:i===!1?e:g.cloneElement(e,{ref:h})})}const xS=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:l,anchorX:o,anchorY:u,root:c})=>{const d=bn(bS),h=g.useId(),m=g.useRef(n),f=g.useRef(r);ta(()=>{m.current=n,f.current=r});let b=!0,v=g.useMemo(()=>(b=!1,{id:h,initial:t,isPresent:n,custom:s,onExitComplete:k=>{d.set(k,!0);for(const x of d.values())if(!x)return;r&&r()},register:k=>(d.set(k,!1),()=>{var x;d.delete(k),!m.current&&!d.size&&((x=f.current)==null||x.call(f))})}),[n,d,r]);return i&&b&&(v={...v}),g.useMemo(()=>{d.forEach((k,x)=>d.set(x,!1))},[n]),g.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=a.jsx(gS,{pop:l==="popLayout",isPresent:n,anchorX:o,anchorY:u,root:c,children:e}),a.jsx(ul.Provider,{value:v,children:e})};function bS(){return new Map}function Ox(e=!0){const t=g.useContext(ul);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=g.useId();g.useEffect(()=>{if(e)return s(i)},[e]);const l=g.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,l]:[!0]}const Aa=e=>e.key||"";function Qm(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const yS=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:l=!1,anchorX:o="left",anchorY:u="top",root:c})=>{const[d,h]=Ox(l),m=g.useMemo(()=>Qm(e),[e]),f=l&&!d?[]:m.map(Aa),b=g.useRef(!0),v=g.useRef(m),k=bn(()=>new Map),x=g.useRef(new Set),[p,y]=g.useState(m),[w,j]=g.useState(m);ta(()=>{b.current=!1,v.current=m;for(let N=0;N{const S=Aa(N),E=l&&!d?!1:m===w||f.includes(S),T=()=>{if(x.current.has(S))return;if(k.has(S))x.current.add(S),k.set(S,!0);else return;let R=!0;k.forEach(U=>{U||(R=!1)}),R&&(C==null||C(),j(v.current),l&&(h==null||h()),r&&r())};return a.jsx(xS,{isPresent:E,initial:!b.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:E?void 0:T,anchorX:o,anchorY:u,children:N},S)})})},Ux=g.createContext({strict:!1}),Jm={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 ef=!1;function vS(){if(ef)return;const e={};for(const t in Jm)e[t]={isEnabled:n=>Jm[t].some(r=>!!n[r])};bx(e),ef=!0}function Wx(){return vS(),rN()}function kS(e){const t=Wx();for(const n in e)t[n]={...t[n],...e[n]};bx(t)}const wS=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 Fi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||wS.has(e)}let Hx=e=>!Fi(e);function jS(e){typeof e=="function"&&(Hx=t=>t.startsWith("on")?!Fi(t):e(t))}try{jS(require("@emotion/is-prop-valid").default)}catch{}function NS(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||ge(e[s])||(Hx(s)||n===!0&&Fi(s)||!t&&!Fi(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const ml=g.createContext({});function SS(e,t){if(hl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ks(n)?n:void 0,animate:Ks(r)?r:void 0}}return e.inherit!==!1?t:{}}function CS(e){const{initial:t,animate:n}=SS(e,g.useContext(ml));return g.useMemo(()=>({initial:t,animate:n}),[tf(t),tf(n)])}function tf(e){return Array.isArray(e)?e.join(" "):e}const kd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function $x(e,t,n){for(const r in t)!ge(t[r])&&!Sx(r,n)&&(e[r]=t[r])}function PS({transformTemplate:e},t){return g.useMemo(()=>{const n=kd();return yd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ES(e,t){const n=e.style||{},r={};return $x(r,n,e),Object.assign(r,PS(e,t)),r}function TS(e,t){const n={},r=ES(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 Gx=()=>({...kd(),attrs:{}});function AS(e,t,n,r){const s=g.useMemo(()=>{const i=Gx();return Cx(i,t,Ex(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};$x(i,e.style,e),s.style={...i,...s.style}}return s}const MS=["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 wd(e){return typeof e!="string"||e.includes("-")?!1:!!(MS.indexOf(e)>-1||/[A-Z]/u.test(e))}function _S(e,t,n,{latestValues:r},s,i=!1,l){const u=(l??wd(e)?AS:TS)(t,r,s,e),c=NS(t,typeof e=="string",i),d=e!==g.Fragment?{...c,...u,ref:n}:{},{children:h}=t,m=g.useMemo(()=>ge(h)?h.get():h,[h]);return g.createElement(e,{...d,children:m})}function DS({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:LS(n,r,s,e),renderState:t()}}function LS(e,t,n,r){const s={},i=r(e,{});for(const m in i)s[m]=ti(i[m]);let{initial:l,animate:o}=e;const u=hl(e),c=gx(e);t&&c&&!u&&e.inherit!==!1&&(l===void 0&&(l=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||l===!1;const h=d?o:l;if(h&&typeof h!="boolean"&&!dl(h)){const m=Array.isArray(h)?h:[h];for(let f=0;f(t,n)=>{const r=g.useContext(ml),s=g.useContext(ul),i=()=>DS(e,t,r,s);return n?i():bn(i)},BS=Kx({scrapeMotionValuesFromProps:vd,createRenderState:kd}),zS=Kx({scrapeMotionValuesFromProps:Tx,createRenderState:Gx}),RS=Symbol.for("motionComponentSymbol");function IS(e,t,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var o;i&&((o=e.onMount)==null||o.call(e,i)),t&&(i?t.mount(i):t.unmount());const l=r.current;if(typeof l=="function")if(i){const u=l(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):l(i);else l&&(l.current=i)},[t])}const qx=g.createContext({});function Yn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function FS(e,t,n,r,s,i){var y,w;const{visualElement:l}=g.useContext(ml),o=g.useContext(Ux),u=g.useContext(ul),c=g.useContext(aa),d=c.reducedMotion,h=c.skipAnimations,m=g.useRef(null),f=g.useRef(!1);r=r||o.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:i}),f.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const b=m.current,v=g.useContext(qx);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&VS(m.current,n,s,v);const k=g.useRef(!1);g.useInsertionEffect(()=>{b&&k.current&&b.update(n,u)});const x=n[nx],p=g.useRef(!!x&&typeof window<"u"&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,x))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,x)));return ta(()=>{f.current=!0,b&&(k.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),p.current&&b.animationState&&b.animationState.animateChanges())}),g.useEffect(()=>{b&&(!p.current&&b.animationState&&b.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{var j;(j=window.MotionHandoffMarkAsComplete)==null||j.call(window,x)}),p.current=!1),b.enteringChildren=void 0)}),b}function VS(e,t,n,r){const{layoutId:s,layout:i,drag:l,dragConstraints:o,layoutScroll:u,layoutRoot:c,layoutAnchor:d,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Yx(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!l||o&&Yn(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:u,layoutRoot:c,layoutAnchor:d})}function Yx(e){if(e)return e.options.allowProjection!==!1?e.projection:Yx(e.parent)}function lo(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&kS(r);const i=n?n==="svg":wd(e),l=i?zS:BS;function o(c,d){let h;const m={...g.useContext(aa),...c,layoutId:OS(c)},{isStatic:f}=m,b=CS(c),v=l(c,f);if(!f&&typeof window<"u"){US();const k=WS(m);h=k.MeasureLayout,b.visualElement=FS(e,v,m,s,k.ProjectionNode,i)}return a.jsxs(ml.Provider,{value:b,children:[h&&b.visualElement?a.jsx(h,{visualElement:b.visualElement,...m}):null,_S(e,c,IS(v,b.visualElement,d),v,f,t,i)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=g.forwardRef(o);return u[RS]=e,u}function OS({layoutId:e}){const t=g.useContext(Kc).id;return t&&e!==void 0?t+"-"+e:e}function US(e,t){g.useContext(Ux).strict}function WS(e){const t=Wx(),{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 HS(e,t){if(typeof Proxy>"u")return lo;const n=new Map,r=(i,l)=>lo(i,l,e,t),s=(i,l)=>r(i,l);return new Proxy(s,{get:(i,l)=>l==="create"?r:(n.has(l)||n.set(l,lo(l,void 0,e,t)),n.get(l))})}const $S=(e,t)=>t.isSVG??wd(e)?new vN(t):new fN(t,{allowProjection:e!==g.Fragment});class GS extends jn{constructor(t){super(t),t.animationState||(t.animationState=SN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();dl(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 KS=0;class qS extends jn{constructor(){super(...arguments),this.id=KS++,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:l,custom:o}=this.node.getProps();if(typeof l=="string"||typeof l=="object"&&l!==null&&!Array.isArray(l)){const u=Rn(this.node,l,o);if(u){const{transition:c,transitionEnd:d,...h}=u;for(const m in h)(i=this.node.getValue(m))==null||i.jump(h[m])}}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 YS={animation:{Feature:GS},exit:{Feature:qS}};function ia(e){return{point:{x:e.pageX,y:e.pageY}}}const XS=e=>t=>pd(t)&&e(t,ia(t));function ws(e,t,n,r){return qs(e,t,XS(n),r)}const Xx=({current:e})=>e?e.ownerDocument.defaultView:null,nf=(e,t)=>Math.abs(e-t);function ZS(e,t){const n=nf(e.x,t.x),r=nf(e.y,t.y);return Math.sqrt(n**2+r**2)}const rf=new Set(["auto","scroll"]);class Zx{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:l=3,element:o}={}){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=b=>{this.handleScroll(b.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ma(this.lastRawMoveEventInfo,this.transformPagePoint));const b=oo(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,k=ZS(b.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!k)return;const{point:x}=b,{timestamp:p}=xe;this.history.push({...x,timestamp:p});const{onStart:y,onMove:w}=this.handlers;v||(y&&y(this.lastMoveEvent,b),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,b)},this.handlePointerMove=(b,v)=>{this.lastMoveEvent=b,this.lastRawMoveEventInfo=v,this.lastMoveEventInfo=Ma(v,this.transformPagePoint),K.update(this.updatePoint,!0)},this.handlePointerUp=(b,v)=>{this.end();const{onEnd:k,onSessionEnd:x,resumeAnimation:p}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=oo(b.type==="pointercancel"?this.lastMoveEventInfo:Ma(v,this.transformPagePoint),this.history);this.startEvent&&k&&k(b,y),x&&x(b,y)},!pd(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=s||window;const u=ia(t),c=Ma(u,this.transformPagePoint),{point:d}=c,{timestamp:h}=xe;this.history=[{...d,timestamp:h}];const{onSessionStart:m}=n;m&&m(t,oo(c,this.history));const f={passive:!0,capture:!0};this.removeListeners=na(ws(this.contextWindow,"pointermove",this.handlePointerMove,f),ws(this.contextWindow,"pointerup",this.handlePointerUp,f),ws(this.contextWindow,"pointercancel",this.handlePointerUp,f)),o&&this.startScrollTracking(o)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(rf.has(r.overflowX)||rf.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),K.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),lt(this.updatePoint)}}function Ma(e,t){return t?{point:t(e.point)}:e}function sf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oo({point:e},t){return{point:e,delta:sf(e,Qx(t)),offset:sf(e,QS(t)),velocity:JS(t,.1)}}function QS(e){return e[0]}function Qx(e){return e[e.length-1]}function JS(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Qx(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ke(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Ke(t)*2&&(r=e[1]);const i=rt(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const l={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function e2(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Q(n,e,r.max):Math.min(e,n)),e}function af(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 t2(e,{top:t,left:n,bottom:r,right:s}){return{x:af(e.x,n,s),y:af(e.y,t,r)}}function lf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Cr(t.min,t.max-r,e.min):r>s&&(n=Cr(e.min,e.max-s,t.min)),kt(0,1,n)}function s2(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 $u=.35;function a2(e=$u){return e===!1?e=0:e===!0&&(e=$u),{x:of(e,"left","right"),y:of(e,"top","bottom")}}function of(e,t,n){return{min:uf(e,t),max:uf(e,n)}}function uf(e,t){return typeof e=="number"?e:e[t]||0}const i2=new WeakMap;class l2{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=me(),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=h=>{n&&this.snapToCursor(ia(h).point),this.stopAnimation()},l=(h,m)=>{const{drag:f,dragPropagation:b,onDragStart:v}=this.getProps();if(f&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Mj(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nt(x=>{let p=this.getAxisMotionValue(x).get()||0;if(Tt.test(p)){const{projection:y}=this.visualElement;if(y&&y.layout){const w=y.layout.layoutBox[x];w&&(p=Me(w)*(parseFloat(p)/100))}}this.originPoint[x]=p}),v&&K.update(()=>v(h,m),!1,!0),Lu(this.visualElement,"transform");const{animationState:k}=this.visualElement;k&&k.setActive("whileDrag",!0)},o=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:f,dragDirectionLock:b,onDirectionLock:v,onDrag:k}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:x}=m;if(b&&this.currentDirection===null){this.currentDirection=u2(x),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",m.point,x),this.updateAxis("y",m.point,x),this.visualElement.render(),k&&K.update(()=>k(h,m),!1,!0)},u=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Zx(t,{onSessionStart:i,onStart:l,onMove:o,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Xx(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:l}=s;this.startAnimation(l);const{onDragEnd:o}=this.getProps();o&&K.postRender(()=>o(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||!_a(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=e2(l,this.constraints[t],this.elastic[t])),i.set(l)}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&&Yn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=t2(r.layoutBox,t):this.constraints=!1,this.elastic=a2(n),s!==this.constraints&&!Yn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Nt(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=s2(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Yn(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=oN(r,s.root,this.visualElement.getTransformPagePoint());let l=n2(s.layout.layoutBox,i);if(n){const o=n(aN(l));this.hasMutatedConstraints=!!o,o&&(l=vx(o))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:l,onDragTransitionEnd:o}=this.getProps(),u=this.constraints||{},c=Nt(d=>{if(!_a(d,n,this.currentDirection))return;let h=u&&u[d]||{};(l===!0||l===d)&&(h={min:0,max:0});const m=s?200:1e6,f=s?40:1e7,b={type:"inertia",velocity:r?t[d]:0,bounceStiffness:m,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(d,b)});return Promise.all(c).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Lu(this.visualElement,t),r.start(dd(t,r,0,n,this.visualElement,!1))}stopAnimation(){Nt(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){Nt(n=>{const{drag:r}=this.getProps();if(!_a(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:o}=s.layout.layoutBox[n],u=i.get()||0;i.set(t[n]-Q(l,o,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Yn(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Nt(l=>{const o=this.getAxisMotionValue(l);if(o&&this.constraints!==!1){const u=o.get();s[l]=r2({min:u,max:u},this.constraints[l])}});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(),Nt(l=>{if(!_a(l,t,null))return;const o=this.getAxisMotionValue(l),{min:u,max:c}=this.constraints[l];o.set(Q(u,c,s[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;i2.set(this.visualElement,this);const t=this.visualElement.current,n=ws(t,"pointerdown",c=>{const{drag:d,dragListener:h=!0}=this.getProps(),m=c.target,f=m!==t&&Rj(m);d&&h&&!f&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Yn(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=o2(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,l=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),K.read(s);const o=qs(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Nt(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=c[h].translate,m.set(m.get()+c[h].translate))}),this.visualElement.render())});return()=>{o(),n(),l(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:l=$u,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:l,dragMomentum:o}}}function cf(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function o2(e,t,n){const r=Fu(e,cf(n)),s=Fu(t,cf(n));return()=>{r(),s()}}function _a(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function u2(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class c2 extends jn{constructor(t){super(t),this.removeGroupControls=Ue,this.removeListeners=Ue,this.controls=new l2(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ue}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 uo=e=>(t,n)=>{e&&K.update(()=>e(t,n),!1,!0)};class d2 extends jn{constructor(){super(...arguments),this.removePointerDownListener=Ue}onPointerDown(t){this.session=new Zx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Xx(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:uo(t),onStart:uo(n),onMove:uo(r),onEnd:(i,l)=>{delete this.session,s&&K.postRender(()=>s(i,l))}}}mount(){this.removePointerDownListener=ws(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 co=!1;class h2 extends g.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),co&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ni.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:l}=r;return l&&(l.isPresent=i,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),co=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?l.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?l.promote():l.relegate()||K.postRender(()=>{const o=l.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Er.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;co=!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 Jx(e){const[t,n]=Ox(),r=g.useContext(Kc);return a.jsx(h2,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(qx),isPresent:t,safeToRemove:n})}const m2={pan:{Feature:d2},drag:{Feature:c2,ProjectionNode:Vx,MeasureLayout:Jx}};function df(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&&K.postRender(()=>i(t,ia(t)))}class f2 extends jn{mount(){const{current:t}=this.node;t&&(this.unmount=Dj(t,(n,r)=>(df(this.node,r,"Start"),s=>df(this.node,s,"End"))))}unmount(){}}class p2 extends jn{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=na(qs(this.node.current,"focus",()=>this.onFocus()),qs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function hf(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&&K.postRender(()=>i(t,ia(t)))}class g2 extends jn{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Fj(t,(s,i)=>(hf(this.node,i,"Start"),(l,{success:o})=>hf(this.node,l,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Gu=new WeakMap,ho=new WeakMap,x2=e=>{const t=Gu.get(e.target);t&&t(e)},b2=e=>{e.forEach(x2)};function y2({root:e,...t}){const n=e||document;ho.has(n)||ho.set(n,{});const r=ho.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(b2,{root:e,...t})),r[s]}function v2(e,t,n){const r=y2(t);return Gu.set(e,n),r.observe(e),()=>{Gu.delete(e),r.unobserve(e)}}const k2={some:0,all:1};class w2 extends jn{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,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:k2[s]},o=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:h,onViewportLeave:m}=this.node.getProps(),f=d?h:m;f&&f(c)};this.stopObserver=v2(this.node.current,l,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(j2(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function j2({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const N2={inView:{Feature:w2},tap:{Feature:g2},focus:{Feature:p2},hover:{Feature:f2}},S2={layout:{ProjectionNode:Vx,MeasureLayout:Jx}},C2={...YS,...N2,...m2,...S2},Ft=HS(C2,$S);function Vi(e){return typeof window>"u"?!1:e?$g():ud()}const P2=50,mf=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),E2=()=>({time:0,x:mf(),y:mf()}),T2={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ff(e,t,n,r){const s=n[t],{length:i,position:l}=T2[t],o=s.current,u=n.time;s.current=Math.abs(e[`scroll${l}`]),s.scrollLength=e[`scroll${i}`]-e[`client${i}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=Cr(0,s.scrollLength,s.current);const c=r-u;s.velocity=c>P2?0:Zc(s.current-o,c)}function A2(e,t,n){ff(e,"x",t,n),ff(e,"y",t,n),t.time=n}function M2(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(vs(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 l=null,o=r.parentNode;for(;!l;)o.tagName==="svg"&&(l=o),o=r.parentNode;r=l}else break;return n}const Ku={start:0,center:.5,end:1};function pf(e,t,n=0){let r=0;if(e in Ku&&(e=Ku[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 _2=[0,0];function D2(e,t,n,r){let s=Array.isArray(e)?e:_2,i=0,l=0;return typeof e=="number"?s=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?s=e.split(" "):s=[e,Ku[e]?e:"0"]),i=pf(s[0],n,r),l=pf(s[1],t),i-l}const ls={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},L2={x:0,y:0};function B2(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function z2(e,t,n){const{offset:r=ls.All}=n,{target:s=e,axis:i="y"}=n,l=i==="y"?"height":"width",o=s!==e?M2(s,e):L2,u=s===e?{width:e.scrollWidth,height:e.scrollHeight}:B2(s),c={width:e.clientWidth,height:e.clientHeight};t[i].offset.length=0;let d=!t[i].interpolate;const h=r.length;for(let m=0;m{R2(e,r.target,n),A2(e,n,s),(r.offset||r.target)&&z2(e,n,r)},notify:()=>t(n)}}const qn=new WeakMap,gf=new WeakMap,mo=new WeakMap,xf=new WeakMap,Da=new WeakMap,bf=e=>e===document.scrollingElement?window:e;function eb(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return Ue;let s=mo.get(t);s||(s=new Set,mo.set(t,s));const i=E2(),l=I2(t,e,i,r);if(s.add(l),!qn.has(t)){const u=()=>{for(const m of s)m.measure(xe.timestamp);K.preUpdate(c)},c=()=>{for(const m of s)m.notify()},d=()=>K.read(u);qn.set(t,d);const h=bf(t);window.addEventListener("resize",d),t!==document.documentElement&&gf.set(t,Fu(t,d)),h.addEventListener("scroll",d),d()}if(n&&!Da.has(t)){const u=qn.get(t),c={width:t.scrollWidth,height:t.scrollHeight};xf.set(t,c);const d=()=>{const m=t.scrollWidth,f=t.scrollHeight;(c.width!==m||c.height!==f)&&(u(),c.width=m,c.height=f)},h=K.read(d,!0);Da.set(t,h)}const o=qn.get(t);return K.read(o,!1,!0),()=>{var h;lt(o);const u=mo.get(t);if(!u||(u.delete(l),u.size))return;const c=qn.get(t);qn.delete(t),c&&(bf(t).removeEventListener("scroll",c),(h=gf.get(t))==null||h(),window.removeEventListener("resize",c));const d=Da.get(t);d&&(lt(d),Da.delete(t)),xf.delete(t)}}const F2=[[ls.Enter,"entry"],[ls.Exit,"exit"],[ls.Any,"cover"],[ls.All,"contain"]],yf={start:0,end:1};function V2(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const n=yf[t[0]],r=yf[t[1]];if(!(n===void 0||r===void 0))return[n,r]}function O2(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=V2(n);if(!r)return;t.push(r)}else return;return t}function U2(e,t){const n=O2(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 jd(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of F2)if(U2(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const vf=new Map;function kf(e){const t={value:0},n=eb(r=>{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function tb({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=vf.get(t);s||(s=new Map,vf.set(t,s));const i=n.target??"self";let l=s.get(i);l||(l={},s.set(i,l));const o=r+(n.offset??[]).join(",");return l[o]||(n.target&&Vi(n.target)?jd(n.offset)?l[o]=new ViewTimeline({subject:n.target,axis:r}):l[o]=kf({container:t,...n}):Vi()?l[o]=new ScrollTimeline({source:t,axis:r}):l[o]=kf({container:t,...n})),l[o]}function W2(e,t){const n=tb(t),r=t.target?jd(t.offset):void 0,s=t.target?Vi(t.target)&&!!r:Vi();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:i=>(i.pause(),px(l=>{i.time=i.iterationDuration*l},n))})}function H2(e){return e&&(e.target||e.offset)}function $2(e){return e.length===2}function G2(e,t){return $2(e)||H2(t)?eb(n=>{e(n[t.axis].progress,n)},t):px(e,tb(t))}function nb(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return Ue;const s={axis:t,container:n,...r};return typeof e=="function"?G2(e,s):W2(e,s)}const K2=()=>({scrollX:gt(0),scrollY:gt(0),scrollXProgress:gt(0),scrollYProgress:gt(0)}),dr=e=>e?!e.current:!1;function wf(e,t,n,r){return{factory:s=>{let i;const l=()=>{if(dr(n)||dr(r)){Er.read(l);return}i=nb(s,{...t,axis:e,container:(n==null?void 0:n.current)||void 0,target:(r==null?void 0:r.current)||void 0})};return Er.read(l),()=>{cx(l),i==null||i()}},times:[0,1],keyframes:[0,1],ease:s=>s,duration:1}}function q2(e,t){return typeof window>"u"?!1:e?$g()&&!!jd(t):ud()}function rb({container:e,target:t,...n}={}){const r=bn(K2);q2(t,n.offset)&&(r.scrollXProgress.accelerate=wf("x",n,e,t),r.scrollYProgress.accelerate=wf("y",n,e,t));const s=g.useRef(null),i=g.useRef(!1),l=g.useCallback(()=>(s.current=nb((o,{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 o;(o=s.current)==null||o.call(s)}),[e,t,JSON.stringify(n.offset)]);return ta(()=>{if(i.current=!1,dr(e)||dr(t)){i.current=!0;return}else return l()},[l]),g.useEffect(()=>{if(!i.current)return;let o;const u=()=>{const c=dr(e),d=dr(t);!c&&!d&&(o=l())};return Er.read(u),()=>{cx(u),o==null||o()}},[l]),r}function sb(e){const t=bn(()=>gt(e)),{isStatic:n}=g.useContext(aa);if(n){const[,r]=g.useState(e);g.useEffect(()=>t.on("change",r),[])}return t}function ab(e,t){const n=sb(t()),r=()=>n.set(t());return r(),ta(()=>{const s=()=>K.preRender(r,!1,!0),i=e.map(l=>l.on("change",s));return()=>{i.forEach(l=>l()),lt(r)}}),n}function Y2(e){ys.current=[],e();const t=ab(ys.current,e);return ys.current=void 0,t}function Qt(e,t,n,r){if(typeof e=="function")return Y2(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!="function")return X2(e,t,n,r);const l=typeof t=="function"?t:Yj(t,n,r),o=Array.isArray(e)?jf(e,l):jf([e],([c])=>l(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&&(o.accelerate={...u,times:t,keyframes:n,isTransformed:!0}),o}function jf(e,t){const n=bn(()=>[]);return ab(e,()=>{n.length=0;const r=e.length;for(let s=0;sObject.keys(n)),i=bn(()=>({}));for(const l of s)i[l]=Qt(e,t,n[l],r);return i}function Z2(e,t={}){const{isStatic:n}=g.useContext(aa),r=()=>ge(e)?e.get():e;if(n)return Qt(r);const s=sb(r());return g.useInsertionEffect(()=>Xj(s,e,t),[s,JSON.stringify(t)]),s}function Q2(e,t={}){return Z2(e,{type:"spring",...t})}function J2(){const{scrollYProgress:e}=rb(),t=Q2(e,{stiffness:200,damping:30,restDelta:.001});return a.jsx(Ft.div,{style:{scaleX:t},className:"fixed left-0 top-0 z-40 h-0.5 w-full origin-left bg-brand-500"})}const eC=()=>a.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:a.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 la({message:e,fullScreen:t=!1}){const{t:n}=Ne(),r=a.jsxs("div",{className:"mx-auto max-w-md text-center",children:[a.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:a.jsx(eC,{})}),a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:n("maintenance.title")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:e||n("maintenance.defaultMessage")})]});return t?a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950",children:r}):a.jsx("div",{className:"mx-auto max-w-6xl px-4 py-20 sm:px-6",children:r})}const Nf=a.jsx(a.Fragment,{children:'Wartungsmodus aktiv – Besucher sehen aktuell eine Wartungsmeldung. Du siehst diese Seite nur, weil du die Berechtigung "Wartungsmodus umgehen" hast.'});function oa({inline:e=!1}){return e?a.jsx("div",{className:"mb-8 rounded-lg bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:Nf}):a.jsx("div",{className:"bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:Nf})}function tC({onClose:e}){const{consent:t,saveCustom:n}=Ir(),[r,s]=g.useState(t.external),[i,l]=g.useState(t.analytics),{t:o}=Ne();return a.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:e,children:a.jsxs("div",{className:"w-full max-w-md rounded-xl bg-white p-6 dark:bg-neutral-900",onClick:u=>u.stopPropagation(),children:[a.jsx("h2",{className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:o("cookieConsent.modalTitle")}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:[o("cookieConsent.modalIntro")," ",a.jsx(O,{to:"/datenschutz",className:"underline hover:text-brand-500",onClick:e,children:o("cookieConsent.privacyPolicy")}),"."]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.necessaryTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.necessaryDesc")})]}),a.jsx("input",{type:"checkbox",checked:!0,disabled:!0,className:"mt-1 h-4 w-4 shrink-0"})]}),a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.externalTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.externalDesc")})]}),a.jsx("input",{type:"checkbox",checked:r,onChange:u=>s(u.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]}),a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.analyticsTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.analyticsDesc")})]}),a.jsx("input",{type:"checkbox",checked:i,onChange:u=>l(u.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]})]}),a.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[a.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:o("cookieConsent.cancel")}),a.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:o("cookieConsent.saveSelection")})]})]})})}function nC(){const{decided:e,settingsOpen:t,acceptAll:n,rejectNonEssential:r,openSettings:s,closeSettings:i}=Ir(),{t:l}=Ne();return a.jsxs(a.Fragment,{children:[!e&&a.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:a.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[l("cookieConsent.bannerText")," ",l("cookieConsent.moreInfo")," ",a.jsx(O,{to:"/datenschutz",className:"underline hover:text-brand-500",children:l("cookieConsent.privacyPolicy")}),"."]}),a.jsxs("div",{className:"flex flex-wrap gap-2 sm:shrink-0",children:[a.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:l("cookieConsent.settings")}),a.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:l("cookieConsent.onlyNecessary")}),a.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:l("cookieConsent.acceptAll")})]})]})}),t&&a.jsx(tC,{onClose:i})]})}function rC(){const{consent:e}=Ir(),{ga_measurement_id:t}=Rr(),n=g.useRef(!1);return g.useEffect(()=>{if(!t||!e.analytics||n.current)return;n.current=!0;const r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,r.async=!0,document.head.appendChild(r),window.dataLayer=window.dataLayer||[];function s(...i){window.dataLayer.push(i)}window.gtag=s,s("js",new Date),s("config",t,{anonymize_ip:!0})},[t,e.analytics]),null}const ib=g.createContext({global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null},bypass:!1}),sC=ib.Provider;function fl(){return g.useContext(ib)}const aC={global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null}},iC={phone:"09373 20 62 390",whatsapp:null,contact_email:"info@hifi-planet-amorbach.de",hero_image_path:null,ga_measurement_id:null,package_card_theme:"graphite",package_card_layout:"strip"},lC=["/impressum","/datenschutz","/agb"];function oC(){const[e,t]=g.useState(null),[n,r]=g.useState(iC),{loading:s,hasPermission:i}=Mt(),l=ot();if(g.useEffect(()=>{M.get("/maintenance").then(t).catch(()=>t(aC)),M.get("/site-settings").then(r).catch(()=>{})},[]),e===null||s)return a.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});const o=i("maintenance.bypass"),u=lC.includes(l.pathname);return e.global.enabled&&!o&&!u?a.jsx(Gh,{children:a.jsx(la,{message:e.global.message,fullScreen:!0})}):a.jsx(Gh,{children:a.jsx(sC,{value:{...e,bypass:o},children:a.jsx(xw,{value:n,children:a.jsxs("div",{className:"page-texture flex min-h-screen flex-col text-neutral-900 dark:text-neutral-100",children:[o&&e.global.enabled&&a.jsx(oa,{}),a.jsx(J2,{}),a.jsx(jw,{}),a.jsx("main",{className:"flex-1",children:a.jsx(ol,{})}),a.jsx(Tw,{}),a.jsx(nC,{}),a.jsx(rC,{})]})})})})}const uC={home:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9",tag:"M4 4h7l9 9-7 7-9-9V4Zm3.5 3.5h.01",car:"M3 13.5 4.5 9A2 2 0 0 1 6.4 7.5h11.2A2 2 0 0 1 19.5 9L21 13.5M3 13.5v4a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1h12v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-4M3 13.5h18M6.5 16.5h.01M17.5 16.5h.01",box:"M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Zm0 9 8-4.5M12 12v9M12 12 4 7.5",mail:"M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm0 0 8 7 8-7",users:"M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-4 6c-4 0-7 2-7 4.5V19h14v-1.5C19 15 16 13 12 13Z",shield:"M12 3 4 6v6c0 4.5 3.4 7.7 8 9 4.6-1.3 8-4.5 8-9V6l-8-3Zm-1.5 9.5 4-4 1 1-5 5-2.5-2.5 1-1 1.5 1.5Z",lock:"M6 10V8a6 6 0 1 1 12 0v2m-13 0h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1Zm7 5v2",briefcase:"M4 7h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm4 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12h18",sliders:"M4 6h16M4 6a2 2 0 1 0 4 0 2 2 0 0 0-4 0Zm16 6H4m10 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0ZM4 18h16m-12 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0Z",image:"M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Zm2 12 4.5-5.5L14 16l2.5-3L20 17H6ZM8 9.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-5.5v.01M9.5 9.25a2.5 2.5 0 1 1 3.5 2.29c-.7.32-1 .77-1 1.46v.3"},cC=({path:e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"h-5 w-5 shrink-0",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})});function dC(){const{logout:e,user:t,hasPermission:n}=Mt(),r=ea(),[s,i]=g.useState(!1),[l,o]=g.useState(0);g.useEffect(()=>{n("contact.manage")&&M.get("/contact").then(m=>o(m.filter(f=>f.status==="new").length)).catch(()=>{})},[]);const u=[{title:null,links:[{to:"/admin",label:"Dashboard",icon:"home",end:!0},{to:"/admin/account",label:"Mein Konto",icon:"lock"}]},{title:"Fahrzeug-Katalog",links:[{to:"/admin/brands",label:"Marken",icon:"tag",permission:"brands.manage"},{to:"/admin/models",label:"Modelle",icon:"car",permission:"models.manage"},{to:"/admin/packages",label:"Pakete",icon:"box",permission:"packages.manage"}]},{title:"Website",links:[{to:"/admin/services",label:"Leistungen",icon:"briefcase",permission:"services.manage"},{to:"/admin/faqs",label:"FAQ",icon:"help",permission:"content.manage"}]},{title:"Bildergalerie",links:[{to:"/admin/gallery-brands",label:"Marken",icon:"tag",permission:"gallery.manage"},{to:"/admin/gallery-projects",label:"Projekte",icon:"image",permission:"gallery.manage"}]},{title:"Kunden",links:[{to:"/admin/contact-requests",label:"Kontaktanfragen",icon:"mail",permission:"contact.manage",badge:l}]},{title:"Verwaltung",links:[{to:"/admin/users",label:"Benutzer",icon:"users",permission:"users.manage"},{to:"/admin/permission-groups",label:"Berechtigungsgruppen",icon:"shield",permission:"permission_groups.manage"},{to:"/admin/settings",label:"Einstellungen",icon:"sliders",permission:"settings.manage"}]}].map(m=>({...m,links:m.links.filter(f=>!f.permission||n(f.permission))})).filter(m=>m.links.length>0),c=async()=>{await e(),r("/admin/login")},d=({isActive:m})=>`flex items-center justify-between gap-2 rounded-md px-3 py-2 text-sm font-medium transition ${m?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,h=({onNavigate:m})=>a.jsx("nav",{className:"space-y-5",children:u.map((f,b)=>a.jsxs("div",{children:[f.title&&a.jsx("p",{className:"mb-1.5 px-3 text-xs font-semibold uppercase tracking-wide text-neutral-400 dark:text-neutral-500",children:f.title}),a.jsx("div",{className:"space-y-1",children:f.links.map(v=>a.jsxs(ig,{to:v.to,end:v.end,className:d,onClick:m,children:[a.jsxs("span",{className:"flex items-center gap-2.5",children:[a.jsx(cC,{path:uC[v.icon]}),v.label]}),!!v.badge&&a.jsx("span",{className:"rounded-full bg-red-500 px-2 py-0.5 text-xs font-bold text-white",children:v.badge})]},v.to))})]},b))});return a.jsxs("div",{className:"flex min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[a.jsxs("aside",{className:"hidden w-60 shrink-0 border-r border-neutral-200 p-4 dark:border-neutral-800 sm:block",children:[a.jsxs("div",{className:"mb-6 flex items-center gap-2 px-3",children:[a.jsxs("span",{className:"rounded-lg px-2 py-1",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-7 w-auto dark:hidden"}),a.jsx("img",{src:Ai,alt:"HifiPlanet",className:"hidden h-7 w-auto dark:block"})]}),a.jsx("span",{className:"text-sm font-semibold text-neutral-500 dark:text-neutral-400",children:"Admin"})]}),a.jsx(h,{})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("header",{className:"border-b border-neutral-200 dark:border-neutral-800",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 sm:px-6",children:[a.jsxs("div",{className:"flex items-center gap-2 sm:hidden",children:[a.jsx("button",{onClick:()=>i(m=>!m),"aria-label":"Menü öffnen",className:"rounded-md p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800",children:a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),a.jsxs("span",{className:"rounded-lg px-1.5 py-0.5",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-6 w-auto dark:hidden"}),a.jsx("img",{src:Ai,alt:"HifiPlanet",className:"hidden h-6 w-auto dark:block"})]})]}),a.jsxs("p",{className:"hidden text-sm text-neutral-500 dark:text-neutral-400 sm:block",children:["Angemeldet als ",t==null?void 0:t.username,t!=null&&t.is_super_admin?" · Super-Admin":""]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(cg,{}),a.jsx("button",{onClick:c,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:"Abmelden"})]})]}),s&&a.jsx("div",{className:"border-t border-neutral-200 px-4 py-3 dark:border-neutral-800 sm:hidden",children:a.jsx(h,{onNavigate:()=>i(!1)})})]}),a.jsx("main",{className:"p-4 sm:p-6",children:a.jsx(ol,{})})]})]})}function hC(){const{user:e,loading:t}=Mt();return t?a.jsx("div",{className:"flex min-h-screen items-center justify-center text-neutral-500",children:"Lädt…"}):e?a.jsx(ol,{}):a.jsx(Ws,{to:"/admin/login",replace:!0})}function Be({permission:e,children:t}){const{hasPermission:n}=Mt();return(Array.isArray(e)?e:[e]).some(i=>n(i))?t:a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-8 text-center dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h1",{className:"mb-2 text-lg font-bold text-neutral-900 dark:text-white",children:"Keine Berechtigung"}),a.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 fo(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 mC(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}`)}function Ze({title:e,description:t,path:n}){g.useEffect(()=>{e&&(document.title=`${e} | HifiPlanet`,fo("og:title",`${e} | HifiPlanet`,"property")),t&&(fo("description",t),fo("og:description",t,"property")),n&&mC(n)},[e,t,n])}const fC=[.16,1,.3,1],Sf={up:{y:40},left:{x:-56},right:{x:56}};function pC(e){return{hidden:{opacity:0,scale:.96,filter:"blur(8px)",...Sf[e]||Sf.up},visible:{opacity:1,scale:1,x:0,y:0,filter:"blur(0px)"}}}const gC={hidden:{x:"-130%"},visible:{x:"230%",transition:{duration:1.1,ease:"easeInOut",delay:.4}}};function ve({children:e,direction:t="up",className:n="",index:r=0,shine:s=!1}){const i=Math.min(r*.09,.45);return a.jsxs(Ft.div,{className:n,style:{position:"relative",overflow:"hidden"},initial:"hidden",whileInView:"visible",viewport:{once:!0,amount:.25,margin:"-100px"},variants:pC(t),transition:{duration:.75,ease:fC,delay:i},children:[e,s&&a.jsx(Ft.div,{"aria-hidden":!0,variants:gC,className:"pointer-events-none absolute inset-y-0 -left-1/3 w-1/3 rotate-12 bg-gradient-to-r from-transparent via-white/40 to-transparent"})]})}function xC({items:e}){const[t,n]=g.useState(null);return a.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((r,s)=>{const i=t===s;return a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>n(i?null:s),className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left","aria-expanded":i,children:[a.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:r.question}),a.jsx(Ft.svg,{animate:{rotate:i?180:0},transition:{duration:.2},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0 text-neutral-500",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6 9 6 6 6-6"})})]}),a.jsx(yS,{initial:!1,children:i&&a.jsx(Ft.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:a.jsx("p",{className:"px-5 pb-4 text-sm text-neutral-600 dark:text-neutral-300",children:r.answer})})})]},r.question)})})}function lb({count:e=5,className:t="h-4 w-4"}){return a.jsx("div",{className:"flex gap-0.5 text-amber-400",children:Array.from({length:e}).map((n,r)=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:t,children:a.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 bC=70;function yC({testimonials:e}){const t=g.useRef(null),n=g.useRef(null),r=g.useRef({pos:0,half:0,hovering:!1,dragging:!1,dragStartX:0,dragStartPos:0,lastTime:null,rafId:null}).current;g.useLayoutEffect(()=>{const i=n.current,l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,o=()=>{i.style.transform=`translateX(${r.pos}px)`},u=p=>{if(r.half<=0)return p;for(;p>0;)p-=r.half;for(;p<=-r.half;)p+=r.half;return p},c=()=>{r.half=i.scrollWidth/2,r.pos===0?r.pos=-r.half:r.pos=u(r.pos),o()};c();const d=new ResizeObserver(c);d.observe(i);const h=p=>{r.lastTime===null&&(r.lastTime=p);const y=(p-r.lastTime)/1e3;r.lastTime=p,!r.dragging&&!r.hovering&&!l&&(r.pos=u(r.pos+bC*y),o()),r.rafId=requestAnimationFrame(h)};r.rafId=requestAnimationFrame(h);const m=t.current,f=()=>{r.hovering=!0},b=()=>{r.hovering=!1},v=p=>{r.dragging=!0,r.dragStartX=p.clientX,r.dragStartPos=r.pos,m.setPointerCapture(p.pointerId),m.classList.add("cursor-grabbing"),m.classList.remove("cursor-grab")},k=p=>{r.dragging&&(r.pos=u(r.dragStartPos+(p.clientX-r.dragStartX)),o())},x=p=>{r.dragging&&(r.dragging=!1,m.hasPointerCapture(p.pointerId)&&m.releasePointerCapture(p.pointerId),m.classList.remove("cursor-grabbing"),m.classList.add("cursor-grab"))};return m.addEventListener("pointerenter",f),m.addEventListener("pointerleave",b),m.addEventListener("pointerdown",v),m.addEventListener("pointermove",k),m.addEventListener("pointerup",x),m.addEventListener("pointercancel",x),()=>{cancelAnimationFrame(r.rafId),d.disconnect(),m.removeEventListener("pointerenter",f),m.removeEventListener("pointerleave",b),m.removeEventListener("pointerdown",v),m.removeEventListener("pointermove",k),m.removeEventListener("pointerup",x),m.removeEventListener("pointercancel",x)}},[e.length]);const s=[...e,...e];return a.jsx("div",{ref:t,className:"marquee-viewport cursor-grab touch-pan-y select-none overflow-hidden",children:a.jsx("div",{ref:n,className:"marquee-track flex w-max gap-5",children:s.map((i,l)=>a.jsx("div",{className:"w-64 shrink-0 sm:w-72 lg:w-80",children:a.jsxs("div",{className:"flex h-full flex-col rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx(lb,{className:"mb-3 h-4 w-4"}),a.jsxs("p",{className:"mb-4 flex-1 text-sm text-neutral-600 dark:text-neutral-300",children:["„",i.text,'"']}),a.jsx("p",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:i.name})]})},`${i.name}-${l}`))})})}const vC="/assets/gallery-dash2-CEVCErVK.webp",ob="/assets/gallery-amp-purple-CESAKuOf.webp",kC="/assets/gallery-speaker-CUXQZ49Q.webp",ub="/assets/gallery-subs-COSd4seJ.webp",cb="/assets/gallery-dash-Cg-7v9qo.webp",wC="/assets/hero-trunk-Dp4_JHDh.webp",jC="/assets/gallery-rear-8cIXPC7T.webp",NC="/assets/hero-highlight-Co4f1Kj5.webp",SC="/assets/youtube-hintergrund-C0osNxn7.mp4",CC="ostj2mKDVUc",PC=["Ground Zero Audio","Audison","Hertz","Helix","Brax","Gladen","Alpine","Pioneer","Kenwood","JVC"],EC=[{src:ub,width:900,height:600},{src:ob,width:900,height:600},{src:kC,width:900,height:1200},{src:cb,width:900,height:814},{src:jC,width:900,height:1200},{src:wC,width:1920,height:1280}];function TC(){const{hero_image_path:e}=Rr(),t=e||vC,{t:n,language:r}=Ne(),s=n("home.stats"),i=n("home.galleryAlts"),l=EC.map((p,y)=>({...p,alt:i[y]})),o=n("home.testimonials"),[u,c]=g.useState([]);g.useEffect(()=>{M.get("/faqs").then(p=>{c(p.map(y=>({question:r==="de"?y.question_de:y.question_en,answer:r==="de"?y.answer_de:y.answer_en})))}).catch(()=>{})},[r]),Ze({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),g.useEffect(()=>{if(u.length===0)return;const p=document.createElement("script");return p.type="application/ld+json",p.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:u.map(y=>({"@type":"Question",name:y.question,acceptedAnswer:{"@type":"Answer",text:y.answer}}))}),document.head.appendChild(p),()=>document.head.removeChild(p)},[u]);const d=g.useRef(null),{scrollYProgress:h}=rb({target:d,offset:["start start","end start"]}),m=Qt(h,[0,1],["-6%","6%"]),f=Qt(h,[0,1],["0%","60%"]),b=Qt(h,[0,.8],[1,0]),v=Qt(h,[.5,1],[0,1]),k=Qt(v,p=>p>.05?"auto":"none"),x=Qt(h,[.5,1],[16,0]);return a.jsxs("div",{children:[a.jsx(Ft.div,{style:{opacity:v,pointerEvents:k,y:x},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:a.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[a.jsx("p",{className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block",children:n("home.stickyCta")}),a.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[a.jsx(O,{to:"/fahrzeuge",className:"flex-1 rounded-md bg-brand-500 px-5 py-2.5 text-center text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 sm:flex-none",children:n("home.selectVehicle")}),a.jsx(O,{to:"/kontakt",className:"flex-1 rounded-md border border-neutral-300 px-5 py-2.5 text-center text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800 sm:flex-none",children:n("home.getInTouch")})]})]})}),a.jsxs("section",{ref:d,className:"relative -mt-[89px] h-dvh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[a.jsx(Ft.img,{style:{y:m,scale:1.15},src:t,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),a.jsx(Ft.div,{style:{y:f,opacity:b},className:"relative flex h-full max-w-6xl flex-col items-center justify-center px-4 mx-auto text-center sm:px-6",children:a.jsxs(Ft.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[a.jsx("p",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",children:n("home.welcome")}),a.jsx("h1",{className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",children:n("home.heroTitle")}),a.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg",children:n("home.heroSubtitle")}),a.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[a.jsx(O,{to:"/fahrzeuge",className:"rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 hover:shadow-lg",children:n("home.selectVehicle")}),a.jsx(O,{to:"/kontakt",className:"rounded-md border border-white/30 bg-white/10 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:-translate-y-0.5 hover:bg-white/20",children:n("home.getInTouch")})]})]})})]}),a.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:a.jsx("div",{className:"mx-auto grid max-w-6xl grid-cols-2 gap-6 px-4 text-center sm:grid-cols-4 sm:px-6",children:s.map((p,y)=>a.jsxs(ve,{index:y,children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:p.value}),a.jsx("p",{className:"text-sm text-neutral-400",children:p.label})]},p.label))})}),a.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:a.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[a.jsx("p",{className:"mb-4 text-center text-xs font-semibold uppercase tracking-wide text-neutral-400",children:n("home.brandsHeading")}),a.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:PC.map((p,y)=>a.jsx(ve,{index:y,className:"text-lg font-bold text-neutral-400 dark:text-neutral-600",children:p},p))})]})}),a.jsxs("section",{className:"relative flex min-h-[70vh] items-center justify-center overflow-hidden sm:min-h-[85vh]",children:[a.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,poster:cb,className:"absolute inset-0 h-full w-full object-cover",children:a.jsx("source",{src:SC,type:"video/mp4"})}),a.jsx("div",{className:"absolute inset-0 bg-black/55"}),a.jsxs(ve,{className:"relative mx-auto max-w-3xl px-4 text-center sm:px-6",children:[a.jsx("p",{className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",children:n("home.youtubeBadge")}),a.jsx("h2",{className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",children:n("home.youtubeTitle")}),a.jsx("p",{className:"mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm",children:n("home.youtubeText")}),a.jsx("a",{href:`https://www.youtube.com/watch?v=${CC}`,target:"_blank",rel:"noopener noreferrer",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",children:n("home.youtubeCta")})]})]}),a.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:a.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[a.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[a.jsx(ve,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:a.jsx("img",{src:ub,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})}),a.jsxs(ve,{direction:"right",index:1,children:[a.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:n("home.craftEyebrow")}),a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.craftTitle")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:n("home.craftText")})]})]}),a.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[a.jsxs(ve,{direction:"left",className:"order-2 md:order-1",children:[a.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:n("home.adviceEyebrow")}),a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.adviceTitle")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:n("home.adviceText")})]}),a.jsx(ve,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:a.jsx("img",{src:ob,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})]})]})}),a.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[a.jsxs(ve,{className:"mb-8 text-center",children:[a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.insightsTitle")}),a.jsx("p",{className:"mt-2 text-neutral-600 dark:text-neutral-300",children:n("home.insightsText")})]}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:l.map((p,y)=>a.jsx(ve,{index:y%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsx("img",{src:p.src,alt:p.alt,width:p.width,height:p.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})},p.src))})]}),a.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:a.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[a.jsxs(ve,{className:"mb-10 text-center",children:[a.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:a.jsx(lb,{className:"h-6 w-6"})}),a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.reviewsRating")}),a.jsx("p",{className:"mt-1 text-neutral-600 dark:text-neutral-300",children:n("home.reviewsText")}),a.jsx("a",{href:"https://www.google.com/maps/search/?api=1&query=Hifi+Planet+Amorbach+Boxbrunner+Stra%C3%9Fe+20a",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-block text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:n("home.reviewsLink")})]}),a.jsx(ve,{children:a.jsx(yC,{testimonials:o})})]})}),a.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:a.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[a.jsx(ve,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:a.jsx("img",{src:NC,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})}),a.jsxs(ve,{direction:"right",index:1,className:"rounded-xl border border-neutral-200 bg-white p-8 text-center shadow-sm dark:border-neutral-800 dark:bg-neutral-900 md:text-left",children:[a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.moreTitle")}),a.jsx("p",{className:"mx-auto mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 md:mx-0",children:n("home.moreText")}),a.jsx(O,{to:"/leistungen",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",children:n("home.moreCta")})]})]})}),a.jsx("section",{className:"border-t border-neutral-300 py-16 dark:border-neutral-700",children:a.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[a.jsx(ve,{className:"mb-8 text-center",children:a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.faqHeading")})}),a.jsx(ve,{index:1,children:a.jsx(xC,{items:u})})]})})]})}function AC(){const[e,t]=g.useState([]),[n,r]=g.useState(""),s=fl(),{t:i}=Ne();return Ze({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),g.useEffect(()=>{s.vehicles.enabled&&!s.bypass||M.get("/brands").then(t).catch(l=>r(l.message))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?a.jsx(la,{message:s.vehicles.message}):a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[s.vehicles.enabled&&s.bypass&&a.jsx(oa,{inline:!0}),a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:i("vehicleSelect.title")}),a.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:i("vehicleSelect.intro")}),n&&a.jsx("p",{className:"text-red-600",children:n}),e.length===0&&!n&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:e.map(l=>a.jsx(O,{to:`/fahrzeuge/${l.slug}`,className:"flex items-center justify-center rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:l.name},l.id))})]})}function MC(){const{brandSlug:e}=$n(),[t,n]=g.useState(null),[r,s]=g.useState(""),i=fl(),{t:l}=Ne();return g.useEffect(()=>{i.vehicles.enabled&&!i.bypass||M.get(`/brands/${e}/models`).then(n).catch(o=>s(o.message))},[e,i.vehicles.enabled,i.bypass]),Ze({title:t?`${t.brand.name} ${l("brandPage.titleSuffix")}`:l("brandPage.metaTitleFallback"),description:t?l("brandPage.metaDescription")(t.brand.name):void 0,path:`/fahrzeuge/${e}`}),i.vehicles.enabled&&!i.bypass?a.jsx(la,{message:i.vehicles.message}):r?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&a.jsx(oa,{inline:!0}),a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(O,{to:"/fahrzeuge",className:"hover:text-brand-500",children:l("brandPage.breadcrumbVehicles")})," / ",t.brand.name]}),a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",l("brandPage.titleSuffix")]}),t.models.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:l("brandPage.empty")}),a.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:t.models.map(o=>a.jsx(O,{to:`/fahrzeuge/${e}/${o.slug}`,className:"flex items-center justify-center rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:o.name},o.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:l("brandPage.loading")})}const Cf="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==",_C="/assets/base-BKOm0Bib.webp",DC="/assets/clear-DZZMSrMX.webp",LC="/assets/drive-BE2W1yna.webp",BC="/assets/prime-BTVNe2Gb.webp",zC="/assets/elite_r-BRvz_pyr.webp",RC="/assets/apex-CFy2qup8.webp",IC="/assets/statement-pTO-wTPx.webp",FC="/assets/limitless-DDs0S_PU.webp",VC=(e,t,n)=>{t/=100,n/=100;const r=l=>(l+e/30)%12,s=t*Math.min(n,1-n),i=l=>n-s*Math.max(-1,Math.min(r(l)-3,Math.min(9-r(l),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},po=(e,t,n)=>`rgb(${VC(e,t,n).join(", ")})`,Pf=e=>e.map(([t,n,r,s,i,l])=>({bgTop:po(t,n,r),border:po(t,n,r+8),accent:po(s,i,l),img:null})),Ef={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:_C},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:DC},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:LC},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:BC},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:zC},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:RC},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:IC},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:FC}],"deep-blue":Pf([[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":Pf([[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]])},OC="#f2f2f2",UC="#8a8a8a",WC="#c4c4c4",Tf=5;function HC({pkg:e,tier:t,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:l,t:o}){const[u,c]=g.useState(!1),d=s.length-Tf,h=u?s:s.slice(0,Tf),m=t.img?null:{backgroundColor:t.accent,WebkitMaskImage:`url(${Cf})`,maskImage:`url(${Cf})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return a.jsxs("div",{style:{borderColor:t.border,background:`linear-gradient(180deg, ${t.bgTop} 0%, #0b0b0b 55%, #080808 100%)`},className:r==="strip"?"relative flex min-h-[640px] grow shrink basis-[190px] min-w-[190px] max-w-[240px] snap-start flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40 sm:basis-[210px]":r==="coverflow"?"relative flex min-h-[640px] w-[230px] shrink-0 snap-center flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40":"relative flex min-h-[640px] flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40",children:[t.img?a.jsx("img",{src:t.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...m,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),a.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...m,opacity:.55+n*.45},"aria-hidden":"true"})]}),e.is_featured&&a.jsx("span",{className:"absolute top-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-brand-500 px-3 py-1 text-xs font-bold text-white shadow",children:o("modelPage.featuredBadge")}),a.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0"},children:[a.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:t.accent,textTransform:"uppercase",lineHeight:1.1},children:e.name}),a.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&&a.jsxs("div",{className:"relative z-10",style:{padding:"18px 20px 14px",background:u?"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:[a.jsx("ul",{className:"space-y-1.5 text-left",children:h.map((f,b)=>a.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:WC},children:[a.jsx(Ie,{name:"check",className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:t.accent}}),a.jsx("span",{className:"leading-snug",children:f})]},b))}),d>0&&a.jsxs("button",{type:"button",onClick:()=>c(f=>!f),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:t.accent},children:[u?o("modelPage.lessBullets"):o("modelPage.moreBullets")(d),a.jsx(Ie,{name:u?"chevron-up":"chevron-down",className:"h-3.5 w-3.5"})]})]}),a.jsx("div",{className:"relative z-10 flex-1"}),a.jsx("div",{className:"relative z-10",style:{padding:"20px 20px 28px",background:"linear-gradient(180deg, rgba(8,8,8,0) 0%, rgba(8,8,8,0.85) 45%, rgba(8,8,8,0.95) 100%)"},children:a.jsxs("div",{className:"text-center",children:[!e.price_text&&a.jsx("div",{style:{fontSize:"13px",color:UC},children:o("modelPage.totalPrice")}),a.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:OC},children:e.price_text||i(e.total_price)}),a.jsx(O,{to:l(e),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:o("modelPage.requestContact")})]})})]})}function $C(){const{brandSlug:e,modelSlug:t}=$n(),[n,r]=g.useState(null),[s,i]=g.useState(""),l=fl(),{t:o,language:u}=Ne(),{package_card_theme:c,package_card_layout:d}=Rr(),h=Ef[c]||Ef.graphite,m=["grid","strip","coverflow"].includes(d)?d:"strip",f=g.useRef(null),b=g.useRef(null),v=g.useRef(null),k=g.useRef(!1),x=N=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(N);if(g.useEffect(()=>{l.vehicles.enabled&&!l.bypass||M.get(`/models/${e}/${t}/packages`).then(r).catch(N=>i(N.message))},[e,t,l.vehicles.enabled,l.bypass]),g.useEffect(()=>{const N=f.current;if(m!=="coverflow"||!N)return;let S=0;const E=()=>{S=0;const U=N.scrollLeft+N.clientWidth/2;for(const Y of N.children){const J=Y.offsetLeft+Y.offsetWidth/2,I=Math.max(-1,Math.min(1,(J-U)/(Y.offsetWidth*1.4))),X=Math.abs(I);Y.style.transform=`rotateY(${(-I*35).toFixed(2)}deg) scale(${(1-X*.13).toFixed(3)}) translateZ(${(-X*60).toFixed(1)}px)`,Y.style.zIndex=String(100-Math.round(X*50))}},T=()=>{S||(S=requestAnimationFrame(E))};E(),N.addEventListener("scroll",T,{passive:!0});const R=new ResizeObserver(T);return R.observe(N),()=>{N.removeEventListener("scroll",T),R.disconnect(),cancelAnimationFrame(S)}},[m,n]),g.useEffect(()=>{const N=f.current;if(m==="grid"||!N||k.current)return;const S=window.matchMedia("(pointer: coarse)").matches,E=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(!S||E)return;k.current=!0;const T=Math.min(N.clientWidth*.4,160),R=setTimeout(()=>N.scrollTo({left:T,behavior:"smooth"}),500),U=setTimeout(()=>N.scrollTo({left:0,behavior:"smooth"}),1250);return()=>{clearTimeout(R),clearTimeout(U)}},[m,n]),g.useEffect(()=>{const N=f.current,S=b.current,E=v.current;if(m==="grid"||!N||!S||!E)return;let T=0;const R=()=>{T=0;const V=N.scrollWidth-N.clientWidth;if(V<=1){S.style.opacity="0",S.style.pointerEvents="none";return}S.style.opacity="1",S.style.pointerEvents="auto";const $=S.clientWidth,Je=Math.max(32,N.clientWidth/N.scrollWidth*$);E.style.width=`${Je}px`,E.style.transform=`translateX(${(N.scrollLeft/V*($-Je)).toFixed(1)}px)`},U=()=>{T||(T=requestAnimationFrame(R))};R(),N.addEventListener("scroll",U,{passive:!0});const Y=new ResizeObserver(U);Y.observe(N);let J=!1,I=0;const X=V=>{const $=S.getBoundingClientRect(),Je=E.clientWidth,ut=Math.min(Math.max(V-$.left-I,0),$.width-Je);N.scrollLeft=ut/($.width-Je)*(N.scrollWidth-N.clientWidth)},_=V=>{J=!0,S.setPointerCapture(V.pointerId),N.style.scrollSnapType="none";const $=E.getBoundingClientRect();I=V.clientX>=$.left&&V.clientX<=$.right?V.clientX-$.left:E.clientWidth/2,V.clientX>=$.left&&V.clientX<=$.right||X(V.clientX)},L=V=>{J&&X(V.clientX)},F=V=>{var $;J&&(J=!1,($=S.hasPointerCapture)!=null&&$.call(S,V.pointerId)&&S.releasePointerCapture(V.pointerId),N.style.scrollSnapType="")};return S.addEventListener("pointerdown",_),S.addEventListener("pointermove",L),S.addEventListener("pointerup",F),S.addEventListener("pointercancel",F),()=>{N.removeEventListener("scroll",U),Y.disconnect(),cancelAnimationFrame(T),S.removeEventListener("pointerdown",_),S.removeEventListener("pointermove",L),S.removeEventListener("pointerup",F),S.removeEventListener("pointercancel",F)}},[m,n]),Ze({title:n?o("modelPage.metaTitle")(n.model.brand_name,n.model.name):o("modelPage.metaTitleFallback"),description:n?o("modelPage.metaDescription")(n.model.brand_name,n.model.name):void 0,path:`/fahrzeuge/${e}/${t}`}),l.vehicles.enabled&&!l.bypass)return a.jsx(la,{message:l.vehicles.message});if(s)return a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s});if(!n)return a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:o("modelPage.loading")});const{model:p,packages:y}=n,w=new Map([...y].sort((N,S)=>N.total_price-S.total_price).map((N,S)=>[N.id,S])),j=N=>{const S=y.length,E=w.get(N.id)??0,T=S<=1?0:E/(S-1),R=Math.round(T*(h.length-1));return{tier:h[R],tierT:T}},P=N=>[...N.products.map(S=>S.name_override||S.scraped_name||o("modelPage.productLoading")),...(N.description||"").split(`
+`).map(S=>S.trim()).filter(Boolean)],C=N=>`/kontakt?${new URLSearchParams({brand:p.brand_name,model:p.name,package:N.name,packageId:N.id,total:N.total_price}).toString()}`;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-12 sm:px-6",children:[l.vehicles.enabled&&l.bypass&&a.jsx(oa,{inline:!0}),a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(O,{to:"/fahrzeuge",className:"hover:text-brand-500",children:o("modelPage.breadcrumbVehicles")})," /"," ",a.jsx(O,{to:`/fahrzeuge/${e}`,className:"hover:text-brand-500",children:p.brand_name})," / ",p.name]}),a.jsxs("h1",{className:`text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl ${y.length?"mb-2":"mb-8"}`,children:[p.brand_name," ",p.name," – ",o("modelPage.titleSuffix")]}),y.length===0&&a.jsx("p",{className:"pb-12 text-neutral-500 dark:text-neutral-400",children:o("modelPage.empty")})]}),y.length>0&&a.jsx("section",{className:"py-10 sm:py-14",style:{fontFamily:"'Barlow', sans-serif"},children:a.jsxs("div",{className:m==="grid"?"mx-auto max-w-6xl px-4 sm:px-6":"mx-auto max-w-[1880px] px-4 sm:px-6",children:[a.jsx("div",{ref:m==="grid"?void 0:f,className:m==="grid"?"grid items-start gap-[18px] sm:grid-cols-2 xl:grid-cols-3":"flex select-none items-start gap-[18px] overflow-x-auto pb-3 snap-x snap-mandatory [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:m==="coverflow"?{perspective:"1200px",paddingLeft:"calc(50% - 115px)",paddingRight:"calc(50% - 115px)",paddingTop:"10px"}:void 0,children:y.map(N=>{const{tier:S,tierT:E}=j(N);return a.jsx(HC,{pkg:N,tier:S,tierT:E,layout:m,bullets:P(N),formatPrice:x,contactUrl:C,t:o},N.id)})}),m!=="grid"&&a.jsx("div",{ref:b,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:a.jsx("div",{ref:v,className:"absolute left-0 top-0 h-full rounded-full bg-brand-500 shadow-[0_0_10px_rgba(107,166,38,0.7)]",style:{width:"48px"}})})]})})]})}function GC(){const[e,t]=g.useState(null),[n,r]=g.useState(""),{t:s}=Ne();return Ze({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),g.useEffect(()=>{M.get("/gallery-brands").then(t).catch(i=>r(i.message))},[]),a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("galleryOverview.title")}),a.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:s("galleryOverview.intro")}),n&&a.jsx("p",{className:"text-red-600",children:n}),!e&&!n&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),e&&e.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:e==null?void 0:e.map(i=>a.jsxs(O,{to:`/galerie/${i.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[i.cover_image_path?a.jsx("img",{src:i.cover_image_path,alt:i.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("span",{className:"absolute inset-x-0 bottom-0 p-4 text-lg font-extrabold text-white",children:i.name})]},i.id))})]})}function KC(){const{brandSlug:e}=$n(),[t,n]=g.useState(null),[r,s]=g.useState(""),{t:i}=Ne();return g.useEffect(()=>{M.get(`/gallery-brands/${e}/projects`).then(n).catch(l=>s(l.message))},[e]),Ze({title:t?i("galleryBrandPage.metaTitle")(t.brand.name):i("galleryBrandPage.metaTitleFallback"),description:t?i("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${e}`}),r?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(O,{to:"/galerie",className:"hover:text-brand-500",children:i("galleryBrandPage.breadcrumbGallery")})," / ",t.brand.name]}),a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",i("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(l=>a.jsxs(O,{to:`/galerie/${e}/${l.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[l.cover_image_path?a.jsx("img",{src:l.cover_image_path,alt:l.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("span",{className:"absolute inset-x-0 bottom-0 p-4 text-lg font-extrabold text-white",children:l.name})]},l.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:i("galleryBrandPage.loading")})}function qC({photos:e,index:t,onClose:n,onNavigate:r}){const{t:s}=Ne();if(g.useEffect(()=>{if(t==null)return;const o=u=>{u.key==="Escape"&&n(),u.key==="ArrowRight"&&r(1),u.key==="ArrowLeft"&&r(-1)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t,n,r]),t==null)return null;const i=e[t],l=o=>o.stopPropagation();return Wc.createPortal(a.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:n,children:[a.jsx("button",{onClick:o=>{l(o),n()},"aria-label":s("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),e.length>1&&a.jsx("button",{onClick:o=>{l(o),r(-1)},"aria-label":s("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),a.jsx("img",{src:i.image_path,alt:i.caption||"",onClick:l,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),e.length>1&&a.jsx("button",{onClick:o=>{l(o),r(1)},"aria-label":s("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:a.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:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),i.caption&&a.jsx("p",{onClick:l,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:i.caption})]}),document.body)}function YC(){const{brandSlug:e,projectSlug:t}=$n(),[n,r]=g.useState(null),[s,i]=g.useState(""),[l,o]=g.useState(null),{t:u}=Ne();g.useEffect(()=>{M.get(`/gallery-brands/${e}/${t}/photos`).then(r).catch(d=>i(d.message))},[e,t]),Ze({title:n?`${n.project.name} – ${n.project.brand_name}`:u("galleryProjectPage.metaTitleFallback"),description:n?u("galleryProjectPage.metaDescription")(n.project.name):void 0,path:`/galerie/${e}/${t}`});const c=d=>{o(h=>{const m=n.photos.length;return(h+d+m)%m})};return s?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s}):n?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(O,{to:"/galerie",className:"hover:text-brand-500",children:u("galleryProjectPage.breadcrumbGallery")})," /"," ",a.jsx(O,{to:`/galerie/${e}`,className:"hover:text-brand-500",children:n.project.brand_name})," / ",n.project.name]}),a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:n.project.name}),n.photos.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:u("galleryProjectPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:n.photos.map((d,h)=>a.jsx(ve,{index:h%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:a.jsx("button",{onClick:()=>o(h),className:"block h-full w-full","aria-label":d.caption||u("galleryProjectPage.enlargeImage"),children:a.jsx("img",{src:d.image_path,alt:d.caption||"",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},d.id))}),a.jsx(qC,{photos:n.photos,index:l,onClose:()=>o(null),onNavigate:c})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:u("galleryProjectPage.loading")})}function XC(){const[e,t]=g.useState([]),n=fl(),{t:r}=Ne();return g.useEffect(()=>{M.get("/services").then(t).catch(()=>t([]))},[]),Ze({title:r("leistungen.metaTitle"),description:r("leistungen.metaDescription"),path:"/leistungen"}),n.services.enabled&&!n.bypass?a.jsx(la,{message:n.services.message}):a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[n.services.enabled&&n.bypass&&a.jsx(oa,{inline:!0}),a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:r("leistungen.title")}),a.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:r("leistungen.intro")}),a.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:e.map((s,i)=>a.jsxs(ve,{index:i%3,shine:!0,className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"relative aspect-[4/3]",children:[s.image_path&&a.jsx("img",{src:s.image_path,alt:s.title,className:"h-full w-full object-cover",loading:"lazy"}),a.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:a.jsx(Ie,{name:s.icon_name,className:"h-6 w-6"})})]}),a.jsxs("div",{className:"p-6 pt-8",children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:s.title}),a.jsx("p",{className:"mb-3 text-sm text-neutral-600 dark:text-neutral-300",children:s.description}),s.cta_label&&s.cta_url&&a.jsxs(O,{to:s.cta_url,className:"text-sm font-semibold text-brand-600 hover:underline dark:text-brand-400",children:[s.cta_label," →"]})]})]},s.id))}),a.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:[a.jsx("h2",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:r("leistungen.notListedTitle")}),a.jsx("p",{className:"mb-5 text-neutral-600 dark:text-neutral-300",children:r("leistungen.notListedText")}),a.jsx(O,{to:"/kontakt",className:"inline-block rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white hover:bg-brand-600",children:r("leistungen.contact")})]})]})}function ZC({name:e,description:t,className:n="",children:r}){const{consent:s,acceptAll:i,openSettings:l}=Ir();return s.external?r:a.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:[a.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.`}),a.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[a.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"}),a.jsx("button",{type:"button",onClick:l,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Cookie-Einstellungen"})]})]})}const db=e=>(e||"").replace(/[^\d+]/g,""),QC=e=>`https://wa.me/${db(e).replace(/^0/,"49").replace("+","")}`,hb=encodeURIComponent("Boxbrunner Str. 20a, 63916 Amorbach"),Af=`https://www.google.com/maps/dir/?api=1&destination=${hb}`,ri={fontFamily:"'Michroma', sans-serif"};function JC({className:e}){return a.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.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 eP({path:e,className:t}){return a.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:e})})}const tP={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 Mf({formatted:e,color:t}){const[n,r]=e.split("€");return a.jsxs("span",{style:{...ri,color:t},children:[n,a.jsx("span",{style:{fontFamily:"'Barlow', sans-serif"},children:"€"}),r]})}function La({icon:e,label:t,name:n,type:r="text",required:s,value:i,onChange:l,placeholder:o}){return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("label",{htmlFor:`kf-${n}`,className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:t}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx(e,{className:"pointer-events-none absolute left-[14px] h-[17px] w-[17px]",style:{color:"var(--kf-fieldicon)"}}),a.jsx("input",{id:`kf-${n}`,name:n,type:r,required:s,value:i,onChange:l,placeholder:o,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 nP(){const[e]=rw(),{phone:t,whatsapp:n,contact_email:r}=Rr(),{t:s,language:i}=Ne(),{consent:l}=Ir(),o=T=>new Intl.NumberFormat(i==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(T),[u,c]=g.useState({name:"",email:"",phone:"",vin:"",message:""}),[d,h]=g.useState("idle"),[m,f]=g.useState(""),[b,v]=g.useState([]),[k,x]=g.useState([]),p=e.get("packageId"),y=e.get("total")?Number(e.get("total")):null;g.useEffect(()=>{if(!p){v([]);return}M.get(`/packages/${p}/upgrades`).then(v).catch(()=>v([]))},[p]);const w=T=>{x(R=>R.includes(T)?R.filter(U=>U!==T):[...R,T])},j=b.filter(T=>k.includes(T.id)).reduce((T,R)=>T+Number(R.price),0);Ze({title:s("contactPage.metaTitle"),description:s("contactPage.metaDescription"),path:"/kontakt"});const P={brand:e.get("brand")||"",model:e.get("model")||"",package:e.get("package")||""},C=!!(P.brand&&P.model&&P.package),N=T=>c(R=>({...R,[T.target.name]:T.target.value})),S=async T=>{T.preventDefault(),h("sending"),f("");try{await M.post("/contact",{...u,brand_name:P.brand||null,model_name:P.model||null,package_name:P.package||null,product_name:e.get("product")||null,package_id:p||null,package_product_id:e.get("productId")||null,upgrade_ids:k}),h("sent"),c({name:"",email:"",phone:"",vin:"",message:""})}catch(R){f(R.message),h("idle")}},E=[{key:"premium",title:s("contactPage.featurePremiumTitle"),sub:s("contactPage.featurePremiumSub")},{key:"germany",title:s("contactPage.featureGermanyTitle"),sub:s("contactPage.featureGermanySub")},{key:"individual",title:s("contactPage.featureIndividualTitle"),sub:s("contactPage.featureIndividualSub")},{key:"experts",title:s("contactPage.featureExpertsTitle"),sub:s("contactPage.featureExpertsSub")}];return a.jsx("div",{className:"kf-page kontakt-sektion relative w-full overflow-hidden px-4 pb-10 sm:px-10",style:{color:"var(--kf-text2)"},children:a.jsxs("div",{className:"relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14",children:[a.jsx("div",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.heroEyebrow")}),a.jsxs("h1",{className:"text-[34px] leading-[1.08] sm:text-[46px] lg:text-[60px]",style:{...ri,color:"var(--kf-text)"},children:[s("contactPage.heroTitlePre")," ",a.jsx("span",{style:{color:"var(--kf-accent2)"},children:s("contactPage.heroTitleAccent")})," ",s("contactPage.heroTitlePost")]}),a.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:"var(--kf-muted)"},children:s("contactPage.heroSubtitle")}),a.jsxs("div",{className:"grid grid-cols-1 items-start gap-10 min-[981px]:grid-cols-[minmax(0,1.35fr)_minmax(320px,1fr)]",children:[a.jsx("div",{children:a.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:[C&&a.jsxs("div",{className:"mb-8 rounded-xl border px-6 py-[22px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[a.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:[a.jsx(Lb,{className:"h-4 w-4"}),s("contactPage.packageBoxTitle")]}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-5 gap-y-2 text-[15px]",children:[a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextBrand")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:P.brand}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextModel")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:P.model}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextPackage")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:P.package})]}),a.jsxs("div",{className:"mt-3.5 flex items-baseline justify-between border-t pt-3.5",style:{borderColor:"var(--kf-pkgbrd)"},children:[a.jsx("span",{className:"text-[13px] font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:s("contactPage.packagePrice")}),a.jsx("span",{className:"text-xl",children:y!=null?a.jsx(Mf,{formatted:o(y),color:"var(--kf-text)"}):"—"})]})]}),b.length>0&&a.jsxs("div",{className:"mb-8 rounded-xl border p-5",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)"},children:[a.jsx("div",{className:"mb-3 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.optionalUpgrades")}),a.jsx("div",{className:"space-y-2",children:b.map(T=>a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border p-3 text-sm",style:{borderColor:"var(--kf-fieldbrd)"},children:[a.jsx("input",{type:"checkbox",checked:k.includes(T.id),onChange:()=>w(T.id),className:"mt-0.5 h-4 w-4 rounded",style:{accentColor:"var(--kf-accent)"}}),a.jsxs("span",{className:"flex-1",children:[a.jsx("span",{className:"block font-semibold",style:{color:"var(--kf-text2)"},children:T.name}),T.description&&a.jsx("span",{className:"block text-xs",style:{color:"var(--kf-muted)"},children:T.description})]}),a.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-accent2)"},children:["+",o(T.price)]})]},T.id))}),k.length>0&&y!=null&&a.jsxs("div",{className:"mt-3 flex items-baseline justify-between border-t pt-3 text-sm",style:{borderColor:"var(--kf-pkgbrd)"},children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:s("contactPage.totalWithUpgrades")}),a.jsx(Mf,{formatted:o(y+j),color:"var(--kf-text)"})]})]}),a.jsx("h2",{className:"mb-8 text-xl",style:{...ri,color:"var(--kf-text)"},children:s("contactPage.formTitle")}),d==="sent"&&a.jsxs("div",{className:"mb-6 rounded-[10px] border p-5",style:{borderColor:"var(--kf-accent)",background:"var(--kf-accentsoft)"},children:[a.jsx("div",{className:"text-base font-bold",style:{color:"var(--kf-accent2)"},children:s("contactPage.sentTitle")}),a.jsx("div",{className:"mt-1 text-sm",style:{color:"var(--kf-muted)"},children:s("contactPage.sentText")})]}),a.jsxs("form",{onSubmit:S,children:[a.jsxs("div",{className:"grid grid-cols-1 gap-6 min-[641px]:grid-cols-2",children:[a.jsx(La,{icon:Bb,label:s("contactPage.nameLabel"),name:"name",required:!0,value:u.name,onChange:N,placeholder:s("contactPage.namePlaceholder")}),a.jsx(La,{icon:Ad,label:s("contactPage.emailLabel"),name:"email",type:"email",required:!0,value:u.email,onChange:N,placeholder:s("contactPage.emailPlaceholder")}),a.jsx(La,{icon:Md,label:s("contactPage.phoneLabel"),name:"phone",value:u.phone,onChange:N,placeholder:s("contactPage.phonePlaceholder")}),a.jsx(La,{icon:zb,label:s("contactPage.vinLabel"),name:"vin",value:u.vin,onChange:N,placeholder:s("contactPage.vinPlaceholder")})]}),a.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[a.jsx("label",{htmlFor:"kf-message",className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:s("contactPage.messageLabel")}),a.jsx("textarea",{id:"kf-message",name:"message",rows:5,value:u.message,onChange:N,placeholder:s("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)"}})]}),m&&a.jsx("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:m}),a.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-5",children:[a.jsxs("button",{type:"submit",disabled:d==="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:[a.jsx(Rb,{className:"h-[18px] w-[18px]"}),s(d==="sending"?"contactPage.sending":"contactPage.submit")]}),a.jsx("div",{className:"text-[13px]",style:{color:"var(--kf-label)"},children:s("contactPage.requiredHint")})]})]})]})}),a.jsxs("div",{className:"flex flex-col gap-6",children:[a.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:[a.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)"}}),a.jsx("h2",{className:"mb-7 text-[17px]",style:{...ri,color:"var(--kf-text)"},children:s("contactPage.cardTitle")}),a.jsxs("div",{className:"flex flex-col gap-5",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(Md,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.phone")}),a.jsx("a",{href:`tel:${db(t)}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:t})]})]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(Ad,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.email")}),a.jsx("a",{href:`mailto:${r}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:r})]})]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(Ib,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.address")}),a.jsxs("div",{className:"text-base font-semibold leading-[1.4]",style:{color:"var(--kf-text2)"},children:["Boxbrunner Straße 20a",a.jsx("br",{}),"63916 Amorbach"]})]})]}),n&&a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(JC,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("nav.whatsapp")}),a.jsx("a",{href:QC(n),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:n})]})]})]}),a.jsxs("div",{className:"mt-7 border-t pt-6",style:{borderColor:"var(--kf-divider)"},children:[a.jsx("div",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.hours")}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-[15px]",children:[a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.hoursWeekDays")}),a.jsx("span",{children:s("contactPage.hoursWeekTime")}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.hoursSatDay")}),a.jsx("span",{children:s("contactPage.hoursSatTime")})]})]})]}),a.jsxs("div",{className:"relative overflow-hidden rounded-2xl border",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[l.external&&a.jsxs("a",{href:Af,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:[s("contactPage.mapOpenChip"),a.jsx(Fb,{className:"h-3.5 w-3.5",style:{color:"var(--kf-accent2)"}})]}),a.jsx(ZC,{name:s("contactPage.mapEmbedName"),className:"h-[210px] w-full",children:a.jsx("div",{className:"h-[210px] overflow-hidden",children:a.jsx("iframe",{title:"HifiPlanet Amorbach – Standort",src:`https://www.google.com/maps?q=${hb}&output=embed`,width:"100%",height:"280",style:{border:0,display:"block",marginTop:"-70px"},loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"})})}),a.jsxs("a",{href:Af,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:[s("contactPage.routePlan")," →"]})]})]})]}),a.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:E.map(T=>a.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:[a.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:a.jsx(eP,{path:tP[T.key],className:"h-[22px] w-[22px]"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-bold",style:{color:"var(--kf-text)"},children:T.title}),a.jsx("div",{className:"mt-0.5 text-[13px]",style:{color:"var(--kf-muted)"},children:T.sub})]})]},T.key))})]})})}function rP(){return Ze({title:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG.",path:"/impressum"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Impressum"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Angaben gemäß § 5 DDG"}),a.jsxs("p",{children:["Hifi Planet e.K.",a.jsx("br",{}),"Inhaber: Christopher Horndasch",a.jsx("br",{}),"Boxbrunner Str. 20a",a.jsx("br",{}),"63916 Amorbach"]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Kontakt"}),a.jsxs("p",{children:["Telefon: ",a.jsx("a",{href:"tel:+4993732062390",className:"hover:text-brand-500",children:"09373 20 62 390"}),a.jsx("br",{}),"E-Mail: ",a.jsx("a",{href:"mailto:info@hifi-planet-amorbach.de",className:"hover:text-brand-500",children:"info@hifi-planet-amorbach.de"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Umsatzsteuer-ID"}),a.jsx("p",{children:"Umsatzsteuer-Identifikationsnummer gemäß § 27a Umsatzsteuergesetz: DE 275084766"})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Zuständige Kammer"}),a.jsx("p",{children:"IHK Aschaffenburg"})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Verantwortlich für den Inhalt nach § 18 Abs. 2 MStV"}),a.jsxs("p",{children:["Christopher Horndasch",a.jsx("br",{}),"Anschrift wie oben"]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Verbraucherstreitbeilegung"}),a.jsx("p",{children:"Wir sind nicht bereit und nicht verpflichtet, an Streitbeilegungsverfahren vor einer Verbraucherschlichtungsstelle im Sinne des Verbraucherstreitbeilegungsgesetzes (VSBG) teilzunehmen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Haftung für Inhalte"}),a.jsx("p",{children:"Als Diensteanbieter sind wir gemäß § 7 Abs. 1 DDG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 DDG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntnis einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von entsprechenden Rechtsverletzungen werden wir diese Inhalte umgehend entfernen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Haftung für Links"}),a.jsx("p",{children:"Unser Angebot enthält Links zu externen Websites Dritter, auf deren Inhalte wir keinen Einfluss haben. Deshalb können wir für diese fremden Inhalte auch keine Gewähr übernehmen. Für die Inhalte der verlinkten Seiten ist stets der jeweilige Anbieter oder Betreiber der Seiten verantwortlich. Eine permanente inhaltliche Kontrolle der verlinkten Seiten ist ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht zumutbar. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Links umgehend entfernen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Urheberrecht"}),a.jsx("p",{children:"Die durch die Seitenbetreiber erstellten Inhalte und Werke auf diesen Seiten unterliegen dem deutschen Urheberrecht. Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung außerhalb der Grenzen des Urheberrechtes bedürfen der schriftlichen Zustimmung des jeweiligen Autors bzw. Erstellers. Downloads und Kopien dieser Seite sind nur für den privaten, nicht kommerziellen Gebrauch gestattet. Soweit die Inhalte auf dieser Seite nicht vom Betreiber erstellt wurden, werden die Urheberrechte Dritter beachtet. Insbesondere werden Inhalte Dritter als solche gekennzeichnet. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte umgehend entfernen."})]})]})]})}function sP(){return Ze({title:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO.",path:"/datenschutz"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Datenschutzerklärung"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"1. Verantwortlicher"}),a.jsxs("p",{children:["Verantwortlicher im Sinne der Datenschutz-Grundverordnung (DSGVO) ist:",a.jsx("br",{}),"Hifi Planet e.K., Christopher Horndasch",a.jsx("br",{}),"Boxbrunner Str. 20a, 63916 Amorbach",a.jsx("br",{}),"Telefon: 09373 20 62 390 · E-Mail:"," ",a.jsx("a",{href:"mailto:info@hifi-planet-amorbach.de",className:"hover:text-brand-500",children:"info@hifi-planet-amorbach.de"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"2. Ihre Rechte als betroffene Person"}),a.jsx("p",{className:"mb-2",children:"Sie haben jederzeit das Recht,"}),a.jsxs("ul",{className:"list-disc space-y-1 pl-5",children:[a.jsx("li",{children:"Auskunft über Ihre bei uns gespeicherten personenbezogenen Daten zu erhalten (Art. 15 DSGVO),"}),a.jsx("li",{children:"die Berichtigung unrichtiger Daten zu verlangen (Art. 16 DSGVO),"}),a.jsx("li",{children:"die Löschung Ihrer Daten zu verlangen (Art. 17 DSGVO),"}),a.jsx("li",{children:"die Verarbeitung Ihrer Daten einschränken zu lassen (Art. 18 DSGVO),"}),a.jsx("li",{children:"der Verarbeitung Ihrer Daten zu widersprechen (Art. 21 DSGVO),"}),a.jsx("li",{children:"Ihre Daten in einem gängigen Format zu erhalten (Datenübertragbarkeit, Art. 20 DSGVO), und"}),a.jsx("li",{children:"eine erteilte Einwilligung jederzeit mit Wirkung für die Zukunft zu widerrufen (Art. 7 Abs. 3 DSGVO)."})]}),a.jsx("p",{className:"mt-2",children:"Außerdem haben Sie das Recht, sich bei einer Datenschutz-Aufsichtsbehörde über die Verarbeitung Ihrer personenbezogenen Daten durch uns zu beschweren, zum Beispiel beim Bayerischen Landesamt für Datenschutzaufsicht (BayLDA)."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"3. Hosting und Server-Logfiles"}),a.jsx("p",{children:"Beim Aufruf dieser Website erhebt der Webserver automatisch Daten in sogenannten Server-Logfiles, die Ihr Browser übermittelt. Dazu gehören: IP-Adresse, Datum und Uhrzeit der Anfrage, aufgerufene Seite, verwendeter Browser und Betriebssystem sowie die zuvor besuchte Seite (Referrer-URL). Diese Daten dienen ausschließlich der technisch fehlerfreien Auslieferung der Website sowie der IT-Sicherheit (z. B. zur Abwehr von Angriffen) und werden nicht mit anderen Datenquellen zusammengeführt. Rechtsgrundlage ist unser berechtigtes Interesse an einem sicheren und stabilen Betrieb der Website (Art. 6 Abs. 1 lit. f DSGVO)."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"4. Kontaktformular"}),a.jsx("p",{children:"Wenn Sie uns über das Kontaktformular eine Anfrage zukommen lassen, werden Ihre Angaben aus dem Formular (Name, E-Mail-Adresse, optional Telefonnummer, Nachricht sowie ggf. der Kontext Ihrer Anfrage wie Marke, Modell oder Paket) inklusive der von Ihnen dort angegebenen Kontaktdaten bei uns gespeichert, um Ihre Anfrage zu bearbeiten und zu beantworten. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung durch Absenden des Formulars (Art. 6 Abs. 1 lit. a DSGVO) bzw., sofern Ihre Anfrage der Vorbereitung eines Vertrags dient, auf Grundlage von Art. 6 Abs. 1 lit. b DSGVO. Wir löschen die Anfrage inklusive der Kontaktdaten, sobald der jeweilige Sachverhalt abschließend geklärt ist und keine gesetzlichen Aufbewahrungspflichten entgegenstehen. Diese Einwilligung können Sie jederzeit widerrufen, indem Sie uns formlos per E-Mail kontaktieren."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"5. Cookies und lokale Speicherung"}),a.jsx("p",{className:"mb-2",children:"Diese Website verwendet technisch notwendige Cookies bzw. Speichertechnologien, die für den Betrieb der Seite erforderlich sind und ohne die einzelne Funktionen nicht funktionieren würden. Dazu gehören:"}),a.jsxs("ul",{className:"list-disc space-y-1 pl-5",children:[a.jsxs("li",{children:["ein Session-Cookie (",a.jsx("code",{children:"hifi_admin_session"}),"), das für den Anmeldestatus im Mitarbeiter-Login benötigt wird und mit Ende der Browsersitzung abläuft,"]}),a.jsxs("li",{children:["eine lokale Speicherung (",a.jsx("code",{children:"localStorage"}),") Ihrer Hell-/Dunkelmodus-Einstellung sowie Ihrer Cookie-Auswahl, damit wir Sie nicht bei jedem Besuch erneut danach fragen müssen."]})]}),a.jsx("p",{className:"mt-2",children:'Für diese technisch notwendigen Cookies ist gemäß § 25 Abs. 2 Nr. 2 TTDSG keine Einwilligung erforderlich. Rechtsgrundlage ist unser berechtigtes Interesse am technischen Betrieb der Website (Art. 6 Abs. 1 lit. f DSGVO). Für alle darüber hinausgehenden Inhalte und Dienste – aktuell die eingebundenen Google Maps- und YouTube-Elemente sowie Google Analytics – fragen wir Sie beim ersten Besuch aktiv nach Ihrer Einwilligung. Sie können Ihre Auswahl jederzeit über den Link „Cookie-Einstellungen" im Footer ändern.'})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"6. Google Maps"}),a.jsxs("p",{children:['Auf unserer Kontaktseite und im Footer binden wir Kartenmaterial des Dienstes „Google Maps" ein, um Ihnen die Anfahrt zu unserem Standort zu erleichtern. Anbieter ist Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland. Die eingebettete Karte wird erst geladen, nachdem Sie dem im Cookie-Banner unter „Externe Medien" zugestimmt haben. Beim Laden der Karte wird Ihre IP-Adresse an Google übertragen; eine Verarbeitung kann dabei auch auf Servern außerhalb der EU/des EWR erfolgen. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"7. YouTube"}),a.jsxs("p",{children:['Auf unserer Startseite binden wir ein Video des Anbieters YouTube (Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland) im „erweiterten Datenschutzmodus" ein (Domain youtube-nocookie.com). Auch dieses Video wird erst geladen, nachdem Sie unter „Externe Medien" zugestimmt haben. Nach Angaben von Google werden dabei bis zum Start der Wiedergabe keine Cookies gesetzt; beim Laden des Players wird jedoch bereits eine Verbindung zu Google-Servern aufgebaut und Ihre IP-Adresse übertragen. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"8. Google Analytics"}),a.jsxs("p",{children:['Sofern Sie der Statistik-Kategorie im Cookie-Banner zugestimmt haben, setzen wir „Google Analytics" ein, einen Webanalysedienst der Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland. Google Analytics verwendet Cookies und ähnliche Technologien, die eine Analyse der Benutzung dieser Website durch Sie ermöglichen. Die dabei erzeugten Informationen (u. a. Ihre IP-Adresse, die vor der Verarbeitung durch die Aktivierung der IP-Anonymisierung gekürzt wird) werden an einen Server von Google übertragen und dort gespeichert; eine Verarbeitung kann dabei auch auf Servern außerhalb der EU/des EWR erfolgen. Die Verarbeitung erfolgt ausschließlich auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen mit Wirkung für die Zukunft widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"9. Empfänger der Daten"}),a.jsx("p",{children:"Ihre Daten werden grundsätzlich nur innerhalb unseres Unternehmens verarbeitet. Eine Weitergabe an Dritte erfolgt nur, soweit dies zur Bearbeitung Ihrer Anfrage erforderlich ist (z. B. an unseren Hosting-Provider zum Betrieb dieser Website und an unseren E-Mail-Anbieter zur Zustellung Ihrer Kontaktanfrage) oder soweit wir gesetzlich dazu verpflichtet sind."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"10. Speicherdauer"}),a.jsx("p",{children:"Sofern in dieser Erklärung keine speziellere Speicherdauer genannt wurde, verbleiben Ihre personenbezogenen Daten bei uns, bis der Zweck für die Datenspeicherung entfällt. Gesetzliche Aufbewahrungsfristen (z. B. aus dem Handels- oder Steuerrecht) bleiben hiervon unberührt und können eine längere Speicherung erforderlich machen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"11. SSL-/TLS-Verschlüsselung"}),a.jsx("p",{children:"Diese Seite nutzt aus Sicherheitsgründen eine SSL-/TLS-Verschlüsselung zur Übertragung Ihrer Daten. Eine verschlüsselte Verbindung erkennen Sie an dem Schloss-Symbol in der Adresszeile Ihres Browsers."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"12. Änderung dieser Datenschutzerklärung"}),a.jsx("p",{children:"Wir passen diese Datenschutzerklärung an, sobald sich die von uns eingesetzten Datenverarbeitungen ändern. Es gilt jeweils die zum Zeitpunkt Ihres Besuchs aktuelle, auf dieser Seite veröffentlichte Fassung."})]}),a.jsxs("p",{children:["Fragen zum Datenschutz beantworten wir Ihnen gerne über unser"," ",a.jsx(O,{to:"/kontakt",className:"underline hover:text-brand-500",children:"Kontaktformular"})," oder direkt per E-Mail."]})]})]})}function aP(){return Ze({title:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach.",path:"/agb"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Allgemeine Geschäftsbedingungen"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"1. Geltungsbereich"}),a.jsx("p",{children:'Diese Allgemeinen Geschäftsbedingungen (AGB) gelten für alle Beratungs-, Werkstatt- und Umbauleistungen, die die Hifi Planet e.K., Boxbrunner Str. 20a, 63916 Amorbach („wir", „HifiPlanet") gegenüber ihren Kunden erbringt, sowie für die Nutzung des Kontaktformulars auf dieser Website.'})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"2. Anfragen über die Website"}),a.jsx("p",{children:"Über das Kontaktformular können Sie unverbindlich eine Beratung oder ein Angebot zu einem einzelnen Produkt oder einem ganzen Paket anfragen. Die auf der Website angezeigten Preise sind, soweit sie von Drittanbietern automatisiert übernommen werden, unverbindliche Circa-Preise ohne Einbau und können sich bis zur Erstellung eines konkreten Angebots ändern. Mit dem Absenden einer Anfrage kommt noch kein Vertrag zustande."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"3. Vertragsschluss"}),a.jsx("p",{children:"Ein verbindlicher Vertrag über Beratung, Material und Einbauleistungen kommt erst zustande, wenn wir Ihnen nach persönlicher oder schriftlicher Abstimmung ein konkretes Angebot unterbreitet haben und Sie dieses angenommen haben, spätestens jedoch mit der Übergabe Ihres Fahrzeugs zur vereinbarten Auftragsdurchführung in unserer Werkstatt in Amorbach."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"4. Preise und Zahlung"}),a.jsx("p",{children:"Es gelten die im jeweiligen Einzelangebot genannten Preise inklusive der zum Zeitpunkt der Rechnungsstellung gesetzlich geltenden Umsatzsteuer. Sofern nichts anderes vereinbart ist, ist die Rechnung nach Abnahme der Leistung bzw. Übergabe des Fahrzeugs ohne Abzug fällig."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"5. Termine und Fahrzeugübergabe"}),a.jsx("p",{children:"Vereinbarte Termine zur Fahrzeugübergabe sind von beiden Seiten einzuhalten. Verschiebungen sind möglichst frühzeitig mitzuteilen. Für Gegenstände, die sich zum Zeitpunkt der Übergabe im Fahrzeug befinden und nicht Gegenstand des Auftrags sind, übernehmen wir keine Haftung."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"6. Gewährleistung"}),a.jsx("p",{children:"Es gelten die gesetzlichen Gewährleistungsrechte. Mängel sind uns unverzüglich nach Feststellung anzuzeigen, damit wir Ihnen Nacherfüllung anbieten können. Für Verschleißteile sowie für Schäden, die auf unsachgemäße Behandlung, Fremdeingriffe Dritter oder normalen Verschleiß zurückzuführen sind, besteht kein Gewährleistungsanspruch."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"7. Eigentumsvorbehalt"}),a.jsx("p",{children:"Verbautes Material und gelieferte Ware bleiben bis zur vollständigen Bezahlung unser Eigentum."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"8. Haftung"}),a.jsx("p",{children:"Wir haften unbeschränkt bei Vorsatz und grober Fahrlässigkeit sowie nach Maßgabe des Produkthaftungsgesetzes. Bei leichter Fahrlässigkeit haften wir nur bei Verletzung einer wesentlichen Vertragspflicht (Kardinalpflicht) und begrenzt auf den vertragstypisch vorhersehbaren Schaden. Die Haftung für Schäden aus der Verletzung des Lebens, des Körpers oder der Gesundheit bleibt hiervon unberührt."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"9. Widerrufsrecht"}),a.jsx("p",{children:"Ein gesetzliches Widerrufsrecht für Verbraucher besteht bei Verträgen, die außerhalb von Geschäftsräumen oder im Fernabsatz geschlossen werden. Da der eigentliche Werkvertrag über Beratung und Einbauleistungen erst bei persönlicher Fahrzeugübergabe in unseren Geschäftsräumen in Amorbach geschlossen wird, handelt es sich hierbei nicht um einen Fernabsatzvertrag; ein gesetzliches Widerrufsrecht besteht in diesem Fall nicht. Sollte im Einzelfall ausnahmsweise ein Vertrag im Fernabsatz zustande kommen, informieren wir Sie gesondert über Ihr gesetzliches Widerrufsrecht."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"10. Anwendbares Recht und Gerichtsstand"}),a.jsx("p",{children:"Es gilt das Recht der Bundesrepublik Deutschland unter Ausschluss des UN-Kaufrechts. Ist der Kunde Kaufmann, juristische Person des öffentlichen Rechts oder öffentlich-rechtliches Sondervermögen, ist Gerichtsstand für alle Streitigkeiten aus diesem Vertragsverhältnis unser Geschäftssitz in Amorbach."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"11. Schlussbestimmungen"}),a.jsx("p",{children:"Sollte eine Bestimmung dieser AGB unwirksam sein oder werden, bleibt die Wirksamkeit der übrigen Bestimmungen hiervon unberührt."})]})]})]})}const iP={host:"",name:"",user:"",password:"",charset:"utf8mb4"},lP={username:"",password:"",password_confirmation:""};function oP(){Ze({title:"Ersteinrichtung",path:"/setup"});const[e,t]=g.useState("loading"),[n,r]=g.useState(""),[s,i]=g.useState(!1),[l,o]=g.useState(""),[u,c]=g.useState(iP),[d,h]=g.useState(lP),[m,f]=g.useState(null),b=()=>M.get("/setup/status").then(C=>(C.needs_setup?C.steps.admin.ok?t("done"):C.steps.schema.ok?t("admin"):t(C.steps.database.ok?"schema":"database"):t("locked"),C));g.useEffect(()=>{M.get("/setup/status").then(C=>t(C.needs_setup?"password":"locked")).catch(()=>t("locked"))},[]);const v=async C=>{C.preventDefault(),r(""),i(!0);try{await M.post("/setup/verify-password",{password:l}),await b()}catch(N){r(N.message)}finally{i(!1)}},k=async C=>{C.preventDefault(),r(""),i(!0);try{await M.post("/setup/database",u),await b()}catch(N){r(N.message)}finally{i(!1)}},x=async()=>{r(""),i(!0);try{const C=await M.post("/setup/migrate",{});f(C.actions),C.status.steps.schema.ok&&t("admin")}catch(C){r(C.message)}finally{i(!1)}},p=async C=>{if(C.preventDefault(),r(""),d.password!==d.password_confirmation){r("Die Passwörter stimmen nicht überein");return}i(!0);try{await M.post("/setup/admin",d),t("done")}catch(N){r(N.message)}finally{i(!1)}},y="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900",w="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",j=[{key:"database",label:"Datenbank"},{key:"schema",label:"Struktur"},{key:"admin",label:"Admin-Account"}],P=j.findIndex(C=>C.key===e);return a.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:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-16 w-auto sm:h-20"}),a.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:[e==="loading"&&a.jsx("p",{className:"text-center text-sm text-neutral-400",children:"Lädt…"}),e==="locked"&&a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bereits eingerichtet"}),a.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."}),a.jsx(O,{to:"/admin/login",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Zum Login"})]}),["database","schema","admin"].includes(e)&&a.jsx("div",{className:"mb-6 flex items-center justify-center gap-2",children:j.map((C,N)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-semibold ${No(C.target.value),required:!0,autoFocus:!0,className:y})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Prüfe…":"Weiter"})]}),e==="database"&&a.jsxs("form",{onSubmit:k,children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),a.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."}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Host *"}),a.jsx("input",{required:!0,value:u.host,onChange:C=>c({...u,host:C.target.value}),className:y})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Datenbankname *"}),a.jsx("input",{required:!0,value:u.name,onChange:C=>c({...u,name:C.target.value}),className:y})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Benutzer *"}),a.jsx("input",{required:!0,value:u.user,onChange:C=>c({...u,user:C.target.value}),className:y})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Passwort"}),a.jsx("input",{type:"password",value:u.password,onChange:C=>c({...u,password:C.target.value}),className:y})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:w,children:"Zeichensatz"}),a.jsx("input",{value:u.charset,onChange:C=>c({...u,charset:C.target.value}),className:y})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Teste Verbindung…":"Verbindung testen & speichern"})]}),e==="schema"&&a.jsxs("div",{children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),a.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."}),m&&a.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:m.map((C,N)=>a.jsx("li",{children:C},N))}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"button",onClick:x,disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Richte ein…":"Datenbankstruktur einrichten"})]}),e==="admin"&&a.jsxs("form",{onSubmit:p,children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Erster Admin-Account"}),a.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."}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Benutzername"}),a.jsx("input",{required:!0,autoFocus:!0,value:d.username,onChange:C=>h({...d,username:C.target.value}),className:y})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Passwort"}),a.jsx("input",{type:"password",required:!0,minLength:8,value:d.password,onChange:C=>h({...d,password:C.target.value}),className:y})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:w,children:"Passwort wiederholen"}),a.jsx("input",{type:"password",required:!0,minLength:8,value:d.password_confirmation,onChange:C=>h({...d,password_confirmation:C.target.value}),className:y})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Lege an…":"Admin-Account anlegen"})]}),e==="done"&&a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Fertig!"}),a.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."}),a.jsx(O,{to:"/admin/login",className:"inline-block w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Zum Login"})]})]})]})}function uP(){const{user:e,login:t,verifyTwoFactor:n}=Mt(),r=ea(),[s,i]=g.useState("credentials"),[l,o]=g.useState(""),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState(""),[b,v]=g.useState(!1);if(e)return a.jsx(Ws,{to:"/admin",replace:!0});const k=async p=>{p.preventDefault(),v(!0),f("");try{(await t(l,u)).requires2fa?i("code"):r("/admin")}catch(y){f(y.message)}finally{v(!1)}},x=async p=>{p.preventDefault(),v(!0),f("");try{await n(d),r("/admin")}catch(y){f(y.message)}finally{v(!1)}};return a.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:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),a.jsx("img",{src:Ai,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),s==="credentials"?a.jsxs("form",{onSubmit:k,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:[a.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),a.jsx("input",{value:l,onChange:p=>o(p.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"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),a.jsx("input",{type:"password",value:u,onChange:p=>c(p.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"})]}),m&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),a.jsx("button",{type:"submit",disabled:b,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:b?"Anmelden…":"Anmelden"})]}):a.jsxs("form",{onSubmit:x,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:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),a.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."}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),a.jsx("input",{value:d,onChange:p=>h(p.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),a.jsx("button",{type:"submit",disabled:b,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:b?"Prüfe…":"Bestätigen"}),a.jsx("button",{type:"button",onClick:()=>{i("credentials"),h(""),f("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}const cP={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"},dP=({path:e,className:t="h-6 w-6"})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:t,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})});function hP(){const[e,t]=g.useState(null),[n,r]=g.useState("");if(g.useEffect(()=>{M.get("/analytics/report").then(t).catch(i=>r(i.message))},[]),n)return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsx("p",{className:"text-sm text-red-600",children:n})]});if(!e)return null;if(!e.configured)return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Noch nicht eingerichtet. Unter"," ",a.jsx(O,{to:"/admin/settings/website",className:"text-brand-600 hover:underline dark:text-brand-400",children:"Einstellungen → Website"})," ","kannst du die Dashboard-Anbindung konfigurieren, um hier Besucherzahlen zu sehen."]})]});const s=Math.max(1,...e.daily.map(i=>i.pageviews));return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Letzte 7 Tage."}),a.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.users}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Nutzer"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.sessions}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Sitzungen"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.pageviews}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Seitenaufrufe"})]})]}),e.daily.length>0&&a.jsx("div",{className:"mb-6 flex h-24 items-end gap-1.5",children:e.daily.map(i=>a.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[a.jsx("div",{className:"w-full rounded-t bg-brand-400 dark:bg-brand-500",style:{height:`${Math.max(4,i.pageviews/s*80)}px`},title:`${i.date}: ${i.pageviews} Seitenaufrufe`}),a.jsxs("span",{className:"text-[10px] text-neutral-400",children:[i.date.slice(6,8),".",i.date.slice(4,6),"."]})]},i.date))}),e.top_pages.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Meistbesuchte Seiten"}),a.jsx("ul",{className:"space-y-1 text-sm",children:e.top_pages.map(i=>a.jsxs("li",{className:"flex items-center justify-between gap-3 text-neutral-700 dark:text-neutral-300",children:[a.jsx("span",{className:"truncate font-mono text-xs",children:i.path}),a.jsx("span",{className:"shrink-0 font-semibold",children:i.pageviews})]},i.path))})]})]})}function mP(){const{user:e,hasPermission:t}=Mt(),[n,r]=g.useState({});g.useEffect(()=>{t("brands.manage")&&M.get("/brands").then(i=>r(l=>({...l,brands:i.length}))),(t("models.manage")||t("packages.manage"))&&M.get("/models").then(i=>r(l=>({...l,models:i.length}))),t("packages.manage")&&M.get("/packages").then(i=>r(l=>({...l,packages:i.length}))),t("contact.manage")&&M.get("/contact").then(i=>r(l=>({...l,newContacts:i.filter(o=>o.status==="new").length})))},[]);const s=[{key:"brands",label:"Marken",icon:"tag",hint:"Die Hersteller, z. B. Audi oder BMW.",value:n.brands,to:"/admin/brands",show:t("brands.manage")},{key:"models",label:"Modelle",icon:"car",hint:"Die Fahrzeuge einer Marke, z. B. A4.",value:n.models,to:"/admin/models",show:t("models.manage")},{key:"packages",label:"Pakete",icon:"box",hint:"Die Sound-Pakete für ein Modell.",value:n.packages,to:"/admin/packages",show:t("packages.manage")},{key:"contacts",label:"Neue Anfragen",icon:"mail",hint:"Kunden, die noch auf Antwort warten.",value:n.newContacts,to:"/admin/contact-requests",show:t("contact.manage"),highlight:!0}].filter(i=>i.show);return a.jsxs("div",{children:[a.jsxs("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:["Willkommen, ",e==null?void 0:e.username,"!"]}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Hier siehst du auf einen Blick, wie viel in deinem Shop hinterlegt ist. Klicke auf eine Kachel, um dorthin zu gelangen."}),s.length===0?a.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."}):a.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:s.map(i=>a.jsxs(O,{to:i.to,className:`rounded-xl border p-5 shadow-sm transition hover:-translate-y-0.5 hover:shadow-md ${i.highlight&&i.value>0?"border-brand-300 bg-brand-50 dark:border-brand-900 dark:bg-brand-900/20":"border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900"}`,children:[a.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:a.jsx(dP,{path:cP[i.icon]})}),a.jsx("p",{className:"text-sm font-semibold text-neutral-700 dark:text-neutral-200",children:i.label}),a.jsx("p",{className:"mt-1 text-3xl font-extrabold text-brand-600 dark:text-brand-400",children:i.value??"…"}),a.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:i.hint})]},i.key))}),t("settings.manage")&&a.jsx(hP,{})]})}const _f={name:"",sort_order:0};function fP(){const[e,t]=g.useState([]),[n,r]=g.useState(_f),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/brands").then(t);g.useEffect(()=>{u()},[]);const c=f=>{i(f.id),r({name:f.name,sort_order:f.sort_order})},d=()=>{i(null),r(_f)},h=async f=>{f.preventDefault(),o("");try{s?await M.put(`/brands/${s}`,n):await M.post("/brands",n),d(),u()}catch(b){o(b.message)}},m=async f=>{confirm("Marke inkl. aller Modelle/Pakete/Produkte wirklich löschen?")&&(await M.delete(`/brands/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Marken"}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsx(O,{to:`/marken/${f.slug}`,target:"_blank",className:"hover:text-brand-500",children:f.name})}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Marken angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.name,onChange:f=>r({...n,name:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Df={name:"",brand_id:"",sort_order:0};function pP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(Df),[l,o]=g.useState(null),[u,c]=g.useState(""),[d,h]=g.useState("all"),m=g.useMemo(()=>d==="all"?e:e.filter(p=>String(p.brand_id)===d),[e,d]),f=()=>{M.get("/models").then(t),M.get("/brands").then(r)};g.useEffect(f,[]);const b=p=>{o(p.id),i({name:p.name,brand_id:p.brand_id,sort_order:p.sort_order})},v=()=>{o(null),i(Df)},k=async p=>{p.preventDefault(),c("");const y={...s,brand_id:Number(s.brand_id)};try{l?await M.put(`/models/${l}`,y):await M.post("/models",y),v(),f()}catch(w){c(w.message)}},x=async p=>{confirm("Modell inkl. aller Pakete/Produkte wirklich löschen?")&&(await M.delete(`/models/${p}`),f())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Modelle"}),a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),a.jsxs("select",{value:d,onChange:p=>h(p.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),n.map(p=>a.jsx("option",{value:String(p.id),children:p.name},p.id))]}),d!=="all"&&a.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[m.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke"}),a.jsx("th",{className:"px-4 py-2",children:"Modell"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[m.map(p=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:p.brand_name}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.name}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>b(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>x(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),m.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Modelle angelegt.":"Keine Modelle für diese Marke."})})]})]})})]}),a.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:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Modell bearbeiten":"Neues Modell"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),a.jsxs("select",{required:!0,value:s.brand_id,onChange:p=>i({...s,brand_id:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(p=>a.jsx("option",{value:p.id,children:p.name},p.id))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Modellname *"}),a.jsx("input",{required:!0,value:s.name,onChange:p=>i({...s,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:s.sort_order,onChange:p=>i({...s,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:v,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}function pl({value:e,onChange:t,label:n="Bild"}){const[r,s]=g.useState(!1),[i,l]=g.useState(""),o=async u=>{var d;const c=(d=u.target.files)==null?void 0:d[0];if(c){s(!0),l("");try{const h=new FormData;h.append("file",c);const m=await M.post("/uploads",h);t(m.path)}catch(h){l(h.message)}finally{s(!1)}}};return a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:n}),a.jsxs("div",{className:"flex items-center gap-3",children:[e&&a.jsx("img",{src:e,alt:"",className:"h-12 w-12 rounded-md object-cover"}),a.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp",onChange:o,className:"text-sm"}),r&&a.jsx("span",{className:"text-sm text-neutral-500",children:"Lädt hoch…"})]}),i&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:i})]})}const Lf={name:"",cover_image_path:"",sort_order:0};function gP(){const[e,t]=g.useState([]),[n,r]=g.useState(Lf),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/gallery-brands").then(t);g.useEffect(()=>{u()},[]);const c=f=>{i(f.id),r({name:f.name,cover_image_path:f.cover_image_path||"",sort_order:f.sort_order})},d=()=>{i(null),r(Lf)},h=async f=>{f.preventDefault(),o("");try{s?await M.put(`/gallery-brands/${s}`,n):await M.post("/gallery-brands",n),d(),u()}catch(b){o(b.message)}},m=async f=>{confirm("Marke inkl. aller Projekte/Fotos wirklich löschen?")&&(await M.delete(`/gallery-brands/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Marken"}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Bild"}),a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:f.cover_image_path?a.jsx("img",{src:f.cover_image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):a.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:"–"})}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsx(O,{to:`/galerie/${f.slug}`,target:"_blank",className:"hover:text-brand-500",children:f.name})}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Galerie-Marken angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.name,onChange:f=>r({...n,name:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(pl,{value:n.cover_image_path,onChange:f=>r({...n,cover_image_path:f}),label:"Titelbild (optional)"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Bf={name:"",gallery_brand_id:"",cover_image_path:"",sort_order:0};function xP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(Bf),[l,o]=g.useState(null),[u,c]=g.useState(""),[d,h]=g.useState("all"),m=g.useMemo(()=>d==="all"?e:e.filter(p=>String(p.gallery_brand_id)===d),[e,d]),f=()=>{M.get("/gallery-projects").then(t),M.get("/gallery-brands").then(r)};g.useEffect(f,[]);const b=p=>{o(p.id),i({name:p.name,gallery_brand_id:p.gallery_brand_id,cover_image_path:p.cover_image_path||"",sort_order:p.sort_order})},v=()=>{o(null),i(Bf)},k=async p=>{p.preventDefault(),c("");const y={...s,gallery_brand_id:Number(s.gallery_brand_id)};try{l?await M.put(`/gallery-projects/${l}`,y):await M.post("/gallery-projects",y),v(),f()}catch(w){c(w.message)}},x=async p=>{confirm("Projekt inkl. aller Fotos wirklich löschen?")&&(await M.delete(`/gallery-projects/${p}`),f())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Projekte"}),a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),a.jsxs("select",{value:d,onChange:p=>h(p.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),n.map(p=>a.jsx("option",{value:String(p.id),children:p.name},p.id))]}),d!=="all"&&a.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[m.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke"}),a.jsx("th",{className:"px-4 py-2",children:"Projekt"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[m.map(p=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:p.brand_name}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.name}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx(O,{to:`/admin/gallery-projects/${p.id}/photos`,className:"mr-3 text-brand-600 hover:underline",children:"Fotos"}),a.jsx("button",{onClick:()=>b(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>x(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),m.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Projekte angelegt.":"Keine Projekte für diese Marke."})})]})]})})]}),a.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:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Projekt bearbeiten":"Neues Projekt"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),a.jsxs("select",{required:!0,value:s.gallery_brand_id,onChange:p=>i({...s,gallery_brand_id:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(p=>a.jsx("option",{value:p.id,children:p.name},p.id))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Projektname *"}),a.jsx("input",{required:!0,placeholder:"z. B. Audi TT",value:s.name,onChange:p=>i({...s,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(pl,{value:s.cover_image_path,onChange:p=>i({...s,cover_image_path:p}),label:"Titelbild (optional)"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:s.sort_order,onChange:p=>i({...s,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:v,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}function bP(){const{projectId:e}=$n(),[t,n]=g.useState([]),[r,s]=g.useState(""),[i,l]=g.useState(!1),[o,u]=g.useState(""),c=g.useRef(null),d=()=>M.get(`/gallery-projects/${e}/photos`).then(n);g.useEffect(()=>{d()},[e]);const h=async k=>{const x=Array.from(k.target.files||[]);if(x.length!==0){s(""),l(!0);try{for(let p=0;p{n(p=>p.map(y=>y.id===k.id?{...y,caption:x}:y))},f=(k,x)=>{n(p=>p.map(y=>y.id===k.id?{...y,sort_order:x}:y))},b=async k=>{await M.put(`/gallery-photos/${k.id}`,{caption:k.caption,sort_order:k.sort_order}),d()},v=async k=>{confirm("Foto wirklich entfernen?")&&(await M.delete(`/gallery-photos/${k}`),d())};return a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(O,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Fotos im Projekt"}),a.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),a.jsx("input",{ref:c,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:h,disabled:i,className:"text-sm"}),i&&a.jsx("p",{className:"mt-2 text-sm text-neutral-500",children:o})]}),r&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:r}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:[t.map(k=>a.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("img",{src:k.image_path,alt:k.caption||"",className:"aspect-square w-full object-cover"}),a.jsxs("div",{className:"space-y-2 p-3",children:[a.jsx("input",{value:k.caption||"",onChange:x=>m(k,x.target.value),onBlur:()=>b(k),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"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"number",value:k.sort_order,onChange:x=>f(k,Number(x.target.value)),onBlur:()=>b(k),className:"w-16 rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{onClick:()=>v(k.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]},k.id)),t.length===0&&a.jsx("p",{className:"col-span-full py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})]})}const yP=["Base","Clear","Drive","Prime","Elite","Apex","The Statement","Limitless"],vP=e=>(e+1)*10,Ba="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",qu=e=>({description:e.description||"",markup_type:e.markup_type||"none",markup_value:e.markup_value||0,icon_name:e.icon_name||"",tagline:e.tagline||"",price_text:e.price_text||"",is_featured:!!e.is_featured,sort_order:e.sort_order??0}),kP=e=>({description:"",markup_type:"none",markup_value:0,icon_name:"",tagline:"",price_text:"",is_featured:!1,sort_order:vP(e)}),wP=["description","markup_type","markup_value","icon_name","tagline","price_text","is_featured","sort_order"],go=e=>{if(!e.existing)return e.checked;const t=qu(e.existing);return wP.some(n=>n==="is_featured"?!!t[n]!=!!e.form[n]:String(t[n])!==String(e.form[n]))},ts=(e,t)=>{const n=t.filter(l=>l.car_model_id===e).slice().sort((l,o)=>l.sort_order-o.sort_order||l.name.localeCompare(o.name)),r=new Set,s=yP.map((l,o)=>{const u=n.find(c=>!r.has(c.id)&&c.name.trim().toLowerCase()===l.toLowerCase());return u&&r.add(u.id),{key:`tier-${o}`,tierName:l,existing:u||null,checked:!!u,form:u?qu(u):kP(o)}}),i=n.filter(l=>!r.has(l.id)).map(l=>({key:`legacy-${l.id}`,tierName:null,existing:l,checked:!0,form:qu(l)}));return[...s,...i]},jP=e=>{e.target.style.height="auto",e.target.style.height=`${e.target.scrollHeight}px`};function NP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(""),[l,o]=g.useState(""),[u,c]=g.useState([]),[d,h]=g.useState({}),[m,f]=g.useState(!1),[b,v]=g.useState(null),[k,x]=g.useState(""),[p,y]=g.useState(!1),[w,j]=g.useState(null),[P,C]=g.useState("all"),[N,S]=g.useState("all"),E=async()=>{const[A,W]=await Promise.all([M.get("/packages"),M.get("/models")]);return t(A),r(W),A};g.useEffect(()=>{E()},[]);const T=g.useMemo(()=>new Map(n.map(A=>[A.id,A])),[n]),R=g.useMemo(()=>{const A=new Map;return n.forEach(W=>{A.has(W.brand_id)||A.set(W.brand_id,W.brand_name)}),Array.from(A,([W,G])=>({id:W,name:G})).sort((W,G)=>W.name.localeCompare(G.name))},[n]),U=g.useMemo(()=>n.filter(A=>!s||String(A.brand_id)===s).sort((A,W)=>A.name.localeCompare(W.name)),[n,s]),Y=l?T.get(Number(l)):null,J=g.useMemo(()=>u.some(go),[u]),I=()=>!J||confirm("Ungespeicherte Änderungen verwerfen?"),X=(A,W,G=e)=>{i(String(A)),o(String(W)),c(ts(Number(W),G)),h({}),v(null),x(""),j(null)},_=A=>{I()&&(i(A),o(""),c([]),h({}),v(null),j(null))},L=A=>{if(!I())return;if(!A){o(""),c([]);return}const W=T.get(Number(A));X(W?W.brand_id:s,A)},F=(A,W)=>c(G=>G.map(Le=>Le.key===A?{...Le,checked:W}:Le)),V=(A,W)=>c(G=>G.map(Le=>Le.key===A?{...Le,form:{...Le.form,...W}}:Le)),$=A=>({name:A.tierName??A.existing.name,car_model_id:Number(l),...A.form,markup_value:Number(A.form.markup_value),sort_order:Number(A.form.sort_order)}),Je=async()=>{f(!0),v(null);const A={},W=u;let G=0,Le=0;for(const We of u)try{We.existing?go(We)&&(await M.put(`/packages/${We.existing.id}`,$(We)),Le+=1):We.checked&&(await M.post("/packages",$(We)),G+=1)}catch(Hr){A[We.key]=Hr.message}const da=await E(),kl=ts(Number(l),da).map(We=>{if(!A[We.key])return We;const Hr=W.find(Mb=>Mb.key===We.key);return Hr?{...We,checked:Hr.checked,form:Hr.form}:We});c(kl),h(A);const Wr=Object.keys(A).length,Kt=[];G&&Kt.push(`${G} neu angelegt`),Le&&Kt.push(`${Le} aktualisiert`),!Kt.length&&!Wr&&Kt.push("Keine Änderungen"),v(Wr?{kind:"error",text:`${Kt.join(", ")||"Nichts gespeichert"} – ${Wr} Paket(e) fehlgeschlagen (Details an der Zeile).`}:{kind:"ok",text:`${Kt.join(", ")}.`}),f(!1)},ut=async A=>{if(!confirm(`Paket "${A.tierName??A.existing.name}" inkl. aller Produkte wirklich löschen?`))return;await M.delete(`/packages/${A.existing.id}`);const W=await E();c(ts(Number(l),W)),v(null)},Ur=async A=>{if(!confirm("Paket inkl. aller Produkte wirklich löschen?"))return;await M.delete(`/packages/${A.id}`);const W=await E();l&&c(ts(Number(l),W))},Dt=async()=>{if(!k||!I())return;const A=T.get(Number(k)),W=T.get(Number(l));if(confirm(`Alle Pakete von "${A.brand_name} ${A.name}" inkl. verknüpfter Produkte nach "${W.brand_name} ${W.name}" kopieren?
-Bereits vorhandene Paketstufen werden übersprungen. Upgrades werden nicht mitkopiert.`)){v(!0),j(null);try{const G=await M.post(`/models/${l}/copy-packages`,{source_model_id:Number(k)}),Le=G.copied.reduce((Wr,Kt)=>Wr+Kt.products,0),da=[`${G.copied.length} Paket(e) kopiert (${Le} Produkte)`];G.skipped.length&&da.push(`übersprungen: ${G.skipped.join(", ")}`),j({text:`${da.join(" – ")}.`});const kl=await E();c(ts(Number(l),kl)),h({})}catch(G){j({error:G.message})}v(!1)}},Gn=u.filter(A=>!A.existing&&A.checked).length,Tb=u.filter(A=>A.existing&&go(A)).length,Ab=g.useMemo(()=>n.filter(A=>P==="all"||String(A.brand_id)===P).sort((A,W)=>A.name.localeCompare(W.name)),[n,P]),yl=g.useMemo(()=>e.filter(A=>{const W=T.get(A.car_model_id);return!(P!=="all"&&String(W==null?void 0:W.brand_id)!==P||N!=="all"&&String(A.car_model_id)!==N)}),[e,T,P,N]),Td=a.jsxs("div",{children:[a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Filtern:"}),a.jsxs("select",{value:P,onChange:A=>{C(A.target.value),S("all")},className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),I.map(A=>a.jsx("option",{value:String(A.id),children:A.name},A.id))]}),a.jsxs("select",{value:N,onChange:A=>S(A.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:[a.jsx("option",{value:"all",children:"Alle Modelle"}),Ab.map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]}),(P!=="all"||N!=="all")&&a.jsx("button",{onClick:()=>{C("all"),S("all")},className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[yl.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke / Modell"}),a.jsx("th",{className:"px-4 py-2",children:"Paket"}),a.jsx("th",{className:"px-4 py-2",children:"Aufschlag"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[yl.map(A=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[A.brand_name," ",A.model_name]}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[A.name,A.is_featured&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"})]})}),a.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[A.markup_type==="fixed"&&`+${A.markup_value} €`,A.markup_type==="percent"&&`+${A.markup_value} %`,(!A.markup_type||A.markup_type==="none")&&"–"]}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx(O,{to:`/admin/packages/${A.id}/products`,className:"mr-3 text-brand-600 hover:underline",children:"Produkte"}),a.jsx(O,{to:`/admin/packages/${A.id}/upgrades`,className:"mr-3 text-brand-600 hover:underline",children:"Upgrades"}),a.jsx("button",{onClick:()=>{if(!R())return;const W=T.get(A.car_model_id);X(W.brand_id,A.car_model_id),window.scrollTo({top:0,behavior:"smooth"})},className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>Ur(A),className:"text-red-600 hover:underline",children:"Löschen"})]})]},A.id)),yl.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Pakete angelegt.":"Keine Pakete für diesen Filter."})})]})]})})]});return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Pakete"}),a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-3 font-bold text-neutral-900 dark:text-white",children:"Modell wählen"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("select",{value:s,onChange:A=>_(A.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Marke wählen…"}),I.map(A=>a.jsx("option",{value:String(A.id),children:A.name},A.id))]}),a.jsxs("select",{value:l,onChange:A=>L(A.target.value),className:"min-w-[220px] rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Modell wählen…"}),U.map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]})]}),!l&&a.jsx("p",{className:"mt-2 text-sm text-neutral-500 dark:text-neutral-400",children:"Modell auswählen, um dessen Pakete anzulegen oder zu bearbeiten – die Standard-Paketstufen stehen dann als Checkliste bereit."})]}),Y&&a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"border-b border-neutral-200 px-5 py-4 dark:border-neutral-800",children:[a.jsxs("h2",{className:"font-bold text-neutral-900 dark:text-white",children:["Pakete für ",Y.brand_name," ",Y.name]}),a.jsx("p",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:"Paketstufen anhaken, Beschreibung und Aufschlag ausfüllen, unten alles auf einmal speichern."}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 rounded-lg border border-neutral-200 bg-neutral-50 px-3 py-2.5 dark:border-neutral-800 dark:bg-neutral-950",children:[a.jsx("span",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Pakete von anderem Modell kopieren:"}),a.jsxs("select",{value:k,onChange:A=>x(A.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:[a.jsx("option",{value:"",children:"Quellmodell wählen…"}),n.filter(A=>String(A.id)!==l).sort((A,W)=>`${A.brand_name} ${A.name}`.localeCompare(`${W.brand_name} ${W.name}`)).map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]}),a.jsx("button",{type:"button",onClick:Dt,disabled:!k||p,className:"rounded-md border border-brand-500 px-3 py-1.5 text-sm font-semibold text-brand-600 hover:bg-brand-50 disabled:opacity-50 dark:hover:bg-brand-900/20",children:p?"Kopiert…":"Kopieren"}),a.jsx("span",{className:"text-xs text-neutral-400",children:"inkl. Produkte, ohne Upgrades"}),w&&a.jsx("span",{className:`w-full text-sm ${w.error?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:w.error||w.text})]})]}),a.jsx("div",{children:u.map((A,W)=>a.jsxs("div",{children:[A.tierName===null&&W>0&&u[W-1].tierName!==null&&a.jsx("div",{className:"border-t border-neutral-200 bg-neutral-50 px-5 py-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-400",children:"Weitere Pakete (alte Namen)"}),a.jsxs("div",{className:`border-t border-neutral-100 dark:border-neutral-800 ${A.checked?"":"opacity-70"}`,children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-5 py-3",children:[a.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[a.jsx("input",{type:"checkbox",checked:A.checked,disabled:!!A.existing||m,onChange:G=>F(A.key,G.target.checked),className:"h-5 w-5 rounded border-neutral-300 text-brand-600 focus:ring-brand-500 disabled:opacity-60"}),a.jsx("span",{className:"font-semibold text-neutral-900 dark:text-white",children:A.tierName??A.existing.name})]}),A.tierName===null&&a.jsx("span",{className:"text-xs text-neutral-400",children:"(alter Name)"}),A.existing?a.jsx("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-semibold text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:"Vorhanden"}):A.checked&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Neu"}),A.form.is_featured&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"}),A.existing&&a.jsxs("span",{className:"ml-auto flex items-center gap-3 text-sm",children:[a.jsx(O,{to:`/admin/packages/${A.existing.id}/products`,className:"text-brand-600 hover:underline",children:"Produkte"}),a.jsx(O,{to:`/admin/packages/${A.existing.id}/upgrades`,className:"text-brand-600 hover:underline",children:"Upgrades"}),a.jsx("button",{type:"button",onClick:()=>ut(A),className:"text-red-600 hover:underline",children:"Löschen"})]})]}),A.checked&&a.jsxs("div",{className:"space-y-4 px-5 pb-5 sm:pl-[52px]",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("p",{className:"mb-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Jede Zeile erscheint als eigener Stichpunkt zusammen mit den Bauteilen."}),a.jsx("textarea",{rows:10,value:A.form.description,onChange:G=>V(A.key,{description:G.target.value}),onInput:CP,className:Ba})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aufschlag"}),a.jsxs("div",{className:"flex max-w-md gap-2",children:[a.jsxs("select",{value:A.form.markup_type,onChange:G=>V(A.key,{markup_type:G.target.value}),className:"w-40 rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"none",children:"Kein Aufschlag"}),a.jsx("option",{value:"fixed",children:"Fester Betrag (€)"}),a.jsx("option",{value:"percent",children:"Prozent (%)"})]}),a.jsx("input",{type:"number",step:"0.01",min:"0",disabled:A.form.markup_type==="none",value:A.form.markup_value,onChange:G=>V(A.key,{markup_value:G.target.value}),className:`${Ba} disabled:opacity-50`})]}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Wird auf die Summe der Bauteilpreise aufgeschlagen und ergibt den Gesamtpreis für den Kunden."})]}),a.jsxs("details",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800",children:[a.jsx("summary",{className:"cursor-pointer select-none px-3 py-2 text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Weitere Optionen (Preis-Text, Empfohlen, Sortierung)"}),a.jsxs("div",{className:"space-y-4 border-t border-neutral-200 p-3 dark:border-neutral-800",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis-Text (optional)"}),a.jsx("input",{value:A.form.price_text,onChange:G=>V(A.key,{price_text:G.target.value}),placeholder:'z. B. "Coming soon" oder "Preis auf Anfrage"',className:Ba}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Ersetzt auf der Kachel den berechneten Preis, solange ausgefüllt."})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:A.form.is_featured,onChange:G=>V(A.key,{is_featured:G.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Als empfohlen hervorheben"]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:A.form.sort_order,onChange:G=>V(A.key,{sort_order:G.target.value}),className:`${Ba} max-w-[160px]`})]})]})]}),d[A.key]&&a.jsx("p",{className:"text-sm text-red-600",children:d[A.key]})]})]})]},A.key))}),a.jsxs("div",{className:"sticky bottom-0 flex flex-wrap items-center gap-3 rounded-b-xl border-t border-neutral-200 bg-white px-5 py-3 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("button",{type:"button",onClick:Je,disabled:m||!J,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:m?"Speichert…":"Alle speichern"}),a.jsxs("span",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:[Gn," neu, ",Tb," geändert"]}),b&&a.jsx("span",{className:`text-sm ${b.kind==="error"?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:b.text})]})]}),Y?a.jsxs("details",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("summary",{className:"cursor-pointer select-none px-5 py-3 font-bold text-neutral-900 dark:text-white",children:"Alle Pakete (Übersicht)"}),a.jsx("div",{className:"border-t border-neutral-200 p-5 dark:border-neutral-800",children:Td})]}):Td]})}const za=[...Vb].sort(),EP=120,TP=200;function AP({value:e,onChange:t}){const[n,r]=g.useState(""),s=g.useMemo(()=>{const i=n.trim().toLowerCase();return i?za.filter(l=>l.includes(i)).slice(0,TP):za.slice(0,EP)},[n]);return a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center gap-3 rounded-md border border-neutral-300 p-2 dark:border-neutral-700",children:[a.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:e?a.jsx(Re,{name:e,className:"h-6 w-6"}):a.jsx("span",{className:"text-xs text-neutral-400",children:"?"})}),a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:e||"Kein Icon gewählt"}),a.jsxs("p",{className:"text-xs text-neutral-400",children:[za.length," Icons verfügbar"]})]})]}),a.jsx("input",{value:n,onChange:i=>r(i.target.value),placeholder:"Icon suchen (z. B. car, shield, zap)…",className:"mb-2 w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsxs("div",{className:"grid max-h-64 grid-cols-6 gap-1 overflow-y-auto rounded-md border border-neutral-200 p-2 sm:grid-cols-8 dark:border-neutral-700",children:[s.map(i=>a.jsx("button",{type:"button",title:i,onClick:()=>t(i),className:`flex h-10 w-10 items-center justify-center rounded-md transition ${e===i?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:a.jsx(Re,{name:i,className:"h-5 w-5"})},i)),s.length===0&&a.jsx("p",{className:"col-span-full py-4 text-center text-sm text-neutral-400",children:"Keine Icons gefunden."})]}),!n&&a.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Tipp: Tippe einen Suchbegriff ein, um alle ",za.length," Icons zu durchsuchen."]})]})}const zf={icon_name:"",title:"",description:"",image_path:"",cta_label:"",cta_url:"",sort_order:0};function MP(){const[e,t]=g.useState([]),[n,r]=g.useState(zf),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/services").then(t);g.useEffect(u,[]);const c=f=>{i(f.id),r({icon_name:f.icon_name,title:f.title,description:f.description,image_path:f.image_path||"",cta_label:f.cta_label||"",cta_url:f.cta_url||"",sort_order:f.sort_order})},d=()=>{i(null),r(zf)},h=async f=>{if(f.preventDefault(),o(""),!n.icon_name){o("Bitte ein Icon auswählen");return}const b={...n,sort_order:Number(n.sort_order)};try{s?await M.put(`/services/${s}`,b):await M.post("/services",b),d(),u()}catch(y){o(y.message)}},m=async f=>{confirm("Diese Leistung wirklich löschen?")&&(await M.delete(`/services/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Leistungen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Karten erscheinen auf der öffentlichen Leistungen-Seite. Die 8 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Icon"}),a.jsx("th",{className:"px-4 py-2",children:"Titel"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:a.jsx(Re,{name:f.icon_name,className:"h-5 w-5"})})}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:f.title}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Leistungen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Leistung bearbeiten":"Neue Leistung"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Icon *"}),a.jsx(AP,{value:n.icon_name,onChange:f=>r({...n,icon_name:f})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.title,onChange:f=>r({...n,title:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung *"}),a.jsx("textarea",{required:!0,rows:4,value:n.description,onChange:f=>r({...n,description:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(pl,{value:n.image_path,onChange:f=>r({...n,image_path:f}),label:"Bild"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Text (optional)"}),a.jsx("input",{value:n.cta_label,onChange:f=>r({...n,cta_label:f.target.value}),placeholder:"z. B. Fahrzeug konfigurieren",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Link (optional)"}),a.jsx("input",{value:n.cta_url,onChange:f=>r({...n,cta_url:f.target.value}),placeholder:"z. B. /fahrzeuge",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const If={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function _P(){const[e,t]=g.useState([]),[n,r]=g.useState(If),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/faqs").then(t);g.useEffect(u,[]);const c=f=>{i(f.id),r({question_de:f.question_de,answer_de:f.answer_de,question_en:f.question_en,answer_en:f.answer_en,sort_order:f.sort_order})},d=()=>{i(null),r(If)},h=async f=>{f.preventDefault(),o("");const b={...n,sort_order:Number(n.sort_order)};try{s?await M.put(`/faqs/${s}`,b):await M.post("/faqs",b),d(),u()}catch(y){o(y.message)}},m=async f=>{confirm("Diese Frage wirklich löschen?")&&(await M.delete(`/faqs/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Häufig gestellte Fragen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Fragen erscheinen im FAQ-Bereich der Startseite, jeweils in der aktuell gewählten Sprache. Die 6 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Frage (DE)"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:f.question_de}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Fragen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Frage bearbeiten":"Neue Frage"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Deutsch) *"}),a.jsx("input",{required:!0,value:n.question_de,onChange:f=>r({...n,question_de:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Deutsch) *"}),a.jsx("textarea",{required:!0,rows:3,value:n.answer_de,onChange:f=>r({...n,answer_de:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Englisch) *"}),a.jsx("input",{required:!0,value:n.question_en,onChange:f=>r({...n,question_en:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Englisch) *"}),a.jsx("textarea",{required:!0,rows:3,value:n.answer_en,onChange:f=>r({...n,answer_en:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const DP=e=>e==null?"–":new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),LP={ok:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"};function BP(){const{packageId:e}=$n(),[t,n]=g.useState([]),[r,s]=g.useState(""),[i,l]=g.useState(""),[o,u]=g.useState(""),[c,d]=g.useState(!1),h=()=>M.get(`/packages/${e}/products`).then(n);g.useEffect(()=>{h()},[e]);const m=async y=>{y.preventDefault(),u(""),d(!0);try{await M.post("/products",{package_id:Number(e),source_url:r,name_override:i||null}),s(""),l(""),h()}catch(k){u(k.message)}finally{d(!1)}},f=async y=>{d(!0);try{await M.post(`/products/${y}/refresh-price`,{}),h()}finally{d(!1)}},b=async y=>{confirm("Produkt wirklich entfernen?")&&(await M.delete(`/products/${y}`),h())};return a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(O,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Produkte im Paket"}),a.jsxs("form",{onSubmit:m,className:"mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"flex-1 min-w-[240px]",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"audio4cars.de Produkt-URL *"}),a.jsx("input",{required:!0,type:"url",placeholder:"https://www.audio4cars.de/produkt/...",value:r,onChange:y=>s(y.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{className:"w-56",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name überschreiben (optional)"}),a.jsx("input",{value:i,onChange:y=>l(y.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx("button",{disabled:c,type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Hinzufügen"})]}),o&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:o}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Produkt"}),a.jsx("th",{className:"px-4 py-2",children:"Preis"}),a.jsx("th",{className:"px-4 py-2",children:"Status"}),a.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktualisiert"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(y=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("a",{href:y.source_url,target:"_blank",rel:"noreferrer",className:"font-medium text-neutral-800 hover:underline dark:text-neutral-100",children:y.name_override||y.scraped_name||y.source_url}),y.scrape_status==="error"&&a.jsx("p",{className:"text-xs text-red-500",children:y.scrape_error})]}),a.jsx("td",{className:"px-4 py-2",children:DP(y.scraped_price)}),a.jsx("td",{className:"px-4 py-2",children:a.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${LP[y.scrape_status]}`,children:y.scrape_status})}),a.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:y.price_updated_at?new Date(y.price_updated_at.replace(" ","T")).toLocaleString("de-DE"):"–"}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{disabled:c,onClick:()=>f(y.id),className:"mr-3 text-brand-600 hover:underline disabled:opacity-60",children:"Preis aktualisieren"}),a.jsx("button",{onClick:()=>b(y.id),className:"text-red-600 hover:underline",children:"Entfernen"})]})]},y.id)),t.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Produkte im Paket."})})]})]})})]})}const zP=e=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),Rf={name:"",description:"",price:0,sort_order:0};function IP(){const{packageId:e}=$n(),[t,n]=g.useState([]),[r,s]=g.useState(Rf),[i,l]=g.useState(null),[o,u]=g.useState(""),c=()=>M.get(`/packages/${e}/upgrades`).then(n);g.useEffect(()=>{c()},[e]);const d=b=>{l(b.id),s({name:b.name,description:b.description||"",price:b.price,sort_order:b.sort_order})},h=()=>{l(null),s(Rf)},m=async b=>{b.preventDefault(),u("");const y={...r,package_id:Number(e),price:Number(r.price)};try{i?await M.put(`/package-upgrades/${i}`,y):await M.post("/package-upgrades",y),h(),c()}catch(k){u(k.message)}},f=async b=>{confirm("Upgrade wirklich löschen?")&&(await M.delete(`/package-upgrades/${b}`),c())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(O,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Optionale Upgrades"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Upgrades erscheinen nicht in der öffentlichen Paketübersicht, sondern erst als Auswahl im Kontaktformular."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Preis"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(b=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:b.name}),b.description&&a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:b.description})]}),a.jsx("td",{className:"px-4 py-2",children:zP(b.price)}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>d(b),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>f(b.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},b.id)),t.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Upgrades hinterlegt."})})]})]})})]}),a.jsxs("form",{onSubmit:m,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:i?"Upgrade bearbeiten":"Neues Upgrade"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:r.name,onChange:b=>s({...r,name:b.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("textarea",{rows:2,value:r.description,onChange:b=>s({...r,description:b.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis (€) *"}),a.jsx("input",{required:!0,type:"number",step:"0.01",min:"0",value:r.price,onChange:b=>s({...r,price:b.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:r.sort_order,onChange:b=>s({...r,sort_order:Number(b.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&a.jsx("p",{className:"text-sm text-red-600",children:o}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:i?"Speichern":"Anlegen"}),i&&a.jsx("button",{type:"button",onClick:h,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const RP=e=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),FP={new:"Neu",in_progress:"In Bearbeitung",done:"Erledigt"},VP={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"},OP=()=>a.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:a.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 UP(){const{hasPermission:e}=Mt(),[t,n]=g.useState([]),[r,s]=g.useState("all"),i=()=>M.get("/contact").then(n);g.useEffect(()=>{i()},[]);const l=async(h,m)=>{await M.patch(`/contact/${h}`,{status:m}),i()},o=async h=>{confirm("Diese Kontaktanfrage wirklich unwiderruflich löschen?")&&(await M.delete(`/contact/${h}`),i())},u=g.useMemo(()=>({all:t.length,new:t.filter(h=>h.status==="new").length,in_progress:t.filter(h=>h.status==="in_progress").length,done:t.filter(h=>h.status==="done").length}),[t]),c=r==="all"?t:t.filter(h=>h.status===r),d=[{value:"all",label:"Alle"},{value:"new",label:"Neu"},{value:"in_progress",label:"In Bearbeitung"},{value:"done",label:"Erledigt"}];return a.jsxs("div",{children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Kontaktanfragen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Alle Anfragen deiner Kunden. Wähle oben einen Reiter, um nur bestimmte Anfragen zu sehen."}),a.jsx("div",{className:"mb-5 flex flex-wrap gap-2",children:d.map(h=>a.jsxs("button",{onClick:()=>s(h.value),className:`rounded-full px-4 py-1.5 text-sm font-medium transition ${r===h.value?"bg-brand-500 text-white":"bg-neutral-100 text-neutral-600 hover:bg-neutral-200 dark:bg-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-700"}`,children:[h.label," (",u[h.value],")"]},h.value))}),a.jsxs("div",{className:"space-y-3",children:[c.map(h=>{var m;return a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-2 flex flex-wrap items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("p",{className:"font-semibold text-neutral-800 dark:text-neutral-100",children:[h.name," · ",h.email,h.phone?` · ${h.phone}`:""]}),h.vin&&a.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["FIN: ",a.jsx("span",{className:"font-mono",children:h.vin})]}),a.jsx("p",{className:"text-xs text-neutral-400",children:new Date(h.created_at.replace(" ","T")).toLocaleString("de-DE")})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("select",{value:h.status,onChange:f=>l(h.id,f.target.value),className:`rounded-full border-0 px-3 py-1 text-xs font-medium ${VP[h.status]}`,children:Object.entries(FP).map(([f,b])=>a.jsx("option",{value:f,children:b},f))}),e("contact.delete")&&a.jsx("button",{onClick:()=>o(h.id),"aria-label":"Anfrage löschen",title:"Anfrage löschen",className:"rounded-md p-1.5 text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20",children:a.jsx(OP,{})})]})]}),(h.brand_name||h.model_name||h.package_name||h.product_name)&&a.jsx("p",{className:"mb-2 text-sm text-neutral-500 dark:text-neutral-400",children:[h.brand_name,h.model_name,h.package_name,h.product_name].filter(Boolean).join(" · ")}),((m=h.selected_upgrades)==null?void 0:m.length)>0&&a.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:[a.jsx("p",{className:"font-semibold",children:"Gewünschte Upgrades:"}),a.jsx("ul",{className:"list-disc pl-5",children:h.selected_upgrades.map(f=>a.jsxs("li",{children:[f.name," – ",RP(f.price)]},f.id))})]}),h.message&&a.jsx("p",{className:"text-sm text-neutral-700 dark:text-neutral-300",children:h.message})]},h.id)}),c.length===0&&a.jsx("p",{className:"text-neutral-400",children:r==="all"?"Noch keine Kontaktanfragen eingegangen.":"Keine Anfragen mit diesem Status."})]})]})}var ua={},WP=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},mb={},Qe={};let Nd;const HP=[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];Qe.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};Qe.getSymbolTotalCodewords=function(t){return HP[t]};Qe.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};Qe.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Nd=t};Qe.isKanjiModeEnabled=function(){return typeof Nd<"u"};Qe.toSJIS=function(t){return Nd(t)};var gl={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.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: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,s){if(e.isValid(r))return r;try{return t(r)}catch{return s}}})(gl);function fb(){this.buffer=[],this.length=0}fb.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 n=0;n>>t-n-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 $P=fb;function ca(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)}ca.prototype.set=function(e,t,n,r){const s=e*this.size+t;this.data[s]=n,r&&(this.reservedBit[s]=!0)};ca.prototype.get=function(e,t){return this.data[e*this.size+t]};ca.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};ca.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var GP=ca,pb={};(function(e){const t=Qe.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,i=t(r),l=i===145?26:Math.ceil((i-13)/(2*s-2))*2,o=[i-7];for(let u=1;u=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const i=s.size;let l=0,o=0,u=0,c=null,d=null;for(let h=0;h=5&&(l+=t.N1+(o-5)),c=f,o=1),f=s.get(m,h),f===d?u++:(u>=5&&(l+=t.N1+(u-5)),d=f,u=1)}o>=5&&(l+=t.N1+(o-5)),u>=5&&(l+=t.N1+(u-5))}return l},e.getPenaltyN2=function(s){const i=s.size;let l=0;for(let o=0;o=10&&(o===1488||o===93)&&l++,u=u<<1&2047|s.get(d,c),d>=10&&(u===1488||u===93)&&l++}return l*t.N3},e.getPenaltyN4=function(s){let i=0;const l=s.data.length;for(let u=0;u=0;){const l=i[0];for(let u=0;u0){const i=new Uint8Array(this.degree);return i.set(r,s),i}return r};var qP=Sd,yb={},Nn={},Cd={};Cd.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var _t={};const kb="[0-9]+",YP="[A-Z $%*+\\-./:]+";let Ys="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ys=Ys.replace(/u/g,"\\u");const XP="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ys+`)(?:.|[\r
-]))+`;_t.KANJI=new RegExp(Ys,"g");_t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");_t.BYTE=new RegExp(XP,"g");_t.NUMERIC=new RegExp(kb,"g");_t.ALPHANUMERIC=new RegExp(YP,"g");const ZP=new RegExp("^"+Ys+"$"),QP=new RegExp("^"+kb+"$"),JP=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");_t.testKanji=function(t){return ZP.test(t)};_t.testNumeric=function(t){return QP.test(t)};_t.testAlphanumeric=function(t){return JP.test(t)};(function(e){const t=Cd,n=_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(i,l){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(l))throw new Error("Invalid version: "+l);return l>=1&&l<10?i.ccBits[0]:l<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(i,l){if(e.isValid(i))return i;try{return r(i)}catch{return l}}})(Nn);(function(e){const t=Qe,n=xl,r=gl,s=Nn,i=Cd,l=7973,o=t.getBCHDigit(l);function u(m,f,b){for(let y=1;y<=40;y++)if(f<=e.getCapacity(y,b,m))return y}function c(m,f){return s.getCharCountIndicator(m,f)+4}function d(m,f){let b=0;return m.forEach(function(y){const k=c(y.mode,f);b+=k+y.getBitsLength()}),b}function h(m,f){for(let b=1;b<=40;b++)if(d(m,b)<=e.getCapacity(b,f,s.MIXED))return b}e.from=function(f,b){return i.isValid(f)?parseInt(f,10):b},e.getCapacity=function(f,b,y){if(!i.isValid(f))throw new Error("Invalid QR Code version");typeof y>"u"&&(y=s.BYTE);const k=t.getSymbolTotalCodewords(f),x=n.getTotalCodewordsCount(f,b),p=(k-x)*8;if(y===s.MIXED)return p;const v=p-c(y,f);switch(y){case s.NUMERIC:return Math.floor(v/10*3);case s.ALPHANUMERIC:return Math.floor(v/11*2);case s.KANJI:return Math.floor(v/13);case s.BYTE:default:return Math.floor(v/8)}},e.getBestVersionForData=function(f,b){let y;const k=r.from(b,r.M);if(Array.isArray(f)){if(f.length>1)return h(f,k);if(f.length===0)return 1;y=f[0]}else y=f;return u(y.mode,y.getLength(),k)},e.getEncodedBits=function(f){if(!i.isValid(f)||f<7)throw new Error("Invalid QR Code version");let b=f<<12;for(;t.getBCHDigit(b)-o>=0;)b^=l<=0;)s^=jb<0&&(r=this.data.substr(n),s=parseInt(r,10),t.put(s,i*3+1))};var n4=Tr;const r4=Nn,xo=["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 Ar(e){this.mode=r4.ALPHANUMERIC,this.data=e}Ar.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Ar.prototype.getLength=function(){return this.data.length};Ar.prototype.getBitsLength=function(){return Ar.getBitsLength(this.data.length)};Ar.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=xo.indexOf(this.data[n])*45;r+=xo.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(xo.indexOf(this.data[n]),6)};var s4=Ar;const a4=Nn;function Mr(e){this.mode=a4.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}Mr.getBitsLength=function(t){return t*8};Mr.prototype.getLength=function(){return this.data.length};Mr.prototype.getBitsLength=function(){return Mr.getBitsLength(this.data.length)};Mr.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
-Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var u4=_r,Sb={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,r,s){var i={},l={};l[r]=0;var o=t.PriorityQueue.make();o.push(r,0);for(var u,c,d,h,m,f,b,y,k;!o.empty();){u=o.pop(),c=u.value,h=u.cost,m=n[c]||{};for(d in m)m.hasOwnProperty(d)&&(f=m[d],b=h+f,y=l[d],k=typeof l[d]>"u",(k||y>b)&&(l[d]=b,o.push(d,b),i[d]=c))}if(typeof s<"u"&&typeof l[s]>"u"){var x=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(x)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],i=r;i;)s.push(i),n[i],i=n[i];return s.reverse(),s},find_path:function(n,r,s){var i=t.single_source_shortest_paths(n,r,s);return t.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,s={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Sb);var c4=Sb.exports;(function(e){const t=Nn,n=n4,r=s4,s=i4,i=u4,l=_t,o=Qe,u=c4;function c(x){return unescape(encodeURIComponent(x)).length}function d(x,p,v){const w=[];let j;for(;(j=x.exec(v))!==null;)w.push({data:j[0],index:j.index,mode:p,length:j[0].length});return w}function h(x){const p=d(l.NUMERIC,t.NUMERIC,x),v=d(l.ALPHANUMERIC,t.ALPHANUMERIC,x);let w,j;return o.isKanjiModeEnabled()?(w=d(l.BYTE,t.BYTE,x),j=d(l.KANJI,t.KANJI,x)):(w=d(l.BYTE_KANJI,t.BYTE,x),j=[]),p.concat(v,w,j).sort(function(C,N){return C.index-N.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function m(x,p){switch(p){case t.NUMERIC:return n.getBitsLength(x);case t.ALPHANUMERIC:return r.getBitsLength(x);case t.KANJI:return i.getBitsLength(x);case t.BYTE:return s.getBitsLength(x)}}function f(x){return x.reduce(function(p,v){const w=p.length-1>=0?p[p.length-1]:null;return w&&w.mode===v.mode?(p[p.length-1].data+=v.data,p):(p.push(v),p)},[])}function b(x){const p=[];for(let v=0;v=0&&o<=6&&(u===0||u===6)||u>=0&&u<=6&&(o===0||o===6)||o>=2&&o<=4&&u>=2&&u<=4?e.set(i+o,l+u,!0,!0):e.set(i+o,l+u,!1,!0))}}function v4(e){const t=e.size;for(let n=8;n>o&1)===1,e.set(s,i,l,!0),e.set(i,s,l,!0)}function yo(e,t,n){const r=e.size,s=g4.getEncodedBits(t,n);let i,l;for(i=0;i<15;i++)l=(s>>i&1)===1,i<6?e.set(i,8,l,!0):i<8?e.set(i+1,8,l,!0):e.set(r-15+i,8,l,!0),i<8?e.set(8,r-i-1,l,!0):i<9?e.set(8,15-i-1+1,l,!0):e.set(8,15-i-1,l,!0);e.set(r-8,8,1,!0)}function w4(e,t){const n=e.size;let r=-1,s=n-1,i=7,l=0;for(let o=n-1;o>0;o-=2)for(o===6&&o--;;){for(let u=0;u<2;u++)if(!e.isReserved(s,o-u)){let c=!1;l>>i&1)===1),e.set(s,o-u,c),i--,i===-1&&(l++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function j4(e,t,n){const r=new d4;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),x4.getCharCountIndicator(u.mode,e)),u.write(r)});const s=vl.getSymbolTotalCodewords(e),i=Zu.getTotalCodewordsCount(e,t),l=(s-i)*8;for(r.getLengthInBits()+4<=l&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const o=(l-r.getLengthInBits())/8;for(let u=0;uWr+Kt.products,0),da=[`${G.copied.length} Paket(e) kopiert (${Le} Produkte)`];G.skipped.length&&da.push(`übersprungen: ${G.skipped.join(", ")}`),j({text:`${da.join(" – ")}.`});const kl=await E();c(ts(Number(l),kl)),h({})}catch(G){j({error:G.message})}y(!1)}},Gn=u.filter(A=>!A.existing&&A.checked).length,Tb=u.filter(A=>A.existing&&go(A)).length,Ab=g.useMemo(()=>n.filter(A=>P==="all"||String(A.brand_id)===P).sort((A,W)=>A.name.localeCompare(W.name)),[n,P]),vl=g.useMemo(()=>e.filter(A=>{const W=T.get(A.car_model_id);return!(P!=="all"&&String(W==null?void 0:W.brand_id)!==P||N!=="all"&&String(A.car_model_id)!==N)}),[e,T,P,N]),Td=a.jsxs("div",{children:[a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Filtern:"}),a.jsxs("select",{value:P,onChange:A=>{C(A.target.value),S("all")},className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),R.map(A=>a.jsx("option",{value:String(A.id),children:A.name},A.id))]}),a.jsxs("select",{value:N,onChange:A=>S(A.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:[a.jsx("option",{value:"all",children:"Alle Modelle"}),Ab.map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]}),(P!=="all"||N!=="all")&&a.jsx("button",{onClick:()=>{C("all"),S("all")},className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[vl.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke / Modell"}),a.jsx("th",{className:"px-4 py-2",children:"Paket"}),a.jsx("th",{className:"px-4 py-2",children:"Aufschlag"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[vl.map(A=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[A.brand_name," ",A.model_name]}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[A.name,A.is_featured&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"})]})}),a.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[A.markup_type==="fixed"&&`+${A.markup_value} €`,A.markup_type==="percent"&&`+${A.markup_value} %`,(!A.markup_type||A.markup_type==="none")&&"–"]}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx(O,{to:`/admin/packages/${A.id}/products`,className:"mr-3 text-brand-600 hover:underline",children:"Produkte"}),a.jsx(O,{to:`/admin/packages/${A.id}/upgrades`,className:"mr-3 text-brand-600 hover:underline",children:"Upgrades"}),a.jsx("button",{onClick:()=>{if(!I())return;const W=T.get(A.car_model_id);X(W.brand_id,A.car_model_id),window.scrollTo({top:0,behavior:"smooth"})},className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>Ur(A),className:"text-red-600 hover:underline",children:"Löschen"})]})]},A.id)),vl.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Pakete angelegt.":"Keine Pakete für diesen Filter."})})]})]})})]});return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Pakete"}),a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-3 font-bold text-neutral-900 dark:text-white",children:"Modell wählen"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("select",{value:s,onChange:A=>_(A.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Marke wählen…"}),R.map(A=>a.jsx("option",{value:String(A.id),children:A.name},A.id))]}),a.jsxs("select",{value:l,onChange:A=>L(A.target.value),className:"min-w-[220px] rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Modell wählen…"}),U.map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]})]}),!l&&a.jsx("p",{className:"mt-2 text-sm text-neutral-500 dark:text-neutral-400",children:"Modell auswählen, um dessen Pakete anzulegen oder zu bearbeiten – die Standard-Paketstufen stehen dann als Checkliste bereit."})]}),Y&&a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"border-b border-neutral-200 px-5 py-4 dark:border-neutral-800",children:[a.jsxs("h2",{className:"font-bold text-neutral-900 dark:text-white",children:["Pakete für ",Y.brand_name," ",Y.name]}),a.jsx("p",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:"Paketstufen anhaken, Beschreibung und Aufschlag ausfüllen, unten alles auf einmal speichern."}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 rounded-lg border border-neutral-200 bg-neutral-50 px-3 py-2.5 dark:border-neutral-800 dark:bg-neutral-950",children:[a.jsx("span",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Pakete von anderem Modell kopieren:"}),a.jsxs("select",{value:k,onChange:A=>x(A.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:[a.jsx("option",{value:"",children:"Quellmodell wählen…"}),n.filter(A=>String(A.id)!==l).sort((A,W)=>`${A.brand_name} ${A.name}`.localeCompare(`${W.brand_name} ${W.name}`)).map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]}),a.jsx("button",{type:"button",onClick:Dt,disabled:!k||p,className:"rounded-md border border-brand-500 px-3 py-1.5 text-sm font-semibold text-brand-600 hover:bg-brand-50 disabled:opacity-50 dark:hover:bg-brand-900/20",children:p?"Kopiert…":"Kopieren"}),a.jsx("span",{className:"text-xs text-neutral-400",children:"inkl. Produkte, ohne Upgrades"}),w&&a.jsx("span",{className:`w-full text-sm ${w.error?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:w.error||w.text})]})]}),a.jsx("div",{children:u.map((A,W)=>a.jsxs("div",{children:[A.tierName===null&&W>0&&u[W-1].tierName!==null&&a.jsx("div",{className:"border-t border-neutral-200 bg-neutral-50 px-5 py-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-400",children:"Weitere Pakete (alte Namen)"}),a.jsxs("div",{className:`border-t border-neutral-100 dark:border-neutral-800 ${A.checked?"":"opacity-70"}`,children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-5 py-3",children:[a.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[a.jsx("input",{type:"checkbox",checked:A.checked,disabled:!!A.existing||m,onChange:G=>F(A.key,G.target.checked),className:"h-5 w-5 rounded border-neutral-300 text-brand-600 focus:ring-brand-500 disabled:opacity-60"}),a.jsx("span",{className:"font-semibold text-neutral-900 dark:text-white",children:A.tierName??A.existing.name})]}),A.tierName===null&&a.jsx("span",{className:"text-xs text-neutral-400",children:"(alter Name)"}),A.existing?a.jsx("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-semibold text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:"Vorhanden"}):A.checked&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Neu"}),A.form.is_featured&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"}),A.existing&&a.jsxs("span",{className:"ml-auto flex items-center gap-3 text-sm",children:[a.jsx(O,{to:`/admin/packages/${A.existing.id}/products`,className:"text-brand-600 hover:underline",children:"Produkte"}),a.jsx(O,{to:`/admin/packages/${A.existing.id}/upgrades`,className:"text-brand-600 hover:underline",children:"Upgrades"}),a.jsx("button",{type:"button",onClick:()=>ut(A),className:"text-red-600 hover:underline",children:"Löschen"})]})]}),A.checked&&a.jsxs("div",{className:"space-y-4 px-5 pb-5 sm:pl-[52px]",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("p",{className:"mb-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Jede Zeile erscheint als eigener Stichpunkt zusammen mit den Bauteilen."}),a.jsx("textarea",{rows:10,value:A.form.description,onChange:G=>V(A.key,{description:G.target.value}),onInput:jP,className:Ba})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aufschlag"}),a.jsxs("div",{className:"flex max-w-md gap-2",children:[a.jsxs("select",{value:A.form.markup_type,onChange:G=>V(A.key,{markup_type:G.target.value}),className:"w-40 rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"none",children:"Kein Aufschlag"}),a.jsx("option",{value:"fixed",children:"Fester Betrag (€)"}),a.jsx("option",{value:"percent",children:"Prozent (%)"})]}),a.jsx("input",{type:"number",step:"0.01",min:"0",disabled:A.form.markup_type==="none",value:A.form.markup_value,onChange:G=>V(A.key,{markup_value:G.target.value}),className:`${Ba} disabled:opacity-50`})]}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Wird auf die Summe der Bauteilpreise aufgeschlagen und ergibt den Gesamtpreis für den Kunden."})]}),a.jsxs("details",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800",children:[a.jsx("summary",{className:"cursor-pointer select-none px-3 py-2 text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Weitere Optionen (Preis-Text, Empfohlen, Sortierung)"}),a.jsxs("div",{className:"space-y-4 border-t border-neutral-200 p-3 dark:border-neutral-800",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis-Text (optional)"}),a.jsx("input",{value:A.form.price_text,onChange:G=>V(A.key,{price_text:G.target.value}),placeholder:'z. B. "Coming soon" oder "Preis auf Anfrage"',className:Ba}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Ersetzt auf der Kachel den berechneten Preis, solange ausgefüllt."})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:A.form.is_featured,onChange:G=>V(A.key,{is_featured:G.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Als empfohlen hervorheben"]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:A.form.sort_order,onChange:G=>V(A.key,{sort_order:G.target.value}),className:`${Ba} max-w-[160px]`})]})]})]}),d[A.key]&&a.jsx("p",{className:"text-sm text-red-600",children:d[A.key]})]})]})]},A.key))}),a.jsxs("div",{className:"sticky bottom-0 flex flex-wrap items-center gap-3 rounded-b-xl border-t border-neutral-200 bg-white px-5 py-3 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("button",{type:"button",onClick:Je,disabled:m||!J,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:m?"Speichert…":"Alle speichern"}),a.jsxs("span",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:[Gn," neu, ",Tb," geändert"]}),b&&a.jsx("span",{className:`text-sm ${b.kind==="error"?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:b.text})]})]}),Y?a.jsxs("details",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("summary",{className:"cursor-pointer select-none px-5 py-3 font-bold text-neutral-900 dark:text-white",children:"Alle Pakete (Übersicht)"}),a.jsx("div",{className:"border-t border-neutral-200 p-5 dark:border-neutral-800",children:Td})]}):Td]})}const za=[...Vb].sort(),SP=120,CP=200;function PP({value:e,onChange:t}){const[n,r]=g.useState(""),s=g.useMemo(()=>{const i=n.trim().toLowerCase();return i?za.filter(l=>l.includes(i)).slice(0,CP):za.slice(0,SP)},[n]);return a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center gap-3 rounded-md border border-neutral-300 p-2 dark:border-neutral-700",children:[a.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:e?a.jsx(Ie,{name:e,className:"h-6 w-6"}):a.jsx("span",{className:"text-xs text-neutral-400",children:"?"})}),a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:e||"Kein Icon gewählt"}),a.jsxs("p",{className:"text-xs text-neutral-400",children:[za.length," Icons verfügbar"]})]})]}),a.jsx("input",{value:n,onChange:i=>r(i.target.value),placeholder:"Icon suchen (z. B. car, shield, zap)…",className:"mb-2 w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsxs("div",{className:"grid max-h-64 grid-cols-6 gap-1 overflow-y-auto rounded-md border border-neutral-200 p-2 sm:grid-cols-8 dark:border-neutral-700",children:[s.map(i=>a.jsx("button",{type:"button",title:i,onClick:()=>t(i),className:`flex h-10 w-10 items-center justify-center rounded-md transition ${e===i?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:a.jsx(Ie,{name:i,className:"h-5 w-5"})},i)),s.length===0&&a.jsx("p",{className:"col-span-full py-4 text-center text-sm text-neutral-400",children:"Keine Icons gefunden."})]}),!n&&a.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Tipp: Tippe einen Suchbegriff ein, um alle ",za.length," Icons zu durchsuchen."]})]})}const zf={icon_name:"",title:"",description:"",image_path:"",cta_label:"",cta_url:"",sort_order:0};function EP(){const[e,t]=g.useState([]),[n,r]=g.useState(zf),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/services").then(t);g.useEffect(u,[]);const c=f=>{i(f.id),r({icon_name:f.icon_name,title:f.title,description:f.description,image_path:f.image_path||"",cta_label:f.cta_label||"",cta_url:f.cta_url||"",sort_order:f.sort_order})},d=()=>{i(null),r(zf)},h=async f=>{if(f.preventDefault(),o(""),!n.icon_name){o("Bitte ein Icon auswählen");return}const b={...n,sort_order:Number(n.sort_order)};try{s?await M.put(`/services/${s}`,b):await M.post("/services",b),d(),u()}catch(v){o(v.message)}},m=async f=>{confirm("Diese Leistung wirklich löschen?")&&(await M.delete(`/services/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Leistungen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Karten erscheinen auf der öffentlichen Leistungen-Seite. Die 8 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Icon"}),a.jsx("th",{className:"px-4 py-2",children:"Titel"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:a.jsx(Ie,{name:f.icon_name,className:"h-5 w-5"})})}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:f.title}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Leistungen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Leistung bearbeiten":"Neue Leistung"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Icon *"}),a.jsx(PP,{value:n.icon_name,onChange:f=>r({...n,icon_name:f})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.title,onChange:f=>r({...n,title:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung *"}),a.jsx("textarea",{required:!0,rows:4,value:n.description,onChange:f=>r({...n,description:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(pl,{value:n.image_path,onChange:f=>r({...n,image_path:f}),label:"Bild"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Text (optional)"}),a.jsx("input",{value:n.cta_label,onChange:f=>r({...n,cta_label:f.target.value}),placeholder:"z. B. Fahrzeug konfigurieren",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Link (optional)"}),a.jsx("input",{value:n.cta_url,onChange:f=>r({...n,cta_url:f.target.value}),placeholder:"z. B. /fahrzeuge",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Rf={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function TP(){const[e,t]=g.useState([]),[n,r]=g.useState(Rf),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/faqs").then(t);g.useEffect(u,[]);const c=f=>{i(f.id),r({question_de:f.question_de,answer_de:f.answer_de,question_en:f.question_en,answer_en:f.answer_en,sort_order:f.sort_order})},d=()=>{i(null),r(Rf)},h=async f=>{f.preventDefault(),o("");const b={...n,sort_order:Number(n.sort_order)};try{s?await M.put(`/faqs/${s}`,b):await M.post("/faqs",b),d(),u()}catch(v){o(v.message)}},m=async f=>{confirm("Diese Frage wirklich löschen?")&&(await M.delete(`/faqs/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Häufig gestellte Fragen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Fragen erscheinen im FAQ-Bereich der Startseite, jeweils in der aktuell gewählten Sprache. Die 6 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Frage (DE)"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:f.question_de}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Fragen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Frage bearbeiten":"Neue Frage"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Deutsch) *"}),a.jsx("input",{required:!0,value:n.question_de,onChange:f=>r({...n,question_de:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Deutsch) *"}),a.jsx("textarea",{required:!0,rows:3,value:n.answer_de,onChange:f=>r({...n,answer_de:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Englisch) *"}),a.jsx("input",{required:!0,value:n.question_en,onChange:f=>r({...n,question_en:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Englisch) *"}),a.jsx("textarea",{required:!0,rows:3,value:n.answer_en,onChange:f=>r({...n,answer_en:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const AP=e=>e==null?"–":new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),MP={ok:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"};function _P(){const{packageId:e}=$n(),[t,n]=g.useState([]),[r,s]=g.useState(""),[i,l]=g.useState(""),[o,u]=g.useState(""),[c,d]=g.useState(!1),h=()=>M.get(`/packages/${e}/products`).then(n);g.useEffect(()=>{h()},[e]);const m=async v=>{v.preventDefault(),u(""),d(!0);try{await M.post("/products",{package_id:Number(e),source_url:r,name_override:i||null}),s(""),l(""),h()}catch(k){u(k.message)}finally{d(!1)}},f=async v=>{d(!0);try{await M.post(`/products/${v}/refresh-price`,{}),h()}finally{d(!1)}},b=async v=>{confirm("Produkt wirklich entfernen?")&&(await M.delete(`/products/${v}`),h())};return a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(O,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Produkte im Paket"}),a.jsxs("form",{onSubmit:m,className:"mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"flex-1 min-w-[240px]",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"audio4cars.de Produkt-URL *"}),a.jsx("input",{required:!0,type:"url",placeholder:"https://www.audio4cars.de/produkt/...",value:r,onChange:v=>s(v.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{className:"w-56",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name überschreiben (optional)"}),a.jsx("input",{value:i,onChange:v=>l(v.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx("button",{disabled:c,type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Hinzufügen"})]}),o&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:o}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Produkt"}),a.jsx("th",{className:"px-4 py-2",children:"Preis"}),a.jsx("th",{className:"px-4 py-2",children:"Status"}),a.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktualisiert"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(v=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("a",{href:v.source_url,target:"_blank",rel:"noreferrer",className:"font-medium text-neutral-800 hover:underline dark:text-neutral-100",children:v.name_override||v.scraped_name||v.source_url}),v.scrape_status==="error"&&a.jsx("p",{className:"text-xs text-red-500",children:v.scrape_error})]}),a.jsx("td",{className:"px-4 py-2",children:AP(v.scraped_price)}),a.jsx("td",{className:"px-4 py-2",children:a.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${MP[v.scrape_status]}`,children:v.scrape_status})}),a.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:v.price_updated_at?new Date(v.price_updated_at.replace(" ","T")).toLocaleString("de-DE"):"–"}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{disabled:c,onClick:()=>f(v.id),className:"mr-3 text-brand-600 hover:underline disabled:opacity-60",children:"Preis aktualisieren"}),a.jsx("button",{onClick:()=>b(v.id),className:"text-red-600 hover:underline",children:"Entfernen"})]})]},v.id)),t.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Produkte im Paket."})})]})]})})]})}const DP=e=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),If={name:"",description:"",price:0,sort_order:0};function LP(){const{packageId:e}=$n(),[t,n]=g.useState([]),[r,s]=g.useState(If),[i,l]=g.useState(null),[o,u]=g.useState(""),c=()=>M.get(`/packages/${e}/upgrades`).then(n);g.useEffect(()=>{c()},[e]);const d=b=>{l(b.id),s({name:b.name,description:b.description||"",price:b.price,sort_order:b.sort_order})},h=()=>{l(null),s(If)},m=async b=>{b.preventDefault(),u("");const v={...r,package_id:Number(e),price:Number(r.price)};try{i?await M.put(`/package-upgrades/${i}`,v):await M.post("/package-upgrades",v),h(),c()}catch(k){u(k.message)}},f=async b=>{confirm("Upgrade wirklich löschen?")&&(await M.delete(`/package-upgrades/${b}`),c())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(O,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Optionale Upgrades"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Upgrades erscheinen nicht in der öffentlichen Paketübersicht, sondern erst als Auswahl im Kontaktformular."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Preis"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(b=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:b.name}),b.description&&a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:b.description})]}),a.jsx("td",{className:"px-4 py-2",children:DP(b.price)}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>d(b),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>f(b.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},b.id)),t.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Upgrades hinterlegt."})})]})]})})]}),a.jsxs("form",{onSubmit:m,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:i?"Upgrade bearbeiten":"Neues Upgrade"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:r.name,onChange:b=>s({...r,name:b.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("textarea",{rows:2,value:r.description,onChange:b=>s({...r,description:b.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis (€) *"}),a.jsx("input",{required:!0,type:"number",step:"0.01",min:"0",value:r.price,onChange:b=>s({...r,price:b.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:r.sort_order,onChange:b=>s({...r,sort_order:Number(b.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&a.jsx("p",{className:"text-sm text-red-600",children:o}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:i?"Speichern":"Anlegen"}),i&&a.jsx("button",{type:"button",onClick:h,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const BP=e=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),zP={new:"Neu",in_progress:"In Bearbeitung",done:"Erledigt"},RP={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"},IP=()=>a.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:a.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 FP(){const{hasPermission:e}=Mt(),[t,n]=g.useState([]),[r,s]=g.useState("all"),i=()=>M.get("/contact").then(n);g.useEffect(()=>{i()},[]);const l=async(h,m)=>{await M.patch(`/contact/${h}`,{status:m}),i()},o=async h=>{confirm("Diese Kontaktanfrage wirklich unwiderruflich löschen?")&&(await M.delete(`/contact/${h}`),i())},u=g.useMemo(()=>({all:t.length,new:t.filter(h=>h.status==="new").length,in_progress:t.filter(h=>h.status==="in_progress").length,done:t.filter(h=>h.status==="done").length}),[t]),c=r==="all"?t:t.filter(h=>h.status===r),d=[{value:"all",label:"Alle"},{value:"new",label:"Neu"},{value:"in_progress",label:"In Bearbeitung"},{value:"done",label:"Erledigt"}];return a.jsxs("div",{children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Kontaktanfragen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Alle Anfragen deiner Kunden. Wähle oben einen Reiter, um nur bestimmte Anfragen zu sehen."}),a.jsx("div",{className:"mb-5 flex flex-wrap gap-2",children:d.map(h=>a.jsxs("button",{onClick:()=>s(h.value),className:`rounded-full px-4 py-1.5 text-sm font-medium transition ${r===h.value?"bg-brand-500 text-white":"bg-neutral-100 text-neutral-600 hover:bg-neutral-200 dark:bg-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-700"}`,children:[h.label," (",u[h.value],")"]},h.value))}),a.jsxs("div",{className:"space-y-3",children:[c.map(h=>{var m;return a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-2 flex flex-wrap items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("p",{className:"font-semibold text-neutral-800 dark:text-neutral-100",children:[h.name," · ",h.email,h.phone?` · ${h.phone}`:""]}),h.vin&&a.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["FIN: ",a.jsx("span",{className:"font-mono",children:h.vin})]}),a.jsx("p",{className:"text-xs text-neutral-400",children:new Date(h.created_at.replace(" ","T")).toLocaleString("de-DE")})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("select",{value:h.status,onChange:f=>l(h.id,f.target.value),className:`rounded-full border-0 px-3 py-1 text-xs font-medium ${RP[h.status]}`,children:Object.entries(zP).map(([f,b])=>a.jsx("option",{value:f,children:b},f))}),e("contact.delete")&&a.jsx("button",{onClick:()=>o(h.id),"aria-label":"Anfrage löschen",title:"Anfrage löschen",className:"rounded-md p-1.5 text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20",children:a.jsx(IP,{})})]})]}),(h.brand_name||h.model_name||h.package_name||h.product_name)&&a.jsx("p",{className:"mb-2 text-sm text-neutral-500 dark:text-neutral-400",children:[h.brand_name,h.model_name,h.package_name,h.product_name].filter(Boolean).join(" · ")}),((m=h.selected_upgrades)==null?void 0:m.length)>0&&a.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:[a.jsx("p",{className:"font-semibold",children:"Gewünschte Upgrades:"}),a.jsx("ul",{className:"list-disc pl-5",children:h.selected_upgrades.map(f=>a.jsxs("li",{children:[f.name," – ",BP(f.price)]},f.id))})]}),h.message&&a.jsx("p",{className:"text-sm text-neutral-700 dark:text-neutral-300",children:h.message})]},h.id)}),c.length===0&&a.jsx("p",{className:"text-neutral-400",children:r==="all"?"Noch keine Kontaktanfragen eingegangen.":"Keine Anfragen mit diesem Status."})]})]})}var ua={},VP=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},mb={},Qe={};let Nd;const OP=[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];Qe.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};Qe.getSymbolTotalCodewords=function(t){return OP[t]};Qe.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};Qe.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Nd=t};Qe.isKanjiModeEnabled=function(){return typeof Nd<"u"};Qe.toSJIS=function(t){return Nd(t)};var gl={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.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: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,s){if(e.isValid(r))return r;try{return t(r)}catch{return s}}})(gl);function fb(){this.buffer=[],this.length=0}fb.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 n=0;n>>t-n-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 UP=fb;function ca(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)}ca.prototype.set=function(e,t,n,r){const s=e*this.size+t;this.data[s]=n,r&&(this.reservedBit[s]=!0)};ca.prototype.get=function(e,t){return this.data[e*this.size+t]};ca.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};ca.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var WP=ca,pb={};(function(e){const t=Qe.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,i=t(r),l=i===145?26:Math.ceil((i-13)/(2*s-2))*2,o=[i-7];for(let u=1;u=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const i=s.size;let l=0,o=0,u=0,c=null,d=null;for(let h=0;h=5&&(l+=t.N1+(o-5)),c=f,o=1),f=s.get(m,h),f===d?u++:(u>=5&&(l+=t.N1+(u-5)),d=f,u=1)}o>=5&&(l+=t.N1+(o-5)),u>=5&&(l+=t.N1+(u-5))}return l},e.getPenaltyN2=function(s){const i=s.size;let l=0;for(let o=0;o=10&&(o===1488||o===93)&&l++,u=u<<1&2047|s.get(d,c),d>=10&&(u===1488||u===93)&&l++}return l*t.N3},e.getPenaltyN4=function(s){let i=0;const l=s.data.length;for(let u=0;u=0;){const l=i[0];for(let u=0;u0){const i=new Uint8Array(this.degree);return i.set(r,s),i}return r};var $P=Sd,vb={},Nn={},Cd={};Cd.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var _t={};const kb="[0-9]+",GP="[A-Z $%*+\\-./:]+";let Ys="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ys=Ys.replace(/u/g,"\\u");const KP="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ys+`)(?:.|[\r
+]))+`;_t.KANJI=new RegExp(Ys,"g");_t.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");_t.BYTE=new RegExp(KP,"g");_t.NUMERIC=new RegExp(kb,"g");_t.ALPHANUMERIC=new RegExp(GP,"g");const qP=new RegExp("^"+Ys+"$"),YP=new RegExp("^"+kb+"$"),XP=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");_t.testKanji=function(t){return qP.test(t)};_t.testNumeric=function(t){return YP.test(t)};_t.testAlphanumeric=function(t){return XP.test(t)};(function(e){const t=Cd,n=_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(i,l){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(l))throw new Error("Invalid version: "+l);return l>=1&&l<10?i.ccBits[0]:l<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(i,l){if(e.isValid(i))return i;try{return r(i)}catch{return l}}})(Nn);(function(e){const t=Qe,n=xl,r=gl,s=Nn,i=Cd,l=7973,o=t.getBCHDigit(l);function u(m,f,b){for(let v=1;v<=40;v++)if(f<=e.getCapacity(v,b,m))return v}function c(m,f){return s.getCharCountIndicator(m,f)+4}function d(m,f){let b=0;return m.forEach(function(v){const k=c(v.mode,f);b+=k+v.getBitsLength()}),b}function h(m,f){for(let b=1;b<=40;b++)if(d(m,b)<=e.getCapacity(b,f,s.MIXED))return b}e.from=function(f,b){return i.isValid(f)?parseInt(f,10):b},e.getCapacity=function(f,b,v){if(!i.isValid(f))throw new Error("Invalid QR Code version");typeof v>"u"&&(v=s.BYTE);const k=t.getSymbolTotalCodewords(f),x=n.getTotalCodewordsCount(f,b),p=(k-x)*8;if(v===s.MIXED)return p;const y=p-c(v,f);switch(v){case s.NUMERIC:return Math.floor(y/10*3);case s.ALPHANUMERIC:return Math.floor(y/11*2);case s.KANJI:return Math.floor(y/13);case s.BYTE:default:return Math.floor(y/8)}},e.getBestVersionForData=function(f,b){let v;const k=r.from(b,r.M);if(Array.isArray(f)){if(f.length>1)return h(f,k);if(f.length===0)return 1;v=f[0]}else v=f;return u(v.mode,v.getLength(),k)},e.getEncodedBits=function(f){if(!i.isValid(f)||f<7)throw new Error("Invalid QR Code version");let b=f<<12;for(;t.getBCHDigit(b)-o>=0;)b^=l<=0;)s^=jb<0&&(r=this.data.substr(n),s=parseInt(r,10),t.put(s,i*3+1))};var JP=Tr;const e4=Nn,xo=["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 Ar(e){this.mode=e4.ALPHANUMERIC,this.data=e}Ar.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Ar.prototype.getLength=function(){return this.data.length};Ar.prototype.getBitsLength=function(){return Ar.getBitsLength(this.data.length)};Ar.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=xo.indexOf(this.data[n])*45;r+=xo.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(xo.indexOf(this.data[n]),6)};var t4=Ar;const n4=Nn;function Mr(e){this.mode=n4.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}Mr.getBitsLength=function(t){return t*8};Mr.prototype.getLength=function(){return this.data.length};Mr.prototype.getBitsLength=function(){return Mr.getBitsLength(this.data.length)};Mr.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
+Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var i4=_r,Sb={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,r,s){var i={},l={};l[r]=0;var o=t.PriorityQueue.make();o.push(r,0);for(var u,c,d,h,m,f,b,v,k;!o.empty();){u=o.pop(),c=u.value,h=u.cost,m=n[c]||{};for(d in m)m.hasOwnProperty(d)&&(f=m[d],b=h+f,v=l[d],k=typeof l[d]>"u",(k||v>b)&&(l[d]=b,o.push(d,b),i[d]=c))}if(typeof s<"u"&&typeof l[s]>"u"){var x=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(x)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],i=r;i;)s.push(i),n[i],i=n[i];return s.reverse(),s},find_path:function(n,r,s){var i=t.single_source_shortest_paths(n,r,s);return t.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,s={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Sb);var l4=Sb.exports;(function(e){const t=Nn,n=JP,r=t4,s=r4,i=i4,l=_t,o=Qe,u=l4;function c(x){return unescape(encodeURIComponent(x)).length}function d(x,p,y){const w=[];let j;for(;(j=x.exec(y))!==null;)w.push({data:j[0],index:j.index,mode:p,length:j[0].length});return w}function h(x){const p=d(l.NUMERIC,t.NUMERIC,x),y=d(l.ALPHANUMERIC,t.ALPHANUMERIC,x);let w,j;return o.isKanjiModeEnabled()?(w=d(l.BYTE,t.BYTE,x),j=d(l.KANJI,t.KANJI,x)):(w=d(l.BYTE_KANJI,t.BYTE,x),j=[]),p.concat(y,w,j).sort(function(C,N){return C.index-N.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function m(x,p){switch(p){case t.NUMERIC:return n.getBitsLength(x);case t.ALPHANUMERIC:return r.getBitsLength(x);case t.KANJI:return i.getBitsLength(x);case t.BYTE:return s.getBitsLength(x)}}function f(x){return x.reduce(function(p,y){const w=p.length-1>=0?p[p.length-1]:null;return w&&w.mode===y.mode?(p[p.length-1].data+=y.data,p):(p.push(y),p)},[])}function b(x){const p=[];for(let y=0;y=0&&o<=6&&(u===0||u===6)||u>=0&&u<=6&&(o===0||o===6)||o>=2&&o<=4&&u>=2&&u<=4?e.set(i+o,l+u,!0,!0):e.set(i+o,l+u,!1,!0))}}function g4(e){const t=e.size;for(let n=8;n>o&1)===1,e.set(s,i,l,!0),e.set(i,s,l,!0)}function vo(e,t,n){const r=e.size,s=m4.getEncodedBits(t,n);let i,l;for(i=0;i<15;i++)l=(s>>i&1)===1,i<6?e.set(i,8,l,!0):i<8?e.set(i+1,8,l,!0):e.set(r-15+i,8,l,!0),i<8?e.set(8,r-i-1,l,!0):i<9?e.set(8,15-i-1+1,l,!0):e.set(8,15-i-1,l,!0);e.set(r-8,8,1,!0)}function y4(e,t){const n=e.size;let r=-1,s=n-1,i=7,l=0;for(let o=n-1;o>0;o-=2)for(o===6&&o--;;){for(let u=0;u<2;u++)if(!e.isReserved(s,o-u)){let c=!1;l>>i&1)===1),e.set(s,o-u,c),i--,i===-1&&(l++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function v4(e,t,n){const r=new o4;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),f4.getCharCountIndicator(u.mode,e)),u.write(r)});const s=yl.getSymbolTotalCodewords(e),i=Zu.getTotalCodewordsCount(e,t),l=(s-i)*8;for(r.getLengthInBits()+4<=l&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const o=(l-r.getLengthInBits())/8;for(let u=0;u=7&&k4(u,t),w4(u,l),isNaN(r)&&(r=Xu.getBestMask(u,yo.bind(null,u,n))),Xu.applyMask(r,u),yo(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:s}}mb.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=bo.M,s,i;return typeof n<"u"&&(r=bo.from(n.errorCorrectionLevel,bo.M),s=Ui.from(n.version),i=Xu.from(n.maskPattern),n.toSJISFunc&&vl.setToSJISFunction(n.toSJISFunc)),S4(t,s,r,i)};var Cb={},Pd={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,l=r.scale||4;return{width:i,scale:i?4:l,margin:s,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},e.getImageWidth=function(r,s){const i=e.getScale(r,s);return Math.floor((r+s.margin*2)*i)},e.qrToImageData=function(r,s,i){const l=s.modules.size,o=s.modules.data,u=e.getScale(l,i),c=Math.floor((l+i.margin*2)*u),d=i.margin*u,h=[i.color.light,i.color.dark];for(let m=0;m=d&&f>=d&&m"u"&&(!l||!l.getContext)&&(u=l,l=void 0),l||(c=r()),u=t.getOptions(u);const d=t.getImageWidth(i.modules.size,u),h=c.getContext("2d"),m=h.createImageData(d,d);return t.qrToImageData(m.data,i,u),n(h,c,d),h.putImageData(m,0,0),c},e.renderToDataURL=function(i,l,o){let u=o;typeof u>"u"&&(!l||!l.getContext)&&(u=l,l=void 0),u||(u={});const c=e.render(i,l,u),d=u.type||"image/png",h=u.rendererOpts||{};return c.toDataURL(d,h.quality)}})(Cb);var Pb={};const C4=Pd;function Of(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function ko(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function P4(e,t,n){let r="",s=0,i=!1,l=0;for(let o=0;o0&&u>0&&e[o-1]||(r+=i?ko("M",u+n,.5+c+n):ko("m",s,0),s=0,i=!1),u+1':"",c="',d='viewBox="0 0 '+o+" "+o+'"',m='
-`;return typeof r=="function"&&r(null,m),m};const E4=WP,Qu=mb,Eb=Cb,T4=Pb;function Ed(e,t,n,r,s){const i=[].slice.call(arguments,1),l=i.length,o=typeof i[l-1]=="function";if(!o&&!E4())throw new Error("Callback required as last argument");if(o){if(l<2)throw new Error("Too few arguments provided");l===2?(s=n,n=t,t=r=void 0):l===3&&(t.getContext&&typeof s>"u"?(s=r,r=void 0):(s=r,r=n,n=t,t=void 0))}else{if(l<1)throw new Error("Too few arguments provided");return l===1?(n=t,t=r=void 0):l===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,c){try{const d=Qu.create(n,r);u(e(d,t,r))}catch(d){c(d)}})}try{const u=Qu.create(n,r);s(null,e(u,t,r))}catch(u){s(u)}}ua.create=Qu.create;ua.toCanvas=Ed.bind(null,Eb.render);ua.toDataURL=Ed.bind(null,Eb.renderToDataURL);ua.toString=Ed.bind(null,function(e,t,n){return T4.render(e,n)});const Uf={current_password:"",new_password:"",new_password_confirmation:"",two_factor_code:""};function A4(){const{user:e,refreshUser:t}=Mt(),[n,r]=g.useState("idle"),[s,i]=g.useState(""),[l,o]=g.useState(""),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState([]),[b,y]=g.useState(""),[k,x]=g.useState(!1),[p,v]=g.useState(Uf),[w,j]=g.useState(""),[P,C]=g.useState(""),[N,S]=g.useState(!1),E=async R=>{if(R.preventDefault(),j(""),C(""),p.new_password!==p.new_password_confirmation){j("Die neuen Passwörter stimmen nicht überein");return}S(!0);try{await M.post("/auth/change-password",p),v(Uf),C("Passwort erfolgreich geändert.")}catch(X){j(X.message)}finally{S(!1)}},T=async()=>{y(""),x(!0);try{const R=await M.get("/auth/2fa/setup");o(R.secret),i(await ua.toDataURL(R.otpauth_url)),c(""),r("setup")}catch(R){y(R.message)}finally{x(!1)}},I=async R=>{R.preventDefault(),y(""),x(!0);try{const X=await M.post("/auth/2fa/enable",{code:u});f(X.recovery_codes),r("recovery-codes"),await t()}catch(X){y(X.message)}finally{x(!1)}},U=()=>{r("idle"),f([]),h("")},Y=async R=>{R.preventDefault(),y(""),x(!0);try{await M.post("/auth/2fa/disable",{password:d}),h(""),r("idle"),await t()}catch(X){y(X.message)}finally{x(!1)}},J=async R=>{R.preventDefault(),y(""),x(!0);try{const X=await M.post("/auth/2fa/recovery-codes",{password:d});f(X.recovery_codes),r("recovery-codes")}catch(X){y(X.message)}finally{x(!1)}};return a.jsxs("div",{className:"max-w-xl",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Mein Konto"}),a.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Angemeldet als ",a.jsx("strong",{children:e==null?void 0:e.username}),e!=null&&e.is_super_admin?" (Super-Admin)":"","."]}),a.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Passwort ändern"}),a.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."]}),a.jsxs("form",{onSubmit:E,children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aktuelles Passwort"}),a.jsx("input",{type:"password",value:p.current_password,onChange:R=>v({...p,current_password:R.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"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort"}),a.jsx("input",{type:"password",value:p.new_password,onChange:R=>v({...p,new_password:R.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"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort wiederholen"}),a.jsx("input",{type:"password",value:p.new_password_confirmation,onChange:R=>v({...p,new_password_confirmation:R.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)&&a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"2FA-Code zur Bestätigung"}),a.jsx("input",{value:p.two_factor_code,onChange:R=>v({...p,two_factor_code:R.target.value}),required:!0,inputMode:"numeric",placeholder:"123456 oder Wiederherstellungscode",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),w&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),P&&a.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:P}),a.jsx("button",{type:"submit",disabled:N,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:N?"Wird geändert…":"Passwort ändern"})]})]}),a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Zwei-Faktor-Authentifizierung"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Schützt dein Konto zusätzlich mit einem Code aus der Google Authenticator App."}),n==="idle"&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"mb-4 text-sm",children:["Status:"," ",e!=null&&e.two_factor_enabled?a.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"Aktiv"}):a.jsx("span",{className:"font-semibold text-neutral-500 dark:text-neutral-400",children:"Nicht aktiv"})]}),e!=null&&e.two_factor_enabled?a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("button",{onClick:()=>{r("regenerate"),y("")},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"}),a.jsx("button",{onClick:()=>{r("disable"),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:"2FA deaktivieren"})]}):a.jsx("button",{onClick:T,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"})]}),n==="setup"&&a.jsxs("form",{onSubmit:I,children:[a.jsxs("ol",{className:"mb-4 list-decimal space-y-2 pl-5 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("li",{children:"Öffne die Google Authenticator App (oder eine kompatible App)."}),a.jsx("li",{children:"Scanne den folgenden QR-Code:"})]}),a.jsx("div",{className:"mb-4 flex justify-center",children:s&&a.jsx("img",{src:s,alt:"QR-Code für Zwei-Faktor-Authentifizierung",className:"h-48 w-48 rounded-lg border border-neutral-200 dark:border-neutral-700"})}),a.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: ",a.jsx("br",{}),a.jsx("code",{className:"mt-1 inline-block rounded bg-neutral-100 px-2 py-1 font-mono tracking-wider dark:bg-neutral-800",children:l})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Bestätigungscode aus der App"}),a.jsx("input",{value:u,onChange:R=>c(R.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"})]}),b&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:b}),a.jsxs("div",{className:"flex gap-2",children:[a.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"}),a.jsx("button",{type:"button",onClick:()=>r("idle"),className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="recovery-codes"&&a.jsxs("div",{children:[a.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Wiederherstellungscodes – jetzt sicher speichern!"}),a.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."}),a.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:m.map(R=>a.jsx("span",{children:R},R))}),a.jsx("button",{onClick:U,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Ich habe die Codes gespeichert"})]}),n==="disable"&&a.jsxs("form",{onSubmit:Y,children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),a.jsx("input",{type:"password",value:d,onChange:R=>h(R.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"})]}),b&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:b}),a.jsxs("div",{className:"flex gap-2",children:[a.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"}),a.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="regenerate"&&a.jsxs("form",{onSubmit:J,children:[a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Die bisherigen Wiederherstellungscodes werden ungültig."}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),a.jsx("input",{type:"password",value:d,onChange:R=>h(R.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"})]}),b&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:b}),a.jsxs("div",{className:"flex gap-2",children:[a.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"}),a.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})]})}const Wf={username:"",password:"",is_super_admin:!1,permissions:[],group_ids:[]};function M4(){const{user:e,hasPermission:t}=Mt(),[n,r]=g.useState([]),[s,i]=g.useState([]),[l,o]=g.useState([]),[u,c]=g.useState(Wf),[d,h]=g.useState(null),[m,f]=g.useState(""),b=()=>{M.get("/admin-users").then(r),M.get("/permissions/catalog").then(i),(t("permission_groups.manage")||t("users.manage"))&&M.get("/permission-groups").then(o)};g.useEffect(b,[]);const y=j=>{h(j.id),c({username:j.username,password:"",is_super_admin:j.is_super_admin,permissions:j.permissions,group_ids:j.groups.map(P=>P.id)})},k=()=>{h(null),c(Wf)},x=j=>{c(P=>({...P,permissions:P.permissions.includes(j)?P.permissions.filter(C=>C!==j):[...P.permissions,j]}))},p=j=>{c(P=>({...P,group_ids:P.group_ids.includes(j)?P.group_ids.filter(C=>C!==j):[...P.group_ids,j]}))},v=async j=>{j.preventDefault(),f("");try{if(d)await M.put(`/admin-users/${d}`,u);else{if(u.password.length<8){f("Passwort muss mindestens 8 Zeichen lang sein");return}await M.post("/admin-users",u)}k(),b()}catch(P){f(P.message)}},w=async j=>{if(confirm("Diesen Benutzer wirklich löschen?"))try{await M.delete(`/admin-users/${j}`),b()}catch(P){alert(P.message)}};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Benutzer"}),a.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."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Benutzername"}),a.jsx("th",{className:"px-4 py-2",children:"Rolle"}),a.jsx("th",{className:"px-4 py-2",children:"Berechtigungsgruppen"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[n.map(j=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:[j.username,j.id===(e==null?void 0:e.id)&&a.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(du)"})]}),a.jsx("td",{className:"px-4 py-2",children:j.is_super_admin?a.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"}):a.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400",children:[j.permissions.length," Einzelrechte"]})}),a.jsx("td",{className:"px-4 py-2",children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[j.groups.map(P=>a.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:P.name},P.id)),j.groups.length===0&&"–"]})}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>y(j),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),j.id!==(e==null?void 0:e.id)&&a.jsx("button",{onClick:()=>w(j.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},j.id)),n.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Benutzer angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:v,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:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:d?"Benutzer bearbeiten":"Neuer Benutzer"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername *"}),a.jsx("input",{required:!0,value:u.username,onChange:j=>c({...u,username:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",d?"(leer lassen = unverändert)":"*"]}),a.jsx("input",{type:"password",required:!d,value:u.password,onChange:j=>c({...u,password:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),(e==null?void 0:e.is_super_admin)&&a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.is_super_admin,onChange:j=>c({...u,is_super_admin:j.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Super-Admin (hat automatisch alle Rechte)"]}),!u.is_super_admin&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Einzelne Berechtigungen"}),a.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:s.map(j=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.permissions.includes(j.key),onChange:()=>x(j.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),j.label]},j.key))})]}),a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungsgruppen"}),a.jsxs("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:[l.map(j=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.group_ids.includes(j.id),onChange:()=>p(j.id),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),j.name]},j.id)),l.length===0&&a.jsx("p",{className:"text-sm text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})]})]})]}),m&&a.jsx("p",{className:"text-sm text-red-600",children:m}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.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"})]})]})]})}const Hf={name:"",description:"",permissions:[]};function _4(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(Hf),[l,o]=g.useState(null),[u,c]=g.useState(""),d=()=>{M.get("/permission-groups").then(t),M.get("/permissions/catalog").then(r)};g.useEffect(d,[]);const h=k=>{o(k.id),i({name:k.name,description:k.description||"",permissions:k.permissions})},m=()=>{o(null),i(Hf)},f=k=>{i(x=>({...x,permissions:x.permissions.includes(k)?x.permissions.filter(p=>p!==k):[...x.permissions,k]}))},b=async k=>{k.preventDefault(),c("");try{l?await M.put(`/permission-groups/${l}`,s):await M.post("/permission-groups",s),m(),d()}catch(x){c(x.message)}},y=async k=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await M.delete(`/permission-groups/${k}`),d())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),a.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.'}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(k=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:k.name}),k.description&&a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:k.description})]}),a.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[k.permissions.length," von ",n.length]}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>h(k),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>y(k.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},k.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:b,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:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:s.name,onChange:k=>i({...s,name:k.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("textarea",{rows:2,value:s.description,onChange:k=>i({...s,description:k.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),a.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:n.map(k=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:s.permissions.includes(k.key),onChange:()=>f(k.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),k.label]},k.key))})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.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"})]})]})]})}const D4=[{to:"/admin/settings/website",label:"Website"},{to:"/admin/settings/email",label:"E-Mail"},{to:"/admin/settings/database",label:"Datenbank"},{to:"/admin/settings/export-import",label:"Export & Import"},{to:"/admin/settings/maintenance",label:"Wartungsmodus"},{to:"/admin/settings/reset",label:"Zurücksetzen"}];function L4(){const e=({isActive:t})=>`rounded-md px-4 py-2 text-sm font-medium transition ${t?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`;return a.jsxs("div",{children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Einstellungen"}),a.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Werkzeuge rund um Datenbank, Server-Umzug und Zurücksetzen dieser Seite."}),a.jsx("nav",{className:"mb-6 flex flex-wrap gap-2",children:D4.map(t=>a.jsx(ig,{to:t.to,className:e,children:t.label},t.to))}),a.jsx(ol,{})]})}const B4={phone:"",whatsapp:"",contact_email:"",hero_image_path:"",ga_measurement_id:"",package_card_theme:"graphite",package_card_layout:"strip"},z4=[{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."}],I4=[{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 R4(){const[e,t]=g.useState(B4),[n,r]=g.useState(!0),[s,i]=g.useState(!1),[l,o]=g.useState(!1),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState(""),[b,y]=g.useState(!1),[k,x]=g.useState(!1),[p,v]=g.useState(""),[w,j]=g.useState(!1);g.useEffect(()=>{M.get("/site-settings").then(S=>t({phone:S.phone||"",whatsapp:S.whatsapp||"",contact_email:S.contact_email||"",hero_image_path:S.hero_image_path||"",ga_measurement_id:S.ga_measurement_id||"",package_card_theme:S.package_card_theme||"graphite",package_card_layout:S.package_card_layout||"strip"})).finally(()=>r(!1)),M.get("/settings/analytics").then(S=>{h(S.ga_property_id||""),y(S.has_credentials)})},[]);const P=async()=>{x(!0),v(""),j(!1);try{const S=await M.post("/settings/analytics",{ga_property_id:d,service_account_json:m});y(S.has_credentials),f(""),j(!0)}catch(S){v(S.message)}finally{x(!1)}},C=(S,E)=>{t(T=>({...T,[S]:E})),o(!1)},N=async S=>{S.preventDefault(),i(!0),c(""),o(!1);try{await M.post("/site-settings",e),o(!0)}catch(E){c(E.message)}finally{i(!1)}};return n?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:N,className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Startseiten-Bild"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das große Hero-Bild ganz oben auf der Startseite. Ohne eigenes Bild wird das Standardbild verwendet."}),a.jsx(pl,{value:e.hero_image_path,onChange:S=>C("hero_image_path",S),label:"Bild"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktdaten"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird im Header, Footer und auf der Kontaktseite angezeigt."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Telefon"}),a.jsx("input",{value:e.phone,onChange:S=>C("phone",S.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"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"WhatsApp Business Nummer"}),a.jsx("input",{value:e.whatsapp,onChange:S=>C("whatsapp",S.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"}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Leer lassen, um den WhatsApp-Link im Header auszublenden."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail"}),a.jsx("input",{type:"email",value:e.contact_email,onChange:S=>C("contact_email",S.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"})]})]})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Paket-Kachel-Design"}),a.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)."}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:z4.map(S=>a.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${e.package_card_theme===S.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:[a.jsx("input",{type:"radio",name:"package_card_theme",value:S.value,checked:e.package_card_theme===S.value,onChange:E=>C("package_card_theme",E.target.value),className:"sr-only"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:S.label}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:S.description})]},S.value))})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kachel-Layout"}),a.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."}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:I4.map(S=>a.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${e.package_card_layout===S.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:[a.jsx("input",{type:"radio",name:"package_card_layout",value:S.value,checked:e.package_card_layout===S.value,onChange:E=>C("package_card_layout",E.target.value),className:"sr-only"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:S.label}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:S.description})]},S.value))})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.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."}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Measurement-ID"}),a.jsx("input",{value:e.ga_measurement_id,onChange:S=>C("ga_measurement_id",S.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"})]}),a.jsxs("div",{className:"mt-5 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[a.jsx("h3",{className:"mb-1 text-sm font-semibold text-neutral-900 dark:text-white",children:"Dashboard-Anbindung (optional)"}),a.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."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Property-ID"}),a.jsx("input",{value:d,onChange:S=>{h(S.target.value),j(!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"}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Nicht die Measurement-ID (G-...) - zu finden unter GA4 → Verwaltung → Property-Details."})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Service-Account-JSON-Schlüssel ",b?"(leer lassen = unverändert)":""]}),a.jsx("textarea",{rows:4,value:m,onChange:S=>{f(S.target.value),j(!1)},placeholder:b?'{ "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"})]})]}),p&&a.jsx("p",{className:"mt-2 text-sm text-red-600",children:p}),w&&a.jsx("p",{className:"mt-2 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"button",onClick:P,disabled:k,className:"mt-3 rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:k?"Speichere…":"Dashboard-Anbindung speichern"})]})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),l&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}const F4={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:""},V4=[["{{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 $f(){return a.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:V4.map(([e,t])=>a.jsx("span",{title:t,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:e},e))})}function O4(){const[e,t]=g.useState(F4),[n,r]=g.useState(!1),[s,i]=g.useState(!0),[l,o]=g.useState(!1),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[b,y]=g.useState(!1),[k,x]=g.useState(""),[p,v]=g.useState(""),[w,j]=g.useState(""),[P,C]=g.useState(null);g.useEffect(()=>{M.get("/settings/mail").then(T=>{t({...T,mail_password:""}),r(T.has_password)}).finally(()=>i(!1))},[]);const N=(T,I)=>{t(U=>({...U,[T]:I})),f(!1)},S=async T=>{T.preventDefault(),c(!0),h(""),f(!1);try{const I=await M.post("/settings/mail",e);t({...I,mail_password:""}),r(I.has_password),f(!0)}catch(I){h(I.message)}finally{c(!1)}},E=async()=>{y(!0),x(""),v(""),j(""),C(null);try{const T=await M.post("/settings/mail/test",e);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.`),j(T.warning||""),C(T.smtp_log||null)}catch(T){x(T.message)}finally{y(!1)}};return s?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:S,className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"SMTP-Server"}),a.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)."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px]",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Server (Host)"}),a.jsx("input",{value:e.mail_host,onChange:T=>N("mail_host",T.target.value),placeholder:"smtp.beispiel.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Port"}),a.jsx("input",{type:"number",value:e.mail_port,onChange:T=>N("mail_port",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Verschlüsselung"}),a.jsxs("select",{value:e.mail_encryption,onChange:T=>N("mail_encryption",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"tls",children:"STARTTLS"}),a.jsx("option",{value:"ssl",children:"SSL"}),a.jsx("option",{value:"none",children:"Keine"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),a.jsx("input",{value:e.mail_username,onChange:T=>N("mail_username",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:l?"text":"password",value:e.mail_password,onChange:T=>N("mail_password",T.target.value),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{type:"button",onClick:()=>o(T=>!T),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:l?"Verbergen":"Anzeigen"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-E-Mail"}),a.jsx("input",{type:"email",value:e.mail_from_email,onChange:T=>N("mail_from_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-Name"}),a.jsx("input",{value:e.mail_from_name,onChange:T=>N("mail_from_name",T.target.value),placeholder:"HifiPlanet",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),a.jsxs("div",{className:"mt-4 border-t border-neutral-200 pt-4 dark:border-neutral-800",children:[k&&a.jsx("p",{className:"mb-2 whitespace-pre-wrap text-sm text-red-600",children:k}),p&&a.jsx("p",{className:"mb-2 text-sm text-green-600 dark:text-green-400",children:p}),w&&a.jsx("p",{className:"mb-2 rounded-md bg-amber-50 p-2 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:w}),a.jsx("button",{type:"button",onClick:E,disabled:b,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:b?"Sende Testmail…":"Verbindung testen"}),P&&P.length>0&&a.jsxs("details",{className:"mt-3",children:[a.jsx("summary",{className:"cursor-pointer text-xs text-neutral-500 dark:text-neutral-400",children:"SMTP-Protokoll anzeigen"}),a.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-neutral-900 p-3 text-xs text-neutral-200",children:P.join(`
-`)})]})]})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Empfänger"}),a.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."}),a.jsx("input",{type:"email",value:e.mail_notify_email,onChange:T=>N("mail_notify_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Kunden (Bestätigung)"}),a.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."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),a.jsx("input",{value:e.mail_customer_subject,onChange:T=>N("mail_customer_subject",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Text"}),a.jsx("textarea",{rows:8,value:e.mail_customer_body,onChange:T=>N("mail_customer_body",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"})]})]}),a.jsx($f,{})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Shop (Benachrichtigung)"}),a.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."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),a.jsx("input",{value:e.mail_owner_subject,onChange:T=>N("mail_owner_subject",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Text"}),a.jsx("textarea",{rows:8,value:e.mail_owner_body,onChange:T=>N("mail_owner_body",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"})]})]}),a.jsx($f,{})]}),d&&a.jsx("p",{className:"text-sm text-red-600",children:d}),m&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:u,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:u?"Speichere…":"Speichern"})]})}function U4(){const[e,t]=g.useState({host:"",name:"",user:"",password:"",charset:"utf8mb4"}),[n,r]=g.useState(!1),[s,i]=g.useState(!0),[l,o]=g.useState(!1),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[b,y]=g.useState(null),[k,x]=g.useState(!0),[p,v]=g.useState(!1),[w,j]=g.useState(null),P=()=>{i(!0),M.get("/settings/database").then(E=>{t({...E.config,password:""}),r(E.has_password)}).finally(()=>i(!1))},C=()=>{x(!0),M.get("/settings/schema-check").then(y).catch(E=>y({ok:!1,error:E.message,tables:[]})).finally(()=>x(!1))};g.useEffect(()=>{P(),C()},[]);const N=async()=>{v(!0),j(null);try{const E=await M.post("/settings/schema-migrate",{});j(E.actions),y(E.report)}catch(E){j(["Fehler: "+E.message])}finally{v(!1)}},S=async E=>{E.preventDefault(),c(!0),h(""),f(!1);try{await M.post("/settings/database",e),f(!0),t(T=>({...T,password:""})),r(!0),C()}catch(T){h(T.message)}finally{c(!1)}};return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wichtig für einen Umzug auf einen anderen Server/Webspace: Trage hier die Zugangsdaten der dortigen Datenbank ein. Die Verbindung wird vor dem Speichern getestet, damit du dich nicht aussperrst."}),s?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:S,className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Host *"}),a.jsx("input",{required:!0,value:e.host,onChange:E=>t({...e,host:E.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datenbankname *"}),a.jsx("input",{required:!0,value:e.name,onChange:E=>t({...e,name:E.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzer *"}),a.jsx("input",{required:!0,value:e.user,onChange:E=>t({...e,user:E.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:l?"text":"password",value:e.password,onChange:E=>t({...e,password:E.target.value}),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{type:"button",onClick:()=>o(E=>!E),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:l?"Verbergen":"Anzeigen"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Zeichensatz"}),a.jsx("input",{value:e.charset,onChange:E=>t({...e,charset:E.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&&a.jsx("p",{className:"text-sm text-red-600",children:d}),m&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Verbindung erfolgreich getestet und gespeichert."}),a.jsx("button",{type:"submit",disabled:u,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:u?"Teste & speichere…":"Verbindung testen & speichern"})]})]}),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:"Datenbankstruktur"}),!k&&b&&a.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${b.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:b.ok?"Datenbank OK":"Datenbank nicht OK"})]}),a.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."}),k&&a.jsx("p",{className:"text-sm text-neutral-400",children:"Prüfe…"}),!k&&b&&!b.ok&&a.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:b.tables.filter(E=>!E.ok).map(E=>a.jsx("li",{children:E.exists?a.jsxs(a.Fragment,{children:["Tabelle ",a.jsx("code",{className:"font-mono",children:E.table}),": Spalte(n) fehlen – ",E.missing_columns.join(", ")]}):a.jsxs(a.Fragment,{children:["Tabelle ",a.jsx("code",{className:"font-mono",children:E.table})," fehlt komplett"]})},E.table))}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("button",{onClick:C,disabled:k,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"}),b&&!b.ok&&a.jsx("button",{onClick:N,disabled:p,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:p?"Aktualisiere…":"Datenbankstruktur aktualisieren"})]}),w&&a.jsx("ul",{className:"mt-3 space-y-1 rounded-md bg-neutral-50 p-3 text-sm text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:w.map((E,T)=>a.jsx("li",{children:E},T))})]})]})}function W4(){const[e,t]=g.useState(null),[n,r]=g.useState(!1),[s,i]=g.useState(!1),[l,o]=g.useState(null),[u,c]=g.useState(""),d=async h=>{if(h.preventDefault(),!(!e||!n)){i(!0),c(""),o(null);try{const m=new FormData;m.append("file",e);const f=await M.post("/settings/import",m);o(f),t(null),r(!1),h.target.reset()}catch(m){c(m.message)}finally{i(!1)}}};return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten exportieren"}),a.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 und der kompletten Bildergalerie (inkl. Bilder) herunter. Benutzerkonten und Kontaktanfragen sind bewusst",a.jsx("strong",{children:" nicht"})," enthalten."]}),a.jsx("a",{href:`${lg}/settings/export`,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"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten importieren"}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Lädt eine zuvor exportierte Datei auf diesen Server. ",a.jsx("strong",{children:"Ersetzt dabei alle"})," aktuellen Marken, Modelle, Pakete, Produkte, Upgrades, Leistungen, FAQs und die komplette Bildergalerie auf diesem Server – das kann nicht rückgängig gemacht werden. Kontaktanfragen und Benutzerkonten bleiben unangetastet."]}),a.jsxs("form",{onSubmit:d,className:"space-y-3",children:[a.jsx("input",{type:"file",accept:"application/json,.json",onChange:h=>{var m;return t(((m=h.target.files)==null?void 0:m[0])||null)},className:"text-sm"}),a.jsxs("label",{className:"flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:n,onChange:h=>r(h.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 alle aktuellen Marken, Modelle, Pakete, Produkte, Upgrades, Leistungen, FAQs und die Bildergalerie auf diesem Server unwiderruflich ersetzt."]}),a.jsx("button",{type:"submit",disabled:!e||!n||s,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"})]}),u&&a.jsx("p",{className:"mt-3 text-sm text-red-600",children:u}),l&&a.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:[a.jsx("p",{className:"mb-1 font-semibold",children:"Import erfolgreich:"}),a.jsxs("ul",{className:"list-disc pl-5",children:[a.jsxs("li",{children:[l.counts.brands," Marken"]}),a.jsxs("li",{children:[l.counts.car_models," Modelle"]}),a.jsxs("li",{children:[l.counts.packages," Pakete"]}),a.jsxs("li",{children:[l.counts.package_products," Produkte"]}),a.jsxs("li",{children:[l.counts.package_upgrades," Upgrades"]}),a.jsxs("li",{children:[l.counts.services," Leistungen"]}),a.jsxs("li",{children:[l.counts.faqs," FAQs"]}),a.jsxs("li",{children:[l.counts.gallery_brands," Galerie-Marken"]}),a.jsxs("li",{children:[l.counts.gallery_projects," Galerie-Projekte"]}),a.jsxs("li",{children:[l.counts.gallery_photos," Galerie-Fotos"]}),a.jsxs("li",{children:[l.images_restored," Bilder wiederhergestellt"]})]})]})]})]})}const H4={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function $4(){const[e,t]=g.useState(H4),[n,r]=g.useState(!0),[s,i]=g.useState(!1),[l,o]=g.useState(!1),[u,c]=g.useState("");g.useEffect(()=>{M.get("/maintenance").then(f=>{t({global:{enabled:f.global.enabled,message:f.global.message||""},services:{enabled:f.services.enabled,message:f.services.message||""},vehicles:{enabled:f.vehicles.enabled,message:f.vehicles.message||""}})}).finally(()=>r(!1))},[]);const d=(f,b,y)=>{t(k=>({...k,[f]:{...k[f],[b]:y}})),o(!1)},h=async f=>{f.preventDefault(),i(!0),c(""),o(!1);try{const b=await M.post("/maintenance",e);t({global:{enabled:b.global.enabled,message:b.global.message||""},services:{enabled:b.services.enabled,message:b.services.message||""},vehicles:{enabled:b.vehicles.enabled,message:b.vehicles.message||""}}),o(!0)}catch(b){c(b.message)}finally{i(!1)}},m=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return n?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:h,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.'}),m.map(f=>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:f.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:e[f.key].enabled,onChange:b=>d(f.key,"enabled",b.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:f.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:e[f.key].message,onChange:b=>d(f.key,"message",b.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"})]},f.key)),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),l&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}function G4(){const[e,t]=g.useState(!1),[n,r]=g.useState(""),[s,i]=g.useState(!1),[l,o]=g.useState(""),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[b,y]=g.useState(""),[k,x]=g.useState(!1),[p,v]=g.useState(""),w=async()=>{if(confirm("Alle aktuellen Leistungen werden gelöscht und durch die 8 Standard-Leistungen ersetzt. Fortfahren?")){t(!0),r("");try{const S=await M.post("/settings/reset-services",{});r(`${S.count} Standard-Leistungen wiederhergestellt.`)}catch(S){r("Fehler: "+S.message)}finally{t(!1)}}},j=async()=>{if(confirm("Alle aktuellen FAQ-Einträge werden gelöscht und durch die 6 Standard-Fragen ersetzt. Fortfahren?")){i(!0),o("");try{const S=await M.post("/settings/reset-faqs",{});o(`${S.count} Standard-Fragen wiederhergestellt.`)}catch(S){o("Fehler: "+S.message)}finally{i(!1)}}},P=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?")){c(!0),h("");try{const S=await M.post("/settings/reset-gallery",{});h(`${S.photos} Fotos wiederhergestellt.`)}catch(S){h("Fehler: "+S.message)}finally{c(!1)}}},C=async()=>{if(confirm("Alle Marken, Modelle, Pakete, Produkte und Upgrades werden unwiderruflich gelöscht. Leistungen und Kontaktanfragen bleiben erhalten. Fortfahren?")){f(!0),y("");try{const S=await M.post("/settings/reset-catalog",{});y(`Fahrzeugkatalog geleert (${S.brands_removed} Marken entfernt).`)}catch(S){y("Fehler: "+S.message)}finally{f(!1)}}},N=async()=>{if(confirm("WIRKLICH ALLES zurücksetzen? Marken, Modelle, Pakete, Produkte und Upgrades werden gelöscht, Leistungen, FAQs und die Bildergalerie auf Standard zurückgesetzt. Kontaktanfragen und Benutzerkonten bleiben erhalten. Das kann nicht rückgängig gemacht werden!")){x(!0),v("");try{const S=await M.post("/settings/reset-all",{});v(`Erledigt: ${S.brands_removed} Marken entfernt, ${S.services_reset} Standard-Leistungen, ${S.faqs_reset} Standard-Fragen und ${S.gallery_photos_reset} Galerie-Fotos wiederhergestellt.`)}catch(S){v("Fehler: "+S.message)}finally{x(!1)}}};return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Leistungen zurücksetzen"}),a.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."}),a.jsx("button",{onClick:w,disabled:e,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:e?"Setze zurück…":"Leistungen auf Standard zurücksetzen"}),n&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:n})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur FAQs zurücksetzen"}),a.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."}),a.jsx("button",{onClick:j,disabled:s,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:s?"Setze zurück…":"FAQs auf Standard zurücksetzen"}),l&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:l})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Bildergalerie zurücksetzen"}),a.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."}),a.jsx("button",{onClick:P,disabled:u,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:u?"Setze zurück…":"Galerie auf Standard zurücksetzen"}),d&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:d})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Fahrzeugkatalog leeren"}),a.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."}),a.jsx("button",{onClick:C,disabled:m,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:m?"Leere…":"Fahrzeugkatalog leeren"}),b&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:b})]}),a.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:[a.jsx("h2",{className:"mb-1 font-semibold text-red-700 dark:text-red-300",children:"Alles zurücksetzen"}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:["Kombiniert alles: Fahrzeugkatalog wird komplett geleert ",a.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."]}),a.jsx("button",{onClick:N,disabled:k,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:k?"Setze zurück…":"Wirklich alles zurücksetzen"}),p&&a.jsx("p",{className:"mt-3 text-sm text-neutral-700 dark:text-neutral-300",children:p})]})]})}function K4(){return a.jsxs(a.Fragment,{children:[a.jsx(aw,{}),a.jsx(ow,{}),a.jsx(uw,{children:a.jsxs(Wk,{children:[a.jsx(H,{path:"/setup",element:a.jsx(dP,{})}),a.jsxs(H,{element:a.jsx(oC,{}),children:[a.jsx(H,{path:"/",element:a.jsx(TC,{})}),a.jsx(H,{path:"/fahrzeuge",element:a.jsx(AC,{})}),a.jsx(H,{path:"/fahrzeuge/:brandSlug",element:a.jsx(MC,{})}),a.jsx(H,{path:"/fahrzeuge/:brandSlug/:modelSlug",element:a.jsx($C,{})}),a.jsx(H,{path:"/galerie",element:a.jsx(GC,{})}),a.jsx(H,{path:"/galerie/:brandSlug",element:a.jsx(KC,{})}),a.jsx(H,{path:"/galerie/:brandSlug/:projectSlug",element:a.jsx(YC,{})}),a.jsx(H,{path:"/leistungen",element:a.jsx(XC,{})}),a.jsx(H,{path:"/kontakt",element:a.jsx(aP,{})}),a.jsx(H,{path:"/impressum",element:a.jsx(iP,{})}),a.jsx(H,{path:"/datenschutz",element:a.jsx(lP,{})}),a.jsx(H,{path:"/agb",element:a.jsx(oP,{})})]}),a.jsx(H,{path:"/admin/login",element:a.jsx(hP,{})}),a.jsx(H,{path:"/admin",element:a.jsx(hC,{}),children:a.jsxs(H,{element:a.jsx(dC,{}),children:[a.jsx(H,{index:!0,element:a.jsx(gP,{})}),a.jsx(H,{path:"account",element:a.jsx(A4,{})}),a.jsx(H,{path:"brands",element:a.jsx(Be,{permission:"brands.manage",children:a.jsx(xP,{})})}),a.jsx(H,{path:"models",element:a.jsx(Be,{permission:"models.manage",children:a.jsx(bP,{})})}),a.jsx(H,{path:"gallery-brands",element:a.jsx(Be,{permission:"gallery.manage",children:a.jsx(vP,{})})}),a.jsx(H,{path:"gallery-projects",element:a.jsx(Be,{permission:"gallery.manage",children:a.jsx(yP,{})})}),a.jsx(H,{path:"gallery-projects/:projectId/photos",element:a.jsx(Be,{permission:"gallery.manage",children:a.jsx(kP,{})})}),a.jsx(H,{path:"packages",element:a.jsx(Be,{permission:"packages.manage",children:a.jsx(PP,{})})}),a.jsx(H,{path:"packages/:packageId/products",element:a.jsx(Be,{permission:"packages.manage",children:a.jsx(BP,{})})}),a.jsx(H,{path:"packages/:packageId/upgrades",element:a.jsx(Be,{permission:"packages.manage",children:a.jsx(IP,{})})}),a.jsx(H,{path:"services",element:a.jsx(Be,{permission:"services.manage",children:a.jsx(MP,{})})}),a.jsx(H,{path:"faqs",element:a.jsx(Be,{permission:"content.manage",children:a.jsx(_P,{})})}),a.jsx(H,{path:"contact-requests",element:a.jsx(Be,{permission:"contact.manage",children:a.jsx(UP,{})})}),a.jsx(H,{path:"users",element:a.jsx(Be,{permission:"users.manage",children:a.jsx(M4,{})})}),a.jsx(H,{path:"permission-groups",element:a.jsx(Be,{permission:"permission_groups.manage",children:a.jsx(_4,{})})}),a.jsxs(H,{path:"settings",element:a.jsx(Be,{permission:"settings.manage",children:a.jsx(L4,{})}),children:[a.jsx(H,{index:!0,element:a.jsx(Ws,{to:"website",replace:!0})}),a.jsx(H,{path:"website",element:a.jsx(R4,{})}),a.jsx(H,{path:"email",element:a.jsx(O4,{})}),a.jsx(H,{path:"database",element:a.jsx(U4,{})}),a.jsx(H,{path:"export-import",element:a.jsx(W4,{})}),a.jsx(H,{path:"maintenance",element:a.jsx($4,{})}),a.jsx(H,{path:"reset",element:a.jsx(G4,{})})]})]})})]})})]})}wo.createRoot(document.getElementById("root")).render(a.jsx(Ob.StrictMode,{children:a.jsx(Qk,{basename:"/".replace(/\/$/,"")||"/",children:a.jsx(dw,{children:a.jsx(gw,{children:a.jsx(Nw,{children:a.jsx(K4,{})})})})})}));
+`);const l=v4(t,n,s),o=yl.getSymbolSize(t),u=new u4(o);return p4(u,t),g4(u),x4(u,t),vo(u,n,0),t>=7&&b4(u,t),y4(u,l),isNaN(r)&&(r=Xu.getBestMask(u,vo.bind(null,u,n))),Xu.applyMask(r,u),vo(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:s}}mb.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=bo.M,s,i;return typeof n<"u"&&(r=bo.from(n.errorCorrectionLevel,bo.M),s=Ui.from(n.version),i=Xu.from(n.maskPattern),n.toSJISFunc&&yl.setToSJISFunction(n.toSJISFunc)),w4(t,s,r,i)};var Cb={},Pd={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,l=r.scale||4;return{width:i,scale:i?4:l,margin:s,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},e.getImageWidth=function(r,s){const i=e.getScale(r,s);return Math.floor((r+s.margin*2)*i)},e.qrToImageData=function(r,s,i){const l=s.modules.size,o=s.modules.data,u=e.getScale(l,i),c=Math.floor((l+i.margin*2)*u),d=i.margin*u,h=[i.color.light,i.color.dark];for(let m=0;m=d&&f>=d&&m"u"&&(!l||!l.getContext)&&(u=l,l=void 0),l||(c=r()),u=t.getOptions(u);const d=t.getImageWidth(i.modules.size,u),h=c.getContext("2d"),m=h.createImageData(d,d);return t.qrToImageData(m.data,i,u),n(h,c,d),h.putImageData(m,0,0),c},e.renderToDataURL=function(i,l,o){let u=o;typeof u>"u"&&(!l||!l.getContext)&&(u=l,l=void 0),u||(u={});const c=e.render(i,l,u),d=u.type||"image/png",h=u.rendererOpts||{};return c.toDataURL(d,h.quality)}})(Cb);var Pb={};const j4=Pd;function Of(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function ko(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function N4(e,t,n){let r="",s=0,i=!1,l=0;for(let o=0;o0&&u>0&&e[o-1]||(r+=i?ko("M",u+n,.5+c+n):ko("m",s,0),s=0,i=!1),u+1':"",c="',d='viewBox="0 0 '+o+" "+o+'"',m='
+`;return typeof r=="function"&&r(null,m),m};const S4=VP,Qu=mb,Eb=Cb,C4=Pb;function Ed(e,t,n,r,s){const i=[].slice.call(arguments,1),l=i.length,o=typeof i[l-1]=="function";if(!o&&!S4())throw new Error("Callback required as last argument");if(o){if(l<2)throw new Error("Too few arguments provided");l===2?(s=n,n=t,t=r=void 0):l===3&&(t.getContext&&typeof s>"u"?(s=r,r=void 0):(s=r,r=n,n=t,t=void 0))}else{if(l<1)throw new Error("Too few arguments provided");return l===1?(n=t,t=r=void 0):l===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,c){try{const d=Qu.create(n,r);u(e(d,t,r))}catch(d){c(d)}})}try{const u=Qu.create(n,r);s(null,e(u,t,r))}catch(u){s(u)}}ua.create=Qu.create;ua.toCanvas=Ed.bind(null,Eb.render);ua.toDataURL=Ed.bind(null,Eb.renderToDataURL);ua.toString=Ed.bind(null,function(e,t,n){return C4.render(e,n)});const Uf={current_password:"",new_password:"",new_password_confirmation:"",two_factor_code:""};function P4(){const{user:e,refreshUser:t}=Mt(),[n,r]=g.useState("idle"),[s,i]=g.useState(""),[l,o]=g.useState(""),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState([]),[b,v]=g.useState(""),[k,x]=g.useState(!1),[p,y]=g.useState(Uf),[w,j]=g.useState(""),[P,C]=g.useState(""),[N,S]=g.useState(!1),E=async I=>{if(I.preventDefault(),j(""),C(""),p.new_password!==p.new_password_confirmation){j("Die neuen Passwörter stimmen nicht überein");return}S(!0);try{await M.post("/auth/change-password",p),y(Uf),C("Passwort erfolgreich geändert.")}catch(X){j(X.message)}finally{S(!1)}},T=async()=>{v(""),x(!0);try{const I=await M.get("/auth/2fa/setup");o(I.secret),i(await ua.toDataURL(I.otpauth_url)),c(""),r("setup")}catch(I){v(I.message)}finally{x(!1)}},R=async I=>{I.preventDefault(),v(""),x(!0);try{const X=await M.post("/auth/2fa/enable",{code:u});f(X.recovery_codes),r("recovery-codes"),await t()}catch(X){v(X.message)}finally{x(!1)}},U=()=>{r("idle"),f([]),h("")},Y=async I=>{I.preventDefault(),v(""),x(!0);try{await M.post("/auth/2fa/disable",{password:d}),h(""),r("idle"),await t()}catch(X){v(X.message)}finally{x(!1)}},J=async I=>{I.preventDefault(),v(""),x(!0);try{const X=await M.post("/auth/2fa/recovery-codes",{password:d});f(X.recovery_codes),r("recovery-codes")}catch(X){v(X.message)}finally{x(!1)}};return a.jsxs("div",{className:"max-w-xl",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Mein Konto"}),a.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Angemeldet als ",a.jsx("strong",{children:e==null?void 0:e.username}),e!=null&&e.is_super_admin?" (Super-Admin)":"","."]}),a.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Passwort ändern"}),a.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."]}),a.jsxs("form",{onSubmit:E,children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aktuelles Passwort"}),a.jsx("input",{type:"password",value:p.current_password,onChange:I=>y({...p,current_password:I.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"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort"}),a.jsx("input",{type:"password",value:p.new_password,onChange:I=>y({...p,new_password:I.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"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort wiederholen"}),a.jsx("input",{type:"password",value:p.new_password_confirmation,onChange:I=>y({...p,new_password_confirmation:I.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)&&a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"2FA-Code zur Bestätigung"}),a.jsx("input",{value:p.two_factor_code,onChange:I=>y({...p,two_factor_code:I.target.value}),required:!0,inputMode:"numeric",placeholder:"123456 oder Wiederherstellungscode",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),w&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),P&&a.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:P}),a.jsx("button",{type:"submit",disabled:N,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:N?"Wird geändert…":"Passwort ändern"})]})]}),a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Zwei-Faktor-Authentifizierung"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Schützt dein Konto zusätzlich mit einem Code aus der Google Authenticator App."}),n==="idle"&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"mb-4 text-sm",children:["Status:"," ",e!=null&&e.two_factor_enabled?a.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"Aktiv"}):a.jsx("span",{className:"font-semibold text-neutral-500 dark:text-neutral-400",children:"Nicht aktiv"})]}),e!=null&&e.two_factor_enabled?a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("button",{onClick:()=>{r("regenerate"),v("")},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"}),a.jsx("button",{onClick:()=>{r("disable"),v("")},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"})]}):a.jsx("button",{onClick:T,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"})]}),n==="setup"&&a.jsxs("form",{onSubmit:R,children:[a.jsxs("ol",{className:"mb-4 list-decimal space-y-2 pl-5 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("li",{children:"Öffne die Google Authenticator App (oder eine kompatible App)."}),a.jsx("li",{children:"Scanne den folgenden QR-Code:"})]}),a.jsx("div",{className:"mb-4 flex justify-center",children:s&&a.jsx("img",{src:s,alt:"QR-Code für Zwei-Faktor-Authentifizierung",className:"h-48 w-48 rounded-lg border border-neutral-200 dark:border-neutral-700"})}),a.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: ",a.jsx("br",{}),a.jsx("code",{className:"mt-1 inline-block rounded bg-neutral-100 px-2 py-1 font-mono tracking-wider dark:bg-neutral-800",children:l})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Bestätigungscode aus der App"}),a.jsx("input",{value:u,onChange:I=>c(I.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"})]}),b&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:b}),a.jsxs("div",{className:"flex gap-2",children:[a.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"}),a.jsx("button",{type:"button",onClick:()=>r("idle"),className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="recovery-codes"&&a.jsxs("div",{children:[a.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Wiederherstellungscodes – jetzt sicher speichern!"}),a.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."}),a.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:m.map(I=>a.jsx("span",{children:I},I))}),a.jsx("button",{onClick:U,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Ich habe die Codes gespeichert"})]}),n==="disable"&&a.jsxs("form",{onSubmit:Y,children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),a.jsx("input",{type:"password",value:d,onChange:I=>h(I.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"})]}),b&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:b}),a.jsxs("div",{className:"flex gap-2",children:[a.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"}),a.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="regenerate"&&a.jsxs("form",{onSubmit:J,children:[a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Die bisherigen Wiederherstellungscodes werden ungültig."}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),a.jsx("input",{type:"password",value:d,onChange:I=>h(I.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"})]}),b&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:b}),a.jsxs("div",{className:"flex gap-2",children:[a.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"}),a.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})]})}const Wf={username:"",password:"",is_super_admin:!1,permissions:[],group_ids:[]};function E4(){const{user:e,hasPermission:t}=Mt(),[n,r]=g.useState([]),[s,i]=g.useState([]),[l,o]=g.useState([]),[u,c]=g.useState(Wf),[d,h]=g.useState(null),[m,f]=g.useState(""),b=()=>{M.get("/admin-users").then(r),M.get("/permissions/catalog").then(i),(t("permission_groups.manage")||t("users.manage"))&&M.get("/permission-groups").then(o)};g.useEffect(b,[]);const v=j=>{h(j.id),c({username:j.username,password:"",is_super_admin:j.is_super_admin,permissions:j.permissions,group_ids:j.groups.map(P=>P.id)})},k=()=>{h(null),c(Wf)},x=j=>{c(P=>({...P,permissions:P.permissions.includes(j)?P.permissions.filter(C=>C!==j):[...P.permissions,j]}))},p=j=>{c(P=>({...P,group_ids:P.group_ids.includes(j)?P.group_ids.filter(C=>C!==j):[...P.group_ids,j]}))},y=async j=>{j.preventDefault(),f("");try{if(d)await M.put(`/admin-users/${d}`,u);else{if(u.password.length<8){f("Passwort muss mindestens 8 Zeichen lang sein");return}await M.post("/admin-users",u)}k(),b()}catch(P){f(P.message)}},w=async j=>{if(confirm("Diesen Benutzer wirklich löschen?"))try{await M.delete(`/admin-users/${j}`),b()}catch(P){alert(P.message)}};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Benutzer"}),a.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."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Benutzername"}),a.jsx("th",{className:"px-4 py-2",children:"Rolle"}),a.jsx("th",{className:"px-4 py-2",children:"Berechtigungsgruppen"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[n.map(j=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:[j.username,j.id===(e==null?void 0:e.id)&&a.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(du)"})]}),a.jsx("td",{className:"px-4 py-2",children:j.is_super_admin?a.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"}):a.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400",children:[j.permissions.length," Einzelrechte"]})}),a.jsx("td",{className:"px-4 py-2",children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[j.groups.map(P=>a.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:P.name},P.id)),j.groups.length===0&&"–"]})}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>v(j),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),j.id!==(e==null?void 0:e.id)&&a.jsx("button",{onClick:()=>w(j.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},j.id)),n.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Benutzer angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:y,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:d?"Benutzer bearbeiten":"Neuer Benutzer"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername *"}),a.jsx("input",{required:!0,value:u.username,onChange:j=>c({...u,username:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",d?"(leer lassen = unverändert)":"*"]}),a.jsx("input",{type:"password",required:!d,value:u.password,onChange:j=>c({...u,password:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),(e==null?void 0:e.is_super_admin)&&a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.is_super_admin,onChange:j=>c({...u,is_super_admin:j.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Super-Admin (hat automatisch alle Rechte)"]}),!u.is_super_admin&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Einzelne Berechtigungen"}),a.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:s.map(j=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.permissions.includes(j.key),onChange:()=>x(j.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),j.label]},j.key))})]}),a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungsgruppen"}),a.jsxs("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:[l.map(j=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.group_ids.includes(j.id),onChange:()=>p(j.id),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),j.name]},j.id)),l.length===0&&a.jsx("p",{className:"text-sm text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})]})]})]}),m&&a.jsx("p",{className:"text-sm text-red-600",children:m}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.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"})]})]})]})}const Hf={name:"",description:"",permissions:[]};function T4(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(Hf),[l,o]=g.useState(null),[u,c]=g.useState(""),d=()=>{M.get("/permission-groups").then(t),M.get("/permissions/catalog").then(r)};g.useEffect(d,[]);const h=k=>{o(k.id),i({name:k.name,description:k.description||"",permissions:k.permissions})},m=()=>{o(null),i(Hf)},f=k=>{i(x=>({...x,permissions:x.permissions.includes(k)?x.permissions.filter(p=>p!==k):[...x.permissions,k]}))},b=async k=>{k.preventDefault(),c("");try{l?await M.put(`/permission-groups/${l}`,s):await M.post("/permission-groups",s),m(),d()}catch(x){c(x.message)}},v=async k=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await M.delete(`/permission-groups/${k}`),d())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),a.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.'}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(k=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:k.name}),k.description&&a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:k.description})]}),a.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[k.permissions.length," von ",n.length]}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>h(k),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>v(k.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},k.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:b,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:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:s.name,onChange:k=>i({...s,name:k.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("textarea",{rows:2,value:s.description,onChange:k=>i({...s,description:k.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),a.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:n.map(k=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:s.permissions.includes(k.key),onChange:()=>f(k.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),k.label]},k.key))})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.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&&a.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"})]})]})]})}const A4=[{to:"/admin/settings/website",label:"Website"},{to:"/admin/settings/email",label:"E-Mail"},{to:"/admin/settings/database",label:"Datenbank"},{to:"/admin/settings/export-import",label:"Export & Import"},{to:"/admin/settings/maintenance",label:"Wartungsmodus"},{to:"/admin/settings/reset",label:"Zurücksetzen"}];function M4(){const e=({isActive:t})=>`rounded-md px-4 py-2 text-sm font-medium transition ${t?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`;return a.jsxs("div",{children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Einstellungen"}),a.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Werkzeuge rund um Datenbank, Server-Umzug und Zurücksetzen dieser Seite."}),a.jsx("nav",{className:"mb-6 flex flex-wrap gap-2",children:A4.map(t=>a.jsx(ig,{to:t.to,className:e,children:t.label},t.to))}),a.jsx(ol,{})]})}const _4={phone:"",whatsapp:"",contact_email:"",hero_image_path:"",ga_measurement_id:"",package_card_theme:"graphite",package_card_layout:"strip"},D4=[{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."}],L4=[{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 B4(){const[e,t]=g.useState(_4),[n,r]=g.useState(!0),[s,i]=g.useState(!1),[l,o]=g.useState(!1),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState(""),[b,v]=g.useState(!1),[k,x]=g.useState(!1),[p,y]=g.useState(""),[w,j]=g.useState(!1);g.useEffect(()=>{M.get("/site-settings").then(S=>t({phone:S.phone||"",whatsapp:S.whatsapp||"",contact_email:S.contact_email||"",hero_image_path:S.hero_image_path||"",ga_measurement_id:S.ga_measurement_id||"",package_card_theme:S.package_card_theme||"graphite",package_card_layout:S.package_card_layout||"strip"})).finally(()=>r(!1)),M.get("/settings/analytics").then(S=>{h(S.ga_property_id||""),v(S.has_credentials)})},[]);const P=async()=>{x(!0),y(""),j(!1);try{const S=await M.post("/settings/analytics",{ga_property_id:d,service_account_json:m});v(S.has_credentials),f(""),j(!0)}catch(S){y(S.message)}finally{x(!1)}},C=(S,E)=>{t(T=>({...T,[S]:E})),o(!1)},N=async S=>{S.preventDefault(),i(!0),c(""),o(!1);try{await M.post("/site-settings",e),o(!0)}catch(E){c(E.message)}finally{i(!1)}};return n?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:N,className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Startseiten-Bild"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das große Hero-Bild ganz oben auf der Startseite. Ohne eigenes Bild wird das Standardbild verwendet."}),a.jsx(pl,{value:e.hero_image_path,onChange:S=>C("hero_image_path",S),label:"Bild"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktdaten"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird im Header, Footer und auf der Kontaktseite angezeigt."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Telefon"}),a.jsx("input",{value:e.phone,onChange:S=>C("phone",S.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"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"WhatsApp Business Nummer"}),a.jsx("input",{value:e.whatsapp,onChange:S=>C("whatsapp",S.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"}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Leer lassen, um den WhatsApp-Link im Header auszublenden."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail"}),a.jsx("input",{type:"email",value:e.contact_email,onChange:S=>C("contact_email",S.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"})]})]})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Paket-Kachel-Design"}),a.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)."}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:D4.map(S=>a.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${e.package_card_theme===S.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:[a.jsx("input",{type:"radio",name:"package_card_theme",value:S.value,checked:e.package_card_theme===S.value,onChange:E=>C("package_card_theme",E.target.value),className:"sr-only"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:S.label}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:S.description})]},S.value))})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kachel-Layout"}),a.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."}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:L4.map(S=>a.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${e.package_card_layout===S.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:[a.jsx("input",{type:"radio",name:"package_card_layout",value:S.value,checked:e.package_card_layout===S.value,onChange:E=>C("package_card_layout",E.target.value),className:"sr-only"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:S.label}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:S.description})]},S.value))})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.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."}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Measurement-ID"}),a.jsx("input",{value:e.ga_measurement_id,onChange:S=>C("ga_measurement_id",S.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"})]}),a.jsxs("div",{className:"mt-5 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[a.jsx("h3",{className:"mb-1 text-sm font-semibold text-neutral-900 dark:text-white",children:"Dashboard-Anbindung (optional)"}),a.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."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Property-ID"}),a.jsx("input",{value:d,onChange:S=>{h(S.target.value),j(!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"}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Nicht die Measurement-ID (G-...) - zu finden unter GA4 → Verwaltung → Property-Details."})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Service-Account-JSON-Schlüssel ",b?"(leer lassen = unverändert)":""]}),a.jsx("textarea",{rows:4,value:m,onChange:S=>{f(S.target.value),j(!1)},placeholder:b?'{ "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"})]})]}),p&&a.jsx("p",{className:"mt-2 text-sm text-red-600",children:p}),w&&a.jsx("p",{className:"mt-2 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"button",onClick:P,disabled:k,className:"mt-3 rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:k?"Speichere…":"Dashboard-Anbindung speichern"})]})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),l&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}const z4={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:""},R4=[["{{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 $f(){return a.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:R4.map(([e,t])=>a.jsx("span",{title:t,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:e},e))})}function I4(){const[e,t]=g.useState(z4),[n,r]=g.useState(!1),[s,i]=g.useState(!0),[l,o]=g.useState(!1),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[b,v]=g.useState(!1),[k,x]=g.useState(""),[p,y]=g.useState(""),[w,j]=g.useState(""),[P,C]=g.useState(null);g.useEffect(()=>{M.get("/settings/mail").then(T=>{t({...T,mail_password:""}),r(T.has_password)}).finally(()=>i(!1))},[]);const N=(T,R)=>{t(U=>({...U,[T]:R})),f(!1)},S=async T=>{T.preventDefault(),c(!0),h(""),f(!1);try{const R=await M.post("/settings/mail",e);t({...R,mail_password:""}),r(R.has_password),f(!0)}catch(R){h(R.message)}finally{c(!1)}},E=async()=>{v(!0),x(""),y(""),j(""),C(null);try{const T=await M.post("/settings/mail/test",e);y(`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.`),j(T.warning||""),C(T.smtp_log||null)}catch(T){x(T.message)}finally{v(!1)}};return s?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:S,className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"SMTP-Server"}),a.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)."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px]",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Server (Host)"}),a.jsx("input",{value:e.mail_host,onChange:T=>N("mail_host",T.target.value),placeholder:"smtp.beispiel.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Port"}),a.jsx("input",{type:"number",value:e.mail_port,onChange:T=>N("mail_port",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Verschlüsselung"}),a.jsxs("select",{value:e.mail_encryption,onChange:T=>N("mail_encryption",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"tls",children:"STARTTLS"}),a.jsx("option",{value:"ssl",children:"SSL"}),a.jsx("option",{value:"none",children:"Keine"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),a.jsx("input",{value:e.mail_username,onChange:T=>N("mail_username",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:l?"text":"password",value:e.mail_password,onChange:T=>N("mail_password",T.target.value),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{type:"button",onClick:()=>o(T=>!T),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:l?"Verbergen":"Anzeigen"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-E-Mail"}),a.jsx("input",{type:"email",value:e.mail_from_email,onChange:T=>N("mail_from_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-Name"}),a.jsx("input",{value:e.mail_from_name,onChange:T=>N("mail_from_name",T.target.value),placeholder:"HifiPlanet",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),a.jsxs("div",{className:"mt-4 border-t border-neutral-200 pt-4 dark:border-neutral-800",children:[k&&a.jsx("p",{className:"mb-2 whitespace-pre-wrap text-sm text-red-600",children:k}),p&&a.jsx("p",{className:"mb-2 text-sm text-green-600 dark:text-green-400",children:p}),w&&a.jsx("p",{className:"mb-2 rounded-md bg-amber-50 p-2 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:w}),a.jsx("button",{type:"button",onClick:E,disabled:b,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:b?"Sende Testmail…":"Verbindung testen"}),P&&P.length>0&&a.jsxs("details",{className:"mt-3",children:[a.jsx("summary",{className:"cursor-pointer text-xs text-neutral-500 dark:text-neutral-400",children:"SMTP-Protokoll anzeigen"}),a.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-neutral-900 p-3 text-xs text-neutral-200",children:P.join(`
+`)})]})]})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Empfänger"}),a.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."}),a.jsx("input",{type:"email",value:e.mail_notify_email,onChange:T=>N("mail_notify_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Kunden (Bestätigung)"}),a.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."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),a.jsx("input",{value:e.mail_customer_subject,onChange:T=>N("mail_customer_subject",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Text"}),a.jsx("textarea",{rows:8,value:e.mail_customer_body,onChange:T=>N("mail_customer_body",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"})]})]}),a.jsx($f,{})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Shop (Benachrichtigung)"}),a.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."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),a.jsx("input",{value:e.mail_owner_subject,onChange:T=>N("mail_owner_subject",T.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Text"}),a.jsx("textarea",{rows:8,value:e.mail_owner_body,onChange:T=>N("mail_owner_body",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"})]})]}),a.jsx($f,{})]}),d&&a.jsx("p",{className:"text-sm text-red-600",children:d}),m&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:u,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:u?"Speichere…":"Speichern"})]})}function F4(){const[e,t]=g.useState({host:"",name:"",user:"",password:"",charset:"utf8mb4"}),[n,r]=g.useState(!1),[s,i]=g.useState(!0),[l,o]=g.useState(!1),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[b,v]=g.useState(null),[k,x]=g.useState(!0),[p,y]=g.useState(!1),[w,j]=g.useState(null),P=()=>{i(!0),M.get("/settings/database").then(E=>{t({...E.config,password:""}),r(E.has_password)}).finally(()=>i(!1))},C=()=>{x(!0),M.get("/settings/schema-check").then(v).catch(E=>v({ok:!1,error:E.message,tables:[]})).finally(()=>x(!1))};g.useEffect(()=>{P(),C()},[]);const N=async()=>{y(!0),j(null);try{const E=await M.post("/settings/schema-migrate",{});j(E.actions),v(E.report)}catch(E){j(["Fehler: "+E.message])}finally{y(!1)}},S=async E=>{E.preventDefault(),c(!0),h(""),f(!1);try{await M.post("/settings/database",e),f(!0),t(T=>({...T,password:""})),r(!0),C()}catch(T){h(T.message)}finally{c(!1)}};return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wichtig für einen Umzug auf einen anderen Server/Webspace: Trage hier die Zugangsdaten der dortigen Datenbank ein. Die Verbindung wird vor dem Speichern getestet, damit du dich nicht aussperrst."}),s?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:S,className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Host *"}),a.jsx("input",{required:!0,value:e.host,onChange:E=>t({...e,host:E.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datenbankname *"}),a.jsx("input",{required:!0,value:e.name,onChange:E=>t({...e,name:E.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzer *"}),a.jsx("input",{required:!0,value:e.user,onChange:E=>t({...e,user:E.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:l?"text":"password",value:e.password,onChange:E=>t({...e,password:E.target.value}),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{type:"button",onClick:()=>o(E=>!E),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:l?"Verbergen":"Anzeigen"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Zeichensatz"}),a.jsx("input",{value:e.charset,onChange:E=>t({...e,charset:E.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&&a.jsx("p",{className:"text-sm text-red-600",children:d}),m&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Verbindung erfolgreich getestet und gespeichert."}),a.jsx("button",{type:"submit",disabled:u,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:u?"Teste & speichere…":"Verbindung testen & speichern"})]})]}),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:"Datenbankstruktur"}),!k&&b&&a.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${b.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:b.ok?"Datenbank OK":"Datenbank nicht OK"})]}),a.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."}),k&&a.jsx("p",{className:"text-sm text-neutral-400",children:"Prüfe…"}),!k&&b&&!b.ok&&a.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:b.tables.filter(E=>!E.ok).map(E=>a.jsx("li",{children:E.exists?a.jsxs(a.Fragment,{children:["Tabelle ",a.jsx("code",{className:"font-mono",children:E.table}),": Spalte(n) fehlen – ",E.missing_columns.join(", ")]}):a.jsxs(a.Fragment,{children:["Tabelle ",a.jsx("code",{className:"font-mono",children:E.table})," fehlt komplett"]})},E.table))}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("button",{onClick:C,disabled:k,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"}),b&&!b.ok&&a.jsx("button",{onClick:N,disabled:p,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:p?"Aktualisiere…":"Datenbankstruktur aktualisieren"})]}),w&&a.jsx("ul",{className:"mt-3 space-y-1 rounded-md bg-neutral-50 p-3 text-sm text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:w.map((E,T)=>a.jsx("li",{children:E},T))})]})]})}function V4(){const[e,t]=g.useState(null),[n,r]=g.useState(!1),[s,i]=g.useState(!1),[l,o]=g.useState(null),[u,c]=g.useState(""),d=async h=>{if(h.preventDefault(),!(!e||!n)){i(!0),c(""),o(null);try{const m=new FormData;m.append("file",e);const f=await M.post("/settings/import",m);o(f),t(null),r(!1),h.target.reset()}catch(m){c(m.message)}finally{i(!1)}}};return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten exportieren"}),a.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 und der kompletten Bildergalerie (inkl. Bilder) herunter. Benutzerkonten und Kontaktanfragen sind bewusst",a.jsx("strong",{children:" nicht"})," enthalten."]}),a.jsx("a",{href:`${lg}/settings/export`,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"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten importieren"}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Lädt eine zuvor exportierte Datei auf diesen Server. ",a.jsx("strong",{children:"Ersetzt dabei alle"})," aktuellen Marken, Modelle, Pakete, Produkte, Upgrades, Leistungen, FAQs und die komplette Bildergalerie auf diesem Server – das kann nicht rückgängig gemacht werden. Kontaktanfragen und Benutzerkonten bleiben unangetastet."]}),a.jsxs("form",{onSubmit:d,className:"space-y-3",children:[a.jsx("input",{type:"file",accept:"application/json,.json",onChange:h=>{var m;return t(((m=h.target.files)==null?void 0:m[0])||null)},className:"text-sm"}),a.jsxs("label",{className:"flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:n,onChange:h=>r(h.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 alle aktuellen Marken, Modelle, Pakete, Produkte, Upgrades, Leistungen, FAQs und die Bildergalerie auf diesem Server unwiderruflich ersetzt."]}),a.jsx("button",{type:"submit",disabled:!e||!n||s,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"})]}),u&&a.jsx("p",{className:"mt-3 text-sm text-red-600",children:u}),l&&a.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:[a.jsx("p",{className:"mb-1 font-semibold",children:"Import erfolgreich:"}),a.jsxs("ul",{className:"list-disc pl-5",children:[a.jsxs("li",{children:[l.counts.brands," Marken"]}),a.jsxs("li",{children:[l.counts.car_models," Modelle"]}),a.jsxs("li",{children:[l.counts.packages," Pakete"]}),a.jsxs("li",{children:[l.counts.package_products," Produkte"]}),a.jsxs("li",{children:[l.counts.package_upgrades," Upgrades"]}),a.jsxs("li",{children:[l.counts.services," Leistungen"]}),a.jsxs("li",{children:[l.counts.faqs," FAQs"]}),a.jsxs("li",{children:[l.counts.gallery_brands," Galerie-Marken"]}),a.jsxs("li",{children:[l.counts.gallery_projects," Galerie-Projekte"]}),a.jsxs("li",{children:[l.counts.gallery_photos," Galerie-Fotos"]}),a.jsxs("li",{children:[l.images_restored," Bilder wiederhergestellt"]})]})]})]})]})}const O4={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function U4(){const[e,t]=g.useState(O4),[n,r]=g.useState(!0),[s,i]=g.useState(!1),[l,o]=g.useState(!1),[u,c]=g.useState("");g.useEffect(()=>{M.get("/maintenance").then(f=>{t({global:{enabled:f.global.enabled,message:f.global.message||""},services:{enabled:f.services.enabled,message:f.services.message||""},vehicles:{enabled:f.vehicles.enabled,message:f.vehicles.message||""}})}).finally(()=>r(!1))},[]);const d=(f,b,v)=>{t(k=>({...k,[f]:{...k[f],[b]:v}})),o(!1)},h=async f=>{f.preventDefault(),i(!0),c(""),o(!1);try{const b=await M.post("/maintenance",e);t({global:{enabled:b.global.enabled,message:b.global.message||""},services:{enabled:b.services.enabled,message:b.services.message||""},vehicles:{enabled:b.vehicles.enabled,message:b.vehicles.message||""}}),o(!0)}catch(b){c(b.message)}finally{i(!1)}},m=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return n?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:h,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.'}),m.map(f=>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:f.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:e[f.key].enabled,onChange:b=>d(f.key,"enabled",b.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:f.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:e[f.key].message,onChange:b=>d(f.key,"message",b.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"})]},f.key)),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),l&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}function W4(){const[e,t]=g.useState(!1),[n,r]=g.useState(""),[s,i]=g.useState(!1),[l,o]=g.useState(""),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[b,v]=g.useState(""),[k,x]=g.useState(!1),[p,y]=g.useState(""),w=async()=>{if(confirm("Alle aktuellen Leistungen werden gelöscht und durch die 8 Standard-Leistungen ersetzt. Fortfahren?")){t(!0),r("");try{const S=await M.post("/settings/reset-services",{});r(`${S.count} Standard-Leistungen wiederhergestellt.`)}catch(S){r("Fehler: "+S.message)}finally{t(!1)}}},j=async()=>{if(confirm("Alle aktuellen FAQ-Einträge werden gelöscht und durch die 6 Standard-Fragen ersetzt. Fortfahren?")){i(!0),o("");try{const S=await M.post("/settings/reset-faqs",{});o(`${S.count} Standard-Fragen wiederhergestellt.`)}catch(S){o("Fehler: "+S.message)}finally{i(!1)}}},P=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?")){c(!0),h("");try{const S=await M.post("/settings/reset-gallery",{});h(`${S.photos} Fotos wiederhergestellt.`)}catch(S){h("Fehler: "+S.message)}finally{c(!1)}}},C=async()=>{if(confirm("Alle Marken, Modelle, Pakete, Produkte und Upgrades werden unwiderruflich gelöscht. Leistungen und Kontaktanfragen bleiben erhalten. Fortfahren?")){f(!0),v("");try{const S=await M.post("/settings/reset-catalog",{});v(`Fahrzeugkatalog geleert (${S.brands_removed} Marken entfernt).`)}catch(S){v("Fehler: "+S.message)}finally{f(!1)}}},N=async()=>{if(confirm("WIRKLICH ALLES zurücksetzen? Marken, Modelle, Pakete, Produkte und Upgrades werden gelöscht, Leistungen, FAQs und die Bildergalerie auf Standard zurückgesetzt. Kontaktanfragen und Benutzerkonten bleiben erhalten. Das kann nicht rückgängig gemacht werden!")){x(!0),y("");try{const S=await M.post("/settings/reset-all",{});y(`Erledigt: ${S.brands_removed} Marken entfernt, ${S.services_reset} Standard-Leistungen, ${S.faqs_reset} Standard-Fragen und ${S.gallery_photos_reset} Galerie-Fotos wiederhergestellt.`)}catch(S){y("Fehler: "+S.message)}finally{x(!1)}}};return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Leistungen zurücksetzen"}),a.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."}),a.jsx("button",{onClick:w,disabled:e,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:e?"Setze zurück…":"Leistungen auf Standard zurücksetzen"}),n&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:n})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur FAQs zurücksetzen"}),a.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."}),a.jsx("button",{onClick:j,disabled:s,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:s?"Setze zurück…":"FAQs auf Standard zurücksetzen"}),l&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:l})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Bildergalerie zurücksetzen"}),a.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."}),a.jsx("button",{onClick:P,disabled:u,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:u?"Setze zurück…":"Galerie auf Standard zurücksetzen"}),d&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:d})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Fahrzeugkatalog leeren"}),a.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."}),a.jsx("button",{onClick:C,disabled:m,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:m?"Leere…":"Fahrzeugkatalog leeren"}),b&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:b})]}),a.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:[a.jsx("h2",{className:"mb-1 font-semibold text-red-700 dark:text-red-300",children:"Alles zurücksetzen"}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:["Kombiniert alles: Fahrzeugkatalog wird komplett geleert ",a.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."]}),a.jsx("button",{onClick:N,disabled:k,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:k?"Setze zurück…":"Wirklich alles zurücksetzen"}),p&&a.jsx("p",{className:"mt-3 text-sm text-neutral-700 dark:text-neutral-300",children:p})]})]})}function H4(){return a.jsxs(a.Fragment,{children:[a.jsx(aw,{}),a.jsx(ow,{}),a.jsx(uw,{children:a.jsxs(Wk,{children:[a.jsx(H,{path:"/setup",element:a.jsx(oP,{})}),a.jsxs(H,{element:a.jsx(oC,{}),children:[a.jsx(H,{path:"/",element:a.jsx(TC,{})}),a.jsx(H,{path:"/fahrzeuge",element:a.jsx(AC,{})}),a.jsx(H,{path:"/fahrzeuge/:brandSlug",element:a.jsx(MC,{})}),a.jsx(H,{path:"/fahrzeuge/:brandSlug/:modelSlug",element:a.jsx($C,{})}),a.jsx(H,{path:"/galerie",element:a.jsx(GC,{})}),a.jsx(H,{path:"/galerie/:brandSlug",element:a.jsx(KC,{})}),a.jsx(H,{path:"/galerie/:brandSlug/:projectSlug",element:a.jsx(YC,{})}),a.jsx(H,{path:"/leistungen",element:a.jsx(XC,{})}),a.jsx(H,{path:"/kontakt",element:a.jsx(nP,{})}),a.jsx(H,{path:"/impressum",element:a.jsx(rP,{})}),a.jsx(H,{path:"/datenschutz",element:a.jsx(sP,{})}),a.jsx(H,{path:"/agb",element:a.jsx(aP,{})})]}),a.jsx(H,{path:"/admin/login",element:a.jsx(uP,{})}),a.jsx(H,{path:"/admin",element:a.jsx(hC,{}),children:a.jsxs(H,{element:a.jsx(dC,{}),children:[a.jsx(H,{index:!0,element:a.jsx(mP,{})}),a.jsx(H,{path:"account",element:a.jsx(P4,{})}),a.jsx(H,{path:"brands",element:a.jsx(Be,{permission:"brands.manage",children:a.jsx(fP,{})})}),a.jsx(H,{path:"models",element:a.jsx(Be,{permission:"models.manage",children:a.jsx(pP,{})})}),a.jsx(H,{path:"gallery-brands",element:a.jsx(Be,{permission:"gallery.manage",children:a.jsx(gP,{})})}),a.jsx(H,{path:"gallery-projects",element:a.jsx(Be,{permission:"gallery.manage",children:a.jsx(xP,{})})}),a.jsx(H,{path:"gallery-projects/:projectId/photos",element:a.jsx(Be,{permission:"gallery.manage",children:a.jsx(bP,{})})}),a.jsx(H,{path:"packages",element:a.jsx(Be,{permission:"packages.manage",children:a.jsx(NP,{})})}),a.jsx(H,{path:"packages/:packageId/products",element:a.jsx(Be,{permission:"packages.manage",children:a.jsx(_P,{})})}),a.jsx(H,{path:"packages/:packageId/upgrades",element:a.jsx(Be,{permission:"packages.manage",children:a.jsx(LP,{})})}),a.jsx(H,{path:"services",element:a.jsx(Be,{permission:"services.manage",children:a.jsx(EP,{})})}),a.jsx(H,{path:"faqs",element:a.jsx(Be,{permission:"content.manage",children:a.jsx(TP,{})})}),a.jsx(H,{path:"contact-requests",element:a.jsx(Be,{permission:"contact.manage",children:a.jsx(FP,{})})}),a.jsx(H,{path:"users",element:a.jsx(Be,{permission:"users.manage",children:a.jsx(E4,{})})}),a.jsx(H,{path:"permission-groups",element:a.jsx(Be,{permission:"permission_groups.manage",children:a.jsx(T4,{})})}),a.jsxs(H,{path:"settings",element:a.jsx(Be,{permission:"settings.manage",children:a.jsx(M4,{})}),children:[a.jsx(H,{index:!0,element:a.jsx(Ws,{to:"website",replace:!0})}),a.jsx(H,{path:"website",element:a.jsx(B4,{})}),a.jsx(H,{path:"email",element:a.jsx(I4,{})}),a.jsx(H,{path:"database",element:a.jsx(F4,{})}),a.jsx(H,{path:"export-import",element:a.jsx(V4,{})}),a.jsx(H,{path:"maintenance",element:a.jsx(U4,{})}),a.jsx(H,{path:"reset",element:a.jsx(W4,{})})]})]})})]})})]})}wo.createRoot(document.getElementById("root")).render(a.jsx(Ob.StrictMode,{children:a.jsx(Qk,{basename:"/".replace(/\/$/,"")||"/",children:a.jsx(dw,{children:a.jsx(gw,{children:a.jsx(Nw,{children:a.jsx(H4,{})})})})})}));
diff --git a/hifi/assets/index-C9rG7muU.css b/hifi/assets/index-C9rG7muU.css
deleted file mode 100644
index a672784..0000000
--- a/hifi/assets/index-C9rG7muU.css
+++ /dev/null
@@ -1 +0,0 @@
-*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-bottom-5{bottom:-1.25rem}.-left-1\/3{left:-33.333333%}.-right-\[4\%\]{right:-4%}.-right-\[60px\]{right:-60px}.-top-3{top:-.75rem}.-top-\[60px\]{top:-60px}.-top-\[8\%\]{top:-8%}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-3\.5{left:.875rem}.left-5{left:1.25rem}.left-6{left:1.5rem}.left-\[14px\]{left:14px}.right-0{right:0}.right-1\/2{right:50%}.right-2{right:.5rem}.right-4{right:1rem}.right-\[40\%\]{right:40%}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-1\/3{top:33.333333%}.top-2{top:.5rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-8{top:2rem}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[200\]{z-index:200}.z-\[60\]{z-index:60}.order-1{order:1}.order-2{order:2}.col-span-full{grid-column:1 / -1}.mx-auto{margin-left:auto;margin-right:auto}.-mt-\[89px\]{margin-top:-89px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-10{margin-bottom:2.5rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-7{margin-bottom:1.75rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mr-3{margin-right:.75rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-10{margin-top:2.5rem}.mt-12{margin-top:3rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-7{margin-top:1.75rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[4\/3\]{aspect-ratio:4/3}.aspect-square{aspect-ratio:1 / 1}.h-0\.5{height:.125rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-48{height:12rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[122\%\]{height:122%}.h-\[17px\]{height:17px}.h-\[18px\]{height:18px}.h-\[190px\]{height:190px}.h-\[210px\]{height:210px}.h-\[22px\]{height:22px}.h-\[280px\]{height:280px}.h-\[420px\]{height:420px}.h-\[46px\]{height:46px}.h-dvh{height:100dvh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-px{height:1px}.max-h-64{max-height:16rem}.max-h-\[85vh\]{max-height:85vh}.min-h-\[560px\]{min-height:560px}.min-h-\[640px\]{min-height:640px}.min-h-\[70vh\]{min-height:70vh}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[17px\]{width:17px}.w-\[18px\]{width:18px}.w-\[190px\]{width:190px}.w-\[22px\]{width:22px}.w-\[230px\]{width:230px}.w-\[2px\]{width:2px}.w-\[360px\]{width:360px}.w-\[3px\]{width:3px}.w-\[42\%\]{width:42%}.w-\[420px\]{width:420px}.w-\[46\%\]{width:46%}.w-\[46px\]{width:46px}.w-\[60\%\]{width:60%}.w-\[90px\]{width:90px}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-\[190px\]{min-width:190px}.min-w-\[220px\]{min-width:220px}.min-w-\[240px\]{min-width:240px}.min-w-\[9rem\]{min-width:9rem}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-6xl{max-width:72rem}.max-w-\[1280px\]{max-width:1280px}.max-w-\[160px\]{max-width:160px}.max-w-\[1880px\]{max-width:1880px}.max-w-\[240px\]{max-width:240px}.max-w-\[520px\]{max-width:520px}.max-w-full{max-width:100%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.basis-\[190px\]{flex-basis:190px}.origin-left{transform-origin:left}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1\/2{--tw-translate-x: 50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-12{--tw-rotate: 12deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-6{--tw-rotate: 6deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y: pan-y;touch-action:var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-y{resize:vertical}.snap-x{scroll-snap-type:x var(--tw-scroll-snap-strictness)}.snap-mandatory{--tw-scroll-snap-strictness: mandatory}.snap-start{scroll-snap-align:start}.snap-center{scroll-snap-align:center}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.grid-cols-\[1fr_auto_1fr\]{grid-template-columns:1fr auto 1fr}.grid-cols-\[auto_1fr\]{grid-template-columns:auto 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-10{gap:2.5rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.gap-\[18px\]{gap:18px}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-5{-moz-column-gap:1.25rem;column-gap:1.25rem}.gap-x-6{-moz-column-gap:1.5rem;column-gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1{row-gap:.25rem}.gap-y-2{row-gap:.5rem}.gap-y-3{row-gap:.75rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-16>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(4rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(4rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-neutral-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(245 245 245 / var(--tw-divide-opacity, 1))}.divide-neutral-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 229 229 / var(--tw-divide-opacity, 1))}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[18px\]{border-radius:18px}.rounded-\[3px\]{border-radius:3px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.rounded-b-xl{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-width:1px}.border-0{border-width:0px}.border-\[1\.5px\]{border-width:1.5px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-brand-300{--tw-border-opacity: 1;border-color:rgb(182 227 130 / var(--tw-border-opacity, 1))}.border-brand-500{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.border-neutral-100{--tw-border-opacity: 1;border-color:rgb(245 245 245 / var(--tw-border-opacity, 1))}.border-neutral-200{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-neutral-300{--tw-border-opacity: 1;border-color:rgb(212 212 212 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/30{border-color:#ffffff4d}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-black\/50{background-color:#00000080}.bg-black\/55{background-color:#0000008c}.bg-black\/60{background-color:#0009}.bg-black\/90{background-color:#000000e6}.bg-brand-100{--tw-bg-opacity: 1;background-color:rgb(233 246 218 / var(--tw-bg-opacity, 1))}.bg-brand-400{--tw-bg-opacity: 1;background-color:rgb(146 212 68 / var(--tw-bg-opacity, 1))}.bg-brand-50{--tw-bg-opacity: 1;background-color:rgb(245 251 238 / var(--tw-bg-opacity, 1))}.bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.bg-brand-500\/60{background-color:#6ba62699}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-neutral-100{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}.bg-neutral-200{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.bg-neutral-300{--tw-bg-opacity: 1;background-color:rgb(212 212 212 / var(--tw-bg-opacity, 1))}.bg-neutral-400{--tw-bg-opacity: 1;background-color:rgb(163 163 163 / var(--tw-bg-opacity, 1))}.bg-neutral-50{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}.bg-neutral-900{--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.bg-neutral-900\/10{background-color:#1717171a}.bg-neutral-950{--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-50\/40{background-color:#fef2f266}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-600{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/90{background-color:#ffffffe6}.bg-white\/95{background-color:#fffffff2}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-black\/85{--tw-gradient-from: rgb(0 0 0 / .85) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-neutral-950{--tw-gradient-from: #0a0a0a var(--tw-gradient-from-position);--tw-gradient-to: rgb(10 10 10 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-black\/10{--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(0 0 0 / .1) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-neutral-950\/80{--tw-gradient-to: rgb(10 10 10 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(10 10 10 / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.via-white\/40{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), rgb(255 255 255 / .4) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-neutral-950\/40{--tw-gradient-to: rgb(10 10 10 / .4) var(--tw-gradient-to-position)}.to-transparent{--tw-gradient-to: transparent var(--tw-gradient-to-position)}.bg-contain{background-size:contain}.bg-cover{background-size:cover}.bg-center{background-position:center}.bg-right{background-position:right}.bg-no-repeat{background-repeat:no-repeat}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.p-\[22px\]{padding:22px}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.px-\[22px\]{padding-left:22px;padding-right:22px}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-20{padding-top:5rem;padding-bottom:5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-\[22px\]{padding-top:22px;padding-bottom:22px}.py-\[26px\]{padding-top:26px;padding-bottom:26px}.pb-10{padding-bottom:2.5rem}.pb-12{padding-bottom:3rem}.pb-24{padding-bottom:6rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-5{padding-left:1.25rem}.pl-6{padding-left:1.5rem}.pl-\[42px\]{padding-left:42px}.pr-4{padding-right:1rem}.pr-8{padding-right:2rem}.pt-10{padding-top:2.5rem}.pt-12{padding-top:3rem}.pt-3{padding-top:.75rem}.pt-3\.5{padding-top:.875rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.pt-6{padding-top:1.5rem}.pt-8{padding-top:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[15px\]{font-size:15px}.text-\[17px\]{font-size:17px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-\[1\.08\]{line-height:1.08}.leading-\[1\.4\]{line-height:1.4}.leading-\[1\.55\]{line-height:1.55}.leading-snug{line-height:1.375}.tracking-\[0\.2em\]{letter-spacing:.2em}.tracking-\[2px\]{letter-spacing:2px}.tracking-\[3px\]{letter-spacing:3px}.tracking-\[6px\]{letter-spacing:6px}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-brand-400{--tw-text-opacity: 1;color:rgb(146 212 68 / var(--tw-text-opacity, 1))}.text-brand-500{--tw-text-opacity: 1;color:rgb(107 166 38 / var(--tw-text-opacity, 1))}.text-brand-600{--tw-text-opacity: 1;color:rgb(88 137 31 / var(--tw-text-opacity, 1))}.text-brand-700{--tw-text-opacity: 1;color:rgb(72 112 26 / var(--tw-text-opacity, 1))}.text-brand-800{--tw-text-opacity: 1;color:rgb(59 91 21 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-neutral-200{--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity, 1))}.text-neutral-300{--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.text-neutral-400{--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.text-neutral-500{--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.text-neutral-600{--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.text-neutral-700{--tw-text-opacity: 1;color:rgb(64 64 64 / var(--tw-text-opacity, 1))}.text-neutral-800{--tw-text-opacity: 1;color:rgb(38 38 38 / var(--tw-text-opacity, 1))}.text-neutral-900{--tw-text-opacity: 1;color:rgb(23 23 23 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/70{color:#ffffffb3}.text-white\/80{color:#fffc}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-\[0\.85\]{opacity:.85}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_-8px_24px_rgba\(0\,0\,0\,0\.08\)\]{--tw-shadow: 0 -8px 24px rgba(0,0,0,.08);--tw-shadow-colored: 0 -8px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_10px_rgba\(107\,166\,38\,0\.7\)\]{--tw-shadow: 0 0 10px rgba(107,166,38,.7);--tw-shadow-colored: 0 0 10px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-brand-500\/30{--tw-shadow-color: rgb(107 166 38 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-neutral-900\/20{--tw-shadow-color: rgb(23 23 23 / .2);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-brand-500\/40{--tw-ring-color: rgb(107 166 38 / .4)}.ring-neutral-300{--tw-ring-opacity: 1;--tw-ring-color: rgb(212 212 212 / var(--tw-ring-opacity, 1))}.ring-white{--tw-ring-opacity: 1;--tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity, 1))}.ring-white\/50{--tw-ring-color: rgb(255 255 255 / .5)}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-\[1px\]{--tw-blur: blur(1px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-\[20px\]{--tw-blur: blur(20px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.blur-\[26px\]{--tw-blur: blur(26px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.drop-shadow{--tw-drop-shadow: drop-shadow(0 1px 2px rgb(0 0 0 / .1)) drop-shadow(0 1px 1px rgb(0 0 0 / .06));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[filter\,box-shadow\]{transition-property:filter,box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.will-change-transform{will-change:transform}.\[scrollbar-width\:none\]{scrollbar-width:none}html{scroll-behavior:smooth}.marquee-viewport{-webkit-mask-image:linear-gradient(to right,transparent,black 6%,black 94%,transparent);mask-image:linear-gradient(to right,transparent,black 6%,black 94%,transparent)}.page-texture{background-color:#f6f5f0;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:180px 180px}.dark .page-texture{background-color:#0a0b07;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}.kf-page{--kf-pagebg: linear-gradient(120deg, #eef0ea 0%, #f6f8f3 45%, #fbfcf9 100%);--kf-card: #ffffff;--kf-cardbrd: #e4e8dc;--kf-text: #23271d;--kf-text2: #2a2e24;--kf-muted: #6c7360;--kf-label: #838a72;--kf-field: #fafcf6;--kf-fieldbrd: #dde2d3;--kf-fieldicon: #a7ad9d;--kf-accent: #a4d417;--kf-accent2: #8ec21a;--kf-accentsoft: #f2f8df;--kf-pill: #ffffff;--kf-pillbrd: #dfe4d6;--kf-shadow: 0 24px 60px rgba(60, 70, 40, .08);--kf-shadow2: 0 16px 40px rgba(60, 70, 40, .06);--kf-divider: #e8ecdf;--kf-topo: #d7dccd;--kf-pkgbg: #f4fbe4;--kf-pkgbrd: #cfe89a;--kf-btntext: #1f2417;--kf-scrim: linear-gradient(90deg, rgba(244, 246, 241, .35) 0%, rgba(244, 246, 241, .55) 55%, rgba(246, 248, 243, 1) 100%)}.dark .kf-page{--kf-pagebg: linear-gradient(120deg, #181b0f 0%, #111409 45%, #0a0c06 100%);--kf-card: #14170e;--kf-cardbrd: rgba(168, 225, 12, .16);--kf-text: #f3f6ea;--kf-text2: #e8ece0;--kf-muted: #9aa38c;--kf-label: #8f987f;--kf-field: rgba(0, 0, 0, .35);--kf-fieldbrd: #2c3323;--kf-fieldicon: #5f6852;--kf-accent: #a8e10c;--kf-accent2: #b6e619;--kf-accentsoft: rgba(168, 225, 12, .1);--kf-pill: #14170e;--kf-pillbrd: rgba(168, 225, 12, .28);--kf-shadow: 0 24px 60px rgba(0, 0, 0, .55);--kf-shadow2: 0 16px 40px rgba(0, 0, 0, .45);--kf-divider: rgba(168, 225, 12, .15);--kf-pkgbg: rgba(168, 225, 12, .08);--kf-pkgbrd: rgba(168, 225, 12, .4);--kf-btntext: #0f1208}.kontakt-bg-foto{position:absolute;left:0;bottom:0;width:clamp(280px,24vw,460px);height:auto;pointer-events:none;z-index:0;opacity:.9;-webkit-mask-composite:source-in;-webkit-mask-image:linear-gradient(90deg,black 55%,transparent 100%),linear-gradient(180deg,transparent 0%,black 45%);mask-image:linear-gradient(90deg,black 55%,transparent 100%),linear-gradient(180deg,transparent 0%,black 45%);-webkit-mask-composite:source-in,xor;mask-composite:intersect}.kf-page input::-moz-placeholder,.kf-page textarea::-moz-placeholder{color:var(--kf-fieldicon)}.kf-page input::placeholder,.kf-page textarea::placeholder{color:var(--kf-fieldicon)}.kf-page input:focus,.kf-page textarea:focus{border-color:var(--kf-accent)!important;box-shadow:0 0 0 3px #a4d41733}.grain-band{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.13 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:180px 180px}.dark .grain-band{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch' result='noise'/%3E%3CfeColorMatrix in='noise' type='matrix' values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}html.hifi-cursor-on,html.hifi-cursor-on *{cursor:none!important}html.hifi-cursor-on :is(input,textarea,[contenteditable=true]){cursor:auto!important}.hifi-cursor{position:fixed;top:0;right:0;bottom:0;left:0;pointer-events:none;z-index:99999;opacity:1;transition:opacity .2s ease}.hifi-cursor[data-hidden=true]{opacity:0}.hifi-cursor__core{position:fixed;top:0;left:0;width:10px;height:10px;margin:-5px 0 0 -5px;border-radius:9999px;background:#7fd44a;box-shadow:0 0 0 1.5px #ffffffe6,0 0 10px #7fd44abf;transition:width .18s ease,height .18s ease,margin .18s ease,background-color .18s ease,opacity .15s ease}.hifi-cursor__orbit{position:fixed;top:0;left:0;opacity:0;transition:opacity .18s ease}.hifi-cursor__ring{position:absolute;width:38px;height:15px;margin:-7.5px 0 0 -19px;border:1px solid rgba(139,234,60,.85);border-radius:50%;transform:rotate(-24deg) scale(.6);transition:transform .22s ease}.hifi-cursor__sat{position:absolute;width:5px;height:5px;margin:-2.5px 0 0 -2.5px;border-radius:9999px;background:#eaffdb;box-shadow:0 0 6px #8bea3ce6}.hifi-cursor[data-state=hover] .hifi-cursor__orbit{opacity:1}.hifi-cursor[data-state=hover] .hifi-cursor__core{width:16px;height:16px;margin:-8px 0 0 -8px;background:#8bea3c;box-shadow:0 0 0 1.5px #fffffff2,0 0 12px #8bea3cd9}.hifi-cursor[data-state=hover] .hifi-cursor__ring{transform:rotate(-24deg) scale(1.45)}.hifi-cursor[data-state=text] .hifi-cursor__core,.hifi-cursor[data-state=text] .hifi-cursor__orbit{opacity:0}.hifi-cursor[data-down=true] .hifi-cursor__core{width:20px;height:20px;margin:-10px 0 0 -10px}.hifi-cursor__pulse{position:fixed;top:0;left:0;width:12px;height:12px;margin:-6px 0 0 -6px;border-radius:9999px;border:1.5px solid rgba(139,234,60,.9);opacity:0}.hifi-cursor__pulse.is-live{animation:hifi-cursor-pulse .45s ease-out forwards}@keyframes hifi-cursor-pulse{0%{opacity:.9;transform:scale(1)}to{opacity:0;transform:scale(3.2)}}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:border-\[var\(--kf-accent\)\]:hover{border-color:var(--kf-accent)}.hover\:border-brand-500:hover{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.hover\:border-neutral-400:hover{--tw-border-opacity: 1;border-color:rgb(163 163 163 / var(--tw-border-opacity, 1))}.hover\:bg-\[var\(--kf-accentsoft\)\]:hover{background-color:var(--kf-accentsoft)}.hover\:bg-brand-400:hover{--tw-bg-opacity: 1;background-color:rgb(146 212 68 / var(--tw-bg-opacity, 1))}.hover\:bg-brand-50:hover{--tw-bg-opacity: 1;background-color:rgb(245 251 238 / var(--tw-bg-opacity, 1))}.hover\:bg-brand-600:hover{--tw-bg-opacity: 1;background-color:rgb(88 137 31 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-100:hover{--tw-bg-opacity: 1;background-color:rgb(245 245 245 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 229 229 / var(--tw-bg-opacity, 1))}.hover\:bg-neutral-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 250 250 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-700:hover{--tw-bg-opacity: 1;background-color:rgb(185 28 28 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/10:hover{background-color:#ffffff1a}.hover\:bg-white\/20:hover{background-color:#fff3}.hover\:text-brand-500:hover{--tw-text-opacity: 1;color:rgb(107 166 38 / var(--tw-text-opacity, 1))}.hover\:text-brand-600:hover{--tw-text-opacity: 1;color:rgb(88 137 31 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:border-brand-500:focus{--tw-border-opacity: 1;border-color:rgb(107 166 38 / var(--tw-border-opacity, 1))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-brand-500:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(107 166 38 / var(--tw-ring-opacity, 1))}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.group:hover .group-hover\:scale-105{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:from-black\/95{--tw-gradient-from: rgb(0 0 0 / .95) var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.peer:checked~.peer-checked\:translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:checked~.peer-checked\:bg-brand-500{--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.dark\:block:is(.dark *){display:block}.dark\:\!hidden:is(.dark *){display:none!important}.dark\:hidden:is(.dark *){display:none}.dark\:divide-neutral-800:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(38 38 38 / var(--tw-divide-opacity, 1))}.dark\:border-brand-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(48 75 17 / var(--tw-border-opacity, 1))}.dark\:border-neutral-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(64 64 64 / var(--tw-border-opacity, 1))}.dark\:border-neutral-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(38 38 38 / var(--tw-border-opacity, 1))}.dark\:border-red-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(127 29 29 / var(--tw-border-opacity, 1))}.dark\:bg-amber-900\/20:is(.dark *){background-color:#78350f33}.dark\:bg-amber-900\/40:is(.dark *){background-color:#78350f66}.dark\:bg-brand-500:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(107 166 38 / var(--tw-bg-opacity, 1))}.dark\:bg-brand-900\/20:is(.dark *){background-color:#304b1133}.dark\:bg-brand-900\/40:is(.dark *){background-color:#304b1166}.dark\:bg-green-900\/20:is(.dark *){background-color:#14532d33}.dark\:bg-green-900\/40:is(.dark *){background-color:#14532d66}.dark\:bg-neutral-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 23 23 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-900\/40:is(.dark *){background-color:#17171766}.dark\:bg-neutral-900\/95:is(.dark *){background-color:#171717f2}.dark\:bg-neutral-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(10 10 10 / var(--tw-bg-opacity, 1))}.dark\:bg-neutral-950\/90:is(.dark *){background-color:#0a0a0ae6}.dark\:bg-neutral-950\/95:is(.dark *){background-color:#0a0a0af2}.dark\:bg-red-900\/10:is(.dark *){background-color:#7f1d1d1a}.dark\:bg-red-900\/20:is(.dark *){background-color:#7f1d1d33}.dark\:bg-red-900\/40:is(.dark *){background-color:#7f1d1d66}.dark\:bg-slate-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(2 6 23 / var(--tw-bg-opacity, 1))}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-brand-200:is(.dark *){--tw-text-opacity: 1;color:rgb(211 238 180 / var(--tw-text-opacity, 1))}.dark\:text-brand-300:is(.dark *){--tw-text-opacity: 1;color:rgb(182 227 130 / var(--tw-text-opacity, 1))}.dark\:text-brand-400:is(.dark *){--tw-text-opacity: 1;color:rgb(146 212 68 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-neutral-100:is(.dark *){--tw-text-opacity: 1;color:rgb(245 245 245 / var(--tw-text-opacity, 1))}.dark\:text-neutral-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 229 229 / var(--tw-text-opacity, 1))}.dark\:text-neutral-300:is(.dark *){--tw-text-opacity: 1;color:rgb(212 212 212 / var(--tw-text-opacity, 1))}.dark\:text-neutral-400:is(.dark *){--tw-text-opacity: 1;color:rgb(163 163 163 / var(--tw-text-opacity, 1))}.dark\:text-neutral-500:is(.dark *){--tw-text-opacity: 1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.dark\:text-neutral-600:is(.dark *){--tw-text-opacity: 1;color:rgb(82 82 82 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-slate-100:is(.dark *){--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.dark\:text-white:is(.dark *){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.dark\:shadow-black\/40:is(.dark *){--tw-shadow-color: rgb(0 0 0 / .4);--tw-shadow: var(--tw-shadow-colored)}.dark\:ring-neutral-600:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(82 82 82 / var(--tw-ring-opacity, 1))}.dark\:ring-neutral-900:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(23 23 23 / var(--tw-ring-opacity, 1))}.dark\:hover\:border-neutral-600:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(82 82 82 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-brand-900\/20:hover:is(.dark *){background-color:#304b1133}.dark\:hover\:bg-neutral-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(64 64 64 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-neutral-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(38 38 38 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900\/20:hover:is(.dark *){background-color:#7f1d1d33}@media (min-width: 640px){.sm\:left-4{left:1rem}.sm\:left-8{left:2rem}.sm\:right-4{right:1rem}.sm\:top-\[65px\]{top:65px}.sm\:-mt-\[97px\]{margin-top:-97px}.sm\:block{display:block}.sm\:hidden{display:none}.sm\:h-16{height:4rem}.sm\:h-20{height:5rem}.sm\:min-h-\[85vh\]{min-height:85vh}.sm\:w-72{width:18rem}.sm\:w-auto{width:auto}.sm\:flex-none{flex:none}.sm\:shrink-0{flex-shrink:0}.sm\:basis-\[210px\]{flex-basis:210px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.sm\:grid-cols-\[1fr_120px\]{grid-template-columns:1fr 120px}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:p-10{padding:2.5rem}.sm\:p-5{padding:1.25rem}.sm\:p-6{padding:1.5rem}.sm\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:px-8{padding-left:2rem;padding-right:2rem}.sm\:py-14{padding-top:3.5rem;padding-bottom:3.5rem}.sm\:py-\[34px\]{padding-top:34px;padding-bottom:34px}.sm\:pl-8{padding-left:2rem}.sm\:pl-\[52px\]{padding-left:52px}.sm\:pt-14{padding-top:3.5rem}.sm\:text-3xl{font-size:1.875rem;line-height:2.25rem}.sm\:text-5xl{font-size:3rem;line-height:1}.sm\:text-\[46px\]{font-size:46px}.sm\:text-lg{font-size:1.125rem;line-height:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (min-width: 641px){.min-\[641px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.min-\[641px\]\:border-b-0{border-bottom-width:0px}.min-\[641px\]\:border-r{border-right-width:1px}.min-\[641px\]\:last\:border-r-0:last-child{border-right-width:0px}}@media (min-width: 768px){.md\:order-1{order:1}.md\:order-2{order:2}.md\:mx-0{margin-left:0;margin-right:0}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-left{text-align:left}}@media (min-width: 901px){.min-\[901px\]\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 981px){.min-\[981px\]\:block{display:block}.min-\[981px\]\:grid-cols-\[minmax\(0\,1\.35fr\)_minmax\(320px\,1fr\)\]{grid-template-columns:minmax(0,1.35fr) minmax(320px,1fr)}}@media (min-width: 1024px){.lg\:col-span-2{grid-column:span 2 / span 2}.lg\:w-80{width:20rem}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:text-\[60px\]{font-size:60px}}@media (min-width: 1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar{display:none}
diff --git a/hifi/assets/splatter-ChpwEetv.png b/hifi/assets/splatter-ChpwEetv.png
deleted file mode 100644
index 94f6b1f..0000000
Binary files a/hifi/assets/splatter-ChpwEetv.png and /dev/null differ
diff --git a/hifi/index.html b/hifi/index.html
index bb929b4..7aee7d3 100644
--- a/hifi/index.html
+++ b/hifi/index.html
@@ -43,9 +43,9 @@
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
}
-
+
-
+