PageSourceSearch

https://luxuryleasing.de/assets/MetaCatalog-C7h8Lzjo.js

js luxuryleasing.de collected 2026-10-08 07:13:28 UTC 9,198 bytes, 14 lines download raw bytes

1import{u as f,j as e}from"./query-vendor-DVmmQ-ki.js";import{r as z,L}from"./react-vendor-BURXZ51T.js";import{B as r,R as N,g as T}from"./index-DpP3iEYK.js";import{C as i,a as n,b as u,c as j,d as w}from"./card-DwBoygcx.js";import{B as v}from"./badge-BrFuXnAq.js";import{T as U,a as A,b,c as C}from"./tabs-CH4KCsyR.js";import{A as B,b as D,a as I}from"./alert-CpDtCbP7.js";import{u as M}from"./index-Rp47IaA2.js";import{supabase as y}from"./client-BXzYhP5O.js";import{A as E}from"./arrow-left-DrlG9OEE.js";import{C as R}from"./circle-check-BavTUs4p.js";import{C as F}from"./circle-alert-BGAtDceg.js";import{C as $}from"./code-gxlq8pQZ.js";import{F as V}from"./file-text-UJur6P3r.js";import{C as x}from"./check-Dwauox-g.js";import{C as h}from"./copy-CJmodTUB.js";import{E as g}from"./external-link-Dq9xh9iT.js";import{D as q}from"./download-BqrsYkRJ.js";import"./radix-slot-BTvEbTmE.js";import"./ui-radix-LBOF5AHa.js";import"./supabase-DxfZiqN5.js";function de(){const[m,p]=z.useState(null),o="https://vbbjtsrypdfstwygrcud.supabase.co/functions/v1/meta-catalog-feed",s={xml:`${o}?format=xml`,csv:`${o}?format=csv`,xmlLuxury:`${o}?format=xml&type=luxury`,xmlBmw:`${o}?format=xml&type=bmw`},{data:t,isLoading:k,refetch:S}=f({queryKey:["meta-catalog-feed-status"],queryFn:async()=>{try{const a=await fetch(s.xml);if(!a.ok)throw new Error("Feed nicht erreichbar");return{status:"online",itemCount:((await a.text()).match(/<item>/g)||[]).length,lastChecked:new Date().toISOString()}}catch(a){return{status:"error",error:a instanceof Error?a.message:"Unbekannter Fehler",lastChecked:new Date().toISOString()}}},refetchInterval:6e4}),{data:l}=f({queryKey:["catalog-vehicle-counts"],queryFn:async()=>{const{count:a}=await y.from("vehicles").select("*",{count:"exact",head:!0}).eq("status","live"),{count:c}=await y.from("bmw_vehicles").select("*",{count:"exact",head:!0}).eq("status","live");return{luxury:a||0,bmw:c||0,total:(a||0)+(c||0)}}}),d=async(a,c)=>{await navigator.clipboard.writeText(a),p(c),M.success("URL kopiert"),setTimeout(()=>p(null),2e3)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(r,{variant:"ghost",size:"icon",asChild:!0,children:e.jsx(L,{to:"/admin/marketing",children:e.jsx(E,{className:"h-5 w-5"})})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Meta Catalog Feed"}),e.jsx("p",{className:"text-muted-foreground",children:"Automatische Synchronisation mit Facebook/Instagram Automotive Catalog"})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsx(i,{children:e.jsx(n,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Feed Status"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[k?e.jsx(N,{className:"h-4 w-4 animate-spin"}):(t==null?void 0:t.status)==="online"?e.jsx(R,{className:"h-5 w-5 text-green-500"}):e.jsx(F,{className:"h-5 w-5 text-red-500"}),e.jsx("span",{className:"text-lg font-semibold",children:(t==null?void 0:t.status)==="online"?"Online":"Fehler"})]})]}),e.jsx(r,{variant:"ghost",size:"sm",onClick:()=>S(),children:e.jsx(N,{className:"h-4 w-4"})})]})})}),e.jsx(i,{children:e.jsxs(n,{className:"pt-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Fahrzeuge im Feed"}),e.jsx("p",{className:"text-3xl font-bold mt-1",children:(l==null?void 0:l.total)||0}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[(l==null?void 0:l.luxury)||0," Luxury + ",(l==null?void 0:l.bmw)||0," BMW"]})]})}),e.jsx(i,{children:e.jsxs(n,{className:"pt-6",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Formate"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(v,{variant:"secondary",children:"XML"}),e.jsx(v,{variant:"secondary",children:"CSV"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Meta Automotive Standard"})]})})]}),e.jsxs(i,{children:[e.jsxs(u,{children:[e.jsx(j,{className:"text-lg",children:"Feed URLs"}),e.jsx(w,{children:"Kopieren Sie die URL und fügen Sie sie in Ihrer Meta Business Suite unter Catalog → Data Sources ein."})]}),e.jsx(n,{children:e.jsxs(U,{defaultValue:"xml",className:"w-full",children:[e.jsxs(A,{className:"grid w-full grid-cols-2",children:[e.jsxs(b,{value:"xml",className:"gap-2",children:[e.jsx($,{className:"h-4 w-4"}),"XML Feed"]}),e.jsxs(b,{value:"csv",className:"gap-2",children:[e.jsx(V,{className:"h-4 w-4"}),"CSV Feed"]})]}
1),e.jsxs(C,{value:"xml",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50 border",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",children:"Alle Fahrzeuge"}),e.jsx("p",{className:"text-xs text-muted-foreground truncate font-mono",children:s.xml})]}),e.jsx(r,{variant:"ghost",size:"sm",onClick:()=>d(s.xml,"xml-all"),children:m==="xml-all"?e.jsx(x,{className:"h-4 w-4"}):e.jsx(h,{className:"h-4 w-4"})}),e.jsx(r,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx("a",{href:s.xml,target:"_blank",rel:"noopener noreferrer",children:e.jsx(g,{className:"h-4 w-4"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50 border",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",children:"Nur Luxusfahrzeuge"}),e.jsx("p",{className:"text-xs text-muted-foreground truncate font-mono",children:s.xmlLuxury})]}),e.jsx(r,{variant:"ghost",size:"sm",onClick:()=>d(s.xmlLuxury,"xml-luxury"),children:m==="xml-luxury"?e.jsx(x,{className:"h-4 w-4"}):e.jsx(h,{className:"h-4 w-4"})}),e.jsx(r,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx("a",{href:s.xmlLuxury,target:"_blank",rel:"noopener noreferrer",children:e.jsx(g,{className:"h-4 w-4"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50 border",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",children:"Nur BMW Fahrzeuge"}),e.jsx("p",{className:"text-xs text-muted-foreground truncate font-mono",children:s.xmlBmw})]}),e.jsx(r,{variant:"ghost",size:"sm",onClick:()=>d(s.xmlBmw,"xml-bmw"),children:m==="xml-bmw"?e.jsx(x,{className:"h-4 w-4"}):e.jsx(h,{className:"h-4 w-4"})}),e.jsx(r,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx("a",{href:s.xmlBmw,target:"_blank",rel:"noopener noreferrer",children:e.jsx(g,{className:"h-4 w-4"})})})]})]}),e.jsx(C,{value:"csv",className:"space-y-4 mt-4",children:e.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg bg-muted/50 border",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",children:"CSV Download"}),e.jsx("p",{className:"text-xs text-muted-foreground truncate font-mono",children:s.csv})]}),e.jsx(r,{variant:"ghost",size:"sm",onClick:()=>d(s.csv,"csv"),children:m==="csv"?e.jsx(x,{className:"h-4 w-4"}):e.jsx(h,{className:"h-4 w-4"})}),e.jsx(r,{variant:"secondary",size:"sm",asChild:!0,children:e.jsxs("a",{href:s.csv,download:!0,children:[e.jsx(q,{className:"h-4 w-4 mr-2"}),"Download"]})})]})})]})})]}),e.jsxs(i,{children:[e.jsx(u,{children:e.jsx(j,{className:"text-lg",children:"Einrichtung in Meta Business Suite"})}),e.jsxs(n,{className:"space-y-4",children:[e.jsxs("ol",{className:"list-decimal list-inside space-y-3 text-sm",children:[e.jsxs("li",{children:["Öffnen Sie die"," ",e.jsx("a",{href:"https://business.facebook.com/commerce/catalogs",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Meta Commerce Manager"})]}),e.jsx("li",{children:"Erstellen Sie einen neuen Catalog (Typ: Fahrzeuge)"}),e.jsx("li",{children:'Gehen Sie zu "Data Sources" → "Add Items" → "Use Data Feeds"'}),e.jsx("li",{children:'Wählen Sie "Scheduled Feed" und fügen Sie die XML-URL ein'}),e.jsx("li",{children:'Setzen Sie das Update-Intervall auf "Täglich"'}),e.jsx("li",{children:"Verbinden Sie den Catalog mit Ihrem Facebook Pixel"})]}),e.jsxs(B,{children:[e.jsx(F,{className:"h-4 w-4"}),e.jsx(D,{children:"Hinweis"}),e.jsx(I,{children:'Der Feed wird automatisch aktualisiert, wenn Fahrzeuge hinzugefügt, bearbeitet oder auf "live" gesetzt werden. Meta ruft den Feed entsprechend Ihrem eingestellten Intervall ab.'})]})]})]}),(t==null?void 0:t.status)==="online"&&e.jsxs(i,{children:[e.jsxs(u,{children:[e.jsx(j,{className:"text-lg",children:"Feed Vorschau"}),e.jsxs(w,{children:[t.itemCount," Fahrzeuge im Feed"]})]}),e.jsx(n,{children:e.jsx("div",{className:"bg-muted/50 rounded-lg p-4 font-mono text-xs overflow-x-auto",children:e.jsx("pre",{className:"whitespace-pre-wrap text-muted-foreground",children:`<?xml version="1.0" encoding="UTF-8"?>
2<feed xmlns="http://www.w3.org/2005/Atom">
3  <title>LuxuryLeasing Vehicle Catalog</title>
4  <link href="${T()}"/>
5  <updated>${new Date().toISOString()}</updated>
6  
7  <!-- ${t.itemCount} Fahrzeuge -->
8  <item>
9    <id>LX-xxxxx</id>
10    <title>Ferrari 488 GTB</title>
11    <price>2450 EUR per month</price>
12    ...
13  </item>
14</feed>`})})})]})]})}export{de 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.