(this.webpackJsonp=this.webpackJsonp||[]).push([[176],{cNeJ:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=l(a("kaz8")),s=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var a=[],n=!0,s=!1,i=void 0;try{for(var r,u=e[Symbol.iterator]();!(n=(r=u.next()).done)&&(a.push(r.value),!t||a.length!==t);n=!0);}catch(e){s=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(s)throw i}}return a}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};a("sRBo");var i=a("cDcd"),r=l(i),u=l(a("vDqi"));function l(e){return e&&e.__esModule?e:{default:e}}a("j4F2"),t.default=function(e){var t=e.current_user,a=(0,i.useState)(),l=s(a,2),c=l[0],d=l[1],o=(0,i.useState)(),f=s(o,2),m=f[0],p=f[1],g=(0,i.useState)(),y=s(g,2),_=y[0],h=y[1];function v(e,a,n){var s=m,i=_;e?s[n]=a.target.checked:i[n]=a.target.checked,u.default.post("/users/"+t.login+"/template_message_settings/update_setting.json",{setting:{notification_body:s,email_body:i}}).then((function(e){e&&0===e.status&&b()}))}function b(){u.default.get("/users/"+t.login+"/template_message_settings.json").then((function(e){e&&200===e.status&&(h(e.data.email_body),p(e.data.notification_body))}))}return(0,i.useEffect)((function(){document.title="通知管理",u.default.get("/template_message_settings.json").then((function(e){e&&200===e.status&&d(e.data.setting_types)})),b()}),[]),r.default.createElement("div",{className:"notice01"},r.default.createElement("div",{className:"sshHead"},r.default.createElement("span",{className:"text-shadow07"},"通知管理")),r.default.createElement("div",null,r.default.createElement("span",{className:"notice-manager-tip"},"您可以通过通知管理来选择接受通知的方式"),c&&m&&_&&c.map((function(e,t){return e.type_name&&r.default.createElement("div",{key:t},r.default.createElement("div",{className:"manager-cont-top"},e.type_name),e.settings.map((function(t,a){var s=e.type.substring(e.type.indexOf("::")+2)+"::"+t.key;return r.default.createElement("div",{className:"manager-cont",key:a},r.default.createElement("div",{className:"manager-cont-title"},t.name),r.default.createElement(n.default,{disabled:t.notification_disabled,defaultChecked:m[s],onChange:function(e){v(!0,e,s)}},"站内信"),r.default.createElement(n.default,{disabled:t.email_disabled,defaultChecked:_[s],onChange:function(e){v(!1,e,s)}},"邮件"))})))}))))}}}]);