1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7179,8299],{22747:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(18153),a=n(84733),r=n(14232);let l=e=>{let{data:t}=e,{formId:n}=t,l="143681764",o=(0,r.useRef)(null),[s,d]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(!l||!n)return;if(window.hbspt)return void d(!0);let e=document.createElement("script");e.src="https://js-eu1.hsforms.net/forms/v2.js",e.async=!0,e.defer=!0,e.onload=()=>{d(!0)},document.body.appendChild(e)},[l,n]),(0,r.useEffect)(()=>{if(!s||!window.hbspt)return;let e=document.getElementById("hubspotFormWrapper");e&&(e.innerHTML=""),window.hbspt.forms.create({portalId:l,formId:n,target:"#hubspotFormWrapper"})},[s,l,n]),(0,i.FD)(a.A,{sx:{maxWidth:"750px",margin:"0 auto",width:"100%"},children:[(0,i.Y)("style",{children:"\n #hubspotFormWrapper iframe {\n width: 100% !important;\n max-width: 100% !important;\n }\n\n #hubspotFormWrapper {\n width: 100% !important;\n max-width: 100% !important;\n }\n\n .hs-form-iframe,\n .hs-form-iframe iframe {\n width: 100% !important;\n max-width: 100% !important;\n }\n "}),(0,i.Y)("div",{id:"hubspotFormWrapper",ref:o})]})}},26362:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(18153),a=n(68309),r=n(6537);let l=()=>(0,i.Y)(a.A,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%",color:"#000"},children:(0,i.Y)(r.A,{color:"inherit"})})},42964:e=>{e.exports={selectContainer:"select_selectContainer__PuWYa",selectLabel:"select_selectLabel__BTf1z",error:"select_error__cmuSB",selectBox:"select_selectBox__oeEtx",selected:"select_selected__4LtD0",errorMessage:"select_errorMessage__skSqd",optionsList:"select_optionsList__FyqPf",option:"select_option__obsfX",highlighted:"select_highlighted__XYfxz"}},48917:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(18153),a=n(14232);n(22747);var r=n(84733);let l=e=>{let{data:t}=e,{formId:n}=t,l="143681764",o=(0,a.useRef)(null),[s,d]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!l||!n)return;if(window.hbspt)return void d(!0);let e=document.createElement("script");e.src="https://js-eu1.hsforms.net/forms/v2.js",e.async=!0,e.defer=!0,e.onload=()=>{d(!0)},document.body.appendChild(e)},[l,n]),(0,a.useEffect)(()=>{if(!s||!window.hbspt)return;let e=document.getElementById("hubspotFormWrapper");e&&(e.innerHTML=""),window.hbspt.forms.create({portalId:l,formId:n,target:"#hubspotFormWrapper"})},[s,l,n]),(0,i.FD)(r.A,{sx:{maxWidth:"1280px",margin:"0 auto",width:"100%"},children:[(0,i.Y)("style",{children:"\n #hubspotFormWrapper iframe {\n width: 100% !important;\n max-width: 100% !important;\n }\n\n #hubspotFormWrapper {\n width: 100% !important;\n max-width: 100% !important;\n }\n\n .hs-form-iframe,\n .hs-form-iframe iframe {\n width: 100% !important;\n max-width: 100% !important;\n }\n "}),(0,i.Y)("div",{id:"hubspotFormWrapper",ref:o})]})},o=e=>{let{data:t}=e;return(0,i.Y)(l,{data:t})}},56438:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});var i=n(14232);function a(){{let{innerWidth:e,innerHeight:t}=window;return{width:e,height:t}}}function r(){let[e,t]=(0,i.useState)(a());return(0,i.useEffect)(()=>{function e(){t(a())}return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),e}},63207:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(18153);let a=e=>{let{videoUrl:t,height:n}=e,a=t.split("/"),r=a.length>4,l=r?a.slice(-2)[0]:a.pop(),o=r?"?h=".concat(a.pop()):"",s="https://player.vimeo.com/video/".concat(l).concat(o);return(0,i.Y)("div",{style:{position:"relative",height:"100%",width:"100%",minHeight:n+"px"},children:(0,i.Y)("iframe",{style:{border:"none",position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},width:"100%",height:"100%",src:s,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Embedded video"})})},r=e=>{let{videoUrl:t,height:n}=e;return(0,i.Y)("div",{style:{position:"relative",height:"100%",width:"100%",minHeight:n+"px"},children:(0,i.Y)("iframe",{style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%"},width:"100%",height:"100%",src:"https://www.youtube-nocookie.com/embed/".concat(t.split("=").pop(),"?rel=0"),title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0})})},l=e=>{let{videoUrl:t,height:n}=e;return t?t.includes("vimeo")?(0,i.Y)(a,{videoUrl:t,height:n}):t.includes("youtube")?(0,i.Y)(r,{videoUrl:t,height:n}):null:null}},71846:(e,t,n)=>{"use strict";n.d(t,{A:()=>k});var i=n(18153),a=n(14232),r=n(10553),l=n(89099),o=n(75656),s=n(83191),d=n(30649);let c=e=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({auctionEstimateItemType:e})};var p=n(71421);let m=()=>(0,i.Y)("svg",{width:"45",height:"31",viewBox:"0 0 45 31",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.Y)("path",{d:"M0.795248 15.6865C0.366619 16.
10825 0.366619 16.7598 0.795247 17.1557L15.3215 30.5736C15.7046 30.9275 16.2954 30.9275 16.6785 30.5736L44.0076 5.32969C44.4352 4.93471 44.4363 4.25941 44.0101 3.86293L40.9667 1.03177C40.5838 0.675593 39.9912 0.674549 39.6071 1.02937L16 22.8353L5.19045 12.8783C4.80722 12.5253 4.21716 12.5257 3.83442 12.8793L0.795248 15.6865Z",fill:"black"})});var u=n(10616),h=n(84733),f=n(96192);let g=e=>{let{currentStep:t=2}=e,n=(0,u.A)(),{txt:a}=(0,d.A)();return(0,i.FD)(h.A,{width:1,display:"flex",flexDirection:"column",alignItems:"center",gap:n.spacing(3),marginTop:n.spacing(2),marginBottom:n.spacing(4),children:[(0,i.FD)(h.A,{display:"flex",justifyContent:"space-between",alignItems:"center",width:1,gap:"20px",children:[(0,i.FD)(h.A,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"20px",children:[(0,i.Y)(h.A,{width:70,height:70,display:"flex",justifyContent:"center",alignItems:"center",sx:{background:n.palette.primary.main,borderRadius:"50%",border:"3px solid "+n.palette.primary.main},children:1===t?(0,i.Y)(f.A,{variant:"heading3",component:"p",fontSize:40,sx:{color:n.palette.primary.contrastText},children:"1"}):(0,i.Y)(m,{})}),(0,i.Y)(f.A,{variant:"body2",component:"p",textAlign:"center",children:"My details"})]}),(0,i.Y)(h.A,{flexGrow:1,height:"3px",sx:{background:n.palette.primary.main,position:"relative",top:"-20px"}}),(0,i.FD)(h.A,{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",gap:"20px",children:[(0,i.Y)(h.A,{width:70,height:70,display:"flex",justifyContent:"center",alignItems:"center",sx:{background:1!==t?n.palette.primary.main:n.palette.primary.contrastText,borderRadius:"50%",border:"3px solid "+n.palette.primary.main},children:(0,i.Y)(f.A,{variant:"heading3",component:"p",fontSize:40,sx:{color:1===t?n.palette.primary.main:n.palette.primary.contrastText},children:"2"})}),(0,i.Y)(f.A,{variant:"body2",component:"p",textAlign:"center",children:"Item details"})]})]}),(0,i.FD)(f.A,{variant:"heading4",component:"p",textAlign:"center",children:["Step ",String(t)," of 2:"," ",a(1===t?"requestEstimate.myDetails":"requestEstimate.itemDetails")]})]})};var x=n(26362),v=n(13467),y=n(27819),b=n(32729);let w=e=>{let{children:t,allowGuest:n}=e,{status:o}=(0,r.useSession)(),[s,d]=(0,a.useState)(!1),{query:c}=(0,l.useRouter)(),p=(0,a.useRef)(null);return((0,a.useEffect)(()=>{if(c.scroll){var e;null==(e=p.current)||e.scrollIntoView({behavior:"smooth"})}},[]),"loading"===o)?(0,i.Y)(x.A,{}):"authenticated"===o||s?(0,i.Y)("div",{style:{width:"100%"},ref:p,children:t}):(0,i.Y)(A,{allowGuest:n,onGuestSelect:()=>{d(!0)}})},A=e=>{let{allowGuest:t,onGuestSelect:n}=e,r=(0,u.A)(),{txt:o}=(0,d.A)(),s=(0,y.A)(r.breakpoints.down("md")),c=(0,y.A)(r.breakpoints.down(378)),[p,m]=(0,a.useState)(!1),[g,x]=(0,a.useState)(!0),{asPath:w}=(0,l.useRouter)();return p?(0,i.Y)(h.A,{sx:{width:"100%",maxWidth:s?"100%":600},children:(0,i.Y)(v.A,{isSignIn:g,callbackUrlOverride:"".concat(w,"?scroll=true")})}):(0,i.FD)(h.A,{sx:{display:"flex",flexDirection:s?"column":"row",gap:4,justifyContent:"space-between",maxWidth:750,width:"100%"},children:[(0,i.FD)(h.A,{display:"flex",flexDirection:"column",gap:r.spacing(2),justifyContent:"center",alignItems:"center",children:[(0,i.Y)(f.A,{variant:"body1",component:"p",children:o("authGate.loginDescription")}),(0,i.Y)(h.A,{padding:r.spacing(0,.5),children:(0,i.Y)(b.default,{variation:"primary",action:()=>{x(!0),m(!0)},label:o("authGate.loginCta")})})]}),(0,i.FD)(h.A,{display:"flex",flexDirection:"column",gap:r.spacing(2),justifyContent:"center",alignItems:"center",children:[(0,i.Y)(f.A,{variant:"body1",component:"p",children:o("authGate.noAccountDescription")}),(0,i.FD)(h.A,{sx:{display:"flex",alignItems:"center",flexDirection:c?"column":"row",gap:2},children:[(0,i.Y)(h.A,{children:(0,i.Y)(b.default,{variation:"primary",fullWidth:!0,action:()=>{x(!1),m(!0)},label:o("authGate.noAccountCreateAccountCta")})}),(0,i.Y)(h.A,{children:t&&(0,i.Y)(b.default,{fullWidth:!0,variation:"secondary",action:n,label:o("authGate.noAccountMaybeLaterCta")})})]})]})]})};var Y=n(80598),D=n(38871),F=n(7400),E=n(73602),_=(n(23273),n(57488),n(62375),n(72311),n(48627)),C=n(97179),I=n(90952);let S=e=>{var t,n,a,r,l;let{data:o}=e,{isCustomer:s,allowGuest:d,currentUrl:c,txt:p,hasCompletedInitialForm:m,setHasCompletedInitialForm:v,isFormSubmitting:A,uploadProgress:S,errorMsg:L,isSubmitSuccessful:k,successBoxRef:N,selectedFiles:T,setSelectedFiles:q,maintenanceMode:W,titleOptions:j,customerData:P,locations:B,useLocations:M,departmentsWithCategories:O,isLoading:z,handleSubmit:R}=o,U=(0,u.A)(),G=(0,y.A)(U.breakpoints.down("md")),K=null==j?void 0:j.map(e=>({key:e.text,value:e.text})),H=null==B?void 0:B.map(e=>({key:e,value:e})),V=null==O?void 0:O.map(e=>({key:e.uuid,value:e.name.en})).sort((e,t)=>
1e.value.localeCompare(t.value));return z?(0,i.Y)(x.A,{}):k?(0,i.FD)(h.A,{maxWidth:1920,width:1,ref:N,sx:{marginBottom:"40px"},id:"requestEstimateThankYou",children:[(0,i.FD)(h.A,{width:1,sx:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,i.Y)(f.A,{variant:"heading3",component:"h2",align:"center",sx:{marginBottom:U.spacing(4)},dangerouslySetInnerHTML:{__html:p("requestEstimate.thankYou.title")}}),(0,i.Y)(f.A,{variant:"body2",component:"p",align:"center",sx:{padding:"0 40px"},dangerouslySetInnerHTML:{__html:p("requestEstimate.thankYou.content")}})]}),!P&&!W&&(0,i.FD)(i.FK,{children:[(0,i.Y)(F.A,{sx:{width:"370px",margin:"60px auto"}}),(0,i.FD)(h.A,{sx:{display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"},children:[(0,i.Y)(f.A,{variant:"heading3",component:"h3",align:"center",sx:{marginBottom:U.spacing(4)},children:p("requestEstimate.thankYou.createAcc.title")}),(0,i.Y)(f.A,{variant:"body3",component:"p",align:"center",sx:{padding:"0 40px"},dangerouslySetInnerHTML:{__html:p("requestEstimate.thankYou.createAcc.content")}}),(0,i.Y)(h.A,{sx:{marginTop:"20px",marginBottom:"20px"},children:(0,i.Y)(b.default,{label:p("requestEstimate.thankYou.createAcc.title"),linkto:"/auth/create?callbackUrl=".concat(encodeURIComponent(c))})})]})]})]}):(0,i.Y)(h.A,{maxWidth:1920,width:1,sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",paddingBottom:"60px",gap:"16px",maxWidth:1920,margin:"0 auto",overflow:"hidden"},children:(0,i.Y)(h.A,{width:1,maxWidth:G?1:650,children:(0,i.FD)(h.A,{width:1,maxWidth:G?1:650,children:[(0,i.Y)(g,{currentStep:s||m?2:1}),(0,i.Y)(w,{allowGuest:d,children:(0,i.Y)(_.l1,{initialValues:{title:null!=(t=null==P?void 0:P.title)?t:"",firstName:null!=(n=null==P?void 0:P.first_name)?n:"",lastName:null!=(a=null==P?void 0:P.last_name)?a:"",email:null!=(r=null==P?void 0:P.email)?r:"",phone:null!=(l=null==P?void 0:P.phone)?l:"",department:"",location:"",category:"",description:"",images:[]},validate:e=>{let t={};return e.title||(t.title="Title is required"),e.firstName||(t.firstName="First name is required"),e.lastName||(t.lastName="Last name is required"),D.U.test(e.email)||(t.email="Please enter a valid email address"),D.I.test(e.phone)||(t.phone="Please enter a valid phone number"),e.department||(t.department="Please select a department"),M&&!e.location&&(t.location="Please select your nearest location"),e.description||(t.description="Description is required"),T.length||(t.images="Please upload at least one image"),t},onSubmit:e=>R(e,!0),children:e=>{let{isSubmitting:t,errors:n,touched:a,setFieldTouched:r,setFieldValue:l,setErrors:o,values:d}=e;return(0,i.FD)(_.lV,{noValidate:!0,style:{width:"100%",display:"flex",flexDirection:"column",gap:U.spacing(3)},children:[!s&&!m&&(0,i.FD)(i.FK,{children:[(0,i.FD)(E.A,{children:[j?(0,i.Y)(_.D0,{as:C.A,name:"title",required:!0,placeholder:"Title",labelId:"title-label",id:"title",variant:"outlined",action:e=>{l("title",e)},options:K,error:!!(a.title&&n.title),isError:!!(a.title&&n.title),errorMessage:""}):(0,i.Y)(i.FK,{}),a.title&&n.title&&(0,i.Y)(f.A,{variant:"caption",color:"error",sx:{marginLeft:"14px"},children:n.title})]}),(0,i.Y)(_.D0,{as:I.XY,name:"firstName",label:"First Name",fullWidth:!0,required:!0,disabled:!!(null==P?void 0:P.first_name),error:!!(a.firstName&&n.firstName),helperText:a.firstName&&n.firstName}),(0,i.Y)(_.D0,{as:I.XY,name:"lastName",label:"Last Name",fullWidth:!0,required:!0,disabled:!!(null==P?void 0:P.last_name),error:!!(a.lastName&&n.lastName),helperText:a.lastName&&n.lastName}),(0,i.Y)(_.D0,{as:I.XY,type:"email",name:"email",label:"Email",fullWidth:!0,required:!0,disabled:!!(null==P?void 0:P.email),error:!!(a.email&&n.email),helperText:a.email&&n.email}),(0,i.Y)(_.D0,{as:I.XY,name:"phone",label:"Phone",fullWidth:!0,required:!0,disabled:!!(null==P?void 0:P.phone),error:!!(a.phone&&n.phone),helperText:a.phone&&n.phone}),(0,i.Y)(h.A,{sx:{width:"150px",margin:"0 5px"},children:(0,i.Y)(b.default,{label:"Next",variation:"primary",fullWidth:!0,type:"submit",action:()=>{(()=>{let e={};d.firstName||(e.firstName="First name is required"),d.lastName||(e.lastName="Last name is required"),D.U.test(d.email)||(e.email="Invalid email format"),D.I.test(d.phone)||(e.phone="Invalid phone format"),d.title||(e.title="Title is required"),Object.values(e).every(e=>""===e)&&(o({}),v(!0))})()}})})]}),(s||m)&&(0,i.FD)(i.FK,{children:[(0,i.Y)(f.A,{variant:"heading5",component:"h3",children:p("requestEstimate.form.specialistDepartment")}),(0,i.FD)(E.A,{fullWidth:!0,children:[O?(0,i.Y)(_.D0,{as:C.A,name:"department",label:"Department",labelId:"department-label",id:"department",variant:"outlined",options:V,action:e=>{var t,n;l("department",e);let i=O.find(t=>t.uuid===e),a=(null==i||null==(t=i.categories)?void 0:t.find(e=>e.name.en.toLowerCase()===i.name.en.toLowerCase()))||(null==i||null==(n=i.categories)?void 0:n[0]);l("category",a?a.uuid:"")},error:!!(a.department&&n.department),isError:!!(a.department&&n.department),errorMessage:""}):(0,i.Y)(i.FK,{}),a.department&&n.department&&(0,i.Y)(f.A,{variant:"caption",color:"error",sx:{marginLeft:"14px"},children:n.department})]}),M&&(0,i.FD)(i.FK,{children:[(0,i.Y)(f.A,{variant:"heading5",component:"h3",sx:{marginTop:U.spacing(2)},children:p("requestEstimate.form.location")}),(0,i.Y)(f.A,{variant:"body3",component:"p",children:p("requestEstimate.form.locationContent")}),(0,i.FD)(E.A,{fullWidth:!0,children:[B?(0,i.Y)(_.D0,{as:C.A,name:"location",label:"Location",required:!1,labelId:"location-label",id:"location",variant:"outlined",options:H,action:e=>{l("location",e)},error:!!(a.location&&n.location),isError:!!(a.location&&n.location),errorMessage:""}):(0,i.Y)(i.FK,{}),a.location&&n.location&&(0,i.Y)(f.A,{variant:"caption",color:"error",sx:{marginLeft:"14px"},children:n.location})]})]}),(0,i.Y)(f.A,{variant:"heading5",component:"h3",sx:{marginTop:U.spacing(2)},children:p("requestEstimate.form.description")}),(0,i.Y)(f.A,{variant:"body3",component:"p",children:p("requestEstimate.form.descriptionContent")}),(0,i.Y)(_.D0,{as:I.us,name:"description",label:"Description",fullWidth:!0,multiline:!0,rows:2,error:!!(a.description&&n.description),helperText:a.description&&n.description}),(0,i.Y)(f.A,{variant:"heading5",component:"h3",sx:{marginTop:U.spacing(2)},children:p("requestEstimate.form.images")}),(0,i.FD)(h.A,{sx:{marginBottom:"20px"},children:[(0,i.Y)(Y.A,{onFileChange:e=>{(e=>{q(e),l("images",e),r("images",!0,!1)})(e)},uploadProgress:S}),a.images&&!T.length&&n.images&&(0,i.Y)(f.A,{variant:"caption",color:"error",children:n.images})]}),(0,i.Y)(h.A,{sx:{width:"250px",margin:"0 5px"},children:(0,i.Y)(b.default,{type:"submit",fullWidth:!0,disabled:A,label:p("requestEstimate.form.submitBtn")})})]}),L&&(0,i.Y)(f.A,{variant:"caption",color:"error",children:L})]})}})})]})})})};var L=n(65364);let k=e=>{var t;let{uiConfig:m}=e,{status:u}=(0,r.useSession)(),h="authenticated"===u,f=(0,l.useRouter)().asPath,{txt:g}=(0,d.A)(),[x,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(!1),[w,A]=(0,a.useState)({}
1),[Y,D]=(0,a.useState)(""),[F,E]=(0,a.useState)(!1),_=(0,a.useRef)(null),[C,I]=(0,a.useState)([]),k=!(null==m||null==(t=m.requestEstimate)?void 0:t.requireLogin);(0,a.useEffect)(()=>{if(F){var e;null==(e=_.current)||e.scrollIntoView({behavior:"smooth"})}},[F]);let{data:N,isLoading:T}=(0,o.Ay)("/api/user/get-titles",s.A,{revalidateOnFocus:!1}),{data:q,isLoading:W}=(0,o.Ay)("/api/artisio/departments-with-categories?limit=100",s.A,{revalidateOnFocus:!1}),{data:j,isLoading:P}=(0,o.Ay)(h?"/api/customer/profile":null,s.A,{revalidateOnFocus:!1}),B=g("requestEstimate.form.locations").split(","),M=B.length>0&&""!==B[0],O=null==q?void 0:q.results.reduce((e,t)=>{var n;if(t.name.en.startsWith("DONOTUSE_"))return e;let i=(null==t||null==(n=t.categories)?void 0:n.filter(e=>!e.name.en.startsWith("DONOTUSE_")))||[];return i.length>0&&e.push({...t,categories:i}),e},[]);null==O||O.sort((e,t)=>e.name.en.localeCompare(t.name.en));let z=async(e,t,i)=>{let a=(await n.e(9289).then(n.bind(n,9289))).default,r=e.map((e,n)=>{let r=t[n];return r?a.put(e.presigned_url,r,{headers:{"Content-Type":r.type},onUploadProgress:e=>{var t;i(n,Math.round(100*e.loaded/(null!=(t=e.total)?t:1)))}}):(console.error("No file found for presigned URL at position ".concat(e.position)),Promise.reject(Error("File not found")))});try{await Promise.all(r)}catch(e){console.error("Error uploading files:",e),D("Error uploading files. Please try again.")}},R=(e,t)=>{A(n=>({...n,[e]:t}))},U=(e,t)=>{for(let n of e)for(let e of n.categories)if(e.uuid===t)return e.name.en;return null},G=async function(e){var t,n,i;let a,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(r||c(U(O,e.category)),b(!0),L.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY&&"unauthenticated"===u){let t=await (0,p.Z)("estimate_request");if(!t)return void b(!1);e.recaptchaToken=t}if(r)a=null==O?void 0:O.find(t=>t.name.en===e.department),e.department=null==a?void 0:a.uuid,e.department_name=null==a?void 0:a.name.en,e.category=null==a||null==(t=a.categories[0])?void 0:t.uuid,e.category_name=null==a||null==(n=a.categories[0])?void 0:n.name.en,c(e.department_name);else{let t=null==(a=null==O?void 0:O.find(t=>t.uuid===e.department))||null==(i=a.categories)?void 0:i.find(t=>t.uuid===e.category);e.department_name=null==a?void 0:a.name.en,e.category_name=null==t?void 0:t.name.en}e.images=C,M||(e.location="");let l=async()=>{let t=new FormData;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.append(n,e[n]);t.append("pageName",document.title),C.forEach(e=>{t.append("images",e)});try{let e=await fetch("/api/estimate-request/guest",{method:"POST",body:t,credentials:"include"});(await e.json()).success?E(!0):D("Error sending estimate request. Please try again.")}catch(e){console.error("Error: ",e),D("Error sending estimate request. Please try again.")}},o=async()=>{let{images:t,...n}=e,i=C.map((e,t)=>({content_type:e.type,position:t+1})),a="";if(C.length>0){let e=C[0],t=new FormData;t.append("image",e,e.name);try{let e=await fetch("/api/hubspot/upload-image",{method:"POST",body:t}),n=await e.json();n.hubspotImageId&&(a=n.hubspotImageId)}catch(e){console.error("HubSpot image upload failed:",e)}}let r={title:n.title||"",firstName:n.firstName||"",lastName:n.lastName||"",email:n.email||"",phone:n.phone||"",department:n.department||"",category:n.category||"",description:n.description||"",location:n.location||"",imageInfo:JSON.stringify(i),pageName:document.title,hubspotImageId:a},l=await fetch("/api/estimate-request/customer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),o=await l.json();if(o.uuid){let e=await fetch("/api/estimate-request/presigned-urls",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uuid:o.uuid,imageInfo:i})}),t=await e.json();t&&t.length>0&&t[0].presigned_url?(await z(t,C,R),E(!0)):D("Error updating images. Please try again.")}else D("Error sending estimate request. Please try again.")};h&&1?await o():await l(),b(!1)};return(0,i.Y)(S,{data:{status:u,isCustomer:h,allowGuest:k,currentUrl:f,txt:g,hasCompletedInitialForm:x,setHasCompletedInitialForm:v,isFormSubmitting:y,uploadProgress:w,errorMsg:Y,setErrorMsg:D,isSubmitSuccessful:F,successBoxRef:_,selectedFiles:C,setSelectedFiles:I,maintenanceMode:!1,titleOptions:N,departments:q,customerData:j,locations:B,useLocations:M,departmentsWithCategories:O,isLoading:T||W||P,handleSubmit:G,getselectedCategory:U}})}}
1,80598:(e,t,n)=>{"use strict";n.d(t,{A:()=>A});var i=n(28888),a=n(18153),r=n(28873),l=n(37726),o=n(39057),s=n(27819),d=n(96192),c=n(84733),p=n(55134),m=n(69943),u=n(64289),h=n(20035),f=n(54843),g=n(10553),x=n(14232);function v(){let e=(0,i._)(["\n font-size: 16px;\n font-weight: 400;\n lineheight: 20px;\n letter-spacing: 0.17px;\n text-align: center;\n text-decoration: none;\n color: ",";\n "]);return v=function(){return e},e}function y(){let e=(0,i._)(["\n border-bottom: 2px solid ",";\n padding-bottom: 1px;\n box-sizing: border-box;\n "]);return y=function(){return e},e}let b=["image/jpeg","image/png","image/svg+xml","image/gif","application/pdf"],w=e=>{let{onFileChange:t,uploadProgress:n,maxUploads:i,validTypes:w=b}=e,{status:A}=(0,g.useSession)(),[Y,D]=(0,x.useState)([]),[F,E]=(0,x.useState)(""),_=(0,x.useRef)(null),C="authenticated"!==A?4:20,I="authenticated"!==A?4:5,S=void 0===i||Y.length<i,L=(0,u.A)();(0,s.A)(L.breakpoints.down("md"));let k=e=>{if(E(""),!e.target.files)return;let n=Array.from(e.target.files).map(e=>{let t=null,n=w.includes(e.type),i=e.size/1024/1024<I,a=Y.some(t=>t.file.name===e.name);return n?i?a&&(t="Duplicate file"):t="File too large":t="Unsupported format",{file:e,error:t}});if((Y.reduce((e,t)=>e+t.file.size,0)+n.reduce((e,t)=>e+t.file.size,0))/1024/1024>C)return void E("Total file size exceeds ".concat(C," MB."));if(void 0!==i&&Y.length+n.length>i)return void E("Cannot upload more than ".concat(i," file(s)."));let a=[...Y,...n];D(a),t(a.filter(e=>!e.error).map(e=>e.file))},N=()=>{_.current&&_.current.click()};(0,h.A)(d.A)(v(),L.palette.text.primary),(0,h.A)("span")(y(),(0,f.X4)(L.palette.primary.main,.4));let T={"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"],"image/svg+xml":[".svg"],"image/gif":[".gif"],"application/pdf":[".pdf"]},q=e=>{let{fileInfo:i,index:s}=e,u=n[i.file.name]||0;return(0,a.Y)(c.A,{width:1,marginTop:2,children:(0,a.FD)(c.A,{display:"flex",alignItems:"center",children:[(0,a.Y)(o.A,{fontSize:"large",sx:{margin:"0 16px",color:"rgb(0, 0, 0)"}}),(0,a.FD)(c.A,{flex:1,display:"flex",flexDirection:"column",children:[(0,a.FD)(c.A,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,a.FD)(c.A,{children:[(0,a.Y)(d.A,{variant:"body1",children:i.file.name}),(0,a.Y)(d.A,{variant:"body1",sx:{color:i.error&&"#f00"},children:i.error?"".concat(i.error," ⢠Failed"):"".concat((0,r.y2)(i.file.size)," ⢠Added")})]}),(0,a.Y)(p.A,{size:"small",onClick:()=>(e=>{E("");let n=Y.filter((t,n)=>n!==e);D(n),t(n.filter(e=>!e.error).map(e=>e.file))})(s),children:(0,a.Y)(l.default,{fontSize:"large"})})]}),(0,a.Y)(c.A,{sx:{width:"100%",maxWidth:"100%",height:4,borderRadius:4,backgroundColor:"rgba(0, 0, 0, 1)",marginTop:1},children:(0,a.Y)(m.A,{variant:"determinate",value:u,color:"primary"})})]})]})},i.file.name)};return(0,a.FD)(a.FK,{children:[S&&(0,a.FD)(c.A,{onDragOver:e=>e.preventDefault(),onDrop:e=>{if(e.preventDefault(),e.dataTransfer.files)k({target:{files:Array.from(e.dataTransfer.files)}})},tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),N())},onClick:N,sx:{height:160,width:"100%",maxWidth:"100%",border:"2px dashed rgba(0, 0, 0, 1)",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",cursor:"pointer",gap:1},children:[(0,a.Y)(o.A,{fontSize:"large"}),(0,a.FD)(c.A,{display:"flex",alignItems:"center",justifyContent:"center",children:[(0,a.Y)(d.A,{variant:"body3",children:"Click to upload"}),(0,a.Y)(d.A,{variant:"body3",sx:{ml:.5},children:"or drag and drop"})]}),(0,a.FD)(d.A,{variant:"body3",children:[(()=>{let e={"image/jpeg":"JPG","image/png":"PNG","image/svg+xml":"SVG","image/gif":"GIF","application/pdf":"PDF"},t=w.map(t=>e[t]||t);if(!(t.length>1))return t.join("");{let e=t.pop();return"".concat(t.join(", ")," or ").concat(e)}})()," (max. ",I,"MB)"]}),(0,a.Y)("input",{type:"file",hidden:!0,multiple:!0,accept:w.flatMap(e=>T[e]||[]).join(","),onChange:k,ref:_})]}),F&&(0,a.Y)(d.A,{color:"error",children:F}),Y.map((e,t)=>(0,a.Y)(q,{fileInfo:e,index:t},t))]})};w.displayName="ImageUploader";let A=w},97179:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var i=n(18153),a=n(14232),r=n(42964),l=n.n(r);let o=e=>{let{direction:t}=e;return(0,i.Y)("svg",{width:"15",height:"8",viewBox:"0 0 15 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:"rotate(".concat(180*("up"===t),"deg)"),transition:"transform 0.3s"},children:(0,i.Y)("path",{d:"M1.11885 1.09204L1.2696 1.22347L1.11885 1.09204C0.897177 1.3463 0.926092 1.73271 1.18314 1.95114L7.52714 7.34214L7.65665 7.45219L7.78616 7.34214L14.0789 1.99474C14.364 1.75243 14.3786 1.31727 14.1104 1.05634C13.8756 0.827901 13.5056 0.815726 13.2563 1.02824L7.65564 5.80233L1.96427 1.02615C1.71159 0.814096 1.33563 0.843398 1.11885 1.09204Z",fill:"black",stroke:"black",strokeWidth:"0.4"})})},s=e=>{let{options:t,title:n,placeholder:r="Select",currentValue:s,action:d,required:c=!1,isError:p=!1,errorMessage:m="Please select an option",name:u="select"}=e,[h,f]=(0,a.useState)(!1),[g,x]=(0,a.useState)(s||""),[v,y]=(0,a.useState)(null),b=(0,a.useRef)(null);(0,a.useEffect)(()=>{x(s||"")},[s]);let w=()=>f(e=>!e),A=e=>{x(e),f(!1),d(e)},Y=e=>{b.current&&!b.current.contains(e.target)&&f(!1)};return(0,a.useEffect)(()=>(document.addEventListener("mousedown",Y),()=>{document.removeEventListener("mousedown",Y)}),[]),(0,i.FD)("div",{className:l().selectContainer,ref:b,tabIndex:0,onKeyDown:e=>{switch(e.key){case"ArrowDown":e.preventDefault(),f(!0),y(e=>{var n;let i=null===e||e===t.length-1?0:e+1;return null==(n=document.getElementById("option-".concat(i)))||n.scrollIntoView({block:"nearest"}),i});break;case"ArrowUp":e.preventDefault(),f(!0),y(e=>{var n;let i=null===e||0===e?t.length-1:e-1;return null==(n=document.getElementById("option-".concat(i)))||n.scrollIntoView({block:"nearest"}),i});break;case"Enter":case" ":h&&null!==v?A(t[v].value):w(),e.preventDefault();break;case"Escape":case"Tab":f(!1)}},"aria-expanded":h,role:"combobox","aria-haspopup":"listbox","aria-controls":"".concat(u,"-listbox"),children:[n&&(0,i.Y)("label",{className:"".concat(l().selectLabel," ").concat(p?l().error:""),htmlFor:u,children:n}),(0,i.FD)("div",{id:u,"data-fieldname":u,className:"".concat(l().selectBox," ").concat(g?l().selected:p?l().error:""," ").concat(p?l().error:""),onClick:w,children:[g||"".concat(r," ").concat(c?"*":"")," ",(0,i.Y)(o,{direction:h?"up":"down"})]}),p&&(0,i.Y)("span",{className:l().errorMessage,children:m}),h&&(0,i.Y)("ul",{className:l().optionsList,role:"listbox",id:"".concat(u,"-listbox"),"aria-activedescendant":null!==v?"option-".concat(v):void 0,children:t.map((e,t)=>(0,i.Y)("li",{id:"option-".concat(t),role:"option",className:"".concat(l().option," ").concat(v===t?l().highlighted:""),onClick:()=>A(e.value),"aria-selected":v===t,children:e.value},t))})]})}}}]);
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.