Preguntas frecuentes

Encuentra respuestas sobre acceso, pagos, certificados y soporte. Usa la búsqueda instantánea para filtrar por palabras clave.

0

Base de ayuda

Resultados en tiempo real

No encuentro mi respuesta

Cuéntanos tu duda y te responderemos lo antes posible. Campos obligatorios marcados.

0/800

Cookies y preferencias

Usamos cookies para recordar tu tema y mejorar la experiencia. Puedes aceptar o ajustar.

Necesarias

Imprescindibles para funciones básicas (ej. recordar consentimiento).

Siempre activas

Preferencias

Guardan ajustes como el modo claro/oscuro.

Analítica

Nos ayuda a entender uso del FAQ (sin datos sensibles).

`; }; const fallbackFooter = () => { footerMount.innerHTML = ` `; const yn = u1z8b('#yNow'); if(yn) yn.textContent = new Date().getFullYear(); }; const fetchInto = async (url, mount, fallbackFn) => { try{ const res = await fetch(url, {cache:'no-store'}); if(!res.ok) throw new Error('bad status'); const html = await res.text(); mount.innerHTML = html; }catch(e){ fallbackFn(); } }; await Promise.all([ fetchInto('./header.html', headerMount, fallbackHeader), fetchInto('./footer.html', footerMount, fallbackFooter) ]); }; const initAccordion = () => { const items = w6k2t('#faqList > li'); items.forEach((li)=>{ const btn = u1z8b('button', li); const panel = li.querySelector('div.px-4.pb-4') || li.querySelector('div:nth-child(2)'); const icon = li.querySelector('svg'); const close = () => { btn.setAttribute('aria-expanded','false'); if(panel) panel.classList.add('hidden'); if(icon){ icon.style.transform = 'rotate(0deg)'; } }; const open = () => { btn.setAttribute('aria-expanded','true'); if(panel) panel.classList.remove('hidden'); if(icon){ icon.style.transform = 'rotate(180deg)'; } }; close(); btn.addEventListener('click', ()=>{ const isOpen = btn.getAttribute('aria-expanded') === 'true'; items.forEach(o=>{ if(o!==li){ const b = u1z8b('button', o); const p = o.querySelector('div.px-4.pb-4') || o.querySelector('div:nth-child(2)'); const i = o.querySelector('svg'); if(b) b.setAttribute('aria-expanded','false'); if(p) p.classList.add('hidden'); if(i) i.style.transform = 'rotate(0deg)'; } }); if(isOpen) close(); else open(); }); }); }; const normalize = (s) => (s||'') .toString() .toLowerCase() .normalize('NFD') .replace(/[\u0300-\u036f]/g,'') .replace(/\s+/g,' ') .trim(); const initSearch = () => { const input = u1z8b('#qSearch'); const clearBtn = u1z8b('#qClear'); const count = u1z8b('#qCount'); const list = u1z8b('#faqList'); const noRes = u1z8b('#noResults'); const resetBtn = u1z8b('#qResetSearch'); const items = w6k2t('#faqList > li'); const textIndex = items.map(li=>{ const q = li.getAttribute('data-q') || ''; const title = (li.querySelector('button span span.block.font-extrabold')?.textContent) || li.querySelector('button')?.textContent || ''; const snippet = (li.querySelector('button span span.block.mt-1')?.textContent) || ''; const body = (li.querySelector('div.px-4.pb-4')?.textContent) || ''; return normalize([q,title,snippet,body].join(' ')); }); const setCount = (n, total) => { count.textContent = String(n); count.classList.remove('bg-brand/15','text-brand','ring-brand/25','bg-emerald-400/10','text-emerald-200','ring-emerald-400/20','bg-rose-400/10','text-rose-200','ring-rose-400/20'); if(n === 0){ count.classList.add('bg-rose-400/10','text-rose-200','ring-rose-400/20','ring-1'); }else if(n < total){ count.classList.add('bg-brand/15','text-brand','ring-brand/25','ring-1'); }else{ count.classList.add('bg-emerald-400/10','text-emerald-200','ring-emerald-400/20','ring-1'); } }; const filter = (qRaw) => { const q = normalize(qRaw); let visible = 0; items.forEach((li, idx)=>{ const hit = q.length === 0 ? true : textIndex[idx].includes(q); li.classList.toggle('hidden', !hit); if(hit) visible++; }); const total = items.length; setCount(visible, total); if(q.length > 0){ clearBtn.classList.remove('hidden'); }else{ clearBtn.classList.add('hidden'); } const any = visible > 0; if(any){ noRes.classList.add('hidden'); list.classList.remove('hidden'); }else{ noRes.classList.remove('hidden'); list.classList.remove('hidden'); } const hQuery = u1z8b('#hQuery'); if(hQuery) hQuery.value = qRaw || ''; }; input.addEventListener('input', ()=>filter(input.value)); clearBtn.addEventListener('click', ()=>{ input.value = ''; input.focus(); filter(''); }); resetBtn.addEventListener('click', ()=>{ input.value = ''; input.focus(); filter(''); }); w6k2t('button[data-chip]').forEach(btn=>{ btn.addEventListener('click', ()=>{ const chip = btn.getAttribute('data-chip') || ''; const next = chip; input.value = next; input.focus(); filter(next); }); }); filter(''); }; const initModal = () => { const modal = u1z8b('#helpModal'); const openers = [u1z8b('#qOpenModalTop'), u1z8b('#qOpenModalSide'), u1z8b('#qOpenModalEmpty')].filter(Boolean); const xBtn = u1z8b('#closeModalX'); const cancelBtn = u1z8b('#hCancel'); const form = u1z8b('#helpForm'); const mCount = u1z8b('#mCount'); const msg = u1z8b('#hMessage'); const open = () => { if(!modal.open) modal.showModal(); const q = u1z8b('#qSearch')?.value || ''; const qHidden = u1z8b('#hQuery'); if(qHidden) qHidden.value = q; setTimeout(()=>{ u1z8b('#hName')?.focus(); }, 50); }; const close = () => { if(modal.open) modal.close(); }; openers.forEach(b=>b.addEventListener('click', open)); xBtn?.addEventListener('click', close); cancelBtn?.addEventListener('click', close); modal.addEventListener('click', (e)=>{ const r = modal.getBoundingClientRect(); const inDialog = (e.clientX >= r.left && e.clientX <= r.right && e.clientY >= r.top && e.clientY <= r.bottom); if(!inDialog) close(); }); const setErr = (id, on) => { const el = u1z8b(id); if(!el) return; el.classList.toggle('hidden', !on); }; const validEmail = (v) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(String(v||'').trim()); const validPhone = (v) => { const s = String(v||'').trim(); if(s.length === 0) return true; return /^(\+34\s?)?([67]\d{2})([\s.-]?\d{3})([\s.-]?\d{3})$/.test(s) || /^\+?[0-9][0-9\s().-]{7,}$/.test(s); }; const updateMsgCount = () => { const v = (msg?.value || ''); const n = Math.min(800, v.length); if(mCount) mCount.textContent = String(n); if(v.length > 800){ msg.value = v.slice(0,800); } }; msg?.addEventListener('input', updateMsgCount); updateMsgCount(); form?.addEventListener('submit', (e)=>{ const name = u1z8b('#hName')?.value || ''; const email = u1z8b('#hEmail')?.value || ''; const phone = u1z8b('#hPhone')?.value || ''; const topic = u1z8b('#hTopic')?.value || ''; const message = u1z8b('#hMessage')?.value || ''; const consent = u1z8b('#hConsent')?.checked; const badName = normalize(name).length < 2; const badEmail = !validEmail(email); const badPhone = !validPhone(phone); const badTopic = normalize(topic).length < 3; const badMsg = normalize(message).length < 20; const badConsent = !consent; setErr('#eName', badName); setErr('#eEmail', badEmail); setErr('#ePhone', badPhone); setErr('#eTopic', badTopic); setErr('#eMessage', badMsg); setErr('#eConsent', badConsent); const firstBad = badName ? '#hName' : badEmail ? '#hEmail' : badPhone ? '#hPhone' : badTopic ? '#hTopic' : badMsg ? '#hMessage' : badConsent ? '#hConsent' : null; if(firstBad){ e.preventDefault(); u1z8b(firstBad)?.focus(); return; } }); }; const initCookieBanner = () => { const dlg = u1z8b('#cookieBanner'); const btnAccept = u1z8b('#cookieAccept'); const btnReject = u1z8b('#cookieReject'); const btnSave = u1z8b('#cookieSave'); const btnX = u1z8b('#cookieCloseX'); const prefToggle = u1z8b('#prefToggle'); const anaToggle = u1z8b('#anaToggle'); let prefs = {preferences:true, analytics:false}; const syncButtons = () => { if(prefToggle) prefToggle.textContent = prefs.preferences ? 'Activadas' : 'Desactivadas'; if(anaToggle) anaToggle.textContent = prefs.analytics ? 'Activada' : 'Desactivada'; if(prefToggle){ prefToggle.classList.toggle('bg-emerald-300', prefs.preferences); prefToggle.classList.toggle('text-slate-950', prefs.preferences); prefToggle.classList.toggle('bg-slate-800/70', !prefs.preferences); } if(anaToggle){ anaToggle.classList.toggle('bg-emerald-300', prefs.analytics); anaToggle.classList.toggle('text-slate-950', prefs.analytics); anaToggle.classList.toggle('bg-slate-800/70', !prefs.analytics); } }; const close = () => { if(dlg.open) dlg.close(); }; const write = (obj) => { const payload = JSON.stringify({v:1, ts: Date.now(), ...obj}); localStorage.setItem(sKey, payload); setCookie(sKey, payload, 180); }; const read = () => { const ls = localStorage.getItem(sKey); const ck = getCookie(sKey); return safeJSON(ls || ck, null); }; const openIfNeeded = () => { const current = read(); if(!current || !current.choice){ if(!dlg.open) dlg.showModal(); }else{ prefs = { preferences: !!current.preferences, analytics: !!current.analytics }; syncButtons(); } }; prefToggle?.addEventListener('click', ()=>{ prefs.preferences = !prefs.preferences; syncButtons(); }); anaToggle?.addEventListener('click', ()=>{ prefs.analytics = !prefs.analytics; syncButtons(); }); btnAccept?.addEventListener('click', ()=>{ prefs = {preferences:true, analytics:true}; syncButtons(); write({choice:'all', ...prefs}); close(); }); btnReject?.addEventListener('click', ()=>{ prefs = {preferences:false, analytics:false}; syncButtons(); write({choice:'reject', ...prefs}); close(); }); btnSave?.addEventListener('click', ()=>{ write({choice:'custom', ...prefs}); close(); }); btnX?.addEventListener('click', ()=>{ write({choice:'dismiss', ...prefs}); close(); }); dlg.addEventListener('click', (e)=>{ const r = dlg.getBoundingClientRect(); const inDialog = (e.clientX >= r.left && e.clientX <= r.right && e.clientY >= r.top && e.clientY <= r.bottom); if(!inDialog){ write({choice:'dismiss', ...prefs}); close(); } }); const hookCookieOpeners = () => { const btn = u1z8b('#openCookies'); if(btn){ btn.addEventListener('click', ()=>{ const current = read(); if(current){ prefs = {preferences: !!current.preferences, analytics: !!current.analytics}; syncButtons(); } if(!dlg.open) dlg.showModal(); }); } }; syncButtons(); openIfNeeded(); hookCookieOpeners(); const observer = new MutationObserver(()=>hookCookieOpeners()); observer.observe(document.body, {subtree:true, childList:true}); }; const initThemeButton = () => { const setup = () => { const btn = u1z8b('#themeBtn'); if(!btn) return false; const current = getPreferredTheme(); applyTheme(current); btn.addEventListener('click', ()=>{ const now = (localStorage.getItem(tKey) || getPreferredTheme()); const next = now === 'light' ? 'dark' : 'light'; localStorage.setItem(tKey, next); applyTheme(next); }); return true; }; if(setup()) return; const obs = new MutationObserver(()=>{ if(setup()) obs.disconnect(); }); obs.observe(document.body, {subtree:true, childList:true}); }; const initEta = () => { const badge = u1z8b('#etaBadge'); const bar = u1z8b('#etaBar'); const text = u1z8b('#etaText'); const isBusinessHour = (d) => { const day = d.getDay(); const h = d.getHours(); if(day === 0 || day === 6) return false; return h >= 10 && h < 18; }; const nextBusinessStart = (d) => { const x = new Date(d.getTime()); const addDay = () => x.setDate(x.getDate()+1); const setStart = () => { x.setHours(10,0,0,0); }; if(isBusinessHour(x)) return x; if(x.getHours() < 10){ setStart(); if(x.getDay() === 0) { addDay(); setStart(); } if(x.getDay() === 6) { addDay(); addDay(); setStart(); } return x; } addDay(); setStart(); while(x.getDay() === 0 || x.getDay() === 6){ addDay(); setStart(); } return x; }; const fmt = (ms) => { const m = Math.max(0, Math.floor(ms/60000)); const h = Math.floor(m/60); const mm = m%60; if(h <= 0) return `${mm} min`; return `${h} h ${mm} min`; }; const tick = () => { const now = new Date(); const open = isBusinessHour(now); const next = nextBusinessStart(now); let remaining = next.getTime() - now.getTime(); if(open){ const end = new Date(now.getTime()); end.setHours(18,0,0,0); remaining = end.getTime() - now.getTime(); } if(badge){ badge.textContent = open ? 'En horario' : 'Fuera de horario'; badge.classList.toggle('bg-emerald-400/10', open); badge.classList.toggle('text-emerald-200', open); badge.classList.toggle('ring-emerald-400/20', open); badge.classList.toggle('bg-amber-400/10', !open); badge.classList.toggle('text-amber-200', !open); badge.classList.toggle('ring-amber-400/20', !open); } if(text){ if(open){ text.textContent = `Estamos atendiendo ahora. Tiempo restante aproximado del bloque actual: ${fmt(remaining)}.`; }else{ const hh = String(next.getHours()).padStart(2,'0'); const mn = String(next.getMinutes()).padStart(2,'0'); text.textContent = `Próximo bloque de atención: ${hh}:${mn} (hora local). Faltan aprox.: ${fmt(remaining)}.`; } } if(bar){ let pct = 0; if(open){ const start = new Date(now.getTime()); start.setHours(10,0,0,0); const end = new Date(now.getTime()); end.setHours(18,0,0,0); pct = Math.min(100, Math.max(0, ((now.getTime()-start.getTime())/(end.getTime()-start.getTime()))*100)); }else{ const prev = new Date(next.getTime()); prev.setHours(10,0,0,0); const total = Math.max(1, next.getTime() - prev.getTime()); pct = Math.min(100, Math.max(0, (1 - (remaining/total))*100)); } bar.style.width = pct.toFixed(1) + '%'; } }; tick(); setInterval(tick, 1000); }; const boot = async () => { await buildHeaderFooter(); initThemeButton(); initAccordion(); initSearch(); initModal(); initCookieBanner(); initEta(); const savedTheme = localStorage.getItem(tKey); applyTheme(savedTheme || getPreferredTheme()); }; boot(); })();