1import{n as e}from"./rolldown-runtime-DF2fYuay.js";import{t}from"./react-vendor-CiR0XGit.js";import{i as n,t as r}from"./i18n-vendor-dHlc_tL0.js";import{l as i}from"./index-3ZwZxJLb.js";import{r as a,t as o}from"./Seo-D2Qb6k7K.js";import{t as s}from"./ArrowMoveButton-Bg9PkuaL.js";var c=e(n(),1),l=new Map,u=`https://storage.googleapis.com/pinlet/Ayudas/`,d=()=>`${(`https://pinlet.app/apiRest6/corp/v1`?.trim()||`https://pinlet.app/apiRest6/corp/v1`).replace(/\/$/,``)}/getAllAyuda`,f=e=>e.trim().replace(/\bocacional(es)?\b/gi,`ocasional$1`).replace(/\bsopote\b/gi,`soporte`).replace(/crear una invitacion ocasionales/gi,`crear invitaciones ocasionales`).replace(/\s+/g,` `),p=e=>!e.id_ayuda||!e.pregunta||!e.imagen?null:{id:String(e.id_ayuda),question:f(e.pregunta),videoFile:e.imagen,videoUrl:`${u}${e.imagen}`},m=async()=>{let e=`help-videos`,t=l.get(e);if(t)return t;let n=`eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImNvcnBOYW1lIjoiMUEifX0.kciSXvjreQTiWqDholhZSuGSPhqRpCMf6jWtDvpcf0o2026MTMvMDQvMjAyMw`?.trim();if(!n)throw Error(`No se encontro la API key general para Ayuda.`);let r=await fetch(d(),{method:`POST`,headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},body:JSON.stringify({})});if(!r.ok)throw Error(`No se pudo obtener la ayuda: ${r.status}`);let i=(await r.json()).map(p).filter(e=>e!==null);return l.set(e,i),i},h={panel:`_panel_2jsaw_1`,header:`_header_2jsaw_27`,kicker:`_kicker_2jsaw_41`,title:`_title_2jsaw_59`,list:`_list_2jsaw_75`,item:`_item_2jsaw_105`,questionButton:`_questionButton_2jsaw_117`,questionButtonActive:`_questionButtonActive_2jsaw_169`},g=t(),_=({items:e,selectedId:t,onSelect:n})=>{let{t:i}=r();return(0,g.jsxs)(`section`,{className:h.panel,children:[(0,g.jsxs)(`div`,{className:h.header,children:[(0,g.jsx)(`p`,{className:h.kicker,children:i(`help.questionsKicker`)}),(0,g.jsx)(`h2`,{className:h.title,children:i(`help.questionsTitle`)})]}),(0,g.jsx)(`ul`,{className:h.list,children:e.map(e=>(0,g.jsx)(`li`,{className:h.item,children:(0,g.jsx)(`button`,{type:`button`,className:`${h.questionButton} ${t===e.id?h.questionButtonActive:``}`.trim(),onClick:()=>n(e.id),children:e.question})},e.id))})]})},v={panel:`_panel_swdzq_1`,header:`_header_swdzq_29`,kicker:`_kicker_swdzq_57`,title:`_title_swdzq_75`,closeButton:`_closeButton_swdzq_91`,videoShell:`_videoShell_swdzq_109`,video:`_video_swdzq_109`,emptyState:`_emptyState_swdzq_143`},y=({item:e,onClose:t})=>{let{t:n}=r();return(0,g.jsxs)(`section`,{className:v.panel,children:[(0,g.jsxs)(`div`,{className:v.header,children:[t?(0,g.jsx)(s,{className:v.closeButton,direction:`previous`,ariaLabel:n(`help.backToQuestions`),onClick:t}):null,(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`p`,{className:v.kicker,children:n(`help.videoKicker`)}),(0,g.jsx)(`h2`,{className:v.title,children:e?.question??n(`help.videoFallbackTitle`)})]})]}),e?(0,g.jsx)(`div`,{className:v.videoShell,children:(0,g.jsxs)(`video`,{className:v.video,controls:!0,preload:`metadata`,children:[(0,g.jsx)(`source`,{src:e.videoUrl,type:`video/mp4`}),n(`help.videoUnsupported`)]},e.id)}):(0,g.jsx)(`div`,{className:v.emptyState,children:n(`help.emptyVideo`)})]})},b={page:`_page_1pwhk_1`,heroSection:`_heroSection_1pwhk_29`,eyebrow:`_eyebrow_1pwhk_53`,title:`_title_1pwhk_71`,description:`_description_1pwhk_109`,contentGrid:`_contentGrid_1pwhk_127`,videoColumn:`_videoColumn_1pwhk_149`,mobileQuestionsHidden:`_mobileQuestionsHidden_1pwhk_159`,statusPanel:`_statusPanel_1pwhk_167`,videoColumnOpen:`_videoColumnOpen_1pwhk_259`},x=()=>{let{i18n:e,t}=r(),n=i(e.resolvedLanguage?.startsWith(`en`)?`en`:`es`),[s,l]=(0,c.useState)([]),[u,d]=(0,c.useState)(``),[f,p]=(0,c.useState)(!1),[h,v]=(0,c.useState)(!0),[x,S]=(0,c.useState)(``);(0,c.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await m();if(!e)return;l(t),d(t[0]?.id??``),S(``)}catch(n){if(!e)return;S(n instanceof Error?n.message:t(`help.loadError`))}finally{e&&v(!1)}})(),()=>{e=!1}},[t]);let C=(0,c.useMemo)(()=>s.find(e=>e.id===u)??s[0]??null,[s,u]),w=e=>{d(e),p(!0)},T=()=>{p(!1)},E={"@context":`https://schema.org`,"@type":`FAQPage`,mainEntity:s.slice(0,12).map(e=>
1({"@type":`Question`,name:e.question,acceptedAnswer:{"@type":`Answer`,text:t(`help.answerText`)}}))};return(0,g.jsxs)(`main`,{className:b.page,children:[(0,g.jsx)(o,{title:t(`help.seo.title`),description:t(`help.seo.description`),path:n.help,keywords:t(`help.seo.keywords`),imageUrl:a,imageAlt:t(`help.seo.imageAlt`),structuredData:s.length>0?E:void 0,breadcrumbs:[{name:t(`home.seo.breadcrumb`),path:n.home},{name:t(`help.seo.breadcrumb`),path:n.help}]}),(0,g.jsxs)(`section`,{className:b.heroSection,children:[(0,g.jsx)(`h1`,{className:b.title,children:t(`help.title`)}),(0,g.jsx)(`p`,{className:b.description,children:t(`help.description`)})]}),h?(0,g.jsx)(`div`,{className:b.statusPanel,children:t(`help.loading`)}):null,!h&&x?(0,g.jsx)(`div`,{className:b.statusPanel,children:x}):null,!h&&!x&&s.length>0?(0,g.jsxs)(`section`,{className:b.contentGrid,children:[(0,g.jsx)(`div`,{className:f?b.mobileQuestionsHidden:void 0,children:(0,g.jsx)(_,{items:s,selectedId:C?.id??``,onSelect:w})}),(0,g.jsx)(`div`,{className:`${b.videoColumn} ${f?b.videoColumnOpen:``}`.trim(),children:(0,g.jsx)(y,{item:C,onClose:f?T:void 0})})]}):null,!h&&!x&&s.length===0?(0,g.jsx)(`div`,{className:b.statusPanel,children:t(`help.empty`)}):null]})};export{x as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.