1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2322],{2080:function(e,t,r){r.d(t,{default:function(){return f}});var n=r(7437),a=r(2265),o=r(166),s=r(9102),l=r(4205),i=r(7192),c=r(5582);let u=["imageprofile","imageProfile","photoURL","photoUrl","avatarUrl","avatarURL","avatar","image"];function d(e){if("string"==typeof e)return e.trim();if(!e||"object"!=typeof e)return"";for(let t of u){let r=e[t];if("string"==typeof r&&r.trim())return r.trim()}return""}function p(e){var t,r;let n=d(e);if(n)return n;if(!e||"object"!=typeof e)return"";for(let n of[e.user,e.profile,e.data,e.result,null===(t=e.data)||void 0===t?void 0:t.user,null===(r=e.data)||void 0===r?void 0:r.profile]){let e=d(n);if(e)return e}return""}let x=(0,o.default)(()=>Promise.resolve().then(r.bind(r,5609)),{loadableGenerated:{webpack:()=>[5609]},ssr:!1});function h(){return(0,n.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"12",cy:"8",r:"3.4",stroke:"currentColor",strokeWidth:"1.6"}),(0,n.jsx)("path",{d:"M4.6 20c0-3.6 3.3-5.8 7.4-5.8s7.4 2.2 7.4 5.8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})]})}function m(e){let{src:t}=e,[r,o]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{o(!1)},[t]),!t||r)?(0,n.jsx)(h,{}):(0,n.jsx)("span",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-full bg-black/10",children:(0,n.jsx)("img",{src:t,alt:"",className:"h-full w-full object-cover",referrerPolicy:"no-referrer",onError:()=>o(!0)})})}function f(e){let{light:t}=e,{t:r}=(0,i.Q)(),{user:o,authenticated:u,getToken:d,sessionRevision:f}=(0,s.a)(),[b,g]=(0,a.useState)(!1),[v,j]=(0,a.useState)(!1),[k,y]=(0,a.useState)(!1),w=p(o),[N,C]=(0,a.useState)(w);(0,a.useEffect)(()=>{let e=!0;return u?(C(w),Promise.resolve(d()).then(e=>e?(0,c.et)(e):null).then(t=>{e&&C(p(t)||w)}).catch(()=>{e&&C(w)})):C(""),()=>{e=!1}},[u,w,d,f]);let E="flex items-center gap-1.5 rounded-full px-4 h-12 text-[18px] font-medium leading-none shrink-0 ".concat(t?"bg-neutral-100 text-neutral-900":"bg-[#2a2a2a] text-white");if(!u)return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{type:"button","aria-haspopup":"dialog",onClick:()=>{j(!0),g(!0)},className:E,children:[(0,n.jsx)(h,{}),(0,n.jsx)("span",{children:r("header.login","×ת××ר×ת")})]}),v&&(0,n.jsx)(x,{open:b,onClose:()=>g(!1),initialMode:"login"})]});let M=o.displayName||(o.email?o.email.split("@")[0]:r("header.myAccount","××ש××× ×©××"));return(0,n.jsxs)("div",{className:"relative shrink-0",children:[(0,n.jsxs)("button",{type:"button","aria-haspopup":"menu",onClick:()=>y(e=>!e),className:E,children:[(0,n.jsx)(m,{src:N}),(0,n.jsx)("span",{className:"max-w-[140px] truncate",dir:"auto",children:M})]}),k&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button","aria-hidden":"true",tabIndex:-1,className:"fixed inset-0 z-40 cursor-default",onClick:()=>y(!1)}),(0,n.jsx)("div",{className:"absolute start-0 top-[52px] z-50",children:(0,n.jsx)(l.default,{className:"shadow-[0_10px_30px_rgba(0,0,0,0.18)]",onSelect:()=>y(!1)})})]})]})}},2755:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(7437);
1function a(e){let{size:t=22,active:r=!1,className:a="",stops:o=["#4BBFD6","#47F5A6"],mini:s=!0}=e,[l,i]=o,c="aiSparkGrad-".concat(l.replace("#",""),"-").concat(i.replace("#",""));return(0,n.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"shrink-0 ".concat(r?"ai-sparkle-active":""," ").concat(a),children:[(0,n.jsx)("defs",{children:(0,n.jsxs)("linearGradient",{id:c,x1:"0",y1:"0",x2:"1",y2:"1",children:[(0,n.jsx)("stop",{stopColor:l}),(0,n.jsx)("stop",{offset:"1",stopColor:i})]})}),(0,n.jsx)("path",{className:"ai-spark-main",d:"M12 2.5l1.8 4.9c.3.8.9 1.4 1.7 1.7L20.5 11l-4.9 1.8c-.8.3-1.4.9-1.7 1.7L12 19.5l-1.8-4.9a2.7 2.7 0 0 0-1.7-1.7L3.5 11l4.9-1.8c.8-.3 1.4-.9 1.7-1.7L12 2.5Z",fill:"url(#".concat(c,")")}),s&&(0,n.jsx)("path",{className:"ai-spark-mini",d:"M19.2 3.1l.5 1.5c.09.25.27.43.52.52l1.5.55-1.5.55c-.25.09-.43.27-.52.52l-.5 1.5-.55-1.5a.9.9 0 0 0-.52-.52l-1.5-.55 1.5-.55c.25-.09.43-.27.52-.52l.55-1.5Z",fill:l})]})}},4053:function(e,t,r){r.d(t,{default:function(){return L}});var n=r(7437),a=r(8353),o=r(9376),s=r(2265),l=r(7388),i=r(9102),c=r(166),u=r(15),d=r(7192),p=r(3904),x=r(2964),h=r(5025),m=r(3330),f=r(3584),b=r(1396);let g={print:{labelKey:"cart.formatPrint",labelHe:"×××פס",Icon:u.bv},audio:{labelKey:"cart.formatAudio",labelHe:"×§×××",Icon:u.DT},digital:{labelKey:"cart.formatDigital",labelHe:"×××××××",Icon:u.qW},set:{labelKey:"cart.formatSet",labelHe:"×¡× ×¡×¤×¨××",Icon:u.bv},bundle:{labelKey:"cart.formatBundle",labelHe:"××קפ×× 360",Icon:u.bv}},v=e=>(0,b.of)(e)?g.set:g[null==e?void 0:e.format]||g.print,j=e=>Number.isInteger(e)?"".concat(e):e.toFixed(2);function k(){return(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6"})})}function y(e){let{size:t=40}=e;return(0,n.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,n.jsx)("rect",{x:"4",y:"5.5",width:"16",height:"14.5",rx:"2.5"}),(0,n.jsx)("path",{d:"M8.7 9.3a3.3 3.3 0 0 0 6.6 0"})]})}function w(e){let{className:t=""}=e;return(0,n.jsx)("svg",{width:"210",height:"34",viewBox:"0 0 240 56",preserveAspectRatio:"none",className:t,"aria-hidden":"true",children:(0,n.jsx)("path",{d:"M0 0 C78 2 116 56 120 56 C124 56 162 2 240 0 Z",fill:"rgb(var(--ui-raised))"})})}function N(e){let{item:t,onQty:r,onRemove:a,onMoveToFavorites:o}=e,{t:s}=(0,d.Q)(),{symbol:l}=(0,x.U8)(),i=v(t),c=i.Icon,u=(0,b.of)(t)||"print"===t.format;return(0,n.jsxs)("div",{className:"flex gap-4 rounded-[13px] border-[2.2px] border-brand-green bg-ui-surface p-5",children:[(0,n.jsx)(p.Z,{book:t,className:"h-[128px] w-[90px] shrink-0 rounded-[6px]",captionClassName:"text-[10px] line-clamp-4"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 text-start",children:[(0,n.jsx)("h3",{className:"text-[18px] font-medium leading-snug text-ui-content line-clamp-2",dir:"auto",children:t.title}),(0,n.jsxs)("span",{className:"mt-2 inline-flex items-center gap-1.5 rounded-[8px] bg-ui-subtle px-2.5 py-1 text-[15px] leading-none text-ui-content",children:[(0,n.jsx)("span",{className:"[&>svg]:h-[18px] [&>svg]:w-[18px]",children:(0,n.jsx)(c,{})}),s(i.labelKey,i.labelHe)]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2.5 text-ui-content",children:[(0,n.jsx)("button",{type:"button","aria-label":s("cart.removeFromCart","××¡×¨× ××ס×"),onClick:a,className:"transition-colors hover:text-red-500",children:(0,n.jsx)(k,{})}),!(0,b.of)(t)&&(0,n.jsx)(f.Z,{onMove:o,className:"hover:text-brand-green focus-visible:text-brand-green"})]})]}),(0,n.jsxs)("div",{className:"mt-auto flex items-end justify-between gap-2 pt-2",children:[u?(0,n.jsxs)("div",{className:"flex h-[36px] items-center gap-3 rounded-[8px] border border-ui-border/20 px-3",dir:"ltr",children:[(0,n.jsx)("button",{type:"button","aria-label":s("cart.increaseQty","××ספת ×××ת"),onClick:()=>r(t.qty+1),className:"text-[19px] leading-none text-ui-muted hover:text-ui-content",children:"+"}),(0,n.jsx)("span",{className:"min-w-[14px] text-center text-[15px] tabular-nums text-ui-content",children:t.qty}),(0,n.jsx)("button",{type:"button","aria-label":s("cart.decreaseQty","×פ×תת ×××ת"),onClick:()=>r(Math.max(1,t.qty-1)),className:"text-[19px] leading-none text-ui-muted hover:text-ui-content",children:"â"})]}):(0,n.jsx)("span",{}),(0,n.jsxs)("div",{className:"flex items-baseline gap-2",dir:"ltr",children:[t.origPrice>t.price&&(0,n.jsx)("span",{className:"text-[13px] text-red-500 line-through",children:(0,h.CZ)(t.origPrice,l)}),(0,n.jsx)("span",{className:"text-[18px] font-bold text-ui-content",children:(0,h.CZ)(t.price,l)})]})]})]})]})}function C(e){let{onNavigate:t}=e,{t:r,dir:o}=(0,d.Q)(),{symbol:s}=(0,x.U8)(),i=(0,l.j)(),{items:c,hydrated:u,subtotal:p}=i,{addFavorite:f}=(0,m.r)(),g=e=>{(0,b.of)(e)||f(e,{onSuccess:()=>i.removeItem(e.key)})};return u&&0!==c.length?(0,n.jsxs)("div",{dir:o,className:"theme-elevated-card flex max-h-[940px] w-[594px] flex-col overflow-hidden rounded-[18px] border border-ui-border/1
15 bg-ui-raised shadow-[0_10px_24px_rgba(0,0,0,0.10),0_40px_70px_rgba(0,0,0,0.12)]",children:[(0,n.jsx)("div",{className:"no-scrollbar flex min-h-0 flex-col gap-[14px] overflow-y-auto px-[34px] pb-[24px] pt-[39px]",children:c.map(e=>(0,n.jsx)(N,{item:e,onQty:t=>i.setQty(e.key,t),onRemove:()=>i.removeItem(e.key),onMoveToFavorites:()=>g(e)},e.key))}),(0,n.jsxs)("div",{className:"relative shrink-0 bg-ui-soft px-[31px] pb-[34px] pt-[34px]",children:[(0,n.jsx)(w,{className:"pointer-events-none absolute left-1/2 top-0 -translate-x-1/2"}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-[20px] font-medium text-ui-content",dir:"ltr",children:(0,h.CZ)(p,s)}),(0,n.jsx)("span",{className:"text-[20px] font-medium text-ui-content",children:r("cart.subtotal","ס××× ××× ×××")})]}),(0,n.jsxs)(a.default,{href:"/cart",onClick:t,className:"mt-[10px] flex h-[60px] w-full items-center justify-center rounded-[12px] bg-brand-green text-[20px] font-medium text-black transition-opacity hover:opacity-90",children:[r("cart.goToCheckout","××¢×ר ××§×פ×")," ⢠",j(p)]})]})]}):(0,n.jsxs)("div",{dir:o,className:"theme-elevated-card w-[360px] overflow-hidden rounded-[18px] border border-ui-border/15 bg-ui-raised p-9 text-center shadow-[0_10px_24px_rgba(0,0,0,0.10),0_40px_70px_rgba(0,0,0,0.12)]",children:[(0,n.jsx)("div",{className:"mx-auto grid h-[64px] w-[64px] place-items-center rounded-full bg-ui-soft text-ui-content",children:(0,n.jsx)(y,{size:32})}),(0,n.jsx)("p",{className:"mt-4 text-[18px] font-bold text-ui-content",children:r("cart.cartEmpty","××¡× ×©×× ×¨××§")}),(0,n.jsx)("p",{className:"mt-1 text-[14px] text-ui-muted",children:r("cart.cartEmptySubShort","×¢×××× ×× ××ספת ספר×× ×ס×.")}),(0,n.jsx)(a.default,{href:"/",onClick:t,className:"mt-5 inline-block rounded-[10px] bg-brand-green px-6 py-2.5 text-[15px] font-bold text-black",children:r("cart.browseBooks","××¢××× ×ספר××")})]})}let E=(0,c.default)(()=>Promise.resolve().then(r.bind(r,5609)),{loadableGenerated:{webpack:()=>[5609]},ssr:!1}),M="/account?tab=favorites";function L(e){let{light:t}=e,{t:r,dir:c,localizeHref:u}=(0,d.Q)(),{symbol:p}=(0,x.U8)(),{count:m,subtotal:f,hydrated:b,registerCartTarget:g,bump:v}=(0,l.j)(),j=(0,h.CZ)(b?f:0,p),k=(0,s.useRef)(null),[y,w]=(0,s.useState)(!1),N=(0,o.useRouter)(),{authenticated:L}=(0,i.a)(),[S,A]=(0,s.useState)(!1),[F,I]=(0,s.useState)(!1),[D,_]=(0,s.useState)(!1);(0,s.useEffect)(()=>{L&&D&&(_(!1),A(!1),N.push(u(M)))},[L,u,D,N]);
1let[T,R]=(0,s.useState)(!1),B=(0,s.useRef)(null),W=()=>{B.current&&clearTimeout(B.current),R(!0)},z=()=>{B.current&&clearTimeout(B.current),B.current=setTimeout(()=>R(!1),160)};(0,s.useEffect)(()=>()=>B.current&&clearTimeout(B.current),[]),(0,s.useEffect)(()=>{if(!T)return;let e=e=>{"Escape"===e.key&&R(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[T]),(0,s.useEffect)(()=>g(k.current),[g]),(0,s.useEffect)(()=>{var e;let t=window.matchMedia("(prefers-reduced-motion: reduce)");w(t.matches);let r=e=>w(e.matches);return null===(e=t.addEventListener)||void 0===e||e.call(t,"change",r),()=>{var e;return null===(e=t.removeEventListener)||void 0===e?void 0:e.call(t,"change",r)}},[]);let P=v>0&&!y;return(0,n.jsxs)("div",{className:"relative shrink-0",onMouseEnter:W,onMouseLeave:z,onFocusCapture:W,onBlurCapture:z,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 rounded-full h-12 ps-3 pe-1.5 shrink-0 shadow-[0_1px_4px_rgba(0,0,0,0.13)] ".concat(t?"bg-neutral-100 text-neutral-900":"bg-[#2a2a2a] text-white"),children:[(0,n.jsx)(a.default,{href:M,"aria-label":r("header.favorites","×××¢×פ××"),onClick:e=>{L||(e.preventDefault(),_(!0),I(!0),A(!0))},className:"grid place-items-center w-[37px] h-[37px] rounded-full bg-brand-green text-black shrink-0",children:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M17.3651 3.84124C16.9395 3.41541 16.4341 3.07761 15.8779 2.84714C15.3217 2.61667 14.7255 2.49805 14.1235 2.49805C13.5214 2.49805 12.9252 2.61667 12.369 2.84714C11.8128 3.07761 11.3074 3.41541 10.8818 3.84124L9.99847 4.72457L9.11514 3.84124C8.25539 2.98149 7.08933 2.49849 5.87347 2.49849C4.65761 2.49849 3.49155 2.98149 2.6318 3.84124C1.77206 4.70098 1.28906 5.86704 1.28906 7.0829C1.28906 8.29876 1.77206 9.46483 2.6318 10.3246L3.51514 11.2079L9.99847 17.6912L16.4818 11.2079L17.3651 10.3246C17.791 9.89894 18.1288 9.39358 18.3592 8.83736C18.5897 8.28115 18.7083 7.68497 18.7083 7.0829C18.7083 6.48083 18.5897 5.88465 18.3592 5.32844C18.1288 4.77222 17.791 4.26686 17.3651 3.84124Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,n.jsxs)(a.default,{href:"/cart","aria-label":r("header.cart","×¡× ××§× ××ת"),className:"flex items-center gap-2",children:[(0,n.jsxs)("span",{ref:k,className:"relative inline-block",children:[P&&(0,n.jsx)("span",{"aria-hidden":"true",className:"pointer-events-none absolute left-1/2 top-1/2 h-[30px] w-[30px] rounded-full border-2 border-brand-green animate-[cart-ring_0.6s_ease-out_forwards]"},"ring-".concat(v)),(0,n.jsx)("span",{className:"block ".concat(P?"animate-[cart-pop_0.55s_ease]":""),children:(0,n.jsxs)("svg",{width:"31",height:"31",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,n.jsx)("rect",{x:"4",y:"5.5",width:"16",height:"14.5",rx:"2.5",stroke:"currentColor",strokeWidth:"1.45"}),(0,n.jsx)("path",{d:"M8.7 9.3a3.3 3.3 0 0 0 6.6 0",stroke:"currentColor",strokeWidth:"1.45",strokeLinecap:"round"})]})},"bag-".concat(v)),b&&m>0&&(0,n.jsx)("span",{dir:"ltr",className:"absolute -end-1.5 -top-1 grid h-[18px] min-w-[18px] place-items-center rounded-full bg-brand-green px-1 text-[11px] font-bold leading-none text-black ".concat(P?"animate-[cart-pop_0.55s_ease]":""),children:m},"badge-".concat(v))]}),(0,n.jsx)("span",{className:"text-[18px] font-medium leading-none",dir:"ltr",children:j})]})]}),(0,n.jsx)("div",{className:"absolute end-0 top-full z-50 ".concat("rtl"===c?"origin-top-left":"origin-top-right"," transition-[opacity,transform] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none ").concat(T?"translate-y-[10px] scale-[0.76] opacity-100":"pointer-events-none translate-y-[2px] scale-[0.68] opacity-0"),onMouseEnter:W,onMouseLeave:z,"aria-hidden":!T,inert:T?void 0:"",children:(0,n.jsx)(C,{onNavigate:()=>R(!1)})}),F&&(0,n.jsx)(E,{open:S,onClose:()=>{A(!1),_(!1)},initialMode:"login"})]})}},3904:function(e,t,r){r.d(t,{Z:function(){return o}});var n=r(7437),a=r(1430);function o(e){let{book:t,className:r="",captionClassName:o="text-[10px] line-clamp-4"}=e,s=(null==t?void 0:t.bg)||"#1f2a44",l=(null==t?void 0:t.fg)||"#e9eefb";return(null==t?void 0:t.cover)?(0,n.jsx)(a.default,{src:t.cover,alt:t.title,width:128,height:182,sizes:"128px",className:"object-cover ".concat(r)}):(0,n.jsx)("div",{className:"grid place-items-center px-1 text-center ".concat(r),style:{backgroundColor:s},children:(0,n.jsx)("span",{dir:"auto",className:"font-bold leading-tight ".concat(o),style:{color:l}
1,children:null==t?void 0:t.title})})}},224:function(e,t,r){r.d(t,{default:function(){return p}});var n=r(7437),a=r(2265),o=r(7192),s=r(3654),l=r(6950),i=r(556);function c(){return(0,n.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.6"}),(0,n.jsx)("path",{d:"M3 12h18M12 3c2.5 2.5 2.5 15 0 18M12 3c-2.5 2.5-2.5 15 0 18",stroke:"currentColor",strokeWidth:"1.6"})]})}function u(e){let{open:t}=e;return(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"transition-transform duration-200 ".concat(t?"rotate-180":""),children:(0,n.jsx)("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}function d(){return(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M5 13l4 4L19 7",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function p(e){let{light:t=!1}=e,{locale:r,locales:p,setLocale:x,t:h}=(0,o.Q)(),{enabled:m,mode:f}=(0,l.Fg)(),[b,g]=(0,a.useState)(!1),v=(0,a.useRef)(null),j=(0,a.useRef)(null),k=(0,a.useRef)(!1),y=(0,a.useId)().replace(/:/g,""),w="".concat(y,"-display-preferences"),N="".concat(y,"-display-preferences-title"),C="".concat(y,"-display-language");(0,a.useEffect)(()=>{if(!b)return;let e=e=>{var t;k.current=!!(null===(t=v.current)||void 0===t?void 0:t.contains(e.target)),k.current||g(!1)},t=()=>{k.current=!1},r=e=>{"Escape"===e.key&&(g(!1),window.requestAnimationFrame(()=>{var e;return null===(e=j.current)||void 0===e?void 0:e.focus()}))};return document.addEventListener("mousedown",e),document.addEventListener("mouseup",t),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("mouseup",t),document.removeEventListener("keydown",r)}},[b]);let E="system"===f?h("account.themeSystem","×××רת ×××ש×ר"):"dark"===f?h("account.themeDark","×××"):h("account.themeLight","×××ר"),M=m?"".concat(h("header.displayPreferences","×©×¤× ××ר××"),": ").concat(i.Ok[r],", ").concat(E):"".concat(h("header.language","שפ×"),": ").concat(i.Ok[r]);return(0,n.jsxs)("div",{className:"relative shrink-0",ref:v,onBlurCapture:e=>{!b||k.current||e.currentTarget.contains(e.relatedTarget)||g(!1)},children:[(0,n.jsxs)("button",{ref:j,type:"button","aria-label":M,"aria-expanded":b,...b?{"aria-controls":w}:null,onClick:()=>g(e=>!e),className:"flex h-12 items-center gap-1.5 rounded-full px-3 text-[16px] font-medium leading-none transition-colors ".concat(t?"bg-neutral-100 text-neutral-900 hover:bg-neutral-200":"bg-[#2a2a2a] text-white hover:bg-[#363636]"),children:[(0,n.jsx)(c,{}),(0,n.jsx)("span",{"aria-hidden":"true",className:"text-[18px] leading-none",children:i.Hm[r]}),(0,n.jsx)("span",{dir:"ltr","aria-hidden":"true",className:"min-w-5 text-center text-[13px] font-semibold tracking-wide",children:r.toUpperCase()}),(0,n.jsx)(u,{open:b})]}),b&&(0,n.jsxs)("section",{id:w,"aria-labelledby":N,className:"absolute end-0 top-[52px] z-50 w-[320px] rounded-2xl border border-ui-border/15 bg-ui-raised p-4 text-ui-content shadow-[0_14px_40px_rgba(0,0,0,0.28)]",children:[(0,n.jsx)("h2",{id:N,className:"text-[17px] font-semibold",children:h("header.displayPreferences","×©×¤× ××ר××")}),(0,n.jsxs)("fieldset",{className:"mt-4",children:[(0,n.jsx)("legend",{className:"text-[13px] font-semibold uppercase tracking-wide text-ui-muted",children:h("header.language","שפ×")}),(0,n.jsx)("div",{className:"mt-2 overflow-hidden rounded-[14px] border border-ui-border/10 bg-ui-subtle",children:p.map(e=>{let t=e===r;return(0,n.jsxs)("label",{className:"flex min-h-11 cursor-pointer items-center gap-3 border-b border-ui-border/10 px-3 py-2 text-[15px] transition-colors last:border-b-0 focus-within:outline focus-within:outline-2 focus-within:-outline-offset-2 focus-within:outline-brand-focus ".concat(t?"bg-brand-green/15 font-semibold text-ui-content":"hover:bg-ui-surface"),children:[(0,n.jsx)("input",{className:"sr-only",type:"radio",name:C,value:e,checked:t,onChange:()=>{g(!1),x(e)}}),(0,n.jsx)("span",{className:"text-[20px] leading-none",children:i.Hm[e]}),(0,n.jsx)("bdi",{dir:"auto",className:"flex-1",children:i.Ok[e]}),t&&(0,n.jsx)(d,{})]},e)})})]}),m&&(0,n.jsx)(s.I,{className:"mt-4 border-t border-ui-border/10 pt-4",legendClassName:"text-[13px] font-semibold uppercase tracking-wide text-ui-muted"})]})]})}},5253:function(e,t,r){r.d(t,{default:function(){return p}});var n=r(7437),a=r(2265),o=r(8353),s=r(9376),l=r(6052),i=r(7192),c=r(2964);let u=[{id:"new",i18nKey:"navNew",label:"××ש ×××קפ××",href:"/new"},{id:"authors",i18nKey:"navAuthors",label:"××××¢ ×ס×פר××",href:"https://lp.bookpod.co.il",external:!0,israelOnly:!0}];function d(e){let{active:t}=e;return(0,n.jsx)("span",{className:"absolute bottom-[-14px] inset-x-0 h-[3px] rounded-full bg-brand-green origin-center transition-all duration-200 ease-out ".concat(t?"scale-x-100 opacity-100":"scale-x-0 opacity-0")})}function p(e){let{light:t=!1}=e,{t:r}=(0,i.Q)(),{isGlobal:p,storeKey:x}=(0,c.mT)(),h=p||"bookplus"===x?u.filter(e=>!e.israelOnly):u,m=(0,s.usePathname)(),[f,b]=(0,a.useState)(!1),[g,v]=(0,a.useState)(null),j=(0,a.useRef)(null),k="".concat((0,a.useId)().replace(/:/g,""),"-mega"),y=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>y.current&&clearTimeout(y.current),[]),(0,a.useEffect)(()=>
1{if(f)return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)};function e(e){j.current&&!j.current.contains(e.target)&&b(!1)}function t(e){"Escape"===e.key&&b(!1)}},[f]);let w="/new"===m||(null==m?void 0:m.startsWith("/new/"))?"new":"/writers"===m||(null==m?void 0:m.startsWith("/writers/"))?"authors":"/category"===m||(null==m?void 0:m.startsWith("/category/"))?"cat":null,N=null!=g?g:f?"cat":w,C="relative block translate-y-[3px] text-[16px] font-normal leading-none whitespace-nowrap pb-1.5 transition-colors duration-200",E=t?"text-black/70 hover:text-black":"text-white/80 hover:text-white";return(0,n.jsxs)("nav",{"aria-label":r("header.primaryNavAria","× ×××× ×¨×ש×"),className:"flex items-center gap-8",onMouseLeave:()=>v(null),children:[(0,n.jsxs)("div",{ref:j,onMouseEnter:()=>{y.current&&clearTimeout(y.current),b(!0)},onMouseLeave:()=>{y.current&&clearTimeout(y.current),y.current=setTimeout(()=>b(!1),150)},children:[(0,n.jsxs)("button",{type:"button",onClick:()=>b(e=>!e),onMouseEnter:()=>v("cat"),"aria-expanded":f,"aria-controls":k,className:"".concat(C," ").concat(E),children:[r("header.allCategories","×× ××§×××ר××ת"),(0,n.jsx)(d,{active:"cat"===N})]}),(0,n.jsx)(l.ZP,{open:f,onClose:()=>b(!1),panelId:k})]}),h.map(e=>(0,n.jsxs)(o.default,{href:e.href,target:e.external?"_blank":void 0,rel:e.external?"noopener noreferrer":void 0,onMouseEnter:()=>v(e.id),"aria-current":w===e.id?"page":void 0,className:"".concat(C," ").concat(E),children:["bookplus"===x&&"new"===e.id?r("header.navNewNeutral","××ש"):r("header.".concat(e.i18nKey),e.label),(0,n.jsx)(d,{active:N===e.id})]},e.id))]})}},9646:function(e,t,r){r.d(t,{default:function(){return P}});var n=r(7437),a=r(2265),o=r(9376),s=r(4190),l=r(2755),i=r(7192),c=r(4041),u=r(9102),d=r(4340),p=r(3484);let x="bp_recent_searches",h=Object.freeze({books:[],sets:[],authors:[],categories:[]}),m=Object.freeze({books:0,sets:0,products:0,authors:0,categories:0}),f=new Set(["array","null","undefined","[object object]","nan"]),b={he:["ספר ×ר×××¢ ××¤× × ×ש×× ×","×ש×× ××× ×××¨× ×¤××ר","××ª× ×©×§×©× ××× ××","××ª× × ×××× ×× 8"],en:["A calming book before bed","Something like Harry Potter","A thriller I canât put down","A gift for an 8-year-old"],fr:["Un livre apaisant avant de dormir","Quelque chose comme Harry Potter","Un thriller haletant","Un cadeau pour un enfant de 8 ans"],de:["Ein beruhigendes Buch vor dem Schlafen","Etwas wie Harry Potter","Ein fesselnder Thriller","Ein Geschenk f\xfcr ein 8-j\xe4hriges Kind"],es:["Un libro relajante antes de dormir","Algo como Harry Potter","Un thriller que no puedas soltar","Un regalo para un ni\xf1o de 8 a\xf1os"],nl:["Een rustgevend boek voor het slapengaan","Iets zoals Harry Potter","Een thriller die ik niet kan wegleggen","Een cadeau voor een kind van 8"]},g={he:["ר×××","×××××","×ת×","×¢×××"],en:["Novel","Children","Thriller","Non-fiction"],fr:["Roman","Enfants","Thriller","Essai"],de:["Roman","Kinder","Thriller","Sachbuch"],es:["Novela","Ni\xf1os","Suspense","No ficci\xf3n"],nl:["Roman","Kinderen","Thriller","Non-fictie"]};function v(e){let t="",r=[];for(let n=0;n<e.length;n++){let a=e[n].normalize("NFD").replace(/[\u0300-\u036F\u0591-\u05C7]/g,"").toLowerCase();for(let e=0;e<a.length;e++)t+=a[e],r.push(n)}return{folded:t,map:r}}function j(e){if("string"!=typeof e&&"number"!=typeof e)return"";let t=String(e).replace(/\s+/g," ").trim();return!t||f.has(t.toLowerCase())?"":t}function k(e){return v(j(e)).folded.replace(/[\s_-]+/g," ").trim()}function y(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.round(t):0}function w(e,t){let r=new Set;return e.filter(e=>{let n=t(e);return!(!n||r.has(n))&&(r.add(n),!0)})}function N(e){return Array.isArray(e)?w(e.map(e=>{var t,r,n;let a="string"==typeof e?{value:e,label:e}:e;if(!a||"object"!=typeof a)return null;let o=j(a.label||a.name||a.title||a.value||a.slug);if(!o)return null;let s=j(a.value||a.slug)||o;return{...a,value:s,label:o,bookCount:y(null!==(n=null!==(r=null!==(t=a.bookCount)&&void 0!==t?t:a.book_count)&&void 0!==r?r:a.item_count)&&void 0!==n?n:a.count),exact:!0===a.exact}}
1).filter(Boolean),e=>k(e.value||e.label)):[]}function C(e){if(!Array.isArray(e))return[];let t=[...e],r=[],n=new Set;for(;t.length;){let e=t.shift();if(e){if("object"==typeof e){if(n.has(e))continue;n.add(e),Array.isArray(e.children)&&t.push(...e.children)}r.push(e)}}return N(r)}function E(e,t,r){return(null==e?void 0:e.exact)===!0||!!k(r)&&k(t)===k(r)}function M(e,t,r){let a=String(e||""),o=String(t||"").trim();if(!o)return a;let{folded:s,map:l}=v(a),i=v(o).folded;if(!i)return a;let c=s.indexOf(i);if(c<0)return a;let u=l[c],d=c+i.length<l.length?l[c+i.length]:a.length;return(0,n.jsxs)(n.Fragment,{children:[a.slice(0,u),(0,n.jsx)("mark",{className:r,children:a.slice(u,d)}),a.slice(d)]})}function L(e){let{path:t,size:r=18,className:a=""}=e;return(0,n.jsx)("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"shrink-0 ".concat(a),children:t})}let S=(0,n.jsx)("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),A=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.8"}),(0,n.jsx)("path",{d:"M12 7v5l3 2",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]}),F=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("path",{d:"M20.5 12a8.5 8.5 0 1 1-2.6-6.1",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M20.6 3.6v4.2h-4.2",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M12 7.4V12l3 1.8",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}),I=(0,n.jsx)("path",{d:"M4 12.5V5a1 1 0 0 1 1-1h7.5a1 1 0 0 1 .7.3l6.5 6.5a1 1 0 0 1 0 1.4l-7 7a1 1 0 0 1-1.4 0L4.3 13.2a1 1 0 0 1-.3-.7ZM8 8h.01",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"}),D=(0,n.jsx)("path",{d:"M5 4h9a2 2 0 0 1 2 2v13a1 1 0 0 1-1 1H6a2 2 0 0 1-2-2V5a1 1 0 0 1 1-1Zm11 0h2a1 1 0 0 1 1 1v14",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),_=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("circle",{cx:"12",cy:"8",r:"3.4",stroke:"currentColor",strokeWidth:"1.7"}),(0,n.jsx)("path",{d:"M5 20c0-3.5 3-5.7 7-5.7s7 2.2 7 5.7",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]}),T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("path",{d:"M12 8v5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,n.jsx)("circle",{cx:"12",cy:"16.5",r:"1",fill:"currentColor"}),(0,n.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.8"})]});function R(){return(0,n.jsxs)("svg",{width:"20",height:"17.8",viewBox:"0 0 28 25",fill:"none","aria-hidden":"true",className:"shrink-0",children:[(0,n.jsx)("path",{d:"M14.0244 0C19.8032 0.000118032 24.4883 4.68503 24.4883 10.4639C24.4882 13.0279 23.5631 15.3748 22.0322 17.1943L27.6865 22.8486C28.0769 23.2392 28.077 23.8722 27.6865 24.2627C27.296 24.653 26.6629 24.653 26.2725 24.2627L20.6055 18.5957C18.8076 20.0525 16.5187 20.9277 14.0244 20.9277C8.96379 20.9277 4.74278 17.3345 3.77148 12.5605H5.82324C6.75636 16.2205 10.074 18.9277 14.0244 18.9277C18.6985 18.9276 22.488 15.1379 22.4883 10.4639C22.4883 5.7896 18.6987 2.00012 14.0244 2C12.4737 2 11.0214 2.41843 9.77148 3.14648C9.38639 2.57402 8.89566 2.07895 8.32715 1.68848C9.96681 0.621725 11.9225 0 14.0244 0Z",fill:"currentColor"}),(0,n.jsx)("path",{d:"M4.5 2.0459C5.27145 4.13071 6.91519 5.77445 9 6.5459C6.91519 7.31735 5.27145 8.96109 4.5 11.0459C3.72855 8.96109 2.08481 7.31735 0 6.5459C2.08481 5.77445 3.72855 4.13071 4.5 2.0459Z",fill:"currentColor"})]})}function B(){return(0,n.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"dir-flip shrink-0 text-neutral-400",children:(0,n.jsx)("path",{d:"M14 6l-6 6 6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function W(e){let{src:t,onError:r}=e;return(0,n.jsx)("span",{className:"flex h-[52px] w-[37px] shrink-0 items-center justify-center overflow-hidden rounded bg-neutral-100 text-neutral-300",children:t?(0,n.jsx)("img",{src:t,alt:"",loading:"lazy",onError:r,className:"h-full w-full object-cover"}):(0,n.jsx)(L,{path:D,size:18})})}function z(e){let{formats:t,discount:r,t:a}=e,o=[];return((null==t?void 0:t.audio)!=null&&o.push({k:"audio",label:a("header.fmtAudio","ש××¢")}),(null==t?void 0:t.digital)!=null&&o.push({k:"digital",label:a("header.fmtDigital","×××××××")}),(null==t?void 0:t.print)&&o.push({k:"print",label:a("header.fmtPrint","×××פס")}),o.length||r)?(0,n.jsxs)("span",{className:"mt-1 flex flex-wrap gap-1",children:[o.map(e=>(0,n.jsx)("span",{className:"rounded bg-brand-green/15 px-1.5 py-[1px] text-[11px] leading-tight text-emerald-800",children:e.label},e.k)),r?(0,n.jsx)("span",{className:"rounded bg-rose-100 px-1.5 py-[1px] text-[11px] leading-tight text-rose-700",children:a("header.onSale","××צע")}):null]}):null}function P(e){let{light:t=!1,initialQuery:r="",categories:f=null,autoFocus:v=!1,onNavigate:P,inline:Z=!1,defaultOpen:K=!1,onOpenChange:O,focusEventName:U,placeholder:H}=e,{t:q,dir:Q,locale:G,localizeHref:J}=(0,i.Q)(),{authenticated:V}=(0,u.a)(),X=(0,d.L)(),{openConcierge:Y}=(0,p.O)(),$=(0,o.useRouter)(),ee=(0,a.useId)().replace(/:/g,""),et="header-search-listbox-".concat(ee),er=e=>"hs-".concat(ee,"-opt-").concat(e),[en,ea]=(0,a.useState)(r),[eo,es]=(0,a.useState)(()=>K),[el,ei]=(0,a.useState)(h),[ec,eu]=(0,a.useState)(m),[ed,ep]=(0,a.useState)(!1),[ex,eh]=(0,a.useState)(!1),[em,ef]=(0,a.useState)(-1),[eb,eg]=(0,a.useState)([]),[ev,ej]=(0,a.useState)(!0),[ek,ey]=(0,a.useState)(0),[ew,eN]=(0,a.useState)(0),[eC,eE]=(0,a.useState)(""),[eM,eL]=(0,a.useState)(()=>new Set),eS=(0,a.useRef)(null),eA=(0,a.useRef)(null),eF=(0,a.useRef)(new Map),eI=(0,a.useRef)(!1),eD=(0,a.useRef)(!1),e_=(0,a.useRef)(!0),eT=(0,a.useRef)(O),eR=(0,a.useRef)(eo),eB=en.trim(),eW=eB.length>
1=2,ez=1===eB.length,eP=(eB?eB.split(/\s+/).filter(Boolean).length:0)>=2||eB.endsWith("?");(0,a.useEffect)(()=>ea(r),[r]),(0,a.useEffect)(()=>{eT.current=O},[O]),(0,a.useEffect)(()=>{var e;eR.current!==eo&&(eR.current=eo,null===(e=eT.current)||void 0===e||e.call(eT,eo))},[eo]),(0,a.useEffect)(()=>{if(!v)return;let e=setTimeout(()=>{var e;null===(e=eA.current)||void 0===e||e.focus(),es(!0)},60);return()=>clearTimeout(e)},[v]),(0,a.useEffect)(()=>{if(!U)return;let e=()=>{es(!0),Z&&window.scrollTo({top:0,behavior:"auto"}),requestAnimationFrame(()=>{var e;return null===(e=eA.current)||void 0===e?void 0:e.focus()})};return window.addEventListener(U,e),()=>window.removeEventListener(U,e)},[U,Z]),(0,a.useEffect)(()=>{try{let e=localStorage.getItem(x);e&&eg(JSON.parse(e).slice(0,6))}catch(e){}},[]),(0,a.useEffect)(()=>{ej(navigator.onLine);let e=()=>ej(!0),t=()=>ej(!1);return window.addEventListener("online",e),window.addEventListener("offline",t),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",t)}},[]),(0,a.useEffect)(()=>{let e;if(!eo&&eB.length>=2){ep(!1);return}if(eB.length<2){ei(h),eu(m),ep(!1),eh(!1);return}if(eD.current)return;let t="".concat(G,":").concat(k(eB)),r=eF.current.get(t);if(r){ei(r.groups),eu(r.counts),ep(!1),eh(!1);return}let n=new AbortController,a=setTimeout(()=>{e=setTimeout(()=>ep(!0),180),(async()=>{try{var r,a,o;let s=await fetch("/api/suggest?q=".concat(encodeURIComponent(eB),"&locale=").concat(encodeURIComponent(G)),{signal:n.signal}),l=await s.json();clearTimeout(e);let i={books:(r=null==l?void 0:l.results,Array.isArray(r)?w(r.map(e=>{if(!e||"object"!=typeof e)return null;let t=j(e.title);return t?{...e,title:t,author:j(e.author)}:null}).filter(Boolean),e=>String(e.id||"".concat(k(e.title),"|").concat(k(e.author)))):[]),sets:(a=null==l?void 0:l.sets,Array.isArray(a)?w(a.map(e=>{var t,r,n;if(!e||"object"!=typeof e)return null;let a=Number(null!==(r=null!==(t=e.id)&&void 0!==t?t:e.setid)&&void 0!==r?r:e.setId),o=j(e.title);return Number.isSafeInteger(a)&&!(a<=0)&&o?{...e,id:a,productType:"set",title:o,author:j(e.author||e.ownerName),itemCount:y(null!==(n=e.itemCount)&&void 0!==n?n:e.item_count)}:null}).filter(Boolean),e=>"set:".concat(e.id)):[]),authors:(o=null==l?void 0:l.authors,Array.isArray(o)?w(o.map(e=>{var t,r;let n="string"==typeof e?{name:e}:e;if(!n||"object"!=typeof n)return null;let a=j(n.name||n.label);return a?{...n,name:a,slug:j(n.slug),image:j(n.image||n.authorImage||n.author_image),bookCount:y(null!==(r=null!==(t=n.bookCount)&&void 0!==t?t:n.book_count)&&void 0!==r?r:n.count),exact:!0===n.exact}:null}).filter(Boolean),e=>k(e.name)):[]),categories:N(null==l?void 0:l.categories)},c=i.books.length+i.sets.length+i.authors.length+i.categories.length>0;if((null==l?void 0:l.error)&&!c)eh(!0),ei(h),eu(m);else{let e={books:Math.max(y(null==l?void 0:l.total),i.books.length),sets:Math.max(y(null==l?void 0:l.setTotal),i.sets.length),products:Math.max(y(null==l?void 0:l.productTotal),i.books.length+i.sets.length),authors:i.authors.length,categories:i.categories.length};ei(i),eu(e),eh(!1),eF.current.set(t,{groups:i,counts:e}),eF.current.size>30&&eF.current.delete(eF.current.keys().next().value)}}catch(t){clearTimeout(e),"AbortError"!==t.name&&(eh(!0),ei(h),eu(m))}finally{ep(!1)}})()},140);return()=>{clearTimeout(a),clearTimeout(e),n.abort()}},[eB,G,ek,ew,eo]),(0,a.useEffect)(()=>ef(-1),[eB,el,ex]),(0,a.useEffect)(()=>{eo||ef(-1)},[eo]),(0,a.useEffect)(()=>{if(!eo)return;let e=e=>{eS.current&&!eS.current.contains(e.target)&&(es(!1),Z&&ea(r))};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[eo,Z,r]);let eZ=(0,a.useMemo)(()=>{let e=C(f);return e.length?e:C(X)},[f,X]),eK=b[G]||b.he,eO=g[G]||g.he,eU=(0,a.useMemo)(()=>{if(!eW||!eZ.length)return[];let e=k(eB);return eZ.filter(t=>k(t.label).includes(e)||k(t.value).includes(e)).map(e=>({...e,exact:E(e,e.label,eB)||E(e,e.value,eB)})).slice(0,3)},[eB,eW,eZ]),eH=(0,a.useMemo)(()=>[...el.books].filter(e=>(0,c.J)(e)&&!eM.has(e.cover)).sort((e,t)=>
1Number(E(t,t.title,eB))-Number(E(e,e.title,eB))).slice(0,6),[eM,el.books,eB]),eq=(0,a.useMemo)(()=>[...el.sets].filter(e=>(0,c.J)(e)&&!eM.has(e.cover)).sort((e,t)=>Number(E(t,t.title,eB))-Number(E(e,e.title,eB))).slice(0,2),[eM,el.sets,eB]),eQ=(0,a.useMemo)(()=>[...el.authors].sort((e,t)=>Number(E(t,t.name,eB))-Number(E(e,e.name,eB))).slice(0,3),[el.authors,eB]),eG=(0,a.useMemo)(()=>[...el.categories.length?el.categories:eU].sort((e,t)=>Number(E(t,t.label,eB)||E(t,t.value,eB))-Number(E(e,e.label,eB)||E(e,e.value,eB))).slice(0,3),[el.categories,eU,eB]),eJ=eQ.some(e=>E(e,e.name,eB)),eV=eq.some(e=>E(e,e.title,eB)),eX=eG.some(e=>E(e,e.label,eB)||E(e,e.value,eB)),eY=eH.length+eq.length+eQ.length+eG.length,e$=(0,a.useMemo)(()=>{if(ez)return[];if(!eW){let e=[];return Z?(eb.slice(0,3).forEach(t=>e.push({type:"recent",term:t})),eK.slice(0,3).forEach(t=>e.push({type:"ai-example",prompt:t}))):(eb.forEach(t=>e.push({type:"recent",term:t})),eK.forEach(t=>e.push({type:"ai-example",prompt:t})),V&&e.push({type:"ai-personal",prompt:q("header.personalPrompt","××¦× ×× ×¡×¤×¨ ××¤× ×× ×©×××ת×")}),eZ.length?eZ.slice(0,8).forEach(t=>e.push({type:"zero-category",cat:t})):eO.forEach(t=>e.push({type:"popular",term:t}))),e}if(ex)return[{type:"retry"}];let e={key:"books",count:ec.books||eH.length,items:eH.map(e=>({type:"book",book:e}))},t={key:"sets",count:ec.sets||eq.length,items:eq.map(e=>({type:"set",set:e}))},r={key:"authors",count:ec.authors||eQ.length,items:eQ.map(e=>({type:"author",author:e}))},n={key:"categories",count:ec.categories||eG.length,items:eG.map(e=>({type:"category",cat:e}))},a=[];return(eV||eJ||eX?[...eV?[t]:[],...eJ?[r]:[],...eX?[n]:[],e,...eV?[]:[t],...eJ?[]:[r],...eX?[]:[n]]:[e,t,r,n]).forEach(e=>{e.items.forEach((t,r)=>a.push({...t,section:e.key,sectionCount:e.count,sectionStart:0===r}))}),(eH.length||eq.length)&&a.push({type:"view-all"}),a},[ez,eW,ex,Z,eb,eK,V,eZ,eO,eH,eq,eQ,eG,ec,eV,eJ,eX,G]),e0=eW&&ed&&0===eY&&!ex,e1=eB.length>0||eb.length||eK.length||eZ.length,e2=!!(Z&&0===eB.length||eo&&e1),e5=eW||ez?[]:e$.map((e,t)=>({item:e,idx:t})),e4=e5.filter(e=>{let{item:t}=e;return"recent"===t.type}),e3=e5.filter(e=>{let{item:t}=e;return"zero-category"===t.type}),e8=e5.filter(e=>{let{item:t}=e;return"popular"===t.type}),e6=e5.filter(e=>{let{item:t}=e;return"ai-example"===t.type}),e7=e5.find(e=>{let{item:t}=e;return"ai-personal"===t.type});function e9(){var e;Z&&ea(r),es(!1),ef(-1),null===(e=eA.current)||void 0===e||e.blur()}function te(e){eI.current||(eI.current=!0,e9(),e(),null==P||P(),setTimeout(()=>{eI.current=!1},700))}function tt(e){let t=String(e||"").trim();if(!t)return;let r=[t,...eb.filter(e=>e!==t)].slice(0,6);eg(r);try{localStorage.setItem(x,JSON.stringify(r))}catch(e){}}function tr(){var e;eg([]);try{localStorage.removeItem(x)}catch(e){}null===(e=eA.current)||void 0===e||e.focus()}function tn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eB,t=String(e||"").trim();t&&(tt(t),te(()=>$.push(J("/search?q=".concat(encodeURIComponent(t))))))}function ta(e){var t,r,n,a;switch(e.type){case"book":return t=e.book,void te(()=>$.push(J((0,s.E2)(t))));case"set":return r=e.set,void te(()=>$.push(J((0,s.Rx)(r))));case"category":case"zero-category":return n=e.cat,void te(()=>$.push(J((0,s.cw)(n.value))));case"author":return a=e.author,void te(()=>$.push(J((0,s.tw)(a.slug||a.name))));case"view-all":return tn();case"recent":return ea(e.term),tn(e.term);case"popular":return tn(e.term);case"browse-authors":return te(()=>$.push(J("/authors")));case"browse-categories":return te(()=>$.push(J("/category")));case"ai-example":case"ai-personal":return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eB,t=String(e||"").trim();t&&ev&&(tt(t),te(()=>$.push(J("/search?q=".concat(encodeURIComponent(t),"&ai=1")))))}(e.prompt);case"retry":return eh(!1),ey(e=>e+1);default:return null}}function to(e){e_.current&&ef(e)}(0,a.useEffect)(()=>{let e=setTimeout(()=>Z&&!eo?eE(""):ez?eE(q("header.typeOneMoreCharacter","××§×××× ×¢×× ×ª× ××× ××× ×ר××ת ×צע×ת")):eW?ex?eE(q("header.searchFailed","×××פ×ש ×× × ××¢× â × ×¡× ×©××")):ed?eE(q("header.searching","××פשâ¦")):eY>0?eE(q("header.groupedResultsCountSr","× ×צ×× {books} ספר××, {sets} ××ר×××, {authors} ס×פר×× ×-{categories} ×§×××ר××ת").replace("{books}",String(ec.books||el.books.length)).replace("{sets}",String(ec.sets||el.sets.length)).replace("{authors}",String(ec.authors||el.authors.length)).replace("{categories}",String(ec.categories||eG.length))):eE(q("header.noMatchSr","×× × ×צ×× ×ת××× ××××קת â ××פ×ש AI ××××")):eE(""),350);return()=>clearTimeout(e)},[Z,eo,ez,eW,ex,ed,eY,el,ec,eG,G]),(0,a.useEffect)(()=>{let e=e$[em];(null==e?void 0:e.type)==="book"&&$.prefetch(J((0,s.E2)(e.book))),(null==e?void 0:e.type)==="set"&&$.prefetch(J((0,s.Rx)(e.set)))},[em]);let ts=e=>"relative flex w-full items-center gap-3 px-4 py-2.5 text-start transition-colors before:absolute before:inset-y-1 before:start-0 before:w-[3px] before:rounded-full before:transition-colors ".concat(em===e?"bg-neutral-100 before:bg-brand-green":"hover:bg-neutral-50 before:bg-transparent"),tl=e=>(0,n.jsx)("bdi",{dir:"auto",children:e});function ti(e){let{item:t,idx:r}=e,a=t.book;return(0,n.jsxs)("button",{type:"button",role:"option",id:er(r),"data-search-option":r,"aria-selected":em===r,"aria-label":"".concat(q("header.suggestionBookLabel","{title} ××ת {author}").replace("{title}",a.title).replace("{author}",a.author||"")).concat(a.price?", ".concat(a.price):""),tabIndex:-1,onMouseEnter:()=>to(r),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(t),className:Z?"relative flex w-full items-center gap-3 rounded-xl px-2 py-2 text-start transition-colors before:absolute before:inset-y-2 before:start-0 before:w-[3px] before:rounded-full before:transition-colors ".concat(em===r?"bg-neutral-100 before:bg-brand-green":"hover:bg-neutral-50 before:bg-transparent"):ts(r),children:[(0,n.jsx)(W,{src:a.c
1over,onError:()=>{eL(e=>{if(e.has(a.cover))return e;let t=new Set(e);return t.add(a.cover),t})}}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{dir:"auto",className:"block truncate text-start text-[14px] text-neutral-800",children:M(a.title,eB,"hs-mark rounded-[3px] bg-brand-green/25 px-[1px] font-medium text-emerald-950")}),a.author&&(0,n.jsx)("span",{dir:"auto",className:"block truncate text-start text-[12px] text-neutral-500",children:M(a.author,eB,"hs-mark bg-brand-green/20 font-medium text-emerald-900")}),(0,n.jsx)(z,{formats:a.formats,discount:a.discount,t:q})]}),a.price&&(0,n.jsx)("span",{className:"shrink-0 rounded-full border border-black/10 px-2.5 py-[3px] text-[13px] font-medium text-neutral-700",children:a.price})]})}function tc(e){var t;let{item:r,idx:a}=e,o=r.set,s=1===(t=o.itemCount)?q("header.setItemCountOne","פר×× ××× ×××ר×"):q("header.setItemCountMany","{n} פר×××× ×××ר×").replace("{n}",String(t||0));return(0,n.jsxs)("button",{type:"button",role:"option",id:er(a),"data-search-option":a,"aria-selected":em===a,"aria-label":q("header.suggestionSetLabel","×××¨× ×¡×¤×¨××: {title}, {count}{author}").replace("{title}",o.title).replace("{count}",s).replace("{author}",o.author?", ".concat(o.author):""),tabIndex:-1,onMouseEnter:()=>to(a),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(r),className:Z?"relative flex w-full items-center gap-3 rounded-xl px-2 py-2 text-start transition-colors before:absolute before:inset-y-2 before:start-0 before:w-[3px] before:rounded-full before:transition-colors ".concat(em===a?"bg-neutral-100 before:bg-brand-green":"hover:bg-neutral-50 before:bg-transparent"):ts(a),children:[(0,n.jsx)(W,{src:o.cover,onError:()=>{eL(e=>{if(e.has(o.cover))return e;let t=new Set(e);return t.add(o.cover),t})}}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"mb-1 inline-flex rounded-full bg-brand-green/20 px-2 py-0.5 text-[10px] font-bold text-emerald-900",children:q("header.setBadge","×××¨× ×¡×¤×¨××")}),(0,n.jsx)("span",{dir:"auto",className:"block truncate text-start text-[14px] font-medium text-neutral-900",children:M(o.title,eB,"hs-mark rounded-[3px] bg-brand-green/25 px-[1px] font-medium text-emerald-950")}),(0,n.jsxs)("span",{className:"block truncate text-[12px] text-neutral-500",children:[s,o.author?(0,n.jsxs)(n.Fragment,{children:[" \xb7 ",(0,n.jsx)("bdi",{dir:"auto",children:o.author})]}):null]})]}),o.price&&(0,n.jsx)("span",{className:"shrink-0 rounded-full border border-brand-green/40 bg-brand-green/10 px-2.5 py-[3px] text-[13px] font-semibold text-neutral-800",children:o.price})]})}function tu(e){return 1===e?q("header.bookCountOne","ספר ×××"):e>1?q("header.bookCountMany","{n} ספר××").replace("{n}",String(e)):""}function td(e){let{item:t,idx:r}=e,a=t.author,o=tu(a.bookCount);return(0,n.jsxs)("button",{type:"button",role:"option",id:er(r),"data-search-option":r,"aria-selected":em===r,"aria-label":q("header.suggestionAuthorLabel","ספר×× ××ת {author}{count}").replace("{author}",a.name).replace("{count}",o?", ".concat(o):""),tabIndex:-1,onMouseEnter:()=>to(r),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(t),className:ts(r),children:[(0,n.jsxs)("span",{className:"relative flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-100 text-neutral-400",children:[(0,n.jsx)(L,{path:_,size:19}),a.image&&(0,n.jsx)("img",{src:a.image,alt:"",className:"absolute inset-0 h-full w-full object-cover",onError:e=>e.currentTarget.remove()})]}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{dir:"auto",className:"block truncate text-start text-[14px] font-medium text-neutral-900",children:M(a.name,eB,"hs-mark rounded-[3px] bg-brand-green/25 px-[1px] font-medium text-emerald-950")}),(0,n.jsx)("span",{className:"block truncate text-[12px] text-neutral-500",children:o||q("header.authorSuggestion","×¢××× ×ס×פר")})]}),(0,n.jsx)(B,{})]})}function tp(e){let{item:t,idx:r}=e,a=tu(t.cat.bookCount);return(0,n.jsxs)("button",{type:"button",role:"option",id:er(r),"data-search-option":r,"aria-selected":em===r,"aria-label":q("header.suggestionCategoryLabel","×¢××× ××§×××ר×× {category}{count}").replace("{category}",t.cat.label).replace("{count}",a?", ".concat(a):""),tabIndex:-1,onMouseEnter:()=>to(r),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(t),className:ts(r),children:[(0,n.jsx)("span",{className:"flex h-[52px] w-[37px] shrink-0 items-center justify-center rounded bg-neutral-100 text-neutral-400",children:(0,n.jsx)(L,{path:I,size:18})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{dir:"auto",className:"block truncate text-start text-[14px] font-medium text-neutral-900",children:M(t.cat.label,eB,"hs-mark rounded-[3px] bg-brand-green/25 px-[1px] font-medium text-emerald-950")}),(0,n.jsx)("span",{className:"block truncate text-[12px] text-neutral-500",children:a||q("header.categorySuggestion","×¢××× ××§×××ר××")})]}),(0,n.jsx)(B,{})]})}function tx(e){let{idx:t}=e,r=ec.products||el.books.length+el.sets.length,a=r>el.books.length+el.sets.length?q("header.showAllResultsCount","×צ×ת ×× {total} ת×צ××ת ×¢× â{q}â"):q("header.showAllResults","×צ×ת ×× ×ת×צ××ת ×¢× â{q}â"),[o,s]=a.split("{q}"),l=o.replace("{total}",String(r));return Z?(0,n.jsx)("button",{type:"button",role:"option",id:er(t),"data-search-option":t,"aria-selected":em===t,"aria-label":a.replace("{total}",String(r)).replace("{q}",eB),tabIndex:-1,onMouseEnter:()=>to(t),onMouseDown:e=>e.preventDefault(),onClick:()=>ta({type:"view-all"}),className:"mt-1.5 flex h-[34px] w-full items-center justify-center rounded-full border border-brand-green px-3 text-[14px] font-medium leading-none text-[#2A2A2A] transition-colors ".concat(em===t?"bg-brand-green/30":"bg-[#DEFDF1] hover:bg-brand-green/25"),children:(0,n.jsxs)("span",{className:"truncate",children:[l,tl(eB),s||""]})}):(0,n.jsxs)("button",{type:"button",role:"option",id:er(t),"data-search-option":t,"aria-selected":em===t,"aria-label":a.replace("{total}",String(r)).replace("{q}",eB),tabIndex:-1,onMouseEnter:()=>to(t),onMouseDown:e=>e.preventDefault(),onClick:()=>ta({type:"view-all"}),className:"relative flex w-full items-center justify-between gap-2 border-t border-black/5 px-4 py-3 text-start text-[14px] font-medium text-black transition-colors before:absolute before:inset-y-1 before:start-0 before:w-[3px] before:rounded-full ".concat(em===t?"bg-neutral-100 before:bg-brand-green":"hover:bg-neutral-50 before:bg-transparent"),children:[(0,n.jsxs)("span",{className:"truncate",children:[l,tl(eB),s||""]}),(0,n.jsx)(B,{})]})}function th(e){let{item:t,idx:r,icon:a,aiTone:o}=e,s="recent"===t.type?t.term:t.prompt;return(0,n.jsxs)("button",{type:"button",role:"option",id:er(r),"data-search-option":r,"aria-selected":em===r,"aria-label":s,tabIndex:-1,onMouseEnter:()=>to(r),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(t),className:ts(r),children:[o?(0,n.jsx)(l.Z,{size:18}):(0,n.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center text-neutral-400",children:(0,n.jsx)(L,{path:a,size:18})}),(0,n.jsx)("span",{dir:"auto",className:"min-w-0 flex-1 truncate text-start text-[14px] ".concat(o?"text-emerald-900":"text-neutral-700"),children:s})]})}function tm(e){let{children:t,action:r}=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between ".concat(Z?"pb-2.5 pt-4 first:pt-0":"px-4 pb-1 pt-2"),children:[(0,n.jsx)("span",{className:Z?"text-[14px] font-bold leading-none text-black":"text-[12px] font-medium text-neutral-500",children:t}),r]})}function tf(e){let{section:t,count:r}=e,a={books:q("header.booksSection","ספר××"),sets:q("header.setsSection","××ר×××"),authors:q("header.authorsSection","ס×פר××"),categories:q("header.categoriesSection","×§×××ר××ת")};return(0,n.jsx)(tm,{action:Z?null:(0,n.jsx)("span",{className:"min-w-5 rounded-full bg-neutral-100 px-1.5 py-0.5 text-center text-[11px] tabular-nums text-neutral-500",children:r}),children:a[t]})}function tb(e){let{item:t,idx:r,icon:a,label:o}=e;return(0,n.jsxs)("button",{type:"button",role:"option",id:er(r),"data-search-option":r,"aria-selected":em===r,"aria-label":o,tabIndex:-1,onMouseEnter:()=>to(r),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(t),className:"flex w-full items-center gap-2.5 rounded-lg text-start transition-colors ".concat(em===r?"bg-neutral-100":"hover:bg-neutral-50"),children:[(0,n.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center text-black",children:(0,n.jsx)(L,{path:a,size:17})}),(0,n.jsx)("span",{dir:"auto",className:"min-w-0 flex-1 truncate text-[14px] leading-[28px] text-[#2A2A2A]",children:o})]})}function tg(e){let{item:t,idx:r,children:a}=e;return(0,n.jsx)("button",{type:"button",role:"option",id:er(r),"data-search-option":r,"aria-selected":em===r,tabIndex:-1,onMouseEnter:()=>to(r),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(t),className:"flex h-[34px] shrink-0 items-center rounded-full border px-3 text-[14px] font-medium leading-none transition-colors ".concat(em===r?"border-brand-green bg-brand-green/15 text-black":"border-[#F3F3F3] text-[#2A2A2A] hover:border-brand-green hover:bg-brand-green/10"),children:a})}function tv(e){let{item:t,idx:r,children:a}=e;return(0,n.jsx)("button",{type:"button",role:"option",id:er(r),"data-search-option":r,"aria-selected":em===r,tabIndex:-1,onMouseEnter:()=>to(r),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(t),className:"rounded-full border px-3 py-1.5 text-[13px] transition-colors ".concat(em===r?"border-brand-green bg-brand-green/15 text-neutral-950":"border-black/10 bg-neutral-50 text-neutral-800 hover:border-brand-green hover:bg-brand-green/10"),children:a})}let tj=H||q("header.searchCatalogPlaceholder","××פ×ש ספר××, ס×פר×× ×× ×§×××ר××ת");return(0,n.jsxs)("div",{ref:eS,className:Z?"contents":"relative w-full",children:[(0,n.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:eC}),(0,n.jsx)("form",{onSubmit:e=>{e.preventDefault(),tn()},role:"search",className:Z?"sticky top-0 z-30 flex items-center bg-white px-4 py-3":"",children:(0,n.jsxs)("div",{className:Z?"theme-paper flex h-[49px] w-full items-center gap-2.5 rounded-[50px] border-2 border-transparent pe-[13px] ps-[22px] [background:linear-gradient(#fff,#fff)_padding-box,linear-gradient(90deg,#47F5A6,#71BAFF)_border-box] focus-within:ring-2 focus-within:ring-brand-focus":"theme-paper flex h-12 w-full items-center gap-2.5 rounded-[50px] border-2 border-transparent pe-[13px] ps-[18px] transition-shadow [background:linear-gradient(#fff,#fff)_padding-box,linear-gradient(90deg,#47F5A6,#71BAFF)_border-box] focus-within:ring-2 focus-within:ring-brand-focus",children:[(0,n.jsx)("button",{type:"submit","aria-label":q("header.searchAria","××פ×ש ספר××, ××ר×××, ס×פר×× ××§×××ר××ת"),className:"-m-1 shrink-0 rounded-full p-1",children:(0,n.jsx)(l.Z,{size:22,active:ed||eW&&eP,stops:["#47F5A6","#5E99FF"],mini:!1})}),(0,n.jsx)("input",{ref:eA,type:"search",dir:en?"auto":Q,value:en,onChange:e=>{ea(e.target.value),es(!0)},onFocus:()=>es(!0),onKeyDown:function(e){let t=e$.length;if("ArrowDown"===e.key)e.preventDefault(),eo||es(!0),e_.current=!1,t&&ef(e=>(e+1)%t);else if("ArrowUp"===e.key)e.preventDefault(),e_.current=!1,t&&ef(e=>e<=0?t-1:e-1);else if("Enter"===e.key){if(e.shiftKey&&eW)return e.preventDefault(),tn();em>=0&&e$[em]&&(e.preventDefault(),ta(e$[em]))}else"Escape"===e.key&&(e.stopPropagation(),Z&&en?e9():en?(ea(""),eE("")):e9(
1))},onCompositionStart:()=>{eD.current=!0},onCompositionEnd:()=>{eD.current=!1,eN(e=>e+1)},role:"combobox","aria-expanded":e2,"aria-controls":et,"aria-autocomplete":"list","aria-activedescendant":em>=0?er(em):void 0,placeholder:tj,"aria-label":q("header.searchAria","××פ×ש ספר××, ××ר×××, ס×פר×× ××§×××ר××ת"),enterKeyHint:"search",autoComplete:"off",maxLength:120,className:"no-focus-ring min-w-0 flex-1 bg-transparent text-start text-[16px] font-medium leading-none text-black outline-none placeholder:text-black [&::-webkit-search-cancel-button]:appearance-none"}),en?(0,n.jsx)("button",{type:"button","aria-label":q("header.clearSearch","× ××§×× ××פ×ש"),onMouseDown:e=>e.preventDefault(),onClick:()=>{var e;ea(""),ei(h),eu(m),es(!0),null===(e=eA.current)||void 0===e||e.focus()},className:Z?'relative grid h-[29px] w-[29px] shrink-0 place-items-center rounded-full bg-[#F3F3F3] text-black transition-colors before:absolute before:-inset-2 before:content-[""] hover:bg-black/10':"-m-2 shrink-0 p-2 text-black/40 transition-colors hover:text-black/70",children:(0,n.jsx)(L,{path:S,size:Z?14:16})}):(0,n.jsxs)("button",{type:"button","aria-label":q("header.aiPillLabel","××פ×ש AI"),onMouseDown:e=>e.preventDefault(),onClick:()=>Y(),className:"flex h-[32px] min-w-[95px] shrink-0 items-center justify-center gap-[3px] rounded-[30px] bg-[#AFFEDA] px-3 py-[7px] text-[12px] font-medium text-black transition-colors hover:bg-brand-green/70",children:[(0,n.jsx)("span",{className:"whitespace-nowrap leading-none",children:q("header.aiPillLabel","××פ×ש AI")}),(0,n.jsx)(R,{})]})]})}),e2&&(0,n.jsx)("div",{id:et,role:"listbox","aria-label":q("header.searchSuggestions","×צע×ת ××פ×ש"),dir:Q,onPointerMove:function(e){var t,r;e_.current=!0;let n=null===(t=(r=e.target).closest)||void 0===t?void 0:t.call(r,'[role="option"][data-search-option]'),a=Number(null==n?void 0:n.dataset.searchOption);Number.isInteger(a)&&ef(a)},className:Z?"hs-panel relative mx-4 mt-3 flex flex-col overflow-visible rounded-[18px] border border-[#2A2A2A]/15 bg-white p-[22px] text-start":"hs-panel absolute start-0 top-[calc(100%+8px)] z-[60] max-h-[70dvh] w-full overflow-auto rounded-2xl border bg-white py-2 text-start shadow-[0_24px_60px_rgba(0,0,0,0.18)] ".concat(t?"border-black/10":"border-brand-green/30"),children:ez?(0,n.jsxs)("div",{role:"status",className:"flex items-center gap-2 rounded-xl bg-neutral-50 px-3 py-3 text-[13px] text-neutral-600 ".concat(Z?"":"mx-4"),children:[(0,n.jsx)(L,{path:D,size:17,className:"text-neutral-400"}),(0,n.jsx)("span",{children:q("header.typeOneMoreCharacter","××§×××× ×¢×× ×ª× ××× ××× ×ר××ת ×צע×ת")})]}):eW?e0?(0,n.jsx)("div",{className:"py-1","aria-hidden":"true",children:Array.from({length:4}).map((e,t)=>Z?(0,n.jsxs)("div",{className:"flex items-center gap-3 rounded-xl px-2 py-2",children:[(0,n.jsx)("span",{className:"skeleton h-[52px] w-[37px] shrink-0 rounded"}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"skeleton block h-3.5 w-3/4 rounded"}),(0,n.jsx)("span",{className:"skeleton mt-2 block h-3 w-1/2 rounded"}),(0,n.jsx)("span",{className:"skeleton mt-2 block h-3 w-2/3 rounded"})]}),(0,n.jsx)("span",{className:"skeleton h-6 w-12 shrink-0 rounded-full"})]},t):(0,n.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,n.jsx)("span",{className:"skeleton h-[52px] w-[37px] shrink-0 rounded"}),(0,n.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,n.jsx)("span",{className:"skeleton block h-3.5 w-3/5 rounded"}),(0,n.jsx)("span",{className:"skeleton mt-2 block h-3 w-2/5 rounded"})]})]},t))}):e$.map((e,t)=>{var r,o,s,l,i;let c=null;if(Z&&("author"===e.type||"category"===e.type)){let r="author"===e.type?_:I,a="author"===e.type?e.author.name:e.cat.label;c=(0,n.jsx)(tb,{item:e,idx:t,icon:r,label:a})}else"book"===e.type&&(c=(0,n.jsx)(ti,{item:e,idx:t})),"set"===e.type&&(c=(0,n.jsx)(tc,{item:e,idx:t})),"author"===e.type&&(c=(0,n.jsx)(td,{item:e,idx:t})),"category"===e.type&&(c=(0,n.jsx)(tp,{item:e,idx:t}));return("view-all"===e.type&&(c=(0,n.jsx)(tx,{idx:t})),"retry"===e.type&&(c=(0,n.jsxs)("button",{type:"button",role:"option",id:er(t),"data-search-option":t,"aria-selected":em===t,tabIndex:-1,onMouseEnter:()=>to(t),onMouseDown:e=>e.preventDefault(),onClick:()=>ta(e),className:"".concat(ts(t)," text-[14px] text-neutral-700"),children:[(0,n.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center text-amber-500",children:(0,n.jsx)(L,{path:T,size:18})}),q("header.searchFailed","×××פ×ש ×× × ××¢× â ×××¦× ×× ×ס××× ×××ר")]})),c)?(0,n.jsxs)(a.Fragment,{children:[e.sectionStart&&(0,n.jsx)(tf,{section:e.section,count:e.sectionCount}),c]},"".concat(e.type,"-").concat((null===(r=e.book)||void 0===r?void 0:r.id)||(null===(o=e.set)||void 0===o?void 0:o.id)||(null===(s=e.author)||void 0===s?void 0:s.slug)||(null===(l=e.author)||void 0===l?void 0:l.name)||(null===(i=e.cat)||void 0===i?void 0:i.value)||t)):null}):Z?(0,n.jsxs)(n.Fragment,{children:[e4.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tm,{action:(0,n.jsx)("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:tr,className:"text-[12px] text-neutral-400 transition-colors hover:text-neutral-700",children:q("header.clearRecent","× ××§××")}),children:q("header.recentTitle","××פ×ש×× ××ר×× ××")}),(0,n.jsx)("div",{className:"flex flex-col",children:e4.map(e=>{let{item:t,idx:r}=e;return(0,n.jsx)(tb,{item:t,idx:r,icon:F,label:t.term},"r-".concat(t.term))})})]}),(0,n.jsx)(tm,{children:q("header.examplesTitle","××פ×ש×× ××××××")}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:e6.map(e=>{let{item:t,idx:r}=e;return(0,n.jsx)(tg,{item:t,idx:r,children:(0,n.jsx)("span",{dir:"auto",children:t.prompt})},"ex-".concat(t.prompt))})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"mx-4 mb-2 flex items-center gap-2 rounded-xl bg-brand-green/10 px-3 py-2 text-[13px] text-emerald-900",children:[(0,n.jsx)(l.Z,{size:16}),(0,n.jsx)("span",{children:q("header.searchHint","×פשר ××ת×× ×××¤×©× â × ×ש×, ××××ר×, ×× ×´×¡×¤×¨ ×××â¦×´")})]}),e4.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tm,{action:(0,n.jsx)("button",{type:"button",onMouseDown:e=>e.preventDefault(),onClick:tr,className:"text-[12px] text-neutral-400 transition-colors hover:text-neutral-700",children:q("header.clearRecent","× ××§××")}),children:q("header.recentTitle","××פ×ש×× ××ר×× ××")}),e4.map(e=>{let{item:t,idx:r}=e;return(0,n.jsx)(th,{item:t,idx:r,icon:A},"r-".concat(t.term))})]}),(0,n.jsx)(tm,{children:(0,n.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,n.jsx)(l.Z,{size:14}),q("header.tryAgentTitle","× ×¡× ×ת ×ס×××")]})}),e6.map(e=>{let{item:t,idx:r}=e;return(0,n.jsx)(th,{item:t,idx:r,aiTone:!0},"ex-".concat(t.prompt))}),e7&&(0,n.jsx)(th,{item:e7.item,idx:e7.idx,aiTone:!0}),e3.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tm,{children:q("header.browseByCategory","×¢××× ××¤× ×§×××ר××")}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2 px-4 pb-2 pt-1",children:e3.map(e=>{let{item:t,idx:r}=e;return(0,n.jsx)(tv,{item:t,idx:r,children:(0,n.jsx)("span",{dir:"auto",children:t.cat.label})},t.cat.value)})})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(tm,{children:q("header.popularTitle","××פ×ש×× × ×¤×צ××")}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2 px-4 pb-2 pt-1",children:e8.map(e=>{let{item:t,idx:r}=e;return(0,n.jsx)(tv,{item:t,idx:r,children:(0,n.jsx)("span",{dir:"auto",children:t.term})},t.term)})})]})]})})]})}},3584:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(7437),a=r(2265),o=r(7192);function s(){return(0,n.jsxs)("svg",{width:"25",height:"20",viewBox:"0 0 29 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,n.jsx)("g",{transform:"translate(5 0)",children:(0,n.jsx)("path",{d:"M12.62 20.81c-.34.12-.9.12-1.24 0C8.48 19.82 2 15.69 2 8.69 2 5.6 4.49 3.1 7.56 3.1c1.82 0 3.43.88 4.44 2.24a5.53 5.53 0 0 1 4.44-2.24C19.51 3.1 22 5.6 22 8.69c0 7-6.48 11.13-9.38 12.12Z"})}),(0,n.jsx)("path",{d:"M1.5 7h8m-3-3 3 3-3 3",strokeWidth:"2"})]})}function l(e){let{onMove:t,className:r=""}=e,{t:l}=(0,o.Q)(),[i,c]=(0,a.useState)(!1),u=l("cart.moveToFavorites","××¢××¨× ××××¢×פ××"),d=async()=>{!i&&(c(!0),await t()||c(!1))};return(0,n.jsxs)("button",{type:"button","aria-label":u,disabled:i,onClick:d,className:"group relative transition-colors hover:text-black focus-visible:text-black focus-visible:outline-none disabled:cursor-wait disabled:opacity-50 ".concat(r),children:[(0,n.jsx)(s,{}),(0,n.jsx)("span",{role:"tooltip",className:"pointer-events-none absolute bottom-full end-0 z-20 mb-2 whitespace-nowrap rounded-[6px] bg-black px-2.5 py-1.5 text-[12px] font-medium text-white opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus:opacity-100",children:u})]})}},4205:function(e,t,r){r.d(t,{default:function(){return b}});var n=r(7437),a=r(2265),o=r(9376),s=r(7192),l=r(9102),i=r(2964),c=r(3486),u=r(6950),d=r(3654),p=r(543);function x(e){return(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...e,children:(0,n.jsx)("path",{d:"M14.5 7.5 9.5 12l5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function h(e){let{expanded:t}=e;return(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",className:"transition-transform ".concat(t?"rotate-180":""),children:(0,n.jsx)("path",{d:"M7.5 9.5 12 14l4.5-4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}let m=[[{key:"preferences",tKey:"menuPreferences",he:"××¢×פ×ת קר×××",Icon:p.dg},{key:"appearance",tKey:"menuAppearance",he:"×ר××",Icon:p.bX}],[{key:"personal",tKey:"menuPersonalArea",he:"×××ר ××ש×",Icon:p.jR},{key:"orders",tKey:"menuMyOrders",he:"××××× ×ת ש××",Icon:p.Mu},{key:"authorsDashboard",tKey:"menuAuthorsDashboard",he:"××¢×ר ××ש×××¨× ×©× ×ס×פר××",Icon:p.QG,href:"https://dash.bookpod.co.il/",israelOnly:!0}]];function f(e){let{item:t,onSelect:r,expanded:a=!1,valueLabel:o="",controlsId:l}=e,{t:i}=(0,s.Q)(),{Icon:c,tKey:u,he:d,key:p,href:m}=t;return(0,n.jsxs)(m?"a":"button",{...m?{href:m,target:"_blank",rel:"noopener noreferrer"}
1:{type:"button",..."appearance"===p?{"aria-expanded":a,"aria-controls":l}:{}},onClick:()=>null==r?void 0:r(p),className:"flex w-full items-center justify-between rounded-xl px-2.5 py-2.5 text-ui-content transition-colors hover:bg-ui-subtle",children:[(0,n.jsxs)("span",{className:"flex items-center gap-3",children:[(0,n.jsx)(c,{className:"shrink-0"}),(0,n.jsx)("span",{className:"text-[17px] leading-none",children:i("account.".concat(u),d)})]}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5 text-ui-muted",children:[o&&(0,n.jsx)("span",{className:"text-[12px] leading-none",children:o}),"appearance"===p?(0,n.jsx)(h,{expanded:a}):(0,n.jsx)(x,{className:"dir-flip"})]})]})}function b(e){let{onSelect:t,className:r=""}=e,{t:x,dir:h,localizeHref:b}=(0,s.Q)(),{logout:g}=(0,l.a)(),{openPreferences:v}=(0,c.G)(),{enabled:j,mode:k}=(0,u.Fg)(),{isGlobal:y,storeKey:w}=(0,i.mT)(),N=(0,o.useRouter)(),[C,E]=(0,a.useState)(!1),M="".concat((0,a.useId)().replace(/:/g,""),"-settings-appearance"),L="system"===k?x("account.themeSystem","×××רת ×××ש×ר"):"dark"===k?x("account.themeDark","×××"):x("account.themeLight","×××ר"),S=m[0].filter(e=>"appearance"!==e.key||j),A=y||"bookplus"===w?m[1].filter(e=>!e.israelOnly):m[1],F=e=>{if("preferences"===e)v("edit");else if("appearance"===e){E(e=>!e);return}else"personal"===e?N.push(b("/account")):"orders"===e&&N.push(b("/account?tab=orders"));null==t||t(e)};return(0,n.jsxs)("div",{dir:h,className:"flex min-h-[370px] w-[300px] flex-col rounded-[14px] border border-ui-border/[0.42] bg-ui-surface p-4 text-ui-content ".concat(r),children:[(0,n.jsx)("nav",{"aria-label":x("account.menuAccountAria","×ש×××"),className:"flex flex-col gap-1",children:S.map(e=>(0,n.jsxs)(a.Fragment,{children:[(0,n.jsx)(f,{item:e,onSelect:F,expanded:"appearance"===e.key&&C,valueLabel:"appearance"===e.key?L:"",controlsId:"appearance"===e.key?M:void 0}),"appearance"===e.key&&C&&(0,n.jsx)("div",{id:M,children:(0,n.jsx)(d.I,{className:"mx-1 mb-2 rounded-xl border border-ui-border/10 bg-ui-raised p-3",legendClassName:"sr-only"})})]},e.key))}),(0,n.jsx)("hr",{className:"my-3 border-0 border-t border-ui-border/10"}),(0,n.jsx)("nav",{"aria-label":x("account.menuPreferencesAria","××¢×פ×ת"),className:"flex flex-col gap-1",children:A.map(e=>(0,n.jsx)(f,{item:e,onSelect:F},e.key))}),(0,n.jsxs)("button",{type:"button",onClick:()=>g(),className:"mt-auto flex items-center justify-center gap-3 rounded-xl px-2.5 py-3 text-ui-content transition-colors hover:bg-ui-subtle",children:[(0,n.jsx)("span",{className:"text-[17px] leading-none",children:x("account.logout","××ª× ×ª×§×ת")}),(0,n.jsx)(p.R0,{className:"shrink-0"})]})]})}}}]);
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.