PageSourceSearch

https://schoolface.cl/build/assets/Announcements-BZuXuUe_.js

js schoolface.cl collected 2026-09-24 14:36:56 UTC 31,781 bytes, 4 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/RichEditor-BR9S_N1E.js","assets/app-C0MJ8J0X.js","assets/app-DtGXB5km.css","assets/app-DgGl11_S.css","assets/RichEditor-DZb7HXtg.css"])))=>i.map(i=>d[i]);
2import{i as p,h as P,j as le,x as Se,A as je,o as a,c as n,a as t,f as v,l as u,v as c,O as K,F as A,E as I,t as r,d,e as $e,u as Te,p as De,B as g,R as Me,K as Ne,n as O,G as oe}from"./app-C0MJ8J0X.js";/* empty css            */const Le={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-6"},Fe={class:"flex gap-2"},ze={class:"bg-white rounded-xl shadow-sm p-4 mb-6"},Pe={class:"flex flex-col sm:flex-row gap-3"},Ae={key:0,class:"flex justify-center py-12"},Ie={key:1,class:"space-y-4"},Oe={class:"flex flex-col sm:flex-row gap-4"},Re={key:0,class:"w-full sm:w-32 h-32 rounded-lg overflow-hidden flex-shrink-0 bg-gray-100"},Be=["src"],Ge={class:"flex-1 min-w-0"},He={class:"flex items-center gap-2 flex-wrap mb-2"},qe={key:1,class:"text-xs text-gray-500"},We={class:"text-lg font-semibold text-gray-900 mb-1"},Ke={key:0,class:"text-sm text-gray-600 line-clamp-2 mb-2"},Qe={class:"flex items-center gap-3 text-xs text-gray-400 flex-wrap"},Ye={key:0},Je={key:1},Xe=["href"],Ze={class:"flex items-center gap-2 mt-4 pt-3 border-t border-gray-100"},et=["onClick"],tt=["onClick"],lt=["onClick"],ot=["onClick"],st={key:2,class:"bg-white rounded-xl shadow-sm p-8 text-center"},at={key:3,class:"flex justify-center items-center gap-4 mt-6"},nt=["disabled"],rt={class:"text-sm text-gray-500"},it=["disabled"],ut={key:4,class:"fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 bg-black/50"},dt={class:"bg-white w-full sm:max-w-3xl rounded-t-2xl sm:rounded-xl shadow-2xl max-h-[95vh] overflow-y-auto"},ct={class:"p-5 border-b sticky top-0 bg-white z-10 flex items-center justify-between"},pt={class:"text-xl font-bold text-gray-900"},mt=["disabled"],gt={class:"p-5 space-y-5"},xt={key:0,class:"text-xs text-gray-400 mt-1"},ft={class:"font-mono text-purple-600"},bt=["value"],vt={key:0,class:"mt-2 relative inline-block"},yt=["src"],_t={key:2,class:"text-xs text-gray-500 mt-1"},ht={class:"border border-gray-200 rounded-lg",open:""},wt={class:"p-4 space-y-3 border-t"},kt={class:"grid grid-cols-1 sm:grid-cols-2 gap-3"},Ct={class:"border border-gray-200 rounded-lg"},Et={class:"p-4 space-y-3 border-t"},Vt={class:"border border-gray-200 rounded-lg"},Ut={class:"p-4 space-y-3 border-t"},St={class:"border border-gray-200 rounded-lg"},jt={class:"p-4 space-y-3 border-t"},$t={class:"border border-gray-200 rounded-lg p-4"},Tt={class:"flex items-center gap-3 mb-2"},Dt={class:"relative inline-flex items-center cursor-pointer"},Mt={key:0,class:"text-xs text-green-600"},Nt={key:1},Lt={key:0,class:"text-xs text-amber-600 mt-1"},Ft={class:"p-5 border-t bg-gray-50 flex justify-end gap-3 sticky bottom-0"},zt=["disabled"],Pt=["disabled"],At={key:5,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50"},It={class:"bg-white rounded-xl shadow-2xl w-full max-w-lg max-h-[90vh] overflow-y-auto"},Ot={class:"p-5 border-b flex items-center justify-between"},Rt={class:"p-5 space-y-3"},Bt={class:"text-2xl"},Gt={class:"flex-1 min-w-0"},Ht={class:"font-medium text-gray-900 truncate"},qt={class:"text-xs text-gray-500"},Wt=["onClick"],Kt=["onClick"],Qt={class:"border-t pt-4 space-y-2"},Yt={class:"font-semibold text-gray-900"},Jt={class:"grid grid-cols-2 gap-2"},Xt={class:"grid grid-cols-2 gap-2"},Zt={class:"flex gap-2"},el=["disabled"],tl={key:6,class:"fixed inset-0 z-50 flex items-end sm:items-center justify-center p-0 sm:p-4 bg-black/50"},ll={class:"bg-white w-full sm:max-w-2xl rounded-t-2xl sm:rounded-xl shadow-2xl max-h-[95vh] overflow-y-auto"},ol={class:"p-5 border-b flex items-center justify-between sticky top-0 bg-white z-10"},sl={class:"p-5 space-y-5"},al={key:0,class:"grid grid-cols-2 sm:grid-cols-4 gap-3"},nl={class:"bg-green-50 border border-green-200 rounded-lg p-3"},rl={class:"text-2xl font-bold text-green-800 mt-1"},il={class:"bg-amber-50 border border-amber-200 rounded-lg p-3"},ul={class:"text-2xl font-bold text-amber-800 mt-1"},dl={class:"bg-gray-50 border border-gray-200 rounded-lg p-3"},cl={class:"text-2xl font-bold text-gray-700 mt-1"},pl={class:"bg-purple-50 border border-purple-200 rounded-lg p-3"},ml={class:"text-2xl font-bold text-purple-800 mt-1"},gl={class:"flex gap-2 flex-wrap"},xl={class:"border border-gray-200 rounded-lg overflow-hidden"},fl={class:"w-full text-sm"},bl={class:"px-3 py-2"},vl={class:"font-medium text-gray-900"},yl={key:0,class:"text-xs text-gray-500"},_l={class:"px-3 py-2"},hl={class:"px-3 py-2 text-xs text-gray-500"},wl={class:"px-3 py-2 text-xs text-gray-500"},kl={key:0},Cl={key:1,class:"text-xs text-gray-500 text-center"},El={key:7,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50"}
2,Vl={class:"bg-white rounded-xl shadow-2xl w-full max-w-sm p-6"},Ul={class:"text-sm text-gray-600 mb-4"},Sl={class:"flex justify-end gap-3"},jl=["disabled"],Ml={__name:"Announcements",setup($l){const se=Me(()=>Ne(()=>import("./RichEditor-BR9S_N1E.js"),__vite__mapDeps([0,1,2,3,4]))),j=p([]),$=p([]),R=p(!1),_=p(!1),T=p(!1),D=p(""),M=p(""),E=p(!1),N=p(!1),B=p(!1),L=p(!1),C=p(null),V=p([]),G=P({current_page:1,total:0}),F=p(""),z=p(""),h=p(!1),H=p(null),U=p(null),y=p(null),x=p(null),S=p(!1),f=P({current_page:1,last_page:1,total:0}),s=P({title:"",content:"",excerpt:"",category_id:null,author_name:"",author_role:"",author_photo_url:"",author_bio:"",seo_title:"",seo_description:"",link_url:"",link_text:"",social_instagram_url:"",social_tiktok_url:"",social_youtube_url:"",social_facebook_url:"",hero_image_alt:"",published_at:"",is_active:!0,schedule:!1}),m=P({id:null,name:"",slug:"",color:"#8b5cf6",icon:"",description:""}),w=p(null),Q=le(()=>(s.content||"").replace(/<[^>]*>/g,"").trim().length>0),ae=le(()=>s.published_at&&new Date(s.published_at)>new Date);function ne(o){return o?o.startsWith("http://")||o.startsWith("https://")?o:`/storage/${o}`:null}function re(o){return(o||"").toString().toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-").slice(0,60)}function Y(o){return o?new Date(o).toLocaleDateString("es-CL",{day:"numeric",month:"short",year:"numeric"}):""}function ie(o){return o?new Date(o).toLocaleDateString("es-CL",{weekday:"long",day:"numeric",month:"long",hour:"2-digit",minute:"2-digit"}):""}let J=null;function ue(){clearTimeout(J),J=setTimeout(()=>k(),400)}async function k(o=1){R.value=!0;try{const e={page:o,per_page:15};D.value&&(e.search=D.value),M.value==="active"&&(e.is_active=!0),M.value==="inactive"&&(e.is_active=!1);const i=await g.get("/admin/announcements",{params:e});i.data.success&&(j.value=i.data.data,Object.assign(f,i.data.pagination))}catch{}finally{R.value=!1}}async function q(){try{const o=await g.get("/admin/announcements/categories");o.data.success&&($.value=o.data.data)}catch{}}function de(){Object.assign(s,{title:"",content:"",excerpt:"",category_id:null,author_name:"",author_role:"",author_photo_url:"",author_bio:"",seo_title:"",seo_description:"",link_url:"",link_text:"",social_instagram_url:"",social_tiktok_url:"",social_youtube_url:"",social_facebook_url:"",hero_image_alt:"",published_at:"",is_active:!0,schedule:!1}),y.value=null,x.value=null,S.value=!1}function X(){h.value=!1,H.value=null,de();const o=$.value.find(e=>e.is_active!==!1);o&&(s.category_id=o.id),E.value=!0}function ce(o){h.value=!0,H.value=o.id,y.value=o.hero_image_url||null,x.value=null,S.value=!1;const e=o.published_at&&new Date(o.published_at)>new Date;Object.assign(s,{title:o.title||"",content:o.content||"",excerpt:o.excerpt||"",category_id:o.category_id||null,author_name:o.author_name||"",author_role:o.author_role||"",author_photo_url:o.author_photo_url||"",author_bio:o.author_bio||"",seo_title:o.seo_title||"",seo_description:o.seo_description||"",link_url:o.link_url||"",link_text:o.link_text||"",social_instagram_url:o.social_instagram_url||"",social_tiktok_url:o.social_tiktok_url||"",social_youtube_url:o.social_youtube_url||"",social_facebook_url:o.social_facebook_url||"",hero_image_alt:o.hero_image_alt||"",published_at:e?o.published_at.slice(0,16):"",is_active:o.is_active,schedule:e}),E.value=!0}function Z(){_.value||(E.value=!1)}function pe(o){const e=o.target.files[0];if(e){x.value=e,S.value=!1;const i=new FileReader;i.onload=l=>{y.value=l.target.result},i.readAsDataURL(e)}}function me(){y.value=null,x.value=null,S.value=!0}async function ge(){if(!x.value)return null;try{const o=await g.post("/admin/announcements/upload/presigned",{filename:x.value.name,mime_type:x.value.type});if(!o.data.success)return null;const{key:e,upload_url:i}=o.data.data;return(await fetch(i,{method:"PUT",headers:{"Content-Type":x.value.type},body:x.value})).ok?{key:e,filename:x.value.name,mime_type:x.value.type}:null}catch{return null}}async function xe(){var o,e;if(!(!s.title.trim()||!Q.value)){if(s.schedule&&!s.published_at){alert("Selecciona una fecha para programar");return}_.value=!0;try{const i=await ge();let l;s.schedule?l=s.published_at:h.value||(l="now");const b={title:s.title,content:s.content,excerpt:s.excerpt||void 0,category_id:s.category_id||void 0,author_name:s.author_name||void 0,author_role:s.author_role||void 0,author_photo_url:s.author_photo_url||void 0,author_bio:s.author_bio||void 0,seo_title:s.seo_title||void 0,seo_de
2scription:s.seo_description||void 0,link_url:s.link_url||void 0,link_text:s.link_text||void 0,social_instagram_url:s.social_instagram_url||void 0,social_tiktok_url:s.social_tiktok_url||void 0,social_youtube_url:s.social_youtube_url||void 0,social_facebook_url:s.social_facebook_url||void 0,hero_image_alt:s.hero_image_alt||void 0,published_at:l,is_active:s.is_active};i&&(b.hero_image_r2=i),S.value&&h.value&&(b.remove_hero_image=!0),h.value?await g.put(`/admin/announcements/${H.value}`,b):await g.post("/admin/announcements",b),E.value=!1,k(f.current_page)}catch(i){alert(((e=(o=i.response)==null?void 0:o.data)==null?void 0:e.message)||"Error al guardar")}finally{_.value=!1}}}async function fe(o){try{const e=await g.post(`/admin/announcements/${o.id}/toggle`);e.data.success&&(o.is_active=e.data.data.is_active)}catch{}}function be(o){U.value=o,N.value=!0}async function ve(){if(U.value){T.value=!0;try{await g.delete(`/admin/announcements/${U.value.id}`),N.value=!1,U.value=null,k(f.current_page)}catch{}finally{T.value=!1}}}function ee(){Object.assign(m,{id:null,name:"",slug:"",color:"#8b5cf6",icon:"",description:""}),w.value=null}function ye(o){w.value=o.id,Object.assign(m,{id:o.id,name:o.name,slug:o.slug,color:o.color,icon:o.icon||"",description:o.description||""})}function _e(){ee()}async function he(){var o,e;try{const i={name:m.name,color:m.color,icon:m.icon||void 0,description:m.description||void 0};m.slug&&(i.slug=m.slug),w.value?await g.put(`/admin/announcements/categories/${w.value}`,i):await g.post("/admin/announcements/categories",i),ee(),q()}catch(i){alert(((e=(o=i.response)==null?void 0:o.data)==null?void 0:e.message)||"Error al guardar categoria")}}async function we(o){var e,i;if(confirm(`Eliminar categoria "${o.name}"?`))try{await g.delete(`/admin/announcements/categories/${o.id}`),q()}catch(l){alert(((i=(e=l.response)==null?void 0:e.data)==null?void 0:i.message)||"Error al eliminar")}}async function ke(){try{const o=await g.get("/admin/announcements/newsletter/stats");o.data.success&&(C.value=o.data.data)}catch{}}async function W(){try{const o={per_page:50};F.value&&(o.search=F.value),z.value&&(o.status=z.value);const e=await g.get("/admin/announcements/newsletter/subscribers",{params:o});e.data.success&&(V.value=e.data.data,e.data.pagination&&Object.assign(G,e.data.pagination))}catch{}}let te=null;function Ce(){clearTimeout(te),te=setTimeout(()=>W(),400)}async function Ee(o){var e,i;if(confirm(`Enviar/reenviar newsletter para "${o.title}" a todos los suscritos confirmados?
3
4Nota: los que ya lo recibieron no lo recibiran de nuevo.`))try{await g.post(`/admin/announcements/${o.id}/newsletter/send`),window.$toast&&window.$toast.success("Envio encolado. Los suscritos recibiran el correo en breve.")}catch(l){window.$toast&&window.$toast.error(((i=(e=l.response)==null?void 0:e.data)==null?void 0:i.message)||"Error al enviar")}}function Ve(o){return o==="confirmed"?"bg-green-100 text-green-700":o==="pending"?"bg-amber-100 text-amber-700":"bg-gray-100 text-gray-700"}function Ue(o){return o==="confirmed"?"Confirmado":o==="pending"?"Pendiente":"Desuscrito"}return Se(L,o=>{o&&(ke(),W())}),je(()=>{k(),q()}),(o,e)=>{var i;return a(),n("div",null,[t("div",Le,[e[37]||(e[37]=t("div",null,[t("h1",{class:"text-2xl sm:text-3xl font-bold text-gray-900"},"Novedades — Blog"),t("p",{class:"text-sm text-gray-500 mt-1"},[v(" Publicaciones visibles en la app y en "),t("a",{href:"https://schoolface.cl/novedades",target:"_blank",class:"text-purple-600 hover:underline"},"schoolface.cl/novedades")])],-1)),t("div",Fe,[t("button",{onClick:e[0]||(e[0]=l=>L.value=!0),class:"px-4 py-2 text-sm border border-gray-300 rounded-lg hover:bg-gray-50"}," 📬 Newsletter "),t("button",{onClick:e[1]||(e[1]=l=>B.value=!0),class:"px-4 py-2 text-sm border border-gray-300 rounded-lg hover:bg-gray-50"}," Categorias "),t("button",{onClick:X,class:"btn-schoolface"}," + Nuevo articulo ")])]),t("div",ze,[t("div",Pe,[u(t("input",{"onUpdate:modelValue":e[2]||(e[2]=l=>D.value=l),type:"text",placeholder:"Buscar por titulo o contenido...",class:"input-schoolface flex-1",onInput:ue},null,544),[[c,D.value]]),u(t("select",{"onUpdate:modelValue":e[3]||(e[3]=l=>M.value=l),onChange:e[4]||(e[4]=l=>k()),class:"input-schoolface sm:w-36"},[...e[38]||(e[38]=[t("option",{value:""},"Todos",-1),t("option",{value:"active"},"Activos",-1),t("option",{value:"inactive"},"Inactivos",-1)])],544),[[K,M.value]])])]),R.value&&!j.value.length?(a(),n("div",Ae,[...e[39]||(e[39]=[t("div",{class:"animate-spin text-4xl"},"⌛",-1)])])):j.value.length?(a(),n("div",Ie,[(a(!0),n(A,null,I(j.value,l=>(a(),n("div",{key:l.id,class:O(["bg-white rounded-xl shadow-sm p-4 sm:p-6",{"opacity-60":!l.is_active}])},[t("div",Oe,[l.hero_image_url||l.image_url?(a(),n("div",Re,[t("img",{src:ne(l.hero_image_url||l.image_url),alt:"",class:"w-full h-full object-cover"},null,8,Be)])):d("",!0),t("div",Ge,[t("div",He,[l.category?(a(),n("span",{key:0,class:"px-2 py-0.5 text-xs font-semibold rounded-full inline-flex items-center gap-1",style:oe({backgroundColor:l.category.color+"20",color:l.category.color})},r(l.category.icon)+" "+r(l.category.name),5)):d("",!0),t("span",{class:O(["px-2 py-0.5 text-xs font-medium rounded-full",l.is_active?"bg-green-100 text-green-700":"bg-red-100 text-red-700"])},r(l.is_active?"Publicado":"Borrador"),3),l.reading_time_minutes?(a(),n("span",qe,r(l.reading_time_minutes)+" min de lectura ",1)):d("",!0)]),t("h3",We,r(l.title),
41),l.excerpt?(a(),n("p",Ke,r(l.excerpt),1)):d("",!0),t("div",Qe,[l.author_name?(a(),n("span",Ye,"✍ "+r(l.author_name),1)):d("",!0),t("span",null,"📅 "+r(Y(l.published_at)),1),l.view_count>0?(a(),n("span",Je,"👁 "+r(l.view_count)+" vistas",1)):d("",!0),l.slug&&l.is_active?(a(),n("a",{key:2,href:`/novedades/${l.slug}`,target:"_blank",class:"text-purple-600 hover:underline"}," Ver publicado ↗ ",8,Xe)):d("",!0)])])]),t("div",Ze,[t("button",{onClick:b=>ce(l),class:"px-3 py-1.5 text-sm text-purple-600 hover:bg-purple-50 rounded-lg transition-colors"}," Editar ",8,et),t("button",{onClick:b=>fe(l),class:O(["px-3 py-1.5 text-sm rounded-lg transition-colors",l.is_active?"text-amber-600 hover:bg-amber-50":"text-green-600 hover:bg-green-50"])},r(l.is_active?"Despublicar":"Publicar"),11,tt),l.is_active?(a(),n("button",{key:0,onClick:b=>Ee(l),class:"px-3 py-1.5 text-sm text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",title:"Enviar/reenviar newsletter a suscritos (no duplica envios previos)"}," 📬 Newsletter ",8,lt)):d("",!0),t("button",{onClick:b=>be(l),class:"px-3 py-1.5 text-sm text-red-600 hover:bg-red-50 rounded-lg transition-colors"}," Eliminar ",8,ot)])],2))),128))])):(a(),n("div",st,[e[40]||(e[40]=t("div",{class:"text-5xl mb-3"},"📣",-1)),e[41]||(e[41]=t("p",{class:"text-gray-500"},"No hay articulos aun",-1)),t("button",{onClick:X,class:"btn-schoolface mt-4"}," Crear primer articulo ")])),f.last_page>1?(a(),n("div",at,[t("button",{onClick:e[5]||(e[5]=l=>k(f.current_page-1)),disabled:f.current_page===1,class:"px-4 py-2 text-sm bg-white rounded-lg shadow-sm hover:bg-gray-50 disabled:opacity-50"}," Anterior ",8,nt),t("span",rt,r(f.current_page)+" / "+r(f.last_page),1),t("button",{onClick:e[6]||(e[6]=l=>k(f.current_page+1)),disabled:f.current_page===f.last_page,class:"px-4 py-2 text-sm bg-white rounded-lg shadow-sm hover:bg-gray-50 disabled:opacity-50"}," Siguiente ",8,it)])):d("",!0),E.value?(a(),n("div",ut,[t("div",dt,[t("div",ct,[t("h2",pt,r(h.value?"Editar articulo":"Nuevo articulo"),1),t("button",{onClick:Z,disabled:_.value,class:"p-1.5 rounded-lg hover:bg-gray-100 text-gray-500 disabled:opacity-50"},[...e[42]||(e[42]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])],8,mt)]),t("div",gt,[t("div",null,[e[44]||(e[44]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Titulo *",-1)),u(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>s.title=l),type:"text",class:"input-schoolface w-full text-lg font-semibold",maxlength:"200",placeholder:"Titulo del articulo"},null,512),[[c,s.title]]),s.title?(a(),n("p",xt,[e[43]||(e[43]=v(" URL: /novedades/",-1)),t("span",ft,r(re(s.title)),1)])):d("",!0)]),t("div",null,[e[46]||(e[46]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Categoria *",-1)),u(t("select",{"onUpdate:modelValue":e[8]||(e[8]=l=>s.category_id=l),class:"input-schoolface w-full"},[e[45]||(e[45]=t("option",{value:null},"Sin categoria",-1)),(a(!0),n(A,null,I($.value,l=>(a(),n("option",{key:l.id,value:l.id},r(l.icon)+" "+r(l.name),9,bt))),128))],512),[[K,s.category_id]])]),t("div",null,[e[47]||(e[47]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},[v(" Extracto "),t("span",{class:"text-gray-400 font-normal"},"(opcional — se muestra en el listado y al compartir)")],-1)),u(t("textarea",{"onUpdate:modelValue":e[9]||(e[9]=l=>s.excerpt=l),rows:"2",maxlength:"500",class:"input-schoolface w-full text-sm",placeholder:"Resumen atractivo del articulo. Si lo dejas vacio, se genera automatico."},null,512),[[c,s.excerpt]])]),t("div",null,[e[48]||(e[48]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},[v(" Imagen de portada "),t("span",{class:"text-gray-400 font-normal"},"(hero, 16:9 recomendado)")],-1)),t("input",{type:"file",accept:"image/jpeg,image/png,image/webp",onChange:pe,class:"input-schoolface w-full text-sm"},null,32),y.value?(a(),n("div",vt,[t("img",{src:y.value,alt:"",class:"w-64 h-36 object-cover rounded-lg"},null,8,yt),t("button",{onClick:me,class:"absolute -top-2 -right-2 w-6 h-6 bg-red-500 text-white rounded-full text-xs hover:bg-red-600"},"×")])):d("",!0),y.value?u((a(),n("input",{key:1,"onUpdate:modelValue":e[10]||(e[10]=l=>s.hero_image_alt=l),type:"text",maxlength:"200",class:"input-schoolface w-full text-sm mt-2",placeholder:"Texto descriptivo de la imagen (para SEO y accesibilidad). Ej: 'Profesora Maria Lopez ensenando fracciones a alumnos de 3° basico'"},null,512)),[[c,s.hero_image_alt]]):d("",!0),y.value?(a(),n("p",_t," Google usa este texto para posicionar la imagen en Google Images. Si lo de
4jas vacio, usamos el titulo del articulo. ")):d("",!0)]),t("div",null,[e[49]||(e[49]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1"},"Contenido *",-1)),$e(Te(se),{modelValue:s.content,"onUpdate:modelValue":e[11]||(e[11]=l=>s.content=l),placeholder:"Escribe la historia. Usa la barra para dar formato, agregar imagenes, videos, enlaces..."},null,8,["modelValue"]),e[50]||(e[50]=t("p",{class:"text-xs text-gray-500 mt-1"}," Tip: para insertar imagenes dentro del articulo, subelas primero via el navegador y pega la URL. ",-1))]),t("details",ht,[e[55]||(e[55]=t("summary",{class:"cursor-pointer px-4 py-3 font-medium text-gray-700 hover:bg-gray-50"}," Firma del articulo (entrevistado o autor) ",-1)),t("div",wt,[t("div",kt,[t("div",null,[e[51]||(e[51]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},"Nombre",-1)),u(t("input",{"onUpdate:modelValue":e[12]||(e[12]=l=>s.author_name=l),type:"text",maxlength:"100",class:"input-schoolface w-full",placeholder:"Maria Lopez"},null,512),[[c,s.author_name]])]),t("div",null,[e[52]||(e[52]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},"Cargo / Contexto",-1)),u(t("input",{"onUpdate:modelValue":e[13]||(e[13]=l=>s.author_role=l),type:"text",maxlength:"100",class:"input-schoolface w-full",placeholder:"Profesora de Matematica, Colegio San Ignacio"},null,512),[[c,s.author_role]])])]),t("div",null,[e[53]||(e[53]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},"Foto (URL, opcional)",-1)),u(t("input",{"onUpdate:modelValue":e[14]||(e[14]=l=>s.author_photo_url=l),type:"url",maxlength:"500",class:"input-schoolface w-full",placeholder:"https://..."},null,512),[[c,s.author_photo_url]])]),t("div",null,[e[54]||(e[54]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},"Bio corta (opcional)",-1)),u(t("textarea",{"onUpdate:modelValue":e[15]||(e[15]=l=>s.author_bio=l),rows:"2",maxlength:"1000",class:"input-schoolface w-full text-sm",placeholder:"15 anos ensenando a estudiantes de basica..."},null,512),[[c,s.author_bio]])])])]),t("details",Ct,[e[58]||(e[58]=t("summary",{class:"cursor-pointer px-4 py-3 font-medium text-gray-700 hover:bg-gray-50"}," SEO (avanzado — opcional) ",-1)),t("div",Et,[t("div",null,[e[56]||(e[56]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},"Title SEO (override del titulo)",-1)),u(t("input",{"onUpdate:modelValue":e[16]||(e[16]=l=>s.seo_title=l),type:"text",maxlength:"200",class:"input-schoolface w-full",placeholder:"Titulo optimizado para Google (60 chars)"},null,512),[[c,s.seo_title]])]),t("div",null,[e[57]||(e[57]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},"Description SEO",-1)),u(t("textarea",{"onUpdate:modelValue":e[17]||(e[17]=l=>s.seo_description=l),rows:"2",maxlength:"300",class:"input-schoolface w-full text-sm",placeholder:"Meta description para Google y OG (155 chars)"},null,512),[[c,s.seo_description]])])])]),t("details",Vt,[e[59]||(e[59]=t("summary",{class:"cursor-pointer px-4 py-3 font-medium text-gray-700 hover:bg-gray-50"}," Enlace externo (opcional) ",-1)),t("div",Ut,[u(t("input",{"onUpdate:modelValue":e[18]||(e[18]=l=>s.link_url=l),type:"url",maxlength:"500",class:"input-schoolface w-full",placeholder:"https://..."},null,512),[[c,s.link_url]]),s.link_url?u((a(),n("input",{key:0,"onUpdate:modelValue":e[19]||(e[19]=l=>s.link_text=l),type:"text",maxlength:"100",class:"input-schoolface w-full",placeholder:"Texto del boton (Ver mas)"},null,512)),[[c,s.link_text]]):d("",!0)])]),t("details",St,[e[65]||(e[65]=t("summary",{class:"cursor-pointer px-4 py-3 font-medium text-gray-700 hover:bg-gray-50"}," Redes sociales del articulo (opcional) ",-1)),t("div",jt,[e[64]||(e[64]=t("p",{class:"text-xs text-gray-500"}," Si publicaste el video o version completa en redes, agrega los enlaces. Se muestran como iconos junto a la publicacion. Solo aparecen los que completes. ",-1)),t("div",null,[e[60]||(e[60]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},[t("span",{class:"inline-block mr-1"},"📸"),v(" Instagram ")],-1)),u(t("input",{"onUpdate:modelValue":e[20]||(e[20]=l=>s.social_instagram_url=l),type:"url",maxlength:"500",class:"input-schoolface w-full",placeholder:"https://www.instagram.com/p/..."},null,512),[[c,s.social_instagram_url]])]),t("div",null,[e[61]||(e[61]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},[t("span",{class:"inline-block mr-1"},"🎵"),v(" TikTok ")],-1)),u(t("input",{"onUpdate:modelValue":e[21]||(e[21]=l=>s.social_tiktok_url=l),type:"url",maxlength:"500",class:"input-schoolface w-full",placeholder:"https://www.tiktok.com/@usuario/video/..."},null,512),[[c,s.social_tiktok_url]])]),t("div",null,[e[62]||(e[62]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},[t("span",{class:"inline-block mr-1"},"▶️"),v(" YouTube ")],-1)),u(t("input",{"onUpdate:modelValue":e[22]||(e[22]=l=>s.social_youtube_url=l),type:"url",maxlength:"500",class:"input-schoolface w-full",placeholder:"https://www.youtube.com/watch?v=..."},null,512),[[c,s.social_youtube_url]])]),t("div",null,[e[63]||(e[63]=t("label",{class:"block text-xs font-medium text-gray-600 mb-1"},[t("span",{class:"inline-block mr-1"},"📘"),v(" Facebook ")],-1)),u(t("input",{"onUpdate:modelValue":e[23]||(e[23]=l=>s.social_facebook_url=l),type:"url",maxlength:"500",class:"input-schoolface w-full",placeholder:"https://www.facebook.com/..."},null,512),[[c,s.social_facebook_url]])])])]),t("div",$t,[t("div",Tt,[t("label",Dt,[u(t("input",{type:"checkbox","onUpdate:modelValue":e[24]||(e[24]=l=>s.schedule=l),class:"sr-only peer"},null,512),[[De,s.schedule]]),e[66]||(e[66]=t("div",{class:"w-11 h-6 bg-gray-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-purple-600"},null,-1))]),e[67]||(e[67]=t("span",{class:"text-sm font-medium text-gray-700"},"Programar publicacion",-1))]),s.schedule?d("",!0):(a(),n("p",Mt,"Se publica de inmediato al guardar")),s.schedule?(a(),n("div",Nt,[u(t("input",{"onUpdate:modelValue":e[25]||(e[25]=l=>s.published_at=l),type:"datetime-local",class:"input-schoolface w-full mt-2"},null,512),[[c,s.published_at]]),s.published_at&&ae.value?(a(),n("p",Lt," Se publica el "+r(ie(s.published_at)),1)):d("",!0)])):d("",!0)])]),t("div",Ft,[t("button",{onClick:Z,disabled:_.value,class:"px-4 py-2 text-sm text-gray-600 hover:bg-gray-100 rounded-lg"}," Cancelar ",8,zt),t("button",{onClick:xe,disabled:_.value||!s.title.trim()||!Q.value,class:"btn-schoolface disabled:opacity-50"},r(_.value?"Guardando...":h.value?"Actualizar":"Publicar"),9,Pt)])])])):d("",!0),B.value?(a(),n("div",At,[t("div",It,[t("div",Ot,[e[69]||(e[69]=t("h2",{class:"text-xl font-bold text-gray-900"},"Categorias",-1)),t("button",{onClick:e[26]||(e[26]=l=>B.value=!1),class:"p-1.5 rounded-lg hover:bg-gray-100 text-gray-500"},[...e[68]||(e[68]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),t("div",Rt,[(a(!0),n(A,null,I($.value,l=>(a(),n("div",{key:l.id,class:"flex items-center gap-3 p-3 border border-gray-200 rounded-lg"},[t("span",Bt,r(l.icon||"📄"),1),t("div",Gt,[t("p",Ht,r(l.name),1),t("p",qt,"/novedades?cat="+r(l.slug),1)]),t("span",{class:"w-4 h-4 rounded-full",style:oe({background:l.color})},null,4),t("button",{onClick:b=>ye(l),class:"text-purple-600 text-sm hover:underline"},"Editar",8,Wt),t("button",{onClick:b=>we(l),class:"text-red-600 text-sm hover:underline"},"Eliminar",8,Kt)]))),128)),t("div",Qt,[t("h3",Yt,r(w.value?"Editar categoria":"Nueva categoria"),1),t("div",Jt,[u(t("input",{"onUpdate:modelValue":e[27]||(e[27]=l=>m.name=l),type:"text",placeholder:"Nombre",class:"input-schoolface"},null,512),[[c,m.name]]),u(t("input",{"onUpdate:modelValue":e[28]||(e[28]=l=>m.icon=l),type:"text",placeholder:"🎤 (emoji)",class:"input-schoolface",maxlength:"4"},null,512),[[c,m.icon]])]),t("div",Xt,[u(t("input",{"onUpdate:modelValue":e[29]||(e[29]=l=>m.slug=l),type:"text",placeholder:"slug-url (opcional)",class:"input-schoolface"},null,512),[[c,m.slug]]),u(t("input",{"onUpdate:modelValue":e[30]||(e[30]=l=>m.color=l),type:"text",placeholder:"#8b5cf6",class:"input-schoolface"},null,512),[[c,m.color]])]),u(t("textarea",{"onUpdate:modelValue":e[31]||(e[31]=l=>m.description=l),rows:"2",placeholder:"Descripcion breve",class:"input-schoolface w-full"}
4,null,512),[[c,m.description]]),t("div",Zt,[w.value?(a(),n("button",{key:0,onClick:_e,class:"px-3 py-1.5 text-sm text-gray-600 border rounded-lg"}," Cancelar ")):d("",!0),t("button",{onClick:he,disabled:!m.name,class:"btn-schoolface flex-1 disabled:opacity-50"},r(w.value?"Actualizar":"Crear"),9,el)])])])])])):d("",!0),L.value?(a(),n("div",tl,[t("div",ll,[t("div",ol,[e[71]||(e[71]=t("h2",{class:"text-xl font-bold text-gray-900"},"📬 Newsletter del blog",-1)),t("button",{onClick:e[32]||(e[32]=l=>L.value=!1),class:"p-1.5 rounded-lg hover:bg-gray-100 text-gray-500"},[...e[70]||(e[70]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])]),t("div",sl,[C.value?(a(),n("div",al,[t("div",nl,[e[72]||(e[72]=t("p",{class:"text-xs text-green-700 font-semibold uppercase"},"Confirmados",-1)),t("p",rl,r(C.value.confirmed),1)]),t("div",il,[e[73]||(e[73]=t("p",{class:"text-xs text-amber-700 font-semibold uppercase"},"Pendientes",-1)),t("p",ul,r(C.value.pending),1)]),t("div",dl,[e[74]||(e[74]=t("p",{class:"text-xs text-gray-600 font-semibold uppercase"},"Desuscritos",-1)),t("p",cl,r(C.value.unsubscribed),1)]),t("div",pl,[e[75]||(e[75]=t("p",{class:"text-xs text-purple-700 font-semibold uppercase"},"Emails enviados",-1)),t("p",ml,r(C.value.sends_total),1)])])):d("",!0),t("div",gl,[u(t("input",{"onUpdate:modelValue":e[33]||(e[33]=l=>F.value=l),onInput:Ce,type:"text",placeholder:"Buscar por email o nombre...",class:"input-schoolface flex-1 min-w-0"},null,544),[[c,F.value]]),u(t("select",{"onUpdate:modelValue":e[34]||(e[34]=l=>z.value=l),onChange:e[35]||(e[35]=l=>W()),class:"input-schoolface w-40"},[...e[76]||(e[76]=[t("option",{value:""},"Todos",-1),t("option",{value:"confirmed"},"Confirmados",-1),t("option",{value:"pending"},"Pendientes",-1),t("option",{value:"unsubscribed"},"Desuscritos",-1)])],544),[[K,z.value]])]),t("div",xl,[t("table",fl,[e[78]||(e[78]=t("thead",{class:"bg-gray-50 text-xs uppercase text-gray-600"},[t("tr",null,[t("th",{class:"px-3 py-2 text-left"},"Email"),t("th",{class:"px-3 py-2 text-left"},"Estado"),t("th",{class:"px-3 py-2 text-left"},"Fuente"),t("th",{class:"px-3 py-2 text-left"},"Fecha")])],-1)),t("tbody",null,[(a(!0),n(A,null,I(V.value,l=>(a(),n("tr",{key:l.id,class:"border-t border-gray-100"},[t("td",bl,[t("div",vl,r(l.email),1),l.name?(a(),n("div",yl,r(l.name),1)):d("",!0)]),t("td",_l,[t("span",{class:O(["text-xs px-2 py-0.5 rounded-full font-semibold",Ve(l.status)])},r(Ue(l.status)),3)]),t("td",hl,r(l.source||"—"),1),t("td",wl,r(Y(l.created_at)),1)]))),128)),V.value.length===0?(a(),n("tr",kl,[...e[77]||(e[77]=[t("td",{colspan:"4",class:"text-center py-8 text-gray-400"},"Sin resultados",-1)])])):d("",!0)])])]),G.total>V.value.length?(a(),n("p",Cl," Mostrando "+r(V.value.length)+" de "+r(G.total),1)):d("",!0)])])])):d("",!0),N.value?(a(),n("div",El,[t("div",Vl,[e[81]||(e[81]=t("h3",{class:"text-lg font-bold text-gray-900 mb-2"},"Eliminar articulo",-1)),t("p",Ul,[e[79]||(e[79]=v(' ¿Estas seguro de eliminar "',-1)),t("strong",null,r((i=U.value)==null?void 0:i.title),1),e[80]||(e[80]=v('"? ',-1))]),t("div",Sl,[t("button",{onClick:e[36]||(e[36]=l=>N.value=!1),class:"px-4 py-2 text-sm text-gray-600 hover:bg-gray-100 rounded-lg"}," Cancelar "),t("button",{onClick:ve,disabled:T.value,class:"px-4 py-2 text-sm bg-red-600 text-white rounded-lg hover:bg-red-700 disabled:opacity-50"},r(T.value?"Eliminando...":"Eliminar"),9,jl)])])])):d("",!0)])}}};export{Ml as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.