(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,931562,e=>{"use strict";var s=e.i(843476),r=e.i(940574),a=e.i(102305),l=e.i(951700),t=e.i(447128),d=e.i(191437),i=e.i(699492);e.s(["default",0,({type:e,typeId:o})=>{let c=(0,t.useT)(),{data:n}=(0,d.useQuery)(["groupRating",e,o],()=>i.reviewService.getGroupRating(e,o));return(0,s.jsxs)("div",{className:"grid grid-cols-4 gap-4",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"border border-gray-border dark:border-gray-bold rounded-2xl flex items-center justify-center flex-col flex-1",children:[(0,s.jsx)("strong",{className:"text-3xl font-bold",children:n?.avg||0}),(0,s.jsx)("span",{className:"text-xs font-medium text-center",children:c("total.rating")})]}),(0,s.jsxs)("div",{className:"border border-gray-border dark:border-gray-bold  rounded-2xl flex items-center gap-2 justify-center py-7 flex-wrap",children:[(0,s.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("span",{className:"text-yellow",children:(0,s.jsx)(r.default,{})}),(0,s.jsx)("span",{className:"text-sm",children:n?.count||0})]}),(0,s.jsx)("span",{className:"text-xs font-medium",children:c("reviews")})]})]}),(0,s.jsx)("div",{className:"border border-gray-border dark:border-gray-bold  rounded-2xl col-span-3 p-5",children:(0,s.jsx)("div",{className:"flex flex-col gap-6",children:Array.from([,,,,,].keys()).map(e=>{let r=0;return n&&n.count&&0!==n.group[e+1]&&(r=Math.floor(n.group[e+1]/n.count*100)),(0,s.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,s.jsxs)("div",{className:"text-sm",children:[e+1," ",c("star")]}),(0,s.jsx)(l.default,{value:r,className:"flex-1",max:100,disabled:!0,renderTrack:(e,r)=>{let{key:l,...t}=e;return(0,s.jsx)("div",{...t,className:(0,a.default)(0===r.index&&r.value>0?"bg-yellow h-[14px] -translate-y-[5px] rounded-full ":"bg-gray-border dark:border-gray-bold h-1 rounded-r-full")},l)}}),(0,s.jsxs)("div",{className:"text-sm font-semibold w-4",children:[r,"%"]})]},e)})})})]})}])},892946,e=>{"use strict";var s=e.i(843476),r=e.i(493515),a=e.i(931562),l=e.i(653480),t=e.i(807939),d=e.i(699492),i=e.i(271645),o=e.i(819213);let c=({id:e})=>{let r=(0,t.useQueryClient)(),{mutate:a,isLoading:c}=(0,l.useMutation)({mutationFn:s=>d.reviewService.createReview("shops",e,{...s,type:"shop"}),onSuccess:()=>{r.invalidateQueries(["reviewList",String(e),"shops"]),r.invalidateQueries(["groupRating","shops",e]),r.setQueryData(["canReview","shop",e],e=>e?{...e,data:{ordered:!0,added_review:!0}}:{data:{ordered:!0,added_review:!0},message:"success",status:!0,timestamp:""})}}),n=(0,i.useCallback)(e=>{a(e)},[]);return(0,s.jsx)(o.default,{type:"shop",isProduct:!1,typeId:e,onSubmit:n,isSubmitting:c})};e.s([],914612),e.i(914612),e.s(["default",0,({id:e})=>(0,s.jsxs)("div",{className:"grid grid-cols-7 gap-7 mb-4 mt-2",children:[(0,s.jsx)("div",{className:"l:col-span-5 lg:col-span-4 col-span-7",children:(0,s.jsx)(r.default,{title:"reviews",type:"shops",id:e?.toString()})}),(0,s.jsxs)("div",{className:"lg:col-span-3 col-span-7 mb-8 md:mb-0",children:[(0,s.jsx)(a.default,{type:"shops",typeId:e}),(0,s.jsx)(c,{id:e})]})]})],892946)},844253,e=>{e.n(e.i(892946))}]);