PageSourceSearch

https://elitnoe.ru/_nuxt/DQdhizJX.js

js elitnoe.ru collected 2026-09-24 22:59:21 UTC 8,047 bytes, 1 lines download raw bytes

1import{H as le,r as p,I as ie,d as z,M as H,s as K,b6 as re,p as q,ao as S,au as M,av as ne,ar as ce,c as ue,o as P,a as C,e as O,f as Y,g as E,t as B,j as e,w as U,i as pe,h as fe,b7 as de,aw as ve,W as me,a6 as ge,ae as ye,y as _e,as as be,a3 as he,P as xe,aq as A,at as je,ag as we}from"./eUuGUOoT.js";import{u as Te,a as ke}from"./CFDs1eZw.js";import{u as Se}from"./BFoShfwP.js";import{S as L}from"./C_POfyZ4.js";import{b as W}from"./BANd2Yow.js";import{_ as qe}from"./wyh0Q0p7.js";import{_ as Pe}from"./DCWUfD_5.js";import"./C04dpLaR.js";import"./D5mmIHJX.js";import"./DXd11RPQ.js";import"./BOUqG99x.js";import"./6MIxXekv.js";import"./BSM-C0hF.js";import"./CiZc3jrg.js";import"./CPQDuYYC.js";import"./BD2nz2zb.js";import"./CxGma9ZB.js";import"./CrU7rsUa.js";import"./Dx38ULt9.js";import"./Bb3sl5CE.js";import"./C1qrcO9i.js";import"./AKPGbDaE.js";import"./DkCLXQi4.js";import"./Bj--6Vwl.js";import"./Csz6yr1H.js";import"./DnfZh1HJ.js";import"./DPx3TFth.js";import"./Cu9VhfcD.js";import"./DeCP0-Ue.js";import"./MO0Q7MZu.js";import"./B4owFNKT.js";import"./yk2p3wx6.js";import"./CP6kKpye.js";import"./D3OAjtku.js";const Oe=le("favoritesObjects",()=>{const h=p([]),o=p(),f=p(),g=p(!1),j=p(!1),m=p(1),i=p(0),y=p(9),_=p(1),b=ie(),s=p(null),d=p(!1);async function n(r,x={},v=!1,u=!1){if(typeof r>"u")return!1;g.value=!u,j.value=v,!v&&!u&&(h.value=[]);try{const c=await b(`/api/profile/favorites/${r}`,{method:"GET",query:{...x,update:u?"1":""}});u?h.value.push(...c.elements):h.value=v?h.value.concat(c.elements):c.elements,m.value=c.currentPage?c.currentPage:1,_.value=c.totalPages?c.totalPages:1,i.value=c.total||0}catch(c){console.error(`Error fetching favorites ${r}: `,c);const T=c instanceof Error?c.message:"Unknown error";throw s.value=T,_.value=1,new Error(T)}finally{g.value=!1,j.value=!1,d.value=!1}}async function a(r,x,v={}){d.value=!0,h.value.splice(r,1),m.value<_.value?await n(x,v,!1,!0):d.value=!1}return{objects:h,objectsType:o,dealType:f,isLoading:g,isLoadingMore:j,currentPage:m,totalPages:_,objectsCount:i,objectsPerPage:y,isUpdating:d,fetchObjects:n,removeItem:a}}),$e={class:"favorites-page-hidden container"},Ie={class:"favorites-page-hidden__header"},Fe={class:"favorites-page-hidden__title h2"},Ce={class:"favorites-page-hidden__text"},Be=z({__name:"FavoritesPageHidden",async setup(h){let o,f;const{loggedIn:g}=H(),{favorites:j,favoritesCount:m}=K(re()),i=q(()=>{let n=null,a=null,r=null;return Object.entries(j.value).forEach(([x,v])=>{if(v)if(x==="complexes"){const u=v;u.length>0&&(n=u[u.length-1])}else x==="flats"&&Object.entries(v).forEach(([u,c])=>{c.length>0&&(a=u,r=c[c.length-1])})}),{type:r?"flats":"complexes",dealType:a,id:r||n}}),y=p({flat:[],complex:[]});if(i.value.id){let n="",a="";if(i.value.type==="complexes"?n="complexes":i.value.dealType&&(n="flats",a=i.value.dealType),n){const{data:r}=([o,f]=S(()=>M(`/api/${n}/ids`,{query:{ids:`[${i.value.id}]`,dealType:a},lazy:!0},"$Va392Cdej2")),o=await o,f(),o);n==="complexes"?y.value.complex=r.value:y.value.flat=r.value}}const _=q(()=>{let n="Вы пока не добавляли избранное",a="Нажмите на ♡, чтобы добавить предложение в избранное";if(!g.value&&m.value>0){const r=ne(m.value,["объявление","объявления","объявлений"]);n=`У вас ${m.value} ${r} в избранном`,a=`Войдите, чтобы посмотреть ${m.value>1?"их":"его"}`}return{title:n,text:a}}),{buildListingUrlSafe:b}=ce(),s=b("flats","sales");function d(){g.value||(de().popupsState.login.show=!0)}return(n,a)=>{const r=fe;return P(),ue("div",$e,[C("div",Ie,[C("h2",Fe,B(e(_).title),1),C("p",Ce,B(e(_).text),1),E(r,{size:"l",class:"favorites-page-hidden__button",href:e(g)?e(s):void 0,onClick:d},{default:U(()=>[pe(B(e(g)?"Начать поиск":"Войти"),1)]),_:1},8,["href"])]),e(m)&&e(i).id?(P(),O(W,{key:0,"is-complexes":e(i).type==="complexes","residential-complexes":e(y).complex,"is-flats":e(i).type==="flats",flats:e(y).flat,class:"favorites-page-hidden__list"},null,8,["is-complexes","residential-complexes","is-flats","flats"])):Y("",!0)])}}}),G="Избранное",Q="ваше избранное",mt=z({__name:"favorites",async setup(h){let o,f;ve({title:G,description:Q,ogTitle:G,ogDescription(){return Q},ogType(){return"website"}});const{loggedIn:g,user:j}=H(),m=me([{title:"Избранное",url:""}]),i=ge(),y=ye(),{data:_}=([o,f]=S(()=>M("/api/profile/favorites/tabs","$db5xs1PlK0")),o=await o,f(),o),b=q(()=>{let t=[];return _.value&&(t=_.value.map(l=>({id:l.value,title:l.label,params:{objectsType:l.objectType,dealType:l.value}}))),t}),s=q(()=>{if(!b.value)return null;let t=b.value[0];return i.query.list&&(t=b.value.find(l=>l.id===i.query.list)||t),t}),d=Oe(),{objects:n,objectsType:a,dealType:r,objectsCount:x,isLoading:v,isLoadingMore:u,currentPage:c,totalPages:T,objectsPerPage:N,isUpdating:J}=K(d);a.value=s.value?.params?.objectsType,r.value=s.value?.params?.dealType,[o,f]=S(()=>A("favorite",()=>d.fetchObjects(s.value?.id,{...i.query},!1).then(()=>!0))),await o,f();function X(t){const l={...i.query,list:t.id};delete l.list,delete l.sort,t.params?.objectsType&&(a.value=t.params?.objectsType,r.value=t.params?.dealType),I.value=[],d.fetchObjects(t.id,l,!1).then(()=>{const w={...i.query,list:t.id===b.value[0]?.id?"":t.id,sort:""};y.push({query:w})})}const $=p();let V;_e(()=>{const{y:t}=be(window,{behavior:"smooth"});V=t});const R=q(()=>{let t=[{label:"по умолчанию",value:"default"}];return s.value?.id==="sales"?t=L.flats.sales:s.value?.id==="rents"?t=L.flats.rents:s.value?.id==="complexes"&&(t=L.complexes),t}),D={label:"по умолчанию",value:"default"},k=p([D]);k.value=Te(D,R.value);const Z=ke();function ee(){const t=k.value[0],l=Z(t);d.fetchObjects(s.value?.id,l).then(()=>{y.push({query:l})})}function te(t,l=!1,w=!1){const F={...i.query,page:t.toString()};t===1&&delete F.page,d.fetchObjects(s.value?.id,F,l,w).then(()=>{l||($.value?.titleBlock&&!w&&(V.value=$.value?.titleBlock.offsetTop),y.push({query:F}))})}he("isAvailableChangeFavorite",!J.value);function se(t,l){!t&&s.value&&d.removeItem(l,s.value.id,i.query)}const{fetchViewed:ae}=Se(),{data:I}=([o,f]=S(async()=>A(`viewed_${s.value?.id}`,async()=>{let t;return s.value?.id!=="complexes"&&(t=s.value?.id),await ae(a.value,t)},{lazy:!0,watch:[s]})),o=await o,f(),o),{data:oe}=([o,f]=S(()=>M("/api/site/faq/",{query:{objectType:"favorites"}},"$y4g6uf0KYn")),o=await o,f(),o);return(t,l)=>e(g)&&e(j)&&e(s)?(P(),O(qe,{key:0,ref_key:"listingPage",ref:$,"current-sort":e(k),"onUpdate:currentSort":l[0]||(l[0]=w=>xe(k)?k.value=w:null),title:"Избранное","is-catalog":!1,"object-type":e(s)?.params.objectsType,"deal-type":e(s)?.params.dealType||void 0,breadcrumbs:e(m),"filter-links":e(b)||[],"show-filter-links-as-tabs":!0,"filter-links-is-links":!1,"active-filter-link-id":e(s)?.id,"objects-count":e(x),"sorting-options":e(R),faq:e(oe),"viewed-complexes":e(a)==="complexes"?e(I):[],"viewed-flats":e(a)==="flats"?e(I):[],onSelectFilterLink:X,onSort:ee},{"objects-list":U(()=>[E(W,{"residential-complexes":e(a)==="complexes"?e(n):[],"is-complexes":e(a)==="complexes",flats:e(a)==="flats"?e(n):[],"is-flats":e(a)==="flats","is-cols":t.$device.isMobile||e(a)==="complexes","is-loading":e(v),"is-loading-more":e(u),"loaders-count":e(u)?Math.floor(e(N)/2):e(N),onToggledFavorite:se},je({_:2},[t.$device.isMobileOrTablet?{name:"banner1",fn:U(()=>[E(we,{position:"banner-sidebar","is-list-item":""})]),key:"0"}:void 0]),1032,["residential-complexes","is-complexes","flats","is-flats","is-cols","is-loading","is-loading-more","loaders-count"]),e(T)>1?(P(),O(Pe,{key:0,page:e(c),"total-pages":e(T),"is-loading":e(v)||e(u),class:"listing-page__pagination",onLoadNewPage:te},null,8,["page","total-pages","is-loading"])):Y("",!0)]),_:1},8,["current-sort","object-type","deal-type","breadcrumbs","filter-links","active-filter-link-id","objects-count","sorting-options","faq","viewed-complexes","viewed-flats"])):(P(),O(Be,{key:1}))}});
1export{mt as default};

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.