PageSourceSearch

https://velaflow.com/_next/static/chunks/9677-0ef551a479e806f6.js

js velaflow.com collected 2026-10-01 16:26:22 UTC 17,687 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9677],{18847:(e,l,t)=>{e.exports=t(52496)},41224:(e,l,t)=>{"use strict";t.d(l,{A:()=>j});var a=t(37876),r=t(14232),n=t(10553),s=t(96145);let i=e=>{let{handleInputChange:l,formData:t,handleSubmit:r,loader:n,placesSearchInput:i,categories:d,errors:o,apiErrors:c,currencySymbol:u}=e,p=(()=>{let e=new Date().getFullYear(),l=[];for(let t=e;t>e-30;t--)l.push(t);return l})();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"text-14 text-black font-medium mb-3",children:"Required"}),(0,a.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,a.jsx)(s.pd,{name:"title",placeholder:"Title",className:"border border-black rounded-md px-3 py-2 text-12 placeholder-black text-black w-full",value:null==t?void 0:t.title,onChange:l}),(null==o?void 0:o.title)&&(0,a.jsx)("p",{className:"text-12 text-red !mt-0",children:o.title}),(0,a.jsxs)("div",{className:"relative w-full",children:[(0,a.jsx)("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-black text-12 z-10 pointer-events-none",children:u}),(0,a.jsx)(s.pd,{name:"price",placeholder:"Price",className:" border border-black rounded-md px-3 py-2 pl-8 text-12 placeholder-black text-black w-full bg-transparent ",value:null==t?void 0:t.price,onChange:l})]}),(null==o?void 0:o.price)&&(0,a.jsx)("p",{className:"text-12 text-red !mt-0",children:o.price}),(0,a.jsxs)("select",{name:"year",className:"border border-black rounded-md text-black px-3 py-2 text-12 w-full",value:null==t?void 0:t.year,onChange:l,children:[(0,a.jsx)("option",{hidden:!0,children:"Year of Manufacturing"}),null==p?void 0:p.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(null==o?void 0:o.year)&&(0,a.jsx)("p",{className:"text-12 text-red !mt-0",children:o.year}),(0,a.jsx)(s.pd,{name:"details",placeholder:"Details",className:"border border-black rounded-md px-3 py-2 text-12 text-black placeholder-black w-full",value:null==t?void 0:t.details,onChange:l}),(null==o?void 0:o.details)&&(0,a.jsx)("p",{className:"text-12 text-red !mt-0",children:o.details}),(0,a.jsxs)("select",{name:"condition",value:null==t?void 0:t.condition,className:"border border-black rounded-md px-3 py-2 text-12 text-black w-full",onChange:l,children:[(0,a.jsx)("option",{hidden:!0,children:"Condition"}),(0,a.jsx)("option",{value:"new",children:"New"}),(0,a.jsx)("option",{value:"used",children:"Used"}),(0,a.jsx)("option",{value:"refurbished",children:"Refurbished"})]}),(null==o?void 0:o.condition)&&(0,a.jsx)("p",{className:"text-12 text-red !mt-0",children:o.condition}),(0,a.jsxs)("select",{name:"category",className:"border border-black rounded-md text-black px-3 py-2 text-12 w-full",value:null==t?void 0:t.category,onChange:l,children:[(0,a.jsx)("option",{hidden:!0,children:"Category"}),null==d?void 0:d.map(e=>(0,a.jsx)("option",{value:null==e?void 0:e.id,children:null==e?void 0:e.name},null==e?void 0:e.id))]}),(null==o?void 0:o.category)&&(0,a.jsx)("p",{className:"text-12 text-red !mt-0",children:o.category}),i,(null==o?void 0:o.lat)&&(0,a.jsx)("p",{className:"text-12 text-red !mt-0",children:o.lat}),(0,a.jsx)(s.$n,{onClick:r,disabled:n,className:"bg-primary text-14 font-normal text-white rounded-md py-2 mt-3 hover:bg-blue-700",children:n?(0,a.jsx)("div",{className:"flex justify-center items-center",children:(0,a.jsx)(s.aH,{className:"text-white"})}):"Publish"}),c&&(null==c?void 0:c.length)>0&&(null==c?void 0:c.map((e,l)=>(0,a.jsx)("p",{className:"text-red text-12",children:e},"".concat(e,"-").concat(l))))]})]})};var d=t(81220),o=t(89099),c=t(95754),u=t(18847),p=t.n(u),m=t(91408),x=t(97685),h=t(10841),f=t.n(h),b=t(54587),g=t.n(b);let v=p()(()=>Promise.all([t.e(9759),t.e(1423)]).then(t.bind(t,91423)),{loadableGenerated:{webpack:()=>[91423]},ssr:!1}),y=m.Ik().shape({title:m.Yj().required("Title is required"),price:m.Yj().required("Price is required"),year:m.Yj().required("Year is required"),details:m.Yj().required("Details are required"),condition:m.Yj().required("Condition is required"),category:m.Yj().required("Category is required"),lat:m.Yj().required("Location is required")}),j=e=>{var l,t,u,p,m,h,b,j,w;let{categories:N,listingDetail:_={},isEdit:k=!1}
1=e,C=(0,r.useRef)(null),E=(0,o.useRouter)(),D=(null==E||null==(l=E.query)?void 0:l.slug)==="vehicle",{data:L}=(0,n.useSession)(),R=null==L||null==(t=L.user)?void 0:t.userData,P=null!=(w=null==L||null==(m=L.user)||null==(p=m.userData)||null==(u=p.country_details)?void 0:u.currency_symbol)?w:"",O="".concat(null==R?void 0:R.first_name," ").concat(null==R?void 0:R.last_name),S="@".concat(null==R?void 0:R.username),Y=(null==L||null==(b=L.user)||null==(h=b.userData)?void 0:h.profile_pic)||"/images/profile-image.jpg",[q,A]=(0,r.useState)([]),[T,M]=(0,r.useState)(0),[F,V]=(0,r.useState)(!1),[I,U]=(0,r.useState)([]),[Z,G]=(0,r.useState)([]),[B,H]=(0,r.useState)(k?{title:null==_?void 0:_.title,price:null==_?void 0:_.price,year:null==_?void 0:_.year,details:null==_?void 0:_.description,condition:null==_?void 0:_.condition_type,category:null==_?void 0:_.category_id}:{title:"",price:"",year:"",details:"",condition:"",category:""}),[$,z]=(0,r.useState)(null),[K,W]=(0,r.useState)(k?{lat:Number(null==_?void 0:_.latitude),lng:Number(null==_?void 0:_.longitude),address:null==_?void 0:_.address}:{lat:51.5074,lng:-.1278,address:"London, United Kingdom"});(0,r.useEffect)(()=>{k&&(null==_?void 0:_.photos)&&(A(_.photos.map(e=>({url:e.url,id:null==e?void 0:e.id,isExisting:!0}))),M(0))},[k,_]),(0,r.useEffect)(()=>()=>null==q?void 0:q.forEach(e=>URL.revokeObjectURL(e)),[q]);let X=async()=>{try{await y.validate({...B,...K},{abortEarly:!1}),V(!0),z({})}catch(l){let e={};l.inner?l.inner.forEach(l=>{e[l.path]=l.message}):e[l.path]=l.message,z(e);return}let e=new FormData;e.append("title",null==B?void 0:B.title),e.append("description",null==B?void 0:B.details),e.append("price",null==B?void 0:B.price),e.append("currency","INR"),e.append("condition_type",(null==B?void 0:B.condition)||"new"),e.append("category_id",null==B?void 0:B.category),e.append("primary_photo_index",T),e.append("latitude",null==K?void 0:K.lat),e.append("longitude",null==K?void 0:K.lng),e.append("address",null==K?void 0:K.address),e.append("year",null==B?void 0:B.year),(null==Z?void 0:Z.length)>0&&Z.forEach(l=>e.append("delete_photo_ids[]",l)),q.forEach(l=>!(null==l?void 0:l.isExisting)&&e.append("media[]",l));try{let r=k?await (0,d.Rp)(e,null==_?void 0:_.id):await (0,d.G1)(e);if(r.error){var l,t,a;let e=Object.values(null==(a=r.message)||null==(t=a.response)||null==(l=t.data)?void 0:l.errors).flat();U(e)}else x.Ay.success(null==r?void 0:r.message),E.push("/marketplace")}catch(e){console.error(e)}finally{V(!1)}},J=(0,a.jsx)("div",{className:"w-full max-w-xl",children:(0,a.jsx)(c.A,{onSelect:(e,l,t)=>W({lat:e,lng:l,address:t}),location:K})}),Q=null==_?void 0:_.updated_at,ee=f()(),el=f()(Q),et=24>ee.diff(el,"hours")?el.fromNow():el.format("MMM D, YYYY");return(0,a.jsxs)("div",{className:"min-h-screen mb-[50px] md:mb-0 bg-gray-100 flex flex-col lg:flex-row justify-center items-start lg:items-start gap-6 p-4 lg:p-10",children:[(0,a.jsxs)("div",{className:"md:hidden flex items-center",children:[(0,a.jsx)(s.In,{onClick:()=>E.push("/marketplace"),id:"arrow-left-icn",className:"w-5 h-5 align-middle inline-block cursor-pointer"}),(0,a.jsx)(s.DZ,{type:"h2",text:"Back",className:"text-14 text-black ml-2"})]}),(0,a.jsxs)("div",{className:"bg-white rounded-md shadow-md w-full lg:w-[60%] flex flex-col lg:flex-row",children:[(0,a.jsx)("div",{className:"".concat((null==q?void 0:q[T])?"w-full h-64 sm:h-80 lg:h-[540px]":"w-full sm:w-full h-64 sm:h-80 lg:w-[500px] lg:h-[540px]"," bg-[#F1F1F1] m-4 lg:m-6 rounded-md flex items-center justify-center relative max-w-full overflow-hidden mx-auto"),children:(0,a.jsx)(s.Zc,{src:q[T]?(null==(j=q[T])?void 0:j.isExisting)?q[T].url:q[T]instanceof File?URL.createObjectURL(q[T]):"/images/sampleCar.png":"/images/sampleCar.png",alt:"Car",className:"w-full h-full object-contain"})}),(0,a.jsxs)("div",{className:"p-4 lg:p-6 flex flex-col justify-between w-full lg:w-[320px]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(s.DZ,{type:"h3",className:"text-[20px] font-normal text-black mb-2",children:(null==B?void 0:B.title)||"Title"}),(0,a.jsx)("p",{className:"text-[20px] font-medium mb-2 text-black",children:(null==B?void 0:B.price)?"".concat(P).concat(B.price):"Price"}),k&&(0,a.jsxs)("p",{className:"text-[16px] text-black font-normal",children:["Listed ",et]}),(0,a.jsx)("p",{className:"text-[16px] text-black font-normal mb-6",children:(null==K?void 0:K.address)||"Location will appear here"}),(0,a.jsx)("hr",{className:"border-gray-200 mb-5"}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsx)("p",{className:"font-regular text-[20px] text-black mb-1",children:"Year"}),(0,a.jsx)("p",{className:"text-black text-[16px] text-regular",children:(null==B?void 0:B.year)||"year will appear here"})]}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsx)("p",{className:"font-regular text-[20px] text-black mb-1",children:"Details"}),(0,a.jsx)("p",{className:"text-black text-[16px] text-regular",children:(null==B?void 0:B.details)||"Details will appear here"})]}),(0,a.jsxs)("div",{className:"mb-5",children:[(0,a.jsx)("p",{className:"font-regular text-[20px] text-black mb-1",children:"Location"}),(0,a.jsx)("p",{className:"text-black text-[16px] text-regular",children:(null==K?void 0:K.address)||"Location will appear here"}),(0,a.jsx)("div",{className:"w-full max-w-2xl h-48 lg:h-64 mt-2",children:(0,a.jsx)(v,{lat:K.lat,lng:K.lng})})]})]}),(0,a.jsxs)("div",{className:"pt-4 border-t border-gray-200 flex flex-col lg:flex-row items-start lg:items-center gap-3",children:[(0,a.jsx)(s.Zc,{src:Y,alt:O,className:"w-10 h-10 rounded-full object-cover"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-14 font-normal text-black",children:O}),(0,a.jsx)("p",{className:"text-12 text-black font-normal",children:S})]})]})]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-md shadow-md px-4 sm:px-8 py-6 lg:py-20 w-full lg:w-[400px] flex flex-col",children:[(0,a.jsxs)("div",{className:"hidden md:flex items-center mb-6",children:[(0,a.jsx)(s.In,{onClick:()=>E.push("/marketplace"),id:"arrow-left-icn",className:"w-5 h-5 align-middle inline-block cursor-pointer"}),(0,a.jsx)(s.DZ,{type:"h2",text:"Back",className:"text-14 text-black ml-2"})]}),(0,a.jsx)(s.DZ,{type:"h2",className:"text-[28px] sm:text-[34px] font-normal mb-6",children:"".concat(D?"Vehicle":"Item"," for sale")}),(0,a.jsxs)("div",{className:"flex items-center space-x-3 mb-4",children:[(0,a.jsx)(s.Zc,{src:Y,alt:O,className:"w-10 h-10 rounded-full object-cover"}),(0,a.jsx)("p",{className:"text-14 text-black font-normal",children:O})]}),(0,a.jsx)("hr",{className:"border-gray-200 mb-6"}),(0,a.jsxs)("div",{className:"mb-6 flex flex-wrap gap-2",children:[null==q?void 0:q.map((e,l)=>(0,a.jsxs)("div",{className:"relative border ".concat(l===T&&"border-blue-600"," rounded-md p-1"),onClick:()=>M(l),children:[(0,a.jsx)(g(),{width:300,height:300,src:"string"==typeof e?e:(null==e?void 0:e.url)?e.url:URL.createObjectURL(e),alt:"Car ".concat(l+1),className:"w-16 h-12 sm:w-20 sm:h-16 object-contain"}),(0,a.jsx)("button",{onClick:()=>((e,l)=>{var t,a;(null==q||null==(t=q[l])?void 0:t.isExisting)&&G([...Z,null==q||null==(a=q[l])?void 0:a.id]),A(l=>l.filter(l=>l!==e)),M(0)})(e,l),className:"absolute -top-2 -right-2 bg-blue-600 text-white rounded-full w-4 h-4 flex justify-center items-center text-xs","aria-label":"Remove image",type:"button",children:"\xd7"})]},l)),(0,a.jsx)(s.pd,{type:"file",ref:C,accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{let l=Array.from(e.target.files||[]);A(e=>{let t=[...e,...l].slice(0,10);return t.length>10&&alert("You can upload at most 10 images."),t}),e.target.value=""}}),(0,a.jsx)(s.$n,{type:"button",onClick:()=>C.current&&C.current.click(),className:"w-16 h-12 border border-grey rounded-md flex items-center justify-center text-xs text-gray-400 cursor-pointer bg-gray-50 hover:bg-gray-100","aria-label":"Add more photos",children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{d:"M12 4v16m8-8H4"})})})]}),(0,a.jsx)(i,{handleInputChange:e=>{let{type:l,checked:t,name:a,value:r}=e.target;H({...B,[a]:"checkbox"===l?t:r})},formData:B,handleSubmit:X,loader:F,placesSearchInput:J,categories:N,errors:$,apiErrors:I,currencySymbol:P})]})]})}},52496:(e,l,t)=>{"use strict";
1Object.defineProperty(l,"__esModule",{value:!0}),!function(e,l){for(var t in l)Object.defineProperty(e,t,{enumerable:!0,get:l[t]})}(l,{default:function(){return i},noSSR:function(){return s}});let a=t(64252);t(37876),t(14232);let r=a._(t(90295));function n(e){return{default:(null==e?void 0:e.default)||e}}function s(e,l){return delete l.webpack,delete l.modules,e(l)}function i(e,l){let t=r.default,a={loading:e=>{let{error:l,isLoading:t,pastDelay:a}=e;return null}};e instanceof Promise?a.loader=()=>e:"function"==typeof e?a.loader=e:"object"==typeof e&&(a={...a,...e});let i=(a={...a,...l}).loader;return(a.loadableGenerated&&(a={...a,...a.loadableGenerated},delete a.loadableGenerated),"boolean"!=typeof a.ssr||a.ssr)?t({...a,loader:()=>null!=i?i().then(n):Promise.resolve(n(()=>null))}):(delete a.webpack,delete a.modules,s(t,a))}("function"==typeof l.default||"object"==typeof l.default&&null!==l.default)&&void 0===l.default.__esModule&&(Object.defineProperty(l.default,"__esModule",{value:!0}),Object.assign(l.default,l),e.exports=l.default)},80612:(e,l,t)=>{"use strict";t.d(l,{A:()=>s});var a=t(37876),r=t(77328),n=t.n(r);function s(e){let{title:l}=e;return(0,a.jsx)(n(),{children:(0,a.jsx)("title",{children:l?"".concat(l," | Velaflow"):"Velaflow"})})}},86581:(e,l,t)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(l,"LoadableContext",{enumerable:!0,get:function(){return a}});let a=t(64252)._(t(14232)).default.createContext(null)},90295:(e,l,t)=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(l,"default",{enumerable:!0,get:function(){return p}});let a=t(64252)._(t(14232)),r=t(86581),n=[],s=[],i=!1;function d(e){let l=e(),t={loading:!0,loaded:null,error:null};return t.promise=l.then(e=>(t.loading=!1,t.loaded=e,e)).catch(e=>{throw t.loading=!1,t.error=e,e}),t}class o{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:l}=this;e.loading&&("number"==typeof l.delay&&(0===l.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},l.delay)),"number"==typeof l.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},l.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,l){this._loadFn=e,this._opts=l,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function c(e){return function(e,l){let t=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},l),n=null;function d(){if(!n){let l=new o(e,t);n={getCurrentValue:l.getCurrentValue.bind(l),subscribe:l.subscribe.bind(l),retry:l.retry.bind(l),promise:l.promise.bind(l)}}return n.promise()}if(!i){let e=t.webpack&&1?t.webpack():t.modules;e&&s.push(l=>{for(let t of e)if(l.includes(t))return d()})}function c(e,l){d();let s=a.default.useContext(r.LoadableContext);s&&Array.isArray(t.modules)&&t.modules.forEach(e=>{s(e)});let i=a.default.useSyncExternalStore(n.subscribe,n.getCurrentValue,n.getCurrentValue);return a.default.useImperativeHandle(l,()=>({retry:n.retry}),[]),a.default.useMemo(()=>{var l;return i.loading||i.error?a.default.createElement(t.loading,{isLoading:i.loading,pastDelay:i.pastDelay,timedOut:i.timedOut,error:i.error,retry:n.retry}):i.loaded?a.default.createElement((l=i.loaded)&&l.default?l.default:l,e):null},[e,i])}return c.preload=()=>d(),c.displayName="LoadableComponent",a.default.forwardRef(c)}(d,e)}function u(e,l){let t=[];for(;e.length;){let a=e.pop();t.push(a(l))}return Promise.all(t).then(()=>{if(e.length)return u(e,l)})}c.preloadAll=()=>new Promise((e,l)=>{u(n).then(e,l)}),c.preloadReady=e=>(void 0===e&&(e=[]),new Promise(l=>{let t=()=>(i=!0,l());u(s,e).then(t,t)})),window.__NEXT_PRELOADREADY=c.preloadReady;let p=c},95754:(e,l,t)=>{"use strict";t.d(l,{A:()=>n});var a=t(37876),r=t(14232);function n(e){let{onSelect:l,location:t}=e,n=(0,r.useRef)(null);return(0,r.useEffect)(()=>
1{if(console.log(window.google,"gg"),!window.google||!window.google.maps)return;let e=new google.maps.places.Autocomplete(n.current,{types:["geocode"],fields:["geometry","formatted_address"]});console.log(e,"autocomplete"),e.addListener("place_changed",()=>{var t,a,r,n;let s=e.getPlace(),i=null==s||null==(a=s.geometry)||null==(t=a.location)?void 0:t.lat();l(i,null==s||null==(n=s.geometry)||null==(r=n.location)?void 0:r.lng(),(null==s?void 0:s.formatted_address)||"")})},[l]),(0,a.jsx)("input",{ref:n,type:"text",placeholder:"Location",onChange:e=>{""===e.target.value&&l(null,null,"")},defaultValue:null==t?void 0:t.address,className:"border border-black rounded-md px-3 py-2 text-12 text-black placeholder-black w-full"})}}}]);

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.