PageSourceSearch

https://app.memberstack.com/assets/index-D0oVDanv.js

js memberstack.com collected 2026-09-24 17:16:46 UTC 9,689 bytes, 22 lines download raw bytes

1import{q as w,k as g,t as C,j as e,r as m,L as h}from"./vendor-CSdFbWfl.js";import{k as p,S as x,G as T,aJ as E,aK as G,aL as M,h as b,aM as A,b as k,aN as d}from"./index-BynWLX9U.js";import{S as D}from"./Select-tnTVfiMN.js";import{T as R}from"./Textarea-DLTpr-0A.js";import{u as W}from"./UnsavedChangesContext.hooks-C5QFZMTO.js";import"./react-select.esm-DP0yNhqo.js";import"./objectWithoutPropertiesLoose-ECer6yPr.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"5fdab7154cbea903e2531547e54739370b469773"};var t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="fdd5a5ce-bbe3-4218-b8a1-ebdb9ee7c2d6",s._sentryDebugIdIdentifier="sentry-dbid-fdd5a5ce-bbe3-4218-b8a1-ebdb9ee7c2d6")}catch{}})();const U=g`
2    mutation UpdateGlobalCommentSettings($input: UpdateGlobalCommentSettingsInput!) {
3  updateGlobalCommentSettings(input: $input) {
4    moderateAllComments
5    moderateNewMembers
6    restrictedWords
7    useDefaultRestrictedWords
8  }
9}
10    `;function V(s){return w(U,s)}const L=g`
11    query GetCommentSettings {
12  getGlobalCommentSettings {
13    moderateAllComments
14    moderateNewMembers
15    restrictedWords
16    useDefaultRestrictedWords
17    aiModerationEnabled
18    communityDescription
19    aiSpamThreshold
20  }
21}
22    `;function _(s){return C(L,s)}const f=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),j=(s,t)=>{if(Object.keys(s).length!==Object.keys(t).length)return!0;for(const l in s){const r=s[l],o=t[l],i=f(r)&&f(o);if(i&&!j(r,o)||!i&&r!==o)return!0}return!1},q=()=>e.jsxs("div",{className:"w-full flex flex-col overflow-auto",children:[e.jsxs("div",{className:"flex justify-between items-center p-5",children:[e.jsx("h4",{className:"text-base",children:"General Settings"}),e.jsx(p,{disabled:!0,children:"Save"})]}),e.jsx("div",{className:"overflow-auto",children:e.jsxs("div",{className:"p-7 bg-gray-50 flex flex-col gap-4 border-b",children:[e.jsx(x,{height:144}),e.jsx(x,{height:358}),e.jsx(x,{height:144})]})})]}),c=[{label:"Most strict - A Spam free community.",value:4},{label:"Default - Reduce moderation time.",value:6},{label:"Least strict - Give commenters the benefit of the doubt.",value:9}],u=({title:s,description:t,children:l,className:r})=>e.jsxs(k,{className:b("p-5",r),hideShadow:!1,hideBorder:!1,children:[s&&e.jsx("p",{className:"text-[14px] leading-6 font-bold",children:s}),t&&e.jsx("p",{className:"text-[14px] leading-6 text-muted-foreground",children:t}),e.jsx("div",{className:"flex flex-col gap-1.5 mt-4",children:l})]}),B=({settings:s})=>{const[t,l]=m.useState({...s}),{createToastAlert:r}=T(),{setHasUnsavedChanges:o}=W(),i=m.useMemo(()=>j(s||{},t||{}),[t,s]);m.useEffect(()=>(o(i),()=>o(!1)),[i]);const[y,{loading:N}]=V({variables:{input:{...t}},update(a,{data:n}){a.modify({fields:{getGlobalCommentSettings(){return n==null?void 0:n.updateGlobalCommentSettings}}})},onCompleted(){r({alertType:"success",message:"Settings updated successfully."})},onError(){r({alertType:"error",message:"Unable to update settings. Please try again."})}}),v=async()=>{r({alertType:"processing"}),await y()},S=m.useMemo(()=>t.aiSpamThreshold&&t.aiSpamThreshold>=1&&t.aiSpamThreshold<=5?c[0]:t.aiSpamThreshold&&t.aiSpamThreshold>=6&&t.aiSpamThreshold<=8?c[1]:t.aiSpamThreshold&&t.aiSpamThreshold>=9&&t.aiSpamThreshold<=10?c[2]:c[1],[t.aiSpamThreshold]);return e.jsxs("form",{className:"w-full flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex justify-between items-center p-5 border-b border-border",children:[e.jsx("h4",{className:"text-base",children:"General Settings"}),e.jsx(p,{isLoading:N,onClick:v,disabled:!i,children:"Save"})]}),e.jsxs("div",{className:"flex-1 overflow-auto p-7 bg-muted border-b border-border",children:[e.jsx(u,{title:"Content Approval",description:"Choose how and when you want to publish end-user content.",children:e.jsx(E,{id:"moderateAllComments",label:"Hold all comments for review",checked:t.moderateAllComments,onChange:a=>{var n;l({...t,moderateAllComments:(n=a==null?void 0:a.target)==null?void 0:n.checked})}})}),e.jsxs(u,{className:"mt-4",title:"Restricted Words & Phrases",description:e.jsxs(e.Fragment,{children:["Comments with restricted words will be flagged for moderation."," ",e.jsx(h,{className:"underline text-primary",rel:"noreferrer",to:"https://docs.memberstack.com/hc/en-us/articles/20269774291227-Restricted-Words-and-Phrases-Commenting",children:"Learn more."})]}),children:[e.jsx(G,{name:"words",label:"",onChange:a=>{l({...t,useDefaultRestrictedWords:a==="on"})},selectedValue:t.useDefaultRestrictedWords?"on":"off",labelClassName:"font-bold",options:[{label:"Use default restricted words",value:"on",description:e.jsxs(e.Fragment,{children:["Use default restricted words. ",e.jsx(h,{className:"text-primary",rel:"noreferrer",to:"https://docs.memberstack.com/hc/en-us/articles/20269774291227",target:"_blank",children:"View words"})]})},{label:"Use your own restricted words",value:"off",description:"Enter a comma separated list of your own words."}]}),!t.useDefaultRestrictedWords&&e.jsxs("div",{className:"mt-4",children:[e.jsx(R,{placeholder:"Enter words or phrases",rows:4,value:t.restrictedWords||"",onChange:a=>{var n;l({...t,restrictedWords:(n=a==null?void 0:a.target)==null?void 0:n.value})}}),e.jsxs("p",{className:"text-[14px] leading-6 text-muted-foreground",children:["Enter as a comma separated list. Does not include"," ",e.jsx(h,{className:"text-primary",target:"_blank",rel:"noreferrer",to:"https://docs.memberstack.com/hc/en-us/articles/20269774291227",children:"default words"}),"."]})]})]}),e.jsxs(u,{className:"mt-4 overflow-visible",title:"Filter Spam",children:[e.jsx(M,{className:"mb-2.5 -z-10",label:"Enable Al Moderation",id:"aiModerationEnabled",isChecked:t.aiModerationEnabled||!1,onChange:a=>{l({...t,aiModerationEnabled:a})},description:e.jsx("div",{className:b("cursor-default text-grey600 opacity-100 mb-1 translate-y-[1px] h-full text-utility-tag-md"),children:"By default, we run all new comments through an Al spam filter."})}),e.jsx("div",{className:"text-[14px] leading-6",children:"What is your top priority when it comes to spam filtering?"}),e.jsxs("div",{children:[e.jsx(A,{text:"Sensitivity"}),e.jsx(D,{id:"aiSpamThreshold",options:c,value:S,onChange:a=>{l({...t,aiSpamThreshold:a==null?void 0:a.value})},menuPlacement:"top"})]})]})]})]})},K=()=>{const{loading:s,data:t,error:l}=_();if(s)return e.jsx(q,{});if(l)return e.jsx("div",{children:l.message});if(!(t!=null&&t.getGlobalCommentSettings))return null;const{__typename:r,...o}=t.getGlobalCommentSettings;return e.jsx(B,{settings:o})},Y=()=>e.jsx("div",{children:"Emails"}),I=[{name:"Duncan Hamra",value:"all-message"},{name:"Tyler Bell",value:"all-message"},{name:"Josh Lopez",value:"all-message"}],F=[{name:"Member",value:"all-message"},{name:"Moderator",value:"all-message"}],X=()=>e.jsxs("div",{className:"w-full flex flex-col",children:[e.jsxs("div",{className:"flex justify-between items-center p-5 border-b",children:[e.jsx("h4",{className:"text-base",children:"Notifications"}),e.jsx(p,{children:"Save"})]}),e.jsxs("div",{className:"p-7 border-b",children:[e.jsx("h3",{className:"text-h3 font-bold mb-2",children:"Admin Notifications"}),e.jsx("p",{className:"text-[14px] leading-6 text-app-gray600 mb-7",children:"Choose if and when admin should receive content notifications."}),e.jsxs("table",{className:"",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-[14px] leading-6 font-bold py-2 px-4",align:"left",children:"Admin"}),e.jsx("th",{className:"text-[14px] leading-6 font-bold py-2 px-4",align:"left",children:"All Messages"}),e.jsx("th",{className:"text-[14px] leading-6 font-bold py-2 px-4",align:"left",children:"Requires Moderation"}),e.jsx("th",{className:"text-[14px] leading-6 font-bold py-2 px-4",align:"left",children:"Nothing"})]})}),e.jsx("tbody",{children:I.map(({name:s,value:t})=>e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"text-[14px] leading-6 p-4",align:"left",children:s}),e.jsx("td",{align:"center",children:e.jsx(d,{name:s,value:"all-message",selectedValue:t})}),e.jsx("td",{align:"center",children:e.jsx(d,{name:s,value:"require-moderation",selectedValue:t})}),e.jsx("td",{align:"center",children:e.jsx(d,{name:s,value:"nothing",selectedValue:t})})]},s))})]})]}),e.jsxs("div",{className:"p-7",children:[e.jsx("h3",{className:"text-h3 font-bold mb-2",children:"Member Notifications"}),e.jsx("p",{className:"text-[14px] leading-6 text-app-gray600 mb-7",children:"Choose if and when members should receive content notifications."}),e.jsxs("table",{className:"",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-[14px] leading-6 font-bold py-2 px-4",align:"left",children:"Admin"}),e.jsx("th",{className:"text-[14px] leading-6 font-bold py-2 px-4",align:"left",children:"All Messages"}),e.jsx("th",{className:"text-[14px] leading-6 font-bold py-2 px-4",align:"left",children:"Requires Moderation"}),e.jsx("th",{className:"text-[14px] leading-6 font-bold py-2 px-4",align:"left",children:"Nothing"})]})}),e.jsx("tbody",{children:F.map(({name:s,value:t})=>e.jsxs("tr",{className:"border-b",children:[e.jsx("td",{className:"text-[14px] leading-6 p-4",align:"left",children:s}),e.jsx("td",{align:"center",children:e.jsx(d,{name:s,value:"all-message",selectedValue:t})}),e.jsx("td",{align:"center",children:e.jsx(d,{name:s,value:"require-moderation",selectedValue:t})}),e.jsx("td",{align:"center",children:e.jsx(d,{name:s,value:"nothing",selectedValue:t})})]},s))})]})]})]});
22export{Y as Emails,K as General,X as Notifications};

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.