PageSourceSearch

https://www.usfh.ch/_next/static/chunks/8966-51ae9aefa7d832e5.js

js usfh.ch collected 2026-10-08 04:05:46 UTC 83,891 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8966],{24680:(e,s,t)=>{t.d(s,{A:()=>c});var r=t(20136),a=t(17868),n=t(96391),l=t(21968);let i="[email protected]";function c(e){let{open:s,onClose:t,subject:c}=e;if(!s)return null;let o="mailto:".concat(i).concat(c?"?subject=".concat(encodeURIComponent(c)):"");return(0,r.jsxs)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:t}),(0,r.jsxs)("div",{className:"relative bg-white rounded-2xl shadow-xl w-full max-w-sm p-6",children:[(0,r.jsx)("button",{onClick:t,className:"absolute top-3 right-3 text-gray-400 hover:text-gray-600","aria-label":"Schlie\xdfen",children:(0,r.jsx)(a.A,{className:"w-5 h-5"})}),(0,r.jsx)("h3",{className:"text-lg font-black text-gray-900 mb-1",children:"Kontaktieren Sie uns"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mb-5",children:"F\xfcr Versand oder Abholung im Laden."}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("a",{href:o,className:"flex items-center gap-3 rounded-xl border border-gray-200 hover:border-[#2C5F2E] hover:bg-[#F0F5F0] px-4 py-3 transition-colors",children:[(0,r.jsx)(n.A,{className:"w-5 h-5 text-[#2C5F2E] flex-shrink-0"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-bold text-gray-900",children:"E-Mail"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 truncate",children:i})]})]}),(0,r.jsxs)("a",{href:"tel:+41786066105",className:"flex items-center gap-3 rounded-xl border border-gray-200 hover:border-[#2C5F2E] hover:bg-[#F0F5F0] px-4 py-3 transition-colors",children:[(0,r.jsx)(l.A,{className:"w-5 h-5 text-[#2C5F2E] flex-shrink-0"}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-bold text-gray-900",children:"Telefon"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"078 606 61 05"})]})]})]})]})]})}},56988:(e,s,t)=>{t.d(s,{O:()=>Q});var r=t(20136),a=t(72004),n=t(46053),l=t(62865),i=t(21968),c=t(57818),o=t(36444),d=t(65891),m=t(51216),x=t(46735),h=t(11373),u=t(1411),p=t(57719),g=t(43641),b=t(36301),j=t(71416),f=t(96534),N=t(22610),w=t(24224),y=t(87156),v=t(7020),E=t(70841),F=t(80036),C=t(13029),k=t(43238),S=t(96391),A=t(1145),_=t(10083),I=t(87871),B=t(69317),P=t(61855),T=t(49209),z=t(56230);let D=a.forwardRef((e,s)=>{let{className:t,orientation:a="horizontal",decorative:n=!0,...l}=e;return(0,r.jsx)(T.b,{ref:s,decorative:n,orientation:a,className:(0,z.cn)("shrink-0 bg-border","horizontal"===a?"h-[1px] w-full":"h-full w-[1px]",t),...l})});D.displayName=T.b.displayName;var R=t(52228),L=t(16960);let M=a.forwardRef((e,s)=>{let{className:t,...a}=e;return(0,r.jsx)(R.bL,{ref:s,className:(0,z.cn)("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...a,children:(0,r.jsx)(R.C1,{className:(0,z.cn)("flex items-center justify-center text-current"),children:(0,r.jsx)(L.A,{className:"h-4 w-4"})})})});M.displayName=R.bL.displayName;var O=t(43577),H=t(24680),Z=t(39083),J=t(98526),K=t(17215),W=t(83931),V=t(17283);let U=e=>{let{amount:s,currency:t,orderData:n,onSuccess:i,onError:o,disabled:d,secretKey:m}=e,h=(0,K.useStripe)(),u=(0,K.useElements)(),[p,g]=(0,a.useState)(!1),[b,j]=(0,a.useState)("idle"),[N,w]=(0,a.useState)(""),[y,v]=(0,a.useState)("".concat(n.customerInfo.firstName," ").concat(n.customerInfo.lastName)),E=async e=>{if(e.preventDefault(),!h||!u||d)return;g(!0),j("processing"),w("");let r=u.getElement(K.CardElement);try{let e=await fetch("/api/stripe/create-payment-intent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:Math.round(100*s),currency:t.toLowerCase(),orderData:n,stripeSecretKey:m})});if(!e.ok)throw Error("Error creating payment intent");let{clientSecret:a}=await e.json(),{error:l,paymentIntent:c}=await h.confirmCardPayment(a,{payment_method:{card:r,billing_details:{name:y||"".concat(n.customerInfo.firstName," ").concat(n.customerInfo.lastName),email:n.customerInfo.email,address:{line1:n.customerInfo.address,city:n.customerInfo.city,postal_code:n.customerInfo.postalCode,country:"CH"}}}});l?(j("error"),w(l.message||"Error procesando el pago"),o(l.message||"Error procesando el pago")):"succeeded"===c.status&&(j("success"),i(c))}catch(s){j("error");let e=s.message||"Error inesperado al procesar el pago";w(e),o(e)}finally{g(!1)}};return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("form",{onSubmit:E,className:"space-y-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(B.J,{htmlFor:"cardholderName",className:"text-sm font-medium text-gray-700",children:"Name auf der Karte"}),(0,r.jsx)(I.p,{id:"cardholderName",type:"text",value:y,onChange:e=>v(e.target.value),placeholder:"Vollst\xe4ndiger Name wie auf der Karte",disabled:d||p,className:"w-full bg-white text-black"})]}),(0,r.jsx)("div",{className:"p-4 border border-gray-300 rounded-lg bg-white shadow-sm",children:(0,r.jsx)(K.CardElement,{options:{style:{base
1:{fontSize:"16px",color:"#424770",fontFamily:'"Helvetica Neue", Helvetica, sans-serif',fontSmoothing:"antialiased","::placeholder":{color:"#aab7c4"}},invalid:{color:"#9e2146"}},hidePostalCode:!0}})}),"error"===b&&N&&(0,r.jsxs)("div",{className:"flex items-center space-x-2 text-red-600 bg-red-50 p-3 rounded-lg border border-red-200",children:[(0,r.jsx)(x.A,{className:"w-4 h-4 flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm",children:N})]}),"success"===b&&(0,r.jsxs)("div",{className:"flex items-center space-x-2 text-green-600 bg-green-50 p-3 rounded-lg border border-green-200",children:[(0,r.jsx)(c.A,{className:"w-4 h-4 flex-shrink-0"}),(0,r.jsx)("span",{className:"text-sm",children:"Zahlung erfolgreich abgeschlossen!"})]}),(0,r.jsx)(A.$,{type:"submit",disabled:!h||p||"success"===b||d||!y.trim(),className:"w-full bg-blue-600 hover:bg-blue-700 disabled:opacity-50",size:"lg",children:p?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Zahlung wird verarbeitet..."]}):"success"===b?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.A,{className:"w-4 h-4 mr-2"}),"Zahlung abgeschlossen"]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.A,{className:"w-4 h-4 mr-2"}),s.toFixed(2)," CHF mit Karte bezahlen"]})})]}),(0,r.jsxs)("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2 text-sm text-gray-600",children:[(0,r.jsx)(l.A,{className:"w-4 h-4 text-green-600"}),(0,r.jsx)("span",{className:"font-medium",children:"Sichere Zahlung"})]}),(0,r.jsxs)("div",{className:"text-xs text-gray-500 space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,r.jsx)(W.A,{className:"w-3 h-3"}),(0,r.jsx)("span",{children:"256-bit SSL Verschl\xfcsselung"})]}),(0,r.jsx)("div",{children:"• Visa, Mastercard, American Express"}),(0,r.jsx)("div",{children:"• 3D Secure Authentifizierung"}),(0,r.jsx)("div",{children:"• PCI DSS Level 1 zertifiziert"})]})]})]})};function $(e){let s=e.publishableKey||V.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY;if(!s)return(0,r.jsxs)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2 text-red-600",children:[(0,r.jsx)(x.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{className:"text-sm font-medium",children:"Stripe nicht konfiguriert"})]}),(0,r.jsx)("p",{className:"text-xs text-red-500 mt-1",children:"Bitte konfigurieren Sie die Stripe-Schl\xfcssel im Admin-Panel unter Zahlung."})]});let t=(0,J.c)(s);return(0,r.jsx)(K.Elements,{stripe:t,children:(0,r.jsx)(U,{...e})})}var G=t(17283);let q=e=>{let{amount:s,orderData:t,secretKey:n,pmcId:l,disabled:i,returnUrl:c,onSaveOrder:o,onError:d}=e,m=(0,K.useStripe)(),[h,u]=(0,a.useState)(!1),[p,g]=(0,a.useState)(""),b=async()=>{if(m&&!i){u(!0),g("");try{let e=await o(),r=await fetch("/api/stripe/create-payment-intent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({amount:Math.round(100*s),currency:"chf",orderData:{...t,orderId:e},stripeSecretKey:n,paymentMethodConfigId:l||void 0,paymentMethodTypes:l?void 0:["twint"]})});if(!r.ok){let e=await r.json();throw Error(e.error||"Fehler beim Erstellen der Zahlung")}let{clientSecret:a}=await r.json(),i="".concat(c).concat(c.includes("?")?"&":"?","twint_order=").concat(e,"&twint_total=").concat(s);localStorage.setItem("cart-should-be-cleared","true");let{error:x}=await m.confirmTwintPayment(a,{payment_method:{billing_details:{name:"".concat(t.customerInfo.firstName," ").concat(t.customerInfo.lastName),email:t.customerInfo.email}},return_url:i});x&&(g(x.message||"TWINT Zahlung fehlgeschlagen"),d(x.message||"TWINT Zahlung fehlgeschlagen"))}catch(s){let e=s.message||"Unbekannter Fehler";g(e),d(e)}finally{u(!1)}}};return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"bg-gray-50 border border-gray-200 rounded-xl p-4 text-sm text-gray-600 space-y-1",children:[(0,r.jsx)("p",{className:"font-semibold text-gray-800",children:"Wie funktioniert es?"}),(0,r.jsxs)("p",{children:["\uD83D\uDCF1 ",(0,r.jsx)("strong",{children:"Mobile:"})," Sie werden direkt zur TWINT-App weitergeleitet"]}),(0,r.jsxs)("p",{children:["\uD83D\uDDA5️ ",(0,r.jsx)("strong",{children:"Desktop:"})," Ein QR-Code erscheint zum Scannen mit der App"]}
1)]}),p&&(0,r.jsxs)("div",{className:"flex items-center gap-2 text-red-600 bg-red-50 p-3 rounded-lg border border-red-200 text-sm",children:[(0,r.jsx)(x.A,{className:"w-4 h-4 flex-shrink-0"}),p]}),(0,r.jsx)(A.$,{onClick:b,disabled:!m||h||i,className:"w-full min-h-14 h-auto py-3 text-base font-bold bg-black hover:bg-neutral-800 text-white shadow-xl transition-all duration-300",children:h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Weiterleitung zu TWINT..."]}):(0,r.jsxs)(r.Fragment,{children:["Via TWINT bezahlen \xb7 ",s.toFixed(2)," CHF"]})})]})};function X(e){let s=e.publishableKey||G.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY;if(!s)return(0,r.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-lg text-sm text-red-600",children:"Stripe-Schl\xfcssel nicht konfiguriert"});let t=(0,J.c)(s);return(0,r.jsx)(K.Elements,{stripe:t,children:(0,r.jsx)(q,{...e})})}function Q(e){var s,t,T,z,R,L;let{cart:J,onBackToStore:K,onClearCart:W,onAddToCart:V,onRemoveFromCart:U}=e,[G,q]=(0,a.useState)({firstName:"",lastName:"",email:"",phone:"",address:"",city:"",postalCode:"",canton:"",notes:"",country:"CH"}),[Q,Y]=(0,a.useState)("pending"),[ee,es]=(0,a.useState)(null),[et,er]=(0,a.useState)({}),[ea,en]=(0,a.useState)(!1),[el,ei]=(0,a.useState)(!1),[ec,eo]=(0,a.useState)("invoice"),[ed,em]=(0,a.useState)(!1),[ex,eh]=(0,a.useState)({firstName:"",lastName:"",address:"",city:"",postalCode:"",canton:""}),[eu,ep]=(0,a.useState)({}),[eg,eb]=(0,a.useState)(!1),[ej,ef]=(0,a.useState)({password:"",confirmPassword:"",saveData:!1}),[eN,ew]=(0,a.useState)(!1),[ey,ev]=(0,a.useState)(!1),[eE,eF]=(0,a.useState)({}),[eC,ek]=(0,a.useState)(!1),[eS,eA]=(0,a.useState)(null),e_=(0,n.useRouter)(),[eI,eB]=(0,a.useState)(!1),[eP,eT]=(0,a.useState)(!1),[ez,eD]=(0,a.useState)("idle"),[eR,eL]=(0,a.useState)(""),[eM,eO]=(0,a.useState)(!0),[eH,eZ]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=()=>{let e=window.scrollY;e<10?eO(!0):e>eH&&e>100?eO(!1):e<eH&&eO(!0),eZ(e)};return window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)},[eH]);let[eJ,eK]=(0,a.useState)(!1),[eW,eV]=(0,a.useState)({email:"",password:""}),[eU,e$]=(0,a.useState)(!1),[eG,eq]=(0,a.useState)({}),[eX,eQ]=(0,a.useState)(!1),[eY,e0]=(0,a.useState)("idle"),[e2,e1]=(0,a.useState)(""),[e5,e4]=(0,a.useState)(0),[e3,e6]=(0,a.useState)({zone:"",range:""}),[e8,e7]=(0,a.useState)(["CH"]),[e9,se]=(0,a.useState)({enable_paypal:!1,enable_stripe:!1,enable_twint:!1,enable_invoice:!0,enable_pickup:!1,paypal_email:"",stripe_publishable_key:"",stripe_secret_key:"",stripe_pmc_id:"",twint_phone:"",bank_iban:"",bank_holder:"",bank_name:""}),[ss,st]=(0,a.useState)("idle"),[sr,sa]=(0,a.useState)(""),[sn,sl]=(0,a.useState)(!1),[si,sc]=(0,a.useState)(""),[so,sd]=(0,a.useState)(!1),[sm,sx]=(0,a.useState)("idle"),[sh,su]=(0,a.useState)(""),[sp,sg]=(0,a.useState)({}),sb="https://web.lweb.ch/templettedhop";(0,a.useEffect)(()=>{fetch("/api/payment-settings").then(e=>e.json()).then(e=>{if(e.success&&e.settings){let s=e.settings;se(s),s.enable_invoice?eo("invoice"):s.enable_paypal?eo("paypal"):s.enable_stripe?eo("stripe"):s.enable_twint?eo("twint"):s.enable_pickup&&eo("pickup")}}).catch(()=>{}),fetch("/api/shipping-settings").then(e=>e.json()).then(e=>{if(e.success&&e.zones){let s=[],t=!1;for(let r of e.zones)if(r.enabled){if("*"===r.countries){t=!0;continue}r.countries.split(",").map(e=>e.trim()).forEach(e=>{e&&!s.includes(e)&&s.push(e)})}t&&s.push("OTHER"),s.length>0&&(e7(s),q(e=>({...e,country:s.includes(e.country)?e.country:s[0]||"CH"})))}}).catch(()=>{})},[]),(0,a.useEffect)(()=>{let e=new URLSearchParams(window.location.search),s=e.get("redirect_status"),t=e.get("twint_order"),r=e.get("twint_total");"succeeded"===s&&t?(Y("completed"),es({id:t,status:"PAID",customerInfo:G,cart:[],total:r?parseFloat(r):0}),W&&W(),window.history.replaceState({},"",window.location.pathname)):"failed"===s&&t&&(Y("error"),window.history.replaceState({},"",window.location.pathname))},[]),(0,a.useEffect)(()=>{if(0===J.length||"pickup"===ec||J.every(e=>"gutschein"===e.item_type)||J.length>0&&J.every(e=>e.shipping_on_request)){e4(0),e6({zone:"",range:""});return}let e=J.reduce((e,s)=>{var t;return e+(s.shipping_on_request?0:null!=(t=s.weight_kg)?t:.5)*s.quantity},0);fetch("".concat(sb,"/calculate_shipping.php"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({country:G.country,weight_kg:e})}).then(e=>e.json()).then(e=>{if(e.success){var s,t,r;e4(null!=(s=e.price)?s:0),e6({zone:null!=(t=e.zone)?t:"",range:null!=(r=e.range)?r:""})}}).catch(()=>{})},[J,G.country,ec]),(0,a.useEffect)(()=>{(async()=>{console.log("\uD83D\uDD0D CheckoutPage: Inicializando autenticaci\xf3n...");let e=localStorage.getItem("user-session-token");e?(console.log("\uD83C\uDFAB Token encontrado:",e.substring(0,20)+"..."),await sj(e)||(console.log("❌ Token inv\xe1lido, limpiando..."),localStorage.removeItem("user-session-token"),sN())):(console.log("❌ No hay token, cargando info guardada..."),sN())})()},[]);let sj=async e=>{try{console.log("\uD83D\uDD04 Verificando token con el servidor...");let s=await fetch("".concat(sb,"/get_user.php"),{method:"POST",mode:"cors",credentials:"omit",headers:{"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest","Cache-Control":"no-cache"},body:JSON.stringify({sessionToken:e})});if(console.log("\uD83D\uDCE1 Respuesta del servidor:",s.status),!s.ok){let e=await s.text();return console.error("❌ Error HTTP:",s.status,e),!1}let t=await s.json();if(console.log("✅ Datos del usuario recibidos:",t),t.success&&t.user)return ek(!0),eA({id:t.user.user_id||t.user.id,email:t.user.email,firstName:t.user.first_name||"",lastName:t.user.last_name||"",phone:t.user.phone||"",address:t.user.address||"",city:t.user.city||"",postalCode:t.user.postal_code||"",canton:t.user.canton||"",notes:t.user.notes||""}),q({firstName:t.user.first_name||"",lastName:t.user.last_name||"",email:t.user.email||"",phone:t.user.phone||"",address:t.user.address||"",city:t.user.city||"",postalCode:t.user.postal_code||"",canton:t.user.canton||"",country:t.user.country||"CH",notes:t.user.notes||""}),eb(!1),eD("idle"),console.log("✅ Usuario logueado exitosamente"),!0;return console.error("❌ Respuesta inv\xe1lida del servidor:",t),!1}catch(e){return console.error("❌ Error verificando token:",e),!1}},sf=async()=>{console.log("\uD83D\uDD04 Recargando datos del usuario...");let e=localStorage.getItem("user-session-token");e&&eC&&await sj(e)&&console.log("✅ Datos del usuario recargados exitosamente")},sN=()=>{let e=localStorage.getItem("cantina-customer-info");if(e)try{let s=JSON.parse(e);q(s),console.log("✅ Info del cliente cargada desde localStorage")}catch(e){console.error("❌ Error cargando info del cliente:",e)}};(0,a.useEffect)(()=>{!eC&&Object.values(G).some(e=>""!==e.trim())&&localStorage.setItem("cantina-customer-info",JSON.stringify(G))},[G,eC]);let sw=()=>J.reduce((e,s)=>e+s.price*s.quantity,0),sy=()=>"pickup"===ec?0:e5,sv=()=>J.length>0&&J.every(e=>"gutschein"===e.item_type)||"pickup"===ec?sw():.5*Math.ceil((sw()+e5)/.5),sE=async()=>{try{eT(!0),eD("idle"),console.log("\uD83D\uDD04 Creando cuenta de usuario...");let e={email:G.email,password:ej.password,firstName:G.firstName,lastName:G.lastName,phone:G.phone,address:G.address,city:G.city,postalCode:G.postalCode,canton:G.canton,notes:G.notes};console.log("\uD83D\uDCE4 Enviando datos:",e);let s=await fetch("".concat(sb,"/create_user.php"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)});if(console.log("\uD83D\uDCE1 Respuesta recibida:",s.status,s.statusText),!s.ok){let e=await s.text();throw console.error("❌ Error HTTP:",s.status,e),Error("HTTP ".concat(s.status,": ").concat(s.statusText))}let t=await s.json();if(console.log("✅ Respuesta de creaci\xf3n de cuenta:",t),t.success&&t.sessionToken){let e=t.sessionToken;return console.log("\uD83D\uDCBE Guardando token:",e.substring(0,20)+"..."),localStorage.setItem("user-session-token",e),ek(!0),eA({id:t.user.id,email:t.user.email,firstName:t.user.firstName||"",lastName:t.user.lastName||"",phone:t.user.phone||"",address:t.user.address||"",city:t.user.city||"",postalCode:t.user.postalCode||"",canton:t.user.canton||"",notes:t.user.notes||""}),eD("success"),eL("\xa1Cuenta creada exitosamente! Ahora est\xe1s conectado."),eb(!1),ef({password:"",confirmPassword:"",saveData:!1}),t.user.id}throw Error(t.error||"Error creating account")}catch(s){console.error("❌ Error creando cuenta:",s),eD("error");let e="Error desconocido";throw s instanceof Error?e=s.message:"string"==typeof s&&(e=s),e.includes("Load failed")||e.includes("Failed to fetch")?e="Error de conexi\xf3n. Verifique su conexi\xf3n a internet y que el servidor est\xe9 disponible.":e.includes("CORS")&&(e="Error de configuraci\xf3n del servidor (CORS). Contacte al administrador."),eL("Error al crear la cuenta: ".concat(e)),s}finally{eT(!1)}},sF=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{eg&&ej.saveData&&!eC&&await sE();let s=s_({userId:(null==eS?void 0:eS.id)||null,...e}),t=await fetch("".concat(sb,"/add_order.php"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}
1),r=await t.json();if(!r.success)throw Error(r.error||"Error saving order");return r.data}catch(e){throw console.error("Error saving order to database:",e),e}},sC=async()=>{if(sB()&&sD()&&(!eg||sP())){en(!0);try{let e=await sF();Y("completed"),es({id:e.orderNumber,status:"INVOICE_SENT",customerInfo:G,cart:J,total:sv(),createdAt:e.createdAt}),W&&W(),localStorage.removeItem("cantina-cart")}catch(e){console.error("Error saving order:",e),alert("Error al guardar el pedido: ".concat(e.message)),Y("error")}finally{en(!1)}}},sk=async()=>{if(sB()&&(!eg||sP())){en(!0);try{let e=await sF({paymentMethod:"pickup",paymentStatus:"pending",shippingCost:0});Y("completed"),es({id:e.orderNumber,status:"PICKUP_RESERVED",customerInfo:G,cart:J,total:sv(),createdAt:e.createdAt}),W&&W(),localStorage.removeItem("cantina-cart")}catch(e){console.error("Error saving pickup order:",e),alert("Fehler beim Speichern der Bestellung: ".concat(e.message)),Y("error")}finally{en(!1)}}},sS=async()=>{if(!sB())throw Error("Bitte f\xfcllen Sie alle Pflichtfelder aus");if(!sD())throw Error("Rechnungsadresse ung\xfcltig");if(eg&&!sP())throw Error("Konto-Daten ung\xfcltig");return(await sF({paymentMethod:"stripe_twint",paymentStatus:"pending"})).orderNumber},sA=async()=>{if(sB()&&sD()&&(!eg||sP())){en(!0);try{let e=await sF({paymentMethod:"twint",paymentStatus:"pending"});Y("completed"),es({id:e.orderNumber,status:"TWINT_PENDING",customerInfo:G,cart:J,total:sv(),createdAt:e.createdAt,twintPhone:e9.twint_phone}),W&&W(),localStorage.removeItem("cantina-cart")}catch(e){console.error("Error saving TWINT order:",e),alert("Fehler beim Speichern der Bestellung: ".concat(e.message)),Y("error")}finally{en(!1)}}},s_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{customerInfo:G,billingAddress:ed?ex:null,cart:J,totalAmount:sv(),shippingCost:sy(),paymentMethod:ec,paymentStatus:"invoice"===ec||"pickup"===ec?"pending":"completed",userId:(null==eS?void 0:eS.id)||null,...e}},sI=async e=>{try{var s,t,r;st("success"),en(!0);let a=null;eg&&ej.saveData&&!eC&&(a=await sE());let n={...s_(),paymentMethod:"stripe",paymentStatus:"completed",stripePaymentIntentId:e.id,stripeChargeId:(null==(r=e.charges)||null==(t=r.data)||null==(s=t[0])?void 0:s.id)||null,userId:a||(null==eS?void 0:eS.id)||null},l=await sF(n);Y("completed"),es({id:l.orderNumber,status:"COMPLETED",customerInfo:G,cart:J,total:sv(),createdAt:l.createdAt,paymentMethod:"stripe",paymentId:e.id}),W&&W(),localStorage.removeItem("cantina-cart"),console.log("✅ Stripe payment completed successfully:",e.id)}catch(e){console.error("❌ Error saving Stripe order:",e),st("error"),sa("Error al guardar el pedido: ".concat(e.message)),Y("error")}finally{en(!1)}},sB=()=>{let e={};return G.firstName.trim()||(e.firstName="Vorname ist erforderlich"),G.lastName.trim()||(e.lastName="Nachname ist erforderlich"),G.email.trim()||(e.email="E-Mail ist erforderlich"),G.phone.trim()||(e.phone="Telefon ist erforderlich"),"pickup"!==ec&&(G.address.trim()||(e.address="Adresse ist erforderlich"),G.city.trim()||(e.city="Stadt ist erforderlich"),G.postalCode.trim()||(e.postalCode="PLZ ist erforderlich"),G.canton.trim()||(e.canton="Kanton ist erforderlich")),G.email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(G.email)&&(e.email="Ung\xfcltige E-Mail-Adresse"),er(e),0===Object.keys(e).length},sP=()=>{let e={};return ej.password.length<6&&(e.password="Passwort muss mindestens 6 Zeichen haben"),ej.password!==ej.confirmPassword&&(e.confirmPassword="Passw\xf6rter stimmen nicht \xfcberein"),ej.saveData||(e.saveData="Bitte best\xe4tigen Sie, dass Sie ein Konto erstellen m\xf6chten"),eF(e),0===Object.keys(e).length},sT=(e,s)=>{q(t=>({...t,[e]:s})),et[e]&&er(s=>({...s,[e]:void 0}))},sz=(e,s)=>{eh(t=>({...t,[e]:s})),eu[e]&&ep(s=>({...s,[e]:void 0}))},sD=()=>{if(!ed)return!0;let e={};return ex.firstName.trim()||(e.firstName="Vorname ist erforderlich"),ex.lastName.trim()||(e.lastName="Nachname ist erforderlich"),ex.address.trim()||(e.address="Adresse ist erforderlich"),ex.city.trim()||(e.city="Stadt ist erforderlich"),ex.canton.trim()||(e.canton="Kanton ist erforderlich"),ep(e),0===Object.keys(e).length},sR=(0,a.useMemo)(()=>sB(),[G,ec]),sL=(0,a.useMemo)(()=>!ed||sD(),[ed,ex]),sM=(0,a.useMemo)(()=>!eg||sP(),[eg,ej]),sO=async()=>
1{if(sB()&&sP())try{await sE()}catch(e){}},sH=async()=>{try{eQ(!0),e0("idle"),eq({}),console.log("\uD83D\uDD04 Iniciando sesi\xf3n...");let e={};if(eW.email.trim()||(e.email="E-Mail ist erforderlich"),eW.password.trim()||(e.password="Passwort ist erforderlich"),eW.email&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(eW.email)&&(e.email="Ung\xfcltige E-Mail-Adresse"),Object.keys(e).length>0)return void eq(e);let s=await fetch("".concat(sb,"/login_user.php"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({email:eW.email,password:eW.password})});if(console.log("\uD83D\uDCE1 Respuesta de login:",s.status),!s.ok){let e=await s.text();throw console.error("❌ Error HTTP:",s.status,e),Error("HTTP ".concat(s.status,": ").concat(s.statusText))}let t=await s.json();if(console.log("✅ Respuesta de login:",t),t.success&&t.sessionToken){let e=t.sessionToken;console.log("\uD83D\uDCBE Guardando token de login:",e.substring(0,20)+"..."),localStorage.setItem("user-session-token",e),ek(!0),eA({id:t.user.id,email:t.user.email,firstName:t.user.firstName||"",lastName:t.user.lastName||"",phone:t.user.phone||"",address:t.user.address||"",city:t.user.city||"",postalCode:t.user.postal_code||"",canton:t.user.canton||"",notes:t.user.notes||""}),q({firstName:t.user.firstName||"",lastName:t.user.lastName||"",email:t.user.email||"",phone:t.user.phone||"",address:t.user.address||"",city:t.user.city||"",postalCode:t.user.postal_code||"",canton:t.user.canton||"",country:t.user.country||"CH",notes:t.user.notes||""}),e0("success"),e1("\xa1Anmeldung erfolgreich!"),eK(!1),eV({email:"",password:""}),console.log("✅ Login exitoso")}else throw Error(t.error||"Login failed")}catch(s){console.error("❌ Error en login:",s),e0("error");let e="Error desconocido";s instanceof Error?e=s.message:"string"==typeof s&&(e=s),e.includes("Invalid email or password")?e="E-Mail oder Passwort ist falsch":(e.includes("Load failed")||e.includes("Failed to fetch"))&&(e="Verbindungsfehler. Bitte versuchen Sie es erneut."),e1(e)}finally{eQ(!1)}},sZ=async()=>{try{sd(!0),sx("idle"),sg({}),console.log("\uD83D\uDD04 Iniciando reset de contrase\xf1a...");let e={};if(si.trim()||(e.email="E-Mail-Adresse ist erforderlich"),si&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(si)&&(e.email="Ung\xfcltige E-Mail-Adresse"),Object.keys(e).length>0)return void sg(e);let s=await fetch("".concat(sb,"/reset_password.php"),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({email:si.trim().toLowerCase()})});if(console.log("\uD83D\uDCE1 Respuesta de reset:",s.status),!s.ok){let e=await s.text();throw console.error("❌ Error HTTP:",s.status,e),Error("HTTP ".concat(s.status,": ").concat(s.statusText))}let t=await s.json();if(console.log("✅ Respuesta de reset:",t),t.success)sx("success"),su(t.message||"Ein neues Passwort wurde an Ihre E-Mail-Adresse gesendet."),sc(""),console.log("✅ Reset de contrase\xf1a exitoso");else throw Error(t.error||"Password reset failed")}catch(s){console.error("❌ Error en reset de contrase\xf1a:",s),sx("error");let e="Error desconocido";s instanceof Error?e=s.message:"string"==typeof s&&(e=s),e.includes("Load failed")||e.includes("Failed to fetch")?e="Verbindungsfehler. Bitte versuchen Sie es erneut.":e.includes("CORS")&&(e="Serverfehler. Bitte kontaktieren Sie den Support."),su(e)}finally{sd(!1)}};if("completed"===Q){let e=(null==ee?void 0:ee.status)==="TWINT_PENDING",s=(null==ee?void 0:ee.status)==="INVOICE_SENT",t=(null==ee?void 0:ee.status)==="PICKUP_RESERVED";return(0,r.jsxs)("div",{className:"min-h-screen bg-[#F0F1F3]",children:[(0,r.jsx)("div",{className:"bg-white border-b border-[#E5E5E5] px-4 py-3",children:(0,r.jsxs)("div",{className:"container mx-auto max-w-4xl flex items-center justify-between",children:[(0,r.jsx)("div",{className:"flex items-center gap-3",children:(0,r.jsx)("img",{src:"/Security_n.png",alt:"Logo",className:"h-10 w-auto object-contain"})}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-[#888]",children:[(0,r.jsx)(l.A,{className:"w-4 h-4 text-[#2C5F2E]"}),(0,r.jsx)("span",{children:"SSL gesichert"})]})]})}),(0,r.jsxs)("div",{className:"container mx-auto max-w-2xl px-4 py-12",children:[(0,r.jsxs)("div",{className:"text-center mb-8",children:[(0,r.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-[#2C5F2E] mb-5 shadow-lg",children:e?(0,r.jsx)(i.A,{className:"w-9 h-9 text-white"}):(0,r.jsx)(c.A,{className:"w-10 h-10 text-white"})}),(0,r.jsx)("h1",{className:"text-3xl font-black text-[#1A1A1A] tracking-tight mb-2",children:e?"Bestellung aufgegeben!":t?"Bestellung reserviert!":"Bestellung best\xe4tigt!"}),(0,r.jsx)("p",{className:"text-[#666] text-base max-w-md mx-auto",children:e?"Bitte kontaktieren Sie uns telefonisch, um die Zahlung zu vereinbaren und Ihre Bestellung zu best\xe4tigen.":s?"Vielen Dank! Wir senden Ihnen die Rechnung per E-Mail.":t?"Vielen Dank! Ihre Bestellung ist f\xfcr Sie reserviert. Sie bezahlen bei der Abholung im Gesch\xe4ft – wir melden uns, sobald sie bereit ist.":"Vielen Dank! Sie erhalten in K\xfcrze eine Best\xe4tigungs-E-Mail."})]}),(0,r.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-[#
1EBEBEB] overflow-hidden mb-5",children:[(0,r.jsxs)("div",{className:"bg-[#1A1A1A] px-6 py-4 flex items-center gap-2",children:[(0,r.jsx)(o.A,{className:"w-4 h-4 text-[#aaa]"}),(0,r.jsx)("span",{className:"text-sm font-bold text-white tracking-wide uppercase",children:"Bestelldetails"})]}),(0,r.jsxs)("div",{className:"px-6 py-4 space-y-3",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-[#F0F0F0]",children:[(0,r.jsx)("span",{className:"text-sm text-[#888]",children:"Bestellnummer"}),(0,r.jsxs)("span",{className:"font-mono font-black text-[#1A1A1A] text-lg tracking-widest",children:["#",null==ee?void 0:ee.id]})]}),(0,r.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-[#F0F0F0]",children:[(0,r.jsx)("span",{className:"text-sm text-[#888]",children:"Gesamtbetrag"}),(0,r.jsxs)("span",{className:"font-black text-xl text-[#1A1A1A]",children:[(null==ee||null==(R=ee.total)?void 0:R.toFixed(2))||"0.00"," CHF"]})]}),(0,r.jsxs)("div",{className:"flex justify-between items-center py-2 border-b border-[#F0F0F0]",children:[(0,r.jsx)("span",{className:"text-sm text-[#888]",children:"Zahlungsstatus"}),(0,r.jsx)("span",{className:"text-sm font-bold px-3 py-1 rounded-full ".concat(e?"bg-orange-100 text-orange-700":s?"bg-blue-100 text-blue-700":"bg-green-100 text-[#2C5F2E]"),children:e?"Ausstehend":s?"Rechnung":"Bezahlt"})]}),eC&&(0,r.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,r.jsx)("span",{className:"text-sm text-[#888]",children:"Konto"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-[#2C5F2E]",children:"Gespeichert"})]})]})]}),e&&(0,r.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-[#EBEBEB] overflow-hidden mb-5",children:[(0,r.jsxs)("div",{className:"bg-black px-6 py-4 flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-sm font-bold text-white tracking-wide uppercase",children:"Jetzt per Telefon bezahlen"}),(0,r.jsx)(i.A,{className:"h-5 w-5 text-white"})]}),(0,r.jsxs)("div",{className:"px-6 py-5 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"w-6 h-6 rounded-full bg-black text-white text-xs font-black flex items-center justify-center flex-shrink-0 mt-0.5",children:"1"}),(0,r.jsxs)("p",{className:"text-sm text-[#444]",children:["Kontaktieren Sie uns unter der folgenden Nummer – wir vereinbaren die Zahlung direkt mit Ihnen (z.B. ",(0,r.jsx)("strong",{children:"TWINT"})," oder andere App)"]})]}),(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"w-6 h-6 rounded-full bg-black text-white text-xs font-black flex items-center justify-center flex-shrink-0 mt-0.5",children:"2"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("p",{className:"text-sm text-[#444] mb-2",children:["Betrag ",(0,r.jsxs)("strong",{children:[null==ee||null==(L=ee.total)?void 0:L.toFixed(2)," CHF"]})," – unsere Telefonnummer:"]}),(0,r.jsx)("div",{className:"bg-[#F5F5F5] rounded-xl px-5 py-3 text-center border border-[#E0E0E0]",children:(0,r.jsx)("p",{className:"text-2xl font-black text-[#1A1A1A] tracking-wider",children:null==ee?void 0:ee.twintPhone})})]})]}),(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("span",{className:"w-6 h-6 rounded-full bg-black text-white text-xs font-black flex items-center justify-center flex-shrink-0 mt-0.5",children:"3"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("p",{className:"text-sm text-[#444] mb-2",children:["Geben Sie als ",(0,r.jsx)("strong",{children:"Mitteilung / Referenz"})," ein:"]}),(0,r.jsx)("div",{className:"bg-[#F5F5F5] rounded-xl px-5 py-3 text-center border border-[#E0E0E0]",children:(0,r.jsxs)("p",{className:"text-2xl font-black text-[#1A1A1A] tracking-widest",children:["#",null==ee?void 0:ee.id]})})]})]}),(0,r.jsx)("p",{className:"text-xs text-[#999] bg-orange-50 border border-orange-200 rounded-lg px-4 py-3",children:"Die Bestellnummer als Referenz ist wichtig, damit wir Ihre Zahlung zuordnen k\xf6nnen."})]})]}),!e&&(0,r.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-[#
1EBEBEB] px-6 py-4 mb-5 flex items-center gap-3",children:[(0,r.jsx)(d.A,{className:"w-5 h-5 text-[#2C5F2E] flex-shrink-0"}),(0,r.jsx)("p",{className:"text-sm text-[#555]",children:s?"Der Verk\xe4ufer wird Sie per E-Mail oder Telefon kontaktieren, um die Bestellung abzuschlie\xdfen.":"Ihre Bestellung wird innerhalb von 2–3 Werktagen versendet."})]}),(0,r.jsxs)(A.$,{onClick:K,className:"w-full bg-[#2C5F2E] hover:bg-[#1A4520] text-white font-bold py-4 rounded-xl text-base shadow-lg transition-all",children:[(0,r.jsx)(m.A,{className:"w-4 h-4 mr-2"}),"Zur\xfcck zum Shop"]})]})]})}return"error"===Q?(0,r.jsxs)("div",{className:"min-h-screen bg-[#F0F1F3]",children:[(0,r.jsx)("div",{className:"bg-white border-b border-[#E5E5E5] px-4 py-3",children:(0,r.jsxs)("div",{className:"container mx-auto max-w-4xl flex items-center justify-between",children:[(0,r.jsx)("img",{src:"/Security_n.png",alt:"Logo",className:"h-10 w-auto object-contain"}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-[#888]",children:[(0,r.jsx)(l.A,{className:"w-4 h-4 text-[#2C5F2E]"}),(0,r.jsx)("span",{children:"SSL gesichert"})]})]})}),(0,r.jsxs)("div",{className:"container mx-auto max-w-2xl px-4 py-12",children:[(0,r.jsxs)("div",{className:"text-center mb-8",children:[(0,r.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-red-600 mb-5 shadow-lg",children:(0,r.jsx)(x.A,{className:"w-10 h-10 text-white"})}),(0,r.jsx)("h1",{className:"text-3xl font-black text-[#1A1A1A] tracking-tight mb-2",children:"Fehler bei der Bestellung"}),(0,r.jsx)("p",{className:"text-[#666] text-base",children:"Es gab ein Problem beim Verarbeiten Ihrer Zahlung. Bitte versuchen Sie es erneut."})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(A.$,{onClick:()=>Y("pending"),className:"w-full bg-[#2C5F2E] hover:bg-[#1A4520] text-white font-bold py-4 rounded-xl text-base",children:"Erneut versuchen"}),(0,r.jsx)(A.$,{onClick:K,variant:"outline",className:"w-full rounded-xl py-4",children:"Zur\xfcck zum Shop"})]})]})]}):(0,r.jsxs)("div",{className:"min-h-screen bg-[#F0F1F3]",children:[(0,r.jsx)("div",{className:"bg-white shadow-sm border-b border-[#E0E0E0] sticky top-0 z-30 flex-shrink-0 transition-transform duration-300 ".concat(eM?"translate-y-0":"-translate-y-full"),children:(0,r.jsxs)("div",{className:"container mx-auto px-4 max-w-7xl h-32 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("button",{onClick:K,className:"w-9 h-9 flex items-center justify-center rounded-xl bg-gray-100 text-gray-600 hover:bg-[#2C5F2E] hover:text-white transition-all",children:(0,r.jsx)(h.A,{className:"w-4 h-4"})}),(0,r.jsx)("img",{src:"/Security_n.png",alt:"Logo",className:"h-28 w-auto object-contain hidden sm:block"}),(0,r.jsx)("span",{className:"sm:hidden",style:{fontFamily:"'Rubik Dirt', sans-serif",color:"#1A1A1A",fontSize:"1.1rem"},children:"Warenkorb"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-[#888]",children:[(0,r.jsx)(l.A,{className:"w-4 h-4 text-[#2C5F2E]"}),(0,r.jsx)("span",{children:"SSL gesichert"})]})]})}),(0,r.jsxs)("div",{className:"container mx-auto px-4 max-w-7xl py-8",children:[eC&&eS&&(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 bg-[#F8FAF8] border border-[#2C5F2E]/20 rounded-2xl px-5 py-4 mb-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-full bg-[#2C5F2E] flex items-center justify-center flex-shrink-0",children:(0,r.jsxs)("span",{className:"text-white text-sm font-black",children:[null==(t=eS.firstName)||null==(s=t[0])?void 0:s.toUpperCase(),null==(z=eS.lastName)||null==(T=z[0])?void 0:T.toUpperCase()]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[11px] font-semibold text-[#2C5F2E] uppercase tracking-widest",children:"Angemeldet"}),(0,r.jsxs)("p",{className:"font-black text-[#1A1A1A] text-sm leading-tight",children:[eS.firstName," ",eS.lastName]}),(0,r.jsx)("p",{className:"text-xs text-[#888]",children:eS.email})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(0,r.jsxs)("button",{onClick:()=>e_.push("/profile?back="+encodeURIComponent(window.location.pathname+window.location.search)),className:"flex flex-col items-center gap-0.5 px-3 py-1.5 rounded-xl border border-[#2C5F2E]/30 text-[#2C5F2E] hover:bg-[#2C5F2E] hover:text-white transition-colors",children:[(0,r.jsx)(u.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{className:"text-[9px] font-semibold leading-none sm:hidden",children:"Profil"}),(0,r.jsx)("span",{className:"hidden sm:inline text-xs",children:"Mein Profil"})]}),(0,r.jsxs)("button",{onClick:()=>{console.log("\uD83D\uDEAA Cerrando sesi\xf3n..."),localStorage.removeItem("user-session-token"),ek(!1),eA(null),eb(!1),eD("idle")},className:"flex flex-col items-center gap-0.5 px-3 py-1.5 rounded-xl border border-red-200 text-red-500 hover:bg-red-500 hover:text-white transition-colors",children:[(0,r.jsx)(p.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{className:"text-[9px] font-semibold leading-none sm:hidden",children:"Logout"}),(0,r.jsx)("span",{className:"hidden sm:inline text-xs",children:"Abmelden"})]})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,r.jsxs)("div",{className:"space-y-6",children:[!eC&&(0,r.jsx)(_.Zp,{className:"rounded-2xl shadow-sm border-[#2C5F2E]/20 bg-[#F8FCF8]",children:(0,r.jsxs)(_.Wu,{className:"pt-4 pb-4",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2 mb-3",children:[(0,r.jsx)(M,{id:"showLogin",checked:eJ,onCheckedChange:e=>{eK(e),e&&eb(!1)}}),(0,r.jsxs)(B.J,{htmlFor:"showLogin",className:"flex items-center cursor-pointer font-semibold text-[#2C5F2E]",children:[(0,r.jsx)(u.A,{className:"w-4 h-4 mr-2"}),"Ich habe bereits ein Konto — Anmelden"]})]}),eJ&&(0,r.jsxs)("div",{className:"space-y-4 bg-white p-4 rounded-xl border border-[#2C5F2E]/15",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"loginEmail",children:"E-Mail *"}),(0,r.jsx)(I.p,{id:"loginEmail",type:"email",value:eW.email,onChange:e=>eV(s=>({...s,email:e.target.value})),className:"bg-white ".concat(eG.email?"border-red-500":""),placeholder:"[email protected]"}),eG.email&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eG.email})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(B.J,{htmlFor:"loginPassword",children:"Passwort *"}),(0,r.jsx)(A.$,{type:"button",variant:"link",size:"sm",onClick:()=>{sl(!0),sc(eW.email),sx("idle"),su(""),sg({})},className:"text-xs text-[#2C5F2E] hover:text-[#1A4520] p-0 h-auto",children:"Passwort vergessen?"})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(I.p,{id:"loginPassword",type:eU?"text":"password",value:eW.password,onChange:e=>eV(s=>({...s,password:e.target.value})),className:"bg-white pr-10 ".concat(eG.password?"border-red-500":""),placeholder:"Ihr Passwort"}),(0,r.jsx)(A.$,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>e$(!eU),children:eU?(0,r.jsx)(g.A,{className:"w-4 h-4"}):(0,r.jsx)(b.A,{className:"w-4 h-4"})})]}),eG.password&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eG.password})]}),(0,r.jsx)("div",{className:"pt-4 border-t",children:(0,r.jsx)(A.$,{onClick:sH,disabled:eX||!eW.email||!eW.password,className:"w-full bg-[#2C5F2E] hover:bg-[#1A4520] text-white",children:eX?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Anmeldung l\xe4uft..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.A,{className:"w-4 h-4 mr-2"}),"Anmelden"]})})}),"error"===eY&&(0,r.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(x.A,{className:"w-5 h-5 text-red-600 mr-2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-red-700 font-medium",children:"Anmeldung fehlgeschlagen"}),(0,r.jsx)("p",{className:"text-red-600 text-sm mt-1",children:e2})]})]})}),(0,r.jsxs)("div",{className:"bg-[#F0F9F0] p-3 rounded-xl border border-[#2C5F2E]/15",children:[(0,r.jsx)("p",{className:"text-sm text-[#2C5F2E] font-semibold",children:"Nach der Anmeldung:"}),(0,r.jsxs)("ul",{className:"text-sm text-[#2C5F2E]/80 mt-1 space-y-1",children:[(0,r.jsx)("li",{children:"• Ihre Daten werden automatisch ausgef\xfcllt"}),(0,r.jsx)("li",{children:"• Schnellerer Checkout-Prozess"}),(0,r.jsx)("li",{children:"• Zugriff auf Ihr Profil und Bestellhistorie"})]})]})]})]})}
1),(0,r.jsxs)(_.Zp,{className:"rounded-2xl shadow-sm border-[#EBEBEB]",children:[(0,r.jsx)(_.aR,{children:(0,r.jsxs)(_.ZB,{className:"flex items-center justify-between text-xl",children:[(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(u.A,{className:"w-5 h-5 mr-2 text-[#2C5F2E]"}),"Pers\xf6nliche Daten"]}),!eC&&(0,r.jsxs)("div",{className:"flex items-center text-xs text-green-600",children:[(0,r.jsx)("div",{className:"w-2 h-2 bg-green-500 rounded-full mr-1 animate-pulse"}),"Automatisch gespeichert"]}),eC&&(0,r.jsxs)("div",{className:"flex items-center text-xs text-blue-600",children:[(0,r.jsx)(c.A,{className:"w-4 h-4 mr-1"}),"Aus Ihrem Konto geladen"]})]})}),(0,r.jsxs)(_.Wu,{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"firstName",children:"Vorname *"}),(0,r.jsx)(I.p,{id:"firstName",value:G.firstName,onChange:e=>sT("firstName",e.target.value),className:"bg-white ".concat(et.firstName?"border-red-500":"")}),et.firstName&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:et.firstName})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"lastName",children:"Nachname *"}),(0,r.jsx)(I.p,{id:"lastName",value:G.lastName,onChange:e=>sT("lastName",e.target.value),className:"bg-white ".concat(et.lastName?"border-red-500":"")}),et.lastName&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:et.lastName})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"email",children:"E-Mail *"}),(0,r.jsx)(I.p,{id:"email",type:"email",value:G.email,onChange:e=>sT("email",e.target.value),className:"bg-white ".concat(et.email?"border-red-500":""),disabled:eC}),et.email&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:et.email})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"phone",children:"Telefon *"}),(0,r.jsx)(I.p,{id:"phone",value:G.phone,onChange:e=>sT("phone",e.target.value),className:"bg-white ".concat(et.phone?"border-red-500":""),placeholder:"+41 XX XXX XX XX"}),et.phone&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:et.phone})]}),eC&&(0,r.jsx)("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(c.A,{className:"w-5 h-5 text-green-600 mr-2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-green-700 font-medium",children:"Sie sind angemeldet!"}),(0,r.jsx)("p",{className:"text-green-600 text-sm",children:"Ihre Daten werden automatisch f\xfcr zuk\xfcnftige Bestellungen gespeichert."})]})]})}),!1]})]}
1),(0,r.jsxs)(_.Zp,{className:"rounded-2xl shadow-sm border-[#EBEBEB]",children:[(0,r.jsx)(_.aR,{children:(0,r.jsxs)(_.ZB,{className:"flex items-center text-xl",children:[(0,r.jsx)(j.A,{className:"w-5 h-5 mr-2 text-[#2C5F2E]"}),"Lieferadresse"]})}),(0,r.jsxs)(_.Wu,{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"country",children:"Land *"}),(0,r.jsx)("select",{id:"country",value:G.country,onChange:e=>sT("country",e.target.value),className:"flex h-10 w-full rounded-md border border-input bg-white px-3 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",children:["CH","DE","AT","FR","IT","NL","BE","ES","PL","PT","CZ","DK","SE","FI","NO","HU","RO","HR","SK","SI","LU","LI","OTHER"].filter(e=>e8.includes(e)).map(e=>{var s;return(0,r.jsx)("option",{value:e,children:null!=(s=({CH:"\uD83C\uDDE8\uD83C\uDDED Schweiz",DE:"\uD83C\uDDE9\uD83C\uDDEA Deutschland",AT:"\uD83C\uDDE6\uD83C\uDDF9 \xd6sterreich",FR:"\uD83C\uDDEB\uD83C\uDDF7 Frankreich",IT:"\uD83C\uDDEE\uD83C\uDDF9 Italien",NL:"\uD83C\uDDF3\uD83C\uDDF1 Niederlande",BE:"\uD83C\uDDE7\uD83C\uDDEA Belgien",ES:"\uD83C\uDDEA\uD83C\uDDF8 Spanien",PL:"\uD83C\uDDF5\uD83C\uDDF1 Polen",PT:"\uD83C\uDDF5\uD83C\uDDF9 Portugal",CZ:"\uD83C\uDDE8\uD83C\uDDFF Tschechien",DK:"\uD83C\uDDE9\uD83C\uDDF0 D\xe4nemark",SE:"\uD83C\uDDF8\uD83C\uDDEA Schweden",FI:"\uD83C\uDDEB\uD83C\uDDEE Finnland",NO:"\uD83C\uDDF3\uD83C\uDDF4 Norwegen",HU:"\uD83C\uDDED\uD83C\uDDFA Ungarn",RO:"\uD83C\uDDF7\uD83C\uDDF4 Rum\xe4nien",HR:"\uD83C\uDDED\uD83C\uDDF7 Kroatien",SK:"\uD83C\uDDF8\uD83C\uDDF0 Slowakei",SI:"\uD83C\uDDF8\uD83C\uDDEE Slowenien",LU:"\uD83C\uDDF1\uD83C\uDDFA Luxemburg",LI:"\uD83C\uDDF1\uD83C\uDDEE Liechtenstein",OTHER:"\uD83C\uDF0D Andere"})[e])?s:e},e)})}),(0,r.jsxs)("p",{className:"mt-1.5 text-xs text-[#888]",children:["F\xfcr Lieferungen in andere L\xe4nder"," ",(0,r.jsx)("a",{href:"mailto:[email protected]?subject=Anfrage%20internationale%20Lieferung",className:"text-[#2C5F2E] font-semibold underline hover:text-[#1A4520]",children:"kontaktieren Sie uns bitte direkt"}),"."]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"address",children:"Stra\xdfe und Hausnummer *"}),(0,r.jsx)(I.p,{id:"address",value:G.address,onChange:e=>sT("address",e.target.value),className:"bg-white ".concat(et.address?"border-red-500":"")}),et.address&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:et.address})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"postalCode",children:"PLZ *"}),(0,r.jsx)(I.p,{id:"postalCode",value:G.postalCode,onChange:e=>sT("postalCode",e.target.value),className:"bg-white ".concat(et.postalCode?"border-red-500":""),placeholder:"1234"}),et.postalCode&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:et.postalCode})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"city",children:"Stadt *"}),(0,r.jsx)(I.p,{id:"city",value:G.city,onChange:e=>sT("city",e.target.value),className:"bg-white ".concat(et.city?"border-red-500":"")}),et.city&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:et.city})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"canton",children:"Kanton *"}),(0,r.jsx)(I.p,{id:"canton",value:G.canton,onChange:e=>sT("canton",e.target.value),className:"bg-white ".concat(et.canton?"border-red-500":""),placeholder:"z.B. Z\xfcrich, Bern, Basel..."}),et.canton&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:et.canton})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"notes",children:"Anmerkungen (optional)"}),(0,r.jsx)(P.T,{id:"notes",value:G.notes,onChange:e=>sT("notes",e.target.value),placeholder:"Besondere Lieferhinweise...",rows:3,className:"bg-white"})]})]})]}
1),(0,r.jsx)(_.Zp,{className:"rounded-2xl shadow-sm border-[#EBEBEB]",children:(0,r.jsxs)(_.Wu,{className:"pt-6",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,r.jsx)(M,{id:"differentBillingAddress",checked:ed,onCheckedChange:e=>{em(e),e||(eh({firstName:"",lastName:"",address:"",city:"",postalCode:"",canton:""}),ep({}))}}),(0,r.jsxs)(B.J,{htmlFor:"differentBillingAddress",className:"flex items-center cursor-pointer",children:[(0,r.jsx)(f.A,{className:"w-4 h-4 mr-2 text-[#2C5F2E]"}),"Rechnungsadresse anders als Lieferadresse"]})]}),ed&&(0,r.jsxs)("div",{className:"space-y-4 bg-[#F0F9F0] p-4 rounded-xl border border-[#2C5F2E]/20",children:[(0,r.jsx)("h4",{className:"font-semibold text-[#2C5F2E] mb-3",children:"Rechnungsadresse"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"billingFirstName",children:"Vorname *"}),(0,r.jsx)(I.p,{id:"billingFirstName",value:ex.firstName,onChange:e=>sz("firstName",e.target.value),className:"bg-white ".concat(eu.firstName?"border-red-500":"")}),eu.firstName&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eu.firstName})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"billingLastName",children:"Nachname *"}),(0,r.jsx)(I.p,{id:"billingLastName",value:ex.lastName,onChange:e=>sz("lastName",e.target.value),className:"bg-white ".concat(eu.lastName?"border-red-500":"")}),eu.lastName&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eu.lastName})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"billingAddress",children:"Stra\xdfe und Hausnummer *"}),(0,r.jsx)(I.p,{id:"billingAddress",value:ex.address,onChange:e=>sz("address",e.target.value),className:"bg-white ".concat(eu.address?"border-red-500":"")}),eu.address&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eu.address})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"billingPostalCode",children:"PLZ *"}),(0,r.jsx)(I.p,{id:"billingPostalCode",value:ex.postalCode,onChange:e=>sz("postalCode",e.target.value),className:"bg-white ".concat(eu.postalCode?"border-red-500":""),placeholder:"1234"}),eu.postalCode&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eu.postalCode})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"billingCity",children:"Stadt *"}),(0,r.jsx)(I.p,{id:"billingCity",value:ex.city,onChange:e=>sz("city",e.target.value),className:"bg-white ".concat(eu.city?"border-red-500":"")}),eu.city&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eu.city})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"billingCanton",children:"Kanton *"}),(0,r.jsx)(I.p,{id:"billingCanton",value:ex.canton,onChange:e=>sz("canton",e.target.value),className:"bg-white ".concat(eu.canton?"border-red-500":""),placeholder:"z.B. Z\xfcrich, Bern, Basel..."}),eu.canton&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eu.canton})]}),(0,r.jsx)("div",{className:"bg-[#E8F5E9] p-3 rounded-xl border border-[#2C5F2E]/15",children:(0,r.jsxs)("p",{className:"text-sm text-[#2C5F2E]",children:[(0,r.jsx)("strong",{children:"Hinweis:"})," Die Rechnungsadresse wird nur f\xfcr die Rechnungsstellung verwendet und nicht in der Datenbank gespeichert."]})})]})]})}),!eC&&(0,r.jsx)(_.Zp,{className:"rounded-2xl shadow-sm border-[#
1EBEBEB]",children:(0,r.jsxs)(_.Wu,{className:"pt-6",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2 mb-4",children:[(0,r.jsx)(M,{id:"createAccount",checked:eg,onCheckedChange:e=>{eb(e),e&&eK(!1)}}),(0,r.jsxs)(B.J,{htmlFor:"createAccount",className:"flex items-center cursor-pointer",children:[(0,r.jsx)(N.A,{className:"w-4 h-4 mr-2 text-[#2C5F2E]"}),"Konto erstellen und Daten f\xfcr zuk\xfcnftige Bestellungen speichern"]})]}),eg&&(0,r.jsxs)("div",{className:"space-y-4 bg-[#F0F9F0] p-4 rounded-xl border border-[#2C5F2E]/15",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"password",children:"Passwort *"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(I.p,{id:"password",type:eN?"text":"password",value:ej.password,onChange:e=>ef(s=>({...s,password:e.target.value})),className:"bg-white pr-10 ".concat(eE.password?"border-red-500":""),placeholder:"Mindestens 6 Zeichen"}),(0,r.jsx)(A.$,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>ew(!eN),children:eN?(0,r.jsx)(g.A,{className:"w-4 h-4"}):(0,r.jsx)(b.A,{className:"w-4 h-4"})})]}),eE.password&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eE.password})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"confirmPassword",children:"Passwort best\xe4tigen *"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(I.p,{id:"confirmPassword",type:ey?"text":"password",value:ej.confirmPassword,onChange:e=>ef(s=>({...s,confirmPassword:e.target.value})),className:"bg-white pr-10 ".concat(eE.confirmPassword?"border-red-500":""),placeholder:"Passwort wiederholen"}),(0,r.jsx)(A.$,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 hover:bg-transparent",onClick:()=>ev(!ey),children:ey?(0,r.jsx)(g.A,{className:"w-4 h-4"}):(0,r.jsx)(b.A,{className:"w-4 h-4"})})]}),eE.confirmPassword&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eE.confirmPassword})]}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(M,{id:"saveData",checked:ej.saveData,onCheckedChange:e=>ef(s=>({...s,saveData:e}))}),(0,r.jsx)(B.J,{htmlFor:"saveData",className:"text-sm cursor-pointer",children:"Ich m\xf6chte ein Konto erstellen und meine Daten f\xfcr zuk\xfcnftige Bestellungen speichern"})]}),eE.saveData&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:eE.saveData}),(0,r.jsxs)("div",{className:"pt-4 border-t",children:[(0,r.jsx)(A.$,{onClick:sO,disabled:eP||!ej.password||!ej.confirmPassword,className:"w-full bg-green-600 hover:bg-green-700 text-white",children:eP?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Konto wird erstellt..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(N.A,{className:"w-4 h-4 mr-2"}),"Konto jetzt erstellen"]})}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-2 text-center",children:"Sie k\xf6nnen Ihr Konto jetzt erstellen oder sp\xe4ter beim Bezahlen"})]}),"error"===ez&&(0,r.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(x.A,{className:"w-5 h-5 text-red-600 mr-2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-red-700 font-medium",children:"Error al crear la cuenta"}),(0,r.jsx)("p",{className:"text-red-600 text-sm mt-1",children:eR})]})]})}),(0,r.jsxs)("div",{className:"bg-[#F0F9F0] p-3 rounded-xl border border-[#2C5F2E]/15",children:[(0,r.jsx)("p",{className:"text-sm text-[#2C5F2E] font-semibold",children:"Vorteile eines Kontos:"}),(0,r.jsxs)("ul",{className:"text-sm text-[#2C5F2E]/80 mt-1 space-y-1",children:[(0,r.jsx)("li",{children:"• Automatisches Ausf\xfcllen bei zuk\xfcnftigen Bestellungen"}),(0,r.jsx)("li",{children:"• Bestellhistorie einsehen"}),(0,r.jsx)("li",{children:"• Adressdaten verwalten"}),(0,r.jsx)("li",{children:"• Schnellerer Checkout"})]})]})]})]})})]}),(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)(_.Zp,{className:"rounded-2xl shadow-sm border-[#
1EBEBEB]",children:[(0,r.jsx)(_.aR,{children:(0,r.jsxs)(_.ZB,{className:"flex items-center text-xl",children:[(0,r.jsx)(w.A,{className:"w-5 h-5 mr-2 text-[#2C5F2E]"}),"Ihre Bestellung"]})}),(0,r.jsxs)(_.Wu,{children:[(0,r.jsx)("div",{className:"space-y-4",children:J.map(e=>(0,r.jsx)("div",{className:"flex items-center space-x-4 p-3 bg-gray-50 rounded-2xl border border-gray-100",children:(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsx)("h4",{className:"font-semibold text-sm line-clamp-2 transition-colors ".concat("gutschein"===e.item_type?"cursor-default text-gray-900":"cursor-pointer text-[#2C5F2E] hover:text-[#1e4220]"),onClick:()=>{"gutschein"!==e.item_type&&e_.push("/product/".concat(e.id))},children:e.name}),(0,r.jsxs)("span",{className:"text-sm font-bold text-[#2C5F2E] whitespace-nowrap flex-shrink-0",children:[(e.price*e.quantity).toFixed(2)," CHF"]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(A.$,{size:"sm",variant:"outline",onClick:()=>{U&&U(e.id)},className:"h-8 w-8 p-0 bg-white hover:bg-gray-100",disabled:!U,children:(0,r.jsx)(y.A,{className:"w-3 h-3"})}),(0,r.jsx)("span",{className:"font-medium text-sm min-w-[2rem] text-center",children:e.quantity}),(0,r.jsx)(A.$,{size:"sm",variant:"outline",onClick:()=>{V&&V(e)},className:"h-8 w-8 p-0 bg-white hover:bg-gray-100",disabled:!V,children:(0,r.jsx)(v.A,{className:"w-3 h-3"})})]}),(0,r.jsx)(A.$,{size:"sm",variant:"ghost",onClick:()=>(e=>{if(U)for(let s=0;s<e.quantity;s++)U(e.id)})(e),className:"text-red-600 hover:text-red-800 hover:bg-red-50 ",disabled:!U,children:(0,r.jsx)(E.A,{className:"w-4 h-4"})})]})]})},e.id))}),(0,r.jsx)(D,{className:"my-6"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"Zwischensumme:"}),(0,r.jsxs)("span",{children:[sw().toFixed(2)," CHF"]})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{children:"pickup"===ec?"Abholung:":"Versand:"}),(0,r.jsx)("span",{children:"pickup"===ec?(0,r.jsx)("span",{className:"font-semibold",children:"Im Gesch\xe4ft"}):0===sy()?(0,r.jsx)("span",{className:"font-semibold",children:"0.00 CHF"}):(0,r.jsxs)("span",{className:"font-semibold",children:[sy().toFixed(2)," CHF"]})})]}),"pickup"!==ec&&e3.zone&&(0,r.jsxs)("div",{className:"text-xs text-gray-500",children:[e3.zone," \xb7 ",e3.range]}),"pickup"!==ec&&J.some(e=>e.shipping_on_request)&&(0,r.jsxs)("div",{className:"text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded-lg px-2.5 py-2",children:[(0,r.jsx)("p",{className:"mb-2",children:"F\xfcr einzelne Artikel (Versand auf Anfrage) wird der Versand separat vereinbart."}),(0,r.jsx)("button",{type:"button",onClick:()=>ei(!0),className:"inline-flex items-center gap-1.5 bg-amber-600 hover:bg-amber-700 text-white text-xs font-semibold px-3 py-1.5 rounded-full transition-colors",children:"Kontaktieren"})]}),(0,r.jsx)(H.A,{open:el,onClose:()=>ei(!1),subject:"Versand-/Abholanfrage"}),(0,r.jsx)(D,{}),(0,r.jsxs)("div",{className:"flex justify-between text-xl font-black",children:[(0,r.jsx)("span",{children:"Gesamt:"}),(0,r.jsxs)("span",{className:"text-[#2C5F2E]",children:[sv().toFixed(2)," CHF"]})]})]})]})]}),(0,r.jsx)(_.Zp,{className:"bg-[#F0F9F0] border-[#2C5F2E]/25 rounded-2xl",children:(0,r.jsxs)(_.Wu,{className:"p-6",children:[(0,r.jsx)("h3",{className:"font-semibold text-[#2C5F2E] mb-2",children:"\uD83D\uDCE6 Versandinformationen"}),(0,r.jsxs)("ul",{className:"text-sm text-[#2C5F2E]/80 space-y-1",children:[(0,r.jsx)("li",{children:"• Lieferzeit: 2-3 Werktage"}),(0,r.jsx)("li",{children:"• Versand aus 9745 Sevelen"}),e3.zone&&(0,r.jsxs)("li",{children:["• Zone: ",e3.zone," \xb7 ",e3.range]})]})]})}
1),(0,r.jsxs)(_.Zp,{className:"rounded-2xl shadow-sm border-[#EBEBEB]",children:[(0,r.jsx)(_.aR,{children:(0,r.jsxs)(_.ZB,{className:"flex items-center text-xl",children:[(0,r.jsx)(f.A,{className:"w-5 h-5 mr-2 text-[#2C5F2E]"}),"Zahlungsart w\xe4hlen"]})}),(0,r.jsxs)(_.Wu,{children:[(0,r.jsxs)("div",{className:"space-y-2 mb-6",children:[e9.enable_paypal&&(0,r.jsxs)("div",{onClick:()=>eo("paypal"),className:"flex items-center gap-3 border rounded-xl px-4 py-3 cursor-pointer transition-all ".concat("paypal"===ec?"border-[#2C5F2E] bg-[#F0F9F0]":"border-gray-200 hover:border-gray-300 bg-white"),children:[(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 flex-shrink-0 ".concat("paypal"===ec?"border-[#2C5F2E] bg-[#2C5F2E]":"border-gray-300"),children:"paypal"===ec&&(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full mx-auto mt-0.5"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"font-semibold text-sm text-gray-900",children:"PayPal"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Sofortige Zahlung mit PayPal – Sie werden weitergeleitet"})]}),(0,r.jsx)("img",{src:"/0014294_paypal-express-payment-plugin.png",alt:"PayPal",className:"h-8 w-auto object-contain flex-shrink-0"})]}),e9.enable_stripe&&(0,r.jsxs)("div",{onClick:()=>eo("stripe"),className:"flex items-center gap-3 border rounded-xl px-4 py-3 cursor-pointer transition-all ".concat("stripe"===ec?"border-[#2C5F2E] bg-[#F0F9F0]":"border-gray-200 hover:border-gray-300 bg-white"),children:[(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 flex-shrink-0 ".concat("stripe"===ec?"border-[#2C5F2E] bg-[#2C5F2E]":"border-gray-300"),children:"stripe"===ec&&(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full mx-auto mt-0.5"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"font-semibold text-sm text-gray-900",children:"Kreditkarte"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Visa, Mastercard, AMEX – sichere SSL-Zahlung"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 750 471",width:"42",height:"26",children:[(0,r.jsx)("rect",{width:"750",height:"471",rx:"40",fill:"#fff",stroke:"#e0e0e0",strokeWidth:"20"}),(0,r.jsx)("path",{d:"M278 333L313 141h56L334 333z",fill:"#00579F"}
1),(0,r.jsx)("path",{d:"M524 146c-11-4-28-9-50-9-55 0-93 29-94 71-1 31 28 48 49 58 22 11 29 18 29 27 0 15-17 22-33 22-22 0-34-3-52-11l-7-4-8 47c13 6 37 11 62 11 58 0 96-28 96-73 0-25-15-43-47-59-20-10-32-17-32-27 0-9 10-19 33-19 18 0 32 4 43 8l5 3 8-46z",fill:"#00579F"}),(0,r.jsx)("path",{d:"M616 141h-43c-13 0-23 4-29 18l-82 174h58l12-32h71l7 32h51L616 141zm-68 116l22-59 12 59h-34z",fill:"#00579F"}),(0,r.jsx)("path",{d:"M222 141l-54 131-6-29-18-93c-3-13-12-17-23-18h-88l-1 4c21 5 40 13 55 22l47 178h59l90-195h-61z",fill:"#00579F"})]}),(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 750 471",width:"42",height:"26",children:[(0,r.jsx)("rect",{width:"750",height:"471",rx:"40",fill:"#fff",stroke:"#e0e0e0",strokeWidth:"20"}),(0,r.jsx)("circle",{cx:"280",cy:"235",r:"140",fill:"#EB001B"}),(0,r.jsx)("circle",{cx:"470",cy:"235",r:"140",fill:"#F79E1B"}),(0,r.jsx)("path",{d:"M375 103a140 140 0 0 1 0 265 140 140 0 0 1 0-265z",fill:"#FF5F00"})]})]})]}),e9.enable_stripe&&e9.stripe_publishable_key&&(0,r.jsxs)("div",{onClick:()=>eo("twint_stripe"),className:"flex items-center gap-3 border rounded-xl px-4 py-3 cursor-pointer transition-all ".concat("twint_stripe"===ec?"border-[#2C5F2E] bg-[#F0F9F0]":"border-gray-200 hover:border-gray-300 bg-white"),children:[(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 flex-shrink-0 ".concat("twint_stripe"===ec?"border-[#2C5F2E] bg-[#2C5F2E]":"border-gray-300"),children:"twint_stripe"===ec&&(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full mx-auto mt-0.5"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("p",{className:"font-semibold text-sm text-gray-900",children:["TWINT ",(0,r.jsx)("span",{className:"text-[10px] bg-green-100 text-green-700 font-bold px-1.5 py-0.5 rounded ml-1",children:"QR-Code"})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"QR-Code scannen oder App-Weiterleitung – via Stripe"})]}),(0,r.jsx)("img",{src:"/twint-logo-original.svg",alt:"TWINT",className:"h-7 w-auto object-contain flex-shrink-0"})]}),e9.enable_twint&&(0,r.jsxs)("div",{onClick:()=>eo("twint"),className:"flex items-center gap-3 border rounded-xl px-4 py-3 cursor-pointer transition-all ".concat("twint"===ec?"border-[#2C5F2E] bg-[#F0F9F0]":"border-gray-200 hover:border-gray-300 bg-white"),children:[(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 flex-shrink-0 ".concat("twint"===ec?"border-[#2C5F2E] bg-[#2C5F2E]":"border-gray-300"),children:"twint"===ec&&(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full mx-auto mt-0.5"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("p",{className:"font-semibold text-sm text-gray-900",children:["Per Telefon ",(0,r.jsx)("span",{className:"text-[10px] bg-gray-100 text-gray-500 font-bold px-1.5 py-0.5 rounded ml-1",children:"z.B. TWINT oder andere App"})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Sie erhalten unsere Telefonnummer – Zahlung nach Absprache"})]}),(0,r.jsx)("img",{src:"/twint-logo.svg",alt:"Telefon",className:"h-7 w-auto object-contain flex-shrink-0"})]}),e9.enable_invoice&&(0,r.jsxs)("div",{onClick:()=>eo("invoice"),className:"flex items-center gap-3 border rounded-xl px-4 py-3 cursor-pointer transition-all ".concat("invoice"===ec?"border-[#2C5F2E] bg-[#F0F9F0]":"border-gray-200 hover:border-gray-300 bg-white"),children:[(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 flex-shrink-0 ".concat("invoice"===ec?"border-[#2C5F2E] bg-[#2C5F2E]":"border-gray-300"),children:"invoice"===ec&&(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full mx-auto mt-0.5"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"font-semibold text-sm text-gray-900",children:"Kauf auf Rechnung & Vorkasse"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Nach Abschluss der Bestellung wird der Verk\xe4ufer Sie so bald wie m\xf6glich per E-Mail oder Telefon kontaktieren, um die Bestellung abzuschlie\xdfen."})]}),(0,r.jsx)(F.A,{className:"w-6 h-6 text-gray-400 flex-shrink-0"})]}),e9.enable_pickup&&(0,r.jsxs)("div",{onClick:()=>eo("pickup"),className:"flex items-center gap-3 border rounded-xl px-4 py-3 cursor-pointer transition-all ".concat("pickup"===ec?"border-[#2C5F2E] bg-[#F0F9F0]":"border-gray-200 hover:border-gray-300 bg-white"),children:[(0,r.jsx)("div",{className:"w-4 h-4 rounded-full border-2 flex-shrink-0 ".concat("pickup"===ec?"border-[#2C5F2E] bg-[#2C5F2E]":"border-gray-300"),children:"pickup"===ec&&(0,r.jsx)("div",{className:"w-2 h-2 bg-white rounded-full mx-auto mt-0.5"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"font-semibold text-sm text-gray-900",children:"Abholung im Gesch\xe4ft"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Ihre Bestellung wird reserviert. Sie bezahlen bei der Abholung im Gesch\xe4ft – kein Versand."})]}),(0,r.jsx)(C.A,{className:"w-6 h-6 text-gray-400 flex-shrink-0"})]})]}),"invoice"===ec&&(0,r.jsxs)(r.Fragment,{children:[e9.bank_iban&&(e9.enable_paypal||e9.enable_str
1ipe||e9.enable_twint)&&(0,r.jsxs)("div",{className:"mb-4 border border-gray-200 rounded-xl overflow-hidden",children:[(0,r.jsx)("div",{className:"bg-gray-50 px-4 py-2 border-b border-gray-200",children:(0,r.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:"Bankverbindung"})}),(0,r.jsxs)("div",{className:"px-4 py-3 space-y-2",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"IBAN"}),(0,r.jsx)("span",{className:"text-sm font-mono font-semibold text-gray-800",children:e9.bank_iban})]}),e9.bank_holder&&(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"Kontoinhaber"}),(0,r.jsx)("span",{className:"text-sm font-semibold text-gray-800",children:e9.bank_holder})]}),e9.bank_name&&(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"Bank"}),(0,r.jsx)("span",{className:"text-sm text-gray-700",children:e9.bank_name})]})]})]}),(0,r.jsx)("div",{className:"mb-4 bg-green-50 border border-green-200 rounded-lg px-4 py-3",children:(0,r.jsx)("p",{className:"text-sm text-green-700",children:"Nach der Bestellung wird der Verk\xe4ufer Sie per E-Mail oder Telefon kontaktieren."})}),(0,r.jsx)(A.$,{onClick:sC,disabled:ea||!1,className:"w-full min-h-14 h-auto py-3 text-base font-bold bg-gradient-to-r from-green-500 to-green-600 hover:from-green-600 hover:to-green-700 text-white shadow-xl transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed",children:ea?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Verarbeitung..."]}):"Bestellung abschlie\xdfen \xb7 ".concat(sv().toFixed(2)," CHF")})]}),"pickup"===ec&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-4 bg-amber-50 border border-amber-200 rounded-lg px-4 py-3",children:(0,r.jsx)("p",{className:"text-sm text-amber-700",children:"Ihre Bestellung wird f\xfcr Sie reserviert. Die Bezahlung erfolgt bei der Abholung im Gesch\xe4ft. Wir kontaktieren Sie, sobald die Bestellung zur Abholung bereit ist."})}),(0,r.jsx)(A.$,{onClick:sk,disabled:ea||!1,className:"w-full min-h-14 h-auto py-3 text-base font-bold bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 text-white shadow-xl transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed",children:ea?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Verarbeitung..."]}):"Reservieren & im Gesch\xe4ft abholen \xb7 ".concat(sv().toFixed(2)," CHF")})]}),"paypal"===ec&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-4 bg-blue-50 border border-blue-200 rounded-lg p-4",children:(0,r.jsxs)("p",{className:"text-sm text-blue-700",children:["Sie werden zu ",(0,r.jsx)("strong",{children:"PayPal"})," weitergeleitet, um die Zahlung sicher abzuschlie\xdfen."]})}),(0,r.jsx)(A.$,{onClick:()=>{if(!sB()||!sD()||eg&&!sP())return;let e={firstName:G.firstName,lastName:G.lastName,email:G.email,phone:G.phone,address:G.address,city:G.city,postalCode:G.postalCode,canton:G.canton,notes:G.notes,accountPassword:eg?ej.password:"",billingAddress:ed?{firstName:ex.firstName,lastName:ex.lastName,address:ex.address,city:ex.city,postalCode:ex.postalCode,canton:ex.canton}:null};localStorage.setItem("cantina-customer-info",JSON.stringify(e)),sessionStorage.setItem("cantina-customer-info",JSON.stringify(e)),localStorage.setItem("cantina-cart",JSON.stringify(J)),sessionStorage.setItem("cantina-cart",JSON.stringify(J)),localStorage.setItem("cantina-shipping-cost",String(sy())),sessionStorage.setItem("cantina-shipping-cost",String(sy()));let s="order_".concat(Date.now(),"_").concat(Math.random().toString(36).substr(2,9)),t={orderId:s,customerInfo:e,cart:J,total:sv(),shippingCost:sy(),timestamp:new Date().toISOString()};localStorage.setItem("cantina-order-".concat(s),JSON.stringify(t)),sessionStorage.setItem("cantina-order-".concat(s),JSON.stringify(t)),localStorage.setItem("cantina-current-order-id",s),sessionStorage.setItem("cantina-current-order-id",s);let r=sv(),a=e9.paypal_email||"[email protected]",n="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=".concat(encodeURIComponent(a),"&amount=").concat(r.toFixed(2),"&currency_code=CHF&item_name=FEUER K\xd6NIGREICH Order&custom=").concat(s,"&return=").concat(window.location.origin,"/success&cancel_return=").concat(window.location.origin,"/cancel");Y("processing"),window.location.href=n},disabled:ea||!1,className:"w-full min-h-14 h-auto py-3 text-base font-bold bg-[#0070BA] hover:bg-[#005ea6] text-white shadow-xl transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed",children:ea?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Weiterleitung..."]}):"Mit PayPal bezahlen \xb7 ".concat(sv().toFixed(2)," CHF")})]}),"stripe"===ec&&(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)($,{amount:sv(),currency:"CHF",orderData:{orderId:"ORDER-".concat(Date.now()),customerInfo:G,cart:J},onSuccess:sI,onError:e=>{st("error"),sa(e),console.error("❌ Stripe payment error:",e)},disabled:!sR||!sL||!sM,publishableKey:e9.stripe_publishable_key||void 0,secretKey:e9.stripe_secret_key||void 0}),sr&&(0,r.jsxs)("div",{className:"mt-3 p-3 bg-red-50 border border-red-200 rounded-lg flex items-center gap-2 text-red-600",children:[(0,r.jsx)(x.A,{className:"w-4 h-4 shrink-0"}),(0,r.jsx)("p",{className:"text-sm",children:sr})]})]})}),"twint"===ec&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-4 bg-orange-50 border border-orange-200 rounded-lg p-4",children:(0,r.jsxs)("p",{className:"text-sm text-orange-700",children:["Nach der Bestellung erhalten Sie unsere Telefonnummer – die Zahlung vereinbaren wir direkt mit Ihnen (z.B. TWINT oder andere App).",e9.twint_phone&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}
1),"Nummer: ",(0,r.jsx)("strong",{children:e9.twint_phone})]})]})}),(0,r.jsx)(A.$,{onClick:sA,disabled:ea||!1,className:"w-full min-h-14 h-auto py-3 text-base font-bold bg-gradient-to-r from-orange-400 to-orange-500 hover:from-orange-500 hover:to-orange-600 text-white shadow-xl transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed",children:ea?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Verarbeitung..."]}):(0,r.jsxs)("span",{className:"flex flex-col items-center leading-tight",children:[(0,r.jsx)("span",{children:"Bestellen & per Telefon bezahlen"}),(0,r.jsxs)("span",{className:"text-sm font-semibold opacity-90",children:[sv().toFixed(2)," CHF"]})]})})]}),"twint_stripe"===ec&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)(X,{amount:sv(),orderData:{customerInfo:G,cart:J},publishableKey:e9.stripe_publishable_key||void 0,secretKey:e9.stripe_secret_key||void 0,pmcId:e9.stripe_pmc_id||void 0,disabled:!sR||!sL||!sM,returnUrl:window.location.origin,onSaveOrder:sS,onError:e=>sa(e)}),sr&&(0,r.jsxs)("div",{className:"mt-3 p-3 bg-red-50 border border-red-200 rounded-lg flex items-center gap-2 text-red-600",children:[(0,r.jsx)(x.A,{className:"w-4 h-4 shrink-0"}),(0,r.jsx)("p",{className:"text-sm",children:sr})]})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-4 text-center",children:"Mit Ihrer Bestellung akzeptieren Sie unsere AGB und Datenschutzbestimmungen."})]})]})]})]}),(0,r.jsx)(O.lG,{open:sn,onOpenChange:sl,children:(0,r.jsxs)(O.Cf,{className:"sm:max-w-md",children:[(0,r.jsxs)(O.c7,{children:[(0,r.jsxs)(O.L3,{className:"flex items-center",children:[(0,r.jsx)(k.A,{className:"w-5 h-5 mr-2 text-[#2C5F2E]"}),"Passwort zur\xfccksetzen"]}),(0,r.jsx)(O.rr,{children:"Geben Sie Ihre E-Mail-Adresse ein. Wir senden Ihnen ein neues tempor\xe4res Passwort."})]}),(0,r.jsxs)("div",{className:"space-y-4 py-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{htmlFor:"resetEmail",children:"E-Mail-Adresse *"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(S.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),(0,r.jsx)(I.p,{id:"resetEmail",type:"email",value:si,onChange:e=>sc(e.target.value),className:"pl-10 ".concat(sp.email?"border-red-500":""),placeholder:"[email protected]",disabled:so})]}),sp.email&&(0,r.jsx)("p",{className:"text-red-500 text-sm mt-1",children:sp.email})]}),"success"===sm&&(0,r.jsx)("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(c.A,{className:"w-5 h-5 text-green-600 mr-2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-green-700 font-medium",children:"E-Mail gesendet!"}),(0,r.jsx)("p",{className:"text-green-600 text-sm mt-1",children:sh})]})]})}),"error"===sm&&(0,r.jsx)("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(x.A,{className:"w-5 h-5 text-red-600 mr-2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-red-700 font-medium",children:"Fehler"}),(0,r.jsx)("p",{className:"text-red-600 text-sm mt-1",children:sh})]})]})}),(0,r.jsxs)("div",{className:"bg-[#F0F9F0] border border-[#2C5F2E]/20 rounded-xl p-4",children:[(0,r.jsx)("h4",{className:"text-[#2C5F2E] font-medium mb-2",children:"ℹ️ Wichtige Hinweise:"}),(0,r.jsxs)("ul",{className:"text-[#2C5F2E]/80 text-sm space-y-1",children:[(0,r.jsx)("li",{children:"• Sie erhalten ein neues 8-stelliges Passwort per E-Mail"}),(0,r.jsx)("li",{children:"• Melden Sie sich sofort mit dem neuen Passwort an"}),(0,r.jsx)("li",{children:"• \xc4ndern Sie das Passwort nach der Anmeldung in Ihrem Profil"}),(0,r.jsx)("li",{children:"• Alle bestehenden Sitzungen werden aus Sicherheitsgr\xfcnden beendet"})]})]}),(0,r.jsxs)("div",{className:"flex gap-3 pt-4",children:[(0,r.jsx)(A.$,{onClick:sZ,disabled:so||!si.trim()||"success"===sm,className:"flex-1 bg-[#2C5F2E] hover:bg-[#1A4520] text-white rounded-xl",children:so?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Wird gesendet..."]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(S.A,{className:"w-4 h-4 mr-2"}),"Neues Passwort anfordern"]})}),(0,r.jsx)(A.$,{onClick:()=>{sl(!1),sc(""),sx("idle"),su(""),sg({})},variant:"outline",disabled:so,className:"flex-1",children:"success"===sm?"Schlie\xdfen":"Abbrechen"})]})]})]})}),eI&&(0,r.jsx)(Z.F,{onClose:()=>{eB(!1),setTimeout(()=>{sf()},100)}})]}
1),e9&&(e9.enable_invoice||e9.enable_stripe||e9.enable_twint||e9.enable_paypal)&&(0,r.jsx)("div",{className:"border-t border-[#E0E0E0] py-5 bg-white mt-8",children:(0,r.jsx)("div",{className:"container mx-auto px-4 max-w-7xl",children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 pr-4 border-r border-[#E0E0E0]",children:[(0,r.jsx)(l.A,{className:"w-4 h-4 text-[#2C5F2E]"}),(0,r.jsx)("span",{className:"text-[11px] font-semibold text-[#555] tracking-widest uppercase",children:"Sichere Zahlung"})]}),e9.enable_invoice&&(0,r.jsxs)("div",{className:"h-9 px-4 rounded-lg bg-[#F5F5F5] border border-[#E0E0E0] flex items-center gap-2 shadow-sm",children:[(0,r.jsx)("span",{className:"text-lg",children:"\uD83C\uDFE6"}),(0,r.jsx)("span",{className:"text-[11px] font-bold text-[#444] tracking-tight",children:"Rechnung"})]}),e9.enable_twint&&(0,r.jsx)("div",{className:"h-9 px-3 rounded-lg bg-black flex items-center shadow-sm",children:(0,r.jsx)("img",{src:"/twint-logo.svg",alt:"Telefon",className:"h-7 w-auto"})}),e9.enable_stripe&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"h-9 px-5 rounded-lg bg-[#1A1F71] flex items-center shadow-sm",children:(0,r.jsx)("span",{className:"font-black text-white text-base italic tracking-tight",children:"VISA"})}),(0,r.jsxs)("div",{className:"h-9 px-4 rounded-lg bg-white border border-[#E0E0E0] flex items-center gap-1 shadow-sm",children:[(0,r.jsx)("div",{className:"w-5 h-5 rounded-full bg-[#EB001B] opacity-90"}),(0,r.jsx)("div",{className:"w-5 h-5 rounded-full bg-[#F79E1B] opacity-90 -ml-2"}),(0,r.jsx)("span",{className:"text-[11px] font-bold text-[#333] ml-1.5 tracking-tight",children:"Mastercard"})]})]}),e9.enable_paypal&&(0,r.jsx)("div",{className:"h-9 px-3 rounded-lg bg-white border border-[#E0E0E0] flex items-center shadow-sm",children:(0,r.jsx)("img",{src:"/0014294_paypal-express-payment-plugin.png",alt:"PayPal",className:"h-7 w-auto object-contain"})})]})})})]})}},66723:(e,s,t)=>{t.d(s,{w:()=>x});var r=t(20136),a=t(33109),n=t(24224),l=t(87156),i=t(7020),c=t(17230),o=t(70841),d=t(30434),m=t(46053);function x(e){let{isOpen:s,onOpenChange:t,cart:x,onAddToCart:h,onRemoveFromCart:u,onGoToCheckout:p,onClearCart:g}=e,b=(0,m.useRouter)(),j=x.reduce((e,s)=>e+s.price*s.quantity,0),f=x.reduce((e,s)=>e+s.quantity,0);return(0,r.jsx)(d.cj,{open:s,onOpenChange:t,children:(0,r.jsxs)(d.h,{className:"bg-white border-l border-gray-100 w-full sm:w-[420px] flex flex-col p-0 shadow-2xl",children:[(0,r.jsx)(d.Fm,{className:"px-5 py-4 border-b border-gray-100 flex-shrink-0",children:(0,r.jsx)("div",{className:"flex items-center justify-between",children:(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("div",{className:"w-8 h-8 bg-[#2C5F2E] rounded-xl flex items-center justify-center",children:(0,r.jsx)(a.A,{className:"w-4 h-4 text-white"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)(d.qp,{className:"leading-none",style:{fontFamily:"'Rubik Dirt', sans-serif",color:"#1A1A1A",fontSize:"1.1rem",fontWeight:"normal"},children:"Warenkorb"}),(0,r.jsxs)("p",{className:"text-xs text-gray-400 mt-0.5",children:[f," ","Artikel"]})]})]})})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-4 py-4",children:0===x.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-center py-16",children:[(0,r.jsx)("div",{className:"w-16 h-16 bg-gray-50 rounded-2xl flex items-center justify-center mb-4",children:(0,r.jsx)(n.A,{className:"w-8 h-8 text-gray-300"})}),(0,r.jsx)("p",{className:"text-sm font-bold text-gray-400",children:"Ihr Warenkorb ist leer"}),(0,r.jsx)("p",{className:"text-xs text-gray-300 mt-1",children:"F\xfcgen Sie Produkte hinzu"})]}):(0,r.jsx)("div",{className:"space-y-3",children:x.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-gray-50 hover:bg-gray-100/80 rounded-2xl border border-gray-100 transition-colors group",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-xs font-bold line-clamp-2 leading-tight transition-colors ".concat("gutschein"===e.item_type?"cursor-default text-gray-900":"cursor-pointer text-[#2C5F2E] hover:text-[#1e4220]"),onClick:()=>{"gutschein"!==e.item_type&&(t(!1),b.push("/product/".concat(e.id)))},children:e.name}),(0,r.jsxs)("p",{className:"text-sm font-black text-[#2C5F2E] mt-1",children:[e.price.toFixed(2)," ",(0,r.jsx)("span",{className:"text-xs font-semibold text-gray-400",children:"CHF"})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[(0,r.jsx)("button",{onClick:()=>u(e.id),className:"w-7 h-7 rounded-lg bg-white border border-gray-200 hover:border-red-300 hover:bg-red-50 hover:text-red-500 flex items-center justify-center transition-all text-gray-500 shadow-sm",children:(0,r.jsx)(l.A,{className:"w-3 h-3"})}),(0,r.jsx)("span",{className:"w-6 text-center text-sm font-black text-gray-900",children:e.quantity}),(0,r.jsx)("button",{onClick:()=>h(e),className:"w-7 h-7 rounded-lg bg-[#2C5F2E] hover:bg-[#1e4220] text-white flex items-center justify-center transition-all shadow-sm",children:(0,r.jsx)(i.A,{className:"w-3 h-3"})})]})]},e.id))})}),x.length>0&&(0,r.jsxs)("div",{className:"border-t border-gray-100 p-4 bg-white flex-shrink-0 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-1",children:[(0,r.jsx)("span",{className:"text-sm font-semibold text-gray-500",children:"Gesamt"}),(0,r.jsxs)("div",{className:"text-right",children:[(0,r.jsx)("span",{className:"text-2xl font-black text-gray-900 tracking-tight",children:j.toFixed(2)}),(0,r.jsx)("span",{className:"text-sm text-gray-400 ml-1",children:"CHF"})]})]}),(0,r.jsxs)("button",{onClick:()=>{p()},className:"w-full flex items-center justify-center gap-2 bg-[#2C5F2E] hover:bg-[#1e4220] text-white font-bold py-3.5 rounded-2xl text-sm transition-all duration-200 hover:scale-[1.02] active:scale-[0.98] shadow-lg shadow-[#2C5F2E]/30",children:["Warenkorb ansehen",(0,r.jsx)(c.A,{className:"w-4 h-4"})]}),(0,r.jsxs)("button",{onClick:g,className:"w-full flex items-center justify-center gap-1.5 text-xs font-semibold text-gray-400 hover:text-red-500 transition-colors py-1",children:[(0,r.jsx)(o.A,{className:"w-3.5 h-3.5"}),"Warenkorb leeren"]})]})]})})}}}]);

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.