PageSourceSearch

https://printstudios.de/static/react/chunks/OrderTracking-tfwyDo9I.js

js printstudios.de collected 2026-10-06 14:06:01 UTC 10,601 bytes, 1 lines download raw bytes

1import{j as e}from"./motion-4Pe-0l9l.js";import{r as o,aJ as h,X as j}from"./icons-D33OLVah.js";import{b as N}from"./client-BrDz2RtE.js";import{P as k}from"./PublicSEO-DPKSFMvb.js";import{d as v,L as u}from"./router-C_86t40E.js";import"./index-DOjRTYqR.js";import"./radix-Bm8LYzHo.js";import"./tanstack-9D8FVQmw.js";import"./react-query-B-PjvZ3S.js";import"./recharts-CkBxNeT6.js";const w={received:"bg-blue-100 text-blue-700",pending:"bg-amber-100 text-amber-700",pending_payment:"bg-amber-100 text-amber-700",confirmed:"bg-indigo-100 text-indigo-700",in_production:"bg-violet-100 text-violet-700",shipped:"bg-cyan-100 text-cyan-700",completed:"bg-emerald-100 text-emerald-700",delivered:"bg-emerald-100 text-emerald-700"};function b(l){return(Number(l)||0).toLocaleString("de-DE",{style:"currency",currency:"EUR"})}function x(l){if(!l)return"";const t=String(l).trim();if(!t)return"";if(/,\s*https?:\/\//i.test(t)){const r=t.split(/,(?=https?:\/\/)/i)[0]?.trim()||"";return/^https?:\/\//i.test(r)||r.startsWith("/")?r:""}return/^https?:\/\//i.test(t)||t.startsWith("/")?t:""}function g(l){if(l.size_label)return l.size_label;const t=l.sizes||{},r=Object.keys(t);if(!r.length)return"";const c=r.reduce((d,n)=>d+(Number(t[n])||0),0);return c?`${c}× (${r.join(", ")})`:r.join(", ")}function T(){const{token:l}=v(),[t,r]=o.useState(null),[c,d]=o.useState(""),[n,i]=o.useState(null);if(o.useEffect(()=>{l&&N(`/api/portal/order/${encodeURIComponent(l)}`).then(s=>{s.ok&&s.order?r(s.order):d("Bestellung nicht gefunden.")}).catch(()=>d("Bestellung nicht gefunden."))},[l]),o.useEffect(()=>{if(!n)return;const s=m=>{m.key==="Escape"&&i(null)};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[n]),c)return e.jsxs("div",{className:"mx-auto max-w-2xl px-4 py-20 text-center",children:[e.jsx("p",{className:"text-lg font-bold text-slate-900",children:"Bestellung nicht gefunden"}),e.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Bitte prüfe deinen Tracking-Link."}),e.jsx(u,{to:"/home",className:"mt-6 inline-block rounded-full bg-slate-900 px-6 py-3 text-sm font-bold text-white",children:"Zur Startseite"})]});if(!t)return e.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:e.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-slate-200 border-t-blue-600"})});const f=w[t.status]||"bg-slate-100 text-slate-600",a=t.delivery_address;return e.jsxs("div",{className:"mx-auto max-w-3xl px-4 pb-16 pt-10",children:[e.jsx(k,{title:`Bestellung ${t.order_id}`,description:"Bestellstatus und Tracking",path:`/portal/order/${l}`,noindex:!0}),e.jsxs("div",{className:"mb-5 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(u,{to:"/home",className:"text-xs font-semibold text-slate-400 hover:text-slate-600",children:"← Zur Startseite"}),e.jsx("h1",{className:"text-2xl font-black tracking-tight text-slate-900",children:t.order_id||"Bestellung"})]}),e.jsx("span",{className:`rounded-full px-4 py-1.5 text-xs font-bold uppercase tracking-wide ${f}`,children:t.status_label||t.status})]}),e.jsxs("div",{className:"rounded-3xl border border-slate-200 bg-white p-5 shadow-[0_8px_40px_rgba(15,23,42,0.06)] sm:p-7",children:[t.designs?.length?e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx("h3",{className:"text-sm font-bold text-slate-900",children:t.is_collection&&t.designs.length>1?"Kollektion":t.designs.length>1?"Artikel":"Dein Design"}),t.designs.length>1?e.jsxs("span",{className:"rounded-full bg-gradient-to-r from-indigo-500 to-violet-500 px-2.5 py-0.5 text-[10px] font-bold text-white",children:[t.designs.length," Textilien"]}):null]}),e.jsx("div",{className:"grid gap-4",style:{gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))"},children:t.designs.map((s,m)=>{const p=x(s.mockup_url);return e.jsxs("div",{className:"overflow-hidden rounded-2xl border border-slate-200 bg-slate-50",children:[p?e.jsxs("button",{type:"button",onClick:()=>i(p),className:"group relative block w-full cursor-zoom-in","aria-label":"Mockup vergrößern",children:[e.jsx("img",{src:p,alt:s.textile_name,className:"aspect-square w-full bg-slate-900 object-cover transition-transform duration-300 group-hover:scale-[1.03]"}),e.jsx("span",{className:"absolute right-2 top-2 flex h-7 w-7 items-center justify-center rounded-full bg-black/55 text-white opacity-0 transition-opacity group-hover:opacity-100",children:e.jsx(h,{className:"h-3.5 w-3.5"})})]}):e.jsx("div",{className:"flex aspect-square w-full items-center justify-center bg-slate-800 text-slate-500",children:"-"}),e.jsxs("div",{className:"p-3",children:[e.jsx("p",{className:"text-xs font-semibold text-slate-900",children:s.textile_name||"Textil"}),e.jsx("p",{className:"text-[11px] text-slate-500",children:[s.color,s.decoration_method].filter(
1Boolean).join(" · ")}),g(s)?e.jsx("p",{className:"text-[11px] text-slate-400",children:g(s)}):null,s.total_brutto?e.jsx("p",{className:"mt-1 text-xs font-bold",children:b(s.total_brutto)}):null]})]},s.id||m)})})]}):x(t.mockup_url)?e.jsxs("button",{type:"button",onClick:()=>i(x(t.mockup_url)),className:"group relative mb-6 block w-full cursor-zoom-in overflow-hidden rounded-2xl border border-slate-200 bg-slate-50","aria-label":"Mockup vergrößern",children:[e.jsx("img",{src:x(t.mockup_url),alt:"Design Mockup",className:"w-full object-contain transition-transform duration-300 group-hover:scale-[1.02]"}),e.jsxs("span",{className:"absolute right-3 top-3 flex items-center gap-1 rounded-full bg-black/60 px-2.5 py-1 text-[11px] font-semibold text-white opacity-0 transition-opacity group-hover:opacity-100",children:[e.jsx(h,{className:"h-3 w-3"})," Vergrößern"]})]}):null,e.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Gesamtbetrag"}),e.jsx("p",{className:"text-xl font-black text-slate-900",children:b(t.total_brutto)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Nettobetrag"}),e.jsx("p",{className:"text-sm font-bold text-slate-700",children:b(t.total_netto)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Bezahlung"}),t.payment_verified?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2.5 py-1 text-xs font-bold text-emerald-700",children:["Bezahlt",t.payment_method==="str
1ipe"?" (Stripe)":""]}):e.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-amber-100 px-2.5 py-1 text-xs font-semibold text-amber-700",children:t.payment_method==="invoice"?"Rechnung – Offen":t.payment_method==="prepayment"?"Vorkasse – Offen":"Zahlung ausstehend"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Erstellt"}),e.jsx("p",{className:"text-sm font-bold text-slate-700",children:t.created_at?new Date(t.created_at).toLocaleDateString("de-DE"):"–"})]})]}),t.design_token?e.jsx("div",{className:"mt-5 flex flex-wrap gap-2",children:e.jsx(u,{to:`/konfigurator?design_token=${encodeURIComponent(t.design_token)}`,className:"inline-flex rounded-full bg-slate-900 px-4 py-2 text-xs font-bold text-white",children:"Im Konfigurator laden"})}):null,(t.production_status||t.queue||t.tracking_number)&&e.jsxs("div",{className:"mt-5 grid grid-cols-2 gap-4 border-t border-slate-100 pt-5 sm:grid-cols-3",children:[t.queue&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Queue"}),e.jsx("p",{className:"text-sm font-bold text-slate-700",children:t.queue})]}),t.production_status&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Produktion"}),e.jsx("p",{className:"text-sm font-bold text-slate-700",children:t.production_status})]}),t.tracking_number&&e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Sendungsverfolgung"}),t.tracking_url?e.jsxs("a",{href:t.tracking_url,target:"_blank",rel:"noreferrer",className:"text-sm font-bold text-blue-600 underline",children:[t.carrier_name||"Tracking",": ",t.tracking_number]}):e.jsx("p",{className:"text-sm font-bold text-slate-700",children:t.tracking_number})]})]}),a&&(a.name||a.street)&&e.jsxs("div",{className:"mt-5 rounded-2xl border border-slate-100 bg-slate-50 p-4",children:[e.jsx("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Lieferadresse"}),e.jsx("p",{className:"text-sm font-semibold text-slate-800",children:a.name||t.customer_name}),e.jsx("p",{className:"text-sm text-slate-600",children:a.street}),e.jsx("p",{className:"text-sm text-slate-600",children:[a.zip,a.city].filter(Boolean).join(" ")}),e.jsx("p",{className:"text-sm text-slate-600",children:a.country||"Deutschland"})]}),t.invoice&&e.jsxs("div",{className:"mt-4 flex items-center justify-between rounded-2xl border border-slate-100 bg-slate-50 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Rechnung"}),e.jsx("p",{className:"text-sm font-bold text-slate-800",children:t.invoice.invoice_number})]}),e.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-bold ${t.invoice.is_paid?"bg-emerald-100 text-emerald-700":"bg-amber-100 text-amber-700"}`,children:t.invoice.is_paid?"Bezahlt":"Offen"})]}),t.notes&&e.jsxs("div",{className:"mt-4",children:[e.jsx("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-wide text-slate-400",children:"Anmerkungen"}),e.jsx("p",{className:"whitespace-pre-wrap text-sm text-slate-600",children:t.notes})]})]}),n&&e.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/85 p-4 backdrop-blur-sm",onClick:()=>i(null),role:"dialog","aria-modal":"true",children:[e.jsx("button",{onClick:()=>i(null),className:"absolute right-5 top-5 flex h-10 w-10 items-center justify-center rounded-full bg-white/10 text-white transition hover:bg-white/20","aria-label":"Schließen",children:e.jsx(j,{className:"h-5 w-5"})}),e.jsx("img",{src:n,alt:"Design Mockup groß",className:"max-h-[90vh] max-w-full rounded-xl object-contain shadow-2xl",onClick:s=>s.stopPropagation()})]})]})}export{T as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.