PageSourceSearch

https://www.smarthomeyourself.de/_next/static/chunks/app/deals/page-5a4d75e58f8420a3.js

js smarthomeyourself.de collected 2026-10-05 21:27:15 UTC 51,821 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8242,9609],{8672:(e,t,a)=>{Promise.resolve().then(a.bind(a,67281)),Promise.resolve().then(a.bind(a,32083)),Promise.resolve().then(a.bind(a,63515))},30510:(e,t,a)=>{"use strict";a.d(t,{a:()=>x});var r=a(12115),s=a(20063);let l=null,n=0,i=new Set;function d(){i.forEach(e=>e())}function o(e){return n+=1,i.add(e),()=>{i.delete(e),0==(n-=1)&&(l=null)}}function c(){return l}function u(){return null}function x(){var e;let t=(0,s.useSearchParams)(),a=(0,s.useRouter)(),n="sonstige"===(e=t.get("tab"))||"other"===e?"other":"amazon",i=(0,r.useSyncExternalStore)(o,c,u),x=null!=i?i:n;return(0,r.useEffect)(()=>{null!==l&&l===n&&(l=null,d())},[n]),{activeTab:x,setActiveTab:(0,r.useCallback)(e=>{if(e===(null!=l?l:n))return;l=e,d();let r=new URLSearchParams(t.toString());"other"===e?r.set("tab","sonstige"):r.delete("tab");let s=r.toString();a.replace(s?"/deals?".concat(s):"/deals",{scroll:!1})},[a,t,n])}}},32083:(e,t,a)=>{"use strict";a.d(t,{default:()=>n});var r=a(95155),s=a(12115),l=a(30510);function n(e){var t,a,n,i;let{activeDeals:d,discountedProducts:o,rabattCodesCount:c=0}=e,{activeTab:u,setActiveTab:x}
1=(0,l.a)(),[m,g]=(0,s.useState)(!1),[h,p]=(0,s.useState)(0),f=(null==o||null==(a=o.ItemsResult)||null==(t=a.Pagination)?void 0:t.totalItems)||(null==o||null==(i=o.ItemsResult)||null==(n=i.Items)?void 0:n.length)||0,b=(null==d?void 0:d.length)||0;if((0,s.useEffect)(()=>{let e=()=>{let e=document.querySelector('header[role="banner"]');e&&p(e.offsetHeight)};e(),window.addEventListener("resize",e);let t=()=>{g(window.scrollY>50)};return window.scrollY>50&&g(!0),window.addEventListener("scroll",t,{passive:!0}),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",t)}},[]),!m)return null;let v="amazon"===u,y=v?"Zu den Hersteller-Deals":"Zu den Amazon-Angeboten",j=v?"other":"amazon",w=[b>0?"".concat(b," Deals"):"",c>0?"".concat(c," Rabattcodes"):""].filter(Boolean).join(" + ");return(0,r.jsx)("div",{className:"fixed left-0 right-0 z-40 transition-all duration-200",style:{top:"".concat(h,"px")},children:(0,r.jsxs)("button",{type:"button",onClick:()=>{x(j)},"aria-label":y,className:"relative block w-full overflow-hidden rounded-b-xl shadow-lg border-b border-white/10 bg-gradient-to-r ".concat(v?"from-purple-600 via-blue-600 to-sky-500":"from-orange-500 via-red-500 to-rose-500"," cursor-pointer text-left touch-manipulation hover:brightness-110 active:brightness-95 transition-[filter] duration-150"),children:[(0,r.jsx)("div",{className:"absolute inset-0 opacity-30 bg-[radial-gradient(circle_at_top,_rgba(255,255,255,0.35),_transparent_65%)] pointer-events-none"}),(0,r.jsxs)("div",{className:"relative px-4 py-1 sm:px-5 sm:py-1.5 pb-2 sm:pb-1.5 flex flex-col sm:flex-row sm:items-center gap-1 sm:gap-2 text-white pointer-events-none",children:[(0,r.jsxs)("div",{className:"flex-1 space-y-0.5",children:[(0,r.jsx)("p",{className:"text-base sm:text-lg font-semibold leading-tight",children:v?w||"Hersteller-Deals":"".concat(f," Amazon-Produkte")}),(0,r.jsx)("p",{className:"text-xs text-white/90 leading-tight",children:v?"Hersteller-Deals mit Rabattcodes und zeitlich begrenzten Aktionen.":"T\xe4glich aktualisierte Amazon Angebote mit mindestens 10% Rabatt"})]}),(0,r.jsxs)("span",{className:"text-white font-semibold underline underline-offset-2 text-xs sm:text-sm whitespace-nowrap",children:[y," →"]})]})]})})}},34750:(e,t,a)=>{"use strict";a.d(t,{F:()=>c,A:()=>m});var r=a(95155),s=a(52619),l=a.n(s);a(3119);var n=a(12115),i=a(91009),d=a(41143);function o(e){if(!e)return"";let t=e;return(t=(t=(t=(t=(t=(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;")).replace(/^### (.+)$/gm,'<h3 class="text-lg font-bold mt-2 mb-1">$1</h3>')).replace(/^## (.+)$/gm,'<h2 class="text-xl font-bold mt-2 mb-1">$1</h2>')).replace(/^# (.+)$/gm,'<h1 class="text-2xl font-bold mt-2 mb-1">$1</h1>')).replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>")).replace(/\*(.+?)\*/g,"<em>$1</em>")).replace(/_(.+?)_/g,"<u>$1</u>")}function c(e){let{codes:t}=e,[a,s]=(0,n.useState)(null);return t&&0!==t.length?(0,r.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>{var l;return(0,r.jsxs)(i.P.div,{initial:{opacity:0,scale:.85},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:280,damping:24,delay:.08*t+.1},className:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-2 bg-white/20 rounded-lg p-2 sm:p-3 backdrop-blur-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium opacity-90 mb-1",children:"Rabattcode:"}),(0,r.jsx)("code",{className:"text-lg sm:text-xl md:text-2xl font-bold tracking-wider break-all",children:e.code}),e.description&&(0,r.jsx)("span",{className:"text-xs sm:text-sm opacity-80 mt-1",children:e.description})]}),(0,r.jsx)("div",{className:"flex flex-col sm:flex-row gap-2 flex-shrink-0",children:e.link?(0,r.jsx)("a",{href:(l=e.id,"/deals/aktion/code/".concat(l)),target:"_blank",rel:"sponsored noopener noreferrer",className:"px-4 py-2 sm:px-6 sm:py-3 bg-white text-blue-600 font-bold rounded-lg hover:bg-gray-100 transition-colors duration-200 shadow-md text-sm sm:text-base text-center",children:"Zum Angebot →"}):(0,r.jsx)("button",{onClick:()=>{var t,a;return t=e.code,a=e.id,void(navigator.clipboard.writeText(t),s(a),setTimeout(()=>s(null),2e3))},className:"px-4 py-2 sm:px-6 sm:py-3 bg-white text-blue-600 font-bold rounded-lg hover:bg-gray-100 transition-colors duration-200 shadow-md text-sm sm:text-base",children:a===e.id?"✓ Kopiert!":"Kopieren"})})]},e.id)})}):null}function u(e){let{imageUrl:t,title:a,linkHref:s,isExternalDeal:n,className:i,imgClassName:d}=e,o=(0,r.jsx)("img",{src:t,alt:a,className:"w-full h-auto object-contain no-modal ".concat(null!=d?d:""),loading:"lazy"}),c="bg-white/10 rounded-lg overflow-hidden w-full block ".concat(null!=i?i:"");return n?(0,r.jsx)("a",{href:s,target:"_blank",rel:"sponsored noopener noreferrer",className:c,"data-no-modal":!0,children:o}):(0,r.jsx)(l(),{href:s,className:c,"data-no-modal":!0,children:o})}function x(e){var t;let{deal:a}=e,s=a.title.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim(),n=!!a.externalUrl,i=n?(t=a.id,"/deals/aktion/".concat(t)):"/deals/".concat(s);return(0,r.jsx)("div",{className:"block",children:(0,r.jsxs)("div",{className:"bg-gradient-to-r from-blue-500 to-purple-500 rounded-xl shadow-lg p-3 text-white hover:shadow-xl transition-all duration-200",children:[(0,r.jsxs)("div",{className:"flex flex-col lg:hidden gap-4",children:[a.imageUrl&&(0,r.jsx)("div",{className:"w-full flex items-center justify-center",children:(0,r.jsx)(u,{imageUrl:a.imageUrl,title:a.title,linkHref:i,isExternalDeal:n,className:"max-h-48",imgClassName:"max-h-48 group-hover:scale-105 transition-transform duration-500"})}),(0,r.jsxs)("div",{className:"flex flex-col justify-between",children:[(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"inline-flex items-center px-3 py-1 bg-white/20 rounded-full text-xs font-bold",children:["\uD83D\uDCC5 ",(0,d.o1)(a.startDate)," - ",(0,d.o1)(a.endDate)]}),(0,r.jsx)("h3",{className:"text-xl sm:text-2xl font-bold leading-tight",children:a.title}),(0,r.jsx)("div",{className:"text-sm sm:text-base opacity-90 whitespace-pre-line",dangerouslySetInnerHTML:{__html:o(a.description)}}),a.discountCodes&&a.discountCodes.length>0&&(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsx)(c,{codes:a.discountCodes})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 pt-3",children:[!n&&a.products.length>0&&(0,r.jsxs)("span",{className:"text-base sm:text-lg font-bold bg-white/20 px-3 py-1.5 rounded self-start",children:[a.products.length," ",1===a.products.length?"Produkt":"Produkte"]}),n?(0,r.jsx)("a",{href:i,target:"_blank",rel:"sponsored noopener noreferrer",className:"w-full text-center px-6 py-3 bg-white text-blue-600 font-bold text-base rounded-lg hover:bg-gray-100 transition-colors duration-200 shadow-lg",children:"Zum Angebot →"}):(0,r.jsx)(l(),{href:i,className:"w-full text-center px-6 py-3 bg-white text-blue-600 font-bold text-base rounded-lg hover:bg-gray-100 transition-colors duration-200 shadow-lg",children:"Angebote ansehen →"})]})]})]}),(0,r.jsxs)("div",{className:"hidden lg:flex flex-row gap-3 h-full",children:[a.imageUrl&&(0,r.jsx)("div",{className:"flex-shrink-0 w-full max-w-[50%] flex items-center justify-center",children:(0,r.jsx)(u,{imageUrl:a.imageUrl,title:a.title,linkHref:i,isExternalDeal:n,imgClassName:"group-hover:scale-105 transition-transform duration-500"})}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col justify-between min-w-0",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"inline-flex items-center px-4 py-2 bg-white/20 rounded-full text-sm font-bold",children:["\uD83D\uDCC5 ",(0,d.o1)(a.startDate)," - ",(0,d.o1)(a.endDate)]}),(0,r.jsx)("h3",{className:"text-2xl font-bold leading-tight",children:a.title}),(0,r.jsx)("div",{className:"text-lg opacity-90 whitespace-pre-line",dangerouslySetInnerHTML:{__html:o(a.description)}}),a.discountCodes&&a.discountCodes.length>0&&(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsx)(c,{codes:a.discountCodes})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-2 pt-2",children:[!n&&a.products.length>0&&(0,r.jsxs)("span",{className:"text-xl font-bold bg-white/20 px-4 py-2 rounded self-start",children:[a.products.length," ",1===a.products.length?"Produkt":"Produkte"]}),n?(0,r.jsx)("a",{href:i,target:"_blank",rel:"sponsored noopener noreferrer",className:"w-full text-center px-4 py-2 bg-white text-blue-600 font-bold text-base rounded-lg hover:bg-gray-100 transition-colors duration-200 shadow-lg",children:"Zum Angebot →"}):(0,r.jsx)(l(),{href:i,className:"w-full text-center px-4 py-2 bg-white text-blue-600 font-bold text-base rounded-lg hover:bg-gray-100 transition-colors duration-200 shadow-lg",children:"Angebote ansehen →"})]})]})]})]})})}function m(e){let{className:t="",deals:a}=e;return a&&0!==a.length?(0,r.jsxs)("div",{className:t,children:[(0,r.jsxs)("div",{className:"text-center mb-3",children:[(0,r.jsx)("p",{className:"text-sm uppercase tracking-widest text-blue-400 mb-2",children:"Zeitlich begrenzte Aktionen"}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Aktuelle Deals und Sonderangebote"})]}),(0,r.jsx)("div",{className:"space-y-3",children:a.map((e,t)=>(0,r.jsx)(i.P.div,{initial:{opacity:0,scale:.85}
1,animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:280,damping:24,delay:.12*t+.1},children:(0,r.jsx)(x,{deal:e})},e.id))})]}):null}},39609:(e,t,a)=>{"use strict";a.d(t,{Eb:()=>p,Iu:()=>m,M_:()=>b,WA:()=>f,al:()=>o,cU:()=>g,cY:()=>u,dK:()=>x,jj:()=>v,n$:()=>h,nb:()=>c});var r=a(95155),s=a(12115),l=a(90368),n=a(27937),i=a(37772),d=a(64269);function o(){let[e,t]=s.useState(!1),[a,r]=s.useState(!1);return s.useEffect(()=>{r(!0);let e=()=>{t(window.innerWidth<640)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!!a&&e}function c(e,t){let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(a&&t>3)return[e];let r=a?1:2,s=[];if(t<=5){for(let e=1;e<=t;e++)s.push(e);return s}let l=Math.max(2,e-r),n=Math.min(t-1,e+r);s.push(1),l>2&&s.push("ellipsis");for(let e=l;e<=n;e++)s.push(e);return n<t-1&&s.push("ellipsis"),t>1&&s.push(t),s}function u(e){let{currentPage:t,totalPages:a}=e,i=o(),[c,u]=s.useState(!1);return(s.useEffect(()=>{u(!0)},[]),c&&i&&!(a<=1))?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1 mt-2",children:[(0,r.jsxs)("div",{className:"flex justify-center items-center gap-3",children:[t>1&&(0,r.jsxs)("div",{className:"flex items-center gap-1 text-sm text-gray-500 dark:text-gray-400",children:[(0,r.jsx)(l.A,{className:"w-4 h-4"}),(0,r.jsx)("span",{className:"hidden xs:inline",children:"Swipe"})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[Array.from({length:Math.min(a,7)},(e,a)=>{let s=a+1,l=s===t;return(0,r.jsx)("div",{className:(0,d.cn)("w-2 h-2 rounded-full transition-all duration-200",l?"bg-blue-600 scale-125":"bg-gray-300 dark:bg-gray-600")},s)}),a>7&&(0,r.jsx)("div",{className:"flex items-center text-xs text-gray-400",children:(0,r.jsx)("span",{children:"..."})})]}),t<a&&(0,r.jsxs)("div",{className:"flex items-center gap-1 text-sm text-gray-500 dark:text-gray-400",children:[(0,r.jsx)("span",{className:"hidden xs:inline",children:"Swipe"}),(0,r.jsx)(n.A,{className:"w-4 h-4"})]})]}),(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"\uD83D\uDCA1 Tipp: Wische nach links/rechts zum Wechseln"})})]}):null}function x(e){let{className:t,...a}=e;return(0,r.jsx)("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:(0,d.cn)("mx-auto flex w-full justify-center",t),...a})}function m(e){let{className:t,...a}=e;return(0,r.jsx)("ul",{"data-slot":"pagination-content",className:(0,d.cn)("flex flex-wrap justify-center items-center gap-2 px-2","sm:gap-3 max-w-full overflow-x-auto scrollbar-hide",t),...a})}function g(e){let{...t}=e;return(0,r.jsx)("li",{"data-slot":"pagination-item",className:"flex-shrink-0",...t})}function h(e){let{className:t,isActive:a,size:s="icon",...l}=e;return(0,r.jsx)("a",{"aria-current":a?"page":void 0,"data-slot":"pagination-link","data-active":a,className:(0,d.cn)("inline-flex items-center justify-center min-w-[3rem] h-10 px-3 text-sm font-medium rounded-lg transition-all duration-200","border cursor-pointer select-none touch-manipulation","sm:min-w-[2.5rem] sm:h-8 sm:px-2 sm:rounded-md",a?"bg-blue-600 text-white border-blue-600 shadow-sm":"bg-transparent text-gray-600 dark:text-gray-300 border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700 hover:text-gray-900 dark:hover:text-white",t),...l})}function p(e){let{className:t,...a}=e;return(0,r.jsx)(h,{"aria-label":"Go to previous page",size:"default",className:(0,d.cn)("rounded-full px-4 py-3 sm:px-3 sm:py-2","touch-manipulation min-w-[3rem] h-10 sm:min-w-[2.5rem] sm:h-8",t),...a,children:(0,r.jsx)(l.A,{className:"w-5 h-5 sm:w-4 sm:h-4"})})}function f(e){let{className:t,...a}=e;return(0,r.jsx)(h,{"aria-label":"Go to next page",size:"default",className:(0,d.cn)("rounded-full px-4 py-3 sm:px-3 sm:py-2","touch-manipulation min-w-[3rem] h-10 sm:min-w-[2.5rem] sm:h-8",t),...a,children:(0,r.jsx)(n.A,{className:"w-5 h-5 sm:w-4 sm:h-4"})})}function b(e){let{className:t,...a}=e;return(0,r.jsxs)("span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:(0,d.cn)("flex size-8 sm:size-9 items-center justify-center text-[var(--shys-cyan)]",t),...a,children:[(0,r.jsx)(i.A,{className:"size-3 sm:size-4"}),(0,r.jsx)("span",{className:"sr-only",children:"More pages"})]})}function v(e){let{currentPage:t,totalPages:a,onPageChange:l,enableSwipe:n=!0,enableKeyboard:i=!0,showSwipeIndicator:v=!0,showKeyboardHint:y=!0,className:j,children:w}=e,N=o();!function(e,t,a){let r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],l=s.useRef(null),n=s.useRef(null);s.useEffect(()=>{if(!r)return;let s=e=>{l.current=e.touches[0].clientX,n.current=e.touches[0].clientY},i=r=>{if(!l.current||!n.current)return;let s=r.changedTouches[0].clientX,i=r.changedTouches[0].clientY,d=l.current-s,o=Math.abs(n.current-i);100>Math.abs(d)||o>150||(d>0&&e<t?a(e+1):d<0&&e>1&&a(e-1),l.current=null,n.current=null)};return document.addEventListener("touchstart",s,{passive:!0}),document.addEventListener("touchend",i,{passive:!0}),()=>{document.removeEventListener("touchstart",s),document.removeEventListener("touchend",i)}},[e,t,a,r])}(t,a,l,n),function(e,t,a){let r=!(arguments.length>3)||void 0===arguments[3]||arguments[3];s.useEffect(()=>{if(!r)return;let s=r=>{var s,l;if((null==(s=document.activeElement)?void 0:s.tagName)!=="INPUT"&&(null==(l=document.activeElement)?void 0:l.tagName)!=="TEXTAREA")switch(r.key){case"ArrowLeft":r.preventDefault(),e>1&&a(e-1);break;case"ArrowRight":r.preventDefault(),e<t&&a(e+1);break;case"Home":r.preventDefault(),a(1);break;case"End":r.preventDefault(),a(t)}};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t,a,r])}(t,a,l,i);let k=c(t,a,N);return(0,r.jsxs)("div",{className:(0,d.cn)("space-y-2",j),children:[w,(0,r.jsx)(x,{children:(0,r.jsxs)(m,{children:[(0,r.jsx)(g,{children:(0,r.jsx)(p,{href:"#",onClick:e=>{e.preventDefault(),t>1&&l(t-1)},className:t<=1?"opacity-50 pointer-events-none":""})}),k.map((e,a)=>(0,r.jsx)(g,{children:"ellipsis"===e?(0,r.jsx)(b,{}):(0,r.jsx)(h,{href:"#",onClick:t=>{t.preventDefault(),l(e)},isActive:e===t,children:e})},a)),(0,r.jsx)(g,{children:(0,r.jsx)(f,{href:"#",onClick:e=>{e.preventDefault(),t<a&&l(t+1)},className:t>=a?"opacity-50 pointer-events-none":""})})]})}),v&&(0,r.jsx)(u,{currentPage:t,totalPages:a}),!N&&i&&y&&(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"\uD83D\uDCA1 Tipp: Nutze ← → Tasten zur Navigation"})})]})}},41143:(e,t,a)=>{"use strict";function r(e){if(!e)return"";let t=e.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!t)return new Date(e).toLocaleDateString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric"});let[,a,r,s]=t;return"".concat(s,".").concat(r,".").concat(a)}a.d(t,{o1:()=>r})},51460:(e,t,a)=>{"use strict";a.d(t,{Ay:()=>i,NL:()=>l,mt:()=>s,vO:()=>n});var r=a(95155);let s="Als Amazon-Partner verdienen wir an qualifizierten Verk\xe4ufen.",l="Produktpreise und Verf\xfcgbarkeit entsprechen dem angegebenen Stand (Datum/Uhrzeit) und k\xf6nnen sich \xe4ndern. F\xfcr den Kauf dieses Produkts gelten die Angaben zu Preis und Verf\xfcgbarkeit, die zum Kaufzeitpunkt auf Amazon.de angezeigt werden.",n="Bestimmte Inhalte, die auf dieser Website angezeigt werden, stammen von Amazon. Diese Inhalte werden „wie besehen“ bereitgestellt und k\xf6nnen jederzeit ge\xe4ndert oder entfernt werden.";function i(e){let{id:t,className:a=""}=e;return(0,r.jsxs)("div",{id:t,className:"text-sm text-gray-700 dark:text-gray-300 text-left ".concat(a),children:[(0,r.jsx)("p",{children:s}),(0,r.jsxs)("details",{children:[(0,r.jsx)("summary",{className:"cursor-pointer font-medium underline underline-offset-2 hover:text-gray-900 dark:hover:text-white",children:"N\xe4here Einzelheiten"}),(0,r.jsxs)("div",{className:"mt-1.5 space-y-1 text-gray-600 dark:text-gray-400",children:[(0,r.jsx)("p",{children:l}),(0,r.jsx)("p",{children:n})]})]})]})}},63515:(e,t,a)=>{"use strict";a.d(t,{default:()=>k});var r=a(95155),s=a(12115),l=a(91009),n=a(30510),i=a(34750),d=a(3119),o=a(25329),
1c=a(20124),u=a(8324);function x(){return(0,r.jsx)("div",{className:"bg-gradient-to-r from-orange-500 to-red-500 rounded-xl shadow-lg p-3 animate-pulse",children:(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,r.jsx)("div",{className:"w-52 h-52 sm:w-56 sm:h-56 mx-auto sm:mx-0 flex-shrink-0 bg-white/20 rounded-lg"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,r.jsx)("div",{className:"h-4 bg-white/20 rounded w-1/3"}),(0,r.jsx)("div",{className:"h-4 bg-white/20 rounded w-3/4"}),(0,r.jsx)("div",{className:"h-6 bg-white/20 rounded w-1/2"})]})]})})}function m(e){var t,a,s,n,i,m;let{product:g,className:h=""}=e;if(!g)return(0,r.jsx)(x,{});let{ItemInfo:p,OffersV2:f,DiscountInfo:b,RatingInfo:v,DetailPageURL:y,Images:j}=g,w=(null==p||null==(t=p.Title)?void 0:t.DisplayValue)||"Produkt",N=(null==b?void 0:b.originalPrice)||0,k=(null==b?void 0:b.discountPercentage)||0,P=null==f||null==(i=f.Listings)||null==(n=i[0])||null==(s=n.Price)||null==(a=s.Money)?void 0:a.Amount,D=P?"".concat(P.toFixed(2),"€"):"Preis nicht verf\xfcgbar",A=(0,c.b)({Images:j},"/shys-product-placeholder.webp"),z=(null==v?void 0:v.star_rating)||0,S=(null==v?void 0:v.review_count)||0,C=d._K.getAmazonAffiliateTag(),E=(0,o.q_)(y,C);return(0,r.jsx)(l.P.a,{href:E,target:"_blank",rel:"sponsored noopener noreferrer","aria-label":"".concat(w," bei Amazon kaufen"),className:"group block bg-gradient-to-r from-orange-500 to-red-500 rounded-lg sm:rounded-xl shadow-lg p-3 text-white cursor-pointer hover:shadow-xl hover:brightness-[1.04] transition-[filter,box-shadow] duration-200 ".concat(h),initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{type:"spring",stiffness:300,delay:.1,duration:.6},children:(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-stretch gap-3",children:[(0,r.jsx)("div",{className:"w-52 h-52 sm:w-56 sm:h-56 mx-auto sm:mx-0 flex-shrink-0",children:(0,r.jsx)("div",{className:"relative w-full h-full bg-white rounded-lg overflow-hidden",children:(0,r.jsx)(u.A,{src:A,alt:w,fill:!0,className:"object-contain p-1.5",sizes:"224px",loading:"lazy"})})}),(0,r.jsxs)("div",{className:"flex flex-col flex-grow min-w-0",children:[(0,r.jsxs)("div",{className:"inline-flex self-start items-center px-3 py-1 bg-white/20 rounded-full text-base font-bold",children:["\uD83D\uDD25 ",k,"% RABATT"]}),(0,r.jsx)("h3",{className:"mt-2 text-lg sm:text-xl md:text-2xl font-bold leading-snug line-clamp-2",children:w}),(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-baseline gap-2.5",children:[(0,r.jsx)("span",{className:"text-3xl sm:text-4xl font-bold leading-none",children:D}),N>0&&(0,r.jsxs)("span",{className:"text-lg line-through opacity-75",children:[N.toFixed(2),"€"]}),(0,r.jsxs)("span",{className:"text-base font-bold bg-white/20 px-2.5 py-1 rounded whitespace-nowrap",children:["Du sparst ",N>0&&P?(N-P).toFixed(2):0,"€"]})]}),z>0&&(0,r.jsxs)("div",{className:"mt-1.5 flex items-center gap-1.5",children:[(0,r.jsx)("div",{className:"flex items-center",children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,r.jsx)("span",{className:t<Math.floor(z)?"text-yellow-300":"text-white/50",style:{fontSize:"0.85rem"},children:"★"},t))}),(0,r.jsxs)("span",{className:"text-xs opacity-90",children:[z.toFixed(1)," (",S," Bewertungen)"]})]}),(0,r.jsxs)("div",{className:"mt-auto pt-3 flex flex-col-reverse sm:flex-row sm:items-end sm:justify-between gap-2",children:[(0,r.jsxs)("div",{className:"space-y-0.5",children:[(0,r.jsxs)("div",{className:"text-xs sm:text-sm opacity-75",children:["\uD83D\uDCC5 Stand: ",(null==(m=g.CustomFields)?void 0:m.FetchedAt)?new Date(g.CustomFields.FetchedAt).toLocaleDateString("de-DE",{timeZone:"Europe/Berlin",day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}):"Unbekannt"]}),(0,r.jsx)("div",{className:"text-xs sm:text-sm opacity-75",children:"\uD83E\uDD1D Als Amazon-Partner verdienen wir an qualifizierten Verk\xe4ufen"})]}),(0,r.jsx)("span",{className:"inline-flex items-center justify-center w-full sm:w-auto shrink-0 px-5 py-2.5 sm:px-6 sm:py-3 bg-white text-orange-600 font-bold text-base rounded-lg group-hover:bg-gray-100 transition-colors duration-200 shadow-md",children:"Jetzt bei Amazon kaufen →"})]})]})]})})}function g(e){let{className:t,product:a}=e;if(a)return(0,r.jsx)(l.P.div,{initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},transition:{type:"spring",stiffness:300,delay:.1,duration:.6},className:t,children:(0,r.jsx)(m,{product:a})});let[n,i]=(0,s.useState)(null),[d,o]=(0,s.useState)(!0),[c,u]=(0,s.useState)(null);return((0,s.useEffect)(()=>{(async()=>{try{var e,t;o(!0),u(null);let a=await fetch("/api/amazon/discounted?min_discount=10&limit=1");if(!a.ok)throw Error("Failed to fetch top deal");let r=null==(t=(await a.json()).ItemsResult)||null==(e=t.Items)?void 0:e[0];r&&i(r)}catch(e){u(e instanceof Error?e.message:"Unknown error")}finally{o(!1)}})()},[]),d)?(0,r.jsx)(x,{}):c||!n?(0,r.jsx)("div",{className:"bg-gray-100 dark:bg-gray-800 rounded-xl p-6 text-center",children:(0,r.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:"Fehler beim Laden des Top Deals"})}):(0,r.jsx)(l.P.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{type:"spring",stiffness:300,delay:.1,duration:.6},children:(0,r.jsx)(m,{product:n,className:t})})}var h=a(20063),p=a(25626),f=a(51460);function b(e){var t,a,r,s,l,n,i,d,o,u,x,m,g,h,p;let{ItemInfo:f,OffersV2:b,DiscountInfo:v,RatingInfo:y,DetailPageURL:j,Images:w}=e,N=(null==f||null==(t=f.Title)?void 0:t.DisplayValue)||"Produkt",k=null==f||null==(r=f.ByLineInfo)||null==(a=r.Brand)?void 0:a.DisplayValue,P=null==f||null==(l=f.ByLineInfo)||null==(s=l.Manufacturer)?void 0:s.DisplayValue,D=(null==v?void 0:v.originalPrice)||0,A=(null==v?void 0:v.discountPercentage)||0,z="Preis nicht verf\xfcgbar";(null==b||null==(o=b.Listings)||null==(d=o[0])||null==(i=d.Price)||null==(n=i.Money)?void 0:n.Amount)?z="".concat(b.Listings[0].Price.Money.Amount.toFixed(2),"€"):(null==(g=e.Offers)||null==(m
1=g.Listings)||null==(x=m[0])||null==(u=x.Price)?void 0:u.DisplayAmount)&&(z=e.Offers.Listings[0].Price.DisplayAmount);let S=D>0?"".concat(D.toFixed(2),"€"):void 0,C=(0,c.b)(e,"/shys-product-placeholder.webp"),E=(null==y?void 0:y.star_rating)||0,M=(null==y?void 0:y.review_count)||0,I=(null==f||null==(h=f.Features)?void 0:h.DisplayValues)||[];return{id:e.ASIN,title:N,price:z,originalPrice:S,discountPercentage:A>0?A:void 0,imageUrl:C,amazonUrl:j,rating:E,reviewCount:M,description:N,features:I,fetched_at:(null==(p=e.CustomFields)?void 0:p.FetchedAt)||new Date().toISOString(),brand:k,manufacturer:P}}var v=a(39609);function y(e){let{products:t,onPriceRangeChange:a,className:l="",resetTrigger:n}=e,{minPrice:i,maxPrice:d}=(0,s.useMemo)(()=>{let e=t.map(e=>{let t=e.price.match(/[\d,]+/);if(!t)return null;let a=parseFloat(t[0].replace(",","."));return isNaN(a)?null:a}).filter(e=>null!==e);return 0===e.length?{minPrice:0,maxPrice:100}:{minPrice:Math.floor(Math.min(...e)),maxPrice:Math.ceil(Math.max(...e))}},[t]),[o,c]=(0,s.use
1State)(i),[u,x]=(0,s.useState)(d),[m,g]=(0,s.useState)(i.toString()),[h,p]=(0,s.useState)(d.toString());(0,s.useEffect)(()=>{c(i),x(d),g(i.toString()),p(d.toString())},[i,d]),(0,s.useEffect)(()=>{void 0!==n&&(c(i),x(d),g(i.toString()),p(d.toString()))},[n,i,d]),(0,s.useEffect)(()=>{a(o,u)},[o,u,a]);let f=()=>{let e=Math.min(Math.max(parseInt(m)||i,i),u-1);c(e),g(e.toString())},b=()=>{let e=Math.max(Math.min(parseInt(h)||d,d),o+1);x(e),p(e.toString())};return(0,r.jsxs)("div",{className:"space-y-2 ".concat(l),children:[(0,r.jsx)("div",{className:"flex items-center justify-between",children:(0,r.jsx)("label",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:"Preisbereich"})}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("div",{className:"flex-1 relative",children:[(0,r.jsx)("input",{type:"text",value:m,onChange:e=>{g(e.target.value)},onBlur:f,onKeyDown:e=>{"Enter"===e.key&&f()},className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-orange-500 focus:border-orange-500 h-10",placeholder:"".concat(i)}),(0,r.jsx)("div",{className:"absolute top-full left-0 text-xs text-gray-500 dark:text-gray-400 mt-2",children:"Von"})]}),(0,r.jsxs)("div",{className:"flex-1 relative",children:[(0,r.jsx)("input",{type:"text",value:h,onChange:e=>{p(e.target.value)},onBlur:b,onKeyDown:e=>{"Enter"===e.key&&b()},className:"w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-orange-500 focus:border-orange-500 h-10",placeholder:"".concat(d)}),(0,r.jsx)("div",{className:"absolute top-full left-0 text-xs text-gray-500 dark:text-gray-400 mt-2",children:"Bis"})]})]})]})}function j(e){let{products:t,onFilteredProducts:a,itemsPerPage:n=12,onItemsPerPageChange:i,className:d=""}
1=e,[o,c]=(0,s.useState)(""),[u,x]=(0,s.useState)(""),[m,g]=(0,s.useState)("discount-desc"),h=(0,s.useMemo)(()=>{let e=t.map(e=>{let t=e.price.match(/[\d,]+/);if(!t)return null;let a=parseFloat(t[0].replace(",","."));return isNaN(a)?null:a}).filter(e=>null!==e);return 0===e.length?{defaultMinPrice:0,defaultMaxPrice:1e3}:{defaultMinPrice:Math.floor(Math.min(...e)),defaultMaxPrice:Math.ceil(Math.max(...e))}},[t]),[p,f]=(0,s.useState)(h.defaultMinPrice),[b,v]=(0,s.useState)(h.defaultMaxPrice),[j,w]=(0,s.useState)(0),[N,k]=(0,s.useState)(!1),P=(0,s.useMemo)(()=>{let e=new Set;return t.forEach(t=>{t.brand&&e.add(t.brand),t.manufacturer&&e.add(t.manufacturer)}),Array.from(e).sort()},[t]),D=(0,s.useMemo)(()=>{let e=t.filter(e=>{let t=!o||e.title.toLowerCase().includes(o.toLowerCase()),a=!u||e.brand===u||e.manufacturer===u,r=(()=>{let t=e.price.match(/[\d,]+/);if(!t)return!0;let a=parseFloat(t[0].replace(",","."));return!!isNaN(a)||a>=p&&a<=b})();return t&&a&&r});return e.sort((e,t)=>{var a,r,s,l;switch(m){case"price-asc":return parseFloat((null==(a=e.price.replace(",",".").match(/[\d,]+/))?void 0:a[0])||"0")-parseFloat((null==(r=t.price.replace(",",".").match(/[\d,]+/))?void 0:r[0])||"0");case"price-desc":let n=parseFloat((null==(s=e.price.replace(",",".").match(/[\d,]+/))?void 0:s[0])||"0");return parseFloat((null==(l=t.price.replace(",",".").match(/[\d,]+/))?void 0:l[0])||"0")-n;case"discount-desc":default:return(t.discountPercentage||0)-(e.discountPercentage||0);case"discount-asc":return(e.discountPercentage||0)-(t.discountPercentage||0)}}),e},[t,o,u,m,p,b]);(0,s.useEffect)(()=>{a(D)},[D]),(0,s.useEffect)(()=>{f(h.defaultMinPrice),v(h.defaultMaxPrice)},[h.defaultMinPrice,h.defaultMaxPrice]);let A=(0,s.useCallback)((e,t)=>{f(e),v(t)},[]),z=!!(o||u||p>h.defaultMinPrice||b<h.defaultMaxPrice);return(0,r.jsxs)(l.P.div,{className:"bg-gray-100 dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 p-4 ".concat(d),initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row gap-4 items-start lg:items-end",children:[(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("label",{htmlFor:"search",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Produktsuche"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{id:"search",type:"text",value:o,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur()},placeholder:"Nach Produktnamen suchen...",className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 focus:ring-2 focus:ring-orange-500 focus:border-orange-500"}),(0,r.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]})]}),(0,r.jsxs)("div",{className:"w-full lg:w-48",children:[(0,r.jsx)("label",{htmlFor:"brand",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Hersteller"}),(0,r.jsxs)("select",{id:"brand",value:u,onChange:e=>x(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-orange-500 focus:border-orange-500 h-10",children:[(0,r.jsx)("option",{value:"",children:"Alle Hersteller"}),P.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]})]}),(0,r.jsx)("div",{className:"lg:hidden w-full",children:(0,r.jsxs)("button",{onClick:()=>k(!N),className:"w-full px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors flex items-center justify-center gap-2",children:[N?"Weniger Filter":"Mehr Filter",(0,r.jsx)("svg",{className:"w-4 h-4 transition-transform duration-200 ".concat(N?"rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})})]}),(0,r.jsxs)("div",{className:"flex-col lg:flex-row gap-4 items-start lg:items-end transition-all duration-300 ".concat(N?"flex":"hidden lg:flex"),children:[(0,r.jsx)("div",{className:"w-full lg:w-64",children:(0,r.jsx)(y,{products:t,onPriceRangeChange:A,resetTrigger:j})}),(0,r.jsxs)("div",{className:"w-full lg:w-56",children:[(0,r.jsx)("label",{htmlFor:"sort",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Sortierung"}),(0,r.jsxs)("select",{id:"sort",value:m,onChange:e=>g(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-orange-500 focus:border-orange-500 h-10",children:[(0,r.jsx)("option",{value:"price-asc",children:"Preis: Niedrig → Hoch"}),(0,r.jsx)("option",{value:"price-desc",children:"Preis: Hoch → Niedrig"}),(0,r.jsx)("option",{value:"discount-desc",children:"Rabatt: H\xf6chster zuerst"}),(0,r.jsx)("option",{value:"discount-asc",children:"Rabatt: Niedrigster zuerst"})]})]}),i&&(0,r.jsxs)("div",{className:"w-full lg:w-40",children:[(0,r.jsx)("label",{htmlFor:"itemsPerPage",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Artikel pro Seite"}),(0,r.jsxs)("select",{id:"itemsPerPage",value:n,onChange:e=>i(parseInt(e.target.value)),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:ring-2 focus:ring-orange-500 focus:border-orange-500 h-10",children:[(0,r.jsx)("option",{value:"12",children:"12"}),(0,r.jsx)("option",{value:"24",children:"24"}),(0,r.jsx)("option",{value:"48",children:"48"}),(0,r.jsx)("option",{value:"999999",children:"Alle"})]})]}),z&&(0,r.jsx)("div",{className:"flex items-end justify-end",children:(0,r.jsx)("button",{onClick:()=>{c(""),x(""),f(h.defaultMinPrice),v(h.defaultMaxPrice),w(e=>e+1)},className:"px-4 py-2 text-sm font-medium text-gray-600 dark:text-gray-400 hover:text-gray-800 dark:hover:text-gray-200 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors h-10 flex items-center justify-center",children:"Zur\xfccksetzen"})})]})]}),(0,r.jsx)("div",{className:"mt-6 text-sm text-gray-600 dark:text-gray-400",children:z?(0,r.jsxs)("span",{children:[D.length," von ",t.length," Produkten",o&&' • Suche: "'.concat(o,'"'),u&&" • Hersteller: ".concat(u)]}):(0,r.jsxs)("span",{children:[t.length," Produkte verf\xfcgbar"]})})]})}function w(){return(0,r.jsxs)("div",{className:"bg-gray-100 dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 animate-pulse p-2.5",children:[(0,r.jsx)("div",{className:"h-28 bg-gray-200 dark:bg-gray-700 rounded-md mb-2"}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"h-3 bg-gray-200 dark:bg-gray-700 rounded w-3/4"}),(0,r.jsx)("div",{className:"h-3 bg-gray-200 dark:bg-gray-700 rounded w-1/2"}),(0,r.jsx)("div",{className:"h-7 bg-gray-200 dark:bg-gray-700 rounded"})]})]})}function N(e){var t,a,n,i,d,o;let{className:c="",data:u}=e;(0,h.useRouter)();
1let[x,m]=(0,s.useState)(1),[g,y]=(0,s.useState)([]),[N,k]=(0,s.useState)(12),[P,D]=(0,s.useState)(!1),A=(0,v.al)(),[z,S]=(0,s.useState)(null),[C,E]=(0,s.useState)(!0),[M,I]=(0,s.useState)(null),[R,L]=(0,s.useState)(1),F=(0,s.useCallback)(e=>{y(e),D(!0)},[]),_=(0,s.useMemo)(()=>{var e,t,a,r;return(null==u||null==(t=u.ItemsResult)||null==(e=t.Items)?void 0:e.length)?u.ItemsResult.Items.map(b):(null==z||null==(r=z.ItemsResult)||null==(a=r.Items)?void 0:a.length)?z.ItemsResult.Items.map(b):[]},[null==u||null==(t=u.ItemsResult)?void 0:t.Items,null==z||null==(a=z.ItemsResult)?void 0:a.Items]);if((0,s.useEffect)(()=>{if(P&&g.length>0&&_.length>0){let e=new Set(g.map(e=>e.id)),t=new Set(_.map(e=>e.id));e.size===t.size&&e.size===_.length&&Array.from(e).every(e=>t.has(e))&&D(!1)}},[g,_,P]),void 0!==u){if(!(null==u||null==(o=u.ItemsResult)||null==(d=o.Items)?void 0:d.length))return(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:"Keine rabattierten Produkte verf\xfcgbar"})});let{Items:e,Pagination:t}=u.ItemsResult,a=P&&0===g.length?[]:g.length>
10?g:_,s=Math.ceil(a.length/N),n=(x-1)*N,i=a.slice(n,n+N),h=P&&0===g.length&&_.length>0;return(0,r.jsxs)("div",{className:c,children:[(0,r.jsx)(j,{products:_,onFilteredProducts:F,itemsPerPage:N,onItemsPerPageChange:e=>{k(e),m(1)},className:"mb-3"}),h?(0,r.jsx)("div",{className:"text-center py-12 px-4",children:(0,r.jsxs)("div",{className:"max-w-md mx-auto",children:[(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)("svg",{className:"mx-auto h-16 w-16 text-orange-400 dark:text-orange-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,r.jsx)("h3",{className:"text-2xl font-bold text-gray-900 dark:text-white mb-2",children:"Keine Produkte gefunden"}),(0,r.jsx)("p",{className:"text-gray-600 dark:text-gray-400 mb-6",children:"Leider konnten wir keine Produkte finden, die deinen Filterkriterien entsprechen."}),(0,r.jsx)("button",{onClick:()=>{var e;
1let t=null==(e=document.querySelector('[id="search"]'))?void 0:e.closest(".bg-white, .dark\\:bg-gray-800");t&&(t.scrollIntoView({behavior:"smooth",block:"center"}),setTimeout(()=>{let e=Array.from(t.querySelectorAll("button")).find(e=>{var t,a;return(null==(t=e.textContent)?void 0:t.includes("Zur\xfccksetzen"))||(null==(a=e.textContent)?void 0:a.includes("zur\xfccksetzen"))});null==e||e.click()},500))},className:"px-6 py-3 bg-orange-500 hover:bg-orange-600 text-white font-semibold rounded-lg transition-colors shadow-md hover:shadow-lg",children:"Filter zur\xfccksetzen"})]})}):0===a.length?(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:"Keine rabattierten Produkte verf\xfcgbar"})}):(0,r.jsxs)(r.Fragment,{children:[s>1&&(()=>{let e=(0,v.nb)(x,s,A);return(0,r.jsxs)("div",{className:"mb-3 space-y-2",children:[(0,r.jsxs)("div",{className:"text-center text-sm text-gray-600 dark:text-gray-400",children:["Seite ",x," von ",s," (",a.length," Artikel insgesamt)"]}),(0,r.jsx)(v.dK,{children:(0,r.jsxs)(v.Iu,{children:[(0,r.jsx)(v.cU,{children:(0,r.jsx)(v.Eb,{href:"#",onClick:e=>{e.preventDefault(),x>1&&m(x-1)},className:x<=1?"opacity-50 pointer-events-none":""})}),e.map((e,t)=>(0,r.jsx)(v.cU,{children:"ellipsis"===e?(0,r.jsx)(v.M_,{}):(0,r.jsx)(v.n$,{href:"#",onClick:t=>{t.preventDefault(),m(e)},isActive:e===x,children:e})},t)),(0,r.jsx)(v.cU,{children:(0,r.jsx)(v.WA,{href:"#",onClick:e=>{e.preventDefault(),x<s&&m(x+1)},className:x>=s?"opacity-50 pointer-events-none":""})})]})}),(0,r.jsx)(v.cY,{currentPage:x,totalPages:s}),!A&&(0,r.jsx)("div",{className:"text-center mt-2",children:(0,r.jsx)("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:"\uD83D\uDCA1 Tipp: Nutze ← → Tasten zur Navigation"})})]})})(),s>1?(0,r.jsxs)(v.jj,{currentPage:x,totalPages:s,onPageChange:e=>{m(e)},enableSwipe:!0,enableKeyboard:!0,showSwipeIndicator:!1,showKeyboardHint:!1,children:[(0,r.jsx)(f.Ay,{id:"amazon-hinweise",className:"mb-3"}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:i.map((e,t)=>(0,r.jsx)(l.P.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:300,delay:.2*Math.floor(t/4)+.2,duration:.6},children:(0,r.jsx)(p.default,{products:[e],variant:"dealcard",multiple:!1})},e.id))}),(0,r.jsxs)("div",{className:"text-center mt-2 text-sm text-gray-600 dark:text-gray-400",children:["Seite ",x," von ",s,"(",a.length," Artikel insgesamt)"]})]}):(0,r.jsxs)("div",{children:[(0,r.jsx)(f.Ay,{className:"mb-3"}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:a.map((e,t)=>(0,r.jsx)(l.P.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:300,delay:.2*Math.floor(t/4)+.2,duration:.6},children:(0,r.jsx)(p.default,{products:[e],variant:"dealcard",multiple:!1})},e.id))}),(0,r.jsxs)("div",{className:"text-center mt-2 text-sm text-gray-600 dark:text-gray-400",children:[a.length," Artikel insgesamt"]})]})]})]})}let T=async e=>{try{E(!0),I(null);let t=await fetch("/api/amazon/discounted?min_discount=10&limit=12&page=".concat(e,"&exclude_top_deal=true"));if(!t.ok)throw Error("Failed to fetch products");let a=await t.json();S(a)}catch(e){I(e instanceof Error?e.message:"Unknown error")}finally{E(!1)}};if((0,s.useEffect)(()=>{T(R)},[R]),C)return(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 ".concat(c),children:[...Array(12)].map((e,t)=>(0,r.jsx)(w,{},t))});if(M)return(0,r.jsxs)("div",{className:"text-center py-8",children:[(0,r.jsxs)("p",{className:"text-red-600 dark:text-red-400",children:["Fehler beim Laden der Produkte: ",M]}),(0,r.jsx)("button",{onClick:()=>T(R),className:"mt-4 px-4 py-2 bg-orange-500 text-white rounded hover:bg-orange-600",children:"Erneut versuchen"})]});if(!(null==z||null==(i=z.ItemsResult)||null==(n=i.Items)?void 0:n.length))return(0,r.jsx)("div",{className:"text-center py-8",children:(0,r.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:"Keine rabattierten Produkte verf\xfcgbar"})});let{Items:U,Pagination:H}=z.ItemsResult;return(0,r.jsx)("div",{className:c,children:H.totalPages>1?(0,r.jsxs)(v.jj,{currentPage:H.currentPage,totalPages:H.totalPages,onPageChange:e=>{L(e)},enableSwipe:!0,enableKeyboard:!0,showSwipeIndicator:!0,children:[(0,r.jsx)(f.Ay,{className:"mb-3"}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:_.map((e,t)=>(0,r.jsx)(l.P.div,{initial:{opacity:0,scale:.8}
1,animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:300,delay:.2*Math.floor(t/4),duration:.6},children:(0,r.jsx)(p.default,{products:[e],variant:"dealcard",multiple:!1})},e.id))}),(0,r.jsxs)("div",{className:"text-center mt-2 text-sm text-gray-600 dark:text-gray-400",children:["Seite ",H.currentPage," von ",H.totalPages,"(",H.totalItems," Artikel insgesamt)"]})]}):(0,r.jsxs)("div",{children:[(0,r.jsx)(f.Ay,{className:"mb-3"}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:_.map((e,t)=>(0,r.jsx)(l.P.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:300,delay:.2*Math.floor(t/4),duration:.6},children:(0,r.jsx)(p.default,{products:[e],variant:"dealcard",multiple:!1})},e.id))}),(0,r.jsxs)("div",{className:"text-center mt-2 text-sm text-gray-600 dark:text-gray-400",children:[H.totalItems," Artikel insgesamt"]})]})})}function k(e){var t,a,s,d;let{activeDeals:o,topDeal:c,discountedProducts:u,affiliatesWithCodes:x}=e,{activeTab:m,setActiveTab:h}=(0,n.a)(),p=(null==u||null==(a=u.ItemsResult)||null==(t=a.Pagination)?void 0:t.totalItems)||(null==u||null==(d=u.ItemsResult)||null==(s=d.Items)?void 0:s.length)||0,f=(null==o?void 0:o.length)||0,b=(null==x?void 0:x.length)||0,v=e=>{h(e)};return(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsxs)("div",{className:"flex flex-wrap gap-3 mb-3",children:[(0,r.jsx)("button",{onClick:()=>v("amazon"),className:"flex-1 min-w-[220px] px-3 py-2 text-sm font-semibold rounded-2xl transition-all shadow-sm border ".concat("amazon"===m?"bg-gradient-to-r from-blue-600 via-blue-500 to-sky-500 text-white border-blue-500 shadow-lg":"bg-white/60 dark:bg-gray-800/60 text-gray-700 dark:text-gray-200 border-gray-200 dark:border-gray-700 hover:bg-white dark:hover:bg-gray-800"),children:(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})}),"Amazon Rabatte (",p," ",1===p?"Produkt":"Produkte",")"]})}),(0,r.jsx)("button",{onClick:()=>v("other"),className:"flex-1 min-w-[220px] px-3 py-2 text-sm font-semibold rounded-2xl transition-all shadow-sm border ".concat("other"===m?"bg-gradient-to-r from-purple-600 via-indigo-500 to-blue-500 text-white border-indigo-500 shadow-lg":"bg-white/60 dark:bg-gray-800/60 text-gray-700 dark:text-gray-200 border-gray-200 dark:border-gray-700 hover:bg-white dark:hover:bg-gray-800"),children:(0,r.jsxs)("span",{className:"flex items-center gap-2",children:[(0,r.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})}),f>0&&b>0?"Sonstige Deals (".concat(f,") + ").concat(b," Rabattcodes"):f>0?"Sonstige Deals (".concat(f,")"):b>0?"".concat(b," Rabattcodes"):"Sonstige Deals"]})})]}),(0,r.jsxs)("div",{className:"mt-3",children:["amazon"===m&&(0,r.jsxs)("div",{children:[c&&(0,r.jsxs)("section",{children:[(0,r.jsxs)("div",{className:"text-center mb-2",children:[(0,r.jsx)("p",{className:"text-sm uppercase tracking-widest text-orange-400 mb-1",children:"Top Angebot"}),(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Der Artikel mit dem gr\xf6\xdften Rabatt"}),(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:"Aus allen verf\xfcgbaren Amazon-Angeboten"})]}),(0,r.jsx)(g,{product:c,className:"mx-0"})]}),(0,r.jsxs)("section",{className:c?"mt-1":void 0,children:[(0,r.jsxs)("div",{className:"text-center mb-2",children:[(0,r.jsx)("p",{className:"text-sm uppercase tracking-widest text-green-400 mb-1",children:"Rabattierte Artikel"}),(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Alle Smart Home Produkte mit mindestens 10% Rabatt"})]}),(0,r.jsx)(N,{data:u})]})]}),"other"===m&&(0,r.jsxs)("div",{className:"space-y-3",children:[o&&o.length>0&&(0,r.jsx)(i.A,{deals:o}),x.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"text-center mb-3",children:[(0,r.jsx)("p",{className:"text-sm uppercase tracking-widest text-blue-400 mb-1",children:"Dauerhaft verf\xfcgbar"}),(0,r.jsx)("h2",{className:"text-xl font-bold text-gray-900 dark:text-white",children:"Rabatt-Codes f\xfcr die Community"}),(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1 max-w-2xl mx-auto",children:"Diese Rabatt-Codes sind nicht befristet und dauerhaft g\xfcltig. Sie bieten dir stetige Ersparnisse bei deinen Eink\xe4ufen."})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:x.map((e,t)=>(0,r.jsx)(l.P.div,{initial:{opacity:0,scale:.85}
1,animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:280,damping:24,delay:.12*t+.1},children:(0,r.jsx)(D,{affiliate:e})},e.id))})]})]})]}),(0,r.jsx)(P,{variant:m})]})}function P(e){let{variant:t}=e,a=new Date().toLocaleString("de-DE",{timeZone:"Europe/Berlin",day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"});return(0,r.jsxs)("div",{className:"mt-3 bg-blue-50 dark:bg-blue-900/20 border border-blue-300 dark:border-blue-700 rounded-xl shadow-md p-3",children:[(0,r.jsxs)("div",{className:"text-center mb-3",children:[(0,r.jsx)("p",{className:"text-sm uppercase tracking-widest text-blue-400 mb-2",children:"Wichtige Hinweise"}),(0,r.jsx)("h2",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:"Deal-Tipps & Hinweise"})]}),(0,r.jsxs)("div",{className:"text-sm text-blue-700 dark:text-blue-300 space-y-2 leading-snug",children:[(0,r.jsxs)("p",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"⏰ Zeitlich begrenzt:"})," Deals sind oft zeitlich begrenzt oder nur begrenzte St\xfcckzahlen verf\xfcgbar."]}),"amazon"===t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"\uD83D\uDCB0 Preise und Verf\xfcgbarkeit:"})," ",f.NL]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"\uD83D\uDD04 T\xe4glich aktualisiert:"})," Alle Produkte werden t\xe4glich auf Verf\xfcgbarkeit und Preise gepr\xfcft. Der genaue Stand steht jeweils am Preis."]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"\uD83E\uDD1D Amazon-Partner:"})," ",f.mt]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("span",{className:"font-semibold",children:"\uD83D\uDCE6 Amazon-Inhalte:"})," ",f.vO]})]})]}),(0,r.jsxs)("p",{className:"text-sm text-blue-600 dark:text-blue-400 mt-3 text-center",children:["Letzte Aktualisierung: ",a]})]})}function D(e){let{affiliate:t}=e,[a,l]=(0,s.useState)(!1),n=async()=>{try{await navigator.clipboard.writeText(t.discountCode),l(!0),setTimeout(()=>l(!1),2e3)}catch(e){}};return(0,r.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-purple-50 dark:from-blue-900/20 dark:to-purple-900/20 rounded-xl shadow-md p-3 border border-gray-200 dark:border-gray-700 hover:shadow-lg transition-shadow flex flex-col h-full",children:[t.logoUrl&&(0,r.jsx)("div",{className:"flex justify-center items-center mb-2 flex-shrink-0 h-12",children:(0,r.jsx)("img",{src:t.logoUrl,alt:t.name,className:"max-h-12 max-w-full object-contain",loading:"lazy"})}),(0,r.jsxs)("div",{className:"flex flex-col flex-grow",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-gray-900 dark:text-white text-center mb-2 leading-snug",children:t.name}),t.discountCode&&(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("p",{className:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Rabattcode"}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("div",{className:"@container min-w-0 flex-1",children:(0,r.jsx)("code",{className:"flex h-10 w-full items-center justify-center bg-white dark:bg-gray-900 px-1.5 rounded-md font-mono font-semibold tracking-tight text-gray-900 dark:text-gray-100 text-center border border-blue-500 dark:border-blue-400 whitespace-nowrap overflow-hidden text-[clamp(0.8rem,13cqi,1.05rem)]",children:t.discountCode})}),(0,r.jsx)("button",{type:"button",onClick:n,"aria-label":"Rabattcode kopieren",className:"w-10 h-10 shrink-0 inline-flex items-center justify-center bg-blue-600 dark:bg-blue-500 text-white rounded-md hover:bg-blue-700 dark:hover:bg-blue-600 transition-colors text-sm",children:a?"✓":"\uD83D\uDCCB"})]})]}),t.discountCondition&&(0,r.jsx)("p",{className:"text-xs text-gray-600 dark:text-gray-300 mb-2 text-center leading-snug line-clamp-2 min-h-[2.5rem]",children:t.discountCondition}),t.affiliateUrl&&(0,r.jsx)("button",{type:"button",onClick:()=>{t.affiliateUrl&&window.open(t.affiliateUrl,"_blank","noopener,noreferrer")},className:"mt-auto w-full px-3 py-2 bg-gradient-to-r from-blue-600 to-purple-600 text-white font-semibold rounded-lg hover:from-blue-700 hover:to-purple-700 transition-all shadow-md hover:shadow-lg text-sm",children:"Zum Angebot →"})]})]})}},64269:(e,t,a)=>{"use strict";a.d(t,{cn:()=>l});var r=a(2821),s=a(75889);function l(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,s.QP)((0,r.$)(t))}}},e=>{e.O(0,[8995,5321,2245,76,8669,3290,8407,5203,470,5363,2145,6344,7696,8389,3326,2243,2123,9299,9290,622,9491,6785,2559,3649,408,3045,704,3976,7389,2608,2789,9030,4001,9172,3242,2523,5379,7281,3316,5371,8324,5626,7358],()=>e(e.s=8672)),_N_E=e.O()}]);

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.