1 line
21 KiB
JavaScript
1 line
21 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[9297],{47659:(e,r,i)=>{i.d(r,{A:()=>d});var n=i(89379),s=i(48089),t=i(50704),l=i(16491),o=i(82053),c=i(60899),a=i(44414);const d=e=>{let{primary:r,secondary:i,percentage:d,color:x,sx:p}=e;return(0,a.jsx)(s.A,{elevation:0,sx:(0,n.A)({background:x,position:"relative",color:"#fff","&:hover svg":{opacity:1,transform:"scale(1.1)"}},p),children:(0,a.jsxs)(t.A,{children:[(0,a.jsx)(l.A,{sx:{position:"absolute",right:15,top:25,color:"#fff","& svg":{width:36,height:36,opacity:.5,transition:"all .3s ease-in-out"}},children:(0,a.jsx)(o.A,{variant:"h2",color:"inherit",sx:{fontSize:{xs:20,md:25}},children:d&&"number"===typeof d?"".concat(d.toString()," %"):d})}),(0,a.jsxs)(c.Ay,{container:!0,spacing:0,children:[(0,a.jsx)(c.Ay,{item:!0,xs:12,children:(0,a.jsx)(o.A,{variant:"h3",color:"inherit",sx:{fontSize:{xs:16,md:20}},children:i})}),(0,a.jsx)(c.Ay,{item:!0,xs:12,children:(0,a.jsx)(o.A,{variant:"subtitle2",color:"inherit",children:r})})]})]})})}},62217:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD4AAAA+CAYAAABzwahEAAAPnUlEQVR4AdVae3AU9R3/7d4jdyGQQKAhECBAJBSmEAtFSQUjqPgAHGlhRm0lDkWY6Tg+O9qiErR26h8WR8ZWqTMN1ur4qMpDrTyjtDwDJloeCYiBvAgkaZ53l7vb3X4/v9vfZS/Zu9uFwLSfmb3d293f7u/z+z5/399K7CphdW5JrupgBZosZ0ialmu8pklSjUOTamRJbvvjqTUV7CpAYlcIj+SWZHQ55WJZlm7UNK2IXpRhpZ3GWJskSWXUZrPD4Sp77eSva9gVwIATXz35+SJNYWs1phWxAYDEpDKVaZv+fOrZUjaAGDDiK695rpgetpYOc82upw72sM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KSOjDFDIEtLmSRb1LUR94/dZeY+tVROoPDaQo1TQTS9PoSlfik4cA0B9c7mpc1z6GAByghISoZkjivI8MuVRjqEjU52DRuossXir+UJdFHcCXfW+b09VtR9tMnReoefxNJqeCbsF6R7KygL03B56N8/OWK/3tkTaNnHWa/M8zrNIru8iOik0GeADQGHFTabh0q85qL/8Kwu0xSBgTwPB6BiLGMZn83SZzmuQMAhTWz5voEeGoNcgTtWUHiqW8OO8vLww+R5lz5494UT2PBDEY9rSQqOTHAmP91TFdNGChJsyPTdlelztqcMu6i+XvNiIkBQRHlcPHGv6sUbHIKzo56J1AZBkvR5cSFhUVBR2CbD69bIpysvLecdoAHqINOytm0ijJt9J3r+TVBLHXfrGkwsiJRIMLF1i76MBEue7qE0XqTPadYiNnFen3j6Ad5HGYSDwTcslkQYGamVULLrLpH7y6dOnuY1TGctFFR0hcYfhvujinQ6eaNBgYc6sEHm+0WAKqatEWJkwYYI6depUjYhbtuWrBW775GGd1FEXFQA8FFsR8+HRMdFBKocgPrTvRkgnh4l70ijPxtwAzpLnCLpDvSztvFqQ9C8PuAPEINDeTdpgjADYjOFQhESn3s6hP+OKr9dfSUhCaiIcYjNIMur52f850f95/BfoYlARf1CQvwAAAABJRU5ErkJggg=="},89297:(e,r,i)=>{i.r(r),i.d(r,{default:()=>G});var n=i(89379),s=i(93230),t=i(83274),l=i(25333),o=i(82053),c=i(82223),a=i(55158),d=i(60899),x=i(1320),p=i(15769),h=i(69780),A=i(9213),m=i(21671),j=i(34075),u=i(25277),y=i(74745),g=i(77922),v=i(29925),f=i(9950),k=i(14857),b=i(28429),S=i(4159),Y=i.n(S),C=i(50027),W=i(63189),z=i(81425),D=i(20466),R=i(36150),J=i(51778),T=i(52351),w=i(94826),M=i(13838),K=i(47659),P=i(65913),F=i(31222),Z=i(43302),N=i(99324),B=i(44414),L=i(36220);Y().extend(L);const G=()=>{var e,r,i,S,L,G,H;const E=(0,k.A)(),I=(0,b.Zp)(),q=(0,b.zy)();console.log("location.state",q.state);const[O,V]=(0,f.useState)(null),[U,Q]=(0,f.useState)(null),[X,_]=(0,f.useState)([]),[$,ee]=(0,f.useState)(!1),re=null===(e=q.state)||void 0===e?void 0:e.deliverylist,ie=null===(r=q.state)||void 0===r?void 0:r.zoneData,ne=null===(i=q.state)||void 0===i?void 0:i.metaData,se=null===(S=q.state)||void 0===S?void 0:S.riderToken,te=null===(L=q.state)||void 0===L?void 0:L.appId,le=null===(G=q.state)||void 0===G?void 0:G.aiMode,oe=null===(H=q.state)||void 0===H?void 0:H.reassignOrders;(0,f.useEffect)((()=>{console.log("aiMode",le),console.log("riderToken",se),console.log("zoneData",ie),console.log("metaData",ne),console.log("reassignOrders",oe)}),[]),(0,f.useEffect)((()=>{if(null===re||void 0===re||!re.length)return;const e=re.map((e=>{const r=Number(e.cumulativekms||0),i=Number(e.minkm||0),s=Number(e.baseprice||0),t=Number(e.priceperkm||0);return r<=i?(0,n.A)((0,n.A)({},e),{},{deliveryamt:s}):(0,n.A)((0,n.A)({},e),{},{deliveryamt:(r-i)*t+s})}));_(e),console.log("finaldeliveryList",e)}),[re]);const{data:ce=[],isLoading:ae,isError:de,error:xe}=(0,R.I)({queryKey:["paymentmodes"],queryFn:z.HY}),{data:pe=[],isLoading:he,isError:Ae,error:me,refetch:je}=(0,R.I)({queryKey:["ridersList",te],queryFn:z.Sd,enabled:0!==te}),ue=(0,J.n)({mutationFn:z.k3,onSuccess:()=>{(0,D.k)("Notification sent Successfully","success",2e3)},onError:e=>{(0,D.k)(e.message,"error",2e3)}}),ye=(0,J.n)({mutationFn:z.H2,onSuccess:(e,r)=>{console.log("data",e),console.log("varialbles",r),ue.mutate(O.userfcmtoken||se),"accepted"==e.status&&(0,D.k)("Delivery Created Successfully","success",2e3),setTimeout((()=>{ee(!1),I("/nearle/deliveries")}),2e3)},onError:e=>{(0,D.k)(e.message,"error",4e3)}});return(0,B.jsxs)(C.A,{content:!1,title:(0,B.jsxs)(s.A,{direction:"row",alignItems:"center",spacing:1,sx:{ml:1},children:[(0,B.jsxs)(t.A,{title:"Back to orders",placement:"top",children:[(0,B.jsx)(l.A,{onClick:()=>I("/nearle/orders"),sx:{backgroundColor:"action.hover",color:"text.primary","&:hover":{backgroundColor:"action.selected"}},children:(0,B.jsx)(N.eQE,{size:22})})," "]}),(0,B.jsx)(o.A,{sx:{m:2},variant:"h3",children:"Assign Orders"})]}),secondary:(0,B.jsx)(c.A,{sx:{m:2},color:"primary",variant:"contained",startIcon:(0,B.jsx)(W.A,{}),children:"Re-Assign"}),children:[(ae||he||$)&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(T.A,{}),(0,B.jsx)(w.A,{})]}),(0,B.jsx)(a.A,{sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:ae||he||$,children:(0,B.jsx)(w.A,{color:"inherit"})}),1==le&&(0,B.jsx)(s.A,{sx:{m:2},children:(0,B.jsxs)(d.Ay,{container:!0,spacing:2,children:[(0,B.jsx)(d.Ay,{item:!0,xs:12,sm:3,children:(0,B.jsx)(K.A,{secondary:null===ne||void 0===ne?void 0:ne.total_orders,primary:"Orders",percentage:(0,B.jsx)(P.A,{}),color:E.palette.success.main,sx:{cursor:"pointer"}})}),(0,B.jsx)(d.Ay,{item:!0,xs:12,sm:3,children:(0,B.jsx)(K.A,{secondary:null===ne||void 0===ne?void 0:ne.total_riders,primary:"Riders",percentage:(0,B.jsx)(F.bsz,{}),color:E.palette.warning.main})}),(0,B.jsx)(d.Ay,{item:!0,xs:12,sm:3,children:(0,B.jsx)(K.A,{secondary:null===ie||void 0===ie?void 0:ie.length,primary:"Zones",percentage:(0,B.jsx)(Z.us2,{}),color:E.palette.info.main})}),(0,B.jsx)(d.Ay,{item:!0,xs:12,sm:3,children:(0,B.jsx)(K.A,{secondary:null===ie||void 0===ie?void 0:ie.length,primary:"Kilometer",percentage:(0,B.jsx)(Z.us2,{}),color:E.palette.error.main})})]})}),(0,B.jsx)(x.A,{sx:{maxHeight:"calc(100vh - 250px)",overflow:"auto","&::-webkit-scrollbar":{width:"12px",cursor:"pointer"},"&::-webkit-scrollbar-thumb":{backgroundColor:E.palette.primary.main,borderRadius:"8px",cursor:"pointer"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:E.palette.primary.dark,cursor:"pointer"},"&::-webkit-scrollbar-track":{backgroundColor:E.palette.primary.lighter,cursor:"pointer"}},children:(0,B.jsxs)(p.A,{stickyHeader:!0,children:[(0,B.jsx)(h.A,{children:(0,B.jsxs)(A.A,{sx:{backgroundColor:"red"},children:[(0,B.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"#"}),1==le&&(0,B.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Zone "}),(0,B.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Tenant "}),(0,B.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"order Location"}),(0,B.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Pickup "}),(0,B.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Delivery"}),(0,B.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Notes"}),1==le&&(0,B.jsx)(m.A,{sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Rider"}),(0,B.jsx)(m.A,{align:"center",sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Type"}),(0,B.jsx)(m.A,{align:"center",sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Profit"}),(0,B.jsx)(m.A,{align:"center",sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"Charges"}),(0,B.jsx)(m.A,{align:"center",sx:{position:"sticky !important",backgroundColor:E.palette.secondary.light},children:"KMS"})]})}),(0,B.jsxs)(j.A,{children:[0==(null===X||void 0===X?void 0:X.length)&&(0,B.jsx)(A.A,{children:(0,B.jsx)(m.A,{colSpan:10,children:(0,B.jsx)(M.A,{})})}),X&&1==le?null===X||void 0===X?void 0:X.map(((e,r)=>(0,B.jsx)(f.Fragment,{children:(0,B.jsxs)(A.A,{sx:{},children:[(0,B.jsx)(m.A,{children:(0,B.jsxs)(o.A,{children:[" ",r+1]})}),1==le&&(0,B.jsx)(m.A,{children:(0,B.jsx)(u.A,{color:"primary",label:e.zone_name})}),(0,B.jsx)(m.A,{children:(0,B.jsxs)(t.A,{title:e.tenantaddress,children:[(0,B.jsx)(o.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,B.jsxs)(o.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,B.jsx)("br",{})]}),(0,B.jsx)(o.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,B.jsxs)(m.A,{align:"left",children:[(0,B.jsx)(t.A,{title:e.locationaddress,placement:"top",children:(0,B.jsx)(o.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,B.jsx)(t.A,{title:"Order Id",children:(0,B.jsx)(o.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,B.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,B.jsxs)(t.A,{title:"Ordered date",children:[(0,B.jsx)(o.A,{noWrap:!0,sx:{fontSize:"12px"},children:Y()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,B.jsx)(o.A,{noWrap:!0,sx:{fontSize:"11px"},children:Y()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,B.jsxs)(t.A,{title:"Delivery date",children:[(0,B.jsx)(o.A,{noWrap:!0,sx:{fontSize:"12px"},children:Y()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,B.jsx)(o.A,{noWrap:!0,sx:{fontSize:"11px"},children:Y()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,B.jsx)(m.A,{align:"left",children:(0,B.jsx)(s.A,{direction:"row",spacing:1,children:(0,B.jsxs)(s.A,{direction:"column",children:[(0,B.jsx)(o.A,{variant:"caption",children:e.pickupcustomer}),(0,B.jsx)(o.A,{variant:"caption",children:e.pickupcontactno}),(0,B.jsx)(t.A,{title:e.pickupaddress,children:(0,B.jsx)(o.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,B.jsx)(m.A,{align:"left",children:(0,B.jsx)(s.A,{direction:"row",spacing:1,children:(0,B.jsxs)(s.A,{direction:"column",children:[(0,B.jsx)(o.A,{variant:"caption",children:e.deliverycustomer}),(0,B.jsx)(o.A,{variant:"caption",children:e.deliverycontactno}),(0,B.jsx)(t.A,{title:e.deliveryaddress,children:(0,B.jsx)(o.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,B.jsx)(m.A,{align:"left",children:e.ordernotes}),1==le&&(0,B.jsxs)(m.A,{align:"left",children:[(0,B.jsx)(o.A,{sx:{whiteSpace:"nowrap"},children:e.username}),(0,B.jsxs)(o.A,{children:["ID : ",e.userid]})]}),(0,B.jsx)(m.A,{align:"center",children:(0,B.jsx)(u.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary"})}),(0,B.jsx)(m.A,{align:"center",children:(0,B.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,B.jsx)(t.A,{title:"Charges",placement:"top",children:(0,B.jsx)(u.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,B.jsx)(t.A,{title:"Amount",placement:"left",children:(0,B.jsx)(u.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,B.jsx)(m.A,{align:"center",children:(0,B.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,B.jsx)(t.A,{title:"KMS",placement:"top",children:(0,B.jsx)(u.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,B.jsx)(t.A,{title:"Cumulative Kms",placement:"right",children:(0,B.jsx)(u.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},r))):null===X||void 0===X?void 0:X.map(((e,r)=>(0,B.jsx)(f.Fragment,{children:(0,B.jsxs)(A.A,{sx:{},children:[(0,B.jsx)(m.A,{children:(0,B.jsxs)(o.A,{children:[" ",r+1]})}),(0,B.jsx)(m.A,{children:(0,B.jsxs)(t.A,{title:e.tenantaddress,children:[(0,B.jsx)(o.A,{variant:"body1",noWrap:!0,children:e.tenantname}),(0,B.jsxs)(o.A,{noWrap:!0,sx:{fontSize:"11px"},children:[e.tenantsuburb,(0,B.jsx)("br",{})]}),(0,B.jsx)(o.A,{noWrap:!0,variant:"body2",children:e.applocation})]})}),(0,B.jsxs)(m.A,{align:"left",children:[(0,B.jsx)(t.A,{title:e.locationaddress,placement:"top",children:(0,B.jsx)(o.A,{variant:"body1",noWrap:!0,children:"".concat(e.locationname,"-(").concat(e.locationsuburb,")")})}),(0,B.jsx)(t.A,{title:"Order Id",children:(0,B.jsx)(o.A,{variant:"body2",noWrap:!0,children:e.orderid})}),(0,B.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:3,children:[(0,B.jsxs)(t.A,{title:"Ordered date",children:[(0,B.jsx)(o.A,{noWrap:!0,sx:{fontSize:"12px"},children:Y()(e.orderdate).utc().format("DD/MM/YYYY")}),(0,B.jsx)(o.A,{noWrap:!0,sx:{fontSize:"11px"},children:Y()(e.orderdate).utc().format("hh:mm A")})]}),"-",(0,B.jsxs)(t.A,{title:"Delivery date",children:[(0,B.jsx)(o.A,{noWrap:!0,sx:{fontSize:"12px"},children:Y()(e.deliverydate).utc().format("DD/MM/YYYY")}),(0,B.jsx)(o.A,{noWrap:!0,sx:{fontSize:"11px"},children:Y()(e.deliverydate).utc().format("hh:mm A")})]})]})]}),(0,B.jsx)(m.A,{align:"left",children:(0,B.jsx)(s.A,{direction:"row",spacing:1,children:(0,B.jsxs)(s.A,{direction:"column",children:[(0,B.jsx)(o.A,{variant:"caption",children:e.pickupcustomer}),(0,B.jsx)(o.A,{variant:"caption",children:e.pickupcontactno}),(0,B.jsx)(t.A,{title:e.pickupaddress,children:(0,B.jsx)(o.A,{variant:"caption",children:e.pickupsuburb||e.pickupaddress.slice(0,20)})})]})})}),(0,B.jsx)(m.A,{align:"left",children:(0,B.jsx)(s.A,{direction:"row",spacing:1,children:(0,B.jsxs)(s.A,{direction:"column",children:[(0,B.jsx)(o.A,{variant:"caption",children:e.deliverycustomer}),(0,B.jsx)(o.A,{variant:"caption",children:e.deliverycontactno}),(0,B.jsx)(t.A,{title:e.deliveryaddress,children:(0,B.jsx)(o.A,{variant:"caption",children:e.deliverysuburb||e.deliveryaddress.slice(0,20)})})]})})}),(0,B.jsx)(m.A,{align:"left",children:e.ordernotes}),(0,B.jsx)(m.A,{align:"center",children:(0,B.jsx)(u.A,{size:"small",label:e.ordertype,color:"Economy"==e.ordertype?"success":"Risky"==e.ordertype?"error":"primary"})}),(0,B.jsx)(m.A,{align:"center",children:(0,B.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,B.jsx)(t.A,{title:"Charges",placement:"top",children:(0,B.jsx)(u.A,{size:"small",label:"\u20b9 ".concat(e.deliverycharge.toFixed(2)," "),color:"error"})}),(0,B.jsx)(t.A,{title:"Amount",placement:"left",children:(0,B.jsx)(u.A,{size:"small",label:"\u20b9 ".concat(e.deliveryamt.toFixed(2)," "),color:"success"})})]})}),(0,B.jsx)(m.A,{align:"center",children:(0,B.jsxs)(s.A,{display:"flex",flexDirection:"column",gap:1,sx:{cursor:"pointer"},children:[(0,B.jsx)(t.A,{title:"KMS",placement:"top",children:(0,B.jsx)(u.A,{size:"small",label:"".concat(e.kms," km"),color:"error"})}),(0,B.jsx)(t.A,{title:"Cumulative Kms",placement:"right",children:(0,B.jsx)(u.A,{size:"small",label:"".concat(e.cumulativekms," km"),color:"success"})})]})})]})},r)))]})]})}),(0,B.jsx)(y.A,{}),0==le&&(0,B.jsxs)(d.Ay,{container:!0,spacing:2,sx:{p:2},children:[(0,B.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsx)(g.A,{id:"free-solo-demo",options:ce,renderInput:e=>(0,B.jsx)(v.A,(0,n.A)((0,n.A)({},e),{},{label:"Choose Payment"})),onChange:(e,r,i)=>{if("clear"!==i){if(r){console.log("Selected:",r),Q(r);const e=null===X||void 0===X?void 0:X.map((e=>(0,n.A)((0,n.A)({},e),{},{paymenttype:r.apptypeid})));_(e)}}else Q(null)}})}),(0,B.jsx)(d.Ay,{item:!0,xs:12,sm:6,children:(0,B.jsx)(g.A,{id:"free-solo-demo",options:pe,renderInput:e=>(0,B.jsx)(v.A,(0,n.A)((0,n.A)({},e),{},{label:"Choose Rider"})),onChange:(e,r,i)=>{if("clear"!==i){if(r){V(r),console.log("Selected:",r);const e=null===X||void 0===X?void 0:X.map((e=>(0,n.A)((0,n.A)({},e),{},{userid:r.userid,userfcmtoken:r.userfcmtoken})));_(e)}}else V(null)}})})]}),(0,B.jsx)(y.A,{}),(0,B.jsxs)(s.A,{display:"flex",flexDirection:"row",gap:2,alignItems:"center",justifyContent:"end",sx:{p:2},children:[(0,B.jsx)(c.A,{sx:{},variant:"contained",color:"secondary",startIcon:(0,B.jsx)(W.A,{}),onClick:()=>{I("/nearle/orders")},children:"Back"}),(0,B.jsx)(c.A,{sx:{my:2},variant:"contained",disabled:0===le&&(!O||!U),onClick:async()=>{ee(!0),ye.mutate({deliveries:X})},children:"Assign Orders"})]})]})}},94826:(e,r,i)=>{i.d(r,{A:()=>a});var n=i(59254),s=i(46639),t=i(62217),l=i(44414);const o=(0,n.Ay)("div")((()=>({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:2001,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255, 255, 255, 0.7)",padding:"20px",borderRadius:"10px"}))),c=(0,n.Ay)("div")((()=>({position:"absolute",width:"40px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center"}))),a=()=>(0,l.jsxs)(o,{children:[(0,l.jsx)(s.A,{color:"primary",size:80,thickness:6}),(0,l.jsx)(c,{children:(0,l.jsx)("img",{src:t,alt:"Logo",style:{width:"100%",height:"100%"}})})]})}}]); |