1(this["webpackJsonpvehicle-submission-web"]=this["webpackJsonpvehicle-submission-web"]||[]).push([[12],{336:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d}));var r=n(6),i=n(8),o=n(20),c=n.n(o),a=n(28),s=n(30),l=a.a.restful,p=function(){var e=Object(i.a)(Object(r.a)().mark((function e(t){var n,i,o;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(s.g)(),i={project:"haup-stable"},n&&(i.Authorization=n),e.next=5,c.a.get("".concat(l.URL,"/car-submit/").concat(t),{headers:i});case 5:if((o=e.sent).data.success){e.next=8;break}return e.abrupt("return",null);case 8:return e.abrupt("return",o.data.data);case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),d=function(){var e=Object(i.a)(Object(r.a)().mark((function e(){var t,n;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Object(s.g)(),e.next=3,c.a.get("".concat(l.URL,"/car-submit"),{headers:{Authorization:t,project:"haup-stable"}});case 3:return n=e.sent,e.abrupt("return",n.data.data);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},679:function(e,t,n){"use strict";n.r(t);var r=n(6),i=n(8),o=n(3),c=n(310),a=n(166),s=n(292),l=n(0),p=n(37),d=n(168),u=n(188),x=n(336),j=n(1);t.default=function(){var e,t,n,b,f,h,g=Object(p.j)().id,m=Object(p.h)(),y=Object(l.useState)(null),O=Object(o.a)(y,2),v=O[0],S=O[1],z=Object(l.useState)(null),k=Object(o.a)(z,2),w=k[0],C=k[1],_=Object(l.useState)(!0),B=Object(o.a)(_,2),R=B[0],A=B[1],F=Object(l.useState)(!1),D=Object(o.a)(F,2),E=D[0],W=D[1],H=g;Object(l.useEffect)((function(){var e=localStorage.getItem("userToken");W(!!e),H?T(H):A(!1)}),[H]);var T=function(){var e=Object(i.a)(Object(r.a)().mark((function e(t){var n,i;return Object(r.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(x.a)(t);case 3:if(!(n=e.sent)){e.next=13;break}
1if(S(n),!n.carRequestId){e.next=11;break}return e.next=9,Object(u.a)(n.carRequestId);case 9:(i=e.sent)&&C(i);case 11:e.next=14;break;case 13:a.b.error("Car submission not found");case 14:e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),console.error("Error loading car submit:",e.t0),a.b.error("Failed to load car submission");case 20:return e.prev=20,A(!1),e.finish(20);case 23:case"end":return e.stop()}}),e,null,[[0,16,20,23]])})));return function(t){return e.apply(this,arguments)}}();if(R)return Object(j.jsx)(d.c,{children:Object(j.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"100vh",backgroundColor:"#F9FAFB"},children:Object(j.jsx)(s.a,{size:"large"})})});if(!v)return Object(j.jsx)(d.c,{children:Object(j.jsx)("div",{style:{padding:"24px",textAlign:"center"},children:"Car submission not found"})});var L="ACCEPTED"===v.status?"Accepted":"REJECTED"===v.status?"Rejected":"Pending",U=v.carImages&&v.carImages.length>0?v.carImages[0]:"https://ts-upload.sgp1.digitaloceanspaces.com/cms/1ijYRirRjLBxXbaQck3TtzYKegLGCMn1X6T5j9Z6MejV4288Gb1wyknCvLDGuCqU6Z8G6KB6R14uAHjGUwQnpStV.png",Y=v.carImages&&v.carImages.length>1?v.carImages.slice(1):["https://ts-upload.sgp1.digitaloceanspaces.com/cms/65kDp5pgUtzscRtJDvUvzz3sxGRZNJa8EcUofegnPP74PAYGyV2z5xitNHsdsQCamTippWkriS1cZzja3jrXzSxS.png","https://ts-upload.sgp1.digitaloceanspaces.com/cms/4Lz6tYgjkR8cLCYojtuJ5xV45z1Nc5RUdMskYRSHVFq1jJq1bnHpfXHjyn17MbvxgnCvesWGz2ZxH88UMpK7sP4v.png","https://ts-upload.sgp1.digitaloceanspaces.com/cms/5aDsvZc135xVvrNWyd9CJ7CjCnwEgYuKftmKQMTS15d6rij7ybvTRRYLezrJ8nEbj4pZyoQkvuWX2XMAzan6eaEQ.png","https://ts-upload.sgp1.digitaloceanspaces.com/cms/5h5HnwtN7Zyd3mEFW4Kza3zJKvgZy37P4aXRBKBtUANaxzvsbkdtZ22sBwn6EDQuzzca5NcnzxeMxESGH8AtWhKk.png"];return Object(j.jsx)(d.c,{children:Object(j.jsxs)("div",{style:{backgroundColor:"#F9FAFB",minHeight:"100vh",padding:"16px"},children:[E&&Object(j.jsx)("div",{onClick:function(){return m.push("/submission")},style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"16px",cursor:"pointer"},children:Object(j.jsx)(c.a,{style:{fontSize:"20px",color:"#000"}})}),"Pending"===L&&Object(j.jsxs)("div",{style:{backgroundColor:"#fff",borderRadius:"12px",padding:"32px 24px",marginBottom:"16px",textAlign:"center"},children:[Object(j.jsx)("style",{children:"\n @keyframes float {\n 0%, 100% {\n transform: translateY(0px);\n }\n 50% {\n transform: translateY(-10px);\n }\n }\n @keyframes pulse {\n 0%, 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n }\n .hourglass-icon {\n animation: float 3s ease-in-out infinite, pulse 2s ease-in-out infinite;\n }\n "}),Object(j.jsx)("div",{style:{display:"flex",justifyContent:"center",marginBottom:"20px"},children:Object(j.jsx)("img",{src:"https://ts-upload.sgp1.digitaloceanspaces.com/cms/26eHHmscptMkFj2BaukkUxqbgMfcYjmLHUYWNjy38pcuggN7ntxpiTbTDdEyFuzvG2JkawaoZ9SDGdYiRe28iVFW.png",alt:"Awaiting",className:"hourglass-icon",style:{width:"80px",height:"80px"}})}),Object(j.jsx)("h2",{style:{fontSize:"18px",fontWeight:600,color:"#212427",marginBottom:"12px"},children:"Awaiting renter decision..."}),Object(j.jsx)("p",{style:{fontSize:"14px",color:"#667085",lineHeight:"20px",marginBottom:0},children:"Your car is now under review by the renter. As soon as they select a car, we'll notify you so you can continue with the booking process."})]}),"Accepted"===L&&Object(j.jsxs)("div",{style:{backgroundColor:"#fff",borderRadius:"12px",padding:"32px 24px",marginBottom:"16px",textAlign:"center"},children:[Object(j.jsx)("div",{style:{display:"flex",justifyContent:"center",marginBottom:"20px"},children:Object(j.jsx)("img",{src:"https://ts-upload.sgp1.digitaloceanspaces.com/cms/5pv5jdG3DkDrJi5N8eUkeoGu6E2GSdD4LuA2XP68qcTErK6PTZWkb4X3JuRiiSFwhtpRxA6qZCbTHmQLj7ZNfMU2.png",alt:"Success",style:{width:"80px",height:"80px"}})}),Object(j.jsx)("h2",{style:{fontSize:"18px",fontWeight:600,color:"#101828",marginBottom:"12px"},children:"Your car has been selected!"}),Object(j.jsx)("p",{style:{fontSize:"14px",color:"#667085",lineHeight:"20px",marginBottom:"24px"},children:"The renter has selected your car. To proceed with the booking, please submit the full car details on the HAUP platform thorough below button."}),Object(j.jsx)("button",{onClick:function(){return m.push("/submission")},style:{width:"100%",height:"48px",backgroundColor:"#0048B3",color:"#fff",border:"none",borderRadius:"8px",fontSize:"16px",fontWeight:500,cursor:"pointer"},children:"Continue to booking"})]}),w&&Object(j.jsxs)("div",{style:{backgroundColor:"#F4F5F9",borderRadius:"12px",padding:"16px",marginBottom:"16
1px"},children:[Object(j.jsx)("h3",{style:{fontSize:"16px",fontWeight:600,marginBottom:"12px",color:"#212427"},children:"Requested car information"}),Object(j.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[Object(j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(j.jsx)("span",{style:{fontSize:"14px",color:"#667085"},children:"Brand and model :"}),Object(j.jsx)("span",{style:{fontSize:"14px",fontWeight:500,color:"#212427"},children:"".concat(w.preferred_brand||""," ").concat(w.preferred_model||""," ").concat(null!==(e=w.car_information)&&void 0!==e&&e.model_year&&"null"!==w.car_information.model_year?w.car_information.model_year:"").trim()})]}),(null===(t=w.car_information)||void 0===t?void 0:t.pickup_date)&&((null===(n=w.car_information)||void 0===n?void 0:n.drop_off_date)||(null===(b=w.car_information)||void 0===b?void 0:b.duration)&&(null===(f=w.car_information)||void 0===f?void 0:f.duration_type))&&Object(j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(j.jsx)("span",{style:{fontSize:"14px",color:"#667085"},children:"Reservation date :"}),Object(j.jsx)("span",{style:{fontSize:"14px",fontWeight:500,color:"#212427"},children:function(){var e=new Date(w.car_information.pickup_date),t=function(e){var t=e.getDate(),n=e.toLocaleString("en-US",{month:"short"}),r=e.getFullYear();return"".concat(t," ").concat(n," ").concat(r)};if(w.car_information.drop_off_date){var n=new Date(w.car_information.drop_off_date);return"".concat(t(e)," - ").concat(t(n))}var r=parseInt(w.car_information.duration),i=w.car_information.duration_type.toLowerCase(),o=new Date(e);return"month"===i?o.setMonth(o.getMonth()+r):"day"===i&&o.setDate(o.getDate()+r),"".concat(t(e)," - ").concat(t(o))}()})]}),w.preferred_location&&Object(j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(j.jsx)("span",{style:{fontSize:"14px",color:"#667085"},children:"Location :"}),Object(j.jsx)("span",{style:{fontSize:"14px",fontWeight:500,color:"#212427"},children:w.preferred_location})]}),Object(j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(j.jsx)("span",{style:{fontSize:"14px",color:"#667085"},children:"Budget :"}),Object(j.jsx)("span",{style:{fontSize:"14px",fontWeight:500,color:"#212427"},children:null!==(h=w.car_information)&&void 0!==h&&h.price_per_month?"".concat(w.car_information.currency||"THB"," ").concat(Number(w.car_information.price_per_month).toLocaleString()).concat(w.car_information.duration_type?"/".concat(w.car_information.duration_type.charAt(0).toUpperCase()+w.car_information.duration_type.slice(1)):""):"Not specified"})]})]})]}),Object(j.jsxs)("div",{style:{backgroundColor:"#fff",borderRadius:"12px",padding:"20px",marginBottom:"16px"},children:[Object(j.jsx)("h2",{style:{fontSize:"18px",fontWeight:600,marginBottom:"16px"},children:"Submission information"}),Object(j.jsxs)("div",{style:{display:"flex",gap:"16px",marginBottom:"20px"},children:[Object(j.jsx)("img",{src:U,alt:"".concat(v.brand," ").concat(v.model),style:{width:"120px",height:"120px",borderRadius:"8px",objectFit:"cover"}}),Object(j.jsxs)("div",{style:{flex:1},children:[Object(j.jsxs)("h3",{style:{fontSize:"18px",fontWeight:600,marginBottom:"8px"},children:[v.brand," ",v.model]}),Object(j.jsxs)("p",{style:{fontSize:"14px",color:"#667085",marginBottom:"4px"},children:["Year : ",v.year]}),Object(j.jsxs)("p",{style:{fontSize:"14px",color:"#667085",marginBottom:"0"},children:["Submitted on :"," ",new Date(v.createdAt).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})]})]})]}),Object(j.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"12px",marginBottom:"20px"},children:[(v.registrationPrefix||v.registrationNumber)&&Object(j.jsxs)(j.Fragment,{children:[Object(j.jsx)("hr",{style:{border:"none",borderTop:"1px solid #E5E7EB",margin:"0 0 12px 0"}}),Object(j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(j.jsx)("span",{style:{fontSize:"14px",color:"#667085"},children:"Car registration number"}),Object(j.jsxs)("span",{style:{fontSize:"14px",fontWeight:500,color:"#000"},children:[v.registrationPrefix,v.registrationNumber]})]})]}),v.expectedPrice&&Object(j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[Object(j.jsx)("span",{style:{fontSize:"14px",color:"#667085"},children:"Expected price"}),Object(j.jsxs)("span",{style:{fontSize:"14px",fontWeight:500,color:"#000"}
1,children:["THB"," ",v.expectedPrice.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}),"/month"]})]}),Object(j.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[Object(j.jsx)("span",{style:{fontSize:"14px",color:"#667085"},children:"Status"}),Object(j.jsx)("span",{style:{fontSize:"14px",fontWeight:500,color:"Accepted"===L?"#027A48":"#B54708",backgroundColor:"Accepted"===L?"#ECFDF3":"#FEF0C7",padding:"2px 10px",borderRadius:"16px"},children:L})]})]}),v.carImages&&v.carImages.length>1&&Object(j.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"8px"},children:Y.map((function(e,t){return Object(j.jsx)("img",{src:e,alt:"Interior ".concat(t+1),style:{width:"100%",height:"80px",borderRadius:"8px",objectFit:"cover"}},t)}))})]})]})})}}}]); 2//# sourceMappingURL=12.780248ca.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.