1"use strict";(self.webpackChunktechassist_host=self.webpackChunktechassist_host||[]).push([[5219,7600],{37600:function(e,t,r){r.r(t);var n=r(1995),o=r(13732),l=r(49785),s=r(75225),a=r(82283),i=r(53869),c=r(75667),u=r(7081),d=r(86439),p=r(3665),h=r(6911),m=r(68857);let f=e=>e?"string"==typeof e?e.trim().toLowerCase():"object"==typeof e?(e.value||e.code||e.id||"").trim().toLowerCase():"":"",b=["country","city","postalCode","state","street"];t.default=({fieldProps:e={},countryCode:t="",sx:x={}})=>{let g=(0,p.A)(),{t:y}=(0,h.Bd)(),{control:_,watch:S,setValue:w,clearErrors:A,getValues:k}=(0,l.xW)(),[C,j]=(0,o.useState)(""),[v,I]=(0,o.useState)([]),[P,E]=(0,o.useState)(!1),[D,R]=(0,o.useState)(!1),T=(0,o.useRef)(null),V=(0,o.useRef)(null),z=(0,o.useRef)(null),L=(0,o.useRef)(!1),W=f(S("countryCode")||t),F=(0,o.useRef)(W),O=(0,o.useCallback)(()=>{b.forEach(e=>{w(e,"")})},[w]);(0,o.useEffect)(()=>{let e=!0;return b.forEach(e=>{void 0===k(e)&&w(e,"")}),r.e(3750).then(r.bind(r,83750)).then(({setOptions:e,importLibrary:t})=>(e({key:"AIzaSyDqUoIJBjq4Nnz2gwym6emLdJchoZ8LUpI",v:"weekly"}),t("places"))).then(t=>{e&&t&&(z.current=t,T.current=new t.AutocompleteService,R(!0))}).catch(e=>{console.error("Failed to load Google Places SDK:",e)}),()=>{e=!1}},[k,w]),(0,o.useEffect)(()=>{void 0!==F.current&&F.current!==W&&L.current&&(j(""),I([]),e.name&&w(e.name,""),w("phone",""),O(),L.current=!1),F.current=W},[W,w,e.name,O]);let $=t=>{let r="string"==typeof t?t:t?.label||"";e.name&&(w(e.name,r,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),r&&A(e.name)),w("phone","",{shouldValidate:!0,shouldDirty:!0}),O(),t&&"object"==typeof t&&t.id&&D&&z.current?(L.current=!0,V.current||(V.current=new z.current.PlacesService(document.createElement("div"))),V.current.getDetails({placeId:t.id,fields:["formatted_phone_number","international_phone_number","address_components","geometry"]},(e,t)=>{if(t===z.current.PlacesServiceStatus.OK&&e){let t=e.international_phone_number||e.formatted_phone_number;if(t){let e=!1;try{let r=(0,m.l)(t);r&&r.isValid()&&(e="FIXED_LINE"===r.getType())}catch(e){console.warn("Failed to parse phone number type",e)}e||w("phone",t.replace(/^\+\d{1,3}\s*/,"").trim(),{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}let r="",n="",o="",l="",s="",a="";e.address_components&&e.address_components.forEach(e=>{let{types:t}=e;t.includes("street_number")&&(r=e.long_name),t.includes("route")&&(n=e.long_name),(t.includes("locality")||t.includes("postal_town"))&&(o=e.long_name),t.includes("administrative_area_level_1")&&(l=e.long_name),t.includes("postal_code")&&(s=e.long_name),t.includes("country")&&(a=e.long_name)});let i=`${r} ${n}`.trim();a&&w("country",a),o&&w("city",o),s&&w("postalCode",s),l&&w("state",l),i&&w("street",i)}})):L.current=!1};return((0,o.useEffect)(()=>{let e,t=!0;return!C||C.trim().length<2?I([]):D&&T.current&&(e=setTimeout(()=>{E(!0);let e={input:C,types:["establishment"]};W&&2===W.length&&(e.componentRestrictions={country:W}),T.current.getPlacePredictions(e,(e,r)=>{t&&(E(!1),r===z.current?.PlacesServiceStatus.OK&&e?I(e.map((e,t)=>({label:e.structured_formatting?.main_text||e.description,fullAddress:e.description,id:e.place_id||`${e.description}-${t}`}))):I([]))})},300)),()=>{t=!1,e&&clearTimeout(e)}},[C,W,D]),e.name)?(0,n.jsx)(l.xI,{name:e.name,control:_,rules:e.rules||{},render:({field:{value:t},fieldState:{error:r}})=>(0,n.jsxs)(u.A,{sx:{width:"100%"},children:[e.label&&(0,n.jsx)(c.A,{htmlFor:e.name,sx:{color:g.palette.text.primary,fontWeight:700,display:"flex",alignItems:"center",mb:"4px",fontSize:"14px",...e.labelSx},children:y(e.label)}),(0,n.jsx)(a.A,{fullWidth:!0,freeSolo:!0,options:v,loading:P,value:t||"",slotProps:{paper:{sx:{marginTop:"4px",borderRadius:"4px",boxShadow:"0px 8px 24px rgba(0, 0, 0, 0.12)",overflow:"hidden"}},listbox:{sx:{padding:0,maxHeight:"240px","&::-webkit-scrollbar":{width:"5px"},"&::-webkit-scrollbar-track":{backgroundColor:"#f1f5f9",borderRadius:"4px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#cbd5e1",borderRadius:"4px"},scrollbarWidth:"thin",scrollbarColor:"#cbd5e1 #f1f5f9","& .MuiAutocomplete-option":{padding:"8px 12px",'&[aria-selected="true"]':{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&.Mui-focused":{backgroundColor:"rgba(0, 0, 0, 0.06)"}}}}},getOptionLabel:e=>"string"==typeof e?e:e.label||"",isOptionEqualToValue:(e,t)=>
1"string"==typeof e?e===t:e.id===t?.id||e.label===t,onInputChange:(t,r,n)=>{j(r),("input"===n||"clear"===n)&&(L.current&&(L.current=!1),e.name&&(w(e.name,r,{shouldValidate:!0,shouldDirty:!0}),r&&A(e.name)),w("phone","",{shouldValidate:!0,shouldDirty:!0}),O())},onChange:(e,t)=>$(t),renderOption:(e,t)=>{let{key:r,...o}=e,l="string"==typeof t?t:t.id;return(0,n.jsx)("li",{...o,children:(0,n.jsxs)(s.A,{children:[(0,n.jsx)(s.A,{component:"span",sx:{fontWeight:600,display:"block",fontSize:"14px",color:"text.primary"},children:"string"==typeof t?t:t.label}),"string"!=typeof t&&t.fullAddress&&(0,n.jsx)(s.A,{component:"span",sx:{fontSize:"12px",color:"text.secondary"},children:t.fullAddress})]})},l)},renderInput:o=>(0,n.jsx)(i.A,{...o,fullWidth:!0,error:!!r,helperText:r?.message,placeholder:y(e.placeholder||"Company name"),sx:{width:"100%",...x,...e.sx},slotProps:{htmlInput:{...o.inputProps,title:t||""},input:{...o.InputProps,endAdornment:(0,n.jsxs)(n.Fragment,{children:[P?(0,n.jsx)(d.A,{color:"inherit",size:18}):null,o.InputProps.endAdornment]})}}})})]})}):null}}}]);
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.