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]="d8a8d8c9-ec9b-43e9-87e8-453ce60bb227",e._sentryDebugIdIdentifier="sentry-dbid-d8a8d8c9-ec9b-43e9-87e8-453ce60bb227")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7186],{66569:function(e,r){r.Z={src:"/_next/static/media/Profile banner.bcdaec7d.png",height:600,width:2384,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAACCAIAAADq9gq6AAAAI0lEQVR42mNU1AtkZOJkZOZkYAaScAYHEwMDIwMjGDEgIyYAKu4BBurxN3cAAAAASUVORK5CYII=",blurWidth:8,blurHeight:2}},55604:function(e,r){r.Z={src:"/_next/static/media/video-thumbnail.fe1b6867.png",height:1152,width:1600,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAAsElEQVR42i2OQQuCQBCFpyAiokBIIi3QTrkWpmQjBv0Vjx67Rmeha4dAd4X1tvgvt1np8A7zvfd4AzAB9PdeBgAX0oEUkK7O1kGYAYLnD2ZaVdW9aRrVtu23KIqUGNprGyFgwc206rqWfd/rrus05/xFLIyTOAd2ZDkdTAjxUUppKaXmgj+InaJzlIPjbtBslmWJFHrTxDOhKrFsaS3ImwK6O3cI/Z8MjWmtLBzPR/gDX8sut57XL28AAAAASUVORK5CYII=",blurWidth:8,blurHeight:6}},68236:function(e,r,t){var i=t(85893),o=t(16610),l=t(59099),n=t(68029),a=t(8186),s=t(88329),d=t(90092),c=t(38491),u=t(22768),p=t(39332),x=t(35270),h=t(55604),g=t(45184);t(55678),r.Z=e=>{let{items:r,isUser:t,meshId:m,onItemClick:b,onAddClick:f}=e,y=(0,p.useRouter)();return r&&(null==r?void 0:r.length)>0?(0,i.jsx)(o.r,{templateColumns:["repeat(2, 1fr)","repeat(3, 1fr)"],gap:1,children:r.map((e,r)=>{var t,o,a,s;return(0,i.jsx)(l.P,{onClick:()=>b?b(r):y.push("/mesh/".concat(m,"/catalog/").concat(e.id)),position:"relative",cursor:"pointer",children:(null==e?void 0:e.media)&&(null==e?void 0:null===(t=e.media)||void 0===t?void 0:t.length)!==0?(0,i.jsxs)(i.Fragment,{children:[e.media.length>1&&(0,i.jsx)(n.x,{"aria-label":"Copy catalog link",position:"absolute",top:"8px",right:"8px",bg:"transparent",children:(0,i.jsx)(g.On2,{color:"#FFFFFF",size:24})}),(null===(o=e.media[0])||void 0===o?void 0:o.type)!=="video"?(0,i.jsx)(n.x,{bgImage:"url(".concat(null===(a=e.media[0])||void 0===a?void 0:a.url,")"),h:"200px",bgSize:"cover",bgPosition:"center",cursor:"pointer",borderRadius:"8px"}):(0,i.jsx)(n.x,{as:"video",src:(null===(s=e.media[0])||void 0===s?void 0:s.url)||x.Z.src,h:"200px",w:"100%",borderRadius:"8px",objectFit:"cover",poster:h.Z.src,preload:"metadata",muted:!0,playsInline:!0})]}):(0,i.jsx)(n.x,{bgImage:x.Z.src,h:"200px",bgSize:"cover",bgPosition:"center",cursor:"pointer",borderRadius:"8px"})},r)})}):(0,i.jsx)(i.Fragment,{children:t?(0,i.jsxs)(a.g,{mt:"24px",mb:"40px",w:"380px",mx:"auto",children:[(0,i.jsx)(s.k,{bg:"#F8F8F8",rounded:"full",justify:"center",align:"center",w:"118px",h:"118px",children:(0,i.jsx)(s.k,{bg:"#F8F8F8",rounded:"full",justify:"center",align:"center",w:"78px",h:"78px",border:"5px solid white",children:(0,i.jsx)(u.Z,{size:44})})}),(0,i.jsxs)(a.g,{mt:"16px",spacing:"12px",textAlign:"center",children:[(0,i.jsx)(d.x,{fontSize:"18px",fontWeight:"600",color:"#101828",children:"Let your work speak \uD83D\uDCAA"}),(0,i.jsx)(d.x,{fontSize:"16px",fontWeight:"400",color:"#667085",children:"Upload photos of your work to attract more customers in the community"}),(0,i.jsx)(c.z,{borderRadius:"36px",onClick:null!=f?f:()=>y.push("/mesh/".concat(m,"/catalog/upload")),children:"Upload work"})]})]}):(0,i.jsx)(a.g,{mt:"24px",mb:"40px",w:"380px",mx:"auto",children:(0,i.jsx)(d.x,{fontSize:"14px",fontWeight:"400",color:"#667085",children:"No work samples uploaded yet"})})})}},6485:function(e,r,t){var i=t(85893),o=t(67294),l=t(6459),n=t(83658),a=t(5490),s=t(34614),d=t(26840),c=t(57391),u=t(21360),p=t(70010),x=t(8186),h=t(38491),g=t(90092),m=t(16610),b=t(59099),f=t(68029),y=t(73636),j=t(64831),v=t(12519),w=t(54506),S=t(30980),A=t(82206),z=t(73244),C=t(24950),R=t(45443),k=t(5713),I=t(56524),F=t(56489),D=t(78316),_=t(8622),N=t(86523),T=t(45007),W=t(18471),E=t(57012),Z=t(35270),O=t(11163);let U={title:"",description:"",media:[]};r.Z=e=>{var r,t;let{isOpen:q,onClose:B,userId:P,items:H,isOwner:L,initialIndex:Y,businessId:K}=e,M=(0,T.I0)(),V=(0,O.useRouter)(),J=(0,l.p)(),[G,Q]=(0,o.useState)("list"),[X,$]=(0,o.useState)(0),[ee,er]=(0,o.useState)(0),[et,ei]=(0,o.useState)(null),[eo,el]=(0,o.useState)(U),[en,ea]=(0,o.useState)([]),[es,ed]=(0,o.useState)(!1),[ec,eu]=(0,o.useState)(!1),ep=(0,o.useRef)(null);(0,o.useEffect)(()=>{q&&("number"==typeof Y?($(Y),er(0),Q("detail")):Q("list"))},[q,Y]);let{isOpen:ex,onOpen:eh,onClose:eg}=(0,n.q)(),em=(0,o.useRef)(null),eb=H[X],ef=()=>{Q("list"),el(U),ea([]),ei(null)},ey=e=>{$(e),er(0),Q("detail")},ej=e=>
1{el({title:e.title,description:e.description||"",media:e.media||[]}),ea([]),ei(e.id),Q("form")},ev=e=>{el(r=>({...r,media:r.media.filter(r=>r.url!==e)}))},ew=e=>{ea(r=>r.filter((r,t)=>t!==e))},eS=async e=>{if(0===en.length)return[];let r=localStorage.getItem("token"),t=en.map(e=>({filename:e.name,contentType:e.type})),i=await M((0,E.KC)({files:t,resourceType:"catalog",resourceId:e,userAuthToken:null!=r?r:"",imageType:"catalog"})).unwrap(),o=[];for(let t=0;t<en.length;t++){let l=en[t],{url:n,filename:a}=i.presignedUrls[t];if(!(await fetch(n,{method:"PUT",headers:{"Content-Type":l.type,"x-goog-meta-resource-type":"catalog","x-goog-meta-resource-id":e,"x-goog-meta-user_auth_token":null!=r?r:"","x-goog-meta-image-type":"catalog"},body:l})).ok)throw Error("Failed to upload ".concat(l.name));o.push({filename:a,url:"https://storage.googleapis.com/handymesh/".concat(a),type:l.type.startsWith("video/")?"video":"image",status:"completed"})}return o},eA=async()=>{if(!eo.title.trim()){J({title:"Title is required",status:"warning"});return}try{if(ed(!0),eu(en.length>0),et){let e=[];try{e=await eS(et)}catch(e){J({title:"Some photos failed to upload",status:"warning"})}eu(!1),await M((0,W.CO)({id:et,formData:{title:eo.title,description:eo.description,media:[...eo.media,...e],businessId:K}})).unwrap()}else{let e=await M((0,W.rV)({title:eo.title,description:eo.description,media:[],businessId:K})).unwrap(),r=[];try{r=await eS(e.id)}catch(e){J({title:"Some photos failed to upload",status:"warning"})}eu(!1),r.length>0&&await M((0,W.CO)({id:e.id,formData:{title:eo.title,description:eo.description,media:r,businessId:K}})).unwrap()}if(J({title:et?"Catalog entry updated":"Catalog entry created",status:"success"}),K){V.reload();return}await M((0,W.BT)()).unwrap(),ef()}catch(e){J({title:"Failed to save catalog entry",description:e.message,status:"error"})}finally{ed(!1),eu(!1)}},ez=async()=>{if(eb)try{if(await M((0,W.r$)({id:eb.id,businessId:K})).unwrap(),J({title:"Catalog entry removed",status:"info"}),K){V.reload();return}await M((0,W.BT)()).unwrap(),eg(),ef()}catch(e){J({title:"Failed to remove catalog entry",description:e.message,status:"error"})}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(a.u_,{isOpen:q,onClose:()=>{ef(),B()},size:"lg",scrollBehavior:"inside",children:[(0,i.jsx)(s.Z,{}),(0,i.jsxs)(d.h,{children:[(0,i.jsx)(c.x,{children:"list"===G?"Catalog":"form"===G?et?"Edit Catalog Entry":"Add Catalog Entry":null==eb?void 0:eb.title}),(0,i.jsx)(u.o,{}),(0,i.jsxs)(p.f,{pb:6,children:["list"===G&&(0,i.jsxs)(x.g,{align:"stretch",spacing:4,children:[L&&(0,i.jsx)(h.z,{size:"sm",leftIcon:(0,i.jsx)(k.Z,{size:16}),colorScheme:"green",alignSelf:"start",onClick:()=>{el(U),ea([]),ei(null),Q("form")},children:"Add Catalog Entry"}),0===H.length?(0,i.jsx)(g.x,{fontSize:"sm",color:"gray.500",textAlign:"center",py:8,children:"No work samples uploaded yet"}):(0,i.jsx)(m.r,{templateColumns:"repeat(3, 1fr)",gap:2,children:H.map((e,r)=>{var t,o;return(0,i.jsx)(b.P,{cursor:"pointer",borderRadius:"8px",overflow:"hidden",onClick:()=>ey(r),children:(0,i.jsx)(f.x,{h:"100px",bg:"gray.100",children:(0,i.jsx)("img",{src:(null===(o=e.media)||void 0===o?void 0:null===(t=o[0])||void 0===t?void 0:t.url)||Z.Z.src,alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})})},e.id)})})]}),"detail"===G&&eb&&(0,i.jsxs)(x.g,{align:"stretch",spacing:4,children:[(0,i.jsxs)(f.x,{position:"relative",h:"280px",bg:"gray.100",borderRadius:"12px",overflow:"hidden",children:[(0,i.jsx)("img",{src:(null===(t=eb.media)||void 0===t?void 0:null===(r=t[ee])||void 0===r?void 0:r.url)||Z.Z.src,alt:eb.title,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}),H.length>1&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.z,{"aria-label":"Previous entry",w:"unset",minH:"unset",bg:"#1212127A",rounded:"full",p:"9px",position:"absolute",left:"8px",top:"50%",transform:"translateY(-50%)",onClick:()=>$(e=>e>0?e-1:H.length-1),children:(0,i.jsx)(I.Z,{size:18,color:"white"})}),(0,i.jsx)(h.z,{"aria-label":"Next entry",w:"unset",minH:"unset",bg:"#1212127A",rounded:"full",p:"9px",position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",onClick:()=>$(e=>e<H.length-1?e+1:0),children:(0,i.jsx)(F.Z,{size:18,color:"white"})})]})]}),eb.media&&eb.media.length>1&&(0,i.jsx)(y.U,{spacing:2,overflowX:"auto",children:eb.media.map((e,r)=>(0,i.jsx)(f.x,{as:"button",onClick:()=>er(r),w:"56px",h:"56px",flexShrink:0,borderRadius:"8px",overflow:"hidden",border:"2px s
1olid",borderColor:r===ee?"green.400":"transparent",children:(0,i.jsx)("img",{src:e.url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})},e.url))}),(0,i.jsx)(g.x,{fontSize:"16px",fontWeight:"600",children:eb.title}),eb.description&&(0,i.jsx)(g.x,{fontSize:"14px",color:"gray.600",children:eb.description}),(0,i.jsxs)(g.x,{fontSize:"12px",color:"gray.400",textAlign:"center",children:[X+1," of ",H.length]}),(0,i.jsx)(j.i,{}),(0,i.jsxs)(y.U,{justify:"space-between",children:[(0,i.jsx)(h.z,{variant:"ghost",size:"sm",onClick:ef,children:"Back to all"}),L&&(0,i.jsxs)(y.U,{children:[(0,i.jsx)(v.h,{"aria-label":"Delete",icon:(0,i.jsx)(D.Z,{size:16,color:"#E53E3E"}),size:"sm",variant:"ghost",onClick:eh}),(0,i.jsx)(h.z,{size:"sm",leftIcon:(0,i.jsx)(_.Z,{size:16}),onClick:()=>ej(eb),children:"Edit"})]})]})]}),"form"===G&&(0,i.jsxs)(x.g,{align:"stretch",spacing:4,children:[(0,i.jsxs)(w.NI,{children:[(0,i.jsx)(S.l,{fontSize:"13px",children:"Title"}),(0,i.jsx)(A.I,{value:eo.title,onChange:e=>el(r=>({...r,title:e.target.value})),placeholder:"Catalog title"})]}),(0,i.jsxs)(w.NI,{children:[(0,i.jsxs)(S.l,{fontSize:"13px",children:["Description ",(0,i.jsx)(g.x,{as:"span",color:"gray.400",fontWeight:400,children:"(Optional)"})]}),(0,i.jsx)(z.g,{value:eo.description,onChange:e=>el(r=>({...r,description:e.target.value})),rows:3})]}),(0,i.jsxs)(w.NI,{children:[(0,i.jsxs)(S.l,{fontSize:"13px",children:["Photos ",(0,i.jsx)(g.x,{as:"span",color:"gray.400",fontWeight:400,children:"(Optional, max 8)"})]}),(0,i.jsx)("input",{type:"file",accept:"image/jpeg,image/png,image/heic,image/heif,image/webp",multiple:!0,ref:ep,onChange:e=>{let r=Array.from(e.target.files||[]);if(r.length+en.length+eo.media.length>8){J({title:"Maximum 8 photos per catalog entry",status:"warning"});return}ea(e=>[...e,...r]),ep.current&&(ep.current.value="")},style:{display:"none"}}),(0,i.jsx)(h.z,{variant:"outline",size:"sm",leftIcon:(0,i.jsx)(k.Z,{size:16}),onClick:()=>{var e;return null===(e=ep.current)||void 0===e?void 0:e.click()},isDisabled:ec,children:"Add Photos"}),(eo.media.length>0||en.length>0)&&(0,i.jsxs)(m.r,{templateColumns:"repeat(auto-fill, minmax(72px, 1fr))",gap:2,mt:3,children:[eo.media.map(e=>(0,i.jsxs)(b.P,{position:"relative",children:[(0,i.jsx)(f.x,{borderRadius:"8px",overflow:"hidden",border:"1px solid",borderColor:"gray.200",height:"72px",children:(0,i.jsx)("img",{src:e.url,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),(0,i.jsx)(v.h,{"aria-label":"Remove photo",icon:(0,i.jsx)(N.T,{w:2,h:2,color:"white"}),size:"xs",position:"absolute",top:"2px",right:"2px",variant:"ghost",borderRadius:"full",bg:"rgba(0,0,0,0.5)",_hover:{bg:"red.500"},onClick:()=>ev(e.url)})]},e.url)),en.map((e,r)=>(0,i.jsxs)(b.P,{position:"relative",children:[(0,i.jsx)(f.x,{borderRadius:"8px",overflow:"hidden",border:"1px solid",borderColor:"gray.200",height:"72px",opacity:ec?.5:1,children:(0,i.jsx)("img",{src:URL.createObjectURL(e),alt:"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),!ec&&(0,i.jsx)(v.h,{"aria-label":"Remove photo",icon:(0,i.jsx)(N.T,{w:2,h:2,color:"white"}),size:"xs",position:"absolute",top:"2px",right:"2px",variant:"ghost",borderRadius:"full",bg:"rgba(0,0,0,0.5)",_hover:{bg:"red.500"},onClick:()=>ew(r)})]},"pending-".concat(r)))]})]}),(0,i.jsx)(j.i,{}),(0,i.jsxs)(y.U,{justify:"flex-end",children:[(0,i.jsx)(h.z,{variant:"ghost",onClick:ef,isDisabled:es,children:"Cancel"}),(0,i.jsx)(h.z,{colorScheme:"green",onClick:eA,isLoading:es,loadingText:ec?"Uploading photos...":void 0,children:et?"Update":"Create"})]})]})]})]})]}),(0,i.jsx)(C.aR,{isOpen:ex,leastDestructiveRef:em,onClose:eg,children:(0,i.jsx)(s.Z,{children:(0,i.jsxs)(C._T,{children:[(0,i.jsx)(c.x,{fontSize:"lg",fontWeight:"bold",children:"Remove catalog entry?"}),(0,i.jsxs)(p.f,{children:['This removes "',null==eb?void 0:eb.title,"\" and its photos from your catalog. This can't be undone."]}),(0,i.jsxs)(R.m,{children:[(0,i.jsx)(h.z,{ref:em,onClick:eg,children:"Cancel"}),(0,i.jsx)(h.z,{colorScheme:"red",onClick:ez,ml:3,children:"Remove"})]})]})})})]})}},25760:function(e,r,t){var i=t(85893),o=t(67294),l=t(5490),n=t(34614),a=t(26840),s=t(57391),d=t(21360),c=t(70010),u=t(8186),p=t(54506),x=t(73636),h=t(30980),g=t(90092),m=t(73244),b=t(54795),f=t(45443),y=t(38491),j=t(54299),v=t(16310),w=t(45007),S=t(18471),A=t(37750),z=t(55678),C=t(11163);let R=v.Ry({bio:v.Z_().min(10,"Bio must be at least 10 characters").max(600,"Bio cannot exceed 600 characters").required("Bio is required")});r.Z=e=>{let{isOpen:r,onClose:t,initialBio:v="",meshId:k,businessId:I}=e,F=(0,w.I0)(),[D,_]=(0,o.useState)(v.length),N=(0,C.useRouter)();return(0,i.jsxs)(l.u_,{closeOnOverlayClick:!1,isOpen:r,onClose:t,size:"lg",children:[(0,i.jsx)(n.Z,{}),(0,i.jsxs)(a.h,{children:[(0,i.jsx)(s.x,{children:"Update Profile Bio"}),(0,i.jsx)(d.o,{}),(0,i.jsx)(c.f,{pb:6,children:(0,i.jsx)(j.J9,{initialValues:{bio:v},validationSchema:R,onSubmit:async(e,r)=>{let{setSubmitting:i}=r;try{if(I){await (0,A.wz)(I,e.bio),t(),N.reload();return}await F((0,S.DZ)({about:e.bio})).unwrap(),await F((0,S.BT)()).unwrap(),t(),N.push("/mesh/".concat(k))}catch(e){console.error("Failed to update bio:",e),z.Am.error("Failed to update bio. Please try again.")}finally{i(!1)}},children:e=>{let{values:r,isSubmitting:t}=e;return(0,i.jsxs)(j.l0,{id:"bio-form",children:[(0,i.jsx)(u.g,{spacing:4,align:"stretch",children:(0,i.jsx)(j.gN,{name:"bio",children:e=>{let{field:r,form:t}=e;return(0,i.jsxs)(p.NI,{isInvalid:t.errors.bio&&t.touched.bio,children:[(0,i.jsxs)(x.U,{justify:"space-between",children:[(0,i.jsx)(h.l,{htmlFor:"bio",children:"Bio"}),(0,i.jsxs)(g.x,{fontSize:"sm",color:"gray.500",children:[D,"/600"]})]}),(0,i.jsx)(m.g,{...r,id:"bio",height:"200px",placeholder:"Tell us about yourself...",resize:"vertical",onChange:e=>{r.onChange(e),_(e.target.value.length)}}),(0,i.jsx)(b.J1,{children:t.errors.bio})]})}})}),(0,i.jsx)(f.m,{children:(0,i.jsx)(y.z,{type:"submit",form:"bio-form",colorScheme:"blue",w:"full",rounded:"full",isLoading:t,children:"Update"})})]})}})})]})]})}},51656:function(e,r,t){t.d(r,{Z:function(){return el}});var i=t(85893),o=t(73636),l=t(68029),n=t(90092),a=t(5490),s=t(34614),d=t(26840),c=t(2
11360),u=t(70010),p=t(8186),x=t(46572),h=t(12553),g=t(54506),m=t(30980),b=t(82206),f=t(54795),y=t(73244),j=t(38491),v=t(16610),w=t(59099),S=t(12519),A=t(85330),z=t(86523),C=t(67294),R=t(16310),k=t(54299),I=t(77983);t(1885);var F=t(45007),D=t(89508),_=t(88324),N=t(25675),T=t.n(N),W={src:"/_next/static/media/Success_Icon.e0211a38.png",height:236,width:236,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAxUlEQVR42mMAgQVLV7MwQAAjCEPE1kDE5i9eBWKwPHryLOL9x8+73n/6suvx0+cRILEFS6AagQJRr95++H/q3KX/x06d///q7fv/IDEGKGB69/HzvtPnLv83tAz7ERiW+ePI8TP/gSbtA8mBFDADOftBOhNSSn5a2Ef+PHD45P8PQDGQHNiIJ89exIOMPXzs9H+Q5Ms37/8/ffYyHiw5bfZisCOBihKBJh3+AMRAyUSQ2Iy5SyGOnDprEZgBEgRhiMYlYBoA9d1189bv1DUAAAAASUVORK5CYII=",blurWidth:8,blurHeight:8},E=t(18471),Z=t(57012),O=t(55678),U=t(91778),q=t(2248),B=t(49525),P=t(38421),H=t(10490),L=t(57523),Y=t(96887),K=t(43819),M=t(22768),V=t(74919),J=t(42845),G=t(18118),Q=t(97873),X=e=>{let{fields:r,namePrefix:t="customFieldResponses",hideHeading:o=!1}=e;if(!r||0===r.length)return null;let l=[...r].sort((e,r)=>e.displayOrder-r.displayOrder);return(0,i.jsxs)(p.g,{align:"stretch",spacing:4,children:[!o&&(0,i.jsx)(n.x,{fontSize:"sm",fontWeight:"600",color:"gray.700",children:"A Few More Details"}),l.map(e=>(0,i.jsx)(k.gN,{name:"".concat(t,".").concat(e.fieldKey),children:r=>{var o,l,a,s,d,c;let{field:u,form:p}=r,x=null===(o=p.errors)||void 0===o?void 0:o[t],h=null===(l=p.touched)||void 0===l?void 0:l[t],y=null==x?void 0:x[e.fieldKey],j=null==h?void 0:h[e.fieldKey];return(0,i.jsxs)(g.NI,{isInvalid:!!y&&!!j,children:[(0,i.jsxs)(m.l,{fontSize:"sm",fontWeight:"500",color:"gray.700",children:[e.label," ",!e.required&&(0,i.jsx)(n.x,{as:"span",color:"gray.400",fontSize:"xs",children:"(Optional)"})]}),"text"===e.fieldType&&(0,i.jsx)(b.I,{...u,value:null!==(d=u.value)&&void 0!==d?d:"",placeholder:"Enter ".concat(e.label.toLowerCase()),bg:"gray.50",borderRadius:"10px",border:"2px solid",borderColor:"gray.200",_focus:{borderColor:"purple.500",bg:"white"}}),"single_select"===e.fieldType&&(0,i.jsx)(J.P,{...u,value:null!==(c=u.value)&&void 0!==c?c:"",placeholder:"Select ".concat(e.label.toLowerCase()),bg:"gray.50",borderRadius:"10px",border:"2px solid",borderColor:"gray.200",_focus:{borderColor:"purple.500",bg:"white"},children:null===(a=e.options)||void 0===a?void 0:a.map(e=>(0,i.jsx)("option",{value:e,children:e},e))}),"multi_select"===e.fieldType&&(0,i.jsx)(G.E,{spacing:2,children:null===(s=e.options)||void 0===s?void 0:s.map(e=>{let r=u.value||[],t=r.includes(e);return(0,i.jsx)(G.U,{children:(0,i.jsx)(Q.Vp,{as:"button",type:"button",size:"lg",borderRadius:"full",px:4,py:2,fontSize:"sm",fontWeight:"500",cursor:"pointer",bg:t?"purple.500":"gray.50",color:t?"white":"gray.600",border:"2px solid",borderColor:t?"purple.500":"gray.200",transition:"all 0.15s",onClick:()=>p.setFieldValue(u.name,t?r.filter(r=>r!==e):[...r,e]),children:e})},e)})}),(0,i.jsx)(f.J1,{fontSize:"xs",mt:1,children:y})]})}},e.id))]})},$=t(83299),ee=t(86214),er=t(75313),et=t(29705);let ei=R.Ry({fullName:R.Z_().required("Full name is required"),email:R.Z_().email("Invalid email address").required("Email is required"),phoneNumber:R.Z_().required("Phone number is required").test("is-valid-phone","Invalid phone number",e=>(0,I.yf)(e||"")),serviceType:R.Z_().required("Service type is required"),description:R.Z_().optional(),artisanFirstname:R.Z_().optional(),artisanLastname:R.Z_().optional(),locationAddress:R.Z_().optional(),latitude:R.Rx().optional(),longitude:R.Rx().optional(),preferredDate:R.Z_().optional(),endDate:R.Z_().optional()}),eo=e=>{let{children:r}=e;return(0,i.jsxs)(o.U,{spacing:3,align:"center",my:1,children:[(0,i.jsx)(l.x,{flex:1,h:"1px",bg:"gray.200"}),(0,i.jsx)(n.x,{fontSize:"xs",fontWeight:"600",color:"gray.400",whiteSpace:"nowrap",textTransform:"uppercase",letterSpacing:"0.04em",children:r}),(0,i.jsx)(l.x,{flex:1,h:"1px",bg:"gray.200"})]})};var el=e=>{let{isOpen:r,onClose:t,artisanId:N,serviceType:J,professionDisplayName:G,isCustomQuoteFlow:Q=!1,usesReservationInventory:el=!1,artisanFirstname:en,artisanLastname:ea,displayName:es,isBusinessIdentity:ed=!1,isTopRated:ec=!1,imageUrl:eu,artisanPhoneNumber:ep,artisanPageId:ex,targetBusinessId:eh,overrideQuoteIntakeFields:eg,serviceTypes:em}=e,[,eb]=(0,C.useState)(!1),[ef,ey]=(0,C.useState)(!1),[ej,ev]=(0,C.useState)(null),ew=(0,F.I0)(),eS=(0,E.$V)(),eA=(null==es?void 0:es.trim())||"".concat(en," ").concat(ea),[ez,eC]=(0,C.useState)(!1),[eR,ek]=(0,C.useState)(null),[eI,eF]=(0,C.useState)([]),eD=(0,C.useRef)(null),[e_,eN]=(0,C.useState)(!0),[eT,eW]=(0,C.useState)(!1),eE=(0,C.useRef)(null),eZ=(0,F.v9)((0,ee.bT)(N)),eO=(0,C.useMemo)(()=>{var e;return null!==(e=null!=eg?eg:null==eZ?void 0:eZ.quoteIntakeFields)&&void 0!==e?e:[]}
1,[eg,eZ]),eU=eO.length>0,eq=(0,C.useMemo)(()=>Object.fromEntries(eO.map(e=>[e.fieldKey,"multi_select"===e.fieldType?[]:""])),[eO]),eB=(0,C.useMemo)(()=>{let e=ed?ei.shape({artisanFirstname:R.Z_().optional(),artisanLastname:R.Z_().optional()}):ei;if(0===eO.length)return e;let r=Object.fromEntries(eO.map(e=>{let r="multi_select"===e.fieldType?R.IX().of(R.Z_()):R.Z_();return e.required&&(r="multi_select"===e.fieldType?r.min(1,"".concat(e.label," is required")):r.required("".concat(e.label," is required"))),[e.fieldKey,r]}));return e.shape({customFieldResponses:R.Ry(r)})},[eO,ed]);(0,C.useEffect)(()=>{if(!r)return;eN(!0);let e=setTimeout(()=>eN(!1),5e3);return()=>clearTimeout(e)},[r]);let eP=()=>eN(!1),eH=e=>{let r=Array.from(e.target.files||[]);!(r.length+eI.length>15)&&(eF(e=>[...e,...r]),eD.current&&(eD.current.value=""))},eL=e=>{eF(r=>r.filter((r,t)=>t!==e))},eY=async e=>{let r=localStorage.getItem("token");if(!N)return[];let t=e.map(e=>({filename:e.name,contentType:e.type})),i=await ew((0,Z.KC)({files:t,resourceType:"request",resourceId:N,userAuthToken:null!=r?r:"",imageType:"request"})).unwrap(),o=[];for(let t=0;t<e.length;t++){let l=e[t],{url:n,filename:a}=i.presignedUrls[t];if(!(await fetch(n,{method:"PUT",headers:{"Content-Type":l.type,"x-goog-meta-resource-type":"request","x-goog-meta-resource-id":N,"x-goog-meta-user_auth_token":null!=r?r:"","x-goog-meta-image-type":"request"},body:l})).ok)throw Error("Failed to upload ".concat(l.name));o.push({filename:a,url:"https://storage.googleapis.com/handymesh/".concat(a),type:l.type.startsWith("video/")?"video":"image"})}return o},eK=async(e,r)=>{let{setSubmitting:t,resetForm:i}=r;eb(!0);try{let r,t=[];if(eI.length>0)try{t=await eY(eI)}catch(e){}let o=e.fullName.trim().split(" "),l=o[0]||"",n=o.slice(1).join(" ")||"",a=!!em&&em.length>1;r=(null==eS?void 0:eS.id)?await (0,q.X8)("post","".concat(q.Ne,"/core/request/direct/user/").concat(eS.id),{directArtisanId:N,serviceType:e.serviceType,...a?{serviceTypes:em}:{},serviceDescription:e.description,...eh?{targetBusinessId:eh}:{},...(null==eR?void 0:eR.latitude)!=null?{latitude:String(eR.latitude)}:{},...(null==eR?void 0:eR.longitude)!=null?{longitude:String(eR.longitude)}:{},...(null==eR?void 0:eR.address)?{address:eR.address}:{},...e.preferredDate?{preferredDate:new Date(e.preferredDate).toISOString()}:{},...e.endDate?{endDate:new Date(e.endDate).toISOString()}:{},...t.length>0?{media:t}:{},...eO.length>0?{customFieldResponses:e.customFieldResponses}:{}}):await (0,q.X8)("post","".concat(q.Ne,"/core/request/direct/guest"),{directArtisanId:N,firstName:l,lastName:n,phoneNumber:e.phoneNumber,...e.email?{email:e.email}:{},serviceType:e.serviceType,...a?{serviceTypes:em}:{},serviceDescription:e.description,...eh?{targetBusinessId:eh}:{},...(null==eR?void 0:eR.latitude)!=null?{latitude:eR.latitude}:{},...(null==eR?void 0:eR.longitude)!=null?{longitude:eR.longitude}:{},...(null==eR?void 0:eR.address)?{address:eR.address}:{},...e.preferredDate?{preferredDate:new Date(e.preferredDate).toISOString()}:{},...e.endDate?{endDate:new Date(e.endDate).toISOString()}:{},...t.length>0?{media:t}:{},...eO.length>0?{customFieldResponses:e.customFieldResponses}:{}}),(0,B.L9)("direct_artisan_service_request",{service_category:e.serviceType,service_description:e.description,full_name:e.fullName,location_address:(null==eR?void 0:eR.address)||""}),a||(0,P.T)("Schedule",{content_id:null==r?void 0:r.id,content_type:e.serviceType}),a&&(null==r?void 0:r.succeeded)&&ev({succeeded:r.succeeded.length,failed:(r.failed||[]).map(e=>e.serviceType)}),ey(!0),eF([]),i(),(null==eS?void 0:eS.id)&&ew((0,E.BT)()).unwrap()}catch(r){let e=r instanceof Error?r.message:"Failed to submit request";console.error("Submission error:",r),O.Am.error(e)}finally{eb(!1),t(!1)}};return(0,i.jsxs)(a.u_,{isOpen:r,onClose:t,size:{base:"full",md:"xl"},children:[(0,i.jsx)(s.Z,{bg:"blackAlpha.600",backdropFilter:"blur(4px)"}),(0,i.jsxs)(d.h,{mx:{base:0,md:4},my:{base:0,md:4},maxW:{base:"100%",md:"700px"},bg:"gray.50",display:"flex",flexDirection:"column",children:[(0,i.jsx)(c.o,{size:"lg",color:"white",_hover:{bg:"whiteAlpha.300"},zIndex:2}),(0,i.jsx)(u.f,{p:0,display:"flex",flexDirection:"column",flex:"1",children:(0,i.jsx)(D.M,{mode:"wait",children:ef?(0,i.jsx)(l.x,{as:_.E.div,initial:{opacity:0,scale:.9}
1,animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},transition:"all 0.3s ease-in-out",bg:"white",w:"full",flex:"1",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",borderRadius:{base:0,md:"24px"},children:(0,i.jsxs)(p.g,{spacing:6,py:12,px:8,children:[(0,i.jsx)(_.E.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.2,type:"spring",stiffness:200},children:(0,i.jsxs)(l.x,{position:"relative",bg:"green.50",borderRadius:"full",p:8,children:[(0,i.jsx)(l.x,{position:"absolute",inset:0,bg:"green.100",borderRadius:"full",animation:"pulse 2s ease-in-out infinite"}),(0,i.jsx)(T(),{src:W,alt:"Submission Success",width:120,height:120,style:{objectFit:"contain",position:"relative"}})]})}),(0,i.jsxs)(p.g,{spacing:3,children:[(0,i.jsx)(n.x,{fontSize:"2xl",fontWeight:"800",color:"gray.800",children:"Request Submitted Successfully!"}),(0,i.jsxs)(n.x,{fontSize:"md",color:"gray.600",maxW:"400px",lineHeight:"tall",children:["The service provider has been notified about your"," ",ej&&ej.succeeded>1?"".concat(ej.succeeded," requests"):"request"," ","and will contact you shortly. You'll receive updates via email and phone."]}),ej&&ej.failed.length>0&&(0,i.jsxs)(n.x,{fontSize:"sm",color:"orange.600",maxW:"400px",lineHeight:"tall",children:["We couldn't submit your request for ",ej.failed.join(", ")," â please try again for ",ej.failed.length>1?"those":"that"," one."]})]}),(0,i.jsx)(j.z,{as:_.E.button,size:"lg",w:"full",maxW:"300px",h:"54px",borderRadius:"14px",bgGradient:"linear(135deg, #667eea 0%, #764ba2 100%)",color:"white",fontSize:"md",fontWeight:"600",boxShadow:"0 4px 15px rgba(102, 126, 234, 0.4)",_hover:{bgGradient:"linear(135deg, #5568d3 0%, #6a3f94 100%)",boxShadow:"0 6px 20px rgba(102, 126, 234, 0.5)",transform:"translateY(-2px)"},_active:{transform:"translateY(0)"},initial:"hidden",animate:"visible",variants:{hidden:{opacity:0,y:10},visible:{opacity:1,y:0,transition:{duration:.3,delay:.4}}},onClick:()=>{ey(!1),ev(null),t()},transition:"all 0.2s",children:"Done"})]})},"success"):(0,i.jsx)(l.x,{as:_.E.div,initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:"background 0.2s ease-in-out",bg:"white",w:"full",children:(0,i.jsx)(k.J9,{initialValues:{fullName:eS?"".concat(eS.firstName||""," ").concat(eS.lastName||"").trim():"",email:(null==eS?void 0:eS.email)||"",phoneNumber:(null==eS?void 0:eS.phoneNumber)||"",artisanId:N,serviceType:J,description:"",artisanFirstname:en,artisanLastname:ea,artisanPhoneNumber:ep,latitude:void 0,longitude:void 0,preferredDate:"",endDate:"",customFieldResponses:eq},validationSchema:eB,onSubmit:eK,enableReinitialize:!0,children:e=>{let{isSubmitting:r,values:t,setFieldValue:a}=e;return(0,i.jsx)(k.l0,{children:(0,i.jsxs)(p.g,{spacing:0,align:"stretch",children:[(0,i.jsxs)(l.x,{position:"relative",overflow:"hidden",children:[(0,i.jsxs)(l.x,{bgGradient:"linear(135deg, #667eea 0%, #764ba2 100%)",position:"relative",pt:8,pb:24,children:[(0,i.jsx)(l.x,{position:"absolute",top:"-20%",right:"-5%",width:"300px",height:"300px",bgGradient:"radial(circle, rgba(255,255,255,0.15) 0%, transparent 70%)",borderRadius:"full",filter:"blur(60px)"}),(0,i.jsx)(l.x,{position:"absolute",bottom:"-10%",left:"-5%",width:"250px",height:"250px",bgGradient:"radial(circle, rgba(255,255,255,0.1) 0%, transparent 70%)",borderRadius:"full",filter:"blur(50px)"}),(0,i.jsxs)(p.g,{spacing:3,px:8,position:"relative",zIndex:1,children:[(0,i.jsx)(n.x,{fontSize:"2xl",fontWeight:"800",color:"white",textAlign:"center",textShadow:"0 2px 10px rgba(0,0,0,0.2)",children:Q?"Request a Custom Quote":"Request Service"}),(0,i.jsx)(n.x,{fontSize:"sm",color:"whiteAlpha.900",textAlign:"center",maxW:"400px",children:Q?"".concat(eA," will send an itemized quote you can review before paying"):"Fill out the form below and the service provider will be notified immediately"})]})]}),(0,i.jsx)(l.x,{position:"relative",mt:"-16",px:6,zIndex:2,children:(0,i.jsx)(l.x,{bg:"white",borderRadius:"16px",boxShadow:"0 10px 40px rgba(0,0,0,0.1)",p:5,border:"1px solid",borderColor:"gray.100",children:(0,i.jsxs)(o.U,{spacing:4,align:"center",children:[(0,i.jsxs)(l.x,{position:"relative",children:[(0,i.jsx)(x.q,{src:null!=eu?eu:void 0,name:eA,size:"lg",border:"3px solid",borderColor:"purple.500"}),(0,i.jsx)(l.x,{position:"absolute",bottom:"0",right:"0",bg:"green.400",borderRadius:"full",w:"14px",h:"14px",border:"3px solid white"})]}),(0,i.jsxs)(p.g,{align:"start",spacing:0,flex:1,children:[(0,i.jsxs)(o.U,{spacing:"6px",align:"center",children:[(0,i.jsx)(n.x,{fontSize:"lg",fontWeight:"700",color:"gray.800",children:eA||"Not provided"}),ed&&(0,i.jsx)(h.J,{as:er.Y5,boxSize:"15px",color:"gray.500"}),ec&&(0,i.jsx)(et.Z,{size:"sm"})]}),(0,i.jsx)(n.x,{fontSize:"sm",color:"purple.600",fontWeight:"500",children:G||"Provider"})]})]})})})]}),(0,i.jsx)(l.x,{bg:"white",px:6,pt:6,pb:8,children:(0,i.jsxs)(p.g,{spacing:5,align:"stretch",children:[(0,i.jsx)(n.x,{fontSize:"md",fontWeight:"600",color:"gray.800",children:"Your Information"}),(0,i.jsx)(k.gN,{name:"fullName",children:e=>{let{field:r,form:t}=e;return(0,i.jsxs)(g.NI,{isInvalid:t.errors.fullName&&t.touched.fullName,children:[(0,i.jsx)(m.l,{fontSize:"sm",fontWeight:"500",color:"gray.700",mb:2,children:"Full Name"}),(0,i.jsxs)(o.U,{bg:"gray.50",borderRadius:"12px",border:"2px s
1olid",borderColor:t.errors.fullName&&t.touched.fullName?"red.300":"gray.200",px:4,transition:"all 0.2s",_focusWithin:{borderColor:"purple.500",bg:"white",boxShadow:"0 0 0 3px rgba(139, 92, 246, 0.1)"},children:[(0,i.jsx)(h.J,{as:H.Z,color:"gray.400",boxSize:5}),(0,i.jsx)(b.I,{...r,placeholder:"Enter your full name",size:"md",border:"none",bg:"transparent",_focus:{boxShadow:"none"},_placeholder:{color:"gray.400"}})]}),(0,i.jsx)(f.J1,{fontSize:"xs",mt:1,children:t.errors.fullName})]})}}),(0,i.jsx)(k.gN,{name:"email",children:e=>{let{field:r,form:t}=e;return(0,i.jsxs)(g.NI,{isInvalid:t.errors.email&&t.touched.email,children:[(0,i.jsx)(m.l,{fontSize:"sm",fontWeight:"500",color:"gray.700",mb:2,children:"Email Address"}),(0,i.jsxs)(o.U,{bg:"gray.50",borderRadius:"12px",border:"2px solid",borderColor:t.errors.email&&t.touched.email?"red.300":"gray.200",px:4,transition:"all 0.2s",_focusWithin:{borderColor:"purple.500",bg:"white",boxShadow:"0 0 0 3px rgba(139, 92, 246, 0.1)"},children:[(0,i.jsx)(h.J,{as:L.Z,color:"gray.400",boxSize:5}),(0,i.jsx)(b.I,{...r,placeholder:"[email protected]",size:"md",border:"none",bg:"transparent",_focus:{boxShadow:"none"},_placeholder:{color:"gray.400"}})]}),(0,i.jsx)(f.J1,{fontSize:"xs",mt:1,children:t.errors.email})]})}}),(0,i.jsx)(k.gN,{name:"phoneNumber",children:e=>{let{field:r,form:t}=e;return(0,i.jsxs)(g.NI,{isInvalid:t.errors.phoneNumber&&t.touched.phoneNumber,children:[(0,i.jsx)(m.l,{fontSize:"sm",fontWeight:"500",color:"gray.700",mb:2,children:"Phone Number"}),(0,i.jsx)(I.ZP,{international:!0,defaultCountry:"NG",value:r.value,onChange:e=>t.setFieldValue("phoneNumber",e||""),onBlur:()=>t.setFieldTouched("phoneNumber",!0),style:{width:"100%",height:"48px",paddingLeft:"12px",paddingRight:"12px",borderRadius:"12px",border:t.errors.phoneNumber&&t.touched.phoneNumber?"2px solid #FC8181":"2px solid #E2E8F0",backgroundColor:"#F9FAFB",fontSize:"14px",color:"#1A202C"}}),(0,i.jsx)(f.J1,{fontSize:"xs",mt:1,children:t.errors.phoneNumber})]})}}),!eS&&(0,i.jsxs)(o.U,{align:"flex-start",spacing:2,bg:"#EFF6FF",borderRadius:"10px",px:3,py:2.5,children:[(0,i.jsx)(h.J,{as:Y.Z,color:"#3B82F6",boxSize:3.5,mt:"1px"}),(0,i.jsx)(n.x,{fontSize:"xs",color:"#1D4ED8",lineHeight:"1.4",children:"If your phone number or email matches an existing Handymesh account, this request will be linked to it automatically. Otherwise, you can create an account afterward using the same details to track it."})]}),(0,i.jsx)(l.x,{h:"1px",bg:"gray.200",my:2}),(0,i.jsx)(n.x,{fontSize:"md",fontWeight:"600",color:"gray.800",mt:2,children:"Service Details"}),eU&&(0,i.jsx)(eo,{children:"Every profession gets this"}),(0,i.jsx)(k.gN,{name:"locationAddress",children:e=>{let{field:r,form:t}=e;return(0,i.jsxs)(g.NI,{isInvalid:t.errors.locationAddress&&t.touched.locationAddress,children:[(0,i.jsxs)(m.l,{fontSize:"sm",fontWeight:"500",color:"gray.700",mb:2,children:["Location"," ",(0,i.jsx)(n.x,{as:"span",color:"gray.400",fontSize:"xs",children:"(Optional)"})]}),(0,i.jsxs)(o.U,{bg:"gray.50",borderRadius:"12px",border:"2px solid",borderColor:"gray.200",px:4,transition:"all 0.2s",cursor:"pointer",onClick:()=>eC(!0),_hover:{borderColor:"purple.300",bg:"purple.50"},children:[(0,i.jsx)(h.J,{as:K.Z,color:"gray.400",boxSize:5}),(0,i.jsx)(b.I,{...r,placeholder:"Click to select location",size:"md",border:"none",bg:"transparent",value:(null==eR?void 0:eR.address)||"",isReadOnly:!0,cursor:"pointer",_focus:{boxShadow:"none"},_placeholder:{color:"gray.400"}})]}),(0,i.jsx)(f.J1,{fontSize:"xs",mt:1,children:t.errors.locationAddress})]})}}),(0,i.jsxs)(g.NI,{children:[(0,i.jsxs)(m.l,{fontSize:"sm",fontWeight:"500",color:"gray.700",mb:2,children:[el?"Select Your Dates":"When do you need this?"," ",(0,i.jsx)(n.x,{as:"span",color:"gray.400",fontSize:"xs",children:"(Optional)"})]}),(0,i.jsx)($.Z,{mode:el?"range":"single",startDate:t.preferredDate||"",endDate:t.endD
1ate||"",onChangeStart:e=>a("preferredDate",e),onChangeEnd:e=>a("endDate",e),startLabel:"Start Date",endLabel:"End Date"}),el&&(0,i.jsxs)(n.x,{fontSize:"10.5px",color:"gray.400",mt:2,children:["Not sure on the end date? ",eA," will confirm it with you."]})]}),eU&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eo,{children:"Specific to this profession"}),(0,i.jsx)(X,{fields:eO,hideHeading:!0}),(0,i.jsx)(eo,{children:"A few more details"})]}),(0,i.jsx)(k.gN,{name:"description",children:e=>{let{field:r,form:t}=e;return(0,i.jsxs)(g.NI,{isInvalid:t.errors.description&&t.touched.description,children:[(0,i.jsxs)(o.U,{justify:"space-between",align:"center",mb:2,children:[(0,i.jsxs)(m.l,{fontSize:"sm",fontWeight:"500",color:"gray.700",mb:0,children:["Describe Your Service Need"," ",(0,i.jsx)(n.x,{as:"span",color:"gray.400",fontSize:"xs",children:"(Optional)"})]}),(0,i.jsxs)(l.x,{position:"relative",children:[e_&&(0,i.jsx)(l.x,{position:"absolute",bottom:"calc(100% + 8px)",right:"-4px",bg:"gray.800",color:"white",fontSize:"xs",fontWeight:"600",px:3,py:2,borderRadius:"md",whiteSpace:"nowrap",zIndex:10,sx:{animation:"voiceHintFadeIn 0.3s ease","@keyframes voiceHintFadeIn":{from:{opacity:0,transform:"translateY(4px)"},to:{opacity:1,transform:"translateY(0)"}},"&::after":{content:'""',position:"absolute",top:"100%",right:"14px",borderWidth:"5px",borderStyle:"solid",borderColor:"gray.800 transparent transparent transparent"}},children:"\uD83C\uDF99ï¸ Tap to speak"}),(0,i.jsx)(l.x,{borderRadius:"full",sx:e_?{"@keyframes voicePulse":{"0%":{boxShadow:"0 0 0 0 rgba(51, 101, 227, 0.5)"},"70%":{boxShadow:"0 0 0 10px rgba(51, 101, 227, 0)"},"100%":{boxShadow:"0 0 0 0 rgba(51, 101, 227, 0)"}},animation:"voicePulse 1.4s ease infinite"}:{},children:(0,i.jsx)(V.D,{ref:eE,onTranscript:e=>{eP(),t.setFieldValue("description",r.value?"".concat(r.value," ").concat(e):e)},onError:e=>O.Am.error(e),onRecordingChange:e=>{eW(e),e&&eP()}})})]})]}),(0,i.jsxs)(l.x,{position:"relative",bg:"gray.50",borderRadius:"12px",border:"2px solid",borderColor:t.errors.description&&t.touched.description?"red.300":"gray.200",p:3,transition:"all 0.2s",_focusWithin:{borderColor:"purple.500",bg:"white",boxShadow:"0 0 0 3px rgba(139, 92, 246, 0.1)"},children:[(0,i.jsxs)(o.U,{align:"flex-start",spacing:3,children:[(0,i.jsx)(h.J,{as:M.Z,color:"gray.400",boxSize:5,mt:1}),(0,i.jsx)(y.g,{...r,placeholder:"Please provide details about what you need help with...",size:"md",border:"none",bg:"transparent",minH:"100px",resize:"vertical",isReadOnly:eT,_focus:{boxShadow:"none"},_placeholder:{color:"gray.400"}})]}),eT&&(0,i.jsx)(l.x,{position:"absolute",inset:0,cursor:"pointer",onClick:()=>{var e;return null===(e=eE.current)||void 0===e?void 0:e.stopRecording()},"aria-label":"Stop recording"})]}),(0,i.jsx)(f.J1,{fontSize:"xs",mt:1,children:t.errors.description})]})}}),(0,i.jsxs)(g.NI,{children:[(0,i.jsxs)(m.l,{fontSize:"sm",fontWeight:"500",color:"gray.700",mb:2,children:["Photos / Videos"," ",(0,i.jsx)(n.x,{as:"span",color:"gray.400",fontSize:"xs",children:"(Optional, max 15)"})]}),(0,i.jsx)("input",{type:"file",accept:"image/jpeg,image/png,image/heic,image/heif,video/mp4,video/quicktime",multiple:!0,ref:eD,onChange:eH,style:{display:"none"}}),(0,i.jsxs)(j.z,{variant:"outline",size:"sm",leftIcon:(0,i.jsx)(A.d,{}),onClick:()=>{var e;return null===(e=eD.current)||void 0===e?void 0:e.click()},isDisabled:eI.length>=15,borderRadius:"10px",borderColor:"gray.300",color:"gray.600",w:"full",children:["Attach Media (",eI.length,"/15)"]}),eI.length>0&&(0,i.jsx)(v.r,{templateColumns:"repeat(auto-fill, minmax(90px, 1fr))",gap:2,mt:3,children:eI.map((e,r)=>(0,i.jsxs)(w.P,{position:"relative",children:[(0,i.jsx)(l.x,{borderRadius:"10px",overflow:"hidden",border:"1px solid",borderColor:"gray.200",height:"90px",children:e.type.startsWith("image/")?(0,i.jsx)(T(),{src:URL.createObjectURL(e),alt:"media-".concat(r),fill:!0,style:{objectFit:"cover"}}):(0,i.jsx)("video",{src:URL.createObjectURL(e),style:{width:"100%",height:"100%",objectFit:"cover"}})}),(0,i.jsx)(S.h,{"aria-label":"Remove",icon:(0,i.jsx)(z.T,{w:2.5,h:2.5,color:"white"}),size:"xs",position:"absolute",top:"4px",right:"4px",variant:"ghost",borderRadius:"full",bg:"rgba(0,0,0,0.5)",_hover:{bg:"red.500"},onClick:()=>eL(r)})]},r))})]})]})}),(0,i.jsx)(l.x,{bg:"gray.50",px:6,py:6,borderBottomRadius:{base:0,md:"24px"},children:(0,i.jsx)(j.z,{as:_.E.button,type:"submit",size:"lg",w:"full",h:"56px",borderRadius:"14px",bgGradient:"linear(135deg, #667eea 0%, #764ba2 100%)",color:"white",fontSize:"md",fontWeight:"600",boxShadow:"0 4px 15px rgba(102, 126, 234, 0.4)",_hover:{bgGradient:"linear(135deg, #5568d3 0%, #6a3f94 100%)",boxShadow:"0 6px 20px rgba(102, 126, 234, 0.5)",transform:"translateY(-2px)"},_active:{transform:"translateY(0)"},initial:"hidden",animate:"visible",variants:{hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.4,delay:.1,ease:"easeOut"}}},isLoading:r,isDisabled:r,loadingText:"Submitting...",transition:"all 0.2s",children:"Submit Request"})})]})})}})},"form")})})]}),(0,i.jsx)(U.Z,{isOpen:ez,onClose:()=>eC(!1),onSave:e=>{ek(e),eC(!1)}})]})}},11718:function(e,r,t){var i=t(85893),o=t(67294),l=t(68029),n=t(8186),a=t(73636),s=t(90092),d=t(19159),c=t(35270);r.Z=e=>{let{items:r,onItemClick:t}=e,u=(0,o.useRef)(null),[p,x]=(0,o.useState)(!1),h=(0,o.useRef)(null),g=r.length>3,m=g?[...r,...r]:r;return((0,o.useEffect)(()=>
1{if(!g)return;let e=u.current;if(!e)return;let r=()=>{!p&&e&&(e.scrollTop+=.35,e.scrollTop>=e.scrollHeight/2&&(e.scrollTop=0)),h.current=requestAnimationFrame(r)};return h.current=requestAnimationFrame(r),()=>{h.current&&cancelAnimationFrame(h.current)}},[p,g]),0===r.length)?null:(0,i.jsx)(l.x,{ref:u,h:g?"".concat(380,"px"):"auto",maxH:"".concat(380,"px"),overflowY:"auto",onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),onTouchStart:()=>x(!0),onTouchEnd:()=>x(!1),onFocus:()=>x(!0),onBlur:()=>x(!1),sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},children:(0,i.jsx)(n.g,{align:"stretch",spacing:3,children:m.map((e,r)=>(0,i.jsxs)(a.U,{spacing:3,p:3,bg:"white",border:"1px solid",borderColor:"gray.200",borderRadius:"12px",cursor:"pointer",_hover:{borderColor:"gray.300",boxShadow:"sm"},transition:"all 0.15s",onClick:()=>t(e.id),tabIndex:0,children:[(0,i.jsx)(l.x,{w:"64px",h:"64px",flexShrink:0,borderRadius:"8px",overflow:"hidden",bg:"gray.100",children:(0,i.jsx)("img",{src:e.thumbnail||c.Z.src,alt:e.title,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})}),(0,i.jsxs)(n.g,{align:"start",spacing:"2px",minW:0,children:[(0,i.jsx)(s.x,{fontSize:"14px",fontWeight:"600",color:"gray.800",noOfLines:1,children:e.title}),(0,i.jsxs)(s.x,{fontSize:"13px",color:"gray.500",children:["From ",(0,d.$c)(e.startingPrice)]})]})]},"".concat(e.type,"-").concat(e.id,"-").concat(r)))})})}},29705:function(e,r,t){var i=t(85893),o=t(73636),l=t(12553),n=t(90092),a=t(88815);r.Z=e=>{let{size:r="md"}=e;return(0,i.jsxs)(o.U,{as:"span",spacing:"4px",bg:"#FFFBEB",border:"1px solid",borderColor:"#FDE68A",borderRadius:"100px",px:"8px",py:"3px",display:"inline-flex",alignItems:"center",flexShrink:0,children:[(0,i.jsx)(l.J,{as:a.Z,boxSize:"sm"===r?"11px":"13px",color:"#F59E0B",variant:"Bold"}),(0,i.jsx)(n.x,{fontSize:"sm"===r?"11px":"12px",fontWeight:700,color:"#92400E",whiteSpace:"nowrap",lineHeight:1,children:"Top Rated"})]})}},41282:function(e,r,t){var i=t(85893),o=t(67294),l=t(5490),n=t(34614),a=t(26840),s=t(57391),d=t(21360),c=t(70010),u=t(90092),p=t(8186),x=t(73636),h=t(55436),g=t(4296),m=t(89342),b=t(82206),f=t(45443),y=t(38491),j=t(23961),v=t(45007),w=t(11163),S=t(55678),A=t(18471),z=t(37750),C=t(92209);let R=[{key:"monday",label:"Monday"},{key:"tuesday",label:"Tuesday"},{key:"wednesday",label:"Wednesday"},{key:"thursday",label:"Thursday"},{key:"friday",label:"Friday"},{key:"saturday",label:"Saturday"},{key:"sunday",label:"Sunday"}];r.Z=e=>{let{isOpen:r,onClose:t,initialWorkingHours:k,businessId:I}=e,F=(0,v.I0)(),D=(0,w.useRouter)(),[_,N]=(0,o.useState)(k||{}),[T,W]=(0,o.useState)(!1);(0,o.useEffect)(()=>{r&&N(k||{})},[r,k]);let E=e=>{N(r=>({...r,[e]:r[e]?null:{...C.HW}}))},Z=(e,r,t)=>{N(i=>{let o=i[e]||{...C.HW};return{...i,[e]:{...o,[r]:t}}})},O=async()=>{try{if(W(!0),I){await (0,z.yk)(I,_),S.Am.success("Working hours updated"),t(),D.reload();return}await F((0,A.DZ)({workingHours:_})).unwrap(),await F((0,A.BT)()).unwrap(),S.Am.success("Working hours updated"),t()}catch(e){S.Am.error((null==e?void 0:e.message)||"Failed to update working hours. Please try again.")}finally{W(!1)}};return(0,i.jsxs)(l.u_,{closeOnOverlayClick:!1,isOpen:r,onClose:t,size:"lg",scrollBehavior:"inside",children:[(0,i.jsx)(n.Z,{}),(0,i.jsxs)(a.h,{maxH:{base:"100dvh",md:"85vh"},display:"flex",flexDirection:"column",children:[(0,i.jsx)(s.x,{children:"Working Hours"}),(0,i.jsx)(d.o,{}),(0,i.jsxs)(c.f,{overflowY:"auto",flex:"1",minH:0,sx:{WebkitOverflowScrolling:"touch"},children:[(0,i.jsx)(u.x,{fontSize:"13px",color:"gray.500",mb:4,children:"Let customers know when you're typically available. Turn a day off if you don't work then."}),(0,i.jsx)(p.g,{align:"stretch",spacing:3,children:R.map(e=>{let{key:r,label:t}=e,o=_[r],l=!!o;return(0,i.jsxs)(x.U,{align:"center",spacing:3,p:3,bg:l?"purple.50":"gray.50",border:"1px solid",borderColor:l?"purple.100":"gray.200",borderRadius:"10px",transition:"all 0.15s",children:[(0,i.jsx)(h.r,{colorScheme:"purple",isChecked:l,onChange:()=>E(r)}),(0,i.jsx)(u.x,{fontSize:"14px",fontWeight:"600",color:"gray.700",w:"90px",flexShrink:0,children:t}),l?(0,i.jsxs)(x.U,{flex:1,spacing:2,children:[(0,i.jsxs)(g.B,{size:"sm",children:[(0,i.jsx)(m.Z,{pointerEvents:"none",children:(0,i.jsx)(j.Z,{size:14,color:"#9
1CA3AF"})}),(0,i.jsx)(b.I,{type:"time",pl:"32px",bg:"white",borderRadius:"8px",value:(null==o?void 0:o.start)||C.HW.start,onChange:e=>Z(r,"start",e.target.value)})]}),(0,i.jsx)(u.x,{fontSize:"12px",color:"gray.400",children:"to"}),(0,i.jsxs)(g.B,{size:"sm",children:[(0,i.jsx)(m.Z,{pointerEvents:"none",children:(0,i.jsx)(j.Z,{size:14,color:"#9CA3AF"})}),(0,i.jsx)(b.I,{type:"time",pl:"32px",bg:"white",borderRadius:"8px",value:(null==o?void 0:o.end)||C.HW.end,onChange:e=>Z(r,"end",e.target.value)})]})]}):(0,i.jsx)(u.x,{fontSize:"13px",color:"gray.400",flex:1,children:"Closed"})]},r)})})]}),(0,i.jsxs)(f.m,{borderTop:"1px solid",borderColor:"gray.100",children:[(0,i.jsx)(y.z,{variant:"ghost",onClick:t,isDisabled:T,mr:3,children:"Cancel"}),(0,i.jsx)(y.z,{colorScheme:"purple",onClick:O,isLoading:T,children:"Save"})]})]})]})}},92209:function(e,r,t){t.d(r,{H1:function(){return s},HW:function(){return i},xr:function(){return a}});let i={start:"09:00",end:"17:00"},o=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],l={monday:"Mon",tuesday:"Tue",wednesday:"Wed",thursday:"Thu",friday:"Fri",saturday:"Sat",sunday:"Sun"},n=e=>{let[r,t]=e.split(":").map(Number),i=r>=12?"PM":"AM",o=r%12==0?12:r%12;return 0===t?"".concat(o).concat(i):"".concat(o,":").concat(String(t).padStart(2,"0")).concat(i)},a=e=>{if(!e)return null;let r=o.map(r=>({day:r,value:e[r]||null}));if(r.every(e=>!e.value))return null;let t=[];for(let e of r){let r=t[t.length-1];r&&(!r.value&&!e.value||r.value&&e.value&&r.value.start===e.value.start&&r.value.end===e.value.end)?r.days.push(e.day):t.push({days:[e.day],value:e.value})}return t.filter(e=>e.value).map(e=>{let r=e.days.length>1?"".concat(l[e.days[0]],"â").concat(l[e.days[e.days.length-1]]):l[e.days[0]];return"".concat(r," ").concat(n(e.value.start),"â").concat(n(e.value.end))}).join(", ")},s=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Date;if(!e)return!1;let t=e[["sunday","monday","tuesday","wednesday","thursday","friday","saturday"][r.getDay()]];if(!t)return!1;let i=60*r.getHours()+r.getMinutes(),[o,l]=t.start.split(":").map(Number),[n,a]=t.end.split(":").map(Number);return i>=60*o+l&&i<60*n+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.