1import{a as ee}from"./chunk-SALTVC4S.js";import"./chunk-MQENSMVN.js";import"./chunk-LW6UBSXN.js";import"./chunk-2ITU7562.js";import{a as W}from"./chunk-TQNSHKDH.js";import{a as Z}from"./chunk-Q6Z5PMGJ.js";import{a as X}from"./chunk-Y4UEUGBK.js";import{a as K}from"./chunk-UJYMJQZB.js";import{i as J}from"./chunk-IWAWM5X7.js";import{c as k}from"./chunk-YDXYDHVT.js";import"./chunk-57BBKKDM.js";import{H,I as U,T as G,a as F,b as w,c as V,k as N,qa as Q,t as B,v as j,x as Y}from"./chunk-BDBNNF5F.js";import"./chunk-BMNDREH6.js";import"./chunk-IQLQCF3X.js";import{b as $}from"./chunk-HU7SHZ2P.js";import"./chunk-WKTS323O.js";import"./chunk-G5C4E5SZ.js";import"./chunk-JFOVODTQ.js";import{f as L}from"./chunk-HHMUAAKH.js";import"./chunk-KX3MZ4HX.js";import"./chunk-CPVTU5XS.js";import"./chunk-EUZLHDMR.js";import{d as z}from"./chunk-LSHSIR26.js";import"./chunk-BTO3RYRP.js";import"./chunk-OYMZJ57R.js";import"./chunk-3W7VWIDZ.js";import{Fa as D,m as A}from"./chunk-OOUYCANI.js";import{Ca as P,Kb as g,Lb as f,Qb as a,Rb as c,Sb as y,Tb as p,Yb as R,Za as d,_ as r,_c as E,dc as h,dd as O,ea as v,fa as C,fc as l,jd as I,nb as u,ra as T,ta as x}from"./chunk-WXYLEQT5.js";import"./chunk-C6Q5SG76.js";function se(o,t){o&1&&p(0,"imobzi-breadcrumb",1)}function ae(o,t){if(o&1){let e=R();c(0,"imobzi-step-form",5),h("selectEmitter",function(n){v(e);let s=l(2);return C(s.checkSelectField(n))})("formSubmit",function(n){v(e);let s=l(2);return C(s.onFormSubmit(n))}),y()}if(o&2){let e=l(2);a("formContent",e.formContent)("buttonTitle",e.buttonTitle)("loading",e.loading())("identity",e.formIdentity)}}function le(o,t){if(o&1&&g(0,ae,1,4,"imobzi-step-form",4),o&2){let e=l();f(e.formContent?0:-1)}}function me(o,t){if(o&1){let e=R();c(0,"imobzi-success-form",6),h("btnAction",function(n){v(e);let s=l();return C(s.onBtnChanged(n))}),y()}if(o&2){let e=l();a("msgSuccessTitle",e.msgSuccessTitle)("msgSuccessSubtitle",e.msgSuccessSubtitle)}}var b=class o{titlePage=r(z);formService=r(B);propertyService=r(W);router=r(L);cdr=r(I);_fildsService=r(J);platformId=r(P);propertyTypesSearch=this._fildsService.getPropertyTypesResult();title="Pe\xE7a seu im\xF3vel";subtitle="Est\xE1 com dificuldade ou sem tempo? Preencha o formul\xE1rio abaixo e iremos buscar im\xF3veis de acordo com o seu perfil.";privacyService;privacyData;isSmallScreen=O(void 0);displaySuccess=T(!1);loading=T(!1);msgSuccessTitle='<h3 class="display-h3 color-title text-center">A sua mensagem foi <br> enviada com sucesso!<h3>';msgSuccessSubtitle='<h2 class="color-subtitle text-center normal">Um de nossos corretores <br> entrar\xE1 em contato em breve.</h2>';messageRequired="\xC9 necess\xE1rio preencher o campo!";buttonTitle="Encontre meu im\xF3vel";formContent;formData;PROPERTY_TYPES=[];STEP_ITEMS=[];DATA_STEP_1;availabilities=j;formIdentity="peca_seu_imovel";constructor(){let t=r(X);this.privacyService=t,x(()=>{let e=Object.keys(this.propertyTypesSearch());this.availabilities=this.availabilities.filter(i=>i.type==="buy_or_rent"?e.includes("buy")&&e.includes("rent"):e.includes(i.type)),this.formContent=this.stepItens()})}ngOnInit(){this.groupTypesByFinality(),this.titlePage.setTitle(`${this.title} - ${this.titlePage.getTitle()}`)}groupTypesByFinality(){this.propertyService.getPropertyTypes().subscribe(t=>{let e=t.reduce((i,n)=>{n.finality=G(n.finality);let s=i.findIndex(S=>S.finality===n.finality);return s!==-1?i[s].types.push(n.type):i.push({finality:n.finality,types:[n.type]}),i},[]);this.PROPERTY_TYPES.push(...e.sort(i=>i.finality==="Residencial"?-1:1)),this.cdr.detectChanges()})}checkSelectField({field:t,value:e,masterForm:i}){if(t==="finality"&&(i.addControl(t,new N(t)),i.get(t).setValue(e)),t==="interest"){let n=Array.from(document.querySelectorAll(".start")).concat(Array.from(document.querySelectorAll(".end"))).concat(Array.from(document.querySelectorAll(".vacation_rental_guests"))),S=document.querySelector("form")?.querySelector(".bedroom"),re=e==="Alugar por Temporada"?["gd-xs-1-12","gd-sm-1-12","gd-md-8-11","gd-lg-8-11","gd-xl-8-11"]:["gd-xs-1-12","gd-sm-1-12","gd-md-10-11","gd-lg-10-11","gd-xl-10-11"],ne=/^gd-(xs|sm|md|lg|xl)-\d+-\d+$/;if(e==="Alugar por Temporada"?(this.DATA_STEP_1.max_value.placeholder="Valor m\xE1ximo da di\xE1ria",n.forEac
1h(m=>{m.parentElement?.classList.remove("disabled")})):(this.DATA_STEP_1.max_value.placeholder="Valor m\xE1ximo",n.forEach(m=>{let _=m.parentElement;_&&!_.classList.contains("disabled")&&_.classList.add("disabled")})),S){let m=S.parentElement;m&&(Array.from(m.classList).forEach(M=>{ne.test(M)&&m.classList.remove(M)}),m.classList.add(...re))}}}stepItens(){return this.STEP_ITEMS=[{label:"1",data:this.dataStep1()}]}dataStep1(){let t=this.availabilities[0]?.name==="Alugar por Temporada";return this.DATA_STEP_1={name:{type:"text",placeholder:"Nome",validations:{required:!0,minLength:2},class:"gd-xs-1-12 gd-sm-1-12 gd-md-2-5 gd-lg-2-5 gd-xl-2-5",errors:{required:this.messageRequired,minlength:"Digite no minimo de 2 caracteres"}},phone:{type:"phone",mask:"(00) 0000-0000||(00) 0 0000-0000",placeholder:"Telefone",validations:{required:!0,pattern:Y.phone},class:"gd-xs-1-12 gd-sm-1-12 gd-md-6-8 gd-lg-6-8 gd-xl-6-8",errors:{required:this.messageRequired,pattern:"Por favor adicione um Telefone valido!"}},email:{type:"email",placeholder:"E-mail",validations:{required:!0,email:!0},class:"gd-xs-1-12 gd-sm-1-12 gd-md-9-11 gd-lg-9-11 gd-xl-9-11",errors:{required:this.messageRequired,email:"Email invalido"}},interest:{type:"select",placeholder:"Interesse",emitSelected:!0,options:this.availabilities.length?this.availabilities:[],value:this.availabilities.length?this.availabilities[0].name:"",validations:{required:!0},class:"gd-xs-1-12 gd-sm-1-12 gd-md-2-3 gd-lg-2-3 gd-xl-2-3",errors:{required:this.messageRequired}},property_type:{type:"select",placeholder:"Tipo do Im\xF3vel",options:this.PROPERTY_TYPES,emitSelected:!0,grouped:!0,validations:{required:!0},class:"gd-xs-1-12 gd-sm-1-12 gd-md-4-6 gd-lg-4-6 gd-xl-4-6 priority",errors:{required:this.messageRequired}},max_value:{type:"text",placeholder:t?"Valor m\xE1ximo da di\xE1ria":"Valor m\xE1ximo",mask:"separator.2",validations:{required:!0},class:"gd-xs-1-12 gd-sm-1-12 gd-md-7-9 gd-lg-7-9 gd-xl-7-9",errors:{required:this.messageRequired}},vacation_rental_guests:{type:"number",placeholder:"H\xF3spedes",validations:{},class:`${t?"":"disabled"} gd-xs-1-12 gd-sm-1-12 gd-md-10-11 gd-lg-10-11 gd-xl-10-11`,errors:{}},start:{type:"calendar",placeholder:"Data de chegada",validations:{},class:`${t?"":"disabled"} gd-xs-1-12 gd-sm-1-12 gd-md-2-4 gd-lg-2-4 gd-xl-2-4`,errors:{required:"Selecione uma Data"}},end:{type:"calendar",placeholder:"Data de sa\xEDda",validations:{},class:`${t?"":"disabled"} gd-xs-1-12 gd-sm-1-12 gd-md-5-7 gd-lg-5-7 gd-xl-5-7`,errors:{required:"Selecione uma Data"}},bedroom:{type:"number",placeholder:"Quartos",validations:{},class:t?"gd-xs-1-12 gd-sm-1-12 gd-md-8-11 gd-lg-8-11 gd-xl-8-11":"gd-xs-1-12 gd-sm-1-12 gd-md-10-11 gd-lg-10-11 gd-xl-10-11",errors:{}},message:{type:"textarea",placeholder:"Observa\xE7\xF5es",validations:{required:!0},class:"gd-xs-1-12 gd-sm-1-12 gd-md-2-11 gd-lg-2-11 gd-xl-2-11",errors:{required:this.messageRequired}}}}
1onBtnChanged(t){this.router.navigate(["/"])}onFormSubmit(t){Q("formulario_solicitar_imovel",this.platformId),this.loading.set(!0),this.formData=t,this.formData&&(!this.privacyService.getItem("Sent")&&this.privacyService.getItem("Imobzi")&&(this.privacyData=this.privacyService.getItem("Imobzi"),Object.keys(this.privacyData).forEach(e=>{this.formData[e]=this.privacyData[e]}),this.privacyService.setItem("Sent",!0)),this.formService.contact(this.formData).subscribe(()=>{this.loading.set(!1),this.displaySuccess.set(!0)},()=>{this.loading.set(!1),this.displaySuccess.set(!1)}))}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=u({type:o,selectors:[["imobzi-request-property-form"]],inputs:{isSmallScreen:[1,"isSmallScreen"]},decls:5,vars:4,consts:[["id","request-property",1,"container"],["category","Pe\xE7a seu im\xF3vel",1,"col-xs-12","col-sm-12","col-md-12","col-lg-12","col-xl-12"],[1,"col-xs-12","col-sm-12","col-md-12","col-lg-12","col-xl-12",3,"title","subtitle"],[1,"col-xs-12","col-sm-12","col-md-12","col-lg-12","col-xl-12",3,"msgSuccessTitle","msgSuccessSubtitle"],[1,"col-xs-12","col-sm-12","col-md-12","col-lg-12","col-xl-12",3,"formContent","buttonTitle","loading","identity"],[1,"col-xs-12","col-sm-12","col-md-12","col-lg-12","col-xl-12",3,"selectEmitter","formSubmit","formContent","buttonTitle","loading","identity"],[1,"col-xs-12","col-sm-12","col-md-12","col-lg-12","col-xl-12",3,"btnAction","msgSuccessTitle","msgSuccessSubtitle"]],template:function(e,i){e&1&&(c(0,"section",0),g(1,se,1,0,"imobzi-breadcrumb",1),p(2,"imobzi-section-title",2),g(3,le,1,1)(4,me,1,2,"imobzi-success-form",3),y()),e&2&&(d(),f(i.isSmallScreen()()?-1:1),d(),a("title",i.title)("subtitle",i.subtitle),d(),f(i.displaySuccess()?4:3))},dependencies:[ee,$,U,Z],styles:["#request-property[_ngcontent-%COMP%] imobzi-section-title[_ngcontent-%COMP%]{margin:38px 0 55px;grid-gap:0}#request-property[_ngcontent-%COMP%] imobzi-section-title[_ngcontent-%COMP%] .title{color:var(--title)}#request-property[_ngcontent-%COMP%] #breadcrumbs{margin-top:38px}#request-property[_ngcontent-%COMP%] #breadcrumbs p.h4{color:var(--subtitle)}#request-property[_ngcontent-%COMP%] #breadcrumbs .mat-icon{color:var(--subtitle)}#request-property[_ngcontent-%COMP%] .priority{z-index:1}#request-property[_ngcontent-%COMP%] .title{font-size:38px}@media(max-width:767px){#request-property[_ngcontent-%COMP%] imobzi-section-title[_ngcontent-%COMP%]{margin:32px 0 42px;grid-gap:25px}#request-property[_ngcontent-%COMP%] imobzi-section-title[_ngcontent-%COMP%] .title{width:180px;color:var(--title)}#request-property[_ngcontent-%COMP%] imobzi-section-title[_ngcontent-%COMP%] .title, #request-property[_ngcontent-%COMP%] imobzi-section-title[_ngcontent-%COMP%] .subtitle{text-align:start}#request-property[_ngcontent-%COMP%] imobzi-section-title[_ngcontent-%COMP%] .title div, #request-property[_ngcontent-%COMP%] imobzi-section-title[_ngcontent-%COMP%] .subtitle div{margin:0}#request-property[_ngcontent-%COMP%] imobzi-step-form[_ngcontent-%COMP%] form{margin-bottom:60px}}"]})};var q=class o{location=r(A);dialogRef=r(F);data=r(w);_homeService=r(K);closeIconColor=this._homeService.getIconColorByBackground();closeDialog(){this.dialogRef.close(),this.location.back()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=u({type:o,selectors:[["imobzi-request-property-dialog"]],decls:3,vars:2,consts:[[3,"onModalChanged","closeIconColor"],[1,"mat-dialog-content","request-container"],[3,"isSmallScreen"]],template:function(e,i){e&1&&(c(0,"imobzi-modal",0),h("onModalChanged",function(){return i.closeDialog()}),c(1,"section",1),p(2,"imobzi-request-property-form",2),y()()),e&2&&(a("closeIconColor",i.closeIconColor()),d(2),a("isSmallScreen",i.data.isSmallScreen))},dependencies:[b,H],styles:["imobzi-modal[_ngcontent-%COMP%]{height:100dvh}imobzi-modal[_ngcontent-%COMP%] .request-container[_ngcontent-%COMP%]{background-color:var(--background-page)}"]})};function ce(o,t){if(o&1&&p(0,"imobzi-request-property-form",0),o&2){let e=l();a("isSmallScreen",e.isSmallScreen)}}var oe=class o{dialog=r(V);breakpointsService=r(k);platformId=r(P);isSmallScreen=E(()=>this.breakpointsService.isInViewPort(["--phone-upper-boundary","--tablet-portrait-upper-boundary"])());openDialog;dialogRef;constructor(){x(()=>{D(this.platformId)&&(this.isSmallScreen()&&!this.openDialog&&this.openRequestPropertyDialog(),!this.isSmallScreen()&&this.openDialog&&this.dialogRef.close())})}ngOnInit(){D(this.platformId)&&window.scroll(0,1),this.openDialog=!1}openRequestPropertyDialog(){this.openDialog||(this.dialogRef=this.dialog.open(q,{panelClass:"custom-dialog-container",data:{open:!0,isSmallScreen:this.isSmallScreen}})),this.dialogRef.afterOpened().subscribe(()=>{this.openDialog=!0}),this.dialogRef.afterClosed().subscribe(()=>{this.openDialog=!1})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=u({type:o,selectors:[["imobzi-request-property"]],decls:1,vars:1,consts:[[3,"isSmallScreen"]],template:function(e,i){e&1&&g(0,ce,1,1,"imobzi-request-property-form",0),e&2&&f(i.isSmallScreen()?-1:0)},dependencies:[b],encapsulation:2})};export{oe as RequestPropertyComponent};
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.