aktueller stand
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
import { medusaFetch } from "./medusa";
|
||||
|
||||
export interface MedusaCustomer {
|
||||
id: string;
|
||||
email: string;
|
||||
first_name: string | null;
|
||||
last_name: string | null;
|
||||
}
|
||||
|
||||
export async function loginCustomer(email: string, password: string): Promise<string> {
|
||||
const data = await medusaFetch("/auth/customer/emailpass", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ email, password }),
|
||||
});
|
||||
return data.token;
|
||||
}
|
||||
|
||||
export async function registerCustomer(input: {
|
||||
email: string;
|
||||
password: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
}): Promise<string> {
|
||||
const registration = await medusaFetch("/auth/customer/emailpass/register", {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ email: input.email, password: input.password }),
|
||||
});
|
||||
|
||||
await medusaFetch("/store/customers", {
|
||||
method: "POST",
|
||||
headers: { Authorization: `Bearer ${registration.token}` },
|
||||
body: JSON.stringify({ email: input.email, first_name: input.first_name, last_name: input.last_name }),
|
||||
});
|
||||
|
||||
// The registration token isn't linked to the new customer yet (Medusa
|
||||
// issues it before the auth identity <-> customer link exists), so it
|
||||
// can't authenticate customer-scoped routes. Log in again to get a token
|
||||
// that actually resolves to this customer.
|
||||
return loginCustomer(input.email, input.password);
|
||||
}
|
||||
|
||||
export async function getCustomerMe(token: string): Promise<MedusaCustomer> {
|
||||
const data = await medusaFetch("/store/customers/me", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
return data.customer;
|
||||
}
|
||||
|
||||
export interface MedusaOrderSummary {
|
||||
id: string;
|
||||
display_id: number;
|
||||
status: string;
|
||||
total: number;
|
||||
currency_code: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
export async function listMyOrders(token: string): Promise<MedusaOrderSummary[]> {
|
||||
const data = await medusaFetch("/store/orders?limit=50&order=-created_at", {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
return data.orders;
|
||||
}
|
||||
|
||||
export interface MedusaOrderDetailItem {
|
||||
title: string;
|
||||
quantity: number;
|
||||
unit_price: number;
|
||||
total: number;
|
||||
thumbnail: string | null;
|
||||
}
|
||||
|
||||
export interface MedusaOrderDetail {
|
||||
id: string;
|
||||
display_id: number;
|
||||
email: string;
|
||||
created_at: string;
|
||||
currency_code: string;
|
||||
items: MedusaOrderDetailItem[];
|
||||
shipping_address: {
|
||||
first_name?: string | null;
|
||||
last_name?: string | null;
|
||||
address_1?: string | null;
|
||||
postal_code?: string | null;
|
||||
city?: string | null;
|
||||
country_code?: string | null;
|
||||
} | null;
|
||||
item_total: number;
|
||||
shipping_total: number;
|
||||
total: number;
|
||||
fulfillment_status: string;
|
||||
fulfillments: {
|
||||
packed_at: string | null;
|
||||
shipped_at: string | null;
|
||||
delivered_at: string | null;
|
||||
canceled_at: string | null;
|
||||
labels: { tracking_number: string; tracking_url: string }[];
|
||||
}[];
|
||||
}
|
||||
|
||||
export async function getMyOrder(token: string, id: string): Promise<MedusaOrderDetail> {
|
||||
const data = await medusaFetch(`/store/customers/me/orders/${id}`, {
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
return data.order;
|
||||
}
|
||||
|
||||
// Links a (possibly guest-created) cart to the now-logged-in customer, so
|
||||
// the resulting order shows up under "Meine Bestellungen" — carts only get
|
||||
// a customer_id automatically at creation time if already authenticated,
|
||||
// which isn't the case when someone adds to cart before logging in.
|
||||
export async function transferCartToCustomer(cartId: string, token: string): Promise<void> {
|
||||
await medusaFetch(`/store/carts/${cartId}/customer`, {
|
||||
method: "POST",
|
||||
headers: { Authorization: `Bearer ${token}` },
|
||||
});
|
||||
}
|
||||
+206
-4
@@ -1,4 +1,6 @@
|
||||
import { medusaFetch } from "./medusa";
|
||||
import { summariseVarieties } from "./subscriptions";
|
||||
import { varietyName } from "./varieties";
|
||||
|
||||
export interface MedusaCartItem {
|
||||
id: string;
|
||||
@@ -6,14 +8,55 @@ export interface MedusaCartItem {
|
||||
thumbnail: string | null;
|
||||
quantity: number;
|
||||
unit_price: number;
|
||||
/** Beim Abo steht hier die Sortenwahl. */
|
||||
metadata?: {
|
||||
subscription_selection?: "fixed" | "random";
|
||||
/** Altbestand: eine Sorte für alle Gläser. */
|
||||
subscription_variety?: string;
|
||||
subscription_variant_id?: string;
|
||||
/** Eine Angabe je Glas, in der Reihenfolge der Auswahl. */
|
||||
subscription_varieties?: string[];
|
||||
subscription_variant_ids?: string[];
|
||||
/** Beim verschenkten Abo gesetzt. */
|
||||
subscription_gift?: boolean;
|
||||
/** Bienenpatenschaft: Angaben für Urkunde, Etikett und Beschenkten. */
|
||||
sponsorship_name?: string;
|
||||
sponsorship_gift?: boolean;
|
||||
sponsorship_recipient_email?: string;
|
||||
sponsorship_sender_name?: string;
|
||||
subscription_deliveries?: number;
|
||||
gift_recipient_name?: string;
|
||||
gift_recipient_email?: string;
|
||||
gift_sender_name?: string;
|
||||
/** Geschenkgutschein: geht er direkt an den Beschenkten? */
|
||||
voucher_gift?: boolean;
|
||||
voucher_recipient_name?: string;
|
||||
voucher_recipient_email?: string;
|
||||
voucher_sender_name?: string;
|
||||
voucher_message?: string;
|
||||
} | null;
|
||||
/** `false` beim Geschenkgutschein: er kommt per E-Mail. */
|
||||
requires_shipping?: boolean;
|
||||
variant?: {
|
||||
id: string;
|
||||
metadata?: { subscription_interval?: string; subscription_size?: string } | null;
|
||||
product?: { metadata?: { subscription?: boolean } | null } | null;
|
||||
} | null;
|
||||
}
|
||||
|
||||
export interface MedusaCart {
|
||||
id: string;
|
||||
email: string | null;
|
||||
currency_code: string;
|
||||
/** Bestimmt, welche Zahlungsarten zur Verfügung stehen. */
|
||||
region_id: string | null;
|
||||
item_total: number;
|
||||
items: MedusaCartItem[];
|
||||
/** Nach Abzug eingelöster Gutscheine. */
|
||||
total?: number;
|
||||
credit_line_total?: number;
|
||||
credit_lines?: { id: string; amount: number; reference: string | null; reference_id: string | null }[];
|
||||
gift_cards?: { id: string; code: string }[];
|
||||
}
|
||||
|
||||
export interface MedusaShippingOption {
|
||||
@@ -30,15 +73,152 @@ export async function createCart(regionId: string): Promise<MedusaCart> {
|
||||
return data.cart;
|
||||
}
|
||||
|
||||
// Ohne diese Felder liefert Medusa weder die Posten-Metadaten noch die
|
||||
// Produktkennzeichnung — beides braucht die Kasse, um ein Abo zu erkennen.
|
||||
// Dazu die eingelösten Gutscheine und ob ein Posten verschickt wird.
|
||||
const CART_FIELDS =
|
||||
"+items.metadata,+items.variant.metadata,+items.variant.product.metadata,+items.requires_shipping," +
|
||||
"+total,+credit_line_total,+credit_lines.*,+gift_cards.id,+gift_cards.code";
|
||||
|
||||
export async function getCart(cartId: string): Promise<MedusaCart> {
|
||||
const data = await medusaFetch(`/store/carts/${cartId}`);
|
||||
const data = await medusaFetch(`/store/carts/${cartId}?fields=${encodeURIComponent(CART_FIELDS)}`);
|
||||
return data.cart;
|
||||
}
|
||||
|
||||
export async function addLineItem(cartId: string, variantId: string, quantity = 1): Promise<MedusaCart> {
|
||||
/** Enthält der Warenkorb ein Abo? Dann läuft die Kasse anders. */
|
||||
function istAboPosten(item: MedusaCartItem): boolean {
|
||||
return item.variant?.product?.metadata?.subscription === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ob der Warenkorb ein Abo enthält, das ein Mandat braucht.
|
||||
*
|
||||
* Ein verschenktes Abo braucht keines: es ist mit der Bestellung vollständig
|
||||
* bezahlt und wird nie abgebucht. Es läuft deshalb durch die normale Kasse,
|
||||
* nicht über die Weiterleitung zu Mollie.
|
||||
*/
|
||||
export function cartHasSubscription(cart: MedusaCart | null): boolean {
|
||||
return (cart?.items ?? []).some(
|
||||
(item) => istAboPosten(item) && item.metadata?.subscription_gift !== true
|
||||
);
|
||||
}
|
||||
|
||||
/** Ob im Warenkorb ein verschenktes Abo liegt. */
|
||||
export function cartHasGiftSubscription(cart: MedusaCart | null): boolean {
|
||||
return (cart?.items ?? []).some(
|
||||
(item) => istAboPosten(item) && item.metadata?.subscription_gift === true
|
||||
);
|
||||
}
|
||||
|
||||
const INTERVAL_LABELS: Record<string, string> = {
|
||||
monthly: "monatlich",
|
||||
quarterly: "alle 3 Monate",
|
||||
biannual: "alle 6 Monate",
|
||||
};
|
||||
|
||||
/**
|
||||
* Die Angaben, die ein Posten über sich selbst macht.
|
||||
*
|
||||
* Bei der Patenschaft sind das Name und Empfänger — sie stehen im Warenkorb
|
||||
* und an der Kasse, damit ein Tippfehler im Namen auffällt, bevor die
|
||||
* Urkunde gedruckt ist.
|
||||
*/
|
||||
export function describeSponsorshipItem(item: MedusaCartItem): string {
|
||||
const name = item.metadata?.sponsorship_name;
|
||||
if (!name) return "";
|
||||
const teile = [`Auf den Namen: ${name}`];
|
||||
if (item.metadata?.sponsorship_gift) {
|
||||
teile.push(`Geschenk an ${item.metadata.sponsorship_recipient_email ?? "—"}`);
|
||||
}
|
||||
return teile.join(" · ");
|
||||
}
|
||||
|
||||
/** Beim verschenkten Gutschein: an wen er per E-Mail geht. */
|
||||
export function describeVoucherItem(item: MedusaCartItem): string {
|
||||
if (!item.metadata?.voucher_gift || !item.metadata.voucher_recipient_email) return "";
|
||||
const an = item.metadata.voucher_recipient_name
|
||||
? `${item.metadata.voucher_recipient_name} (${item.metadata.voucher_recipient_email})`
|
||||
: item.metadata.voucher_recipient_email;
|
||||
return `Per E-Mail an ${an}`;
|
||||
}
|
||||
|
||||
/** Ob etwas im Warenkorb verschickt wird. Ein Gutschein allein nicht. */
|
||||
export function cartRequiresShipping(cart: MedusaCart | null): boolean {
|
||||
return (cart?.items ?? []).some((item) => item.requires_shipping !== false);
|
||||
}
|
||||
|
||||
/** Gutscheincode am Warenkorb einlösen. */
|
||||
export async function applyGiftCard(cartId: string, code: string): Promise<void> {
|
||||
await medusaFetch(`/store/carts/${cartId}/gift-cards`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ code }),
|
||||
});
|
||||
}
|
||||
|
||||
/** Eingelösten Gutschein wieder vom Warenkorb nehmen. */
|
||||
export async function removeGiftCard(cartId: string, code: string): Promise<void> {
|
||||
await medusaFetch(`/store/carts/${cartId}/gift-cards`, {
|
||||
method: "DELETE",
|
||||
body: JSON.stringify({ code }),
|
||||
});
|
||||
}
|
||||
|
||||
/** Das Guthaben der eingelösten Gutscheine — für den Abzug an der Kasse. */
|
||||
export async function getGiftCardBalances(cartId: string): Promise<{ code: string; balance: number }[]> {
|
||||
const data = await medusaFetch(`/store/carts/${cartId}/gift-card-balances`);
|
||||
return data.gift_cards ?? [];
|
||||
}
|
||||
|
||||
export function describeSubscriptionItem(item: MedusaCartItem): string {
|
||||
const interval = INTERVAL_LABELS[item.variant?.metadata?.subscription_interval ?? ""] ?? "";
|
||||
const size = item.variant?.metadata?.subscription_size ?? "";
|
||||
// Beim Anzeigen kürzen statt beim Speichern: so lesen sich auch Warenkörbe
|
||||
// kurz, die noch mit den vollen Katalogtiteln angelegt wurden.
|
||||
const perGlass = summariseVarieties(
|
||||
(item.metadata?.subscription_varieties ?? []).map(varietyName)
|
||||
);
|
||||
const variety =
|
||||
item.metadata?.subscription_selection === "fixed"
|
||||
? // Altbestand aus der Zeit vor der Wahl je Glas kennt nur die
|
||||
// Einzelangabe.
|
||||
(perGlass || (item.metadata.subscription_variety && varietyName(item.metadata.subscription_variety)) || "feste Sorte")
|
||||
: "Überraschungshonig";
|
||||
return [size, interval, variety].filter(Boolean).join(" · ");
|
||||
}
|
||||
|
||||
/** Startet die Abo-Kasse und liefert die Weiterleitungsadresse zu Mollie. */
|
||||
export async function startSubscriptionCheckout(payload: {
|
||||
cart_id: string;
|
||||
email: string;
|
||||
shipping_address: Record<string, unknown>;
|
||||
shipping_option_id?: string;
|
||||
method?: string;
|
||||
}): Promise<{ checkout_url: string }> {
|
||||
const data = await medusaFetch("/store/subscriptions/checkout", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function addLineItem(
|
||||
cartId: string,
|
||||
variantId: string,
|
||||
quantity = 1,
|
||||
/**
|
||||
* Zusatzangaben am Posten. Beim Abo steht hier die Sortenwahl, die
|
||||
* bewusst keine Produktvariante ist — mit 12 Sorten mal Größe mal
|
||||
* Intervall gäbe das 78 Varianten.
|
||||
*/
|
||||
metadata?: Record<string, unknown>
|
||||
): Promise<MedusaCart> {
|
||||
const data = await medusaFetch(`/store/carts/${cartId}/line-items`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ variant_id: variantId, quantity }),
|
||||
body: JSON.stringify({
|
||||
variant_id: variantId,
|
||||
quantity,
|
||||
...(metadata && Object.keys(metadata).length ? { metadata } : {}),
|
||||
}),
|
||||
});
|
||||
return data.cart;
|
||||
}
|
||||
@@ -80,14 +260,36 @@ export async function listShippingOptions(cartId: string): Promise<MedusaShippin
|
||||
return data.shipping_options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Versandart setzen. Über die eigene Route statt Medusas `shipping-methods`:
|
||||
* nur sie rechnet die Versandkostenfreigrenze ohne Gutscheine im Warenkorb.
|
||||
*/
|
||||
export async function addShippingMethod(cartId: string, optionId: string): Promise<MedusaCart> {
|
||||
const data = await medusaFetch(`/store/carts/${cartId}/shipping-methods`, {
|
||||
const data = await medusaFetch(`/store/carts/${cartId}/select-shipping`, {
|
||||
method: "POST",
|
||||
body: JSON.stringify({ option_id: optionId }),
|
||||
});
|
||||
return data.cart;
|
||||
}
|
||||
|
||||
export interface PaymentMethod {
|
||||
id: string;
|
||||
label: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Die Zahlungsarten, die der Shop zu Ende führen kann.
|
||||
*
|
||||
* Bewusst nicht Medusas `/store/payment-providers`: das listet auch
|
||||
* Anbieter, für die es an der Kasse noch keinen Ablauf gibt.
|
||||
*/
|
||||
export async function listPaymentMethods(regionId?: string): Promise<PaymentMethod[]> {
|
||||
const query = regionId ? `?region_id=${encodeURIComponent(regionId)}` : "";
|
||||
const data = await medusaFetch(`/store/payment-methods${query}`);
|
||||
return data.payment_methods ?? [];
|
||||
}
|
||||
|
||||
export async function createPaymentCollection(cartId: string) {
|
||||
const data = await medusaFetch("/store/payment-collections", {
|
||||
method: "POST",
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { medusaFetch } from "./medusa";
|
||||
|
||||
export interface ContactRequest {
|
||||
quelle: string;
|
||||
name: string;
|
||||
email: string;
|
||||
nachricht: string;
|
||||
datenschutz: boolean;
|
||||
/** Die unsichtbare Falle. Bleibt beim Menschen leer. */
|
||||
website?: string;
|
||||
seite?: string;
|
||||
}
|
||||
|
||||
/** Schickt eine Anfrage an den Shop. Wirft mit der Meldung des Backends. */
|
||||
export async function sendContactRequest(anfrage: ContactRequest): Promise<void> {
|
||||
await medusaFetch("/store/contact", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(anfrage),
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
export const CUSTOMER_COOKIE_NAME = "customer_jwt";
|
||||
|
||||
export function getCustomerTokenClient(): string | null {
|
||||
const match = document.cookie.match(new RegExp(`(?:^|; )${CUSTOMER_COOKIE_NAME}=([^;]*)`));
|
||||
return match ? decodeURIComponent(match[1]) : null;
|
||||
}
|
||||
|
||||
export function setCustomerTokenClient(token: string) {
|
||||
document.cookie = `${CUSTOMER_COOKIE_NAME}=${encodeURIComponent(token)}; path=/; max-age=${60 * 60 * 24 * 30}; SameSite=Lax`;
|
||||
}
|
||||
|
||||
export function clearCustomerTokenClient() {
|
||||
document.cookie = `${CUSTOMER_COOKIE_NAME}=; path=/; max-age=0`;
|
||||
}
|
||||
@@ -6,3 +6,15 @@ export function formatGrundpreis(amount: number, netWeightGrams: number): string
|
||||
const perKg = (amount / netWeightGrams) * 1000;
|
||||
return `${formatEUR(perKg)}/kg`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wie formatEUR, aber ohne "‚00" bei glatten Beträgen — "60 €" statt
|
||||
* "60,00 €". Für Angaben wie die Versandfreigrenze, die immer rund ist.
|
||||
*/
|
||||
export function formatEURKurz(amount: number): string {
|
||||
return new Intl.NumberFormat("de-DE", {
|
||||
style: "currency",
|
||||
currency: "EUR",
|
||||
minimumFractionDigits: Number.isInteger(amount) ? 0 : 2,
|
||||
}).format(amount);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/**
|
||||
* Umrisse der 16 Bundesländer als SVG-Pfade.
|
||||
*
|
||||
* Erzeugt aus deutschlandGeoJSON (isellsoap, niedrige Auflösung) mit einer
|
||||
* äquirektangularen Projektion und Standardparallele in der Landesmitte —
|
||||
* dadurch entspricht das Seitenverhältnis den realen Entfernungen statt der
|
||||
* Mercator-Überhöhung. Douglas-Peucker-vereinfacht.
|
||||
*
|
||||
* `project()` verwendet exakt dieselbe Projektion wie die Pfade. Nur so
|
||||
* landen zur Laufzeit gesetzte Koordinaten an der richtigen Stelle.
|
||||
*/
|
||||
|
||||
export const MAP_WIDTH = 1000.0;
|
||||
export const MAP_HEIGHT = 1354.59;
|
||||
|
||||
const LON0 = 5.87161922454851;
|
||||
const LAT_N = 55.05652618408226;
|
||||
const KX = 0.6271040495237281;
|
||||
const SCALE = 173.96311033367303;
|
||||
|
||||
/** Geografische Koordinate -> Punkt im SVG-Koordinatensystem der Karte. */
|
||||
export function project(lat: number, lng: number): { x: number; y: number } {
|
||||
return {
|
||||
x: (lng - LON0) * KX * SCALE,
|
||||
y: (LAT_N - lat) * SCALE,
|
||||
};
|
||||
}
|
||||
|
||||
/** Ausschnitte für das viewBox-Attribut. */
|
||||
export const VIEWS = {
|
||||
germany: `0 0 1000 1355`,
|
||||
/** Hamburg mit Umland – Standardansicht, weil dort alle Völker stehen. */
|
||||
hamburg: `389 213 128 90`,
|
||||
/** Norddeutschland. */
|
||||
north: `59 0 897 677`,
|
||||
} as const;
|
||||
|
||||
export type MapView = keyof typeof VIEWS;
|
||||
|
||||
/** Hamburg im Gesamtbild — für die kleine Übersichtskarte. */
|
||||
export const HAMBURG = project(53.5511, 9.9937);
|
||||
|
||||
export interface StatePath {
|
||||
id: string;
|
||||
name: string;
|
||||
d: string;
|
||||
}
|
||||
|
||||
/** Bundesländer, die im Nord-Ausschnitt sichtbar sind. */
|
||||
export const NORTHERN_STATES = ["Bremen", "Hamburg", "Mecklenburg-Vorpommern", "Niedersachsen", "Schleswig-Holstein"].map(String);
|
||||
|
||||
export const STATES: StatePath[] = [
|
||||
{ id: "DE-BW", name: "Baden-Württemberg", d: "M412.2 918.6L410.8 933.5L414.6 934.8L419.4 927.6L421.4 934.7L428.1 927.5L432.6 932.0L432.2 940.4L437.3 948.7L431.3 957.8L435.7 959.7L441.8 952.5L440.0 957.0L443.1 957.0L444.1 970.5L452.7 970.4L458.1 959.4L460.1 965.8L464.5 965.7L461.6 976.6L469.2 985.5L463.0 988.2L465.0 993.2L462.5 995.2L466.9 997.1L468.1 1005.0L463.4 1009.3L465.9 1009.9L464.7 1018.8L479.2 1028.8L473.7 1036.6L478.7 1037.7L478.8 1046.7L490.1 1048.4L501.3 1064.3L498.2 1069.4L501.3 1072.1L498.2 1079.7L500.6 1086.2L496.3 1092.5L505.5 1107.5L496.3 1111.8L499.3 1106.1L495.7 1105.4L489.5 1113.0L488.3 1106.6L480.8 1104.0L479.0 1111.0L486.4 1120.7L483.3 1121.3L485.1 1135.4L475.9 1137.2L477.1 1140.4L469.8 1146.5L454.5 1147.0L455.2 1152.1L447.3 1160.7L457.8 1177.9L459.8 1195.4L466.0 1209.6L465.4 1223.9L459.4 1234.4L462.5 1238.2L461.9 1248.0L458.9 1250.0L465.0 1259.0L457.8 1264.3L463.2 1268.8L464.4 1283.8L459.6 1283.9L458.3 1290.5L453.0 1281.3L446.5 1287.8L433.4 1283.4L422.7 1295.9L403.2 1299.5L395.8 1288.0L375.7 1283.8L346.1 1258.2L360.6 1273.2L365.4 1285.3L359.2 1287.8L340.4 1271.4L342.4 1274.5L334.9 1274.2L342.0 1280.6L329.5 1287.6L325.3 1282.6L327.6 1278.4L320.4 1272.5L316.3 1276.3L319.3 1283.3L311.6 1280.3L311.9 1268.3L307.5 1268.8L303.8 1261.4L300.9 1268.3L299.8 1261.7L294.2 1259.9L295.1 1264.3L283.8 1267.6L276.3 1283.3L283.7 1289.6L297.8 1283.8L300.8 1288.2L297.3 1289.0L296.0 1297.1L289.0 1290.5L282.2 1296.2L286.3 1299.7L279.9 1302.1L268.1 1301.5L263.9 1294.7L254.5 1292.6L241.8 1303.6L226.1 1305.9L220.3 1298.3L212.6 1298.1L196.1 1308.1L192.1 1303.7L197.3 1302.2L196.3 1298.3L189.4 1300.5L180.3 1286.7L183.9 1248.3L191.0 1232.2L185.1 1221.3L186.1 1206.5L195.8 1189.1L198.8 1175.0L204.4 1170.2L203.1 1158.2L210.9 1138.2L210.9 1124.4L228.9 1096.0L241.7 1088.1L253.7 1061.1L264.4 1052.9L271.7 1036.3L274.5 1012.8L285.8 1001.2L281.3 995.7L286.1 990.9L286.6 985.2L282.9 985.4L287.7 976.8L280.8 975.3L283.2 971.3L277.9 957.6L279.0 951.7L296.7 962.3L300.4 957.6L297.7 946.9L308.3 944.5L306.6 952.9L311.7 962.8L330.6 964.7L328.2 971.1L322.5 970.6L323.8 976.9L319.5 980.9L325.8 983.2L336.4 973.4L336.3 964.5L355.8 963.1L351.4 958.6L353.2 952.2L369.5 951.6L375.6 939.4L386.9 941.4L387.9 929.8L384.8 926.5L381.1 931.0L383.5 927.2L374.8 925.2L377.9 924.6L376.6 920.1L397.0 916.8L403.9 924.5L403.7 918.0L412.2 918.6ZM309.5 1277.1L311.0 1280.4L304.3 1280.6L309.5 1277.1Z" },
|
||||
{ id: "DE-BY", name: "Bayern", d: "M465.0 784.0L472.7 783.3L475.9 790.5L486.8 793.7L494.6 806.0L493.3 811.2L500.3 809.9L504.2 818.3L516.4 822.2L517.1 840.4L529.3 844.9L530.5 836.4L543.7 836.3L528.6 823.5L529.2 817.0L541.1 811.8L553.0 811.8L559.3 820.1L559.3 816.2L564.3 820.1L571.8 816.2L576.9 822.6L575.0 829.7L586.9 833.5L590.2 816.1L586.5 796.7L594.8 794.7L597.4 788.9L606.4 790.1L605.0 801.1L608.2 806.3L612.0 804.3L616.4 814.7L624.2 809.4L645.3 806.1L649.7 811.3L661.9 805.4L666.8 811.2L666.5 818.3L682.2 825.2L683.5 830.6L677.9 835.2L690.3 845.6L690.3 860.2L697.1 863.6L696.5 868.8L721.9 882.0L720.5 890.1L728.3 892.3L723.3 907.7L720.1 908.2L720.1 916.1L712.5 922.2L717.0 930.6L726.1 934.0L725.9 943.6L730.2 945.0L732.7 959.0L739.0 961.2L737.6 970.1L740.7 978.4L751.4 984.0L754.1 992.4L772.5 993.0L781.3 999.9L781.8 1007.0L797.3 1023.3L797.3 1028.5L809.9 1032.7L821.7 1044.6L823.9 1058.5L831.8 1064.0L833.3 1059.1L841.9 1059.1L850.9 1073.9L859.6 1075.4L868.8 1093.4L863.5 1102.1L867.7 1116.0L866.0 1124.8L858.4 1135.6L832.5 1123.8L825.2 1129.3L827.2 1137.8L822.5 1161.9L808.8 1174.5L787.5 1178.6L763.3 1192.1L750.7 1207.2L777.8 1253.3L768.0 1274.3L779.3 1274.6L786.6 1281.3L789.2 1290.3L782.9 1299.8L783.5 1315.5L779.1 1320.5L774.4 1318.5L755.8 1303.9L753.8 1300.4L758.7 1294.3L752.7 1289.3L754.0 1284.0L734.6 1283.4L731.5 1291.2L723.8 1292.1L716.1 1279.6L696.8 1283.9L696.3 1272.8L687.6 1280.0L691.4 1297.0L670.4 1293.4L652.9 1300.8L628.9 1297.5L622.9 1312.5L607.2 1312.3L601.8 1319.4L605.7 1324.0L596.7 1322.9L589.4 1333.5L583.9 1333.5L586.3 1325.9L557.0 1332.6L551.5 1318.4L544.5 1318.4L550.6 1311.8L546.7 1307.9L534.6 1311.7L515.8 1301.7L511.6 1308.3L497.5 1299.7L497.6 1315.0L500.9 1316.8L501.8 1326.2L497.7 1335.7L492.9 1336.2L485.6 1348.9L468.9 1354.6L475.1 1333.2L460.8 1339.8L457.9 1329.9L460.7 1328.7L460.3 1322.1L450.1 1317.0L447.2 1305.8L436.6 1309.2L430.0 1305.7L428.7 1297.7L421.5 1307.4L408.5 1301.6L413.2 1294.8L423.9 1295.2L433.4 1283.4L446.5 1287.8L453.0 1281.3L458.3 1290.5L459.6 1283.9L464.4 1283.8L463.2 1268.8L457.8 1264.3L465.0 1259.0L458.9 1250.0L461.9 1248.0L462.5 1238.2L459.4 1234.4L465.4 1223.9L466.0 1209.6L459.8 1195.4L457.8 1177.9L447.3 1160.7L455.2 1152.1L454.5 1147.0L469.8 1146.5L477.1 1140.4L475.9 1137.2L485.1 1135.4L483.3 1121.3L486.4 1120.7L479.0 1111.0L480.8 1104.0L488.3 1106.6L489.5 1113.0L495.7 1105.4L499.3 1106.1L496.3 1111.8L505.5 1107.5L496.3 1092.5L500.6 1086.2L498.2 1079.7L501.3 1072.1L498.2 1069.4L501.3 1064.3L490.1 1048.4L478.8 1046.7L478.7 1037.7L473.7 1036.6L479.2 1028.8L464.7 1018.8L465.9 1009.9L463.4 1009.3L468.1 1005.0L466.9 997.1L462.5 995.2L465.0 993.2L463.0 988.2L469.2 985.5L461.6 976.6L464.5 965.7L460.1 965.8L458.1 959.4L452.7 970.4L445.9 971.1L442.1 968.6L441.8 952.5L435.7 959.7L431.3 957.8L437.3 948.1L429.4 927.5L422.1 934.7L419.4 927.6L413.3 934.8L410.2 932.2L412.8 916.6L403.7 918.0L403.9 924.5L397.0 916.8L382.8 918.2L374.8 925.2L383.5 927.2L379.8 928.5L382.4 931.7L386.0 927.2L388.6 933.0L386.9 941.4L375.6 939.4L367.0 952.9L355.1 953.5L349.3 948.4L353.7 941.3L351.7 933.0L359.1 923.9L354.1 921.4L357.1 915.0L352.7 915.7L352.6 906.7L346.3 906.2L344.8 881.3L348.6 880.5L346.5 872.3L340.8 870.5L345.0 860.1L356.4 857.9L360.2 859.0L359.8 864.2L367.2 853.7L382.4 856.6L387.0 865.7L397.9 863.6L399.4 850.5L396.3 849.3L395.8 837.6L413.3 839.3L410.7 836.7L412.5 832.8L422.5 825.5L422.7 807.2L437.6 810.3L445.9 806.3L458.6 785.3L465.0 784.0Z" },
|
||||
{ id: "DE-BE", name: "Berlin", d: "M795.3 428.3L801.2 430.4L802.8 422.7L807.4 423.4L808.9 417.7L818.0 423.7L829.5 418.8L827.5 416.8L830.3 414.3L835.4 420.2L833.8 429.2L850.1 439.9L845.1 450.1L861.5 455.7L849.8 472.8L848.6 466.3L830.9 463.3L829.7 458.8L824.3 460.6L824.8 466.4L805.2 458.8L793.1 464.4L787.9 459.1L796.9 443.8L791.0 441.1L795.3 428.3Z" },
|
||||
{ id: "DE-BB", name: "Brandenburg", d: "M873.6 270.6L877.7 284.6L913.0 283.2L912.5 293.5L897.7 312.3L914.9 312.8L921.6 303.4L932.6 301.1L935.7 312.2L926.8 326.4L929.1 334.0L926.7 344.5L902.3 364.5L903.8 378.7L900.0 385.5L924.0 399.6L937.6 417.4L956.5 430.8L952.3 439.0L955.6 444.9L944.4 462.8L950.5 477.6L949.0 481.3L963.1 489.8L959.8 510.6L967.6 519.0L961.0 548.2L950.6 560.1L967.3 589.7L967.5 600.7L961.5 601.4L959.3 609.9L948.9 606.1L924.1 618.6L903.5 610.9L896.8 619.3L898.5 622.1L892.2 622.1L895.5 627.8L888.4 640.6L883.7 636.3L862.7 642.7L838.8 641.3L823.6 626.7L820.9 631.8L814.4 629.1L808.9 638.6L803.1 636.5L802.0 630.7L798.7 631.2L802.3 617.8L799.9 608.8L784.6 593.0L799.4 581.1L792.7 558.4L795.4 554.0L782.9 554.3L783.7 549.2L775.8 549.0L774.6 543.2L762.7 543.6L762.2 537.8L755.6 538.9L743.2 530.3L728.6 535.2L720.8 526.0L716.1 529.1L692.7 503.0L701.5 493.5L696.3 488.2L703.2 472.2L700.6 469.6L702.7 461.9L699.4 459.9L705.6 449.1L695.1 441.2L691.0 446.2L687.7 444.3L689.7 439.8L685.0 441.0L689.2 432.7L688.0 423.6L695.4 423.1L694.9 412.8L690.9 408.2L692.4 397.9L697.2 394.1L694.7 383.1L651.8 374.6L649.9 371.4L652.6 366.9L635.1 362.1L634.5 356.9L628.5 356.2L629.2 351.0L616.3 350.2L609.6 344.3L597.4 348.7L589.3 340.2L602.9 339.0L602.9 333.9L618.5 336.6L622.6 329.6L621.3 321.1L628.8 316.0L650.5 318.9L647.2 314.4L671.7 305.7L674.5 294.0L687.3 299.4L694.1 296.3L697.4 302.2L712.2 305.7L717.5 314.9L741.7 314.1L742.3 318.6L751.7 319.5L749.6 324.0L752.3 326.0L775.2 323.9L771.7 328.3L775.7 330.4L790.9 316.5L797.6 314.7L802.9 320.7L810.6 309.9L821.9 315.3L825.5 306.4L835.1 302.8L837.6 288.6L845.7 286.9L855.0 274.3L868.1 271.4L862.8 268.7L863.8 261.0L866.9 268.2L873.6 270.6ZM830.3 414.3L827.5 416.8L829.5 418.8L818.0 423.7L808.9 417.7L807.4 423.4L802.8 422.7L801.2 430.4L792.6 430.2L795.2 433.5L791.0 441.1L796.9 443.8L788.5 461.1L793.1 464.4L811.1 459.6L824.8 466.4L824.3 460.6L829.7 458.8L830.9 463.3L848.6 466.3L849.8 472.8L858.7 462.1L860.9 453.7L845.1 450.1L850.1 439.9L833.8 429.2L835.4 420.2L830.3 414.3Z" },
|
||||
{ id: "DE-HB", name: "Bremen", d: "M339.7 335.5L335.7 336.2L340.5 340.6L337.2 342.0L339.4 349.1L334.2 355.1L326.7 350.1L321.5 353.6L316.6 347.9L312.0 351.3L300.5 329.0L285.3 318.0L297.5 320.0L297.0 325.3L322.7 328.8L326.2 333.9L335.5 330.4L339.7 335.5Z" },
|
||||
{ id: "DE-HH", name: "Hamburg", d: "M458.2 232.8L472.0 228.9L466.0 237.9L475.3 247.5L467.2 261.0L486.5 280.1L477.4 287.4L469.7 286.8L456.2 275.3L449.9 283.1L440.1 283.9L441.5 278.0L435.2 281.3L424.6 267.8L425.1 259.4L420.2 258.8L424.2 246.6L431.3 254.2L440.2 242.6L458.3 237.9L458.2 232.8Z" },
|
||||
{ id: "DE-HE", name: "Hessen", d: "M395.7 595.8L409.8 594.8L416.5 604.2L405.7 614.7L411.6 623.5L411.8 632.5L403.6 637.3L402.6 645.1L421.0 653.4L425.4 646.1L421.6 649.4L418.3 641.2L430.7 633.4L436.1 640.4L434.7 633.4L440.7 632.7L447.5 655.9L456.6 657.3L458.7 666.3L476.2 673.0L473.7 685.2L469.2 679.3L464.0 681.2L469.9 685.2L466.7 696.1L474.5 701.3L467.4 706.4L455.1 703.1L452.5 708.9L457.8 714.7L444.7 714.7L444.8 718.5L449.3 716.6L448.1 721.8L452.0 719.2L457.2 725.7L452.7 728.9L452.8 734.7L444.9 736.6L445.6 743.7L441.8 746.9L443.7 751.4L436.5 768.0L444.5 770.0L445.1 762.9L455.7 761.8L459.8 769.6L454.5 772.8L457.3 782.7L454.7 793.8L446.5 805.7L433.7 810.4L424.0 805.9L421.9 827.5L412.5 832.8L410.7 836.7L413.3 839.3L395.8 837.6L396.3 849.3L399.4 850.5L397.9 863.6L387.0 865.7L382.4 856.6L367.2 853.7L359.8 864.2L360.2 859.0L356.4 857.9L343.1 863.4L340.8 871.8L346.5 872.3L348.6 880.5L344.8 881.3L346.3 906.2L352.6 906.7L352.7 915.7L357.1 915.0L354.1 921.4L359.1 923.9L351.7 933.0L353.7 941.3L349.3 945.2L353.2 952.2L351.4 958.6L355.8 963.1L336.3 964.5L336.4 973.4L321.4 983.3L322.5 970.6L328.2 971.1L330.6 964.7L311.7 962.8L306.6 952.9L308.3 944.5L297.7 946.9L300.4 957.6L293.0 962.5L275.1 946.2L271.7 933.5L285.2 920.0L278.9 920.4L274.3 911.0L275.5 905.8L270.3 900.2L270.0 886.7L262.2 876.8L252.7 874.0L219.9 884.8L208.7 870.4L218.0 857.3L225.8 861.8L226.3 855.3L221.0 850.1L223.4 844.2L232.9 838.8L237.4 842.7L240.5 839.3L237.8 832.9L247.3 832.0L241.2 814.6L230.5 807.7L235.5 801.7L231.8 795.3L233.4 788.1L238.4 782.7L249.9 783.7L251.1 775.2L245.1 762.1L251.8 751.7L246.6 741.9L262.3 726.3L273.7 730.2L283.6 721.1L283.2 712.1L292.7 703.4L288.6 699.0L290.9 689.1L312.3 687.2L309.6 682.7L317.8 670.1L314.3 660.5L297.8 662.9L294.8 655.9L309.0 640.5L336.7 638.3L337.9 631.1L334.6 631.2L331.7 622.2L340.3 617.4L352.9 619.0L353.7 628.7L366.2 625.7L382.6 602.6L378.8 598.9L394.3 591.4L395.7 595.8Z" },
|
||||
{ id: "DE-MV", name: "Mecklenburg-Vorpommern", d: "M725.3 99.5L740.0 106.8L773.6 107.7L756.1 112.8L738.0 109.9L731.5 113.6L733.3 117.1L716.1 117.9L707.9 130.5L710.4 135.2L708.2 137.5L718.8 140.6L713.2 135.1L727.0 124.9L728.9 117.8L733.1 121.6L741.6 115.8L740.3 112.8L746.6 113.5L745.5 115.1L748.7 119.3L754.4 114.9L757.0 123.8L779.8 107.4L780.4 114.8L787.9 120.0L785.9 123.7L789.2 134.8L808.9 142.9L815.4 152.4L812.4 156.0L823.0 153.3L819.4 159.0L822.5 156.6L827.5 168.0L832.3 169.0L831.0 162.3L853.6 153.9L865.7 165.8L858.8 178.7L877.4 197.3L867.6 207.1L879.9 199.7L876.5 185.6L883.0 185.5L882.4 195.3L885.0 190.3L891.4 193.9L891.9 184.4L883.9 172.7L877.0 172.6L878.5 177.6L871.7 183.9L873.6 176.8L871.3 175.4L861.6 180.5L866.3 166.6L859.4 156.1L865.3 152.7L872.7 166.1L888.3 174.3L910.9 196.0L907.1 198.5L910.5 207.2L891.0 205.8L875.7 211.7L865.6 208.5L891.0 226.4L917.6 229.1L910.2 235.5L916.5 236.1L918.3 247.5L922.2 250.1L919.8 263.4L927.7 277.8L932.1 300.4L921.6 303.4L914.9 312.8L897.7 312.3L912.5 293.5L913.0 283.2L877.7 284.6L873.6 270.3L866.9 268.2L863.8 261.0L862.8 268.7L868.1 271.4L855.0 274.3L845.7 286.9L837.6 288.6L835.1 302.8L825.5 306.4L821.9 315.3L810.6 309.9L802.9 320.7L797.6 314.7L790.9 316.5L775.7 330.4L771.7 328.3L775.2 323.9L752.3 326.0L749.6 324.0L751.7 319.5L742.3 318.6L741.7 314.1L717.5 314.9L712.2 305.7L697.4 302.2L694.1 296.3L687.3 299.4L674.5 294.0L671.7 305.7L663.5 311.4L657.4 310.0L654.6 315.1L647.2 314.4L650.5 318.9L641.0 320.7L628.8 316.0L619.9 322.4L622.6 329.6L618.5 336.6L602.9 333.9L601.5 339.0L579.8 334.2L581.2 326.4L567.0 317.8L558.8 299.5L550.7 296.7L541.9 304.0L527.6 291.8L515.6 292.8L520.1 276.8L540.3 267.8L540.2 256.8L551.1 255.9L553.7 239.9L533.0 227.0L531.6 211.5L534.2 204.5L545.9 196.3L548.7 201.0L555.5 199.3L547.2 197.0L548.0 191.5L579.0 181.1L587.7 186.4L587.7 195.3L596.0 191.0L609.1 201.1L612.2 189.3L607.9 190.7L608.0 184.3L606.2 190.6L601.8 189.8L600.7 184.3L613.2 179.8L610.5 188.3L613.0 189.3L616.1 178.2L621.9 178.1L627.7 168.2L625.3 165.9L617.6 175.3L616.8 171.3L633.9 157.1L652.6 158.5L678.1 151.9L678.6 157.3L682.2 157.7L684.1 153.8L679.0 152.3L705.6 132.0L725.3 99.5ZM824.5 64.7L818.7 73.3L823.6 83.3L851.8 85.9L850.6 93.2L839.8 103.5L844.2 113.4L851.1 114.1L861.3 124.4L855.9 129.8L856.8 136.2L848.2 132.2L854.5 127.0L844.3 128.8L852.2 123.0L844.6 126.3L841.0 122.4L827.3 125.4L820.7 136.6L816.1 136.9L823.3 139.5L820.6 145.4L809.3 140.1L812.7 141.2L814.2 135.4L807.1 139.7L799.4 136.8L798.8 132.2L792.8 134.7L797.8 131.4L790.2 126.1L791.6 119.2L806.2 117.2L800.7 109.0L794.0 109.2L806.9 100.4L802.5 99.3L802.8 94.9L795.0 96.1L793.3 88.7L805.5 87.8L811.0 94.4L810.1 87.7L817.9 83.0L814.5 88.3L818.8 86.5L822.7 97.9L832.9 100.1L832.4 88.4L820.8 84.1L818.1 76.9L804.2 86.6L808.5 71.4L795.2 86.5L804.9 69.0L824.5 64.7ZM797.7 97.8L802.4 102.3L790.8 106.8L797.7 97.8ZM792.5 78.5L794.9 83.0L789.7 82.2L790.4 90.3L784.6 104.2L788.3 81.1L792.5 78.5Z" },
|
||||
{ id: "DE-NI", name: "Niedersachsen", d: "M306.5 202.6L314.8 211.2L328.6 213.7L343.1 212.3L351.8 204.0L372.7 206.5L396.6 235.8L401.0 249.2L425.1 259.4L424.6 267.8L435.2 281.3L439.3 276.1L442.2 280.0L440.1 283.9L448.5 283.8L456.2 275.3L469.7 286.8L486.5 280.8L513.6 293.4L527.6 291.8L541.9 304.0L552.0 296.7L558.8 299.5L567.0 317.8L581.2 326.4L579.8 334.2L588.6 335.6L595.4 347.4L609.6 344.3L625.1 352.3L621.0 358.7L615.6 358.0L614.9 368.3L594.5 379.7L564.0 372.9L558.6 374.1L553.2 383.6L534.0 383.6L537.2 406.4L541.2 405.9L550.9 426.2L557.1 423.5L552.3 433.3L560.6 446.2L553.8 446.1L552.5 451.9L568.1 466.8L558.1 473.1L569.5 492.5L561.7 497.5L566.9 502.7L565.0 508.4L553.9 513.4L556.7 521.8L525.8 522.5L511.8 530.0L521.9 538.6L517.2 541.8L521.9 548.3L513.3 557.6L513.4 569.5L519.3 573.9L527.3 593.7L520.2 598.0L522.9 608.6L516.4 605.4L507.3 609.9L491.6 603.9L488.6 614.9L476.3 623.9L471.8 621.9L466.0 628.9L468.0 630.9L456.3 629.5L444.2 639.7L440.7 632.7L434.7 633.4L436.1 640.4L430.7 633.4L418.3 641.2L421.6 649.4L425.4 646.1L421.0 653.4L402.6 645.1L403.6 637.3L411.8 632.5L411.6 623.5L405.7 614.7L416.5 604.2L409.8 594.8L383.0 593.0L385.9 584.0L383.7 573.8L390.5 567.8L389.0 559.5L392.1 556.9L378.5 557.2L379.6 550.0L371.6 544.4L372.0 537.2L360.8 535.5L363.3 532.2L360.5 525.8L362.3 519.3L356.3 515.5L358.8 510.3L343.5 508.7L339.9 497.8L346.6 500.2L345.7 493.1L349.6 491.7L337.4 482.9L354.7 461.7L351.8 454.6L356.3 448.7L351.6 444.9L346.9 444.4L334.8 461.6L325.6 463.8L309.6 462.9L309.0 444.1L303.5 439.1L287.6 442.2L279.4 453.4L265.4 451.3L266.4 460.9L280.6 468.3L283.5 476.6L280.9 494.8L289.0 499.1L276.3 512.4L261.6 508.3L253.6 518.9L235.7 519.8L229.4 525.4L219.7 516.7L233.2 511.7L234.1 501.6L221.3 497.1L227.3 483.6L224.4 478.6L230.9 477.5L225.4 467.6L201.6 461.8L198.7 452.3L190.0 448.9L186.2 456.7L189.5 458.5L187.1 466.3L155.7 485.8L130.8 489.4L126.3 480.5L131.7 465.1L123.8 450.0L117.7 455.7L91.9 447.5L88.6 435.0L97.8 433.4L93.0 429.0L95.1 419.2L128.8 421.1L133.4 384.5L151.6 358.2L151.1 340.6L147.9 336.1L155.0 329.4L154.1 323.0L152.8 317.1L145.5 316.2L150.3 300.4L126.0 299.3L122.9 294.9L128.5 269.4L126.8 265.0L137.7 265.1L132.9 257.5L140.3 248.5L157.7 238.9L180.9 240.9L233.9 234.1L237.1 246.1L244.2 246.0L251.0 261.3L249.1 268.4L239.3 269.7L240.2 276.9L259.7 288.3L266.7 276.6L266.7 266.9L257.4 267.2L261.9 251.7L288.5 261.0L293.0 266.3L288.9 270.6L294.5 267.6L284.9 237.0L293.1 212.7L306.5 202.6ZM288.9 323.7L300.5 329.0L312.0 351.3L316.6 347.9L321.5 353.6L326.7 350.1L334.2 355.1L339.4 349.1L337.2 342.0L340.5 340.6L335.7 336.2L339.7 335.5L335.5 330.4L326.2 333.9L322.7 328.8L297.0 325.3L297.5 320.0L285.3 318.0L288.9 323.7ZM286.6 195.8L288.4 198.2L285.4 198.8L286.6 195.8ZM233.2 221.1L234.6 228.2L230.8 223.8L233.2 221.1ZM220.8 219.6L228.7 223.0L215.4 220.9L220.8 219.6ZM200.2 222.1L211.0 223.0L195.9 225.8L200.2 222.1ZM185.7 226.0L191.6 227.6L174.1 231.3L176.0 226.4L185.7 226.0ZM166.1 230.0L170.0 231.6L162.4 231.3L166.1 230.0ZM157.6 231.9L160.5 232.4L138.2 235.1L157.6 231.9ZM129.5 238.7L133.6 239.3L107.2 242.7L129.5 238.7ZM112.3 244.0L111.9 248.8L108.3 246.6L112.3 244.0ZM97.1 250.1L102.5 252.9L92.7 256.2L95.8 260.9L82.8 253.7L97.1 250.1Z" },
|
||||
{ id: "DE-NW", name: "Nordrhein-Westfalen", d: "M304.9 440.3L309.0 444.1L309.6 462.9L313.0 464.1L334.8 461.6L346.9 444.4L355.6 447.4L350.9 469.6L344.4 471.7L337.4 482.9L349.6 491.7L345.7 493.1L346.6 500.2L339.9 497.8L343.5 508.7L358.8 510.3L356.3 515.5L362.3 519.3L360.5 525.8L363.3 532.2L360.8 535.5L372.0 537.2L371.6 544.4L379.6 550.0L378.5 557.2L392.1 556.9L389.0 559.5L390.5 567.8L383.2 576.4L385.9 584.0L383.0 593.0L390.6 593.4L378.8 598.9L382.6 602.6L366.2 625.7L353.7 628.7L353.5 619.6L345.9 615.3L331.7 622.2L334.6 631.2L337.9 631.1L336.7 638.3L309.0 640.5L301.2 647.2L294.3 657.8L297.8 662.9L312.9 658.6L317.8 670.1L309.6 682.7L312.3 687.2L290.9 689.1L288.6 699.0L292.7 703.4L283.2 712.1L283.6 721.1L273.7 730.2L262.3 726.3L246.6 741.9L251.8 751.0L248.9 758.8L238.0 758.0L229.4 744.9L229.4 732.6L214.1 726.4L216.3 718.5L210.3 715.6L203.4 719.9L206.7 732.6L195.3 737.1L198.2 742.1L195.2 746.2L164.7 755.2L160.3 769.0L147.0 771.8L146.1 767.4L139.6 776.2L129.3 775.6L115.7 783.5L115.9 788.0L110.9 789.0L112.8 799.3L108.5 802.1L101.7 795.3L96.1 798.2L102.3 818.8L91.1 822.3L87.6 816.3L84.0 821.0L80.2 813.3L63.1 821.6L64.2 817.0L56.7 812.8L58.0 823.6L51.1 813.6L54.9 802.1L50.0 793.8L38.4 792.3L32.8 783.9L44.4 772.4L32.9 771.5L33.0 765.1L27.0 756.4L17.1 753.5L15.3 744.8L10.0 741.3L17.0 737.9L16.2 732.6L22.1 732.3L23.1 719.3L15.7 717.3L17.3 708.6L3.5 709.5L0.0 696.8L10.7 699.7L15.7 689.3L32.7 679.1L29.8 675.5L35.1 672.3L24.0 675.2L22.5 663.1L39.3 642.0L37.5 615.8L23.9 600.4L27.0 590.8L18.3 587.8L19.5 581.0L10.1 576.7L14.5 572.1L11.0 561.0L21.5 555.2L32.4 558.7L25.7 551.0L31.3 548.2L59.5 562.1L57.9 553.5L66.4 557.0L89.5 545.6L95.0 549.3L105.5 537.7L105.1 532.5L90.2 524.7L90.4 518.9L95.0 518.7L97.8 510.7L109.6 509.5L122.6 491.9L140.5 485.1L155.7 485.8L187.1 466.3L189.5 458.5L186.2 456.7L190.0 448.9L198.7 452.3L201.6 461.8L225.4 467.6L230.9 477.5L224.4 478.6L227.3 483.6L221.3 497.1L234.9 503.5L232.2 504.5L233.2 511.7L219.7 516.7L223.3 523.1L253.6 518.9L261.6 508.3L276.3 512.4L289.0 499.1L280.9 494.8L283.5 476.6L280.6 468.3L266.4 460.9L264.7 451.9L279.4 453.4L287.6 442.2L304.9 440.3Z" },
|
||||
{ id: "DE-RP", name: "Rheinland-Pfalz", d: "M210.3 715.6L216.3 718.5L214.1 726.4L229.4 732.6L229.4 744.9L238.0 758.0L245.4 757.5L247.6 773.2L251.2 776.5L247.6 786.4L238.4 782.7L233.4 788.1L231.8 795.3L235.5 801.7L230.5 807.7L241.2 814.6L247.3 832.0L237.8 832.9L240.5 839.3L237.4 842.7L232.9 838.8L223.4 844.2L221.0 850.1L226.3 855.3L225.8 861.8L218.0 857.3L208.7 870.4L219.9 884.8L260.3 874.9L270.0 886.7L270.3 900.2L275.5 905.8L274.3 911.0L278.9 920.4L285.2 920.0L271.7 933.5L279.0 951.7L277.9 957.6L283.2 971.3L280.8 975.3L287.7 976.8L282.9 985.4L286.6 985.2L286.1 990.9L281.3 995.7L285.8 1001.2L275.0 1011.5L271.7 1036.3L258.5 1059.0L242.2 1055.5L225.3 1043.8L217.7 1047.8L210.4 1042.5L196.3 1045.6L181.0 1036.7L176.7 1024.3L161.7 1023.9L155.0 1010.9L165.2 1002.7L167.8 987.9L155.1 984.5L151.0 977.0L157.0 970.3L154.2 964.6L157.1 959.3L154.0 958.8L152.9 950.5L146.8 954.0L126.6 941.1L80.4 963.1L55.3 958.3L53.7 953.7L59.5 946.2L60.3 937.7L70.4 927.6L71.6 913.0L58.2 911.0L53.6 905.0L48.1 908.3L47.7 903.1L39.9 898.4L37.9 888.1L31.8 887.7L24.7 869.2L30.0 849.4L34.7 846.7L32.6 838.5L44.1 833.5L46.9 824.2L60.0 823.6L55.5 813.5L64.2 817.0L63.1 821.6L80.2 813.3L84.0 821.0L87.6 816.3L91.1 822.3L102.3 818.8L96.1 798.2L101.7 795.3L108.5 802.1L112.8 799.3L110.9 789.0L115.9 788.0L115.7 783.5L129.3 775.6L139.6 776.2L146.1 767.4L147.0 771.8L160.3 769.0L164.7 755.2L195.2 746.2L198.2 742.1L195.3 737.1L206.7 732.6L203.4 719.9L210.3 715.6Z" },
|
||||
{ id: "DE-SL", name: "Saarland", d: "M127.2 941.7L146.8 954.0L152.9 950.5L154.0 958.8L157.1 959.3L154.2 964.6L157.0 970.3L151.0 977.0L155.1 984.5L167.8 987.9L165.2 1002.7L155.0 1010.9L162.7 1028.4L144.7 1033.6L133.8 1026.8L129.4 1034.0L126.8 1020.9L114.8 1014.8L105.7 1016.3L107.9 1022.5L105.0 1027.3L94.5 1025.0L86.9 1004.8L75.7 992.8L79.4 989.8L72.4 978.1L61.1 971.1L52.7 972.7L54.5 958.3L80.4 963.1L116.5 942.4L127.2 941.7Z" },
|
||||
{ id: "DE-SN", name: "Sachsen", d: "M764.3 588.7L772.7 594.6L779.4 589.6L788.4 600.1L796.2 601.6L795.4 608.0L802.4 614.6L798.7 631.2L802.0 630.7L803.1 636.5L808.9 638.6L814.4 629.1L820.9 631.8L823.6 626.7L838.8 641.3L862.7 642.7L883.7 636.3L888.4 640.6L895.5 627.8L892.2 622.1L898.5 622.1L896.8 619.3L903.5 610.9L924.1 618.6L948.9 606.1L959.3 609.9L962.1 601.4L967.4 614.5L986.1 619.9L991.9 626.8L992.3 644.0L998.9 651.8L1000.0 663.9L988.2 707.2L976.2 724.5L974.6 735.4L953.5 730.9L957.8 717.4L947.9 719.0L951.7 707.7L941.6 702.8L941.5 696.7L940.3 702.1L930.1 704.2L918.8 696.3L913.7 710.3L930.5 715.7L927.4 725.1L914.5 725.5L893.1 740.4L881.8 739.8L875.3 743.4L875.7 750.4L870.5 754.7L837.5 755.6L835.0 769.1L828.4 775.9L818.6 767.7L813.3 778.4L804.8 776.6L799.0 792.6L781.3 791.2L780.7 801.5L775.2 807.6L759.0 799.9L745.5 810.5L735.7 806.7L724.9 810.0L722.4 818.9L708.3 831.6L704.3 848.4L699.4 847.9L699.6 840.1L694.1 835.6L696.2 831.7L689.8 831.1L689.7 823.5L681.6 825.2L665.9 817.7L666.8 811.2L656.9 802.2L664.0 800.2L665.4 794.4L655.3 784.7L670.5 768.5L672.8 782.7L686.5 778.7L685.5 769.7L699.2 768.4L705.4 759.9L695.0 749.7L701.6 743.4L697.1 736.3L717.8 732.3L722.5 723.5L741.3 718.3L736.4 705.4L727.3 705.1L728.7 700.7L725.4 701.9L724.9 694.2L719.8 690.2L693.9 685.9L695.9 682.7L691.3 680.7L692.7 673.7L688.8 673.6L692.2 667.9L685.9 649.9L690.5 648.1L690.7 632.1L685.6 624.9L691.5 621.2L690.3 614.7L695.7 607.1L764.3 588.7Z" },
|
||||
{ id: "DE-ST", name: "Sachsen-Anhalt", d: "M628.5 354.9L634.5 356.9L635.1 362.1L652.6 366.9L649.9 371.4L651.8 374.6L694.7 383.1L697.2 394.1L692.4 397.9L690.9 408.2L694.9 412.8L695.4 423.1L688.0 423.6L689.2 432.7L685.0 441.0L689.7 439.8L687.7 444.3L691.0 446.2L695.1 441.2L705.6 449.1L699.4 459.9L702.7 461.9L700.6 469.6L703.2 472.2L696.3 488.2L701.5 493.5L692.7 503.0L699.2 514.0L716.1 529.1L722.1 526.7L728.6 535.2L743.2 530.3L755.6 538.9L762.2 537.8L762.7 543.6L774.6 543.2L775.8 549.0L783.7 549.2L782.9 554.3L795.4 554.0L792.7 558.4L799.4 581.1L781.9 594.8L779.4 589.6L772.7 594.6L760.4 587.3L754.4 593.6L744.6 590.8L739.2 598.4L695.7 607.1L691.0 613.5L691.5 621.2L685.6 624.9L690.7 632.1L690.5 648.1L685.9 649.9L692.2 667.9L688.8 673.6L692.7 673.7L691.3 680.7L695.9 682.7L693.9 685.9L701.0 689.2L697.0 698.1L702.1 699.4L694.1 715.2L689.7 708.8L670.7 710.5L666.2 706.0L667.6 702.8L655.9 695.0L642.8 698.2L632.5 685.9L611.0 686.6L611.1 672.3L599.4 667.2L611.9 653.6L603.5 645.9L602.9 638.8L595.1 634.3L558.6 633.1L560.6 631.2L556.0 630.6L556.7 622.1L552.8 618.9L554.1 612.4L547.0 604.7L552.9 602.0L551.6 598.1L527.3 593.7L519.3 573.9L513.4 569.5L513.3 557.6L521.9 548.3L517.2 541.8L521.9 538.6L514.5 535.2L512.5 528.7L519.2 529.5L525.8 522.5L556.7 521.8L553.9 513.4L565.0 508.4L566.9 502.7L561.7 497.5L569.5 492.5L558.1 473.1L568.1 466.8L552.5 451.9L553.8 446.1L560.6 446.2L552.3 433.3L557.1 423.5L550.9 426.2L541.2 405.9L537.2 406.4L534.0 383.6L553.2 383.6L558.6 374.1L564.0 372.9L594.5 379.7L614.9 368.3L616.3 357.3L630.5 352.3L628.5 354.9Z" },
|
||||
{ id: "DE-SH", name: "Schleswig-Holstein", d: "M567.1 90.8L585.0 95.6L593.7 113.8L572.4 113.8L569.8 106.3L560.5 107.0L561.4 97.8L567.1 90.8ZM276.6 2.2L280.5 7.1L270.8 15.5L272.2 26.8L279.1 31.1L320.8 24.3L365.8 34.9L372.1 44.2L385.9 37.5L388.8 46.6L408.2 31.4L407.1 39.1L427.7 45.1L433.3 52.2L440.1 50.9L440.3 45.1L445.5 48.1L454.2 66.8L448.5 61.8L443.6 66.7L443.1 74.6L425.3 82.8L419.9 91.9L423.0 88.7L443.6 75.3L444.7 66.6L454.1 67.3L453.4 88.0L433.0 102.5L436.0 106.0L464.3 99.4L472.1 104.5L468.8 108.3L471.3 116.0L466.5 119.6L464.8 129.7L470.5 126.8L469.8 121.0L475.3 111.9L485.1 108.0L516.2 120.7L527.3 130.8L536.4 129.6L551.7 117.4L573.4 115.8L565.9 122.2L569.7 149.4L546.3 168.4L538.2 167.1L532.3 175.3L536.2 184.4L546.2 186.2L547.2 197.0L555.5 199.3L548.7 201.0L545.9 196.3L534.2 204.5L531.6 211.5L533.0 227.0L553.7 239.9L551.1 255.9L540.2 256.8L540.3 267.8L520.1 276.8L518.2 289.6L513.6 293.4L485.2 280.8L487.1 277.6L468.7 264.8L467.8 255.2L473.4 254.6L471.8 249.4L475.3 247.5L466.0 237.9L472.1 230.8L469.9 227.6L459.5 230.9L458.3 237.9L450.6 237.4L449.3 243.1L440.2 242.6L431.3 254.2L424.2 246.6L420.2 258.8L414.8 257.7L401.0 249.2L396.6 235.8L372.7 206.5L335.9 200.8L321.6 179.6L337.4 177.7L339.7 173.1L333.4 160.9L325.9 162.5L320.3 153.3L323.4 140.0L330.7 138.5L336.0 129.4L326.2 137.0L324.2 133.6L324.5 138.1L322.0 133.1L302.6 136.4L295.4 129.9L298.2 121.5L307.0 121.7L298.6 116.6L326.7 113.5L343.9 101.4L339.3 93.2L331.3 103.4L320.2 102.0L320.0 97.2L327.3 91.9L329.3 80.7L320.9 79.9L324.0 76.8L321.9 71.4L307.2 56.8L307.8 49.9L296.6 29.8L277.6 36.4L266.0 31.7L268.5 33.6L264.9 35.8L264.8 54.7L262.7 53.0L264.7 25.6L276.6 2.2ZM418.4 93.5L400.8 95.2L403.9 101.1L409.4 94.8L419.3 98.3L417.7 94.2L418.4 93.5ZM277.1 1.2L277.7 0.0L282.7 1.9L277.1 1.2ZM307.7 86.9L305.5 97.8L296.5 94.8L307.7 86.9ZM291.1 52.3L297.1 58.6L294.0 65.5L275.5 61.0L278.2 54.5L291.1 52.3ZM292.3 83.0L294.7 86.6L287.7 83.9L292.3 83.0ZM284.2 100.9L289.6 108.4L283.5 110.4L281.3 105.1L284.2 100.9ZM284.3 88.8L287.3 91.4L283.7 97.5L284.3 88.8ZM284.9 82.1L286.9 86.7L281.9 86.6L284.9 82.1ZM271.1 60.0L269.2 63.9L275.3 77.3L264.1 67.7L271.1 60.0Z" },
|
||||
{ id: "DE-TH", name: "Thüringen", d: "M534.6 593.5L552.9 600.1L547.0 604.7L554.1 612.4L552.8 618.9L556.7 622.1L556.0 630.6L560.6 631.2L558.6 633.1L595.1 634.3L602.9 638.8L603.5 645.9L611.9 653.6L599.4 667.2L611.1 672.3L613.0 676.9L609.0 680.7L612.9 687.8L632.5 685.9L642.8 698.2L655.9 695.0L667.6 702.8L666.2 706.0L670.7 710.5L689.7 708.8L693.5 715.2L702.1 701.3L697.0 698.1L701.0 689.2L719.8 690.2L724.9 694.2L725.4 701.9L728.7 700.7L727.3 705.1L736.4 705.4L741.2 719.0L722.5 723.5L717.8 732.3L697.1 736.3L701.6 743.4L695.0 749.7L699.0 749.7L698.8 757.4L704.6 762.5L699.2 768.4L691.4 767.1L690.6 771.6L686.1 769.1L684.6 777.5L687.2 778.1L675.4 782.7L671.6 780.8L671.8 769.7L667.2 770.4L661.2 782.1L655.3 784.7L665.4 795.0L662.8 795.7L664.0 800.2L656.9 802.2L661.3 804.8L654.2 809.3L649.1 811.3L644.7 806.1L616.4 814.7L612.0 804.3L608.2 806.3L605.0 801.1L606.4 790.1L597.4 788.9L594.8 794.7L586.5 796.7L590.2 816.1L586.9 833.5L575.0 829.7L576.9 822.6L571.8 816.2L564.3 820.1L559.3 816.2L559.3 820.1L553.0 811.8L546.1 811.1L528.6 818.3L529.9 824.8L543.1 832.5L543.1 837.6L530.5 836.4L529.9 844.9L517.8 841.1L516.4 822.2L504.2 818.3L500.3 809.9L493.3 811.2L494.6 806.0L486.8 793.7L464.3 781.4L454.7 789.9L457.3 782.7L454.5 772.8L459.8 771.6L455.7 761.8L445.1 762.9L444.5 770.0L436.5 768.0L443.7 751.4L441.8 746.9L445.6 743.7L444.9 736.6L452.8 734.7L452.7 728.9L457.2 725.7L452.0 719.2L448.1 721.8L449.3 716.6L444.8 718.5L444.7 714.7L457.8 714.7L452.5 708.9L455.1 703.1L472.6 705.2L472.6 698.1L466.7 696.1L469.9 685.2L464.0 681.2L469.2 679.3L473.7 685.2L476.2 674.2L458.7 666.3L456.6 657.3L447.5 655.9L442.2 641.0L456.3 629.5L468.0 630.9L466.0 628.9L471.8 621.9L483.4 620.0L490.5 612.3L491.6 603.9L522.3 609.4L520.2 598.0L534.6 593.5Z" },
|
||||
];
|
||||
|
||||
/**
|
||||
* Die Elbe als Mittellinie, gezeichnet mit einem Strich statt als Fläche.
|
||||
*
|
||||
* Als Uferflächen zerfällt der Fluss in Hamburg in dutzende Einzelpolygone
|
||||
* (Norderelbe, Süderelbe, Hafenbecken). Behält man nur die größten, klaffen
|
||||
* dazwischen Lücken und der Fluss wirkt abgeschnitten. Die Mittellinie ist
|
||||
* durchgehend und passt zur reduzierten Darstellung: die Breite kommt aus
|
||||
* stroke-width, nicht aus der Geometrie.
|
||||
*
|
||||
* Quelle: OpenStreetMap via Overpass (waterway=river; Elbe, Norderelbe,
|
||||
* Süderelbe), zu durchgehenden Zügen verkettet. Norder- und Süderelbe sind
|
||||
* die beiden Hafenarme um Wilhelmsburg; Neben- und Binnenelben bleiben
|
||||
* draußen, sie machen die Darstellung wieder kleinteilig. Gleiche Projektion wie STATES.
|
||||
*/
|
||||
export const RIVERS = "M444.01 270.52L445.02 271.60L446.15 273.68L447.61 274.70L450.31 275.63L453.00 275.24L454.11 275.44L457.61 278.48L459.72 279.31L457.60 277.67L457.08 274.68L456.02 273.29L455.89 271.36L456.94 269.30L456.71 267.90L455.60 266.68L452.49 264.83L448.92 264.09L446.89 263.06L444.38 263.53L435.61 263.18L425.85 260.50L412.81 258.61L409.27 256.56L406.00 253.42L401.81 250.42L399.08 247.48L397.99 245.12L395.46 236.29L394.30 234.38L392.46 232.33L388.60 229.71L385.53 226.85L382.00 217.47M520.56 293.41L517.24 293.56L513.40 295.22L512.48 294.92L510.94 293.57L505.56 292.98L495.86 287.66L491.23 283.81L490.09 283.60L486.60 283.87L484.42 282.45L483.35 282.42L484.20 282.07L485.49 282.11L491.34 283.86M456.05 270.17L456.33 270.22M487.89 282.75L486.56 282.41M483.35 282.42L481.83 283.81L478.55 285.01L477.71 286.08L477.15 288.21L476.28 288.99L474.47 289.11L471.94 288.29L469.27 288.86L467.26 287.42L465.68 284.42L464.79 283.95L462.37 283.79L461.94 283.47L460.49 280.17L459.72 279.31";
|
||||
|
||||
/** Außen- und Binnenalster als Fläche — ein See ist eine Form, keine Linie. */
|
||||
export const WATER = "M451.06 257.71L451.39 258.62L452.09 259.06L452.05 259.71L451.26 260.50L450.16 260.84L449.93 260.53L450.67 258.25L450.24 256.99L450.45 256.76L450.70 256.74L451.06 257.71ZM449.45 261.23L449.63 260.86L450.16 260.84L450.37 261.15L449.76 261.58Z";
|
||||
|
||||
/** Beschriftungen für den Hamburger Ausschnitt. */
|
||||
export const REGION_LABELS = [
|
||||
{ name: "Schleswig-Holstein", x: 419.8, y: 216.0 },
|
||||
{ name: "Hamburg", x: 471.1, y: 238.6 },
|
||||
{ name: "Niedersachsen", x: 435.1, y: 297.7 },
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Höher aufgelöste Umrisse für den Hamburg-Ausschnitt.
|
||||
*
|
||||
* STATES stammt aus der niedrigen Auflösung und ist für die Gesamtansicht
|
||||
* Deutschlands richtig — bei achtfachem Zoom wurde daraus aber ein Vieleck
|
||||
* (Hamburg hatte dort nur 21 Stützpunkte). Diese Fassung kommt aus der hohen
|
||||
* Auflösung, ist auf den Rahmen des Ausschnitts geklemmt und erst danach
|
||||
* vereinfacht, damit Küstenlinien außerhalb des Bildes nichts kosten.
|
||||
*/
|
||||
export const DETAIL_STATES: StatePath[] = [
|
||||
{ id: "DE-HH", name: "Hamburg", d: "M458.19 232.81L458.18 232.17L458.87 232.17L459.54 230.88L460.94 230.87L461.65 231.51L463.76 232.14L464.44 231.49L464.43 230.85L468.56 228.91L468.53 227.62L469.92 227.61L469.94 228.26L470.63 228.25L471.34 228.89L472.04 228.89L472.08 230.82L470.74 232.75L470.04 232.75L470.03 232.11L469.35 232.75L467.97 233.40L467.98 234.04L468.68 234.04L468.03 235.97L467.36 237.26L466.68 237.90L465.98 237.91L466.70 238.54L468.09 238.54L468.82 239.82L470.21 239.81L470.24 241.09L470.94 241.09L472.36 242.37L473.08 243.65L471.72 244.94L473.13 245.57L473.82 245.57L475.23 246.20L474.53 246.21L474.55 246.85L475.24 246.84L475.26 247.49L472.51 248.78L471.83 249.43L471.85 250.07L472.55 250.07L472.59 251.99L471.92 252.64L472.63 253.27L473.35 254.55L469.17 254.58L469.16 253.93L468.49 255.22L467.79 255.23L467.84 257.15L467.14 257.15L467.15 257.80L468.57 258.43L468.60 259.71L467.23 261.01L467.98 262.93L468.66 262.28L469.36 262.28L469.39 263.56L468.71 264.21L468.72 264.85L469.44 265.48L470.85 266.12L471.57 266.75L472.97 266.74L474.33 265.45L475.05 266.09L475.08 267.38L475.79 268.01L475.81 268.65L475.11 268.66L475.12 269.30L475.84 269.94L476.54 269.93L477.22 269.29L477.29 271.85L478.70 272.48L479.42 273.12L480.81 273.11L480.86 275.04L482.29 276.31L482.98 276.31L484.40 277.58L483.74 278.23L484.45 278.86L485.81 278.86L485.77 277.57L487.12 277.57L486.50 279.49L486.51 280.13L485.18 280.14L485.20 280.78L483.10 282.10L481.69 282.77L480.98 282.77L480.28 283.43L479.57 283.44L479.57 284.09L478.15 286.70L477.44 287.35L475.34 287.38L473.94 286.74L469.72 286.79L467.59 284.87L467.59 284.22L466.17 282.94L466.16 282.29L463.34 282.32L461.92 281.04L461.91 279.75L461.20 279.11L460.49 277.82L459.78 277.18L458.36 276.54L456.23 275.27L455.54 276.57L455.55 277.22L456.26 277.86L455.56 278.52L453.44 278.54L453.44 277.89L452.04 279.20L452.74 279.19L454.16 280.47L452.76 281.14L452.05 281.14L450.64 281.81L449.94 281.81L449.95 283.11L448.54 283.78L447.83 283.78L447.83 282.49L445.71 281.86L444.30 281.23L444.31 282.52L442.90 282.54L442.21 283.20L440.82 283.87L440.11 283.87L440.11 283.22L441.49 281.91L440.79 281.27L442.18 279.95L441.46 278.01L439.34 276.09L435.19 280.04L435.21 281.34L434.49 280.05L432.37 277.48L429.57 275.57L428.88 275.58L428.85 274.28L428.16 274.29L428.09 271.03L428.78 270.37L428.76 269.72L427.38 269.74L426.70 270.40L425.99 269.76L426.67 269.10L425.27 268.47L424.57 267.83L424.52 265.22L425.91 265.20L425.90 264.55L424.48 263.26L424.46 261.32L425.16 261.31L425.14 259.38L424.44 259.38L420.23 258.77L420.90 257.48L420.89 256.85L421.57 255.56L421.56 254.92L420.86 254.30L422.23 253.00L422.20 251.08L423.59 251.06L423.57 249.78L422.86 249.15L423.55 248.50L423.53 247.23L424.22 246.58L424.91 246.57L424.94 248.48L427.06 249.73L427.75 249.73L428.47 250.36L427.07 250.37L427.08 251.01L427.80 252.29L429.22 252.92L430.65 254.20L431.35 254.19L432.74 253.54L432.03 253.54L432.71 252.25L434.11 252.24L434.80 251.59L434.79 250.95L436.16 249.66L436.15 249.02L437.52 247.72L438.22 247.72L438.21 247.08L438.90 246.43L438.89 245.79L439.57 245.14L439.56 244.50L440.26 244.49L440.22 242.56L441.61 241.91L444.42 242.54L445.12 242.53L446.54 243.16L449.33 243.14L449.31 241.86L450.01 241.85L449.99 241.21L449.26 239.93L450.61 237.36L455.50 237.32L456.21 237.96L458.31 237.95L458.25 235.38L458.92 234.09L459.60 233.45L458.21 233.46L458.89 232.81L458.19 232.81Z" },
|
||||
{ id: "DE-MV", name: "Mecklenburg-Vorpommern", d: "M535.00 195.00L535.00 321.00L535.00 294.03L535.00 321.00L535.00 296.66L535.00 303.97L535.00 301.81L534.43 299.11L533.76 299.08L533.08 298.41L533.75 297.79L533.75 297.15L531.72 297.07L531.72 296.42L531.04 295.11L527.64 291.77L526.30 291.73L524.95 292.33L524.28 292.31L522.25 291.62L516.88 291.51L515.55 292.76L515.55 292.12L516.21 290.21L516.87 290.23L518.21 289.61L518.17 283.85L518.83 282.59L518.82 281.31L519.48 279.40L518.80 278.75L519.47 278.76L520.13 276.85L521.47 276.87L521.47 276.23L524.16 276.28L524.83 276.93L526.18 276.97L527.50 273.15L529.53 273.85L529.52 273.20L530.19 272.58L530.87 273.24L531.54 272.62L532.22 272.64L532.89 272.02L532.90 272.66L533.57 272.04L533.56 271.40L534.24 271.42L535.00 270.82L535.00 227.07L534.37 226.40L533.70 226.38L533.71 227.03L533.04 227.01L533.01 223.79L533.66 223.16L534.32 221.88L534.31 221.24L533.64 221.23L534.29 219.31L534.27 218.02L533.60 217.36L534.26 216.73L533.59 216.07L533.56 213.49L532.89 212.19L532.23 212.19L531.57 211.53L532.21 209.61L532.20 208.32L532.86 207.69L532.85 207.05L534.15 205.13L534.15 204.49L534.80 204.49L535.00 205.15L535.00 195.00Z" },
|
||||
{ id: "DE-NI", name: "Niedersachsen", d: "M371.00 202.57L371.00 213.73L371.00 203.62L371.00 205.34L372.73 206.51L375.52 208.99L376.93 210.86L378.33 212.10L380.43 214.59L381.14 215.85L381.16 216.49L381.88 218.38L385.46 225.95L386.87 227.82L389.65 230.30L393.81 233.37L396.60 235.84L397.35 239.01L398.75 240.89L398.82 244.09L399.56 246.63L400.98 249.15L402.35 249.75L405.13 252.23L407.87 253.42L414.77 257.69L420.23 258.77L424.44 259.38L425.14 259.38L425.16 261.31L424.46 261.32L424.48 263.26L425.90 264.55L425.91 265.20L424.52 265.22L424.57 267.83L425.27 268.47L426.67 269.10L425.99 269.76L426.70 270.40L427.38 269.74L428.76 269.72L428.78 270.37L428.09 271.03L428.16 274.29L428.85 274.28L428.88 275.58L429.57 275.57L432.37 277.48L434.49 280.05L435.21 281.34L435.19 280.04L439.34 276.09L441.46 278.01L442.18 279.95L440.79 281.27L441.49 281.91L440.11 283.22L440.11 283.87L440.82 283.87L442.21 283.20L442.90 282.54L444.31 282.52L444.30 281.23L445.71 281.86L447.83 282.49L447.83 283.78L448.54 283.78L449.95 283.11L449.94 281.81L450.64 281.81L452.05 281.14L452.76 281.14L454.16 280.47L452.74 279.19L452.04 279.20L453.44 277.89L453.44 278.54L455.56 278.52L456.26 277.86L455.55 277.22L455.54 276.57L456.23 275.27L458.36 276.54L459.78 277.18L460.49 277.82L461.20 279.11L461.91 279.75L461.92 281.04L463.34 282.32L466.16 282.29L466.17 282.94L467.59 284.22L467.59 284.87L469.72 286.79L473.94 286.74L475.34 287.38L477.44 287.35L478.15 286.70L479.57 284.09L479.57 283.44L480.28 283.43L480.98 282.77L481.69 282.77L483.10 282.10L485.20 280.78L486.52 280.78L487.84 282.05L493.11 282.02L495.10 284.57L497.08 285.84L501.70 288.38L502.36 289.01L503.68 289.65L505.67 290.91L506.33 290.91L507.65 291.54L511.60 291.51L513.58 293.42L514.24 293.41L514.89 292.76L515.55 292.76L516.88 291.51L522.25 291.62L524.28 292.31L524.95 292.33L526.30 291.73L527.64 291.77L531.04 295.11L531.72 296.42L531.72 297.07L533.75 297.15L533.75 297.79L533.08 298.41L533.76 299.08L534.43 299.11L535.00 301.81L535.00 303.97L535.00 296.66L535.00 321.00L371.00 321.00L372.75 321.00L371.00 321.00L371.00 202.57Z" },
|
||||
{ id: "DE-SH", name: "Schleswig-Holstein", d: "M371.00 195.00L535.00 195.00L532.17 195.00L535.00 195.00L535.00 205.15L534.80 204.49L534.15 204.49L534.15 205.13L532.85 207.05L532.86 207.69L532.20 208.32L532.21 209.61L531.57 211.53L532.23 212.19L532.89 212.19L533.56 213.49L533.59 216.07L534.26 216.73L533.60 217.36L534.27 218.02L534.29 219.31L533.64 221.23L534.31 221.24L534.32 221.88L533.66 223.16L533.01 223.79L533.04 227.01L533.71 227.03L533.70 226.38L534.37 226.40L535.00 227.07L535.00 270.82L534.24 271.42L533.56 271.40L533.57 272.04L532.90 272.66L532.89 272.02L532.22 272.64L531.54 272.62L530.87 273.24L530.19 272.58L529.52 273.20L529.53 273.85L527.50 273.15L526.18 276.97L524.83 276.93L524.16 276.28L521.47 276.23L521.47 276.87L520.13 276.85L519.47 278.76L518.80 278.75L519.48 279.40L518.82 281.31L518.83 282.59L518.17 283.85L518.21 289.61L516.87 290.23L516.21 290.21L515.55 292.12L515.55 292.76L514.89 292.76L514.24 293.41L513.58 293.42L511.60 291.51L507.65 291.54L506.33 290.91L505.67 290.91L503.68 289.65L502.36 289.01L501.70 288.38L497.08 285.84L495.10 284.57L493.11 282.02L487.84 282.05L486.52 280.78L485.20 280.78L485.18 280.14L486.51 280.13L486.50 279.49L487.12 277.57L485.77 277.57L485.81 278.86L484.45 278.86L483.74 278.23L484.40 277.58L482.98 276.31L482.29 276.31L480.86 275.04L480.81 273.11L479.42 273.12L478.70 272.48L477.29 271.85L477.22 269.29L476.54 269.93L475.84 269.94L475.12 269.30L475.11 268.66L475.81 268.65L475.79 268.01L475.08 267.38L475.05 266.09L474.33 265.45L472.97 266.74L471.57 266.75L470.85 266.12L469.44 265.48L468.72 264.85L468.71 264.21L469.39 263.56L469.36 262.28L468.66 262.28L467.98 262.93L467.23 261.01L468.60 259.71L468.57 258.43L467.15 257.80L467.14 257.15L467.84 257.15L467.79 255.23L468.49 255.22L469.16 253.93L469.17 254.58L473.35 254.55L472.63 253.27L471.92 252.64L472.59 251.99L472.55 250.07L471.85 250.07L471.83 249.43L472.51 248.78L475.26 247.49L475.24 246.84L474.55 246.85L474.53 246.21L475.23 246.20L473.82 245.57L473.13 245.57L471.72 244.94L473.08 243.65L472.36 242.37L470.94 241.09L470.24 241.09L470.21 239.81L468.82 239.82L468.09 238.54L466.70 238.54L465.98 237.91L466.68 237.90L467.36 237.26L468.03 235.97L468.68 234.04L467.98 234.04L467.97 233.40L469.35 232.75L470.03 232.11L470.04 232.75L470.74 232.75L472.08 230.82L472.04 228.89L471.34 228.89L470.63 228.25L469.94 228.26L469.92 227.61L468.53 227.62L468.56 228.91L464.43 230.85L464.44 231.49L463.76 232.14L461.65 231.51L460.94 230.87L459.54 230.88L458.87 232.17L458.18 232.17L458.19 232.81L458.89 232.81L458.21 233.46L459.60 233.45L458.92 234.09L458.25 235.38L458.31 237.95L456.21 237.96L455.50 237.32L450.61 237.36L449.26 239.93L449.99 241.21L450.01 241.85L449.31 241.86L449.33 243.14L446.54 243.16L445.12 242.53L444.42 242.54L441.61 241.91L440.22 242.56L440.26 244.49L439.56 244.50L439.57 245.14L438.89 245.79L438.90 246.43L438.21 247.08L438.22 247.72L437.52 247.72L436.15 249.02L436.16 249.66L434.79 250.95L434.80 251.59L434.11 252.24L432.71 252.25L432.03 253.54L432.74 253.54L431.35 254.19L430.65 254.20L429.22 252.92L427.80 252.29L427.08 251.01L427.07 250.37L428.47 250.36L427.75 249.73L427.06 249.73L424.94 248.48L424.91 246.57L424.22 246.58L423.53 247.23L423.55 248.50L422.86 249.15L423.57 249.78L423.59 251.06L422.20 251.08L422.23 253.00L420.86 254.30L421.56 254.92L421.57 255.56L420.89 256.85L420.90 257.48L420.23 258.77L414.77 257.69L407.87 253.42L405.13 252.23L402.35 249.75L400.98 249.15L399.56 246.63L398.82 244.09L398.75 240.89L397.35 239.01L396.60 235.84L393.81 233.37L389.65 230.30L386.87 227.82L385.46 225.95L381.88 218.38L381.16 216.49L381.14 215.85L380.43 214.59L378.33 212.10L376.93 210.86L375.52 208.99L372.73 206.51L371.00 205.34L371.00 195.00Z" },
|
||||
];
|
||||
+131
-6
@@ -1,3 +1,5 @@
|
||||
import { varietyName } from "./varieties";
|
||||
|
||||
const BACKEND_URL = import.meta.env.PUBLIC_MEDUSA_BACKEND_URL;
|
||||
const PUBLISHABLE_KEY = import.meta.env.PUBLIC_MEDUSA_PUBLISHABLE_KEY;
|
||||
|
||||
@@ -20,11 +22,67 @@ export async function medusaFetch(path: string, init?: RequestInit) {
|
||||
return body;
|
||||
}
|
||||
|
||||
export interface ShopShippingOption {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string | null;
|
||||
/** Grundpreis in Euro, ohne die Schwellenregel. */
|
||||
amount: number;
|
||||
}
|
||||
|
||||
export interface ShopSettings {
|
||||
/** Schwelle für kostenfreien Versand in Euro, `null` wenn es keine gibt. */
|
||||
freeShippingThreshold: number | null;
|
||||
/** Die Versandarten, die der Shop anbietet, nach Preis sortiert. */
|
||||
shippingOptions: ShopShippingOption[];
|
||||
}
|
||||
|
||||
// Der Wert steht auf jeder Shop-Seite und ändert sich fast nie. Ohne diesen
|
||||
// kurzen Puffer liefe je Seitenaufruf eine eigene Anfrage an Medusa.
|
||||
let settingsCache: { wert: ShopSettings; bis: number } | null = null;
|
||||
const SETTINGS_TTL_MS = 60_000;
|
||||
|
||||
/**
|
||||
* Die Shop-Einstellungen aus dem Backend.
|
||||
*
|
||||
* Fällt still auf "keine Schwelle" zurück, wenn das Backend nicht antwortet:
|
||||
* lieber gar kein Versprechen als eines, das gerade nicht belegt ist.
|
||||
*/
|
||||
export async function getShopSettings(): Promise<ShopSettings> {
|
||||
if (settingsCache && settingsCache.bis > Date.now()) return settingsCache.wert;
|
||||
try {
|
||||
const data = await medusaFetch("/store/shop-settings");
|
||||
const schwelle = Number(data?.free_shipping_threshold);
|
||||
const wert: ShopSettings = {
|
||||
freeShippingThreshold: Number.isFinite(schwelle) && schwelle > 0 ? schwelle : null,
|
||||
shippingOptions: Array.isArray(data?.shipping_options)
|
||||
? data.shipping_options.map((option: any) => ({
|
||||
id: option.id,
|
||||
name: option.name,
|
||||
description: option.description ?? null,
|
||||
amount: option.amount,
|
||||
}))
|
||||
: [],
|
||||
};
|
||||
settingsCache = { wert, bis: Date.now() + SETTINGS_TTL_MS };
|
||||
return wert;
|
||||
} catch {
|
||||
return { freeShippingThreshold: null, shippingOptions: [] };
|
||||
}
|
||||
}
|
||||
|
||||
export interface MedusaVariant {
|
||||
id: string;
|
||||
title: string;
|
||||
calculated_price?: { calculated_amount: number; currency_code: string };
|
||||
metadata?: { net_weight_grams?: number } | null;
|
||||
metadata?: {
|
||||
net_weight_grams?: number;
|
||||
/** Nur am Abo-Produkt: "monthly" | "quarterly" | "biannual". */
|
||||
subscription_interval?: string;
|
||||
/** Nur am Abo-Produkt: Glasgröße, z. B. "250 Gramm". */
|
||||
subscription_size?: string;
|
||||
} | null;
|
||||
thumbnail?: string | null;
|
||||
}
|
||||
|
||||
export interface MedusaProduct {
|
||||
@@ -35,18 +93,48 @@ export interface MedusaProduct {
|
||||
thumbnail: string | null;
|
||||
images?: { id: string; url: string }[];
|
||||
variants: MedusaVariant[];
|
||||
metadata?: { delivery_time?: string; category?: string } | null;
|
||||
/** `subscription: true` markiert das Abo-Produkt. */
|
||||
metadata?: {
|
||||
delivery_time?: string;
|
||||
subscription?: boolean;
|
||||
/** Hilfsartikel: gehört nicht ins Sortiment. */
|
||||
hidden?: boolean;
|
||||
/** Nur am Abo: "once" oder "per_delivery" — wie beim Geschenk der Versand berechnet wird. */
|
||||
gift_shipping?: "once" | "per_delivery";
|
||||
/** Bienenpatenschaft: braucht Namen für Urkunde und Etikett. */
|
||||
sponsorship?: boolean;
|
||||
} | null;
|
||||
categories?: { id: string; name: string; rank: number }[];
|
||||
}
|
||||
|
||||
// Pulls in the custom metadata (delivery time, category, net fill weight) on
|
||||
// top of Medusa's default product/variant fields.
|
||||
const PRODUCT_FIELDS = "*variants.calculated_price,+metadata,+variants.metadata";
|
||||
// Pulls in the custom metadata (delivery time, net fill weight) and the
|
||||
// real Medusa product categories on top of the default product/variant
|
||||
// fields.
|
||||
const PRODUCT_FIELDS =
|
||||
"*variants.calculated_price,+metadata,+variants.metadata,+variants.thumbnail,+categories.name,+categories.rank";
|
||||
|
||||
export async function listProducts(regionId?: string): Promise<MedusaProduct[]> {
|
||||
const params = new URLSearchParams({ fields: PRODUCT_FIELDS });
|
||||
if (regionId) params.set("region_id", regionId);
|
||||
const data = await medusaFetch(`/store/products?${params}`);
|
||||
return data.products;
|
||||
// Hilfsartikel wie der Versandanteil eines Geschenk-Abos gehören nicht ins
|
||||
// Sortiment — sie werden nur automatisch mitverkauft.
|
||||
return (data.products as MedusaProduct[]).filter((product) => !product.metadata?.hidden);
|
||||
}
|
||||
|
||||
/**
|
||||
* Der Artikel, über den der Versandanteil weiterer Geschenk-Pakete
|
||||
* berechnet wird. `null`, wenn er nicht eingerichtet ist — dann wird nichts
|
||||
* berechnet und der Shop verspricht es auch nicht.
|
||||
*/
|
||||
export async function getGiftShippingSurcharge(
|
||||
regionId?: string
|
||||
): Promise<{ variantId: string; amount: number } | null> {
|
||||
const produkt = await getProductByHandle("versandanteil-geschenk-abo", regionId);
|
||||
const variante = produkt?.variants?.[0];
|
||||
const betrag = variante?.calculated_price?.calculated_amount;
|
||||
if (!variante || betrag == null) return null;
|
||||
return { variantId: variante.id, amount: betrag };
|
||||
}
|
||||
|
||||
export async function getProductByHandle(handle: string, regionId?: string): Promise<MedusaProduct | null> {
|
||||
@@ -65,3 +153,40 @@ export async function getDefaultRegion(): Promise<MedusaRegion> {
|
||||
const data = await medusaFetch("/store/regions");
|
||||
return data.regions[0];
|
||||
}
|
||||
|
||||
/** Glasgrößen, die im Abo wählbar sind. Spiegelt HONEY_SIZES im Backend. */
|
||||
export const SUBSCRIPTION_SIZES = ["250 Gramm", "500 Gramm"] as const;
|
||||
|
||||
export interface HoneyVariety {
|
||||
variantId: string;
|
||||
/** Der volle Katalogtitel. */
|
||||
productTitle: string;
|
||||
/** Der kurze Sortenname aus dem Briefing — das, was angezeigt wird. */
|
||||
name: string;
|
||||
size: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Honigsorten je Glasgröße, für die Sortenauswahl im Abo.
|
||||
*
|
||||
* Leitet sich aus dem normalen Katalog ab statt aus einer gepflegten Liste:
|
||||
* kommt eine Sorte dazu, steht sie automatisch im Abo zur Wahl.
|
||||
*/
|
||||
export async function listHoneyVarieties(regionId?: string): Promise<HoneyVariety[]> {
|
||||
const products = await listProducts(regionId);
|
||||
const varieties: HoneyVariety[] = [];
|
||||
for (const product of products) {
|
||||
const isHoney = (product.categories ?? []).some((category) => category.name === "Honig");
|
||||
if (!isHoney) continue;
|
||||
for (const variant of product.variants) {
|
||||
if (!SUBSCRIPTION_SIZES.includes(variant.title as any)) continue;
|
||||
varieties.push({
|
||||
variantId: variant.id,
|
||||
productTitle: product.title,
|
||||
name: varietyName(product.title),
|
||||
size: variant.title,
|
||||
});
|
||||
}
|
||||
}
|
||||
return varieties.sort((a, b) => a.name.localeCompare(b.name, "de"));
|
||||
}
|
||||
|
||||
@@ -1,35 +1,84 @@
|
||||
export const partners = [
|
||||
{ name: "ABB", file: "abb-3x2-1.png" },
|
||||
export interface PartnerLocation {
|
||||
/** Breitengrad des Bienenstandorts. */
|
||||
lat: number;
|
||||
/** Längengrad des Bienenstandorts. */
|
||||
lng: number;
|
||||
/** Wird an der Nadel und im Tooltip angezeigt, z. B. "Hamburg-Harburg". */
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface Partner {
|
||||
name: string;
|
||||
file: string;
|
||||
/**
|
||||
* Optional. Partner mit Standort erscheinen als Bienenstock auf der Karte
|
||||
* und bekommen eine Verbindungslinie zu ihrem Logo. Partner ohne Standort
|
||||
* erscheinen weiterhin in der Logo-Wand — es geht also nichts verloren,
|
||||
* wenn die Koordinate fehlt.
|
||||
*/
|
||||
location?: PartnerLocation;
|
||||
}
|
||||
|
||||
/*
|
||||
* ⚠️ ACHTUNG: Die Koordinaten unten sind PLATZHALTER.
|
||||
*
|
||||
* Sie verteilen sich über Hamburger Stadtteile, damit die Karte sichtbar
|
||||
* funktioniert — sie sagen NICHT aus, wo die Völker tatsächlich stehen.
|
||||
* Vor der Live-Schaltung durch die echten Standorte ersetzen.
|
||||
*
|
||||
* Koordinaten findet man z. B. über Google Maps (Rechtsklick auf den Punkt →
|
||||
* die beiden Zahlen sind lat und lng) oder über nominatim.openstreetmap.org.
|
||||
*
|
||||
* Neuen Partner ergänzen: Eintrag mit `name`, `file` und optional `location`
|
||||
* hinzufügen — Karte, Nadeln, Verbindungslinien und Logo-Wand aktualisieren
|
||||
* sich von allein.
|
||||
*/
|
||||
export const partners: Partner[] = [
|
||||
{ name: "ABB", file: "abb-3x2-1.png", location: { lat: 53.541, lng: 10.0, label: "Hamburg-HafenCity" } },
|
||||
{ name: "AdvoNeo", file: "advoneo-3x2-1.png" },
|
||||
{ name: "ak.", file: "ak-3x2-1-smaller.png" },
|
||||
{ name: "bp", file: "bp-3x2-1.png" },
|
||||
{ name: "bp", file: "bp-3x2-1.png", location: { lat: 53.545, lng: 10.025, label: "Hamburg-Hammerbrook" } },
|
||||
{ name: "Coloplast", file: "coloplast_logo.png" },
|
||||
{ name: "dentsu", file: "dentsu-3x2-1.png" },
|
||||
{ name: "dentsu", file: "dentsu-3x2-1.png", location: { lat: 53.551, lng: 9.965, label: "Hamburg-St. Pauli" } },
|
||||
{ name: "East Cosmos", file: "east-cosmos-3x2-1.png" },
|
||||
{ name: "Edeka Harburg", file: "edeka_harburg.png" },
|
||||
{ name: "Edeka Harburg", file: "edeka_harburg.png", location: { lat: 53.46, lng: 9.983, label: "Hamburg-Harburg" } },
|
||||
{ name: "Eggers", file: "eggers-3x2-1.png" },
|
||||
{ name: "Empire Riverside Hotels", file: "empire-riverside-hotels-3x2-1.png" },
|
||||
{ name: "Engel & Völkers", file: "engel-voelkers-3x2-1.png" },
|
||||
{ name: "EY", file: "ey-3x2-1.png" },
|
||||
{ name: "Empire Riverside Hotels", file: "empire-riverside-hotels-3x2-1.png", location: { lat: 53.549, lng: 9.96, label: "Hamburg-St. Pauli" } },
|
||||
{ name: "Engel & Völkers", file: "engel-voelkers-3x2-1.png", location: { lat: 53.568, lng: 9.988, label: "Hamburg-Rotherbaum" } },
|
||||
{ name: "EY", file: "ey-3x2-1.png", location: { lat: 53.551, lng: 9.982, label: "Hamburg-Neustadt" } },
|
||||
{ name: "Fairplay", file: "fairplay-3x2-1.png" },
|
||||
{ name: "Hamburger Feuerkasse", file: "hamburger_feuerkasse.png" },
|
||||
{ name: "Hanseatic Bank", file: "hanseatic-bank-3x2-1.png" },
|
||||
{ name: "International School of Hamburg", file: "international-school-of-hamburg-3x2-1.png" },
|
||||
{ name: "Jung von Matt", file: "jungvmatt-3x2-1.png" },
|
||||
{ name: "Hamburger Feuerkasse", file: "hamburger_feuerkasse.png", location: { lat: 53.567, lng: 10.017, label: "Hamburg-Uhlenhorst" } },
|
||||
{ name: "Hanseatic Bank", file: "hanseatic-bank-3x2-1.png", location: { lat: 53.588, lng: 10.04, label: "Hamburg-Barmbek" } },
|
||||
{ name: "International School of Hamburg", file: "international-school-of-hamburg-3x2-1.png", location: { lat: 53.549, lng: 9.89, label: "Hamburg-Othmarschen" } },
|
||||
{ name: "Jung von Matt", file: "jungvmatt-3x2-1.png", location: { lat: 53.55, lng: 9.935, label: "Hamburg-Altona" } },
|
||||
{ name: "Kinderzimmer", file: "kinderzimmer.png" },
|
||||
{ name: "Kontora", file: "kontora-3x2-1.png" },
|
||||
{ name: "Lorentz", file: "lorentz-3x2-1.png" },
|
||||
{ name: "Martha Haus", file: "martha_haus.png" },
|
||||
{ name: "NKG", file: "nkg-3x2-1.png" },
|
||||
{ name: "Nordmann", file: "nordmann-3x2-1.png" },
|
||||
{ name: "Nordmann", file: "nordmann-3x2-1.png", location: { lat: 53.575, lng: 9.952, label: "Hamburg-Eimsbüttel" } },
|
||||
{ name: "Porsche Zentren", file: "porsche_zentren.png" },
|
||||
{ name: "Private Banking", file: "private-banking-3x2-1.png" },
|
||||
{ name: "Röder Stiftung", file: "roeder_stiftung.png" },
|
||||
{ name: "Sund", file: "sund-3x2-1.png" },
|
||||
{ name: "Stilwerks", file: "stilwerks-3x2-1-smaller.png" },
|
||||
{ name: "Still", file: "still-3x2-1.png" },
|
||||
{ name: "Stilwerks", file: "stilwerks-3x2-1-smaller.png", location: { lat: 53.559, lng: 9.81, label: "Hamburg-Blankenese" } },
|
||||
{ name: "Still", file: "still-3x2-1.png", location: { lat: 53.489, lng: 10.212, label: "Hamburg-Bergedorf" } },
|
||||
{ name: "Seniorenzentren Geschwister Jensen", file: "senioren-zentren-geschwister-jensen-3x2-1.png" },
|
||||
{ name: "Tews", file: "tews-3x2-1.png" },
|
||||
{ name: "The Cloud One", file: "the_cloud_one.png" },
|
||||
{ name: "ZF", file: "zf-3x2-1.png" },
|
||||
{ name: "Tews", file: "tews-3x2-1.png", location: { lat: 53.618, lng: 9.95, label: "Hamburg-Niendorf" } },
|
||||
{ name: "The Cloud One", file: "the_cloud_one.png", location: { lat: 53.603, lng: 10.156, label: "Hamburg-Rahlstedt" } },
|
||||
{ name: "ZF", file: "zf-3x2-1.png", location: { lat: 53.582, lng: 10.087, label: "Hamburg-Wandsbek" } },
|
||||
// Im Sommer 2026 auf place4bees.com dazugekommen. Namen stammen aus dem
|
||||
// title-Attribut der Logos dort, Standorte sind noch keine hinterlegt.
|
||||
{ name: "Ahrens Haus- und Grundstücksverwaltung", file: "ahrens-hausverwaltung.png" },
|
||||
{ name: "BRUHN-Unternehmensgruppe", file: "bruhn-unternehmensgruppe.png" },
|
||||
{ name: "E-Center Schleswig", file: "e-center-schleswig.png" },
|
||||
{ name: "intersoft consulting", file: "intersoft-consulting.png" },
|
||||
{ name: "JUFA Hotels", file: "jufa-hotels.png" },
|
||||
{ name: "P+R", file: "p-r.png" },
|
||||
{ name: "Radkultur Hamburg", file: "radkultur-hamburg.png" },
|
||||
];
|
||||
|
||||
/** Partner mit hinterlegtem Standort — nur die erscheinen auf der Karte. */
|
||||
export const locatedPartners = partners.filter(
|
||||
(p): p is Partner & { location: PartnerLocation } => p.location != null
|
||||
);
|
||||
|
||||
+113
-33
@@ -1,61 +1,141 @@
|
||||
export type Section = "private" | "business";
|
||||
/**
|
||||
* Der Aufbau der Seite: ein Hauptauftritt, darüber Ebenen.
|
||||
*
|
||||
* place4bees.com ist eine Seite mit einer Navigation. Shop und Automaten
|
||||
* sind keine zweite Website, sondern legen sich als Ebene darüber: sie
|
||||
* öffnen eine zweite Leiste, während die Hauptnavigation stehen bleibt.
|
||||
* Von dort führt jeder Klick nahtlos zurück in den Hauptauftritt.
|
||||
*/
|
||||
export type Layer = "site" | "shop" | "automaten";
|
||||
|
||||
export const COMPANY_NAME = "place4bees";
|
||||
|
||||
/**
|
||||
* Subline der Wortmarke laut PLACE4BEES_Designguidelines.pdf: auf den
|
||||
* Produkten steht unter „PLACE 4 BEES" nicht mehr „modern beekeeping",
|
||||
* sondern „Hamburger Stadtimkerei".
|
||||
*
|
||||
* Im Header steht sie nicht mehr — dort ist wie auf place4bees.com nur die
|
||||
* Biene. Im Fuß bleibt sie.
|
||||
*/
|
||||
export const BRAND_SUBLINE = "Hamburger Stadtimkerei";
|
||||
|
||||
/**
|
||||
* Der Claim vom Konzeptboard des Briefings (Seite 3), der dort unter jedem
|
||||
* Produktnamen steht.
|
||||
*
|
||||
* Achtung, das Briefing widerspricht sich: der Deckel trägt laut Seite 5
|
||||
* „Regional. Natürlich. 100% Honig." Wir führen die Board-Fassung, weil der
|
||||
* Auftraggeber zum Board schreibt „gern möglichst genau so übernehmen".
|
||||
* Muss noch entschieden werden.
|
||||
*/
|
||||
export const CLAIM = "Regional. Natürlich. Handgemacht.";
|
||||
|
||||
/** Fixed canonical domain: all pages consolidate their SEO signal here, even
|
||||
* though the site also resolves on hhonig.de (see Layout.astro). */
|
||||
export const PRIMARY_DOMAIN = "https://place4bees.com";
|
||||
|
||||
interface SectionConfig {
|
||||
/**
|
||||
* Die Hauptnavigation — Wortlaut und Reihenfolge wie auf place4bees.com,
|
||||
* am 9.9.2026 dort ausgelesen. Sie steht auf jeder Seite, auch im Shop.
|
||||
*/
|
||||
export const mainNav = [
|
||||
{ label: "Unternehmensbienen", href: "/business" },
|
||||
{ label: "Ihr Projekt", href: "/business/ihr-projekt" },
|
||||
{ label: "Über uns", href: "/business/ueber-uns" },
|
||||
{ label: "Philosophie", href: "/business/philosophie" },
|
||||
{ label: "Presse", href: "/business/presse" },
|
||||
{ label: "Kontakt", href: "/business/kontakt" },
|
||||
];
|
||||
|
||||
/** Die Reiter, die eine eigene Ebene öffnen. Rechts neben der Hauptnavigation. */
|
||||
export const layerTabs: { layer: Layer; label: string; href: string }[] = [
|
||||
{ layer: "shop", label: "Shop", href: "/shop" },
|
||||
{ layer: "automaten", label: "Automaten", href: "/automaten" },
|
||||
];
|
||||
|
||||
interface LayerConfig {
|
||||
label: string;
|
||||
tagline: string;
|
||||
/** Stable, host-independent path for this section's homepage. Always link
|
||||
* here internally (never to bare "/") so switching sections behaves the
|
||||
* same regardless of which domain a visitor is on. */
|
||||
/** Startseite der Ebene. Immer hierhin verlinken, nie auf "/". */
|
||||
homeHref: string;
|
||||
/** Inhalt der zweiten Leiste. Beim Hauptauftritt leer — der hat nur eine. */
|
||||
nav: { label: string; href: string }[];
|
||||
}
|
||||
|
||||
export const sections: Record<Section, SectionConfig> = {
|
||||
private: {
|
||||
label: "Privatkunden",
|
||||
export const layers: Record<Layer, LayerConfig> = {
|
||||
site: {
|
||||
label: "place4bees",
|
||||
tagline: "Eigene Bienen vor Ort. Professionell betreut. Nachhaltig erlebbar.",
|
||||
homeHref: "/business",
|
||||
nav: [],
|
||||
},
|
||||
shop: {
|
||||
label: "Shop",
|
||||
tagline: "Regionaler Honig aus Hamburg",
|
||||
homeHref: "/privatkunden",
|
||||
homeHref: "/shop",
|
||||
nav: [
|
||||
{ label: "Shop", href: "/shop" },
|
||||
{ label: "Alle Sorten", href: "/shop" },
|
||||
{ label: "Honig-Abo", href: "/shop/honig-abo" },
|
||||
{ label: "Über uns", href: "/ueber-uns" },
|
||||
{ label: "Kontakt", href: "/kontakt" },
|
||||
],
|
||||
},
|
||||
business: {
|
||||
label: "Business",
|
||||
tagline: "Eigene Bienen vor Ort. Professionell betreut. Nachhaltig erlebbar.",
|
||||
homeHref: "/business",
|
||||
nav: [
|
||||
{ label: "Ihr Projekt", href: "/business/ihr-projekt" },
|
||||
{ label: "Über uns", href: "/business/ueber-uns" },
|
||||
{ label: "Philosophie", href: "/business/philosophie" },
|
||||
{ label: "Presse", href: "/business/presse" },
|
||||
{ label: "Angebot", href: "/business/angebot" },
|
||||
{ label: "Anfrage", href: "/business/anfrage" },
|
||||
{ label: "Kontakt", href: "/business/kontakt" },
|
||||
],
|
||||
automaten: {
|
||||
label: "Automaten",
|
||||
tagline: "Honig rund um die Uhr, ohne Öffnungszeiten",
|
||||
homeHref: "/automaten",
|
||||
nav: [{ label: "Alle Standorte", href: "/automaten" }],
|
||||
},
|
||||
};
|
||||
|
||||
export function sectionForPath(pathname: string): Section {
|
||||
return pathname.startsWith("/business") ? "business" : "private";
|
||||
}
|
||||
/**
|
||||
* Welche Pfade zur Shop-Ebene gehören.
|
||||
*
|
||||
* Alles, was mit Kaufen zu tun hat, inklusive Konto und Bestellverfolgung —
|
||||
* dort soll die zweite Leiste mit dem Warenkorb stehen bleiben. Rechtliche
|
||||
* Seiten bleiben bewusst draußen: sie gehören zu keiner Ebene.
|
||||
*/
|
||||
const SHOP_PATHS = [
|
||||
"/shop",
|
||||
"/warenkorb",
|
||||
"/kasse",
|
||||
"/konto",
|
||||
"/bestellung", "/versand",
|
||||
"/privatkunden",
|
||||
// Die Endkunden-Fassungen von Über uns und Kontakt. Sie stehen in der
|
||||
// zweiten Leiste des Shops — stünden sie nicht auch hier, würde ein Klick
|
||||
// dort die Ebene schließen, statt in ihr zu bleiben. Die Fassungen des
|
||||
// Hauptauftritts liegen getrennt davon unter /business/.
|
||||
"/ueber-uns",
|
||||
"/kontakt",
|
||||
];
|
||||
|
||||
/** hhonig.de defaults to the private/B2C section, place4bees.com to business. */
|
||||
/** hhonig.de landet im Shop, place4bees.com im Hauptauftritt. */
|
||||
export function isBusinessHost(hostname: string): boolean {
|
||||
return hostname.includes("place4bees");
|
||||
}
|
||||
|
||||
/** Resolves the active section for a request, accounting for the host-based
|
||||
* default that only applies at the bare "/" root. */
|
||||
export function resolveSection(pathname: string, hostname: string): Section {
|
||||
if (pathname.startsWith("/business")) return "business";
|
||||
if (pathname === "/" && isBusinessHost(hostname)) return "business";
|
||||
return "private";
|
||||
/**
|
||||
* Die aktive Ebene. Der Host zählt nur an der blanken "/", jeder andere
|
||||
* Pfad entscheidet für sich.
|
||||
*/
|
||||
export function resolveLayer(pathname: string, hostname = ""): Layer {
|
||||
if (pathname === "/") return isBusinessHost(hostname) ? "site" : "shop";
|
||||
if (pathname === "/automaten" || pathname.startsWith("/automaten/")) return "automaten";
|
||||
if (SHOP_PATHS.some((path) => pathname === path || pathname.startsWith(`${path}/`))) {
|
||||
return "shop";
|
||||
}
|
||||
return "site";
|
||||
}
|
||||
|
||||
/**
|
||||
* Ob zwischen zwei Ebenen die Bahn laufen soll.
|
||||
*
|
||||
* Nur beim Sprung zwischen Hauptauftritt und einer aufgelegten Ebene —
|
||||
* innerhalb einer Ebene, und auch zwischen Shop und Automaten, wäre sie nur
|
||||
* Wartezeit.
|
||||
*/
|
||||
export function crossesLayer(from: Layer, to: Layer): boolean {
|
||||
return (from === "site") !== (to === "site");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
import { medusaFetch } from "./medusa";
|
||||
|
||||
export interface Subscription {
|
||||
id: string;
|
||||
status: "active" | "paused" | "canceled";
|
||||
interval: "monthly" | "quarterly" | "biannual";
|
||||
size: string | null;
|
||||
quantity: number;
|
||||
selection: "fixed" | "random";
|
||||
/** Altbestand: eine Sorte für alle Gläser. */
|
||||
variety: string | null;
|
||||
/** Eine Variante je Glas, in der Reihenfolge der Auswahl. */
|
||||
variant_ids: string[];
|
||||
/** Die Namen dazu, gleiche Reihenfolge. */
|
||||
varieties: (string | null)[];
|
||||
last_variety: string | null;
|
||||
next_order_at: string | null;
|
||||
last_order_at: string | null;
|
||||
canceled_at: string | null;
|
||||
paused_at: string | null;
|
||||
payment_method: string | null;
|
||||
}
|
||||
|
||||
export const INTERVAL_LABELS: Record<string, string> = {
|
||||
monthly: "monatlich",
|
||||
quarterly: "alle 3 Monate",
|
||||
biannual: "alle 6 Monate",
|
||||
};
|
||||
|
||||
/**
|
||||
* "2× Lindenhonig, Rapshonig" — gleiche Sorten zusammengefasst.
|
||||
*
|
||||
* Steht hier und nicht bei Warenkorb oder Konto, weil beide dieselbe
|
||||
* Schreibweise brauchen.
|
||||
*/
|
||||
export function summariseVarieties(labels: (string | null | undefined)[]): string {
|
||||
const counts = new Map<string, number>();
|
||||
for (const label of labels) {
|
||||
if (label) counts.set(label, (counts.get(label) ?? 0) + 1);
|
||||
}
|
||||
return [...counts]
|
||||
.map(([label, count]) => (count > 1 ? `${count}× ${label}` : label))
|
||||
.join(", ");
|
||||
}
|
||||
|
||||
export const STATUS_LABELS: Record<string, string> = {
|
||||
active: "aktiv",
|
||||
paused: "pausiert",
|
||||
canceled: "gekündigt",
|
||||
};
|
||||
|
||||
function authHeaders(token: string) {
|
||||
return { Authorization: `Bearer ${token}` };
|
||||
}
|
||||
|
||||
export async function listMySubscriptions(
|
||||
token: string
|
||||
): Promise<{ subscriptions: Subscription[]; sizes: string[] }> {
|
||||
return medusaFetch("/store/customers/me/subscriptions", { headers: authHeaders(token) });
|
||||
}
|
||||
|
||||
export async function updateSubscription(
|
||||
token: string,
|
||||
id: string,
|
||||
payload: {
|
||||
action?: "pause" | "resume" | "cancel";
|
||||
quantity?: number;
|
||||
size?: string;
|
||||
selection?: "fixed" | "random";
|
||||
variant_id?: string | null;
|
||||
/** Eine Variante je Glas. Hat Vorrang vor variant_id. */
|
||||
variant_ids?: string[] | null;
|
||||
cancel_reason?: string;
|
||||
}
|
||||
): Promise<{ subscription: Subscription }> {
|
||||
return medusaFetch(`/store/customers/me/subscriptions/${id}`, {
|
||||
method: "POST",
|
||||
headers: authHeaders(token),
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Kündigung ohne Anmeldung — der gesetzlich vorgeschriebene Weg nach
|
||||
* § 312k BGB. Braucht Abo-Nummer und E-Mail, kein Konto.
|
||||
*/
|
||||
export async function cancelWithoutLogin(payload: {
|
||||
subscription_id: string;
|
||||
email: string;
|
||||
name?: string;
|
||||
kind?: "ordentlich" | "ausserordentlich";
|
||||
reason?: string;
|
||||
}): Promise<{
|
||||
subscription_id: string;
|
||||
canceled_at: string;
|
||||
already_canceled?: boolean;
|
||||
message?: string;
|
||||
}> {
|
||||
return medusaFetch("/store/subscriptions/cancel", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* Sortentexte und Farbcodes aus PLACE4BEES_Designguidelines.pdf.
|
||||
*
|
||||
* Das Briefing (Seite 2) teilt die Honigkollektion in zwei Linien und gibt
|
||||
* jeder Sorte eine feste Subline. Beides ist Markentext, keine
|
||||
* Produktbeschreibung — deshalb steht es hier und nicht in Medusa: die
|
||||
* Zuordnung soll auch dann halten, wenn im Backend jemand den Produkttitel
|
||||
* anfasst.
|
||||
*
|
||||
* Der Farbcode kommt aus Punkt 2 des Briefings („Ich mag die Idee, dass jede
|
||||
* Sorte eine Farbe hat"). Die Farbwelt des Konzeptboards (Seite 3) hat acht
|
||||
* Töne, wir haben zwölf Sorten — die drei Ergänzungen unten sind als solche
|
||||
* markiert und liegen bewusst im selben gedeckten Register.
|
||||
*
|
||||
* Gematcht wird über ein Stichwort im Produkttitel, weil die Titel im Shop
|
||||
* länger sind als die Sortennamen im Briefing ("Lindenhonig aus Hamburg –
|
||||
* cremig" gegenüber "Lindenhonig").
|
||||
*/
|
||||
export type Collection = "urban" | "country";
|
||||
|
||||
export interface Variety {
|
||||
/** Kleingeschriebenes Stichwort, das im Produkttitel vorkommen muss. */
|
||||
match: string;
|
||||
/** Sortenname laut Briefing. */
|
||||
name: string;
|
||||
/** Subline laut Briefing. Fehlt im Briefing bei Himbeerblütenhonig. */
|
||||
subline?: string;
|
||||
collection: Collection;
|
||||
/**
|
||||
* Farbe des Stegs laut Briefing-Idee, als CSS-Custom-Property-Verweis.
|
||||
* Wird ausschließlich als Fläche benutzt (Steg, Regel), nie als Textfarbe
|
||||
* — die hellen Töne der Farbwelt tragen auf Weiß keinen Text.
|
||||
*/
|
||||
color: string;
|
||||
}
|
||||
|
||||
export const COLLECTION_LABELS: Record<Collection, string> = {
|
||||
urban: "Urban Collection",
|
||||
country: "Country Collection",
|
||||
};
|
||||
|
||||
/**
|
||||
* Herkunftshinweis laut Briefing, Seite 2: „12 Honigsorten, wovon 3 in der
|
||||
* Stadt geerntet werden und 9 aus ländlicheren Gegenden stammen."
|
||||
*/
|
||||
export const COLLECTION_NOTES: Record<Collection, string> = {
|
||||
urban: "In der Stadt geerntet.",
|
||||
country: "Aus ländlicheren Gegenden.",
|
||||
};
|
||||
|
||||
/** Reihenfolge der Kollektionen im Shop: erst Hamburg, dann Umland. */
|
||||
export const COLLECTION_ORDER: Collection[] = ["urban", "country"];
|
||||
|
||||
/**
|
||||
* Farbwelt des Konzeptboards, Seite 3.
|
||||
*
|
||||
* Die Hex-Werte stehen in src/styles/global.css, nicht hier — sonst müsste
|
||||
* jede Korrektur an zwei Stellen passieren. Was hier steht, ist die
|
||||
* Zuordnung: welche Sorte welchen Ton bekommt.
|
||||
*/
|
||||
const FARBWELT = {
|
||||
ink: "var(--color-farbwelt-ink)",
|
||||
forest: "var(--color-farbwelt-forest)",
|
||||
sage: "var(--color-farbwelt-sage)",
|
||||
mustard: "var(--color-farbwelt-mustard)",
|
||||
apricot: "var(--color-farbwelt-apricot)",
|
||||
rust: "var(--color-farbwelt-rust)",
|
||||
olive: "var(--color-farbwelt-olive)",
|
||||
stone: "var(--color-farbwelt-stone)",
|
||||
cornflower: "var(--color-farbwelt-cornflower)",
|
||||
// --- Ergänzungen, nicht im Board. Noch nicht freigegeben. ---
|
||||
amber: "var(--color-farbwelt-amber)",
|
||||
heather: "var(--color-farbwelt-heather)",
|
||||
bronze: "var(--color-farbwelt-bronze)",
|
||||
} as const;
|
||||
|
||||
export const varieties: Variety[] = [
|
||||
// Urban Collection — in Hamburg geerntet.
|
||||
{ match: "frühlingsblütenhonig", name: "Frühlingsblütenhonig", subline: "Aus Hamburgs Parks und Gärten", collection: "urban", color: FARBWELT.sage },
|
||||
{ match: "sommerblütenhonig", name: "Sommerblütenhonig", subline: "Hamburger Sommer im Glas", collection: "urban", color: FARBWELT.amber },
|
||||
{ match: "lindenhonig", name: "Lindenhonig", subline: "Mehr Hamburg geht nicht", collection: "urban", color: FARBWELT.olive },
|
||||
|
||||
// Country Collection — aus dem Umland und weiter weg.
|
||||
{ match: "rapshonig", name: "Rapshonig", subline: "Norddeutschland in seiner schönsten Farbe", collection: "country", color: FARBWELT.mustard },
|
||||
{ match: "buchweizenhonig", name: "Buchweizenhonig", subline: "Kräftig. Ehrlich. Unverwechselbar.", collection: "country", color: FARBWELT.ink },
|
||||
{ match: "akazienhonig", name: "Akazienhonig", subline: "Mild. Klar. Elegant.", collection: "country", color: FARBWELT.stone },
|
||||
{ match: "sonnenblumenhonig", name: "Sonnenblumenhonig", subline: "Gute Laune pur", collection: "country", color: FARBWELT.apricot },
|
||||
{ match: "waldhonig", name: "Waldhonig", subline: "Die Kraft des Waldes", collection: "country", color: FARBWELT.forest },
|
||||
// Im Briefing ohne Subline — hier bewusst leer statt erfunden.
|
||||
{ match: "himbeerblütenhonig", name: "Himbeerblütenhonig", collection: "country", color: FARBWELT.rust },
|
||||
{ match: "heidehonig", name: "Heidehonig", subline: "Der Charakter des Nordens", collection: "country", color: FARBWELT.heather },
|
||||
{ match: "kornblumenhonig", name: "Kornblumenhonig", subline: "Zwischen Himmel und Kornfeld", collection: "country", color: FARBWELT.cornflower },
|
||||
// Das Briefing nennt die Sorte "Traditionshonig", im Katalog heißt sie
|
||||
// "Presshonig Hamburger Sommerblüte". Zugeordnet über das Pressverfahren —
|
||||
// bitte gegenprüfen, das ist meine Schlussfolgerung, nicht das Briefing.
|
||||
{ match: "presshonig", name: "Traditionshonig", subline: "Schonend gepresst. Besonders gehaltvoll.", collection: "urban", color: FARBWELT.bronze },
|
||||
];
|
||||
|
||||
/** Findet die Sorte zu einem Produkttitel, oder undefined bei Nicht-Honig. */
|
||||
export function findVariety(productTitle: string): Variety | undefined {
|
||||
const haystack = productTitle.toLowerCase();
|
||||
return varieties.find((v) => haystack.includes(v.match));
|
||||
}
|
||||
|
||||
/**
|
||||
* Der kurze Sortenname aus dem Briefing zu einem Produkttitel.
|
||||
*
|
||||
* Im Katalog heißen die Produkte ausführlich ("Buchweizenhonig aus der
|
||||
* Oder-Spree-Region - cremig"). Überall, wo eine Sorte nur benannt werden
|
||||
* soll — Auswahlfelder im Abo, Warenkorb, Kontoübersicht — steht der Name
|
||||
* aus dem Briefing. Findet sich keine Sorte, bleibt der Titel stehen.
|
||||
*/
|
||||
export function varietyName(productTitle: string): string {
|
||||
return findVariety(productTitle)?.name ?? productTitle;
|
||||
}
|
||||
Reference in New Issue
Block a user