import{C as h}from"./CoachLayout-DmiDPFPr.js";import{a as r,b as n,d as u,h as f,e as l,f as e,o,F as x,j as m,t as a,n as y,p,q as d}from"./app-DtilF0jd.js";import"./MobileNavigationDrawer-BV2kxNFx.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./DarkModeToggle-wIsj_tj1.js";import"./ImpersonationBanner-BXRKEhdr.js";import"./DropdownLink-Bsw03pEy.js";const k={class:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4"},v={class:"py-6"},_={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"},w={class:"grid gap-6 md:grid-cols-2 lg:grid-cols-3"},C={class:"p-5"},j={class:"flex items-start justify-between mb-3"},z={class:"flex items-center gap-2"},B={class:"text-2xl"},P={class:"text-lg font-semibold text-gray-900 dark:text-white"},M={class:"text-sm text-gray-500 dark:text-gray-400 mb-4"},E={class:"mb-4 p-3 bg-gray-50 dark:bg-gray-700/50 rounded-lg"},L={class:"text-sm text-gray-900 dark:text-white truncate"},V={class:"flex flex-wrap gap-1 mb-4"},N=["textContent"],T={__name:"Index",props:{templates:Array},setup(b){const g=(i,s)=>i?s?{class:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",text:"Personalizada"}:{class:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",text:"Por defecto"}:{class:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-400",text:"Desactivada"};return(i,s)=>(o(),r(x,null,[n(u(f),{title:"Plantillas de Email"}),n(h,null,{header:l(()=>[e("div",k,[s[1]||(s[1]=e("div",null,[e("h2",{class:"text-xl font-semibold leading-tight text-gray-800 dark:text-white"}," Plantillas de Email "),e("p",{class:"text-sm text-gray-500 dark:text-gray-400 mt-1"}," Personaliza los emails que se envían a tus clientes de tus planes ")],-1)),n(u(p),{href:i.route("coach.plans.index"),class:"inline-flex items-center px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 transition"},{default:l(()=>[...s[0]||(s[0]=[e("svg",{class:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 19l-7-7m0 0l7-7m-7 7h18"})],-1),d(" Volver a Mis Planes ",-1)])]),_:1},8,["href"])])]),default:l(()=>[e("div",v,[e("div",_,[e("div",w,[(o(!0),r(x,null,m(b.templates,t=>(o(),r("div",{key:t.type,class:"bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-md transition-shadow"},[e("div",C,[e("div",j,[e("div",z,[e("span",B,a(t.type==="purchase_confirmed"?"✅":t.type==="purchase_pending"?"🛒":t.type==="payment_reminder"?"⏰":t.type==="plan_expiring"?"⚠️":t.type==="plan_expired"?"📅":"🔒"),1),e("h3",P,a(t.name),1)]),e("span",{class:y(["px-2 py-1 text-xs font-medium rounded-full",g(t.is_active,t.is_custom).class])},a(g(t.is_active,t.is_custom).text),3)]),e("p",M,a(t.description),1),e("div",E,[s[2]||(s[2]=e("p",{class:"text-xs text-gray-500 dark:text-gray-400 mb-1"},"Asunto:",-1)),e("p",L,a(t.subject),1)]),e("div",V,[(o(!0),r(x,null,m(t.variables,c=>(o(),r("span",{key:c,class:"px-2 py-0.5 text-xs bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400 rounded"},[e("span",{textContent:a("{{"+c+"}}")},null,8,N)]))),128))]),n(u(p),{href:i.route("coach.email-templates.edit",t.type),class:"inline-flex items-center justify-center w-full px-4 py-2 bg-indigo-600 hover:bg-indigo-700 text-white text-sm font-medium rounded-lg transition"},{default:l(()=>[...s[3]||(s[3]=[e("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1),d(" Editar Plantilla ",-1)])]),_:1},8,["href"])])]))),128))]),s[4]||(s[4]=e("div",{class:"mt-8 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-xl p-6"},[e("div",{class:"flex items-start gap-4"},[e("div",{class:"flex-shrink-0"},[e("svg",{class:"w-6 h-6 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])]),e("div",null,[e("h4",{class:"text-sm font-semibold text-blue-800 dark:text-blue-300 mb-1"}," ¿Cómo funcionan las plantillas? "),e("p",{class:"text-sm text-blue-700 dark:text-blue-400"},[d(" Las plantillas personalizadas se utilizan para los emails automáticos enviados a los compradores de tus planes. Usa las variables disponibles (ej: "),e("code",{class:"bg-blue-100 dark:bg-blue-800 px-1 rounded",textContent:"{{buyer_name}}"}),d(") para incluir información dinámica en tus mensajes. ")])])])],-1))])])]),_:1})],64))}};export{T as default};
