sass-template-common 0.8.4 → 0.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11772,6 +11772,7 @@ const Ws = {
|
|
|
11772
11772
|
showSuper: e.showSuper,
|
|
11773
11773
|
block: t,
|
|
11774
11774
|
banners: e.banners,
|
|
11775
|
+
rightOnlyBanner: e.rightOnlyBanner,
|
|
11775
11776
|
customSectionCardStyles: e.customSectionCardStyles,
|
|
11776
11777
|
customNewsDescriptionStyles: e.customNewsDescriptionStyles,
|
|
11777
11778
|
paths: e.paths
|
|
@@ -257,5 +257,5 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
|
257
257
|
${v}
|
|
258
258
|
<figcaption>${B}</figcaption>
|
|
259
259
|
</figure>
|
|
260
|
-
`}}catch(y){console.error("insertVideos error for",g,y),A=""}else A=f;s=u,a+=A,o.lastIndex=u}return a+=e.slice(s),a=Zd(a),a}async function a1(e){const{news:n,banners:a,newsRelatedResponses:s,newsRelatedListResponses:o,slug:r,itemList:i,socials:c,getVideos:h,commonServices:l}=e;let d=n?.body?.rendered??"";d=d.replace(/<script[^>]*src=["']https:\/\/platform\.twitter\.com\/widgets\.js["'][^>]*><\/script>/gi,""),d=d.replace(/ /g,""),d=Rd(d,a),d=e1(d),d=await Xd(d),d=await t1(d,e.texts,s),d=await n1(d,h),d=Kd(d),d=Jd(d);const u=n.main.sources??[],{NEWS_JOURNALIST_COMPONENT:f,CONFIG_blockDefaultTwitterHydrator:g}=W(),m=n.config.articlepreview===Ct.fotoGaleria&&n.hascontent?.hasgalleryimages;return t.jsxs("div",{className:Hn.content,children:[r!=="liveblogs"&&e.showHeaderImage?m?t.jsx(vr,{commonServices:l,newsformated:n,internal:n.info.link.internal}):t.jsx(Wo,{preview:n.preview}):null,t.jsx(ye,{banners:a,name:"block_1"}),t.jsx("div",{className:Hn.journalistArticleContent,children:f==="op1"?t.jsx(Md,{autorIcon:e.autorIcon,socials:c,news:n,texts:e.texts,noteShare:e.noteShare,paths:e.paths}):t.jsx(Yd,{autorIcon:e.autorIcon,socials:c,news:n,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),t.jsx($d,{summary:n.main.summary}),t.jsx("main",{className:Hn.contentNews,suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),t.jsx(Pd,{texts:e.texts,itemList:i,banners:a,slug:r,getVideos:h,newsRelatedListResponses:o??[]}),u.length>0&&t.jsxs("div",{className:Hn.noteSource,children:[t.jsx(jd,{}),t.jsx("p",{children:String(e.texts.noteSource??"")+(u.length===1?"":"s")+": "+u.map(p=>p.name).join(", ")})]}),!g&&n&&n.hascontent&&n.hascontent.hasembeddedtwitter&&t.jsx("script",{async:!0,defer:!0,src:"https://platform.twitter.com/widgets.js"})]})}const s1=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(pe,{title:a,titleUrl:e.titleUrl,children:t.jsx(pt,{slot_id:s,cardWidth:200,children:n.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return t.jsx(Wt,{...c,titleGradient:!0,paths:e.paths},i)})})})},o1=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(pe,{title:a,titleUrl:e.titleUrl,children:t.jsx(pt,{slot_id:s,cardWidth:343,cardGap:32,visibleItems:3,children:n.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return t.jsx(Wt,{...c,titleGradient:!0,paths:e.paths},i)})})})},r1=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(pe,{title:a,titleUrl:e.titleUrl,children:t.jsx(pt,{slot_id:s,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:n.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return I.createElement(Wt,{...c,key:i,titleGradient:!0,paths:e.paths})})})})},zn=e=>{const n={};for(const a in e)a.startsWith("--")&&(n[a]=e[a]);return n},vt={headerSection:"_headerSection_nhjex_1",title:"_title_nhjex_21",subtitle:"_subtitle_nhjex_45",newsContent:"_newsContent_nhjex_71",containerCards:"_containerCards_nhjex_87",image:"_image_nhjex_99",blockHeadContainer:"_blockHeadContainer_nhjex_111"},i1=e=>{const{content:n,title:a,isVideo:s}=e;if(!n||n.length===0)return;const o=n[0],r=n.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return o&&r&&t.jsxs(pe,{title:a,titleUrl:e.titleUrl,children:[t.jsx("div",{className:vt.headerSection,children:t.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:vt.image,href:o?.info?.link?.url,target:o?.info?.link?.target,children:[t.jsxs("div",{className:vt.blockHeadContainer,children:[t.jsx("p",{className:vt.title,children:o?.main?.title.home}),o?.main?.subtitle?.rendered&&t.jsx("p",{className:vt.subtitle,children:o?.main?.subtitle?.striped})]}),t.jsx(ke,{preview:o.preview})]})}),t.jsxs("div",{className:vt.containerCards,children:[t.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),t.jsx("div",{className:vt.newsContent,children:Array.isArray(r)&&r.map((c,h)=>{const l={...c,main:{...c.main,title:{...c.main.title,section:i?c.main.title.home:c.main.title.section}}};return t.jsx("div",{style:{order:h},children:t.jsx(Fe,{...l,isVideo:s,paths:e.paths})},h)})})]})]})},c1=({printEdition:e,title:n})=>e&&t.jsx(pe,{title:n,children:t.jsx("div",{className:"iframe-container",dangerouslySetInnerHTML:{__html:e||""}})}),Er={banner:e=>t.jsx(ye,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>t.jsx(kn,{...e}),"Modulo 1x3":e=>t.jsx(Ma,{...e}),"Modulo 1x4":e=>t.jsx(fr,{...e}),"Modulo 1x5":e=>t.jsx(mr,{...e}),"Destacado noticias":e=>t.jsx(lr,{...e}),"Destacado full width":e=>t.jsx(i1,{...e}),"Destacado videos":e=>t.jsx(gr,{...e}),"Carrusel card":e=>t.jsx(wr,{...e}),"Carrusel story":e=>t.jsx(s1,{...e}),"Carrusel owl":e=>t.jsx(o1,{...e}),"Modulo fotogaleria":e=>t.jsx(r1,{...e}),"Carrusel opinion":e=>t.jsx(yr,{...e}),"Modulo 1x3 card":e=>t.jsx(Ar,{...e}),"Modulo iframe":e=>t.jsx(c1,{...e})};function en({component:e,slot_id:n,data:a,banners:s}){if(s)return Er[e]&&t.jsx("div",{className:"home-slot",style:zn(a),children:Er[e]({...a,banners:s,slot_id:n})})}function l1({children:e,stylesConfigEntry:n}){return t.jsx("div",{className:"home-slot",style:zn(n),children:e})}const kr={Diario:e=>{if(!e?.data||e.data.length===0)return;const n=e.data.slice(1);return t.jsx(rr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:n,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const n=e.data.slice(1);return t.jsx(rr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:n,banners:e.banners,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>t.jsx(Lt,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>t.jsx(ud,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>t.jsx(hd,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},Vn=({component:e,data:n,banners:a,rightOnlyBanner:s})=>t.jsx("div",{style:zn(n),children:kr[e]&&kr[e]({...n,rightOnlyBanner:s,banners:a})}),d1=({slots:e,DYNAMIC_SLOT_SUBINDEXES:n,stylesConfig:a,AutorIcon:s,config:o,banners:r,showTagBySection:i})=>{const c=[],l=n,d=Object.keys(e).length/l;for(let u=1;u<=d;u++)for(let f=1;f<=l;f++){const g="Home_"+u+"_"+f;!e[g]||!e[g].blockSass||!e[g].blockSass[0]||!e[g].blockSass[0].value||!e[g].blockSass[0].block||e[g].blockSass[0].block==="No Mostrar"||(e[g].blockSass[0]?.block==="Modulo iframe"?c.push(t.jsxs(va,{id:e[g].blockSass[0].key,show:!!e[g].blockSass[0].value,order:(u-1)*l+(f-1),children:[t.jsx(en,{component:e[g].blockSass[0].block,banners:r,slot_id:g,data:{printEdition:e[g]?.blockSass[0].value,title:e[g]?.blockSass[0].title??"",titleUrl:e[g].blockSass[0].link??void 0}}),t.jsx(Ve,{children:t.jsx(je,{banners:r,index:"dynamic_"+u+"_"+f})})]},u+"_"+f)):c.push(t.jsxs(va,{id:e[g].blockSass[0].key,show:!!e[g].content?.data,order:(u-1)*l+(f-1),children:[t.jsx(en,{component:e[g].blockSass[0].block,banners:r,slot_id:g,data:{...e[g].blockSass[0].block?a[e[g].blockSass[0].block]:[],content:e[g].content?.data??[],title:e[g].blockSass[0].title??void 0,titleUrl:e[g].blockSass[0].link??void 0,autorIcon:t.jsx(s,{}),paths:o.paths,showTagBySection:i}}),t.jsx(Ve,{children:t.jsx(je,{banners:r,index:"dynamic_"+u+"_"+f})})]},u+"_"+f)))}return c},h1=({mainBlock:e,StylesConfigMain:n,config:a,banners:s})=>{const{PUBLIC_ENV:o}=W();if(o!=="local")return null;const r=e?.news?.data||[],i=(c,h)=>({...e?.news,...n[c],data:r.slice(0,h),paths:a.paths});return t.jsxs(t.Fragment,{children:[t.jsx(Vn,{component:"Super",data:i("Super",1),banners:s}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:1})}),t.jsx(Vn,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:s}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:1})}),t.jsx(Vn,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:s}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:1})})]})},u1=e=>{const{config:n}=e,a=n.articlepreview;return!![Ct.videoEmbedded,Ct.videoYouTube,Ct.iframe].includes(a)},f1=async e=>{const{custom_complement:n,ranking:a=[],banners:s,autor:o=[],news:r=[],newsRelatedResponses:i=[],newsRelatedListResponses:c=[],itemList:h=[],socials:l,getVideos:d}=e,u=e.slug==="liveblogs",{SHOW_NEWS_MORE_NEWS:f,SHOW_NEWS_RELATED_NEWS:g,MORE_NEWS_SSR:m}=W();if(!(!r||!r[0]))return t.jsx(t.Fragment,{children:t.jsxs(_d,{className:Xt.contentLayout2,children:[t.jsx(Nd,{option:e.slug,news:r,paths:e.paths,headerSectionStyles:e.headerSectionStyles,newsDescriptionSectionTag:e.newsDescriptionSectionTag}),t.jsx(je,{banners:s,index:1}),!u&&e.commonServices&&t.jsx(zd,{news:r[0],commonServices:e.commonServices}),t.jsx(Sd,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:h,ranking:a,readestCustomStyles:e.readestCustomStyles,bannerTop:t.jsx(ye,{banners:s??[],name:"right_1"}),banner:t.jsx(ye,{banners:s??[],name:"right_2"}),complement:t.jsxs("div",{id:"comentarios",className:Xt.complementContent,suppressHydrationWarning:!0,children:[o.length>0&&t.jsx(sr,{texts:e.texts,autorIcon:e.autorIcon,autor:o[0],paths:e.paths}),r[0].authors.length>1&&t.jsx(or,{news:r[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),r[0]?.keywords?.tags&&r[0]?.keywords?.tags?.length>0&&t.jsx("div",{className:`${Xt.tagContent} sass-note-tags-content`,children:t.jsx(ar,{tags:r[0]?.keywords?.tags,paths:e.paths})}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2rem"},suppressHydrationWarning:!0,children:[e.showComments&&t.jsx("div",{className:Xt.commentsSeparator,suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"comment",internalPath:e.internalPath,API_ENV:ca(e.API_ENV),texts:e.texts}))}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:2})}),g&&t.jsxs(t.Fragment,{children:[t.jsx(en,{component:"Carrusel card",banners:[],slot_id:"Nota_1",data:{...e.stylesConfig["Carrusel card"],content:e.relatedNewsList??[],title:e.texts.relatedNewsTitle,titleUrl:void 0,paths:e.paths}}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:3})})]}),f&&t.jsxs(t.Fragment,{children:[m?t.jsx(en,{component:"Modulo 1x3",banners:[],slot_id:"Nota_2",data:{...e.stylesConfig?e.stylesConfig["Modulo 1x3 Client"]?e.stylesConfig["Modulo 1x3 Client"]:e.stylesConfig["Modulo 1x3"]:{},content:e.moreNewsSSR??[],title:e.texts.moreNewsTitle,paths:e.paths,titleUrl:void 0}}):t.jsx(pe,{title:e.texts.moreNewsTitle,children:t.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"more",stylesConfig:e.stylesConfig,section:r[0].info.section?.slug??"",internalPath:e.internalPath,paths:e.paths,API_ENV:ca(e.API_ENV),fetchConfig:e.fetchConfig}))})}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:4})})]}),n&&n()]})]}),children:t.jsxs("section",{style:{"--avatar-content-align-items-desk":e.slug==="liveblogs"?"flex-start":"center"},children:[t.jsx(a1,{texts:e.texts,autorIcon:e.autorIcon,socials:l,news:r[0],banners:s,newsRelatedResponses:i,newsRelatedListResponses:c,itemList:h,slug:e.slug,getVideos:d,noteShare:e.noteShare,paths:e.paths,showHeaderImage:!u1(r[0]),commonServices:e.commonServices}),t.jsx(ye,{banners:s??[],name:"block_3"})]})})]})})},tn={content:"_content_lu444_1",buttonStyled:"_buttonStyled_lu444_17",searchStyled:"_searchStyled_lu444_39",inputStyled:"_inputStyled_lu444_71",inputStyledTest:"_inputStyledTest_lu444_109"},m1=e=>t.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("g",{children:t.jsx("path",{d:"M47.8043 46.6003L47.6635 46.7758L47.8232 46.9342L56.4762 55.5171C56.4768 55.5177 56.4774 55.5184 56.478 55.519C56.8524 55.9072 57.0616 56.4256 57.0616 56.965C57.0616 57.5048 56.8521 58.0234 56.4774 58.4117C56.2839 58.6065 56.0539 58.7611 55.8005 58.8667C55.5466 58.9724 55.2743 59.0269 54.9993 59.0269C54.7243 59.0269 54.452 58.9724 54.1981 58.8667C53.9442 58.7609 53.7138 58.6059 53.5201 58.4106L53.5194 58.4099L44.9327 49.8232L44.7743 49.6648L44.5995 49.805C40.4597 53.1252 35.2051 54.7331 29.9162 54.2981C24.6272 53.863 19.706 51.4181 16.1643 47.4661C12.6227 43.514 10.7298 38.3552 10.875 33.0503C11.0201 27.7455 13.1923 22.6979 16.9447 18.9455C20.6972 15.193 25.7448 13.0209 31.0496 12.8757C36.3544 12.7305 41.5133 14.6234 45.4653 18.165C49.4174 21.7067 51.8623 26.6279 52.2974 31.9169C52.7324 37.2058 51.1245 42.4604 47.8043 46.6003ZM22.4528 47.4552C25.1799 49.2774 28.3861 50.25 31.666 50.25C36.0641 50.25 40.2822 48.5029 43.3921 45.3929C46.5021 42.2829 48.2493 38.0649 48.2493 33.6667C48.2493 30.3868 47.2767 27.1806 45.4545 24.4535C43.6323 21.7264 41.0423 19.6008 38.0121 18.3457C34.9819 17.0905 31.6476 16.7621 28.4307 17.402C25.2139 18.0419 22.259 19.6213 19.9398 21.9405C17.6205 24.2597 16.0411 27.2146 15.4013 30.4314C14.7614 33.6483 15.0898 36.9827 16.345 40.0129C17.6001 43.0431 19.7256 45.633 22.4528 47.4552Z",fill:"white",stroke:"white",strokeWidth:"0.5"})})}),g1=e=>t.jsx("form",{className:tn.content,children:t.jsxs("div",{className:`${tn.inputStyled} sass-buscar-form`,children:[t.jsx("input",{className:tn.inputStyledTest,defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),t.jsx("button",{className:tn.buttonStyled,type:"submit",children:t.jsx(m1,{className:tn.searchStyled})})]})}),Qa={content:"_content_27x8l_1",newsContentSection:"_newsContentSection_27x8l_9",itemContent:"_itemContent_27x8l_19"},p1=e=>{const{data:n,option:a,autor:s,page:o,banners:r,pathname:i,ranking:c,currentPage:h,slug:l,texts:d={},socialIconsFilled:u=!1}=e,f=[5,10,15],{SUB_PUBLICATION_PREFIX_IN_ROUTES:g}=W(),m={5:1,10:2,15:3};switch(a){case"op1":return t.jsx(t.Fragment,{children:t.jsxs(ka,{children:[t.jsx(Zo,{autor:s[0],autorIcon:e.autorIcon,socialIconsFilled:u}),t.jsx(La,{paths:e.paths,ranking:c,readestTitle:d.readestTitle??"",bannerTop:t.jsx(ye,{banners:r??[],name:"right_1"}),banner:t.jsx(ye,{banners:r??[],name:"right_2"}),children:t.jsx("section",{className:Qa.content,children:n.length>0?t.jsx(On,{className:[Qa.newsContentSection,"padding-0"].join(" "),paginatorComponent:t.jsx(zt,{block_subPublication:g?.autor,texts:d,pathname:i,query:"",currentPage:h,maxPages:e.paginationLimit,showNext:!(n.length<e.newsListLimit)}),children:Array.isArray(n)&&n?.map((p,A)=>t.jsxs(I.Fragment,{children:[f.includes(A+1)&&t.jsx("div",{className:Qa.itemContent+" banner-context",children:t.jsx(ye,{banners:r??[],name:`block_2_${m[A+1]}`})}),t.jsx(Qn,{autorIcon:e.autorIcon,item:p,option:l,paths:e.paths},A)]},A))}):t.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:t.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:d.autorNotResultMessage})})})})]})});case"op2":return t.jsx(t.Fragment,{children:t.jsxs(ka,{children:[t.jsx(Xo,{autor:s[0],autorIcon:e.autorIcon,socialIconsFilled:u}),Array.isArray(n)?t.jsxs(t.Fragment,{children:[t.jsx(Ma,{content:n,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),t.jsx(zt,{block_subPublication:g?.autor,texts:d,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(o),showNext:!((n.length??0)<Number(e.newsListLimit))})]}):t.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:t.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:d.autorNotResultMessage})})]})});default:return t.jsx(t.Fragment,{})}},q={form:"_form_16zye_133",formUl:"_formUl_16zye_151",field:"_field_16zye_175",label:"_label_16zye_189",input:"_input_16zye_207",error:"_error_16zye_243",primary:"_primary_16zye_255",divider:"_divider_16zye_329",google:"_google_16zye_381",googleIcon:"_googleIcon_16zye_441",spin:"_spin_16zye_507",checkboxRow:"_checkboxRow_16zye_551",switch:"_switch_16zye_609",terms:"_terms_16zye_625",message:"_message_16zye_689",passwordChecker:"_passwordChecker_16zye_699",valid:"_valid_16zye_737",invalid:"_invalid_16zye_745",forgotPassword:"_forgotPassword_16zye_753",toRegister:"_toRegister_16zye_789",successContainer:"_successContainer_16zye_805",thumbsUp:"_thumbsUp_16zye_821",successMessage:"_successMessage_16zye_833"},Ot=({className:e})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:e,children:t.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),A1={GoogleButtonText:"Continuar con Google",loginButtonText:"Iniciar sesión",noAccountText:"¿Ya tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",showPasswordsLabel:"Mostrar contraseñas",termsPrefix:"Al continuar, confirmo que he leído y aceptado los",termsLinkText:"Términos y Condiciones",termsSuffix:"de nuestra comunidad",createAccountButton:"Crear cuenta",verificationCodeLabel:"Código de verificación",confirmAccountButton:"Confirmar cuenta",alreadyConfirmedText:"¿Ya confirmaste antes?",successTitle:"Confirmación completa.",successMessage:"Ya eres parte de la comunidad!",passwordRuleMinLength:"La contraseña debe tener al menos 8 caracteres",passwordRuleNumber:"Usa un número",passwordRuleLowercase:"Usa una letra minúscula",passwordRuleUppercase:"Usa una letra mayúscula",passwordRuleSymbol:"Usa un símbolo",errorCompleteFields:"Complete todos los campos",errorPasswordMismatch:"Las contraseñas no coinciden",errorPasswordInvalid:"La contraseña no es válida",errorVerificationCodeRequired:"Debes ingresar el código de verificación",errorUnexpected:"Error inesperado"},nn={email:{label:"Email"},given_name:{label:"Nombre"},family_name:{label:"Apellido"},password:{label:"Contraseña"},confirmPassword:{label:"Confirmar contraseña"}};function w1(e){return{email:{label:e?.email??nn.email.label,required:!0},given_name:{label:e?.given_name??nn.given_name.label,required:!0},family_name:{label:e?.family_name??nn.family_name.label,required:!0},password:{label:e?.password??nn.password.label,required:!0},confirmPassword:{label:e?.confirmPassword??nn.confirmPassword.label,required:!0}}}const He=[e=>e.length>=8,e=>/\d/.test(e),e=>/[a-z]/.test(e),e=>/[A-Z]/.test(e),e=>/[^A-Za-z0-9]/.test(e)],Ur=[{label:"La contraseña debe tener al menos 8 caracteres",test:He[0]},{label:"Usa un número",test:He[1]},{label:"Usa una letra minúscula",test:He[2]},{label:"Usa una letra mayúscula",test:He[3]},{label:"Usa un símbolo",test:He[4]}];function y1({texts:e,API_ENV:n}){const a={...A1,...e?.comentarios},s=I.useMemo(()=>w1(e?.comentarios?.registerForm),[e?.comentarios?.registerForm]),o=I.useMemo(()=>[{label:a.passwordRuleMinLength,test:He[0]},{label:a.passwordRuleNumber,test:He[1]},{label:a.passwordRuleLowercase,test:He[2]},{label:a.passwordRuleUppercase,test:He[3]},{label:a.passwordRuleSymbol,test:He[4]}],[a.passwordRuleMinLength,a.passwordRuleNumber,a.passwordRuleLowercase,a.passwordRuleUppercase,a.passwordRuleSymbol]),[r,i]=I.useState({}),[c,h]=I.useState(!1),[l,d]=I.useState(!1),[u,f]=I.useState(null),[g,m]=I.useState("register"),p=async()=>{if(n.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"});return}const v=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${v}`},A=(v,w)=>{i(T=>({...T,[v]:w}))},y=async v=>{v.preventDefault(),f(null),d(!0);try{const w=Object.keys(s).filter(L=>!["username","password","confirmPassword"].includes(L)).map(L=>({Name:L,Value:r[L]}));if(w.some(L=>{if(!L.Value||L.Value.trim()==="")return!0}))return d(!1),f(a.errorCompleteFields);if(r.password!==r.confirmPassword){f(a.errorPasswordMismatch);return}const T=r.password||"";if(o.some(L=>!L.test(T))){f(a.errorPasswordInvalid);return}const F=Math.floor(Date.now()/1e3);w.push({Name:"updated_at",Value:String(F)});const X=n.PUBLIC_ENV==="local"?"token":await an("comment_register",n.CAPTCHA_KEY??"");if(!X)throw new Error("Captcha token no generado");const H=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:r.email,password:r.password,userAttributes:w,token:X})});if(!H.ok){const L=await H.json().catch(()=>({}));if(L.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:r.email})}),m("confirm");return}throw new Error(L?.error||"Error al crear usuario")}m("confirm")}catch(w){console.log(w),f(w?.message||w?.error||a.errorUnexpected)}finally{d(!1)}},N=async v=>{if(v.preventDefault(),!r.confirmationCode){f(a.errorVerificationCodeRequired);return}f(null),d(!0);try{const w=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:r.email,code:r.confirmationCode})});if(!w.ok){const T=await w.json().catch(()=>({}));throw new Error(T?.error||"Error al confirmar usuario")}m("success")}catch(w){f(w?.message||a.errorUnexpected)}finally{d(!1)}},S=r.password||"";return t.jsxs(t.Fragment,{children:[g==="register"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:p,className:q.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:q.googleIcon}),t.jsx("span",{children:a.GoogleButtonText})]}),t.jsx("div",{className:q.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:y,className:q.form,"data-error":u?"true":"false",children:[t.jsx("ul",{className:q.formUl,children:Object.entries(s).map(([v,{label:w}])=>t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:w}),t.jsx("input",{type:v.toLowerCase().includes("password")?c?"text":"password":v==="birthdate"?"date":v==="email"?"email":v==="phone_number"?"tel":"text",name:v,value:r[v]||"",onChange:T=>A(v,T.target.value),className:q.input,placeholder:""}),v==="password"&&t.jsx("div",{className:q.passwordChecker,children:o.map((T,B)=>{const F=T.test(S);return t.jsxs("div",{className:F?q.valid:q.invalid,children:[t.jsx("div",{children:F?"✔":"○"}),t.jsx("div",{children:T.label})]},B)})}),v==="confirmPassword"&&t.jsxs("div",{className:q.checkboxRow,children:[t.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:c,onChange:T=>h(T.target.checked)}),t.jsx("label",{htmlFor:"showPasswordRegister",className:q.checkboxLabel,children:a.showPasswordsLabel})]})]},v))}),u&&t.jsx("p",{className:q.error,children:u}),t.jsxs("p",{className:q.terms,children:[a.termsPrefix," ",t.jsx("a",{href:"/pages/politicas-de-privacidad",target:"_blank",children:a.termsLinkText})," ",a.termsSuffix]}),t.jsx("button",{type:"submit",className:q.primary,disabled:l,children:l?t.jsx(Ot,{}):a.createAccountButton})]})]}),g==="confirm"&&t.jsxs("form",{onSubmit:N,className:q.form,"data-error":u?"true":"false",children:[t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:a.verificationCodeLabel}),t.jsx("input",{type:"text",name:"confirmationCode",value:r.confirmationCode||"",onChange:v=>A("confirmationCode",v.target.value),className:q.input,required:!0})]}),u&&t.jsx("p",{className:q.error,children:u}),t.jsx("button",{type:"submit",className:q.primary,disabled:l,children:l?t.jsx(Ot,{}):a.confirmAccountButton}),t.jsxs("p",{className:q.switch,children:[a.alreadyConfirmedText,t.jsx("a",{className:q.toRegister,href:"./login",children:a.loginButtonText})]})]}),g==="success"&&t.jsxs("form",{className:q.form,children:[t.jsxs("div",{className:q.successContainer,children:[t.jsx("div",{className:q.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsxs("div",{className:q.successMessage,children:[t.jsx("p",{children:a.successTitle}),t.jsx("p",{children:a.successMessage})]})]}),t.jsx("a",{href:"./login",className:q.primary,children:a.loginButtonText})]}),g==="register"&&t.jsxs("p",{className:q.switch,children:[a.alreadyHasAccountText,t.jsx("a",{className:q.toRegister,href:"./login",children:a.loginButtonText})]})]})}const b1={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con Google",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function C1({API_ENV:e,texts:n}){const a={...b1,...n?.comentarios},[s,o]=I.useState("login"),[r,i]=I.useState(""),[c,h]=I.useState(""),[l,d]=I.useState(""),[u,f]=I.useState(""),[g,m]=I.useState(""),[p,A]=I.useState(!1),[y,N]=I.useState(!1),[S,v]=I.useState(null);I.useEffect(()=>{if(typeof window>"u")return;window.location.hash.includes("forgot")&&s==="login"&&o("forgot"),s==="login"&&T()});const w=L=>document.cookie.split("; ").find(z=>z.startsWith(L+"="))?.split("=")[1],T=async()=>{if(document.cookie.search(e.COGNITO_AUTH_PREFIX+"IS_AUTH=true")!==-1){if(!window)return;const L=w("redirect_after_login");L&&L!==""?(document.cookie="redirect_after_login=; Max-Age=0; path=/",window.location.pathname=L,window.location.hash="comentarios"):window.location.pathname="/auth/success"}},B=async()=>{if(e.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"});return}const L=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${L}`},F=async L=>{if(!y){if(L.preventDefault(),r===""||c===""){v("Complete todos los campos");return}v(null),N(!0);try{const z=e.PUBLIC_ENV==="local"?"token":await an("comment_login",e.CAPTCHA_KEY||"");if(!z)throw new Error("Captcha token no generado");const R=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:r,password:c,token:z})});if(!R.ok){const P=await R.json().catch(()=>({}));throw new Error(P?.error||"Ha ocurrido un error")}await T();return}catch(z){v(z?.message||"Error inesperado")}finally{N(!1)}}},X=async L=>{if(!y){L.preventDefault(),v(null),N(!0);try{const z=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r})});if(!z.ok){const R=await z.json().catch(()=>({}));throw new Error(R?.error||"Error al enviar código")}h(""),o("changePassword")}catch(z){v(z?.message||"Error inesperado")}finally{N(!1)}}},H=async L=>{if(y)return;if(L.preventDefault(),u!==g){v("Las contraseñas no coinciden");return}if(Ur.some(R=>!R.test(u))){v("La contraseña no cumple con los requisitos");return}v(null),N(!0);try{const R=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r,code:l,newPassword:u})});if(!R.ok){const P=await R.json().catch(()=>({}));throw new Error(P?.error||"Error al cambiar contraseña")}o("feedback")}catch(R){v(R?.message||"Error inesperado")}finally{N(!1)}};return t.jsxs(t.Fragment,{children:[s==="login"&&t.jsx(v1,{email:r,password:c,showPassword:p,loading:y,error:S,setEmail:i,setPassword:h,setShowPassword:A,onSubmit:F,onForgot:()=>{v(null),o("forgot")},handleGoogleLogin:B,t:a}),s==="forgot"&&t.jsx(_1,{email:r,setEmail:i,loading:y,error:S,onSubmit:X,onBack:()=>{v(null),o("login")},t:a}),s==="changePassword"&&t.jsx(N1,{email:r,confirmationCode:l,newPassword:u,confirmNewPassword:g,showPassword:p,loading:y,error:S,setConfirmationCode:d,setNewPassword:f,setConfirmNewPassword:m,setShowPassword:A,onSubmit:H,onBack:()=>{v(null),o("forgot")},t:a}),s==="feedback"&&t.jsx(I1,{onBackToLogin:()=>{v(null),o("login")},t:a})]})}function v1({email:e,password:n,showPassword:a,loading:s,error:o,setEmail:r,setPassword:i,setShowPassword:c,onSubmit:h,onForgot:l,handleGoogleLogin:d,t:u}){return t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:d,className:q.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:q.googleIcon}),t.jsx("span",{children:u.GoogleButtonText})]}),t.jsx("div",{className:q.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:h,className:q.form,"data-error":o?"true":"false",children:[t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:u.email}),t.jsx("input",{type:"email",value:e,onChange:f=>r(f.target.value),className:q.input,placeholder:""})]}),t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:u.password}),t.jsx("input",{type:a?"text":"password",value:n,onChange:f=>i(f.target.value),className:q.input,placeholder:""}),t.jsxs("div",{className:q.checkboxRow,children:[t.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:f=>c(f.target.checked)}),t.jsx("label",{htmlFor:"showPasswordLogin",className:q.checkboxLabel,children:u.showPassword})]})]}),o&&t.jsx("p",{className:q.error,children:o}),t.jsx("button",{type:"submit",className:q.primary,disabled:s,children:s?t.jsx(Ot,{className:q.spin}):u.loginButtonText})]}),t.jsxs("p",{className:q.switch,children:[u.noAccountText,t.jsx("a",{className:q.toRegister,href:"./register",children:u.registerButtonText})]}),t.jsx("button",{type:"button",className:q.forgotPassword,onClick:l,children:u.forgotPasswordText})]})}function _1({email:e,setEmail:n,loading:a,error:s,onSubmit:o,onBack:r,t:i}){return t.jsxs("form",{onSubmit:o,className:q.form,"data-error":s?"true":"false",children:[t.jsx("p",{className:q.message,children:i.forgotMessage}),t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:i.email}),t.jsx("input",{type:"email",value:e,name:"email",onChange:c=>n(c.target.value),className:q.input,placeholder:""})]}),s&&t.jsx("p",{className:q.error,children:s}),t.jsx("button",{type:"submit",className:q.primary,disabled:a,children:a?t.jsx(Ot,{}):i.sendCodeButton}),t.jsx("p",{className:q.switch,style:{margin:"0 0 16px"},children:t.jsx("button",{type:"button",onClick:r,children:i.backButton})})]})}function S1(e){const[n,a]=e.split("@");if(!n||!a)return e;let s="";n.length<=2?s=n[0]+"*":s=n[0]+"*".repeat(n.length-2)+n[n.length-1];const o=a.lastIndexOf(".");if(o===-1)return`${s}@${a}`;const r=a.slice(0,o),i=a.slice(o);let c="";return r.length<=2?c=r[0]+"*":c=r[0]+"*".repeat(r.length-2)+r[r.length-1],`${s}@${c}${i}`}function N1({email:e,confirmationCode:n,newPassword:a,confirmNewPassword:s,showPassword:o,loading:r,error:i,setConfirmationCode:c,setNewPassword:h,setConfirmNewPassword:l,setShowPassword:d,onSubmit:u,onBack:f,t:g}){const m=g.changePasswordMessage.replace("{{email}}",S1(e));return t.jsxs("form",{onSubmit:u,className:q.form,"data-error":i?"true":"false",children:[t.jsx("p",{className:q.message,children:m}),t.jsxs("ul",{className:q.formUl,children:[t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:g.verificationCodeLabel}),t.jsx("input",{type:"text",value:n,onChange:p=>c(p.target.value),className:q.input,placeholder:""})]}),t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:g.newPasswordLabel}),t.jsx("input",{type:o?"text":"password",value:a,onChange:p=>h(p.target.value),className:q.input,placeholder:"",name:"password"}),t.jsx("div",{className:q.passwordChecker,children:Ur.map((p,A)=>{const y=p.test(a);return t.jsxs("div",{className:y?q.valid:q.invalid,children:[t.jsx("div",{children:y?"✔":"○"}),t.jsx("div",{children:p.label})]},A)})})]}),t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:g.confirmPasswordLabel}),t.jsx("input",{type:o?"text":"password",value:s,onChange:p=>l(p.target.value),className:q.input,placeholder:""}),t.jsxs("div",{className:q.checkboxRow,children:[t.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:o,onChange:p=>d(p.target.checked)}),t.jsx("label",{htmlFor:"showPasswordForgot",className:q.checkboxLabel,children:g.showPasswordsLabel})]})]})]}),i&&t.jsx("p",{className:q.error,children:i}),t.jsx("button",{type:"submit",className:q.primary,style:{maxWidth:r?"revert-layer":"fit-content"},disabled:r,children:r?t.jsx(Ot,{}):g.changePasswordButton}),t.jsx("p",{className:q.switch,children:t.jsx("button",{type:"button",onClick:f,children:g.backButton})})]})}function I1({onBackToLogin:e,t:n}){return t.jsxs("div",{className:q.form,children:[t.jsx("p",{className:q.success,children:n.feedbackSuccessMessage}),t.jsx("button",{type:"button",className:q.primary,onClick:e,children:n.loginButtonText})]})}const U={overlay:"_overlay_1t390_1",header:"_header_1t390_35",logo:"_logo_1t390_49",anonimusWrapper:"_anonimusWrapper_1t390_63",anonimus:"_anonimus_1t390_63",anonimusImage:"_anonimusImage_1t390_115",card:"_card_1t390_131",close:"_close_1t390_161",form:"_form_1t390_209",formUl:"_formUl_1t390_227",field:"_field_1t390_251",label:"_label_1t390_265",input:"_input_1t390_283",error:"_error_1t390_319",primary:"_primary_1t390_331",divider:"_divider_1t390_407",google:"_google_1t390_459",googleIcon:"_googleIcon_1t390_519",spin:"_spin_1t390_585",checkboxRow:"_checkboxRow_1t390_629",switch:"_switch_1t390_687",terms:"_terms_1t390_703",message:"_message_1t390_769",passwordChecker:"_passwordChecker_1t390_779",valid:"_valid_1t390_817",invalid:"_invalid_1t390_825",forgotPassword:"_forgotPassword_1t390_833",successContainer:"_successContainer_1t390_871",thumbsUp:"_thumbsUp_1t390_887",successMessage:"_successMessage_1t390_899"},an=async(e,n)=>{if(!e)throw new Error("No action provided");if(!n)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((s,o)=>{a.enterprise.ready(async()=>{try{const r=await a.enterprise.execute(n,{action:e});if(!r)throw new Error("Captcha token no generado");s(r)}catch(r){o(r)}})})},tt=()=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:U.spin,children:t.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),T1={GoogleButtonText:"Continuar con Google",loginButtonText:"Iniciar sesión",noAccountText:"¿Ya tenés cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",showPasswordsLabel:"Mostrar contraseñas",termsPrefix:"Al continuar, confirmo que he leído y aceptado los",termsLinkText:"Términos y Condiciones",termsSuffix:"de nuestra comunidad",createAccountButton:"Crear cuenta",verificationCodeLabel:"Código de verificación",confirmAccountButton:"Confirmar cuenta",alreadyConfirmedText:"¿Ya confirmaste antes?",successTitle:"Confirmación completa.",successMessage:"Ya eres parte de la comunidad!",passwordRuleMinLength:"La contraseña debe tener al menos 8 caracteres",passwordRuleNumber:"Usa un número",passwordRuleLowercase:"Usa una letra minúscula",passwordRuleUppercase:"Usa una letra mayúscula",passwordRuleSymbol:"Usa un símbolo",errorCompleteFields:"Complete todos los campos",errorPasswordMismatch:"Las contraseñas no coinciden",errorPasswordInvalid:"La contraseña no es válida",errorVerificationCodeRequired:"Debes ingresar el código de verificación",errorUnexpected:"Error inesperado"},sn={email:{label:"Email"},given_name:{label:"Nombre"},family_name:{label:"Apellido"},password:{label:"Contraseña"},confirmPassword:{label:"Confirmar contraseña"}};function E1(e){return{email:{label:e?.email??sn.email.label,required:!0},given_name:{label:e?.given_name??sn.given_name.label,required:!0},family_name:{label:e?.family_name??sn.family_name.label,required:!0},password:{label:e?.password??sn.password.label,required:!0},confirmPassword:{label:e?.confirmPassword??sn.confirmPassword.label,required:!0}}}const ze=[e=>e.length>=8,e=>/\d/.test(e),e=>/[a-z]/.test(e),e=>/[A-Z]/.test(e),e=>/[^A-Za-z0-9]/.test(e)],xr=[{label:"La contraseña debe tener al menos 8 caracteres",test:ze[0]},{label:"Usa un número",test:ze[1]},{label:"Usa una letra minúscula",test:ze[2]},{label:"Usa una letra mayúscula",test:ze[3]},{label:"Usa un símbolo",test:ze[4]}];function k1({goToLogin:e,handleGoogleLogin:n,API_ENV:a,texts:s}){const o={...T1,...s?.comentarios},r=I.useMemo(()=>E1(s?.comentarios?.registerForm),[s?.comentarios?.registerForm]),i=I.useMemo(()=>[{label:o.passwordRuleMinLength,test:ze[0]},{label:o.passwordRuleNumber,test:ze[1]},{label:o.passwordRuleLowercase,test:ze[2]},{label:o.passwordRuleUppercase,test:ze[3]},{label:o.passwordRuleSymbol,test:ze[4]}],[o.passwordRuleMinLength,o.passwordRuleNumber,o.passwordRuleLowercase,o.passwordRuleUppercase,o.passwordRuleSymbol]),[c,h]=I.useState({}),[l,d]=I.useState(!1),[u,f]=I.useState(!1),[g,m]=I.useState(null),[p,A]=I.useState("register"),y=(w,T)=>{h(B=>({...B,[w]:T}))},N=async w=>{w.preventDefault(),m(null),f(!0);try{const T=Object.keys(r).filter(z=>!["username","password","confirmPassword"].includes(z)).map(z=>({Name:z,Value:c[z]}));if(T.some(z=>{if(!z.Value||z.Value.trim()==="")return!0}))return f(!1),m(o.errorCompleteFields);if(c.password!==c.confirmPassword){m(o.errorPasswordMismatch);return}const B=c.password||"";if(i.some(z=>!z.test(B))){m(o.errorPasswordInvalid);return}const X=Math.floor(Date.now()/1e3);T.push({Name:"updated_at",Value:String(X)});const H=a.PUBLIC_ENV==="local"?"token":await an("comment_register",a.CAPTCHA_KEY??"");if(!H)throw new Error("Captcha token no generado");const L=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c.email,password:c.password,userAttributes:T,token:H})});if(!L.ok){const z=await L.json().catch(()=>({}));if(z.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c.email})}),A("confirm");return}throw new Error(z?.error||"Error al crear usuario")}A("confirm")}catch(T){console.log(T),m(T?.message||T?.error||o.errorUnexpected)}finally{f(!1)}},S=async w=>{if(w.preventDefault(),!c.confirmationCode){m(o.errorVerificationCodeRequired);return}m(null),f(!0);try{const T=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c.email,code:c.confirmationCode})});if(!T.ok){const B=await T.json().catch(()=>({}));throw new Error(B?.error||"Error al confirmar usuario")}A("success")}catch(T){m(T?.message||o.errorUnexpected)}finally{f(!1)}},v=c.password||"";return t.jsxs(t.Fragment,{children:[p==="register"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:n,className:U.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:U.googleIcon}),t.jsx("span",{children:o.GoogleButtonText})]}),t.jsx("div",{className:U.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:N,className:U.form,"data-error":g?"true":"false",children:[t.jsx("ul",{className:U.formUl,children:Object.entries(r).map(([w,{label:T}])=>t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:T}),t.jsx("input",{type:w.toLowerCase().includes("password")?l?"text":"password":w==="birthdate"?"date":w==="email"?"email":w==="phone_number"?"tel":"text",name:w,value:c[w]||"",onChange:B=>y(w,B.target.value),className:U.input,placeholder:""}),w==="password"&&t.jsx("div",{className:U.passwordChecker,children:i.map((B,F)=>{const X=B.test(v);return t.jsxs("div",{className:X?U.valid:U.invalid,children:[t.jsx("div",{children:X?"✔":"○"}),t.jsx("div",{children:B.label})]},F)})}),w==="confirmPassword"&&t.jsxs("div",{className:U.checkboxRow,children:[t.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:l,onChange:B=>d(B.target.checked)}),t.jsx("label",{htmlFor:"showPasswordRegister",className:U.checkboxLabel,children:o.showPasswordsLabel})]})]},w))}),g&&t.jsx("p",{className:U.error,children:g}),t.jsxs("p",{className:U.terms,children:[o.termsPrefix," ",t.jsx("a",{href:"/pages/politicas-de-privacidad.html",target:"_blank",children:o.termsLinkText})," ",o.termsSuffix]}),t.jsx("button",{type:"submit",className:U.primary,disabled:u,children:u?t.jsx(tt,{}):o.createAccountButton})]})]}),p==="confirm"&&t.jsxs("form",{onSubmit:S,className:U.form,"data-error":g?"true":"false",children:[t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:o.verificationCodeLabel}),t.jsx("input",{type:"text",name:"confirmationCode",value:c.confirmationCode||"",onChange:w=>y("confirmationCode",w.target.value),className:U.input,required:!0})]}),g&&t.jsx("p",{className:U.error,children:g}),t.jsx("button",{type:"submit",className:U.primary,disabled:u,children:u?t.jsx(tt,{}):o.confirmAccountButton}),t.jsxs("p",{className:U.switch,children:[o.alreadyConfirmedText,t.jsx("button",{type:"button",onClick:e,children:o.loginButtonText})]})]}),p==="success"&&t.jsxs("form",{className:U.form,children:[t.jsxs("div",{className:U.successContainer,children:[t.jsx("div",{className:U.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsxs("div",{className:U.successMessage,children:[t.jsx("p",{children:o.successTitle}),t.jsx("p",{children:o.successMessage})]})]}),t.jsx("button",{onClick:e,className:U.primary,children:o.loginButtonText})]}),p==="register"&&t.jsxs("p",{className:U.switch,children:[o.alreadyHasAccountText,t.jsx("button",{type:"button",onClick:e,children:o.loginButtonText})]})]})}const nt=300,at={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function U1(e){const n=e.split(" ");if(n.length!==3)return e;const[a,s,o]=n,r=s.charAt(0).toUpperCase()+s.slice(1).toLowerCase();return`${a} ${r} ${o}`}const Wn=(e,n,a)=>{if(!e||!e.current)return{boolean:!1,text:""};const s=e.current?.value||"",o=s.length>nt,{PUBLIC_ENV:r}=a,i=r==="local",c=s.trim()!==""&&(i||n!=="")&&!o,h=o?`No debes exceder el limite de ${nt} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:c,text:h}},Lr=e=>{const n=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!n)return[];try{return JSON.parse(decodeURIComponent(n.split("=")[1]??""))}catch{return[]}},x1=(e,n)=>{const a=Lr(e);a.includes(n)||(a.push(n),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};function L1(e){const[n,a]=e.split("@");if(!n||!a)return e;let s="";n.length<=2?s=n[0]+"*":s=n[0]+"*".repeat(n.length-2)+n[n.length-1];const o=a.lastIndexOf(".");if(o===-1)return`${s}@${a}`;const r=a.slice(0,o),i=a.slice(o);let c="";return r.length<=2?c=r[0]+"*":c=r[0]+"*".repeat(r.length-2)+r[r.length-1],`${s}@${c}${i}`}const B1={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con Google",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function P1({onClose:e,checkAuth:n,goToRegister:a,handleGoogleLogin:s,API_ENV:o,texts:r}){const i={...B1,...r?.comentarios},[c,h]=I.useState("login"),[l,d]=I.useState(""),[u,f]=I.useState(""),[g,m]=I.useState(""),[p,A]=I.useState(""),[y,N]=I.useState(""),[S,v]=I.useState(!1),[w,T]=I.useState(!1),[B,F]=I.useState(null),X=async z=>{if(!w){z.preventDefault(),F(null),T(!0);try{const R=o.PUBLIC_ENV==="local"?"token":await an("comment_login",o.CAPTCHA_KEY||"");if(!R)throw new Error("Captcha token no generado");const P=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:l,password:u,token:R})});if(!P.ok){const x=await P.json().catch(()=>({}));throw new Error(x?.error||"Ha ocurrido un error")}e(),await n()}catch(R){F(R?.message||"Error inesperado")}finally{T(!1)}}},H=async z=>{if(!w){z.preventDefault(),F(null),T(!0);try{const R=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l})});if(!R.ok){const P=await R.json().catch(()=>({}));throw new Error(P?.error||"Error al enviar código")}f(""),h("changePassword")}catch(R){F(R?.message||"Error inesperado")}finally{T(!1)}}},L=async z=>{if(w)return;if(z.preventDefault(),p!==y){F("Las contraseñas no coinciden");return}if(xr.some(P=>!P.test(p))){F("La contraseña no cumple con los requisitos");return}F(null),T(!0);try{const P=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,code:g,newPassword:p})});if(!P.ok){const x=await P.json().catch(()=>({}));throw new Error(x?.error||"Error al cambiar contraseña")}h("feedback")}catch(P){F(P?.message||"Error inesperado")}finally{T(!1)}};return t.jsxs(t.Fragment,{children:[c==="login"&&t.jsx(O1,{email:l,password:u,showPassword:S,loading:w,error:B,setEmail:d,setPassword:f,setShowPassword:v,onSubmit:X,onForgot:()=>{F(null),h("forgot")},onRegister:a,handleGoogleLogin:s,t:i}),c==="forgot"&&t.jsx(q1,{email:l,setEmail:d,loading:w,error:B,onSubmit:H,onBack:()=>{F(null),h("login")},t:i}),c==="changePassword"&&t.jsx(M1,{email:l,confirmationCode:g,newPassword:p,confirmNewPassword:y,showPassword:S,loading:w,error:B,setConfirmationCode:m,setNewPassword:A,setConfirmNewPassword:N,setShowPassword:v,onSubmit:L,onBack:()=>{F(null),h("forgot")},t:i}),c==="feedback"&&t.jsx(D1,{onBackToLogin:()=>{F(null),h("login")},t:i})]})}function O1({email:e,password:n,showPassword:a,loading:s,error:o,setEmail:r,setPassword:i,setShowPassword:c,onSubmit:h,onForgot:l,onRegister:d,handleGoogleLogin:u,t:f}){return t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:u,className:U.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:U.googleIcon}),t.jsx("span",{children:f.GoogleButtonText})]}),t.jsx("div",{className:U.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:h,className:U.form,"data-error":o?"true":"false",children:[t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:f.email}),t.jsx("input",{type:"email",value:e,onChange:g=>r(g.target.value),className:U.input,placeholder:""})]}),t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:f.password}),t.jsx("input",{type:a?"text":"password",value:n,onChange:g=>i(g.target.value),className:U.input,placeholder:""}),t.jsxs("div",{className:U.checkboxRow,children:[t.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:g=>c(g.target.checked)}),t.jsx("label",{htmlFor:"showPasswordLogin",className:U.checkboxLabel,children:f.showPassword})]})]}),o&&t.jsx("p",{className:U.error,children:o}),t.jsx("button",{type:"submit",className:U.primary,disabled:s,children:s?t.jsx(tt,{}):f.loginButtonText})]}),t.jsxs("p",{className:U.switch,children:[f.noAccountText,t.jsx("button",{type:"button",onClick:d,children:f.registerButtonText})]}),t.jsx("button",{type:"button",className:U.forgotPassword,onClick:l,children:f.forgotPasswordText})]})}function q1({email:e,setEmail:n,loading:a,error:s,onSubmit:o,onBack:r,t:i}){return t.jsxs("form",{onSubmit:o,className:U.form,"data-error":s?"true":"false",children:[t.jsx("p",{className:U.message,children:i.forgotMessage}),t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:i.email}),t.jsx("input",{type:"email",value:e,name:"email",onChange:c=>n(c.target.value),className:U.input,placeholder:""})]}),s&&t.jsx("p",{className:U.error,children:s}),t.jsx("button",{type:"submit",className:U.primary,disabled:a,children:a?t.jsx(tt,{}):i.sendCodeButton}),t.jsx("p",{className:U.switch,children:t.jsx("button",{type:"button",onClick:r,children:i.backButton})})]})}function M1({email:e,confirmationCode:n,newPassword:a,confirmNewPassword:s,showPassword:o,loading:r,error:i,setConfirmationCode:c,setNewPassword:h,setConfirmNewPassword:l,setShowPassword:d,onSubmit:u,onBack:f,t:g}){const m=g.changePasswordMessage.replace("{{email}}",L1(e));return t.jsxs("form",{onSubmit:u,className:U.form,"data-error":i?"true":"false",children:[t.jsx("p",{className:U.message,children:m}),t.jsxs("ul",{className:U.formUl,children:[t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:g.verificationCodeLabel}),t.jsx("input",{type:"text",value:n,onChange:p=>c(p.target.value),className:U.input,placeholder:""})]}),t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:g.newPasswordLabel}),t.jsx("input",{type:o?"text":"password",value:a,onChange:p=>h(p.target.value),className:U.input,placeholder:"",name:"password"}),t.jsx("div",{className:U.passwordChecker,children:xr.map((p,A)=>{const y=p.test(a);return t.jsxs("div",{className:y?U.valid:U.invalid,children:[t.jsx("div",{children:y?"✔":"○"}),t.jsx("div",{children:p.label})]},A)})})]}),t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:g.confirmPasswordLabel}),t.jsx("input",{type:o?"text":"password",value:s,onChange:p=>l(p.target.value),className:U.input,placeholder:""}),t.jsxs("div",{className:U.checkboxRow,children:[t.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:o,onChange:p=>d(p.target.checked)}),t.jsx("label",{htmlFor:"showPasswordForgot",className:U.checkboxLabel,children:g.showPasswordsLabel})]})]})]}),i&&t.jsx("p",{className:U.error,children:i}),t.jsx("button",{type:"submit",className:U.primary,style:{maxWidth:r?"revert-layer":"fit-content"},disabled:r,children:r?t.jsx(tt,{}):g.changePasswordButton}),t.jsx("p",{className:U.switch,children:t.jsx("button",{type:"button",onClick:f,children:g.backButton})})]})}function D1({onBackToLogin:e,t:n}){return t.jsxs("div",{className:U.form,children:[t.jsx("p",{className:U.success,children:n.feedbackSuccessMessage}),t.jsx("button",{type:"button",className:U.primary,onClick:e,children:n.loginButtonText})]})}function Br({handleGoogleLogin:e,onClose:n,checkAuth:a,icon:s,API_ENV:o,texts:r}){const[i,c]=I.useState("login");return t.jsx("div",{className:U.overlay,role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:h=>{const l=h.target;l&&l.id==="pop-overlay"&&n()},children:t.jsxs("div",{className:U.card,children:[t.jsxs("header",{className:U.header,children:[t.jsx("div",{className:U.logo,children:s?s():null}),t.jsx("button",{onClick:n,className:U.close,"aria-label":"Cerrar",children:t.jsx(wt,{})})]}),i==="login"&&t.jsx(P1,{onClose:n,checkAuth:a,handleGoogleLogin:e,goToRegister:()=>c("register"),API_ENV:o,texts:r}),i==="register"&&t.jsx(k1,{handleGoogleLogin:e,goToLogin:()=>c("login"),API_ENV:o,texts:r})]})})}const Pr={content:"_content_ghncj_1",videoContent:"_videoContent_ghncj_17"},on={container:"_container_1wcps_1",playStyled:"_playStyled_1wcps_11",imageStyled:"_imageStyled_1wcps_25",longer:"_longer_1wcps_51",contentNews:"_contentNews_1wcps_61",tagContent:"_tagContent_1wcps_101",tag:"_tag_1wcps_101",titular:"_titular_1wcps_135",small:"_small_1wcps_161",figure:"_figure_1wcps_173",backDrop:"_backDrop_1wcps_183",backDropAux:"_backDropAux_1wcps_199"},Or=async e=>{const{size:n="longer",video:a}=e,s=a.main.image.sizes[0]?.url??"";return t.jsx("figure",{className:on.figure,children:t.jsxs("span",{className:on.backdrop,children:[t.jsx("span",{className:on.backDropAux}),t.jsx(M,{href:a.info.link.url,target:a.info.link.target,children:t.jsxs("div",{children:[a.main.image.sizes.map(async(o,r)=>o.width>=580?t.jsx("source",{media:"(width >=900px)",srcSet:await fe(o.url)},r):t.jsx("source",{media:"(width <900px)",srcSet:await fe(o.url)},r)),t.jsx("img",{fetchPriority:"low",loading:"lazy",className:[on.imageStyled,on[n]].join(" "),alt:"",src:s?await fe(s):""})]})})]})})},$1=e=>{const{videos:n}=e;return t.jsx("div",{className:Pr.content,children:t.jsx(kt,{children:t.jsx(pe,{title:"Videos",isTitle:!0,children:t.jsxs("div",{className:Pr.videoContent,children:[t.jsx(Or,{video:n[0]}),t.jsx("div",{style:{display:"flex",flexDirection:"column"},children:n.slice(1).map((a,s)=>t.jsx(Or,{size:"small",video:a},`video-small-${s}`))})]})})})})},_t={content:"_content_quk50_1",videoContent:"_videoContent_quk50_17",articleSection:"_articleSection_quk50_41",contentLatout:"_contentLatout_quk50_61",title:"_title_quk50_71",article:"_article_quk50_41",correspondent:"_correspondent_quk50_127"},qr={container:"_container_17w1m_1",playStyled:"_playStyled_17w1m_17"},G1=e=>{const{video:n}=e,a=En();return t.jsx(M,{href:n.info.link.url?n.info.link.url:void 0,target:n.info.link.target,children:t.jsxs("section",{className:qr.container,children:[t.jsx(ke,{isLarge:!0,preview:{sizes:n.main.image.sizes,description:n.main.description}}),t.jsx(a,{className:qr.playStyled})]})})},j1=e=>{const n=()=>e?.video.main.author?`${e?.video.main.author} - ${Pe(e.video.info.date.created)}`:e?.video.main.author;return t.jsx("div",{className:_t.content,children:t.jsx(kt,{className:_t.contentLatout,children:t.jsx(pe,{title:"Videos",isTitle:!0,children:t.jsxs("div",{className:_t.videoContent,children:[t.jsx(G1,{video:e.video}),t.jsxs("div",{className:_t.articleSection,children:[t.jsx(M,{className:_t.title,href:e.video.info.link.url,target:e.video.info.link.target,children:e.video.main.title}),t.jsx("p",{className:_t.article,children:Oe(e.video.main.description)}),t.jsx("p",{className:_t.correspondent,children:n()})]})]})})})})},F1=e=>{switch(e.option){case"op1":return t.jsx($1,{videos:e.data});case"op2":return t.jsx(j1,{video:e.data[0]});default:return t.jsx(t.Fragment,{})}};function Q1({containerId:e,containerId2:n}){return I.useEffect(()=>{try{let a=function(){const d=window.twttr;d?.widgets?d.widgets.load(s):l<10?(l++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const s=document.getElementById(e),o=document.getElementById(n);if(!s&&!o)return;const r=s?.querySelectorAll("script[src]")??[],i=o?.querySelectorAll("script[src]")??[];[...r,...i].forEach(d=>{const u=document.createElement("script");Array.from(d.attributes).forEach(f=>{u.setAttribute(f.name,f.value)}),d.replaceWith(u)});const h=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(h)for(let d=0;d<h.length;d++)h[d]?.remove();let l=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const d=document.createElement("script");d.src="https://platform.twitter.com/widgets.js",d.async=!0,d.onload=a,document.body.appendChild(d)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const H1=({currentNew:e})=>e&&e?.hascontent?.hasembeddedtwitter&&t.jsx("script",{src:"https://platform.twitter.com/widgets.js"}),z1=e=>{const{isVideo:n=!1,isLarge:a=!1,hasShadow:s=!1,BackDropAuxHeigthMobile:o}=e,r=Ia(),i=I.useMemo(()=>{const f=e?.preview?.sizes;if(f&&Array.isArray(f)&&f.length>0)return f;const g=e?.preview?.original;return g?.url?[{url:g.url,width:g.width||0,height:g.height||0}]:[]},[e?.preview?.sizes,e?.preview?.original]);if(!i.length||!i[0]?.url||i[0]?.url==="")return t.jsx("div",{className:ce.imagePlaceholder});const{PUBLIC_API_HOST:c="",PUBLIC_ASSETS_URL:h}=e.API_ENV,l=i[0]?.url,d=h&&h!=="false"?h:c,u=l?.startsWith("http")||l?.includes(d)?l:d+l;return t.jsx("figure",{className:ce.figure,children:t.jsxs("span",{className:ce.backdrop,children:[t.jsx("span",{className:ce.backdropAux,style:{height:o||"56.25%"}}),t.jsxs("picture",{children:[t.jsx("img",{fetchPriority:"low",loading:"lazy",className:ce.imageStyled,alt:e.preview?.description||"",src:u,style:{boxShadow:s?"0px 4px 8px 0px #00000033":"0px"}}),n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:ce.boxPlayIcon,style:{height:a?"40%":"72px"}}),t.jsx(r,{className:ce.playStyled,style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},V1=e=>t.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("path",{d:"M17.9576 21.2985C16.8233 21.2985 15.9277 22.194 15.9277 23.3283C15.9277 24.4627 16.8233 25.3582 17.9576 25.3582C19.0919 25.3582 19.9874 24.4627 19.9874 23.3283C19.9874 22.194 19.0919 21.2985 17.9576 21.2985ZM17.9576 19.2686C19.0919 19.2686 19.9874 18.3731 19.9874 17.2388C19.9874 16.1045 19.0919 15.2089 17.9576 15.2089C16.8233 15.2089 15.9277 16.1045 15.9277 17.2388C15.9277 18.3731 16.8233 19.2686 17.9576 19.2686ZM17.9576 13.1791C19.0919 13.1791 19.9874 12.2836 19.9874 11.1492C19.9874 10.0149 19.0919 9.11938 17.9576 9.11938C16.8233 9.11938 15.9277 10.0149 15.9277 11.1492C15.9277 12.2836 16.8233 13.1791 17.9576 13.1791Z",fill:"#7B888A"})}),Mr={info:{section:{name:"",slug:"",url:""},link:{url:"/",target:"",canonical:!1,internal:""},date:{date:"",created:0,modified:0,firstpublish:0,lastpublish:0}},config:{zonehome:void 0,priorityhome:"",zonesection:"",prioritysection:"",homepreview:"",showcomments:!0,showtime:!0,showauthor:!0,showuppertitle:!0,showsubtitle:!0,showads:!0},main:{title:{home:"",section:"",article:""},subtitle:{rendered:"",striped:""},tags:[]},authors:[{firstname:"",lastname:"",fullname:"",image:void 0,name:"",internaluser:!1}],preview:void 0},W1=({section:e,internalPath:n,banner:a,isVisible:s=!1,stylesConfig:o,API_ENV:r,fetchConfig:i,paths:c})=>{const h=r.FETCH_SIZE_MORE_NEWS??6,[l,d]=I.useState({data:Array.from({length:h},()=>Mr)}),[u,f]=I.useState(!1),g=I.useCallback(async()=>{if(!n)return;const A=new URLSearchParams({section:e,currentNewsLink:n}),y=await fetch(`/api/get-more-news?${A}`);if(!y.ok)throw new Error(`HTTP error! status: ${y.status}`);return await y.json()},[e,n]),m=I.useCallback(async()=>{const{PUBLIC_API_FRONT:A,PUBLIC_X_SECURITY_TOKEN:y,PUBLIC_API_PATH_VERSION:N,PUBLIC_PUBLICATION_ID:S}=r;if(!A||!y||!S||!N)throw new Error("Missing required environment variables");const v=await ie.get(`${A}${N}/news-list-section`,{params:{size:h+1,newstype:i.newsType,section:e,imagesizes:i.imgSizes,publication:parseInt(S)},headers:{"x-api-token":y,"Content-Type":"application/json"}});return{...v.data,data:v.data.data.filter(w=>w.info.link.internal!==n)}},[e,n,r]),p=I.useCallback(async()=>{if(!(u||!n)){f(!0);try{let A;r.PUBLIC_ENV!=="prod"?A=await g():A=await m(),d({...A,data:A.data.slice(0,h)})}catch(A){console.error("[/api/get-more-news] Error:",A.message),d(void 0)}}},[u,n,r.PUBLIC_ENV,g,m]);return I.useEffect(()=>{s&&p()},[s,p]),!l?.data||l.data.length===0?null:t.jsx(Y1,{news:l.data,title:"Más Noticias",...o["Modulo 1x3 Client"]??o["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,API_ENV:r,paths:c,isVisible:s})},Y1=e=>{const{news:n,hasLines:a=!1,API_ENV:s}=e,o=r=>a&&(r+1)%3!==0?Ga.contentSeparator:"";return t.jsx("div",{className:Ga.newsContent,style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:n.map((r,i)=>{const{main:c,authors:h,info:l,preview:d,isVideo:u=!1,config:f,overImage:g="default",isTitle:m=!1,isLarge:p=!1,keywords:A}=r;return t.jsx("div",{className:o(i),style:{order:i},children:t.jsxs("section",{className:Vt.content,children:[t.jsx(M,{title:c?.title?.section,href:l?.link?.url??"invalidUrl","aria-label":c?.title?.section??"nota",target:l?.link?.target,children:t.jsx(z1,{isVisible:e.isVisible,preview:d,rounded:e.rounded,isVideo:u,isLarge:p,API_ENV:e.API_ENV,getImageUrl:e.getImageUrl})}),t.jsx("div",{className:Vt.newsDescription,children:t.jsx(K1,{main:c,SHOW_TAG_BY_SECTION:s.SHOW_TAG_BY_SECTION,authors:h,info:l,preview:d,share:e.share,config:f,overImage:g,isTitle:m,paths:e.paths,isVisible:e.isVisible,DATE_CONFIG:e.API_ENV,keywords:A})})]})},i)})})},K1=e=>{const{share:n=!1,cutSubtitle:a=!0,SHOW_TAG_BY_SECTION:s,keywords:o,info:r}=e,c=(()=>{if(!e?.authors||e.authors.length===0)return"";const d=e.authors[0],u=Pe(e.info?.date?.modified,e.DATE_CONFIG);return d&&e?.config?.showtime&&e.config?.showauthor?`${d.fullname} - ${u}`:d&&e.config?.showauthor?d.fullname:e?.config?.showtime?u:""})(),h=()=>e.main.uppertitle?t.jsx("p",{className:se.uppertitle,title:e.main.uppertitle,children:e.main.uppertitle}):null,l=()=>{if(s&&o?.tags?.length&&o.tags.length>0){const d=o.tags[0],u=d.name;return t.jsxs("h3",{className:se.sectionDescriptionContainer,children:[d.approved?t.jsx(M,{"aria-label":u,block_subPublication:e.DATE_CONFIG?.SUB_PUBLICATION_PREFIX_IN_ROUTES?.tema,className:se.sectionDescription,href:st(d,e.paths),children:u}):t.jsx("div",{className:se.sectionDescription,children:u}),h()]})}else if(r?.section?.url){const d=r.section.name;return t.jsxs("h3",{className:se.sectionDescriptionContainer,children:[t.jsx(M,{"aria-label":d,className:se.sectionDescription,href:r.section.url,children:d}),h()]})}return null};return t.jsxs("div",{className:se.boxInformation,children:[n&&t.jsx(V1,{className:se.dotStyles}),t.jsx(l,{}),t.jsx("h2",{className:se.articule,children:t.jsx(M,{className:se.linkStyled,style:{"--isLink":e?.info?.link?.url?"underline":"none"},"aria-label":e.main?.title?.section??"nota",href:e?.info?.link?.url,target:e?.info?.link?.target,children:e.main?.title?.section})}),e.config?.showsubtitle&&e.main?.subtitle?.striped&&t.jsx("p",{className:se.description,style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?Oe(e.main.subtitle.striped):e.main.subtitle.striped}),(e?.config?.showtime||e.config?.showauthor)&&c&&t.jsx(t.Fragment,{children:e.authors?.[0]?.internaluser?t.jsx(M,{block_subPublication:e.DATE_CONFIG?.SUB_PUBLICATION_PREFIX_IN_ROUTES?.autor,className:se.correspondentLink,href:`/${e.paths.autor}/${e.authors[0].name}`,children:c}):t.jsx("div",{className:se.correspondent,children:c})})]})},J1=({user:e,handleLogout:n,message:a})=>{const s=()=>{const r=document.querySelector(".user-actions-options");r&&r.classList.toggle("show")},o=e.firstname??"Usuario";return t.jsx("div",{className:"comment-item",children:t.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?t.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):t.jsx("div",{className:"comment-avatar",children:o.charAt(0).toUpperCase()}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{className:"comment-header",children:[t.jsxs("span",{className:"comment-username user-welcome",children:["Hola ",o,"!"]}),t.jsx("div",{className:"user-actions-options",children:t.jsx("button",{onClick:()=>{n()},children:"Cerrar Sesion"})}),t.jsx("button",{className:"user-actions-span",onClick:s,children:t.jsx($n,{width:13,height:13,fill:"black"})})]}),t.jsx("p",{className:"comment-text",children:a})]})]})})},we={overlay:"_overlay_1ng7z_5",popup:"_popup_1ng7z_33",title:"_title_1ng7z_79",optionsContainer:"_optionsContainer_1ng7z_103",option:"_option_1ng7z_103",radioInput:"_radioInput_1ng7z_131",radioCustom:"_radioCustom_1ng7z_139",optionLabel:"_optionLabel_1ng7z_193",buttons:"_buttons_1ng7z_219",cancelButton:"_cancelButton_1ng7z_233",closeButton:"_closeButton_1ng7z_235",buttonAlone:"_buttonAlone_1ng7z_273",reportButton:"_reportButton_1ng7z_285",successContainer:"_successContainer_1ng7z_325",thumbsUp:"_thumbsUp_1ng7z_341",successMessage:"_successMessage_1ng7z_353",errorMessage:"_errorMessage_1ng7z_435",loadingContainer:"_loadingContainer_1ng7z_461"},Dr=async(e,n)=>{if(!e)return!1;const{CAPTCHA_PROJECT:a,CAPTCHA_KEY_V2:s,COMMENTS_CAPTCHA_API_KEY:o}=n;try{const r=a,i=s,l=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${r}/assessments?key=${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:i}})})).json();return console.log("reCAPTCHA Enterprise verification result:",l),l.tokenProperties?.valid===!0}catch(r){return console.error("Error verificando reCAPTCHA Enterprise:",r),!1}};async function Z1({publication:e,username:n,id:a,type:s,baseUrl:o,captchaToken:r,apiToken:i,securityToken:c,COMMENTS_VARS:h}){if(!e||!n||!a||!s||!r)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof n!="string"||typeof a!="string"||typeof s!="string"||typeof r!="string")throw new Error("Todos los parámetros deben ser strings");if(!await Dr(r,h))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const l=`${o}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,d=encodeURIComponent(s),u=new URLSearchParams({publication:e,username:n??!1,id:a,type:d}),f=`${l}?${u.toString()}`;try{console.log("Reporting comment:",{publication:e,username:n,id:a,type:s,encodedType:d,url:f});const g=await ie.get(f,{headers:{"User-Agent":"blu3st@ck-react","x-security-token":c,"x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",g.data),g.status===200||g.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:g.status,data:g.data};throw new Error(`Respuesta inesperada del servidor: ${g.status}`)}catch(g){if(console.error("Error reporting comment:",g),ie.isAxiosError(g)){const m=g.response?.status,p=g.response?.data;throw m===400?new Error("Datos inválidos para el reporte"):m===401?new Error("Token de API inválido"):m===403?new Error("Acceso denegado para reportar comentario"):m===404?new Error("Comentario no encontrado"):m===409?new Error("El comentario ya fue reportado por este usuario"):m===500?new Error("Error interno del servidor CMS"):new Error(p?.error||p?.message||`Error HTTP ${m}: No se pudo reportar el comentario`)}throw g}}const Yn={spam:"Es spam o contenido comercial no deseado",inappropriate:"Lenguaje inadecuado",hate:"Discurso o símbolos de odio",misinformation:"Información falsa o fraude",terrorism:"Promueve el terrorismo",intellectual:"Violación de propiedad intelectual",bullying:"Bullying o acoso"};function X1(e){return Yn[e]}var Kn={exports:{}},Jn={exports:{}},oe={};var $r;function R1(){if($r)return oe;$r=1;var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function S(w){if(typeof w=="object"&&w!==null){var T=w.$$typeof;switch(T){case n:switch(w=w.type,w){case h:case l:case s:case r:case o:case u:return w;default:switch(w=w&&w.$$typeof,w){case c:case d:case m:case g:case i:return w;default:return T}}case a:return T}}}function v(w){return S(w)===l}return oe.AsyncMode=h,oe.ConcurrentMode=l,oe.ContextConsumer=c,oe.ContextProvider=i,oe.Element=n,oe.ForwardRef=d,oe.Fragment=s,oe.Lazy=m,oe.Memo=g,oe.Portal=a,oe.Profiler=r,oe.StrictMode=o,oe.Suspense=u,oe.isAsyncMode=function(w){return v(w)||S(w)===h},oe.isConcurrentMode=v,oe.isContextConsumer=function(w){return S(w)===c},oe.isContextProvider=function(w){return S(w)===i},oe.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===n},oe.isForwardRef=function(w){return S(w)===d},oe.isFragment=function(w){return S(w)===s},oe.isLazy=function(w){return S(w)===m},oe.isMemo=function(w){return S(w)===g},oe.isPortal=function(w){return S(w)===a},oe.isProfiler=function(w){return S(w)===r},oe.isStrictMode=function(w){return S(w)===o},oe.isSuspense=function(w){return S(w)===u},oe.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===s||w===l||w===r||w===o||w===u||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===g||w.$$typeof===i||w.$$typeof===c||w.$$typeof===d||w.$$typeof===A||w.$$typeof===y||w.$$typeof===N||w.$$typeof===p)},oe.typeOf=S,oe}var re={};var Gr;function eh(){return Gr||(Gr=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function S($){return typeof $=="string"||typeof $=="function"||$===s||$===l||$===r||$===o||$===u||$===f||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===g||$.$$typeof===i||$.$$typeof===c||$.$$typeof===d||$.$$typeof===A||$.$$typeof===y||$.$$typeof===N||$.$$typeof===p)}function v($){if(typeof $=="object"&&$!==null){var ve=$.$$typeof;switch(ve){case n:var ta=$.type;switch(ta){case h:case l:case s:case r:case o:case u:return ta;default:var ni=ta&&ta.$$typeof;switch(ni){case c:case d:case m:case g:case i:return ni;default:return ve}}case a:return ve}}}var w=h,T=l,B=c,F=i,X=n,H=d,L=s,z=m,R=g,P=a,x=r,k=o,G=u,O=!1;function Y($){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b($)||v($)===h}function b($){return v($)===l}function E($){return v($)===c}function D($){return v($)===i}function Q($){return typeof $=="object"&&$!==null&&$.$$typeof===n}function j($){return v($)===d}function V($){return v($)===s}function K($){return v($)===m}function J($){return v($)===g}function ne($){return v($)===a}function ae($){return v($)===r}function Z($){return v($)===o}function he($){return v($)===u}re.AsyncMode=w,re.ConcurrentMode=T,re.ContextConsumer=B,re.ContextProvider=F,re.Element=X,re.ForwardRef=H,re.Fragment=L,re.Lazy=z,re.Memo=R,re.Portal=P,re.Profiler=x,re.StrictMode=k,re.Suspense=G,re.isAsyncMode=Y,re.isConcurrentMode=b,re.isContextConsumer=E,re.isContextProvider=D,re.isElement=Q,re.isForwardRef=j,re.isFragment=V,re.isLazy=K,re.isMemo=J,re.isPortal=ne,re.isProfiler=ae,re.isStrictMode=Z,re.isSuspense=he,re.isValidElementType=S,re.typeOf=v})()),re}var jr;function Ha(){return jr||(jr=1,process.env.NODE_ENV==="production"?Jn.exports=R1():Jn.exports=eh()),Jn.exports}var za,Fr;function th(){if(Fr)return za;Fr=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function s(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function o(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var i={},c=0;c<10;c++)i["_"+String.fromCharCode(c)]=c;var h=Object.getOwnPropertyNames(i).map(function(d){return i[d]});if(h.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(d){l[d]=d}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return za=o()?Object.assign:function(r,i){for(var c,h=s(r),l,d=1;d<arguments.length;d++){c=Object(arguments[d]);for(var u in c)n.call(c,u)&&(h[u]=c[u]);if(e){l=e(c);for(var f=0;f<l.length;f++)a.call(c,l[f])&&(h[l[f]]=c[l[f]])}}return h},za}var Va,Qr;function Wa(){if(Qr)return Va;Qr=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Va=e,Va}var Ya,Hr;function zr(){return Hr||(Hr=1,Ya=Function.call.bind(Object.prototype.hasOwnProperty)),Ya}var Ka,Vr;function nh(){if(Vr)return Ka;Vr=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var n=Wa(),a={},s=zr();e=function(r){var i="Warning: "+r;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(r,i,c,h,l){if(process.env.NODE_ENV!=="production"){for(var d in r)if(s(r,d)){var u;try{if(typeof r[d]!="function"){var f=Error((h||"React class")+": "+c+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=r[d](i,d,h,c,null,n)}catch(m){u=m}if(u&&!(u instanceof Error)&&e((h||"React class")+": type specification of "+c+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in a)){a[u.message]=!0;var g=l?l():"";e("Failed "+c+" type: "+u.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},Ka=o,Ka}var Ja,Wr;function ah(){if(Wr)return Ja;Wr=1;var e=Ha(),n=th(),a=Wa(),s=zr(),o=nh(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(c){var h="Warning: "+c;typeof console<"u"&&console.error(h);try{throw new Error(h)}catch{}});function i(){return null}return Ja=function(c,h){var l=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function u(b){var E=b&&(l&&b[l]||b[d]);if(typeof E=="function")return E}var f="<<anonymous>>",g={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:N(),arrayOf:S,element:v(),elementType:w(),instanceOf:T,node:H(),objectOf:F,oneOf:B,oneOfType:X,shape:z,exact:R};function m(b,E){return b===E?b!==0||1/b===1/E:b!==b&&E!==E}function p(b,E){this.message=b,this.data=E&&typeof E=="object"?E:{},this.stack=""}p.prototype=Error.prototype;function A(b){if(process.env.NODE_ENV!=="production")var E={},D=0;function Q(V,K,J,ne,ae,Z,he){if(ne=ne||f,Z=Z||J,he!==a){if(h){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ve=ne+":"+J;!E[ve]&&D<3&&(r("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+ne+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),E[ve]=!0,D++)}}return K[J]==null?V?K[J]===null?new p("The "+ae+" `"+Z+"` is marked as required "+("in `"+ne+"`, but its value is `null`.")):new p("The "+ae+" `"+Z+"` is marked as required in "+("`"+ne+"`, but its value is `undefined`.")):null:b(K,J,ne,ae,Z)}var j=Q.bind(null,!1);return j.isRequired=Q.bind(null,!0),j}function y(b){function E(D,Q,j,V,K,J){var ne=D[Q],ae=k(ne);if(ae!==b){var Z=G(ne);return new p("Invalid "+V+" `"+K+"` of type "+("`"+Z+"` supplied to `"+j+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return A(E)}function N(){return A(i)}function S(b){function E(D,Q,j,V,K){if(typeof b!="function")return new p("Property `"+K+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var J=D[Q];if(!Array.isArray(J)){var ne=k(J);return new p("Invalid "+V+" `"+K+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected an array."))}for(var ae=0;ae<J.length;ae++){var Z=b(J,ae,j,V,K+"["+ae+"]",a);if(Z instanceof Error)return Z}return null}return A(E)}function v(){function b(E,D,Q,j,V){var K=E[D];if(!c(K)){var J=k(K);return new p("Invalid "+j+" `"+V+"` of type "+("`"+J+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return A(b)}function w(){function b(E,D,Q,j,V){var K=E[D];if(!e.isValidElementType(K)){var J=k(K);return new p("Invalid "+j+" `"+V+"` of type "+("`"+J+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return A(b)}function T(b){function E(D,Q,j,V,K){if(!(D[Q]instanceof b)){var J=b.name||f,ne=Y(D[Q]);return new p("Invalid "+V+" `"+K+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected ")+("instance of `"+J+"`."))}return null}return A(E)}function B(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),i;function E(D,Q,j,V,K){for(var J=D[Q],ne=0;ne<b.length;ne++)if(m(J,b[ne]))return null;var ae=JSON.stringify(b,function(he,$){var ve=G($);return ve==="symbol"?String($):$});return new p("Invalid "+V+" `"+K+"` of value `"+String(J)+"` "+("supplied to `"+j+"`, expected one of "+ae+"."))}return A(E)}function F(b){function E(D,Q,j,V,K){if(typeof b!="function")return new p("Property `"+K+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var J=D[Q],ne=k(J);if(ne!=="object")return new p("Invalid "+V+" `"+K+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected an object."));for(var ae in J)if(s(J,ae)){var Z=b(J,ae,j,V,K+"."+ae,a);if(Z instanceof Error)return Z}return null}return A(E)}function X(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var E=0;E<b.length;E++){var D=b[E];if(typeof D!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O(D)+" at index "+E+"."),i}function Q(j,V,K,J,ne){for(var ae=[],Z=0;Z<b.length;Z++){var he=b[Z],$=he(j,V,K,J,ne,a);if($==null)return null;$.data&&s($.data,"expectedType")&&ae.push($.data.expectedType)}var ve=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new p("Invalid "+J+" `"+ne+"` supplied to "+("`"+K+"`"+ve+"."))}return A(Q)}function H(){function b(E,D,Q,j,V){return P(E[D])?null:new p("Invalid "+j+" `"+V+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return A(b)}function L(b,E,D,Q,j){return new p((b||"React class")+": "+E+" type `"+D+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function z(b){function E(D,Q,j,V,K){var J=D[Q],ne=k(J);if(ne!=="object")return new p("Invalid "+V+" `"+K+"` of type `"+ne+"` "+("supplied to `"+j+"`, expected `object`."));for(var ae in b){var Z=b[ae];if(typeof Z!="function")return L(j,V,K,ae,G(Z));var he=Z(J,ae,j,V,K+"."+ae,a);if(he)return he}return null}return A(E)}function R(b){function E(D,Q,j,V,K){var J=D[Q],ne=k(J);if(ne!=="object")return new p("Invalid "+V+" `"+K+"` of type `"+ne+"` "+("supplied to `"+j+"`, expected `object`."));var ae=n({},D[Q],b);for(var Z in ae){var he=b[Z];if(s(b,Z)&&typeof he!="function")return L(j,V,K,Z,G(he));if(!he)return new p("Invalid "+V+" `"+K+"` key `"+Z+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(D[Q],null," ")+`
|
|
260
|
+
`}}catch(y){console.error("insertVideos error for",g,y),A=""}else A=f;s=u,a+=A,o.lastIndex=u}return a+=e.slice(s),a=Zd(a),a}async function a1(e){const{news:n,banners:a,newsRelatedResponses:s,newsRelatedListResponses:o,slug:r,itemList:i,socials:c,getVideos:h,commonServices:l}=e;let d=n?.body?.rendered??"";d=d.replace(/<script[^>]*src=["']https:\/\/platform\.twitter\.com\/widgets\.js["'][^>]*><\/script>/gi,""),d=d.replace(/ /g,""),d=Rd(d,a),d=e1(d),d=await Xd(d),d=await t1(d,e.texts,s),d=await n1(d,h),d=Kd(d),d=Jd(d);const u=n.main.sources??[],{NEWS_JOURNALIST_COMPONENT:f,CONFIG_blockDefaultTwitterHydrator:g}=W(),m=n.config.articlepreview===Ct.fotoGaleria&&n.hascontent?.hasgalleryimages;return t.jsxs("div",{className:Hn.content,children:[r!=="liveblogs"&&e.showHeaderImage?m?t.jsx(vr,{commonServices:l,newsformated:n,internal:n.info.link.internal}):t.jsx(Wo,{preview:n.preview}):null,t.jsx(ye,{banners:a,name:"block_1"}),t.jsx("div",{className:Hn.journalistArticleContent,children:f==="op1"?t.jsx(Md,{autorIcon:e.autorIcon,socials:c,news:n,texts:e.texts,noteShare:e.noteShare,paths:e.paths}):t.jsx(Yd,{autorIcon:e.autorIcon,socials:c,news:n,texts:e.texts,noteShare:e.noteShare,paths:e.paths})}),t.jsx($d,{summary:n.main.summary}),t.jsx("main",{className:Hn.contentNews,suppressHydrationWarning:!0,id:"content-news-section",dangerouslySetInnerHTML:{__html:d}}),t.jsx(Pd,{texts:e.texts,itemList:i,banners:a,slug:r,getVideos:h,newsRelatedListResponses:o??[]}),u.length>0&&t.jsxs("div",{className:Hn.noteSource,children:[t.jsx(jd,{}),t.jsx("p",{children:String(e.texts.noteSource??"")+(u.length===1?"":"s")+": "+u.map(p=>p.name).join(", ")})]}),!g&&n&&n.hascontent&&n.hascontent.hasembeddedtwitter&&t.jsx("script",{async:!0,defer:!0,src:"https://platform.twitter.com/widgets.js"})]})}const s1=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(pe,{title:a,titleUrl:e.titleUrl,children:t.jsx(pt,{slot_id:s,cardWidth:200,children:n.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return t.jsx(Wt,{...c,titleGradient:!0,paths:e.paths},i)})})})},o1=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(pe,{title:a,titleUrl:e.titleUrl,children:t.jsx(pt,{slot_id:s,cardWidth:343,cardGap:32,visibleItems:3,children:n.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return t.jsx(Wt,{...c,titleGradient:!0,paths:e.paths},i)})})})},r1=e=>{const{content:n,title:a,slot_id:s}=e,o=e.slot_id&&e.slot_id!=="Nota_1";return n&&n.length!==0&&t.jsx(pe,{title:a,titleUrl:e.titleUrl,children:t.jsx(pt,{slot_id:s,fullPageWidth:!0,visibleItems:1,pagination:!0,cardGap:0,children:n.map((r,i)=>{const c={...r,main:{...r.main,title:{...r.main.title,section:o?r.main.title.home:r.main.title.section}}};return I.createElement(Wt,{...c,key:i,titleGradient:!0,paths:e.paths})})})})},zn=e=>{const n={};for(const a in e)a.startsWith("--")&&(n[a]=e[a]);return n},vt={headerSection:"_headerSection_nhjex_1",title:"_title_nhjex_21",subtitle:"_subtitle_nhjex_45",newsContent:"_newsContent_nhjex_71",containerCards:"_containerCards_nhjex_87",image:"_image_nhjex_99",blockHeadContainer:"_blockHeadContainer_nhjex_111"},i1=e=>{const{content:n,title:a,isVideo:s}=e;if(!n||n.length===0)return;const o=n[0],r=n.slice(1),i=e.slot_id&&e.slot_id!=="Nota_1";return o&&r&&t.jsxs(pe,{title:a,titleUrl:e.titleUrl,children:[t.jsx("div",{className:vt.headerSection,children:t.jsxs("a",{style:{"--heightImageOverwriteMobile":"200%"},className:vt.image,href:o?.info?.link?.url,target:o?.info?.link?.target,children:[t.jsxs("div",{className:vt.blockHeadContainer,children:[t.jsx("p",{className:vt.title,children:o?.main?.title.home}),o?.main?.subtitle?.rendered&&t.jsx("p",{className:vt.subtitle,children:o?.main?.subtitle?.striped})]}),t.jsx(ke,{preview:o.preview})]})}),t.jsxs("div",{className:vt.containerCards,children:[t.jsx("div",{className:"banner-context",style:{order:1},children:e.banner}),t.jsx("div",{className:vt.newsContent,children:Array.isArray(r)&&r.map((c,h)=>{const l={...c,main:{...c.main,title:{...c.main.title,section:i?c.main.title.home:c.main.title.section}}};return t.jsx("div",{style:{order:h},children:t.jsx(Fe,{...l,isVideo:s,paths:e.paths})},h)})})]})]})},c1=({printEdition:e,title:n})=>e&&t.jsx(pe,{title:n,children:t.jsx("div",{className:"iframe-container",dangerouslySetInnerHTML:{__html:e||""}})}),Er={banner:e=>t.jsx(ye,{...e,name:e.slot_id.replace("Home","block")}),readest:e=>t.jsx(kn,{...e}),"Modulo 1x3":e=>t.jsx(Ma,{...e}),"Modulo 1x4":e=>t.jsx(fr,{...e}),"Modulo 1x5":e=>t.jsx(mr,{...e}),"Destacado noticias":e=>t.jsx(lr,{...e}),"Destacado full width":e=>t.jsx(i1,{...e}),"Destacado videos":e=>t.jsx(gr,{...e}),"Carrusel card":e=>t.jsx(wr,{...e}),"Carrusel story":e=>t.jsx(s1,{...e}),"Carrusel owl":e=>t.jsx(o1,{...e}),"Modulo fotogaleria":e=>t.jsx(r1,{...e}),"Carrusel opinion":e=>t.jsx(yr,{...e}),"Modulo 1x3 card":e=>t.jsx(Ar,{...e}),"Modulo iframe":e=>t.jsx(c1,{...e})};function en({component:e,slot_id:n,data:a,banners:s}){if(s)return Er[e]&&t.jsx("div",{className:"home-slot",style:zn(a),children:Er[e]({...a,banners:s,slot_id:n})})}function l1({children:e,stylesConfigEntry:n}){return t.jsx("div",{className:"home-slot",style:zn(n),children:e})}const kr={Diario:e=>{if(!e?.data||e.data.length===0)return;const n=e.data.slice(1);return t.jsx(rr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,block:n,banners:e.banners,showSuper:e.showSuper,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},"Diario con imagen":e=>{if(!e?.data||e.data.length===0)return;const n=e.data.slice(1);return t.jsx(rr,{...e.data[0],itemReverseOrder:!0,isLarge:!0,showSuper:e.showSuper,block:n,banners:e.banners,rightOnlyBanner:e.rightOnlyBanner,customSectionCardStyles:e.customSectionCardStyles,customNewsDescriptionStyles:e.customNewsDescriptionStyles,paths:e.paths})},Super:e=>t.jsx(Lt,{...e.data[0],paths:e.paths}),"3 notas verticales":e=>t.jsx(ud,{content:e.data,customLargeSection:e.customLargeSection,customSlimSection:e.customSlimSection,paths:e.paths}),"3 notas horizontales":e=>t.jsx(hd,{content:e.data,customLargeSection:e.customLargeSection,customSmallSection:e.customSmallSection,paths:e.paths})},Vn=({component:e,data:n,banners:a,rightOnlyBanner:s})=>t.jsx("div",{style:zn(n),children:kr[e]&&kr[e]({...n,rightOnlyBanner:s,banners:a})}),d1=({slots:e,DYNAMIC_SLOT_SUBINDEXES:n,stylesConfig:a,AutorIcon:s,config:o,banners:r,showTagBySection:i})=>{const c=[],l=n,d=Object.keys(e).length/l;for(let u=1;u<=d;u++)for(let f=1;f<=l;f++){const g="Home_"+u+"_"+f;!e[g]||!e[g].blockSass||!e[g].blockSass[0]||!e[g].blockSass[0].value||!e[g].blockSass[0].block||e[g].blockSass[0].block==="No Mostrar"||(e[g].blockSass[0]?.block==="Modulo iframe"?c.push(t.jsxs(va,{id:e[g].blockSass[0].key,show:!!e[g].blockSass[0].value,order:(u-1)*l+(f-1),children:[t.jsx(en,{component:e[g].blockSass[0].block,banners:r,slot_id:g,data:{printEdition:e[g]?.blockSass[0].value,title:e[g]?.blockSass[0].title??"",titleUrl:e[g].blockSass[0].link??void 0}}),t.jsx(Ve,{children:t.jsx(je,{banners:r,index:"dynamic_"+u+"_"+f})})]},u+"_"+f)):c.push(t.jsxs(va,{id:e[g].blockSass[0].key,show:!!e[g].content?.data,order:(u-1)*l+(f-1),children:[t.jsx(en,{component:e[g].blockSass[0].block,banners:r,slot_id:g,data:{...e[g].blockSass[0].block?a[e[g].blockSass[0].block]:[],content:e[g].content?.data??[],title:e[g].blockSass[0].title??void 0,titleUrl:e[g].blockSass[0].link??void 0,autorIcon:t.jsx(s,{}),paths:o.paths,showTagBySection:i}}),t.jsx(Ve,{children:t.jsx(je,{banners:r,index:"dynamic_"+u+"_"+f})})]},u+"_"+f)))}return c},h1=({mainBlock:e,StylesConfigMain:n,config:a,banners:s})=>{const{PUBLIC_ENV:o}=W();if(o!=="local")return null;const r=e?.news?.data||[],i=(c,h)=>({...e?.news,...n[c],data:r.slice(0,h),paths:a.paths});return t.jsxs(t.Fragment,{children:[t.jsx(Vn,{component:"Super",data:i("Super",1),banners:s}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:1})}),t.jsx(Vn,{component:"3 notas verticales",data:i("3 notas verticales",3),banners:s}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:1})}),t.jsx(Vn,{component:"3 notas horizontales",data:i("3 notas horizontales",3),banners:s}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:1})})]})},u1=e=>{const{config:n}=e,a=n.articlepreview;return!![Ct.videoEmbedded,Ct.videoYouTube,Ct.iframe].includes(a)},f1=async e=>{const{custom_complement:n,ranking:a=[],banners:s,autor:o=[],news:r=[],newsRelatedResponses:i=[],newsRelatedListResponses:c=[],itemList:h=[],socials:l,getVideos:d}=e,u=e.slug==="liveblogs",{SHOW_NEWS_MORE_NEWS:f,SHOW_NEWS_RELATED_NEWS:g,MORE_NEWS_SSR:m}=W();if(!(!r||!r[0]))return t.jsx(t.Fragment,{children:t.jsxs(_d,{className:Xt.contentLayout2,children:[t.jsx(Nd,{option:e.slug,news:r,paths:e.paths,headerSectionStyles:e.headerSectionStyles,newsDescriptionSectionTag:e.newsDescriptionSectionTag}),t.jsx(je,{banners:s,index:1}),!u&&e.commonServices&&t.jsx(zd,{news:r[0],commonServices:e.commonServices}),t.jsx(Sd,{texts:e.texts,paths:e.paths,slug:e.slug,itemList:h,ranking:a,readestCustomStyles:e.readestCustomStyles,bannerTop:t.jsx(ye,{banners:s??[],name:"right_1"}),banner:t.jsx(ye,{banners:s??[],name:"right_2"}),complement:t.jsxs("div",{id:"comentarios",className:Xt.complementContent,suppressHydrationWarning:!0,children:[o.length>0&&t.jsx(sr,{texts:e.texts,autorIcon:e.autorIcon,autor:o[0],paths:e.paths}),r[0].authors.length>1&&t.jsx(or,{news:r[0],autorIcon:e.autorIcon,paths:e.paths,texts:e.texts}),r[0]?.keywords?.tags&&r[0]?.keywords?.tags?.length>0&&t.jsx("div",{className:`${Xt.tagContent} sass-note-tags-content`,children:t.jsx(ar,{tags:r[0]?.keywords?.tags,paths:e.paths})}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2rem"},suppressHydrationWarning:!0,children:[e.showComments&&t.jsx("div",{className:Xt.commentsSeparator,suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"comment",internalPath:e.internalPath,API_ENV:ca(e.API_ENV),texts:e.texts}))}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:2})}),g&&t.jsxs(t.Fragment,{children:[t.jsx(en,{component:"Carrusel card",banners:[],slot_id:"Nota_1",data:{...e.stylesConfig["Carrusel card"],content:e.relatedNewsList??[],title:e.texts.relatedNewsTitle,titleUrl:void 0,paths:e.paths}}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:3})})]}),f&&t.jsxs(t.Fragment,{children:[m?t.jsx(en,{component:"Modulo 1x3",banners:[],slot_id:"Nota_2",data:{...e.stylesConfig?e.stylesConfig["Modulo 1x3 Client"]?e.stylesConfig["Modulo 1x3 Client"]:e.stylesConfig["Modulo 1x3"]:{},content:e.moreNewsSSR??[],title:e.texts.moreNewsTitle,paths:e.paths,titleUrl:void 0}}):t.jsx(pe,{title:e.texts.moreNewsTitle,children:t.jsx("div",{suppressHydrationWarning:!0,"data-hydrate":"LazyLoader","data-props":encodeURIComponent(JSON.stringify({render:"more",stylesConfig:e.stylesConfig,section:r[0].info.section?.slug??"",internalPath:e.internalPath,paths:e.paths,API_ENV:ca(e.API_ENV),fetchConfig:e.fetchConfig}))})}),t.jsx(Ve,{children:t.jsx(je,{banners:s,index:4})})]}),n&&n()]})]}),children:t.jsxs("section",{style:{"--avatar-content-align-items-desk":e.slug==="liveblogs"?"flex-start":"center"},children:[t.jsx(a1,{texts:e.texts,autorIcon:e.autorIcon,socials:l,news:r[0],banners:s,newsRelatedResponses:i,newsRelatedListResponses:c,itemList:h,slug:e.slug,getVideos:d,noteShare:e.noteShare,paths:e.paths,showHeaderImage:!u1(r[0]),commonServices:e.commonServices}),t.jsx(ye,{banners:s??[],name:"block_3"})]})})]})})},tn={content:"_content_lu444_1",buttonStyled:"_buttonStyled_lu444_17",searchStyled:"_searchStyled_lu444_39",inputStyled:"_inputStyled_lu444_71",inputStyledTest:"_inputStyledTest_lu444_109"},m1=e=>t.jsx("svg",{width:"68",height:"68",viewBox:"0 0 68 68",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("g",{children:t.jsx("path",{d:"M47.8043 46.6003L47.6635 46.7758L47.8232 46.9342L56.4762 55.5171C56.4768 55.5177 56.4774 55.5184 56.478 55.519C56.8524 55.9072 57.0616 56.4256 57.0616 56.965C57.0616 57.5048 56.8521 58.0234 56.4774 58.4117C56.2839 58.6065 56.0539 58.7611 55.8005 58.8667C55.5466 58.9724 55.2743 59.0269 54.9993 59.0269C54.7243 59.0269 54.452 58.9724 54.1981 58.8667C53.9442 58.7609 53.7138 58.6059 53.5201 58.4106L53.5194 58.4099L44.9327 49.8232L44.7743 49.6648L44.5995 49.805C40.4597 53.1252 35.2051 54.7331 29.9162 54.2981C24.6272 53.863 19.706 51.4181 16.1643 47.4661C12.6227 43.514 10.7298 38.3552 10.875 33.0503C11.0201 27.7455 13.1923 22.6979 16.9447 18.9455C20.6972 15.193 25.7448 13.0209 31.0496 12.8757C36.3544 12.7305 41.5133 14.6234 45.4653 18.165C49.4174 21.7067 51.8623 26.6279 52.2974 31.9169C52.7324 37.2058 51.1245 42.4604 47.8043 46.6003ZM22.4528 47.4552C25.1799 49.2774 28.3861 50.25 31.666 50.25C36.0641 50.25 40.2822 48.5029 43.3921 45.3929C46.5021 42.2829 48.2493 38.0649 48.2493 33.6667C48.2493 30.3868 47.2767 27.1806 45.4545 24.4535C43.6323 21.7264 41.0423 19.6008 38.0121 18.3457C34.9819 17.0905 31.6476 16.7621 28.4307 17.402C25.2139 18.0419 22.259 19.6213 19.9398 21.9405C17.6205 24.2597 16.0411 27.2146 15.4013 30.4314C14.7614 33.6483 15.0898 36.9827 16.345 40.0129C17.6001 43.0431 19.7256 45.633 22.4528 47.4552Z",fill:"white",stroke:"white",strokeWidth:"0.5"})})}),g1=e=>t.jsx("form",{className:tn.content,children:t.jsxs("div",{className:`${tn.inputStyled} sass-buscar-form`,children:[t.jsx("input",{className:tn.inputStyledTest,defaultValue:e.query,name:"query",placeholder:e.texts.searchKeyWord+"..."}),t.jsx("button",{className:tn.buttonStyled,type:"submit",children:t.jsx(m1,{className:tn.searchStyled})})]})}),Qa={content:"_content_27x8l_1",newsContentSection:"_newsContentSection_27x8l_9",itemContent:"_itemContent_27x8l_19"},p1=e=>{const{data:n,option:a,autor:s,page:o,banners:r,pathname:i,ranking:c,currentPage:h,slug:l,texts:d={},socialIconsFilled:u=!1}=e,f=[5,10,15],{SUB_PUBLICATION_PREFIX_IN_ROUTES:g}=W(),m={5:1,10:2,15:3};switch(a){case"op1":return t.jsx(t.Fragment,{children:t.jsxs(ka,{children:[t.jsx(Zo,{autor:s[0],autorIcon:e.autorIcon,socialIconsFilled:u}),t.jsx(La,{paths:e.paths,ranking:c,readestTitle:d.readestTitle??"",bannerTop:t.jsx(ye,{banners:r??[],name:"right_1"}),banner:t.jsx(ye,{banners:r??[],name:"right_2"}),children:t.jsx("section",{className:Qa.content,children:n.length>0?t.jsx(On,{className:[Qa.newsContentSection,"padding-0"].join(" "),paginatorComponent:t.jsx(zt,{block_subPublication:g?.autor,texts:d,pathname:i,query:"",currentPage:h,maxPages:e.paginationLimit,showNext:!(n.length<e.newsListLimit)}),children:Array.isArray(n)&&n?.map((p,A)=>t.jsxs(I.Fragment,{children:[f.includes(A+1)&&t.jsx("div",{className:Qa.itemContent+" banner-context",children:t.jsx(ye,{banners:r??[],name:`block_2_${m[A+1]}`})}),t.jsx(Qn,{autorIcon:e.autorIcon,item:p,option:l,paths:e.paths},A)]},A))}):t.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:t.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:d.autorNotResultMessage})})})})]})});case"op2":return t.jsx(t.Fragment,{children:t.jsxs(ka,{children:[t.jsx(Xo,{autor:s[0],autorIcon:e.autorIcon,socialIconsFilled:u}),Array.isArray(n)?t.jsxs(t.Fragment,{children:[t.jsx(Ma,{content:n,title:"",hasLines:!0,banners:e.banners,bannerPositionIndex:[1,6,12],paths:e.paths,slot_id:"block_2"}),t.jsx(zt,{block_subPublication:g?.autor,texts:d,query:"",pathname:i,maxPages:Number(e.paginationLimit),currentPage:Number(o),showNext:!((n.length??0)<Number(e.newsListLimit))})]}):t.jsx("div",{style:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",gap:"2rem"},children:t.jsx("p",{style:{fontWeight:"var(--fw)",width:"100%",fontSize:"18px",lineHeight:"26px",textAlign:"center"},children:d.autorNotResultMessage})})]})});default:return t.jsx(t.Fragment,{})}},q={form:"_form_16zye_133",formUl:"_formUl_16zye_151",field:"_field_16zye_175",label:"_label_16zye_189",input:"_input_16zye_207",error:"_error_16zye_243",primary:"_primary_16zye_255",divider:"_divider_16zye_329",google:"_google_16zye_381",googleIcon:"_googleIcon_16zye_441",spin:"_spin_16zye_507",checkboxRow:"_checkboxRow_16zye_551",switch:"_switch_16zye_609",terms:"_terms_16zye_625",message:"_message_16zye_689",passwordChecker:"_passwordChecker_16zye_699",valid:"_valid_16zye_737",invalid:"_invalid_16zye_745",forgotPassword:"_forgotPassword_16zye_753",toRegister:"_toRegister_16zye_789",successContainer:"_successContainer_16zye_805",thumbsUp:"_thumbsUp_16zye_821",successMessage:"_successMessage_16zye_833"},Ot=({className:e})=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:e,children:t.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),A1={GoogleButtonText:"Continuar con Google",loginButtonText:"Iniciar sesión",noAccountText:"¿Ya tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",showPasswordsLabel:"Mostrar contraseñas",termsPrefix:"Al continuar, confirmo que he leído y aceptado los",termsLinkText:"Términos y Condiciones",termsSuffix:"de nuestra comunidad",createAccountButton:"Crear cuenta",verificationCodeLabel:"Código de verificación",confirmAccountButton:"Confirmar cuenta",alreadyConfirmedText:"¿Ya confirmaste antes?",successTitle:"Confirmación completa.",successMessage:"Ya eres parte de la comunidad!",passwordRuleMinLength:"La contraseña debe tener al menos 8 caracteres",passwordRuleNumber:"Usa un número",passwordRuleLowercase:"Usa una letra minúscula",passwordRuleUppercase:"Usa una letra mayúscula",passwordRuleSymbol:"Usa un símbolo",errorCompleteFields:"Complete todos los campos",errorPasswordMismatch:"Las contraseñas no coinciden",errorPasswordInvalid:"La contraseña no es válida",errorVerificationCodeRequired:"Debes ingresar el código de verificación",errorUnexpected:"Error inesperado"},nn={email:{label:"Email"},given_name:{label:"Nombre"},family_name:{label:"Apellido"},password:{label:"Contraseña"},confirmPassword:{label:"Confirmar contraseña"}};function w1(e){return{email:{label:e?.email??nn.email.label,required:!0},given_name:{label:e?.given_name??nn.given_name.label,required:!0},family_name:{label:e?.family_name??nn.family_name.label,required:!0},password:{label:e?.password??nn.password.label,required:!0},confirmPassword:{label:e?.confirmPassword??nn.confirmPassword.label,required:!0}}}const He=[e=>e.length>=8,e=>/\d/.test(e),e=>/[a-z]/.test(e),e=>/[A-Z]/.test(e),e=>/[^A-Za-z0-9]/.test(e)],Ur=[{label:"La contraseña debe tener al menos 8 caracteres",test:He[0]},{label:"Usa un número",test:He[1]},{label:"Usa una letra minúscula",test:He[2]},{label:"Usa una letra mayúscula",test:He[3]},{label:"Usa un símbolo",test:He[4]}];function y1({texts:e,API_ENV:n}){const a={...A1,...e?.comentarios},s=I.useMemo(()=>w1(e?.comentarios?.registerForm),[e?.comentarios?.registerForm]),o=I.useMemo(()=>[{label:a.passwordRuleMinLength,test:He[0]},{label:a.passwordRuleNumber,test:He[1]},{label:a.passwordRuleLowercase,test:He[2]},{label:a.passwordRuleUppercase,test:He[3]},{label:a.passwordRuleSymbol,test:He[4]}],[a.passwordRuleMinLength,a.passwordRuleNumber,a.passwordRuleLowercase,a.passwordRuleUppercase,a.passwordRuleSymbol]),[r,i]=I.useState({}),[c,h]=I.useState(!1),[l,d]=I.useState(!1),[u,f]=I.useState(null),[g,m]=I.useState("register"),p=async()=>{if(n.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"});return}const v=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${v}`},A=(v,w)=>{i(T=>({...T,[v]:w}))},y=async v=>{v.preventDefault(),f(null),d(!0);try{const w=Object.keys(s).filter(L=>!["username","password","confirmPassword"].includes(L)).map(L=>({Name:L,Value:r[L]}));if(w.some(L=>{if(!L.Value||L.Value.trim()==="")return!0}))return d(!1),f(a.errorCompleteFields);if(r.password!==r.confirmPassword){f(a.errorPasswordMismatch);return}const T=r.password||"";if(o.some(L=>!L.test(T))){f(a.errorPasswordInvalid);return}const F=Math.floor(Date.now()/1e3);w.push({Name:"updated_at",Value:String(F)});const X=n.PUBLIC_ENV==="local"?"token":await an("comment_register",n.CAPTCHA_KEY??"");if(!X)throw new Error("Captcha token no generado");const H=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:r.email,password:r.password,userAttributes:w,token:X})});if(!H.ok){const L=await H.json().catch(()=>({}));if(L.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:r.email})}),m("confirm");return}throw new Error(L?.error||"Error al crear usuario")}m("confirm")}catch(w){console.log(w),f(w?.message||w?.error||a.errorUnexpected)}finally{d(!1)}},N=async v=>{if(v.preventDefault(),!r.confirmationCode){f(a.errorVerificationCodeRequired);return}f(null),d(!0);try{const w=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:r.email,code:r.confirmationCode})});if(!w.ok){const T=await w.json().catch(()=>({}));throw new Error(T?.error||"Error al confirmar usuario")}m("success")}catch(w){f(w?.message||a.errorUnexpected)}finally{d(!1)}},S=r.password||"";return t.jsxs(t.Fragment,{children:[g==="register"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:p,className:q.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:q.googleIcon}),t.jsx("span",{children:a.GoogleButtonText})]}),t.jsx("div",{className:q.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:y,className:q.form,"data-error":u?"true":"false",children:[t.jsx("ul",{className:q.formUl,children:Object.entries(s).map(([v,{label:w}])=>t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:w}),t.jsx("input",{type:v.toLowerCase().includes("password")?c?"text":"password":v==="birthdate"?"date":v==="email"?"email":v==="phone_number"?"tel":"text",name:v,value:r[v]||"",onChange:T=>A(v,T.target.value),className:q.input,placeholder:""}),v==="password"&&t.jsx("div",{className:q.passwordChecker,children:o.map((T,B)=>{const F=T.test(S);return t.jsxs("div",{className:F?q.valid:q.invalid,children:[t.jsx("div",{children:F?"✔":"○"}),t.jsx("div",{children:T.label})]},B)})}),v==="confirmPassword"&&t.jsxs("div",{className:q.checkboxRow,children:[t.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:c,onChange:T=>h(T.target.checked)}),t.jsx("label",{htmlFor:"showPasswordRegister",className:q.checkboxLabel,children:a.showPasswordsLabel})]})]},v))}),u&&t.jsx("p",{className:q.error,children:u}),t.jsxs("p",{className:q.terms,children:[a.termsPrefix," ",t.jsx("a",{href:"/pages/politicas-de-privacidad",target:"_blank",children:a.termsLinkText})," ",a.termsSuffix]}),t.jsx("button",{type:"submit",className:q.primary,disabled:l,children:l?t.jsx(Ot,{}):a.createAccountButton})]})]}),g==="confirm"&&t.jsxs("form",{onSubmit:N,className:q.form,"data-error":u?"true":"false",children:[t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:a.verificationCodeLabel}),t.jsx("input",{type:"text",name:"confirmationCode",value:r.confirmationCode||"",onChange:v=>A("confirmationCode",v.target.value),className:q.input,required:!0})]}),u&&t.jsx("p",{className:q.error,children:u}),t.jsx("button",{type:"submit",className:q.primary,disabled:l,children:l?t.jsx(Ot,{}):a.confirmAccountButton}),t.jsxs("p",{className:q.switch,children:[a.alreadyConfirmedText,t.jsx("a",{className:q.toRegister,href:"./login",children:a.loginButtonText})]})]}),g==="success"&&t.jsxs("form",{className:q.form,children:[t.jsxs("div",{className:q.successContainer,children:[t.jsx("div",{className:q.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsxs("div",{className:q.successMessage,children:[t.jsx("p",{children:a.successTitle}),t.jsx("p",{children:a.successMessage})]})]}),t.jsx("a",{href:"./login",className:q.primary,children:a.loginButtonText})]}),g==="register"&&t.jsxs("p",{className:q.switch,children:[a.alreadyHasAccountText,t.jsx("a",{className:q.toRegister,href:"./login",children:a.loginButtonText})]})]})}const b1={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con Google",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function C1({API_ENV:e,texts:n}){const a={...b1,...n?.comentarios},[s,o]=I.useState("login"),[r,i]=I.useState(""),[c,h]=I.useState(""),[l,d]=I.useState(""),[u,f]=I.useState(""),[g,m]=I.useState(""),[p,A]=I.useState(!1),[y,N]=I.useState(!1),[S,v]=I.useState(null);I.useEffect(()=>{if(typeof window>"u")return;window.location.hash.includes("forgot")&&s==="login"&&o("forgot"),s==="login"&&T()});const w=L=>document.cookie.split("; ").find(z=>z.startsWith(L+"="))?.split("=")[1],T=async()=>{if(document.cookie.search(e.COGNITO_AUTH_PREFIX+"IS_AUTH=true")!==-1){if(!window)return;const L=w("redirect_after_login");L&&L!==""?(document.cookie="redirect_after_login=; Max-Age=0; path=/",window.location.pathname=L,window.location.hash="comentarios"):window.location.pathname="/auth/success"}},B=async()=>{if(e.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"});return}const L=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${L}`},F=async L=>{if(!y){if(L.preventDefault(),r===""||c===""){v("Complete todos los campos");return}v(null),N(!0);try{const z=e.PUBLIC_ENV==="local"?"token":await an("comment_login",e.CAPTCHA_KEY||"");if(!z)throw new Error("Captcha token no generado");const R=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:r,password:c,token:z})});if(!R.ok){const P=await R.json().catch(()=>({}));throw new Error(P?.error||"Ha ocurrido un error")}await T();return}catch(z){v(z?.message||"Error inesperado")}finally{N(!1)}}},X=async L=>{if(!y){L.preventDefault(),v(null),N(!0);try{const z=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r})});if(!z.ok){const R=await z.json().catch(()=>({}));throw new Error(R?.error||"Error al enviar código")}h(""),o("changePassword")}catch(z){v(z?.message||"Error inesperado")}finally{N(!1)}}},H=async L=>{if(y)return;if(L.preventDefault(),u!==g){v("Las contraseñas no coinciden");return}if(Ur.some(R=>!R.test(u))){v("La contraseña no cumple con los requisitos");return}v(null),N(!0);try{const R=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:r,code:l,newPassword:u})});if(!R.ok){const P=await R.json().catch(()=>({}));throw new Error(P?.error||"Error al cambiar contraseña")}o("feedback")}catch(R){v(R?.message||"Error inesperado")}finally{N(!1)}};return t.jsxs(t.Fragment,{children:[s==="login"&&t.jsx(v1,{email:r,password:c,showPassword:p,loading:y,error:S,setEmail:i,setPassword:h,setShowPassword:A,onSubmit:F,onForgot:()=>{v(null),o("forgot")},handleGoogleLogin:B,t:a}),s==="forgot"&&t.jsx(_1,{email:r,setEmail:i,loading:y,error:S,onSubmit:X,onBack:()=>{v(null),o("login")},t:a}),s==="changePassword"&&t.jsx(N1,{email:r,confirmationCode:l,newPassword:u,confirmNewPassword:g,showPassword:p,loading:y,error:S,setConfirmationCode:d,setNewPassword:f,setConfirmNewPassword:m,setShowPassword:A,onSubmit:H,onBack:()=>{v(null),o("forgot")},t:a}),s==="feedback"&&t.jsx(I1,{onBackToLogin:()=>{v(null),o("login")},t:a})]})}function v1({email:e,password:n,showPassword:a,loading:s,error:o,setEmail:r,setPassword:i,setShowPassword:c,onSubmit:h,onForgot:l,handleGoogleLogin:d,t:u}){return t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:d,className:q.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:q.googleIcon}),t.jsx("span",{children:u.GoogleButtonText})]}),t.jsx("div",{className:q.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:h,className:q.form,"data-error":o?"true":"false",children:[t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:u.email}),t.jsx("input",{type:"email",value:e,onChange:f=>r(f.target.value),className:q.input,placeholder:""})]}),t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:u.password}),t.jsx("input",{type:a?"text":"password",value:n,onChange:f=>i(f.target.value),className:q.input,placeholder:""}),t.jsxs("div",{className:q.checkboxRow,children:[t.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:f=>c(f.target.checked)}),t.jsx("label",{htmlFor:"showPasswordLogin",className:q.checkboxLabel,children:u.showPassword})]})]}),o&&t.jsx("p",{className:q.error,children:o}),t.jsx("button",{type:"submit",className:q.primary,disabled:s,children:s?t.jsx(Ot,{className:q.spin}):u.loginButtonText})]}),t.jsxs("p",{className:q.switch,children:[u.noAccountText,t.jsx("a",{className:q.toRegister,href:"./register",children:u.registerButtonText})]}),t.jsx("button",{type:"button",className:q.forgotPassword,onClick:l,children:u.forgotPasswordText})]})}function _1({email:e,setEmail:n,loading:a,error:s,onSubmit:o,onBack:r,t:i}){return t.jsxs("form",{onSubmit:o,className:q.form,"data-error":s?"true":"false",children:[t.jsx("p",{className:q.message,children:i.forgotMessage}),t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:i.email}),t.jsx("input",{type:"email",value:e,name:"email",onChange:c=>n(c.target.value),className:q.input,placeholder:""})]}),s&&t.jsx("p",{className:q.error,children:s}),t.jsx("button",{type:"submit",className:q.primary,disabled:a,children:a?t.jsx(Ot,{}):i.sendCodeButton}),t.jsx("p",{className:q.switch,style:{margin:"0 0 16px"},children:t.jsx("button",{type:"button",onClick:r,children:i.backButton})})]})}function S1(e){const[n,a]=e.split("@");if(!n||!a)return e;let s="";n.length<=2?s=n[0]+"*":s=n[0]+"*".repeat(n.length-2)+n[n.length-1];const o=a.lastIndexOf(".");if(o===-1)return`${s}@${a}`;const r=a.slice(0,o),i=a.slice(o);let c="";return r.length<=2?c=r[0]+"*":c=r[0]+"*".repeat(r.length-2)+r[r.length-1],`${s}@${c}${i}`}function N1({email:e,confirmationCode:n,newPassword:a,confirmNewPassword:s,showPassword:o,loading:r,error:i,setConfirmationCode:c,setNewPassword:h,setConfirmNewPassword:l,setShowPassword:d,onSubmit:u,onBack:f,t:g}){const m=g.changePasswordMessage.replace("{{email}}",S1(e));return t.jsxs("form",{onSubmit:u,className:q.form,"data-error":i?"true":"false",children:[t.jsx("p",{className:q.message,children:m}),t.jsxs("ul",{className:q.formUl,children:[t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:g.verificationCodeLabel}),t.jsx("input",{type:"text",value:n,onChange:p=>c(p.target.value),className:q.input,placeholder:""})]}),t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:g.newPasswordLabel}),t.jsx("input",{type:o?"text":"password",value:a,onChange:p=>h(p.target.value),className:q.input,placeholder:"",name:"password"}),t.jsx("div",{className:q.passwordChecker,children:Ur.map((p,A)=>{const y=p.test(a);return t.jsxs("div",{className:y?q.valid:q.invalid,children:[t.jsx("div",{children:y?"✔":"○"}),t.jsx("div",{children:p.label})]},A)})})]}),t.jsxs("div",{className:q.field,children:[t.jsx("label",{className:q.label,children:g.confirmPasswordLabel}),t.jsx("input",{type:o?"text":"password",value:s,onChange:p=>l(p.target.value),className:q.input,placeholder:""}),t.jsxs("div",{className:q.checkboxRow,children:[t.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:o,onChange:p=>d(p.target.checked)}),t.jsx("label",{htmlFor:"showPasswordForgot",className:q.checkboxLabel,children:g.showPasswordsLabel})]})]})]}),i&&t.jsx("p",{className:q.error,children:i}),t.jsx("button",{type:"submit",className:q.primary,style:{maxWidth:r?"revert-layer":"fit-content"},disabled:r,children:r?t.jsx(Ot,{}):g.changePasswordButton}),t.jsx("p",{className:q.switch,children:t.jsx("button",{type:"button",onClick:f,children:g.backButton})})]})}function I1({onBackToLogin:e,t:n}){return t.jsxs("div",{className:q.form,children:[t.jsx("p",{className:q.success,children:n.feedbackSuccessMessage}),t.jsx("button",{type:"button",className:q.primary,onClick:e,children:n.loginButtonText})]})}const U={overlay:"_overlay_1t390_1",header:"_header_1t390_35",logo:"_logo_1t390_49",anonimusWrapper:"_anonimusWrapper_1t390_63",anonimus:"_anonimus_1t390_63",anonimusImage:"_anonimusImage_1t390_115",card:"_card_1t390_131",close:"_close_1t390_161",form:"_form_1t390_209",formUl:"_formUl_1t390_227",field:"_field_1t390_251",label:"_label_1t390_265",input:"_input_1t390_283",error:"_error_1t390_319",primary:"_primary_1t390_331",divider:"_divider_1t390_407",google:"_google_1t390_459",googleIcon:"_googleIcon_1t390_519",spin:"_spin_1t390_585",checkboxRow:"_checkboxRow_1t390_629",switch:"_switch_1t390_687",terms:"_terms_1t390_703",message:"_message_1t390_769",passwordChecker:"_passwordChecker_1t390_779",valid:"_valid_1t390_817",invalid:"_invalid_1t390_825",forgotPassword:"_forgotPassword_1t390_833",successContainer:"_successContainer_1t390_871",thumbsUp:"_thumbsUp_1t390_887",successMessage:"_successMessage_1t390_899"},an=async(e,n)=>{if(!e)throw new Error("No action provided");if(!n)throw new Error("No site key provided");const a=window.grecaptcha;if(!a?.enterprise)throw new Error("grecaptcha not loaded");return new Promise((s,o)=>{a.enterprise.ready(async()=>{try{const r=await a.enterprise.execute(n,{action:e});if(!r)throw new Error("Captcha token no generado");s(r)}catch(r){o(r)}})})},tt=()=>t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",width:"24",height:"24",viewBox:"0 0 32 32",className:U.spin,children:t.jsx("path",{d:"M18,4.181v2.021c4.559,0.929,8,4.97,8,9.798c0,5.514-4.486,10-10,10S6,21.514,6,16c0-4.829,3.441-8.869,8-9.798V4.181 C8.334,5.137,4,10.066,4,16c0,6.617,5.383,12,12,12s12-5.383,12-12C28,10.066,23.666,5.137,18,4.181z"})}),T1={GoogleButtonText:"Continuar con Google",loginButtonText:"Iniciar sesión",noAccountText:"¿Ya tenés cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",showPasswordsLabel:"Mostrar contraseñas",termsPrefix:"Al continuar, confirmo que he leído y aceptado los",termsLinkText:"Términos y Condiciones",termsSuffix:"de nuestra comunidad",createAccountButton:"Crear cuenta",verificationCodeLabel:"Código de verificación",confirmAccountButton:"Confirmar cuenta",alreadyConfirmedText:"¿Ya confirmaste antes?",successTitle:"Confirmación completa.",successMessage:"Ya eres parte de la comunidad!",passwordRuleMinLength:"La contraseña debe tener al menos 8 caracteres",passwordRuleNumber:"Usa un número",passwordRuleLowercase:"Usa una letra minúscula",passwordRuleUppercase:"Usa una letra mayúscula",passwordRuleSymbol:"Usa un símbolo",errorCompleteFields:"Complete todos los campos",errorPasswordMismatch:"Las contraseñas no coinciden",errorPasswordInvalid:"La contraseña no es válida",errorVerificationCodeRequired:"Debes ingresar el código de verificación",errorUnexpected:"Error inesperado"},sn={email:{label:"Email"},given_name:{label:"Nombre"},family_name:{label:"Apellido"},password:{label:"Contraseña"},confirmPassword:{label:"Confirmar contraseña"}};function E1(e){return{email:{label:e?.email??sn.email.label,required:!0},given_name:{label:e?.given_name??sn.given_name.label,required:!0},family_name:{label:e?.family_name??sn.family_name.label,required:!0},password:{label:e?.password??sn.password.label,required:!0},confirmPassword:{label:e?.confirmPassword??sn.confirmPassword.label,required:!0}}}const ze=[e=>e.length>=8,e=>/\d/.test(e),e=>/[a-z]/.test(e),e=>/[A-Z]/.test(e),e=>/[^A-Za-z0-9]/.test(e)],xr=[{label:"La contraseña debe tener al menos 8 caracteres",test:ze[0]},{label:"Usa un número",test:ze[1]},{label:"Usa una letra minúscula",test:ze[2]},{label:"Usa una letra mayúscula",test:ze[3]},{label:"Usa un símbolo",test:ze[4]}];function k1({goToLogin:e,handleGoogleLogin:n,API_ENV:a,texts:s}){const o={...T1,...s?.comentarios},r=I.useMemo(()=>E1(s?.comentarios?.registerForm),[s?.comentarios?.registerForm]),i=I.useMemo(()=>[{label:o.passwordRuleMinLength,test:ze[0]},{label:o.passwordRuleNumber,test:ze[1]},{label:o.passwordRuleLowercase,test:ze[2]},{label:o.passwordRuleUppercase,test:ze[3]},{label:o.passwordRuleSymbol,test:ze[4]}],[o.passwordRuleMinLength,o.passwordRuleNumber,o.passwordRuleLowercase,o.passwordRuleUppercase,o.passwordRuleSymbol]),[c,h]=I.useState({}),[l,d]=I.useState(!1),[u,f]=I.useState(!1),[g,m]=I.useState(null),[p,A]=I.useState("register"),y=(w,T)=>{h(B=>({...B,[w]:T}))},N=async w=>{w.preventDefault(),m(null),f(!0);try{const T=Object.keys(r).filter(z=>!["username","password","confirmPassword"].includes(z)).map(z=>({Name:z,Value:c[z]}));if(T.some(z=>{if(!z.Value||z.Value.trim()==="")return!0}))return f(!1),m(o.errorCompleteFields);if(c.password!==c.confirmPassword){m(o.errorPasswordMismatch);return}const B=c.password||"";if(i.some(z=>!z.test(B))){m(o.errorPasswordInvalid);return}const X=Math.floor(Date.now()/1e3);T.push({Name:"updated_at",Value:String(X)});const H=a.PUBLIC_ENV==="local"?"token":await an("comment_register",a.CAPTCHA_KEY??"");if(!H)throw new Error("Captcha token no generado");const L=await fetch("/api/auth/create-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c.email,password:c.password,userAttributes:T,token:H})});if(!L.ok){const z=await L.json().catch(()=>({}));if(z.code==="UsernameExistsException"){await fetch("/api/auth/resend-code",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c.email})}),A("confirm");return}throw new Error(z?.error||"Error al crear usuario")}A("confirm")}catch(T){console.log(T),m(T?.message||T?.error||o.errorUnexpected)}finally{f(!1)}},S=async w=>{if(w.preventDefault(),!c.confirmationCode){m(o.errorVerificationCodeRequired);return}m(null),f(!0);try{const T=await fetch("/api/auth/confirm-user",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c.email,code:c.confirmationCode})});if(!T.ok){const B=await T.json().catch(()=>({}));throw new Error(B?.error||"Error al confirmar usuario")}A("success")}catch(T){m(T?.message||o.errorUnexpected)}finally{f(!1)}},v=c.password||"";return t.jsxs(t.Fragment,{children:[p==="register"&&t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:n,className:U.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:U.googleIcon}),t.jsx("span",{children:o.GoogleButtonText})]}),t.jsx("div",{className:U.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:N,className:U.form,"data-error":g?"true":"false",children:[t.jsx("ul",{className:U.formUl,children:Object.entries(r).map(([w,{label:T}])=>t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:T}),t.jsx("input",{type:w.toLowerCase().includes("password")?l?"text":"password":w==="birthdate"?"date":w==="email"?"email":w==="phone_number"?"tel":"text",name:w,value:c[w]||"",onChange:B=>y(w,B.target.value),className:U.input,placeholder:""}),w==="password"&&t.jsx("div",{className:U.passwordChecker,children:i.map((B,F)=>{const X=B.test(v);return t.jsxs("div",{className:X?U.valid:U.invalid,children:[t.jsx("div",{children:X?"✔":"○"}),t.jsx("div",{children:B.label})]},F)})}),w==="confirmPassword"&&t.jsxs("div",{className:U.checkboxRow,children:[t.jsx("input",{id:"showPasswordRegister",type:"checkbox",checked:l,onChange:B=>d(B.target.checked)}),t.jsx("label",{htmlFor:"showPasswordRegister",className:U.checkboxLabel,children:o.showPasswordsLabel})]})]},w))}),g&&t.jsx("p",{className:U.error,children:g}),t.jsxs("p",{className:U.terms,children:[o.termsPrefix," ",t.jsx("a",{href:"/pages/politicas-de-privacidad.html",target:"_blank",children:o.termsLinkText})," ",o.termsSuffix]}),t.jsx("button",{type:"submit",className:U.primary,disabled:u,children:u?t.jsx(tt,{}):o.createAccountButton})]})]}),p==="confirm"&&t.jsxs("form",{onSubmit:S,className:U.form,"data-error":g?"true":"false",children:[t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:o.verificationCodeLabel}),t.jsx("input",{type:"text",name:"confirmationCode",value:c.confirmationCode||"",onChange:w=>y("confirmationCode",w.target.value),className:U.input,required:!0})]}),g&&t.jsx("p",{className:U.error,children:g}),t.jsx("button",{type:"submit",className:U.primary,disabled:u,children:u?t.jsx(tt,{}):o.confirmAccountButton}),t.jsxs("p",{className:U.switch,children:[o.alreadyConfirmedText,t.jsx("button",{type:"button",onClick:e,children:o.loginButtonText})]})]}),p==="success"&&t.jsxs("form",{className:U.form,children:[t.jsxs("div",{className:U.successContainer,children:[t.jsx("div",{className:U.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsxs("div",{className:U.successMessage,children:[t.jsx("p",{children:o.successTitle}),t.jsx("p",{children:o.successMessage})]})]}),t.jsx("button",{onClick:e,className:U.primary,children:o.loginButtonText})]}),p==="register"&&t.jsxs("p",{className:U.switch,children:[o.alreadyHasAccountText,t.jsx("button",{type:"button",onClick:e,children:o.loginButtonText})]})]})}const nt=300,at={username:"anonimo",firstname:"Usuario",lastname:"Anonimo"};function U1(e){const n=e.split(" ");if(n.length!==3)return e;const[a,s,o]=n,r=s.charAt(0).toUpperCase()+s.slice(1).toLowerCase();return`${a} ${r} ${o}`}const Wn=(e,n,a)=>{if(!e||!e.current)return{boolean:!1,text:""};const s=e.current?.value||"",o=s.length>nt,{PUBLIC_ENV:r}=a,i=r==="local",c=s.trim()!==""&&(i||n!=="")&&!o,h=o?`No debes exceder el limite de ${nt} caracteres.`:"Debes completar todos los campos para comentar.";return{boolean:c,text:h}},Lr=e=>{const n=e.cookie.split("; ").find(a=>a.startsWith("reported="));if(!n)return[];try{return JSON.parse(decodeURIComponent(n.split("=")[1]??""))}catch{return[]}},x1=(e,n)=>{const a=Lr(e);a.includes(n)||(a.push(n),e.cookie=`reported=${encodeURIComponent(JSON.stringify(a))}; path=/; max-age=${3600*24*1}`)};function L1(e){const[n,a]=e.split("@");if(!n||!a)return e;let s="";n.length<=2?s=n[0]+"*":s=n[0]+"*".repeat(n.length-2)+n[n.length-1];const o=a.lastIndexOf(".");if(o===-1)return`${s}@${a}`;const r=a.slice(0,o),i=a.slice(o);let c="";return r.length<=2?c=r[0]+"*":c=r[0]+"*".repeat(r.length-2)+r[r.length-1],`${s}@${c}${i}`}const B1={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con Google",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function P1({onClose:e,checkAuth:n,goToRegister:a,handleGoogleLogin:s,API_ENV:o,texts:r}){const i={...B1,...r?.comentarios},[c,h]=I.useState("login"),[l,d]=I.useState(""),[u,f]=I.useState(""),[g,m]=I.useState(""),[p,A]=I.useState(""),[y,N]=I.useState(""),[S,v]=I.useState(!1),[w,T]=I.useState(!1),[B,F]=I.useState(null),X=async z=>{if(!w){z.preventDefault(),F(null),T(!0);try{const R=o.PUBLIC_ENV==="local"?"token":await an("comment_login",o.CAPTCHA_KEY||"");if(!R)throw new Error("Captcha token no generado");const P=await fetch("/api/auth/login-password",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({email:l,password:u,token:R})});if(!P.ok){const x=await P.json().catch(()=>({}));throw new Error(x?.error||"Ha ocurrido un error")}e(),await n()}catch(R){F(R?.message||"Error inesperado")}finally{T(!1)}}},H=async z=>{if(!w){z.preventDefault(),F(null),T(!0);try{const R=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l})});if(!R.ok){const P=await R.json().catch(()=>({}));throw new Error(P?.error||"Error al enviar código")}f(""),h("changePassword")}catch(R){F(R?.message||"Error inesperado")}finally{T(!1)}}},L=async z=>{if(w)return;if(z.preventDefault(),p!==y){F("Las contraseñas no coinciden");return}if(xr.some(P=>!P.test(p))){F("La contraseña no cumple con los requisitos");return}F(null),T(!0);try{const P=await fetch("/api/auth/confirm-forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:l,code:g,newPassword:p})});if(!P.ok){const x=await P.json().catch(()=>({}));throw new Error(x?.error||"Error al cambiar contraseña")}h("feedback")}catch(P){F(P?.message||"Error inesperado")}finally{T(!1)}};return t.jsxs(t.Fragment,{children:[c==="login"&&t.jsx(O1,{email:l,password:u,showPassword:S,loading:w,error:B,setEmail:d,setPassword:f,setShowPassword:v,onSubmit:X,onForgot:()=>{F(null),h("forgot")},onRegister:a,handleGoogleLogin:s,t:i}),c==="forgot"&&t.jsx(q1,{email:l,setEmail:d,loading:w,error:B,onSubmit:H,onBack:()=>{F(null),h("login")},t:i}),c==="changePassword"&&t.jsx(M1,{email:l,confirmationCode:g,newPassword:p,confirmNewPassword:y,showPassword:S,loading:w,error:B,setConfirmationCode:m,setNewPassword:A,setConfirmNewPassword:N,setShowPassword:v,onSubmit:L,onBack:()=>{F(null),h("forgot")},t:i}),c==="feedback"&&t.jsx(D1,{onBackToLogin:()=>{F(null),h("login")},t:i})]})}function O1({email:e,password:n,showPassword:a,loading:s,error:o,setEmail:r,setPassword:i,setShowPassword:c,onSubmit:h,onForgot:l,onRegister:d,handleGoogleLogin:u,t:f}){return t.jsxs(t.Fragment,{children:[t.jsxs("button",{onClick:u,className:U.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:U.googleIcon}),t.jsx("span",{children:f.GoogleButtonText})]}),t.jsx("div",{className:U.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("form",{onSubmit:h,className:U.form,"data-error":o?"true":"false",children:[t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:f.email}),t.jsx("input",{type:"email",value:e,onChange:g=>r(g.target.value),className:U.input,placeholder:""})]}),t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:f.password}),t.jsx("input",{type:a?"text":"password",value:n,onChange:g=>i(g.target.value),className:U.input,placeholder:""}),t.jsxs("div",{className:U.checkboxRow,children:[t.jsx("input",{id:"showPasswordLogin",type:"checkbox",checked:a,onChange:g=>c(g.target.checked)}),t.jsx("label",{htmlFor:"showPasswordLogin",className:U.checkboxLabel,children:f.showPassword})]})]}),o&&t.jsx("p",{className:U.error,children:o}),t.jsx("button",{type:"submit",className:U.primary,disabled:s,children:s?t.jsx(tt,{}):f.loginButtonText})]}),t.jsxs("p",{className:U.switch,children:[f.noAccountText,t.jsx("button",{type:"button",onClick:d,children:f.registerButtonText})]}),t.jsx("button",{type:"button",className:U.forgotPassword,onClick:l,children:f.forgotPasswordText})]})}function q1({email:e,setEmail:n,loading:a,error:s,onSubmit:o,onBack:r,t:i}){return t.jsxs("form",{onSubmit:o,className:U.form,"data-error":s?"true":"false",children:[t.jsx("p",{className:U.message,children:i.forgotMessage}),t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:i.email}),t.jsx("input",{type:"email",value:e,name:"email",onChange:c=>n(c.target.value),className:U.input,placeholder:""})]}),s&&t.jsx("p",{className:U.error,children:s}),t.jsx("button",{type:"submit",className:U.primary,disabled:a,children:a?t.jsx(tt,{}):i.sendCodeButton}),t.jsx("p",{className:U.switch,children:t.jsx("button",{type:"button",onClick:r,children:i.backButton})})]})}function M1({email:e,confirmationCode:n,newPassword:a,confirmNewPassword:s,showPassword:o,loading:r,error:i,setConfirmationCode:c,setNewPassword:h,setConfirmNewPassword:l,setShowPassword:d,onSubmit:u,onBack:f,t:g}){const m=g.changePasswordMessage.replace("{{email}}",L1(e));return t.jsxs("form",{onSubmit:u,className:U.form,"data-error":i?"true":"false",children:[t.jsx("p",{className:U.message,children:m}),t.jsxs("ul",{className:U.formUl,children:[t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:g.verificationCodeLabel}),t.jsx("input",{type:"text",value:n,onChange:p=>c(p.target.value),className:U.input,placeholder:""})]}),t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:g.newPasswordLabel}),t.jsx("input",{type:o?"text":"password",value:a,onChange:p=>h(p.target.value),className:U.input,placeholder:"",name:"password"}),t.jsx("div",{className:U.passwordChecker,children:xr.map((p,A)=>{const y=p.test(a);return t.jsxs("div",{className:y?U.valid:U.invalid,children:[t.jsx("div",{children:y?"✔":"○"}),t.jsx("div",{children:p.label})]},A)})})]}),t.jsxs("div",{className:U.field,children:[t.jsx("label",{className:U.label,children:g.confirmPasswordLabel}),t.jsx("input",{type:o?"text":"password",value:s,onChange:p=>l(p.target.value),className:U.input,placeholder:""}),t.jsxs("div",{className:U.checkboxRow,children:[t.jsx("input",{id:"showPasswordForgot",type:"checkbox",checked:o,onChange:p=>d(p.target.checked)}),t.jsx("label",{htmlFor:"showPasswordForgot",className:U.checkboxLabel,children:g.showPasswordsLabel})]})]})]}),i&&t.jsx("p",{className:U.error,children:i}),t.jsx("button",{type:"submit",className:U.primary,style:{maxWidth:r?"revert-layer":"fit-content"},disabled:r,children:r?t.jsx(tt,{}):g.changePasswordButton}),t.jsx("p",{className:U.switch,children:t.jsx("button",{type:"button",onClick:f,children:g.backButton})})]})}function D1({onBackToLogin:e,t:n}){return t.jsxs("div",{className:U.form,children:[t.jsx("p",{className:U.success,children:n.feedbackSuccessMessage}),t.jsx("button",{type:"button",className:U.primary,onClick:e,children:n.loginButtonText})]})}function Br({handleGoogleLogin:e,onClose:n,checkAuth:a,icon:s,API_ENV:o,texts:r}){const[i,c]=I.useState("login");return t.jsx("div",{className:U.overlay,role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:h=>{const l=h.target;l&&l.id==="pop-overlay"&&n()},children:t.jsxs("div",{className:U.card,children:[t.jsxs("header",{className:U.header,children:[t.jsx("div",{className:U.logo,children:s?s():null}),t.jsx("button",{onClick:n,className:U.close,"aria-label":"Cerrar",children:t.jsx(wt,{})})]}),i==="login"&&t.jsx(P1,{onClose:n,checkAuth:a,handleGoogleLogin:e,goToRegister:()=>c("register"),API_ENV:o,texts:r}),i==="register"&&t.jsx(k1,{handleGoogleLogin:e,goToLogin:()=>c("login"),API_ENV:o,texts:r})]})})}const Pr={content:"_content_ghncj_1",videoContent:"_videoContent_ghncj_17"},on={container:"_container_1wcps_1",playStyled:"_playStyled_1wcps_11",imageStyled:"_imageStyled_1wcps_25",longer:"_longer_1wcps_51",contentNews:"_contentNews_1wcps_61",tagContent:"_tagContent_1wcps_101",tag:"_tag_1wcps_101",titular:"_titular_1wcps_135",small:"_small_1wcps_161",figure:"_figure_1wcps_173",backDrop:"_backDrop_1wcps_183",backDropAux:"_backDropAux_1wcps_199"},Or=async e=>{const{size:n="longer",video:a}=e,s=a.main.image.sizes[0]?.url??"";return t.jsx("figure",{className:on.figure,children:t.jsxs("span",{className:on.backdrop,children:[t.jsx("span",{className:on.backDropAux}),t.jsx(M,{href:a.info.link.url,target:a.info.link.target,children:t.jsxs("div",{children:[a.main.image.sizes.map(async(o,r)=>o.width>=580?t.jsx("source",{media:"(width >=900px)",srcSet:await fe(o.url)},r):t.jsx("source",{media:"(width <900px)",srcSet:await fe(o.url)},r)),t.jsx("img",{fetchPriority:"low",loading:"lazy",className:[on.imageStyled,on[n]].join(" "),alt:"",src:s?await fe(s):""})]})})]})})},$1=e=>{const{videos:n}=e;return t.jsx("div",{className:Pr.content,children:t.jsx(kt,{children:t.jsx(pe,{title:"Videos",isTitle:!0,children:t.jsxs("div",{className:Pr.videoContent,children:[t.jsx(Or,{video:n[0]}),t.jsx("div",{style:{display:"flex",flexDirection:"column"},children:n.slice(1).map((a,s)=>t.jsx(Or,{size:"small",video:a},`video-small-${s}`))})]})})})})},_t={content:"_content_quk50_1",videoContent:"_videoContent_quk50_17",articleSection:"_articleSection_quk50_41",contentLatout:"_contentLatout_quk50_61",title:"_title_quk50_71",article:"_article_quk50_41",correspondent:"_correspondent_quk50_127"},qr={container:"_container_17w1m_1",playStyled:"_playStyled_17w1m_17"},G1=e=>{const{video:n}=e,a=En();return t.jsx(M,{href:n.info.link.url?n.info.link.url:void 0,target:n.info.link.target,children:t.jsxs("section",{className:qr.container,children:[t.jsx(ke,{isLarge:!0,preview:{sizes:n.main.image.sizes,description:n.main.description}}),t.jsx(a,{className:qr.playStyled})]})})},j1=e=>{const n=()=>e?.video.main.author?`${e?.video.main.author} - ${Pe(e.video.info.date.created)}`:e?.video.main.author;return t.jsx("div",{className:_t.content,children:t.jsx(kt,{className:_t.contentLatout,children:t.jsx(pe,{title:"Videos",isTitle:!0,children:t.jsxs("div",{className:_t.videoContent,children:[t.jsx(G1,{video:e.video}),t.jsxs("div",{className:_t.articleSection,children:[t.jsx(M,{className:_t.title,href:e.video.info.link.url,target:e.video.info.link.target,children:e.video.main.title}),t.jsx("p",{className:_t.article,children:Oe(e.video.main.description)}),t.jsx("p",{className:_t.correspondent,children:n()})]})]})})})})},F1=e=>{switch(e.option){case"op1":return t.jsx($1,{videos:e.data});case"op2":return t.jsx(j1,{video:e.data[0]});default:return t.jsx(t.Fragment,{})}};function Q1({containerId:e,containerId2:n}){return I.useEffect(()=>{try{let a=function(){const d=window.twttr;d?.widgets?d.widgets.load(s):l<10?(l++,requestAnimationFrame(a)):console.warn("No se pudo cargar widgets de Twitter")};const s=document.getElementById(e),o=document.getElementById(n);if(!s&&!o)return;const r=s?.querySelectorAll("script[src]")??[],i=o?.querySelectorAll("script[src]")??[];[...r,...i].forEach(d=>{const u=document.createElement("script");Array.from(d.attributes).forEach(f=>{u.setAttribute(f.name,f.value)}),d.replaceWith(u)});const h=document.querySelectorAll('script[src*="platform.twitter.com/widgets.js"]');if(h)for(let d=0;d<h.length;d++)h[d]?.remove();let l=0;if(document.querySelector('script[src*="platform.twitter.com/widgets.js"]'))a();else{const d=document.createElement("script");d.src="https://platform.twitter.com/widgets.js",d.async=!0,d.onload=a,document.body.appendChild(d)}}catch(a){console.warn("Error al procesar embeds de Twitter",a)}},[e]),null}const H1=({currentNew:e})=>e&&e?.hascontent?.hasembeddedtwitter&&t.jsx("script",{src:"https://platform.twitter.com/widgets.js"}),z1=e=>{const{isVideo:n=!1,isLarge:a=!1,hasShadow:s=!1,BackDropAuxHeigthMobile:o}=e,r=Ia(),i=I.useMemo(()=>{const f=e?.preview?.sizes;if(f&&Array.isArray(f)&&f.length>0)return f;const g=e?.preview?.original;return g?.url?[{url:g.url,width:g.width||0,height:g.height||0}]:[]},[e?.preview?.sizes,e?.preview?.original]);if(!i.length||!i[0]?.url||i[0]?.url==="")return t.jsx("div",{className:ce.imagePlaceholder});const{PUBLIC_API_HOST:c="",PUBLIC_ASSETS_URL:h}=e.API_ENV,l=i[0]?.url,d=h&&h!=="false"?h:c,u=l?.startsWith("http")||l?.includes(d)?l:d+l;return t.jsx("figure",{className:ce.figure,children:t.jsxs("span",{className:ce.backdrop,children:[t.jsx("span",{className:ce.backdropAux,style:{height:o||"56.25%"}}),t.jsxs("picture",{children:[t.jsx("img",{fetchPriority:"low",loading:"lazy",className:ce.imageStyled,alt:e.preview?.description||"",src:u,style:{boxShadow:s?"0px 4px 8px 0px #00000033":"0px"}}),n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:ce.boxPlayIcon,style:{height:a?"40%":"72px"}}),t.jsx(r,{className:ce.playStyled,style:{width:a?"3rem":"27px",height:a?"3rem":"27px",marginBottom:a?"18px":".5rem",marginLeft:a?"30px":".5rem"}})]})]})]})})},V1=e=>t.jsx("svg",{width:"41",height:"33",viewBox:"0 0 41 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t.jsx("path",{d:"M17.9576 21.2985C16.8233 21.2985 15.9277 22.194 15.9277 23.3283C15.9277 24.4627 16.8233 25.3582 17.9576 25.3582C19.0919 25.3582 19.9874 24.4627 19.9874 23.3283C19.9874 22.194 19.0919 21.2985 17.9576 21.2985ZM17.9576 19.2686C19.0919 19.2686 19.9874 18.3731 19.9874 17.2388C19.9874 16.1045 19.0919 15.2089 17.9576 15.2089C16.8233 15.2089 15.9277 16.1045 15.9277 17.2388C15.9277 18.3731 16.8233 19.2686 17.9576 19.2686ZM17.9576 13.1791C19.0919 13.1791 19.9874 12.2836 19.9874 11.1492C19.9874 10.0149 19.0919 9.11938 17.9576 9.11938C16.8233 9.11938 15.9277 10.0149 15.9277 11.1492C15.9277 12.2836 16.8233 13.1791 17.9576 13.1791Z",fill:"#7B888A"})}),Mr={info:{section:{name:"",slug:"",url:""},link:{url:"/",target:"",canonical:!1,internal:""},date:{date:"",created:0,modified:0,firstpublish:0,lastpublish:0}},config:{zonehome:void 0,priorityhome:"",zonesection:"",prioritysection:"",homepreview:"",showcomments:!0,showtime:!0,showauthor:!0,showuppertitle:!0,showsubtitle:!0,showads:!0},main:{title:{home:"",section:"",article:""},subtitle:{rendered:"",striped:""},tags:[]},authors:[{firstname:"",lastname:"",fullname:"",image:void 0,name:"",internaluser:!1}],preview:void 0},W1=({section:e,internalPath:n,banner:a,isVisible:s=!1,stylesConfig:o,API_ENV:r,fetchConfig:i,paths:c})=>{const h=r.FETCH_SIZE_MORE_NEWS??6,[l,d]=I.useState({data:Array.from({length:h},()=>Mr)}),[u,f]=I.useState(!1),g=I.useCallback(async()=>{if(!n)return;const A=new URLSearchParams({section:e,currentNewsLink:n}),y=await fetch(`/api/get-more-news?${A}`);if(!y.ok)throw new Error(`HTTP error! status: ${y.status}`);return await y.json()},[e,n]),m=I.useCallback(async()=>{const{PUBLIC_API_FRONT:A,PUBLIC_X_SECURITY_TOKEN:y,PUBLIC_API_PATH_VERSION:N,PUBLIC_PUBLICATION_ID:S}=r;if(!A||!y||!S||!N)throw new Error("Missing required environment variables");const v=await ie.get(`${A}${N}/news-list-section`,{params:{size:h+1,newstype:i.newsType,section:e,imagesizes:i.imgSizes,publication:parseInt(S)},headers:{"x-api-token":y,"Content-Type":"application/json"}});return{...v.data,data:v.data.data.filter(w=>w.info.link.internal!==n)}},[e,n,r]),p=I.useCallback(async()=>{if(!(u||!n)){f(!0);try{let A;r.PUBLIC_ENV!=="prod"?A=await g():A=await m(),d({...A,data:A.data.slice(0,h)})}catch(A){console.error("[/api/get-more-news] Error:",A.message),d(void 0)}}},[u,n,r.PUBLIC_ENV,g,m]);return I.useEffect(()=>{s&&p()},[s,p]),!l?.data||l.data.length===0?null:t.jsx(Y1,{news:l.data,title:"Más Noticias",...o["Modulo 1x3 Client"]??o["Modulo 1x3"],hasLines:!0,showSubtitle:!0,rounded:!0,banner:a,API_ENV:r,paths:c,isVisible:s})},Y1=e=>{const{news:n,hasLines:a=!1,API_ENV:s}=e,o=r=>a&&(r+1)%3!==0?Ga.contentSeparator:"";return t.jsx("div",{className:Ga.newsContent,style:{gap:a?"30px":"20px","--gridTemplateModlule":a?"repeat(auto-fit, 343px);":"repeat(auto-fit, 380px);"},children:n.map((r,i)=>{const{main:c,authors:h,info:l,preview:d,isVideo:u=!1,config:f,overImage:g="default",isTitle:m=!1,isLarge:p=!1,keywords:A}=r;return t.jsx("div",{className:o(i),style:{order:i},children:t.jsxs("section",{className:Vt.content,children:[t.jsx(M,{title:c?.title?.section,href:l?.link?.url??"invalidUrl","aria-label":c?.title?.section??"nota",target:l?.link?.target,children:t.jsx(z1,{isVisible:e.isVisible,preview:d,rounded:e.rounded,isVideo:u,isLarge:p,API_ENV:e.API_ENV,getImageUrl:e.getImageUrl})}),t.jsx("div",{className:Vt.newsDescription,children:t.jsx(K1,{main:c,SHOW_TAG_BY_SECTION:s.SHOW_TAG_BY_SECTION,authors:h,info:l,preview:d,share:e.share,config:f,overImage:g,isTitle:m,paths:e.paths,isVisible:e.isVisible,DATE_CONFIG:e.API_ENV,keywords:A})})]})},i)})})},K1=e=>{const{share:n=!1,cutSubtitle:a=!0,SHOW_TAG_BY_SECTION:s,keywords:o,info:r}=e,c=(()=>{if(!e?.authors||e.authors.length===0)return"";const d=e.authors[0],u=Pe(e.info?.date?.modified,e.DATE_CONFIG);return d&&e?.config?.showtime&&e.config?.showauthor?`${d.fullname} - ${u}`:d&&e.config?.showauthor?d.fullname:e?.config?.showtime?u:""})(),h=()=>e.main.uppertitle?t.jsx("p",{className:se.uppertitle,title:e.main.uppertitle,children:e.main.uppertitle}):null,l=()=>{if(s&&o?.tags?.length&&o.tags.length>0){const d=o.tags[0],u=d.name;return t.jsxs("h3",{className:se.sectionDescriptionContainer,children:[d.approved?t.jsx(M,{"aria-label":u,block_subPublication:e.DATE_CONFIG?.SUB_PUBLICATION_PREFIX_IN_ROUTES?.tema,className:se.sectionDescription,href:st(d,e.paths),children:u}):t.jsx("div",{className:se.sectionDescription,children:u}),h()]})}else if(r?.section?.url){const d=r.section.name;return t.jsxs("h3",{className:se.sectionDescriptionContainer,children:[t.jsx(M,{"aria-label":d,className:se.sectionDescription,href:r.section.url,children:d}),h()]})}return null};return t.jsxs("div",{className:se.boxInformation,children:[n&&t.jsx(V1,{className:se.dotStyles}),t.jsx(l,{}),t.jsx("h2",{className:se.articule,children:t.jsx(M,{className:se.linkStyled,style:{"--isLink":e?.info?.link?.url?"underline":"none"},"aria-label":e.main?.title?.section??"nota",href:e?.info?.link?.url,target:e?.info?.link?.target,children:e.main?.title?.section})}),e.config?.showsubtitle&&e.main?.subtitle?.striped&&t.jsx("p",{className:se.description,style:{"--fontSizeSubTitle":e.fontSizeSubTitle,"--lineHeightSubTitle":e.lineHeightSubTitle,"--colorSubTitle":e.colorSubTitle},children:a?Oe(e.main.subtitle.striped):e.main.subtitle.striped}),(e?.config?.showtime||e.config?.showauthor)&&c&&t.jsx(t.Fragment,{children:e.authors?.[0]?.internaluser?t.jsx(M,{block_subPublication:e.DATE_CONFIG?.SUB_PUBLICATION_PREFIX_IN_ROUTES?.autor,className:se.correspondentLink,href:`/${e.paths.autor}/${e.authors[0].name}`,children:c}):t.jsx("div",{className:se.correspondent,children:c})})]})},J1=({user:e,handleLogout:n,message:a})=>{const s=()=>{const r=document.querySelector(".user-actions-options");r&&r.classList.toggle("show")},o=e.firstname??"Usuario";return t.jsx("div",{className:"comment-item",children:t.jsxs("div",{style:{display:"flex",gap:"14px"},children:[e&&e.picture&&e.picture!==""?t.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):t.jsx("div",{className:"comment-avatar",children:o.charAt(0).toUpperCase()}),t.jsxs("div",{style:{flex:1},children:[t.jsxs("div",{className:"comment-header",children:[t.jsxs("span",{className:"comment-username user-welcome",children:["Hola ",o,"!"]}),t.jsx("div",{className:"user-actions-options",children:t.jsx("button",{onClick:()=>{n()},children:"Cerrar Sesion"})}),t.jsx("button",{className:"user-actions-span",onClick:s,children:t.jsx($n,{width:13,height:13,fill:"black"})})]}),t.jsx("p",{className:"comment-text",children:a})]})]})})},we={overlay:"_overlay_1ng7z_5",popup:"_popup_1ng7z_33",title:"_title_1ng7z_79",optionsContainer:"_optionsContainer_1ng7z_103",option:"_option_1ng7z_103",radioInput:"_radioInput_1ng7z_131",radioCustom:"_radioCustom_1ng7z_139",optionLabel:"_optionLabel_1ng7z_193",buttons:"_buttons_1ng7z_219",cancelButton:"_cancelButton_1ng7z_233",closeButton:"_closeButton_1ng7z_235",buttonAlone:"_buttonAlone_1ng7z_273",reportButton:"_reportButton_1ng7z_285",successContainer:"_successContainer_1ng7z_325",thumbsUp:"_thumbsUp_1ng7z_341",successMessage:"_successMessage_1ng7z_353",errorMessage:"_errorMessage_1ng7z_435",loadingContainer:"_loadingContainer_1ng7z_461"},Dr=async(e,n)=>{if(!e)return!1;const{CAPTCHA_PROJECT:a,CAPTCHA_KEY_V2:s,COMMENTS_CAPTCHA_API_KEY:o}=n;try{const r=a,i=s,l=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${r}/assessments?key=${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:i}})})).json();return console.log("reCAPTCHA Enterprise verification result:",l),l.tokenProperties?.valid===!0}catch(r){return console.error("Error verificando reCAPTCHA Enterprise:",r),!1}};async function Z1({publication:e,username:n,id:a,type:s,baseUrl:o,captchaToken:r,apiToken:i,securityToken:c,COMMENTS_VARS:h}){if(!e||!n||!a||!s||!r)throw new Error("Faltan parámetros requeridos: publication, username, id, type, captchaToken");if(typeof e!="string"||typeof n!="string"||typeof a!="string"||typeof s!="string"||typeof r!="string")throw new Error("Todos los parámetros deben ser strings");if(!await Dr(r,h))throw new Error("Token de captcha inválido");if(!i)throw new Error("Falta el token de API del CMS");const l=`${o}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/report`,d=encodeURIComponent(s),u=new URLSearchParams({publication:e,username:n??!1,id:a,type:d}),f=`${l}?${u.toString()}`;try{console.log("Reporting comment:",{publication:e,username:n,id:a,type:s,encodedType:d,url:f});const g=await ie.get(f,{headers:{"User-Agent":"blu3st@ck-react","x-security-token":c,"x-api-token":i,"Content-Type":"application/json"}});if(console.log("Report response:",g.data),g.status===200||g.status===201)return{type:"success",message:"Comentario reportado exitosamente",status:g.status,data:g.data};throw new Error(`Respuesta inesperada del servidor: ${g.status}`)}catch(g){if(console.error("Error reporting comment:",g),ie.isAxiosError(g)){const m=g.response?.status,p=g.response?.data;throw m===400?new Error("Datos inválidos para el reporte"):m===401?new Error("Token de API inválido"):m===403?new Error("Acceso denegado para reportar comentario"):m===404?new Error("Comentario no encontrado"):m===409?new Error("El comentario ya fue reportado por este usuario"):m===500?new Error("Error interno del servidor CMS"):new Error(p?.error||p?.message||`Error HTTP ${m}: No se pudo reportar el comentario`)}throw g}}const Yn={spam:"Es spam o contenido comercial no deseado",inappropriate:"Lenguaje inadecuado",hate:"Discurso o símbolos de odio",misinformation:"Información falsa o fraude",terrorism:"Promueve el terrorismo",intellectual:"Violación de propiedad intelectual",bullying:"Bullying o acoso"};function X1(e){return Yn[e]}var Kn={exports:{}},Jn={exports:{}},oe={};var $r;function R1(){if($r)return oe;$r=1;var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function S(w){if(typeof w=="object"&&w!==null){var T=w.$$typeof;switch(T){case n:switch(w=w.type,w){case h:case l:case s:case r:case o:case u:return w;default:switch(w=w&&w.$$typeof,w){case c:case d:case m:case g:case i:return w;default:return T}}case a:return T}}}function v(w){return S(w)===l}return oe.AsyncMode=h,oe.ConcurrentMode=l,oe.ContextConsumer=c,oe.ContextProvider=i,oe.Element=n,oe.ForwardRef=d,oe.Fragment=s,oe.Lazy=m,oe.Memo=g,oe.Portal=a,oe.Profiler=r,oe.StrictMode=o,oe.Suspense=u,oe.isAsyncMode=function(w){return v(w)||S(w)===h},oe.isConcurrentMode=v,oe.isContextConsumer=function(w){return S(w)===c},oe.isContextProvider=function(w){return S(w)===i},oe.isElement=function(w){return typeof w=="object"&&w!==null&&w.$$typeof===n},oe.isForwardRef=function(w){return S(w)===d},oe.isFragment=function(w){return S(w)===s},oe.isLazy=function(w){return S(w)===m},oe.isMemo=function(w){return S(w)===g},oe.isPortal=function(w){return S(w)===a},oe.isProfiler=function(w){return S(w)===r},oe.isStrictMode=function(w){return S(w)===o},oe.isSuspense=function(w){return S(w)===u},oe.isValidElementType=function(w){return typeof w=="string"||typeof w=="function"||w===s||w===l||w===r||w===o||w===u||w===f||typeof w=="object"&&w!==null&&(w.$$typeof===m||w.$$typeof===g||w.$$typeof===i||w.$$typeof===c||w.$$typeof===d||w.$$typeof===A||w.$$typeof===y||w.$$typeof===N||w.$$typeof===p)},oe.typeOf=S,oe}var re={};var Gr;function eh(){return Gr||(Gr=1,process.env.NODE_ENV!=="production"&&(function(){var e=typeof Symbol=="function"&&Symbol.for,n=e?Symbol.for("react.element"):60103,a=e?Symbol.for("react.portal"):60106,s=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,r=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,h=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,A=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,N=e?Symbol.for("react.scope"):60119;function S($){return typeof $=="string"||typeof $=="function"||$===s||$===l||$===r||$===o||$===u||$===f||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===g||$.$$typeof===i||$.$$typeof===c||$.$$typeof===d||$.$$typeof===A||$.$$typeof===y||$.$$typeof===N||$.$$typeof===p)}function v($){if(typeof $=="object"&&$!==null){var ve=$.$$typeof;switch(ve){case n:var ta=$.type;switch(ta){case h:case l:case s:case r:case o:case u:return ta;default:var ni=ta&&ta.$$typeof;switch(ni){case c:case d:case m:case g:case i:return ni;default:return ve}}case a:return ve}}}var w=h,T=l,B=c,F=i,X=n,H=d,L=s,z=m,R=g,P=a,x=r,k=o,G=u,O=!1;function Y($){return O||(O=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b($)||v($)===h}function b($){return v($)===l}function E($){return v($)===c}function D($){return v($)===i}function Q($){return typeof $=="object"&&$!==null&&$.$$typeof===n}function j($){return v($)===d}function V($){return v($)===s}function K($){return v($)===m}function J($){return v($)===g}function ne($){return v($)===a}function ae($){return v($)===r}function Z($){return v($)===o}function he($){return v($)===u}re.AsyncMode=w,re.ConcurrentMode=T,re.ContextConsumer=B,re.ContextProvider=F,re.Element=X,re.ForwardRef=H,re.Fragment=L,re.Lazy=z,re.Memo=R,re.Portal=P,re.Profiler=x,re.StrictMode=k,re.Suspense=G,re.isAsyncMode=Y,re.isConcurrentMode=b,re.isContextConsumer=E,re.isContextProvider=D,re.isElement=Q,re.isForwardRef=j,re.isFragment=V,re.isLazy=K,re.isMemo=J,re.isPortal=ne,re.isProfiler=ae,re.isStrictMode=Z,re.isSuspense=he,re.isValidElementType=S,re.typeOf=v})()),re}var jr;function Ha(){return jr||(jr=1,process.env.NODE_ENV==="production"?Jn.exports=R1():Jn.exports=eh()),Jn.exports}var za,Fr;function th(){if(Fr)return za;Fr=1;var e=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function s(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function o(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var i={},c=0;c<10;c++)i["_"+String.fromCharCode(c)]=c;var h=Object.getOwnPropertyNames(i).map(function(d){return i[d]});if(h.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(d){l[d]=d}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return za=o()?Object.assign:function(r,i){for(var c,h=s(r),l,d=1;d<arguments.length;d++){c=Object(arguments[d]);for(var u in c)n.call(c,u)&&(h[u]=c[u]);if(e){l=e(c);for(var f=0;f<l.length;f++)a.call(c,l[f])&&(h[l[f]]=c[l[f]])}}return h},za}var Va,Qr;function Wa(){if(Qr)return Va;Qr=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Va=e,Va}var Ya,Hr;function zr(){return Hr||(Hr=1,Ya=Function.call.bind(Object.prototype.hasOwnProperty)),Ya}var Ka,Vr;function nh(){if(Vr)return Ka;Vr=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var n=Wa(),a={},s=zr();e=function(r){var i="Warning: "+r;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function o(r,i,c,h,l){if(process.env.NODE_ENV!=="production"){for(var d in r)if(s(r,d)){var u;try{if(typeof r[d]!="function"){var f=Error((h||"React class")+": "+c+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}u=r[d](i,d,h,c,null,n)}catch(m){u=m}if(u&&!(u instanceof Error)&&e((h||"React class")+": type specification of "+c+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in a)){a[u.message]=!0;var g=l?l():"";e("Failed "+c+" type: "+u.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(a={})},Ka=o,Ka}var Ja,Wr;function ah(){if(Wr)return Ja;Wr=1;var e=Ha(),n=th(),a=Wa(),s=zr(),o=nh(),r=function(){};process.env.NODE_ENV!=="production"&&(r=function(c){var h="Warning: "+c;typeof console<"u"&&console.error(h);try{throw new Error(h)}catch{}});function i(){return null}return Ja=function(c,h){var l=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function u(b){var E=b&&(l&&b[l]||b[d]);if(typeof E=="function")return E}var f="<<anonymous>>",g={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:N(),arrayOf:S,element:v(),elementType:w(),instanceOf:T,node:H(),objectOf:F,oneOf:B,oneOfType:X,shape:z,exact:R};function m(b,E){return b===E?b!==0||1/b===1/E:b!==b&&E!==E}function p(b,E){this.message=b,this.data=E&&typeof E=="object"?E:{},this.stack=""}p.prototype=Error.prototype;function A(b){if(process.env.NODE_ENV!=="production")var E={},D=0;function Q(V,K,J,ne,ae,Z,he){if(ne=ne||f,Z=Z||J,he!==a){if(h){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ve=ne+":"+J;!E[ve]&&D<3&&(r("You are manually calling a React.PropTypes validation function for the `"+Z+"` prop on `"+ne+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),E[ve]=!0,D++)}}return K[J]==null?V?K[J]===null?new p("The "+ae+" `"+Z+"` is marked as required "+("in `"+ne+"`, but its value is `null`.")):new p("The "+ae+" `"+Z+"` is marked as required in "+("`"+ne+"`, but its value is `undefined`.")):null:b(K,J,ne,ae,Z)}var j=Q.bind(null,!1);return j.isRequired=Q.bind(null,!0),j}function y(b){function E(D,Q,j,V,K,J){var ne=D[Q],ae=k(ne);if(ae!==b){var Z=G(ne);return new p("Invalid "+V+" `"+K+"` of type "+("`"+Z+"` supplied to `"+j+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return A(E)}function N(){return A(i)}function S(b){function E(D,Q,j,V,K){if(typeof b!="function")return new p("Property `"+K+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var J=D[Q];if(!Array.isArray(J)){var ne=k(J);return new p("Invalid "+V+" `"+K+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected an array."))}for(var ae=0;ae<J.length;ae++){var Z=b(J,ae,j,V,K+"["+ae+"]",a);if(Z instanceof Error)return Z}return null}return A(E)}function v(){function b(E,D,Q,j,V){var K=E[D];if(!c(K)){var J=k(K);return new p("Invalid "+j+" `"+V+"` of type "+("`"+J+"` supplied to `"+Q+"`, expected a single ReactElement."))}return null}return A(b)}function w(){function b(E,D,Q,j,V){var K=E[D];if(!e.isValidElementType(K)){var J=k(K);return new p("Invalid "+j+" `"+V+"` of type "+("`"+J+"` supplied to `"+Q+"`, expected a single ReactElement type."))}return null}return A(b)}function T(b){function E(D,Q,j,V,K){if(!(D[Q]instanceof b)){var J=b.name||f,ne=Y(D[Q]);return new p("Invalid "+V+" `"+K+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected ")+("instance of `"+J+"`."))}return null}return A(E)}function B(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?r("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):r("Invalid argument supplied to oneOf, expected an array.")),i;function E(D,Q,j,V,K){for(var J=D[Q],ne=0;ne<b.length;ne++)if(m(J,b[ne]))return null;var ae=JSON.stringify(b,function(he,$){var ve=G($);return ve==="symbol"?String($):$});return new p("Invalid "+V+" `"+K+"` of value `"+String(J)+"` "+("supplied to `"+j+"`, expected one of "+ae+"."))}return A(E)}function F(b){function E(D,Q,j,V,K){if(typeof b!="function")return new p("Property `"+K+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var J=D[Q],ne=k(J);if(ne!=="object")return new p("Invalid "+V+" `"+K+"` of type "+("`"+ne+"` supplied to `"+j+"`, expected an object."));for(var ae in J)if(s(J,ae)){var Z=b(J,ae,j,V,K+"."+ae,a);if(Z instanceof Error)return Z}return null}return A(E)}function X(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&r("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var E=0;E<b.length;E++){var D=b[E];if(typeof D!="function")return r("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+O(D)+" at index "+E+"."),i}function Q(j,V,K,J,ne){for(var ae=[],Z=0;Z<b.length;Z++){var he=b[Z],$=he(j,V,K,J,ne,a);if($==null)return null;$.data&&s($.data,"expectedType")&&ae.push($.data.expectedType)}var ve=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new p("Invalid "+J+" `"+ne+"` supplied to "+("`"+K+"`"+ve+"."))}return A(Q)}function H(){function b(E,D,Q,j,V){return P(E[D])?null:new p("Invalid "+j+" `"+V+"` supplied to "+("`"+Q+"`, expected a ReactNode."))}return A(b)}function L(b,E,D,Q,j){return new p((b||"React class")+": "+E+" type `"+D+"."+Q+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function z(b){function E(D,Q,j,V,K){var J=D[Q],ne=k(J);if(ne!=="object")return new p("Invalid "+V+" `"+K+"` of type `"+ne+"` "+("supplied to `"+j+"`, expected `object`."));for(var ae in b){var Z=b[ae];if(typeof Z!="function")return L(j,V,K,ae,G(Z));var he=Z(J,ae,j,V,K+"."+ae,a);if(he)return he}return null}return A(E)}function R(b){function E(D,Q,j,V,K){var J=D[Q],ne=k(J);if(ne!=="object")return new p("Invalid "+V+" `"+K+"` of type `"+ne+"` "+("supplied to `"+j+"`, expected `object`."));var ae=n({},D[Q],b);for(var Z in ae){var he=b[Z];if(s(b,Z)&&typeof he!="function")return L(j,V,K,Z,G(he));if(!he)return new p("Invalid "+V+" `"+K+"` key `"+Z+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(D[Q],null," ")+`
|
|
261
261
|
Valid keys: `+JSON.stringify(Object.keys(b),null," "));var $=he(J,Z,j,V,K+"."+Z,a);if($)return $}return null}return A(E)}function P(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(P);if(b===null||c(b))return!0;var E=u(b);if(E){var D=E.call(b),Q;if(E!==b.entries){for(;!(Q=D.next()).done;)if(!P(Q.value))return!1}else for(;!(Q=D.next()).done;){var j=Q.value;if(j&&!P(j[1]))return!1}}else return!1;return!0;default:return!1}}function x(b,E){return b==="symbol"?!0:E?E["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&E instanceof Symbol:!1}function k(b){var E=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":x(E,b)?"symbol":E}function G(b){if(typeof b>"u"||b===null)return""+b;var E=k(b);if(E==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return E}function O(b){var E=G(b);switch(E){case"array":case"object":return"an "+E;case"boolean":case"date":case"regexp":return"a "+E;default:return E}}function Y(b){return!b.constructor||!b.constructor.name?f:b.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},Ja}var Za,Yr;function sh(){if(Yr)return Za;Yr=1;var e=Wa();function n(){}function a(){}return a.resetWarningCache=n,Za=function(){function s(i,c,h,l,d,u){if(u!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}s.isRequired=s;function o(){return s}var r={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:o,element:s,elementType:s,instanceOf:o,node:s,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:a,resetWarningCache:n};return r.PropTypes=r,r},Za}var Kr;function oh(){if(Kr)return Kn.exports;if(Kr=1,process.env.NODE_ENV!=="production"){var e=Ha(),n=!0;Kn.exports=ah()(e.isElement,n)}else Kn.exports=sh()();return Kn.exports}var rh=oh();const Ie=St(rh);var ih=["sitekey","onChange","theme","type","tabindex","onExpired","onErrored","size","stoken","grecaptcha","badge","hl","isolated"];function Xa(){return Xa=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},Xa.apply(this,arguments)}function ch(e,n){if(e==null)return{};var a={},s=Object.keys(e),o,r;for(r=0;r<s.length;r++)o=s[r],!(n.indexOf(o)>=0)&&(a[o]=e[o]);return a}function Zn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lh(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,Ra(e,n)}function Ra(e,n){return Ra=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(s,o){return s.__proto__=o,s},Ra(e,n)}var Xn=(function(e){lh(n,e);function n(){var s;return s=e.call(this)||this,s.handleExpired=s.handleExpired.bind(Zn(s)),s.handleErrored=s.handleErrored.bind(Zn(s)),s.handleChange=s.handleChange.bind(Zn(s)),s.handleRecaptchaRef=s.handleRecaptchaRef.bind(Zn(s)),s}var a=n.prototype;return a.getCaptchaFunction=function(o){return this.props.grecaptcha?this.props.grecaptcha.enterprise?this.props.grecaptcha.enterprise[o]:this.props.grecaptcha[o]:null},a.getValue=function(){var o=this.getCaptchaFunction("getResponse");return o&&this._widgetId!==void 0?o(this._widgetId):null},a.getWidgetId=function(){return this.props.grecaptcha&&this._widgetId!==void 0?this._widgetId:null},a.execute=function(){var o=this.getCaptchaFunction("execute");if(o&&this._widgetId!==void 0)return o(this._widgetId);this._executeRequested=!0},a.executeAsync=function(){var o=this;return new Promise(function(r,i){o.executionResolve=r,o.executionReject=i,o.execute()})},a.reset=function(){var o=this.getCaptchaFunction("reset");o&&this._widgetId!==void 0&&o(this._widgetId)},a.forceReset=function(){var o=this.getCaptchaFunction("reset");o&&o()},a.handleExpired=function(){this.props.onExpired?this.props.onExpired():this.handleChange(null)},a.handleErrored=function(){this.props.onErrored&&this.props.onErrored(),this.executionReject&&(this.executionReject(),delete this.executionResolve,delete this.executionReject)},a.handleChange=function(o){this.props.onChange&&this.props.onChange(o),this.executionResolve&&(this.executionResolve(o),delete this.executionReject,delete this.executionResolve)},a.explicitRender=function(){var o=this.getCaptchaFunction("render");if(o&&this._widgetId===void 0){var r=document.createElement("div");this._widgetId=o(r,{sitekey:this.props.sitekey,callback:this.handleChange,theme:this.props.theme,type:this.props.type,tabindex:this.props.tabindex,"expired-callback":this.handleExpired,"error-callback":this.handleErrored,size:this.props.size,stoken:this.props.stoken,hl:this.props.hl,badge:this.props.badge,isolated:this.props.isolated}),this.captcha.appendChild(r)}this._executeRequested&&this.props.grecaptcha&&this._widgetId!==void 0&&(this._executeRequested=!1,this.execute())},a.componentDidMount=function(){this.explicitRender()},a.componentDidUpdate=function(){this.explicitRender()},a.handleRecaptchaRef=function(o){this.captcha=o},a.render=function(){var o=this.props;o.sitekey,o.onChange,o.theme,o.type,o.tabindex,o.onExpired,o.onErrored,o.size,o.stoken,o.grecaptcha,o.badge,o.hl,o.isolated;var r=ch(o,ih);return cs.createElement("div",Xa({},r,{ref:this.handleRecaptchaRef}))},n})(cs.Component);Xn.displayName="ReCAPTCHA",Xn.propTypes={sitekey:Ie.string.isRequired,onChange:Ie.func,grecaptcha:Ie.object,theme:Ie.oneOf(["dark","light"]),type:Ie.oneOf(["image","audio"]),tabindex:Ie.number,onExpired:Ie.func,onErrored:Ie.func,size:Ie.oneOf(["compact","normal","invisible"]),stoken:Ie.string,hl:Ie.string,badge:Ie.oneOf(["bottomright","bottomleft","inline"]),isolated:Ie.bool},Xn.defaultProps={onChange:function(){},theme:"light",type:"image",tabindex:0,size:"normal",badge:"bottomright"};var es,Jr;function dh(){if(Jr)return es;Jr=1;var e=Ha(),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},r={};r[e.ForwardRef]=s,r[e.Memo]=o;function i(m){return e.isMemo(m)?o:r[m.$$typeof]||n}var c=Object.defineProperty,h=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function g(m,p,A){if(typeof p!="string"){if(f){var y=u(p);y&&y!==f&&g(m,y,A)}var N=h(p);l&&(N=N.concat(l(p)));for(var S=i(m),v=i(p),w=0;w<N.length;++w){var T=N[w];if(!a[T]&&!(A&&A[T])&&!(v&&v[T])&&!(S&&S[T])){var B=d(p,T);try{c(m,T,B)}catch{}}}}return m}return es=g,es}var hh=dh();const uh=St(hh);function ts(){return ts=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},ts.apply(this,arguments)}function fh(e,n){if(e==null)return{};var a={},s=Object.keys(e),o,r;for(r=0;r<s.length;r++)o=s[r],!(n.indexOf(o)>=0)&&(a[o]=e[o]);return a}function mh(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var $e={},gh=0;function ph(e,n){return n=n||{},function(s){var o=s.displayName||s.name||"Component",r=(function(c){mh(h,c);function h(d,u){var f;return f=c.call(this,d,u)||this,f.state={},f.__scriptURL="",f}var l=h.prototype;return l.asyncScriptLoaderGetScriptLoaderID=function(){return this.__scriptLoaderID||(this.__scriptLoaderID="async-script-loader-"+gh++),this.__scriptLoaderID},l.setupScriptURL=function(){return this.__scriptURL=typeof e=="function"?e():e,this.__scriptURL},l.asyncScriptLoaderHandleLoad=function(u){var f=this;this.setState(u,function(){return f.props.asyncScriptOnLoad&&f.props.asyncScriptOnLoad(f.state)})},l.asyncScriptLoaderTriggerOnScriptLoaded=function(){var u=$e[this.__scriptURL];if(!u||!u.loaded)throw new Error("Script is not loaded.");for(var f in u.observers)u.observers[f](u);delete window[n.callbackName]},l.componentDidMount=function(){var u=this,f=this.setupScriptURL(),g=this.asyncScriptLoaderGetScriptLoaderID(),m=n,p=m.globalName,A=m.callbackName,y=m.scriptId;if(p&&typeof window[p]<"u"&&($e[f]={loaded:!0,observers:{}}),$e[f]){var N=$e[f];if(N&&(N.loaded||N.errored)){this.asyncScriptLoaderHandleLoad(N);return}N.observers[g]=function(B){return u.asyncScriptLoaderHandleLoad(B)};return}var S={};S[g]=function(B){return u.asyncScriptLoaderHandleLoad(B)},$e[f]={loaded:!1,observers:S};var v=document.createElement("script");v.src=f,v.async=!0;for(var w in n.attributes)v.setAttribute(w,n.attributes[w]);y&&(v.id=y);var T=function(F){if($e[f]){var X=$e[f],H=X.observers;for(var L in H)F(H[L])&&delete H[L]}};A&&typeof window<"u"&&(window[A]=function(){return u.asyncScriptLoaderTriggerOnScriptLoaded()}),v.onload=function(){var B=$e[f];B&&(B.loaded=!0,T(function(F){return A?!1:(F(B),!0)}))},v.onerror=function(){var B=$e[f];B&&(B.errored=!0,T(function(F){return F(B),!0}))},document.body.appendChild(v)},l.componentWillUnmount=function(){var u=this.__scriptURL;if(n.removeOnUnmount===!0)for(var f=document.getElementsByTagName("script"),g=0;g<f.length;g+=1)f[g].src.indexOf(u)>-1&&f[g].parentNode&&f[g].parentNode.removeChild(f[g]);var m=$e[u];m&&(delete m.observers[this.asyncScriptLoaderGetScriptLoaderID()],n.removeOnUnmount===!0&&delete $e[u])},l.render=function(){var u=n.globalName,f=this.props;f.asyncScriptOnLoad;var g=f.forwardedRef,m=fh(f,["asyncScriptOnLoad","forwardedRef"]);return u&&typeof window<"u"&&(m[u]=typeof window[u]<"u"?window[u]:void 0),m.ref=g,I.createElement(s,m)},h})(I.Component),i=I.forwardRef(function(c,h){return I.createElement(r,ts({},c,{forwardedRef:h}))});return i.displayName="AsyncScriptLoader("+o+")",i.propTypes={asyncScriptOnLoad:Ie.func},uh(i,s)}}var ns="onloadcallback",Ah="grecaptcha";function as(){return typeof window<"u"&&window.recaptchaOptions||{}}function wh(){var e=as(),n=e.useRecaptchaNet?"recaptcha.net":"www.google.com";return e.enterprise?"https://"+n+"/recaptcha/enterprise.js?onload="+ns+"&render=explicit":"https://"+n+"/recaptcha/api.js?onload="+ns+"&render=explicit"}const Zr=ph(wh,{callbackName:ns,globalName:Ah,attributes:as().nonce?{nonce:as().nonce}:{}})(Xn),yh={reportAbuseTitle:"Reportar Abuso",errorAlreadyReported:"Ya has reportado este comentario.",errorReportComment:"Error al reportar comentario",cancelButton:"Cancelar",reportButton:"Reportar",reportSuccessMessage:"¡Gracias por reportar!",reportCloseButton:"Cerrar"},bh=({isOpen:e,onClose:n,commentId:a,publication:s,username:o,CAPTCHA_KEY_V2:r,texts:i})=>{const c={...yh,...i?.comentarios},h={...Yn,...c.reportReasons??{}},[l,d]=I.useState("form"),[u,f]=I.useState(""),[g,m]=I.useState(""),[p,A]=I.useState(""),y=[{id:"spam",label:h.spam},{id:"inappropriate",label:h.inappropriate},{id:"hate",label:h.hate},{id:"misinformation",label:h.misinformation},{id:"terrorism",label:h.terrorism},{id:"intellectual",label:h.intellectual},{id:"bullying",label:h.bullying}],N=async()=>{if(!(!u||!a)){if(Lr(document).includes(a)){m(c.errorAlreadyReported);return}d("loading"),m("");try{const w=await(await fetch("/api/comments-report",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:s,username:o,id:a,captchaToken:p,type:Yn[u]})})).json();if(w.type==="success")x1(document,a),d("success"),setTimeout(()=>{S()},3e3);else throw new Error(w.message||c.errorReportComment)}catch(v){console.error("Error reporting comment:",v),m(v.message||c.errorReportComment),d("form")}}},S=()=>{d("form"),f(""),m(""),n()};return!e||!a||!o?null:t.jsx("div",{className:we.overlay,children:t.jsxs("div",{className:we.popup,children:[t.jsx("button",{className:"close-reply-form",onClick:S,children:t.jsx(wt,{})}),t.jsx("h2",{className:we.title,children:c.reportAbuseTitle}),l==="loading"&&t.jsx("div",{className:we.loadingContainer,children:t.jsx(tt,{})}),l==="form"||l==="loading"?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:we.optionsContainer,children:y.map(v=>t.jsxs("label",{className:we.option,children:[t.jsx("input",{type:"radio",name:"reportReason",value:v.id,checked:u===v.id,onChange:w=>f(w.target.value),className:we.radioInput}),t.jsx("span",{className:we.radioCustom}),t.jsx("span",{className:we.optionLabel,children:v.label})]},v.id))}),g&&t.jsx("div",{className:we.errorMessage,children:g}),t.jsx(Zr,{sitekey:r,theme:"light",size:"normal",onChange:v=>A(v??""),onExpired:()=>A("")}),t.jsxs("div",{className:we.buttons,children:[t.jsx("button",{onClick:S,className:we.cancelButton,children:c.cancelButton}),t.jsx("button",{onClick:N,disabled:!u,className:we.reportButton,children:c.reportButton})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:we.successContainer,children:[t.jsx("div",{className:we.thumbsUp,children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:132,height:120,fill:"none",children:t.jsx("path",{fill:"#0073BE",d:"M119.249 42.357H81.915l5.621-27.039.177-1.893a8.906 8.906 0 0 0-2.603-6.272L78.838.941 39.907 39.93c-2.19 2.13-3.491 5.089-3.491 8.343v59.167c0 6.508 5.325 11.833 11.833 11.833h53.25c4.911 0 9.112-2.958 10.887-7.218l17.868-41.713c.533-1.36.829-2.78.829-4.32V54.192c0-6.509-5.325-11.834-11.834-11.834Zm0 23.667-17.75 41.417h-53.25V48.274l25.679-25.678L67.36 54.19h51.889v11.833ZM.916 48.274h23.667v71H.916v-71Z"})})}),t.jsx("p",{className:we.successMessage,children:c.reportSuccessMessage})]}),t.jsx("div",{className:we.buttons,children:t.jsx("button",{onClick:S,className:[we.closeButton,we.buttonAlone].join(" "),children:c.reportCloseButton})})]})]})})};function Ch(e){const n=/^\[\[([^\]]+)\]\]/,a=e.match(n);return a?{user:{username:a[1],firstname:a[1],lastname:""},text:e.replace("[["+a[1]+"]]","")}:{user:!1,text:e}}function Rn(e){const n=e.comments.map(a=>{if(a.user)return{...a,user:a.user,text:a.text,reply:a.reply?Rn({comments:a.reply}).comments:a.reply};const{user:s,text:o}=Ch(a.text);return{...a,user:s||!1,text:o,reply:a.reply?Rn({comments:a.reply}).comments:a.reply}});return{...e,comments:n}}async function ea({publication:e,path:n,size:a=5,sizereply:s=2,id:o,lastid:r,state:i="5,6",apiToken:c,API_ENV:h}){const{PUBLIC_ENV:l}=h;if(l==="prod"){const d=await Xr({publication:e,path:n,size:a,sizereply:s,id:o,lastid:r,state:i,apiToken:c,API_ENV:h});return Rn(d[0])}else{const d=await fetch(`/api/comments-get?publication=${e}&path=${n}&size=${a}&sizereply=${s}&lastid=${r}`);if(!d.ok)throw new Error(`Error al obtener comentarios: ${d.status}`);const u=await d.json();return Rn(u.data[0])}}async function Xr({publication:e,path:n,size:a=5,sizereply:s=2,id:o,lastid:r,state:i="5,6",apiToken:c,API_ENV:h}){if(!e||!n)throw new Error("Missing required parameters: publication and path");if(typeof e!="string"||typeof n!="string")throw new Error("Invalid input types for publication or path");if(!c)throw new Error("Missing CMS API token");const{PUBLIC_ENV:l,PUBLIC_API_HOST:d="dummy",PUBLIC_API_PATH:u,PUBLIC_API_PATH_VERSION:f}=h,g=parseInt(String(a),10),m=parseInt(String(s),10);if(isNaN(g)||g<=0)throw new Error("Invalid size parameter");if(isNaN(m)||m<0)throw new Error("Invalid sizereply parameter");const p=l!=="prod"?`${d}${u}`:"",A=new URLSearchParams({publication:e,path:n,size:g.toString(),sizereply:m.toString(),state:i});o&&A.append("id",o),r&&A.append("lastid",r);const y=`${p}${f}/newcomments/get?${A.toString()}`;try{const{data:N}=await ie.get(y,{headers:{"x-api-token":c,"Cache-Control":"max-age=0, no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!N)throw new Error("No comments data received");return N.data||N||[]}catch(N){if(console.error("Error fetching comments:",N),ie.isAxiosError(N)){const S=N.response?.status,v=N.response?.data;throw S===404?new Error("Comments not found"):S===403?new Error("Access forbidden - check API token"):S===401?new Error("Unauthorized - invalid API token"):S===500?new Error("Internal server error from CMS"):new Error(v?.error||v?.message||`HTTP ${S}: Failed to fetch comments`)}throw N}}const vh=(e,n)=>{const[a,s]=I.useState(void 0),{PUBLIC_PUBLICATION_ID:o}=n,r=o;return I.useEffect(()=>{if(a)return;(async()=>{const{PUBLIC_X_SECURITY_TOKEN:c}=n;try{const h=await ea({publication:r,path:e??"",size:5,sizereply:2,id:void 0,lastid:void 0,state:"5,6",apiToken:c,API_ENV:n});s(h??[])}catch{s({comments:[],morecomment:!1})}})()},[a]),{comments:a,setComments:s}},Rr=({username:e,date:n,DATE_CONFIG:a})=>t.jsxs("div",{className:"comment-header",children:[t.jsx("span",{className:"comment-username",children:e}),t.jsx("span",{className:"comment-header-dot",children:"•"}),t.jsx("span",{className:"comment-date",children:U1(Pe(Number(n),a))})]}),ei=({user:e})=>t.jsx("div",{className:"comment-avatar",children:e.picture?t.jsx("img",{className:"comment-avatar-img",src:e.picture,alt:e.username}):e.firstname.charAt(0).toUpperCase()}),ti=({isReply:e=!1,onReply:n,onFlag:a})=>t.jsxs("div",{className:"comment-actions",children:[!e&&n&&t.jsx("button",{onClick:n,className:"comment-action-btn",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",children:[t.jsx("g",{clipPath:"url(#a)",children:t.jsx("path",{fill:"#4D4E4E",d:"M9.976 9V5l-6.983 7 6.983 7v-4.1c4.988 0 8.48 1.6 10.973 5.1-.997-5-3.99-10-10.973-11Z"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"a",children:t.jsx("path",{fill:"#fff",d:"M0 0h23.942v24H0z"})})})]})}),t.jsx("button",{onClick:a,className:"comment-action-btn",children:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:25,height:24,fill:"none",children:[t.jsx("g",{clipPath:"url(#a)",children:t.jsx("path",{fill:"#4D4E4E",d:"M20.133 2h-16c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2Zm0 14H5.303l-1.17 1.17V4h16v12Zm-9-11h2v6h-2V5Zm0 8h2v2h-2v-2Z"})}),t.jsx("defs",{children:t.jsx("clipPath",{id:"a",children:t.jsx("path",{fill:"#fff",d:"M.133 0h24v24h-24z"})})})]})})]}),ss=({commentRef:e,captchaToken:n="",setIsDisabled:a,API_ENV:s})=>(I.useEffect(()=>{const o=e.current;if(!o)return;const r=()=>{const c=o.value.length;o.parentElement&&(o.parentElement.dataset.text=`${c}/${nt}`),o.classList.toggle("over-limit",c>nt),a(!Wn(e,n,s).boolean)};return o.addEventListener("input",r),r(),()=>o.removeEventListener("input",r)},[e,n,a]),t.jsxs("div",{children:[t.jsx("label",{className:"comment-input-label",children:"Comentario"}),t.jsx("textarea",{ref:e,name:"comment",placeholder:"Ingresa un comentario",rows:2})]})),os=({commentRef:e,captchaToken:n="",setCaptchaToken:a,children:s,API_ENV:o})=>{const r=Wn(e,n,o);return t.jsxs("div",{className:"form-actions",children:[t.jsx(Zr,{sitekey:o.CAPTCHA_KEY_V2??"",theme:"light",size:"normal",onChange:i=>a(i??""),onExpired:()=>a("")}),t.jsxs("div",{className:"submit-zone",children:[s,!r.boolean&&t.jsx("p",{className:"submit-warning",children:r.text})]})]})},_h={title:"",button:"",commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",email:"Email",password:"Contraseña",showPassword:"Mostrar contraseña",loginButtonText:"Iniciar Sesión",backButton:"Volver",GoogleButtonText:"Continuar con GOOGLE",noAccountText:"¿No tienes cuenta?",alreadyHasAccountText:"¿Ya tienes cuenta?",registerButtonText:"Registrate",forgotPasswordText:"Olvidé mi contraseña",forgotMessage:"Ingrese su dirección de correo electrónico. Le enviaremos un mensaje con un código para restablecer la contraseña.",sendCodeButton:"Enviar código",changePasswordMessage:"Hemos enviado un código de restablecimiento de contraseña en un mensaje de Correo electrónico a {{email}}. Ingrese el código y la contraseña nueva.",verificationCodeLabel:"Código de verificación",newPasswordLabel:"Nueva contraseña",confirmPasswordLabel:"Confirmar contraseña",showPasswordsLabel:"Mostrar contraseñas",changePasswordButton:"Cambiar contraseña",feedbackSuccessMessage:"La contraseña fue cambiada con éxito"};function Sh({onClose:e,handleGoogleLogin:n,icon:a,texts:s,API_ENV:o}){const r={..._h,...s?.comentarios},i=f=>{!window||!window.location||(document.cookie=`redirect_after_login=${window.location.pathname}; path=/; max-age=300`,window.location.pathname="/auth/login"+(f?"#forgot":""))},c=()=>{!window||!window.location||(document.cookie=`redirect_after_login=${window.location.pathname}; path=/; max-age=300`,window.location.pathname="/auth/register")},{S3_ID_DIR:h="",PUBLIC_ENV:l,PUBLIC_ASSETS_URL:d}=o,u=l=="local"?"":d&&d!=="false"?d:"";return t.jsx("div",{className:U.overlay,role:"dialog","aria-modal":"true",id:"pop-overlay",onClick:f=>{const g=f.target;g&&g.id==="pop-overlay"&&e()},children:t.jsxs("div",{className:U.card,children:[t.jsxs("header",{className:U.header,children:[t.jsx("div",{className:U.logo,children:a?a():null}),t.jsx("button",{onClick:()=>{e()},className:U.close,"aria-label":"Cerrar",children:t.jsx(wt,{})})]}),t.jsxs("div",{className:U.anonimusWrapper,children:[t.jsx("img",{className:U.anonimusImage,src:u+(u!==""?"/arte/"+h:"")+"/anonimus-img.png",alt:"Imagen incognito"}),t.jsx("button",{onClick:()=>{e(!0)},className:U.anonimus,children:t.jsx("span",{children:"Continuar de forma anónima"})})]}),t.jsx("div",{className:U.divider,children:t.jsx("span",{children:"o"})}),t.jsxs("button",{onClick:n,className:U.google,children:[t.jsx("img",{src:"https://www.gstatic.com/firebasejs/ui/2.0.0/images/auth/google.svg",alt:"",className:U.googleIcon}),t.jsx("span",{children:r.GoogleButtonText})]}),t.jsx("button",{type:"submit",className:U.primary,onClick:()=>{i(!1)},children:r.loginButtonText}),t.jsxs("p",{className:U.switch,children:[r.noAccountText,t.jsx("button",{type:"button",onClick:c,children:r.registerButtonText})]}),t.jsx("button",{type:"button",className:U.forgotPassword,onClick:()=>{i(!0)},children:r.forgotPasswordText})]})})}const rs=({onClick:e,isDisabled:n,API_ENV:a,icon:s,handleGoogleLogin:o})=>{const[r,i]=I.useState(!1),{S3_ID_DIR:c="",PUBLIC_ENV:h,PUBLIC_API_HOST:l="",PUBLIC_ASSETS_URL:d}=a,[u,f]=I.useState(!1),[g,m]=I.useState(!1);I.useEffect(()=>{let A=null;return r&&(A=setTimeout(()=>{i(!1)},2400)),()=>{A&&clearTimeout(A)}},[r]),I.useEffect(()=>{if(!u||!a.CONFIG_commentsV2||!document)return;const A=document.getElementById("comment-button");A&&(console.log("trigger3",{el:A}),A.click())});const p=h=="local"?l:d&&d!=="false"?d:"";return r?t.jsx("div",{className:"success-gif-container",children:t.jsx("img",{className:"success-gif",src:p+"/arte/"+c+"/Success.gif"})}):t.jsxs(t.Fragment,{children:[g&&a.CONFIG_commentsV2&&t.jsx(Sh,{API_ENV:a,icon:s,handleGoogleLogin:o,onClose:A=>{A&&f(!0),m(!1)}}),t.jsxs("button",{type:"button",onClick:async A=>{if(!u&&a.CONFIG_commentsV2){m(!0),console.log("open popup");return}await e(A)&&(a.CONFIG_commentsV2&&f(!1),i(!0))},id:"comment-button",className:`submit-btn ${n?"disabled":"active"}`,children:["Enviar Comentario",t.jsx("svg",{style:{minWidth:16},width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M1.39258 8.99997H12.5626L7.68258 13.88C7.29258 14.27 7.29258 14.91 7.68258 15.3C8.07258 15.69 8.70258 15.69 9.09258 15.3L15.6826 8.70997C16.0726 8.31997 16.0726 7.68997 15.6826 7.29997L9.10258 0.699971C8.71258 0.309971 8.08258 0.309971 7.69258 0.699971C7.30258 1.08997 7.30258 1.71997 7.69258 2.10997L12.5626 6.99997H1.39258C0.842578 6.99997 0.392578 7.44997 0.392578 7.99997C0.392578 8.54997 0.842578 8.99997 1.39258 8.99997Z",fill:"currentColor"})})]})]})},is=async({path:e,ref:n,captchaToken:a,button:s,user:o,id:r,addComment:i,API_ENV:c,anonimusUser:h})=>{const l=n.current?.value||"",{PUBLIC_PUBLICATION_ID:d}=c,u=d;if(console.log("check",o,h),!Wn(n,a,c).boolean||!o&&!h){console.log("warn");const g=s.nextElementSibling;return g&&(g.style.display="block"),!1}if(!o&&!h)return;const f=o?l:"[["+h+"]] "+l;try{const g=Date.now(),m=await fetch("/api/comments-add",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publication:u,path:e,id:r,username:o?o.username:!1,comment:f,recaptchaResponse:a})});let p=null;try{p=await m.json()}catch(v){console.error("Error parsing JSON response:",v)}if(!m.ok)throw new Error(`Error al enviar comentario: ${p?.message} status: ${m.status}`);const A=Date.now(),y=Math.max(0,2400+Math.abs(A-g)),N=o||{username:h,firstname:h},S={username:N.username,firstname:N.firstname,...N.lastname&&{lastname:N.lastname},...N.picture&&{picture:N.picture}};return i({id:A.toString(),text:l,user:S,date:{time:Date.now()},reply:[]}),n.current&&(n.current.value=""),y}catch(g){return console.error("Error enviando comentario:",g),alert(g.message||"Error al enviar el comentario."),!1}},Nh=({replyingTo:e,commentRef:n,user:a,path:s,addReply:o,closeForm:r,API_ENV:i})=>{const[c,h]=I.useState(!0),[l,d]=I.useState(""),u=()=>{n.current?.parentElement&&(n.current.parentElement.dataset.text=`0/${nt}`),h(!0),r()};return t.jsxs("div",{className:"comment-form reply-form",children:[t.jsx("button",{className:"close-reply-form",onClick:u,children:t.jsx(wt,{})}),t.jsx(ss,{commentRef:n,captchaToken:l,setIsDisabled:h,API_ENV:i}),t.jsx(os,{commentRef:n,captchaToken:l,setCaptchaToken:d,API_ENV:i,children:t.jsx(rs,{onClick:async f=>{if(c)return;const g=await is({path:s,ref:n,captchaToken:l,button:f.currentTarget,user:a,id:e,addComment:o,API_ENV:i});return g&&typeof g=="number"?(setTimeout(()=>{u()},g),!0):!1},isDisabled:c,API_ENV:i})})]})},Ih=({reply:e,replyingTo:n,user:a,onFlag:s,DATE_CONFIG:o})=>{const r=e.text;let i=`${at.firstname} ${at.lastname??""}`,c=at.username;return e.user&&(i=`${e.user.firstname} ${e.user.lastname??""}`,c=e.user.username),t.jsx("div",{className:"comment-item reply",children:t.jsxs("div",{className:"comment-header-container",children:[t.jsx(ei,{user:e.user?e.user:at}),t.jsxs("div",{style:{flex:1},children:[t.jsx(Rr,{username:i,date:e.date.time,DATE_CONFIG:o}),t.jsxs("div",{className:"comment-reply-to",children:["Respondiendo a ",t.jsx("strong",{children:n})]}),t.jsx("p",{className:"comment-text",children:r}),a?.username.toLowerCase()!==c.toLowerCase()&&t.jsx(ti,{isReply:!0,onFlag:()=>s(e.id)})]})]})})},Th={moreRepliesButton:"Más Respuestas"},Eh=({comment:e,replyingTo:n,path:a,user:s,handleReplyingTo:o,onFlag:r,API_ENV:i,texts:c})=>{const h={...Th,...c?.comentarios},l={morereply:e.morereply??!1,reply:e.reply?e.reply:[]},[d,u]=I.useState(l),[f,g]=I.useState(!1),{PUBLIC_PUBLICATION_ID:m,PUBLIC_X_SECURITY_TOKEN:p}=i,A=e.text,y=I.useRef(null);let N=`${at.firstname} ${at.lastname??""}`,S=at.username;e.user&&(N=`${e.user.firstname} ${e.user.lastname??""}`,S=e.user.username);const v=w=>{u({morereply:d.morereply,reply:[w,...d.reply]})};return t.jsx("div",{className:"comment-item",children:t.jsxs("div",{className:"comment-header-container","data-hasreplies":d.reply.length>0?"true":"false",children:[t.jsx(ei,{user:e.user?e.user:at}),t.jsxs("div",{style:{flex:1},children:[t.jsx(Rr,{username:N,date:e.date.time,DATE_CONFIG:i}),t.jsx("p",{className:"comment-text",children:A}),s?.username.toLowerCase()!==S.toLowerCase()&&t.jsx(ti,{onReply:()=>o(e.id),onFlag:()=>r(e.id)}),n===e.id&&s&&t.jsx(Nh,{replyingTo:n,commentRef:y,addReply:v,user:s,path:a,API_ENV:i,closeForm:()=>o("")}),d.reply.length>0&&t.jsxs("div",{className:"comment-replies",children:[d.reply.map(w=>t.jsx(Ih,{user:s,reply:w,replyingTo:N,onFlag:r,DATE_CONFIG:i},w.id)),f?t.jsx("div",{style:{marginLeft:"4rem",position:"relative"},children:t.jsx(tt,{})}):d.morereply&&t.jsx("button",{className:"comment-replies-button reply-button",onClick:async()=>{const w=d.reply[d.reply.length-1]?.id;g(!0);try{const B=await ea({publication:m??"",path:a??"",size:2,sizereply:2,id:e.id,lastid:w,state:"5,6",apiToken:p??"",API_ENV:i});g(!1),u({morereply:B.morecomment,reply:[...d.reply,...B.comments]})}catch(T){throw g(!1),new Error(`Error al obtener comentarios: ${T}`)}},children:h.moreRepliesButton})]})]})]})})},kh=({commentRef:e,user:n,path:a,addComment:s,API_ENV:o})=>{const[r,i]=I.useState(!0),[c,h]=I.useState("");return t.jsxs("div",{className:"comment-form",children:[t.jsx(ss,{commentRef:e,captchaToken:c,setIsDisabled:i,API_ENV:o}),t.jsx(os,{API_ENV:o,commentRef:e,captchaToken:c,setCaptchaToken:h,children:t.jsx(rs,{onClick:async l=>{if(r)return;const d=await is({path:a,ref:e,captchaToken:c,button:l.currentTarget,user:n,addComment:s,API_ENV:o});return d&&typeof d=="number"?(e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${nt}`),i(!0),setTimeout(()=>{e.current?.parentElement&&(e.current.parentElement.dataset.text=`0/${nt}`),i(!0)},d),!0):!1},isDisabled:r,API_ENV:o})})]})},Uh=({usernameRef:e})=>t.jsxs("div",{className:"comment-username",children:[t.jsx("label",{className:"comment-input-label",children:"Nombre"}),t.jsx("input",{ref:e,name:"username",placeholder:"Ingresa tu nombre"})]}),xh=({usernameRef:e,commentRef:n,path:a,icon:s,handleGoogleLogin:o,addComment:r,API_ENV:i})=>{const[c,h]=I.useState(!0),[l,d]=I.useState(""),u=async f=>{if(c){console.log("error");return}if(!Wn(n,l,i).boolean){console.log("invalidForm");return}const g=e.current.value,m=await is({path:a,ref:n,captchaToken:l,button:f.currentTarget,user:void 0,addComment:r,API_ENV:i,anonimusUser:g});return d(""),m&&typeof m=="number"?(n.current?.parentElement&&(n.current.parentElement.dataset.text=`0/${nt}`),h(!0),setTimeout(()=>{n.current?.parentElement&&(n.current.parentElement.dataset.text=`0/${nt}`),h(!0)},m),!0):!1};return t.jsx(t.Fragment,{children:t.jsxs("div",{className:"comment-form anoninus-form",children:[t.jsx(Uh,{usernameRef:e}),t.jsx(ss,{commentRef:n,captchaToken:l,setIsDisabled:h,API_ENV:i}),t.jsx(os,{API_ENV:i,commentRef:n,captchaToken:l,setCaptchaToken:d,children:t.jsx(rs,{onClick:u,isDisabled:c,API_ENV:i,handleGoogleLogin:o,icon:s})})]})})},Lh={commentsSectionTitle:"COMENTARIOS",commentHeaderMessageEmpty:"Se el primero en compartir tu opinión de este artículo.",commentHeaderMessageWithComments:"Comparte tu opinión de este artículo.",loadMoreButton:"Más",moreRepliesButton:"Más Respuestas"},Bh=({isAuthenticated:e,path:n,user:a,handleLogout:s,icon:o,handleGoogleLogin:r,API_ENV:i,texts:c})=>{const h={...Lh,...c?.comentarios},{PUBLIC_PUBLICATION_ID:l,PUBLIC_X_SECURITY_TOKEN:d}=i,u=l??"",f=n.replaceAll("/","|"),[g,m]=I.useState(void 0),[p,A]=I.useState(""),{comments:y,setComments:N}=vh(f,i),[S,v]=I.useState(!1),w=I.useRef(null),T=I.useRef(null),B=x=>{A(p===x?"":x)},F=x=>{N(y?{...y,comments:[x,...y.comments??[]]}:void 0)},X=x=>{m(x)},H=async()=>{if(!y||!y.morecomment||y.comments.length===0)return;const x=y.comments[y.comments.length-1];if(!x)return;v(!0);const k=x.id;try{const G=await ea({publication:u,path:f??"",size:5,sizereply:2,id:void 0,lastid:k,state:"5,6",apiToken:d,API_ENV:i});N({morecomment:G.morecomment??!1,comments:[...y.comments,...G.comments]}),v(!1)}catch(G){throw v(!1),new Error(`Error al obtener comentarios: ${G}`)}},L=y?.comments&&y.comments.length>0,z=L?h.commentHeaderMessageWithComments:h.commentHeaderMessageEmpty,R=t.jsx("div",{style:{display:"flex",width:"100%",justifyContent:"center"},children:t.jsx(tt,{})}),P=()=>{!window||!window.location||(document.cookie=`redirect_after_login=${window.location.pathname}; path=/; max-age=300`,window.location.pathname="/auth/login")};return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"comments-container",children:t.jsx(pe,{title:i.CONFIG_commentsV2||L||e?h.commentsSectionTitle:!1,children:t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"comments-header",children:e&&a?t.jsxs(t.Fragment,{children:[t.jsx(J1,{user:a,handleLogout:s,message:z}),t.jsx(kh,{commentRef:w,user:a,addComment:F,path:f,API_ENV:i})]}):i.CONFIG_commentsV2?t.jsxs(t.Fragment,{children:[t.jsxs("p",{className:"anonimus-message",children:["¿Querés debatir con otros lectores? Comentá ahora de forma anónima o ",t.jsx("button",{onClick:P,children:"INICIA SESIÓN AQUÍ"})," para responder a otros usuarios y ser parte activa de nuestra comunidad."]}),t.jsx(xh,{usernameRef:T,commentRef:w,icon:o,handleGoogleLogin:r,addComment:F,path:f,API_ENV:i})]}):null}),y?y.comments&&y.comments.length>0?t.jsxs("div",{className:"comments-list","data-isauthenticated":`${e}`,children:[y.comments.map(x=>t.jsx(Eh,{comment:x,replyingTo:p,handleReplyingTo:B,onFlag:X,user:a??at,path:f,API_ENV:i,texts:c},x.id)),S&&R]}):null:R,y?.morecomment&&!S&&t.jsx("button",{className:"comment-replies-button",onClick:H,children:h.loadMoreButton})]})})}),t.jsx(bh,{username:a?.username??void 0,publication:u,commentId:g,isOpen:g!==void 0,onClose:()=>m(void 0),CAPTCHA_KEY_V2:i.CAPTCHA_KEY_V2??"",texts:c})]})},Ph={commentPromptMessage:"Súmate a la comunidad para dejar tu comentario",loginButtonText:"Iniciar Sesión"};function Oh({isAuthenticated:e,setIsAuthenticated:n,loginUrl:a,user:s,path:o,checkAuth:r,icon:i,API_ENV:c,texts:h}){const[l,d]=I.useState(!1),u={...Ph,...h?.comentarios},f=u.loginButtonText,g=async()=>{if(c.PUBLIC_ENV==="local")await fetch("/api/auth/logout",{method:"GET",credentials:"include"}),n(!1);else{const A=window.location.pathname;window.location.href=`${window.location.origin}/api/auth/logout?redirect=${encodeURIComponent(A)}`}},m=async A=>{A.preventDefault(),a&&d(!0)},p=async()=>{if(c.PUBLIC_ENV==="local"){await fetch("/api/auth/debug-login",{method:"GET",credentials:"include"}),localStorage.setItem("cognito-login","success:"+Date.now()),d(!1),r();return}if(!a)return;const A=encodeURIComponent(window.location.pathname);window.location.href=`/api/auth/login?redirect=${A}`};return t.jsxs(t.Fragment,{children:[l&&!c.CONFIG_commentsV2&&t.jsx(Br,{loginUrl:a,icon:i,checkAuth:r,handleGoogleLogin:p,API_ENV:c,texts:h,onClose:()=>{d(!1)}}),!e&&!c.CONFIG_commentsV2&&t.jsxs("div",{className:"auth-container",children:[t.jsx("p",{children:u.commentPromptMessage}),t.jsx("a",{href:a,onClick:m,className:"login-button",children:f})]}),t.jsx(Bh,{isAuthenticated:e,handleLogout:g,handleGoogleLogin:p,icon:i,path:o,user:e?s:void 0,API_ENV:c,texts:h})]})}function qh({isVisible:e,path:n,icon:a,API_ENV:s,texts:o}){const[r,i]=I.useState(null),[c,h]=I.useState(null),l=s?.COGNITO_AUTH_PREFIX??"ASTRO_",d=I.useCallback(async()=>{if(e){if(document.cookie.search(l+"IS_AUTH=true")===-1){i(!1),h(null);return}try{const m=await(await fetch("/api/auth/user",{credentials:"include"})).json();i(m.isAuthenticated??!1),h(m.user??null)}catch(g){console.error("Error checking auth:",g),i(!1),h(null)}}},[e,l]);I.useEffect(()=>{d()},[d,e]),I.useEffect(()=>{if(!c||!e||typeof window>"u")return;const g=window;if(typeof g!="function"){console.warn("gtag no está disponible todavía");return}g.gtag("set",{user_id:c.username}),console.log("username setted successfully")},[c,e]);const u="/api/auth/login",f=t.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:310,position:"relative"},children:t.jsx(tt,{})});return r===null?f:e?t.jsx(Oh,{icon:a,isAuthenticated:r,setIsAuthenticated:i,loginUrl:u,user:c??void 0,checkAuth:d,path:n,API_ENV:s,texts:o}):f}const Mh=({render:e,internalPath:n,section:a,stylesConfig:s,icon:o,isVisibleDefault:r=!1,paths:i,API_ENV:c,fetchConfig:h,texts:l})=>{const d=I.useRef(null),[u,f]=I.useState(r);I.useEffect(()=>{if(r||u)return;const m=new IntersectionObserver(([p])=>{p?.isIntersecting&&(f(!0),m.disconnect())},{rootMargin:"0px",threshold:.1});return d.current&&m.observe(d.current),()=>m.disconnect()},[]);const g={comment:t.jsx(qh,{path:n,icon:o,isVisible:u,API_ENV:la(c),texts:l}),more:t.jsx(W1,{section:a,internalPath:n,stylesConfig:s,isVisible:u,paths:i,fetchConfig:h,API_ENV:la(c)})};return t.jsx("div",{ref:d,suppressHydrationWarning:!0,style:{...s?s["Modulo 1x3 Client"]?s["Modulo 1x3 Client"]:s["Modulo 1x3"]:{}},children:g[e]})};async function Dh({publication:e,path:n,username:a,comment:s,id:o,recaptchaResponse:r,baseUrl:i,apiToken:c,securityToken:h,COMMENTS_VARS:l}){if(console.log("Adding comment with data:",{publication:e,path:n,username:a,comment:s,id:o,recaptchaResponse:r}),!e||!n||!s)return{type:"error",message:"Faltan campos obligatorios. Por favor, completa todos los campos.",status:400};if([e,n,s].some(m=>typeof m!="string"))return{type:"error",message:"Datos inválidos. Intenta de nuevo.",status:400};if(!s.trim())return{type:"error",message:"El comentario no puede estar vacío.",status:400};const d=await Dr(r,l);if(console.log("Verifying captcha token...",d),!d)return{type:"error",message:"Captcha inválido. Intenta nuevamente.",status:403};const u=`${i}/system/modules/com.tfsla.diario.base/templates/hit/5.0/1/newcomments/add`,f={publication:e,path:n.replace(/\|/gi,"/"),username:a??!1,text:s.trim()};o&&(f.id=o);const g=new URLSearchParams(f);try{const{data:m}=await ie.get(`${u}?${g.toString()}`,{headers:{"Content-Type":"application/json","x-security-token":h,"x-api-token":c,"User-Agent":"amplifyapp-comments-saas"}});return!m||m.error?(console.error("CMS error response:",m),{type:"error",message:"No se pudo guardar el comentario. Intenta nuevamente en unos minutos.",status:502}):(console.log("Comentario enviado con éxito",m),{type:"success",message:"Comentario enviado con éxito.",status:200})}catch(m){if(console.error("Error enviando comentario:",m),ie.isAxiosError(m)){const p=m.response?.status??500,A=m.response?.data;return p===400?{type:"error",message:A?.message||"Solicitud inválida. Verifica que los campos sean correctos.",status:400}:p===403?{type:"error",message:"Captcha inválido o acceso prohibido.",status:403}:p===500?{type:"error",message:"Error interno del servidor del CMS.",status:500}:{type:"error",message:A?.message||"No se pudo enviar el comentario.",status:p}}return{type:"error",message:"Error inesperado. Intenta nuevamente.",status:500}}}const $h=async({token:e,projectId:n,captchaKey:a,apiKey:s,captchaAction:o})=>{if(!e)throw new Error("No token provided");if(!n||!a||!s)throw new Error("Missing project ID or site key");if(!o)throw new Error("No action provided");try{const i=await(await fetch(`https://recaptchaenterprise.googleapis.com/v1/projects/${n}/assessments?key=${s}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:{token:e,siteKey:a,expectedAction:o}})})).json();if(!i?.tokenProperties?.valid)throw new Error(`The token was: ${i?.tokenProperties?.invalidReason}`);if(i.tokenProperties.action!==o)throw new Error("The action attribute in your reCAPTCHA tag does not match the action you are expecting to score");return i?.riskAnalysis?.score??0}catch(r){throw console.error("Recaptcha verification failed",r),new Error(String(r))}};C.AssetsPreconnect=ks,C.AutorComponent=p1,C.AutorHeader1=Zo,C.AutorHeader2=Xo,C.BannerAdvertising=ye,C.BannerAdvertisingMiddle=je,C.CarrouselCSR=kl,C.CarrouselIRS=pt,C.CarruselCard=wr,C.CarruselOpinion=yr,C.CommonServices=ot,C.Comscore=ls,C.ContactInfoServer=Cd,C.ContactInput=Rl,C.ContactSelect=ed,C.ContactTextarea=td,C.ContentLayout1=kt,C.ContentLayoutTema=ka,C.DEBUG_MainSlots=h1,C.DestacadoNoticias=lr,C.DestacadoVideos=gr,C.DynamicBlockServices=Eo,C.DynamicComponents=d1,C.DynamicMainSlot=Vn,C.DynamicSlot=en,C.EditorialBlock=gd,C.ErrorComponent=Xl,C.Font=$s,C.Footer=Kl,C.FormatAfterScripts=Es,C.FormatScripts=oa,C.GA4=ds,C.GTM=hs,C.GalleryHeader=vr,C.GenerateBody=Sl,C.GenerateHead=_l,C.Header=ld,C.IframeHeader=Ir,C.ImageOffline=Oo,C.ImageOnline=ke,C.ImageOnlineClient=Po,C.IssuuServices=Al,C.ItemListSchema=Ps,C.JournalistArticule2=sr,C.JournalistGroup=or,C.LayoutNewsComponent=La,C.LazyLoader=Mh,C.LinkComponent=M,C.LiveBlogHeader=Yo,C.Location=Tl,C.LoginForm=C1,C.LoginPopUp=Br,C.MainComponentServices=Wi,C.Marfeel=us,C.MiddleSection=Ve,C.Modulo1x3=Ma,C.Modulo1x3Card=Ar,C.Modulo1x4=fr,C.Modulo1x5=mr,C.Modulo2Columnas=pd,C.Modulo3Columnas=hr,C.ModuloNewsletter=Ad,C.ModuloOpinion=md,C.NewListResponseDataPH=Mr,C.NewsArticle=Os,C.NewsComponent=f1,C.NewsContent=On,C.NewsDescriptionComponent=At,C.NextPrev=zt,C.OrgList=qs,C.PreloadImages=ia,C.REPORT_REASONS=Yn,C.ReCaptchaRender=ii,C.Readest=kn,C.RegisterForm=y1,C.ScriptHydrator=Q1,C.SearchSection=g1,C.Section=pe,C.SectionCard=Fe,C.SectionCard2=Wt,C.SectionCardServerComponent=Qn,C.SectionServerComponent=bd,C.ShowSection=va,C.SocialNetworks=ja,C.SpeculationRules=Bs,C.Spin=Ot,C.StaticSlotWrapper=l1,C.SubscribeColumn=$o,C.SubscribeRow=Go,C.SubscribeWhatsAppColumn=Gl,C.TagHeader=dd,C.TagSection=ar,C.TimeLine=Ko,C.TrimPathname=Pi,C.TwitterHydration=H1,C.VideoBlock3=Zl,C.VideoBlock4=sd,C.VideoEmbeddedHeader=Sr,C.VideoSection=F1,C.VideoYoutubeHeader=Nr,C.VideosSchemas=Ds,C.WebsiteList=Ms,C.addComment=Dh,C.bannersReplace=mn,C.becomeVideoObject=Nt,C.buildTagUrl=st,C.coloringByStrokeSVGs=Yl,C.compileStyleProps=zn,C.createAssessment=ji,C.cutString=Oe,C.decodeApiEnv=la,C.encodeApiEnv=ca,C.extractMainSlug=Ee,C.extractRealtedNews=aa,C.formatDate=Pe,C.formatDateEdiciones=Si,C.formatDateJournalistArticule=fn,C.formatDateTimeline=ys,C.formatNewsMeta=_s,C.formatVideoData=Us,C.generalGetData=bl,C.getCaptchaToken=an,C.getComments=Xr,C.getConfig=W,C.getDynamicSlots=wl,C.getEnvironmentUrl=qt,C.getEnvironmentUrlFront=Ei,C.getHydratorPath=Di,C.getImageUrl=fe,C.getNextMeta=Mt,C.getPage=$t,C.getPlayIcon=En,C.getPreloadImages=Hi,C.getPrevMeta=Dt,C.getRelatedNewsCarrousel=$i,C.getReportReasonLabel=X1,C.getResponse=ut,C.getResponsePromise=bs,C.getSchemas=gn,C.getScriptReplaces=da,C.getSlugs=js,C.getTypeOfNews=qi,C.getVideoRealPath=Mi,C.handleGetComments=ea,C.initLibrary=oi,C.metadataToJSX=Is,C.metadata_defaults=Uo,C.parseTags=sa,C.pathnameSplit=Ss,C.processExtractedRelatedNews=Cs,C.removePages=Gs,C.reportComment=Z1,C.shareButtons=zo,C.socialIcons=Ln,C.speculationRules=Ls,C.speculationRulesHome=xs,C.toISOWithTimeZone=ht,C.urlReplaces=Ns,C.usePlayIcon=Ia,C.verifyCaptchaTokenEnterprise=$h,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
|