Sindbad~EG File Manager

Current Path : /home/infinitibizsol/www/auction-flow.com/static/js/
Upload File :
Current File : /home/infinitibizsol/www/auction-flow.com/static/js/579.a7893775.chunk.js

"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[579],{7579:(e,i,t)=>{t.r(i),t.d(i,{default:()=>V});var n=t(5043),o=t(9252),l=t(8911),s=t(5865),a=t(8977),r=t(688),c=t(2143),d=(t(7643),t(3216)),u=t(9456),h=t(1036),v=t(1551),p=t(4535),m=(t(3338),t(7550),t(6657),t(3568),t(7858),t(579));(0,p.Ay)("img")({top:0,width:"100%",height:"80%",objectFit:"contain",position:"absolute"}),(0,p.Ay)("img")({top:"100%",right:0,transform:"translate(0%, -100%)",width:"100%",height:"50%",objectFit:"contain",position:"absolute"}),(0,v.A)({root:{minWidth:400,height:150}});var x=t(5660),g=t(6187),j=t(8903),A=t(6446),y=t(8446),b=t(3217),f=t(9588),w=t(2812),_=t(9907),k=t(5565);const I=(0,p.Ay)("img")({top:0,width:"100%",height:"60%",objectFit:"contain",position:"absolute"}),C=(0,v.A)({root:{minWidth:400,height:100}});function S(e){let{allVehiclesWithStatus:i,weekId:t,auctioneerId:o,opportunityId:s,name:a,totalUnits:r,startDate:c,endDate:v,...p}=e;const S=C(),D=(0,d.Zp)(),W=(0,u.wA)(),[V,z]=(0,n.useState)(!1),[E,F]=(0,n.useState)([]),{vehiclesData:B}=(0,u.d4)((e=>e.users)),{userInfo:U}=(0,u.d4)((e=>e.auth)),{state:R}=(0,d.zy)(),O=e=>B.some((i=>i.vehicle_id===e));(0,n.useEffect)((()=>{let e=[];null===B||void 0===B||B.map((i=>e.push(i.vehicle_id))),console.log("\ud83d\ude80 ~ useEffect ~ assignedVehiclesArray:",e),F(e)}),[B]);return(0,m.jsxs)(j.Ay,{container:!0,spacing:3,...p,children:[null===i||void 0===i?void 0:i.map(((e,i)=>(0,m.jsx)(j.Ay,{item:!0,xs:12,sm:12,md:12,children:(0,m.jsx)(x.A,{className:S.root,children:(0,m.jsxs)(j.Ay,{container:!0,sx:{cursor:"pointer"},children:[(0,m.jsx)(j.Ay,{item:!0,xs:4,sm:4,children:(0,m.jsx)(A.A,{sx:{pt:"50%",position:"relative",cursor:"pointer"},children:(0,m.jsx)(I,{alt:e.make,src:"".concat(f.Jz,"/").concat(e.imageUrl)})})}),(0,m.jsx)(j.Ay,{item:!0,xs:6,sm:6,children:(0,m.jsxs)(l.A,{spacing:4,p:2,children:[(0,m.jsx)(l.A,{direction:"row",alignItems:"center",justifyContent:"space-between",children:(0,m.jsx)(y.A,{color:"inherit",underline:"hover",children:(0,m.jsx)(A.A,{style:{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",fontWeight:"bold",fontSize:"20px"},children:"".concat(e.year," ").concat(e.make," ").concat(e.model," ").concat(e.trim)})})}),(0,m.jsxs)(l.A,{direction:"row",alignItems:"center",justifyContent:"space-between",style:{marginTop:"10px"},children:[(0,m.jsx)(g.A,{variant:"subtitle2",noWrap:!0,children:e.vin}),(0,m.jsx)(A.A,{sx:{marginRight:"50px"},children:(0,m.jsx)(g.A,{variant:"subtitle2",noWrap:!0,children:e.mileage?"".concat(e.mileage," mi."):""})})]})]})}),(0,m.jsx)(j.Ay,{item:!0,xs:2,sm:2,children:(0,m.jsx)(A.A,{sx:{pt:"20px",pl:"30px",position:"relative",cursor:"pointer"},children:(0,m.jsx)("span",{onClick:()=>{return null===e||void 0===e||e.vehicle_id,i=null===e||void 0===e?void 0:e.status,null===e||void 0===e||e.auctioneer_name,t=null===e||void 0===e?void 0:e.selected_date,console.log("\ud83d\ude80 ~ handleClick ~ status:",i),void(!0===i&&h.oR.warning("This Vehicle has already assigned to ".concat(R.name,", \n             on ").concat(t,". Please remove it first!")));var i,t},children:(0,m.jsx)(b.A,{color:"success",size:"large",checked:E.includes(e.vehicle_id)||e.status,onChange:()=>{return i=e.vehicle_id,void F((e=>e.includes(i)||O(i)?e.filter((e=>e!==i)):[...e,i]));var i},disabled:O(e.vehicle_id)||e.status})})})})]})})},i))),(0,m.jsx)(j.Ay,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",m:4,children:(0,m.jsx)(w.A,{loading:V,size:"large",type:"submit",variant:"contained",onClick:async()=>{let e=E.filter((e=>!B.some((i=>(null===i||void 0===i?void 0:i.vehicle_id)===e))));if(console.log("\ud83d\ude80 ~ handleSubmit ~ filteredSelectedVehicles:",e),!(null!==e&&void 0!==e&&e.length)>0)return h.oR.error("Please select a vehicle");z(!0);try{const i=await k.A.post("".concat(f.VY,"/vehicle/assign-vehicle-to-auctioneer"),{car_ids:e,auctioneerId:o,userId:null===U||void 0===U?void 0:U.user_id,weekId:t});200===(null===i||void 0===i?void 0:i.status)&&(h.oR.success("Vehicle assigned successfully"),z(!1),W((0,_.Np)({userId:null===U||void 0===U?void 0:U.user_id,weekId:t})),D("/dashboard/opportunities/users/cars",{state:{name:a,totalUnits:r,startDate:c,endDate:v,weekId:t,filterValue:"auctioneer",filterId:s,opportunity_id:s,auctioneerId:o}}))}catch(i){z(!1),console.log("[Error]",i)}},children:"Update"})})]})}var D=t(5869);const W=[{value:"year",label:"Year: Newest First",condition:"DESC"},{value:"year",label:"Year: Oldest First",condition:"ASC"},{value:"mileage",label:"Mileage: Highest First",condition:"DESC"},{value:"mileage",label:"Mileage: Lowest First",condition:"ASC"}];function V(){(0,d.Zp)();const e=(0,u.wA)(),{state:i}=(0,d.zy)(),[t,h]=(0,n.useState)(!1),[v,p]=(0,n.useState)([]),[x,g]=(0,n.useState)(!1),[j,A]=(0,n.useState)(null),[y,b]=(0,n.useState)(""),{vehiclesData:f}=(0,u.d4)((e=>e.users)),{assignVehicleWithStatus:w}=(0,u.d4)((e=>e.users)),{userInfo:k}=(0,u.d4)((e=>e.auth));(0,n.useEffect)((()=>{e((0,_.s_)({user_id:null===k||void 0===k?void 0:k.user_id,sortBy:"year",orderDirection:"DESC"}))}),[]);return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(o.A,{children:[(0,m.jsxs)(l.A,{direction:"row",alignItems:"center",justifyContent:"space-between",fontWeight:"bold",mb:0,children:[(0,m.jsxs)(s.A,{variant:"h6",pb:1,children:[null===i||void 0===i?void 0:i.startDate," - ",null===i||void 0===i?void 0:i.endDate," "]}),(0,m.jsx)(s.A,{variant:"h6",pb:1,children:null===i||void 0===i?void 0:i.name}),(0,m.jsxs)(s.A,{variant:"h6",pb:1,children:[null===f||void 0===f?void 0:f.length," units"]})]}),(0,m.jsx)(l.A,{direction:"row",flexWrap:"wrap-reverse",alignItems:"center",justifyContent:"space-between",children:(0,m.jsxs)(l.A,{children:[(0,m.jsxs)(a.A,{color:"inherit",disableRipple:!0,onClick:e=>{A(e.currentTarget)},py:0,endIcon:(0,m.jsx)(D.A,{icon:j?"eva:chevron-up-fill":"eva:chevron-down-fill"}),children:["Sort By:\xa0",(0,m.jsx)(s.A,{component:"span",variant:"subtitle2",sx:{color:"text.secondary",borderBottom:"1px solid black"},children:y})]}),(0,m.jsx)(r.A,{keepMounted:!0,anchorEl:j,open:Boolean(j),onClose:()=>{A(null)},anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:W.map((i=>(0,m.jsx)(c.A,{selected:i.value,onClick:()=>((i,t,n)=>{e((0,_.s_)({user_id:null===k||void 0===k?void 0:k.user_id,orderDirection:t,sortBy:i})),b(n),A(null)})(i.value,i.condition,i.label),sx:{typography:"body2"},children:i.label},i.value+"_"+i.condition)))})]})}),(0,m.jsx)(S,{allVehiclesWithStatus:w,weekId:null===i||void 0===i?void 0:i.weekId,auctioneerId:null===i||void 0===i?void 0:i.auctioneerId,opportunityId:null===i||void 0===i?void 0:i.opportunity,name:null===i||void 0===i?void 0:i.name,totalUnits:null===i||void 0===i?void 0:i.totalUnits,startDate:null===i||void 0===i?void 0:i.startDate,endDate:null===i||void 0===i?void 0:i.endDate})]})})}}}]);
//# sourceMappingURL=579.a7893775.chunk.js.map

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists