1import{j as e,r as o}from"./index-grvql_R-.js";import{C as j}from"./card-CNOdyeQo.js";import{B as g}from"./button-BEEYPiu6.js";import{I as S}from"./input-BmdUR_ho.js";import{L as h}from"./label-GTUQNhw4.js";import{T as k,a as z,b as C,c as E}from"./tabs-m1ZDDarp.js";import{t as u}from"./index-CFb8R-Fe.js";import{R as I}from"./RichTextEditor-BdmxALcT.js";import{c as v,S as _}from"./siteContent-CjQuT1Mi.js";import{s as N}from"./siteContent.functions-2_4zofeU.js";import{I as L,S as b}from"./ImageInput-C_wUNigL.js";import{a as P}from"./aficion-maloste-a2deQUnR.js";import{U}from"./user-plus-B_TyF2_K.js";import{L as y}from"./loader-circle-tXM_jetd.js";import"./utils-BQHNewu7.js";import"./index-Brf2SyxW.js";import"./index-pbkyVucM.js";import"./index-B7MjU4JX.js";import"./imageCompress-BnBk1rWT.js";import"./createLucideIcon-D-ObpEcT.js";import"./ImageAdjustDialog-DediGaSq.js";import"./dialog-C_0u_R25.js";import"./x-DeBkt7rZ.js";import"./index-CMR369WY.js";import"./AdjustableImg-FaM7naSa.js";import"./upload-CKGhMmOB.js";function ne(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"h-12 w-12 rounded-xl admin-icon-box flex items-center justify-center",children:e.jsx(U,{className:"h-6 w-6"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Hazte Socio"}),e.jsxs("p",{className:"text-muted-foreground mt-1",children:["Edita el texto de la página ",e.jsx("code",{className:"text-xs",children:"/hazte-socio"}),". Los cambios se publican al instante."]})]})]}),e.jsx(G,{}),e.jsxs(k,{defaultValue:"es",className:"w-full",children:[e.jsxs(z,{children:[e.jsx(C,{value:"es",children:"Castellano"}),e.jsx(C,{value:"eu",children:"Euskera"})]}),e.jsx(E,{value:"es",className:"mt-6",children:e.jsx(T,{lang:"es"})}),e.jsx(E,{value:"eu",className:"mt-6",children:e.jsx(T,{lang:"eu"})})]})]})}function G(){const a=v("hazte_socio_image"),[s,t]=o.useState(a),[r,c]=o.useState(!1),i=N;o.useEffect(()=>t(a),[a]);async function l(){c(!0);try{await i({data:{key:"hazte_socio_image",value:{value:s}}}),u.success("Imagen guardada")}catch(p){u.error("No se pudo guardar",{description:p.message})}finally{c(!1)}}return e.jsxs(j,{className:"p-6 space-y-3",children:[e.jsx(h,{children:"Imagen de cabecera"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Foto que aparece arriba del todo en la página /hazte-socio. Si se deja vacÃa, se usa la imagen por defecto."}),e.jsx(L,{hero:!0,label:"Foto de cabecera",value:s,onChange:t,fallbackPreview:P}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(g,{onClick:l,disabled:r,className:"gap-2",children:[r?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(b,{className:"h-4 w-4"}),"Guardar imagen"]})})]})}function T({lang:a}){const s=a==="es"?"hazte_socio_html_es":"hazte_socio_html_eu",t=v(s),[r,c]=o.useState(t||_[s]),[i,l]=o.useState(!1),p=N;o.useEffect(()=>{c(t||_[s])},[t,s]);async function x(){l(!0);try{await p({data:{key:s,value:{value:r}}}),u.success("Guardado")}catch(f){u.error("No se pudo guardar",{description:f.message})}finally{l(!1)}}return e.jsxs("div",{className:"space-y-4",children:[e.jsxs(j,{className:"p-6 space-y-3",children:[e.jsxs(h,{children:["Texto (",a==="es"?"Castellano":"Euskera",")"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Usa la barra de herramientas para negritas, alineación, color, tabulación, listas, enlaces, etc. Los párrafos se separan con la tecla Enter."}),e.jsx(I,{value:r,onChange:c}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(g,{onClick:x,disabled:i,className:"gap-2",children:[i?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(b,{className:"h-4 w-4"}),"Guardar"]})})]}),e.jsx(H,{lang:a})]})}function H({lang:a}){const s=a==="es"?"hazte_socio_precios_es":"hazte_socio_precios_eu",t=v(s),[r,c]=o.useState(t),[i,l]=o.useState(!1),p=N;o.useEffect(()=>c(t),[t]);const x=(n,d)=>c(r.map((m,w)=>w===n?{...m,...d}:m));async function f(){l(!0);try{await p({data:{key:s,value:r}}),u.success("Precios guardados")}catch(n){u.error("No se pudo guardar",{description:n.message})}finally{l(!1)}}return e.jsxs(j,{className:"p-6 space-y-3",children:[e.jsxs(h,{children:["Cuotas (",a==="es"?"Castellano":"Euskera",")"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Edita el nombre y el precio de cada tipo de abono. Se muestran en el recuadro de cuotas de la página."}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:r.map((n,d)=>e.jsxs("div",{className:"rounded-lg border p-3 space-y-2 bg-muted/20",children:[e.jsxs(h,{className:"text-xs",children:["Tipo #",d+1]}),e.jsx(S,{placeholder:"Nombre",value:n.label,onChange:m=>x(d,{label:m.target.value})}),e.jsx(S,{placeholder:"165 â¬",value:n.price,onChange:m=>x(d,{price:m.target.value})})]},d))}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(g,{onClick:f,disabled:i,className:"gap-2",children:[i?e.jsx(y,{className:"h-4 w-4 animate-spin"}):e.jsx(b,{className:"h-4 w-4"}),"Guardar cuotas"]})})]})}export{ne as component};
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.