1import{j as e,r as i,u as j,a5 as v}from"./vendor-CSdFbWfl.js";import{N as w,G as C,fx as S,cx as A,b as N,S as y,aL as x,fy as T,fz as M,k}from"./index-BynWLX9U.js";import{u as P}from"./index-DmNgRvHo.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"5fdab7154cbea903e2531547e54739370b469773"};var l=new a.Error().stack;l&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[l]="be84439c-b847-457b-9e56-5df28619d672",a._sentryDebugIdIdentifier="sentry-dbid-be84439c-b847-457b-9e56-5df28619d672")}catch{}})();const R=[{key:"member.created",label:"New member signup",description:"Email me whenever someone creates an account."},{key:"member.plan.added",label:"New paid signup",description:"Email me when a member starts a paid plan."}],z=()=>{const{appData:a,isLoading:l}=w(),{createToastAlert:n}=C(),[d,{loading:h}]=S(),[r,{loading:u}]=A(),f=h||u,m=a==null?void 0:a.emailNotificationPrefs,g=m&&typeof m=="object"&&!Array.isArray(m)?m:{},b=()=>n({message:"Failed to update email notifications",alertType:"error"}),c=async(s,o)=>{try{await d({variables:{prefs:{...g,[s]:o}}})}catch{b()}},p=async(s,o)=>{try{await r({variables:{input:{[s]:o}}})}catch{b()}};return e.jsxs(N,{className:"p-4 flex items-start gap-6",children:[e.jsx("div",{className:"w-custom-250 shrink-0",children:e.jsx("h1",{className:"font-bold text-base",children:"Email notifications"})}),e.jsxs("div",{className:"flex flex-1 flex-col items-start gap-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Choose which emails you'd like to receive about this app. These settings only affect you, not your teammates."}),l?e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[e.jsx(y,{width:444,height:45}),e.jsx(y,{width:444,height:45}),e.jsx(y,{width:444,height:45}),e.jsx(y,{width:444,height:45})]}):e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[R.map(s=>e.jsx(x,{id:`email-${s.key}`,name:`email-${s.key}`,dataCy:`email-${s.key}`,labelClassName:"font-bold",label:s.label,description:s.description,isChecked:!!g[s.key],disabled:f,onChange:o=>c(s.key,o)},s.key)),e.jsx(x,{id:"weeklyRoundupEmailEnabled",name:"weeklyRoundupEmailEnabled",dataCy:"weeklyRoundupEmailEnabled",labelClassName:"font-bold",label:"Weekly new member roundup",description:"A weekly summary email of your new members.",isChecked:!!(a!=null&&a.weeklyRoundupEmailEnabled),disabled:f,onChange:s=>p("weeklyRoundupEmailEnabled",s)}),e.jsx(x,{id:"dailyCommentingEmailEnabled",name:"dailyCommentingEmailEnabled",dataCy:"dailyCommentingEmailEnabled",labelClassName:"font-bold",label:"Daily comment summary",description:"A daily summary email of new comments.",isChecked:!!(a!=null&&a.dailyCommentingEmailEnabled),disabled:f,onChange:s=>p("dailyCommentingEmailEnabled",s)})]})]})]})},L=({title:a,titleId:l,...n},d)=>i.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 127 127","aria-hidden":"true",ref:d,"aria-labelledby":l,...n},a?i.createElement("title",{id:l},a):null,i.createElement("path",{d:"M27.2 80c0 7.3-5.9 13.2-13.2 13.2C6.7 93.2.8 87.3.8 80c0-7.3 5.9-13.2 13.2-13.2h13.2V80z",fill:"#E01E5A"}),i.createElement("path",{d:"M33.8 80c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2v33c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V80z",fill:"#E01E5A"}),i.createElement("path",{d:"M47 27c-7.3 0-13.2-5.9-13.2-13.2C33.8 6.5 39.7.6 47 .6c7.3 0 13.2 5.9 13.2 13.2V27H47z",fill:"#36C5F0"}),i.createElement("path",{d:"M47 33.7c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H14c-7.3 0-13.2-5.9-13.2-13.2 0-7.3 5.9-13.2 13.2-13.2h33z",fill:"#36C5F0"}),i.createElement("path",{d:"M99.9 46.9c0-7.3 5.9-13.2 13.2-13.2 7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H99.9V46.9z",fill:"#2EB67D"}),i.createElement("path",{d:"M93.2 46.9c0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V13.8C66.8 6.5 72.7.6 80 .6c7.3 0 13.2 5.9 13.2 13.2v33.1z",fill:"#2EB67D"}),i.createElement("path",{d:"M80 99.8c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2-7.3 0-13.2-5.9-13.2-13.2V99.8H80z",fill:"#ECB22E"}),i.createElement("path",{d:"M80 93.2c-7.3 0-13.2-5.9-13.2-13.2 0-7.3 5.9-13.2 13.2-13.2h33.1c7.3 0 13.2 5.9 13.2 13.2 0 7.3-5.9 13.2-13.2 13.2H80z",fill:"#ECB22E"})),V=i.forwardRef(L),F=[{key:"member.created",label:"New member signup",description:"Get a ping whenever someone creates an account."},{key:"member.plan.added",label:"New paid signup",description:"Get a ping when a member starts a paid plan."}],I=()=>{const{appData:a,refetch:l}=w(),{createToastAlert:n}=C(),{startConnect:d,starting:h}=P(),r=j(),u=v(),[f,{loading:m}]=T(),[g,{loading:b}]=M(),c=a==null?void 0:a.slackIntegration,p=(c==null?void 0:c.notificationPrefs)??{};i.useEffect(()=>{const t=r.state;t!=null&&t.slackConnected&&(l(),n({message:"Slack connected successfully",alertType:"success"}),u(r.pathname,{replace:!0,state:null}))},[r.state,r.pathname,u,l,n]);const s=async(t,E)=>{try{await g({variables:{input:{notificationPrefs:{...p,[t]:E}}}}),await l()}catch{n({message:"Failed to update Slack notifications",alertType:"error"})}},o=async()=>{try{await f(),await l(),n({message:"Disconnected from Slack",alertType:"success"})}catch{n({message:"Failed to disconnect Slack",alertType:"error"})}};return e.jsxs(N,{className:"p-4 flex items-start gap-6",children:[e.jsxs("div",{className:"w-custom-250 flex items-center gap-2 shrink-0",children:[e.jsx(V,{className:"w-5 h-5"}),e.jsx("h1",{className:"font-bold text-base",children:"Slack Notifications"})]}),e.jsx("div",{className:"flex flex-1 flex-col items-start gap-4",children:c?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm",children:["Posting to"," ",e.jsx("span",{className:"font-bold",children:c.channelName})," in"," ",c.teamName]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(k,{variant:"outline",onClick:()=>void d(),isLoading:h,children:"Change channel"}),e.jsx(k,{variant:"outline",onClick:o,isLoading:m,children:"Disconnect"})]})]}),e.jsx("div",{className:"flex w-full flex-col gap-4",children:F.map(t=>e.jsx(x,{id:`slack-${t.key}`,name:`slack-${t.key}`,dataCy:`slack-${t.key}`,labelClassName:"font-bold",label:t.label,description:t.description,isChecked:!!p[t.key],disabled:b,onChange:E=>s(t.key,E)},t.key))})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Get a Slack message the moment a member signs up or a plan is added."}),e.jsx(k,{onClick:()=>void d(),isLoading:h,children:"Add to Slack"})]})})]})},$=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(z,{}),e.jsx(I,{})]});
1export{$ as default};
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.