#x27; + REPORT_PRICE;
const REPORT_COMMISSION_RATE = 0.2;
const REPORT_COMMISSION = (REPORT_PRICE * REPORT_COMMISSION_RATE).toFixed(2);
let currentStep = 1;
let currentLang = 'en';
function setText(id, text) {
const el = document.getElementById(id);
if (el) el.textContent = text;
}
function applyPricing() {
setText('priceDisplayHero', REPORT_PRICE_DISPLAY);
setText('priceDisplayStat', REPORT_PRICE_DISPLAY);
setText('commissionDisplayHero', '#x27; + REPORT_COMMISSION);
setText('commissionDisplayStat', '#x27; + REPORT_COMMISSION);
}
const stepSubtitles = {
en: { 1: 'Step 1 of 3 — Personal Information', 2: 'Step 2 of 3 — Professional Profile', 3: 'Step 3 of 3 — Program Agreements' },
es: { 1: 'Paso 1 de 3 — Información Personal', 2: 'Paso 2 de 3 — Perfil Profesional', 3: 'Paso 3 de 3 — Acuerdos del Programa' }
};
function applyLanguage(lang) {
currentLang = lang;
document.documentElement.lang = lang;
const isEs = lang === 'es';
const q = (s) => document.querySelector(s);
const qa = (s) => Array.from(document.querySelectorAll(s));
const setTxt = (s, v) => { const el = q(s); if (el) el.textContent = v; };
const setHtml = (s, v) => { const el = q(s); if (el) el.innerHTML = v; };
setText('step4ApplyBtn', isEs ? 'Aplicar Ahora' : 'Apply Now');
setText('heroEyebrow', isEs ? '⚡ Recibiendo solicitudes' : '⚡ Now Accepting Applications');
document.getElementById('heroTitle').innerHTML = isEs
? 'Panacomps <span>Programa Partner</span>'
: 'Panacomps <span>Partner Program</span>';
setText('heroSub', isEs ? 'Gana comisiones vendiendo reportes inmobiliarios con respaldo registral en Panamá. Recibe referidos calificados de compradores y vendedores. Fortalece tu marca profesional en panacomps.com.' : "Earn commissions selling Panama's most trusted registry-backed real estate reports. Receive qualified buyer and seller referrals. Build your professional brand on panacomps.com.");
setText('applyJoinBtn', isEs ? 'Aplicar para Unirme' : 'Apply to Join');
setText('seeHowBtn', isEs ? 'Ver Cómo Funciona' : 'See How It Works');
setText('startApplicationBtn', isEs ? 'Iniciar Solicitud' : 'Start Your Application');
const statLabels = qa('.hero-stats .stat-label');
if (statLabels.length >= 4) {
statLabels[0].textContent = isEs ? 'Precio del reporte — edificio estándar' : 'Report price — standard building';
statLabels[1].textContent = isEs ? 'Tu comisión por venta' : 'Your commission per sale';
statLabels[2].textContent = isEs ? 'Ganado por cada reporte vendido' : 'Earned per report sold';
statLabels[3].textContent = isEs ? 'De solicitud a estado activo' : 'From application to active status';
}
if (q('.section-head .section-tag')) q('.section-head .section-tag').textContent = isEs ? 'Beneficios del Programa' : 'Program Benefits';
if (q('.section-head .section-h2')) q('.section-head .section-h2').textContent = isEs ? 'Todo lo que recibes como socio Panacomps' : 'Everything you get as a Panacomps partner';
if (q('.section-head .section-lead')) q('.section-head .section-lead').textContent = isEs
? 'El programa está diseñado para cómo realmente funciona el mercado inmobiliario de Panamá: relaciones, referidos y confianza. Ganas por ambos frentes.'
: "The program is built around how Panama's real estate market actually works — relationships, referrals, and trust. You earn from both sides.";
const overviewTitles = qa('.overview-card .ov-title');
const overviewValues = qa('.overview-card .ov-value');
const overviewDescs = qa('.overview-card .ov-desc');
if (overviewTitles.length >= 6) {
const tEs = ['Comisión por Venta de Reportes', 'Referidos de Compradores y Vendedores', 'Tu Perfil en Panacomps.com', 'Menciones en Newsletter', 'Sello MICI Verificado', 'Capacitación de Producto'];
const tEn = ['Report Sales Commission', 'Buyer & Seller Referrals', 'Your Profile on Panacomps.com', 'Newsletter Features', 'MICI Verified Badge', 'Product Training'];
overviewTitles.forEach((el, i) => el.textContent = isEs ? tEs[i] : tEn[i]);
}
if (overviewValues.length >= 6) {
const vEs = ['$139.40 / venta', 'Asignación prioritaria', 'Alojado sin costo', 'Generación de leads', 'Credibilidad inmediata', 'Inducción de 45 min'];
const vEn = ['$139.40 / sale', 'Priority matching', 'Hosted free', 'Lead generation', 'Instant credibility', '45-min onboarding'];
overviewValues.forEach((el, i) => el.textContent = isEs ? vEs[i] : vEn[i]);
}
if (overviewDescs.length >= 6) {
const dEs = [
'Vende reportes de edificios de Panacomps con tu enlace único. Comisión del 20% en cada reporte de ' + REPORT_PRICE_DISPLAY + ' — pago mensual por transferencia bancaria.',
'Panacomps refiere compradores y vendedores calificados a socios en sus zonas objetivo. Asignación por área y ranking de desempeño.',
'Una página profesional en panacomps.com/agents/tu-nombre — compartible por WhatsApp, Instagram y tarjetas.',
'Los agentes activos pueden aparecer en nuestro newsletter, enviado a compradores y vendedores que investigan bienes raíces en Panamá.',
'Tu licencia MICI activa se verifica en el registro público de Panamá y se muestra en tu perfil.',
'Cada socio Panacomps completa una introducción de producto de 45 minutos para presentar los datos con seguridad desde el día uno.'
];
const dEn = [
'Sell Panacomps building reports via your unique tracking link. 20% commission on every ' + REPORT_PRICE_DISPLAY + ' report — paid monthly via bank transfer.',
'Panacomps refers qualified buyers and sellers to partners in their target neighborhoods. Matched by area and ranked by performance.',
'A professional agent page at panacomps.com/agents/your-name — shareable on WhatsApp, Instagram, and business cards.',
'Active agents may be featured in our newsletter — sent to buyers and sellers actively researching Panama real estate.',
"Your active MICI license is verified via Panama's public registry and displayed on your profile — the same tool Panacomps offers all buyers.",
'Every Panacomps partner completes a 45-minute product introduction so you can speak to the data confidently with clients from day one.'
];
overviewDescs.forEach((el, i) => el.textContent = isEs ? dEs[i] : dEn[i]);
}
const sectionTags = qa('section .section-tag');
if (sectionTags.length >= 6) {
sectionTags[1].textContent = isEs ? 'Parte 1 — Comisiones' : 'Part 1 — Commissions';
sectionTags[2].textContent = isEs ? 'Parte 2 — Referidos' : 'Part 2 — Referrals';
sectionTags[3].textContent = isEs ? 'Parte 3 — Tu Perfil' : 'Part 3 — Your Profile Page';
sectionTags[4].textContent = isEs ? 'Requisitos' : 'Requirements';
sectionTags[5].textContent = isEs ? 'Cómo Unirte' : 'How to Join';
}
const commH2 = q('#part-1-commissions .section-h2');
if (commH2) commH2.textContent = isEs ? 'Vende reportes. Gana 20% en cada transacción.' : 'Sell reports. Earn 20% on every transaction.';
const commLead = q('#part-1-commissions .section-lead');
if (commLead) commLead.textContent = isEs
? 'Cada socio Panacomps recibe un enlace único. Cuando un cliente compra un reporte de Panacomps con tu enlace, el 20% se acredita en tu cuenta, con seguimiento automático y pago mensual.'
: "Every Panacomps partner gets a unique tracking link. When a client buys a Panacomps report through your link, 20% lands in your account — automatically tracked, paid monthly.";
const earnLabel = q('.earn-box-label');
if (earnLabel) earnLabel.textContent = isEs ? 'Ejemplo — Ganancia Mensual' : 'Example — Monthly Earnings';
const earnSubs = qa('.earn-sub');
if (earnSubs.length >= 3) {
earnSubs[0].textContent = isEs ? 'reportes vendidos' : 'reports sold';
earnSubs[1].textContent = isEs ? 'por reporte' : 'per report';
earnSubs[2].textContent = isEs ? 'tu comisión' : 'your commission';
}
const payout = qa('.payout-list li');
if (payout.length >= 3) {
payout[0].innerHTML = isEs ? '<strong>Pago mensual</strong> — antes del día 10 por ventas del mes anterior' : '<strong>Paid monthly</strong> — by the 10th for prior month sales';
payout[1].innerHTML = isEs ? '<strong>Transferencia bancaria</strong> — directo a tu cuenta' : '<strong>Bank transfer</strong> — paid directly to your account';
payout[2].innerHTML = isEs ? 'Umbral mínimo de pago: <strong>$25</strong>' : 'Minimum payout threshold: <strong>$25</strong>';
}
const refTitles = qa('.ref-card h4');
const refParas = qa('.ref-card p');
if (refTitles.length >= 4 && refParas.length >= 4) {
const rtEs = ['Inversionistas extranjeros', 'Expatriados en relocalización', 'Compradores y vendedores locales', 'Compradores de reportes'];
const rtEn = ['Foreign Investors', 'Expats Relocating', 'Local Buyers & Sellers', 'Report Buyers'];
const rpEs = [
'Compradores internacionales que investigan apartamentos en Ciudad de Panamá, visas de residencia e inversiones — a menudo desde EE. UU., Canadá y Europa.',
'Expatriados y jubilados que usan Panacomps para evaluar barrios antes de mudarse. Muchos son suscriptores del boletín y ya confían en la plataforma.',
'Compradores panameños que buscan un agente basado en datos y vendedores que descubrieron Panacomps al investigar el valor de mercado de su propiedad.',
'Clientes que compraron un reporte Panacomps — ya informados, ya serios y buscando representación de un agente para cerrar la operación.'
];
const rpEn = [
'International buyers researching Panama City condos, residency visas, and investment properties — often from the US, Canada, and Europe.',
'Expats and retirees using Panacomps to evaluate neighborhoods before moving. Many are newsletter subscribers who already trust the platform.',
"Panamanian buyers looking for a data-driven agent, and sellers who discovered Panacomps while researching their own property's market value.",
'Clients who purchased a Panacomps report — already educated, already serious, and actively looking for agent representation to close the deal.'
];
refTitles.forEach((el, i) => { el.textContent = isEs ? rtEs[i] : rtEn[i]; });
refParas.forEach((el, i) => { el.textContent = isEs ? rpEs[i] : rpEn[i]; });
}
const infoTitles = qa('.info-box .info-box-title');
const infoParas = qa('.info-box > div > p');
if (infoTitles.length >= 4 && infoParas.length >= 4) {
const itEs = ['Coincidencia por barrio', 'Clasificación por desempeño', 'Requisito de respuesta', 'Tarifa de referido'];
const itEn = ['Neighborhood Matching', 'Performance Ranking', 'Response Requirement', 'Referral Fee'];
const ipEs = [
'Los referidos se asignan primero según los barrios que declaras al registrarte: solo recibes leads de las zonas donde trabajas activamente.',
'Dentro de un mismo barrio, los agentes se clasifican por volumen de ventas de reportes. Cuántos más reportes vendas, mayor tu posición en la cola de asignación.',
'Responde a los referidos en un plazo de 48 horas por WhatsApp o correo. Los tiempos de respuesta más rápidos influyen en tu posición general.',
'Aplican tarifas estándar del mercado: <strong style="color:var(--fg);">20% de tarifa de referido en cierres con comprador, 10% en cierres con vendedor</strong> — pagada desde tu comisión al cierre.'
];
const ipEn = [
'Referrals are matched first by the neighborhoods you declare at signup — you only receive leads for the areas you actively serve.',
'Within a neighborhood, agents are ranked by report sales volume. The more reports you sell, the higher your position in the matching queue.',
'Respond to referrals within 48 hours via WhatsApp or email. Faster response times are factored into your overall ranking.',
'Market-standard rates apply: <strong style="color:var(--fg);">20% referral fee on buyer closings, 10% on seller closings</strong> — paid from your commission at settlement.'
];
infoTitles.forEach((el, i) => { el.textContent = isEs ? itEs[i] : itEn[i]; });
infoParas.forEach((el, i) => { el.innerHTML = isEs ? ipEs[i] : ipEn[i]; });
}
setTxt('.profile-preview-label', isEs ? 'Vista previa del perfil' : 'Profile Page Preview');
setTxt('.profile-sample-note', isEs ? 'Perfil de ejemplo — tu página se configurará durante la incorporación.' : 'Sample profile — your page will be set up during onboarding.');
const ctaH2 = q('.cta-strip h2');
if (ctaH2) ctaH2.textContent = isEs ? '¿Listo para aplicar?' : 'Ready to apply?';
const ctaP = q('.cta-strip p');
if (ctaP) ctaP.textContent = isEs ? 'Aplica hoy y activa tu perfil en el directorio del Programa Partner Panacomps esta semana.' : 'Submit your application today and be live in the Panacomps Partner Program directory this week.';
const ctaBtns = qa('.cta-actions a, .cta-actions button');
if (ctaBtns.length >= 2) {
ctaBtns[0].textContent = isEs ? 'Iniciar Solicitud' : 'Start Your Application';
ctaBtns[1].textContent = isEs ? 'Ver Cómo Funciona' : 'See How It Works';
}
// Additional full-section translation coverage
// Explicit section heading/lead mapping (avoid index drift)
const allSectionH2 = qa('section .section-h2');
const allSectionLead = qa('section .section-lead');
if (allSectionH2.length >= 6) {
allSectionH2[1].textContent = isEs ? 'Vende reportes. Gana 20% en cada transacción.' : 'Sell reports. Earn 20% on every transaction.';
allSectionH2[2].innerHTML = isEs ? 'Te enviamos compradores y vendedores.<br>A tarifas estándar del mercado.' : 'We send you buyers and sellers.<br>At market-standard rates.';
allSectionH2[3].textContent = isEs ? 'Una presencia web profesional. Hospedada en Panacomps.' : 'A professional web presence. Hosted on Panacomps.';
allSectionH2[4].textContent = isEs ? 'Un programa selectivo con estándares profesionales.' : 'A selective program built on professional standards.';
allSectionH2[5].textContent = isEs ? 'Activo en 4 pasos' : 'Active in 4 steps';
}
if (allSectionLead.length >= 5) {
allSectionLead[1].textContent = isEs
? 'Cada día, Panacomps interactúa con compradores, inversionistas y expatriados que investigan bienes raíces en Ciudad de Panamá. Cuando están listos para un agente, los referimos a socios Panacomps en la zona correcta.'
: "Every day, Panacomps interacts with buyers, investors, and expats researching Panama City real estate. When they're ready for an agent, we refer them to Panacomps partners in the right neighborhood. This is why most agents join — the referral flow.";
allSectionLead[2].textContent = isEs
? 'Cada socio Panacomps recibe una página de perfil profesional en panacomps.com, tengas o no tu propio sitio web.'
: "Every Panacomps partner gets a free, professionally formatted profile page on panacomps.com — whether or not you have your own website. Panama's buyers search for agents online before they make contact. This puts you there.";
allSectionLead[3].textContent = isEs
? 'El Programa Partner Panacomps está reservado para profesionales licenciados comprometidos con una experiencia verificada y basada en datos.'
: 'The Panacomps Partner Program is reserved for licensed professionals who are committed to delivering a verified, data-driven experience to their clients.';
allSectionLead[4].textContent = isEs
? 'Desde la solicitud hasta tu primer referido en menos de 48 horas.'
: 'From application to your first referral in under 48 hours.';
}
const stepTitles = qa('.step-title');
const stepDescs = qa('.step-desc');
if (stepTitles.length >= 4 && stepDescs.length >= 4) {
const tEs = ['Enviar tu Solicitud', 'Verificación de Licencia MICI', 'Introducción y Capacitación de Producto', 'Activación — Link, Perfil y Referidos'];
const tEn = ['Submit Your Application', 'MICI License Verification', 'Product Introduction & Training', 'Go Live — Link, Profile, and Referrals'];
stepTitles.forEach((el, i) => el.textContent = isEs ? tEs[i] : tEn[i]);
const dEs = [
'Completa la solicitud en línea (3 minutos). Incluye tu licencia MICI, zonas que cubres y un perfil breve.',
'Verificamos tu licencia en el registro público de MICI en menos de 24 horas.',
'Asiste a una sesión de 45 minutos para aprender a presentar reportes y usar tu enlace de seguimiento.',
'Tu perfil se publica, se activa tu enlace y entras a la cola de referidos para tus zonas.'
];
const dEn = [
"Complete the online application — takes about 3 minutes. You'll provide your MICI license number, the neighborhoods you cover, and a short professional profile. Start your application →",
"We verify your license using Panama's MICI public registry — the same tool Panacomps offers to all buyers on the site. This takes under 24 hours.",
"Attend a 45-minute product introduction session. You'll learn how to read and present Panacomps reports, how the referral system works, and how to use your tracking link effectively.",
"Your profile goes live on panacomps.com, your tracking link is activated, and you're added to the referral matching queue for the neighborhoods you serve. Use your link during client due diligence, introduce reports as part of your advisory process, and let the referral flow begin."
];
stepDescs.forEach((el, i) => el.textContent = isEs ? dEs[i] : dEn[i]);
}
const reqLabels = qa('.req-label');
const reqTitles = qa('.req-title');
const reqDescs = qa('.req-desc');
if (reqLabels.length >= 6 && reqTitles.length >= 6) {
const lEs = ['Requisito', 'Onboarding', 'Actividad', 'Tiempo de Respuesta', 'Conducta', 'Estado Inactivo'];
const lEn = ['Required', 'Onboarding', 'Activity', 'Response Time', 'Conduct', 'Inactive Status'];
const tEs = ['Licencia MICI Activa', 'Capacitación de 45 Minutos', '2 Reportes por Trimestre', 'Respuesta en 48 Horas', 'Estándares Profesionales', 'Reactivación Simple'];
const tEn = ['Active MICI License', '45-Minute Product Training', '2 Reports per Quarter', '48-Hour Reply on Referrals', 'Professional Standards', 'Easy to Reinstate'];
reqLabels.forEach((el, i) => el.textContent = isEs ? lEs[i] : lEn[i]);
reqTitles.forEach((el, i) => el.textContent = isEs ? tEs[i] : tEn[i]);
}
if (reqDescs.length >= 6) {
const dEs = [
'Debes tener licencia válida con el MICI. Verificación automática en menos de 24 horas.',
'Todos los socios Panacomps completan una introducción de producto de 45 minutos antes de la activación.',
'Vende al menos 2 reportes de Panacomps por trimestre para mantener estado Activo y continuar en la rotación.',
'Responde referidos de Panacomps dentro de 48 horas por WhatsApp o correo.',
'Panacomps se reserva el derecho de remover agentes por conducta no profesional.',
'Si bajas del umbral, pasas a Inactivo hasta recualificar. La reactivación es inmediata.'
];
const dEn = [
"You must hold a valid license with Panama's Ministry of Commerce and Industry (MICI). Verified automatically — takes under 24 hours.",
'All Panacomps partners complete a 45-minute product introduction before activation — so you can present Panacomps data confidently to clients.',
'Sell at least 2 Panacomps reports per quarter to maintain Active status and stay in the referral rotation.',
'Respond to Panacomps referrals within 48 hours via WhatsApp or email. Faster response improves your position in the matching queue.',
'Panacomps reserves the right to remove agents for unprofessional behavior. We represent the same clients — our reputation is shared.',
'Agents who fall below the activity threshold move to Inactive — removed from the referral rotation until they requalify. Reinstatement is immediate.'
];
reqDescs.forEach((el, i) => el.textContent = isEs ? dEs[i] : dEn[i]);
}
// Commissions table and testimonial
const ths = qa('.data-table th');
if (ths.length >= 3) {
ths[0].textContent = isEs ? 'Tipo de Reporte' : 'Report Type';
ths[1].textContent = isEs ? 'Precio' : 'Price';
ths[2].textContent = isEs ? 'Tu Comisión' : 'Your Cut';
}
const rowMain = qa('.data-table tbody tr td:first-child > div:first-child');
const rowSub = qa('.data-table tbody tr td:first-child > div:nth-child(2)');
if (rowMain.length >= 3 && rowSub.length >= 3) {
rowMain[0].textContent = isEs ? 'Reporte Estándar de Edificio' : 'Standard Building Report';
rowMain[1].textContent = isEs ? 'Reporte Personalizado / Historial Completo' : 'Custom / Full History Report';
rowMain[2].textContent = isEs ? 'Referido Pro Access' : 'Pro Access Referral';
rowSub[0].textContent = isEs ? '10 comparables más recientes, 2–3 días hábiles' : '10 most recent comps, 2–3 business days';
rowSub[1].textContent = isEs ? 'Más de 10 comparables, historial completo del edificio' : 'More than 10 comps, full building history';
rowSub[2].textContent = isEs ? 'Equipos, API, dashboard — corredoras y fondos' : 'Teams, API, dashboard — brokerages & funds';
}
const tdMuted = qa('.data-table tbody tr td[style*=\"muted-fg\"]');
if (tdMuted.length >= 2) {
tdMuted[0].textContent = isEs ? 'Cotización personalizada' : 'Custom quoted';
tdMuted[1].textContent = isEs ? 'Precio personalizado' : 'Custom pricing';
}
const tdPrimary = qa('.data-table .td-primary');
if (tdPrimary.length >= 3) {
tdPrimary[1].textContent = isEs ? '20% de la factura' : '20% of invoice';
tdPrimary[2].textContent = isEs ? '20% del primer pago' : '20% first payment';
}
setTxt('.testimonial-text', isEs ? '"Panacomps me ahorró horas de búsqueda manual en el Registro Público y me permitió dar a mis clientes internacionales los datos verificados que esperan de un broker profesional."' : "\"Panacomps saved me hours of manually searching the Registro Público for comps and let me give my international clients the verified data they expect from a professional broker.\"");
// Profile section details
const profileItems = qa('.profile-list li');
if (profileItems.length >= 6) {
profileItems[0].textContent = isEs ? 'Nombre profesional, foto, bio y años de experiencia' : 'Professional name, photo, bio, and years of experience';
profileItems[1].textContent = isEs ? 'Sello de licencia MICI activa — verificada automáticamente' : 'Active MICI license badge — verified automatically via Panama\'s public registry';
profileItems[2].textContent = isEs ? 'Zonas que atiendes, idiomas y especialidades' : 'Neighborhoods served, languages spoken, specializations';
profileItems[3].textContent = isEs ? 'Botón de WhatsApp en un clic — como realmente se manejan los leads en Panamá' : 'One-click WhatsApp button — how Panama actually runs on leads';
profileItems[4].textContent = isEs ? 'Sello de Partner Panacomps verificado con tu enlace único' : 'Verified Panacomps Partner badge with your unique referral link';
profileItems[5].innerHTML = isEs ? 'URL: <span style=\"color:var(--primary); font-weight:700;\">panacomps.com/agents/tu-nombre</span> — compartible en cualquier canal' : 'URL: <span style=\"color:var(--primary); font-weight:700;\">panacomps.com/agents/your-name</span> — shareable anywhere';
}
setHtml('.violet-box', isEs ? '<strong>¿No tienes sitio web todavía?</strong> Este programa es para ti. Muchos agentes independientes en Panamá dependen de WhatsApp y del voz a voz. Tu perfil en Panacomps te da presencia profesional online para compartir de inmediato, sin tecnología adicional.' : "<strong>Don't have a website yet?</strong> This is for you. Many independent agents in Panama rely entirely on WhatsApp and word of mouth. Your Panacomps profile gives you a professional online presence you can share immediately — no tech required.");
setTxt('.profile-sub', isEs ? 'Agente Inmobiliario Licenciado · Ciudad de Panamá' : 'Licensed Real Estate Agent · Panama City');
setTxt('.profile-badge', isEs ? '✓ MICI Activo' : '✓ MICI Active');
const profileFieldLabels = qa('.profile-field-label');
if (profileFieldLabels.length >= 4) {
profileFieldLabels[0].textContent = isEs ? 'Licencia #' : 'License #';
profileFieldLabels[1].textContent = isEs ? 'Zonas Cubiertas' : 'Areas Covered';
profileFieldLabels[2].textContent = isEs ? 'Idiomas' : 'Languages';
profileFieldLabels[3].textContent = isEs ? 'Experiencia' : 'Experience';
}
const profileFieldVals = qa('.profile-field-val');
if (profileFieldVals.length >= 4) {
profileFieldVals[2].textContent = isEs ? 'Español, Inglés' : 'Spanish, English';
profileFieldVals[3].textContent = isEs ? '8 años en Ciudad de Panamá' : '8 years in Panama City';
}
setHtml('.profile-url', isEs ? 'URL del perfil: <span>panacomps.com/agents/juan-rodriguez</span>' : 'Profile URL: <span>panacomps.com/agents/juan-rodriguez</span>');
setTxt('.profile-whatsapp', isEs ? '💬 Contactar por WhatsApp' : '💬 Contact on WhatsApp');
// CTA note
setHtml('.cta-note', isEs ? '¿Preguntas? Escribe a <a href=\"mailto:info@panacomps.com\">info@panacomps.com</a> · Respondemos en 24 horas.' : 'Questions? Email <a href=\"mailto:info@panacomps.com\">info@panacomps.com</a> · We respond within 24 hours.');
// Modal full translation
setText('modalTitle', isEs ? 'Solicitud — Programa Partner Panacomps' : 'Panacomps Partner Program Application');
setText('step1Intro', isEs ? 'Cuéntanos un poco sobre ti. Todos los campos con * son obligatorios.' : 'Tell us a little about yourself. All fields marked * are required.');
setText('labelFirstName', isEs ? 'Nombre *' : 'First name *');
setText('labelLastName', isEs ? 'Apellido *' : 'Last name *');
setText('labelEmail', isEs ? 'Correo electrónico *' : 'Email address *');
document.getElementById('labelPhone').innerHTML = isEs ? 'WhatsApp / Teléfono <span>(recomendado)</span>' : 'WhatsApp / Phone number <span>(recommended)</span>';
setText('nextToProfessional', isEs ? 'Siguiente — Perfil Profesional' : 'Next — Professional Info');
setText('step2Intro', isEs ? 'Tu perfil profesional nos ayuda a verificar tu licencia y asignarte los referidos correctos.' : 'Your professional background helps us verify your license and match you to the right referrals.');
setText('nextToAgreements', isEs ? 'Siguiente — Acuerdos' : 'Next — Agreements');
setText('step3Intro', isEs ? 'Ya casi. Revisa y confirma los términos antes de enviar.' : 'Almost there. Please review and confirm the program terms before submitting.');
setText('submitApplicationLabel', isEs ? 'Enviar Solicitud' : 'Submit Application');
setText('successTitle', isEs ? '¡Solicitud Recibida!' : 'Application Received!');
setText('stepLabel', (isEs ? 'Paso ' : 'Step ') + currentStep + ' / 3');
if (document.getElementById('modalSubtitle')) document.getElementById('modalSubtitle').textContent = stepSubtitles[lang][currentStep];
const backBtns = qa('.btn-back');
backBtns.forEach((el) => { el.textContent = isEs ? '← Atrás' : '← Back'; });
const formHints = qa('.form-hint');
if (formHints.length >= 3) {
formHints[0].textContent = isEs ? 'Usamos WhatsApp para coordinar tu capacitación y enviar referidos.' : 'We use WhatsApp to coordinate your training session and send referrals.';
formHints[1].textContent = isEs ? 'Validamos esto en el registro público de MICI en menos de 24 horas.' : "We verify this via Panama's MICI public registry within 24 hrs.";
formHints[2].textContent = isEs ? 'Separa varias zonas con comas. Los referidos se asignan por estas áreas.' : 'Separate multiple neighborhoods with commas. Referrals are matched to these areas.';
}
const errors = {
'err-firstName': isEs ? 'Por favor ingresa tu nombre.' : 'Please enter your first name.',
'err-lastName': isEs ? 'Por favor ingresa tu apellido.' : 'Please enter your last name.',
'err-email': isEs ? 'Por favor ingresa un correo válido.' : 'Please enter a valid email address.',
'err-miciLicense': isEs ? 'Por favor ingresa tu licencia MICI.' : 'Please enter your MICI license number.',
'err-yearsExp': isEs ? 'Selecciona tus años de experiencia.' : 'Please select your years of experience.',
'err-neighborhoods': isEs ? 'Indica al menos una zona.' : 'Please list at least one neighborhood.',
'err-languages': isEs ? 'Indica los idiomas que hablas.' : 'Please list the languages you speak.',
'err-checks': isEs ? 'Confirma todos los puntos antes de enviar.' : 'Please confirm all items above before submitting.'
};
Object.entries(errors).forEach(([id, text]) => setText(id, text));
const checkRows = qa('.check-row-text');
if (checkRows.length >= 4) {
checkRows[0].innerHTML = isEs ? 'Entiendo que la <strong>capacitación de 45 minutos</strong> es obligatoria antes de activar mi perfil y recibir referidos.' : 'I understand that completing the <strong>45-minute product training</strong> is required before my profile goes live and I begin receiving referrals.';
checkRows[1].innerHTML = isEs ? 'Acepto la estructura de referidos: <strong>20% comprador</strong> y <strong>10% vendedor</strong>, pagado desde mi comisión al cierre.' : 'I agree to the standard referral fee structure: <strong>20% on buyer closings</strong> and <strong>10% on seller closings</strong>, paid from my commission at settlement.';
checkRows[2].innerHTML = isEs ? 'Entiendo el requisito de actividad: mínimo de <strong>2 reportes por trimestre</strong> para mantener estado Activo.' : 'I understand the activity requirement: selling a minimum of <strong>2 Panacomps reports per quarter</strong> to maintain Active status and stay in the referral rotation.';
checkRows[3].innerHTML = isEs ? 'Me comprometo a responder referidos en <strong>48 horas</strong> por WhatsApp o correo.' : 'I commit to responding to Panacomps referrals within <strong>48 hours</strong> via WhatsApp or email.';
}
setHtml('.training-callout', isEs
? '<strong>📅 Capacitación de Producto de 45 Minutos Requerida</strong><br>Todos los socios Panacomps deben completar una sesión de introducción antes de activarse. Una vez aprobada tu solicitud, te contactaremos por WhatsApp o correo para agendar.'
: "<strong>📅 45-Minute Product Training Required</strong><br>All Panacomps partners must complete a product introduction session before going live. Once your application is approved, we'll reach out via WhatsApp or email to schedule a time that works for you.");
setTxt('.success-body', isEs
? 'Gracias por aplicar al Programa Partner Panacomps. Revisaremos tu solicitud y verificaremos tu licencia MICI en aproximadamente 24 horas.'
: "Thank you for applying to the Panacomps Partner Program. We'll review your application and verify your MICI license — typically within 24 hours.");
setHtml('.success-note', isEs
? 'Una vez aprobada, te contactaremos para agendar tu <strong>capacitación de 45 minutos</strong>. Después, activamos tu perfil y tu enlace.'
: "Once approved, we'll contact you via WhatsApp or email to schedule your <strong>45-minute product training</strong> session. After training, your profile and tracking link go live.");
}
function openModal() {
document.getElementById('appModal').classList.add('open');
document.body.style.overflow = 'hidden';
goToStep(1, true);
}
function closeModal() {
document.getElementById('appModal').classList.remove('open');
document.body.style.overflow = '';
}
function handleOverlayClick(e) {
if (e.target === document.getElementById('appModal')) closeModal();
}
function scrollToCommissions(e) {
if (e) e.preventDefault();
const target = document.getElementById('part-1-commissions');
if (target) {
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
history.replaceState(null, '', '#part-1-commissions');
}
}
function setStep(n) {
// Panels
['step1','step2','step3','stepSuccess'].forEach(id => {
document.getElementById(id).classList.remove('active');
});
// Header visibility
const header = document.getElementById('modalHeader');
if (n === 'success') {
document.getElementById('stepSuccess').classList.add('active');
header.style.display = 'none';
return;
}
header.style.display = '';
document.getElementById('step' + n).classList.add('active');
// Progress
const pct = Math.round((n / 3) * 100);
document.getElementById('progressFill').style.width = pct + '%';
document.getElementById('stepLabel').textContent = (currentLang === 'es' ? 'Paso ' : 'Step ') + n + ' / 3';
document.getElementById('modalSubtitle').textContent = stepSubtitles[currentLang][n];
currentStep = n;
}
function goToStep(n, init) {
if (!init && !validateStep(currentStep)) return;
setStep(n);
document.getElementById('modalBox').scrollTop = 0;
}
function clearErrors() {
document.querySelectorAll('.form-error').forEach(el => el.classList.remove('visible'));
}
function showError(id) {
document.getElementById(id).classList.add('visible');
}
function validateStep(n) {
clearErrors();
let ok = true;
if (n === 1) {
const fn = document.getElementById('firstName').value.trim();
const ln = document.getElementById('lastName').value.trim();
const em = document.getElementById('email').value.trim();
if (!fn) { showError('err-firstName'); ok = false; }
if (!ln) { showError('err-lastName'); ok = false; }
if (!em || !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(em)) { showError('err-email'); ok = false; }
}
if (n === 2) {
const lic = document.getElementById('miciLicense').value.trim();
const exp = document.getElementById('yearsExp').value;
const nb = document.getElementById('neighborhoods').value.trim();
const lg = document.getElementById('languages').value.trim();
if (!lic) { showError('err-miciLicense'); ok = false; }
if (!exp) { showError('err-yearsExp'); ok = false; }
if (!nb) { showError('err-neighborhoods'); ok = false; }
if (!lg) { showError('err-languages'); ok = false; }
}
if (n === 3) {
const checks = ['chk-training','chk-referral','chk-activity','chk-response'];
const allChecked = checks.every(id => document.getElementById(id).checked);
if (!allChecked) { showError('err-checks'); ok = false; }
}
return ok;
}
async function submitApplication() {
if (!validateStep(3)) return;
const btn = document.getElementById('submitBtn');
btn.disabled = true;
btn.textContent = currentLang === 'es' ? 'Enviando…' : 'Submitting…';
const firstName = document.getElementById('firstName').value.trim();
const lastName = document.getElementById('lastName').value.trim();
const email = document.getElementById('email').value.trim();
const countryCode= document.getElementById('countryCode').value;
const phone = document.getElementById('phone').value.trim();
const mici = document.getElementById('miciLicense').value.trim();
const years = document.getElementById('yearsExp').value;
const agency = document.getElementById('agencyName').value.trim();
const hoods = document.getElementById('neighborhoods').value.trim();
const langs = document.getElementById('languages').value.trim();
const bio = document.getElementById('specialties').value.trim();
const fullPhone = phone ? countryCode + ' ' + phone : 'Not provided';
const message = [
'=== PANACOMPS PARTNER PROGRAM APPLICATION ===',
'',
'— Personal Information —',
'Name: ' + firstName + ' ' + lastName,
'Email: ' + email,
'Phone/WhatsApp: ' + fullPhone,
'',
'— Professional Profile —',
'MICI License #: ' + mici,
'Years of Experience: ' + years,
'Agency / Brokerage: ' + (agency || 'Independent'),
'Neighborhoods: ' + hoods,
'Languages: ' + langs,
'Specialties / Bio: ' + (bio || 'Not provided'),
'',
'— Program Agreements Confirmed —',
'✓ 45-minute product training requirement acknowledged',
'✓ Referral fee structure agreed (20% buyer / 10% seller)',
'✓ Activity requirement acknowledged (2 reports/quarter)',
'✓ 48-hour referral response commitment confirmed',
].join('\n');
const payload = {
name: firstName + ' ' + lastName,
email: email,
phoneNumber: phone ? countryCode + phone : '',
subject: 'Panacomps Partner Program Application — ' + firstName + ' ' + lastName,
message: message,
requestType: 'agent_program_application',
};
try {
const res = await fetch('/api/contact-requests', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
});
if (!res.ok) throw new Error('Server error');
setStep('success');
} catch (err) {
// Fallback: open mailto if API unavailable (draft mode)
const subject = encodeURIComponent('Panacomps Partner Program Application — ' + firstName + ' ' + lastName);
const body = encodeURIComponent(message);
window.location.href = 'mailto:info@panacomps.com?subject=' + subject + '&body=' + body;
setStep('success');
} finally {
btn.disabled = false;
btn.textContent = (currentLang === 'es' ? 'Enviar Solicitud' : 'Submit Application') + ' ✓';
}
}
// Close on Escape key
document.addEventListener('keydown', e => {
if (e.key === 'Escape') closeModal();
});
// Language: driven by main site header (react-i18next) via postMessage
window.addEventListener('message', function (ev) {
if (!ev.data || ev.data.type !== 'panacomps-partner-lang') return;
var lang = ev.data.lang === 'es' ? 'es' : 'en';
applyLanguage(lang);
});
applyPricing();
applyLanguage('en');
</script>
</body>
</html>
" class="w-full flex-1 min-h-[calc(100vh-5rem)] border-0 block" sandbox="allow-forms allow-modals allow-popups allow-scripts allow-same-origin allow-downloads">