PageSourceSearch

https://www.upcar.ai/_next/static/chunks/43370.0c9a6dde82b6b7e7.js

js upcar.ai collected 2026-10-05 15:26:55 UTC 12,079 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[43370],{43370:function(e,t,s){s.r(t),s.d(t,{default:function(){return w}});var a=s(27573),i=s(7653),r=e=>{let{tabs:t,setActiveTab:s,activeTab:i,className:r="",tabClassName:l="",activeTabClassName:o="",inactiveTabClassName:n="",uppercase:c=!0}=e;return(0,a.jsx)("div",{className:r,children:t.map((e,t)=>(0,a.jsx)("button",{onClick:()=>s(t),className:"pb-2 px-4 text-sm font-medium ".concat(i===t?"border-b-2 border-[#027BFF] text-[#027BFF] ".concat(o):"text-gray-500 ".concat(n)," ").concat(l),children:c?e.toUpperCase():e},t))})},l=s(76753),o=s(49563),n=s(31624),c=s(2522),d=s(18244),u=s(89825),m=s(98992),h=s(13482),f=s(7384),x=s(35677),p=s(67754);let v=e=>{let{isMobileVerified:t,emailVerify:s,isApprovedToDrive:i}=e;return(0,a.jsxs)("div",{className:"py-4",children:[(0,a.jsx)("h3",{className:"text-xs font-medium text-gray-500 mb-4",children:"VERIFIED INFO"}),[{label:"Approved to drive",isVerified:i},{label:"Email address",isVerified:s},{label:"Phone number",isVerified:t}].map((e,t)=>(0,a.jsxs)("div",{className:"flex justify-between items-center py-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.G,{icon:d.fV7,className:"text-blue-500"}),(0,a.jsx)("p",{className:"text-sm text-gray-700",children:e.label})]}),(0,a.jsx)(c.G,{icon:e.isVerified?n.LEp:n.FDd,className:e.isVerified?"text-blue-500":"text-gray-400",size:"sm"})]},t))]})};function b(e){return(null==e?void 0:e._id)||(null==e?void 0:e.id)||(null==e?void 0:e.userId)||(null==e?void 0:e.user_id)||""}let g=e=>{let{hostData:t}=e,s=(0,p.useRouter)();if(!t)return null;let i=b(t),r=()=>{i&&s.push("/host-profile/".concat(i))};return(0,a.jsx)("div",{className:"px-4 py-3",children:(0,a.jsxs)("div",{className:"flex py-3 items-center gap-4",children:[(0,a.jsx)("img",{src:t.profilePic||"/assets/img/hosts-a.png",onClick:r,alt:"".concat(t.firstName," ").concat(t.lastName),className:"rounded-full border border-gray-100 w-[50px] aspect-square object-cover cursor-pointer"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-bold text-base text-gray-800 cursor-pointer",onClick:r,children:(0,a.jsx)("span",{"data-pii":!0,children:"".concat(t.firstName," ").concat(t.lastName)})}),void 0!==t.totalTripsAsHost&&t.joinedDate&&(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"".concat(t.totalTripsAsHost," trip").concat(1!==t.totalTripsAsHost?"s":""," • Joined ").concat((0,h.WU)(new Date(t.joinedDate),"MMM, yyyy"))})]})]})})},y=e=>{let{userData:t}=e,s=(0,p.useRouter)();if(!t)return null;let i=b(t),r=()=>{i&&s.push("/user-profile/".concat(i))};return(0,a.jsxs)("div",{className:"px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex py-3 items-center gap-4",children:[(0,a.jsx)("img",{src:t.profilePic||"/assets/img/hosts-a.png",onClick:r,alt:"".concat(t.firstName," ").concat(t.lastName),className:"rounded-full border border-gray-100 w-[50px] aspect-square object-cover cursor-pointer"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-bold text-base text-gray-800 cursor-pointer",onClick:r,children:(0,a.jsx)("span",{"data-pii":!0,children:"".concat(t.firstName," ").concat(t.lastName)})}),void 0!==t.totalTripsAsHost&&t.joinedDate&&(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:"".concat(t.totalTripsAsHost," trip").concat(1!==t.totalTripsAsHost?"s":""," • Joined ").concat((0,h.WU)(new Date(t.joinedDate),"MMM, yyyy"))})]})]}),(0,a.jsx)(v,{isMobileVerified:t.isMobileVerified,emailVerify:t.emailVerify,isApprovedToDrive:t.isDriverVerified||t.isDriverManuallyVerified})]})};var j=e=>{let{viewState:t}=e,s=(0,f.v9)(e=>e.user.token),{roomId:r}=(0,o.b)(),[l,n]=(0,i.useState)(null),[c,d]=(0,i.useState)(null),[h,p]=(0,i.useState)(null),[v,b]=(0,i.useState)(!0);return((0,i.useEffect)(()=>{(async()=>{try{if(r){var e,t;if((null==r?void 0:r.startsWith("general_"))||(null==r?void 0:r.startsWith("buysell_"))||(null==r?void 0:r.startsWith("inquiry_"))||(null==r?void 0:r.startsWith("admin_"))){b(!1);return}let s=await u.ZP.get("/trips/getTrip/".concat(r));(null==s?void 0:null===(e=s.data)||void 0===e?void 0:e.status)&&n(null==s?void 0:null===(t=s.data)||void 0===t?void 0:t.data)}}catch(e){console.error("Error fetching trip details:",e)}})()},[r]),(0,i.useEffect)(()=>{let e=async()=>
1{if(l)try{if("guest"===t){let e=await (0,m.qm)(l.carOwnerId,s);e&&p(e)}else{let e=await (0,m.iR)(l.userId,s);e.status&&d(e.data)}}catch(e){console.error("Error fetching user data:",e)}finally{b(!1)}};l&&e()},[l,s,t]),!v&&l&&(c||h))?"host"===t?(0,a.jsx)(y,{userData:c}):(0,a.jsx)(g,{hostData:h}):(0,a.jsx)(x.default,{})},N=s(51607),w=e=>{var t;let{roomId:s,viewState:n}=e,c=["message","your ".concat("guest"===n?"host":"guest")],{setRoomId:d,setChats:m}=(0,o.b)(),[h,f]=(0,i.useState)(0),x=(0,p.useRouter)(),[v,b]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let e=async()=>{if(s){let t="host"===n?"host":"guest";try{var e;let a=await u.ZP.get("/chat/getChatRoom?roomId=".concat(s,"&userType=").concat(t));if(null==a?void 0:null===(e=a.data)||void 0===e?void 0:e.status){let e=a.data.chatbox;"host"===n?b({receiverName:e.guestName,receiverProfilePic:e.guestProfilePic,senderName:e.hostName,senderProfilePic:e.hostProfilePic}):b({senderName:e.guestName,senderProfilePic:e.guestProfilePic,receiverName:e.hostName,receiverProfilePic:e.hostProfilePic})}else x.back()}catch(e){console.error("Error fetching room details:",e)}}};return s&&(d(s),e()),()=>{d(null),m([])}},[s,n]),(0,i.useEffect)(()=>{function e(){setTimeout(()=>{let e=document.getElementById("chat-tabs-view");document.documentElement.style.setProperty("--chat-tabs-view-height","".concat((null==e?void 0:e.offsetHeight)||0,"px"))},0)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),document.documentElement.style.removeProperty("--chat-tabs-view-height")}},[]),(0,a.jsx)(N.Z,{pageTitle:"Back",childrenClassName:"py-0",headerClassName:"border-b-0",onBack:()=>x.push("/messages"),children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{id:"chat-tabs-view",className:"fixed md:hidden left-0 right-0 z-10 bg-white",style:{top:"calc(var(--fixed-top-header-height, 0px))"},children:[(0,a.jsx)("p",{"data-pii":!0,className:"text-sm text-black text-center font-medium",children:null!==(t=null==v?void 0:v.receiverName)&&void 0!==t?t:"Loading..."}),(0,a.jsx)("div",{className:"border-b",children:(0,a.jsx)("div",{className:"flex justify-center gap-6 pt-3",children:(0,a.jsx)(r,{tabs:c,setActiveTab:f,activeTab:h})})})]}),(0,a.jsxs)("div",{className:"md:flex-none overflow-auto",style:{height:"calc(100vh - var(--fixed-top-header-height, 0vh) - var(--chat-message-input-height, 0vh) - var(--chat-tabs-view-height, 0vh))",marginTop:"calc(var(--chat-tabs-view-height, 0px))"},children:[0===h&&(0,a.jsx)(l.default,{viewState:n}),1===h&&(0,a.jsx)(j,{viewState:n})]})]})})}},51607:function(e,t,s){var a=s(27573),i=s(7157),r=s(35662),l=s(7653),o=s(67754);t.Z=e=>{let{pageTitle:t,onBack:s,headerAction:n,headerLeftAction:c,subHeader:d,children:u,childrenClassName:m,headerClassName:h,bottomActionBar:f,hideBackButton:x=!1,hideHeaderOnDesktop:p=!1,autoHeight:v=!1}=e,b=(0,o.usePathname)(),g=null!=f;(0,l.useEffect)(()=>{function e(){let e=document.getElementById("fixed-top-header");document.documentElement.style.setProperty("--fixed-top-header-height","".concat((null==e?void 0:e.offsetHeight)||0,"px"));let t=document.getElementById("fixed-bottom-action");document.documentElement.style.setProperty("--fixed-bottom-action-height","".concat((null==t?void 0:t.offsetHeight)||0,"px"))}let t=requestAnimationFrame(e),s=new ResizeObserver(e),a=document.getElementById("fixed-top-header"),i=document.getElementById("fixed-bottom-action");return a&&s.observe(a),i&&s.observe(i),window.addEventListener("resize",e),()=>{cancelAnimationFrame(t),s.disconnect(),window.removeEventListener("resize",e)}},[g]),(0,l.useEffect)(()=>()=>{document.documentElement.style.removeProperty("--fixed-top-header-height"),document.documentElement.style.removeProperty("--fixed-bottom-action-height")},[]);let y=v||"/bookings/reimbursement/select-incidental"===b;return(0,a.jsxs)("div",{className:(0,r.cn)(y?"relative w-full":"fixed left-0 right-0 flex flex-col overflow-hidden",p&&(y?"md:!h-auto":"md:!relative md:!flex-none md:!overflow-visible md:!left-auto md:!right-auto md:!top-auto md:!bottom-auto md:!h-auto md:!w-full")),style:y?{height:"auto"}:{top:"calc(var(--main-header-height, 0px) + var(--download-app-box-height, 0px))",bottom:"var(--mobile-bottom-bar-height, 0px)"},children:[(0,a.jsxs)("div",{id:"fixed-top-header",className:(0,r.cn)("fixed top-0 right-0 left-0 z-[100] border-b max-md:border-[#F0F0F0] bg-white",h,p&&"md:hidden"),style:{to
1p:"var(--download-app-box-height, 0px)"},children:[(0,a.jsxs)("div",{className:"relative flex items-center h-14 max-md:h-16 px-4",children:[!x&&(0,a.jsx)("button",{onClick:s,className:"absolute left-4 top-1/2 -translate-y-1/2 flex items-center text-[#1F1F1F] max-md:text-[#2C3E5D]","aria-label":"Back",type:"button",children:(0,a.jsx)(i.pf,{size:24,color:"currentColor"})}),x&&c&&(0,a.jsx)("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 flex items-center",children:c}),(0,a.jsx)("h1",{className:"text-base font-semibold text-center title-color flex-1",children:t}),n&&(0,a.jsx)("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 flex items-center z-[101]",children:n})]}),d&&(0,a.jsx)("div",{className:"px-5 pb-2",children:d})]}),(0,a.jsx)("div",{className:(0,r.cn)("w-full py-5 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",y?"h-full overflow-visible":"flex-1 min-h-0 overflow-y-auto",m,p&&"md:!mt-0 md:!mb-0 md:!h-auto md:!overflow-visible md:!flex-none"),style:{marginTop:"var(--fixed-top-header-height, 0px)",marginBottom:"calc(var(--fixed-bottom-action-height, 0px))",WebkitOverflowScrolling:y?void 0:"touch"},children:u}),f&&(0,a.jsx)(a.Fragment,{children:f})]})}},49563:function(e,t,s){s.d(t,{ApplicationProvider:function(){return o},b:function(){return l}});var a=s(27573),i=s(7653);let r=(0,i.createContext)(),l=()=>(0,i.useContext)(r),o=e=>{let{children:t}=e,[s,l]=(0,i.useState)(),[o,n]=(0,i.useState)(0),[c,d]=(0,i.useState)(1),[u,m]=(0,i.useState)({name:"",profileUrl:""}),[h,f]=(0,i.useState)({guestName:"",guestProfilePic:"",hostName:"",hostProfilePic:""}),[x,p]=(0,i.useState)(),[v,b]=(0,i.useState)(!1),[g,y]=(0,i.useState)(!1),[j,N]=(0,i.useState)([]),[w,P]=(0,i.useState)([]),[S,E]=(0,i.useState)([]),[k,C]=(0,i.useState)({}),[F,I]=(0,i.useState)({}),[T,A]=(0,i.useState)(!1),[D,V]=(0,i.useState)(!1),[B,z]=(0,i.useState)({}),[M,_]=(0,i.useState)(null),[H,R]=(0,i.useState)({}),[W,L]=(0,i.useState)({beforePhotos:[],afterPhotos:[]}),[q,O]=(0,i.useState)({}),[U,Z]=(0,i.useState)(1),[G,J]=(0,i.useState)(""),[K,Q]=(0,i.useState)(0),[X,Y]=(0,i.useState)({roomId:"",isSubscriptionCar:!1}),$=(0,i.useCallback)(e=>Array.isArray(e)?e.reduce((e,t)=>(e.some(e=>e.id===t.id||e.timestamp===t.timestamp&&e.senderId===t.senderId)||e.push(t),e),[]):e,[]),ee=(0,i.useCallback)(e=>N($(e)),[$]),et=(0,i.useCallback)(()=>{Q(e=>e+1)},[]),es=(0,i.useMemo)(()=>({setRoomId:l,roomId:s,totalPage:o,setTotalpage:n,page:c,setPage:d,setUserDetail:m,setChats:ee,userDetail:u,chats:j,carSearchResult:x,setCarSearchResult:p,isLongTermRental:v,setIsLongTermRental:b,payments:g,setPayments:y,checkinUrls:w,setCheckinUrls:P,checkoutUrls:S,setCheckouturls:E,tripDetailsData:k,setTripDetailsData:C,guestVerification:F,setGuestVerification:I,listYourCarStatus:T,setListYourCarStatus:A,chatDetails:h,setChatDetails:f,mobileView:D,setMobileView:V,incidenceCharge:B,setIncidenceCharge:z,reportIssue:H,setReportIssue:R,reportDamagePhotos:W,setReportDamagePhotos:L,reportDamage:q,setReportDamge:O,activeTab:U,setActiveTab:Z,bookingTabActive:G,setBookingTabActive:J,notificationTrigger:K,triggerNotificationRefetch:et,incidentChargeCarDetails:M,setIncidenceChargeCarDetails:_,chatRoomMetadata:X,setChatRoomMetadata:Y}),[s,o,c,u,j,x,v,g,w,S,k,F,T,h,D,B,H,W,q,U,G,K,M,X,ee,et]);return(0,a.jsx)(r.Provider,{value:es,children:t})}}}]);

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.