Files
owncast/static/web/_next/static/chunks/pages/admin/config-notify-48561d4d85f054db.js
T
2022-08-16 02:47:50 +00:00

1 line
20 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4440],{24308:function(e,n,t){"use strict";t.d(n,{c4:function(){return i}});var r=t(4942),a=t(87462),i=["xxl","xl","lg","md","sm","xs"],o={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},s=new Map,c=-1,l={},d={matchHandlers:{},dispatch:function(e){return l=e,s.forEach((function(e){return e(l)})),s.size>=1},subscribe:function(e){return s.size||this.register(),c+=1,s.set(c,e),e(l),c},unsubscribe:function(e){s.delete(e),s.size||this.unregister()},unregister:function(){var e=this;Object.keys(o).forEach((function(n){var t=o[n],r=e.matchHandlers[t];null===r||void 0===r||r.mql.removeListener(null===r||void 0===r?void 0:r.listener)})),s.clear()},register:function(){var e=this;Object.keys(o).forEach((function(n){var t=o[n],i=function(t){var i=t.matches;e.dispatch((0,a.Z)((0,a.Z)({},l),(0,r.Z)({},n,i)))},s=window.matchMedia(t);s.addListener(i),e.matchHandlers[t]={mql:s,listener:i},i(s)}))}};n.ZP=d},6226:function(e,n,t){"use strict";t.d(n,{Z:function(){return p}});var r=t(4942),a=t(87462),i=t(71002),o=t(94184),s=t.n(o),c=t(67294),l=t(53124),d=t(99134),u=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]])}return t};var f=["xs","sm","md","lg","xl","xxl"];var p=c.forwardRef((function(e,n){var t,o=c.useContext(l.E_),p=o.getPrefixCls,h=o.direction,v=c.useContext(d.Z),m=v.gutter,x=v.wrap,g=v.supportFlexGap,b=e.prefixCls,Z=e.span,y=e.order,j=e.offset,w=e.push,k=e.pull,C=e.className,N=e.children,S=e.flex,T=e.style,E=u(e,["prefixCls","span","order","offset","push","pull","className","children","flex","style"]),P=p("col",b),O={};f.forEach((function(n){var t,o={},s=e[n];"number"===typeof s?o.span=s:"object"===(0,i.Z)(s)&&(o=s||{}),delete E[n],O=(0,a.Z)((0,a.Z)({},O),(t={},(0,r.Z)(t,"".concat(P,"-").concat(n,"-").concat(o.span),void 0!==o.span),(0,r.Z)(t,"".concat(P,"-").concat(n,"-order-").concat(o.order),o.order||0===o.order),(0,r.Z)(t,"".concat(P,"-").concat(n,"-offset-").concat(o.offset),o.offset||0===o.offset),(0,r.Z)(t,"".concat(P,"-").concat(n,"-push-").concat(o.push),o.push||0===o.push),(0,r.Z)(t,"".concat(P,"-").concat(n,"-pull-").concat(o.pull),o.pull||0===o.pull),(0,r.Z)(t,"".concat(P,"-rtl"),"rtl"===h),t))}));var L=s()(P,(t={},(0,r.Z)(t,"".concat(P,"-").concat(Z),void 0!==Z),(0,r.Z)(t,"".concat(P,"-order-").concat(y),y),(0,r.Z)(t,"".concat(P,"-offset-").concat(j),j),(0,r.Z)(t,"".concat(P,"-push-").concat(w),w),(0,r.Z)(t,"".concat(P,"-pull-").concat(k),k),t),C,O),_={};if(m&&m[0]>0){var I=m[0]/2;_.paddingLeft=I,_.paddingRight=I}if(m&&m[1]>0&&!g){var F=m[1]/2;_.paddingTop=F,_.paddingBottom=F}return S&&(_.flex=function(e){return"number"===typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(S),!1!==x||_.minWidth||(_.minWidth=0)),c.createElement("div",(0,a.Z)({},E,{style:(0,a.Z)((0,a.Z)({},_),T),className:L,ref:n}),N)}))},99134:function(e,n,t){"use strict";var r=(0,t(67294).createContext)({});n.Z=r},25968:function(e,n,t){"use strict";t.d(n,{Z:function(){return m}});var r=t(87462),a=t(4942),i=t(71002),o=t(97685),s=t(94184),c=t.n(s),l=t(67294),d=t(53124),u=t(98082),f=t(24308),p=t(93355),h=t(99134),v=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]])}return t};(0,p.b)("top","middle","bottom","stretch"),(0,p.b)("start","end","center","space-around","space-between","space-evenly");var m=l.forwardRef((function(e,n){var t,s=e.prefixCls,p=e.justify,m=e.align,x=e.className,g=e.style,b=e.children,Z=e.gutter,y=void 0===Z?0:Z,j=e.wrap,w=v(e,["prefixCls","justify","align","className","style","children","gutter","wrap"]),k=l.useContext(d.E_),C=k.getPrefixCls,N=k.direction,S=l.useState({xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0}),T=(0,o.Z)(S,2),E=T[0],P=T[1],O=(0,u.Z)(),L=l.useRef(y);l.useEffect((function(){var e=f.ZP.subscribe((function(e){var n=L.current||0;(!Array.isArray(n)&&"object"===(0,i.Z)(n)||Array.isArray(n)&&("object"===(0,i.Z)(n[0])||"object"===(0,i.Z)(n[1])))&&P(e)}));return function(){return f.ZP.unsubscribe(e)}}),[]);var _=C("row",s),I=function(){var e=[void 0,void 0];return(Array.isArray(y)?y:[y,void 0]).forEach((function(n,t){if("object"===(0,i.Z)(n))for(var r=0;r<f.c4.length;r++){var a=f.c4[r];if(E[a]&&void 0!==n[a]){e[t]=n[a];break}}else e[t]=n})),e}(),F=c()(_,(t={},(0,a.Z)(t,"".concat(_,"-no-wrap"),!1===j),(0,a.Z)(t,"".concat(_,"-").concat(p),p),(0,a.Z)(t,"".concat(_,"-").concat(m),m),(0,a.Z)(t,"".concat(_,"-rtl"),"rtl"===N),t),x),M={},U=null!=I[0]&&I[0]>0?I[0]/-2:void 0,D=null!=I[1]&&I[1]>0?I[1]/-2:void 0;if(U&&(M.marginLeft=U,M.marginRight=U),O){var q=(0,o.Z)(I,2);M.rowGap=q[1]}else D&&(M.marginTop=D,M.marginBottom=D);var A=(0,o.Z)(I,2),R=A[0],z=A[1],K=l.useMemo((function(){return{gutter:[R,z],wrap:j,supportFlexGap:O}}),[R,z,j,O]);return l.createElement(h.Z.Provider,{value:K},l.createElement("div",(0,r.Z)({},w,{className:F,style:(0,r.Z)((0,r.Z)({},M),g),ref:n}),b))}))},94594:function(e,n,t){"use strict";t.d(n,{Z:function(){return y}});var r=t(87462),a=t(4942),i=t(50888),o=t(94184),s=t.n(o),c=t(97685),l=t(91),d=t(67294),u=t(21770),f=t(15105),p=d.forwardRef((function(e,n){var t,r=e.prefixCls,i=void 0===r?"rc-switch":r,o=e.className,p=e.checked,h=e.defaultChecked,v=e.disabled,m=e.loadingIcon,x=e.checkedChildren,g=e.unCheckedChildren,b=e.onClick,Z=e.onChange,y=e.onKeyDown,j=(0,l.Z)(e,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),w=(0,u.Z)(!1,{value:p,defaultValue:h}),k=(0,c.Z)(w,2),C=k[0],N=k[1];function S(e,n){var t=C;return v||(N(t=e),null===Z||void 0===Z||Z(t,n)),t}var T=s()(i,o,(t={},(0,a.Z)(t,"".concat(i,"-checked"),C),(0,a.Z)(t,"".concat(i,"-disabled"),v),t));return d.createElement("button",Object.assign({},j,{type:"button",role:"switch","aria-checked":C,disabled:v,className:T,ref:n,onKeyDown:function(e){e.which===f.Z.LEFT?S(!1,e):e.which===f.Z.RIGHT&&S(!0,e),null===y||void 0===y||y(e)},onClick:function(e){var n=S(!C,e);null===b||void 0===b||b(n,e)}}),m,d.createElement("span",{className:"".concat(i,"-inner")},C?x:g))}));p.displayName="Switch";var h=p,v=t(53124),m=t(98866),x=t(97647),g=t(68349),b=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)n.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]])}return t},Z=d.forwardRef((function(e,n){var t,o=e.prefixCls,c=e.size,l=e.disabled,u=e.loading,f=e.className,p=void 0===f?"":f,Z=b(e,["prefixCls","size","disabled","loading","className"]),y=d.useContext(v.E_),j=y.getPrefixCls,w=y.direction,k=d.useContext(x.Z),C=d.useContext(m.Z),N=l||C||u,S=j("switch",o),T=d.createElement("div",{className:"".concat(S,"-handle")},u&&d.createElement(i.Z,{className:"".concat(S,"-loading-icon")})),E=s()((t={},(0,a.Z)(t,"".concat(S,"-small"),"small"===(c||k)),(0,a.Z)(t,"".concat(S,"-loading"),u),(0,a.Z)(t,"".concat(S,"-rtl"),"rtl"===w),t),p);return d.createElement(g.Z,{insertExtraNode:!0},d.createElement(h,(0,r.Z)({},Z,{prefixCls:S,className:E,disabled:N,ref:n,loadingIcon:T})))}));Z.__ANT_SWITCH=!0;var y=Z},7148:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/config-notify",function(){return t(91881)}])},15976:function(e,n,t){"use strict";t.d(n,{Z:function(){return p}});var r=t(47568),a=t(34051),i=t.n(a),o=t(85893),s=t(67294),c=t(94594),l=t(83192),d=t(78464),u=t(25964),f=t(35159);function p(e){var n=(0,s.useState)(null),t=n[0],a=n[1],p=null,h=((0,s.useContext)(f.aC)||{}).setFieldInConfigState,v=e.apiPath,m=e.checked,x=e.reversed,g=void 0!==x&&x,b=e.configPath,Z=void 0===b?"":b,y=e.disabled,j=void 0!==y&&y,w=e.fieldName,k=e.label,C=e.tip,N=e.useSubmit,S=e.onChange,T=function(){a(null),clearTimeout(p),p=null},E=function(){var e=(0,r.Z)(i().mark((function e(n){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!N){e.next=6;break}return a((0,l.kg)(l.Jk)),t=g?!n:n,e.next=5,(0,u.Si)({apiPath:v,data:{value:t},onSuccess:function(){h({fieldName:w,value:t,path:Z}),a((0,l.kg)(l.zv))},onError:function(e){a((0,l.kg)(l.Un,"There was an error: ".concat(e)))}});case 5:p=setTimeout(T,u.sI);case 6:S&&S(n);case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),P=null!==t&&t.type===l.Jk;return(0,o.jsxs)("div",{className:"formfield-container toggleswitch-container",children:[k&&(0,o.jsx)("div",{className:"label-side",children:(0,o.jsx)("span",{className:"formfield-label",children:k})}),(0,o.jsxs)("div",{className:"input-side",children:[(0,o.jsxs)("div",{className:"input-group",children:[(0,o.jsx)(c.Z,{className:"switch field-".concat(w),loading:P,onChange:E,defaultChecked:m,checked:m,checkedChildren:"ON",unCheckedChildren:"OFF",disabled:j}),(0,o.jsx)(d.Z,{status:t})]}),(0,o.jsx)("p",{className:"field-tip",children:C})]})]})}p.defaultProps={apiPath:"",checked:!1,reversed:!1,configPath:"",disabled:!1,label:"",tip:"",useSubmit:!1,onChange:null}},91881:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return F}});var r=t(14924),a=t(26042),i=t(69396),o=t(85893),s=t(84485),c=t(14670),l=t(25968),d=t(6226),u=t(71577),f=t(67294),p=t(41664),h=t.n(p),v=t(47568),m=t(34051),x=t.n(m),g=t(35159),b=t(13468),Z=t(78464),y=t(25964),j=t(15976),w=t(83192),k=s.Z.Title;function C(){var e=(0,f.useContext)(g.aC)||{},n=e.serverConfig,t=e.setFieldInConfigState,s=(n||{}).notifications,c=(s||{}).discord,l=c||{},d=l.enabled,p=l.webhook,h=l.goLiveMessage,m=(0,f.useState)({}),C=m[0],N=m[1],S=(0,f.useState)(null),T=S[0],E=S[1],P=(0,f.useState)(!1),O=P[0],L=P[1];(0,f.useEffect)((function(){N({enabled:d,webhook:p,goLiveMessage:h})}),[s,c]);var _=function(e){var n=e.fieldName,t=e.value;N((0,i.Z)((0,a.Z)({},C),(0,r.Z)({},n,t))),L(""!==p&&""!==h)},I=null,F=function(){E(null),I=null,clearTimeout(I)},M=function(){var e=(0,v.Z)(x().mark((function e(){var n;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=C,e.next=3,(0,y.Si)({apiPath:"/notifications/discord",data:{value:n},onSuccess:function(){t({fieldName:"discord",value:n,path:"notifications"}),E((0,w.kg)(w.zv,"Updated.")),I=setTimeout(F,y.sI)},onError:function(e){E((0,w.kg)(w.Un,e)),I=setTimeout(F,y.sI)}});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(k,{children:"Discord"}),(0,o.jsx)("p",{className:"description reduced-margins",children:"Let your Discord channel know each time you go live."}),(0,o.jsxs)("p",{className:"description reduced-margins",children:[(0,o.jsx)("a",{href:"https://support.discord.com/hc/en-us/articles/228383668",target:"_blank",rel:"noreferrer",children:"Create a webhook"})," ","under ",(0,o.jsx)("i",{children:"Edit Channel / Integrations"})," on your Discord channel and provide it below."]}),(0,o.jsx)(j.Z,{apiPath:"",fieldName:"discordEnabled",label:"Enable Discord",checked:C.enabled,onChange:function(e){_({fieldName:"enabled",value:e})}}),(0,o.jsx)("div",{style:{display:C.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.oy.webhookUrl),{required:!0,value:C.webhook,onChange:_}))}),(0,o.jsx)("div",{style:{display:C.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.oy.goLiveMessage),{required:!0,value:C.goLiveMessage,onChange:_}))}),(0,o.jsx)(u.Z,{type:"primary",onClick:M,style:{display:O?"inline-block":"none",position:"relative",marginLeft:"auto",right:"0",marginTop:"20px"},children:"Save"}),(0,o.jsx)(Z.Z,{status:T})]})}var N=s.Z.Title;function S(){var e=(0,f.useContext)(g.aC)||{},n=e.serverConfig,t=e.setFieldInConfigState,s=(n||{}).notifications,c=(s||{}).browser,l=c||{},d=l.enabled,p=l.goLiveMessage,h=(0,f.useState)({}),m=h[0],k=h[1],C=(0,f.useState)(null),S=C[0],T=C[1],E=(0,f.useState)(!1),P=E[0],O=E[1];(0,f.useEffect)((function(){k({enabled:d,goLiveMessage:p})}),[s,c]);var L=function(e){var n=e.fieldName,t=e.value;console.log(n,t),k((0,i.Z)((0,a.Z)({},m),(0,r.Z)({},n,t))),O(!0)},_=null,I=function(){T(null),_=null,clearTimeout(_)},F=function(){var e=(0,v.Z)(x().mark((function e(){var n;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=m,e.next=3,(0,y.Si)({apiPath:"/notifications/browser",data:{value:n},onSuccess:function(){t({fieldName:"browser",value:n,path:"notifications"}),T((0,w.kg)(w.zv,"Updated.")),_=setTimeout(I,y.sI)},onError:function(e){T((0,w.kg)(w.Un,e)),_=setTimeout(I,y.sI)}});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(N,{children:"Browser Alerts"}),(0,o.jsx)("p",{className:"description reduced-margins",children:"Viewers can opt into being notified when you go live with their browser."}),(0,o.jsx)("p",{className:"description reduced-margins",children:"Not all browsers support this."}),(0,o.jsx)(j.Z,{apiPath:"",fieldName:"enabled",label:"Enable browser notifications",onChange:function(e){L({fieldName:"enabled",value:e})},checked:m.enabled}),(0,o.jsx)("div",{style:{display:m.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.mv.goLiveMessage),{required:!0,type:b.Sk,value:m.goLiveMessage,onChange:L}))}),(0,o.jsx)(u.Z,{type:"primary",style:{display:P?"inline-block":"none",position:"relative",marginLeft:"auto",right:"0",marginTop:"20px"},onClick:F,children:"Save"}),(0,o.jsx)(Z.Z,{status:S})]})}var T=t(96410),E=s.Z.Title;function P(){var e=(0,f.useContext)(g.aC)||{},n=e.serverConfig,t=e.setFieldInConfigState,s=((n||{}).notifications||{}).twitter,c=(0,f.useState)({}),l=c[0],d=c[1],p=(0,f.useState)(null),h=p[0],m=p[1],k=(0,f.useState)(!1),C=k[0],N=k[1];(0,f.useEffect)((function(){var e=s||{},n=e.enabled,t=e.apiKey,r=e.apiSecret,a=e.accessToken,i=e.accessTokenSecret,o=e.bearerToken,c=e.goLiveMessage;d({enabled:n,apiKey:t,apiSecret:r,accessToken:a,accessTokenSecret:i,bearerToken:o,goLiveMessage:c})}),[s]);var S=function(e){var n=e.fieldName,t=e.value;d((0,i.Z)((0,a.Z)({},l),(0,r.Z)({},n,t))),N(function(){var e=l.enabled,n=l.apiKey,t=l.apiSecret,r=l.accessToken,a=l.accessTokenSecret,i=l.bearerToken,o=l.goLiveMessage;return e&&!!n&&!!t&&!!r&&!!a&&!!i&&!!o}())},P=null,O=function(){m(null),P=null,clearTimeout(P),N(!1)},L=function(){var e=(0,v.Z)(x().mark((function e(){var n;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l,e.next=3,(0,y.Si)({apiPath:"/notifications/twitter",data:{value:n},onSuccess:function(){t({fieldName:"twitter",value:n,path:"notifications"}),m((0,w.kg)(w.zv,"Updated.")),P=setTimeout(O,y.sI)},onError:function(e){m((0,w.kg)(w.Un,e)),P=setTimeout(O,y.sI)}});case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(E,{children:"Twitter"}),(0,o.jsx)("p",{className:"description reduced-margins",children:"Let your Twitter followers know each time you go live."}),(0,o.jsxs)("div",{style:{display:l.enabled?"block":"none"},children:[(0,o.jsxs)("p",{className:"description reduced-margins",children:[(0,o.jsx)("a",{href:"https://owncast.online/docs/notifications",target:"_blank",rel:"noreferrer",children:"Read how to configure your Twitter account"})," ","to support posting from Owncast."]}),(0,o.jsxs)("p",{className:"description reduced-margins",children:[(0,o.jsx)("a",{href:"https://developer.twitter.com/en/portal/dashboard",target:"_blank",rel:"noreferrer",children:"And then get your Twitter developer credentials"})," ","to fill in below."]})]}),(0,o.jsx)(j.Z,{apiPath:"",fieldName:"enabled",label:"Enable Twitter",onChange:function(e){var n=l.enabled;return S({fieldName:"enabled",value:e}),e!==n},checked:l.enabled}),(0,o.jsx)("div",{style:{display:l.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.$Z.apiKey),{required:!0,value:l.apiKey,onChange:S}))}),(0,o.jsx)("div",{style:{display:l.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.$Z.apiSecret),{type:b.A8,required:!0,value:l.apiSecret,onChange:S}))}),(0,o.jsx)("div",{style:{display:l.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.$Z.accessToken),{required:!0,value:l.accessToken,onChange:S}))}),(0,o.jsx)("div",{style:{display:l.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.$Z.accessTokenSecret),{type:b.A8,required:!0,value:l.accessTokenSecret,onChange:S}))}),(0,o.jsx)("div",{style:{display:l.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.$Z.bearerToken),{required:!0,value:l.bearerToken,onChange:S}))}),(0,o.jsx)("div",{style:{display:l.enabled?"block":"none"},children:(0,o.jsx)(b.ZP,(0,i.Z)((0,a.Z)({},y.$Z.goLiveMessage),{type:T.Kx,required:!0,value:l.goLiveMessage,onChange:S}))}),(0,o.jsx)(u.Z,{type:"primary",onClick:L,style:{display:C?"inline-block":"none",position:"relative",marginLeft:"auto",right:"0",marginTop:"20px"},children:"Save"}),(0,o.jsx)(Z.Z,{status:h})]})}var O=s.Z.Title;function L(){var e=(((0,f.useContext)(g.aC)||{}).serverConfig||{}).federation,n=(e||{}).enabled,t=(0,f.useState)({}),r=t[0],a=t[1];return(0,f.useEffect)((function(){a({enabled:n})}),[n]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(O,{children:"Fediverse Social"}),(0,o.jsx)("p",{className:"description",children:"Enabling the Fediverse social features will not just alert people to when you go live, but also enable other functionality."}),(0,o.jsxs)("p",{children:["Fediverse social features:"," ",(0,o.jsx)("span",{style:{color:e.enabled?"green":"red"},children:r.enabled?"Enabled":"Disabled"})]}),(0,o.jsx)(h(),{passHref:!0,href:"/config-federation",children:(0,o.jsx)(u.Z,{type:"primary",style:{position:"relative",marginLeft:"auto",right:"0",marginTop:"20px"},children:"Configure"})})]})}var _=t(19411),I=s.Z.Title;function F(){var e=(0,f.useState)(null),n=e[0],t=e[1],s=((0,f.useContext)(g.aC)||{}).serverConfig.yp,p=s.instanceUrl,v=(0,f.useState)(!1),m=v[0],x=v[1];(0,f.useEffect)((function(){t({instanceUrl:p})}),[s]);var b=""!==p,Z=!b&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(c.Z,{message:"You must set your server URL before you can enable this feature.",type:"warning",showIcon:!0}),(0,o.jsx)("br",{}),(0,o.jsx)(T.ZP,(0,i.Z)((0,a.Z)({fieldName:"instanceUrl"},y.yi),{value:(null===n||void 0===n?void 0:n.instanceUrl)||"",initialValue:s.instanceUrl,type:T.xA,onChange:function(e){var o=e.fieldName,s=e.value;x((0,_.Z)(s)),t((0,i.Z)((0,a.Z)({},n),(0,r.Z)({},o,s)))},onSubmit:function(){m&&t((0,i.Z)((0,a.Z)({},n),{enabled:!1}))},required:!0}))]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(I,{children:"Notifications"}),(0,o.jsxs)("p",{className:"description",children:["Let your viewers know when you go live by supporting any of the below notification channels."," ",(0,o.jsx)("a",{href:"https://owncast.online/docs/notifications/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn more about live notifications."})]}),Z,(0,o.jsxs)(l.Z,{children:[(0,o.jsx)(d.Z,{span:10,className:"form-module ".concat(b?"":"disabled"),style:{margin:"5px",display:"flex",flexDirection:"column"},children:(0,o.jsx)(S,{})}),(0,o.jsx)(d.Z,{span:10,className:"form-module ".concat(b?"":"disabled"),style:{margin:"5px",display:"flex",flexDirection:"column"},children:(0,o.jsx)(P,{})}),(0,o.jsx)(d.Z,{span:10,className:"form-module ".concat(b?"":"disabled"),style:{margin:"5px",display:"flex",flexDirection:"column"},children:(0,o.jsx)(C,{})}),(0,o.jsx)(d.Z,{span:10,className:"form-module ".concat(b?"":"disabled"),style:{margin:"5px",display:"flex",flexDirection:"column"},children:(0,o.jsx)(L,{})}),(0,o.jsxs)(d.Z,{span:10,className:"form-module ".concat(b?"":"disabled"),style:{margin:"5px",display:"flex",flexDirection:"column"},children:[(0,o.jsx)(I,{children:"Custom"}),(0,o.jsx)("p",{className:"description",children:"Build your own notifications by using custom webhooks."}),(0,o.jsx)(h(),{passHref:!0,href:"/webhooks",children:(0,o.jsx)(u.Z,{type:"primary",style:{position:"relative",marginLeft:"auto",right:"0",marginTop:"20px"},children:"Create"})})]})]})]})}}},function(e){e.O(0,[9774,2888,179],(function(){return n=7148,e(e.s=n);var n}));var n=e.O();_N_E=n}]);