1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="af55c25f-2551-4707-a358-a68ca7a83497",e._sentryDebugIdIdentifier="sentry-dbid-af55c25f-2551-4707-a358-a68ca7a83497")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3285],{20998:function(e,r,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mesh/job-board/available-jobs",function(){return i(34046)}])},34046:function(e,r,i){"use strict";i.r(r),i.d(r,{default:function(){return ec}});var l=i(85893),s=i(67294),o=i(11163),n=i(39332),t=i(68029),a=i(90092),d=i(5490),c=i(34614),u=i(26840),x=i(57391),p=i(21360),g=i(70010),h=i(4296),b=i(82206),f=i(89342),v=i(48899),j=i(52867),y=i(73636),m=i(12553),S=i(38491),w=i(45443),z=i(8186),C=i(64831),R=i(83658),k=i(12519),B=i(46572),W=i(74032),T=i(26972),_=i(86523),D=i(8573),I=i(79433),U=i(18948),E=i(5907),O=i(56524),A=i(23171),N=i(23961),P=i(52587),J=i(90084),L=i(31529),F=i(18471),Z=i(45007),q=i(61656),G=i(68730),$=i(31422),M=i(29138),X=i(49702),Y=i(25593);function H(e){return"viewed_requests_".concat(e)}function V(e,r){try{localStorage.setItem(e,JSON.stringify(r))}catch(e){}}var K=i(82658),Q=i(37750),ee=i(83454);let er="#222E50",ei=["Plumber","Carpenter","Electrician","Painter","Bricklayer/Tiler","Auto Mechanic","Refrigeration / AC","Furniture Maker","Beauty / Personal Care Professional","General Cleaning Services","Mason","Welder","Fashion / Tailoring","Auto Electrician","Solar Technician","Caterer","Event Planner","Gardener","Security Installer","Generator Technician","Event / Party Rental","Generator Rental"],el=[{label:"All Time",value:"all"},{label:"Last 3 Days",value:"3days"},{label:"Last Week",value:"week"},{label:"Last Month",value:"month"}],es=[{label:"Newest First",value:"newest"},{label:"Nearest First",value:"closest"}],eo=[{label:"500m",value:500},{label:"2km",value:2e3},{label:"5km",value:5e3},{label:"10km",value:1e4}],en=e=>{let{label:r,active:i,onClick:s,icon:o}=e;return(0,l.jsxs)(t.x,{as:"button",onClick:s,px:4,py:2,borderRadius:"full",border:"1.5px solid",borderColor:i?er:"gray.200",bg:i?er:"white",color:i?"white":"gray.500",fontSize:"13px",fontWeight:i?700:500,cursor:"pointer",display:"flex",alignItems:"center",gap:1,transition:"all 0.15s",_hover:{borderColor:er},flexShrink:0,children:[o,r]})},et=e=>{let{children:r}=e;return(0,l.jsx)(a.x,{fontSize:"11px",fontWeight:700,color:"gray.500",textTransform:"uppercase",letterSpacing:"0.5px",mb:2,mt:3,children:r})},ea=e=>{let{isOpen:r,onClose:i,filters:o,onApply:n,artisanProfession:z,officeAddress:C,isBusinessMode:R}=e,k=(0,Z.I0)(),[B,W]=(0,s.useState)(o),[T,U]=(0,s.useState)(o.address||""),[E,O]=(0,s.useState)([]),[A,N]=(0,s.useState)(!1),[P,L]=(0,s.useState)(!1),[q,G]=(0,s.useState)(o.radius||5e3),$=(0,s.useRef)(""),M=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(r){let e=o.address||"";$.current=e,W({...o,...z?{serviceType:z}:{}}),U(e),O([]),G(o.radius||5e3)}},[r,o,z]),(0,s.useEffect)(()=>{if(!T.trim()||T.length<3||T===$.current){O([]);return}M.current&&clearTimeout(M.current),M.current=setTimeout(async()=>{N(!0);try{let e=await k((0,F.gn)({input:T,location:"",radius:""})).unwrap();O(e.predictions||[])}catch(e){O([])}finally{N(!1)}},400)},[T]);let X=async e=>{$.current=e.description,U(e.description),O([]);try{let{lat:r,lng:i}=(await k((0,F.AA)({place_id:e.place_id})).unwrap()).result.geometry.location;W(l=>({...l,address:e.description,latitude:r,longitude:i}))}catch(e){}};return(0,l.jsxs)(d.u_,{isOpen:r,onClose:i,motionPreset:"slideInBottom",scrollBehavior:"inside",children:[(0,l.jsx)(c.Z,{bg:"blackAlpha.500"}),(0,l.jsxs)(u.h,{mb:{base:0,md:"auto"},mt:"auto",borderTopRadius:"24px",borderBottomRadius:{base:0,md:"24px"},mx:{base:0,md:"auto"},maxW:{base:"full",md:"520px"},maxH:"88vh",children:[(0,l.jsx)(x.x,{borderBottomWidth:1,borderColor:"gray.100",fontSize:"18px",fontWeight:700,color:er,children:"Filter Jobs"}),(0,l.jsx)(p.o,{top:3}),(0,l.jsxs)(g.f,{px:5,pt:4,pb:2,overflowY:"auto",children:[(0,l.jsx)(et,{children:"Location"}),(0,l.jsxs)(t.x,{position:"relative",children:[(0,l.jsxs)(h.B,{children:[(0,l.jsx)(b.I,{placeholder:"Enter area or city...",value:T,onChange:e=>U(e.target.value),borderRadius:"12px",fontSize:"14px",bg:"gray.50",borderColor:"gray.200"}),(0,l.jsx)(f.x,{children:A?(0,l.jsx)(v.$,{size:"sm",color:"blue.500"}):T?(0,l.jsx)(_.T,{boxSize:3,color:"gray.400",cursor:"pointer",onClick:()=>{U(""),$.current="",W(e=>{let r={...e};return delete r.address,delete r.latitude,delete r.longitude,r})}}):(0,l.jsx)(D.W,{color:"gray.400"})})]}),E.length>0&&(0,l.jsx)(t.x,{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,mt:1,maxH:"180px",overflowY:"auto",bg:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"12px",shadow:"lg",children:(0,l.jsx)(j.aV,{spacing:0,children:E.map(e=>(0,l.jsx)(j.HC,{px:4,py:3,fontSize:"13px",cursor:"pointer",_hover:{bg:"blue.50"},borderBottom:"1px solid",borderBottomColor:"gray.100",_last:{borderBottom:"none"},onClick:()=>X(e),children:(0,l.jsxs)(y.U,{spacing:2,children:[(0,l.jsx)(m.J,{as:J.$0r,boxSize:4,color:"gray.400",flexShrink:0}),(0,l.jsx)(a.x,{noOfLines:1,children:e.description})]})},e.place_id))})})]}),!T&&(0,l.jsxs)(a.x,{fontSize:"12px",color:"gray.400",mt:2,display:"flex",alignItems:"center",gap:1,children:[(0,l.jsx)(m.J,{as:J.$0r,boxSize:3}),"Not set â showing jobs everywhere",C?". Office on file: ".concat(C):""]}),(0,l.jsx)(S.z,{size:"sm",variant:"ghost",color:"blue.500",fontWeight:600,leftIcon:(0,l.jsx)(m.J,{as:J.A_X,boxSize:4}),mt:1,px:0,isLoading:P,onClick:()=>{navigator.geolocation&&(L(!0),navigator.geolocation.getCurrentPosition(async e=>{let{latitude:r,longitude:i}=e.coords,l="Current Location";try{var s;
1let e=await fetch("https://maps.googleapis.com/maps/api/geocode/json?latlng=".concat(r,",").concat(i,"&key=").concat(ee.env.NEXT_PUBLIC_GOOGLE_API_KEY)),o=await e.json();(null===(s=o.results)||void 0===s?void 0:s[0])&&(l=o.results[0].formatted_address)}catch(e){}$.current=l,U(l),W(e=>({...e,address:l,latitude:r,longitude:i})),O([]),L(!1)},()=>L(!1),{timeout:1e4}))},children:"Use Current Location"}),(0,l.jsx)(et,{children:"Search Radius"}),(0,l.jsx)(y.U,{spacing:2,flexWrap:"wrap",opacity:T?1:.45,pointerEvents:T?"auto":"none",children:eo.map(e=>(0,l.jsx)(en,{label:e.label,active:q===e.value,onClick:()=>G(e.value)},e.value))}),!T&&(0,l.jsx)(a.x,{fontSize:"11px",color:"gray.400",mt:1,children:"Set a location above to turn radius on."}),(0,l.jsx)(et,{children:"Time Period"}),(0,l.jsx)(y.U,{spacing:2,flexWrap:"wrap",children:el.map(e=>(0,l.jsx)(en,{label:e.label,active:B.timeRange===e.value,onClick:()=>W(r=>({...r,timeRange:e.value}))},e.value))}),(0,l.jsx)(et,{children:"Sort By"}),(0,l.jsx)(y.U,{spacing:2,flexWrap:"wrap",children:es.map(e=>{let r="closest"===e.value&&!T;return(0,l.jsx)(en,{label:r?"".concat(e.label," \uD83D\uDD12"):e.label,active:B.sortBy===e.value,onClick:()=>{r||W(r=>({...r,sortBy:e.value}))}},e.value)})}),(0,l.jsx)(et,{children:"Service Type"}),R?(0,l.jsx)(a.x,{fontSize:"12px",color:"gray.500",fontStyle:"italic",mb:2,children:"Jobs are automatically matched to your business's provided services."}):z?(0,l.jsx)(a.x,{fontSize:"12px",color:"gray.500",fontStyle:"italic",mb:2,children:"Showing jobs for your profession only"}):null,!R&&(0,l.jsx)(t.x,{display:"flex",flexWrap:"wrap",gap:2,pb:4,children:(z?[z]:ei).map(e=>(0,l.jsx)(en,{label:(0,K.u)(e)||e,active:B.serviceType===e,onClick:()=>{z||W(r=>({...r,serviceType:r.serviceType===e?void 0:e}))},icon:B.serviceType===e?(0,l.jsx)(I.r,{boxSize:3,mr:1}):void 0},e))})]}),(0,l.jsxs)(w.m,{borderTopWidth:1,borderColor:"gray.100",gap:3,children:[(0,l.jsx)(S.z,{flex:1,variant:"outline",borderRadius:"14px",h:"50px",onClick:()=>{W({timeRange:"all",sortBy:"newest",status:"pending",...z?{serviceType:z}:{}}),U(""),O([]),G(5e3),$.current=""},fontWeight:600,children:"Reset"}),(0,l.jsx)(S.z,{flex:2,h:"50px",borderRadius:"14px",bg:er,color:"white",fontWeight:700,_hover:{bg:"#1a2340"},onClick:()=>{let e={...B,radius:q};T.trim()||(delete e.address,delete e.latitude,delete e.longitude,"closest"!==e.sortBy||(e.sortBy="newest")),n(e),i()},children:"Apply Filters"})]})]})]})},ed=()=>(0,l.jsxs)(t.x,{border:"1px solid",borderColor:"gray.200",borderRadius:"16px",p:4,bg:"white",w:"full",children:[(0,l.jsxs)(y.U,{justify:"space-between",align:"start",mb:3,children:[(0,l.jsx)(z.g,{align:"start",spacing:2,flex:1,children:(0,l.jsxs)(y.U,{children:[(0,l.jsx)(t.x,{w:"40px",h:"40px",bg:"gray.200",borderRadius:"full"}),(0,l.jsxs)(z.g,{align:"start",spacing:1,children:[(0,l.jsx)(t.x,{w:"120px",h:"16px",bg:"gray.200",borderRadius:"md"}),(0,l.jsx)(t.x,{w:"80px",h:"14px",bg:"gray.200",borderRadius:"md"})]})]})}),(0,l.jsx)(t.x,{w:"100px",h:"24px",bg:"gray.200",borderRadius:"full"})]}),(0,l.jsx)(t.x,{w:"full",h:"40px",bg:"gray.200",borderRadius:"md",mb:3}),(0,l.jsxs)(y.U,{spacing:4,mb:3,children:[(0,l.jsx)(t.x,{w:"80px",h:"20px",bg:"gray.200",borderRadius:"md"}),(0,l.jsx)(t.x,{w:"70px",h:"20px",bg:"gray.200",borderRadius:"md"}),(0,l.jsx)(t.x,{w:"90px",h:"20px",bg:"gray.200",borderRadius:"md"})]}),(0,l.jsx)(C.i,{mb:3}),(0,l.jsxs)(y.U,{justify:"space-between",children:[(0,l.jsx)(t.x,{w:"120px",h:"16px",bg:"gray.200",borderRadius:"md"}),(0,l.jsx)(t.x,{w:"80px",h:"16px",bg:"gray.200",borderRadius:"md"})]})]});var ec=()=>{var e,r,i,d,c,u,x,p;let g=(0,F.$V)(),v=(0,n.useParams)(),j=(0,o.useRouter)(),w=null==v?void 0:v.meshId;null==g||g.id;let{activeRole:Z,marketplaceGate:ee}=(0,G.q)(),{effectiveArtisanId:er,canManageJobs:ei}=(0,q.O)(),el=null!=er?er:null==g?void 0:g.id,es=!(null==g?void 0:g.activeBusinessId)||ei,[eo,en]=(0,s.useState)(!1),et=null==g?void 0:null===(e=g.officeLocation)||void 0===e?void 0:e.address,ec=!!(null==g?void 0:g.activeBusinessId),eu=ec?void 0:null!==(c=null==g?void 0:null===(r=g.primaryField)||void 0===r?void 0:r.id)&&void 0!==c?c:null==g?void 0:g.profession,ex=eu?(0,K.u)(eu):void 0,[ep,eg]=(0,s.use
1State)(""),[eh,eb]=(0,s.useState)({timeRange:"all",sortBy:"newest",status:"pending"}),[ef,ev]=(0,s.useState)([]),[ej,ey]=(0,s.useState)(!1),{isOpen:em,onOpen:eS,onClose:ew}=(0,R.q)(),[ez,eC]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!(null==g?void 0:g.activeBusinessId)){eC(!1);return}let e=!1;return(0,Q.WR)(g.activeBusinessId).then(r=>{var i;e||eC((null===(i=r.serviceTags)||void 0===i?void 0:i.label)==="Services Offered")}).catch(()=>{}),()=>{e=!0}},[null==g?void 0:g.activeBusinessId]);let{viewedIds:eR,markViewed:ek,pruneStale:eB}=function(e){let[r,i]=(0,s.useState)(new Set),l=(0,s.useRef)({}),o=(0,s.useRef)(!1);return(0,s.useEffect)(()=>{if(!e)return;let r=function(e){try{let r=localStorage.getItem(e);if(!r)return{};let i=JSON.parse(r),l=Date.now(),s={};for(let[e,r]of Object.entries(i))l-r<6048e5&&(s[e]=r);return s}catch(e){return{}}}(H(e));l.current=r,i(new Set(Object.keys(r))),o.current=!0},[e]),{viewedIds:r,markViewed:(0,s.useCallback)(r=>{if(!e||l.current[r])return;let s=Object.fromEntries(Object.entries({...l.current,[r]:Date.now()}).sort((e,r)=>e[1]-r[1]).slice(-500));l.current=s,i(new Set(Object.keys(s))),V(H(e),s)},[e]),pruneStale:(0,s.useCallback)(r=>{if(!e||!o.current)return;let s=new Set(r),n={};for(let[e,r]of Object.entries(l.current))s.has(e)&&(n[e]=r);Object.keys(n).length!==Object.keys(l.current).length&&(l.current=n,i(new Set(Object.keys(n))),V(H(e),n))},[e])}}(null==g?void 0:g.id),{isOpen:eW,onOpen:eT,onClose:e_}=(0,R.q)(),[eD,eI]=(0,s.useState)(null);(0,s.useEffect)(()=>{"provider"!==Z&&j.push("/mesh/job-board")},[Z,w,j]);let eU=async()=>{try{ey(!0);let e=await (0,X.oX)({...eh,search:ep||void 0,...(null==g?void 0:g.activeBusinessId)?{businessId:g.activeBusinessId}:{}});ev(e),eB(e.map(e=>e.id))}catch(e){console.error("Failed to fetch available jobs:",e)}finally{ey(!1)}};(0,s.useEffect)(()=>{"provider"===Z&&eU()},[Z,eh,null==g?void 0:g.activeBusinessId]);let eE=()=>{eU()},eO=e=>{let r="string"==typeof e?new Date(e):e;return isNaN(r.getTime())?"":r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})},eA=e=>{let r="string"==typeof e?new Date(e):e;return isNaN(r.getTime())?"":r.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})},eN=e=>{if(!ee.eligible){en(!0);return}ek(e),j.push("/mesh/job-board/requests/".concat(e))},eP=(e,r)=>{if(e.stopPropagation(),!ee.eligible){en(!0);return}ek(r.id),eI(r),eT()};return(0,l.jsx)(L.Z,{children:(0,l.jsxs)(t.x,{w:"full",position:"relative",px:4,pb:8,children:[(0,l.jsx)(y.U,{justify:"space-between",align:"center",position:"sticky",top:0,bg:"white",zIndex:10,py:3,children:(0,l.jsxs)(y.U,{spacing:3,children:[(0,l.jsx)(k.h,{"aria-label":"Go back",icon:(0,l.jsx)(O.Z,{size:20}),variant:"ghost",onClick:()=>j.back(),size:"sm"}),(0,l.jsxs)(z.g,{align:"start",spacing:0,children:[(0,l.jsx)(a.x,{color:"primary",fontWeight:"600",fontSize:"20px",children:"Available Jobs"}),(0,l.jsx)(a.x,{fontSize:"13px",color:"gray.500",children:eh.address?"Near ".concat(eh.address):"".concat(ex?"".concat(ex," \xb7 "):"","All locations")})]})]})}),(0,l.jsxs)(y.U,{spacing:2,mb:6,children:[(0,l.jsxs)(h.B,{flex:1,children:[(0,l.jsx)(f.Z,{pointerEvents:"none",children:(0,l.jsx)(D.W,{color:"gray.400"})}),(0,l.jsx)(b.I,{placeholder:"Search jobs...",value:ep,onChange:e=>eg(e.target.value),onKeyPress:e=>"Enter"===e.key&&eE(),borderRadius:"full",bg:"white"})]}),(0,l.jsx)(S.z,{"aria-label":"Filter",onClick:eS,size:"md",colorScheme:"all"!==eh.timeRange||eh.status||eh.address?"blue":"gray",variant:"outline",borderRadius:"full",minW:"unset",w:"0px",children:(0,l.jsx)(m.J,{as:A.Z,size:26})})]}),(0,l.jsxs)(y.U,{spacing:2,mb:4,flexWrap:"wrap",children:[eh.address?(0,l.jsxs)(y.U,{spacing:1,px:3,py:1,bg:"blue.50",borderRadius:"full",fontSize:"12px",color:"blue.700",children:[(0,l.jsxs)(a.x,{fontSize:"12px",children:["\uD83D\uDCCD Within ",((null!==(u=eh.radius)&&void 0!==u?u:5e3)/1e3).toFixed(0),"km"]}),(0,l.jsx)(_.T,{boxSize:2,cursor:"pointer",opacity:.6,onClick:()=>eb(e=>{let r={...e};return delete r.address,delete r.latitude,delete r.longitude,"closest"===r.sortBy&&(r.sortBy="newest"),r})})]}):(0,l.jsx)(t.x,{as:"button",onClick:eS,px:3,py:1,border:"1.5px dashed",borderColor:"gray.300",borderRadius:"full",fontSize:"12px",color:"gray.500",fontWeight:"500",children:"\uD83D\uDCCD Add location filter"}),"all"!==eh.timeRange&&(0,l.jsx)(t.x,{px:3,py:1,bg:"blue.50",borderRadius:"full",fontSize:"12px",color:"blue.700",children:null===(i=eh.timeRange)||void 0===i?void 0:i.replace(/_/g," ")}),"newest"!==eh.sortBy&&(0,l.jsx)(t.x,{px:3,py:1,bg:"purple.50",borderRadius:"full",fontSize:"12px",color:"purple.700",children:"closest"===eh.sortBy?"Nearest first":"Newest first"}),eh.serviceType&&(0,l.jsx)(t.x,{px:3,py:1,bg:"green.50",borderRadius:"full",fontSize:"12px",color:"green.700",children:eh.serviceType}),("all"!==eh.timeRange||"newest"!==eh.sortBy||eh.serviceType||eh.address)&&(0,l.jsx)(S.z,{size:"xs",variant:"ghost",onClick:()=>eb({timeRange:"all",sortBy:"newest",status:"pending"}),fontSize:"12px",children:"Clear all"})]}),!ej&&ef.length>0&&(0,l.jsxs)(a.x,{fontSize:"14px",color:"gray.600",mb:4,children:[ef.length," job",1!==ef.length?"s":""," available"]}),ej&&(0,l.jsx)(z.g,{spacing:4,children:[1,2,3].map(e=>(0,l.jsx)(ed,{},e))}),!ej&&0===ef.length&&(0,l.jsxs)(z.g,{py:12,spacing:3,children:[(0,l.jsx)(a.x,{fontSize:"48px",children:"\uD83D\uDD0D"}),(0,l.jsx)(a.x,{fontSize:"16px",fontWeight:"500",color:"gray.700",children:"No jobs available"}),(0,l.jsx)(a.x,{fontSize:"14px",color:"gray.500",textAlign:"center",children:ep||"all"!==eh.timeRange?"Try adjusting your search or filters":"No jobs listed at the moment"})]}),(0,l.jsx)(z.g,{spacing:4,align:"stretch",children:!ej&&ef.map(e=>
1{var r,i,s,o,n,d,c,u,x,p;return(0,l.jsxs)(t.x,{position:"relative",border:"1px solid",borderColor:"gray.200",borderRadius:"16px",p:4,bg:"white",cursor:"pointer",transition:"all 0.2s ease",_hover:{shadow:"md",transform:"translateY(-2px)"},onClick:()=>eN(null==e?void 0:e.id),children:[!eR.has(null==e?void 0:e.id)&&(0,l.jsx)(t.x,{position:"absolute",top:"12px",right:"12px",w:"10px",h:"10px",borderRadius:"full",bg:"#22C55E",border:"2px solid white",zIndex:1}),(0,l.jsxs)(y.U,{justify:"space-between",align:"start",mb:3,children:[(0,l.jsxs)(y.U,{spacing:3,flex:1,children:[(0,l.jsx)(B.q,{size:"md",name:(null==e?void 0:e.user)?"".concat((null==e?void 0:null===(r=e.user)||void 0===r?void 0:r.firstName)||""," ").concat((null==e?void 0:null===(i=e.user)||void 0===i?void 0:i.lastName)||""):"Anonymous",src:null!==(p=null==e?void 0:null===(s=e.user)||void 0===s?void 0:s.imageUrl)&&void 0!==p?p:void 0,bg:"blue.500"}),(0,l.jsxs)(z.g,{align:"start",spacing:0,children:[(0,l.jsx)(a.x,{fontWeight:"500",fontSize:"15px",children:(null==e?void 0:e.user)?"".concat((null==e?void 0:null===(o=e.user)||void 0===o?void 0:o.firstName)||""," ").concat((null==e?void 0:null===(n=e.user)||void 0===n?void 0:n.lastName)||""):"Anonymous Customer"}),(0,l.jsx)(a.x,{fontSize:"13px",color:"gray.500",children:"Customer"})]})]}),(0,l.jsxs)(z.g,{align:"end",spacing:1,children:[(null==e?void 0:e.isSupportPriority)&&(0,l.jsx)(W.C,{colorScheme:"orange",fontSize:"11px",px:3,py:1,borderRadius:"full",variant:"solid",children:"â¡ Support Priority"}),(null==e?void 0:e.openToBids)&&(0,l.jsx)(W.C,{colorScheme:"purple",fontSize:"11px",px:2,py:.5,borderRadius:"full",children:"Open to Bids"})]})]}),(null==e?void 0:e.serviceDescription)&&(0,l.jsx)(a.x,{mb:2,fontSize:"14px",color:"gray.700",noOfLines:2,fontWeight:500,children:null==e?void 0:e.serviceDescription}),ez&&(null==e?void 0:e.serviceType)&&(0,l.jsxs)(a.x,{mb:1,fontSize:"12px",fontWeight:"700",color:"blue.600",children:[(0,K.u)(e.serviceType)," Requested"]}),(0,l.jsx)(y.U,{spacing:2,flexWrap:"wrap",mb:3,children:(null==e?void 0:e.skills)&&(null==e?void 0:e.skills.slice(0,3).map((e,r)=>(0,l.jsx)(t.x,{px:3,py:1,bg:"blue.50",border:"1px solid",borderColor:"blue.200",borderRadius:"full",children:(0,l.jsx)(a.x,{fontSize:"12px",fontWeight:"500",color:"blue.700",children:e.replace(/_/g," ")})},r)))}),(null==e?void 0:e.address)&&(0,l.jsxs)(y.U,{mb:3,gap:"sm",fontSize:"12px",color:"gray.500",children:[(0,l.jsx)(J.$0r,{size:18,color:"#222E50"}),(0,l.jsx)(a.x,{children:null==e?void 0:e.address})]}),(0,l.jsx)(y.U,{spacing:2,flexWrap:"wrap",mb:3,children:(null==e?void 0:null===(d=e.aiAnalysis)||void 0===d?void 0:d.skills)&&(null==e?void 0:null===(c=e.aiAnalysis)||void 0===c?void 0:c.skills.slice(0,3).map((e,r)=>(0,l.jsx)(t.x,{px:3,py:1,bg:"blue.50",border:"1px solid",borderColor:"blue.200",borderRadius:"full",children:(0,l.jsx)(a.x,{fontSize:"12px",fontWeight:"500",color:"blue.700",children:e.replace(/_/g," ")})},r)))}),(0,l.jsxs)(y.U,{spacing:4,mb:3,flexWrap:"wrap",children:[(0,l.jsxs)(y.U,{spacing:1,fontSize:"13px",color:"gray.600",children:[(0,l.jsx)(m.J,{as:N.Z,boxSize:4}),(0,l.jsx)(a.x,{fontWeight:"500",children:null==e?void 0:e.timeAgo})]}),(null==e?void 0:e.distance)&&(0,l.jsxs)(y.U,{spacing:1,fontSize:"13px",color:"gray.600",children:[(0,l.jsx)(m.J,{as:J.$0r,boxSize:4}),(0,l.jsx)(a.x,{fontWeight:"500",children:e.distance})]}),(0,l.jsx)(y.U,{spacing:1,fontSize:"13px",color:"blue.600",children:(0,l.jsxs)(a.x,{fontWeight:"600",children:[null==e?void 0:null===(u=e.bids)||void 0===u?void 0:u.length," ",(null==e?void 0:e.bids)&&(null==e?void 0:null===(x=e.bids)||void 0===x?void 0:x.length)<2?"Bid":"Bids"]})}),(null==e?void 0:e.openToBids)&&(null==e?void 0:e.biddingExpiresAt)&&(()=>{let r=(0,Y.Qq)(e.biddingExpiresAt);return"Expired"===r||"No deadline"===r?null:(0,l.jsxs)(y.U,{spacing:1,fontSize:"13px",color:"orange.600",bg:"orange.50",px:2,py:.5,borderRadius:"full",children:[(0,l.jsx)(m.J,{as:N.Z,boxSize:3}),(0,l.jsx)(a.x,{fontWeight:"600",children:r})]})})()]}),(0,l.jsx)(C.i,{mb:3}),(0,l.jsxs)(y.U,{justify:"space-between",align:"center",children:[(0,l.jsxs)(y.U,{spacing:4,fontSize:"13px",color:"gray.600",children:[(0,l.jsxs)(y.U,{spacing:2,children:[(0,l.jsx)(U.Q,{boxSize:3}),(0,l.jsx)(a.x,{children:(null==e?void 0:e.preferredDate)?eO(null==e?void 0:e.preferredDate):eO(null==e?void 0:e.createdAt)})]}),(0,l.jsxs)(y.U,{spacing:2,children:[(0,l.jsx)(E.w,{boxSize:3}),(0,l.jsx)(a.x,{children:(null==e?void 0:e.preferredDate)?eA(null==e?void 0:e.preferredDate):eA(null==e?void 0:e.createdAt)})]})]}),"pending"===e.status&&(0,l.jsx)(t.x,{children:(()=>{var r;let i=null==e?void 0:null===(r=e.bids)||void 0===r?void 0:r.find(e=>e.artisanId===el||e.artisanId===w);if(i&&"withdrawn"!==i.status)return(0,l.jsxs)(y.U,{color:"green.600",spacing:1,children:[(0,l.jsx)(m.J,{as:I.r,boxSize:4}),(0,l.jsx)(a.x,{fontWeight:"600",fontSize:"14px",children:"Bid Placed"})]});if(null==e?void 0:e.openToBids){if(!es)return null;let r=(null==i?void 0:i.status)==="withdrawn"?"Resubmit Bid":"Place Bid";return ee.eligible?(0,l.jsx)(S.z,{size:"md",colorScheme:(null==i?void 0:i.status)==="withdrawn"?"purple":"blue",leftIcon:(0,l.jsx)(m.J,{as:P.Z,boxSize:4}),onClick:r=>eP(r,e),_hover:{transform:"scale(1.05)"},transition:"all 0.2s",children:r}):(0,l.jsx)(T.u,{label:(0,M.u)(ee),hasArrow:!0,shouldWrapChildren:!0,children:(0,l.jsx)(S.z,{size:"md",colorScheme:"gray",leftIcon:(0,l.jsx)(m.J,{as:P.Z,boxSize:4}),isDisabled:!0,children:r})})}return(null==i?void 0:i.status)==="withdrawn"?(0,l.jsxs)(y.U,{color:"gray.500",spacing:1,children:[(0,l.jsx)(m.J,{as:I.r,boxSize:4}),(0,l.jsx)(a.x,{fontWeight:"600",fontSize:"14px",children:"Withdrawn (Closed)"})]}):null})()})]})]},null==e?void 0:e.id)})}),(0,l.jsx)($.Z,{isOpen:eW,onClose:e_,request:eD,onSuccess:()=>{eU()}}),(0,l.jsx)(ea,{isOpen:em,onClose:ew,filters:eh,onApply:e=>{eb(e),ew()},artisanProfession:ec?void 0:null!==(p=null!==(x=null==g?void 0:null===(d=g.primaryField)||void 0===d?void 0:d.id)&&void 0!==x?x:null==g?void 0:g.profession)&&void 0!==p?p:void 0,officeAddress:et,isBusinessMode:ec}),(0,l.jsx)(M.Z,{isOpen:eo,onClose:()=>en(!1),gate:ee})]})})}}},function(e){e.O(0,[5443,4838,1664,1657,2775,6714,2893,7447,9203,1529,6480,2888,9774,179],function(){return e(e.s=20998)}),_N_E=e.O()}]);
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.