import{C as e,D as t,F as n,I as r,Q as i,S as a,U as o,Y as s,_ as c,a as l,b as u,et as d,g as f,i as p,l as m}from"./app-Cer3VJhT.js";import{t as h}from"./i18n-Hs3zKI4v.js";var g={class:`text-lg font-medium text-ink`},_={class:`mt-1 text-sm text-ink-2`},v={class:`grid grid-cols-[1fr_4rem_4rem] items-center gap-y-3`},y={class:`text-center text-xs font-semibold uppercase tracking-wide text-ink-muted`},b={class:`text-center text-xs font-semibold uppercase tracking-wide text-ink-muted`},x={class:`border-t border-line py-2.5 text-sm text-ink-2`},S={class:`flex justify-center border-t border-line py-2.5`},C=[`onUpdate:modelValue`],w={class:`flex justify-center border-t border-line py-2.5`},T=[`onUpdate:modelValue`],E={class:`mt-5 flex items-center gap-3`},D=[`disabled`],O={key:0,class:`text-sm text-emerald-500`},k=t({__name:`NotificationPreferencesForm`,setup(t){let d=l().props.notificationPrefs??{},k=[{key:`reply`,label:h(`Replies to your topics & posts`)},{key:`mention`,label:h(`Mentions (@you)`)},{key:`message`,label:h(`Direct messages`)},{key:`reaction`,label:h(`Reactions to your posts`)},{key:`wall`,label:h(`Posts on your profile`)},{key:`badge`,label:h(`Badges you earn`)}],A={};for(let e of k)A[e.key]={email:!!d[e.key]?.email,push:d[e.key]?.push??!0};let j=p({prefs:A});function M(){j.post(`/notifications/channel-prefs`,{preserveScroll:!0})}return(t,l)=>(n(),e(`section`,null,[u(`header`,null,[u(`h2`,g,i(s(h)(`Notifications`)),1),u(`p`,_,i(s(h)(`Choose what you get notified about, and how. In-app alerts (the bell) are always on.`)),1)]),u(`form`,{class:`mt-6`,onSubmit:f(M,[`prevent`])},[u(`div`,v,[l[0]||=u(`span`,null,null,-1),u(`span`,y,i(s(h)(`Email`)),1),u(`span`,b,i(s(h)(`Push`)),1),(n(),e(c,null,r(k,t=>(n(),e(c,{key:t.key},[u(`span`,x,i(t.label),1),u(`label`,S,[o(u(`input`,{"onUpdate:modelValue":e=>s(j).prefs[t.key].email=e,type:`checkbox`,class:`h-4 w-4 rounded border-line bg-appbg text-primary focus:ring-primary`},null,8,C),[[m,s(j).prefs[t.key].email]])]),u(`label`,w,[o(u(`input`,{"onUpdate:modelValue":e=>s(j).prefs[t.key].push=e,type:`checkbox`,class:`h-4 w-4 rounded border-line bg-appbg text-primary focus:ring-primary`},null,8,T),[[m,s(j).prefs[t.key].push]])])],64))),64))]),u(`div`,E,[u(`button`,{type:`submit`,disabled:s(j).processing,class:`rounded-lg bg-primary px-4 py-2 text-sm font-semibold text-white hover:bg-primary-600 disabled:opacity-60`},i(s(h)(`Save preferences`)),9,D),s(j).recentlySuccessful?(n(),e(`span`,O,i(s(h)(`Saved.`)),1)):a(``,!0)])],32)]))}}),A=d({default:()=>j}),j=k;export{A as n,j as t};