PageSourceSearch

https://www.upcar.ai/_next/static/chunks/97835-e7175bade62fb8db.js

js upcar.ai collected 2026-10-05 15:25:49 UTC 25,637 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[97835],{33617:function(e,t,i){var s=i(27573),a=i(7653),l=i(7157),o=i(67211),n=i(20582),r=i(10865),c=i(35662);let d=(0,n.default)(()=>Promise.all([i.e(47392),i.e(64557),i.e(7943),i.e(52945),i.e(15315)]).then(i.bind(i,88521)),{loadableGenerated:{webpack:()=>[88521]},ssr:!1});t.Z=e=>{let{fromData:t,handleForm:i,inputValue:n,suggestions:u,handleAddressInputChange:h,handleSuggestionClick:g,range:m,setRange:x,isCalendarOpen:f,setIsCalendarOpen:v,field:p,setField:y,handleFocus:F,handleSubmit:w,dateError:b,isMobileSearchModalOpen:j,handleMobileSearchClose:C,isLongTermRental:N=!1,className:B="",buttonText:A="Start your journey",homeLocationSuggestions:_=[],recentSearches:k=[],handleQuickLocationSelect:L,handleCurrentLocationClick:T,currentLocationError:E=null,isFetchingCurrentLocation:S=!1}=e,D="Current Location",Z=(0,a.useRef)(null),P=(0,a.useRef)(null),[I,R]=(0,a.useState)(!1),[Y,z]=(0,a.useState)(!1),[M,O]=(0,a.useState)(!1),V=Object.values(u).some(e=>e&&e.length>0),H=e=>e?e.toLocaleDateString():"";(0,a.useEffect)(()=>{if(!j){R(!1),z(!1),O(!1);return}},[j]);let U=(0,a.useRef)(!1);if((0,a.useEffect)(()=>{U.current&&!S&&!E&&n&&n.trim().toLowerCase()!==D.toLowerCase()&&(z(!1),R(!1),O(!1)),U.current=S},[S,E,n]),(0,a.useEffect)(()=>{if(!P.current)return;let e=P.current,t=t=>{1===t.touches.length&&(e._lastTouchY=t.touches[0].clientY)},i=t=>{var i,s,a,l;let{scrollTop:o,scrollHeight:n,clientHeight:r}=e;if((o<=0&&t.touches[0].clientY>((null===(s=t.targetTouches)||void 0===s?void 0:null===(i=s[0])||void 0===i?void 0:i.clientY)||t.touches[0].clientY)||o+r>=n&&t.touches[0].clientY<((null===(l=t.targetTouches)||void 0===l?void 0:null===(a=l[0])||void 0===a?void 0:a.clientY)||t.touches[0].clientY))&&t.preventDefault(),1===t.touches.length){let i=t.touches[0],s=i.clientY-(e._lastTouchY||i.clientY);e._lastTouchY=i.clientY,Math.abs(s)>5&&(e.scrollTop-=s)}};return e.addEventListener("touchstart",t,{passive:!0}),e.addEventListener("touchmove",i,{passive:!1}),()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchmove",i)}},[u]),!j)return null;let K=n.trim(),Q=K.toLowerCase()===D.toLowerCase(),J=I&&(0===K.length||M&&!V||Q),$=I&&(J||V);function G(){z(!1),R(!1),O(!1)}function W(){if(z(!0),R(!0),!(K.length>=3&&K.toLowerCase()!==D.toLowerCase())){O(!1);return}O(!0),h({target:{value:n}})}return(0,s.jsx)("div",{className:"fixed inset-x-0 bottom-0 z-40 flex items-start justify-center bg-black/50",style:{to
1p:"var(--visual-viewport-offset-top, 0px)"},children:(0,s.jsxs)("div",{className:"relative w-full bg-white rounded-b-2xl animate-slideInDown",children:[(0,s.jsxs)("div",{className:"p-5 pb-7 max-w-[420px] mx-auto",children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-4",children:(0,s.jsxs)("button",{type:"button","aria-label":"Close",onClick:e=>{e.stopPropagation(),C()},className:"flex items-center justify-center w-8 h-8 rounded-full bg-[#F7F8F9] border border-[#F0F0F0]",children:[(0,s.jsx)("span",{className:"sr-only",children:"Close"}),(0,s.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.980431 0.979454C1.17569 0.784192 1.49228 0.784192 1.68754 0.979454L6.00065 5.29257L10.3138 0.979454C10.509 0.784192 10.8256 0.784192 11.0209 0.979454C11.2161 1.17472 11.2161 1.4913 11.0209 1.68656L6.70776 5.99967L11.0209 10.3128C11.2161 10.508 11.2161 10.8246 11.0209 11.0199C10.8256 11.2152 10.509 11.2152 10.3138 11.0199L6.00065 6.70678L1.68754 11.0199C1.49228 11.2152 1.17569 11.2152 0.980431 11.0199C0.785169 10.8246 0.785169 10.508 0.980431 10.3128L5.29354 5.99967L0.980431 1.68656C0.785169 1.4913 0.785169 1.17472 0.980431 0.979454Z",fill:"#000000"})})]})}),(0,s.jsxs)("div",{className:(0,c.cn)("relative flex flex-col gap-3 w-full bg-white",B),children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("label",{className:"text-sm text-[#1F1F1F] font-medium",htmlFor:"delivery-location",children:"Delivery Location"}),(0,s.jsxs)("div",{className:"relative flex items-center",children:[(0,s.jsx)("span",{className:"absolute left-3",children:(0,s.jsx)(o.Z,{fill:(null==n?void 0:n.length)>0?"#0E0F11":"#BFBFBF"})}),(0,s.jsx)("input",{id:"delivery-location",type:"text",className:"w-full px-9 py-2 !text-base rounded-[10px] border border-[#F0F0F0] title-color placeholder:text-gray-400 focus:outline-none transition placeholder:text-sm",placeholder:"Search for an address",value:n,onFocus:W,onClick:W,readOnly:!0,autoComplete:"off"}),(0,s.jsx)("span",{className:"absolute right-3",children:(0,s.jsx)(l.Zx,{width:16,height:16,fillColor:(null==n?void 0:n.length)>0?"#0E0F11":"#BFBFBF"})})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("label",{className:"text-sm sm:text-base title-color font-medium",htmlFor:"start-date",children:"Start"}),(0,s.jsxs)("div",{className:"flex gap-1 rounded-[10px] px-2.5 py-2 border border-[#F0F0F0] bg-white",children:[(0,s.jsxs)("div",{className:"flex-1 flex items-center justify-start gap-2 cursor-pointer",onClick:()=>F("start"),children:[(0,s.jsx)(l.Qu,{fill:(null==m?void 0:m.from)?"#0E0F11":"#BFBFBF",size:20}),(0,s.jsx)("input",{id:"start-date",type:"text",value:H(m.from),onClick:e=>{F("start")},onChange:()=>{},readOnly:!0,className:"relative flex-1 w-full title-color text-base cursor-pointer placeholder:text-[#BFBFBF] focus:outline-none focus:ring-0",placeholder:"Add Date"}),(0,s.jsx)(l.KL,{stroke:(null==m?void 0:m.from)?"#0E0F11":"#BFBFBF",size:18})]}),(0,s.jsx)("span",{className:"text-[#E5E7EB]",children:"|"}),(0,s.jsxs)("div",{className:"relative flex-1 flex items-center justify-end gap-2",children:[(0,s.jsx)(l.T3,{size:20,color:(null==t?void 0:t.fromTime)?"#0E0F11":"#BFBFBF"}),(0,s.jsxs)("div",{className:"relative flex items-center",children:[(0,s.jsxs)("select",{className:"title-color text-base focus:outline-none transition appearance-none bg-white pr-6",value:null==t?void 0:t.fromTime,onChange:e=>i("fromTime",e.target.value),children:[(0,s.jsx)("option",{value:"",disabled:!0,children:"Time"}),(0,r.QR)().map((e,t)=>(0,s.jsx)("option",{value:e,children:e},t))]}),(0,s.jsx)(l.KL,{className:"absolute right-0 top-1/2 -translate-y-1/2 pointer-events-none",stroke:(null==t?void 0:t.fromTime)?"#0E0F11":"#BFBFBF",size:18})]})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("label",{className:"text-sm sm:text-base title-color font-medium",htmlFor:"end-date",children:"End"}),(0,s.jsxs)("div",{className:"flex gap-1 rounded-[10px] px-2.5 py-2 border border-[#F0F0F0] bg-white",children:[(0,s.jsxs)("div",{className:"relative flex-1 flex items-center justify-start gap-2 cursor-pointer",onClick:()=>v(!0),children:[(0,s.jsx)(l.Qu,{fill:m.to?"#0E0F11":"#BFBFBF",size:20}),(0,s.jsx)("input",{id:"end-date",type:"text",value:H(m.to),readOnly:!0,onClick:e=>{v(!0)},onChange:()=>{},className:"relative flex-1 w-full title-color text-base cursor-pointer placeholder:text-[#BFBFBF] focus:outline-none focus:ring-0",placeholder:"Add Date"}),(0,s.jsx)(l.KL,{stroke:m.to?"#0E0F11":"#BFBFBF",size:18})]}),(0,s.jsx)("span",{className:"text-[#E5E7EB]",children:"|"}),(0,s.jsxs)("div",{className:"relative flex-1 flex items-center justify-end gap-2",children:[(0,s.jsx)(l.T3,{size:20,color:(null==t?void 0:t.untilTime)?"#0E0F11":"#BFBFBF"}),(0,s.jsxs)("div",{className:"relative flex items-center",children:[(0,s.jsxs)("select",{className:"title-color text-base focus:outline-none transition appearance-none bg-white pr-6",value:null==t?void 0:t.untilTime,onChange:e=>i("untilTime",e.target.value),children:[(0,s.jsx)("option",{value:"",disabled:!0,children:"Time"}),(0,r.QR)().map((e,t)=>(0,s.jsx)("option",{value:e,children:e},t))]}),(0,s.jsx)(l.KL,{className:"absolute right-0 top-1/2 -translate-y-1/2 pointer-events-none",stroke:(null==t?void 0:t.untilTime)?"#0E0F11":"#BFBFBF",size:18})]})]})]})]}),f&&(0,s.jsx)(d,{range:m,setRange:e=>{x(e),e.from&&i("fromDate",e.from),e.to&&i("untilDate",e.to)},isCalendarOpen:f,field:p,setField:y,setIsCalendarOpen:v,months:1,blockedDates:[],styles:{},isLongTermRental:N}),(0,s.jsx)("button",{type:"button",className:"w-full rounded-[12px] py-3 mt-2 bg-cta text-cta-foreground hover:bg-cta-hover text-sm font-semibold transition-colors disabled:bg-pt-disabled-bg disabled:text-pt-disabled-fg disabled:cursor-not-allowed",onClick:w,disabled:b||S,children:S?"Detecting your location…":A}),b&&(0,s.jsx)("div",{className:"flex justify-center items-center gap-2 mt-2"})]})]}),Y&&(0,s.jsx)("div",{className:"fixed inset-x-0 bottom-0 z-[60] bg-white overflow-y-auto",style:{to
1p:"var(--visual-viewport-offset-top, 0px)"},children:(0,s.jsxs)("div",{className:"p-5 max-w-[420px] mx-auto min-h-full flex flex-col",children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-4",children:(0,s.jsx)("button",{type:"button","aria-label":"Close suggestions",onClick:G,className:"flex items-center justify-center w-8 h-8 rounded-full bg-[#F7F8F9] border border-[#F0F0F0]",children:(0,s.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.980431 0.979454C1.17569 0.784192 1.49228 0.784192 1.68754 0.979454L6.00065 5.29257L10.3138 0.979454C10.509 0.784192 10.8256 0.784192 11.0209 0.979454C11.2161 1.17472 11.2161 1.4913 11.0209 1.68656L6.70776 5.99967L11.0209 10.3128C11.2161 10.508 11.2161 10.8246 11.0209 11.0199C10.8256 11.2152 10.509 11.2152 10.3138 11.0199L6.00065 6.70678L1.68754 11.0199C1.49228 11.2152 1.17569 11.2152 0.980431 11.0199C0.785169 10.8246 0.785169 10.508 0.980431 10.3128L5.29354 5.99967L0.980431 1.68656C0.785169 1.4913 0.785169 1.17472 0.980431 0.979454Z",fill:"#000000"})})})}),(0,s.jsx)("div",{className:"relative flex items-center border-b border-[#E5E7EB] pb-3",children:(0,s.jsx)("input",{type:"text",className:"w-full pr-8 text-base leading-6 text-[#1F1F1F] placeholder:text-[#637381] focus:outline-none",placeholder:"City, airport, address or hotel",value:n,ref:Z,onChange:function(e){let t=e.target.value.trim();O(t.length>=3&&t.toLowerCase()!==D.toLowerCase()),h(e)},onFocus:()=>R(!0),autoFocus:!0,autoComplete:"off"})}),$&&(0,s.jsx)("div",{className:"pt-3 flex-1 flex flex-col",children:(0,s.jsx)("ul",{ref:P,className:"mobile-search-suggestions relative flex-1 overflow-y-auto overscroll-contain !hide-scrollbar",style:{WebkitOverflowScrolling:"touch",touchAction:"pan-y"},children:(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[J&&(0,s.jsxs)("li",{children:[(0,s.jsxs)("button",{type:"button",onClick:()=>{S||null==T||T()},disabled:S,className:"group flex w-full items-center gap-3 rounded-xl text-left ".concat(S?"cursor-wait opacity-70":""),children:[(0,s.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#F3F4F6]",children:(0,s.jsx)(l.Ve,{width:20,height:20,className:"text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",fillColor:"currentColor"})}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[(0,s.jsx)("p",{className:"m-0 text-base leading-6 font-medium text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",children:S?"Detecting your location…":"Current location"}),S&&(0,s.jsx)("span",{"aria-label":"Detecting your location",className:"inline-block h-4 w-4 flex-shrink-0 animate-spin rounded-full border-2 border-[#E5E7EB] border-t-[#027BFF]"})]})]}),E&&(0,s.jsx)("p",{role:"alert",className:"m-0 mt-1 w-full text-sm font-medium leading-5 text-[#D92D20]",children:E})]}),J&&_.length>0&&(0,s.jsx)("li",{children:_.slice(0,3).map((e,t)=>{let i;let a={width:20,height:20,className:"text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",fillColor:"currentColor"};return i="airport"===e.type?(0,s.jsx)(l.hi,{...a}):"hotel"===e.type?(0,s.jsx)(l.Zf,{...a}):"address"===e.type?(0,s.jsx)(l.Zx,{...a}):(0,s.jsx)(l.Ie,{...a}),(0,s.jsxs)("button",{type:"button",onClick:()=>{null==L||L(e),G()},className:"group mb-2 flex w-full items-center gap-3 rounded-xl text-left",children:[(0,s.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#F3F4F6]",children:i}),(0,s.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden",children:(0,s.jsx)("p",{"data-pii":!0,className:"m-0 truncate text-base leading-6 font-medium text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",children:(0,r.Zj)(e.formatted_address)})})]},"mobile-home-".concat(t))})}),J&&k.length>0&&(0,s.jsxs)("li",{children:[(0,s.jsx)("p",{className:"m-0 pb-2 text-sm font-semibold text-[#595959]",children:"History"}),k.slice(0,3).map((e,t)=>(0,s.jsxs)("button",{type:"button",onClick:()=>{null==L||L(e),G()},className:"group mb-2 flex w-full items-center gap-3 rounded-xl text-left",children:[(0,s.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#F3F4F6]",children:(0,s.jsx)(l.F_,{width:20,height:20,className:"text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",fillColor:"currentColor"})}),(0,s.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden",children:(0,s.jsx)("p",{"data-pii":!0,className:"m-0 truncate text-base leading-6 font-medium text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",children:(0,r.Zj)(e.formatted_address)})})]},"mobile-recent-".concat(t)))]}),u.airport&&u.airport.length>0&&(0,s.jsxs)("li",{children:[(0,s.jsx)("p",{className:"m-0 pb-2 text-sm font-semibold text-[#595959]",children:"Airports"}),u.airport.map((e,t)=>(0,s.jsxs)("button",{type:"button",onClick:()=>{g(e,"airport"),G()},className:"group mb-2 flex w-full items-center gap-3 rounded-xl text-left",children:[(0,s.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#F3F4F6]",children:(0,s.jsx)(l.hi,{width:20,height:20,className:"text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",fillColor:"currentColor"})}),(0,s.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden",children:(0,s.jsx)("span",{className:"m-0 block truncate text-base leading-6 font-medium text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",children:e.name||""})})]},t))]}),u.city&&u.city.length>0&&(0,s.jsxs)("li",{children:[(0,s.jsx)("p",{className:"m-0 pb-2 text-sm font-semibold text-[#595959]",children:"Cities"}),u.city.map((e,t)=>(0,s.jsxs)("button",{type:"button",onClick:()=>{g(e,"city"),G()},className:"group mb-2 flex w-full items-center gap-3 rounded-xl text-left",children:[(0,s.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#F3F4F6]",children:(0,s.jsx)(l.Ie,{width:20,height:20,className:"text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",fillColor:"currentColor"})}),(0,s.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden",children:(0,s.jsx)("span",{"data-pii":!0,className:"m-0 block truncate text-base leading-6 font-medium text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",children:(0,r.Zj)(e.formatted_address||"")})})]},t))]}),u.address&&u.address.length>0&&(0,s.jsxs)("li",{children:[(0,s.jsx)("p",{className:"m-0 pb-2 text-sm font-semibold text-[#595959]",children:"Train stations"}),u.address.map((e,t)=>(0,s.jsxs)("button",{type:"button",onClick:()=>{g(e,"address"),G()},className:"group mb-2 flex w-full items-center gap-3 rounded-xl text-left",children:[(0,s.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#F3F4F6]",children:(0,s.jsx)(l.Zx,{width:20,height:20,className:"text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",fillColor:"currentColor"})}),(0,s.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden",children:(0,s.jsx)("span",{"data-pii":!0,className:"m-0 block truncate text-base leading-6 font-medium text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",children:(0,r.Zj)(e.formatted_address||"")})})]},t))]}),u.hotel&&u.hotel.length>0&&(0,s.jsxs)("li",{children:[(0,s.jsx)("p",{className:"m-0 pb-2 text-sm font-semibold text-[#595959]",children:"Hotels"}),u.hotel.map((e,t)=>(0,s.jsxs)("button",{type:"button",onClick:()=>{g(e,"hotel"),G()},className:"group mb-2 flex w-full items-center gap-3 rounded-xl text-left",children:[(0,s.jsx)("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-[#F3F4F6]",children:(0,s.jsx)(l.Zf,{width:20,height:20,className:"text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",fillColor:"currentColor"})}),(0,s.jsx)("div",{className:"min-w-0 flex-1 overflow-hidden",children:(0,s.jsx)("span",{className:"m-0 block truncate text-base leading-6 font-medium text-[#1F1F1F] transition-colors duration-200 group-hover:text-[#027BFF]",children:e.name||""})})]},t))]})]})})})]})})]})})}},67211:function(e,t,i){var s=i(27573);t.Z=e=>{let{width:t=16,height:i=16,fill:a="#0E0F11"}=e;return(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:i,viewBox:"0 0 18 18",fill:"none",children:(0,s.jsx)("path",{d:"M8.16637 0.0419922C3.67919 0.0421488 0.0413666 3.67977 0.0413666 8.16699C0.0415421 12.6541 3.67929 16.2918 8.16637 16.292C10.1851 16.292 12.0306 15.5536 13.4515 14.335L16.891 17.7754C17.1351 18.0195 17.5317 18.0195 17.7757 17.7754C18.0195 17.5314 18.0194 17.1356 17.7757 16.8916L14.3363 13.4512C15.5544 12.0304 16.2913 10.1852 16.2914 8.16699C16.2914 3.67968 12.6537 0.0419922 8.16637 0.0419922ZM8.16637 1.29199C11.9633 1.29199 15.0414 4.37003 15.0414 8.16699C15.0412 11.9638 11.9632 15.042 8.16637 15.042C4.36965 15.0418 1.29154 11.9637 1.29137 8.16699C1.29137 4.37013 4.36954 1.29215 8.16637 1.29199Z",fill:a})})}},7544:function(e,t,i){i.d(t,{g:function(){return o}});var s=i(89825),a=i(18265);class l{generateSessionId(){return"session_".concat(Date.now(),"_").concat(Math.random().toString(36).substr(2,9))}getUserId(){return(0,a.$)("userId")||(0,a.$)("user_id")||void 0}getBaseMetadata(){return{pageUrl:window.location.href,referrer:"undefined"!=typeof document?document.referrer:void 0}}async logActivity(e,t,i){let s={userId:this.getUserId(),sessionId:this.sessionId,activityType:e,activityCategory:t,metadata:{...this.getBaseMetadata(),...i}};this.addToBatch(s)}addToBatch(e){this.pendingActivities.push(e),this.pendingActivities.length>=this.BATCH_SIZE?this.sendBatch():this.batchTimeout||(this.batchTimeout=setTimeout(()=>{this.sendBatch()},this.BATCH_DELAY))}async sendBatch(){if(0===this.pendingActivities.length)return;let e=[...this.pendingActivities];this.pendingActivities=[],this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=null);try{1===e.length?await s.ZP.post("/activity/log",e[0]):await s.ZP.post("/activity/bulk",{activities:e})}catch(e){console.error("Failed to send activity batch:",e)}}async flush(){await this.sendBatch()}flushSync(){if(0===this.pendingActivities.length)return;let e=[...this.pendingActivities];this.pendingActivities=[],this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=null);let t="https://apiprod.upcar.ai/v1";if(!t||"undefined"==typeof navigator||!navigator.sendBeacon)return;let[i,s]=1===e.length?["".concat(t,"/activity/log"),e[0]]:["".concat(t,"/activity/bulk"),{activities:e}];navigator.sendBeacon(i,new Blob([JSON.stringify(s)],{type:"application/json"}))}async logPageView(e){await this.logActivity("page_view","navigation",e)}async logCarViewed(e,t){await this.logActivity("viewed_car","navigation",{carId:e,...t})}async logCarDetailsViewed(e,t){await this.logActivity("viewed_car_details","navigation",{carId:e,...t})}async logSearchPerformed(e,t){await this.logActivity("searched_cars","navigation",{searchQuery:e,...t})}async logFilterApplied(e,t,i){await this.logActivity("filtered_cars","navigation",{filterType:e,filterValue:t,...i})}async logCheckoutPageVisit(e,t,i){await this.logActivity("checkout_page_visit","navigation",{carId:e,tripId:t,...i})}async logProfilePageVisit(e){await this.logActivity("profile_page_visit","navigation",e)}async logDashboardVisit(e){await this.logActivity("dashboard_visit","navigation",e)}async logButtonClick(e,t){await this.logActivity("clicked_button","interaction",{buttonClicked:e,...t})}async logLinkClick(e,t,i){await this.logActivity("clicked_link","interaction",{linkUrl:e,linkText:t,...i})}async logFormSubmitted(e,t){await this.logActivity("form_submitted","interaction",{formName:e,...t})}
1async logFieldFocused(e,t,i){await this.logActivity("form_field_focused","interaction",{fieldName:e,formName:t,...i})}async logImageClicked(e,t){await this.logActivity("image_clicked","interaction",{imageUrl:e,...t})}async logVideoPlayed(e,t){await this.logActivity("video_played","interaction",{videoUrl:e,...t})}async logDownloadStarted(e,t,i){await this.logActivity("download_started","interaction",{fileName:e,fileUrl:t,...i})}async logPaymentAdded(e,t){await this.logActivity("payment_added","transaction",{paymentMethodId:e,...t})}async logPaymentUpdated(e,t){await this.logActivity("payment_updated","transaction",{paymentMethodId:e,...t})}async logPaymentDeleted(e,t){await this.logActivity("payment_deleted","transaction",{paymentMethodId:e,...t})}async logBookingStarted(e,t,i){await this.logActivity("booking_started","transaction",{carId:e,tripId:t,...i})}async logBookingCompleted(e,t,i,s){await this.logActivity("booking_completed","transaction",{bookingId:e,carId:t,amount:i,currency:"USD",...s})}async logBookingCancelled(e,t,i){await this.logActivity("booking_cancelled","transaction",{bookingId:e,cancellationReason:t,...i})}async logTripStarted(e,t,i){await this.logActivity("trip_started","transaction",{tripId:e,carId:t,...i})}async logTripCompleted(e,t,i){await this.logActivity("trip_completed","transaction",{tripId:e,carId:t,...i})}async logTripCancelled(e,t,i){await this.logActivity("trip_cancelled","transaction",{tripId:e,cancellationReason:t,...i})}async logReviewSubmitted(e,t,i,s){await this.logActivity("review_submitted","engagement",{carId:e,rating:t,tripId:i,...s})}async logMessageSent(e,t,i,s){await this.logActivity("message_sent","engagement",{messageId:e,recipientId:t,messageType:i,...s})}async logNotificationClicked(e,t,i){await this.logActivity("notification_clicked","engagement",{notificationId:e,notificationType:t,...i})}async logEmailOpened(e,t,i){await this.logActivity("email_opened","engagement",{emailId:e,campaignId:t,...i})}async logEmailClicked(e,t,i){await this.logActivity("email_clicked","engagement",{emailId:e,linkUrl:t,...i})}async logShareAction(e,t,i,s){await this.logActivity("share_action","engagement",{contentType:e,contentId:t,platform:i,...s})}async logFavoriteAdded(e,t){await this.logActivity("favorite_added","engagement",{carId:e,...t})}async logFavoriteRemoved(e,t){await this.logActivity("favorite_removed","engagement",{carId:e,...t})}async logLogin(e){await this.logActivity("login","system",e)}async logLogout(e){await this.logActivity("logout","system",e)}async logRegistration(e){await this.logActivity("registration","system",e)}async logPasswordReset(e){await this.logActivity("password_reset","system",e)}async logProfileUpdated(e,t){await this.logActivity("profile_updated","system",{fieldsUpdated:e,...t})}async logSettingsChanged(e,t,i,s){await this.logActivity("settings_changed","system",{settingName:e,oldValue:t,newValue:i,...s})}async logError(e,t,i,s){await this.logActivity("error_occurred","system",{errorCode:e,errorMessage:t,stackTrace:i,...s})}async logSessionTimeout(e){await this.logActivity("session_timeout","system",e)}async getActivities(e){try{return(await s.ZP.get("/activity",{params:e})).data}catch(e){throw console.error("Failed to fetch activities:",e),e}}async getAnalytics(e,t){try{let i={};return e&&(i.startDate=e),t&&(i.endDate=t),(await s.ZP.get("/activity/analytics",{params:i})).data}catch(e){throw console.error("Failed to fetch analytics:",e),e}}async getUserJourney(e){try{return(await s.ZP.get("/activity/journey?userId=".concat(e))).data}catch(e){throw console.error("Failed to fetch user journey:",e),e}}async getActivityTypes(){try{return(await s.ZP.get("/activity/types")).data}catch(e){throw console.error("Failed to fetch activity types:",e),e}}constructor(){this.pendingActivities=[],this.batchTimeout=null,this.BATCH_SIZE=50,this.BATCH_DELAY=2e3,this.sessionId=this.generateSessionId()}}let o=new l;window.addEventListener("beforeunload",()=>{o.flushSync()})},60193:function(e,t,i){i.d(t,{H:function(){return a},o:function(){return l}});var s=i(87685);async function a(e,t,i,s){try{let t=null==e?void 0:e.homeLocation;if(t&&t.length>0){let e=t[t.length-1];if((null==e?void 0:e.latitude)&&(null==e?void 0:e.longitude)){let t=e.address&&[e.address.city,e.address.state].filter(
1Boolean).join(", ")||s;return{latitude:String(e.latitude),longitude:String(e.longitude),address:t}}}}catch(e){console.warn("[resolveDefaultLocation] Failed to read user homeLocation:",e)}try{let e=await fetch("https://ipapi.co/json/",{signal:AbortSignal.timeout(3e3)});if(e.ok){let t=await e.json();if(t.latitude&&t.longitude&&t.city){let e=[t.city,t.region_code||t.region].filter(Boolean).join(", ")||t.city;return{latitude:String(t.latitude),longitude:String(t.longitude),address:e}}}}catch(e){console.warn("[resolveDefaultLocation] IP geolocation failed:",e)}return{latitude:t,longitude:i,address:s}}async function l(e,t,i){let a={latitude:e,longitude:t,address:i};if(!navigator.geolocation)return a;let l=await (0,s.I0)();return l.ok?{latitude:String(l.lat),longitude:String(l.lng),address:l.formattedAddress&&l.formattedAddress!==s.i?l.formattedAddress:i}:a}}}]);

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.