1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4068],{66935:function(e,t,s){var a=s(52676),l=s(95651),n=s(85344),r=s(82527),i=s(37168),o=s(75271),c=s(65341),d=s(178),u=s(58945);t.Z=e=>{var t;let{max:s,name:m,defaultShow:h=12,setTotal:x,shallowUpdate:f=!1}=e,p=(0,r.useTranslations)("common.buttons"),g=(0,i.useSearchParams)(),{handleChangeValue:j}=(0,l.Z)({searchParamName:"numberOfResults",shallow:f}),[v,b]=(0,o.useState)(Number(null!==(t=null==g?void 0:g.get(n.PG))&&void 0!==t?t:h));return v>=s?null:(0,a.jsx)(u.o,{start:"1",span:"12",className:"flex justify-center col-span-6 md:col-span-12",children:(0,a.jsx)(d.z,{onClick:()=>{x&&x(v+24),b(e=>e+24),j(JSON.stringify(v+24))},children:(0,a.jsx)(c.u,{small:!0,strong:!0,children:m||p("showMore")})})})}},22487:function(e,t,s){var a=s(52676),l=s(95651),n=s(2733),r=s(85344),i=s(75271),o=s(65341),c=s(81461);t.Z=e=>{let{GroupItems:t,groupValue:s,setGroupValue:d,addAsFilter:u=!1,className:m,children:h,searchParamsConfig:x={}}=e,{handleChangeValue:f}=(0,l.Z)({searchParamName:r.j2,...x});return(0,i.useEffect)(()=>{u&&f(s)},[s]),(0,a.jsxs)(c.t,{type:"single",defaultValue:s,onValueChange:e=>{e&&d(e)},value:s,className:(0,n.cn)("flex justify-start px-4 md:px-24 my-8 wrap-mx max-w-[var(--wrap-width)]",m),children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map(e=>e.hide?null:(0,a.jsx)(c.G,{value:e.value,className:"col-span-6 gap-1 rounded-[999px] px-5 bg-[#F4F4F4] border hover:border-[#282828]",children:(0,a.jsx)(o.u,{small:!0,children:e.title})},e.value))}),h]})}},84068:function(e,t,s){s.d(t,{Z:function(){return ei}});var a,l=s(52676),n=s(75271),r=(e,t)=>{let s=(0,n.useRef)(!0);(0,n.useEffect)(()=>{if(s.current){s.current=!1;return}return e()},t)},i=s(95651),o=s(50864),c=s(85344),d=s(82527),u=s(37168),m=s(76711),h=s(74436),x=s(65341),f=s(99577),p=s(10814),g=s(16462),j=s(2733),v=s(74201),b=s.n(v);s(72878);var N=s(68791),w=s(14928),y=s(90648),S=s(74023),L=s(54590);let k=e=>{let{small:t}=e;return(0,l.jsxs)("div",{className:(0,j.cn)("flex flex-col col-span-12",t?"md:col-span-6 lg:col-span-4":"md:col-span-6"),children:[(0,l.jsx)("div",{className:"overflow-hidden rounded-2xl relative !rounded-b-none",children:(0,l.jsx)(y.O,{className:"aspect-[1.5/1]"})}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,l.jsxs)("div",{className:"flex justify-between gap-x-8",children:[(0,l.jsx)(y.O,{className:"h-5 w-4/5"}),(0,l.jsx)(y.O,{className:"h-5 w-1/5"})]}),(0,l.jsx)("div",{className:(0,j.cn)("min-w-fit",t?"md:flex-col md:justify-start flex-row justify-between":"flex-row justify-between"),children:(0,l.jsx)(y.O,{className:"h-[2.5rem] w-full"})})]})]})},C=e=>{let{objectData:{Price:t,Currency:s,StreetAddress:a,SaleHeadline:n,Rooms:r,LivingSpace:i,MonthlyFee:c,Municipality:m,City:h,IsPreSale:f,Status:p,BiddingActive:g,MarketingMethods:v,NewConstruction:b,LeasePurchase:N,ObjectVitecType:y,Image:k,slug:C,AreaName:P,OfficeName:O,Country:A,Province:F},small:D=!1}=e,Z=(0,u.useRouter)(),T=(0,d.useTranslations)("components.cards"),R=(0,j.FF)({values:[{value:r,suffix:" ".concat(T("rooms"))},{value:i,suffix:" m\xb2"},{value:(0,j.mA)(c,s),suffix:T("perMonth")}],returnAsArray:!0}),M=(0,j.FF)({values:[{value:m},{value:P}],joinBy:", "});return(0,l.jsxs)(o.rU,{href:(0,j.xL)({ObjectVitecType:y,slug:C,AreaName:P,City:h,Country:A,Municipality:m,OfficeName:O,Province:F}),className:(0,j.cn)("flex flex-col col-span-12",D?"md:col-span-6 lg:col-span-4":"md:col-span-6"),children:[(0,l.jsxs)("div",{className:"overflow-hidden rounded-2xl relative !rounded-b-none",children:[(0,l.jsx)(w.Z,{src:k?k.Url:"",alt:"First image of ".concat(a),aspectRatio:1.5,aspectRatioClassName:"scale-100 hover:scale-105 transition-all duration-200",className:"object-cover relative !rounded-b-none",quality:80,sizes:"400px",scrimOpacity:"0.05"}),p&&(0,l.jsx)(L.Z,{status:p,IsPreSale:f,BiddingActive:g,MarketingMethods:v,NewConstruction:b,LeasePurchase:N,onBiddingClick:e=>{e.preventDefault(),e.stopPropagation();let t=(0,j.xL)({ObjectVitecType:y,slug:C,AreaName:P,City:h,Country:A,Municipality:m,OfficeName:O,Province:F});Z.push("".concat(t,"?openBids=true"))}})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,l.jsxs)("div",{className:"flex justify-between gap-x-8",children:[(0,l.jsx)(x.u,{small:!0,strong:!0,className:"font-semibold",children:null!=a?a:(0,j.tl)(n)}),0!==(0,j.uf)(t)&&null!==(0,j.uf)(t)&&(0,l.jsx)(x.u,{small:!0,strong:!0,className:"text-end min-w-fit",children:(0,j.mA)(t,s)})]}),(0,l.jsxs)("div",{className:(0,j.cn)("min-w-fit",D?"md:flex-col md:justify-start flex-row justify-between":"flex-row justify-between"),children:[(0,l.jsx)("div",{className:"flex",children:(0,l.jsx)(x.F,{small:!0,children:M})}),(0,l.jsx)(S.F,{stringArray:R,Component:x.F})]})]})]})};var P=e=>{let{small:t,object:s}=e;return s?(0,l.jsx)(C,{objectData:s,small:t}):(0,l.jsx)(k,{small:!0})};let O=(new Date().getDate(),a="pk.eyJ1IjoibWFrbGFycmluZ2VuIiwiYSI6ImNtb2pyMjdqMDAxZ28yeXIyYzI2dXBjN2gifQ.OcbnMTprkbMOLbhlNsDv0Q"),A=(e,t,s)=>{let a=new(b()).LngLatBounds;return e&&e.length>
10?(e.forEach(e=>{e.Latitude&&e.Longitude&&a.extend([e.Longitude,e.Latitude])}),a):s?new(b()).LngLatBounds({lng:-10,lat:30},{lng:40,lat:48}):new(b()).LngLatBounds({lng:11.2943,lat:56.4104},{lng:21.2295,lat:67.8418})},F=async(e,t)=>{let s=await fetch("/api/estates?searchParams=".concat(JSON.stringify(e),"&objectType=").concat(t));return await s.json()},D="(min-width: 768px)",Z=e=>{let{object:t,index:s,selected:a,setSelected:r,handleOnMarkerClick:i}=e,o=(0,u.useRouter)(),d=(0,n.useRef)(),m=(0,g.a)(D),h=(0,g.a)("(pointer: coarse)"),x=(0,u.useSearchParams)(),[f,p]=(0,n.useState)(!1),v=(0,n.useCallback)(e=>()=>{!D||h||a||p(e)},[]),b=(0,n.useCallback)(async()=>{let e=(0,j.xL)(t);o.push(e)},[t]);return((null==x?void 0:x.get(c.j2))!==c.NI||t.Status===c.NI)&&((null==x?void 0:x.get(c.j2))||t.Status!==c.NI)&&t.Latitude&&t.Longitude?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(N.Jx,{longitude:t.Longitude,latitude:t.Latitude,ref:d,onClick:e=>{e.originalEvent.stopPropagation(),h?r(e=>(i(s),s)):b()},children:(0,l.jsx)("div",{onMouseOver:v(!0),onMouseLeave:v(!1),className:(0,j.cn)("size-6 rounded-full cursor-pointer shadow-small border",a?"bg-brand-red border-brand-lightRed":"bg-neutrals-neutral-6 border-neutrals-neutral-4 hover:bg-brand-red hover:border-brand-lightRed")})}),(a||f)&&(0,l.jsx)(N.GI,{longitude:t.Longitude,latitude:t.Latitude,closeButton:!1,closeOnClick:!1,closeOnMove:!1,anchor:"top",offset:[0,20],focusAfterOpen:!1,onClose:()=>{r(e=>{if(e!==s)return s})},maxWidth:m?"294px":"329px",className:(0,j.cn)("w-[329px] md:w-[294px] p-0 rounded-2xl overflow-hidden shadow-custom",m?"":"!transform-none !top-auto !bottom-7 !left-4"),children:(0,l.jsx)(P,{object:t})})]}):null};var T=e=>{let{objectType:t,isAbroad:s}=e,a=(0,n.useRef)(),r=(0,u.useSearchParams)(),[i,o]=(0,n.useState)(),c=(0,n.useMemo)(()=>A(i,void 0,s),[i,s]),d=c.getCenter(),[m,h]=(0,n.useState)(void 0);return(0,n.useEffect)(()=>{let e=Object.fromEntries(new URLSearchParams(null!=r?r:"").entries());(async()=>{o(await F(e,t))})()},[r,t]),(0,l.jsx)("div",{className:"h-[100dvh] w-screen",children:(0,l.jsxs)(N.ZP,{initialViewState:{longitude:d.lng,latitude:d.lat,zoom:s?4:5},ref:a,style:{width:"100%",aspectRatio:"2/1"},mapStyle:"mapbox://styles/mapbox/streets-v11",mapboxAccessToken:O,scrollZoom:!0,onLoad:e=>{let t=e.target;try{(null==i?void 0:i.length)&&t.fitBounds(c,{padding:{bottom:20,left:20,right:20,top:20}})}catch(e){}},children:[null==i?void 0:i.map((e,t)=>(0,l.jsx)(Z,{object:e,index:t,selected:t===m,setSelected:h,handleOnMarkerClick:e=>{var t,s,l;return null===(l=a.current)||void 0===l?void 0:l.getMap().easeTo({center:[null===(t=(null!=i?i:[])[e])||void 0===t?void 0:t.Longitude,null===(s=(null!=i?i:[])[e])||void 0===s?void 0:s.Latitude]})}},e._id)),(0,l.jsx)(N.Pv,{showCompass:!1,position:"top-left"})]})})},R=s(12793),M=e=>{let{objectType:t,objects:s,isAbroad:a}=e,n=(0,d.useTranslations)("components.modules");return(0,l.jsxs)(R.dy,{direction:"bottom",children:[(0,l.jsxs)(R.Qz,{className:"flex ml-auto h-10 gap-2 items-center justify-between rounded-md bg-background px-3 py-2 text-sm r
1ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",children:[(0,l.jsx)(p.Zl,{className:"h-5 w-5"}),(0,l.jsx)(x.u,{children:n("showOnMap")})]}),(0,l.jsxs)(R.sc,{"data-vaul-no-drag":!0,className:"h-[100dvh] mt-0 w-full rounded-none bg-base-white",children:[(0,l.jsx)(R.OX,{className:"p-0 h-0 relative",children:(0,l.jsx)("div",{className:"flex justify-end",children:(0,l.jsx)(R.uh,{className:"absolute top-3 right-3 p-2 z-50 bg-white rounded-full",children:(0,l.jsx)(f.T,{className:"size-5"})})})}),(0,l.jsx)(T,{objectType:t,isAbroad:a})]})]})},I=s(21590),E=s(22648),V=s(58945),B=s(66935),_=e=>{var t;let{isAbroad:s,objects:a,loading:n,total:r}=e,i=(0,u.useSearchParams)();return(0,l.jsxs)(V.M,{id:s?"abroad-list":"list",className:"pt-6 scroll-mt-32 gap-y-6",children:[null==a?void 0:a.map((e,t)=>(0,l.jsx)(I.Z,{objectData:e,small:!0,priorityLoad:t<3},e.slug.current)),n&&Array.from({length:Math.ceil(Number(null!==(t=null==i?void 0:i.get(c.PG))&&void 0!==t?t:12)/3)}).map((e,t)=>(0,l.jsx)(E.Z,{small:!0},t)),(0,l.jsx)(B.Z,{max:r,shallowUpdate:!0})]})},z=s(87142),q=s(22487),U=s(15657),G=()=>{var e,t;let s=(0,d.useTranslations)("components.modules"),{handleChangeValue:a}=(0,i.Z)({searchParamName:c.uO,shallow:!0}),r=[{value:"DateDesc",title:s("sortDateDesc")},{value:"DateAsc",title:s("sortDateAsc")},{value:"PriceAsc",title:s("sortPriceAsc")},{value:"PriceDesc",title:s("sortPriceDesc")},{value:"LivingSpaceDesc",title:s("sortLivingSpaceDesc")},{value:"LivingSpaceAsc",title:s("sortLivingSpaceAsc")}],o=(0,u.useSearchParams)(),[m,h]=(0,n.useState)((null==o?void 0:o.get(c.uO))?JSON.parse(null!==(e=o.get(c.uO))&&void 0!==e?e:"DateDesc"):r[0].value),f=null!==(t=r.find(e=>e.value===m))&&void 0!==t?t:r[0];return(0,l.jsxs)(U.Ph,{onValueChange:e=>{h(e),e===r[0].value?a(void 0):a(JSON.stringify(e))},value:f.value,children:[(0,l.jsx)(U.GT,{children:(0,l.jsx)(U.ki,{placeholder:r[0].title,children:(0,l.jsx)(x.u,{children:f.title})})}),(0,l.jsx)(U.Bw,{ref:e=>{null==e||e.addEventListener("touchend",e=>{e.preventDefault()})},children:r.map(e=>(0,l.jsx)(U.Ql,{value:e.value,className:"pl-8",onClick:e=>{e.preventDefault(),e.stopPropagation()},children:e.title},e.value))})]})},J=s(178),H=()=>{let e=(0,d.useTranslations)("components.pages.forSalePage.ctaBlock");return(0,l.jsx)("div",{className:"md:mt-[120px] md:mb-[72px] my-16 col-span-full",children:(0,l.jsxs)("div",{className:"bg-semantic-blueGrey w-full flex flex-col gap-6 rounded-[16px] p-12",children:[(0,l.jsx)("h3",{className:"text-2xl",children:e("title")}),(0,l.jsx)("p",{children:e("body")}),(0,l.jsxs)("div",{className:"flex gap-4",children:[(0,l.jsx)(J.z,{internalLink:!0,href:"/kopa/kopa-bostad-i-sverige",children:e("button1")}),(0,l.jsx)(J.z,{internalLink:!0,href:"/tjanster",variant:"pureOutline",children:e("button2")})]})]})})},Y=s(43430),Q=s(99545),X=s(47555),W=s(73149),K=s.n(W),$=s(60379),ee=s(88016),et=s(58513),es=s(54910),ea=e=>{var t;let{Heading:s,Subtitle:a,ButtonText:r,VitecLeadType:i,VitecCustomerId:o,BrokerId:c,ShowSwedishOffices:u=!0,isOpen:m=!1,onOpenChange:x,isAbroad:f,children:p}=e,{register:g,handleSubmit:j,setValue:v,formState:{errors:b}}=(0,Y.cI)({resolver:(0,$.F)(ee.kn),defaultValues:{officeid:null!=o?o:"",leadtype:null!==(t=null==i?void 0:i.toString())&&void 0!==t?t:"",assignedto:null!=c?c:""}}),[N,w]=(0,n.useState)(!1),[y,S]=(0,n.useState)(""),[L,k]=(0,n.useState)([]),[C,P]=(0,n.useState)(!1),[O,A]=(0,n.useState)(!1),F=(0,d.useTranslations)("common.forms"),{executeRecaptcha:D}=(0,es.xX)();(0,n.useEffect)(()=>{m&&!O&&A(m),(async()=>{w(!0);try{let e=await fetch("/api/broker-offices");if(!e.ok)throw Error("Failed to fetch offices");let t=await e.json();if(u){let e=null==t?void 0:t.filter(e=>!e.ForeignOffice);k(e)}else{let e=null==t?void 0:t.filter(e=>e.ForeignOffice);k(e)}if(o){let e=null==t?void 0:t.find(e=>(null==e?void 0:e.VitecCustomerId)===o);e&&v("officeid",e.VitecCustomerId)}}catch(e){e instanceof Error?console.error("Error fetching office
1s:",e.message):console.error("An unknown error occurred")}finally{w(!1)}})()},[o,v,u,m]);let Z=s||F("freeValuationHeading"),T=a||F("freeValuationSubtitle"),R=async e=>{w(!0);try{if(!D){console.warn("Recaptcha not ready yet");return}let t=await D("contact_form_abroad"),s=await fetch("/api/create-contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,token:t})}),a=await s.json();if(!s.ok)throw Error(a.message||F("msgErrorNotSent"));S(F("msgSuccessSent"))}catch(e){console.error("Form submission error:",e),S(F("msgErrorNotSent")),P(!0)}finally{w(!1)}},M=!!o,I=c?"grid grid-cols-1 md:grid-cols-2 gap-4 w-full":"grid grid-cols-1 md:grid-cols-3 gap-4 w-full",E=e=>(null==e?void 0:e.message)||"";return(0,l.jsxs)(et.Vq,{open:O,onOpenChange:e=>{A(e),null==x||x(e)},children:[(0,l.jsx)(et.hg,{className:"ring-1 ring-input hover:ring-0 bg-background hover:bg-accent hover:text-accent-foreground px-4 py-2 rounded-2xl min-w-fit",children:p}),(0,l.jsxs)(et.cZ,{className:"flex items-center justify-center min-w-full lg:min-w-fit px-16 xl:px-32 pt-16 pb-8",children:[!y&&(0,l.jsxs)("form",{onSubmit:j(e=>{R(e)}),className:"flex flex-col items-center gap-4 w-full text-center",children:[(0,l.jsx)("input",{type:"hidden",...g("leadtype"),value:null==i?void 0:i.toString()}),(0,l.jsx)("input",{type:"hidden",...g("officeid"),value:o}),(0,l.jsx)("input",{type:"hidden",...g("assignedto"),value:c}),(0,l.jsx)("input",{type:"hidden",...g("leadstaskid")}),c&&(0,l.jsx)("input",{type:"hidden",...g("assignedto"),value:c}),(0,l.jsx)("p",{className:"font-ABCArizonaFlair text-[1.5rem] md:text-[2rem] leading-[1.5] md:leading-[1.25] tracking-[-3%] font-light",children:Z}),(0,l.jsx)("p",{className:"mb-4 text-center",children:T}),(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 w-full",children:[(0,l.jsxs)("div",{className:"md:mb-4",children:[(0,l.jsxs)(Q._,{className:"block font-[450] mb-2 text-left text-sm",children:[F("firstNameLabel"),"*"]}),(0,l.jsx)("input",{...g("firstname",{required:"First name is required"}),className:"w-full p-2 border rounded-[12px] h-12"}),b.firstname&&(0,l.jsx)("p",{className:"text-red-600 text-sm",children:E(b.firstname)})]}),(0,l.jsxs)("div",{className:"md:mb-4",children:[(0,l.jsxs)(Q._,{className:"block font-[450] mb-2 text-left text-sm",children:[F("lastNameLabel"),"*"]}),(0,l.jsx)("input",{...g("lastname",{required:"Last name is required"}),className:"w-full p-2 border rounded-[12px] h-12"}),b.lastname&&(0,l.jsx)("p",{className:"text-red-600 text-sm",children:E(b.lastname)})]})]}),(0,l.jsxs)("div",{className:I,children:[(0,l.jsxs)("div",{className:"md:mb-4",children:[(0,l.jsxs)(Q._,{className:"block font-[450] mb-2 text-left text-sm",children:[F("emailLabel"),"*"]}),(0,l.jsx)("input",{...g("email"),className:"w-full p-2 border rounded-[12px] h-12",autoComplete:"email",type:"email"}),b.email&&(0,l.jsx)("p",{className:"text-red-600 text-sm",children:E(b.email)})]}),(0,l.jsxs)("div",{className:"md:mb-4",children:[(0,l.jsxs)(Q._,{className:"block font-[450] mb-2 text-left text-sm",children:[F("telephoneLabel"),"*"]}),(0,l.jsx)("input",{...g("telephone",{required:"Telephone is required"}),className:"w-full p-2 border rounded-[12px] h-12",type:"tel",autoComplete:"tel"}),b.telephone&&(0,l.jsx)("p",{className:"text-red-600 text-sm",children:E(b.telephone)})]}),!c&&(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsxs)(Q._,{className:"block font-[450] mb-2 text-left text-sm",children:[F("selectOfficeLabel"),"*"]}),N?(0,l.jsx)("p",{children:F("loadingText")}):(0,l.jsxs)("select",{disabled:M,...g("officeid",{required:"Office selection is required"}),className:"w-full p-2 border rounded-[12px] h-12",children:[(0,l.jsx)("option",{value:"",children:F("selectOfficeOption")}),null==L?void 0:L.map(e=>(0,l.jsx)("option",{value:e.VitecCustomerId,children:e.title||e.City},e._id))]}),b.officeid&&(0,l.jsx)("p",{className:"text-red-600 text-sm",children:E(b.officeid)})]})]}),(0,l.jsx)(X.Z,{label:null!=r?r:F("btnContact"),disabled:N}),(0,l.jsxs)("span",{className:"text-xs text-center opacity-70",children:[F("mandatoryFieldNote")," ",(0,l.jsx)(K(),{href:"/om-maklarringen/integritetspolicy/",className:"underline",children:F("privacyPolicyLinkText")}
1),". ",F.rich("mandatoryRecaptchaFieldNoteFull",{privacy:e=>(0,l.jsx)(K(),{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline",children:e}),terms:e=>(0,l.jsx)(K(),{href:"https://policies.google.com/terms",target:"_blank",rel:"noopener noreferrer",className:"underline",children:e})})]})]}),y&&(0,l.jsxs)("div",{className:"min-h-32",children:[(0,l.jsx)(h.Z,{as:"h2",className:"text-center mb-4",children:C?"!":F("interestThankYouHeading")}),(0,l.jsx)("p",{className:"mb-4 text-center",children:y})]})]})]})},el=s(81570),en=s(67544),er=s(73270),ei=e=>{var t;let{contentArea:s,searchResponse:a,comboSearchItems:f,heroTitle:p,hideFilters:g=!1,isAbroad:j=!1,objectType:v}=e,b=(0,d.useTranslations)("components.pages.forSalePage"),N=(0,d.useTranslations)("common.forms"),w=(0,d.useTranslations)("common.buttons"),y=(0,o.tv)(),S=(0,o.jD)(),L=(0,u.useSearchParams)(),{handleChangeValue:k}=(0,i.Z)({shallow:!0}),C=p||"".concat(b("propertiesForSale")," - ").concat(j?b("abroad"):b("sweden")),P=function(e,t){var s;let a=null==e?void 0:e.get(c.MZ);if(a)return" - "+a.toString();let l=null===(s=t.area)||void 0===s?void 0:s.Heading;return l?" - "+l:""}(L,a),[O,A]=(0,n.useState)(a),[F,D]=(0,n.useState)(!1),[Z,T]=(0,n.use
1State)(null!==(t=null==L?void 0:L.get(c.j2))&&void 0!==t?t:"0"),R=(0,n.useMemo)(()=>[{title:"".concat(b("allObjects")," (").concat(O.statusCount,")"),value:"0"},{title:"".concat(b("soonForSale")," (").concat(O.futureCount,")"),value:"2",hide:g},{title:"".concat(b("viewings")," (").concat(O.viewingsCount,")"),value:"Viewings",hide:g||j},{title:"".concat(b("biddingInProgress")," (").concat(O.bidingCount,")"),value:"BiddingActive",hide:g},{title:b("villa"),value:"villa",hide:!j},{title:b("terraced-house"),value:"terraced-house",hide:!j},{title:b("apartment"),value:"apartment",hide:!j},{title:b("leasePurchase"),value:"LeasePurchase",hide:j},{title:b("newConstruction"),value:"NewConstruction"},{title:"".concat(b("sold")),value:c.NI}],[b,O,g]),I=(0,n.useCallback)(()=>{let e=new URLSearchParams(null==L?void 0:L.toString());e.delete(c.OR),e.delete(c.sU),y.replace(S+"?"+e.toString(),{scroll:!1})},[L,y,S]);r(()=>{let e=Object.fromEntries(new URLSearchParams(null!=L?L:"").entries());!async function(){try{D(!0);let t=await fetch("/api/estates-and-total?searchParams=".concat(JSON.stringify(e),"&objectType=").concat(v)).then(e=>e.json());A(t)}catch(e){console.log("Failed to fetch data")}finally{D(!1)}}()},[null==L?void 0:L.toString(),v]);let[E,B]=(0,n.useState)(null),[U,Y]=(0,n.useState)(null),[Q,X]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{var e;let t=null==L?void 0:L.get("status"),s=null!==(e=null==L?void 0:L.get("q"))&&void 0!==e?e:"",a=null==L?void 0:L.toString().replace(/status=[^&]*&?/,""),l=(null==a?void 0:a.trim())!=="";if("10"===t&&""===s&&!l&&Q){let e=new URLSearchParams(null==L?void 0:L.toString());e.set("status","0"),k(e.toString()),T("0"),X(!1);return}if(s!==E||a!==U){if(!t||!["0","10","2","Viewings","BiddingActive","NewConstruction","
1LeasePurchase"].includes(t)){let e=new URLSearchParams(null==L?void 0:L.toString());e.set("status","0"),k(e.toString()),T("0"),B(s),Y(null!=a?a:"");return}B(s),Y(null!=a?a:"")}if("0"===t&&0===O.activeCount){let e=new URLSearchParams(null==L?void 0:L.toString());e.set("status","10"),k(e.toString()),T("10"),X(!0);return}if(t&&"0"!==t&&"10"!==t&&0===O.objectsCount&&O.activeCount>0){let e=new URLSearchParams(null==L?void 0:L.toString());e.set("status","0"),k(e.toString()),T("0");return}},[O,L,k,E,U,Q]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(z.Z,{heading:"".concat(C).concat(P),searchPlaceholder:j?b("abroadCityAreaStreetAddress"):b("cityAreaStreetAddress"),subHeading:"".concat(b("searchAmong")," ").concat(O.statusCount," ").concat(b("propertiesForSaleAnd")," ").concat(O.futureCount," ").concat(b("soonToBeSoldListings")),showFilter:!0,showAbroadFilter:j,isAbroad:j,comboSearchItems:f,shallowSearch:!0,searchMode:er.N.StartsWith}),(0,l.jsx)(q.Z,{GroupItems:R,groupValue:Z,setGroupValue:T,addAsFilter:!0,searchParamsConfig:{shallow:!0}}),(null==L?void 0:L.get(c.j2))===c.NI&&(null!==L.get(c.OR)||null!==L.get(c.sU))?(0,l.jsx)(V.M,{className:"pt-6",children:(0,l.jsxs)(V.o,{start:"1",span:"12",children:[(0,l.jsx)(h.Z,{as:"h2",children:b("noResults")}),(0,l.jsxs)("div",{className:"flex gap-x-4 items-center",children:[(0,l.jsx)(x.u,{children:b("tryChangingOrExpandingYourSearch")}),(0,l.jsx)(J.z,{onClick:I,variant:"link",className:"underline underline-offset-8 p-0",children:(0,l.jsx)(x.F,{small:!0,children:b("seeAllProperties")})})]})]})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(V.M,{children:[(0,l.jsx)(V.o,{start:"1",span:"6",className:"col-span-3 md:col-span-6",children:(0,l.jsx)(G,{})}),(0,l.jsx)(V.o,{start:"7",span:"6",className:"col-span-3 md:col-span-6 col-start-4 md:col-start-7 flex items-center",children:(0,l.jsx)(M,{objectType:v,objects:O.objects,isAbroad:j})})]}),(0,l.jsx)(_,{isAbroad:j,loading:F,objects:O.objects,total:O.objectsCount}),!j&&(0,l.jsx)(V.M,{className:"pt-6",children:(0,l.jsx)(H,{})}),!!s&&(0,l.jsx)(m.Z,{blocks:s}),j&&(0,l.jsx)(ea,{ShowSwedishOffices:!1,isAbroad:j,VitecLeadType:en.u3.abroadDream,Heading:N("abroadDream"),Subtitle:N("abroadDreamSubtitle"),children:(0,l.jsx)(el.Z,{label:w("findYourDreamHome"),secondLabel:w("findYourDreamHome"),className:"bg-brand-red hover:bg-brand-red"})})]})]})}},81570:function(e,t,s){var a=s(52676),l=s(2733),n=s(75271),r=s(65341);t.Z=e=>{let{label:t,secondLabel:s,className:i}=e,[o,c]=(0,n.useState)(t);return(0,n.useEffect)(()=>{let e=setInterval(()=>{c(e=>e===t?s:t)},8e3);return()=>clearInterval(e)},[t,s]),(0,a.jsxs)(r.u,{small:!0,strong:!0,className:(0,l.cn)("fixed bottom-4 right-4 md:bottom-8 md:right-8 rounded-full px-6 py-3 z-50 text-white flex flex-col overflow-hidden items-center",i),"aria-label":"S\xe4lj med oss formul\xe4r \xf6ppnas i dialog",children:[(0,a.jsx)("span",{className:(0,l.cn)("transition duration-500 ease-in-out absolute",o===t?"translate-y-0 opacity-100":"-translate-y-10 opacity-0"),children:t}),(0,a.jsx)("span",{className:(0,l.cn)("transition duration-500 ease-in-out",o===s?"-translate-y-0 opacity-100":"translate-y-10 opacity-0"),children:s})]})}}}]);
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.