import{n as e}from"./chunk-QTnfLwEv.js";import{C as t,D as n,E as r,G as i,L as a,Q as o,R as s,W as c,Z as l,_ as u,a as d,et as f,f as p,k as m,o as h,s as g,u as _,v,w as y,x as b}from"./app-LqeFiKko.js";import{t as x}from"./i18n-DC0l5-9S.js";import{t as S}from"./InputLabel-BOM7IJkF.js";import{t as C}from"./PrimaryButton-Dxl394fN.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=m({__name:`DigestPreferenceForm`,setup(e){let m=h().props.auth?.user??{},F=d({digest_frequency:m.digest_frequency??`weekly`,notify_email:m.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,d)=>(a(),y(`section`,null,[b(`header`,null,[b(`h2`,w,f(l(x)(`Email digest`)),1),b(`p`,T,f(l(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:u(L,[`prevent`])},[b(`div`,null,[n(S,{value:l(x)(`Frequency`)},null,8,[`value`]),b(`div`,E,[(a(),y(v,null,s(I,e=>b(`label`,{key:e.value,class:o([`flex cursor-pointer items-start gap-3 rounded-lg border border-gray-200 p-3 dark:border-gray-700`,l(F).digest_frequency===e.value?`border-indigo-500 ring-1 ring-indigo-500`:``])},[i(b(`input`,{type:`radio`,class:`mt-0.5 text-indigo-600 focus:ring-indigo-500`,value:e.value,"onUpdate:modelValue":d[0]||=e=>l(F).digest_frequency=e},null,8,D),[[p,l(F).digest_frequency]]),b(`span`,null,[b(`span`,O,f(e.label),1),b(`span`,k,f(e.hint),1)])],2)),64))])]),b(`label`,A,[i(b(`input`,{type:`checkbox`,class:`mt-0.5 rounded text-indigo-600 focus:ring-indigo-500`,"onUpdate:modelValue":d[1]||=e=>l(F).notify_email=e},null,512),[[_,l(F).notify_email]]),b(`span`,null,[b(`span`,j,f(l(x)(`Instant email notifications`)),1),b(`span`,M,f(l(x)(`Email me when someone replies to me, mentions me, posts on my profile, or sends a message.`)),1)])]),b(`div`,N,[n(C,{disabled:l(F).processing},{default:c(()=>[r(f(l(x)(`Save`)),1)]),_:1},8,[`disabled`]),n(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(()=>[l(F).recentlySuccessful?(a(),y(`p`,P,f(l(x)(`Saved.`)),1)):t(``,!0)]),_:1})])],32)]))}}),I=e({default:()=>L}),L=F;export{I as n,L as t};