1import{a as Lt}from"./chunk-7JSZG772.js";import{a as Ot}from"./chunk-3JCGK5TX.js";import{$ as j,Ad as $t,C as k,F as A,Gb as nt,Ha as H,Hc as Mt,I as F,Ia as G,Ib as ot,Ic as yt,Jb as at,Jc as S,K as c,Kb as rt,Lb as st,N as p,Nb as ct,O as R,Ob as lt,P as V,Pa as K,Q as b,Qa as X,Sc as Pt,Tb as mt,Ub as pt,Vb as w,W as d,X as l,Xb as dt,Y as s,Yb as ut,Z as P,_ as D,_c as $,aa as v,ba as O,bb as J,bd as vt,ca as f,cb as W,da as L,db as Y,ea as N,eb as tt,ed as It,fa as E,fb as et,ga as z,ja as m,jb as it,ka as q,kc as gt,la as I,lc as ht,ma as B,n as T,oa as Q,oc as ft,od as wt,pc as _t,qc as xt,qd as St,rb as C,v as U,va as Z,vc as Ct,x as _,xc as bt,y as x,zb as M}from"./chunk-U6C5R4U4.js";var kt=["autoCompleteInput"],At=()=>[30];function Ft(a,n){if(a&1){let o=v();l(0,"mat-option",12),O("click",function(){let e=_(o).$implicit,t=f();return x(t.setItemToSearch(e))})("onSelectionChange",function(){let e=_(o).$implicit,t=f();return x(t.setItemToSearch(e))}),m(1),s()}if(a&2){let o=n.$implicit;d("value",o.colony_name+" "+o.municipaly_name+" "+o.state_name+" - "+o.postal_code),c(),Q(" ",o.colony_name," ",o.municipaly_name," ",o.state_name," - ",o.postal_code," ")}}function Rt(a,n){if(a&1&&(l(0,"div",22),P(1,"img",23),s()),a&2){let o=f().$implicit;c(),d("src",o.image,F)}}function Vt(a,n){if(a&1&&(l(0,"div",16)(1,"mat-icon",17),m(2,"public"),s(),m(3),s()),a&2){let o=f().$implicit;c(3),I(" \xA0 ",o.website," ")}}function Dt(a,n){if(a&1){let o=v();D(0),l(1,"mat-card",13),O("click",function(){let e=_(o).$implicit,t=f();return x(t.getDistanceFromServicePoint(e.location.latitude,e.location.longitude))}),b(2,Rt,2,1,"div",14),l(3,"h3",15),m(4),s(),l(5,"p"),m(6),s(),l(7,"div",16)(8,"mat-icon",17),m(9,"phone"),s(),m(10),s(),l(11,"div",16)(12,"mat-icon",17),m(13,"email"),s(),m(14),s(),b(15,Vt,4,1,"div",18),l(16,"div",19)(17,"div",20)(18,"a",21)(19,"mat-icon"),m(20,"import_contacts"),s(),m(21," \xA0 Ver Oficina "),s()()()(),j()}if(a&2){let o=n.$implicit,i=f();c(2),d("ngIf",o.image),c(2),q(o.officeName),c(2),B("",o.name," ",o.lastName),c(4),I(" \xA0 ",o.phone," "),c(4),I(" \xA0 ",o.email," "),c(),d("ngIf",o.website),c(3),d("routerLink","/office/"+i.buildOfficeUrl(o.officeName,o.officeId))}}var Nt=(()=>{let n=class n{constructor(i,e,t,r,g,u,h,y,Tt){this._platformId=i,this._document=e,this._api=t,this._loader=r,this._qrService=g,this._share=u,this._activatedRouter=h,this._router=y,this._meta=Tt,this.control=new st,this.items={state:"",municipality:"",colony:""},this.list=[],this.visibleList=[],this.try=0}static buildUrlItem(i,e){if(e){let t=i;return t=t.replace(/[^a-zA-Z0-9_ ]/g," "),t=t[0].toUpperCase()+t.slice(1),t}else{let t=i;return t=M.removeDiacritics(t),t=t.replace(/[^a-zA-Z0-9_ ]/g,""),t=t.replace(/ /g,"-"),t=t.toLowerCase(),t=t.replace(/--/g,"-"),t}}ngOnInit(){this.items={state:this._activatedRouter.snapshot.params.state,municipality:this._activatedRouter.snapshot.params.municipality,colony:this._activatedRouter.snapshot.params.colony};let i=`https://www.rentaoventa.com/${this.items.state}/${this.items.municipality}/${this.items.colony}`;this._api.filterUrl(i).subscribe(e=>{e&&e.success&&(this.mainLocation=e.url,this.requestOffices(Number(e.url.latitude),Number(e.url.longitude),5e3))}),this.initSearchBar()}requestOffices(i,e,t,r){let g=Number(this._activatedRouter.snapshot.params.page)||1;this._api.queryOfficeAndUsers({distance:t||5e3,role:Lt.ADMINISTRATOR,location:{latitude:i,longitude:e}}).subscribe(u=>{if(u.code===it.OK)if(u.items&&u.items.length>0)this.list=u.items||[],this.paginator.pageIndex=0,this.try=0,this.changePage({pageIndex:g-1||0});else{let h;this.try++;let y=!1;switch(this.try){case 1:h=1e4;break;case 2:h=2e4;break;case 3:h=5e4;break;default:h=1e5,y=!0;break}r||this.requestOffices(i,e,h,y)}})}initSearchBar(){this.control.valueChanges.pipe(T(400)).subscribe(i=>{if(i.length<=3){this.filteredOptions=[];return}let e=i;e=M.removeDiacritics(e),e=e.replace(/\s/g,""),this._loader.setProgress(!1),this._api.userLocation(e).subscribe(t=>{this._loader.setProgress(!1),this.filteredOptions=t.locations&&t.locations.length>0?t.locations:[]}),this._loader.setProgress(!1)})}getDistanceFromServicePoint(i,e){console.log(M.distanceFrom(i,e,Number(this.mainLocation.latitude),Number(this.mainLocation.longitude)))}setItemToSearch(i){this.itemLocation=i}search(){if(this.itemLocation){this.items={state:n.buildUrlItem(this.itemLocation.state_name),municipality:n.buildUrlItem(this.itemLocation.municipaly_name),colony:n.buildUrlItem(this.itemLocation.colony_name)};let i=`https://firgum.rentaoventa.com/${this.items.state}/${this.items.municipality}/${this.items.colony}`;this._api.filterUrl(i).subscribe(e=>{e&&e.success&&(this.mainLocation=e.url,this.requestOffices(Number(e.url.latitude),Number(e.url.longitude),5e3))})}}buildOfficeUrl(i,e){let t=i;t=M.removeDiacritics(t),t=t.replace(/[^a-zA-Z0-9_ ]/g,""),t=t.replace(/ /g,"-"),t=t.toLowerCase();let r=`${t}-${e}`;return r=r.replace(/--/g,"-"),r}changePage(i){i.pageIndex!==0&&X(this._platformId)&&this._document.getElementsByClassName("agents-container")[0].scrollTo(0,0),setTimeout(()=>{this._router.navigate([`/oficina-asesores-inmobiliarios/${this.items.state}/${this.items.municipality}/${this.items.colony}/${i.pageIndex+1}`])}),this.autoCompleteInput.closePanel();let e=Math.floor(this.list.length/30),t=`/oficina-asesores-inmobiliarios/${this.items.state}/${this.items.municipality}/${this.items.colony}/`;if(e!==0)if(this._meta.setPagination(C.NONE),i.pageIndex===0)t=t.concat("2"),this._meta.setPagination(C.NEXT,{nextUrl:t});else if(i.pageIndex===e)t=t.concat(i.pageIndex.toString()),this._meta.setPagination(C.PREV,{prevUrl:t});else{let r=t.concat(i.pageIndex.toString()),g=t.concat((i.pageIndex+2).toString());this._meta.setPagination(C.BOTH,{nextUrl:g,prevUrl:r})}else this._meta.setPagination(C.NONE);this._state=`${n.buildUrlItem(this.items.state,!0)}.`,this.items.municipality&&(this._state=`${n.buildUrlItem(this.items.municipality,!0)}, ${n.buildUrlItem(this.items.state,!0)}.`,this.items.colony&&(this._state=`${n.buildUrlItem(this.items.colony,!0)}, ${n.buildUrlItem(this.items.municipality,!0)}, ${n.buildUrlItem(this.items.state,!0)}.`)),this._meta.setAllMetas({title:`Directorio de Oficinas Inmobiliarias en ${this._state}`,description:`Encuentra en una oficina a expertos que te puedan ayudar a realizar cualquier operaci\xF3n inmobiliaria en ${this._state}`,url:`${w.url}oficina-asesores-inmobiliarios/${this.items.state}/${this.items.municipality}/${this.items.colony}/${i.pageIndex+1}`,canonical:!0,robots:{noIndex:!1,noFollow:!1}}),this.paginator.pageIndex=i.pageIndex,this.visibleList=this.list.slice(i.pageIndex*30,e===i.pageIndex?this.list.length:(i.pageIndex+1)*30)}};n.\u0275fac=function(e){return new(e||n)(p(A),p(k),p(ut),p(dt),p(wt),p(St),p(J),p(Y),p(Ot))},n.\u0275cmp=R({type:n,selectors:[["app-list"]],viewQuery:function(e,t){if(e&1&&(L(kt,7,S),L($,7)),e&2){let r;N(r=E())&&(t.autoCompleteInput=r.first),N(r=E())&&(t.paginator=r.first)}},standalone:!1,decls:18,vars:8,consts:[["autoCompleteInput",""],["auto","matAutocomplete"],["id","list"],[1,"header-bar"],[1,"search-bar"],["appearance","outline"],["type","text","matInput","",3,"matAutocomplete","formControl"],[3,"value","click","onSelectionChange",4,"ngFor","ngForOf"],["matSuffix","","mat-raised-button","",1,"search-button",3,"click"],[1,"agents-container"],[4,"ngFor","ngForOf"],[3,"page","hidePageSize","pageSizeOptions","length"],[3,"click","onSelectionChange","value"],[1,"agent",3,"click"],["style","position: absolute; width: 60px; height: 60px; right: 5px; top: 5px; display: flex; align-items: center;",4,"ngIf"],[1,"accent",2,"width","calc(100% - 48px)"],[2,"display","flex","align-items","center"],[1,"accent"],["style","display: flex; align-items: center",4,"ngIf"],[1,"actions"],[1,"actions__to-rigth"],["mat-raised-button","","target","_self",1,"directory",3,"routerLink"],[2,"position","absolute","width","60px","height","60px","right","5px","top","5px","display","flex","align-items","center"],["alt","logo","appLazyImg","lazy",2,"width","100%",3,"src"]],template:function(e,t){if(e&1){let r=v();P(0,"router-outlet")(1,"app-new-nav-bar"),l(2,"div",2)(3,"div",3)(4,"form",4)(5,"mat-form-field",5)(6,"mat-label"),m(7,"Escribe una palabra"),s(),P(8,"input",6,0),l(10,"mat-autocomplete",null,1),b(12,Ft,2,5,"mat-option",7),s(),l(13,"button",8),O("click",function(){return _(r),x(t.search())}),m(14," BUSCAR "),s()()()(),l(15,"div",9),b(16,Dt,22,8,"ng-container",10),s(),l(17,"mat-paginator",11),O("page",function(u){return _(r),x(t.changePage(u))}),s()()}if(e&2){let r=z(11);c(8),d("matAutocomplete",r)("formControl",t.control),c(4),d("ngForOf",t.filteredOptions),c(4),d("ngForOf",t.visibleList),
1c(),d("hidePageSize",!0)("pageSizeOptions",Z(7,At))("length",t.list.length)}},dependencies:[H,G,It,Pt,yt,Mt,S,bt,gt,xt,_t,ht,ft,Ct,$,W,tt,ct,nt,ot,at,rt,lt],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}#list[_ngcontent-%COMP%]{width:100vw;height:calc(100% - 100px)}#list[_ngcontent-%COMP%] .accent[_ngcontent-%COMP%]{color:#4f6de7}#list[_ngcontent-%COMP%] .directory[_ngcontent-%COMP%]{background-color:#4f6de7;color:#fff;margin:4px}#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%]{width:100%;display:flex;height:100px;align-items:center;background-color:#3c6bfc;padding:0 16px}#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%]{width:100%;margin:16px 0;display:flex;align-items:baseline}#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-suffix{top:0}#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%] .mat-form-field-appearance-outline .mat-form-field-outline{background-color:#fff;border-radius:8px}#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:50%;margin:0 16px}@media screen and (max-width:900px){#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:70%}}@media screen and (max-width:600px){#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:90%}}#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%] .search-button[_ngcontent-%COMP%]{height:69px;width:100px;margin-right:-12px;border-radius:0 8px 8px 0;font-weight:700;background-color:#4f6de7;color:#fff;box-shadow:none}#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%] .location-button[_ngcontent-%COMP%]{color:#fff;background-color:#4f6de7;font-weight:700;height:69.5px}@media screen and (max-width:600px){#list[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] .search-bar[_ngcontent-%COMP%] .location-button[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:none}}#list[_ngcontent-%COMP%] .agents-container[_ngcontent-%COMP%]{overflow-y:auto;padding:24px 5%;display:grid;grid-template-columns:repeat(3,calc(33.3333333333% - 9px));grid-gap:12px;height:calc(100% - 156px)}#list[_ngcontent-%COMP%] .agents-container[_ngcontent-%COMP%] .agent[_ngcontent-%COMP%]{height:min-content;position:relative}#list[_ngcontent-%COMP%] .agents-container[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}@media screen and (max-width:900px){#list[_ngcontent-%COMP%] .agents-container[_ngcontent-%COMP%]{grid-template-columns:repeat(2,calc(50% - 9px))}}@media screen and (max-width:600px){#list[_ngcontent-%COMP%] .agents-container[_ngcontent-%COMP%]{grid-template-columns:repeat(1,calc(100% - 9px))}}"]});let a=n;return a})();var jt={title:`Directorio de Oficinas Inmobiliarias Profesionales M\xE9xico | ${w.appName}`,description:"Encuentra expertos que te puedan ayudar a realizar cualquier operaci\xF3n inmobiliaria.",url:""},Et=[{path:"",component:Nt,data:{meta:jt}}];var $e=(()=>{let n=class n{};n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=V({type:n}),n.\u0275inj=U({imports:[K,$t,vt,et.forChild(Et),mt,pt]});let a=n;return a})();export{$e as ListModule};
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.