1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4987],{84110:function(e){var t;t=function(){return function(e,t,i){e=e||{};var n=t.prototype,r={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(e,t,i,r){return n.fromToBase(e,t,i,r)}i.en.relativeTime=r,n.fromToBase=function(t,n,a,s,l){for(var o,d,c,u=a.$locale().relativeTime||r,x=e.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=x.length,h=0;h<m;h+=1){var p=x[h];p.d&&(o=s?i(t).diff(a,p.d,!0):a.diff(t,p.d,!0));var g=(e.rounding||Math.round)(Math.abs(o));if(c=o>0,g<=p.r||!p.r){g<=1&&h>0&&(p=x[h-1]);var v=u[p.l];l&&(g=l(""+g)),d="string"==typeof v?v.replace("%d",g):v(g,n,p.l,c);break}}if(n)return d;var f=c?u.future:u.past;return"function"==typeof f?f(d):f.replace("%s",d)},n.to=function(e,t){return a(e,t,this,!0)},n.from=function(e,t){return a(e,t,this)};var s=function(e){return e.$u?i.utc():i()};n.toNow=function(e){return this.to(s(this),e)},n.fromNow=function(e){return this.from(s(this),e)}}},e.exports=t()},48379:function(e,t,i){"use strict";var n=i(64836);t.Z=void 0;var r=n(i(33651)),a=i(85893),s=(0,r.default)((0,a.jsx)("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");t.Z=s},84956:function(e,t,i){"use strict";var n=i(64836);t.Z=void 0;var r=n(i(33651)),a=i(85893),s=(0,r.default)((0,a.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"}),"ArrowUpward");t.Z=s},97914:function(e,t,i){"use strict";i.d(t,{Z:function(){return x}});var n=i(85893),r=i(95639),a=i(89540),s=i(57382),l=i(53145),o=i(19604),d=i(21485),c=i(7727),u=i(18745),x=function(e){let{children:t,title:i,open:x,handleClose:m}=e,h=(0,u.Z)();return(0,a.Z)(h.breakpoints.up("lg"))?null:(0,n.jsx)(s.ZP,{"data-testid":"bottom-drawer",anchor:"bottom",open:x,onClose:m,PaperProps:{sx:{borderTopLeftRadius:"24px",borderTopRightRadius:"24px",display:"flex",alignItems:"center",minWidth:h.breakpoints.values.sm/3,overflowY:"hidden"}},sx:{"& .MuiBackdrop-root":{bgcolor:"".concat(h.palette.primary.dark,"99"),opacity:.5}},children:(0,n.jsxs)(l.Z,{width:"100%",alignItems:"center",children:[(0,n.jsx)(o.Z,{width:"100%",display:"flex",justifyContent:"center",px:{xs:2,md:4},children:(0,n.jsxs)(o.Z,{maxWidth:"md",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",py:2,children:[(0,n.jsx)(d.Z,{variant:"h4",children:i}),(0,n.jsx)(c.Z,{"aria-label":"close",onClick:m,children:(0,n.jsx)(r.Z,{htmlColor:h.palette.text.primary})})]})}),(0,n.jsx)(o.Z,{width:"100%",display:"flex",justifyContent:"center",px:{xs:2,md:4},pb:{xs:2,md:4},pt:{xs:1,md:2},children:(0,n.jsx)(l.Z,{maxWidth:"md",flexGrow:1,gap:2,children:t})})]})})}},74987:function(e,t,i){"use strict";i.d(t,{Z:function(){return eN}});var n,r,a=i(85893),s=i(19604),l=i(56912),o=i(33059),d=i(84956),c=i(53145),u=i(6630),x=i(21485),m=i(27398),h=i(93043),p=i(67294),g=i(93653);let v={justifyContent:"center",alignItems:"center",mt:{xs:2,sm:4,md:6,lg:15}},f={display:"flex",margin:"auto",justifyContent:"center",alignItems:"center",marginTop:"20px"};var w=i(93466),b=()=>{window.scrollTo({top:0,behavior:"smooth"})},j=i(8506),y=i(27484),Z=i.n(y),C=i(84110),R=i.n(C),I=i(43322);Z().extend(R());var S=function(e){let{headline:t,content:i,submittedBy:n,submittedDate:r,rating:o}=e,d=Z()(r).format("MMM D, YYYY");return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Z,{"data-testid":"product-review-divider"}),(0,a.jsxs)(j.ZP,{py:{xs:2,md:4},"data-testid":"product-review",container:!0,component:"article",tabIndex:0,sm:12,item:!0,gap:2,display:"flex",flexDirection:"column",children:[(0,a.jsx)(s.Z,{component:"section",height:"28px",children:(0,a.jsx)(I.Z,{defaultValue:o,"data-testid":"product-review-stars"})}),(0,a.jsx)(x.Z,{variant:"h4",tabIndex:0,children:t}),(0,a.jsx)(x.Z,{variant:"body1",width:"100%",tabIndex:0,children:i}),(0,a.jsxs)(c.Z,{component:"footer",direction:"column",alignItems:"start",ga
1p:.5,children:[n&&(0,a.jsx)(x.Z,{variant:"body2","aria-label":"Submitted by ".concat(n),tabIndex:0,children:n}),d&&(0,a.jsx)(x.Z,{component:"time",variant:"body2","aria-label":"Submitted on ".concat(d),tabIndex:0,children:d})]})]})]})},k=i(48379),T=i(45930),O=i(45399),E=i(83649),P=i(97914);let D={1:"1 Star",2:"2 Stars",3:"3 Stars",4:"4 Stars",5:"5 Stars"},N=[{value:"1",label:D["1"]},{value:"2",label:D["2"]},{value:"3",label:D["3"]},{value:"4",label:D["4"]},{value:"5",label:D["5"]}];(n=r||(r={})).MOST_RECENT="Newest",n.LOWEST_RATED="LowestRating",n.HIGHEST_RATED="HighestRating",n.OLDEST="Oldest";let W=[{value:"Newest",label:"Most Recent"},{value:"Oldest",label:"Oldest"},{value:"LowestRating",label:"Lowest Rated"},{value:"HighestRating",label:"Highest Rated"}],F={Newest:"reviewDate,desc",Oldest:"reviewDate,asc",HighestRating:"rating,desc",LowestRating:"rating,asc"},M={".MuiPopover-paper":{borderRadius:2,width:320,display:"flex",flexDirection:"column"},display:{xs:"none",lg:"block"}},L={bgcolor:"white",justifyContent:"space-between",borderRadius:1,py:1},z={justifyContent:"space-between",fontWeight:"normal",fontSize:"body1",color:"text.secondary",borderColor:"text.secondary",padding:"17px 12px",textTransform:"none"};var B=function(e){var t,i,n,r,l;let{children:o,options:d,selectedOption:c,onChange:u,color:x="primary",size:m="medium",drawerTitle:g="Filter",testIdPrefix:v="filter"}=e,[f,w]=(0,p.useState)(!1),b=(0,p.useRef)(null),j=()=>w(!1),y=e=>()=>{j(),u(e)},Z=d.find(e=>e.value===c);return(0,a.jsxs)(s.Z,{display:"flex",alignItems:"center",sx:{width:{xs:"224px",lg:"320px"}},"data-testid":"".concat(v,"-btn"),children:[(0,a.jsx)(h.Z,{ref:b,variant:"outlined",endIcon:(0,a.jsx)(k.Z,{}),onClick:()=>w(!0),color:x,size:m,"aria-label":"".concat(g," select"),fullWidth:!0,sx:z,children:null!==(n=null==Z?void 0:Z.label)&&void 0!==n?n:o}),(0,a.jsx)(T.Z,{open:f,anchorEl:b.current,onClose:j,anchorOrigin:{vertical:(null!==(r=null===(t=b.current)||void 0===t?void 0:t.clientHeight)&&void 0!==r?r:0)+8,horizontal:(null!==(l=null===(i=b.current)||void 0===i?void 0:i.clientWidth)&&void 0!==l?l:0)-320},sx:M,"data-testid":"".concat(v,"-menu"),children:d.map(e=>{let{label:t,value:i}=e,n=i===c;return(0,a.jsxs)(O.Z,{onClick:y(i),selected:n,disableRipple:!0,"data-testid":"".concat(v,"-option-").concat(i),sx:{justifyContent:"space-between"},children:[t,(0,a.jsx)(E.Z,{color:x,checked:n,disableRipple:!0})]},i)})}),(0,a.jsx)(P.Z,{title:g,open:f,handleClose:j,children:d.map(e=>{let{label:t,value:i}=e,n=i===c;return(0,a.jsxs)(O.Z,{onClick:y(i),selected:n,disableRipple:!0,sx:L,children:[t,(0,a.jsx)(E.Z,{color:x,checked:n,disableRipple:!0})]},i)})})]})},H=function(e){let{numberOfReviews:t,selectedSortByOption:i,selectedFilterOption:n,onSortByOptionChange:r,onAppliedFilterChange:s}=e;return(0,a.jsxs)(c.Z,{mt:6,mb:{xs:2,md:4},"data-testid":"product-reviews-organizer",children:[(0,a.jsxs)(x.Z,{variant:"h5",mb:3,children:["Review by ",t," customers"]}),(0,a.jsxs)(c.Z,{direction:{xs:"column",md:"row"},gap:5,mt:2,component:"aside",children:[(0,a.jsxs)(c.Z,{display:"flex",component:"section",direction:"row",alignItems:"center",spacing:2,width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[(0,a.jsx)(x.Z,{variant:"subtitle1",fontWeight:"bold",mb:1,children:"Filter"}),(0,a.jsx)(B,{onChange:s,selectedOption:n,options:N,size:"large",color:"secondary","data-testid":"filter-review-btn",drawerTitle:"Filter",children:"Select"})]}),(0,a.jsxs)(c.Z,{display:"flex",component:"section",direction:"row",alignItems:"center",spacing:2,width:{xs:"100%",md:"auto"},justifyContent:"space-between",children:[(0,a.jsx)(x.Z,{variant:"subtitle1",fontWeight:"bold",mb:1,children:"Sort by"}),(0,a.jsx)(B,{options:W,selectedOption:i,onChange:r,size:"large",color:"secondary","data-testid":"sort-by-reviews-btn",drawerTitle:"Sort by",children:"Select"})]})]})]})},_=function(e){let{productId:t}=e,[i,n]=(0,p.useState)(!1),[r,s]=(0,p.useState)(),[o,j]=(0,p.useState)(null),[y,Z]=(0,p.useState)(null),[C,R]=(0,p.useState)(0),[I,k]=(0,p.useState)(0),[T,O]=(0,p.useState)(!0),E=async e=>{if(!i){n(!0);try{let i=await g.Z.products.getProductReviews({productId:t,size:3,page:e,rating:o||void 0,sort:y?F[y]:void 0});if(null===i){w.Z.error("[PRODUCT-REVIEWS-SECTION]: Data is null"),n(!1);return}let r=i.pageCount>e;O(r),r&&k(e+1),i.totalCount!==C&&R(i.totalCount),i&&s(e=>[...null!=e?e:[],...i.data])}catch(e){w.Z.error("[PRODUCT-REVIEWS-SECTION]: ".concat(e))}finally{n(!1)}}},P=()=>{k(0),s([]),O(!0)};(0,p.useEffect)(()=>{P(),E(0)},[o,y]);let D=(0,p.useCallback)(e=>{Z(t=>t===e?null:e)},[]),N=(0,p.useCallback)(e=>{j(t=>t===e?null:e)},[]);return r&&0!==r.length||i?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(H,{numberOfReviews:C,selectedSortByOption:y,selectedFilterOption:o,onSortByOptionChange:D,onAppliedFilterChange:N}),null==r?void 0:r.map(e=>{let{content:t,id:i,rating:n,reviewDate:r,reviewer:s,title:l}=e;return(0,a.jsx)(S,{ugcId:i,headline:l,content:t,submittedDate:r,submittedBy:s,rating:n},i)}),(0,a.jsx)(l.Z,{}),i&&(0,a.jsx)(c.Z,{my:2,"aria-label":"Loading reviews","aria-busy":"true",children:(0,a.jsx)(m.Z,{sx:f})}),T?(0,a.jsx)(c.Z,{sx:v,children:(0,a.jsx)(h.Z,{variant:"outlined",color:"secondary",size:"large",onClick:()=>{E(I)},disabled:!T||i,"data-testid":"load-more-reviews-btn",sx:{mt:2,mb:4,width:{xs:"100%",md:"auto"}},children:i?"Loading...":"Load More Reviews"})}):(0,a.jsx)(c.Z,{sx:v,children:(0,a.jsx)(h.Z,{variant:"outlined",color:"secondary",endIcon:(0,a.jsx)(d.Z,{}),disableElevation:!0,size:"large",onClick:b,children:"Back to Top"})})]}):(0,a.jsxs)(c.Z,{direction:{xs:"column",sm:"row"},alignItems:"center",spacing:1,mt:2,children:[(0,a.jsx)(u.Z,{value:5,s
1x:{color:"text.disabled"},size:"large",disabled:!0}),(0,a.jsx)(x.Z,{variant:"h5",component:"p",color:"text.disabled",children:"No reviews yet"})]})},q=i(10448),V=i(87578),U=i(25675),A=i.n(U);let Y={cursor:"pointer","img:hover":{opacity:.75,transition:"200ms opacity ease-in-out"}};var G={width:"100%",height:"100%",objectFit:"cover",borderRadius:8},$=function(e){let{item:t,index:i,cols:n,rows:r,onItemSelected:s}=e;return(0,a.jsx)(V.Z,{cols:n||1,rows:r||1,sx:Y,children:(0,a.jsx)(A(),{onClick:()=>{s(i)},src:t.original,alt:"Product review image ".concat(i+1),width:0,height:0,sizes:"100vw",style:G,placeholder:"blur",blurDataURL:"/_next/image?url=".concat(t.normal,"&w=16&q=1"),"data-testid":"image-grid-item",quality:65,priority:!0})},t.original)};let J={width:"100%",height:"auto",py:1,display:{xs:"grid",md:"none"}},K={width:"100%",height:"auto",margin:"0 auto",padding:"0",scrollbarWidth:"none",display:{xs:"none",md:"grid"}},Q=[{rows:1,cols:1},{rows:1,cols:1},{rows:1,cols:1},{rows:1,cols:1},{rows:2,cols:2},{rows:1,cols:2},{rows:1,cols:1},{rows:1,cols:1}],X=[{rows:1,cols:1},{rows:1,cols:1},{rows:1,cols:1},{rows:2,cols:1},{rows:1,cols:1},{rows:1,cols:1},{rows:1,cols:1},{rows:1,cols:1}];var ee=function(e){let{items:t,onItemSelected:i}=e,n=t.slice(0,8);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(q.Z,{"data-testid":"image-list",sx:K,variant:"quilted",cols:6,rowHeight:150,children:n.map((e,t)=>{let{rows:n,cols:r}=Q[t];return e?(0,a.jsx)($,{onItemSelected:i,item:e,index:t,rows:n,cols:r},"".concat(e,"_").concat(t.toString())):null})}),(0,a.jsx)(q.Z,{sx:J,"data-testid":"mobile-image-list",variant:"quilted",cols:3,rowHeight:140,children:n.map((e,t)=>{let{rows:n,cols:r}=X[t];return e?(0,a.jsx)($,{onItemSelected:i,item:e,index:t,rows:n,cols:r},"".concat(e,"_").concat(t.toString())):null})})]})},et=i(14959),ei={width:"100%",height:"20px",borderRadius:10,bgcolor:"bgcolor.100","& .MuiLinearProgress-bar":{borderRadius:10,bgcolor:"secondary.500"}};let en={1:"One star rating",2:"Two stars rating",3:"Three stars rating",4:"Four stars rating",5:"Five stars rating"};var er=function(e){let{rating:t,numberOfReviews:i,distributionPercentage:n}=e;return(0,a.jsxs)(s.Z,{display:"flex",width:"100%",alignItems:"center","data-testid":"rating-distribution",gap:2,children:[(0,a.jsx)(I.Z,{defaultValue:t,"data-testid":"product-review-stars",withNumericValueLabel:!1}),(0,a.jsx)(et.Z,{variant:"determinate",value:n,"aria-label":en[t],sx:ei}),(0,a.jsx)(s.Z,{width:"130px",display:"flex",justifyContent:"left",children:(0,a.jsx)(x.Z,{variant:"subtitle1",component:"p",fontWeight:600,children:i})})]})},ea=i(42942),es=function(e){let{rating:t,numberOfReviews:i}=e;return(0,a.jsxs)(c.Z,{alignItems:"center",flexDirection:"row",gap:1,"data-testid":"rating-summary",children:[(0,a.jsx)(ea.Z,{sx:{fontSize:"40px",color:"starRating.main"}}),(0,a.jsxs)(c.Z,{ml:1,children:["number"==typeof t&&(0,a.jsx)(x.Z,{variant:"h1",children:t.toFixed(1)}),"number"==typeof i&&(0,a.jsxs)(x.Z,{children:[i," Reviews"]})]})]})},el=function(e){let{totalNumberOfReviews:t,averageRating:i,ratingsDistribution:n,media:r,onItemSelected:s}=e;return(0,a.jsx)(c.Z,{"data-testid":"product-reviews-summary",children:(0,a.jsxs)(j.ZP,{container:!0,spacing:{xs:3,md:15},py:{xs:0,md:5},children:[(0,a.jsxs)(j.ZP,{sx:{display:"flex",flexDirection:"column"},item:!0,xs:12,md:5,gap:{xs:3,md:6},children:[(0,a.jsx)(es,{rating:i,numberOfReviews:t}),(0,a.jsx)(c.Z,{spacing:.5,children:n.map(e=>{let{rating:t,numberOfReviews:i,distributionPercentage:n}=e;return(0,a.jsx)(er,{rating:t,numberOfReviews:i,distributionPercentage:n},"".concat(t,"-").concat(i,"-").concat(n))})})]}),(0,a.jsx)(j.ZP,{item:!0,xs:12,md:7,children:(0,a.jsx)(ee,{items:r,onItemSelected:s})})]})})},eo=i(95639),ed=i(88196),ec=i(88489),eu=i(7727),ex=i(89314),em=i(13056),eh=i.n(em),ep=i(55292),eg=i(73378),ev=function(e){let{onClick:t,className:i,isPrev:n,arrowForwardIcon:r=eg.Z,arrowBackIcon:s=ep.Z}=e;return(0,a.jsx)(eu.Z,{onClick:t,className:i,"aria-label":n?"previous image":"next image",size:"medium",sx:{display:{xs:"none",sm:"flex"}},"data-testid":"prev-next-button",children:n?(0,a.jsx)(s,{color:"primary","data-testid":"back-icon"}):(0,a.jsx)(r,{color:"primary","data-testid":"forward-icon"})})};let ef={height:"70vh",".MuiIconButton-root:hover":{bgcolor:"bgcolor.50",filter:"unset",opacity:"unset"}},ew=e=>({display:"flex",justifyContent:"center",alignItems:"center",height:"70vh",width:"auto",maxWidth:"90vw",ml:"auto",mr:"auto",img:{pointerEvents:"none",borderRadius:"8px",height:"auto",width:"auto",maxWidth:"100%",maxHeight:"100%",marginBottom:0,[e.breakpoints.up("lg")]:{height:"600px"}}}),eb={top:"calc(50% - 25px)",height:0};function ej(e){let{onClick:t,className:i,prev:n}=e;return(0,a.jsx)(ev,{onClick:t,className:i,isPrev:n})}var ey=function(e){let{items:t,activeReviewIndex:i,onSlideChangeHandler:n}=e;return(0,a.jsx)(s.Z,{"data-testid":"media-carousel",children:(0,a.jsx)(eh(),{index:i,indicators:!1,onChange:n,autoPlay:!1,sx:ef,fullHeightHover:!1,navButtonsWrapperProps:{style:eb},NavButton:ej,children:t.map(e=>(0,a.jsx)(s.Z,{sx:ew,"data-testid":"media-carousel-item",children:(0,a.jsx)(A(),{src:e.original,blurDataURL:"/_next/image?url=".concat(e.original,"&w=16&q=1"),alt:"Review media",height:700,width:700,placeholder:"blur",quality:65,priority:!0})},e.original))})})},eZ=i(12885),eC=i(69450),eR=i(18745),eI=i(89540);let eS={position:"relative",height:"100px",width:"100%",overflow:"auto",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},"&-ms-overflow-style:":{display:"none"}},ek={"img:hover":{opacity:"1 !important"}},eT=e=>({objectFit:"cover",borderRadius:"8px",transition:"all .3s ease-in-out",transform:e?"scale(1.15)":"",opacity:e?1:.8});function eO(e){let{onClick:t,className:i,prev:n}=e;return(0,a.jsx)(ev,{onClick:t,className:i,isPrev:n,arrowForwardIcon:eC.default,arrowBackIcon:eZ.default})}var eE=function(e){let{items:t,activeReviewIndex:i,onSlideChangeHandler:n}=e,r=(0,eR.Z)(),l=(0,eI.Z)(r.breakpoints.up("lg")),o=(0,p.useRef)(null),d=e=>()=>{n(e)};return(0,p.useEffect)(()=>{let e=document.getElementsByClassName("active-review-media")[0],t=e.offsetParent;if(e&&t){let i=(e.clientWidth+9.6)/2,n=t.clientWidth/2,r=e.offsetLeft+i-n;t.scrollTo({left:r,behavior:"smooth"})}},[i]),(0,a.jsxs)(c.Z,{direction:"row",justifyContent:"center",spacing:2,"data-testid":"media-list-carousel",children:[(0,a.jsx)(c.Z,{alignContent:"center",justifyContent:"center",children:(0,a.jsx)(eO,{onClick:()=>0===i?n(t.length-1):n(i-1),className:"previous",prev:!0})}),(0,a.jsx)(c.Z,{direction:"row",alignItems:"center",spacing:1.2,px:2,ref:o,sx:eS,children:t.map((e,t)=>{let n=t===i;
1return(0,a.jsx)(s.Z,{onClick:d(t),className:n?"active-review-media":"",sx:ek,"data-testid":"media-list-carousel-item",children:(0,a.jsx)(A(),{src:e.normal,blurDataURL:"/_next/image?url=".concat(e.normal,"&w=16&q=1"),alt:"Review media",height:l?56:70,width:l?56:70,style:eT(n),placeholder:"blur",quality:65,priority:!0})},e.normal)})}),(0,a.jsx)(c.Z,{alignContent:"center",justifyContent:"center",children:(0,a.jsx)(eO,{onClick:()=>i===t.length-1?n(0):n(i+1),className:"next",prev:!1})})]})},eP=function(e){let{items:t,activeReviewIndex:i,onClose:n}=e,[r,s]=(0,p.useState)(null);(0,p.useEffect)(()=>{s(i)},[i]);let l=e=>{"number"==typeof e&&s(e)},o="number"==typeof r;return 0===t.length?null:(0,a.jsx)(ed.Z,{fullScreen:!0,open:o,onClose:n,"data-testid":"reviews-media-gallery",children:(0,a.jsx)(ec.Z,{component:"main",maxWidth:ex.a,children:(0,a.jsxs)(c.Z,{height:"100vh",width:"100%",children:[(0,a.jsxs)(j.ZP,{wrap:"wrap-reverse",width:"100%",alignItems:"center",container:!0,p:2,children:[(0,a.jsx)(j.ZP,{xs:12,md:6,item:!0}),(0,a.jsx)(j.ZP,{xs:12,md:6,item:!0,children:(0,a.jsx)(c.Z,{justifyContent:{xs:"space-between",md:"flex-end"},direction:"row",alignItems:"center",spacing:2,children:(0,a.jsx)(eu.Z,{"aria-label":"close",onClick:n,children:(0,a.jsx)(eo.Z,{color:"primary"})})})})]}),"number"==typeof r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ey,{items:t,activeReviewIndex:r,onSlideChangeHandler:l}),(0,a.jsx)(eE,{items:t,activeReviewIndex:r,onSlideChangeHandler:l})]})]})})})},eD=function(e){let{productId:t}=e,[i,n]=(0,p.useState)(!1),[r,s]=(0,p.useState)(null),[l,o]=(0,p.useState)(null);(0,p.useEffect)(()=>{(async()=>{try{n(!0);let e=await g.Z.products.getProductReviewsOverview({productId:t}),i=function(e){if(!e)return null;let t=[e.ratingFive,e.ratingFour,e.ratingThree,e.ratingTwo,e.ratingOne],i=function(e){let{totalReviews:t,ratingGroups:i}=e;return i.map(e=>{var i;let n=e.reviewCount||0;return{rating:null!==(i=null==e?void 0:e.rating)&&void 0!==i?i:0,numberOfReviews:n,distributionPercentage:Math.round(t&&n?n/t*100:0)}})}({totalReviews:e.reviewCount||0,ratingGroups:t.map(e=>({rating:e.rating,reviewCount:e.reviewCount}))});return{reviewCount:e.reviewCount,images:e.images,rating:e.rating,ratingsDistribution:i}}(e);o(i)}catch(e){w.Z.error("[PRODUCT-REVIEWS-SECTION]: ".concat(e)),o(null)}finally{n(!1)}})()},[t]);let d=(0,p.useCallback)(e=>{s(e)},[]),c=(0,p.useCallback)(()=>{s(null)},[]);return i?(0,a.jsx)(m.Z,{sx:f}):l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eP,{items:(null==l?void 0:l.images)||[],activeReviewIndex:r,onClose:c}),(0,a.jsx)(el,{averageRating:(null==l?void 0:l.rating)||0,totalNumberOfReviews:(null==l?void 0:l.reviewCount)||0,ratingsDistribution:(null==l?void 0:l.ratingsDistribution)||[],media:(null==l?void 0:l.images)||[],onItemSelected:d})]}):null},eN=function(e){let{brand:t,model:i,productId:n}=e;return(0,a.jsxs)(s.Z,{"data-testid":"product-reviews-section",component:"section",id:"reviews",children:[(0,a.jsx)(s.Z,{mt:{xs:4,md:6},children:(0,a.jsx)(o.Z,{brand:t,model:i,title:"Reviews"})}),(0,a.jsx)(eD,{productId:n}),(0,a.jsx)(l.Z,{}),(0,a.jsx)(_,{productId:n})]})}}}]);
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.