module.exports=[547981,a=>{"use strict";var b=a.i(187924),c=a.i(876122),d=a.i(410148),e=a.i(716625),f=a.i(355232),g=a.i(653542),h=a.i(348251);a.s(["default",0,({type:a,typeId:i})=>{let j=(0,f.useT)(),{data:k}=(0,g.useQuery)(["groupRating",a,i],()=>h.reviewService.getGroupRating(a,i));return(0,b.jsxs)("div",{className:"grid grid-cols-4 gap-4",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("div",{className:"border border-gray-border dark:border-gray-bold rounded-2xl flex items-center justify-center flex-col flex-1",children:[(0,b.jsx)("strong",{className:"text-3xl font-bold",children:k?.avg||0}),(0,b.jsx)("span",{className:"text-xs font-medium text-center",children:j("total.rating")})]}),(0,b.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,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)("span",{className:"text-yellow",children:(0,b.jsx)(c.default,{})}),(0,b.jsx)("span",{className:"text-sm",children:k?.count||0})]}),(0,b.jsx)("span",{className:"text-xs font-medium",children:j("reviews")})]})]}),(0,b.jsx)("div",{className:"border border-gray-border dark:border-gray-bold  rounded-2xl col-span-3 p-5",children:(0,b.jsx)("div",{className:"flex flex-col gap-6",children:Array.from([,,,,,].keys()).map(a=>{let c=0;return k&&k.count&&0!==k.group[a+1]&&(c=Math.floor(k.group[a+1]/k.count*100)),(0,b.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,b.jsxs)("div",{className:"text-sm",children:[a+1," ",j("star")]}),(0,b.jsx)(e.default,{value:c,className:"flex-1",max:100,disabled:!0,renderTrack:(a,c)=>{let{key:e,...f}=a;return(0,b.jsx)("div",{...f,className:(0,d.default)(0===c.index&&c.value>0?"bg-yellow h-[14px] -translate-y-[5px] rounded-full ":"bg-gray-border dark:border-gray-bold h-1 rounded-r-full")},e)}}),(0,b.jsxs)("div",{className:"text-sm font-semibold w-4",children:[c,"%"]})]},a)})})})]})}])},716985,a=>{"use strict";var b=a.i(187924),c=a.i(221274),d=a.i(547981),e=a.i(462730),f=a.i(73486),g=a.i(348251),h=a.i(572131),i=a.i(350346);let j=({id:a})=>{let c=(0,f.useQueryClient)(),{mutate:d,isLoading:j}=(0,e.useMutation)({mutationFn:b=>g.reviewService.createReview("shops",a,{...b,type:"shop"}),onSuccess:()=>{c.invalidateQueries(["reviewList",String(a),"shops"]),c.invalidateQueries(["groupRating","shops",a]),c.setQueryData(["canReview","shop",a],a=>a?{...a,data:{ordered:!0,added_review:!0}}:{data:{ordered:!0,added_review:!0},message:"success",status:!0,timestamp:""})}}),k=(0,h.useCallback)(a=>{d(a)},[]);return(0,b.jsx)(i.default,{type:"shop",isProduct:!1,typeId:a,onSubmit:k,isSubmitting:j})};a.s([],38335),a.i(38335),a.s(["default",0,({id:a})=>(0,b.jsxs)("div",{className:"grid grid-cols-7 gap-7 mb-4 mt-2",children:[(0,b.jsx)("div",{className:"l:col-span-5 lg:col-span-4 col-span-7",children:(0,b.jsx)(c.default,{title:"reviews",type:"shops",id:a?.toString()})}),(0,b.jsxs)("div",{className:"lg:col-span-3 col-span-7 mb-8 md:mb-0",children:[(0,b.jsx)(d.default,{type:"shops",typeId:a}),(0,b.jsx)(j,{id:a})]})]})],716985)},521033,a=>{a.n(a.i(716985))}];

//# sourceMappingURL=app_%28store%29_%28booking%29_1ea0389e._.js.map