{"version":3,"file":"WithBilingualTextBlog.CEGi843U.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/w7xKjCjxc8gA9u1ZD3l8/0Pqa52vgFSLlxAkeMw0k/WithBilingualTextBlog.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{useLanguage}from\"https://framerusercontent.com/modules/QriWEv2o0RvZgtp6i8Ql/ZlTzxQLTWIGCe9C5pzDO/LanguageContext.js\";// ========================================\n// DICCIONARIO — BLOG / NEWSROOM\n// ========================================\nconst translations={// ========================================\n// HERO\n// ========================================\nNEWSROOM:\"NEWSROOM\",\"Descubre las historias, avances y proyectos que reflejan nuestra evoluci\\xf3n y compromiso con la arquitectura.\":\"Discover the stories, progress, and projects that reflect our evolution and commitment to architecture.\",// ========================================\n// ENCABEZADO\n// ========================================\n\"(01)\":\"(01)\",ARTICULOS:\"ARTICLES\",ARTÍCULOS:\"ARTICLES\",MX:\"MX\",\"Metric Development\":\"Metric Development\",gvbbb:\"gvbbb\",// ========================================\n// INTRODUCCIÓN\n// ========================================\n\"Descubre las ideas, los proyectos y los acontecimientos que reflejan nuestra evoluci\\xf3n y la visi\\xf3n que construimos cada d\\xeda.\":\"Discover the ideas, projects, and events that reflect our evolution and the vision we build every day.\",// Variante con saltos de línea\n\"Descubre las ideas,\\nlos proyectos y los acontecimientos\\nque reflejan nuestra evoluci\\xf3n\\ny la visi\\xf3n que construimos cada d\\xeda.\":\"Discover the ideas,\\nprojects, and events\\nthat reflect our evolution\\nand the vision we build every day.\",// Variante sin espacios entre nodos internos de Framer\n\"Descubre las ideas,los proyectos y los acontecimientosque reflejan nuestra evoluci\\xf3ny la visi\\xf3n que construimos cada d\\xeda.\":\"Discover the ideas, projects, and events that reflect our evolution and the vision we build every day.\",// ========================================\n// FECHAS Y CATEGORÍAS\n// ========================================\n\"Inversi\\xf3n | junio 2, 2026\":\"Investment | June 2, 2026\",\"Inversi\\xf3n | 2 de junio, 2026\":\"Investment | June 2, 2026\",Inversión:\"Investment\",// ========================================\n// ARTÍCULO 01\n// ========================================\n\"EL FUTURO DEL DESARROLLO INMOBILIARIO\":\"THE FUTURE OF REAL ESTATE DEVELOPMENT\",// ========================================\n// ARTÍCULO 02\n// ========================================\n\"EL VALOR DE INVERTIR EN DESTINOS CON VISI\\xd3N DE FUTURO\":\"THE VALUE OF INVESTING IN DESTINATIONS WITH A VISION FOR THE FUTURE\",// ========================================\n// ARTÍCULO 03\n// ========================================\n\"ARQUITECTURA QUE TRANSFORMA LA MANERA DE HABITAR\":\"ARCHITECTURE THAT TRANSFORMS THE WAY WE LIVE\",// ========================================\n// ARTÍCULO 04\n// ========================================\n\"ESPACIOS DISE\\xd1ADOS PARA UNA VIDA EN EQUILIBRIO\":\"SPACES DESIGNED FOR A BALANCED LIFE\",// ========================================\n// ARTÍCULO 05\n// ========================================\n\"LA VISI\\xd3N QUE IMPULSA CADA DESARROLLO\":\"THE VISION BEHIND EVERY DEVELOPMENT\",// ========================================\n// ARTÍCULO 06\n// ========================================\n\"LA MATERIALIDAD COMO ESENCIA DEL DISE\\xd1O CONTEMPOR\\xc1NEO\":\"MATERIALITY AS THE ESSENCE OF CONTEMPORARY DESIGN\",// ========================================\n// BOTONES\n// ========================================\n\"Ver entradas\":\"View entries\",\"ver entradas\":\"view entries\",\"VER ENTRADAS\":\"VIEW ENTRIES\",\"Ver entrada\":\"View entry\",\"ver entrada\":\"view entry\",\"VER ENTRADA\":\"VIEW ENTRY\"};// ========================================\n// OBTENER NODOS DE TEXTO\n// ========================================\nfunction getTextNodes(element){const walker=document.createTreeWalker(element,NodeFilter.SHOW_TEXT);const nodes=[];let currentNode;while(currentNode=walker.nextNode()){nodes.push(currentNode);}return nodes;}// ========================================\n// NORMALIZAR TEXTO\n// ========================================\n// Evita errores de traducción provocados por:\n// - Saltos de línea\n// - Espacios repetidos\n// - Espacios invisibles\n// - Caracteres especiales introducidos por Framer\nfunction normalizeText(text){return text.replace(/\\u00A0/g,\" \").replace(/\\u2028/g,\" \").replace(/\\u2029/g,\" \").replace(/\\uFEFF/g,\"\").replace(/[‘’]/g,\"'\").replace(/\\s+/g,\" \").trim();}// ========================================\n// BUSCAR TRADUCCIÓN\n// ========================================\nfunction findTranslation(originalNodes){// Framer puede dividir una frase en varios nodos.\nconst joinedNormally=normalizeText(originalNodes.join(\"\"));// Esta variante sirve cuando Framer elimina los espacios\n// entre distintos nodos internos.\nconst joinedWithSpaces=normalizeText(originalNodes.join(\" \"));const translationEntry=Object.entries(translations).find(([spanishText])=>{const normalizedSpanish=normalizeText(spanishText);return normalizedSpanish===joinedNormally||normalizedSpanish===joinedWithSpaces;});return translationEntry?.[1];}// ========================================\n// OVERRIDE BILINGÜE DEL BLOG\n// ========================================\nexport function withBilingualTextBlog(Component){return props=>{const[node,setNode]=useState(null);// Conserva cada nodo original por separado para\n// restaurar correctamente el español.\nconst originalNodesRef=useRef(null);const{lang}=useLanguage();useEffect(()=>{if(!node)return;const textNodes=getTextNodes(node);// Guarda el contenido original solamente\n// la primera vez que se carga el componente.\nif(originalNodesRef.current===null){originalNodesRef.current=textNodes.map(textNode=>textNode.nodeValue||\"\");}const originalNodes=originalNodesRef.current;const translated=findTranslation(originalNodes);if(lang===\"en\"&&translated){// Coloca toda la traducción en el primer nodo.\n// Los demás se limpian sin modificar el estilo\n// general de la capa.\ntextNodes.forEach((textNode,index)=>{textNode.nodeValue=index===0?translated:\"\";});}else{// Restaura el español y su estructura original.\ntextNodes.forEach((textNode,index)=>{textNode.nodeValue=originalNodes[index]??\"\";});}},[lang,node]);return /*#__PURE__*/_jsx(Component,{...props,ref:setNode});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withBilingualTextBlog\":{\"type\":\"reactHoc\",\"name\":\"withBilingualTextBlog\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithBilingualTextBlog.map"],"mappings":"qLAyCA,SAAS,EAAa,EA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