Merge branch 'besucher-statistik' in main
Admin-Seite "Besucher" (/admin/traffic) mit GA4-Trends und Live-Karte. Build-Output neu erzeugt. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019SDNFmggXYzftrfZ6epwP5
This commit is contained in:
commit
eb9b1f60ea
70 changed files with 841 additions and 109 deletions
|
|
@ -63,6 +63,7 @@ const SetupWizard = lazyPage(() => import('./pages/public/SetupWizard.jsx'));
|
||||||
const Login = lazyPage(() => import('./pages/admin/Login.jsx'));
|
const Login = lazyPage(() => import('./pages/admin/Login.jsx'));
|
||||||
const ConfirmEmail = lazyPage(() => import('./pages/admin/ConfirmEmail.jsx'));
|
const ConfirmEmail = lazyPage(() => import('./pages/admin/ConfirmEmail.jsx'));
|
||||||
const Dashboard = lazyPage(() => import('./pages/admin/Dashboard.jsx'));
|
const Dashboard = lazyPage(() => import('./pages/admin/Dashboard.jsx'));
|
||||||
|
const Traffic = lazyPage(() => import('./pages/admin/Traffic.jsx'));
|
||||||
const Brands = lazyPage(() => import('./pages/admin/Brands.jsx'));
|
const Brands = lazyPage(() => import('./pages/admin/Brands.jsx'));
|
||||||
const Models = lazyPage(() => import('./pages/admin/Models.jsx'));
|
const Models = lazyPage(() => import('./pages/admin/Models.jsx'));
|
||||||
const GalleryBrands = lazyPage(() => import('./pages/admin/GalleryBrands.jsx'));
|
const GalleryBrands = lazyPage(() => import('./pages/admin/GalleryBrands.jsx'));
|
||||||
|
|
@ -136,6 +137,7 @@ export default function App() {
|
||||||
<Route path="/admin" element={<ProtectedRoute />}>
|
<Route path="/admin" element={<ProtectedRoute />}>
|
||||||
<Route element={<AdminLayout />}>
|
<Route element={<AdminLayout />}>
|
||||||
<Route index element={<Dashboard />} />
|
<Route index element={<Dashboard />} />
|
||||||
|
<Route path="traffic" element={<RequirePermission permission="system.admin"><Traffic /></RequirePermission>} />
|
||||||
<Route path="account" element={<AccountSettings />} />
|
<Route path="account" element={<AccountSettings />} />
|
||||||
<Route path="brands" element={<RequirePermission permission="brands.manage"><Brands /></RequirePermission>} />
|
<Route path="brands" element={<RequirePermission permission="brands.manage"><Brands /></RequirePermission>} />
|
||||||
<Route path="models" element={<RequirePermission permission="models.manage"><Models /></RequirePermission>} />
|
<Route path="models" element={<RequirePermission permission="models.manage"><Models /></RequirePermission>} />
|
||||||
|
|
|
||||||
|
|
@ -161,6 +161,7 @@ export default function AdminLayout() {
|
||||||
title: null,
|
title: null,
|
||||||
links: [
|
links: [
|
||||||
{ to: '/admin', label: 'Übersicht', icon: 'gauge', end: true, keywords: 'dashboard start' },
|
{ to: '/admin', label: 'Übersicht', icon: 'gauge', end: true, keywords: 'dashboard start' },
|
||||||
|
{ to: '/admin/traffic', label: 'Besucher', icon: 'chart', permission: 'system.admin', keywords: 'statistik analytics traffic zugriffe trend' },
|
||||||
{ to: '/admin/contact-requests', label: 'Anfragen', icon: 'inbox', permission: 'contact.manage', badge: newContactCount, keywords: 'kontakt kunden nachrichten' },
|
{ to: '/admin/contact-requests', label: 'Anfragen', icon: 'inbox', permission: 'contact.manage', badge: newContactCount, keywords: 'kontakt kunden nachrichten' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -385,6 +385,7 @@ export const ICONS = {
|
||||||
list: 'M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01',
|
list: 'M8 6h12M8 12h12M8 18h12M4 6h.01M4 12h.01M4 18h.01',
|
||||||
grip: 'M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01',
|
grip: 'M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01',
|
||||||
check: 'M5 12.5l4.5 4.5L19 7.5',
|
check: 'M5 12.5l4.5 4.5L19 7.5',
|
||||||
|
chart: 'M4 4v15a1 1 0 0 0 1 1h15M8 15l3.5-4 3 2.5L20 7',
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Icon({ name, className = 'h-5 w-5' }) {
|
export function Icon({ name, className = 'h-5 w-5' }) {
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,12 @@ function AnalyticsWidget() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
<section className="rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900">
|
||||||
<h2 className="mb-1 font-semibold text-neutral-900 dark:text-white">Google Analytics</h2>
|
<div className="mb-1 flex flex-wrap items-baseline justify-between gap-2">
|
||||||
|
<h2 className="font-semibold text-neutral-900 dark:text-white">Google Analytics</h2>
|
||||||
|
<Link to="/admin/traffic" className="text-sm font-medium text-brand-600 hover:underline dark:text-brand-400">
|
||||||
|
Details & Trends →
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
<p className="mb-5 text-sm text-neutral-500 dark:text-neutral-400">Letzte 7 Tage.</p>
|
<p className="mb-5 text-sm text-neutral-500 dark:text-neutral-400">Letzte 7 Tage.</p>
|
||||||
|
|
||||||
<div className="mb-6 grid grid-cols-3 gap-4">
|
<div className="mb-6 grid grid-cols-3 gap-4">
|
||||||
|
|
|
||||||
470
hifi-src/src/pages/admin/Traffic.jsx
Normal file
470
hifi-src/src/pages/admin/Traffic.jsx
Normal file
|
|
@ -0,0 +1,470 @@
|
||||||
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||||
|
import { api } from '../../api/client.js';
|
||||||
|
import { Button, Card, EmptyState, PageHeader, Segmented } from '../../components/ui/index.jsx';
|
||||||
|
|
||||||
|
// Ausfuehrliche Besucher-Statistik aus Google Analytics (GA4 Data API, siehe
|
||||||
|
// GoogleAnalyticsReporting::fetchTrafficReport). Jede Zahl wird mit dem vorherigen Zeitraum
|
||||||
|
// gleicher Laenge verglichen, damit man sofort sieht, ob es aufwaerts oder abwaerts geht.
|
||||||
|
|
||||||
|
const RANGES = [
|
||||||
|
{ value: 7, label: '7 Tage' },
|
||||||
|
{ value: 28, label: '28 Tage' },
|
||||||
|
{ value: 90, label: '90 Tage' },
|
||||||
|
{ value: 365, label: '12 Monate' },
|
||||||
|
];
|
||||||
|
|
||||||
|
const CHART_METRICS = [
|
||||||
|
{ value: 'users', label: 'Besucher' },
|
||||||
|
{ value: 'sessions', label: 'Sitzungen' },
|
||||||
|
{ value: 'pageviews', label: 'Seitenaufrufe' },
|
||||||
|
];
|
||||||
|
|
||||||
|
const CHANNEL_LABELS = {
|
||||||
|
Direct: 'Direkt (Adresse/Lesezeichen)',
|
||||||
|
'Organic Search': 'Google & Co. (unbezahlt)',
|
||||||
|
'Paid Search': 'Suchanzeigen',
|
||||||
|
Referral: 'Verweise von anderen Seiten',
|
||||||
|
'Organic Social': 'Social Media',
|
||||||
|
'Paid Social': 'Social-Media-Anzeigen',
|
||||||
|
Email: 'E-Mail',
|
||||||
|
'Organic Maps': 'Google Maps',
|
||||||
|
'Organic Video': 'Video (YouTube & Co.)',
|
||||||
|
Display: 'Bannerwerbung',
|
||||||
|
Unassigned: 'Nicht zugeordnet',
|
||||||
|
};
|
||||||
|
|
||||||
|
const DEVICE_LABELS = { desktop: 'Computer', mobile: 'Handy', tablet: 'Tablet', 'smart tv': 'Smart-TV' };
|
||||||
|
|
||||||
|
// Eigene Events der Website (utils/analytics.js) mit verstaendlichem Namen. Automatische
|
||||||
|
// GA-Events wie session_start bringen hier nichts und werden ausgeblendet.
|
||||||
|
const EVENT_LABELS = {
|
||||||
|
generate_lead: 'Anfrage gesendet',
|
||||||
|
select_package: 'Paket angeklickt',
|
||||||
|
contact_call: 'Telefonnummer angetippt',
|
||||||
|
contact_whatsapp: 'WhatsApp geöffnet',
|
||||||
|
scroll: 'Bis zum Seitenende gescrollt',
|
||||||
|
click: 'Link zu anderer Website',
|
||||||
|
file_download: 'Datei heruntergeladen',
|
||||||
|
form_start: 'Formular angefangen',
|
||||||
|
};
|
||||||
|
|
||||||
|
const nf = new Intl.NumberFormat('de-DE');
|
||||||
|
const fmtNumber = (n) => nf.format(Math.round(n));
|
||||||
|
const fmtPercent = (n) => `${new Intl.NumberFormat('de-DE', { maximumFractionDigits: 1 }).format(n * 100)} %`;
|
||||||
|
const fmtDuration = (seconds) => {
|
||||||
|
const s = Math.round(seconds);
|
||||||
|
return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, '0')} min`;
|
||||||
|
};
|
||||||
|
const fmtDate = (ymd, withYear = false) => `${ymd.slice(6, 8)}.${ymd.slice(4, 6)}.${withYear ? ymd.slice(0, 4) : ''}`;
|
||||||
|
|
||||||
|
function change(current, previous) {
|
||||||
|
if (!previous) return current > 0 ? { label: 'neu', tone: 'up' } : null;
|
||||||
|
const pct = ((current - previous) / previous) * 100;
|
||||||
|
if (Math.abs(pct) < 0.5) return { label: '±0 %', tone: 'flat' };
|
||||||
|
return {
|
||||||
|
label: `${pct > 0 ? '+' : '−'}${new Intl.NumberFormat('de-DE', { maximumFractionDigits: Math.abs(pct) < 10 ? 1 : 0 }).format(Math.abs(pct))} %`,
|
||||||
|
tone: pct > 0 ? 'up' : 'down',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const TREND_TONES = {
|
||||||
|
up: 'bg-brand-100 text-brand-800 dark:bg-brand-900/50 dark:text-brand-300',
|
||||||
|
down: 'bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300',
|
||||||
|
flat: 'bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300',
|
||||||
|
};
|
||||||
|
|
||||||
|
function Trend({ current, previous, className = '' }) {
|
||||||
|
const c = change(current, previous);
|
||||||
|
if (!c) return null;
|
||||||
|
return (
|
||||||
|
<span className={`inline-flex items-center rounded-full px-1.5 py-0.5 text-[11px] font-semibold tabular-nums ${TREND_TONES[c.tone]} ${className}`}>
|
||||||
|
{c.tone === 'up' ? '▲ ' : c.tone === 'down' ? '▼ ' : ''}
|
||||||
|
{c.label}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function KpiTile({ label, hint, value, previous, format }) {
|
||||||
|
return (
|
||||||
|
<div className="rounded-xl border border-neutral-200/80 bg-white p-4 shadow-sm shadow-neutral-900/[0.03] dark:border-neutral-800 dark:bg-neutral-900 dark:shadow-none">
|
||||||
|
<p className="text-xs font-medium text-neutral-500 dark:text-neutral-400" title={hint}>
|
||||||
|
{label}
|
||||||
|
</p>
|
||||||
|
<p className="mt-1 text-2xl font-bold tabular-nums tracking-tight text-neutral-900 dark:text-white">{format(value)}</p>
|
||||||
|
<div className="mt-1.5 flex flex-wrap items-center gap-1.5">
|
||||||
|
<Trend current={value} previous={previous} />
|
||||||
|
<span className="text-[11px] text-neutral-400">vorher {format(previous)}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Verlauf als Liniendiagramm: aktueller Zeitraum (Flaeche) gegen den vorherigen (gestrichelt). */
|
||||||
|
function TrendChart({ current, previous, metric, days }) {
|
||||||
|
const [hover, setHover] = useState(null);
|
||||||
|
// In echter Pixelbreite zeichnen statt per viewBox zu skalieren - sonst wird die Schrift
|
||||||
|
// auf dem Handy winzig.
|
||||||
|
const boxRef = useRef(null);
|
||||||
|
const [W, setW] = useState(720);
|
||||||
|
useEffect(() => {
|
||||||
|
const el = boxRef.current;
|
||||||
|
if (!el) return undefined;
|
||||||
|
const ro = new ResizeObserver(([entry]) => setW(Math.max(260, Math.round(entry.contentRect.width))));
|
||||||
|
ro.observe(el);
|
||||||
|
return () => ro.disconnect();
|
||||||
|
}, []);
|
||||||
|
const H = W < 500 ? 200 : 240;
|
||||||
|
const pad = { top: 12, right: 8, bottom: 26, left: 36 };
|
||||||
|
const innerW = W - pad.left - pad.right;
|
||||||
|
const innerH = H - pad.top - pad.bottom;
|
||||||
|
|
||||||
|
const max = Math.max(1, ...current.map((d) => d[metric]), ...previous.map((d) => d[metric]));
|
||||||
|
const niceMax = (() => {
|
||||||
|
const step = 10 ** Math.floor(Math.log10(max));
|
||||||
|
return Math.ceil(max / step) * step;
|
||||||
|
})();
|
||||||
|
const n = current.length;
|
||||||
|
const x = (i) => pad.left + (n <= 1 ? innerW / 2 : (i / (n - 1)) * innerW);
|
||||||
|
const y = (v) => pad.top + innerH - (v / niceMax) * innerH;
|
||||||
|
const line = (points) => points.map((d, i) => `${i ? 'L' : 'M'}${x(i).toFixed(1)},${y(d[metric]).toFixed(1)}`).join('');
|
||||||
|
const area = `${line(current)}L${x(n - 1).toFixed(1)},${pad.top + innerH}L${x(0).toFixed(1)},${pad.top + innerH}Z`;
|
||||||
|
|
||||||
|
const ticks = [0, 0.5, 1].map((f) => Math.round(niceMax * f));
|
||||||
|
const labelEvery = Math.max(1, Math.ceil(n / Math.max(3, Math.floor(W / 100))));
|
||||||
|
|
||||||
|
const onMove = (e) => {
|
||||||
|
const rect = e.currentTarget.getBoundingClientRect();
|
||||||
|
const px = ((e.clientX - rect.left) / rect.width) * W;
|
||||||
|
const i = Math.round(((px - pad.left) / innerW) * (n - 1));
|
||||||
|
setHover(Math.min(n - 1, Math.max(0, i)));
|
||||||
|
};
|
||||||
|
|
||||||
|
const h = hover !== null ? { cur: current[hover], prev: previous[hover] } : null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div ref={boxRef} className="relative">
|
||||||
|
<svg
|
||||||
|
width={W}
|
||||||
|
height={H}
|
||||||
|
viewBox={`0 0 ${W} ${H}`}
|
||||||
|
className="block max-w-full touch-none select-none"
|
||||||
|
onMouseMove={onMove}
|
||||||
|
onTouchMove={(e) => onMove(e.touches[0] ? { ...e, clientX: e.touches[0].clientX, currentTarget: e.currentTarget } : e)}
|
||||||
|
onMouseLeave={() => setHover(null)}
|
||||||
|
role="img"
|
||||||
|
aria-label="Verlauf im gewählten Zeitraum im Vergleich zum vorherigen"
|
||||||
|
>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="traffic-area" x1="0" x2="0" y1="0" y2="1">
|
||||||
|
<stop offset="0%" stopColor="#6ba626" stopOpacity="0.28" />
|
||||||
|
<stop offset="100%" stopColor="#6ba626" stopOpacity="0" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
{ticks.map((t) => (
|
||||||
|
<g key={t}>
|
||||||
|
<line x1={pad.left} x2={W - pad.right} y1={y(t)} y2={y(t)} className="stroke-neutral-200 dark:stroke-neutral-800" strokeWidth="1" />
|
||||||
|
<text x={pad.left - 6} y={y(t) + 4} textAnchor="end" className="fill-neutral-400 text-[11px]">
|
||||||
|
{fmtNumber(t)}
|
||||||
|
</text>
|
||||||
|
</g>
|
||||||
|
))}
|
||||||
|
{current.map((d, i) =>
|
||||||
|
(i % labelEvery === 0 && n - 1 - i >= labelEvery / 2) || i === n - 1 ? (
|
||||||
|
<text key={d.date} x={x(i)} y={H - 6} textAnchor={i === 0 ? 'start' : i === n - 1 ? 'end' : 'middle'} className="fill-neutral-400 text-[11px]">
|
||||||
|
{fmtDate(d.date)}
|
||||||
|
</text>
|
||||||
|
) : null,
|
||||||
|
)}
|
||||||
|
<path d={line(previous)} fill="none" className="stroke-neutral-400 dark:stroke-neutral-500" strokeWidth="1.5" strokeDasharray="4 4" />
|
||||||
|
<path d={area} fill="url(#traffic-area)" />
|
||||||
|
<path d={line(current)} fill="none" stroke="#6ba626" strokeWidth="2.25" strokeLinejoin="round" strokeLinecap="round" />
|
||||||
|
{h && (
|
||||||
|
<g>
|
||||||
|
<line x1={x(hover)} x2={x(hover)} y1={pad.top} y2={pad.top + innerH} className="stroke-neutral-300 dark:stroke-neutral-700" />
|
||||||
|
<circle cx={x(hover)} cy={y(h.cur[metric])} r="4" fill="#6ba626" className="stroke-white dark:stroke-neutral-900" strokeWidth="2" />
|
||||||
|
</g>
|
||||||
|
)}
|
||||||
|
</svg>
|
||||||
|
{h && (
|
||||||
|
<div
|
||||||
|
className="pointer-events-none absolute top-0 z-10 rounded-lg border border-neutral-200 bg-white px-3 py-2 text-xs shadow-lg dark:border-neutral-700 dark:bg-neutral-900"
|
||||||
|
style={{ left: `${(x(hover) / W) * 100}%`, transform: `translateX(${hover > n / 2 ? '-105%' : '5%'})` }}
|
||||||
|
>
|
||||||
|
<p className="font-semibold text-neutral-900 dark:text-white">
|
||||||
|
{fmtDate(h.cur.date, true)}: {fmtNumber(h.cur[metric])}
|
||||||
|
</p>
|
||||||
|
{h.prev && (
|
||||||
|
<p className="text-neutral-500 dark:text-neutral-400">
|
||||||
|
{days} Tage davor ({fmtDate(h.prev.date)}): {fmtNumber(h.prev[metric])}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="mt-2 flex flex-wrap gap-4 text-xs text-neutral-500 dark:text-neutral-400">
|
||||||
|
<span className="flex items-center gap-1.5">
|
||||||
|
<span className="h-0.5 w-4 rounded bg-brand-500" /> Gewählter Zeitraum
|
||||||
|
</span>
|
||||||
|
<span className="flex items-center gap-1.5">
|
||||||
|
<span className="w-4 border-t-2 border-dashed border-neutral-400" /> Zeitraum davor
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Liste mit Balken, Anteil und Trend je Zeile (Kanaele, Seiten, Quellen ...). */
|
||||||
|
function BreakdownList({ rows, label = (n) => n, mono = false, showTrend = true, empty = 'Noch keine Daten.' }) {
|
||||||
|
if (!rows?.length) return <p className="text-sm text-neutral-400">{empty}</p>;
|
||||||
|
const total = rows.reduce((s, r) => s + r.current, 0) || 1;
|
||||||
|
const max = Math.max(...rows.map((r) => r.current), 1);
|
||||||
|
return (
|
||||||
|
<ul className="space-y-2.5">
|
||||||
|
{rows.map((r) => (
|
||||||
|
<li key={r.name}>
|
||||||
|
<div className="mb-1 flex items-baseline justify-between gap-3 text-sm">
|
||||||
|
<span className={`min-w-0 truncate text-neutral-700 dark:text-neutral-200 ${mono ? 'font-mono text-xs' : ''}`} title={r.name}>
|
||||||
|
{label(r.name) || '(nicht gesetzt)'}
|
||||||
|
</span>
|
||||||
|
<span className="flex shrink-0 items-center gap-2">
|
||||||
|
{showTrend && <Trend current={r.current} previous={r.previous} />}
|
||||||
|
<span className="w-12 text-right font-semibold tabular-nums text-neutral-900 dark:text-white">{fmtNumber(r.current)}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<div className="h-1.5 flex-1 overflow-hidden rounded-full bg-neutral-100 dark:bg-neutral-800">
|
||||||
|
<div className="h-full rounded-full bg-brand-500/80" style={{ width: `${(r.current / max) * 100}%` }} />
|
||||||
|
</div>
|
||||||
|
<span className="w-10 text-right text-[11px] tabular-nums text-neutral-400">{Math.round((r.current / total) * 100)} %</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// "VW Golf 8 | HifiPlanet" -> "VW Golf 8" (usePageMeta haengt den Seitennamen an).
|
||||||
|
const cleanTitle = (t) => (t || '').replace(/\s*\|\s*HifiPlanet\s*$/i, '').trim() || 'Startseite';
|
||||||
|
|
||||||
|
/** Live-Karte: wer ist gerade da, auf welchen Seiten, Verlauf je Minute. Aktualisiert sich jede Minute selbst. */
|
||||||
|
function Realtime({ initial }) {
|
||||||
|
const [data, setData] = useState(initial);
|
||||||
|
useEffect(() => setData(initial), [initial]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const id = setInterval(() => {
|
||||||
|
if (document.visibilityState !== 'visible') return;
|
||||||
|
api
|
||||||
|
.get('/analytics/realtime')
|
||||||
|
.then((res) => res.realtime && setData(res.realtime))
|
||||||
|
.catch(() => {});
|
||||||
|
}, 60000);
|
||||||
|
return () => clearInterval(id);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (!data) return null;
|
||||||
|
const perMinute = data.per_minute || [];
|
||||||
|
const maxMinute = Math.max(1, ...perMinute);
|
||||||
|
const maxPage = Math.max(1, ...data.pages.map((p) => p.users));
|
||||||
|
const active = data.users > 0;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card className="mb-6" padded={false}>
|
||||||
|
<div className="grid lg:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]">
|
||||||
|
<div className="border-b border-neutral-100 p-5 sm:p-6 lg:border-b-0 lg:border-r dark:border-neutral-800">
|
||||||
|
<div className="flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:text-neutral-400">
|
||||||
|
<span className="relative flex h-2.5 w-2.5">
|
||||||
|
{active && <span className="absolute inline-flex h-full w-full animate-ping rounded-full bg-brand-400 opacity-75" />}
|
||||||
|
<span className={`relative inline-flex h-2.5 w-2.5 rounded-full ${active ? 'bg-brand-500' : 'bg-neutral-300 dark:bg-neutral-600'}`} />
|
||||||
|
</span>
|
||||||
|
Live · letzte 30 Minuten
|
||||||
|
</div>
|
||||||
|
<p className="mt-3 text-4xl font-bold tabular-nums tracking-tight text-neutral-900 dark:text-white">{fmtNumber(data.users)}</p>
|
||||||
|
<p className="text-sm text-neutral-500 dark:text-neutral-400">Besucher auf der Website</p>
|
||||||
|
|
||||||
|
{perMinute.length > 0 && (
|
||||||
|
<div className="mt-5">
|
||||||
|
<div className="flex h-16 items-end gap-[3px]" aria-label="Besucher je Minute">
|
||||||
|
{perMinute.map((v, i) => (
|
||||||
|
<div
|
||||||
|
key={i}
|
||||||
|
className={`flex-1 rounded-sm ${v > 0 ? 'bg-brand-500/80' : 'bg-neutral-100 dark:bg-neutral-800'}`}
|
||||||
|
style={{ height: v > 0 ? `${Math.max(12, (v / maxMinute) * 100)}%` : '4px' }}
|
||||||
|
title={`${i === 29 ? 'Gerade eben' : `Vor ${29 - i} Min.`}: ${v}`}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className="mt-1 flex justify-between text-[11px] text-neutral-400">
|
||||||
|
<span>vor 30 Min.</span>
|
||||||
|
<span>jetzt</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{data.devices?.length > 0 && (
|
||||||
|
<div className="mt-4 flex flex-wrap gap-1.5">
|
||||||
|
{data.devices.map((d) => (
|
||||||
|
<span key={d.name} className="rounded-full bg-neutral-100 px-2.5 py-1 text-xs font-medium text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300">
|
||||||
|
{DEVICE_LABELS[d.name] || d.name}: {d.users}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="p-5 sm:p-6">
|
||||||
|
<p className="mb-3 text-sm font-semibold text-neutral-900 dark:text-white">Gerade angesehene Seiten</p>
|
||||||
|
{data.pages.length === 0 ? (
|
||||||
|
<p className="text-sm text-neutral-400">Im Moment ist niemand auf der Website.</p>
|
||||||
|
) : (
|
||||||
|
<ul className="space-y-2">
|
||||||
|
{data.pages.map((p) => (
|
||||||
|
<li key={p.name} className="relative overflow-hidden rounded-lg bg-neutral-50 dark:bg-neutral-800/50">
|
||||||
|
<div className="absolute inset-y-0 left-0 bg-brand-500/15 dark:bg-brand-500/20" style={{ width: `${(p.users / maxPage) * 100}%` }} />
|
||||||
|
<div className="relative flex items-center justify-between gap-3 px-3 py-2 text-sm">
|
||||||
|
<span className="min-w-0 truncate text-neutral-800 dark:text-neutral-100" title={p.name}>
|
||||||
|
{cleanTitle(p.name)}
|
||||||
|
</span>
|
||||||
|
<span className="shrink-0 font-semibold tabular-nums text-neutral-900 dark:text-white">
|
||||||
|
{p.users} <span className="font-normal text-neutral-400">{p.users === 1 ? 'Person' : 'Personen'}</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
)}
|
||||||
|
{data.fetched_at && (
|
||||||
|
<p className="mt-3 text-[11px] text-neutral-400">
|
||||||
|
Stand {new Date(data.fetched_at).toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' })} Uhr · aktualisiert sich jede Minute
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Traffic() {
|
||||||
|
const [days, setDays] = useState(28);
|
||||||
|
const [metric, setMetric] = useState('users');
|
||||||
|
const [report, setReport] = useState(null);
|
||||||
|
const [error, setError] = useState('');
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const load = (refresh = false) => {
|
||||||
|
setLoading(true);
|
||||||
|
setError('');
|
||||||
|
api
|
||||||
|
.get(`/analytics/traffic?days=${days}${refresh ? '&refresh=1' : ''}`)
|
||||||
|
.then(setReport)
|
||||||
|
.catch((e) => setError(e.message))
|
||||||
|
.finally(() => setLoading(false));
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
load();
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [days]);
|
||||||
|
|
||||||
|
const events = useMemo(
|
||||||
|
() => (report?.events || []).filter((e) => EVENT_LABELS[e.name]).sort((a, b) => Object.keys(EVENT_LABELS).indexOf(a.name) - Object.keys(EVENT_LABELS).indexOf(b.name)),
|
||||||
|
[report],
|
||||||
|
);
|
||||||
|
|
||||||
|
const header = (
|
||||||
|
<PageHeader
|
||||||
|
title="Besucher"
|
||||||
|
description="Zahlen aus Google Analytics. Jede Zahl zeigt den Vergleich zum gleich langen Zeitraum davor."
|
||||||
|
actions={
|
||||||
|
<>
|
||||||
|
<Segmented value={days} onChange={setDays} options={RANGES} size="sm" />
|
||||||
|
<Button variant="secondary" size="sm" icon="refresh" onClick={() => load(true)} disabled={loading}>
|
||||||
|
Aktualisieren
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
if (report && !report.configured) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<PageHeader title="Besucher" />
|
||||||
|
<Card>
|
||||||
|
<EmptyState
|
||||||
|
icon="gauge"
|
||||||
|
title="Google Analytics ist noch nicht verbunden"
|
||||||
|
description="Trage unter System › Google-Dienste die Property-ID und den Service-Account ein, dann erscheinen hier die Besucherzahlen."
|
||||||
|
actions={<Button to="/admin/settings/google">Zu den Google-Diensten</Button>}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{header}
|
||||||
|
{error && (
|
||||||
|
<Card className="mb-6">
|
||||||
|
<p className="text-sm text-red-600">{error}</p>
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
{!report && !error && <p className="text-sm text-neutral-400">Lädt…</p>}
|
||||||
|
|
||||||
|
{report && (
|
||||||
|
<div className={loading ? 'opacity-60 transition-opacity' : 'transition-opacity'}>
|
||||||
|
<Realtime initial={report.realtime} />
|
||||||
|
|
||||||
|
<div className="mb-6 grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-3 xl:grid-cols-6">
|
||||||
|
<KpiTile label="Besucher" hint="Aktive Nutzer im Zeitraum" value={report.kpis.activeUsers.current} previous={report.kpis.activeUsers.previous} format={fmtNumber} />
|
||||||
|
<KpiTile label="Neue Besucher" hint="Zum ersten Mal auf der Seite" value={report.kpis.newUsers.current} previous={report.kpis.newUsers.previous} format={fmtNumber} />
|
||||||
|
<KpiTile label="Sitzungen" hint="Besuche (ein Besucher kann mehrmals kommen)" value={report.kpis.sessions.current} previous={report.kpis.sessions.previous} format={fmtNumber} />
|
||||||
|
<KpiTile label="Seitenaufrufe" value={report.kpis.screenPageViews.current} previous={report.kpis.screenPageViews.previous} format={fmtNumber} />
|
||||||
|
<KpiTile label="Ø Besuchsdauer" value={report.kpis.averageSessionDuration.current} previous={report.kpis.averageSessionDuration.previous} format={fmtDuration} />
|
||||||
|
<KpiTile label="Interessierte Besuche" hint="Anteil der Sitzungen über 10 Sekunden, mit 2+ Seiten oder einer Aktion (GA: Engagement-Rate)" value={report.kpis.engagementRate.current} previous={report.kpis.engagementRate.previous} format={fmtPercent} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Card title="Verlauf" actions={<Segmented value={metric} onChange={setMetric} options={CHART_METRICS} size="sm" />} className="mb-6">
|
||||||
|
<TrendChart current={report.daily.current} previous={report.daily.previous} metric={metric} days={report.days} />
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<div className="grid gap-6 lg:grid-cols-2">
|
||||||
|
<Card title="Woher die Besucher kommen" description="Sitzungen nach Kanal">
|
||||||
|
<BreakdownList rows={report.channels} label={(n) => CHANNEL_LABELS[n] || n} />
|
||||||
|
</Card>
|
||||||
|
<Card title="Quellen" description="Sitzungen nach Website bzw. Suchmaschine">
|
||||||
|
<BreakdownList rows={report.sources} label={(n) => (n === '(direct)' ? 'direkt' : n)} />
|
||||||
|
</Card>
|
||||||
|
<Card title="Meistbesuchte Seiten" description="Seitenaufrufe">
|
||||||
|
<BreakdownList rows={report.pages} mono />
|
||||||
|
</Card>
|
||||||
|
<Card title="Einstiegsseiten" description="Auf welcher Seite ein Besuch beginnt (Sitzungen)">
|
||||||
|
<BreakdownList rows={report.landing_pages} mono showTrend={false} />
|
||||||
|
</Card>
|
||||||
|
<Card title="Was Besucher tun" description="Anzahl im Zeitraum – die wichtigsten Aktionen auf der Website">
|
||||||
|
<BreakdownList rows={events} label={(n) => EVENT_LABELS[n]} empty="Noch keine Aktionen erfasst." />
|
||||||
|
</Card>
|
||||||
|
<div className="grid gap-6">
|
||||||
|
<Card title="Geräte" description="Besucher">
|
||||||
|
<BreakdownList rows={report.devices} label={(n) => DEVICE_LABELS[n] || n} />
|
||||||
|
</Card>
|
||||||
|
<Card title="Orte" description="Besucher nach Stadt (ungefähr, aus der IP-Adresse)">
|
||||||
|
<BreakdownList rows={report.cities} showTrend={false} label={(n) => (n === '(not set)' ? 'unbekannt' : n)} />
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className="mt-6 text-xs text-neutral-400">
|
||||||
|
Gezählt werden nur Besucher, die im Cookie-Banner der Statistik zugestimmt haben. Stand{' '}
|
||||||
|
{new Date(report.generated_at).toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' })} Uhr, wird bis zu 5 Minuten
|
||||||
|
zwischengespeichert. Noch mehr Auswertungen gibt es direkt in{' '}
|
||||||
|
<a href="https://analytics.google.com/" target="_blank" rel="noreferrer" className="text-brand-600 hover:underline dark:text-brand-400">
|
||||||
|
Google Analytics
|
||||||
|
</a>
|
||||||
|
.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -301,6 +301,8 @@ $router->post('/settings/google-reviews', $perm('system.admin', fn($p) => Google
|
||||||
$router->post('/settings/google-reviews/refresh', $perm('system.admin', fn($p) => GoogleReviewsController::refresh()));
|
$router->post('/settings/google-reviews/refresh', $perm('system.admin', fn($p) => GoogleReviewsController::refresh()));
|
||||||
$router->post('/settings/connection-test', $perm('system.admin', fn($p) => ConnectionTestController::test()));
|
$router->post('/settings/connection-test', $perm('system.admin', fn($p) => ConnectionTestController::test()));
|
||||||
$router->get('/analytics/report', $admin(fn($p) => AnalyticsController::report()));
|
$router->get('/analytics/report', $admin(fn($p) => AnalyticsController::report()));
|
||||||
|
$router->get('/analytics/traffic', $perm('system.admin', fn($p) => AnalyticsController::traffic()));
|
||||||
|
$router->get('/analytics/realtime', $perm('system.admin', fn($p) => AnalyticsController::realtime()));
|
||||||
|
|
||||||
$router->get('/maintenance', fn($p) => MaintenanceController::status());
|
$router->get('/maintenance', fn($p) => MaintenanceController::status());
|
||||||
$router->post('/maintenance', $perm('settings.manage', fn($p) => MaintenanceController::update()));
|
$router->post('/maintenance', $perm('settings.manage', fn($p) => MaintenanceController::update()));
|
||||||
|
|
|
||||||
|
|
@ -49,16 +49,20 @@ class AnalyticsController
|
||||||
self::show();
|
self::show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function report(): void
|
private static function propertyId(): ?string
|
||||||
{
|
{
|
||||||
$propertyId = null;
|
|
||||||
try {
|
try {
|
||||||
$stmt = Database::connection()->query('SELECT ga_property_id FROM app_settings WHERE id = 1');
|
$stmt = Database::connection()->query('SELECT ga_property_id FROM app_settings WHERE id = 1');
|
||||||
$row = $stmt->fetch();
|
$row = $stmt->fetch();
|
||||||
$propertyId = ($row['ga_property_id'] ?? '') !== '' ? $row['ga_property_id'] : null;
|
return ($row['ga_property_id'] ?? '') !== '' ? $row['ga_property_id'] : null;
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
// Spalte fehlt noch (vor Schema-Migration).
|
return null; // Spalte fehlt noch (vor Schema-Migration).
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function report(): void
|
||||||
|
{
|
||||||
|
$propertyId = self::propertyId();
|
||||||
|
|
||||||
if (!$propertyId || !GoogleAnalyticsReporting::hasCredentials()) {
|
if (!$propertyId || !GoogleAnalyticsReporting::hasCredentials()) {
|
||||||
Http::send(['configured' => false]);
|
Http::send(['configured' => false]);
|
||||||
|
|
@ -72,4 +76,43 @@ class AnalyticsController
|
||||||
|
|
||||||
Http::send(['configured' => true] + $report);
|
Http::send(['configured' => true] + $report);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Ausfuehrlicher Bericht fuer die Seite "Besucher" (?days=7|28|90, ?refresh=1 umgeht den Zwischenspeicher). */
|
||||||
|
public static function traffic(): void
|
||||||
|
{
|
||||||
|
$propertyId = self::propertyId();
|
||||||
|
if (!$propertyId || !GoogleAnalyticsReporting::hasCredentials()) {
|
||||||
|
Http::send(['configured' => false]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$days = (int) ($_GET['days'] ?? 28);
|
||||||
|
if (!in_array($days, [7, 28, 90, 365], true)) {
|
||||||
|
$days = 28;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$report = GoogleAnalyticsReporting::fetchTrafficReport($propertyId, $days, ($_GET['refresh'] ?? '') === '1');
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
Http::error($e->getMessage(), 502);
|
||||||
|
}
|
||||||
|
|
||||||
|
Http::send(['configured' => true] + $report);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Nur die Live-Besucher (letzte 30 Minuten), ohne Zwischenspeicher. */
|
||||||
|
public static function realtime(): void
|
||||||
|
{
|
||||||
|
$propertyId = self::propertyId();
|
||||||
|
if (!$propertyId || !GoogleAnalyticsReporting::hasCredentials()) {
|
||||||
|
Http::send(['configured' => false]);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$realtime = GoogleAnalyticsReporting::fetchRealtimeReport($propertyId);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
Http::error($e->getMessage(), 502);
|
||||||
|
}
|
||||||
|
|
||||||
|
Http::send(['configured' => true, 'realtime' => $realtime]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -188,4 +188,211 @@ class GoogleAnalyticsReporting
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function batchRunReports(string $propertyId, string $token, array $requests): array
|
||||||
|
{
|
||||||
|
$response = self::post(
|
||||||
|
self::API_BASE . '/properties/' . $propertyId . ':batchRunReports',
|
||||||
|
json_encode(['requests' => $requests]),
|
||||||
|
['Authorization: Bearer ' . $token, 'Content-Type: application/json']
|
||||||
|
);
|
||||||
|
|
||||||
|
if (isset($response['error'])) {
|
||||||
|
throw new \RuntimeException('Google Analytics Data API: ' . ($response['error']['message'] ?? 'unbekannter Fehler'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $response['reports'] ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ausfuehrlicher Bericht fuer die Seite "Besucher" im Admin: Kennzahlen mit Vergleich zum
|
||||||
|
* vorherigen Zeitraum gleicher Laenge, Tagesverlauf beider Zeitraeume, Seiten, Kanaele,
|
||||||
|
* Quellen, Geraete, Orte, Interaktionen (eigene Events) und die Echtzeit-Besucher.
|
||||||
|
* Das Ergebnis (ohne Echtzeit) wird 5 Minuten zwischengespeichert, damit Umschalten und
|
||||||
|
* Neuladen nicht jedes Mal acht Abfragen an Google schicken.
|
||||||
|
*/
|
||||||
|
public static function fetchTrafficReport(string $propertyId, int $days, bool $refresh = false): array
|
||||||
|
{
|
||||||
|
$credentials = self::credentials();
|
||||||
|
$token = self::fetchAccessToken($credentials);
|
||||||
|
|
||||||
|
$cacheFile = sys_get_temp_dir() . '/hifi-ga-' . md5($propertyId . '|' . $days) . '.json';
|
||||||
|
$report = null;
|
||||||
|
if (!$refresh && is_file($cacheFile) && filemtime($cacheFile) > time() - 300) {
|
||||||
|
$report = json_decode((string) file_get_contents($cacheFile), true);
|
||||||
|
}
|
||||||
|
if (!is_array($report)) {
|
||||||
|
$report = self::buildTrafficReport($propertyId, $token, $days);
|
||||||
|
@file_put_contents($cacheFile, json_encode($report));
|
||||||
|
}
|
||||||
|
|
||||||
|
$report['realtime'] = self::fetchRealtime($propertyId, $token);
|
||||||
|
return $report;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function buildTrafficReport(string $propertyId, string $token, int $days): array
|
||||||
|
{
|
||||||
|
// Aktueller Zeitraum = die letzten $days Tage inkl. heute, Vergleich = die $days Tage davor.
|
||||||
|
$current = ['startDate' => ($days - 1) . 'daysAgo', 'endDate' => 'today', 'name' => 'current'];
|
||||||
|
$previous = ['startDate' => (2 * $days - 1) . 'daysAgo', 'endDate' => $days . 'daysAgo', 'name' => 'previous'];
|
||||||
|
$both = [$current, $previous];
|
||||||
|
|
||||||
|
$kpiMetrics = ['activeUsers', 'newUsers', 'sessions', 'screenPageViews', 'averageSessionDuration', 'engagementRate'];
|
||||||
|
|
||||||
|
$first = self::batchRunReports($propertyId, $token, [
|
||||||
|
['dateRanges' => $both, 'metrics' => array_map(fn($m) => ['name' => $m], $kpiMetrics)],
|
||||||
|
[
|
||||||
|
'dateRanges' => [['startDate' => (2 * $days - 1) . 'daysAgo', 'endDate' => 'today']],
|
||||||
|
'dimensions' => [['name' => 'date']],
|
||||||
|
'metrics' => [['name' => 'activeUsers'], ['name' => 'sessions'], ['name' => 'screenPageViews']],
|
||||||
|
'orderBys' => [['dimension' => ['dimensionName' => 'date']]],
|
||||||
|
],
|
||||||
|
self::breakdownRequest($both, 'pagePath', 'screenPageViews', 100),
|
||||||
|
self::breakdownRequest($both, 'sessionDefaultChannelGroup', 'sessions', 40),
|
||||||
|
self::breakdownRequest($both, 'deviceCategory', 'activeUsers', 20),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$second = self::batchRunReports($propertyId, $token, [
|
||||||
|
self::breakdownRequest($both, 'sessionSource', 'sessions', 60),
|
||||||
|
self::breakdownRequest([$current], 'city', 'activeUsers', 10),
|
||||||
|
self::breakdownRequest($both, 'eventName', 'eventCount', 60),
|
||||||
|
self::breakdownRequest([$current], 'landingPage', 'sessions', 10),
|
||||||
|
]);
|
||||||
|
|
||||||
|
// KPIs: Zeilen tragen bei zwei Zeitraeumen deren Namen als letzte Dimension.
|
||||||
|
$kpis = [];
|
||||||
|
foreach ($kpiMetrics as $metric) {
|
||||||
|
$kpis[$metric] = ['current' => 0, 'previous' => 0];
|
||||||
|
}
|
||||||
|
foreach ($first[0]['rows'] ?? [] as $row) {
|
||||||
|
$range = end($row['dimensionValues'])['value'] ?? 'current';
|
||||||
|
foreach ($kpiMetrics as $i => $metric) {
|
||||||
|
$kpis[$metric][$range] = (float) ($row['metricValues'][$i]['value'] ?? 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tagesverlauf: fehlende Tage (ohne Besucher liefert GA keine Zeile) mit 0 auffuellen.
|
||||||
|
$byDate = [];
|
||||||
|
foreach ($first[1]['rows'] ?? [] as $row) {
|
||||||
|
$byDate[$row['dimensionValues'][0]['value']] = [
|
||||||
|
'users' => (int) $row['metricValues'][0]['value'],
|
||||||
|
'sessions' => (int) $row['metricValues'][1]['value'],
|
||||||
|
'pageviews' => (int) $row['metricValues'][2]['value'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$series = ['current' => [], 'previous' => []];
|
||||||
|
$today = new \DateTimeImmutable('today');
|
||||||
|
for ($i = 2 * $days - 1; $i >= 0; $i--) {
|
||||||
|
$date = $today->modify("-{$i} days")->format('Ymd');
|
||||||
|
$point = ['date' => $date] + ($byDate[$date] ?? ['users' => 0, 'sessions' => 0, 'pageviews' => 0]);
|
||||||
|
$series[$i >= $days ? 'previous' : 'current'][] = $point;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'days' => $days,
|
||||||
|
'kpis' => $kpis,
|
||||||
|
'daily' => $series,
|
||||||
|
'pages' => self::breakdownRows($first[2], 15),
|
||||||
|
'channels' => self::breakdownRows($first[3], 10),
|
||||||
|
'devices' => self::breakdownRows($first[4], 5),
|
||||||
|
'sources' => self::breakdownRows($second[0], 10),
|
||||||
|
'cities' => self::breakdownRows($second[1], 10),
|
||||||
|
'events' => self::breakdownRows($second[2], 30),
|
||||||
|
'landing_pages' => self::breakdownRows($second[3], 10),
|
||||||
|
'generated_at' => date('c'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function breakdownRequest(array $ranges, string $dimension, string $metric, int $limit): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'dateRanges' => $ranges,
|
||||||
|
'dimensions' => [['name' => $dimension]],
|
||||||
|
'metrics' => [['name' => $metric]],
|
||||||
|
'orderBys' => [['metric' => ['metricName' => $metric], 'desc' => true]],
|
||||||
|
'limit' => $limit,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Fasst die Zeilen einer Aufschluesselung zu [name, current, previous] zusammen, sortiert nach aktuell. */
|
||||||
|
private static function breakdownRows(array $report, int $limit): array
|
||||||
|
{
|
||||||
|
$rows = [];
|
||||||
|
foreach ($report['rows'] ?? [] as $row) {
|
||||||
|
$name = $row['dimensionValues'][0]['value'] ?? '';
|
||||||
|
$range = count($row['dimensionValues']) > 1 ? end($row['dimensionValues'])['value'] : 'current';
|
||||||
|
$rows[$name] ??= ['name' => $name, 'current' => 0, 'previous' => 0];
|
||||||
|
$rows[$name][$range] = (int) ($row['metricValues'][0]['value'] ?? 0);
|
||||||
|
}
|
||||||
|
$rows = array_values(array_filter($rows, fn($r) => $r['current'] > 0));
|
||||||
|
usort($rows, fn($a, $b) => $b['current'] <=> $a['current']);
|
||||||
|
return array_slice($rows, 0, $limit);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Besucher der letzten 30 Minuten (Echtzeit-API): Gesamtzahl, auf welchen Seiten sie sind
|
||||||
|
* (Seitentitel - die Echtzeit-API kennt keinen Seitenpfad), Verlauf je Minute und Geraete.
|
||||||
|
* Faellt die Echtzeit-Abfrage aus, kommt null - der restliche Bericht bleibt nutzbar.
|
||||||
|
*/
|
||||||
|
private static function fetchRealtime(string $propertyId, string $token): ?array
|
||||||
|
{
|
||||||
|
$run = function (array $body) use ($propertyId, $token): array {
|
||||||
|
$response = self::post(
|
||||||
|
self::API_BASE . '/properties/' . $propertyId . ':runRealtimeReport',
|
||||||
|
json_encode($body),
|
||||||
|
['Authorization: Bearer ' . $token, 'Content-Type: application/json']
|
||||||
|
);
|
||||||
|
if (isset($response['error'])) {
|
||||||
|
throw new \RuntimeException($response['error']['message'] ?? 'Echtzeit-Fehler');
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
|
};
|
||||||
|
$rows = fn(array $response) => array_map(fn($row) => [
|
||||||
|
'name' => $row['dimensionValues'][0]['value'],
|
||||||
|
'users' => (int) $row['metricValues'][0]['value'],
|
||||||
|
], $response['rows'] ?? []);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$pages = $run([
|
||||||
|
'dimensions' => [['name' => 'unifiedScreenName']],
|
||||||
|
'metrics' => [['name' => 'activeUsers']],
|
||||||
|
'orderBys' => [['metric' => ['metricName' => 'activeUsers'], 'desc' => true]],
|
||||||
|
'limit' => 10,
|
||||||
|
'metricAggregations' => ['TOTAL'],
|
||||||
|
]);
|
||||||
|
$minutes = $run([
|
||||||
|
'dimensions' => [['name' => 'minutesAgo']],
|
||||||
|
'metrics' => [['name' => 'activeUsers']],
|
||||||
|
]);
|
||||||
|
$devices = $run([
|
||||||
|
'dimensions' => [['name' => 'deviceCategory']],
|
||||||
|
'metrics' => [['name' => 'activeUsers']],
|
||||||
|
]);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// minutesAgo kommt nur fuer Minuten mit Besuchern - auf 30 Werte (vor 29 Min. .. jetzt) auffuellen.
|
||||||
|
$perMinute = array_fill(0, 30, 0);
|
||||||
|
foreach ($rows($minutes) as $row) {
|
||||||
|
$ago = (int) $row['name'];
|
||||||
|
if ($ago >= 0 && $ago < 30) {
|
||||||
|
$perMinute[29 - $ago] = $row['users'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'users' => (int) ($pages['totals'][0]['metricValues'][0]['value'] ?? 0),
|
||||||
|
'pages' => $rows($pages),
|
||||||
|
'per_minute' => $perMinute,
|
||||||
|
'devices' => $rows($devices),
|
||||||
|
'fetched_at' => date('c'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Nur die Echtzeit-Werte - fuer das automatische Aktualisieren der Live-Karte jede Minute. */
|
||||||
|
public static function fetchRealtimeReport(string $propertyId): ?array
|
||||||
|
{
|
||||||
|
return self::fetchRealtime($propertyId, self::fetchAccessToken(self::credentials()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
import{j as e}from"./index-rAH9iOck.js";import{L as i}from"./LegalPageView-Dqr8i9dQ.js";function n(){return e.jsx(i,{slug:"agb",fallbackTitle:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach."})}export{n as default};
|
|
||||||
1
hifi/assets/AGB-CnRoOuUe.js
Normal file
1
hifi/assets/AGB-CnRoOuUe.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
import{j as e}from"./index-DdrBheBF.js";import{L as i}from"./LegalPageView-BPbqmWmZ.js";function n(){return e.jsx(i,{slug:"agb",fallbackTitle:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach."})}export{n as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
hifi/assets/Brands-DCbIzG2i.js
Normal file
1
hifi/assets/Brands-DCbIzG2i.js
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{p as m,k as u,r as s,c as x,j as e,l as h,o as g,L as b}from"./index-rAH9iOck.js";function k(){const[l]=m(),{user:a,refreshUser:i}=u(),[t,r]=s.useState("loading"),[o,d]=s.useState(""),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,x.post("/auth/email/confirm",{token:l.get("token")||""}).then(()=>{r("ok"),i().catch(()=>{})}).catch(c=>{d(c.message),r("error")}))},[]),e.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[e.jsx("img",{src:h,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:g,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),e.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[t==="loading"&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"E-Mail-Adresse wird bestätigt…"}),t==="ok"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"E-Mail-Adresse bestätigt"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Ab jetzt bekommst du beim Login einen Code an diese Adresse, sofern keine Authenticator-App eingerichtet ist."})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigung fehlgeschlagen"}),e.jsx("p",{className:"mb-6 text-sm text-red-600",children:o})]}),t!=="loading"&&e.jsx(b,{to:a?"/admin/account":"/admin/login",className:"block w-full rounded-md bg-brand-500 px-4 py-2.5 text-center text-sm font-semibold text-white hover:bg-brand-600",children:a?"Zu meinem Konto":"Zum Login"})]})]})}export{k as default};
|
import{p as m,k as u,r as s,c as x,j as e,l as h,o as g,L as b}from"./index-DdrBheBF.js";function k(){const[l]=m(),{user:a,refreshUser:i}=u(),[t,r]=s.useState("loading"),[o,d]=s.useState(""),n=s.useRef(!1);return s.useEffect(()=>{n.current||(n.current=!0,x.post("/auth/email/confirm",{token:l.get("token")||""}).then(()=>{r("ok"),i().catch(()=>{})}).catch(c=>{d(c.message),r("error")}))},[]),e.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[e.jsx("img",{src:h,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:g,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),e.jsxs("div",{className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[t==="loading"&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"E-Mail-Adresse wird bestätigt…"}),t==="ok"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"E-Mail-Adresse bestätigt"}),e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Ab jetzt bekommst du beim Login einen Code an diese Adresse, sofern keine Authenticator-App eingerichtet ist."})]}),t==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigung fehlgeschlagen"}),e.jsx("p",{className:"mb-6 text-sm text-red-600",children:o})]}),t!=="loading"&&e.jsx(b,{to:a?"/admin/account":"/admin/login",className:"block w-full rounded-md bg-brand-500 px-4 py-2.5 text-center text-sm font-semibold text-white hover:bg-brand-600",children:a?"Zu meinem Konto":"Zum Login"})]})]})}export{k as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as g,j as e,c as p,L as k}from"./index-rAH9iOck.js";const h=[{title:"Google",tests:[{key:"google_analytics",label:"Google Analytics (Zahlen im Admin)",settings:"/admin/settings/google"},{key:"google_tracking",label:"Google Analytics (Zählen auf der Website)",settings:"/admin/settings/google"},{key:"google_reviews",label:"Google-Bewertungen",settings:"/admin/settings/google"}]},{title:"Weitere Verbindungen",tests:[{key:"mail",label:"Mail-Server",settings:"/admin/settings/email"},{key:"database",label:"Datenbank",settings:"/admin/settings/database"},{key:"update_server",label:"Update-Server",settings:"/admin/settings/update"},{key:"audio4cars",label:"Audio4Cars-Preise",settings:"/admin/packages"}]}],b=h.flatMap(n=>n.tests.map(a=>a.key)),x={ok:{label:"Funktioniert",dot:"bg-green-500",text:"text-green-700 dark:text-green-400"},warning:{label:"Eingeschränkt",dot:"bg-amber-500",text:"text-amber-700 dark:text-amber-400"},error:{label:"Fehler",dot:"bg-red-500",text:"text-red-700 dark:text-red-400"},not_configured:{label:"Nicht eingerichtet",dot:"bg-neutral-400",text:"text-neutral-500 dark:text-neutral-400"}};function N(){const[n,a]=g.useState({}),[r,d]=g.useState({}),l=async t=>{d(s=>({...s,[t]:!0}));try{const s=await p.post("/settings/connection-test",{key:t});a(c=>({...c,[t]:s}))}catch(s){a(c=>({...c,[t]:{status:"error",message:s.message,details:[]}}))}finally{d(s=>({...s,[t]:!1}))}},o=()=>Promise.all(b.map(l)),i=Object.values(r).some(Boolean),m=b.filter(t=>n[t]),u=m.reduce((t,s)=>({...t,[n[s].status]:(t[n[s].status]||0)+1}),{});return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Teste…":"Alle testen"}),m.length>0&&!i&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["ok","warning","error","not_configured"].filter(t=>u[t]).map(t=>`${u[t]} × ${x[t].label.toLowerCase()}`).join(" · ")})]}),h.map(t=>e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"border-b border-neutral-200 px-6 py-3 font-semibold text-neutral-900 dark:border-neutral-800 dark:text-white",children:t.title}),e.jsx("ul",{className:"divide-y divide-neutral-200 dark:divide-neutral-800",children:t.tests.map(s=>e.jsx(j,{test:s,result:n[s.key],running:!!r[s.key],onRun:()=>l(s.key)},s.key))})]},t.title)),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Die Tests ändern nichts und verschicken keine Mails. Der Test der Google-Bewertungen zählt bei Google als ein Abruf."})]})}function j({test:n,result:a,running:r,onRun:d}){var o;const l=a?x[a.status]||x.error:null;return e.jsx("li",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full ${r?"animate-pulse bg-brand-500":l?l.dot:"bg-neutral-200 dark:bg-neutral-700"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:n.label}),r?e.jsx("span",{className:"text-xs text-neutral-500",children:"wird getestet…"}):l&&e.jsxs("span",{className:`text-xs font-semibold ${l.text}`,children:[l.label,a.duration_ms!=null&&e.jsxs("span",{className:"font-normal text-neutral-400",children:[" · ",(a.duration_ms/1e3).toFixed(1)," s"]})]})]}),a&&!r&&e.jsxs("div",{className:"mt-1 space-y-1 text-sm",children:[e.jsx("p",{className:"whitespace-pre-line break-words text-neutral-700 dark:text-neutral-300",children:a.message}),a.hint&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a.hint}),((o=a.details)==null?void 0:o.length)>0&&e.jsx("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs",children:a.details.map(i=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:i.label}),e.jsx("dd",{className:"break-all text-neutral-700 dark:text-neutral-300",children:i.value})]},i.label))})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[a&&a.status!=="ok"&&e.jsx(k,{to:n.settings,className:"text-sm text-neutral-500 underline hover:text-neutral-800 dark:hover:text-neutral-200",children:"Einstellungen"}),e.jsx("button",{type:"button",onClick:d,disabled:r,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Testen"})]})]})})}export{N as default};
|
import{r as g,j as e,c as p,L as k}from"./index-DdrBheBF.js";const h=[{title:"Google",tests:[{key:"google_analytics",label:"Google Analytics (Zahlen im Admin)",settings:"/admin/settings/google"},{key:"google_tracking",label:"Google Analytics (Zählen auf der Website)",settings:"/admin/settings/google"},{key:"google_reviews",label:"Google-Bewertungen",settings:"/admin/settings/google"}]},{title:"Weitere Verbindungen",tests:[{key:"mail",label:"Mail-Server",settings:"/admin/settings/email"},{key:"database",label:"Datenbank",settings:"/admin/settings/database"},{key:"update_server",label:"Update-Server",settings:"/admin/settings/update"},{key:"audio4cars",label:"Audio4Cars-Preise",settings:"/admin/packages"}]}],b=h.flatMap(n=>n.tests.map(a=>a.key)),x={ok:{label:"Funktioniert",dot:"bg-green-500",text:"text-green-700 dark:text-green-400"},warning:{label:"Eingeschränkt",dot:"bg-amber-500",text:"text-amber-700 dark:text-amber-400"},error:{label:"Fehler",dot:"bg-red-500",text:"text-red-700 dark:text-red-400"},not_configured:{label:"Nicht eingerichtet",dot:"bg-neutral-400",text:"text-neutral-500 dark:text-neutral-400"}};function N(){const[n,a]=g.useState({}),[r,d]=g.useState({}),l=async t=>{d(s=>({...s,[t]:!0}));try{const s=await p.post("/settings/connection-test",{key:t});a(c=>({...c,[t]:s}))}catch(s){a(c=>({...c,[t]:{status:"error",message:s.message,details:[]}}))}finally{d(s=>({...s,[t]:!1}))}},o=()=>Promise.all(b.map(l)),i=Object.values(r).some(Boolean),m=b.filter(t=>n[t]),u=m.reduce((t,s)=>({...t,[n[s].status]:(t[n[s].status]||0)+1}),{});return e.jsxs("div",{className:"max-w-3xl space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx("button",{type:"button",onClick:o,disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Teste…":"Alle testen"}),m.length>0&&!i&&e.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["ok","warning","error","not_configured"].filter(t=>u[t]).map(t=>`${u[t]} × ${x[t].label.toLowerCase()}`).join(" · ")})]}),h.map(t=>e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"border-b border-neutral-200 px-6 py-3 font-semibold text-neutral-900 dark:border-neutral-800 dark:text-white",children:t.title}),e.jsx("ul",{className:"divide-y divide-neutral-200 dark:divide-neutral-800",children:t.tests.map(s=>e.jsx(j,{test:s,result:n[s.key],running:!!r[s.key],onRun:()=>l(s.key)},s.key))})]},t.title)),e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Die Tests ändern nichts und verschicken keine Mails. Der Test der Google-Bewertungen zählt bei Google als ein Abruf."})]})}function j({test:n,result:a,running:r,onRun:d}){var o;const l=a?x[a.status]||x.error:null;return e.jsx("li",{className:"px-6 py-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full ${r?"animate-pulse bg-brand-500":l?l.dot:"bg-neutral-200 dark:bg-neutral-700"}`}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:n.label}),r?e.jsx("span",{className:"text-xs text-neutral-500",children:"wird getestet…"}):l&&e.jsxs("span",{className:`text-xs font-semibold ${l.text}`,children:[l.label,a.duration_ms!=null&&e.jsxs("span",{className:"font-normal text-neutral-400",children:[" · ",(a.duration_ms/1e3).toFixed(1)," s"]})]})]}),a&&!r&&e.jsxs("div",{className:"mt-1 space-y-1 text-sm",children:[e.jsx("p",{className:"whitespace-pre-line break-words text-neutral-700 dark:text-neutral-300",children:a.message}),a.hint&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:a.hint}),((o=a.details)==null?void 0:o.length)>0&&e.jsx("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs",children:a.details.map(i=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:i.label}),e.jsx("dd",{className:"break-all text-neutral-700 dark:text-neutral-300",children:i.value})]},i.label))})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[a&&a.status!=="ok"&&e.jsx(k,{to:n.settings,className:"text-sm text-neutral-500 underline hover:text-neutral-800 dark:hover:text-neutral-200",children:"Einstellungen"}),e.jsx("button",{type:"button",onClick:d,disabled:r,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Testen"})]})]})})}export{N as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
hifi/assets/Dashboard-CycCX1ao.js
Normal file
1
hifi/assets/Dashboard-CycCX1ao.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{j as t}from"./index-rAH9iOck.js";import{L as e}from"./LegalPageView-Dqr8i9dQ.js";function n(){return t.jsx(e,{slug:"datenschutz",fallbackTitle:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO."})}export{n as default};
|
import{j as t}from"./index-DdrBheBF.js";import{L as e}from"./LegalPageView-BPbqmWmZ.js";function n(){return t.jsx(e,{slug:"datenschutz",fallbackTitle:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO."})}export{n as default};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{r,u as y,b as v,j as e,e as S,R as D,c as I}from"./index-rAH9iOck.js";import{f as _,a as E,b as F,i as L}from"./downloads-B9pqFegV.js";import{L as C,F as p,a as R,b as T,c as U,M,D as A}from"./music-Dvm6TcAr.js";const K={audio:M,video:U,pdf:p,image:T,archive:R,document:p},n="hifi-downloads-password",z=()=>{try{return localStorage.getItem(n)||""}catch{return""}},f=t=>{try{t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}},g=t=>I.get("/downloads",t?{headers:{"X-Download-Password":encodeURIComponent(t)}}:void 0);function W(){const[t,i]=r.useState(null),[c,x]=r.useState(!1),[o,b]=r.useState(""),[j,m]=r.useState(!1),[u,h]=r.useState(!1),[d,w]=r.useState(null),{t:s,language:k}=y();r.useEffect(()=>{const a=z();g(a).then(l=>{l.locked?(a&&f(""),x(!0)):i(l.items)}).catch(l=>w(l))},[]);const N=async a=>{a.preventDefault(),h(!0),m(!1);try{const l=await g(o);l.locked?m(!0):(f(o),x(!1),i(l.items))}catch(l){w(l.message)}finally{h(!1)}};return v({title:s("downloadsPage.metaTitle"),description:s("downloadsPage.metaDescription"),path:"/downloads"}),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-12 sm:px-6",children:[e.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("downloadsPage.title")}),e.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.intro")}),d&&e.jsx("p",{className:"text-red-600",children:typeof d=="string"?d:S(d,s)}),!d&&!c&&t===null&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.loading")}),(t==null?void 0:t.length)===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.empty")}),c&&e.jsxs("form",{onSubmit:N,className:"max-w-md rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(C,{className:"h-5 w-5 text-brand-500","aria-hidden":"true"}),e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:s("downloadsPage.lockedTitle")})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.lockedText")}),e.jsx("label",{htmlFor:"downloads-password",className:"sr-only",children:s("downloadsPage.passwordLabel")}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{id:"downloads-password",type:"password",required:!0,autoComplete:"off",value:o,onChange:a=>b(a.target.value),placeholder:s("downloadsPage.passwordLabel"),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 dark:border-neutral-700 dark:bg-neutral-950 dark:text-white"}),e.jsx("button",{type:"submit",disabled:u,className:"shrink-0 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s(u?"downloadsPage.unlocking":"downloadsPage.unlock")})]}),j&&e.jsx("p",{className:"mt-2 text-sm text-red-600",role:"alert",children:s("downloadsPage.wrongPassword")})]}),e.jsx("div",{className:"space-y-4",children:t==null?void 0:t.map((a,l)=>{const P=K[_(a.file_name)];return e.jsx(D,{index:l%4,className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-brand-500/10 text-brand-600 dark:text-brand-400",children:e.jsx(P,{className:"h-6 w-6","aria-hidden":"true"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:a.title}),a.description&&e.jsx("p",{className:"mt-1 whitespace-pre-line text-sm text-neutral-600 dark:text-neutral-300",children:a.description}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:[E(a.file_name).toUpperCase()," · ",F(a.file_size,k==="de"?"de-DE":"en-US")]}),L(a.file_name)&&e.jsx("audio",{controls:!0,preload:"none",src:a.file_path,className:"mt-3 w-full"})]}),e.jsxs("a",{href:a.file_path,download:a.file_name,className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:[e.jsx(A,{className:"h-4 w-4","aria-hidden":"true"}),s("downloadsPage.download")]})]})},a.id)})})]})}export{W as default};
|
import{r,u as y,b as v,j as e,e as S,R as D,c as I}from"./index-DdrBheBF.js";import{f as _,a as E,b as F,i as L}from"./downloads-B9pqFegV.js";import{L as C,F as p,a as R,b as T,c as U,M,D as A}from"./music-DbXVbsjj.js";const K={audio:M,video:U,pdf:p,image:T,archive:R,document:p},n="hifi-downloads-password",z=()=>{try{return localStorage.getItem(n)||""}catch{return""}},f=t=>{try{t?localStorage.setItem(n,t):localStorage.removeItem(n)}catch{}},g=t=>I.get("/downloads",t?{headers:{"X-Download-Password":encodeURIComponent(t)}}:void 0);function W(){const[t,i]=r.useState(null),[c,x]=r.useState(!1),[o,b]=r.useState(""),[j,m]=r.useState(!1),[u,h]=r.useState(!1),[d,w]=r.useState(null),{t:s,language:k}=y();r.useEffect(()=>{const a=z();g(a).then(l=>{l.locked?(a&&f(""),x(!0)):i(l.items)}).catch(l=>w(l))},[]);const N=async a=>{a.preventDefault(),h(!0),m(!1);try{const l=await g(o);l.locked?m(!0):(f(o),x(!1),i(l.items))}catch(l){w(l.message)}finally{h(!1)}};return v({title:s("downloadsPage.metaTitle"),description:s("downloadsPage.metaDescription"),path:"/downloads"}),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-12 sm:px-6",children:[e.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("downloadsPage.title")}),e.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.intro")}),d&&e.jsx("p",{className:"text-red-600",children:typeof d=="string"?d:S(d,s)}),!d&&!c&&t===null&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.loading")}),(t==null?void 0:t.length)===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("downloadsPage.empty")}),c&&e.jsxs("form",{onSubmit:N,className:"max-w-md rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(C,{className:"h-5 w-5 text-brand-500","aria-hidden":"true"}),e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:s("downloadsPage.lockedTitle")})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:s("downloadsPage.lockedText")}),e.jsx("label",{htmlFor:"downloads-password",className:"sr-only",children:s("downloadsPage.passwordLabel")}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{id:"downloads-password",type:"password",required:!0,autoComplete:"off",value:o,onChange:a=>b(a.target.value),placeholder:s("downloadsPage.passwordLabel"),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 dark:border-neutral-700 dark:bg-neutral-950 dark:text-white"}),e.jsx("button",{type:"submit",disabled:u,className:"shrink-0 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s(u?"downloadsPage.unlocking":"downloadsPage.unlock")})]}),j&&e.jsx("p",{className:"mt-2 text-sm text-red-600",role:"alert",children:s("downloadsPage.wrongPassword")})]}),e.jsx("div",{className:"space-y-4",children:t==null?void 0:t.map((a,l)=>{const P=K[_(a.file_name)];return e.jsx(D,{index:l%4,className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[e.jsx("div",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-brand-500/10 text-brand-600 dark:text-brand-400",children:e.jsx(P,{className:"h-6 w-6","aria-hidden":"true"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:a.title}),a.description&&e.jsx("p",{className:"mt-1 whitespace-pre-line text-sm text-neutral-600 dark:text-neutral-300",children:a.description}),e.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:[E(a.file_name).toUpperCase()," · ",F(a.file_size,k==="de"?"de-DE":"en-US")]}),L(a.file_name)&&e.jsx("audio",{controls:!0,preload:"none",src:a.file_path,className:"mt-3 w-full"})]}),e.jsxs("a",{href:a.file_path,download:a.file_name,className:"inline-flex shrink-0 items-center justify-center gap-2 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:[e.jsx(A,{className:"h-4 w-4","aria-hidden":"true"}),s("downloadsPage.download")]})]})},a.id)})})]})}export{W as default};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{s as P,r as l,t as U,c as N,j as e,C as _,I as R,v as F,w as O,x as L}from"./index-rAH9iOck.js";import{S as Q,s as z}from"./SortableList-CtBDmUHV.js";function X({endpoint:a,listEndpoint:g,reorderKey:m,emptyForm:o,toForm:k,toPayload:b=c=>c,save:w,labels:d,source:y}){const c=P(),[i,u]=l.useState(null),[n,j]=l.useState(null),[s,x]=l.useState(o),[h,E]=l.useState(o),[D,S]=l.useState(!1),[M,I]=l.useState(!1),[q,v]=l.useState(""),C=D||JSON.stringify(s)!==JSON.stringify(h);U(n!==null&&C,y);const f=l.useCallback(()=>N.get(g||a).then(u).catch(t=>{u(r=>r||[]),c.error(t.message)}),[a,g]);l.useEffect(()=>{f()},[f]);const B=t=>{const r=t?k(t):o;j(t?t.id:"new"),x(r),E(r),S(!1),v("")},$=()=>{j(null),S(!1)};return{items:i,setItems:u,load:f,editing:n,isNew:n==="new",form:s,setForm:x,change:t=>x(r=>({...r,...t})),setExtraDirty:S,dirty:C,saving:M,error:q,setError:v,openPanel:B,closePanel:()=>{C&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||$()},submit:async t=>{t==null||t.preventDefault(),v(""),I(!0);try{if(w)await w({editing:n,form:s,items:i||[]});else if(n!=="new")await N.put(`${a}/${n}`,b(s));else{const r=(i||[]).reduce((p,J)=>Math.max(p,Number(J.sort_order)||0),0)+10;await N.post(a,{...b(s),sort_order:r})}c.success(n==="new"?d.created:d.saved),E(s),$(),f()}catch(r){v(r.message)}finally{I(!1)}},remove:async(t,r)=>{if(window.confirm(r))try{await N.delete(`${a}/${t.id}`),n===t.id&&$(),c.success(d.deleted),f()}catch(p){c.error(`Löschen fehlgeschlagen: ${p.message}`)}},reorder:async t=>{const r=i;u(t);try{u(await z(m,t)),c.success("Reihenfolge gespeichert.")}catch(p){u(r),c.error(`Reihenfolge konnte nicht gespeichert werden: ${p.message}`)}}}}function Y({items:a,onReorder:g,onOpen:m,onDelete:o,renderRow:k,empty:b,searchFrom:w=10,searchText:d,searchPlaceholder:y="Suchen …",editingId:c}){const[i,u]=l.useState(""),n=l.useMemo(()=>{const s=i.trim().toLowerCase();return!s||!a?a||[]:a.filter(x=>(d?d(x):"").toLowerCase().includes(s))},[a,i,d]),j=i.trim()!=="";return e.jsxs(_,{padded:!1,className:"overflow-hidden",children:[a&&a.length>=w&&d&&e.jsx("div",{className:"border-b border-neutral-200 p-3 dark:border-neutral-800",children:e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(R,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),e.jsx(F,{value:i,onChange:s=>u(s.target.value),placeholder:y,className:"h-9 pl-9"})]})}),a===null?e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[0,1,2].map(s=>e.jsxs("li",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsx("span",{className:"h-11 w-11 animate-pulse rounded-lg bg-neutral-100 dark:bg-neutral-800"}),e.jsx("span",{className:"h-4 w-48 animate-pulse rounded bg-neutral-100 dark:bg-neutral-800"})]},s))}):a.length===0?e.jsx(O,{...b}):n.length===0?e.jsxs("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Nichts gefunden für „",i,"“."]}):e.jsx(Q,{items:n,onReorder:g,disabled:j,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(s,x)=>{const h=k(s);return e.jsxs("div",{className:`flex items-center gap-3 bg-white px-3 py-2.5 transition hover:bg-neutral-50 dark:bg-neutral-900 dark:hover:bg-neutral-800/50 sm:gap-4 sm:px-4 ${c===s.id?"bg-brand-50/60 dark:bg-brand-900/20":""}`,children:[e.jsx("span",{className:"w-6 shrink-0",children:x}),e.jsxs("button",{type:"button",onClick:()=>m(s),className:`flex min-w-0 flex-1 items-center gap-4 text-left ${h.muted?"opacity-60":""}`,children:[h.media,e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:h.title}),h.subtitle&&e.jsx("span",{className:"block truncate text-xs text-neutral-500 dark:text-neutral-400",children:h.subtitle})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[h.actions,e.jsx(L,{icon:"pencil",label:"Bearbeiten",onClick:()=>m(s)}),e.jsx(L,{icon:"trash",label:"Löschen",tone:"danger",onClick:()=>o(s)})]})]})}})]})}function Z({src:a,icon:g="image",contain:m=!1,className:o=""}){return a?e.jsx("img",{src:a,alt:"",className:`h-11 w-11 shrink-0 rounded-lg border border-neutral-200 bg-white dark:border-neutral-700 ${m?"object-contain p-1":"object-cover"} ${o}`}):e.jsx("span",{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-400 dark:bg-neutral-800 ${o}`,children:e.jsx(R,{name:g,className:"h-5 w-5"})})}export{Y as E,Z as R,X as u};
|
import{v as P,r as l,w as U,c as N,j as e,C as _,I as R,x as F,s as O,y as L}from"./index-DdrBheBF.js";import{S as Q,s as z}from"./SortableList-DLYTOV3V.js";function X({endpoint:a,listEndpoint:g,reorderKey:m,emptyForm:o,toForm:k,toPayload:b=c=>c,save:w,labels:d,source:y}){const c=P(),[i,u]=l.useState(null),[n,j]=l.useState(null),[s,x]=l.useState(o),[h,E]=l.useState(o),[D,S]=l.useState(!1),[M,I]=l.useState(!1),[q,v]=l.useState(""),C=D||JSON.stringify(s)!==JSON.stringify(h);U(n!==null&&C,y);const f=l.useCallback(()=>N.get(g||a).then(u).catch(t=>{u(r=>r||[]),c.error(t.message)}),[a,g]);l.useEffect(()=>{f()},[f]);const B=t=>{const r=t?k(t):o;j(t?t.id:"new"),x(r),E(r),S(!1),v("")},$=()=>{j(null),S(!1)};return{items:i,setItems:u,load:f,editing:n,isNew:n==="new",form:s,setForm:x,change:t=>x(r=>({...r,...t})),setExtraDirty:S,dirty:C,saving:M,error:q,setError:v,openPanel:B,closePanel:()=>{C&&!window.confirm("Ungespeicherte Änderungen verwerfen?")||$()},submit:async t=>{t==null||t.preventDefault(),v(""),I(!0);try{if(w)await w({editing:n,form:s,items:i||[]});else if(n!=="new")await N.put(`${a}/${n}`,b(s));else{const r=(i||[]).reduce((p,J)=>Math.max(p,Number(J.sort_order)||0),0)+10;await N.post(a,{...b(s),sort_order:r})}c.success(n==="new"?d.created:d.saved),E(s),$(),f()}catch(r){v(r.message)}finally{I(!1)}},remove:async(t,r)=>{if(window.confirm(r))try{await N.delete(`${a}/${t.id}`),n===t.id&&$(),c.success(d.deleted),f()}catch(p){c.error(`Löschen fehlgeschlagen: ${p.message}`)}},reorder:async t=>{const r=i;u(t);try{u(await z(m,t)),c.success("Reihenfolge gespeichert.")}catch(p){u(r),c.error(`Reihenfolge konnte nicht gespeichert werden: ${p.message}`)}}}}function Y({items:a,onReorder:g,onOpen:m,onDelete:o,renderRow:k,empty:b,searchFrom:w=10,searchText:d,searchPlaceholder:y="Suchen …",editingId:c}){const[i,u]=l.useState(""),n=l.useMemo(()=>{const s=i.trim().toLowerCase();return!s||!a?a||[]:a.filter(x=>(d?d(x):"").toLowerCase().includes(s))},[a,i,d]),j=i.trim()!=="";return e.jsxs(_,{padded:!1,className:"overflow-hidden",children:[a&&a.length>=w&&d&&e.jsx("div",{className:"border-b border-neutral-200 p-3 dark:border-neutral-800",children:e.jsxs("div",{className:"relative max-w-xs",children:[e.jsx(R,{name:"search",className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-neutral-400"}),e.jsx(F,{value:i,onChange:s=>u(s.target.value),placeholder:y,className:"h-9 pl-9"})]})}),a===null?e.jsx("ul",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[0,1,2].map(s=>e.jsxs("li",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsx("span",{className:"h-11 w-11 animate-pulse rounded-lg bg-neutral-100 dark:bg-neutral-800"}),e.jsx("span",{className:"h-4 w-48 animate-pulse rounded bg-neutral-100 dark:bg-neutral-800"})]},s))}):a.length===0?e.jsx(O,{...b}):n.length===0?e.jsxs("p",{className:"px-4 py-10 text-center text-sm text-neutral-500 dark:text-neutral-400",children:["Nichts gefunden für „",i,"“."]}):e.jsx(Q,{items:n,onReorder:g,disabled:j,className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:(s,x)=>{const h=k(s);return e.jsxs("div",{className:`flex items-center gap-3 bg-white px-3 py-2.5 transition hover:bg-neutral-50 dark:bg-neutral-900 dark:hover:bg-neutral-800/50 sm:gap-4 sm:px-4 ${c===s.id?"bg-brand-50/60 dark:bg-brand-900/20":""}`,children:[e.jsx("span",{className:"w-6 shrink-0",children:x}),e.jsxs("button",{type:"button",onClick:()=>m(s),className:`flex min-w-0 flex-1 items-center gap-4 text-left ${h.muted?"opacity-60":""}`,children:[h.media,e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-semibold text-neutral-900 dark:text-white",children:h.title}),h.subtitle&&e.jsx("span",{className:"block truncate text-xs text-neutral-500 dark:text-neutral-400",children:h.subtitle})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[h.actions,e.jsx(L,{icon:"pencil",label:"Bearbeiten",onClick:()=>m(s)}),e.jsx(L,{icon:"trash",label:"Löschen",tone:"danger",onClick:()=>o(s)})]})]})}})]})}function Z({src:a,icon:g="image",contain:m=!1,className:o=""}){return a?e.jsx("img",{src:a,alt:"",className:`h-11 w-11 shrink-0 rounded-lg border border-neutral-200 bg-white dark:border-neutral-700 ${m?"object-contain p-1":"object-cover"} ${o}`}):e.jsx("span",{className:`flex h-11 w-11 shrink-0 items-center justify-center rounded-lg bg-neutral-100 text-neutral-400 dark:bg-neutral-800 ${o}`,children:e.jsx(R,{name:g,className:"h-5 w-5"})})}export{Y as E,Z as R,X as u};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{j as e,P as d,B as t,y as c,F as i,v as o,W as l,U as u}from"./index-rAH9iOck.js";import{u as h,E as g,R as p}from"./EntityList-DCHE8ATz.js";import"./SortableList-CtBDmUHV.js";import"./sortable.esm-BXUVU49N.js";import"./grip-vertical-BikCVAyl.js";const x={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function b(){const n=h({endpoint:"/faqs",reorderKey:"faqs",source:"faqs",emptyForm:x,toForm:r=>({question_de:r.question_de,answer_de:r.answer_de,question_en:r.question_en,answer_en:r.answer_en,sort_order:r.sort_order}),toPayload:r=>({...r,sort_order:Number(r.sort_order)}),labels:{created:"Frage angelegt.",saved:"Frage gespeichert.",deleted:"Frage gelöscht."}}),{form:s,change:a}=n;return e.jsxs("div",{children:[e.jsx(d,{title:"Häufige Fragen",description:"Erscheinen im FAQ-Bereich der Startseite, jeweils in der gewählten Sprache. Reihenfolge am Griff links ziehen.",actions:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"secondary",icon:"eye",href:"/#faq",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),e.jsx(t,{icon:"plus",onClick:()=>n.openPanel(null),children:"Neue Frage"})]})}),e.jsx(g,{items:n.items,editingId:n.editing,onReorder:n.reorder,onOpen:n.openPanel,onDelete:r=>n.remove(r,`Frage „${r.question_de}“ wirklich löschen?`),searchText:r=>`${r.question_de} ${r.answer_de}`,searchPlaceholder:"Frage suchen …",empty:{icon:"help",title:"Noch keine Fragen",description:"Typische Kundenfragen sparen dir Telefonate.",actions:e.jsx(t,{icon:"plus",onClick:()=>n.openPanel(null),children:"Neue Frage"})},renderRow:r=>({media:e.jsx(p,{icon:"help"}),title:r.question_de,subtitle:r.answer_de})}),e.jsxs(c,{as:"form",onSubmit:n.submit,open:n.editing!==null,onClose:n.closePanel,size:"lg",title:n.isNew?"Neue Frage":"Frage bearbeiten",footer:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"secondary",onClick:n.closePanel,children:"Abbrechen"}),e.jsx(t,{type:"submit",disabled:n.saving||!n.isNew&&!n.dirty,children:n.saving?"Speichere…":n.isNew?"Anlegen":"Speichern"})]}),children:[n.error&&e.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:n.error}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h3",{className:"flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Deutsch"}),e.jsx(i,{label:"Frage",required:!0,children:e.jsx(o,{required:!0,autoFocus:!0,value:s.question_de,onChange:r=>a({question_de:r.target.value}),placeholder:"z. B. Wie lange dauert ein Einbau?"})}),e.jsx(i,{label:"Antwort",required:!0,children:e.jsx(l,{required:!0,rows:4,value:s.answer_de,onChange:r=>a({answer_de:r.target.value})})})]}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:["Englisch ",(!s.question_en||!s.answer_en)&&e.jsx(u,{tone:"amber",children:"fehlt noch"})]}),e.jsx(i,{label:"Frage",required:!0,children:e.jsx(o,{required:!0,value:s.question_en,onChange:r=>a({question_en:r.target.value}),placeholder:"e.g. How long does an installation take?"})}),e.jsx(i,{label:"Antwort",required:!0,children:e.jsx(l,{required:!0,rows:4,value:s.answer_en,onChange:r=>a({answer_en:r.target.value})})})]})]})]})}export{b as default};
|
import{j as e,P as d,B as t,z as c,F as i,x as o,W as l,U as u}from"./index-DdrBheBF.js";import{u as h,E as g,R as p}from"./EntityList-CZMR7cO6.js";import"./SortableList-DLYTOV3V.js";import"./sortable.esm-Bkx6x4tL.js";import"./grip-vertical-DsuA4IDe.js";const x={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function b(){const n=h({endpoint:"/faqs",reorderKey:"faqs",source:"faqs",emptyForm:x,toForm:r=>({question_de:r.question_de,answer_de:r.answer_de,question_en:r.question_en,answer_en:r.answer_en,sort_order:r.sort_order}),toPayload:r=>({...r,sort_order:Number(r.sort_order)}),labels:{created:"Frage angelegt.",saved:"Frage gespeichert.",deleted:"Frage gelöscht."}}),{form:s,change:a}=n;return e.jsxs("div",{children:[e.jsx(d,{title:"Häufige Fragen",description:"Erscheinen im FAQ-Bereich der Startseite, jeweils in der gewählten Sprache. Reihenfolge am Griff links ziehen.",actions:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"secondary",icon:"eye",href:"/#faq",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),e.jsx(t,{icon:"plus",onClick:()=>n.openPanel(null),children:"Neue Frage"})]})}),e.jsx(g,{items:n.items,editingId:n.editing,onReorder:n.reorder,onOpen:n.openPanel,onDelete:r=>n.remove(r,`Frage „${r.question_de}“ wirklich löschen?`),searchText:r=>`${r.question_de} ${r.answer_de}`,searchPlaceholder:"Frage suchen …",empty:{icon:"help",title:"Noch keine Fragen",description:"Typische Kundenfragen sparen dir Telefonate.",actions:e.jsx(t,{icon:"plus",onClick:()=>n.openPanel(null),children:"Neue Frage"})},renderRow:r=>({media:e.jsx(p,{icon:"help"}),title:r.question_de,subtitle:r.answer_de})}),e.jsxs(c,{as:"form",onSubmit:n.submit,open:n.editing!==null,onClose:n.closePanel,size:"lg",title:n.isNew?"Neue Frage":"Frage bearbeiten",footer:e.jsxs(e.Fragment,{children:[e.jsx(t,{variant:"secondary",onClick:n.closePanel,children:"Abbrechen"}),e.jsx(t,{type:"submit",disabled:n.saving||!n.isNew&&!n.dirty,children:n.saving?"Speichere…":n.isNew?"Anlegen":"Speichern"})]}),children:[n.error&&e.jsx("p",{className:"rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700 dark:bg-red-950/40 dark:text-red-300",children:n.error}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h3",{className:"flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:"Deutsch"}),e.jsx(i,{label:"Frage",required:!0,children:e.jsx(o,{required:!0,autoFocus:!0,value:s.question_de,onChange:r=>a({question_de:r.target.value}),placeholder:"z. B. Wie lange dauert ein Einbau?"})}),e.jsx(i,{label:"Antwort",required:!0,children:e.jsx(l,{required:!0,rows:4,value:s.answer_de,onChange:r=>a({answer_de:r.target.value})})})]}),e.jsxs("section",{className:"space-y-4 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[e.jsxs("h3",{className:"flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-400",children:["Englisch ",(!s.question_en||!s.answer_en)&&e.jsx(u,{tone:"amber",children:"fehlt noch"})]}),e.jsx(i,{label:"Frage",required:!0,children:e.jsx(o,{required:!0,value:s.question_en,onChange:r=>a({question_en:r.target.value}),placeholder:"e.g. How long does an installation take?"})}),e.jsx(i,{label:"Antwort",required:!0,children:e.jsx(l,{required:!0,rows:4,value:s.answer_en,onChange:r=>a({answer_en:r.target.value})})})]})]})]})}export{b as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{g as c,r as n,u as g,a as m,c as u,b as p,j as a,N as h,e as f,L as b,d as y,f as v}from"./index-rAH9iOck.js";function N(){const{brandSlug:r}=c(),[t,i]=n.useState(null),[l,d]=n.useState(null),{t:s}=g(),{gallery_card_text_x:o,gallery_card_text_y:x}=m();return n.useEffect(()=>{u.get(`/gallery-brands/${r}/projects`).then(i).catch(e=>d(e))},[r]),p({title:t?s("galleryBrandPage.metaTitle")(t.brand.name):s("galleryBrandPage.metaTitleFallback"),description:t?s("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${r}`}),l?l.status===404?a.jsx(h,{}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:f(l,s)}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",s("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(e=>a.jsxs(b,{to:`/galerie/${r}/${e.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[e.cover_image_path?a.jsx("img",{src:e.cover_image_path,alt:e.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):a.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),a.jsx(y,{entity:"gallery_projects",id:e.id,field:"name",lang:"de",value:e.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:v(o,x,{x:0,y:100})})]},e.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:s("galleryBrandPage.loading")})}export{N as default};
|
import{g as c,r as n,u as g,a as m,c as u,b as p,j as a,N as h,e as f,L as b,d as y,f as v}from"./index-DdrBheBF.js";function N(){const{brandSlug:r}=c(),[t,i]=n.useState(null),[l,d]=n.useState(null),{t:s}=g(),{gallery_card_text_x:o,gallery_card_text_y:x}=m();return n.useEffect(()=>{u.get(`/gallery-brands/${r}/projects`).then(i).catch(e=>d(e))},[r]),p({title:t?s("galleryBrandPage.metaTitle")(t.brand.name):s("galleryBrandPage.metaTitleFallback"),description:t?s("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${r}`}),l?l.status===404?a.jsx(h,{}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:f(l,s)}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",s("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(e=>a.jsxs(b,{to:`/galerie/${r}/${e.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[e.cover_image_path?a.jsx("img",{src:e.cover_image_path,alt:e.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):a.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),a.jsx(y,{entity:"gallery_projects",id:e.id,field:"name",lang:"de",value:e.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:v(o,x,{x:0,y:100})})]},e.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:s("galleryBrandPage.loading")})}export{N as default};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{r,u as d,a as g,b as u,c as m,j as e,E as i,e as p,L as v,d as h,f as y}from"./index-rAH9iOck.js";function w(){const[a,o]=r.useState(null),[l,n]=r.useState(null),{t:s}=d(),{gallery_card_text_x:c,gallery_card_text_y:x}=g();return u({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),r.useEffect(()=>{m.get("/gallery-brands").then(o).catch(t=>n(t))},[]),e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(i,{k:"galleryOverview.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),e.jsx(i,{k:"galleryOverview.intro",as:"p",className:"mb-8 block text-neutral-600 dark:text-neutral-300"}),l&&e.jsx("p",{className:"text-red-600",children:typeof l=="string"?l:p(l,s)}),!a&&!l&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),a&&a.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:a==null?void 0:a.map(t=>e.jsxs(v,{to:`/galerie/${t.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[t.cover_image_path?e.jsx("img",{src:t.cover_image_path,alt:t.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),e.jsx(h,{entity:"gallery_brands",id:t.id,field:"name",lang:"de",value:t.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:y(c,x,{x:0,y:100})})]},t.id))})]})}export{w as default};
|
import{r,u as d,a as g,b as u,c as m,j as e,E as i,e as p,L as v,d as h,f as y}from"./index-DdrBheBF.js";function w(){const[a,o]=r.useState(null),[l,n]=r.useState(null),{t:s}=d(),{gallery_card_text_x:c,gallery_card_text_y:x}=g();return u({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),r.useEffect(()=>{m.get("/gallery-brands").then(o).catch(t=>n(t))},[]),e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(i,{k:"galleryOverview.title",as:"h1",className:"mb-2 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),e.jsx(i,{k:"galleryOverview.intro",as:"p",className:"mb-8 block text-neutral-600 dark:text-neutral-300"}),l&&e.jsx("p",{className:"text-red-600",children:typeof l=="string"?l:p(l,s)}),!a&&!l&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),a&&a.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:a==null?void 0:a.map(t=>e.jsxs(v,{to:`/galerie/${t.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[t.cover_image_path?e.jsx("img",{src:t.cover_image_path,alt:t.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):e.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),e.jsx(h,{entity:"gallery_brands",id:t.id,field:"name",lang:"de",value:t.name,className:"absolute whitespace-nowrap p-4 text-lg font-extrabold text-white",style:y(c,x,{x:0,y:100})})]},t.id))})]})}export{w as default};
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
import{g as z,r as l,s as B,c as d,j as t,L as C}from"./index-rAH9iOck.js";import{S as M,s as D}from"./SortableList-CtBDmUHV.js";import{V as G}from"./ViewOnSite-B7slGwOw.js";import{r as L,M as A,f as I}from"./resizeImage-C6PvAwh0.js";import"./sortable.esm-BXUVU49N.js";import"./grip-vertical-BikCVAyl.js";function J(){const{projectId:m}=z(),[u,h]=l.useState([]),[c,v]=l.useState(null),[f,j]=l.useState(""),[b,w]=l.useState(!1),[$,y]=l.useState(""),p=l.useRef(null),s=B(),x=()=>d.get(`/gallery-projects/${m}/photos`).then(h);l.useEffect(()=>{x(),d.get("/gallery-projects").then(e=>v(e.find(r=>String(r.id)===String(m))||null)).catch(()=>{})},[m]);const F=async e=>{const r=Array.from(e.target.files||[]);if(r.length===0)return;j(""),w(!0);let a=u.reduce((o,i)=>Math.max(o,Number(i.sort_order)||0),0),n=0;const g=[];for(let o=0;o<r.length;o++){y(`Foto ${o+1} von ${r.length} wird hochgeladen…`);try{const i=await L(r[o]);if(i.size>A)throw new Error(`zu groß (${I(i.size)}, max. 5 MB)`);const k=new FormData;k.append("file",i);const E=await d.post("/uploads",k);a+=10,await d.post("/gallery-photos",{gallery_project_id:Number(m),image_path:E.path,sort_order:a}),n++}catch(i){g.push(`${r[o].name}: ${i.message}`)}}w(!1),y(""),p.current&&(p.current.value=""),x(),g.length===0?s.success(n===1?"1 Foto hochgeladen.":`${n} Fotos hochgeladen.`):(j(`Nicht hochgeladen:
|
import{g as z,r as l,v as B,c as d,j as t,L as C}from"./index-DdrBheBF.js";import{S as M,s as D}from"./SortableList-DLYTOV3V.js";import{V as G}from"./ViewOnSite-D2BxjGdr.js";import{r as L,M as A,f as I}from"./resizeImage-C6PvAwh0.js";import"./sortable.esm-Bkx6x4tL.js";import"./grip-vertical-DsuA4IDe.js";function J(){const{projectId:m}=z(),[u,h]=l.useState([]),[c,v]=l.useState(null),[f,j]=l.useState(""),[b,w]=l.useState(!1),[$,y]=l.useState(""),p=l.useRef(null),s=B(),x=()=>d.get(`/gallery-projects/${m}/photos`).then(h);l.useEffect(()=>{x(),d.get("/gallery-projects").then(e=>v(e.find(r=>String(r.id)===String(m))||null)).catch(()=>{})},[m]);const F=async e=>{const r=Array.from(e.target.files||[]);if(r.length===0)return;j(""),w(!0);let a=u.reduce((o,i)=>Math.max(o,Number(i.sort_order)||0),0),n=0;const g=[];for(let o=0;o<r.length;o++){y(`Foto ${o+1} von ${r.length} wird hochgeladen…`);try{const i=await L(r[o]);if(i.size>A)throw new Error(`zu groß (${I(i.size)}, max. 5 MB)`);const k=new FormData;k.append("file",i);const E=await d.post("/uploads",k);a+=10,await d.post("/gallery-photos",{gallery_project_id:Number(m),image_path:E.path,sort_order:a}),n++}catch(i){g.push(`${r[o].name}: ${i.message}`)}}w(!1),y(""),p.current&&(p.current.value=""),x(),g.length===0?s.success(n===1?"1 Foto hochgeladen.":`${n} Fotos hochgeladen.`):(j(`Nicht hochgeladen:
|
||||||
${g.join(`
|
${g.join(`
|
||||||
`)}`),s.error(`${n} hochgeladen, ${g.length} fehlgeschlagen.`))},P=(e,r)=>{h(a=>a.map(n=>n.id===e.id?{...n,caption:r}:n))},N=l.useRef(null),S=async e=>{if((e.caption||"")!==N.current)try{await d.put(`/gallery-photos/${e.id}`,{caption:e.caption,sort_order:e.sort_order}),s.success("Bildunterschrift gespeichert.")}catch(r){s.error(`Speichern fehlgeschlagen: ${r.message}`)}},_=async e=>{if(confirm("Foto wirklich entfernen?"))try{await d.delete(`/gallery-photos/${e}`),s.success("Foto entfernt."),x()}catch(r){s.error(`Entfernen fehlgeschlagen: ${r.message}`)}},R=async e=>{const r=u;h(e);try{h(await D("gallery-photos",e)),s.success("Reihenfolge gespeichert.")}catch(a){h(r),s.error(`Reihenfolge konnte nicht gespeichert werden: ${a.message}`)}};return t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-sm",children:t.jsx(C,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),t.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t.jsxs("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:["Fotos im Projekt",c?`: ${c.brand_name} ${c.name}`:""]}),c&&t.jsx(G,{to:`/galerie/${c.brand_slug}/${c.slug}`})]}),t.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),t.jsx("input",{ref:p,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:F,disabled:b,className:"text-sm"}),t.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"JPG, PNG oder WebP, große Fotos werden automatisch verkleinert."}),b&&t.jsx("p",{className:"mt-2 text-sm text-neutral-500","aria-live":"polite",children:$})]}),f&&t.jsx("p",{className:"mb-4 whitespace-pre-line text-sm text-red-600",children:f}),u.length>1&&t.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:"Reihenfolge am Griff per Ziehen ändern."}),t.jsx(M,{items:u,onReorder:R,as:"grid",className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:(e,r)=>t.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("img",{src:e.image_path,alt:e.caption||"",className:"aspect-square w-full object-cover",loading:"lazy"}),t.jsxs("div",{className:"space-y-2 p-3",children:[t.jsx("input",{value:e.caption||"",onChange:a=>P(e,a.target.value),onFocus:()=>{N.current=e.caption||""},onBlur:()=>S(e),placeholder:"Bildunterschrift (optional)",className:"w-full rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r,t.jsx("button",{onClick:()=>_(e.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]})}),u.length===0&&t.jsx("p",{className:"py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})}export{J as default};
|
`)}`),s.error(`${n} hochgeladen, ${g.length} fehlgeschlagen.`))},P=(e,r)=>{h(a=>a.map(n=>n.id===e.id?{...n,caption:r}:n))},N=l.useRef(null),S=async e=>{if((e.caption||"")!==N.current)try{await d.put(`/gallery-photos/${e.id}`,{caption:e.caption,sort_order:e.sort_order}),s.success("Bildunterschrift gespeichert.")}catch(r){s.error(`Speichern fehlgeschlagen: ${r.message}`)}},_=async e=>{if(confirm("Foto wirklich entfernen?"))try{await d.delete(`/gallery-photos/${e}`),s.success("Foto entfernt."),x()}catch(r){s.error(`Entfernen fehlgeschlagen: ${r.message}`)}},R=async e=>{const r=u;h(e);try{h(await D("gallery-photos",e)),s.success("Reihenfolge gespeichert.")}catch(a){h(r),s.error(`Reihenfolge konnte nicht gespeichert werden: ${a.message}`)}};return t.jsxs("div",{children:[t.jsx("p",{className:"mb-2 text-sm",children:t.jsx(C,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),t.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[t.jsxs("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:["Fotos im Projekt",c?`: ${c.brand_name} ${c.name}`:""]}),c&&t.jsx(G,{to:`/galerie/${c.brand_slug}/${c.slug}`})]}),t.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),t.jsx("input",{ref:p,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:F,disabled:b,className:"text-sm"}),t.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"JPG, PNG oder WebP, große Fotos werden automatisch verkleinert."}),b&&t.jsx("p",{className:"mt-2 text-sm text-neutral-500","aria-live":"polite",children:$})]}),f&&t.jsx("p",{className:"mb-4 whitespace-pre-line text-sm text-red-600",children:f}),u.length>1&&t.jsx("p",{className:"mb-3 text-xs text-neutral-500 dark:text-neutral-400",children:"Reihenfolge am Griff per Ziehen ändern."}),t.jsx(M,{items:u,onReorder:R,as:"grid",className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:(e,r)=>t.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[t.jsx("img",{src:e.image_path,alt:e.caption||"",className:"aspect-square w-full object-cover",loading:"lazy"}),t.jsxs("div",{className:"space-y-2 p-3",children:[t.jsx("input",{value:e.caption||"",onChange:a=>P(e,a.target.value),onFocus:()=>{N.current=e.caption||""},onBlur:()=>S(e),placeholder:"Bildunterschrift (optional)",className:"w-full rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r,t.jsx("button",{onClick:()=>_(e.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]})}),u.length===0&&t.jsx("p",{className:"py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})}export{J as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{u as g,r as x,h as j,j as e,g as b,c as w,b as f,N as k,e as y,d as v,R as P,E as h,L as N}from"./index-rAH9iOck.js";function L({photos:o,index:s,onClose:t,onNavigate:n}){const{t:i}=g();if(x.useEffect(()=>{if(s==null)return;const a=r=>{r.key==="Escape"&&t(),r.key==="ArrowRight"&&n(1),r.key==="ArrowLeft"&&n(-1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,t,n]),s==null)return null;const d=o[s],c=a=>a.stopPropagation();return j.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:t,children:[e.jsx("button",{onClick:a=>{c(a),t()},"aria-label":i("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-7 w-7",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(-1)},"aria-label":i("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),e.jsx("img",{src:d.image_path,alt:d.caption||"",onClick:c,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(1)},"aria-label":i("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),d.caption&&e.jsx("p",{onClick:c,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:d.caption})]}),document.body)}function C(){const{brandSlug:o,projectSlug:s}=b(),[t,n]=x.useState(null),[i,d]=x.useState(null),[c,a]=x.useState(null),{t:r}=g();x.useEffect(()=>{w.get(`/gallery-brands/${o}/${s}/photos`).then(n).catch(l=>d(l))},[o,s]),f({title:t?`${t.project.name} – ${t.project.brand_name}`:r("galleryProjectPage.metaTitleFallback"),description:t?r("galleryProjectPage.metaDescription")(t.project.name):void 0,path:`/galerie/${o}/${s}`});const p=l=>{a(u=>{const m=t.photos.length;return(u+l+m)%m})};return i?i.status===404?e.jsx(k,{}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:y(i,r)}):t?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(v,{entity:"gallery_projects",id:t.project.id,field:"name",lang:"de",value:t.project.name,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),t.photos.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:r("galleryProjectPage.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:t.photos.map((l,u)=>e.jsx(P,{index:u%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:e.jsx("button",{onClick:()=>a(u),className:"block h-full w-full","aria-label":l.caption||r("galleryProjectPage.enlargeImage"),children:e.jsx("img",{src:l.image_path,alt:l.caption||"",loading:"lazy",decoding:"async",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},l.id))}),e.jsxs("div",{className:"mt-12 flex flex-col items-start gap-4 rounded-2xl border border-neutral-200 bg-white p-6 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(h,{k:"galleryProjectPage.ctaTitle",as:"h2",className:"block text-lg font-bold text-neutral-900 dark:text-white"}),e.jsx(h,{k:"galleryProjectPage.ctaText",as:"p",className:"mt-1 block text-sm text-neutral-600 dark:text-neutral-300"})]}),e.jsx(N,{to:`/kontakt?${new URLSearchParams({topic:r("galleryProjectPage.ctaTopic")(t.project.name)}).toString()}`,className:"shrink-0 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:e.jsx(h,{k:"galleryProjectPage.ctaButton"})})]}),e.jsx(L,{photos:t.photos,index:c,onClose:()=>a(null),onNavigate:p})]}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:r("galleryProjectPage.loading")})}export{C as default};
|
import{u as g,r as x,h as j,j as e,g as b,c as w,b as f,N as k,e as y,d as v,R as P,E as h,L as N}from"./index-DdrBheBF.js";function L({photos:o,index:s,onClose:t,onNavigate:n}){const{t:i}=g();if(x.useEffect(()=>{if(s==null)return;const a=r=>{r.key==="Escape"&&t(),r.key==="ArrowRight"&&n(1),r.key==="ArrowLeft"&&n(-1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,t,n]),s==null)return null;const d=o[s],c=a=>a.stopPropagation();return j.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:t,children:[e.jsx("button",{onClick:a=>{c(a),t()},"aria-label":i("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-7 w-7",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(-1)},"aria-label":i("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),e.jsx("img",{src:d.image_path,alt:d.caption||"",onClick:c,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),o.length>1&&e.jsx("button",{onClick:a=>{c(a),n(1)},"aria-label":i("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),d.caption&&e.jsx("p",{onClick:c,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:d.caption})]}),document.body)}function C(){const{brandSlug:o,projectSlug:s}=b(),[t,n]=x.useState(null),[i,d]=x.useState(null),[c,a]=x.useState(null),{t:r}=g();x.useEffect(()=>{w.get(`/gallery-brands/${o}/${s}/photos`).then(n).catch(l=>d(l))},[o,s]),f({title:t?`${t.project.name} – ${t.project.brand_name}`:r("galleryProjectPage.metaTitleFallback"),description:t?r("galleryProjectPage.metaDescription")(t.project.name):void 0,path:`/galerie/${o}/${s}`});const p=l=>{a(u=>{const m=t.photos.length;return(u+l+m)%m})};return i?i.status===404?e.jsx(k,{}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:y(i,r)}):t?e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[e.jsx(v,{entity:"gallery_projects",id:t.project.id,field:"name",lang:"de",value:t.project.name,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),t.photos.length===0&&e.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:r("galleryProjectPage.empty")}),e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:t.photos.map((l,u)=>e.jsx(P,{index:u%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:e.jsx("button",{onClick:()=>a(u),className:"block h-full w-full","aria-label":l.caption||r("galleryProjectPage.enlargeImage"),children:e.jsx("img",{src:l.image_path,alt:l.caption||"",loading:"lazy",decoding:"async",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},l.id))}),e.jsxs("div",{className:"mt-12 flex flex-col items-start gap-4 rounded-2xl border border-neutral-200 bg-white p-6 shadow-sm dark:border-neutral-800 dark:bg-neutral-900 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(h,{k:"galleryProjectPage.ctaTitle",as:"h2",className:"block text-lg font-bold text-neutral-900 dark:text-white"}),e.jsx(h,{k:"galleryProjectPage.ctaText",as:"p",className:"mt-1 block text-sm text-neutral-600 dark:text-neutral-300"})]}),e.jsx(N,{to:`/kontakt?${new URLSearchParams({topic:r("galleryProjectPage.ctaTopic")(t.project.name)}).toString()}`,className:"shrink-0 rounded-md bg-brand-500 px-5 py-3 text-sm font-semibold text-white shadow-sm hover:bg-brand-600",children:e.jsx(h,{k:"galleryProjectPage.ctaButton"})})]}),e.jsx(L,{photos:t.photos,index:c,onClose:()=>a(null),onNavigate:p})]}):e.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:r("galleryProjectPage.loading")})}export{C as default};
|
||||||
File diff suppressed because one or more lines are too long
1
hifi/assets/HomeSections-8RpJrbD9.js
Normal file
1
hifi/assets/HomeSections-8RpJrbD9.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{r,c as u,j as e}from"./index-rAH9iOck.js";function h({compact:m=!1}){const[n,i]=r.useState(!1),[s,l]=r.useState(null),[d,o]=r.useState(""),[t,c]=r.useState(null);r.useEffect(()=>{u.get("/settings/compress-status").then(a=>c(a.gd_available)).catch(()=>c(!1))},[]);const b=async()=>{i(!0),o(""),l(null);try{l(await u.post("/settings/compress-uploads",{}))}catch(a){o(a.message)}finally{i(!1)}};return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Bilder optimieren"}),t!==null&&e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${t?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"}`,children:t?"Aktiv":"Nicht verfügbar"})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:m?"Verkleinert alle bereits hochgeladenen Fotos, damit die Seite schneller lädt. Neue Bilder werden automatisch verkleinert.":"Neu hochgeladene Bilder werden automatisch verkleinert und komprimiert. Dieser Button holt das für alle bereits vorhandenen Bilder nach – nützlich, wenn die Seite durch zu hoch aufgelöste Fotos spürbar langsam lädt."}),t===!1&&e.jsx("p",{className:"mb-4 rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:'Diese Funktion braucht die PHP-Erweiterung "gd", die auf diesem Server aktuell nicht aktiv ist. Bei den meisten Hostern (auch All-Inkl) ist sie Teil jeder PHP-Version – bitte beim Hoster-Support nachfragen bzw. prüfen, ob in den Hosting-Einstellungen eine andere PHP-Version ausgewählt werden muss.'}),e.jsx("button",{type:"button",onClick:b,disabled:n||t===!1,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:n?"Optimiert… bitte warten":"Bestehende Bilder optimieren"}),d&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:d}),s&&e.jsxs("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:[s.processed," Bild(er) verkleinert: ",(s.before_bytes/1024/1024).toFixed(1)," MB"," → ",(s.after_bytes/1024/1024).toFixed(1)," MB."]})]})}export{h as I};
|
import{r,c as u,j as e}from"./index-DdrBheBF.js";function h({compact:m=!1}){const[n,i]=r.useState(!1),[s,l]=r.useState(null),[d,o]=r.useState(""),[t,c]=r.useState(null);r.useEffect(()=>{u.get("/settings/compress-status").then(a=>c(a.gd_available)).catch(()=>c(!1))},[]);const b=async()=>{i(!0),o(""),l(null);try{l(await u.post("/settings/compress-uploads",{}))}catch(a){o(a.message)}finally{i(!1)}};return e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[e.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Bilder optimieren"}),t!==null&&e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${t?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"}`,children:t?"Aktiv":"Nicht verfügbar"})]}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:m?"Verkleinert alle bereits hochgeladenen Fotos, damit die Seite schneller lädt. Neue Bilder werden automatisch verkleinert.":"Neu hochgeladene Bilder werden automatisch verkleinert und komprimiert. Dieser Button holt das für alle bereits vorhandenen Bilder nach – nützlich, wenn die Seite durch zu hoch aufgelöste Fotos spürbar langsam lädt."}),t===!1&&e.jsx("p",{className:"mb-4 rounded-md bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:'Diese Funktion braucht die PHP-Erweiterung "gd", die auf diesem Server aktuell nicht aktiv ist. Bei den meisten Hostern (auch All-Inkl) ist sie Teil jeder PHP-Version – bitte beim Hoster-Support nachfragen bzw. prüfen, ob in den Hosting-Einstellungen eine andere PHP-Version ausgewählt werden muss.'}),e.jsx("button",{type:"button",onClick:b,disabled:n||t===!1,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:n?"Optimiert… bitte warten":"Bestehende Bilder optimieren"}),d&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:d}),s&&e.jsxs("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:[s.processed," Bild(er) verkleinert: ",(s.before_bytes/1024/1024).toFixed(1)," MB"," → ",(s.after_bytes/1024/1024).toFixed(1)," MB."]})]})}export{h as I};
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import{ab as mt,r as m,j as u,c as ft}from"./index-rAH9iOck.js";import{M as gt,f as vt}from"./resizeImage-C6PvAwh0.js";var V=!1,E,Z,k,N,_,rt,W,B,U,G,nt,H,X,st,at;function g(){if(!V){V=!0;var o=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(o),t=/(Mac OS X)|(Windows)|(Linux)/.exec(o);if(H=/\b(iPhone|iP[ao]d)/.exec(o),X=/\b(iP[ao]d)/.exec(o),G=/Android/i.exec(o),st=/FBAN\/\w+;/i.exec(o),at=/Mobile/i.exec(o),nt=!!/Win64/.exec(o),e){E=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,E&&document&&document.documentMode&&(E=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(o);rt=i?parseFloat(i[1])+4:E,Z=e[2]?parseFloat(e[2]):NaN,k=e[3]?parseFloat(e[3]):NaN,N=e[4]?parseFloat(e[4]):NaN,N?(e=/(?:Chrome\/(\d+\.\d+))/.exec(o),_=e&&e[1]?parseFloat(e[1]):NaN):_=NaN}else E=Z=k=_=N=NaN;if(t){if(t[1]){var r=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(o);W=r?parseFloat(r[1].replace("_",".")):!0}else W=!1;B=!!t[2],U=!!t[3]}else W=B=U=!1}}var Y={ie:function(){return g()||E},ieCompatibilityMode:function(){return g()||rt>E},ie64:function(){return Y.ie()&&nt},firefox:function(){return g()||Z},opera:function(){return g()||k},webkit:function(){return g()||N},safari:function(){return Y.webkit()},chrome:function(){return g()||_},windows:function(){return g()||B},osx:function(){return g()||W},linux:function(){return g()||U},iphone:function(){return g()||H},mobile:function(){return g()||H||X||G||at},nativeApp:function(){return g()||st},android:function(){return g()||G},ipad:function(){return g()||X}},wt=Y,bt=!!(typeof window<"u"&&window.document&&window.document.createElement),Ct={canUseDOM:bt},xt=Ct,ht=xt,ct;ht.canUseDOM&&(ct=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
|
import{ab as mt,r as m,j as u,c as ft}from"./index-DdrBheBF.js";import{M as gt,f as vt}from"./resizeImage-C6PvAwh0.js";var V=!1,E,Z,k,N,_,rt,W,B,U,G,nt,H,X,st,at;function g(){if(!V){V=!0;var o=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(o),t=/(Mac OS X)|(Windows)|(Linux)/.exec(o);if(H=/\b(iPhone|iP[ao]d)/.exec(o),X=/\b(iP[ao]d)/.exec(o),G=/Android/i.exec(o),st=/FBAN\/\w+;/i.exec(o),at=/Mobile/i.exec(o),nt=!!/Win64/.exec(o),e){E=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,E&&document&&document.documentMode&&(E=document.documentMode);var i=/(?:Trident\/(\d+.\d+))/.exec(o);rt=i?parseFloat(i[1])+4:E,Z=e[2]?parseFloat(e[2]):NaN,k=e[3]?parseFloat(e[3]):NaN,N=e[4]?parseFloat(e[4]):NaN,N?(e=/(?:Chrome\/(\d+\.\d+))/.exec(o),_=e&&e[1]?parseFloat(e[1]):NaN):_=NaN}else E=Z=k=_=N=NaN;if(t){if(t[1]){var r=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(o);W=r?parseFloat(r[1].replace("_",".")):!0}else W=!1;B=!!t[2],U=!!t[3]}else W=B=U=!1}}var Y={ie:function(){return g()||E},ieCompatibilityMode:function(){return g()||rt>E},ie64:function(){return Y.ie()&&nt},firefox:function(){return g()||Z},opera:function(){return g()||k},webkit:function(){return g()||N},safari:function(){return Y.webkit()},chrome:function(){return g()||_},windows:function(){return g()||B},osx:function(){return g()||W},linux:function(){return g()||U},iphone:function(){return g()||H},mobile:function(){return g()||H||X||G||at},nativeApp:function(){return g()||st},android:function(){return g()||G},ipad:function(){return g()||X}},wt=Y,bt=!!(typeof window<"u"&&window.document&&window.document.createElement),Ct={canUseDOM:bt},xt=Ct,ht=xt,ct;ht.canUseDOM&&(ct=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
|
||||||
* Checks if an event is supported in the current execution environment.
|
* Checks if an event is supported in the current execution environment.
|
||||||
*
|
*
|
||||||
* NOTE: This will not work correctly for non-generic events such as `change`,
|
* NOTE: This will not work correctly for non-generic events such as `change`,
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
import{j as s}from"./index-rAH9iOck.js";import{L as e}from"./LegalPageView-Dqr8i9dQ.js";function i(){return s.jsx(e,{slug:"impressum",fallbackTitle:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG."})}export{i as default};
|
|
||||||
1
hifi/assets/Impressum-CYl3Zk98.js
Normal file
1
hifi/assets/Impressum-CYl3Zk98.js
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
import{j as s}from"./index-DdrBheBF.js";import{L as e}from"./LegalPageView-BPbqmWmZ.js";function i(){return s.jsx(e,{slug:"impressum",fallbackTitle:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG."})}export{i as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as l,c as n,b as r,j as a,d,i as m}from"./index-rAH9iOck.js";function c({slug:e,fallbackTitle:s,description:i}){const[t,x]=l.useState(null);return l.useEffect(()=>{n.get(`/legal-pages/${e}`).then(x).catch(()=>{})},[e]),r({title:(t==null?void 0:t.title)||s,description:i,path:`/${e}`}),t?a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx(d,{entity:"legal_pages",id:e,field:"title",lang:"de",value:t.title,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),a.jsx(m,{entity:"legal_pages",id:e,field:"body_html",lang:"de",value:t.body_html,label:t.title,className:"legal-content text-sm text-neutral-600 dark:text-neutral-300"})]}):null}export{c as L};
|
import{r as l,c as n,b as r,j as a,d,i as m}from"./index-DdrBheBF.js";function c({slug:e,fallbackTitle:s,description:i}){const[t,x]=l.useState(null);return l.useEffect(()=>{n.get(`/legal-pages/${e}`).then(x).catch(()=>{})},[e]),r({title:(t==null?void 0:t.title)||s,description:i,path:`/${e}`}),t?a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx(d,{entity:"legal_pages",id:e,field:"title",lang:"de",value:t.title,as:"h1",className:"mb-8 block text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl"}),a.jsx(m,{entity:"legal_pages",id:e,field:"body_html",lang:"de",value:t.body_html,label:t.title,className:"legal-content text-sm text-neutral-600 dark:text-neutral-300"})]}):null}export{c as L};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as s,c as b,j as e}from"./index-rAH9iOck.js";import v from"./RichTextEditor-c9aRN8FK.js";const j=[{slug:"impressum",label:"Impressum"},{slug:"datenschutz",label:"Datenschutzerklärung"},{slug:"agb",label:"AGB"}];function k(){const[d,u]=s.useState(null),[r,h]=s.useState("impressum"),[c,i]=s.useState(!1),[o,n]=s.useState(""),[g,l]=s.useState(!1);if(s.useEffect(()=>{b.get("/legal-pages").then(u)},[]),!d)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const a=d[r],m=(t,f)=>{u(x=>({...x,[r]:{...x[r],[t]:f}})),l(!1)},p=async()=>{i(!0),n(""),l(!1);try{await b.put(`/legal-pages/${r}`,{title:a.title,body_html:a.body_html}),l(!0)}catch(t){n(t.message)}finally{i(!1)}};return e.jsx("div",{className:"max-w-3xl space-y-6",children:e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Rechtstexte"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Impressum, Datenschutzerklärung und AGB direkt hier pflegen, statt einen Deploy für jede Textänderung zu brauchen. Bitte bei Rechtstexten im Zweifel rechtlich beraten lassen, bevor du größere Änderungen veröffentlichst."}),e.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:j.map(t=>e.jsx("button",{type:"button",onClick:()=>{h(t.slug),l(!1),n("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${r===t.slug?"bg-brand-500 text-white":"border border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:t.label},t.slug))}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),e.jsx("input",{value:a.title,onChange:t=>m("title",t.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsx(v,{label:"Inhalt",value:a.body_html,onChange:t=>m("body_html",t)})]}),a.updated_at&&e.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(a.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),o&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:o}),g&&e.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"button",onClick:p,disabled:c,className:"mt-4 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:c?"Speichere…":"Speichern"})]})})}export{k as default};
|
import{r as s,c as b,j as e}from"./index-DdrBheBF.js";import v from"./RichTextEditor-CYUhnRVk.js";const j=[{slug:"impressum",label:"Impressum"},{slug:"datenschutz",label:"Datenschutzerklärung"},{slug:"agb",label:"AGB"}];function k(){const[d,u]=s.useState(null),[r,h]=s.useState("impressum"),[c,i]=s.useState(!1),[o,n]=s.useState(""),[g,l]=s.useState(!1);if(s.useEffect(()=>{b.get("/legal-pages").then(u)},[]),!d)return e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"});const a=d[r],m=(t,f)=>{u(x=>({...x,[r]:{...x[r],[t]:f}})),l(!1)},p=async()=>{i(!0),n(""),l(!1);try{await b.put(`/legal-pages/${r}`,{title:a.title,body_html:a.body_html}),l(!0)}catch(t){n(t.message)}finally{i(!1)}};return e.jsx("div",{className:"max-w-3xl space-y-6",children:e.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Rechtstexte"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Impressum, Datenschutzerklärung und AGB direkt hier pflegen, statt einen Deploy für jede Textänderung zu brauchen. Bitte bei Rechtstexten im Zweifel rechtlich beraten lassen, bevor du größere Änderungen veröffentlichst."}),e.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:j.map(t=>e.jsx("button",{type:"button",onClick:()=>{h(t.slug),l(!1),n("")},className:`rounded-md px-3 py-1.5 text-sm font-medium transition ${r===t.slug?"bg-brand-500 text-white":"border border-neutral-300 text-neutral-600 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:t.label},t.slug))}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Überschrift"}),e.jsx("input",{value:a.title,onChange:t=>m("title",t.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsx(v,{label:"Inhalt",value:a.body_html,onChange:t=>m("body_html",t)})]}),a.updated_at&&e.jsxs("p",{className:"mt-3 text-xs text-neutral-400",children:["Zuletzt geändert: ",new Date(a.updated_at.replace(" ","T")).toLocaleString("de-DE")]}),o&&e.jsx("p",{className:"mt-3 text-sm text-red-600",children:o}),g&&e.jsx("p",{className:"mt-3 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),e.jsx("button",{type:"button",onClick:p,disabled:c,className:"mt-4 rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:c?"Speichere…":"Speichern"})]})})}export{k as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{k as L,m as P,r as a,j as e,n as q,l as B,o as D}from"./index-rAH9iOck.js";function M(){const{user:f,login:p,verifyTwoFactor:k,resendLoginCode:w}=L(),i=P(),[N,u]=a.useState("credentials"),[c,j]=a.useState("totp"),[v,y]=a.useState(""),[m,n]=a.useState(""),[x,C]=a.useState(""),[b,S]=a.useState(""),[h,g]=a.useState(""),[l,r]=a.useState(""),[d,o]=a.useState(!1);if(f)return e.jsx(q,{to:"/admin",replace:!0});const A=async t=>{t.preventDefault(),o(!0),r("");try{const s=await p(x,b);s.requires2fa?(j(s.method),y(s.emailHint),n(""),u("code")):i("/admin")}catch(s){r(s.message)}finally{o(!1)}},E=async t=>{t.preventDefault(),o(!0),r("");try{await k(h),i("/admin")}catch(s){r(s.message)}finally{o(!1)}},H=async()=>{r(""),n("");try{await w(),n("Neuer Code ist unterwegs.")}catch(t){r(t.message)}};return e.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[e.jsx("img",{src:B,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:D,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),N==="credentials"?e.jsxs("form",{onSubmit:A,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),e.jsx("input",{value:x,onChange:t=>C(t.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),e.jsx("input",{type:"password",value:b,onChange:t=>S(t.target.value),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:l}),e.jsx("button",{type:"submit",disabled:d,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:d?"Anmelden…":"Anmelden"})]}):e.jsxs("form",{onSubmit:E,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),c==="email"?e.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Wir haben dir einen 6-stelligen Code an ",e.jsx("strong",{className:"text-neutral-700 dark:text-neutral-200",children:v})," geschickt. Er ist 10 Minuten gültig."]}):e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Öffne die Google Authenticator App und gib den 6-stelligen Code ein. Alternativ kannst du auch einen deiner Wiederherstellungscodes verwenden."}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),e.jsx("input",{value:h,onChange:t=>g(t.target.value),required:!0,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:l}),m&&e.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:m}),e.jsx("button",{type:"submit",disabled:d,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:d?"Prüfe…":"Bestätigen"}),c==="email"&&e.jsx("button",{type:"button",onClick:H,className:"mt-3 w-full text-sm text-brand-600 hover:underline dark:text-brand-400",children:"Keinen Code bekommen? Neu senden"}),e.jsx("button",{type:"button",onClick:()=>{u("credentials"),g(""),r(""),n("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}export{M as default};
|
import{k as L,m as P,r as a,j as e,n as q,l as B,o as D}from"./index-DdrBheBF.js";function M(){const{user:f,login:p,verifyTwoFactor:k,resendLoginCode:w}=L(),i=P(),[N,u]=a.useState("credentials"),[c,j]=a.useState("totp"),[v,y]=a.useState(""),[m,n]=a.useState(""),[x,C]=a.useState(""),[b,S]=a.useState(""),[h,g]=a.useState(""),[l,r]=a.useState(""),[d,o]=a.useState(!1);if(f)return e.jsx(q,{to:"/admin",replace:!0});const A=async t=>{t.preventDefault(),o(!0),r("");try{const s=await p(x,b);s.requires2fa?(j(s.method),y(s.emailHint),n(""),u("code")):i("/admin")}catch(s){r(s.message)}finally{o(!1)}},E=async t=>{t.preventDefault(),o(!0),r("");try{await k(h),i("/admin")}catch(s){r(s.message)}finally{o(!1)}},H=async()=>{r(""),n("");try{await w(),n("Neuer Code ist unterwegs.")}catch(t){r(t.message)}};return e.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[e.jsx("img",{src:B,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),e.jsx("img",{src:D,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),N==="credentials"?e.jsxs("form",{onSubmit:A,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),e.jsx("input",{value:x,onChange:t=>C(t.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),e.jsx("input",{type:"password",value:b,onChange:t=>S(t.target.value),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:l}),e.jsx("button",{type:"submit",disabled:d,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:d?"Anmelden…":"Anmelden"})]}):e.jsxs("form",{onSubmit:E,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),c==="email"?e.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Wir haben dir einen 6-stelligen Code an ",e.jsx("strong",{className:"text-neutral-700 dark:text-neutral-200",children:v})," geschickt. Er ist 10 Minuten gültig."]}):e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Öffne die Google Authenticator App und gib den 6-stelligen Code ein. Alternativ kannst du auch einen deiner Wiederherstellungscodes verwenden."}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),e.jsx("input",{value:h,onChange:t=>g(t.target.value),required:!0,autoFocus:!0,inputMode:"numeric",autoComplete:"one-time-code",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:l}),m&&e.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:m}),e.jsx("button",{type:"submit",disabled:d,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:d?"Prüfe…":"Bestätigen"}),c==="email"&&e.jsx("button",{type:"button",onClick:H,className:"mt-3 w-full text-sm text-brand-600 hover:underline dark:text-brand-400",children:"Keinen Code bekommen? Neu senden"}),e.jsx("button",{type:"button",onClick:()=>{u("credentials"),g(""),r(""),n("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}export{M as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as s,c as o,j as a}from"./index-rAH9iOck.js";const v={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function N(){const[l,n]=s.useState(v),[g,h]=s.useState(!0),[i,d]=s.useState(!1),[x,r]=s.useState(!1),[c,u]=s.useState("");s.useEffect(()=>{o.get("/maintenance").then(e=>{n({global:{enabled:e.global.enabled,message:e.global.message||""},services:{enabled:e.services.enabled,message:e.services.message||""},vehicles:{enabled:e.vehicles.enabled,message:e.vehicles.message||""}})}).finally(()=>h(!1))},[]);const m=(e,t,k)=>{n(b=>({...b,[e]:{...b[e],[t]:k}})),r(!1)},p=async e=>{e.preventDefault(),d(!0),u(""),r(!1);try{const t=await o.post("/maintenance",l);n({global:{enabled:t.global.enabled,message:t.global.message||""},services:{enabled:t.services.enabled,message:t.services.message||""},vehicles:{enabled:t.vehicles.enabled,message:t.vehicles.message||""}}),r(!0)}catch(t){u(t.message)}finally{d(!1)}},f=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return g?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:p,className:"max-w-2xl space-y-6",children:[a.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:'Ist "Gesamte Seite" aktiv, gewinnt das immer – die beiden anderen Schalter spielen dann keine Rolle mehr.'}),f.map(e=>a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:e.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:l[e.key].enabled,onChange:t=>m(e.key,"enabled",t.target.checked),className:"peer sr-only"}),a.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),a.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:e.hint}),a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),a.jsx("textarea",{rows:2,value:l[e.key].message,onChange:t=>m(e.key,"message",t.target.value),placeholder:"z. B. Wir aktualisieren gerade unser Angebot. Schau bald wieder vorbei!",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]},e.key)),c&&a.jsx("p",{className:"text-sm text-red-600",children:c}),x&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":"Speichern"})]})}export{N as default};
|
import{r as s,c as o,j as a}from"./index-DdrBheBF.js";const v={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function N(){const[l,n]=s.useState(v),[g,h]=s.useState(!0),[i,d]=s.useState(!1),[x,r]=s.useState(!1),[c,u]=s.useState("");s.useEffect(()=>{o.get("/maintenance").then(e=>{n({global:{enabled:e.global.enabled,message:e.global.message||""},services:{enabled:e.services.enabled,message:e.services.message||""},vehicles:{enabled:e.vehicles.enabled,message:e.vehicles.message||""}})}).finally(()=>h(!1))},[]);const m=(e,t,k)=>{n(b=>({...b,[e]:{...b[e],[t]:k}})),r(!1)},p=async e=>{e.preventDefault(),d(!0),u(""),r(!1);try{const t=await o.post("/maintenance",l);n({global:{enabled:t.global.enabled,message:t.global.message||""},services:{enabled:t.services.enabled,message:t.services.message||""},vehicles:{enabled:t.vehicles.enabled,message:t.vehicles.message||""}}),r(!0)}catch(t){u(t.message)}finally{d(!1)}},f=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return g?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:p,className:"max-w-2xl space-y-6",children:[a.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:'Ist "Gesamte Seite" aktiv, gewinnt das immer – die beiden anderen Schalter spielen dann keine Rolle mehr.'}),f.map(e=>a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:e.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:l[e.key].enabled,onChange:t=>m(e.key,"enabled",t.target.checked),className:"peer sr-only"}),a.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),a.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:e.hint}),a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),a.jsx("textarea",{rows:2,value:l[e.key].message,onChange:t=>m(e.key,"message",t.target.value),placeholder:"z. B. Wir aktualisieren gerade unser Angebot. Schau bald wieder vorbei!",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]},e.key)),c&&a.jsx("p",{className:"text-sm text-red-600",children:c}),x&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":"Speichern"})]})}export{N as default};
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{j as r,P as i,B as t,y as s,F as l,v as c}from"./index-rAH9iOck.js";import d from"./ImageUploadField-3FwYiNkQ.js";import{u as h,E as m,R as u}from"./EntityList-DCHE8ATz.js";import"./resizeImage-C6PvAwh0.js";import"./SortableList-CtBDmUHV.js";import"./sortable.esm-BXUVU49N.js";import"./grip-vertical-BikCVAyl.js";const p={name:"",logo_path:"",sort_order:0};function y(){const e=h({endpoint:"/partners",reorderKey:"partners",source:"partners",emptyForm:p,toForm:n=>({name:n.name,logo_path:n.logo_path||"",sort_order:n.sort_order}),labels:{created:"Partner angelegt.",saved:"Partner gespeichert.",deleted:"Partner gelöscht."}}),{form:o,change:a}=e;return r.jsxs("div",{children:[r.jsx(i,{title:"Partner-Logos",description:"Die Logozeile auf der Startseite. Ohne Logo erscheint der Name als Text. Reihenfolge am Griff links ziehen.",actions:r.jsxs(r.Fragment,{children:[r.jsx(t,{variant:"secondary",icon:"eye",href:"/",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),r.jsx(t,{icon:"plus",onClick:()=>e.openPanel(null),children:"Neuer Partner"})]})}),r.jsx(m,{items:e.items,editingId:e.editing,onReorder:e.reorder,onOpen:e.openPanel,onDelete:n=>e.remove(n,`Partner „${n.name}“ wirklich löschen?`),searchText:n=>n.name,searchPlaceholder:"Partner suchen …",empty:{icon:"shield",title:"Noch keine Partner",description:"Logos von Herstellern, mit denen ihr arbeitet, schaffen Vertrauen.",actions:r.jsx(t,{icon:"plus",onClick:()=>e.openPanel(null),children:"Neuer Partner"})},renderRow:n=>({media:r.jsx(u,{src:n.logo_path,icon:"shield",contain:!0,className:"w-20"}),title:n.name,subtitle:n.logo_path?null:"Ohne Logo – erscheint als Text"})}),r.jsxs(s,{as:"form",onSubmit:e.submit,open:e.editing!==null,onClose:e.closePanel,title:e.isNew?"Neuer Partner":"Partner bearbeiten",footer:r.jsxs(r.Fragment,{children:[r.jsx(t,{variant:"secondary",onClick:e.closePanel,children:"Abbrechen"}),r.jsx(t,{type:"submit",disabled:e.saving||!e.isNew&&!e.dirty,children:e.saving?"Speichere…":e.isNew?"Anlegen":"Speichern"})]}),children:[r.jsx(l,{label:"Name",required:!0,error:e.error,children:r.jsx(c,{required:!0,autoFocus:!0,value:o.name,onChange:n=>a({name:n.target.value}),placeholder:"z. B. Focal"})}),r.jsx(d,{value:o.logo_path,onChange:n=>a({logo_path:n}),label:"Logo (optional)"})]})]})}export{y as default};
|
import{j as r,P as i,B as t,z as s,F as l,x as c}from"./index-DdrBheBF.js";import d from"./ImageUploadField-CU23n4Bo.js";import{u as h,E as m,R as u}from"./EntityList-CZMR7cO6.js";import"./resizeImage-C6PvAwh0.js";import"./SortableList-DLYTOV3V.js";import"./sortable.esm-Bkx6x4tL.js";import"./grip-vertical-DsuA4IDe.js";const p={name:"",logo_path:"",sort_order:0};function _(){const e=h({endpoint:"/partners",reorderKey:"partners",source:"partners",emptyForm:p,toForm:n=>({name:n.name,logo_path:n.logo_path||"",sort_order:n.sort_order}),labels:{created:"Partner angelegt.",saved:"Partner gespeichert.",deleted:"Partner gelöscht."}}),{form:o,change:a}=e;return r.jsxs("div",{children:[r.jsx(i,{title:"Partner-Logos",description:"Die Logozeile auf der Startseite. Ohne Logo erscheint der Name als Text. Reihenfolge am Griff links ziehen.",actions:r.jsxs(r.Fragment,{children:[r.jsx(t,{variant:"secondary",icon:"eye",href:"/",target:"_blank",rel:"noopener noreferrer",children:"Ansehen"}),r.jsx(t,{icon:"plus",onClick:()=>e.openPanel(null),children:"Neuer Partner"})]})}),r.jsx(m,{items:e.items,editingId:e.editing,onReorder:e.reorder,onOpen:e.openPanel,onDelete:n=>e.remove(n,`Partner „${n.name}“ wirklich löschen?`),searchText:n=>n.name,searchPlaceholder:"Partner suchen …",empty:{icon:"shield",title:"Noch keine Partner",description:"Logos von Herstellern, mit denen ihr arbeitet, schaffen Vertrauen.",actions:r.jsx(t,{icon:"plus",onClick:()=>e.openPanel(null),children:"Neuer Partner"})},renderRow:n=>({media:r.jsx(u,{src:n.logo_path,icon:"shield",contain:!0,className:"w-20"}),title:n.name,subtitle:n.logo_path?null:"Ohne Logo – erscheint als Text"})}),r.jsxs(s,{as:"form",onSubmit:e.submit,open:e.editing!==null,onClose:e.closePanel,title:e.isNew?"Neuer Partner":"Partner bearbeiten",footer:r.jsxs(r.Fragment,{children:[r.jsx(t,{variant:"secondary",onClick:e.closePanel,children:"Abbrechen"}),r.jsx(t,{type:"submit",disabled:e.saving||!e.isNew&&!e.dirty,children:e.saving?"Speichere…":e.isNew?"Anlegen":"Speichern"})]}),children:[r.jsx(l,{label:"Name",required:!0,error:e.error,children:r.jsx(c,{required:!0,autoFocus:!0,value:o.name,onChange:n=>a({name:n.target.value}),placeholder:"z. B. Focal"})}),r.jsx(d,{value:o.logo_path,onChange:n=>a({logo_path:n}),label:"Logo (optional)"})]})]})}export{_ as default};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{r as n,j as e,c as i}from"./index-rAH9iOck.js";const h={name:"",description:"",permissions:[]};function w(){const[c,b]=n.useState([]),[o,g]=n.useState([]),[r,a]=n.useState(h),[l,u]=n.useState(null),[m,x]=n.useState(""),d=()=>{i.get("/permission-groups").then(b),i.get("/permissions/catalog").then(g)};n.useEffect(d,[]);const j=t=>{u(t.id),a({name:t.name,description:t.description||"",permissions:t.permissions})},p=()=>{u(null),a(h)},N=t=>{a(s=>({...s,permissions:s.permissions.includes(t)?s.permissions.filter(y=>y!==t):[...s.permissions,t]}))},k=async t=>{t.preventDefault(),x("");try{l?await i.put(`/permission-groups/${l}`,r):await i.post("/permission-groups",r),p(),d()}catch(s){x(s.message)}},f=async t=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await i.delete(`/permission-groups/${t}`),d())};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Fasse mehrere Berechtigungen zu einer Gruppe zusammen (z. B. „Werkstatt"), die du dann bequem einem oder mehreren Benutzern zuweisen kannst.'}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[c.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]}),e.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[t.permissions.length," von ",o.length]}),e.jsxs("td",{className:"px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>j(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>f(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),c.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),e.jsxs("form",{onSubmit:k,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>a({...r,name:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),e.jsx("textarea",{rows:2,value:r.description,onChange:t=>a({...r,description:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),e.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:o.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:r.permissions.includes(t.key),onChange:()=>N(t.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.label]},t.key))})]}),m&&e.jsx("p",{className:"text-sm text-red-600",children:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:l?"Speichern":"Anlegen"}),l&&e.jsx("button",{type:"button",onClick:p,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{w as default};
|
import{r as n,j as e,c as i}from"./index-DdrBheBF.js";const h={name:"",description:"",permissions:[]};function w(){const[c,b]=n.useState([]),[o,g]=n.useState([]),[r,a]=n.useState(h),[l,u]=n.useState(null),[m,x]=n.useState(""),d=()=>{i.get("/permission-groups").then(b),i.get("/permissions/catalog").then(g)};n.useEffect(d,[]);const j=t=>{u(t.id),a({name:t.name,description:t.description||"",permissions:t.permissions})},p=()=>{u(null),a(h)},N=t=>{a(s=>({...s,permissions:s.permissions.includes(t)?s.permissions.filter(y=>y!==t):[...s.permissions,t]}))},k=async t=>{t.preventDefault(),x("");try{l?await i.put(`/permission-groups/${l}`,r):await i.post("/permission-groups",r),p(),d()}catch(s){x(s.message)}},f=async t=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await i.delete(`/permission-groups/${t}`),d())};return e.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),e.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Fasse mehrere Berechtigungen zu einer Gruppe zusammen (z. B. „Werkstatt"), die du dann bequem einem oder mehreren Benutzern zuweisen kannst.'}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Name"}),e.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[c.map(t=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2",children:[e.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:t.name}),t.description&&e.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:t.description})]}),e.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[t.permissions.length," von ",o.length]}),e.jsxs("td",{className:"px-4 py-2 text-right",children:[e.jsx("button",{onClick:()=>j(t),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),e.jsx("button",{onClick:()=>f(t.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},t.id)),c.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),e.jsxs("form",{onSubmit:k,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),e.jsx("input",{required:!0,value:r.name,onChange:t=>a({...r,name:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),e.jsx("textarea",{rows:2,value:r.description,onChange:t=>a({...r,description:t.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),e.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:o.map(t=>e.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[e.jsx("input",{type:"checkbox",checked:r.permissions.includes(t.key),onChange:()=>N(t.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),t.label]},t.key))})]}),m&&e.jsx("p",{className:"text-sm text-red-600",children:m}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:l?"Speichern":"Anlegen"}),l&&e.jsx("button",{type:"button",onClick:p,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}export{w as default};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
import{r as q,a9 as xt,j as R,aK as Gu,a0 as Yu}from"./index-rAH9iOck.js";var Hl={exports:{}},jl={};/**
|
import{r as q,a9 as xt,j as R,aK as Gu,a0 as Yu}from"./index-DdrBheBF.js";var Hl={exports:{}},jl={};/**
|
||||||
* @license React
|
* @license React
|
||||||
* use-sync-external-store-shim.production.js
|
* use-sync-external-store-shim.production.js
|
||||||
*
|
*
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{j as e}from"./index-rAH9iOck.js";function l({dirty:t,busy:i,savedAt:a,onSave:n,label:s="Speichern",form:r}){return e.jsx("div",{className:"sticky bottom-0 z-20 -mx-4 mt-6 border-t border-neutral-200 bg-white/95 px-4 py-3 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:`text-sm ${t?"font-medium text-amber-600 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:t?"● Ungespeicherte Änderungen":a?`✓ Gespeichert um ${a.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})} Uhr`:"Alles gespeichert"}),e.jsx("button",{type:r?"submit":"button",form:r,onClick:r?void 0:n,disabled:i||!t,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":s})]})})}export{l as S};
|
import{j as e}from"./index-DdrBheBF.js";function l({dirty:t,busy:i,savedAt:a,onSave:n,label:s="Speichern",form:r}){return e.jsx("div",{className:"sticky bottom-0 z-20 -mx-4 mt-6 border-t border-neutral-200 bg-white/95 px-4 py-3 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:`text-sm ${t?"font-medium text-amber-600 dark:text-amber-400":"text-neutral-500 dark:text-neutral-400"}`,children:t?"● Ungespeicherte Änderungen":a?`✓ Gespeichert um ${a.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})} Uhr`:"Alles gespeichert"}),e.jsx("button",{type:r?"submit":"button",form:r,onClick:r?void 0:n,disabled:i||!t,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:i?"Speichere…":s})]})})}export{l as S};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{a1 as a,j as e,r as i,a2 as d}from"./index-rAH9iOck.js";const u={company:["Firmendaten","Telefon, Adresse, Öffnungszeiten und der Hinweis unter den Paketpreisen."],design:["Aussehen","Schriften und das Aussehen der Kacheln auf der Website."],images:["Bilder","Alle fest eingebauten Bilder der Website austauschen: Logo, Titelbild, Link-Vorschau, Startseiten-Fotos, Hintergründe und Paketkacheln. Ohne eigenes Bild gilt jeweils das Standardbild."],legal:["Rechtstexte","Impressum, Datenschutzerklärung und AGB."],maintenance:["Wartungsmodus","Die ganze Website oder einzelne Bereiche vorübergehend für Besucher sperren."],countdown:["Launch-Countdown","Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst."],email:["E-Mail-Versand","Zugangsdaten des Mail-Servers und die Texte der automatischen E-Mails."],google:["Google-Dienste","Google Analytics und Google-Bewertungen anbinden. Nur für Techniker."],connections:["Verbindungstest","Prüft auf Knopfdruck, ob Google, Mail-Server, Datenbank, Update-Server und Audio4Cars erreichbar sind und richtig eingerichtet."],database:["Datenbank","Verbindung und Struktur der Datenbank. Nur für Techniker."],"export-import":["Export & Import","Sicherung herunterladen oder auf einem anderen Server einspielen."],update:["Updates","Neue Versionen der Website installieren."],reset:["Zurücksetzen","Inhalte auf den Auslieferungszustand zurücksetzen. Vorher unbedingt exportieren."]};function l(){const{pathname:t}=a(),r=t.replace(/\/$/,"").split("/").pop(),[s,n]=u[r]||["Einstellungen",""];return e.jsxs("div",{children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:s}),n&&e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:n}),e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),children:e.jsx(d,{})})]})}export{l as default};
|
import{a1 as a,j as e,r as i,a2 as d}from"./index-DdrBheBF.js";const u={company:["Firmendaten","Telefon, Adresse, Öffnungszeiten und der Hinweis unter den Paketpreisen."],design:["Aussehen","Schriften und das Aussehen der Kacheln auf der Website."],images:["Bilder","Alle fest eingebauten Bilder der Website austauschen: Logo, Titelbild, Link-Vorschau, Startseiten-Fotos, Hintergründe und Paketkacheln. Ohne eigenes Bild gilt jeweils das Standardbild."],legal:["Rechtstexte","Impressum, Datenschutzerklärung und AGB."],maintenance:["Wartungsmodus","Die ganze Website oder einzelne Bereiche vorübergehend für Besucher sperren."],countdown:["Launch-Countdown","Vor dem Start nur einen Countdown zeigen, der neugierig macht. Danach öffnet sich die Website von selbst."],email:["E-Mail-Versand","Zugangsdaten des Mail-Servers und die Texte der automatischen E-Mails."],google:["Google-Dienste","Google Analytics und Google-Bewertungen anbinden. Nur für Techniker."],connections:["Verbindungstest","Prüft auf Knopfdruck, ob Google, Mail-Server, Datenbank, Update-Server und Audio4Cars erreichbar sind und richtig eingerichtet."],database:["Datenbank","Verbindung und Struktur der Datenbank. Nur für Techniker."],"export-import":["Export & Import","Sicherung herunterladen oder auf einem anderen Server einspielen."],update:["Updates","Neue Versionen der Website installieren."],reset:["Zurücksetzen","Inhalte auf den Auslieferungszustand zurücksetzen. Vorher unbedingt exportieren."]};function l(){const{pathname:t}=a(),r=t.replace(/\/$/,"").split("/").pop(),[s,n]=u[r]||["Einstellungen",""];return e.jsxs("div",{children:[e.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:s}),n&&e.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:n}),e.jsx(i.Suspense,{fallback:e.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}),children:e.jsx(d,{})})]})}export{l as default};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{j as o,c as x}from"./index-rAH9iOck.js";import{u as p,a as f,D as m,c as v,S as y,r as j,v as C,b as R,s as w,K as D,T as N,P as T,d as E,C as G}from"./sortable.esm-BXUVU49N.js";import{G as I}from"./grip-vertical-BikCVAyl.js";function P({items:t,onReorder:s,children:n,as:e="ul",className:d="",disabled:i=!1}){const l=p(f(T,{activationConstraint:{distance:4}}),f(N,{activationConstraint:{delay:150,tolerance:6}}),f(D,{coordinateGetter:w})),c=({active:r,over:a})=>{if(!a||r.id===a.id)return;const h=t.findIndex(b=>b.id===r.id),S=t.findIndex(b=>b.id===a.id);s(R(t,h,S))},u=e==="tbody"?"tbody":e==="grid"?"div":"ul",g=e==="tbody"?"tr":e==="grid"?"div":"li";return o.jsx(m,{sensors:l,collisionDetection:v,onDragEnd:c,children:o.jsx(y,{items:t.map(r=>r.id),strategy:e==="grid"?j:C,disabled:i,children:o.jsx(u,{className:d,children:t.map(r=>o.jsx(K,{id:r.id,tag:g,disabled:i,children:a=>n(r,a)},r.id))})})})}function K({id:t,tag:s,disabled:n,children:e}){const{attributes:d,listeners:i,setNodeRef:l,setActivatorNodeRef:c,transform:u,transition:g,isDragging:r}=E({id:t,disabled:n}),a=n?null:o.jsx("button",{type:"button",ref:c,...d,...i,title:"Ziehen, um die Reihenfolge zu ändern","aria-label":"Reihenfolge ändern",className:"cursor-grab touch-none rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 active:cursor-grabbing dark:hover:bg-neutral-800",children:o.jsx(I,{className:"h-4 w-4"})});return o.jsx(s,{ref:l,style:{transform:G.Translate.toString(u),transition:g,position:"relative",zIndex:r?10:void 0},className:r?"bg-white shadow-lg ring-1 ring-brand-500 dark:bg-neutral-900":void 0,children:e(a)})}async function A(t,s){return await x.put(`/reorder/${t}`,{ids:s.map(n=>n.id)}),s.map((n,e)=>({...n,sort_order:(e+1)*10}))}export{P as S,A as s};
|
import{j as o,c as x}from"./index-DdrBheBF.js";import{u as p,a as f,D as m,c as v,S as y,r as j,v as C,b as R,s as w,K as D,T as N,P as T,d as E,C as G}from"./sortable.esm-Bkx6x4tL.js";import{G as I}from"./grip-vertical-DsuA4IDe.js";function P({items:t,onReorder:s,children:n,as:e="ul",className:d="",disabled:i=!1}){const l=p(f(T,{activationConstraint:{distance:4}}),f(N,{activationConstraint:{delay:150,tolerance:6}}),f(D,{coordinateGetter:w})),c=({active:r,over:a})=>{if(!a||r.id===a.id)return;const h=t.findIndex(b=>b.id===r.id),S=t.findIndex(b=>b.id===a.id);s(R(t,h,S))},u=e==="tbody"?"tbody":e==="grid"?"div":"ul",g=e==="tbody"?"tr":e==="grid"?"div":"li";return o.jsx(m,{sensors:l,collisionDetection:v,onDragEnd:c,children:o.jsx(y,{items:t.map(r=>r.id),strategy:e==="grid"?j:C,disabled:i,children:o.jsx(u,{className:d,children:t.map(r=>o.jsx(K,{id:r.id,tag:g,disabled:i,children:a=>n(r,a)},r.id))})})})}function K({id:t,tag:s,disabled:n,children:e}){const{attributes:d,listeners:i,setNodeRef:l,setActivatorNodeRef:c,transform:u,transition:g,isDragging:r}=E({id:t,disabled:n}),a=n?null:o.jsx("button",{type:"button",ref:c,...d,...i,title:"Ziehen, um die Reihenfolge zu ändern","aria-label":"Reihenfolge ändern",className:"cursor-grab touch-none rounded p-1 text-neutral-400 hover:bg-neutral-100 hover:text-neutral-600 active:cursor-grabbing dark:hover:bg-neutral-800",children:o.jsx(I,{className:"h-4 w-4"})});return o.jsx(s,{ref:l,style:{transform:G.Translate.toString(u),transition:g,position:"relative",zIndex:r?10:void 0},className:r?"bg-white shadow-lg ring-1 ring-brand-500 dark:bg-neutral-900":void 0,children:e(a)})}async function A(t,s){return await x.put(`/reorder/${t}`,{ids:s.map(n=>n.id)}),s.map((n,e)=>({...n,sort_order:(e+1)*10}))}export{P as S,A as s};
|
||||||
|
|
@ -1 +1 @@
|
||||||
import{a0 as g,r as l,c as x,j as t}from"./index-rAH9iOck.js";const y=[{label:"Standard",value:""},{label:"S (14px)",value:"14px"},{label:"M (16px)",value:"16px"},{label:"L (18px)",value:"18px"},{label:"XL (20px)",value:"20px"},{label:"XXL (24px)",value:"24px"},{label:"XXXL (28px)",value:"28px"},{label:"Groß (36px)",value:"36px"},{label:"Riesig (48px)",value:"48px"}],s={font_family:"",font_size:"",color:""};function k({fieldKey:o,previewText:p="Beispieltext",label:c="Stil"}){const b=g(),[a,n]=l.useState(s),[m,u]=l.useState(!0),[d,i]=l.useState("");l.useEffect(()=>{u(!0),x.get(`/text-styles/one?key=${encodeURIComponent(o)}`).then(e=>n({font_family:e.font_family||"",font_size:e.font_size||"",color:e.color||""})).catch(()=>n(s)).finally(()=>u(!1))},[o]);const r=async e=>{n(e),i("");try{await x.put("/text-styles",{field_key:o,...e})}catch(v){i(v.message)}};if(m)return null;const f={fontFamily:a.font_family||void 0,fontSize:a.font_size||void 0,color:a.color||void 0};return t.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 rounded-md border border-neutral-200 bg-neutral-50 p-2 dark:border-neutral-700 dark:bg-neutral-800/50",children:[t.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-neutral-400",children:c}),t.jsx("select",{value:a.font_family,onChange:e=>r({...a,font_family:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:b.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("select",{value:a.font_size,onChange:e=>r({...a,font_size:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:y.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("input",{type:"color",value:a.color||"#000000",onChange:e=>r({...a,color:e.target.value}),className:"h-7 w-9 cursor-pointer rounded border border-neutral-300 bg-white p-0.5 dark:border-neutral-700 dark:bg-neutral-900",title:"Textfarbe"}),t.jsx("button",{type:"button",onClick:()=>r(s),className:"rounded-md border border-neutral-300 px-2 py-1 text-xs text-neutral-500 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-700",children:"Zurücksetzen"}),t.jsx("span",{className:"ml-1 rounded px-2 py-1 text-sm",style:f,children:p}),d&&t.jsx("span",{className:"text-xs text-red-600",children:d})]})}export{k as T};
|
import{a0 as g,r as l,c as x,j as t}from"./index-DdrBheBF.js";const y=[{label:"Standard",value:""},{label:"S (14px)",value:"14px"},{label:"M (16px)",value:"16px"},{label:"L (18px)",value:"18px"},{label:"XL (20px)",value:"20px"},{label:"XXL (24px)",value:"24px"},{label:"XXXL (28px)",value:"28px"},{label:"Groß (36px)",value:"36px"},{label:"Riesig (48px)",value:"48px"}],s={font_family:"",font_size:"",color:""};function k({fieldKey:o,previewText:p="Beispieltext",label:c="Stil"}){const b=g(),[a,n]=l.useState(s),[m,u]=l.useState(!0),[d,i]=l.useState("");l.useEffect(()=>{u(!0),x.get(`/text-styles/one?key=${encodeURIComponent(o)}`).then(e=>n({font_family:e.font_family||"",font_size:e.font_size||"",color:e.color||""})).catch(()=>n(s)).finally(()=>u(!1))},[o]);const r=async e=>{n(e),i("");try{await x.put("/text-styles",{field_key:o,...e})}catch(v){i(v.message)}};if(m)return null;const f={fontFamily:a.font_family||void 0,fontSize:a.font_size||void 0,color:a.color||void 0};return t.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 rounded-md border border-neutral-200 bg-neutral-50 p-2 dark:border-neutral-700 dark:bg-neutral-800/50",children:[t.jsx("span",{className:"text-xs font-medium uppercase tracking-wide text-neutral-400",children:c}),t.jsx("select",{value:a.font_family,onChange:e=>r({...a,font_family:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:b.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("select",{value:a.font_size,onChange:e=>r({...a,font_size:e.target.value}),className:"rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900",children:y.map(e=>t.jsx("option",{value:e.value,children:e.label},e.label))}),t.jsx("input",{type:"color",value:a.color||"#000000",onChange:e=>r({...a,color:e.target.value}),className:"h-7 w-9 cursor-pointer rounded border border-neutral-300 bg-white p-0.5 dark:border-neutral-700 dark:bg-neutral-900",title:"Textfarbe"}),t.jsx("button",{type:"button",onClick:()=>r(s),className:"rounded-md border border-neutral-300 px-2 py-1 text-xs text-neutral-500 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-400 dark:hover:bg-neutral-700",children:"Zurücksetzen"}),t.jsx("span",{className:"ml-1 rounded px-2 py-1 text-sm",style:f,children:p}),d&&t.jsx("span",{className:"text-xs text-red-600",children:d})]})}export{k as T};
|
||||||
1
hifi/assets/Traffic-DHlFjm9L.js
Normal file
1
hifi/assets/Traffic-DHlFjm9L.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
||||||
import{j as n,J as a}from"./index-rAH9iOck.js";function i({to:e,label:r="Ansehen",className:t=""}){return e?n.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Auf der Website ansehen (neuer Tab)",className:`inline-flex items-center gap-1 text-xs font-medium text-neutral-500 hover:text-brand-600 dark:text-neutral-400 ${t}`,children:[n.jsx(a,{className:"h-3.5 w-3.5"}),r]}):null}export{i as V};
|
import{j as n,K as a}from"./index-DdrBheBF.js";function i({to:e,label:r="Ansehen",className:t=""}){return e?n.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",title:"Auf der Website ansehen (neuer Tab)",className:`inline-flex items-center gap-1 text-xs font-medium text-neutral-500 hover:text-brand-600 dark:text-neutral-400 ${t}`,children:[n.jsx(a,{className:"h-3.5 w-3.5"}),r]}):null}export{i as V};
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
import{aa as c}from"./index-rAH9iOck.js";/**
|
import{aa as c}from"./index-DdrBheBF.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import{aa as e,ac as L0,ad as x0,ae as w0,af as f0,ag as I0,ah as C0,G as N0,ai as b0,H as $0,aj as q0,ak as s,al as z0,am as S0,J as A0,an as H0,ao as j0,ap as V0,aq as P0,ar as B0,as as D0,at as F0,au as R0,av as T0,aw as U0,ax as O0,M as G0,ay as Z0,az as W0,D as E0,aA as X0,aB as K0,aC as Q0,aD as J0,aE as Y0,aF as ea,X as aa,aG as ca,aH as fL,aI as IL,aJ as CL,j as NL}from"./index-rAH9iOck.js";import{D as ta,a as oa,b as da,c as l,F as na,L as ha,M as ia}from"./music-Dvm6TcAr.js";import{G as ya}from"./grip-vertical-BikCVAyl.js";import{R as ra,T as ka}from"./trash-2-D5ynvEXW.js";/**
|
import{aa as e,ac as L0,ad as x0,ae as w0,af as f0,ag as I0,ah as C0,H as N0,ai as b0,J as $0,aj as q0,ak as s,al as z0,am as S0,K as A0,an as H0,ao as j0,ap as V0,aq as P0,ar as B0,as as D0,at as F0,au as R0,av as T0,aw as U0,ax as O0,O as G0,ay as Z0,az as W0,G as E0,aA as X0,aB as K0,aC as Q0,aD as J0,aE as Y0,aF as ea,X as aa,aG as ca,aH as fL,aI as IL,aJ as CL,j as NL}from"./index-DdrBheBF.js";import{D as ta,a as oa,b as da,c as l,F as na,L as ha,M as ia}from"./music-DbXVbsjj.js";import{G as ya}from"./grip-vertical-DsuA4IDe.js";import{R as ra,T as ka}from"./trash-2-rD9day4e.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
1
hifi/assets/index-ClmpBZ4J.css
Normal file
1
hifi/assets/index-ClmpBZ4J.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
||||||
import{aa as a}from"./index-rAH9iOck.js";/**
|
import{aa as a}from"./index-DdrBheBF.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import{r as c,a9 as P,h as Oe}from"./index-rAH9iOck.js";function Rn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const et=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:pt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Ut(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:pt(e)?bt(e)?e:Be(e)||Ut(e)?e.ownerDocument:document:document:document}const Q=et?c.useLayoutEffect:c.useEffect;function wt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Sn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ge(e){const t=wt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function dt(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let at={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=at[e]==null?0:at[e]+1;return at[e]=n,e+"-"+n},[e,t])}function Wt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Wt(1),ze=Wt(-1);function En(e){return"clientX"in e&&"clientY"in e}function mt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Mn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ft(e){if(Mn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return En(e)?{x:e.clientX,y:e.clientY}:null}const Je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Je.Translate.toString(e),Je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ot="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function In(e){return e.matches(Ot)?e:e.querySelector(Ot)}const An={display:"none"};function On(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:An},n)}function Tn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Nn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ht=c.createContext(null);function Ln(e){const t=c.useContext(Ht);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function kn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const zn={draggable:`
|
import{r as c,a9 as P,h as Oe}from"./index-DdrBheBF.js";function Rn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const et=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function me(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function pt(e){return"nodeType"in e}function B(e){var t,n;return e?me(e)?e:pt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bt(e){const{Document:t}=B(e);return e instanceof t}function Be(e){return me(e)?!1:e instanceof B(e).HTMLElement}function Ut(e){return e instanceof B(e).SVGElement}function ye(e){return e?me(e)?e.document:pt(e)?bt(e)?e:Be(e)||Ut(e)?e.ownerDocument:document:document:document}const Q=et?c.useLayoutEffect:c.useEffect;function wt(e){const t=c.useRef(e);return Q(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function Sn(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function ke(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return Q(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Ge(e){const t=wt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function dt(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let at={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=at[e]==null?0:at[e]+1;return at[e]=n,e+"-"+n},[e,t])}function Wt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const f=i[l];f!=null&&(i[l]=f+e*u)}return i},{...t})}}const we=Wt(1),ze=Wt(-1);function En(e){return"clientX"in e&&"clientY"in e}function mt(e){if(!e)return!1;const{KeyboardEvent:t}=B(e.target);return t&&e instanceof t}function Mn(e){if(!e)return!1;const{TouchEvent:t}=B(e.target);return t&&e instanceof t}function ft(e){if(Mn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return En(e)?{x:e.clientX,y:e.clientY}:null}const Je=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Je.Translate.toString(e),Je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ot="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function In(e){return e.matches(Ot)?e:e.querySelector(Ot)}const An={display:"none"};function On(e){let{id:t,value:n}=e;return P.createElement("div",{id:t,style:An},n)}function Tn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return P.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Nn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ht=c.createContext(null);function Ln(e){const t=c.useContext(Ht);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function kn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const zn={draggable:`
|
||||||
To pick up a draggable item, press the space bar.
|
To pick up a draggable item, press the space bar.
|
||||||
While dragging, use the arrow keys to move the item.
|
While dragging, use the arrow keys to move the item.
|
||||||
Press space again to drop the item in its new position, or press escape to cancel.
|
Press space again to drop the item in its new position, or press escape to cancel.
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import{aa as a}from"./index-rAH9iOck.js";/**
|
import{aa as a}from"./index-DdrBheBF.js";/**
|
||||||
* @license lucide-react v1.23.0 - ISC
|
* @license lucide-react v1.23.0 - ISC
|
||||||
*
|
*
|
||||||
* This source code is licensed under the ISC license.
|
* This source code is licensed under the ISC license.
|
||||||
|
|
@ -49,8 +49,8 @@
|
||||||
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script type="module" crossorigin src="/assets/index-rAH9iOck.js"></script>
|
<script type="module" crossorigin src="/assets/index-DdrBheBF.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-DKDXW0wR.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-ClmpBZ4J.css">
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
<body class="bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue