(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5929],{83120:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/reviews",function(){return a(53079)}])},53079:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return P},default:function(){return W}});var n=a(52322),i=a(53738),r=a(34638),s=a(9893),o=function(e){let t=(0,r.ff)("/assets/logos/beyond_menu_logo_dark_text.png","/assets/logos/beyond_menu_logo_light_text.png"),{imageWidth:a,imageHeight:o}=e;return(0,n.jsx)(i.xu,{...e,children:(0,n.jsx)(s.P,{"data-testid":"bm-logo",src:t,alt:"beyond menu logo",width:null!=a?a:130,height:null!=o?o:23})})},d=a(20343),l=a(93372),c=a(92086),m=a(11919),u=a(91012),g=a(81927),I=a(72033),h=a(85635),b=a(56133),p=a(50390),f=a(40110),y=a(90365),x=a(15824),k=a(20372),T=a(2784),v=a(5406),M=a(86230);let w=new Map,F=(e,t)=>{let[a,n]=(0,T.useState)(null),[i,r]=(0,T.useState)(!1),s=(0,T.useRef)(!1);return(0,T.useEffect)(()=>{if(!s.current)return;let a=new AbortController;return(async()=>{try{let i=w.get(e);if(i){let e=await i;n(e);return}r(!0);let s=await fetch("/api/restaurant/reviews",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({BusinessEntityID:e,BusinessEntityGUID:t}),signal:a.signal});if(!s.ok){let e=JSON.stringify({message:"Error fetching reviews",status:s.status});throw Error(e)}let o=(await s.json()).Reviews.filter(e=>e.ServiceRating>=4);w.set(e,o),n(o),r(!1)}catch(a){r(!1),a.name,(0,M.H)(a,"Error fetching reviews",{businessEntityId:e,businessEntityGUID:t})}})(),()=>{a.abort()}},[e,t]),(0,T.useEffect)(()=>{s.current=!0},[]),{reviews:a,loading:i}};var D=a(19013),N=a(4810),j=a(13882);function R(e,t){(0,j.Z)(1,arguments);var a,n,i=(0,D.Z)(e);if(isNaN(i.getTime()))throw RangeError("Invalid time value");var r=String(null!==(a=null==t?void 0:t.format)&&void 0!==a?a:"extended"),s=String(null!==(n=null==t?void 0:t.representation)&&void 0!==n?n:"complete");if("extended"!==r&&"basic"!==r)throw RangeError("format must be 'extended' or 'basic'");if("date"!==s&&"time"!==s&&"complete"!==s)throw RangeError("representation must be 'date', 'time', or 'complete'");var o="",d="",l="extended"===r?"-":"";if("time"!==s){var c=(0,N.Z)(i.getDate(),2),m=(0,N.Z)(i.getMonth()+1,2),u=(0,N.Z)(i.getFullYear(),4);o="".concat(u).concat(l).concat(m).concat(l).concat(c)}if("date"!==s){var g=i.getTimezoneOffset();if(0!==g){var I=Math.abs(g),h=(0,N.Z)(Math.floor(I/60),2),b=(0,N.Z)(I%60,2);d="".concat(g<0?"+":"-").concat(h,":").concat(b)}else d="Z";var p=(0,N.Z)(i.getHours(),2),f=(0,N.Z)(i.getMinutes(),2),y=(0,N.Z)(i.getSeconds(),2),x=""===o?"":"T",k=[p,f,y].join("extended"===r?":":"");o="".concat(o).concat(x).concat(k).concat(d)}return o}let S=[{BusinessEntityID:10001,OrderID:97730728,FirstName:"Michael",ServiceRating:5,ReviewNote:"They always make my order just the way I want it",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:["Tasty food","Great value"],MenuItemReviews:[{MenuItemName:"French Fries",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion"]},{MenuItemName:"Kung Pao Chicken",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion","Nice presentation"]}]},{BusinessEntityID:10001,OrderID:97011743,FirstName:"Michael",ServiceRating:4,ReviewNote:"Friendly and order is always correct!!",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:["Tasty food","Great value"],MenuItemReviews:[{MenuItemName:"Egg Roll (2)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion","Nice presentation"]}]},{BusinessEntityID:10001,OrderID:92225792,FirstName:"ANGELE",ServiceRating:4,ReviewNote:"Great portion and the food is very good too, especially the lo mein!!! Love this restaurant!",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:["Tasty food","Fast service","Great value"],MenuItemReviews:[{MenuItemName:"Shrimp Fried Rice",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Good Portion","Tasty"]},{MenuItemName:"Chicken Lo Mein",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion","Nice presentation"]},{MenuItemName:"Beef Broccoli",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion","Nice presentation"]}]},{BusinessEntityID:10001,OrderID:91387201,FirstName:"Ale",ServiceRating:4,ReviewNote:"Thanks So Much!!",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:["Tasty food","Fast service"],MenuItemReviews:[{MenuItemName:"Shrimp Fried Rice",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Good Portion","Tasty"]},{MenuItemName:"Shrimp Lo Mein",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"Side Steamed Broccoli",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Good Portion","Tasty"]},{MenuItemName:"Egg Roll (2)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion"]},{MenuItemName:"2 Liter Drink",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]}]},{BusinessEntityID:10001,OrderID:88775103,FirstName:"CheryL",ServiceRating:4,ReviewNote:"Food is delicious always fresh and delivered on time!",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:[],MenuItemReviews:[{MenuItemName:"House Wonton Soup",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion","Nice presentation"]},{MenuItemName:"Crispy Noodle",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion","Nice presentation"]}]},{BusinessEntityID:10001,OrderID:87504222,FirstName:"CheryL",ServiceRating:5,ReviewNote:"Food was hot and fresh as always.  Love this place.",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:[],MenuItemReviews:[{MenuItemName:"Fried Vegetable Spring Roll (2)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:[]},{MenuItemName:"House Wonton Soup",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:[]},{MenuItemName:"Orange Chicken",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Good Portion"]},{MenuItemName:"House Lo Mein",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Good Portion"]},{MenuItemName:"House Wonton Soup",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Good Portion"]},{MenuItemName:"Crispy Noodle",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:[]},{MenuItemName:"Pan Fried Dumplings (8)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:[]}]},{BusinessEntityID:10001,OrderID:87244766,FirstName:"james",ServiceRating:4,ReviewNote:"Good food at the right price!",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:["Tasty food","Fast service","Great value"],MenuItemReviews:[{MenuItemName:"Orange Chicken",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion"]},{MenuItemName:"Orange Chicken",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion"]},{MenuItemName:"Hunan Chicken",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion"]},{MenuItemName:"Steamed Dumplings (8)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion"]}]},{BusinessEntityID:10001,OrderID:85406238,FirstName:"Cheri",ServiceRating:4,ReviewNote:"Food is always hot and taste good.",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:[],MenuItemReviews:[{MenuItemName:"Pepper Steak",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"Hunan triple Delight",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"Happy Family",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"Egg Roll (2)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"BBQ Pork (Sliced Pork)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]}]},{BusinessEntityID:10001,OrderID:83653398,FirstName:"Melanie",ServiceRating:4,ReviewNote:"Love the food!",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:["Tasty food"],MenuItemReviews:[{MenuItemName:"Fried Biscuit (10)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"Cheese Puffs (8)",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"Chicken Lo Mein",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"Chicken Garlic Sauce",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]},{MenuItemName:"Sweet & Sour Chicken",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty"]}]},{BusinessEntityID:10001,OrderID:82342165,FirstName:"jerry",ServiceRating:5,ReviewNote:"This place is wonderful. service can be improved!",ReviewDateTime:R(new Date).replace("Z",""),OrderFeedbackTags:["Tasty food","Great value"],MenuItemReviews:[{MenuItemName:"Wonton Soup",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:[]},{MenuItemName:"Beef Noodle Soup",MenuItemFeedbackTypeID:1,MenuItemFeedbackTags:["Tasty","Good Portion","Nice presentation"]}]}].filter(e=>e.ServiceRating>=4),E=S.length,C=(S.reduce((e,t)=>e+t.ServiceRating,0)/E).toFixed(1);function G(){let e=(0,r.ff)("assets/icons/NoReviewsblock.svg","assets/icons/NoreviewsBlockDarkMode.svg");return(0,n.jsxs)(m.k,{"data-testid":"zero-state-reviews",flexDir:"column",alignContent:"center",justifyContent:"center",alignItems:"center",mb:8,children:[(0,n.jsx)(s.P,{src:e,width:73,height:73,alt:"star"}),(0,n.jsx)(u.x,{fontSize:"lg",fontWeight:"bold",mt:7,children:"NO REVIEWS"}),(0,n.jsx)(u.x,{fontSize:"sm",variant:"muted",children:"Be the first to leave us a review"})]})}function O(){let e=Array.from({length:3},(e,t)=>t);return(0,n.jsx)(n.Fragment,{children:e.map(e=>(0,n.jsx)(g.O,{borderRadius:"lg",maxWidth:"37.75rem",width:"full",startColor:"gray.100",endColor:"gray.200",minHeight:"7.75rem",mb:6},e))})}var P=!0,W=function(e){var t;let{initialReviews:a,rtData:g,isPreviewEnv:M}=e,w=(0,r.ff)("1px solid var(--gray-200, #E2E2E2)"," 1px solid var(--dm-gray-400, #434343)"),D=(0,r.ff)("white","black"),N=(0,k.S)({base:40,md:30},{fallback:"base"}),[j,R]=(0,T.useState)(g[0].businessEntityId),[S,P]=(0,T.useState)(g[0].businessEntityGUID),{reviews:W,loading:B}=F(j,S),_=g.map(e=>({label:e.name,value:{businessEntityId:e.businessEntityId,businessEntityGUID:e.businessEntityGUID}})),Z=null!=W?W:a,{ratingValue:H,ratingCount:L}=null!==(t=g.find(e=>e.businessEntityId===j))&&void 0!==t?t:{ratingValue:0,ratingCount:0},z=e=>{let{value:{businessEntityId:t,businessEntityGUID:a}}=e;R(t),P(a)},A=(0,l.GP)(e=>e.templateDefinition.reviews),X=(0,l.GP)(e=>e.restaurant),U="First time dining with ".concat(null==X?void 0:X.BusinessName,"? Check out what previous customers have to say.");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(v.c2,{}),(0,n.jsxs)(i.xu,{bg:(0,r.ff)("offWhite","black"),children:[g.length>1&&(0,n.jsx)(I.c,{above:"md",children:(0,n.jsx)(m.k,{px:6,justifyContent:"center",alignItems:"center",height:24,borderBottom:w,bg:D,children:(0,n.jsx)(h.a,{width:"full",onChange:z,options:_,value:_[0],"data-testid":"rt-select-mobile"})})}),(0,n.jsx)(m.k,{alignItems:"center",minHeight:{base:"4.75rem",md:"7rem"},height:"auto",py:{base:"0.75rem",lg:"0"},borderBottom:(0,r.ff)("1px solid var(--gray-200, #E2E2E2)"," 1px solid var(--dm-gray-400, #434343)"),bg:(0,r.ff)("white","black"),mb:{base:8,md:"3.75rem"},children:(0,n.jsxs)(b.W,{maxWidth:"1230px",marginInline:"auto",paddingInline:6,display:"flex",children:[(0,n.jsxs)(i.xu,{children:[(0,n.jsx)(p.X,{"data-testid":"reviews-heading",as:"h2",fontWeight:"bold",fontSize:{base:"2xl",md:"5xl"},children:(null==A?void 0:A.title)||"Reviews"}),(0,n.jsx)(u.x,{color:"grey",fontWeight:600,children:(null==A?void 0:A.subtitle)||U})]}),g.length>1&&(0,n.jsx)(I.c,{below:"md",children:(0,n.jsx)(h.a,{marginLeft:"auto",alignSelf:"center",onChange:z,options:_,value:_[0],"data-testid":"rt-select"})})]})}),(0,n.jsxs)(b.W,{maxWidth:"604px",height:"auto",overflow:"auto",children:[B&&(0,n.jsx)(O,{}),!B&&0===Z.length&&(0,n.jsx)(G,{}),!B&&Z.length>0&&(0,n.jsxs)(m.k,{marginBottom:6,flexDir:"column",alignContent:"center",justifyContent:"center",alignItems:{base:"center",md:"flex-start"},children:[(0,n.jsxs)(m.k,{width:"full",justifyContent:"space-between",alignItems:"flex-end",children:[(0,n.jsxs)(m.k,{flexDir:"column",children:[(0,n.jsxs)(m.k,{gap:2,children:[(0,n.jsx)(p.X,{"data-testid":"rating-value-label",as:"h2",fontSize:{base:"6xl",md:"2.375rem"},fontWeight:"bold",children:M?C:H}),(0,n.jsx)(s.P,{src:"/assets/OverallRating.svg",width:N,height:N,alt:"star"})]}),(0,n.jsx)(u.x,{variant:"muted",fontSize:"sm",fontWeight:"medium",children:"OVERALL RATING"}),(0,n.jsxs)(u.x,{variant:"muted",fontSize:"xs",fontWeight:"medium","data-testid":"rating-count-label",children:[M?E:L,"+ ratings"]})]}),(0,n.jsxs)(m.k,{flexDir:"column",alignItems:"flex-start",justifyContent:"flex-end",children:[(0,n.jsx)(u.x,{variant:"muted",alignSelf:"flex-end",children:"Reviews powered by"}),(0,n.jsx)(o,{imageWidth:160,imageHeight:24,mr:-3})]})]}),(0,n.jsx)(f.i,{}),(0,n.jsx)(m.k,{flexDir:"column",gap:{base:4,md:6},w:"full",children:Z.map(e=>(0,n.jsx)(T.Fragment,{children:(0,n.jsx)(y.a,{...e,ReviewDateTime:(0,c.Z)(new Date(e.ReviewDateTime),"MM/dd/yyyy")})},e.ReviewDateTime))})]})]}),(0,n.jsx)(x.d,{below:"md",children:(0,n.jsx)(d.h,{})})]}),(0,n.jsx)(v.GN,{})]})}},90365:function(e,t,a){"use strict";a.d(t,{a:function(){return m}});var n=a(34638),i=a(11919),r=a(91012),s=a(12374),o=a(53738),d=a(86656),l=a(52322),c=Array.from({length:5},(e,t)=>t),m=function(e){let{FirstName:t,ReviewDateTime:a,ReviewNote:m,ServiceRating:u,OrderFeedbackTags:g}=e,I=(0,n.ff)("white","gray.dark.600"),h=(0,n.ff)("black","white"),b=(0,n.ff)("gray.300","gray.dark.300"),p=(0,n.ff)("black","white"),f=(0,n.ff)("gray.400","gray.dark.300"),y=(0,n.ff)("https://ik.imagekit.io/awwybhhmo/assets/icons/star-outline-black.svg?ik-sdk-version=javascript-1.4.3&updatedAt=1675881710870","https://ik.imagekit.io/awwybhhmo/assets/icons/star-outline-white.svg?ik-sdk-version=javascript-1.4.3&updatedAt=1675881710842"),x=(0,n.ff)("gray.100","gray.dark.400");return(0,l.jsx)(i.k,{boxShadow:"base",bg:I,borderColor:x,borderWidth:"1px",borderRadius:"lg",maxWidth:"37.75rem",width:"full",children:(0,l.jsxs)(i.k,{width:"95%",display:"column",margin:6,children:[(0,l.jsxs)(i.k,{justifyContent:"space-between",marginBottom:1.5,width:"100%",children:[(0,l.jsx)(r.x,{color:h,fontWeight:"medium",fontSize:"md",lineHeight:"1.2rem",children:t}),(0,l.jsx)(r.x,{color:b,fontWeight:"normal",fontSize:"sm",lineHeight:"normal",children:a})]}),(0,l.jsx)(i.k,{marginLeft:.5,children:c.map(e=>u>e?(0,l.jsx)(d.r7,{marginRight:"0.32rem",width:".8rem",color:p,"data-testid":"filled"},e):(0,l.jsx)(s.E,{title:"unfilled",src:y,alt:"unfilled star rating"},e))}),(0,l.jsx)(r.x,{marginTop:".691rem",fontWeight:"normal",color:f,fontSize:"sm",width:"100%",lineHeight:"1.4rem",mb:5,children:m}),(0,l.jsx)(i.k,{gap:2,flexWrap:"wrap",children:g.map(e=>(0,l.jsx)(o.xu,{rounded:15,border:"1px solid #ccc",px:4,py:1,children:(0,l.jsx)(r.x,{children:e})},e))})]})})}},85635:function(e,t,a){"use strict";a.d(t,{a:function(){return c}});var n=a(86656),i=a(34638),r=a(53738),s=a(91012),o=a(40110),d=a(2784),l=a(52322);function c(e){let{onChange:t,value:a,options:c,defaultLabel:m="Select","data-testid":u,isDisabled:g,...I}=e,[h,b]=(0,d.useState)(!1),p=(0,i.ff)("gray.200","gray.dark.400"),f=(0,i.ff)("black","white"),y=(0,i.ff)("white","gray.dark.500"),x=(0,i.ff)("gray.200","gray.dark.600"),k=(null==a?void 0:a.label)||m,T=e=>{t(e),b(!1)};return(0,l.jsxs)(r.xu,{className:"wrapper",w:80,h:"48px",borderRadius:h?"6px 6px 0 0":"md",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:h?f:p,_hover:{borderColor:f,boxShadow:"0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06)"},bg:y,transition:"300ms ease all",style:g?{pointerEvents:"none",opacity:"0.4"}:{},...I,children:[(0,l.jsxs)(r.xu,{display:"flex",alignItems:"center",className:"input-placeholder",borderRadius:h?"6px 6px 0 0":"md",h:"100%",onClick:()=>b(!h),backgroundColor:h?y:"transparent",pl:4,pr:3,children:[(0,l.jsx)(s.x,{className:"label","data-testid":u||"",fontSize:"18px",flexGrow:1,children:k}),(0,l.jsxs)(s.x,{className:"icon",fontSize:"25px",children:[!h&&(0,l.jsx)(n.v4,{}),h&&(0,l.jsx)(n.g8,{})]})]}),h&&(0,l.jsx)(r.xu,{zIndex:1e3,className:"menu",borderWidth:"1px",borderStyle:"solid",borderColor:f,boxShadow:"0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:"0 0 12px 12px",ml:"-1px",w:"calc(100% + 2px)",position:"absolute",cursor:"pointer",maxHeight:"300px",overflowY:"auto",overflowX:"hidden",backgroundColor:y,children:null==c?void 0:c.map((e,t)=>(0,l.jsxs)("div",{"data-testid":"".concat(u,"-option-").concat(t),children:[(0,l.jsx)(s.x,{className:"menu-item",height:"52px",p:4,display:"flex",flexDirection:"column",justifyContent:"center",backgroundColor:e.value===(null==a?void 0:a.value)?x:y,fontSize:"18px",_hover:{fontWeight:"700",backgroundColor:x},onClick:()=>T(e),children:e.label}),t<c.length-1&&(0,l.jsx)(o.i,{opacity:1,my:0,mx:4})]},e.label))})]})}}},function(e){e.O(0,[6525,4424,8092,9097,1904,679,243,9414,5195,9577,8922,3474,9919,7188,655,5319,343,2888,9774,179],function(){return e(e.s=83120)}),_N_E=e.O()}]);