mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
1 line
10 KiB
JavaScript
Vendored
1 line
10 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[524],{94594:function(e,n,t){"use strict";t.d(n,{Z:function(){return y}});var a=t(87462),c=t(4942),i=t(67294),l=t(97685),r=t(91),o=t(94184),s=t.n(o),d=t(21770),u=t(15105),f=i.forwardRef((function(e,n){var t,a=e.prefixCls,o=void 0===a?"rc-switch":a,f=e.className,h=e.checked,m=e.defaultChecked,p=e.disabled,v=e.loadingIcon,b=e.checkedChildren,g=e.unCheckedChildren,C=e.onClick,x=e.onChange,y=e.onKeyDown,N=(0,r.Z)(e,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),k=(0,d.Z)(!1,{value:h,defaultValue:m}),w=(0,l.Z)(k,2),j=w[0],Z=w[1];function O(e,n){var t=j;return p||(Z(t=e),null===x||void 0===x||x(t,n)),t}var E=s()(o,f,(t={},(0,c.Z)(t,"".concat(o,"-checked"),j),(0,c.Z)(t,"".concat(o,"-disabled"),p),t));return i.createElement("button",Object.assign({},N,{type:"button",role:"switch","aria-checked":j,disabled:p,className:E,ref:n,onKeyDown:function(e){e.which===u.Z.LEFT?O(!1,e):e.which===u.Z.RIGHT&&O(!0,e),null===y||void 0===y||y(e)},onClick:function(e){var n=O(!j,e);null===C||void 0===C||C(n,e)}}),v,i.createElement("span",{className:"".concat(o,"-inner")},j?b:g))}));f.displayName="Switch";var h=f,m=t(50888),p=t(97202),v=t(59844),b=t(97647),g=t(21687),C=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var c=0;for(a=Object.getOwnPropertySymbols(e);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(t[a[c]]=e[a[c]])}return t},x=i.forwardRef((function(e,n){var t,l=e.prefixCls,r=e.size,o=e.loading,d=e.className,u=void 0===d?"":d,f=e.disabled,x=C(e,["prefixCls","size","loading","className","disabled"]);(0,g.Z)("checked"in x||!("value"in x),"Switch","`value` is not a valid prop, do you mean `checked`?");var y=i.useContext(v.E_),N=y.getPrefixCls,k=y.direction,w=i.useContext(b.Z),j=N("switch",l),Z=i.createElement("div",{className:"".concat(j,"-handle")},o&&i.createElement(m.Z,{className:"".concat(j,"-loading-icon")})),O=s()((t={},(0,c.Z)(t,"".concat(j,"-small"),"small"===(r||w)),(0,c.Z)(t,"".concat(j,"-loading"),o),(0,c.Z)(t,"".concat(j,"-rtl"),"rtl"===k),t),u);return i.createElement(p.Z,{insertExtraNode:!0},i.createElement(h,(0,a.Z)({},x,{prefixCls:j,className:O,disabled:f||o,ref:n,loadingIcon:Z})))}));x.__ANT_SWITCH=!0,x.displayName="Switch";var y=x},20550:function(e,n,t){"use strict";t.d(n,{Z:function(){return y}});var a=t(4942),c=t(87462),i=t(97685),l=t(67294),r=t(94184),o=t.n(r),s=t(98423),d=t(97937),u=t(59844),f=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var c=0;for(a=Object.getOwnPropertySymbols(e);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(t[a[c]]=e[a[c]])}return t},h=function(e){var n,t=e.prefixCls,i=e.className,r=e.checked,s=e.onChange,d=e.onClick,h=f(e,["prefixCls","className","checked","onChange","onClick"]),m=(0,l.useContext(u.E_).getPrefixCls)("tag",t),p=o()(m,(n={},(0,a.Z)(n,"".concat(m,"-checkable"),!0),(0,a.Z)(n,"".concat(m,"-checkable-checked"),r),n),i);return l.createElement("span",(0,c.Z)({},h,{className:p,onClick:function(e){null===s||void 0===s||s(!r),null===d||void 0===d||d(e)}}))},m=t(98787),p=t(97202),v=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&n.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var c=0;for(a=Object.getOwnPropertySymbols(e);c<a.length;c++)n.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(t[a[c]]=e[a[c]])}return t},b=new RegExp("^(".concat(m.Y.join("|"),")(-inverse)?$")),g=new RegExp("^(".concat(m.E.join("|"),")$")),C=function(e,n){var t,r=e.prefixCls,f=e.className,h=e.style,m=e.children,C=e.icon,x=e.color,y=e.onClose,N=e.closeIcon,k=e.closable,w=void 0!==k&&k,j=v(e,["prefixCls","className","style","children","icon","color","onClose","closeIcon","closable"]),Z=l.useContext(u.E_),O=Z.getPrefixCls,E=Z.direction,P=l.useState(!0),S=(0,i.Z)(P,2),I=S[0],_=S[1];l.useEffect((function(){"visible"in j&&_(j.visible)}),[j.visible]);var D=function(){return!!x&&(b.test(x)||g.test(x))},T=(0,c.Z)({backgroundColor:x&&!D()?x:void 0},h),U=D(),F=O("tag",r),R=o()(F,(t={},(0,a.Z)(t,"".concat(F,"-").concat(x),U),(0,a.Z)(t,"".concat(F,"-has-color"),x&&!U),(0,a.Z)(t,"".concat(F,"-hidden"),!I),(0,a.Z)(t,"".concat(F,"-rtl"),"rtl"===E),t),f),z=function(e){e.stopPropagation(),null===y||void 0===y||y(e),e.defaultPrevented||"visible"in j||_(!1)},L="onClick"in j||m&&"a"===m.type,M=(0,s.Z)(j,["visible"]),J=C||null,K=J?l.createElement(l.Fragment,null,J,l.createElement("span",null,m)):m,X=l.createElement("span",(0,c.Z)({},M,{ref:n,className:R,style:T}),K,w?N?l.createElement("span",{className:"".concat(F,"-close-icon"),onClick:z},N):l.createElement(d.Z,{className:"".concat(F,"-close-icon"),onClick:z}):null);return L?l.createElement(p.Z,null,X):X},x=l.forwardRef(C);x.displayName="Tag",x.CheckableTag=h;var y=x},44716:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/config-chat",function(){return t(90610)}])},10063:function(e,n,t){"use strict";t.d(n,{Q:function(){return s},Z:function(){return d}});var a=t(85893),c=t(67294),i=t(17256),l=t(20550),r=t(48419),o=i.Z.Title,s="#5a67d8";function d(e){var n=(0,c.useState)(""),t=n[0],i=n[1],d=e.title,u=e.description,f=e.placeholder,h=e.maxLength,m=e.values,p=e.handleDeleteIndex,v=e.handleCreateString,b=e.submitStatus;return(0,a.jsxs)("div",{className:"edit-string-array-container",children:[(0,a.jsx)(o,{level:3,className:"section-title",children:d}),(0,a.jsx)("p",{className:"description",children:u}),(0,a.jsx)("div",{className:"edit-current-strings",children:m.map((function(e,n){return(0,a.jsx)(l.Z,{closable:!0,onClose:function(){p(n)},color:s,children:e},"tag-".concat(e,"-").concat(n))}))}),(0,a.jsx)("div",{className:"add-new-string-section",children:(0,a.jsx)(r.ZP,{fieldName:"string-input",value:t,onChange:function(e){var n=e.value;i(n)},onPressEnter:function(){var e=t.trim();v(e),i("")},maxLength:h,placeholder:f,status:b})})]})}d.defaultProps={maxLength:50,description:null,submitStatus:null}},15976:function(e,n,t){"use strict";t.d(n,{Z:function(){return h}});var a=t(28520),c=t.n(a),i=t(85893),l=t(67294),r=t(94594),o=t(83200),s=t(78464),d=t(25964),u=t(35159);function f(e,n,t,a,c,i,l){try{var r=e[i](l),o=r.value}catch(s){return void t(s)}r.done?n(o):Promise.resolve(o).then(a,c)}function h(e){var n,t=(0,l.useState)(null),a=t[0],h=t[1],m=null,p=((0,l.useContext)(u.aC)||{}).setFieldInConfigState,v=e.apiPath,b=e.checked,g=e.reversed,C=void 0!==g&&g,x=e.configPath,y=void 0===x?"":x,N=e.disabled,k=void 0!==N&&N,w=e.fieldName,j=e.label,Z=e.tip,O=e.useSubmit,E=e.onChange,P=function(){h(null),clearTimeout(m),m=null},S=(n=c().mark((function e(n){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O){e.next=6;break}return h((0,o.kg)(o.Jk)),t=C?!n:n,e.next=5,(0,d.Si)({apiPath:v,data:{value:t},onSuccess:function(){p({fieldName:w,value:t,path:y}),h((0,o.kg)(o.zv))},onError:function(e){h((0,o.kg)(o.Un,"There was an error: ".concat(e)))}});case 5:m=setTimeout(P,d.sI);case 6:E&&E(n);case 7:case"end":return e.stop()}}),e)})),function(){var e=this,t=arguments;return new Promise((function(a,c){var i=n.apply(e,t);function l(e){f(i,a,c,l,r,"next",e)}function r(e){f(i,a,c,l,r,"throw",e)}l(void 0)}))}),I=null!==a&&a.type===o.Jk;return(0,i.jsxs)("div",{className:"formfield-container toggleswitch-container",children:[j&&(0,i.jsx)("div",{className:"label-side",children:(0,i.jsx)("span",{className:"formfield-label",children:j})}),(0,i.jsxs)("div",{className:"input-side",children:[(0,i.jsxs)("div",{className:"input-group",children:[(0,i.jsx)(r.Z,{className:"switch field-".concat(w),loading:I,onChange:S,defaultChecked:b,checked:b,checkedChildren:"ON",unCheckedChildren:"OFF",disabled:k}),(0,i.jsx)(s.Z,{status:a})]}),(0,i.jsx)("p",{className:"field-tip",children:Z})]})]})}h.defaultProps={apiPath:"",checked:!1,reversed:!1,configPath:"",disabled:!1,label:"",tip:"",useSubmit:!1,onChange:null}},90610:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return p}});var a=t(85893),c=t(17256),i=t(67294),l=t(48419),r=t(50197),o=t(15976),s=t(10063),d=t(83200),u=t(25964),f=t(35159);function h(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function m(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),a.forEach((function(n){h(e,n,t[n])}))}return e}function p(){var e=function(){x(null)},n=function(){(0,u.Si)({apiPath:u.CJ,data:{value:v.forbiddenUsernames},onSuccess:function(){k({fieldName:"forbiddenUsernames",value:v.forbiddenUsernames}),x(d.zv),setTimeout(e,u.sI)},onError:function(n){x((0,d.kg)(d.Un,n)),setTimeout(e,u.sI)}})},t=c.Z.Title,p=(0,i.useState)(null),v=p[0],b=p[1],g=(0,i.useState)(null),C=g[0],x=g[1],y=(0,i.useContext)(f.aC)||{},N=y.serverConfig,k=y.setFieldInConfigState,w=N.chatDisabled,j=N.forbiddenUsernames,Z=N.instanceDetails.welcomeMessage,O=function(e){var n=e.fieldName,t=e.value;b(m({},v,h({},n,t)))};return(0,i.useEffect)((function(){b({chatDisabled:w,forbiddenUsernames:j,welcomeMessage:Z})}),[N]),v?(0,a.jsxs)("div",{className:"config-server-details-form",children:[(0,a.jsx)(t,{children:"Chat Settings"}),(0,a.jsxs)("div",{className:"form-module config-server-details-container",children:[(0,a.jsx)(o.Z,m({fieldName:"chatDisabled"},u.yj,{checked:!v.chatDisabled,reversed:!0,onChange:function(e){O({fieldName:"chatDisabled",value:!e})}})),(0,a.jsx)(r.ZP,m({fieldName:"welcomeMessage"},u.IX,{type:l.Sk,value:v.welcomeMessage,initialValue:Z,onChange:O})),(0,a.jsx)("br",{}),(0,a.jsx)("br",{}),(0,a.jsx)(s.Z,{title:u.Dg.label,placeholder:u.Dg.placeholder,description:u.Dg.tip,values:v.forbiddenUsernames,handleDeleteIndex:function(e){v.forbiddenUsernames.splice(e,1),n()},handleCreateString:function(e){v.forbiddenUsernames.push(e),O({fieldName:"forbiddenUsernames",value:v.forbiddenUsernames}),n()},submitStatus:(0,d.kg)(C)})]})]}):null}}},function(e){e.O(0,[774,888,179],(function(){return n=44716,e(e.s=n);var n}));var n=e.O();_N_E=n}]); |