1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6711],{121:function(e,t,n){n.d(t,{Z:function(){return P}});var r=n(7437),a=n(8353),i=n(2265),l=n(4190),o=n(15),s=n(166),c=n(1430),u=n(4064);let d={distance:0,rtl:!1};function p(e){let{text:t,className:n=""}=e,a=(0,i.useRef)(null),l=(0,i.useRef)(!1),o=(0,i.useRef)(null),[s,c]=(0,i.useState)(d),[u,p]=(0,i.useState)(!1),[x,h]=(0,i.useState)(!1),[f,m]=(0,i.useState)(!1),[g,b]=(0,i.useState)(!1),v=(0,i.useRef)(null),j=()=>{o.current&&(clearTimeout(o.current),o.current=null)},k=()=>{v.current&&(clearTimeout(v.current),v.current=null)},w=(0,i.useCallback)(()=>{let e=a.current;if(!e)return;l.current=!0,j(),k(),b(!1);let t=Math.max(0,Math.round(e.scrollWidth-e.clientWidth)),n=window.matchMedia("(prefers-reduced-motion: reduce)").matches;c({distance:t,rtl:"rtl"===getComputedStyle(e).direction}),t&&(k(),v.current=setTimeout(()=>{v.current=null,l.current&&m(!0)},180),n||(p(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{l.current&&h(!0)})})))},[]),y=(0,i.useCallback)(()=>{l.current=!1,h(!1),k(),b(!0),j(),o.current=setTimeout(()=>{o.current=null,p(!1),m(!1)},300)},[]);(0,i.useEffect)(()=>()=>{j(),k()},[]),(0,i.useEffect)(()=>{var e;let t=null===(e=a.current)||void 0===e?void 0:e.closest("a, button");if(t)return t.addEventListener("focus",w),t.addEventListener("blur",y),()=>{t.removeEventListener("focus",w),t.removeEventListener("blur",y)}},[w,y]);let N=x?s.rtl?s.distance:-s.distance:0,C=x?Math.max(420,s.distance/70*1e3):240;return(0,r.jsxs)("span",{className:"relative block",onPointerEnter:w,onPointerLeave:y,children:[(0,r.jsxs)("span",{ref:a,className:"relative block overflow-hidden whitespace-nowrap ".concat(n),style:{textOverflow:u?"clip":"ellipsis"},children:[(0,r.jsx)("span",{style:{opacity:u?0:1},children:t}),u&&(0,r.jsx)("span",{"aria-hidden":"true",className:"absolute inset-0 overflow-hidden whitespace-nowrap",children:(0,r.jsx)("span",{className:"inline-block",style:{transform:"translateX(".concat(N,"px)"),transition:"transform ".concat(Math.round(C),"ms ").concat(x?"linear":"ease-out"," ").concat(x?180:0,"ms"),willChange:"transform"},children:t})})]}),f&&(0,r.jsxs)("span",{"aria-hidden":"true",dir:"auto",className:"pointer-events-none absolute bottom-[calc(100%+10px)] left-1/2 z-20 w-max max-w-[240px] whitespace-normal break-words rounded-[8px] bg-ui-action px-[10px] py-[7px] text-start text-[13px] font-medium leading-[1.35] text-ui-on-action shadow-[0_6px_18px_rgba(0,0,0,0.24)]",style:{animation:"".concat(g?"title-bubble-out":"title-bubble-in"," ").concat(150,"ms ease-out both")},children:[t,(0,r.jsx)("span",{className:"absolute left-1/2 top-full h-[9px] w-[9px] -translate-x-1/2 -translate-y-1/2 rotate-45 rounded-[1.5px] bg-ui-action"})]})]})}var x=n(7388),h=n(3330),f=n(5632),m=n(7192),g=n(4041),b=n(2964),v=n(5025),j=n(3677);let k=(0,s.default)(()=>Promise.all([n.e(8462),n.e(7719),n.e(1427),n.e(6444),n.e(8485)]).then(n.bind(n,8485)),{loadableGenerated:{webpack:()=>[8485]},ssr:!1}),w=(0,s.default)(()=>Promise.all([n.e(8462),n.e(7719),n.e(1427)]).then(n.bind(n,1427)),{loadableGenerated:{webpack:()=>[1427]},ssr:!1});function y(){return(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"1.6"})]})}function N(e){let{open:t}=e;return t?(0,r.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{d:"m6 6 12 12M18 6 6 18",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})}):(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M5.5 8.5h13l-1 11h-11l-1-11Z",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M9 9V7a3 3 0 0 1 6 0v2",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})]})}function C(e){let{label:t,pressed:n,onClick:a,className:i="",children:l}=e;return(0,r.jsx)("button",{type:"button","aria-label":t,"aria-pressed":n,onClick:e=>{e.preventDefault(),e.stopPropagation(),a()},className:"grid h-[38px] w-[38px] place-items-center rounded-full bg-black text-white transition-[background-color,opacity,transform] hover:bg-black/85 ".concat(i),children:l})}let _="opacity-0 scale-95 pointer-events-none duration-[340ms] ease-in-out group-hover/card:opacity-100 group-hover/card:scale-100 group-hover/card:pointer-events-auto group-hover/card:duration-[280ms] group-focus-within/card:opacity-100 group-focus-within/card:scale-100 group-focus-within/card:pointer-events-auto group-focus-within/card:duration-[280ms] motion-reduce:scale-100 motion-reduce:transition-none";function S(e){let{value:t}=e,{symbol:n}=(0,b.U8)();return(0,v.xC)(t,n,{compact:!0})}function L(e){let{originalValue:t,value:n}=e,{symbol:a}=(0,b.U8)(),i=(0,v.xC)(t,a,{compact:!0}).split(" - ")[0];return(0,r.jsxs)("span",{dir:"ltr",className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[(0,r.jsx)("s",{className:"text-[12px] font-normal text-black/50",children:i}),(0,r.jsx)(S,{value:n})]})}function M(e){let{value:t}=e,{symbol:n}=(0,b.U8)(),a=(0,v.CZ)(t,n);return a?(0,r.jsx)("span",{dir:"ltr",children:a}):null}function E(e){let{dir:t}=e;return(0,r.jsx)("svg",{className:"absolute bottom-[calc(100%-1px)] left-0 w-full",width:"288",height:"26",viewBox:"0 0 288 26",preserveAspectRatio:"none",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{transform:"ltr"===t?"matrix(-1 0 0 1 288 0)":void 0,d:"M288 26H0V0H18.9766L25.9639 1.17383C36.9877 3.02571 46.4708 10.0169 51.5 20C56.5292 10.0169 66.0123 3.02571 77.0361 1.17383L84.0234 0H288V26Z",fill:"rgb(var(--ui-surface))"})})}function P(e){let{book:t,rank:n,favorite:s=!1,onToggleFavorite:d,onCoverError:b,openInNewTab:v=!1,quickBuyEnabled:P=!0}=e;t=(0,j.h)(t);let{t:z,dir:R}=(0,m.Q)(),F=t.formats||{audio:40,digital:70,print:90},T=t.displayFormats||F,O=(0,o.sS)(T,z,t.originalPrices),A=(0,o.mf)(T,z,t.originalPrices),[Z,q]=(0,i.useState)(()=>{var e;return T.print?"print":null===(e=O[0])||void 0===e?void 0:e.key}),I=O.find(e=>e.key===Z)||O[0],W=null==I?void 0:I.price,[U,B]=(0,i.useState)(!1),[V,D]=(0,i.useState)(!1),[H,J]=(0,i.useState)(!1),Q=(0,i.useId)(),G=(0,i.useRef)(null),$=(0,i.useRef)(null),[X,K]=(0,i.useState)(!1),Y=(0,h.r)(),ee="function"==typeof d,[et,en]=(0,i.useState)(s),er=(0,h._)(t.id),ea=ee?et:er,ei=(0,x.j)(),el=(0,i.useRef)(null),[eo,es]=(0,i.useState)(!1),[ec,eu]=(0,i.useState)(!1),ed=(0,i.useRef)(null);(0,i.useEffect)(()=>{var e;(null===(e=ed.current)||void 0===e?void 0:e.complete)&&ed.current.naturalWi
1dth>0&&es(!0)},[]),(0,i.useEffect)(()=>{if(!H)return;let e=e=>{var t,n,r,a;(null===(t=G.current)||void 0===t||!t.contains(e.target))&&(J(!1),(null===(n=G.current)||void 0===n?void 0:n.contains(document.activeElement))&&(null===(a=document.activeElement)||void 0===a||null===(r=a.blur)||void 0===r||r.call(a)))},t=e=>{var t;"Escape"===e.key&&(J(!1),null===(t=$.current)||void 0===t||t.focus())};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[H]);let ep=(0,l.E2)(t),ex=v?{target:"_blank",rel:"noopener noreferrer"}:{};return!(0,g.J)(t)||ec?null:(0,r.jsxs)("div",{ref:G,className:"w-[288px] shrink-0 relative",children:[null!=n&&(0,r.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 bottom-[-62px] z-0 w-[59px] h-[90px] grid items-end justify-items-center pb-[16px] text-ui-content text-[38px] font-medium leading-none select-none",style:{backgroundColor:"rgb(var(--ui-soft))",clipPath:"polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%)"},children:n}),(0,r.jsx)("button",{ref:$,type:"button","aria-label":H?z("book.hidePurchaseOptions","ס××רת ×פשר×××ת ר××ש×"):z("book.showPurchaseOptions","×צ×ת ×פשר×××ת ר××ש×"),"aria-expanded":H,"aria-controls":Q,onClick:()=>J(e=>!e),className:"book-card-touch-trigger absolute right-7 z-[20] h-[38px] w-[38px] place-items-center rounded-full bg-black text-white shadow-[0_3px_10px_rgba(0,0,0,0.28)] transition-[background-color,transform] active:scale-95 ".concat(null!=t.discount||t.bestSeller?"top-[70px]":"top-7"),children:(0,r.jsx)(N,{open:H})}),(0,r.jsxs)("div",{className:"book-card-frame theme-elevated-card group/card relative z-10 bg-ui-surface p-4 shadow-[0_7px_8px_rgba(0,0,0,0.10),0_30px_15px_rgba(0,0,0,0.09),0_67px_20px_rgba(0,0,0,0.05)] transition-shadow hover:shadow-[0_10px_12px_rgba(0,0,0,0.14),0_36px_20px_rgba(0,0,0,0.11),0_72px_26px_rgba(0,0,0,0.06)]","data-touch-open":H?"true":"false",children:[(0,r.jsxs)("div",{ref:el,className:"relative overflow-hidden rounded-[12px] bg-ui-subtle ".concat(eo?"":"skeleton"),style:{aspectRatio:"261 / 373"},children:[(0,r.jsx)(a.default,{href:ep,...ex,"aria-label":t.author?"".concat(t.title," ").concat(z("book.byAuthor","××ת")," ").concat(t.author):t.title,className:"absolute inset-0 z-[1] focus-visible:rounded-[12px] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-brand-focus"}),(0,r.jsx)(c.default,{ref:ed,src:t.cover,alt:t.title,sizes:"288px",onLoad:()=>es(!0),onError:()=>{eu(!0),null==b||b(t)},className:"cover-img object-cover ".concat(eo?"is-loaded":"")}),(0,r.jsxs)("div",{className:"absolute start-3 top-3 z-[3] flex gap-2.5",dir:"ltr",children:[(0,r.jsx)(C,{label:z("book.addToFavorites","×××¡×¤× ××××¢×פ××"),pressed:ea,onClick:()=>{if(ee){let e=!et;en(e),d(t,e)}else Y.toggleFavorite(t)},className:"book-card-cover-action ".concat(ea?"":_),children:(0,r.jsx)(f.Z,{active:ea})}),(0,r.jsx)(C,{label:z("book.preview","תצ××× ××§××××"),onClick:()=>B(!0),className:"book-card-cover-action ".concat(_),children:(0,r.jsx)(y,{})})]}),null!=t.discount?(0,r.jsx)("span",{dir:R,className:"absolute start-3 top-3 z-[3] rounded-[6px] bg-brand-green px-[10px] py-[6px] text-[14px] font-medium leading-none text-black whitespace-nowrap",children:z("book.discount","{n}% ×× ××").replace("{n}",t.discount)}):t.bestSeller?(0,r.jsx)("span",{dir:R,className:"absolute start-3 top-3 z-[3] rounded-[6px] bg-brand-green px-[10px] py-[6px] text-[14px] font-medium leading-none text-black whitespace-nowrap",children:z("book.bestSeller","××× × ××ר")}):null]}),(0,r.jsxs)("div",{className:"book-card-default-row mt-[18px] flex items-center justify-between gap-3 transition-opacity duration-200 group-hover/card:opacity-0 group-focus-within/card:opacity-0",dir:"ltr",children:[(0,r.jsx)(o.IV,{formats:T,size:24,gapClassName:"gap-[10px]"}),(t.displayPrice||t.price)&&(0,r.jsx)("span",{dir:"ltr",className:"inline-flex shrink-0 items-center justify-center rounded-[8px] bg-brand-green ".concat(t.priceOriginal?"px-[12px]":"px-[21px]"," py-[9px] text-[16px] font-medium leading-none text-black whitespace-nowrap"),children:t.priceOriginal?(0,r.jsx)(L,{originalValue:t.priceOriginal,value:t.displayPrice||t.price}):(0,r.jsx)(S,{value:t.displayPrice||t.price})})]}),(0,r.jsxs)("div",{id:Q,className:"book-card-buy-panel absolute inset-x-4 bottom-4 z-[4] flex translate-y-3 flex-col gap-[10px] rounded-b-[12px] bg-ui-surface px-[14px] pt-[2px] pb-[12px] opacity-0 transition-all duration-300 ease-out pointer-events-none group-hover/card:translate-y-0 group-hover/card:opacity-100 group-hover/card:pointer-events-auto focus-within:translate-y-0 focus-within:opacity-100 focus-within:
1pointer-events-auto",dir:R,children:[(0,r.jsx)(E,{dir:R}),(0,r.jsxs)("div",{className:"flex flex-col gap-[3px] text-start",children:[(0,r.jsx)(a.default,{href:ep,...ex,className:"block",children:(0,r.jsx)("h3",{dir:"auto",className:"text-[19px] font-bold leading-[1.15] text-ui-content",children:(0,r.jsx)(p,{text:t.title})})}),(0,r.jsxs)("div",{className:"flex items-center justify-start gap-2 text-[14px] leading-none text-ui-muted",children:[t.author&&(0,r.jsx)(a.default,{href:(0,l.tw)(t.author),dir:"auto",className:"truncate transition-colors hover:text-ui-content","aria-label":z("product.toAuthorPage","××¢××× ×ס×פר {author}").replace("{author}",t.author),children:t.author}),(0,r.jsx)(u.Z,{book:t,className:"text-[14px]",starClassName:"h-[11px] w-[11px]"})]})]}),(0,r.jsx)("div",{className:"flex gap-[8px]",dir:R,children:A.map(e=>(0,r.jsx)(o.qe,{icon:e.icon,label:e.label,price:e.price,originalPrice:e.originalPrice,disabled:!e.available,selected:e.key===Z,onSelect:()=>q(e.key)},e.key))}),(0,r.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[P&&(0,r.jsxs)("button",{type:"button",onClick:()=>{K(!0),D(!0)},className:"flex h-[40px] items-center justify-center gap-1 rounded-[6px] bg-ui-action text-[15px] font-medium leading-none text-ui-on-action",children:[(0,r.jsx)("span",{children:z("book.quickBuy","×§× ××× ×××ר×")}),W&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{"aria-hidden":"true",children:"\xb7"}),(0,r.jsx)(M,{value:W})]})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{var e;return ei.addItem({id:t.id,title:t.title,author:t.author,cover:t.cover,format:(null==I?void 0:I.key)||"print",formatLabel:(null==I?void 0:I.label)||"",price:(0,o.Sk)(F[null==I?void 0:I.key]),origPrice:Number(null===(e=t.originalPrices)||void 0===e?void 0:e[(null==I?void 0:I.key)||"print"])>(0,o.Sk)(F[null==I?void 0:I.key])?Number(t.originalPrices[(null==I?void 0:I.key)||"print"]):(0,o.Sk)(F[null==I?void 0:I.key]),qty:1},{el:el.current,img:t.cover})},className:"flex h-[40px] items-center justify-center gap-1 rounded-[6px] bg-brand-green text-[15px] font-medium leading-none text-black",children:[(0,r.jsx)("span",{children:z("book.addToCart","×××¡×¤× ×ס×")}),W&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{"aria-hidden":"true",children:"\xb7"}),(0,r.jsx)(M,{value:W})]})]})]})]})]}),U&&(0,r.jsx)(k,{book:t,formats:T,quickBuyEnabled:P,onClose:()=>B(!1)}),P&&X&&(0,r.jsx)(w,{open:V,onClose:()=>D(!1),book:t,format:(null==I?void 0:I.key)||"print",formatLabel:(null==I?void 0:I.label)||"",unitPrice:(0,o.Sk)(W),qty:1})]})}},4064:function(e,t,n){n.d(t,{I:function(){return y},Z:function(){return C}});var r=n(7437),a=n(2265),i=n(7192);let l=new Map,o=new Map,s=new Set,c=new Set,u=new Set,d=new Map,p=new Map,x=new Map,h=new Map,f=null;function m(e){let t=String(null!=e?e:"").trim();if(!/^[1-9]\d*$/.test(t))return null;let n=Number(t);return Number.isSafeInteger(n)?String(n):null}function g(e){let t=Number(null==e?void 0:e.rating),n=Number(null==e?void 0:e.ratingCount);return{rating:Number.isFinite(t)&&t>0&&t<=5?t:null,ratingCount:Number.isFinite(n)&&n>0?Math.floor(n):0}}function b(e){let t=l.get(e);return t?t.expiresAt<=Date.now()?(l.delete(e),null):t.aggregate:null}function v(e,t){for(let n of(l.set(e,{aggregate:t,expiresAt:Date.now()+6e4}),u.delete(e),x.delete(e),h.has(e)&&(clearTimeout(h.get(e)),h.delete(e)),p.has(e)&&clearTimeout(p.get(e)),p.set(e,setTimeout(()=>{p.delete(e),l.delete(e),o.has(e)&&(s.add(e),j())},6e4)),o.get(e)||[]))n(t)}function j(){null==f&&(f=setTimeout(w,0))}async function k(e){let t=new Map(e.map(e=>[e,d.get(e)||0])),n=5e3;try{let r=e.join(","),a=e.some(e=>u.has(e)),i=await fetch("/api/reviews/ratings?bookIds=".concat(encodeURIComponent(r)).concat(a?"&fresh=".concat(Date.now()):""),{...a?{cache:"no-store"}:{},headers:{Accept:"application/json"}});if(!i.ok)throw n=function(e){var t;let n=null==e?void 0:null===(t=e.headers)||void 0===t?void 0:t.get("Retry-After");if(!n)return 5e3;let r=Number(n),a=Number.isFinite(r)?1e3*r:Date.parse(n)-Date.now();return Number.isFinite(a)?Math.max(1e3,Math.min(a,3e4)):5e3}(i),Error("rating batch failed: ".concat(i.status));let l=await i.json(),o=(null==l?void 0:l.ratings)&&"object"==typeof l.ratings?l.ratings:{};for(let n of e)(d.get(n)||0)===t.get(n)&&v(n,g(o[n]))}catch(r){!function(e,t,n){for(let r of e){if((d.get(r)||0)!==t.get(r)||!o.has(r)&&!u.has(r))continue;let e=x.get(r)||0;e>=2||h.has(r)||(x.set(r,e+1),h.set(r,setTimeout(()=>{if(h.delete(r),!o.has(r)&&!u.has(r)){x.delete(r);return}b(r)||(s.add(r),j())},n)))}}
1(e,t,n)}finally{for(let t of e)c.delete(t);s.size&&j()}}function w(){f=null;let e=[...s].slice(0,100);for(let t of e)s.delete(t),c.add(t);e.length&&k(e),s.size&&j()}function y(e){let t=m(e);t&&(l.delete(t),u.add(t),d.set(t,(d.get(t)||0)+1),x.delete(t),h.has(t)&&(clearTimeout(h.get(t)),h.delete(t)),s.add(t),j())}function N(e){let{className:t=""}=e;return(0,r.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 20 20",fill:"currentColor",className:"shrink-0 ".concat(t),"aria-hidden":"true",children:(0,r.jsx)("path",{d:"M8.47528 0.904831C8.84862 -0.301639 10.5563 -0.301637 10.9297 0.904832L12.3066 5.35444C12.4731 5.89246 12.9706 6.25929 13.5338 6.25929H18.1179C19.3471 6.25929 19.8743 7.81969 18.897 8.56523L15.0823 11.4754C14.6539 11.8022 14.475 12.3617 14.6343 12.8765L16.0656 17.5021C16.4353 18.6967 15.0535 19.6617 14.0593 18.9032L10.4816 16.1739C10.0215 15.8229 9.38345 15.8229 8.92332 16.1739L5.34564 18.9032C4.35139 19.6617 2.96962 18.6967 3.3393 17.5021L4.77069 12.8765C4.92998 12.3617 4.75107 11.8022 4.32265 11.4754L0.507893 8.56523C-0.469398 7.81969 0.0578415 6.25929 1.28704 6.25929H5.87117C6.43436 6.25929 6.93188 5.89245 7.09836 5.35444L8.47528 0.904831Z"})})}function C(e){let{book:t,className:n="",starClassName:l="",showCount:d=!1,announce:p=!0}=e,{t:f,dir:k}=(0,i.Q)(),w=function(e){var t;let n=m(null==e?void 0:e.id),r=g({rating:null==e?void 0:e.rating,ratingCount:null!==(t=null==e?void 0:e.ratingCount)&&void 0!==t?t:null==e?void 0:e.reviewCount}),i=r.rating,l=r.ratingCount,d=null!=i,[p,f]=(0,a.useState)(()=>({id:n,aggregate:n?b(n):null}));return((0,a.useEffect)(()=>{if(!n)return;if(d){v(n,{rating:i,ratingCount:l});return}let e=b(n);e&&f({id:n,aggregate:e});let t=function(e,t){let n=o.get(e)||new Set;return n.add(t),o.set(e,n),()=>{n.delete(t),n.size||(o.delete(e),u.has(e)||(h.has(e)&&(clearTimeout(h.get(e)),h.delete(e)),x.delete(e)))}}(n,e=>f({id:n,aggregate:e}));return!e&&(!n||b(n)||s.has(n)||c.has(n)||(s.add(n),j())),t},[d,n,i,l]),d)?r:p.id===n?p.aggregate:null}(t);if(!(null==w?void 0:w.rating))return null;let y=w.rating.toFixed(2).replace(/\.?0+$/,""),C=f("reviews.count","{n} ×××§×ר×ת").replace("{n}",w.ratingCount);return(0,r.jsxs)("span",{dir:k,className:"inline-flex shrink-0 items-center gap-1 text-black ".concat(n),children:[(0,r.jsx)(N,{className:l}),(0,r.jsx)("span",{"aria-hidden":"true",dir:"ltr",className:"font-medium",children:y}),d&&w.ratingCount>0&&(0,r.jsxs)("span",{"aria-hidden":"true",dir:"ltr",className:"opacity-70",children:["(",w.ratingCount,")"]}),p&&(0,r.jsxs)("span",{className:"sr-only",dir:"auto",children:[f("reviews.ratingOutOf","××ר×× {n} ×ת×× 5").replace("{n}",y),d&&w.ratingCount>0?". ".concat(C):""]})]})}},5632:function(e,t,n){n.d(t,{Z:function(){return l}});var r=n(7437),a=n(2265);let i=Array.from({length:6},(e,t)=>{let n=2*Math.PI*t/6-Math.PI/2;return{tx:"".concat((15*Math.cos(n)).toFixed(1),"px"),ty:"".concat((15*Math.sin(n)).toFixed(1),"px")}});function l(e){let{active:t,size:n=20,color:l}=e,[o,s]=(0,a.useState)(0),[c,u]=(0,a.useState)(null),d=(0,a.useRef)(t),p=(0,a.useRef)(!1),x=(0,a.useRef)(!1);(0,a.useEffect)(()=>{var e,t;x.current=!!(null===(e=(t=window).matchMedia)||void 0===e?void 0:e.call(t,"(prefers-reduced-motion: reduce)").matches)},[]),(0,a.useEffect)(()=>{if(!p.current){p.current=!0,d.current=t;return}t!==d.current&&(d.current=t,x.current||(u(t?"like":"unlike"),s(e=>e+1)))},[t]);let h=t?l||"#47F5A6":void 0;return(0,r.jsxs)("span",{className:"relative grid place-items-center",style:{width:n,height:n},children:["like"===c&&o>0&&(0,r.jsxs)("span",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0",children:[(0,r.jsx)("span",{className:"heart-burst-ring absolute left-1/2 top-1/2 h-4 w-4 rounded-full border-2 border-brand-green"}),i.map((e,t)=>(0,r.jsx)("span",{className:"heart-particle absolute left-1/2 top-1/2 h-[3px] w-[3px] rounded-full bg-brand-green",style:{"--tx":e.tx,"--ty":e.ty}},t))]},"burst-".concat(o)),(0,r.jsx)("svg",{width:n,height:n,viewBox:"0 0 20 20",fill:t?"currentColor":"none",style:h?{color:h}:void 0,className:"like"===c?"heart-pop":"unlike"===c?"heart-tap":"","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M17.3661 3.84124C16.9405 3.41541 16.4351 3.07761 15.8789 2.84714C15.3227 2.61667 14.7265 2.49805 14.1244 2.49805C13.5224 2.49805 12.9262 2.61667 12.37 2.84714C11.8138 3.07761 11.3084 3.41541 10.8828 3.84124L9.99945 4.72457L9.11611 3.84124C8.25637 2.98149 7.09031 2.49849 5.87445 2.49849C4.65859 2.49849 3.49252 2.98149 2.63278 3.84124C1.77304 4.70098 1.29004 5.86704 1.29004 7.0829C1.29004 8.29876 1.77304 9.46483 2.63278 10.3246L3.51611 11.2079L9.99945 17.6912L16.4828 11.2079L17.3661 10.3246C17.7919 9.89894 18.1297 9.39358 18.3602 8.83736C18.5907 8.28115 18.7093 7.68497 18.7093 7.0829C18.7093 6.48083 18.5907 5.88466 18.3602 5.32844C18.1297 4.77222 17.7919 4.26687 17.3661 3.84124Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})},"heart-".concat(o))]})}},4027:function(e,t,n){n.d(t,{Z:function(){return m}});var r=n(7437),a=n(8353),i=n(2265),l=n(4190),o=n(1430),s=n(15),c=n(7192),u=n(4041),d=n(2964),p=n(5025),x=n(3677);function h(e){let{value:t}=e,{symbol:n}=(0,d.U8)();return(0,p.xC)(t,n,{compact:!0})}function f(e){let{originalValue:t,value:n}=e,{symbol:a}=(0,d.U8)(),i=(0,p.xC)(t,a,{compact:!0}).split(" - ")[0];return(0,r.jsxs)("span",{dir:"ltr",className:"inline-flex items-center gap-1.5 whitespace-nowrap",children:[(0,r.jsx)("s",{className:"text-[12px] font-normal text-black/50",children:i}),(0,r.jsx)(h,{value:n})]})}function m(e){let{book:t,className:n="",onCoverError:d,openInNewTab:p=!1}=e;t=(0,x.h)(t);let{t:m,dir:g}=(0,c.Q)(),b=t.displayFormats||t.formats||{audio:40,digital:70,print:90},[v,j]=(0,i.useState)(!1),[k,w]=(0,i.useState)(!1),y=(0,i.useRef)(null);(0,i.useEffect)(()=>{var e;(null===(e=y.current)||void 0===e?void 0:e.complete)&&y.current.naturalWi
1dth>0&&j(!0)},[]);let N=(0,l.E2)(t),C=p?{target:"_blank",rel:"noopener noreferrer"}:{};return!(0,u.J)(t)||k?null:(0,r.jsxs)("div",{className:"theme-elevated-card flex min-w-0 self-start flex-col overflow-hidden rounded-[12px] bg-ui-surface text-ui-content shadow-[0_10px_23px_rgba(94,94,94,0.10),0_42px_42px_rgba(94,94,94,0.09)] ".concat(n),children:[(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-t-[12px] bg-ui-subtle ".concat(v?"":"skeleton"),style:{aspectRatio:"181 / 261"},children:[(0,r.jsx)(a.default,{href:N,...C,"aria-label":t.author?"".concat(t.title," ").concat(m("book.byAuthor","××ת")," ").concat(t.author):t.title,className:"absolute inset-0 z-[1]"}),(0,r.jsx)(o.default,{ref:y,src:t.cover,alt:t.title,sizes:"(max-width: 640px) 50vw, 288px",onLoad:()=>j(!0),onError:()=>{w(!0),null==d||d(t)},className:"cover-img object-cover ".concat(v?"is-loaded":"")}),null!=t.discount&&(0,r.jsx)("span",{dir:g,className:"absolute end-2 top-2 z-[3] rounded-[5px] bg-brand-green px-2 py-1 text-[10px] font-semibold leading-none text-black",children:m("book.discount","{n}% ×× ××").replace("{n}",t.discount)})]}),(0,r.jsxs)("div",{className:"relative flex flex-col rounded-b-[12px] bg-ui-surface px-[5px] pb-[10px] pt-[10px]",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"absolute left-1/2 top-[10px] w-5 -translate-x-1/2 border-t-2 border-black/30"}),(0,r.jsxs)("div",{className:"mx-auto mt-[10px] flex w-[calc(100%_-_12px)] min-w-0 flex-col items-center gap-2",children:[(0,r.jsx)(a.default,{href:N,...C,className:"block max-w-full",children:(0,r.jsx)("h3",{dir:"auto",className:"line-clamp-1 text-center text-[16px] font-medium leading-5 text-ui-content",children:t.title})}),(0,r.jsx)("div",{className:"flex h-[21px] w-full items-center justify-center",children:(0,r.jsx)(s.IV,{formats:b,size:18,className:"text-black",separated:!0,describeFormats:!0})}),t.displayPrice||t.price?(0,r.jsx)("div",{dir:"ltr",className:"flex h-[30px] w-full items-center justify-center rounded-[6px] bg-brand-green px-2 text-[14px] font-medium leading-none text-black",children:t.priceOriginal?(0,r.jsx)(f,{originalValue:t.priceOriginal,value:t.displayPrice||t.price}):(0,r.jsx)(h,{value:t.displayPrice||t.price})}):(0,r.jsx)("div",{className:"h-[30px] w-full","aria-hidden":"true"})]})]})]})}},3677:function(e,t,n){n.d(t,{default:function(){return h},h:function(){return p}});var r=n(7437),a=n(2265),i=n(9102),l=n(7388),o=n(9511),s=n(3039),c=n(5025);let u=e=>Object.entries((null==e?void 0:e.formats)||{}).map(e=>{let[t,n]=e;return{format:t,price:(0,c.a6)(n)}}).filter(e=>null!=e.price),d=(0,a.createContext)(null);function p(e){let t=(0,a.useContext)(d);return(null==t?void 0:t.get(String(null==e?void 0:e.id)))||e}let x=[];function h(e){let{couponCode:t="",currencySymbol:n="âª",books:p=x,previewPrices:h=!0,children:f}=e,[m,g]=(0,a.useState)(p),{user:b,getToken:v}=(0,i.a)(),j=(0,l.j)(),k=(0,a.useRef)("");(0,a.useEffect)(()=>{if(g(e=>e.length===p.length&&e.every((e,t)=>e===p[t])?e:p),!t||!h)return;let e=!1;return async function(){let r=[...p],a=0;async function i(){for(;!e&&a<p.length;){let i=a++,l=p[i],d=u(l);if(!d.length)continue;let x=Math.max(...d.map(e=>e.price));try{let a=await fetch("/api/coupons/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,customer_uid:(null==b?void 0:b.uid)||"guest",items:[{id:l.id,price:x,quantity:1,product_type:"book"}]})}),d=await a.json();r[i]=function(e,t,n,r){if(!(null==t?void 0:t.valid))return e;let a={code:t.code||n,discount_type:t.discount_type,discount_value:t.discount_value,eligible_book_ids:t.eligible_book_ids||[],eligible_set_ids:t.eligible_set_ids||[],eligible_product_ids:t.eligible_product_ids||[],max_discount:t.max_discount,min_items:t.min_items,min_subtotal:t.min_subtotal},i=u(e),l=i.map(t=>{let{format:n,price:r}=t,i={id:e.id,productType:"book",format:n,price:r,qty:1};return(0,s.U)([i],a).ok?{format:n,price:Math.max(0,r-(0,o.oU)([i],a))}:{format:n,price:r}});if(!l.some((e,t)=>e.price<i[t].price))return e;let d=Object.fromEntries(l.map(e=>{let{format:t,price:n}=e;return[t,(0,c.lb)(n,r)]})),p=l.map(e=>{let{price:t}=e;return t});return{...e,displayFormats:d,displayPrice:(0,c.qO)(Math.min(...p),Math.max(...p),r)}}(l,d,t,n),e||g([...r])}catch(e){}}}await Promise.all(Array.from({length:Math.min(6,p.length)},()=>i()))}(),()=>{e=!0}},[p,t,n,h,null==b?void 0:b.uid]);let w=(0,a.useMemo)(()=>j.items.map(e=>"".concat(e.key,":").concat(e.qty,":").concat(e.price)).join("|"),[j.items]);(0,a.useEffect)(()=>{var e;if(!t||!j.hydrated||!j.items.length||(null===(e=j.coupon)||void 0===e?void 0:e.code)===t)return;let n="".concat(t,":").concat(w);k.current!==n&&(k.current=n,v().then(e=>j.applyCoupon(t,{token:e,customerUid:(null==b?void 0:b.uid)||"guest"})))},[j,w,t,v,null==b?void 0:b.uid]);let y=(0,a.useMemo)(()=>new Map(m.map(e=>[String(e.id),e])),[m]);return(0,r.jsx)(d.Provider,{value:y,children:f})}}}]);
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.