PageSourceSearch

https://asunnot.oikotie.fi/angular/js/4141.d3ae66f49076595a.js

js oikotie.fi collected 2026-09-24 08:49:41 UTC 15,961 bytes, 3 lines download raw bytes

1(self.webpackChunkota=self.webpackChunkota||[]).push([[4141],{9263(L,E,n){"use strict";n.d(E,{PagesLivingAreaModule:()=>r});var t=n(62552),c=n(56872),g=n(35747);const y=[{path:"**",component:(()=>{var a;class s{static#t=a=()=>(this.\u0275fac=function(i){return new(i||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["ng-component"]],standalone:!1,decls:0,vars:0,template:function(i,h){},encapsulation:2}))}return a(),s})()}];let p=(()=>{var a;class s{static#t=a=()=>(this.\u0275fac=function(i){return new(i||s)},this.\u0275mod=t.$C({type:s}),this.\u0275inj=t.G2t({imports:[g.iI.forChild(y),g.iI]}))}return a(),s})();var u=n(10127),S=n(62265),d=n(57780),m=n(68534),C=n(59554),$=n(34697),H=n(68152);const A=(a,s)=>s.id;function f(a,s){if(1&a&&(t.EFF(0,"\n\t\t\t\t"),t.j41(1,"card-condensed",5),t.EFF(2,"\n\t\t\t\t"),t.k0s(),t.EFF(3,"\n\t\t\t")),2&a){const e=s.$implicit,o=s.$index;t.R7$(),t.Y8G("index",o)("card",e)}}function D(a,s){if(1&a){const e=t.RV6();t.EFF(0,"\n\t\t"),t.j41(1,"div",6),t.EFF(2,"\n\t\t\t"),t.j41(3,"button",7),t.bIt("click",function(){t.eBV(e);const i=t.XpG(2);return t.Njj(i.loadMore())}),t.pXf(4,1),t.k0s(),t.EFF(5,"\n\t\t"),t.k0s(),t.EFF(6,"\n\t")}if(2&a){const e=t.XpG(2);t.R7$(3),t.AVh("button--loading",e.loading)}}function Q(a,s){if(1&a&&(t.EFF(0,"\n\t"),t.j41(1,"h2",2),t.pXf(2,0),t.k0s(),t.EFF(3,"\n\n\t"),t.j41(4,"div",3),t.EFF(5,"\n\t\t"),t.j41(6,"div",4),t.EFF(7,"\n\t\t\t"),t.Z7z(8,f,4,2,null,null,A),t.k0s(),t.EFF(10,"\n\t"),t.k0s(),t.EFF(11,"\n\t"),t.DNE(12,D,7,2)),2&a){const e=t.XpG();t.R7$(6),t.AVh("margined--v20",e.moreToLoad),t.R7$(2),t.Dyx(e.cards),t.R7$(4),t.vxM(e.moreToLoad?12:-1)}}let P=(()=>{var a;class s{constructor(){this.loading=!1,this.cards=[],this.moreToLoad=!0,this.cardUtils=(0,t.WQX)(C.t),this.searchResource=(0,t.WQX)(H.c),this.offset=0,this.timeLimit=Math.floor(Date.now()/1e3),this.limit=3}ngOnInit(){var o=this;return(0,d.A)(function*(){o.searchParams={cardType:m.CARD_TYPE_AD_APARTMENT_SELL,sortBy:m.AD_FILTER_SORTBY_POPULARITY_DESC,locations:JSON.stringify([[o.locationId,o.locationType,o.locationName]])},yield o.fetchCards()})()}loadMore(){var o=this;return(0,d.A)(function*(){o.offset+=o.limit,yield o.fetchCards()})()}fetchCards(){var o=this;return(0,d.A)(function*(){o.loading=!0;try{const{cards:i,found:h}=yield o.searchResource.getV3({limit:o.limit,offset:o.offset,publishedBefore:o.timeLimit,...o.searchParams});o.moreToLoad=(0===o.offset?1:o.offset)*o.limit<=h,o.cards=[...o.cards,...o.cardUtils.getCardV3Objects(i)]}catch{return}finally{o.loading=!1}})()}static#t=a=()=>(this.\u0275fac=function(i){return new(i||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["living-area-listings"]],inputs:{locationId:"locationId",locationType:"locationType",locationName:"locationName"},decls:1,vars:1,consts:()=>{let o,i;return o=$localize`:Most viewed listings in the area|Most viewed listings title:Alueen katsotuimmat kohteet`,i=$localize`:Show More|Show more living area listings button text:
2				Näytä lisää
3			`,[o,i,[1,"heading","heading--title-2","heading--center","margined","margined--v20"],[1,"living-area-listings"],[1,"cards-v3","living-area-listings__container","margined"],["otasEvent","living-area_listing_click",3,"index","card"],[1,"text-center"],[1,"button",3,"click"]]},template:function(i,h){1&i&&t.DNE(0,Q,13,3),2&i&&t.vxM(h.cards.length>0?0:-1)},dependencies:[$.$],styles:[".living-area-listings[_ngcontent-%COMP%]{display:flex;justify-content:center}.living-area-listings__container[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr);gap:1.25rem;flex-grow:1;padding:0 1.25rem}@media screen and (min-width: 33.75rem){.living-area-listings__container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 64rem){.living-area-listings__container[_ngcontent-%COMP%]{grid-template-columns:repeat(3,minmax(0,1fr));padding:0}}"]}))}return a(),s})();const G="otAsunnot:livingArea";u.module(G,[]).directive("livingAreaListings",(0,S.PW)({component:P}));const _=G,x={bindings:{lat:"@",lng:"@",locationId:"@",locationType:"@",locationName:"@",options:"<"},controller:(()=>{class a{constructor(e,o,i){this._domElement=e[0],this._AreaMap=o,this._searchParams=new i,this._intersectionObserver=null}$onInit(){this.cardType=this.options[0],this._intersectionObserver=new IntersectionObserver(this._observerCallback.bind(this)),this._intersectionObserver.observe(this._domElement),this._searchParams.setParam("locations",[{id:this.locationId,type:this.locationType,name:this.locationName}])}$onDestroy(){this._intersectionObserver&&this._intersectionObserver.disconnect()}update(){this.loading=!0,this._searchParams.setParam("cardType",this.cardType.value),this._AreaMap.updateCards(this._searchParams).then(e=>{this.resultCount=e.found}).finally(()=>{this.loading=!1})}_observerCallback(e){e.forEach(o=>{if(o.isIntersecting){this._intersectionObserver.disconnect();const i=this._domElement.querySelector(".area-map__component"),h=this._domElement.querySelector(".area-map");this._AreaMap.createMap(i,parseFloat(this.lat),parseFloat(this.lng),h),this.update()}})}}return a.$inject=["$element","AreaMap","searchParamFactory"],a}
3)(),templateUrl:"/template/living-area/components/area-map"};var O=n(52864);class K extends O.A{constructor(s,e,o,i,h,M,N,it,mt){super(s,e,o,i,h,M,!0),this._SizeControlFactory=it,this._BaseMapToggleFactory=mt,this._createSizeControl(N),this._createBasemapToggleControl()}_createSizeControl(s){const e=this._MapService.createControls(2,this._SizeControlFactory(s,this._asunnotMap));this._asunnotMap.addControl(e)}_createBasemapToggleControl(){const s=this._MapService.createControls(2,this._BaseMapToggleFactory(this._asunnotMap));this._asunnotMap.addControl(s)}}function U(a,s,e,o){return(i,h,M,N,it)=>new K(a,s,i,h,M,N,it,e,o)}U.$inject=["LeafletMapService","MapClusterService","SizeControlFactory","BaseMapToggleFactory"];const Y=U;var z=n(64042);const b=(()=>{class a{constructor(e,o,i,h){this._AreaMapFactory=e,this._CoordinatesResource=o,this._SearchResource=i,this._searchParamsHistory=h}createMap(e,o,i,h){this._map=this._AreaMapFactory(e,o||z.GW,i||z.EW,14,h),this._map.getLeafletMap().disableScrollZoom()}updateCards(e){return this._searchParamsHistory.setLatest(e),this._CoordinatesResource.get(e.serialize()).then(o=>(this._map.setCoordinates(o,o&&o.length>0),this._getResultCount(e)))}_getResultCount(e){return this._SearchResource.get({...e.serialize(),limit:0})}}return a.$inject=["AreaMapFactory","CoordinatesResource","SearchResource","searchParamsHistory"],a})();function W(a,s){return function e(o,i){const h=a.$new(!0);return h.container=o,h.map=i,s('<size-control container="container" map="map"></size-control>')(h)[0]}}W.$inject=["$rootScope","$compile"];const J=W,w={controller:(()=>{class a{constructor(e){this._$timeout=e,this.enlarged=!1}toggle(){this.enlarged=!this.enlarged,this.enlarged?this._container.classList.add("area-map--enlarged"):this._container.classList.remove("area-map--enlarged"),this._map.invalidateSize()}}return a.$inject=["$timeout"],a})(),templateUrl:"/template/living-area/components/size-control",bindings:{_container:"<container",_map:"<map"}};var k=n(13126),q=n(11420),tt=n(99716),I=n(54647),et=n(86786),st=n(37890);const j="otAsunnot:map:popup";u.module(j,[]).directive("searchMapPopupV2",(0,S.PW)({component:st.q}));const nt=j;var ot=n(16705);const F="otAsunnot:map:livingArea";u.module(F,[ot.A,et.A,nt,q.A,k.A,tt.A,I.A]).component("areaMap",x).service("AreaMap",b).factory("AreaMapFactory",Y).component("sizeControl",w).factory("SizeControlFactory",J);const rt=F;var V=n(7797),R=n(2339);const B="otAsunnot:page:livingArea";u.module(B,[_,rt,V.A,R.A]);const at=B;var X=n(64994),l=n(279);let r=(()=>{var a;class s{constructor(){(0,t.WQX)(c.be).bootstrap(document.documentElement,[...l.m,at,...X.m],{strictDi:!0})}static#t=a=()=>(this.\u0275fac=function(i){return new(i||s)},this.\u0275mod=t.$C({type:s}),this.\u0275inj=t.G2t({imports:[c.be,p,X.n]}))}return a(),s})()},68152(L,E,n){"use strict";n.d(E,{c:()=>y});var t=n(84754),c=n(62552),g=n(75902),v=n(12341);let y=(()=>{var p;class u{constructor(){this.http=(0,c.WQX)(t.Qq)}getV3(d={}){const m=(new t._y).set(v.u,!0),C=this.http.get("/api/search",{params:d,context:m});return(0,g.s)(C)}getUserListings(d={}){const m=(new t._y).set(v.u,!0),C=this.http.get("/api/search/user-cards",{params:d,context:m,withCredentials:!0});return(0,g.s)(C)}getPremiumListings(d={}){const m=(new t._y).set(v.u,!0),C=this.http.get("/api/search/premium-cards",{params:d,context:m});return(0,g.s)(C)}getLatestGuardListings(d={}){const m=(new t._y).set(v.u,!0),C=this.http.get("/api/search/latest-guard-cards",{params:d,context:m});return(0,g.s)(C)}getFavouriteListings(d={}){const m=(new t._y).set(v.u,!0),C=this.http.get("/api/search/favourite-cards",{params:d,context:m,withCredentials:!0});return(0,g.s)(C)}static#t=p=()=>(this.\u0275fac=function(m){return new(m||u)},this.\u0275prov=c.jDH({token:u,factory:u.\u0275fac,providedIn:"root"}))}return p(),u})()},32959(L,E,n){"use strict";n.d(E,{m4:()=>X,h5:()=>R,Wh:()=>at});var t=n(62552),c=n(21152),g=n(68754),v=n(6215),y=n(5445),p=n(32479),u=n(17862),S=n(83752),d=n(23097),m=n(84770),C=n(67099),$=n(23478);let H=(()=>{var l;class r{constructor(){this.actions$=(0,t.WQX)(c.En),this.DecorateResourceService=(0,t.WQX)(C.n),this.decorate$=(0,c.EH)(()=>this.actions$.pipe((0,c.gp)(...m.EQ),(0,v.n)(({params:s})=>(0,y.H)(this.DecorateResourceService.searchParams((0,$.l)(s)))),(0,p.T)(s=>d.zc.searchParametersDecorated({decoratedParams:s})),(0,u.W)(()=>S.w)))}static#t=l=()=>(this.\u0275fac=function(e){return new(e||r)},this.\u0275prov=t.jDH({token:r,factory:r.\u0275fac}))}return l(),r})();var A=n(99388),f=n(22131),D=n(59554),Q=n(68152),P=n(68534);let _=(()=>{var l;
3class r{constructor(){this.actions$=(0,t.WQX)(c.En),this.SearchResource=(0,t.WQX)(Q.c),this.CardUtils=(0,t.WQX)(D.t),this.loadPremiumCards$=(0,c.EH)(()=>this.actions$.pipe((0,c.gp)(d.zc.searchParametersUpdatedAfterSuccessfulSubmit),(0,v.n)(({params:s})=>(0,A.of)(f.o.loadPremiumCardsV3({params:s}))))),this.loadPremiumCardsV3$=(0,c.EH)(()=>this.actions$.pipe((0,c.gp)(f.o.loadPremiumCardsV3),(0,v.n)(({params:s})=>function G(l){return!!l.locations&&l.locations.some(r=>!(!r||"object"!=typeof r||"number"!=typeof r.type||r.type!==P.CARD_TYPE_DISTRICT&&r.type!==P.CARD_TYPE_ZIP_CODE&&r.type!==P.CARD_TYPE_STREET))}(s)?(0,y.H)(this.SearchResource.getPremiumListings((0,$.l)({...s}))).pipe((0,p.T)(e=>f.o.premiumCardsV3LoadedSuccess({premiumCardsV3:this.CardUtils.getCardV3Objects(e.cards)}))):(0,A.of)(f.o.premiumCardsV3LoadedSuccess({premiumCardsV3:[]})))))}static#t=l=()=>(this.\u0275fac=function(e){return new(e||r)},this.\u0275prov=t.jDH({token:r,factory:r.\u0275fac}))}return l(),r})();var ct=n(40635),lt=n(40951),x=n.n(lt),T=n(83756),O=n(15768),K=n(22882);let U=(()=>{var l;class r{constructor(){this.actions$=(0,t.WQX)(c.En),this.SearchUrl=(0,t.WQX)(K.X),this.store=(0,t.WQX)(g.il),this.window=(0,t.WQX)(O.t),this.submitReload$=(0,c.EH)(()=>this.actions$.pipe((0,c.gp)(f.o.submitSearchForm),(0,ct.YQ)(()=>this.store.select(m.EG.selectParams)),(0,T.M)(([{params:s},e])=>{const o=this.window.page??"";switch(o){case"index":case"business-index":this.window.location.assign(this.SearchUrl.getLink(s));break;default:this.redirectIfCardTypeChanged(e,s,o)}})),{dispatch:!1})}redirectIfCardTypeChanged(s,e,o){"guard-create"===o||"guard-edit"===o||!x()(s.cardType)&&!x()(e.cardType)&&e.cardType!==s.cardType&&this.window.location.assign("search-map"===o?this.SearchUrl.getMapLink(e):this.SearchUrl.getLink(e))}static#t=l=()=>(this.\u0275fac=function(e){return new(e||r)},this.\u0275prov=t.jDH({token:r,factory:r.\u0275fac}))}return l(),r})();var Y=n(75231),z=n(34670),Z=n(2320);let dt=(()=>{var l;class r{constructor(){this.actions$=(0,t.WQX)(c.En),this.SearchService=(0,t.WQX)(R),this.CardUtils=(0,t.WQX)(D.t),this.LoggerService=(0,t.WQX)(Z.g),this.window=(0,t.WQX)(O.t),this.submit$=(0,c.EH)(()=>this.actions$.pipe((0,c.gp)(f.o.submitSearchForm),(0,T.M)(()=>this.window.scrollTo(0,0)),(0,v.n)(({params:s})=>(0,y.H)(this.SearchService.run(s)).pipe((0,p.T)(e=>this.isCoordinates(e)?f.o.newCoordinatesFetched({coordinates:e}):f.o.newCardsFetched({cards:this.CardUtils.getCardV3Objects(e.cards),secondaryCards:this.CardUtils.getCardV3Objects(e.secondaryCards)})),(0,Y.Z)(e=>(0,z.x)([e,d.zc.searchParametersUpdatedAfterSuccessfulSubmit({params:s})])),(0,u.W)(e=>(0,A.of)(f.o.cardsOrCoordinatesFetchError()).pipe((0,T.M)(()=>{this.LoggerService.error(e)})))))))}isCoordinates(s){return!s.hasOwnProperty("found")}static#t=l=()=>(this.\u0275fac=function(e){return new(e||r)},this.\u0275prov=t.jDH({token:r,factory:r.\u0275fac}))}return l(),r})();var b=n(51048),W=n(76014),J=n(92346),ht=n(12131);let ut=(()=>{var l;class r{constructor(){this.actions$=(0,t.WQX)(c.En),this.history=(0,t.WQX)(J.x),this.location=(0,t.WQX)(ht.A),this.firstSeoSearchParameters$=(0,c.EH)(()=>this.actions$.pipe((0,c.gp)(d.zc.searchParamsUpdated),(0,W.s)(1),(0,T.M)(({params:s})=>{this.locationsOnInit=(s.locations||[]).map(e=>e.id).filter(e=>!!e),this.cardSubTypesOnInit=this.getCardSubTypes(s),this.roomCountOnInit=s.roomCount??[]})),{dispatch:!1}),this.seoParametersChanged$=(0,c.EH)(()=>this.actions$.pipe((0,c.gp)(f.o.submitSearchForm,f.o.submitLegacySearchForm),(0,v.n)(({params:s})=>(0,A.of)(d.zc.seoParametersChanged({changed:this.seoParamsHaveChanged(s)}))),(0,T.M)(({changed:s})=>{if(s){const e=new URL(this.location.href),o=e.pathname.split("/");e.pathname=`/${o[1]}`,this.history.replaceState(this.history.state,"",e)}}))),this.locationsOnInit=[],this.cardSubTypesOnInit=[],this.roomCountOnInit=[]}seoParamsHaveChanged(s){const e=(s.locations||[]).map(h=>h.id).filter(Boolean),o=this.getCardSubTypes(s),i=s.roomCount??[];return this.hasSearchParametersChanged(this.locationsOnInit,e)||this.hasSearchParametersChanged(this.cardSubTypesOnInit,o)||this.hasSearchParametersChanged(this.roomCountOnInit,i)}getCardSubTypes(s){let e=[];for(const o of["buildingType","vacationHomeType","lotType","parkingType","businessType","farmType"])s.hasOwnProperty(o)&&(e=[...e,...s[o]]);return e}hasSearchParametersChanged(s,e){return s.length!==e.length||s.some(o=>!e.includes(o))}static#t=l=()=>(this.\u0275fac=function(e){return new(e||r)},this.\u0275prov=t.jDH({token:r,factory:r.\u0275fac}))}return l(),r})();var w=n(11420),k=n(62265),q=n(10127),tt=n(35507),I=n.n(tt),et=n(88425),st=n.n(et),j=n(28720),nt=n.n(j),ot=n(99716);const F="otAsunnot:search:parameters:store";q.module(F,[ot.A]).service("ngrxStoreService",(0,k.f$)(g.il)).run(["ngrxStoreService","searchParams",(l,r)=>{l.dispatch(d.zc.searchParamsUpdated({params:I()(r.getParams())})),r.onChange(st()(()=>{l.dispatch(d.zc.searchParamsUpdated({params:I()(r.getParams())}))},200)),l.select(m.EG.selectParams).subscribe(a=>{nt()(a,r.getParams())||r.setParams(I()(a))})}]);const rt=F;var V=n(24684);const R=new t.nKC("SearchServiceLazy"),B={provide:R,useFactory:l=>({run:r=>l.get("$injector").get("Search").run(r)}),deps:[t.zZn]};let at=(()=>{var l;class r{static#t=l=()=>(this.\u0275fac=function(e){return new(e||r)},this.\u0275mod=t.$C({type:r}),this.\u0275inj=t.G2t({providers:[{provide:O.t,useValue:window},B,(0,g.vQ)(b.j),(0,g.vQ)(m.EG),(0,c.SI)(U,dt,H,_,ut)],imports:[V.tq]}))}return l(),r})();const X=[w.A,rt,...V.m4]},51048(L,E,n){"use strict";n.d(E,{j:()=>y});var t=n(68754),c=n(22131);const y=(0,t.VG)({name:"Search",reducer:(0,t.vy)({cards:null,secondaryCards:null,coordinates:null,cardLoadError:!1,premiumCardsV3:null},(0,t.on)(c.o.newCardsFetched,(p,{cards:u,secondaryCards:S})=>({...p,cards:u,secondaryCards:S})),(0,t.on)(c.o.newCoordinatesFetched,(p,{coordinates:u})=>({...p,coordinates:u})),(0,t.on)(c.o.submitSearchForm,p=>({...p,cardLoadError:!1,premiumCardsV3:null})),(0,t.on)(c.o.cardsOrCoordinatesFetchError,p=>({...p,cardLoadError:!0})),(0,t.on)(c.o.premiumCardsV3LoadedSuccess,(p,{premiumCardsV3:u})=>({...p,premiumCardsV3:u})))})},40951(L){L.exports=function E(n){return null==n}}}]);

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.