PageSourceSearch

https://buil-fogwill.com/assets/TenantPropertyDetailWrapper-CE93jbe-.js

js buil-fogwill.com collected 2026-10-07 19:56:44 UTC 15,058 bytes, 15 lines download raw bytes

1import{ag as O,i as ie,b1 as oe,ae as w,af as v,r as ne,ak as D,ad as le,j as e,a0 as U,B as l,H as ce,a1 as de,O as W,bF as me,C as u,a3 as pe,a4 as xe,a5 as he,aw as _,ar as E,as as ue,bG as fe,bH as je,bI as ge,h as be,L as ye}from"./index-DYzDqWEM.js";import{u as Ne,T as k,a as $,b as we,c as ve}from"./TenantFooter-DDu9XK38.js";import{A as _e,a as ke,b as $e}from"./avatar-53fNvxZx.js";import{S as C}from"./separator-Bj5BqmNe.js";import{P as Ce,a as Pe}from"./PropertyHomeStaging-DWIH9XLa.js";import{P as Te}from"./PropertyMap-C7somyIq.js";import{B as Ie}from"./BookAppointmentDialog-c9o0vGlO.js";import{M as ze}from"./mountain-Baq5q9tt.js";import{C as Ae,T as Be}from"./trees-BwG99csI.js";import{W as Re,T as Se}from"./wind-BityYaGk.js";import{A as V}from"./arrow-left-Dms1oIqP.js";import{C as Le}from"./calendar-GGqUTgIG.js";import{S as K}from"./share-2-C-NpSi-z.js";import"./maximize-2-CfiyA4Pg.js";import"./chevron-left-ELxThf8y.js";import"./sparkles-BAyFYjp-.js";import"./leaflet-CBvJEdQJ.js";import"./calendar-BMpoG7r9.js";import"./isSameDay-joLYwakD.js";import"./subDays-DRxbqYu5.js";import"./addDays-BSbVNr0x.js";import"./en-US-DWZo7XR8.js";import"./startOfMonth-DdINBIhw.js";import"./endOfMonth-DEMI3k8K.js";import"./isAfter-DG4OP79x.js";import"./format-DTSXrGtn.js";import"./externalSupabase-DJ4PSHv7.js";import"./calendar-days-DfmrVSI0.js";const qe=({tenant:t})=>{var S,L;const{slug:x,propertySlug:b}=O(),{basePath:P}=Ne(),{t:r,i18n:G}=ie(),Z=G.language,Q=t.ref_prefix||"BF",o=t.color_primary||"#4542f5",f=b||x,j=((S=f==null?void 0:f.match(/([a-f0-9]{8})$/))==null?void 0:S[1])||"",{data:y,isLoading:T}=oe(f||""),{data:J,isLoading:X}=w({queryKey:["property-id-prefix",j],queryFn:async()=>{if(!j)return null;const{data:a,error:i}=await v.from("public_properties").select("*").like("id",`${j}%`).maybeSingle();if(i)throw i;return a},enabled:!!j&&!y&&!T}),s=y||J,Y=T||X&&!y,{data:I}=w({queryKey:["tenant-agent-info",s==null?void 0:s.agent_id,t.id],queryFn:async()=>{if(!(s!=null&&s.agent_id))return null;const{data:a,error:i}=await v.from("profiles").select("full_name, last_name, phone, email, avatar_url, tenant_id").eq("id",s.agent_id).eq("is_active",!0).maybeSingle();return i||!a||a.tenant_id&&a.tenant_id!==t.id?null:a},enabled:!!(s!=null&&s.agent_id)}),{data:ee}=w({queryKey:["tenant-fallback-agent",t.id],queryFn:async()=>{const{data:a,error:i}=await v.from("profiles").select("full_name, last_name, phone, email, avatar_url").eq("tenant_id",t.id).eq("is_active",!0).limit(1).maybeSingle();return i?null:a},enabled:!I&&!!t.id}),n=I||ee,[se,z]=ne.useState(!1),ae=a=>a?a.replace(/^BF-/,`${Q}-`):"",N=a=>{if(!s)return"";const i=`${a}_${Z}`,c=`${a}_es`;return s[i]||s[c]||""},h=()=>{const a=N("title");if(!a)return"";if(a.length<=80)return a;const i=a.split(/[.!?\n]|(?:\s[-–—]\s)/)[0].trim();if(i.length>80){const c=i.substring(0,80),p=c.lastIndexOf(" ");return p>30?c.substring(0,p)+"…":c+"…"}return i},te=()=>!(s!=null&&s.images)||!Array.isArray(s.images)?[]:s.images.map(a=>typeof a=="string"?{url:a}:a&&typeof a=="object"&&"url"in a?{url:a.url,caption:a.caption||a.alt}:null).filter(Boolean),m=()=>s?s.price_on_request?r("properties.priceOnRequest"):s.price?`€${Number(s.price).toLocaleString()}`:"-":"",A=s?[{key:"pool",icon:D,active:s.has_pool},{key:"seaView",icon:D,active:s.has_sea_view},{key:"mountainView",icon:ze,active:s.has_mountain_view},{key:"garage",icon:Ae,active:s.has_garage},{key:"airConditioning",icon:Re,active:s.has_air_conditioning},{key:"heating",icon:Se,active:s.has_heating},{key:"garden",icon:Be,active:s.has_garden},{key:"terrace",icon:le,active:s.has_terrace}].filter(a=>a.active):[],d=ae((s==null?void 0:s.public_ref)||null),B=t.smtp_from_email||(n==null?void 0:n.email)||"",R=(n==null?void 0:n.phone)||t.phone||"";return Y?e.jsxs("div",{className:"min-h-screen",style:{"--t-primary":o,"--t-bg":t.color_background||"#ffffff","--t-fg":t.color_foreground||"#2d2d33"},children:[e.jsx(k,{tenant:t}),e.jsx("main",{className:"pt-24 pb-16",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"animate-pulse space-y-8",children:[e.jsx("div",{className:"h-8 bg-muted rounded w-1/4"}),e.jsx("div",{className:"h-[400px] bg-muted rounded-lg"})]})})}),e.jsx($,{tenant:t})]}
1):s?e.jsxs("div",{className:"min-h-screen",style:{"--t-primary":o,"--t-secondary":t.color_secondary||"#1299c9","--t-accent":t.color_accent||"#717178","--t-bg":t.color_background||"#ffffff","--t-fg":t.color_foreground||"#2d2d33"},children:[e.jsxs(ce,{children:[e.jsxs("title",{children:[h()," — ",t.name]}),e.jsx("meta",{name:"description",content:(L=N("description"))==null?void 0:L.slice(0,160)}),t.favicon_url&&e.jsx("link",{rel:"icon",href:t.favicon_url})]}),e.jsx(k,{tenant:t}),e.jsx("main",{className:"pt-24 pb-16",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("div",{className:"mb-6",children:e.jsxs(U,{to:P||"/",className:"inline-flex items-center text-sm hover:opacity-80 transition-opacity",style:{color:t.color_accent||"#717178"},children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),r("properties.backToList")]})}),e.jsx(Ce,{images:te(),title:h()}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-8 mt-8",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-4",children:[e.jsxs("div",{children:[d&&e.jsxs("span",{className:"inline-block text-sm font-semibold px-2 py-0.5 rounded mb-2",style:{color:o,backgroundColor:o+"18"},children:["Ref: ",d]}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold mb-2",style:{color:t.color_foreground||"#2d2d33"},children:h()}),e.jsxs("div",{className:"flex items-center gap-3",style:{color:t.color_accent||"#717178"},children:[e.jsx("span",{className:"font-medium",children:r(`propertyTypes.${s.property_type}`)}),s.zone&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx(de,{className:"h-4 w-4"}),e.jsx("span",{children:s.zone})]})]})]}),e.jsx(W,{variant:"default",className:"text-sm",children:r(`properties.status.${s.status}`)})]}),e.jsx("p",{className:"text-3xl md:text-4xl font-bold",style:{color:o},children:m()}),e.jsx("div",{className:"flex flex-wrap gap-3 mt-4",children:e.jsxs(l,{size:"lg",className:"flex-1 min-w-[200px] h-auto py-3",style:{backgroundColor:o},onClick:()=>z(!0),children:[e.jsx(me,{className:"h-5 w-5 mr-2 shrink-0"}),e.jsx("span",{className:"text-left leading-tight",children:e.jsx("span",{className:"block text-sm font-semibold",children:"Book a Viewing"})})]})})]}),e.jsx(C,{}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.bedrooms!==null&&e.jsxs(u,{className:"p-4 text-center",children:[e.jsx(pe,{className:"h-6 w-6 mx-auto mb-2",style:{color:o}}),e.jsx("p",{className:"text-2xl font-bold",children:s.bedrooms}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("properties.detail.bedrooms")})]}),s.bathrooms!==null&&e.jsxs(u,{className:"p-4 text-center",children:[e.jsx(xe,{className:"h-6 w-6 mx-auto mb-2",style:{color:o}}),e.jsx("p",{className:"text-2xl font-bold",children:s.bathrooms}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("properties.detail.bathrooms")})]}),s.built_area&&e.jsxs(u,{className:"p-4 text-center",children:[e.jsx(he,{className:"h-6 w-6 mx-auto mb-2",style:{color:o}}),e.jsxs("p",{className:"text-2xl font-bold",children:[s.built_area,"m²"]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("properties.detail.builtArea")})]}),s.year_built&&e.jsxs(u,{className:"p-4 text-center",children:[e.jsx(Le,{className:"h-6 w-6 mx-auto mb-2",style:{color:o}}),e.jsx("p",{className:"text-2xl font-bold",children:s.year_built}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("properties.detail.yearBuilt")})]})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:r("properties.detail.description")}),e.jsx("div",{className:"prose prose-sm max-w-none text-muted-foreground",children:e.jsx("p",{className:"whitespace-pre-wrap",children:N("description")})})]}),e.jsx(Pe,{enabled:s.home_staging_enabled,rooms:s.home_staging_rooms}),A.length>0&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:r("properties.detail.features")}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:A.map(a=>e.jsxs("div",{className:"flex items-center gap-2 p-3 bg-muted/50 rounded-lg",children:[e.jsx(a.icon,{className:"h-5 w-5",style:{color:o}}),e.jsx("span",{className:"text-sm",children:r(`properties.features.${a.key}`)})]},a.key))})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:r("properties.detail.additionalInfo")}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.plot_area&&e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:r("properties.detail.plotArea")}),e.jsxs("span",{className:"font-medium",children:[s.plot_area,"m²"]})]}),s.terrace_area&&e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:r("properties.detail.terraceArea")}),e.jsxs("span",{className:"font-medium",children:[s.terrace_area,"m²"]})]}),s.floor_level&&e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:r("properties.detail.floor")}),e.jsx("span",{className:"font-medium",children:s.floor_level})]}),s.orientation&&e.jsxs("div",{className:"flex justify-between py-2 border-b",children:[e.jsx("span",{className:"text-muted-foreground",children:r("properties.detail.orientation")}),e.jsx("span",{className:"font-medium",children:s.orientation})]})]})]}),s.latitude&&s.longitude&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:r("properties.detail.location")}),e.jsx(Te,{properties:[s],selectedProperty:s,height:"300px"})]})]}),e.jsxs("div",{children:[e.jsxs(u,{className:"sticky top-24 p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-3xl font-bold mb-2",style:{color:o},children:m()}),e.jsx(W,{variant:"default",children:r(`properties.status.${s.status}`)})]}),e.jsx(C,{}),n&&(()=>{var q,M,F;const a=((q=n.phone)==null?void 0:q.replace(/[^0-9+]/g,""))||"",i=a.replace("+",""),c=n.email||"",p=`Hi, I'm contacting you about property Ref: ${d}, in ${s.zone||"-"}, price ${m()}. I'd like more information.`;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(_e,{className:"h-14 w-14 ring-2",style:{"--tw-ring-color":o+"33"},children:[e.jsx(ke,{src:n.avatar_url||void 0,alt:n.full_name||""}),e.jsxs($e,{style:{backgroundColor:o+"18",color:o},className:"font-semibold text-lg",children:[(((M=n.full_name)==null?void 0:M[0])||"").toUpperCase(),(((F=n.last_name)==null?void 0:F[0])||"").toUpperCase()]})]}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"font-semibold truncate",children:[n.full_name," ",n.last_name||""]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.name})]})]}),e.jsxs("div",{className:"flex gap-2",children:[a&&e.jsxs(l,{className:"flex-1 bg-[#25D366] hover:bg-[#20BD5A] text-white text-xs px-2 h-8",size:"sm",onClick:()=>{const g=encodeURIComponent(p),re=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)?`https://wa.me/${i}?text=${g}
1`:`https://web.whatsapp.com/send?phone=${i}&text=${g}`;window.open(re,"_blank","noopener,noreferrer")},children:[e.jsx(_,{className:"h-3.5 w-3.5 mr-1 shrink-0"}),"Chat"]}),c&&e.jsxs(l,{variant:"outline",className:"flex-1 text-xs px-2 h-8",size:"sm",onClick:()=>{const g=encodeURIComponent("Property enquiry"),H=encodeURIComponent(`Hi,
2
3I'm interested in the property:
4- Ref: ${d}
5- Zone: ${s.zone||"-"}
6- Price: ${m()}
7- Link: ${window.location.href}
8
9Thank you.`);window.location.href=`mailto:${c}?subject=${g}&body=${H}`},children:[e.jsx(E,{className:"h-3.5 w-3.5 mr-1 shrink-0"}),"Email"]})]}),e.jsx(C,{})]})})(),e.jsxs("div",{className:"space-y-3",children:[t.whatsapp&&e.jsxs(l,{className:"w-full text-white",size:"lg",style:{backgroundColor:"#25D366"},onClick:()=>{const a=t.whatsapp.replace(/[^0-9]/g,""),i=encodeURIComponent(`Hi, I'm interested in property Ref: ${d}, in ${s.zone||"-"}, price ${m()}. I'd like more information.`),p=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)?`https://wa.me/${a}?text=${i}`:`https://web.whatsapp.com/send?phone=${a}&text=${i}`;window.open(p,"_blank","noopener,noreferrer")},children:[e.jsx(_,{className:"h-4 w-4 mr-2"}),"WhatsApp"]}),R&&e.jsxs(l,{className:"w-full text-white",size:"lg",style:{backgroundColor:o},onClick:()=>window.location.href=`tel:${R.replace(/[^0-9+]/g,"")}`,children:[e.jsx(ue,{className:"h-4 w-4 mr-2"}),r("properties.contact.call")]}),B&&e.jsxs(l,{variant:"outline",className:"w-full",size:"lg",onClick:()=>{const a=encodeURIComponent("Property enquiry"),i=encodeURIComponent(`Hi,
10
11I'm interested in property Ref: ${d}
12- Zone: ${s.zone||"-"}
13- Price: ${m()}
14
15Thank you.`);window.location.href=`mailto:${B}?subject=${a}&body=${i}`},children:[e.jsx(E,{className:"h-4 w-4 mr-2"}),r("properties.contact.email")]})]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs(fe,{children:[e.jsx(je,{asChild:!0,children:e.jsxs(l,{variant:"outline",size:"sm",className:"flex-1",children:[e.jsx(K,{className:"h-4 w-4 mr-2"}),r("properties.share")]})}),e.jsx(ge,{className:"w-auto p-2",align:"start",children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx(l,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:()=>window.open(`https://wa.me/?text=${encodeURIComponent(h()+" "+window.location.href)}`,"_blank"),children:e.jsx(_,{className:"h-4 w-4"})}),e.jsx(l,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:()=>{navigator.clipboard.writeText(window.location.href),be.success("Link copied")},children:e.jsx(K,{className:"h-4 w-4"})})]})})]})}),d&&e.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:["Ref: ",d]})]}),e.jsx(Ie,{open:se,onOpenChange:z,propertyTitle:h(),propertyId:s.id,urbanization:s.urbanization||s.zone||void 0})]})]})]})}),e.jsx($,{tenant:t})]}):e.jsxs("div",{className:"min-h-screen",style:{"--t-primary":o},children:[e.jsx(k,{tenant:t}),e.jsx("main",{className:"pt-24 pb-16",children:e.jsxs("div",{className:"container mx-auto px-4 text-center py-20",children:[e.jsx("h1",{className:"text-2xl font-bold mb-4",children:r("properties.notFound")}),e.jsx(U,{to:P||"/",children:e.jsxs(l,{children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Volver"]})})]})}),e.jsx($,{tenant:t})]})},ps=()=>{const{slug:t}=O(),{data:x,isLoading:b}=we(t);return b?e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:e.jsx(ye,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):x?e.jsx(ve,{tenant:x,basePath:`/t/${t}`,children:e.jsx(qe,{tenant:x})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Tenant not found"})};export{ps 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.