import{n as e}from"./chunk-QTnfLwEv.js";import{$ as t,C as n,D as r,E as i,I as a,L as o,O as s,U as c,W as l,X as u,Z as d,_ as f,a as p,f as m,o as h,s as g,u as _,v,w as y,x as b}from"./app-C9PSrpEH.js";import{t as x}from"./i18n-CAfzuMJO.js";import{t as S}from"./InputLabel-hF3hjSXv.js";import{t as C}from"./PrimaryButton-DWLQALBq.js";var w={class:`text-lg font-medium text-gray-900 dark:text-gray-100`},T={class:`mt-1 text-sm text-gray-600 dark:text-gray-400`},E={class:`mt-2 space-y-2`},D=[`value`],O={class:`block text-sm font-medium text-gray-900 dark:text-gray-100`},k={class:`block text-sm text-gray-500 dark:text-gray-400`},A={class:`flex cursor-pointer items-start gap-3 rounded-lg border border-gray-200 p-3 dark:border-gray-700`},j={class:`block text-sm font-medium text-gray-900 dark:text-gray-100`},M={class:`block text-sm text-gray-500 dark:text-gray-400`},N={class:`flex items-center gap-4`},P={key:0,class:`text-sm text-gray-600 dark:text-gray-400`},F=s({__name:`DigestPreferenceForm`,setup(e){let s=h().props.auth?.user??{},F=p({digest_frequency:s.digest_frequency??`weekly`,notify_email:s.notify_email??!0}),I=[{value:`off`,label:x(`Off`),hint:x(`No digest emails.`)},{value:`daily`,label:x(`Daily`),hint:x(`A summary every morning.`)},{value:`weekly`,label:x(`Weekly`),hint:x(`A summary once a week.`)}];function L(){F.post(route(`notifications.preferences`),{preserveScroll:!0})}return(e,s)=>(a(),y(`section`,null,[b(`header`,null,[b(`h2`,w,t(u(x)(`Email digest`)),1),b(`p`,T,t(u(x)(`Choose how often we email you a summary of new topics and unread notifications.`)),1)]),b(`form`,{class:`mt-6 space-y-6`,onSubmit:f(L,[`prevent`])},[b(`div`,null,[r(S,{value:u(x)(`Frequency`)},null,8,[`value`]),b(`div`,E,[(a(),y(v,null,o(I,e=>b(`label`,{key:e.value,class:d([`flex cursor-pointer items-start gap-3 rounded-lg border border-gray-200 p-3 dark:border-gray-700`,u(F).digest_frequency===e.value?`border-indigo-500 ring-1 ring-indigo-500`:``])},[l(b(`input`,{type:`radio`,class:`mt-0.5 text-indigo-600 focus:ring-indigo-500`,value:e.value,"onUpdate:modelValue":s[0]||=e=>u(F).digest_frequency=e},null,8,D),[[m,u(F).digest_frequency]]),b(`span`,null,[b(`span`,O,t(e.label),1),b(`span`,k,t(e.hint),1)])],2)),64))])]),b(`label`,A,[l(b(`input`,{type:`checkbox`,class:`mt-0.5 rounded text-indigo-600 focus:ring-indigo-500`,"onUpdate:modelValue":s[1]||=e=>u(F).notify_email=e},null,512),[[_,u(F).notify_email]]),b(`span`,null,[b(`span`,j,t(u(x)(`Instant email notifications`)),1),b(`span`,M,t(u(x)(`Email me when someone replies to me, mentions me, posts on my profile, or sends a message.`)),1)])]),b(`div`,N,[r(C,{disabled:u(F).processing},{default:c(()=>[i(t(u(x)(`Save`)),1)]),_:1},8,[`disabled`]),r(g,{"enter-active-class":`transition ease-in-out`,"enter-from-class":`opacity-0`,"leave-active-class":`transition ease-in-out`,"leave-to-class":`opacity-0`},{default:c(()=>[u(F).recentlySuccessful?(a(),y(`p`,P,t(u(x)(`Saved.`)),1)):n(``,!0)]),_:1})])],32)]))}}),I=e({default:()=>L}),L=F;export{I as n,L as t};