1import{n as D,k as M,u as $,r as c,j as e}from"./react-vendor-CShGlGts.js";import{s as A,B as g,aa as z,bX as B,E}from"./index-BYC0bmF9.js";import{S as v}from"./slider-BQYDOQqH.js";import"./query-BUBuIGkW.js";import"./shared-utils--gW9Kwo0.js";import"./supabase-C0joAID3.js";const C=[{key:"brot",name_de:"Brot & Aufstriche",name_en:"Bread & Spreads"},{key:"vegi_brot",name_de:"Vegetarisches Brot",name_en:"Vegetarian Bread"},{key:"apero",name_de:"Aperitif",name_en:"Aperitif"},{key:"vegi_apero",name_de:"Vegetarischer Aperitif",name_en:"Vegetarian Aperitif"},{key:"vorspeise",name_de:"Vorspeise",name_en:"Starter"},{key:"vegi_vorspeise",name_de:"Vegetarische Vorspeise",name_en:"Vegetarian Starter"},{key:"suppe",name_de:"Suppe",name_en:"Soup"},{key:"vegi_suppe",name_de:"Vegetarische Suppe",name_en:"Vegetarian Soup"},{key:"warme_vorspeise",name_de:"Warme Vorspeise",name_en:"Warm Starter"},{key:"vegi_warme_vorspeise",name_de:"Vegetarische warme Vorspeise",name_en:"Vegetarian Warm Starter"},{key:"haupt1",name_de:"Hauptgang",name_en:"Main Course"},{key:"haupt2",name_de:"Hauptgang",name_en:"Main Course"},{key:"haupt_vegi",name_de:"Vegetarischer Hauptgang",name_en:"Vegetarian Main Course"},{key:"dessert",name_de:"Dessert",name_en:"Dessert"},{key:"kaese",name_de:"Käse",name_en:"Cheese"}];function R(){const{date:s}=D(),[d,u]=M(),j=$(),[i,x]=c.useState(null),[y,h]=c.useState(!0),f=d.get("lang")||"de",t=f==="en";c.useEffect(()=>{if(s){const[n,a,r]=s.split("-").map(Number),p=new Date(n,a-1,r).toLocaleDateString("de-AT",{weekday:"short"}).slice(0,2).toUpperCase(),_=`${String(r).padStart(2,"0")}.${String(a).padStart(2,"0")}.${n}`,V=t?"-eng":"";document.title=`Menü-${p}${V}_${_}`}},[s,t]);const o=parseInt(d.get("marginTop")||"10",10),l=parseInt(d.get("marginBottom")||"15",10),b=(n,a)=>{u({lang:f,marginTop:n.toString(),marginBottom:a.toString()})};c.useEffect(()=>{s&&N()},[s]);const N=async()=>{try{h(!0);const{data:n,error:a}=await A.from("menu_day").select("*").eq("date",s).single();a?(console.error("Error fetching menu:",a),x(null)):x({date:s,...n})}catch(n){console.error("Error:",n)}finally{h(!1)}},S=n=>{const[a,r,m]=n.split("-").map(Number);return new Date(a,r-1,m).toLocaleDateString(t?"en-GB":"de-AT",{weekday:"long",year:"numeric",month:"long",day:"numeric"})},k=()=>{u({lang:t?"de":"en"})},w=n=>{if(!i)return null;const a=t?"en":"de",r=i[`${n}_${a}`]||null,m=i[`${n}_name_${a}`]||null;return i[`${n}_visible`]===!1||!r&&!m?null:{name:m,content:r}};return y?e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx("div",{children:t?"Loading menu...":"Lade Menü..."})}):i?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"no-print fixed top-4 left-4 z-50 flex flex-col gap-3 bg-background/95 backdrop-blur-sm p-4 rounded-lg shadow-lg border",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(g,{variant:"outline",size:"sm",onClick:()=>j(-1),children:[e.jsx(z,{className:"w-4 h-4 mr-2"}),t?"Back":"Zurück"]}),e.jsxs(g,{variant:"outline",size:"sm",onClick:k,children:[e.jsx(B,{className:"w-4 h-4 mr-2"}),t?"Deutsch":"English"]}),e.jsx(g,{variant:"default",size:"sm",onClick:()=>window.print(),children:t?"Print":"Drucken"})]}),e.jsxs("div",{className:"border-t pt-3 space-y-3",children:[e.jsx(E,{className:"text-xs font-medium text-muted-foreground",children:t?"Separator Spacing":"Trenner-Abstände"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs w-12",children:[t?"Top":"Oben",":"]}),e.jsx(v,{value:[o],onValueChange:([n])=>b(n,l),min:0,max:40,step:1,className:"w-32"}),e.jsxs("span",{className:"text-xs w-10",children:[o,"px"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-xs w-12",children:[t?"Bottom":"Unten",":"]}),e.jsx(v,{value:[l],onValueChange:([n])=>b(o,n),min:0,max:40,step:1,className:"w-32"}),e.jsxs("span",{className:"text-xs w-10",children:[l,"px"]})]})]})]})]}),e.jsx("style",{children:` 2 @media print { 3 body { 4 margin: 0; 5 padding: 0; 6 font-family: 'Jost', sans-serif; 7 color: #000; 8 background: white; 9 } 10 .print-page { 11 width: 100%; 12 margin: 0; 13 padding: 30px 40px; 14 box-sizing: border-box; 15 } 16 .no-print { display: none !important; } 17 } 18 19 @media screen { 20 .print-page { 21 max-width: 800px; 22 margin: 20px auto; 23 padding: 40px; 24 box-shadow: 0 0 20px rgba(0,0,0,0.1); 25 background: white; 26 min-height: calc(100vh - 40px); 27 } 28 } 29 30 .header { 31 text-align: center; 32 margin-bottom: 30px; 33 border-bottom: 2px solid #333; 34 padding-bottom: 15px; 35 } 36 37 .hotel-name { 38 font-size: 24px; 39 font-weight: bold; 40 margin-bottom: 5px; 41 letter-spacing: 1px; 42 } 43 44 .menu-title { 45 font-size: 20px; 46 color: #444; 47 margin-bottom: 5px; 48 } 49 50 .date-info { 51 font-size: 14px; 52 color: #666; 53 font-style: italic; 54 } 55 56 .menu-content { 57 line-height: 1.6; 58 font-size: 14px; 59 } 60 61 .menu-item { 62 margin-bottom: ${l}px; 63 padding-top: ${o}px; 64 padding-bottom: ${o}px; 65 border-bottom: 1px solid #eee; 66 } 67 68 .menu-label { 69 font-weight: bold; 70 color: #333; 71 margin-bottom: 5px; 72 font-size: 13px; 73 text-transform: uppercase; 74 letter-spacing: 0.5px; 75 } 76 77 .menu-text { 78 color: #444; 79 margin-left: 15px; 80 font-size: 14px; 81 line-height: 1.5; 82 font-style: italic; 83 } 84 85 .footer { 86 margin-top: 40px; 87 text-align: center; 88 font-size: 12px; 89 color: #666; 90 border-top: 1px solid #ccc; 91 padding-top: 15px; 92 } 93 `}),e.jsxs("div",{className:"print-page",children:[e.jsxs("div",{className:"header",children:[e.jsx("div",{className:"hotel-name",children:"Riederalm"}),e.jsx("div",{className:"menu-title",children:t?"Evening Menu":"Abendmenü"}),e.jsx("div",{className:"date-info",children:S(i.date)})]}),e.jsx("div",{className:"menu-content",children:C.map(n=>{const a=w(n.key);return a?e.jsxs("div",{className:"menu-item",children:[e.jsx("div",{className:"menu-label",children:t?n.name_en:n.name_de}),e.jsxs("div",{className:"menu-text",children:[a.name&&e.jsx("strong",{children:a.name}),a.name&&a.content&&e.jsx("br",{}),a.content]}
93)]},n.key):null})}),e.jsxs("div",{className:"footer",children:["Riederalm - ",t?"Evening Menu":"Abendmenü"]})]})]}):e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx("div",{children:t?"No menu data found for this date.":"Keine Menüdaten für dieses Datum gefunden."})})}export{R 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.