1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9993a521-a17e-4cf5-9f82-68e9f2e435bf",e._sentryDebugIdIdentifier="sentry-dbid-9993a521-a17e-4cf5-9f82-68e9f2e435bf")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7935],{94871:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/mesh/job-board/requests/[requestId]/edit",function(){return i(25411)}])},76990:function(e,t,i){"use strict";i.d(t,{x:function(){return c}});var r=i(85893),a=i(67294),o=i(32519),s=i(82206),n=i(68029),l=i(11988);i(33732);let d=(0,o.m)(l.ZP,{baseStyle:{bg:"white",borderColor:"#E2E8F0",borderWidth:"1px",borderRadius:"md",p:"2",fontSize:"md",w:"100%",_focus:{borderColor:"#3182CE",boxShadow:"0 0 0 1px #3182CE"},"& .react-datepicker__input-container input":{bg:"white",border:"none",width:"100%",outline:"none",fontSize:"md",padding:"6px"}}}),c=e=>{let{selectedDate:t,onDateChange:i,error:o}=e,l=t?new Date(t):null,c=a.forwardRef((e,t)=>{let{value:i,onClick:a}=e;return(0,r.jsx)(s.I,{ref:t,value:i,onClick:a,placeholder:"Select date and time",isReadOnly:!0,cursor:"pointer",width:"100%",bg:"gray.50",borderColor:o?"red.500":"gray.300",_focus:{borderColor:"blue.500",boxShadow:"0 0 0 1px #3182CE"},_hover:{borderColor:"gray.400"}})});return c.displayName="CustomInput",(0,r.jsx)(n.x,{position:"relative",w:"100%",children:(0,r.jsx)(d,{selected:l,onChange:e=>{e&&i(e.toISOString())},showTimeSelect:!0,timeFormat:"h:mm aa",timeIntervals:30,dateFormat:"EEE, MMM d, yyyy 'at' h:mm aa",minDate:new Date,filterTime:e=>{let t=new Date,i=l||new Date;return i.getFullYear()!==t.getFullYear()||i.getMonth()!==t.getMonth()||i.getDate()!==t.getDate()||e.getTime()>=t.getTime()},popperPlacement:"bottom-start",placeholderText:"Select date and time",showPopperArrow:!1,customInput:(0,r.jsx)(c,{}),wrapperClassName:"datepicker-full-width",className:"datepicker-full-width",width:"100%"})})}},25411:function(e,t,i){"use strict";i.r(t);var r=i(85893),a=i(67294),o=i(54506),s=i(30980),n=i(90092),l=i(82206),d=i(38491),c=i(16610),u=i(59099),h=i(68029),g=i(12519),p=i(83658),x=i(61914),m=i(8186),f=i(86058),b=i(42845),j=i(6459),y=i(73636),v=i(73244),w=i(54795),S=i(96657),C=i(8843),k=i(50090),I=i(88329),q=i(85330),D=i(86523),R=i(91516),P=i(48204),E=i(31529),_=i(18471),z=i(39332),T=i(56524),M=i(76990),N=i(91778),F=i(45007),U=i(57012),O=i(25675),L=i.n(O);let W=e=>{let{media:t,existingMedia:i,onMediaChange:p,onMediaRemove:x,onExistingMediaRemove:m,error:f}=e,b=(0,a.useRef)(null),j=t.length+i.length;return(0,r.jsxs)(o.NI,{children:[(0,r.jsx)(s.l,{children:"Photos or Videos"}),(0,r.jsx)(n.x,{fontSize:"sm",color:"gray.600",mb:3,children:"Upload images or videos to help describe your need (Max 10 files, 3 min video)"}),(0,r.jsx)(l.I,{type:"file",accept:"image/jpeg,image/png,image/heic,image/heif,video/mp4,video/quicktime",multiple:!0,capture:"environment",onChange:p,style:{display:"none"},ref:b}),(0,r.jsxs)(d.z,{variant:"outline",onClick:()=>{var e;return null===(e=b.current)||void 0===e?void 0:e.click()},leftIcon:(0,r.jsx)(q.d,{}),w:"full",isDisabled:j>=10,children:["Attach Media (",j,"/10)"]}),f&&(0,r.jsx)(n.x,{color:"red.500",fontSize:"sm",mt:2,children:f}),(i.length>0||t.length>0)&&(0,r.jsxs)(c.r,{templateColumns:"repeat(auto-fill, minmax(100px, 1fr))",gap:3,mt:3,children:[i.map((e,t)=>(0,r.jsxs)(u.P,{position:"relative",children:[(0,r.jsx)(h.x,{borderRadius:"12px",overflow:"hidden",border:"1px solid",borderColor:"gray.200",height:"120px",children:"image"===e.type?(0,r.jsx)(L(),{src:e.url,alt:"Photo ".concat(t+1),fill:!0,style:{objectFit:"cover"}}):(0,r.jsx)("video",{src:e.url,style:{width:"100%",height:"100%",objectFit:"cover"}})}),(0,r.jsx)(g.h,{"aria-label":"Remove media",icon:(0,r.jsx)(D.T,{w:3,h:3,color:"white"}),size:"sm",position:"absolute",top:"4px",right:"4px",variant:"ghost",borderRadius:"full",bg:"rgba(0,0,0,0.5)",_hover:{bg:"red.500"},onClick:()=>m(t)})]},"existing-".concat(t))),t.map((e,t)=>(0,r.jsxs)(u.P,{position:"relative",children:[(0,r.jsx)(h.x,{borderRadius:"12px",overflow:"hidden",border:"1px solid",borderColor:"gray.200",height:"120px",children:e.type.startsWith("image/")?(0,r.jsx)(L(),{src:URL.createObjectURL(e),alt:"Photo ".concat(t+1),fill:!0,style:{objectFit:"cover"}}):(0,r.jsx)("video",{src:URL.createObjectURL(e),style:{width:"100%",height:"100%",objectFit:"cover"}})}),(0,r.jsx)(g.h,{"aria-label":"Remove media",icon:(0,r.jsx)(D.T,{w:3,h:3,color:"white"}),size:"sm",position:"absolute",top:"4px",right:"4px",variant:"ghost",borderRadius:"full",bg:"rgba(0,0,0,0.5)",_hover:{bg:"red.500"},onClick:()=>x(t)})]},"new-".concat(t)))]})]})},A=e=>{let{requiresSpecialist:t,setRequiresSpecialist:i,pricingPreference:a,setPricingPreference:n,selectionPriority:l,setSelectionPriority:c}=e,{isOpen:u,onToggle:g}=(0,p.q)();return(0,r.jsxs)(h.x,{children:[(0,r.jsx)(d.z,{variant:"ghost",onClick:g,rightIcon:u?(0,r.jsx)(R.g,{}):(0,r.jsx)(P.v,{}),w:"full",justifyContent:"space-between",children:"Advanced Preferences (Optional)"}),(0,r.jsx)(x.U,{in:u,children:(0,r.jsxs)(m.g,{spacing:4,mt:4,p:4,bg:"gray.50",borderRadius:"md",children:[(0,r.jsx)(f.X,{isChecked:t,onChange:e=>i(e.target.checked),children:"I need a certified/specialized professional"}),(0,r.jsxs)(o.NI,{children:[(0,r.jsx)(s.l,{fontSize:"sm",children:"Pricing Preference"}),(0,r.jsxs)(b.P,{value:a,onChange:e=>n(e.target.value),bg:"white",children:[(0,r.jsx)("option",{value:"budget",children:"Budget - Most affordable"}),(0,r.jsx)("option",{value:"standard",children:"Standard - Balance of price & quality"}),(0,r.jsx)("option",{value:"premium",children:"Premium - Highest quality"})]})]}),(0,r.jsxs)(o.NI,{children:[(0,r.jsx)(s.l,{fontSize:"sm",children:"Selection Priority"}
1),(0,r.jsxs)(b.P,{value:l,onChange:e=>c(e.target.value),bg:"white",children:[(0,r.jsx)("option",{value:"fastest",children:"Fastest - Quick response time"}),(0,r.jsx)("option",{value:"balanced",children:"Balanced - Mix of speed & ratings"}),(0,r.jsx)("option",{value:"highest_rated",children:"Highest Rated - Best reviews"})]})]})]})})]})};t.default=()=>{(0,_.$V)();let e=(0,z.useParams)(),t=null==e?void 0:e.requestId,i=(0,z.useRouter)(),c=(0,F.I0)(),u=(0,j.p)(),[p,x]=(0,a.useState)(""),[f,q]=(0,a.useState)("medium"),[D,R]=(0,a.useState)(null),[P,O]=(0,a.useState)(!1),[L,Z]=(0,a.useState)(""),[B,H]=(0,a.useState)([]),[X,Y]=(0,a.useState)([]),[J,V]=(0,a.useState)(!1),[G,K]=(0,a.useState)("standard"),[Q,$]=(0,a.useState)("balanced"),[ee,et]=(0,a.useState)(!1),[ei,er]=(0,a.useState)(!0),[ea,eo]=(0,a.useState)({});(0,a.useEffect)(()=>{(async()=>{if(t)try{let e=(await c((0,U.xW)({requestId:t,role:"customer"})).unwrap()).request;x(e.serviceDescription||""),q(e.urgency||"medium"),(e.address||e.latitude||e.longitude)&&R({address:e.address||"",latitude:e.latitude,longitude:e.longitude}),e.preferredDate&&Z(new Date(e.preferredDate).toISOString()),e.media&&e.media.length>0&&Y(e.media),V(e.requiresSpecialist||!1),K(e.pricingPreference||"standard"),$(e.selectionPriority||"balanced")}catch(e){console.error("Error fetching request:",e),u({title:"Error loading request",description:"Failed to load request details",status:"error",duration:5e3,isClosable:!0})}finally{er(!1)}})()},[t,c,u]);let es=()=>{i.back()},en=async(e,t,i,r)=>{if(!t)throw Error("Missing ".concat(r," ID"));if(0===e.length)return[];if(!i)throw Error("Missing authentication token");try{let a=e.map(e=>({filename:e.filename,contentType:e.type})),o=await c((0,U.KC)({files:a,resourceType:r,resourceId:t,userAuthToken:i,imageType:r})).unwrap(),s=[];for(let a=0;a<e.length;a++){let n=e[a],l=o.presignedUrls[a],d=await fetch(l.url,{method:"PUT",headers:{"Content-Type":n.type,"x-goog-meta-resource-type":r,"x-goog-meta-resource-id":t,"x-goog-meta-user_auth_token":i,"x-goog-meta-image-type":r},body:n.file});if(!d.ok)throw Error("Failed to upload ".concat(n.filename,". Status: ").concat(d.status));s.push({filename:l.filename,url:"https://storage.googleapis.com/handymesh/".concat(l.filename),type:n.type.startsWith("video/")?"video":"image",status:"pending"})}return s}catch(t){let e=t instanceof Error?t.message:String(t);throw Error("Failed to upload media: ".concat(e))}},el=async()=>{let e={};if(p.trim()||(e.description="Description is required"),D||(e.location="Location is required"),L||(e.preferredDate="Preferred date is required"),Object.keys(e).length>0){eo(e);return}et(!0),eo({});try{let e=localStorage.getItem("token");if(!e)throw Error("Authentication token is missing");let r=[];B.length>0&&(r=await en(B.map(e=>({file:e,filename:e.name,type:e.type})),t,e,"request"));let a=[...X,...r];await c((0,U.Zg)({formData:{serviceDescription:p,urgency:f,latitude:null==D?void 0:D.latitude,longitude:null==D?void 0:D.longitude,address:null==D?void 0:D.address,preferredDate:new Date(L).toISOString(),media:a,requiresSpecialist:J,pricingPreference:G,selectionPriority:Q},id:t})).unwrap(),u({title:"Request updated",description:"Your request has been successfully updated",status:"success",duration:5e3,isClosable:!0}),i.push("/mesh/job-board/requests/".concat(t))}catch(e){eo({submit:e.message}),u({title:"Error updating request",description:e.message,status:"error",duration:5e3,isClosable:!0})}finally{et(!1)}};return ei?(0,r.jsx)(E.Z,{children:(0,r.jsx)(h.x,{p:8,children:(0,r.jsx)(n.x,{children:"Loading request..."})})}):(0,r.jsxs)(E.Z,{children:[(0,r.jsxs)(h.x,{maxW:"800px",mx:"auto",p:{base:4,md:8},children:[(0,r.jsxs)(y.U,{mb:6,children:[(0,r.jsx)(g.h,{"aria-label":"Go back",icon:(0,r.jsx)(T.Z,{size:20}),variant:"ghost",colorScheme:"gray",onClick:es,size:"md"}),(0,r.jsx)(n.x,{fontSize:"lg",fontWeight:"semibold",color:"gray.700",children:"Edit Request"})]}),(0,r.jsx)(h.x,{bg:"white",borderRadius:"16px",boxShadow:"lg",p:{base:6,md:8},children:(0,r.jsxs)(m.g,{spacing:6,align:"stretch",children:[(0,r.jsxs)(m.g,{spacing:2,align:"start",children:[(0,r.jsx)(n.x,{fontSize:"2xl",fontWeight:"bold",color:"gray.800",children:"Update Your Request"}),(0,r.jsx)(n.x,{fontSize:"md",color:"gray.600",children:"Make changes to your service request details below."})]}),(0,r.jsxs)(o.NI,{isInvalid:!!ea.description,isRequired:!0,children:[(0,r.jsx)(s.l,{children:"Service Description"}),(0,r.jsx)(v.g,{value:p,onChange:e=>x(e.target.value),placeholder:"Describe what you need help with...",minH:"150px",bg:"gray.50",borderColor:"gray.300",_focus:{borderColor:"blue.500",boxShadow:"0 0 0 1px #3182CE"}}),(0,r.jsx)(w.J1,{children:ea.description})]}),(0,r.jsxs)(o.NI,{isRequired:!0,children:[(0,r.jsx)(s.l,{children:"Priority Level"}),(0,r.jsxs)(b.P,{value:f,onChange:e=>q(e.target.value),bg:"gray.50",children:[(0,r.jsx)("option",{value:"low",children:"Low - Can wait a week"}),(0,r.jsx)("option",{value:"medium",children:"Medium - Within a few days"}),(0,r.jsx)("option",{value:"high",children:"High - Within 24 hours"}),(0,r.jsx)("option",{value:"urgent",children:"Urgent - Same day needed"}),(0,r.jsx)("option",{value:"emergency",children:"Emergency - Immediate help"})]})]}),(0,r.jsxs)(o.NI,{isInvalid:!!ea.location,isRequired:!0,children:[(0,r.jsx)(s.l,{children:"Service Location"}),(0,r.jsx)(l.I,{value:(null==D?void 0:D.address)||"",placeholder:"Click to select your location",isReadOnly:!0,cursor:"pointer",onClick:()=>O(!0),bg:"gray.50"}),(0,r.jsx)(w.J1,{children:ea.location}),(0,r.jsx)(n.x,{fontSize:"xs",color:"gray.500",mt:1,children:"Click to open map and select precise location"})]}),(0,r.jsxs)(o.NI,{isInvalid:!!ea.preferredDate,isRequired:!0,children:[(0,r.jsx)(s.l,{children:"Preferred Date & Time"}),(0,r.jsx)(M.x,{selectedDate:L,onDateChange:Z,error:!!ea.preferredDate}),(0,r.jsx)(w.J1,{children:ea.preferredDate})]}),(0,r.jsx)(W,{media:B,existingMedia:X,onMediaChange:e=>{let t=Array.from(e.target.files||[]),i=B.length+X.length;if(t.length+i>10){u({title:"Too many files",description:"Maximum 10 files allowed",status:"warning",duration:3e3,isClosable:!0});return}H([...B,...t])},onMediaRemove:e=>{H(B.filter((t,i)=>i!==e))},onExistingMediaRemove:e=>{Y(X.filter((t,i)=>i!==e))},error:ea.media}),(0,r.jsx)(A,{requiresSpecialist:J,setRequiresSpecialist:V,pricingPreference:G,setPricingPreference:K,selectionPriority:Q,setSelectionPriority:$}),ea.submit&&(0,r.jsxs)(S.b,{status:"error",borderRadius:"md",children:[(0,r.jsx)(C.z,{}),(0,r.jsx)(k.X,{children:ea.submit})]}),(0,r.jsxs)(I.k,{gap:4,children:[(0,r.jsx)(d.z,{flex:1,variant:"outline",colorScheme:"gray",size:"lg",onClick:es,children:"Cancel"}),(0,r.jsx)(d.z,{flex:1,colorScheme:"blue",size:"lg",onClick:el,isLoading:ee,loadingText:"Updating...",children:"Update Request"})]})]})})]}),(0,r.jsx)(N.Z,{isOpen:P,onClose:()=>O(!1),onSave:e=>{R(e),O(!1)},submitButtonText:"Select Location"})]})}}},function(e){e.O(0,[5443,4838,2644,6342,1664,1657,2775,6714,4699,1047,9203,1529,2888,9774,179],function(){return e(e.s=94871)}),_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.