import { jsx, jsxs, Fragment } from "react/jsx-runtime";
import { PassThrough } from "node:stream";
import { createReadableStreamFromReadable } from "@react-router/node";
import { ServerRouter, UNSAFE_withComponentProps, Outlet, UNSAFE_withErrorBoundaryProps, isRouteErrorResponse, Meta, Links, ScrollRestoration, Scripts, data } from "react-router";
import { isbot } from "isbot";
import { renderToPipeableStream } from "react-dom/server";
import { useEffect, useState, useRef, useMemo } from "react";
import { MessageCircle, X, Menu, ArrowUpRight, ArrowRight, CheckCheck, Wallet, ArrowLeft, LockKeyhole, Play, ChevronDown, Calculator } from "lucide-react";
import PocketBase from "pocketbase";
import ipaddr from "ipaddr.js";
import { RateLimiterMemory, RateLimiterRes } from "rate-limiter-flexible";
const streamTimeout = 5e3;
function handleRequest(request, responseStatusCode, responseHeaders, routerContext, loadContext) {
if (request.method.toUpperCase() === "HEAD") {
return new Response(null, {
status: responseStatusCode,
headers: responseHeaders
});
}
return new Promise((resolve, reject) => {
let shellRendered = false;
let userAgent = request.headers.get("user-agent");
let readyOption = userAgent && isbot(userAgent) || routerContext.isSpaMode ? "onAllReady" : "onShellReady";
let timeoutId = setTimeout(
() => abort(),
streamTimeout + 1e3
);
const { pipe, abort } = renderToPipeableStream(
/* @__PURE__ */ jsx(ServerRouter, { context: routerContext, url: request.url }),
{
[readyOption]() {
shellRendered = true;
const body = new PassThrough({
final(callback) {
clearTimeout(timeoutId);
timeoutId = void 0;
callback();
}
});
const stream = createReadableStreamFromReadable(body);
responseHeaders.set("Content-Type", "text/html");
pipe(body);
resolve(
new Response(stream, {
headers: responseHeaders,
status: responseStatusCode
})
);
},
onShellError(error) {
reject(error);
},
onError(error) {
responseStatusCode = 500;
if (shellRendered) {
console.error(error);
}
}
}
);
});
}
const entryServer = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: handleRequest,
streamTimeout
}, Symbol.toStringTag, { value: "Module" }));
const stylesheet = "/assets/index-DHoBIddV.css";
const DISCLAIMER = "Condições sujeitas à análise de crédito, disponibilidade de unidades e condições comerciais vigentes.";
const PHONE = "(11) 9 9231-9367";
const BROKER_PHOTO = "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/c458340aa7e802a8f2a3cbde7163ac44.jpg";
const images = {
hero: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/a5bdec9c20f0ff429944af417fca0616.jpg",
plan1: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/a72e11d9c84b26ef1a6c420e500029d4.png",
plan2compact: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/d9aa3b10894ba6e41e5656a2efc36dad.png",
plan2: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/f0ab3da11d342a86c388a08eeb402421.png",
plan3: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/e74822067fee74bb085e1c3179d53d99.png"
};
const amenities = [
{ name: "Piscina", note: "Seu próximo mergulho.", image: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/5a97a097e5d8d8b397f93ceed21c74c6.jpg" },
{ name: "Rooftop", note: "Outro ponto de vista.", image: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/f98e5fb0b31b7f36ac5e2969428a5dab.jpg" },
{ name: "Lounge", note: "Lareira ao ar livre.", image: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/cebf838a6c31936757ee9568ec9e782e.jpg" },
{ name: "Churrasqueiras", note: "Encontre sua turma.", image: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/1baeb32e50721509398c5b46361778c9.jpg" },
{ name: "Fitness", note: "Movimento na sua rotina.", image: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/08bea02b9ab68d910921b7959e806619.jpg" },
{ name: "Coworking", note: "Espaço para suas ideias.", image: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/dded009dd717a9ddc6d70ca6d1b2d5bc.jpg" },
{ name: "Espaço Gourmet", note: "À mesa, juntos.", image: "https://images.hostinger.com/e2b2aef6-0909-4561-9605-f488699ee0fb.png" },
{ name: "Sport Bar", note: "O jogo ganha companhia.", image: "https://images.hostinger.com/9f4c4714-367c-4477-a9db-eb2b05c5ff5d.png" },
{ name: "Brinquedoteca", note: "Lugar de imaginar.", image: "https://images.hostinger.com/c35c8f1d-308a-482d-9a46-fc1e16676631.png" },
{ name: "Pet Care", note: "Cuidado também para eles.", image: "https://images.hostinger.com/2495fb0e-2365-44db-8aa4-d7099389f58b.png" },
{ name: "Salão de Festas", note: "Celebre seus momentos.", image: "https://images.hostinger.com/54db8db3-0aac-4d82-8922-3b95ebc065b9.png" }
];
const apartmentOptions = [
{ rooms: 1, label: "1 quarto", area: "24 m²", plan: images.plan1, title: "Seu espaço. Seu começo.", description: "Uma opção para quem quer dar o primeiro passo.", features: ["varanda"] },
{ rooms: 2, label: "2 quartos", area: "33 m²", plan: images.plan2compact, title: "Dois quartos, no seu ritmo.", description: "Uma planta de 2 quartos para quem quer mais um cômodo.", features: [] },
{ rooms: 2, label: "2 quartos", area: "42 m²", plan: images.plan2, title: "Espaço para a próxima fase.", description: "Uma opção para pensar na vida de hoje e de amanhã.", features: ["varanda", "vaga"] },
{ rooms: 3, label: "3 quartos", area: "57 m²", plan: images.plan3, title: "Mais espaço para sua vida.", description: "Uma opção para quem procura mais quartos.", features: ["suite", "varanda", "vaga"] }
];
function whatsappUrl(message) {
return `https://wa.me/5511992319367?text=${encodeURIComponent(message)}`;
}
const LOCAL_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "0.0.0.0", "[::1]"]);
const siteOrigin = (request) => {
const { host, hostname } = new URL(request.url);
return `${LOCAL_HOSTNAMES.has(hostname) ? "http" : "https"}://${host}`;
};
function HorizonsPreviewScripts() {
useEffect(() => {
window.__horizonsHydrated = true;
window.dispatchEvent(new Event("horizons:hydrated"));
{
void import("./assets/_virtual_horizons-runtime-B5-KaiEE.js");
}
}, []);
return /* @__PURE__ */ jsxs(Fragment, { children: [
null,
null
] });
}
const links$1 = () => [{
rel: "stylesheet",
href: stylesheet
}, {
rel: "icon",
href: "/favicon.ico",
sizes: "32x32"
}, {
rel: "preconnect",
href: "https://fonts.googleapis.com"
}, {
rel: "preconnect",
href: "https://fonts.gstatic.com",
crossOrigin: "anonymous"
}, {
rel: "stylesheet",
href: "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap"
}, {
rel: "preload",
as: "image",
href: images.hero,
fetchPriority: "high"
}, {
rel: "preload",
as: "image",
href: BROKER_PHOTO
}];
function loader$4({
request
}) {
const origin = siteOrigin(request);
return data({
origin
}, {
headers: {
Link: `<${origin}/sitemap.xml>; rel="sitemap"; type="application/xml"`
}
});
}
function headers({
loaderHeaders
}) {
return loaderHeaders;
}
function Layout({
children
}) {
return /* @__PURE__ */ jsxs("html", {
lang: "pt-BR",
children: [/* @__PURE__ */ jsxs("head", {
children: [/* @__PURE__ */ jsx("meta", {
charSet: "utf-8"
}), /* @__PURE__ */ jsx("meta", {
name: "viewport",
content: "width=device-width, initial-scale=1"
}), /* @__PURE__ */ jsx(Meta, {}), /* @__PURE__ */ jsx(Links, {}), /* @__PURE__ */ jsx(HorizonsPreviewScripts, {})]
}), /* @__PURE__ */ jsxs("body", {
children: [/* @__PURE__ */ jsx("div", {
id: "root",
children
}), /* @__PURE__ */ jsx(ScrollRestoration, {}), /* @__PURE__ */ jsx(Scripts, {})]
})]
});
}
const root = UNSAFE_withComponentProps(function App() {
return /* @__PURE__ */ jsx(Outlet, {});
});
const ErrorBoundary = UNSAFE_withErrorBoundaryProps(function ErrorBoundary2({
error
}) {
let message = "Algo não saiu como esperado.";
let details = "Ocorreu um erro inesperado. Tente recarregar a página.";
if (isRouteErrorResponse(error)) {
message = error.status === 404 ? "404" : "Erro";
details = error.status === 404 ? "A página solicitada não foi encontrada." : error.statusText || details;
}
return /* @__PURE__ */ jsxs("main", {
children: [/* @__PURE__ */ jsx("h1", {
children: message
}), /* @__PURE__ */ jsx("p", {
children: details
}), null]
});
});
const route0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
ErrorBoundary,
Layout,
default: root,
headers,
links: links$1,
loader: loader$4
}, Symbol.toStringTag, { value: "Module" }));
const ROOT_ROUTE_ID = "root";
const siteOriginFrom = (matches) => {
const root2 = matches.find((match) => match?.id === ROOT_ROUTE_ID);
return root2?.loaderData?.origin ?? "";
};
const absoluteUrl = (origin, target) => {
if (/^https?:\/\//.test(target)) {
return target;
}
return `${origin}${target.startsWith("/") ? target : `/${target}`}`;
};
function seo({ matches, location }, input) {
const origin = siteOriginFrom(matches);
const canonical = absoluteUrl(origin, input.path ?? location.pathname);
const imageUrl = input.image ? absoluteUrl(origin, input.image) : "";
const tags = [
{ title: input.title },
{ name: "description", content: input.description },
{ property: "og:title", content: input.title },
{ property: "og:description", content: input.description },
{ property: "og:type", content: input.type ?? "website" },
{ name: "twitter:card", content: imageUrl ? "summary_large_image" : "summary" },
{ name: "twitter:title", content: input.title },
{ name: "twitter:description", content: input.description }
];
if (origin) {
tags.push({ tagName: "link", rel: "canonical", href: canonical }, { property: "og:url", content: canonical });
}
if (imageUrl) {
tags.push({ property: "og:image", content: imageUrl }, { name: "twitter:image", content: imageUrl });
}
if (input.noindex) {
tags.push({ name: "robots", content: "noindex" });
}
for (const block of [input.jsonLd ?? []].flat()) {
tags.push({ "script:ld+json": block });
}
return tags;
}
const links = [
{ href: "#apartamentos", label: "Unidades" },
{ href: "#vantagens", label: "Vantagens" },
{ href: "#como-funciona", label: "Como funciona" },
{ href: "#localizacao", label: "Localização" },
{ href: "#zaqueu", label: "Zaqueu" }
];
function SiteHeader() {
const [open, setOpen] = useState(false);
useEffect(() => {
document.body.style.overflow = open ? "hidden" : "";
return () => {
document.body.style.overflow = "";
};
}, [open]);
return /* @__PURE__ */ jsxs("header", { className: "site-header", children: [
/* @__PURE__ */ jsxs("a", { className: "brand", href: "#inicio", "aria-label": "Zaqueu Farid — início", children: [
/* @__PURE__ */ jsx("span", { className: "brand-mark", children: "Z" }),
/* @__PURE__ */ jsxs("span", { children: [
"ZAQUEU FARID",
/* @__PURE__ */ jsx("small", { children: "Especialista MCMV" })
] })
] }),
/* @__PURE__ */ jsx("nav", { className: "desktop-nav", "aria-label": "Navegação principal", children: links.map((link) => /* @__PURE__ */ jsx("a", { href: link.href, children: link.label }, link.href)) }),
/* @__PURE__ */ jsxs("a", { className: "header-cta", href: whatsappUrl("Olá, Zaqueu! Quero simular o lançamento da Rua Pedro de Godói."), target: "_blank", rel: "noopener noreferrer", children: [
/* @__PURE__ */ jsx(MessageCircle, { size: 16 }),
" WhatsApp"
] }),
/* @__PURE__ */ jsx("button", { className: "menu-btn", "aria-label": open ? "Fechar menu" : "Abrir menu", "aria-expanded": open, onClick: () => setOpen((v) => !v), children: open ? /* @__PURE__ */ jsx(X, { size: 22 }) : /* @__PURE__ */ jsx(Menu, { size: 22 }) }),
open ? /* @__PURE__ */ jsxs("div", { className: "mobile-nav", children: [
links.map((link) => /* @__PURE__ */ jsx("a", { href: link.href, onClick: () => setOpen(false), children: link.label }, link.href)),
/* @__PURE__ */ jsx("a", { href: "#simulador", onClick: () => setOpen(false), children: "Simular agora" })
] }) : null
] });
}
const LOGOS = {
mcmv: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/3d61595d516a9a4b3b76da345cc5b748.jpg",
fgts: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/544c3105b102e678b75184699fced0eb.png",
caixa: "https://horizons-cdn.hostinger.com/1ae874d1-66b8-4e36-8d33-566d933fec5d/4d648e87b7dd9c7a5d1200162649fa46.jpg"
};
function CredibilitySeals() {
return /* @__PURE__ */ jsxs("div", { className: "credibility-seals", "aria-label": "Referências para análise de financiamento", children: [
/* @__PURE__ */ jsx("img", { className: "seal-logo seal-mcmv", src: LOGOS.mcmv, alt: "Minha Casa Minha Vida" }),
/* @__PURE__ */ jsx("img", { className: "seal-logo seal-fgts", src: LOGOS.fgts, alt: "FGTS" }),
/* @__PURE__ */ jsx("img", { className: "seal-logo seal-caixa", src: LOGOS.caixa, alt: "CAIXA" })
] });
}
function SiteFooter() {
const [privacy, setPrivacy] = useState(false);
const [hideSticky, setHideSticky] = useState(false);
useEffect(() => {
const target = document.getElementById("simulador");
if (!target) return;
const observer = new IntersectionObserver(([entry2]) => setHideSticky(entry2.isIntersecting), { threshold: 0.2 });
observer.observe(target);
return () => observer.disconnect();
}, []);
useEffect(() => {
if (!privacy) return;
const onKey = (event) => {
if (event.key === "Escape") setPrivacy(false);
};
window.addEventListener("keydown", onKey);
return () => window.removeEventListener("keydown", onKey);
}, [privacy]);
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsxs("footer", { className: "site-footer", children: [
/* @__PURE__ */ jsxs("div", { className: "section-rail footer-grid", children: [
/* @__PURE__ */ jsxs("div", { children: [
/* @__PURE__ */ jsx("strong", { children: "ZAQUEU FARID" }),
/* @__PURE__ */ jsx("p", { children: "Especialista MCMV. Simulação do lançamento na Rua Pedro de Godói, Vila Prudente." }),
/* @__PURE__ */ jsx(CredibilitySeals, {})
] }),
/* @__PURE__ */ jsxs("div", { children: [
/* @__PURE__ */ jsx("span", { children: "Nesta página" }),
/* @__PURE__ */ jsx("a", { href: "#apartamentos", children: "Unidades" }),
/* @__PURE__ */ jsx("a", { href: "#vantagens", children: "Vantagens" }),
/* @__PURE__ */ jsx("a", { href: "#como-funciona", children: "Como funciona" }),
/* @__PURE__ */ jsx("a", { href: "#localizacao", children: "Localização" }),
/* @__PURE__ */ jsx("a", { href: "#duvidas", children: "Dúvidas" })
] }),
/* @__PURE__ */ jsxs("div", { children: [
/* @__PURE__ */ jsx("span", { children: "Contato" }),
/* @__PURE__ */ jsxs("a", { href: whatsappUrl("Olá, Zaqueu! Quero mais informações sobre o lançamento na Rua Pedro de Godói."), target: "_blank", rel: "noopener noreferrer", children: [
PHONE,
" ",
/* @__PURE__ */ jsx(ArrowUpRight, { size: 14 })
] }),
/* @__PURE__ */ jsx("p", { children: "Atendimento pelo WhatsApp. Sem e-mail nesta página." })
] })
] }),
/* @__PURE__ */ jsxs("div", { className: "section-rail footer-legal", children: [
/* @__PURE__ */ jsxs("p", { children: [
DISCLAIMER,
" Imagens meramente ilustrativas. Varanda, suíte e vaga conforme a unidade. Referências a Minha Casa Minha Vida, FGTS e CAIXA não garantem elegibilidade nem aprovação."
] }),
/* @__PURE__ */ jsxs("div", { children: [
/* @__PURE__ */ jsx("span", { children: "© 2026 Zaqueu Farid." }),
/* @__PURE__ */ jsx("button", { onClick: () => setPrivacy(true), children: "Privacidade" })
] }),
privacy ? /* @__PURE__ */ jsxs("section", { className: "privacy-panel", "aria-labelledby": "privacy-title", children: [
/* @__PURE__ */ jsx("button", { className: "privacy-close", "aria-label": "Fechar aviso de privacidade", onClick: () => setPrivacy(false), children: /* @__PURE__ */ jsx(X, { size: 18 }) }),
/* @__PURE__ */ jsx("h3", { id: "privacy-title", children: "Privacidade e seus dados" }),
/* @__PURE__ */ jsx("p", { children: "Ao simular, você informa nome, WhatsApp, renda, FGTS e preferência de apartamento. Esses dados e parâmetros de campanha, quando presentes, ficam armazenados para o atendimento de Zaqueu Farid. Não pedimos e-mail, documentos ou dados bancários aqui." }),
/* @__PURE__ */ jsxs("p", { children: [
"O envio não garante crédito. Você pode pedir correção ou exclusão pelo WhatsApp ",
PHONE,
"."
] })
] }) : null
] })
] }),
/* @__PURE__ */ jsx("a", { className: "float-whatsapp", "aria-label": "Falar no WhatsApp", href: whatsappUrl("Olá, Zaqueu! Quero simular o lançamento da Rua Pedro de Godói."), target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx(MessageCircle, { size: 26 }) }),
/* @__PURE__ */ jsx("div", { className: `sticky-conversion ${hideSticky ? "sticky-hidden" : ""}`, children: /* @__PURE__ */ jsx("a", { className: "btn btn-purple", href: "#simulador", tabIndex: hideSticky ? -1 : 0, children: "Quero simular agora" }) })
] });
}
function Hero() {
return /* @__PURE__ */ jsxs("section", { className: "hero", id: "inicio", "aria-labelledby": "hero-title", children: [
/* @__PURE__ */ jsx("div", { className: "hero-scene", children: /* @__PURE__ */ jsx("img", { src: images.hero, alt: "Fachada do empreendimento na Rua Pedro de Godói", width: 1200, height: 1600, fetchPriority: "high", decoding: "async" }) }),
/* @__PURE__ */ jsx("div", { className: "hero-shade" }),
/* @__PURE__ */ jsx("div", { className: "hero-grid", children: /* @__PURE__ */ jsxs("div", { className: "hero-copy", children: [
/* @__PURE__ */ jsx("p", { className: "hero-topline", children: "LANÇAMENTO • ESTAÇÃO VILA PRUDENTE" }),
/* @__PURE__ */ jsx("h1", { id: "hero-title", children: "VOCÊ PAGA ALUGUEL?" }),
/* @__PURE__ */ jsx("p", { className: "hero-sub", children: "Veja se R$ 1.000 pode ser o começo do seu apê." }),
/* @__PURE__ */ jsxs("div", { className: "hero-highlights", children: [
/* @__PURE__ */ jsx("span", { children: "300m DA ESTAÇÃO VILA PRUDENTE" }),
/* @__PURE__ */ jsx("span", { children: "1, 2 E 3 QUARTOS" })
] }),
/* @__PURE__ */ jsxs("a", { className: "btn btn-gold hero-cta", href: "#simulador", children: [
"DESCOBRIR SE CONSIGO COMPRAR ",
/* @__PURE__ */ jsx(ArrowRight, { size: 20 })
] }),
/* @__PURE__ */ jsx("div", { className: "hero-credibility", children: /* @__PURE__ */ jsx(CredibilitySeals, {}) }),
/* @__PURE__ */ jsx("p", { className: "hero-disclaimer", children: DISCLAIMER })
] }) })
] });
}
const numbers = [
{ value: "R$ 1.000", label: "SINAL A PARTIR DE" },
{ value: "42x", label: "ENTRADA EM ATÉ" },
{ value: "R$ 4.500", label: "RENDA FAMILIAR A PARTIR DE" },
{ value: "300m", label: "DA ESTAÇÃO" }
];
function Conditions() {
return /* @__PURE__ */ jsx("section", { className: "condition", id: "condicao", "aria-labelledby": "condition-title", children: /* @__PURE__ */ jsxs("div", { className: "section-rail", children: [
/* @__PURE__ */ jsx("h2", { id: "condition-title", children: "VEJA COMO PODE COMEÇAR" }),
/* @__PURE__ */ jsx("div", { className: "condition-grid", children: numbers.map((n) => /* @__PURE__ */ jsxs("div", { className: "condition-cell", children: [
/* @__PURE__ */ jsx("span", { className: "condition-value", children: n.value }),
/* @__PURE__ */ jsx("span", { className: "condition-label", children: n.label })
] }, n.label)) }),
/* @__PURE__ */ jsxs("a", { className: "btn btn-purple condition-cta", href: "#simulador", children: [
"VER SE DÁ PARA MIM ",
/* @__PURE__ */ jsx(ArrowRight, { size: 18 })
] })
] }) });
}
const POCKETBASE_API_URL = "/hcgi/platform";
const pocketbaseClient = new PocketBase(POCKETBASE_API_URL);
const money = new Intl.NumberFormat("pt-BR", { style: "currency", currency: "BRL", maximumFractionDigits: 0 });
const ANNUITY_FACTOR = 153.7;
function formatPhone(value) {
const digits = value.replace(/\D/g, "").slice(0, 11);
if (digits.length <= 2) return digits;
if (digits.length <= 7) return `(${digits.slice(0, 2)}) ${digits.slice(2)}`;
const cut = digits.length === 11 ? 7 : 6;
return `(${digits.slice(0, 2)}) ${digits.slice(2, cut)}-${digits.slice(cut)}`;
}
function parseIncome(value) {
return Number(value.replace(/\./g, "").replace(",", ".")) || 0;
}
const STEPS = ["Renda", "FGTS", "Apartamento", "Contato"];
function LeadForm() {
const [step, setStep] = useState(0);
const [income, setIncome] = useState("");
const [fgts, setFgts] = useState("");
const [apartment, setApartment] = useState("");
const [name, setName] = useState("");
const [phone, setPhone] = useState("");
const [consent, setConsent] = useState(false);
const [website, setWebsite] = useState("");
const [error, setError] = useState("");
const [busy, setBusy] = useState(false);
const [success, setSuccess] = useState(false);
const inFlight = useRef(false);
const incomeNumber = parseIncome(income);
const estimate = useMemo(() => {
if (incomeNumber < 1e3) return null;
const installment = incomeNumber * 0.3;
const financing = installment * ANNUITY_FACTOR;
return { installment, financing };
}, [incomeNumber]);
const goNext = () => {
setError("");
if (step === 0 && (!Number.isFinite(incomeNumber) || incomeNumber < 1 || incomeNumber > 1e6)) {
setError("Informe sua renda familiar bruta mensal.");
return;
}
if (step === 1 && !fgts) {
setError("Selecione uma opção sobre o FGTS.");
return;
}
if (step === 2 && !apartment) {
setError("Escolha o tipo de apartamento.");
return;
}
setStep((s) => Math.min(STEPS.length - 1, s + 1));
};
const goBack = () => {
setError("");
setStep((s) => Math.max(0, s - 1));
};
const submit = async (event) => {
event.preventDefault();
if (inFlight.current) return;
if (name.trim().length < 2) {
setError("Informe seu nome.");
return;
}
const digits = phone.replace(/\D/g, "");
if (!/^[1-9][0-9]{9,10}$/.test(digits)) {
setError("Informe um WhatsApp válido com DDD.");
return;
}
if (!consent) {
setError("Autorize o contato para receber a análise.");
return;
}
const message = `Olá, Zaqueu! Sou ${name.trim()}. Quero minha simulação na Rua Pedro de Godói. Renda familiar bruta: ${money.format(incomeNumber)}. FGTS: ${fgts}. Procuro: ${apartment}.`;
const opened = window.open(whatsappUrl(message), "_blank", "noopener,noreferrer");
if (!opened) window.location.href = whatsappUrl(message);
inFlight.current = true;
setBusy(true);
setError("");
try {
const params = new URLSearchParams(window.location.search);
const source = {};
["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "fbclid"].forEach((key) => {
const value = params.get(key);
if (value) source[key] = value.slice(0, 300);
});
await pocketbaseClient.collection("simulation_requests").create({
name: name.trim(),
whatsapp: digits,
income: incomeNumber,
fgts,
apartment,
consent,
website,
source
});
setSuccess(true);
window.dispatchEvent(new CustomEvent("simulation:requested", { detail: { source: "landing-vila-prudente" } }));
} catch {
setError("Não foi possível salvar agora. Envie pelo WhatsApp abaixo.");
} finally {
inFlight.current = false;
setBusy(false);
}
};
const requestMessage = `Olá, Zaqueu! Sou ${name.trim() || "visitante"}. Quero minha simulação na Rua Pedro de Godói. Renda familiar bruta: ${money.format(incomeNumber || 0)}. FGTS: ${fgts || "não informado"}. Procuro: ${apartment || "ainda não sei"}.`;
if (success) {
return /* @__PURE__ */ jsxs("div", { className: "lead-card lead-success", role: "status", id: "simulador", children: [
/* @__PURE__ */ jsx("span", { className: "success-icon", children: /* @__PURE__ */ jsx(CheckCheck, { size: 28 }) }),
/* @__PURE__ */ jsx("p", { className: "form-kicker", children: "Pedido recebido" }),
/* @__PURE__ */ jsx("h2", { children: "Agora é com o Zaqueu." }),
/* @__PURE__ */ jsxs("p", { children: [
name.trim().split(" ")[0],
", seus dados foram salvos. Envie também no WhatsApp para receber a análise mais rápido."
] }),
/* @__PURE__ */ jsxs("a", { className: "btn btn-purple", href: whatsappUrl(requestMessage), target: "_blank", rel: "noopener noreferrer", children: [
"Falar com Zaqueu ",
/* @__PURE__ */ jsx(MessageCircle, { size: 18 })
] }),
/* @__PURE__ */ jsxs("a", { className: "btn btn-ghost", href: whatsappUrl(`Olá, Zaqueu! Sou ${name.trim()}. Quero agendar uma visita ao decorado da Rua Pedro de Godói.`), target: "_blank", rel: "noopener noreferrer", children: [
"Agendar visita ao decorado ",
/* @__PURE__ */ jsx(ArrowUpRight, { size: 16 })
] })
] });
}
return /* @__PURE__ */ jsxs("form", { className: "lead-card", id: "simulador", onSubmit: (event) => void submit(event), noValidate: true, children: [
/* @__PURE__ */ jsxs("div", { className: "form-head", children: [
/* @__PURE__ */ jsx("p", { className: "form-kicker", children: "Simulação gratuita" }),
/* @__PURE__ */ jsx("h2", { children: "SERÁ QUE VOCÊ CONSEGUE?" }),
/* @__PURE__ */ jsx("p", { className: "form-sub", children: "Descubra em menos de 2 minutos." })
] }),
/* @__PURE__ */ jsx("ol", { className: "step-bar", "aria-label": "Etapas da simulação", children: STEPS.map((label, index) => /* @__PURE__ */ jsxs("li", { className: index === step ? "active" : index < step ? "done" : "", children: [
/* @__PURE__ */ jsx("span", { children: index < step ? /* @__PURE__ */ jsx(CheckCheck, { size: 13 }) : index + 1 }),
label
] }, label)) }),
/* @__PURE__ */ jsx("div", { className: "step-track", children: /* @__PURE__ */ jsx("span", { style: { width: `${(step + 1) / STEPS.length * 100}%` } }) }),
step === 0 ? /* @__PURE__ */ jsxs("div", { className: "step-panel", children: [
/* @__PURE__ */ jsxs("label", { htmlFor: "income", children: [
"Renda familiar bruta (R$) ",
/* @__PURE__ */ jsx("span", { children: "*" }),
/* @__PURE__ */ jsx("input", { id: "income", autoFocus: true, inputMode: "decimal", placeholder: "Ex: 4500", maxLength: 12, value: income, onChange: (e) => setIncome(e.target.value.replace(/[^\d.,]/g, "")) })
] }),
/* @__PURE__ */ jsx("div", { className: `estimate ${estimate ? "show" : ""}`, "aria-live": "polite", children: estimate ? /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx("span", { className: "estimate-icon", children: /* @__PURE__ */ jsx(Wallet, { size: 18 }) }),
/* @__PURE__ */ jsxs("div", { className: "estimate-text", children: [
/* @__PURE__ */ jsxs("strong", { children: [
"Financiamento estimado: até ",
money.format(estimate.financing)
] }),
/* @__PURE__ */ jsxs("small", { children: [
"Parcela de ~",
money.format(estimate.installment),
"/mês · sujeito a análise de crédito"
] })
] })
] }) : /* @__PURE__ */ jsx("p", { children: "Digite sua renda para ver uma estimativa na hora." }) })
] }) : null,
step === 1 ? /* @__PURE__ */ jsx("div", { className: "step-panel", children: /* @__PURE__ */ jsxs("fieldset", { children: [
/* @__PURE__ */ jsxs("legend", { children: [
"Possui FGTS? ",
/* @__PURE__ */ jsx("span", { children: "*" })
] }),
/* @__PURE__ */ jsx("div", { className: "chip-row", children: ["Sim", "Não", "Não sei"].map((option) => /* @__PURE__ */ jsx("button", { type: "button", className: fgts === option ? "chip on" : "chip", "aria-pressed": fgts === option, onClick: () => setFgts(option), children: option }, option)) })
] }) }) : null,
step === 2 ? /* @__PURE__ */ jsx("div", { className: "step-panel", children: /* @__PURE__ */ jsxs("fieldset", { children: [
/* @__PURE__ */ jsxs("legend", { children: [
"Qual apartamento você procura? ",
/* @__PURE__ */ jsx("span", { children: "*" })
] }),
/* @__PURE__ */ jsx("div", { className: "chip-row", children: ["1 quarto", "2 quartos", "3 quartos", "Ainda não sei"].map((option) => /* @__PURE__ */ jsx("button", { type: "button", className: apartment === option ? "chip on" : "chip", "aria-pressed": apartment === option, onClick: () => setApartment(option), children: option }, option)) })
] }) }) : null,
step === 3 ? /* @__PURE__ */ jsxs("div", { className: "step-panel", children: [
/* @__PURE__ */ jsxs("label", { htmlFor: "lead-name", children: [
"Nome ",
/* @__PURE__ */ jsx("span", { children: "*" }),
/* @__PURE__ */ jsx("input", { id: "lead-name", autoFocus: true, autoComplete: "name", maxLength: 120, placeholder: "Digite seu nome", value: name, onChange: (e) => setName(e.target.value) })
] }),
/* @__PURE__ */ jsxs("label", { htmlFor: "lead-phone", children: [
"WhatsApp com DDD ",
/* @__PURE__ */ jsx("span", { children: "*" }),
/* @__PURE__ */ jsx("input", { id: "lead-phone", type: "tel", inputMode: "tel", autoComplete: "tel-national", placeholder: "(11) 99999-9999", value: phone, onChange: (e) => setPhone(formatPhone(e.target.value)) })
] }),
/* @__PURE__ */ jsxs("label", { className: "consent", children: [
/* @__PURE__ */ jsx("input", { type: "checkbox", checked: consent, onChange: (e) => setConsent(e.target.checked) }),
/* @__PURE__ */ jsx("span", { children: "Autorizo Zaqueu Farid a usar estes dados para analisar meu perfil e entrar em contato pelo WhatsApp." })
] }),
/* @__PURE__ */ jsx("div", { className: "honeypot", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("label", { children: [
"Deixe vazio",
/* @__PURE__ */ jsx("input", { tabIndex: -1, autoComplete: "off", value: website, onChange: (e) => setWebsite(e.target.value) })
] }) })
] }) : null,
/* @__PURE__ */ jsx("p", { className: "form-error", role: "alert", children: error }),
/* @__PURE__ */ jsxs("div", { className: "form-nav", children: [
step > 0 ? /* @__PURE__ */ jsxs("button", { type: "button", className: "btn btn-ghost btn-back", onClick: goBack, children: [
/* @__PURE__ */ jsx(ArrowLeft, { size: 16 }),
" Voltar"
] }) : null,
step < STEPS.length - 1 ? /* @__PURE__ */ jsxs("button", { type: "button", className: "btn btn-purple", onClick: goNext, children: [
"Continuar ",
/* @__PURE__ */ jsx(ArrowRight, { size: 16 })
] }) : /* @__PURE__ */ jsx("button", { className: "btn btn-purple", type: "submit", disabled: busy, children: busy ? "Enviando..." : "RECEBER MINHA SIMULAÇÃO" })
] }),
/* @__PURE__ */ jsx("p", { className: "form-note", children: "Resposta rápida no WhatsApp · sem e-mail" }),
error ? /* @__PURE__ */ jsxs("a", { className: "form-fallback", href: whatsappUrl(requestMessage), target: "_blank", rel: "noopener noreferrer", children: [
"Enviar direto pelo WhatsApp ",
/* @__PURE__ */ jsx(ArrowUpRight, { size: 14 })
] }) : null,
/* @__PURE__ */ jsxs("p", { className: "form-lock", children: [
/* @__PURE__ */ jsx(LockKeyhole, { size: 12 }),
" Dados usados só no seu atendimento. * ",
DISCLAIMER
] })
] });
}
const VIMEO_EMBED = "https://player.vimeo.com/video/1234529233?autoplay=1&dnt=1&playsinline=1";
const featureLabel = {
suite: "Suíte",
varanda: "Varanda",
vaga: "Vaga"
};
function Product() {
const topAmenities = amenities.slice(0, 6);
const [playing, setPlaying] = useState(false);
return /* @__PURE__ */ jsx("section", { className: "product", id: "apartamentos", "aria-labelledby": "product-title", children: /* @__PURE__ */ jsxs("div", { className: "section-rail", children: [
/* @__PURE__ */ jsx("p", { className: "section-kicker", children: "Apartamentos" }),
/* @__PURE__ */ jsx("h2", { id: "product-title", children: "ESCOLHA COMO VOCÊ QUER MORAR" }),
/* @__PURE__ */ jsx("div", { className: "product-units", children: apartmentOptions.map((item) => /* @__PURE__ */ jsxs("article", { className: "product-unit", children: [
/* @__PURE__ */ jsx("div", { className: "product-unit-photo", children: /* @__PURE__ */ jsx("img", { src: item.plan, alt: `Planta ${item.label}`, width: 1200, height: 800, decoding: "async", loading: "lazy" }) }),
/* @__PURE__ */ jsxs("div", { className: "product-unit-body", children: [
/* @__PURE__ */ jsx("h3", { children: item.label }),
/* @__PURE__ */ jsx("div", { className: "product-features", children: item.features.map((f) => /* @__PURE__ */ jsx("span", { className: "product-feature", children: featureLabel[f] }, f)) })
] })
] }, `${item.label}-${item.area}`)) }),
/* @__PURE__ */ jsx("div", { className: "product-video", children: playing ? /* @__PURE__ */ jsx(
"iframe",
{
src: VIMEO_EMBED,
title: "Vídeo do empreendimento na Rua Pedro de Godói",
allow: "autoplay; fullscreen; picture-in-picture",
allowFullScreen: true
}
) : /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx("img", { src: images.hero, alt: "Fachada do empreendimento na Rua Pedro de Godói", width: 1200, height: 675, decoding: "async", loading: "lazy" }),
/* @__PURE__ */ jsx(
"button",
{
type: "button",
className: "video-play",
"aria-label": "Reproduzir vídeo do empreendimento",
onClick: () => setPlaying(true),
children: /* @__PURE__ */ jsx(Play, { size: 64, fill: "#fff" })
}
),
/* @__PURE__ */ jsx(
"button",
{
type: "button",
className: "video-tag",
onClick: () => setPlaying(true),
children: "VEJA EM 30 SEGUNDOS"
}
)
] }) }),
/* @__PURE__ */ jsx("div", { className: "product-gallery", children: topAmenities.map((item) => /* @__PURE__ */ jsxs("figure", { children: [
/* @__PURE__ */ jsx("img", { src: item.image, alt: item.name, width: 480, height: 320, decoding: "async", loading: "lazy" }),
/* @__PURE__ */ jsx("figcaption", { children: item.name })
] }, item.name)) }),
/* @__PURE__ */ jsx("p", { className: "product-note", children: "Imagens meramente ilustrativas. Varanda, suíte e vaga conforme a unidade." })
] }) });
}
const MAP_SRC = "https://www.google.com/maps?saddr=Rua+Pedro+de+God%C3%B3i,+Vila+Prudente,+S%C3%A3o+Paulo&daddr=Esta%C3%A7%C3%A3o+Vila+Prudente,+S%C3%A3o+Paulo&dirflg=w&hl=pt-BR&z=17&output=embed";
function Location() {
return /* @__PURE__ */ jsx("section", { className: "location", id: "localizacao", "aria-labelledby": "location-title", children: /* @__PURE__ */ jsxs("div", { className: "location-inner", children: [
/* @__PURE__ */ jsxs("div", { className: "location-copy", children: [
/* @__PURE__ */ jsx("p", { className: "section-kicker", children: "Localização" }),
/* @__PURE__ */ jsx("h2", { id: "location-title", children: "300 METROS ENTRE SUA CASA E O METRÔ." }),
/* @__PURE__ */ jsx("p", { className: "section-description", children: "A pé, da Rua Pedro de Godói até a Estação Vila Prudente." })
] }),
/* @__PURE__ */ jsx("div", { className: "route-map", "aria-label": "Rota a pé da Rua Pedro de Godói até a Estação Vila Prudente", children: /* @__PURE__ */ jsx(
"iframe",
{
title: "Mapa da rota da Rua Pedro de Godói até a Estação Vila Prudente",
src: MAP_SRC,
loading: "lazy",
referrerPolicy: "no-referrer-when-downgrade",
allowFullScreen: true
}
) })
] }) });
}
function Broker() {
return /* @__PURE__ */ jsxs("section", { className: "broker section-rail", id: "zaqueu", "aria-labelledby": "broker-title", children: [
/* @__PURE__ */ jsx("div", { className: "broker-portrait", children: /* @__PURE__ */ jsx("img", { src: BROKER_PHOTO, alt: "Zaqueu Farid — Especialista MCMV", width: 560, height: 720, decoding: "async", fetchPriority: "low" }) }),
/* @__PURE__ */ jsxs("div", { className: "broker-copy", children: [
/* @__PURE__ */ jsx("p", { className: "section-kicker", children: "Quem analisa seu perfil" }),
/* @__PURE__ */ jsxs("h2", { id: "broker-title", children: [
"ZAQUEU FARID",
/* @__PURE__ */ jsx("span", { children: "Especialista MCMV" })
] }),
/* @__PURE__ */ jsx("p", { children: "“Eu analiso seu perfil e mostro quais opções podem fazer sentido para você.”" }),
/* @__PURE__ */ jsxs("a", { className: "broker-phone", href: whatsappUrl("Olá, Zaqueu! Quero descobrir se consigo comprar na Rua Pedro de Godói."), target: "_blank", rel: "noopener noreferrer", children: [
/* @__PURE__ */ jsx(MessageCircle, { size: 19 }),
PHONE
] }),
/* @__PURE__ */ jsxs("a", { className: "button button-dark", href: whatsappUrl("Olá, Zaqueu! Quero descobrir se consigo comprar na Rua Pedro de Godói."), target: "_blank", rel: "noopener noreferrer", children: [
"FALAR COM ZAQUEU ",
/* @__PURE__ */ jsx(ArrowUpRight, { size: 19 })
] })
] })
] });
}
const faqs = [
{ q: "A simulação aprova o crédito?", a: "Não. Ela organiza seu perfil para o Zaqueu analisar. A aprovação depende da CAIXA e das condições do dia." },
{ q: "Preciso ter FGTS?", a: "Não é obrigatório. Se tiver saldo, ele entra na análise." },
{ q: "Posso visitar o decorado?", a: "Sim. O horário é combinado pelo WhatsApp após a simulação." }
];
function Closing() {
const [open, setOpen] = useState(0);
return /* @__PURE__ */ jsxs("section", { className: "closing", "aria-labelledby": "closing-title", children: [
/* @__PURE__ */ jsxs("h2", { id: "closing-title", children: [
"VOCÊ JÁ VIU O APÊ.",
/* @__PURE__ */ jsx("br", {}),
"AGORA DESCUBRA SE DÁ PARA VOCÊ."
] }),
/* @__PURE__ */ jsxs("ul", { className: "closing-recap", children: [
/* @__PURE__ */ jsx("li", { children: "R$ 1.000 de sinal" }),
/* @__PURE__ */ jsx("li", { children: "300m da estação" }),
/* @__PURE__ */ jsx("li", { children: "1, 2 e 3 quartos" })
] }),
/* @__PURE__ */ jsxs("div", { className: "closing-cta", children: [
/* @__PURE__ */ jsx("a", { className: "btn btn-gold btn-lg", href: "#simulador", children: "DESCOBRIR SE CONSIGO COMPRAR" }),
/* @__PURE__ */ jsx("a", { className: "btn btn-outline-light", href: whatsappUrl("Olá, Zaqueu! Quero agendar uma visita ao decorado da Rua Pedro de Godói."), target: "_blank", rel: "noopener noreferrer", children: "PREFIRO VISITAR O DECORADO" })
] }),
/* @__PURE__ */ jsx("div", { className: "closing-faq", children: faqs.map((item, index) => /* @__PURE__ */ jsxs("div", { className: open === index ? "faq-item open" : "faq-item", children: [
/* @__PURE__ */ jsxs("button", { "aria-expanded": open === index, onClick: () => setOpen(open === index ? -1 : index), children: [
item.q,
" ",
/* @__PURE__ */ jsx(ChevronDown, { size: 18 })
] }),
open === index ? /* @__PURE__ */ jsx("p", { children: item.a }) : null
] }, item.q)) })
] });
}
function StickyCta() {
const [visible, setVisible] = useState(false);
useEffect(() => {
const onScroll = () => setVisible(window.scrollY > 480);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
return /* @__PURE__ */ jsxs("div", { className: `sticky-conversion${visible ? "" : " sticky-hidden"}`, "aria-hidden": !visible, children: [
/* @__PURE__ */ jsxs("a", { className: "btn btn-purple", href: "#simulador", children: [
/* @__PURE__ */ jsx(Calculator, { size: 18 }),
" Simular agora"
] }),
/* @__PURE__ */ jsxs("a", { className: "btn btn-ghost", href: whatsappUrl("Olá, Zaqueu! Quero simular o lançamento da Rua Pedro de Godói."), target: "_blank", rel: "noopener noreferrer", children: [
/* @__PURE__ */ jsx(MessageCircle, { size: 18 }),
" WhatsApp"
] })
] });
}
function isZoomable(img) {
if (img.closest(".no-zoom, .credibility-seals, .site-header, .site-footer, .zoom-layer")) return false;
if (img.width < 64 && img.height < 64) return false;
return Boolean(img.currentSrc || img.src);
}
function ImageZoom() {
const [src, setSrc] = useState(null);
const [alt, setAlt] = useState("");
const [pinned, setPinned] = useState(false);
useEffect(() => {
const canHover = window.matchMedia("(hover: hover) and (pointer: fine)").matches;
const open = (img, pin) => {
setSrc(img.currentSrc || img.src);
setAlt(img.alt);
setPinned(pin);
};
const onOver = (event) => {
if (!canHover) return;
const target = event.target;
if (!(target instanceof HTMLImageElement) || !isZoomable(target)) return;
open(target, false);
};
const onOut = (event) => {
if (!canHover || pinned) return;
const target = event.target;
if (!(target instanceof HTMLImageElement)) return;
const next = event.relatedTarget;
if (next instanceof Node && target.contains(next)) return;
setSrc(null);
};
const onClick = (event) => {
if (canHover) return;
const target = event.target;
if (!(target instanceof HTMLImageElement) || !isZoomable(target)) return;
event.preventDefault();
open(target, true);
};
document.addEventListener("mouseover", onOver);
document.addEventListener("mouseout", onOut);
document.addEventListener("click", onClick);
return () => {
document.removeEventListener("mouseover", onOver);
document.removeEventListener("mouseout", onOut);
document.removeEventListener("click", onClick);
};
}, [pinned]);
if (!src) return null;
return /* @__PURE__ */ jsx(
"div",
{
className: pinned ? "zoom-layer pinned" : "zoom-layer",
role: "dialog",
"aria-label": alt || "Imagem ampliada",
onClick: () => setSrc(null),
children: /* @__PURE__ */ jsx("img", { src, alt })
}
);
}
function meta({
matches,
location
}) {
return seo({
matches,
location
}, {
title: "Você paga aluguel? | Sinal a partir de R$ 1.000 · Zaqueu Farid",
description: "Lançamento a 300m da Estação Vila Prudente. Sinal a partir de R$ 1.000, renda familiar bruta a partir de R$ 4.500. 1, 2 e 3 quartos. Descubra em 2 minutos se você consegue comprar."
});
}
const home = UNSAFE_withComponentProps(function HomePage() {
return /* @__PURE__ */ jsxs(Fragment, {
children: [/* @__PURE__ */ jsx("a", {
className: "skip-link",
href: "#simulador",
children: "Ir para a simulação"
}), /* @__PURE__ */ jsx(SiteHeader, {}), /* @__PURE__ */ jsxs("main", {
children: [/* @__PURE__ */ jsx(Hero, {}), /* @__PURE__ */ jsx(Conditions, {}), /* @__PURE__ */ jsx("section", {
className: "conversion",
"aria-label": "Simulação",
children: /* @__PURE__ */ jsx("div", {
className: "section-rail conversion-inner",
children: /* @__PURE__ */ jsx(LeadForm, {})
})
}), /* @__PURE__ */ jsx(Product, {}), /* @__PURE__ */ jsx(Location, {}), /* @__PURE__ */ jsx(Broker, {}), /* @__PURE__ */ jsx(Closing, {})]
}), /* @__PURE__ */ jsx(SiteFooter, {}), /* @__PURE__ */ jsx(StickyCta, {}), /* @__PURE__ */ jsx(ImageZoom, {})]
});
});
const route1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: home,
meta
}, Symbol.toStringTag, { value: "Module" }));
const STATIC_PATHS = ["/"];
function escapeXml(value) {
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'");
}
function toLoc(origin, path) {
return `${origin}${path.startsWith("/") ? path : `/${path}`}`;
}
function serializeSitemap(origin, entries) {
const urls = entries.map((entry2) => {
const loc = escapeXml(toLoc(origin, entry2.path));
const lastmod = entry2.lastmod ? `
${escapeXml(entry2.lastmod)}` : "";
return `
${loc}${lastmod}
`;
}).join("\n");
return `
${urls}
`;
}
async function getDynamicEntries() {
return [];
}
async function loader$3({
request
}) {
const origin = siteOrigin(request);
const entries = [...STATIC_PATHS.map((path) => ({
path
})), ...await getDynamicEntries()];
return new Response(serializeSitemap(origin, entries), {
headers: {
"Content-Type": "application/xml; charset=utf-8",
"Cache-Control": "public, max-age=3600",
"Access-Control-Allow-Origin": "*"
}
});
}
const route2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
loader: loader$3
}, Symbol.toStringTag, { value: "Module" }));
const UNPUBLISHED_HOST_SUFFIXES = [".app-preview.com", ".app-preview.io", ".hostingersite.com", ".hostingersite.dev"];
const AI_ANSWER_AGENTS = ["OAI-SearchBot", "ChatGPT-User", "Claude-SearchBot", "Claude-User", "PerplexityBot", "Perplexity-User", "DuckAssistBot", "MistralAI-User", "meta-webindexer", "meta-externalfetcher", "Amzn-SearchBot", "Amzn-User"];
const AI_TRAINING_AGENTS = ["GPTBot", "ClaudeBot", "Google-Extended", "Applebot-Extended", "meta-externalagent", "Amazonbot", "Bytespider"];
const CONTENT_SIGNAL = "Content-Signal: search=yes, ai-input=yes, ai-train=no";
function publishedRules(origin) {
return ["User-agent: *", CONTENT_SIGNAL, "Allow: /", "", ...AI_ANSWER_AGENTS.flatMap((agent) => [`User-agent: ${agent}`, CONTENT_SIGNAL, "Allow: /", ""]), ...AI_TRAINING_AGENTS.flatMap((agent) => [`User-agent: ${agent}`, "Disallow: /", ""]), `Sitemap: ${origin}/sitemap.xml`];
}
function loader$2({
request
}) {
const origin = siteOrigin(request);
const {
hostname
} = new URL(origin);
const isUnpublished = UNPUBLISHED_HOST_SUFFIXES.some((suffix) => hostname.endsWith(suffix));
const lines = isUnpublished ? ["User-agent: *", "Disallow: /"] : publishedRules(origin);
return new Response(`${lines.join("\n")}
`, {
headers: {
"Content-Type": "text/plain; charset=utf-8",
"Cache-Control": "public, max-age=3600"
}
});
}
const route3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
loader: loader$2
}, Symbol.toStringTag, { value: "Module" }));
const logger = {
// Application errors - goes to stdout
error: (...args) => {
console.log("[ERROR]", ...args);
},
// Critical system errors - goes to stderr
fatal: (...args) => {
console.error("[FATAL]", ...args);
},
info: (...args) => {
console.log("[INFO]", ...args);
},
debug: (...args) => {
console.log("[DEBUG]", ...args);
},
warn: (...args) => {
console.log("[WARN]", ...args);
}
};
const MS_PER_SECOND = 1e3;
const WINDOW_SECONDS = 5 * 60;
const MAX_REQUESTS_PER_WINDOW = 100;
const IPV6_PREFIX_BYTES = 7;
const clientIdentifier = (request) => {
const [forwarded] = request.headers.get("x-forwarded-for")?.split(",") ?? [];
const address = forwarded?.trim() || request.headers.get("x-real-ip")?.trim();
if (!address) {
return "unknown";
}
try {
const parsed = ipaddr.parse(address);
if (!(parsed instanceof ipaddr.IPv6)) {
return address;
}
if (parsed.isIPv4MappedAddress()) {
return parsed.toIPv4Address().toString();
}
return parsed.toByteArray().slice(0, IPV6_PREFIX_BYTES).join(".");
} catch {
return address;
}
};
const sharedLimiter = new RateLimiterMemory({
points: MAX_REQUESTS_PER_WINDOW,
duration: WINDOW_SECONDS
});
const consume = async (limiter, identifier) => {
try {
return { result: await limiter.consume(identifier), isLimited: false };
} catch (error) {
if (error instanceof RateLimiterRes) {
return { result: error, isLimited: true };
}
throw error;
}
};
const consumeRateLimit = async (identifier) => {
const { result, isLimited } = await consume(sharedLimiter, identifier);
return {
isLimited,
limit: MAX_REQUESTS_PER_WINDOW,
remaining: result.remainingPoints,
resetSeconds: Math.max(0, Math.ceil(result.msBeforeNext / MS_PER_SECOND))
};
};
const rateLimitHeaders = (verdict) => {
const headers2 = {
"RateLimit-Policy": `${verdict.limit};w=${WINDOW_SECONDS}`,
"RateLimit-Limit": String(verdict.limit),
"RateLimit-Remaining": String(verdict.remaining),
"RateLimit-Reset": String(verdict.resetSeconds)
};
if (verdict.isLimited) {
headers2["Retry-After"] = String(verdict.resetSeconds);
}
return headers2;
};
const SECURITY_HEADERS = {
"Cache-Control": "no-store",
"Content-Security-Policy": "default-src 'none'; frame-ancestors 'none'",
"Cross-Origin-Resource-Policy": "same-origin",
"Referrer-Policy": "no-referrer",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"X-Permitted-Cross-Domain-Policies": "none"
};
const withExtraHeaders = (response, extra) => {
const headers2 = new Headers(response.headers);
for (const [name, value] of Object.entries(extra)) {
if (!headers2.has(name)) {
headers2.set(name, value);
}
}
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: headers2
});
};
const json = (value, init = {}) => withExtraHeaders(Response.json(value, init), SECURITY_HEADERS);
const apiError = (status, message) => json({ error: message }, { status });
const serverError = (error) => {
const isProduction = process.env.NODE_ENV === "production";
const cause = error instanceof Error ? error : new Error(String(error));
return json(
{
message: "Something went wrong!",
...!isProduction && {
error: {
name: cause.name,
message: cause.message,
stack: cause.stack
}
}
},
{ status: 500 }
);
};
const runHandler = async (handler, args) => {
const verdict = await consumeRateLimit(clientIdentifier(args.request));
if (verdict.isLimited) {
return withExtraHeaders(apiError(429, "Too many requests, please try again later"), rateLimitHeaders(verdict));
}
const extraHeaders = rateLimitHeaders(verdict);
try {
const result = await handler(args);
const response = result instanceof Response ? withExtraHeaders(result, SECURITY_HEADERS) : json(result ?? null);
return withExtraHeaders(response, extraHeaders);
} catch (error) {
if (error instanceof Response) {
return withExtraHeaders(error, extraHeaders);
}
logger.error(error instanceof Error ? error.message : error, error instanceof Error ? error.stack : void 0);
return withExtraHeaders(serverError(error), extraHeaders);
}
};
const withApi = (handler) => {
return async (args) => {
const startedAt = Date.now();
const response = await runHandler(handler, args);
const { pathname } = new URL(args.request.url);
logger.info(`${args.request.method} ${pathname} ${response.status} ${Date.now() - startedAt}ms`);
return response;
};
};
const loader$1 = withApi(async () => json({
ok: true
}));
const route4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
loader: loader$1
}, Symbol.toStringTag, { value: "Module" }));
const notFound = withApi(async () => apiError(404, "Route not found"));
const loader = notFound;
const action = notFound;
const route5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
action,
loader
}, Symbol.toStringTag, { value: "Module" }));
const serverManifest = { "entry": { "module": "/assets/entry.client-C27bi0c1.js", "imports": ["/assets/jsx-runtime-QevHBTpY.js", "/assets/errorBoundaries-Dg_2yKML.js"], "css": [] }, "routes": { "root": { "id": "root", "parentId": void 0, "path": "", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": true, "module": "/assets/root-Bqt2B2rG.js", "imports": ["/assets/jsx-runtime-QevHBTpY.js", "/assets/errorBoundaries-Dg_2yKML.js", "/assets/landing-Bu2ZLLnT.js"], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/home": { "id": "routes/home", "parentId": "root", "path": void 0, "index": true, "caseSensitive": void 0, "hasAction": false, "hasLoader": false, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": true, "hasErrorBoundary": false, "module": "/assets/home-CC_eiBjZ.js", "imports": ["/assets/jsx-runtime-QevHBTpY.js", "/assets/landing-Bu2ZLLnT.js"], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/sitemap.xml": { "id": "routes/sitemap.xml", "parentId": "root", "path": "sitemap.xml", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/sitemap.xml-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/robots.txt": { "id": "routes/robots.txt", "parentId": "root", "path": "robots.txt", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/robots.txt-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.health": { "id": "routes/api.health", "parentId": "root", "path": "api/health", "index": void 0, "caseSensitive": void 0, "hasAction": false, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api.health-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 }, "routes/api.$": { "id": "routes/api.$", "parentId": "root", "path": "api/*", "index": void 0, "caseSensitive": void 0, "hasAction": true, "hasLoader": true, "hasClientAction": false, "hasClientLoader": false, "hasClientMiddleware": false, "hasDefaultExport": false, "hasErrorBoundary": false, "module": "/assets/api._-l0sNRNKZ.js", "imports": [], "css": [], "clientActionModule": void 0, "clientLoaderModule": void 0, "clientMiddlewareModule": void 0, "hydrateFallbackModule": void 0 } }, "url": "/assets/manifest-ab80710f.js", "version": "ab80710f", "sri": void 0 };
const assetsBuildDirectory = "../../dist/apps/web/client";
const basename = "/";
const future = { "unstable_enableNodeReadableStream": false, "unstable_optimizeDeps": false };
const ssr = true;
const isSpaMode = false;
const prerender = [];
const routeDiscovery = { "mode": "lazy", "manifestPath": "/__manifest" };
const publicPath = "/";
const entry = { module: entryServer };
const routes = {
"root": {
id: "root",
parentId: void 0,
path: "",
index: void 0,
caseSensitive: void 0,
module: route0
},
"routes/home": {
id: "routes/home",
parentId: "root",
path: void 0,
index: true,
caseSensitive: void 0,
module: route1
},
"routes/sitemap.xml": {
id: "routes/sitemap.xml",
parentId: "root",
path: "sitemap.xml",
index: void 0,
caseSensitive: void 0,
module: route2
},
"routes/robots.txt": {
id: "routes/robots.txt",
parentId: "root",
path: "robots.txt",
index: void 0,
caseSensitive: void 0,
module: route3
},
"routes/api.health": {
id: "routes/api.health",
parentId: "root",
path: "api/health",
index: void 0,
caseSensitive: void 0,
module: route4
},
"routes/api.$": {
id: "routes/api.$",
parentId: "root",
path: "api/*",
index: void 0,
caseSensitive: void 0,
module: route5
}
};
const allowedActionOrigins = false;
export {
allowedActionOrigins,
serverManifest as assets,
assetsBuildDirectory,
basename,
entry,
future,
isSpaMode,
prerender,
publicPath,
routeDiscovery,
routes,
ssr
};