1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1069],{95388:function(e,n,t){"use strict";t.d(n,{O:function(){return a}});var l=t(6993),r=t(17161),i=t(42035),a=function(e){var n=r.Children.toArray(e.children),t=(0,i.useRouter)(),a=n.map((function(e,r){var i,a,s=(null===(i=t.asPath)||void 0===i?void 0:i.split("?")[0])||"";return(0,l.jsx)("li",{className:s===e.props.href||e.props.defaultActive||e.props.defaultChecked?"active m-w-100":"",children:(null===n||void 0===n?void 0:n.length)-1!==r?e:(0,l.jsx)("span",{className:"ellipsis-inline",children:null===e||void 0===e||null===(a=e.props)||void 0===a?void 0:a.children})},r)}));return(0,l.jsx)("nav",{className:"breadcrumbs","aria-label":"breadcrumb",children:(0,l.jsx)("ol",{children:a})})}},15566:function(e,n,t){"use strict";t.d(n,{k:function(){return W}});var l,r,i=t(95911),a=t(28351),s=t(33803),o=t(16888),c=t(45885),d=t.n(c),u=t(6993),m=t(62417),v=t(23578),N=t(2039),f=t(4012),p=t(73702),T=t(17161),h=t(3516);function C(){return C=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var l in t)({}).hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},C.apply(null,arguments)}var O,x=function(e){return T.createElement("svg",C({width:20,height:20,fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=T.createElement("g",{clipPath:"url(#systems-question-line_svg__a)"},T.createElement("path",{d:"M10 18.334a8.333 8.333 0 1 1 0-16.667 8.333 8.333 0 0 1 0 16.667Zm0-1.667a6.667 6.667 0 1 0 0-13.333 6.667 6.667 0 0 0 0 13.333ZM9.165 12.5h1.667v1.667H9.166V12.5Zm1.667-1.37v.537H9.166v-1.25a.833.833 0 0 1 .833-.833 1.25 1.25 0 1 0-1.225-1.495L7.139 7.76a2.918 2.918 0 1 1 3.694 3.369Z",fill:"#D2AE38"}))),r||(r=T.createElement("defs",null,T.createElement("clipPath",{id:"systems-question-line_svg__a"},T.createElement("path",{fill:"#fff",d:"M0 0h20v20H0z"})))))},A=t(24639),E=t.n(A),_=t(93366),I=t(69188),g=t(10469),R=t(4725),j=t(8898),b=t(46179),L=t(85172),y=t(73870),w=t(8543),U=t(23478),Z=t(97031),D=t(62657),S=t(35928);!function(e){e.TYPE="type",e.SURNAME="surname",e.LOCATION="locationId",e.LOCATION_CATEGORY="locationCategoryId",e.TOWN="townId",e.CONTY="countyId",e.COUNTY_SIMPLE="countySimpleIdHelper",e.COUNTY_CHURCH="countyChurchIdHelper"}(O||(O={}));var H=t(94344),M=["Alerts.selectChurch","Alerts.selectDenomination","Alerts.selectActualChurch","Alerts.repeatChurch"],Y=["Alerts.countyTipOne","Alerts.countyTipTwo","Alerts.countyTipThree","Alerts.countyTipFour"],K=(0,T.forwardRef)((function(e,n){var t,l=(0,y.Z)("dashboard-alerts").t,r=(0,T.useState)(H.K.TOWN),i=r[0],a=r[1],s=(0,T.useState)(!1),o=s[0],c=s[1],d=(0,w.d)().width,C=function(){c(!1)};return(0,T.useImperativeHandle)(n,(function(){return{openTipsModal:function(e){c(!0),a(e)}}})),(0,u.jsx)(m.Z,{"aria-labelledby":"transition-modal-title","aria-describedby":"transition-modal-description",open:o,closeAfterTransition:!0,BackdropProps:{timeout:500},children:(0,u.jsx)(v.Z,{in:o,children:(0,u.jsxs)(N.Z,{className:"modal-content modal-content-default",children:[(0,u.jsx)(p.Z,{className:"icon-button",onClick:C,children:(0,u.jsx)(f.Z,{className:"close-icon"})}),(0,u.jsxs)("div",{className:"mb-6",children:[(0,u.jsx)("h3",{className:"h2 font-secondary primary-900 mb-2",children:null===e||void 0===e?void 0:e.title}),(0,u.jsxs)("div",{className:"text-16 grey-800",children:[i===H.K.CHURCH&&(0,u.jsx)("div",{children:l("Alerts.alertsDescription")}),(0,u.jsx)("ul",{children:null===(t=i===H.K.TOWN?Y:M)||void 0===t?void 0:t.map((function(e,n){return(0,u.jsxs)("li",{children:[(0,u.jsx)("span",{className:"primary-600 text-16",children:"\u2666\ufe0e"}),(0,u.jsx)("span",{className:"pl-1",children:l(e)})]},n)}))})]})]}),(0,u.jsx)("div",{className:"w-100",children:(0,u.jsx)("div",{className:"w-md-100 flex flex-wrap align-items-center justify-content-between",children:(0,u.jsx)(h.Z,{onClick:C,size:d>U.Z.TabletMax?"l":"m",className:"px-5",variant:"secondary-outline",disableRipple:!0,children:(0,u.jsx)("span",{className:"font-15 font-md-13",children:l("Alerts.close")})})})})]})})})})),F=t(73770),k=t(72800),P=t(88758),W=(0,T.forwardRef)((function(e,n){var t,l=(0,D.Uk)({}),r=(0,T.useState)(null),c=r[0],C=r[1],A=(0,S.useSession)().data,M=(0,y.Z)("dashboard-alerts").t,Y=(0,T.useState)(!1),W=Y[0],B=Y[1],V=(0,T.useState)(!1),G=V[0],z=V[1],q=(0,T.useState)(H.K.TOWN),Q=q[0],X=q[1],J=(0,T.useRef)(null),$=(0,T.useRef)(null),ee=(0,T.useRef)(null),ne=(0,T.useRef)(null),te=e.onUpdate,le=(0,T.useState)({open:!1,type:"error",text:"",vertical:"top",horizontal:"center"}),re=le[0],ie=le[1],ae=re.vertical,se=re.horizontal,oe=re.open,ce=(0,w.d)().width,de=(t={},(0,a.Z)(t,O.SURNAME,""),(0,a.Z)(t,O.LOCATION,null),(0,a.Z)(t,O.LOCATION_CATEGORY,null),(0,a.Z)(t,O.TOWN,null),(0,a.Z)(t,O.CONTY,null),(0,a.Z)(t,O.COUNTY_SIMPLE,null),(0,a.Z)(t,O.COUNTY_CHURCH,null),t),ue=(0,_.cI)({mode:"onChange",reValidateMode:"onChange",defaultValues:de}),me=ue.watch,ve=ue.control,Ne=ue.getValues,fe=(ue.handleSubmit,ue.reset),pe=ue.setValue,Te=me(O.COUNTY_SIMPLE),he=me(O.COUNTY_CHURCH),
1Ce=me(O.LOCATION_CATEGORY),Oe=function(){B(!1)},xe=function(){var e=(0,i.Z)(d().mark((function e(n,t){var r;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G){e.next=3;break}return e.abrupt("return");case 3:return z(!0),e.next=6,l.mutate({mutation:L.YMT,variables:{emailAlertId:null===t||void 0===t?void 0:t.id,input:n},context:{authToken:null===A||void 0===A||null===(r=A.user)||void 0===r?void 0:r.token}}).then((function(){fe(de),ie((0,s.Z)({},re,{open:!0,text:M("Alerts.updated"),type:"success"})),z(!1),te&&te(),Oe()})).catch((function(e){var n,t=M("Alerts.error"),l=null===e||void 0===e||null===(n=e.graphQLErrors)||void 0===n?void 0:n[0],r=l.errorCode;l.message;switch(r){case P.a.TOO_MUCH_ALERTS:t=M("Alerts.tooMuchAlerts");break;case P.a.VALIDATION_ERROR:t=M("Alerts.wrongData")}ie((0,s.Z)({},re,{open:!0,text:t,type:"error"})),z(!1)}));case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),Ae=function(){var e=(0,i.Z)(d().mark((function e(n){var t;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G){e.next=3;break}return e.abrupt("return");case 3:return z(!0),e.next=6,l.mutate({mutation:L.v1f,variables:{input:n},context:{authToken:null===A||void 0===A||null===(t=A.user)||void 0===t?void 0:t.token}}).then((function(){fe(de),ie((0,s.Z)({},re,{open:!0,text:M("Alerts.newCreated"),type:"success"})),z(!1),te&&te(),Oe()})).catch((function(e){var n,t=M("Alerts.error"),l=null===e||void 0===e||null===(n=e.graphQLErrors)||void 0===n?void 0:n[0],r=l.errorCode;l.message;switch(r){case P.a.TOO_MUCH_ALERTS:t=M("Alerts.tooMuchAlerts");break;case P.a.VALIDATION_ERROR:t=M("Alerts.wrongData")}ie((0,s.Z)({},re,{open:!0,text:t,type:"error"})),z(!1)}));case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,T.useEffect)((function(){Te&&$.current.getItems()}),[Te]),(0,T.useImperativeHandle)(n,(function(){return{openAlertModal:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;C(e),X((null===e||void 0===e?void 0:e.type)||H.K.TOWN),fe(de),B(!0),setTimeout((function(){if(e)switch(null===e||void 0===e?void 0:e.type){case H.K.TOWN:pe(O.SURNAME,(null===e||void 0===e?void 0:e.surname)||""),pe(O.COUNTY_SIMPLE,(null===e||void 0===e?void 0:e.county)||null),pe(O.TOWN,(null===e||void 0===e?void 0:e.town)||null),setTimeout((function(){var e;null===$||void 0===$||null===(e=$.current)||void 0===e||e.getItems()}),100);break;case H.K.CHURCH:pe(O.COUNTY_CHURCH,(null===e||void 0===e?void 0:e.county)||null),pe(O.LOCATION_CATEGORY,(null===e||void 0===e?void 0:e.locationCategory)||null),pe(O.LOCATION,(null===e||void 0===e?void 0:e.location)||null),setTimeout((function(){var e;null===ee||void 0===ee||null===(e=ee.current)||void 0===e||e.getItems()}),100)}}),100)}}})),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(m.Z,{"aria-labelledby":"transition-modal-title","aria-describedby":"transition-modal-description",open:W,closeAfterTransition:!0,BackdropProps:{timeout:500},children:(0,u.jsx)(v.Z,{in:W,children:(0,u.jsxs)(N.Z,{className:"modal-content modal-content-default",children:[(0,u.jsx)(p.Z,{className:"icon-button",onClick:Oe,children:(0,u.jsx)(f.Z,{className:"close-icon"})}),(0,u.jsxs)("div",{children:[(0,u.jsx)("h3",{className:"h2 font-secondary mb-2",children:M((null===c||void 0===c?void 0:c.id)?"Alerts.updateAlertTitle":"Alerts.createAlertTitle")}),(0,u.jsx)("div",{className:"font-14 primary-900",children:M("Alerts.createAlertDescription")})]}),(0,u.jsxs)("ul",{className:"flex w-100 text-center font-12 text-capitalize font-weight-700 bg-light",children:[(0,u.jsx)("li",{onClick:function(){return X(H.K.TOWN)},className:"w-50 pointer py-3 text-secondary ".concat(Q===H.K.TOWN?E().active:""),children:M("Alerts.byCounty")}),(0,u.jsx)("li",{onClick:function(){return X(H.K.CHURCH)},className:"w-50 pointer py-3 text-secondary ".concat(Q===H.K.CHURCH?E().active:""),children:M("Alerts.byChurch")})]}),Q===H.K.TOWN&&(0,u.jsxs)("form",{className:"w-100 mb-6 mb-md-0",children:[(0,u.jsx)("div",{className:"mb-3 w-100",children:(0,u.jsx)(_.Qr,{name:O.SURNAME,control:ve,render:function(e){var n=e.field,t=e.fieldState,l=t.invali
1d,r=(t.isTouched,t.isDirty,t.error);return(0,u.jsxs)(I.Z,{fullWidth:!0,className:"input-large-lg",children:[(0,u.jsx)(g.Z,(0,o.Z)((0,s.Z)({},n),{error:l,inputProps:{maxLength:60,autoComplete:"off"},type:"text",fullWidth:!0,label:M("Alerts.surname"),onBlur:function(e){return(0,j.r)(e,pe)}})),!!l&&(0,u.jsx)(R.Z,{error:!0,children:null===r||void 0===r?void 0:r.message})]})}})}),(0,u.jsxs)("div",{className:"flex flex-wrap mx-n-3",children:[(0,u.jsx)("div",{className:"w-50 w-md-100 mb-md-3 px-3",children:(0,u.jsx)(_.Qr,{name:O.COUNTY_SIMPLE,control:ve,render:function(e){var n=e.field;return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(b.m,{className:"select-large-lg select-contrast-placeholder",ref:J,field:n,optionName:"name",query:L.uz1,onChange:function(e,t){null===n||void 0===n||n.onChange(t),setTimeout((function(){pe(O.TOWN,null)}),100)},variables:{input:{page:1,records:100}},fieldName:"getCountiesForFilters",customTextLabel:!0,textFieldLabel:M("Alerts.county")})})}})}),(0,u.jsx)("div",{className:"w-50 w-md-100 px-3",children:(0,u.jsx)(_.Qr,{name:O.TOWN,control:ve,render:function(e){var n=e.field;return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(b.m,{className:"select-large-lg select-contrast-placeholder",ref:$,field:n,optionName:"name",ascSortField:"name",query:L.W68,variables:{countyId:Te?Te.id:1,input:{page:1,records:500}},fieldName:"getTownsForFilters",customTextLabel:!0,textFieldLabel:M("Alerts.town"),disabled:!Te})})}})})]})]}),Q===H.K.CHURCH&&(0,u.jsxs)("form",{className:"w-100 mb-6 mb-md-0",children:[(0,u.jsx)("div",{className:"w-100 mb-3",children:(0,u.jsx)(_.Qr,{name:O.COUNTY_CHURCH,control:ve,render:function(e){var n=e.field;return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(b.m,{className:"select-large-lg",field:n,optionName:"name",query:L.uz1,onChange:function(e,t){null===n||void 0===n||n.onChange(t),setTimeout((function(){return function(e,n){var t;pe(O.LOCATION,null),null===ee||void 0===ee||null===(t=ee.current)||void 0===t||t.getItems()}()}),100)},variables:{input:{page:1,records:100}},fieldName:"getCountiesForFilters",customTextLabel:!0,textFieldLabel:M("Alerts.county")})})}})}),(0,u.jsxs)("div",{className:"flex flex-wrap mx-n-3",children:[(0,u.jsx)("div",{className:"w-50 w-md-100 mb-md-3 px-3",children:(0,u.jsx)(_.Qr,{name:O.LOCATION_CATEGORY,control:ve,render:function(e){var n=e.field;return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(b.m,{className:"select-large-lg",field:n,optionName:"name",query:L.UDG,onChange:function(e,t){null===n||void 0===n||n.onChange(t),setTimeout((function(){return function(e,n){var t;pe(O.LOCATION,null),null===ee||void 0===ee||null===(t=ee.current)||void 0===t||t.getItems()}()}),100)},variables:{input:{page:1,records:9999}},fieldName:"getLocationCategoriesForFilters",customTextLabel:!0,textFieldLabel:M("Alerts.denomination")})})}})}),(0,u.jsx)("div",{className:"w-50 w-md-100 px-3",children:(0,u.jsx)(_.Qr,{name:O.LOCATION,control:ve,render:function(e){var n,t,l=e.field;return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(b.m,{ref:ee,className:"select-large-lg",field:l,optionName:"name",query:L.P34,variables:{query:{page:1,records:9999,filters:[{field:"county.id",operator:"eq",value:(null===he||void 0===he||null===(n=he.id)||void 0===n?void 0:n.toString())||"1"},{field:"locationCategory.id",operator:"eq",value:(null===Ce||void 0===Ce||null===(t=Ce.id)||void 0===t?void 0:t.toString())||"1"}]}},fieldName:"searchLocations",customTextLabel:!0,textFieldLabel:M("Alerts.church"),disabled:!(null===Ce||void 0===Ce?void 0:Ce.id)||!(null===he||void 0===he?void 0:he.id)})})}})})]})]}),(0,u.jsxs)("div",{className:"flex justify-content-between w-100 flex-wrap-md align-items-center",children:[(0,u.jsxs)("div",{onClick:function(){return function(e){var n;null===ne||void 0===ne||null===(n=ne.current)||void 0===n||n.openTipsModal(e)}(Q)},className:"w-md-100 priamry-900 font-13 font-weight-600 px-3 flex align-items-center pointer px-md-0 mb-md-6",children:[(0,u.jsx)(x,{}),(0,u.jsx)("span",{className:"pl-2 text-capitalize",children:M(Q===H.K.CHURCH?"Alerts.tipsChurch":"Alerts.tips")})]}),(0,u.jsxs)("div",{className:"w-md-100 flex flex-wrap-md align-items-center justify-content-between",children:[(0,u.jsx)(h.Z,{onClick:Oe,size:ce>U.Z.TabletMax?"l":"m",className:"px-12 mr-4 mr-md-0",variant:"secondary-outline",disableRipple:!0,children:(0,u.jsx)("span",{className:"font-15 font-md-13",children:M("Alerts.close")})}),(0,u.jsx)(Z.Z,{loading:G,onClick:function(){var e={};switch(Q){case H.K.TOWN:e=function(){var e,n,t;return t={},(0,a.Z)(t,O.SURNAME,Ne(O.SURNAME)||""),(0,a.Z)(t,O.TOWN,(null===(e=Ne(O.TOWN))||void 0===e?void 0:e.id)||null),(0,a.Z)(t,O.CONTY,(null===(n=Ne(O.COUNTY_SIMPLE))||void 0===n?void 0:n.id)||null),(0,a.Z)(t,O.TYPE,H.K.TOWN),(0,a.Z)(t,O.LOCATION,null),(0,a.Z)(t,O.LOCATION_CATEGORY,null),t}();break;case H.K.CHURCH:e=function(){var e,n,t,l;return l={},(0,a.Z)(l,O.CONTY,(null===(e=Ne(O.COUNTY_CHURCH))||void 0===e?void 0:e.id)||null),(0,a.Z)(l,O.LO
1CATION_CATEGORY,(null===(n=Ne(O.LOCATION_CATEGORY))||void 0===n?void 0:n.id)||null),(0,a.Z)(l,O.LOCATION,(null===(t=Ne(O.LOCATION))||void 0===t?void 0:t.id)||null),(0,a.Z)(l,O.TYPE,H.K.CHURCH),(0,a.Z)(l,O.SURNAME,""),(0,a.Z)(l,O.TOWN,null),l}()}var n=Object.assign({},e),t=(null===n||void 0===n?void 0:n[O.TYPE])===H.K.CHURCH;delete n[O.TYPE];var l=Object.keys(n).filter((function(e){var t,l;return!!(null===(l=null===(t=n[e])||void 0===t?void 0:t.toString())||void 0===l?void 0:l.length)})).length;if(t){if(l<3){var r=M("Alerts.allFieldRequired");return void ie((0,s.Z)({},re,{open:!0,text:r,type:"error"}))}}else if(l<1){var i=M("Alerts.minOneField");return void ie((0,s.Z)({},re,{open:!0,text:i,type:"error"}))}(null===c||void 0===c?void 0:c.id)?xe(e,c):Ae(e)},loadingPosition:"start",startIcon:(0,u.jsx)(u.Fragment,{}),size:ce>U.Z.TabletMax?"l":"m",className:"px-6",disableRipple:!0,variant:"primary-light",type:"submit",children:(0,u.jsx)("span",{className:"font-15 font-md-13 text-capitalize flex-shrink",children:M((null===c||void 0===c?void 0:c.id)?"Alerts.updateAlert":"Alerts.saveAlert")})})]})]})]})})}),(0,u.jsx)(K,{title:M(Q===H.K.CHURCH?"Alerts.tipsChurch":"Alerts.tips"),ref:ne}),(0,u.jsx)(F.Z,{autoHideDuration:6e3,anchorOrigin:{vertical:ae,horizontal:se},open:oe,onClose:function(){return ie((0,s.Z)({},re,{open:!1}))},children:(0,u.jsx)(k.Z,{className:"font-18 font-md-16",onClose:function(){ie((0,s.Z)({},re,{open:!1}))},severity:null===re||void 0===re?void 0:re.type,sx:{width:"100%"},children:null===re||void 0===re?void 0:re.text})})]})}))},88758:function(e,n,t){"use strict";var l;t.d(n,{a:function(){return l}}),function(e){e[e.BAD_REQUEST=999]="BAD_REQUEST",e[e.AUTH_WRONG_TOKEN=990]="AUTH_WRONG_TOKEN",e[e.AUTH_EXPIRED_TOKEN=991]="AUTH_EXPIRED_TOKEN",e[e.VALIDATION_ERROR=600]="VALIDATION_ERROR",e[e.FORBIDDEN=700]="FORBIDDEN",e[e.NOT_FOUND=1]="NOT_FOUND",e[e.ALREADY_EXISTS=2]="ALREADY_EXISTS",e[e.INVALID_CREDENTIALS=3]="INVALID_CREDENTIALS",e[e.INVALID_TOKEN=4]="INVALID_TOKEN",e[e.ITEM_NOT_EXISTS=5]="ITEM_NOT_EXISTS",e[e.ACCOUNT_BLOCKED=6]="ACCOUNT_BLOCKED",e[e.ACCOUNT_NOT_CONFIRMED=7]="ACCOUNT_NOT_CONFIRMED",e[e.SOCIAL_LOGIN_ERROR=8]="SOCIAL_LOGIN_ERROR",e[e.EXPIRED_TOKEN=9]="EXPIRED_TOKEN",e[e.INVALID_TYPE=10]="INVALID_TYPE",e[e.NEW_CONDOLENCES_BLOCKED=11]="NEW_CONDOLENCES_BLOCKED",e[e.FILE_EXCEEDS_LIMIT=12]="FILE_EXCEEDS_LIMIT",e[e.TOO_MUCH_ALERTS=13]="TOO_MUCH_ALERTS",e[e.COMPLAINT_ALREADY_SUBMITTED=18]="COMPLAINT_ALREADY_SUBMITTED",e[e.CONDOLENCE_ALREADY_SUBMITTED=19]="CONDOLENCE_ALREADY_SUBMITTED"}(l||(l={}))},94344:function(e,n,t){"use strict";var l;t.d(n,{K:function(){return l}}),function(e){e.TOWN="0",e.CHURCH="1"}(l||(l={}))},24639:function(e){e.exports={active:"MemberAlertModal_active__m9Q1W"}}}]);
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.