1 line
10 KiB
JavaScript
Vendored
1 line
10 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9686],{47443:function(e,n,t){var r=t(42118);e.exports=function(e,n){return!!(null==e?0:e.length)&&r(e,n,0)>-1}},1196:function(e){e.exports=function(e,n,t){for(var r=-1,a=null==e?0:e.length;++r<a;)if(t(n,e[r]))return!0;return!1}},41848:function(e){e.exports=function(e,n,t,r){for(var a=e.length,s=t+(r?1:-1);r?s--:++s<a;)if(n(e[s],s,e))return s;return -1}},42118:function(e,n,t){var r=t(41848),a=t(62722),s=t(42351);e.exports=function(e,n,t){return n==n?s(e,n,t):r(e,a,t)}},62722:function(e){e.exports=function(e){return e!=e}},45652:function(e,n,t){var r=t(88668),a=t(47443),s=t(1196),l=t(74757),o=t(23593),i=t(21814);e.exports=function(e,n,t){var c=-1,u=a,d=e.length,f=!0,h=[],m=h;if(t)f=!1,u=s;else if(d>=200){var x=n?null:o(e);if(x)return i(x);f=!1,u=l,m=new r}else m=n?[]:h;e:for(;++c<d;){var p=e[c],b=n?n(p):p;if(p=t||0!==p?p:0,f&&b==b){for(var j=m.length;j--;)if(m[j]===b)continue e;n&&m.push(b),h.push(p)}else u(m,b,t)||(m!==h&&m.push(b),h.push(p))}return h}},23593:function(e,n,t){var r=t(58525),a=t(50308),s=t(21814),l=r&&1/s(new r([,-0]))[1]==1/0?function(e){return new r(e)}:a;e.exports=l},42351:function(e){e.exports=function(e,n,t){for(var r=t-1,a=e.length;++r<a;)if(e[r]===n)return r;return -1}},50308:function(e){e.exports=function(){}},44908:function(e,n,t){var r=t(45652);e.exports=function(e){return e&&e.length?r(e):[]}},65021:function(e,n,t){"use strict";t.d(n,{e:function(){return f}});var r=t(85893),a=t(24716),s=t(90622),l=t(5152),o=t.n(l),i=t(6925);let c=o()(()=>Promise.all([t.e(7298),t.e(3801)]).then(t.t.bind(t,83801,23)),{loadableGenerated:{webpack:()=>[83801]},ssr:!1}),u=o()(()=>Promise.all([t.e(7298),t.e(8796)]).then(t.t.bind(t,48796,23)),{loadableGenerated:{webpack:()=>[48796]},ssr:!1}),d=o()(()=>Promise.all([t.e(7298),t.e(2550)]).then(t.t.bind(t,82550,23)),{loadableGenerated:{webpack:()=>[82550]},ssr:!1}),f=e=>{let{user:n,isEnabled:t,label:l,onClick:o}=e;async function f(e){let{id:n}=e;try{return(await (0,i.rQ)(i.NM,{data:{userId:n,enabled:!t},method:"POST",auth:!0})).success}catch(e){console.error(e)}return!1}let h=t?"ban":"unban",m=t?(0,r.jsx)(c,{style:{color:"var(--ant-error)"}}):(0,r.jsx)(u,{style:{color:"var(--ant-warning)"}}),x=(0,r.jsxs)(r.Fragment,{children:["Are you sure you want to ",h," ",(0,r.jsx)("strong",{children:n.displayName}),t?" and remove their messages?":"?"]});return(0,r.jsx)(s.Z,{type:"primary",onClick:()=>{a.default.confirm({title:"Confirm ".concat(h),content:x,onCancel:()=>{},onOk:()=>new Promise((e,t)=>{let r=f(n);r?setTimeout(()=>{e(r),null==o||o()},3e3):t()}),okType:"danger",okText:t?"Absolutely":null,icon:m})},size:"small",icon:t?(0,r.jsx)(d,{twoToneColor:"#ff4d4f"}):null,className:"block-user-button",children:l||h})};f.defaultProps={label:"",onClick:null}},64096:function(e,n,t){"use strict";t.d(n,{Z:function(){return T}});var r=t(85893),a=t(67294),s=t(27189),l=t(24716),o=t(47271),i=t(6647),c=t(55050),u=t(76066),d=t(96652),f=t(45938),h=t(58091),m=t(44908),x=t.n(m),p=t(65021),b=t(90622),j=t(5152),g=t.n(j),y=t(6925);let v=g()(()=>Promise.all([t.e(7298),t.e(3801)]).then(t.t.bind(t,83801,23)),{loadableGenerated:{webpack:()=>[83801]},ssr:!1}),w=g()(()=>Promise.all([t.e(7298),t.e(8796)]).then(t.t.bind(t,48796,23)),{loadableGenerated:{webpack:()=>[48796]},ssr:!1}),Z=g()(()=>Promise.all([t.e(7298),t.e(2550)]).then(t.t.bind(t,82550,23)),{loadableGenerated:{webpack:()=>[82550]},ssr:!1}),k=g()(()=>Promise.all([t.e(7298),t.e(8138)]).then(t.t.bind(t,78770,23)),{loadableGenerated:{webpack:()=>[78770]},ssr:!1}),C=e=>{var n;let{user:t,onClick:a}=e;async function s(e,n){let{id:t}=e;try{return(await (0,y.rQ)(y.jr,{data:{userId:t,isModerator:n},method:"POST",auth:!0})).success}catch(e){console.error(e)}return!1}let o=null===(n=t.scopes)||void 0===n?void 0:n.includes("MODERATOR"),i=o?"remove moderator":"add moderator",c=o?(0,r.jsx)(v,{style:{color:"var(--ant-error)"}}):(0,r.jsx)(w,{style:{color:"var(--ant-warning)"}}),u=(0,r.jsxs)(r.Fragment,{children:["Are you sure you want to ",i," ",(0,r.jsx)("strong",{children:t.displayName}),"?"]});return(0,r.jsx)(b.Z,{type:"primary",onClick:()=>{l.default.confirm({title:"Confirm ".concat(i),content:u,onCancel:()=>{},onOk:()=>new Promise((e,n)=>{let r=s(t,!o);r?setTimeout(()=>{e(r),null==a||a()},3e3):n()}),okType:"danger",okText:o?"Yup!":null,icon:c})},size:"small",icon:o?(0,r.jsx)(Z,{twoToneColor:"#ff4d4f"}):(0,r.jsx)(k,{twoToneColor:"#22bb44"}),className:"block-user-button",children:i})};C.defaultProps={onClick:null};var P=t(99706),N=t(9507);let T=e=>{let{user:n,connectionInfo:t,children:m}=e,[b,j]=(0,a.useState)(!1),g=()=>{j(!1)},{displayName:y,createdAt:v,previousNames:w,nameChangedAt:Z,disabledAt:k}=n,{connectedAt:T,messageCount:O,userAgent:D}=t||{},A=null,M=w&&[...w];w&&w.length>1&&Z&&(A=new Date(Z),M.reverse());let E=new Date(v),S=(0,h.Z)(E,"PP pp"),F=A?(0,f.Z)(A):null;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z,{title:(0,r.jsxs)(r.Fragment,{children:["Created at: ",S,".",(0,r.jsx)("br",{})," Click for more info."]}),placement:"bottomLeft",children:(0,r.jsx)("button",{type:"button","aria-label":"Display more details about this user",className:"user-item-container",onClick:()=>{j(!0)},children:m})}),(0,r.jsx)(l.default,{destroyOnClose:!0,width:600,cancelText:"Close",okButtonProps:{style:{display:"none"}},title:"User details: ".concat(y),open:b,onOk:g,onCancel:g,children:(0,r.jsxs)("div",{className:"user-details",children:[(0,r.jsx)(o.default.Title,{level:4,children:y}),(0,r.jsxs)("p",{className:"created-at",children:["User created at ",S,"."]}),(0,r.jsxs)(i.Z,{gutter:16,children:[t&&(0,r.jsxs)(c.Z,{md:A?12:24,children:[(0,r.jsx)(o.default.Title,{level:5,children:"This user is currently connected to Chat."}),(0,r.jsxs)("ul",{className:"connection-info",children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Active for:"})," ",(0,f.Z)(new Date(T))]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Messages sent:"})," ",O]}),(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"User Agent:"}),(0,r.jsx)("br",{}),(0,N.AB)(D)]})]})]}),A&&(0,r.jsxs)(c.Z,{md:t?12:24,children:[(0,r.jsx)(o.default.Title,{level:5,children:"This user is also seen as:"}),(0,r.jsx)("ul",{className:"previous-names-list",children:x()(M).map((e,n)=>(0,r.jsxs)("li",{className:0===n?"latest":"",children:[(0,r.jsx)("span",{className:"user-name-item",children:e}),0===n?" (Changed ".concat(F," ago)"):""]}))})]})]}),(0,r.jsx)(u.Z,{}),(0,r.jsxs)(d.Z,{direction:"horizontal",children:[k?(0,r.jsxs)(r.Fragment,{children:["This user was banned on ",(0,r.jsx)("code",{children:(0,P.u)(k)}),".",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)(p.e,{label:"Unban this user",user:n,isEnabled:!1,onClick:g})]}):(0,r.jsx)(p.e,{label:"Ban this user",user:n,isEnabled:!0,onClick:g}),(0,r.jsx)(C,{user:n,onClick:g})]})]})})]})};T.defaultProps={connectionInfo:null}},99706:function(e,n,t){"use strict";t.d(n,{K:function(){return c},u:function(){return i}});var r=t(85893),a=t(43796),s=t(58091),l=t(64096),o=t(65021);function i(e){return new Date(e).getFullYear()!==new Date().getFullYear()?(0,s.Z)(new Date(e),"MMM d, yyyy H:mma"):(0,s.Z)(new Date(e),"MMM d H:mma")}let c=e=>{let{data:n}=e;return(0,r.jsx)(a.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:[{title:"Last Known Display Name",dataIndex:"displayName",key:"displayName",render:(e,n)=>(0,r.jsx)(l.Z,{user:n,children:(0,r.jsx)("span",{className:"display-name",children:e})})},{title:"Created",dataIndex:"createdAt",key:"createdAt",render:e=>i(e),sorter:(e,n)=>new Date(e.createdAt).getTime()-new Date(n.createdAt).getTime(),sortDirections:["descend","ascend"]},{title:"Disabled at",dataIndex:"disabledAt",key:"disabledAt",defaultSortOrder:"descend",render:e=>e?i(e):null,sorter:(e,n)=>new Date(e.disabledAt).getTime()-new Date(n.disabledAt).getTime(),sortDirections:["descend","ascend"]},{title:"",key:"block",className:"actions-col",render:(e,n)=>(0,r.jsx)(o.e,{user:n,isEnabled:!n.disabledAt})}],dataSource:n,size:"small",rowKey:"id"})}},41760:function(e,n,t){"use strict";t.d(n,{Z:function(){return s}});var r=t(97685),a=t(67294);function s(){var e=a.useReducer(function(e){return e+1},0);return(0,r.Z)(e,2)[1]}},55050:function(e,n,t){"use strict";var r=t(75664);n.Z=r.Z},76066:function(e,n,t){"use strict";var r=t(87462),a=t(4942),s=t(93967),l=t.n(s),o=t(67294),i=t(71946),c=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>n.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(t[r[a]]=e[r[a]]);return t};n.Z=function(e){var n=o.useContext(i.E_),t=n.getPrefixCls,s=n.direction,u=e.prefixCls,d=e.type,f=void 0===d?"horizontal":d,h=e.orientation,m=void 0===h?"center":h,x=e.orientationMargin,p=e.className,b=e.children,j=e.dashed,g=e.plain,y=c(e,["prefixCls","type","orientation","orientationMargin","className","children","dashed","plain"]),v=t("divider",u),w=m.length>0?"-".concat(m):m,Z=!!b,k="left"===m&&null!=x,C="right"===m&&null!=x,P=l()(v,"".concat(v,"-").concat(f),(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},"".concat(v,"-with-text"),Z),"".concat(v,"-with-text").concat(w),Z),"".concat(v,"-dashed"),!!j),"".concat(v,"-plain"),!!g),"".concat(v,"-rtl"),"rtl"===s),"".concat(v,"-no-default-orientation-margin-left"),k),"".concat(v,"-no-default-orientation-margin-right"),C),p),N=(0,r.Z)((0,r.Z)({},k&&{marginLeft:x}),C&&{marginRight:x});return o.createElement("div",(0,r.Z)({className:P},y,{role:"separator"}),b&&"vertical"!==f&&o.createElement("span",{className:"".concat(v,"-inner-text"),style:N},b))}},28609:function(e,n,t){"use strict";var r=t(67294),a=t(41760),s=t(95872);n.Z=function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],n=(0,r.useRef)({}),t=(0,a.Z)();return(0,r.useEffect)(function(){var r=s.ZP.subscribe(function(r){n.current=r,e&&t()});return function(){return s.ZP.unsubscribe(r)}},[]),n.current}},49947:function(e,n,t){"use strict";var r=t(82215),a=t(63085),s=r.ZP;s.Header=r.h4,s.Footer=r.$_,s.Content=r.VY,s.Sider=a.Z,s._InternalSiderContext=a.D,n.default=s},6647:function(e,n,t){"use strict";var r=t(37525);n.Z=r.Z},11163:function(e,n,t){e.exports=t(73035)}}]); |