1import{Q as _,cX as M,r as v,P as f,d as g,U as E,j as e,F as b,ac as k,a4 as D,cY as L}from"./index-KDcLenRU.js";import{u as A,P as Y}from"./index.z5hTNRCp.js";import O from"./BestSellersByCategory.K2nN-3UG.js";import{g as z}from"./utils.xHmnnrxQ.js";import{g as H,s as $}from"./awardsHelper.l2A6I6d0.js";import{a as U,i as V,b as q}from"./TeacherBookBadge.lXe03IJT.js";import{d as R}from"./index.CSq2RyQM.js";import{u as G,S as K,a as Q,b as X}from"./smile-face.hhJGtgbg.js";import W from"./NewReleases.ADYydxKV.js";import Z from"./PreOrders.rQ0zI0YW.js";import{R as J}from"./RecentlyViewedProducts.WWys3IM-.js";import{P as ee}from"./ProductCardsSwiper.uWj36LrL.js";/* empty css */import"./warning-sign.XBdkSz9g.js";import"./toGreekCaps.1t_UCRL0.js";import"./useProducts.heOgfDpk.js";/* empty css */import"./pagination.2PogbG0d.js";import"./swiper-react.4C7c-kAQ.js";import"./useProductsByIds.nFkdXrlC.js";import"./useSwiperSlidePersistence.A7cCrjuI.js";import"./ProductCardMini.XQQTvl9v.js";import"./FormattedPrice._VlBjyoq.js";import"./PurchasedBadge.VYTyYo3L.js";import"./my-library.ZRI8T0vT.js";import"./Default Book.mxlZrDNP.js";import"./AddToCart.dFMhPKyn.js";import"./react-select-utils.fldikllN.js";import"./variables.w40geAFS.js";const se=s=>_({queryKey:["custom-message",s],queryFn:()=>M(s).then(r=>r).catch(()=>({})),placeholderData:r=>r??{},enabled:s.length>0,refetchOnWindowFocus:!1}),ne=s=>v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:8.841,height:6.593,viewBox:"0 0 8.841 6.593",...s},v.createElement("path",{id:"Icon_awesome-check","data-name":"Icon awesome-check",d:"M3,11.041.129,8.167a.442.442,0,0,1,0-.625l.625-.625a.442.442,0,0,1,.625,0L3.316,8.853,7.462,4.707a.442.442,0,0,1,.625,0l.625.625a.442.442,0,0,1,0,.625L3.628,11.041A.442.442,0,0,1,3,11.041Z",transform:"translate(0 -4.577)",fill:"#003e92"}));function I({product:s,handleOpenReviewModal:r}){var c;const{t:l}=g(),{data:n}=G(1,s.id),o=t=>t>=4?e.jsx("span",{className:"review-icon very-good",children:e.jsx(K,{})}):t>=2.5?e.jsx("span",{className:"review-icon smile",children:e.jsx(Q,{})}):e.jsx("span",{className:"review-icon default",children:e.jsx(X,{})}),a=v.useMemo(()=>{var t;return((t=n==null?void 0:n.items)==null?void 0:t.filter(N=>N.st===1))??[]},[n]),d=a==null?void 0:a.length,j=Math.round(((c=s.aggregates)==null?void 0:c.rating)??0),u=E.isAuthenticated()&&(n==null?void 0:n.canCreateReview)===!1&&!(n!=null&&n.lastStatus);return e.jsx("div",{id:"product-reviews",children:e.jsx("div",{className:"content-wrapper product-reviews-container",children:a.length>0?e.jsxs("div",{className:"reviews-container",children:[e.jsxs("div",{className:"reviews",children:[e.jsx("h3",{className:"reviews-heading",children:j}),e.jsxs("div",{className:"star-rating",children:[e.jsx(R.Rating,{allowFraction:!0,fillColor:"#003E92",SVGstrokeColor:"#003E92",size:24,readonly:!0,initialValue:j}),"(",d,")"]}),!u&&e.jsx("button",{className:"blue-button",onClick:r,children:l("productReviews.rateProduct")})]}),e.jsx("div",{className:"ratings",children:e.jsx("div",{className:"ratings-container",children:a&&a.map(t=>e.jsxs("div",{className:"ratings-item",children:[e.jsxs("div",{className:"ratings-header",children:[e.jsx("span",{className:"ratings-heading",children:o(t.rating)}),e.jsx("div",{className:"rating-stars",children:e.jsx(R.Rating,{allowFraction:!0,fillColor:"black",SVGstrokeColor:"black",size:18,style:{height:"16px"},readonly:!0,initialValue:t.rating})}),t.pdt&&e.jsxs("div",{className:"confirmed-purchase",children:[e.jsx(ne,{})," ",l("productReviews.verifiedPurchase")]})]}),e.jsx("p",{className:"subtext",children:e.jsxs("span",{className:"subtext-1",children:[t.from_name?e.jsx(b,{to:`/readers/${t.from_name}`,className:"review-user-link",children:t.from_name}):null," | ",k(t.review_date).format("DD/MM/YYYY")]})}),e.jsx("div",{className:"rating-desc",dangerouslySetInnerHTML:{__html:t.review}})]},t.id))})})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"no-reviews-text",children:l("productReviews.noReviews")}),!u&&e.jsx("button",{className:"add-review centered",onClick:r,children:l("productReviews.rateNow")})]})})})}I.propTypes={product:f.object,handleOpenReviewModal:f.func};const C=(s,r)=>{const l=D();return _({queryKey:["customers-by-recommendation-entity",s,r,{lang:l}],queryFn:()=>L(s,r).then(n=>n).catch(()=>({})),placeholderData:n=>n??[],enabled:!!s&&!!r})},ie=({product:s,isFetching:r})=>{var u;const{t:l}=g(),n=(u=s.contributors)==null?void 0:u.find(c=>c.contributorCategoryCode==="author"),{data:o=[]}=C(1,s.id),{data:a=[]}=C(6,n==null?void 0:n.conId),d=o.join(", ").split(",").map(c=>
1c.trim()).filter(Boolean),j=a.join(", ").split(",").map(c=>c.trim()).filter(Boolean);return e.jsx("div",{className:"recommendations",id:"recommendations",children:e.jsx("div",{className:"content-wrapper",children:r?e.jsxs("div",{className:"recommendations-skeleton",children:[e.jsx("div",{className:"skeleton book-recommendations"}),e.jsx("div",{className:"skeleton author-recommendations"})]}):e.jsxs("div",{className:"recommendations",children:[e.jsxs("div",{className:"book-recommendations",children:[e.jsx("h3",{children:l("recommendations.book_recommended_by")}),e.jsx("div",{className:"recommenders",children:d.length>0?d.map((c,t)=>e.jsxs("span",{children:[e.jsx(b,{to:`/readers/${c}`,children:c}),t<d.length-1?", ":""]},t)):e.jsx("span",{})})]}),e.jsxs("div",{className:"author-recommendations",children:[e.jsx("h3",{children:l("recommendations.author_recommended_by")}),e.jsx("div",{className:"recommenders",children:j.length>0?j.map((c,t)=>e.jsxs("span",{children:[e.jsx(b,{to:`/readers/${c}`,children:c}),t<j.length-1?", ":""]},t)):e.jsx("span",{})})]})]})})})};function ae({product:s,handleOpenReviewModal:r,reviewsTabTrigger:l}){var y,w;const{t:n}=g(),o=[n("productTabs.details"),n("productTabs.reviews"),n("productTabs.shippingAndReturns")],[a,d]=v.useState(o[0]);v.useEffect(()=>{l&&d(o[1])},[l]);const{data:j}=se("PRODUCT-SHIPPING-RETURN-POLICY"),u=U(s),c=V(s.catlst),t=["Î£Ï Î³Î³ÏαÏÎαÏ","ÎεÏαÏÏαÏÏήÏ","ÎκδÏÏηÏ"],N=v.useMemo(()=>{var m;if(!s.contributors)return[];const i=Array.from(z(((m=s.contributors)==null?void 0:m.sort((h,x)=>h.catId-x.catId))??[],h=>h.contributorCategoryName)),p=h=>{const x=t.indexOf(h);return x===-1?Number.MAX_SAFE_INTEGER:x};return i.sort(([h],[x])=>p(h)-p(x))},[s.contributors]),T=(i,p,m)=>{const h=i.contributorCategoryCode==="author"?H(i,n):$(i.comb_name),x=e.jsxs("span",{children:[h,p!==m-1&&", "]});return["Î£Ï Î³Î³ÏαÏÎαÏ","ÎικονογÏάÏοÏ","ÎιαÏÎºÎµÏ Î®","ÎικονογÏάÏηÏη","ÎεÏαÏÏαÏÏήÏ"].includes(i.contributorCategoryName)?e.jsx(b,{to:i.eurl?`${i.eurl}`:"#",children:x},p):e.jsx("span",{children:x},p)};return e.jsx("div",{id:"product-reviews-section",className:"details-rating-policy-tabs",children:e.jsxs("div",{className:"content-wrapper",children:[e.jsx("ul",{className:"tabs",children:o.map(i=>e.jsx("li",{className:a===i?"active":"",onClick:()=>d(i),children:i},i))}),e.jsx("div",{className:a===o[0]?"tab-container active":"tab-container",children:e.jsxs("ul",{className:"product-details",children:[e.jsxs("li",{children:[e.jsx("div",{children:"ISBN13"}),e.jsx("div",{children:s.bc})]}),s.sub_title&&e.jsxs("li",{children:[e.jsx("div",{children:n("productTabs.originalTitle")||"Î ÏÏÏÏÏÏ ÏÎ¿Ï Î¤Î¯ÏλοÏ"}),e.jsx("div",{children:s.sub_title})]}),N==null?void 0:N.map((i,p)=>{const m=i[1],h=m==null?void 0:m[0];let x=i[0];return(h==null?void 0:h.contributorCategoryCode)==="publisher"&&(x=n(c?"productTabs.manufacturer":"productTabs.publisher")),e.jsxs("li",{children:[e.jsx("div",{children:x}),e.jsx("div",{className:"wrapper",children:m.map((B,F)=>T(B,F,m.length))})]},p)}),e.jsxs("li",{children:[e.jsx("div",{children:n("product.possible_location")}),e.jsx("div",{children:u})]}),(w=(y=s.atrlst)==null?void 0:y.filter(i=>i.isrc&&i.vint!==0&&i.tval.length>0))==null?void 0:w.map((i,p)=>{let m=i.tval;return i.anm==="ΣειÏά"&&(m=e.jsx(b,{to:q(i.tval),className:"series-link",children:i.tval})),e.jsxs("li",{children:[e.jsx("div",{children:i.anm}),e.jsx("div",{children:m})]},p)}),s.pieces&&e.jsxs("li",{children:[e.jsx("div",{children:n("productTabs.pages")}),e.jsx("div",{children:s.pieces})]}),s.size&&e.jsxs("li",{children:[e.jsx("div",{children:n("productTabs.dimensions")}),e.jsx("div",{children:s.size})]}),s.release&&e.jsxs("li",{children:[e.jsx("div",{children:n("productTabs.date")}),e.jsx("div",{children:k(s.release).format("DD/MM/YYYY")})]}),s.cnm&&e.jsxs("li",{children:[e.jsx("div",{children:n("productTabs.theme")}),e.jsx("div",{children:s.cnm})]})]})}),e.jsx("div",{className:a===o[1]?"tab-container active":"tab-container",children:e.jsx(I,{product:s,handleOpenReviewModal:r})}),e.jsx("div",{className:a===o[2]?"tab-container active":"tab-container",children:e.jsx("div",{className:"shipping-policy",dangerouslySetInnerHTML:{__html:j.bd}})}),e.jsx("div",{className:"recommendation-wrapper",children:e.jsx(ie,{product:s,isFetching:!1})})]})})}function P({title:s,className:r,children:l}){const{t:n}=g(),[o,a]=v.useState(!1);return e.jsxs("div",{className:r,children:[e.jsx("h2",{children:s}),e.jsx("div",{className:`description ${o?"active":""}`,children:l}),e.jsxs("button",{type:"button",className:"show-more",onClick:()=>a(d=>!d),children:[n(o?"productDescription.showLess":"productDescription.showMore"),e.jsx("span",{className:"show-more-icon","aria-hidden":"true",children:o?"â":"+"})]})]})}function te({product:s,isFetching:r}){var d,j;const{t:l}=g(),n=((d=s==null?void 0:s.dsm)==null?void 0:d.length)>1,o=(j=s==null?void 0:s.dlg)!=null&&j.trim()?s.dlg.split(` 2`).map(u=>
2u.trim()).filter(Boolean):[],a=o.length>0;return!n&&!a?null:e.jsx("div",{id:"product-description",children:r?e.jsx("div",{className:"placeholder-content-wrapper",children:e.jsx("div",{className:"skeleton"})}):e.jsxs("div",{className:`presentation-contents ${n&&a?"two-columns":""}`,children:[n&&e.jsx(P,{title:l("productDescription.title"),className:"product-description-container",children:e.jsx("div",{dangerouslySetInnerHTML:{__html:s==null?void 0:s.dsm}})}),a&&e.jsx(P,{title:l("productTabs.contents"),className:"product-contents-container",children:e.jsx("div",{className:"toc-columns",children:o.map((u,c)=>e.jsx("div",{className:"toc-line",dangerouslySetInnerHTML:{__html:u}},c))})})]})})}const S=({product:s})=>{var n;const{t:r}=g(),{data:l}=A(s.id,"related");return((n=l.items)==null?void 0:n.length)===0?null:e.jsx("div",{id:"related-products",children:e.jsxs("div",{className:"personalized-products-container content-wrapper",children:[e.jsx("h2",{className:"title",children:r("relatedProducts.title")}),e.jsx(ee,{products:l.items??[],pagination:!0})]})})};S.propTypes={product:f.object};const Ee=({product:s,isFetching:r,handleOpenReviewModal:l,reviewsTabTrigger:n})=>{var d;const o=(s==null?void 0:s.subtid)!==3,a=(d=s==null?void 0:s.catlst)==null?void 0:d[0];return e.jsxs(e.Fragment,{children:[e.jsx(te,{product:s,isFetching:r}),e.jsx(ae,{product:s,handleOpenReviewModal:l,reviewsTabTrigger:n}),e.jsx(J,{product:s}),o&&a&&e.jsxs(e.Fragment,{children:[e.jsx(O,{categoryId:a,excludeProductId:s==null?void 0:s.id}),e.jsx(Z,{categoryId:a,excludeProductId:s==null?void 0:s.id}),e.jsx(W,{categoryId:a,excludeProductId:s==null?void 0:s.id})]}),e.jsx(S,{product:s}),e.jsx(Y,{})]})};export{Ee as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.