From da291f3e5d4fcb5fc28c7b2be4a25aac340956e8 Mon Sep 17 00:00:00 2001 From: gabek Date: Tue, 4 Oct 2022 18:25:24 +0000 Subject: [PATCH] Bundle embedded web app --- static/web/404.html | 4 ++-- static/web/404/index.html | 4 ++-- .../web/_next/static/YkCfcYQjmUfYTmmomZk0h/_buildManifest.js | 1 - static/web/_next/static/chunks/2877-6ed259e27dba66ad.js | 1 + static/web/_next/static/chunks/2877-c114745c37bb026b.js | 1 - static/web/_next/static/chunks/355-bd89fb21c9e9d2de.js | 1 - static/web/_next/static/chunks/3626-ffcb249be5918774.js | 1 + .../{7781.2553454a5caad033.js => 7781.c2410185d16b1336.js} | 2 +- static/web/_next/static/chunks/8763-5f3081892e9117b4.js | 1 + static/web/_next/static/chunks/8763-ddc977899642b6f9.js | 1 - .../{9640-9346df51762e2ae7.js => 9640-e282810d6fb4f58d.js} | 2 +- .../{admin-2443e7998747a17b.js => admin-cc18916a0b499b94.js} | 2 +- ...-8b84a4df3eda8be0.js => access-tokens-ffe8732ccbc0256e.js} | 2 +- ...ctions-a66e823c70116568.js => actions-e6982b17ca2b6d30.js} | 2 +- ...sages-317322f2f861cc63.js => messages-bd543116cd1989d4.js} | 2 +- .../{users-30d91538da7a1ac3.js => users-1d48f6dca8230410.js} | 2 +- ...99601525b.js => config-public-details-61013ad2a35fbe56.js} | 2 +- ...606e719eea2.js => config-social-items-0c9506f9b2b2acaf.js} | 2 +- ...o-6d13d083d980bcf3.js => config-video-67dd9ceeab2a8d04.js} | 2 +- ...ctions-71d8b8563d762f87.js => actions-e31f1858274d3033.js} | 2 +- ...wers-5504ff57b0a1d9c0.js => followers-340617dfd678f424.js} | 2 +- .../{logs-e841532c80e2f73f.js => logs-2296627de57047d9.js} | 2 +- ...pgrade-d37fb18597de81d5.js => upgrade-a2690af66d4d3214.js} | 2 +- ...fo-d4da40ea621ba733.js => viewer-info-a302c2034b7c758f.js} | 2 +- ...hooks-4bf13fb3eb979bed.js => webhooks-31e1e30a1af46238.js} | 2 +- static/web/_next/static/chunks/webpack-73a0b616e2c4289a.js | 1 + static/web/_next/static/chunks/webpack-89f969ac019106da.js | 1 - .../web/_next/static/z23tI41L-Dxrisxt-O5h2/_buildManifest.js | 1 + .../_ssgManifest.js | 0 static/web/admin/access-tokens/index.html | 2 +- static/web/admin/actions/index.html | 2 +- static/web/admin/chat/messages/index.html | 2 +- static/web/admin/chat/users/index.html | 2 +- static/web/admin/config-chat/index.html | 2 +- static/web/admin/config-federation/index.html | 2 +- static/web/admin/config-notify/index.html | 2 +- static/web/admin/config-public-details/index.html | 2 +- static/web/admin/config-server-details/index.html | 2 +- static/web/admin/config-social-items/index.html | 2 +- static/web/admin/config-storage/index.html | 2 +- static/web/admin/config-video/index.html | 2 +- static/web/admin/federation/actions/index.html | 2 +- static/web/admin/federation/followers/index.html | 2 +- static/web/admin/hardware-info/index.html | 2 +- static/web/admin/help/index.html | 2 +- static/web/admin/index.html | 2 +- static/web/admin/logs/index.html | 2 +- static/web/admin/stream-health/index.html | 2 +- static/web/admin/upgrade/index.html | 2 +- static/web/admin/viewer-info/index.html | 2 +- static/web/admin/webhooks/index.html | 2 +- static/web/embed/chat/readonly/index.html | 2 +- static/web/embed/chat/readwrite/index.html | 2 +- static/web/embed/video/index.html | 2 +- static/web/index.html | 2 +- 55 files changed, 51 insertions(+), 51 deletions(-) delete mode 100644 static/web/_next/static/YkCfcYQjmUfYTmmomZk0h/_buildManifest.js create mode 100644 static/web/_next/static/chunks/2877-6ed259e27dba66ad.js delete mode 100644 static/web/_next/static/chunks/2877-c114745c37bb026b.js delete mode 100644 static/web/_next/static/chunks/355-bd89fb21c9e9d2de.js create mode 100644 static/web/_next/static/chunks/3626-ffcb249be5918774.js rename static/web/_next/static/chunks/{7781.2553454a5caad033.js => 7781.c2410185d16b1336.js} (99%) create mode 100644 static/web/_next/static/chunks/8763-5f3081892e9117b4.js delete mode 100644 static/web/_next/static/chunks/8763-ddc977899642b6f9.js rename static/web/_next/static/chunks/{9640-9346df51762e2ae7.js => 9640-e282810d6fb4f58d.js} (99%) rename static/web/_next/static/chunks/pages/{admin-2443e7998747a17b.js => admin-cc18916a0b499b94.js} (98%) rename static/web/_next/static/chunks/pages/admin/{access-tokens-8b84a4df3eda8be0.js => access-tokens-ffe8732ccbc0256e.js} (98%) rename static/web/_next/static/chunks/pages/admin/{actions-a66e823c70116568.js => actions-e6982b17ca2b6d30.js} (98%) rename static/web/_next/static/chunks/pages/admin/chat/{messages-317322f2f861cc63.js => messages-bd543116cd1989d4.js} (96%) rename static/web/_next/static/chunks/pages/admin/chat/{users-30d91538da7a1ac3.js => users-1d48f6dca8230410.js} (96%) rename static/web/_next/static/chunks/pages/admin/{config-public-details-0c8d1d299601525b.js => config-public-details-61013ad2a35fbe56.js} (99%) rename static/web/_next/static/chunks/pages/admin/{config-social-items-d6bb1606e719eea2.js => config-social-items-0c9506f9b2b2acaf.js} (96%) rename static/web/_next/static/chunks/pages/admin/{config-video-6d13d083d980bcf3.js => config-video-67dd9ceeab2a8d04.js} (98%) rename static/web/_next/static/chunks/pages/admin/federation/{actions-71d8b8563d762f87.js => actions-e31f1858274d3033.js} (95%) rename static/web/_next/static/chunks/pages/admin/federation/{followers-5504ff57b0a1d9c0.js => followers-340617dfd678f424.js} (98%) rename static/web/_next/static/chunks/pages/admin/{logs-e841532c80e2f73f.js => logs-2296627de57047d9.js} (95%) rename static/web/_next/static/chunks/pages/admin/{upgrade-d37fb18597de81d5.js => upgrade-a2690af66d4d3214.js} (88%) rename static/web/_next/static/chunks/pages/admin/{viewer-info-d4da40ea621ba733.js => viewer-info-a302c2034b7c758f.js} (97%) rename static/web/_next/static/chunks/pages/admin/{webhooks-4bf13fb3eb979bed.js => webhooks-31e1e30a1af46238.js} (98%) create mode 100644 static/web/_next/static/chunks/webpack-73a0b616e2c4289a.js delete mode 100644 static/web/_next/static/chunks/webpack-89f969ac019106da.js create mode 100644 static/web/_next/static/z23tI41L-Dxrisxt-O5h2/_buildManifest.js rename static/web/_next/static/{YkCfcYQjmUfYTmmomZk0h => z23tI41L-Dxrisxt-O5h2}/_ssgManifest.js (100%) diff --git a/static/web/404.html b/static/web/404.html index 06fa120ec..13fa4ee65 100644 --- a/static/web/404.html +++ b/static/web/404.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/static/web/404/index.html b/static/web/404/index.html index 06fa120ec..13fa4ee65 100644 --- a/static/web/404/index.html +++ b/static/web/404/index.html @@ -1,4 +1,4 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file + }

404

This page could not be found.

\ No newline at end of file diff --git a/static/web/_next/static/YkCfcYQjmUfYTmmomZk0h/_buildManifest.js b/static/web/_next/static/YkCfcYQjmUfYTmmomZk0h/_buildManifest.js deleted file mode 100644 index 5680f4f24..000000000 --- a/static/web/_next/static/YkCfcYQjmUfYTmmomZk0h/_buildManifest.js +++ /dev/null @@ -1 +0,0 @@ -self.__BUILD_MANIFEST=function(s,a,c,e,i,t,d,n,f,h,o,b,m,u,k,r,g,j,p,l,_,w,v,y,I,B,F,A,D,E){return{__rewrites:{beforeFiles:[],afterFiles:[{source:"/api/:path*"},{source:"/hls/:path*"},{source:"/img/:path*"},{source:"/logo"},{source:"/thumbnail.jpg"}],fallback:[]},"/":[m,u,_,s,t,d,f,h,k,r,w,v,y,"static/chunks/1996-9a53824dcf344d7c.js",o,g,I,"static/css/07e0886dce1d8889.css","static/chunks/pages/index-fb956376c1741c1f.js"],"/_error":["static/chunks/pages/_error-f2496e8b9fdedb89.js"],"/admin":[a,s,c,e,i,t,d,n,b,r,"static/chunks/5300-b0f573cc3f14ae75.js","static/chunks/pages/admin-2443e7998747a17b.js"],"/admin/access-tokens":[a,s,c,e,i,"static/chunks/pages/admin/access-tokens-8b84a4df3eda8be0.js"],"/admin/actions":[a,s,c,e,"static/chunks/pages/admin/actions-a66e823c70116568.js"],"/admin/chat/messages":[B,a,s,c,e,i,d,F,A,"static/chunks/pages/admin/chat/messages-317322f2f861cc63.js"],"/admin/chat/users":[B,a,s,c,e,i,t,d,F,A,"static/chunks/pages/admin/chat/users-30d91538da7a1ac3.js"],"/admin/config-chat":["static/chunks/pages/admin/config-chat-40e0e71cfeaff121.js"],"/admin/config-federation":["static/chunks/1829-271cba4b38fde9a4.js","static/chunks/pages/admin/config-federation-5c6874737e33a71c.js"],"/admin/config-notify":["static/chunks/pages/admin/config-notify-58fa36815f7c88c5.js"],"/admin/config-public-details":[a,s,c,e,h,j,"static/css/1f5ee95fffd43a71.css","static/chunks/9839-71976094eefc0741.js",D,"static/chunks/pages/admin/config-public-details-0c8d1d299601525b.js"],"/admin/config-server-details":[E,"static/chunks/pages/admin/config-server-details-16e85ec1ac7c9ccd.js"],"/admin/config-social-items":[a,s,c,e,D,"static/chunks/pages/admin/config-social-items-d6bb1606e719eea2.js"],"/admin/config-storage":["static/chunks/5473-185a5241676edf4a.js","static/chunks/pages/admin/config-storage-723faa1b1e9d32cc.js"],"/admin/config-video":[a,s,c,e,E,"static/chunks/4812-106e72c5e21f1d74.js","static/chunks/pages/admin/config-video-6d13d083d980bcf3.js"],"/admin/federation/actions":[a,s,c,e,i,"static/chunks/pages/admin/federation/actions-71d8b8563d762f87.js"],"/admin/federation/followers":[a,s,c,e,i,t,"static/chunks/pages/admin/federation/followers-5504ff57b0a1d9c0.js"],"/admin/hardware-info":[p,i,t,n,b,l,j,"static/chunks/pages/admin/hardware-info-4553850c31257f6d.js"],"/admin/help":[t,n,y,"static/chunks/5566-8ddb7a25da6d2715.js","static/chunks/pages/admin/help-635a866be914f510.js"],"/admin/logs":[a,s,c,e,i,r,"static/chunks/pages/admin/logs-e841532c80e2f73f.js"],"/admin/stream-health":[p,i,t,n,b,l,"static/chunks/6610-62cb634d71c38c3a.js","static/chunks/pages/admin/stream-health-897a4c79610a240c.js"],"/admin/upgrade":[a,s,c,e,"static/chunks/3812-73e73ff4fa8c15d9.js","static/chunks/pages/admin/upgrade-d37fb18597de81d5.js"],"/admin/viewer-info":[p,a,s,c,e,i,t,d,n,b,l,j,"static/chunks/pages/admin/viewer-info-d4da40ea621ba733.js"],"/admin/webhooks":[a,s,c,e,"static/chunks/pages/admin/webhooks-4bf13fb3eb979bed.js"],"/embed/chat/readonly":[m,u,f,h,k,o,g,"static/css/d2120b8ad68b9567.css","static/chunks/pages/embed/chat/readonly-be347a9cf4a90b73.js"],"/embed/chat/readwrite":[m,u,s,f,h,k,o,g,"static/css/094c475c62728b4d.css","static/chunks/pages/embed/chat/readwrite-26d87e3a0c9e0165.js"],"/embed/video":[_,d,f,w,v,o,I,"static/css/8283b6095a0a048a.css","static/chunks/pages/embed/video-61510af0fd4d92ba.js"],sortedPages:["/","/_app","/_error","/admin","/admin/access-tokens","/admin/actions","/admin/chat/messages","/admin/chat/users","/admin/config-chat","/admin/config-federation","/admin/config-notify","/admin/config-public-details","/admin/config-server-details","/admin/config-social-items","/admin/config-storage","/admin/config-video","/admin/federation/actions","/admin/federation/followers","/admin/hardware-info","/admin/help","/admin/logs","/admin/stream-health","/admin/upgrade","/admin/viewer-info","/admin/webhooks","/embed/chat/readonly","/embed/chat/readwrite","/embed/video"]}}("static/chunks/3903-bdaee0333fdb7201.js","static/chunks/8939-b1631aef52fbaa8f.js","static/chunks/3698-35a1751ec66f28c7.js","static/chunks/355-bd89fb21c9e9d2de.js","static/chunks/8091-d7457a988f3f1d54.js","static/chunks/2944-6793cb651dad1c89.js","static/chunks/5938-b8bf626b6df6d168.js","static/chunks/5315-0e7e74a6fb9533c3.js","static/chunks/9372-9a6ed970911222d5.js","static/chunks/9654-a01856f993ffae7a.js","static/chunks/1899-3fb0be1a52d4bddf.js","static/chunks/4763-aeb67859bc15c785.js","static/chunks/d3048c20-0576676e1017fabd.js","static/chunks/d2094a0f-e4988ec3c3ddbfcf.js","static/chunks/2852-a70539634f8c0765.js","static/chunks/2429-35846a119e7209fe.js","static/chunks/8763-ddc977899642b6f9.js","static/chunks/7910-7248e2d1496cf795.js","static/chunks/3fff1979-612c6162f1b345ff.js","static/chunks/2139-c72b3a851c3b6fc9.js","static/chunks/d6e1aeb5-1e3969b413cccadf.js","static/css/7c735c05af084bb2.css","static/chunks/1681-c6f123c7a3f0d079.js","static/chunks/1082-03ae605a1f81cbce.js","static/chunks/2854-da2fe2768714039f.js","static/chunks/29107295-4a69275373f23f88.js","static/chunks/2460-885300cc1f75d92b.js","static/chunks/9640-9346df51762e2ae7.js","static/chunks/2877-c114745c37bb026b.js","static/chunks/3286-25235a0b8b0401f3.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/static/web/_next/static/chunks/2877-6ed259e27dba66ad.js b/static/web/_next/static/chunks/2877-6ed259e27dba66ad.js new file mode 100644 index 000000000..58c280a98 --- /dev/null +++ b/static/web/_next/static/chunks/2877-6ed259e27dba66ad.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2877],{72877:function(e,n,a){a.d(n,{h:function(){return z}});var t=a(47568),l=a(14924),s=a(26042),i=a(69396),c=a(29815),o=a(70655),r=a(85893),u=a(67294),d=a(84485),f=a(71577),m=a(69677),p=a(93626),h=a(85402),x=a(10010),j=a(39398),v=a(48689),N=a(38939),Z=a(58827),k=a(25964),g=function(e){var n=e.iconList,a=e.selectedOption,t=e.onSelected,l=""===a?null:a;return(0,r.jsxs)("div",{className:"social-dropdown-container",children:[(0,r.jsx)("p",{className:"description",children:"If you are looking for a platform name not on this list, please select Other and type in your own name. A logo will not be provided."}),(0,r.jsxs)("div",{className:"formfield-container",children:[(0,r.jsx)("div",{className:"label-side",children:(0,r.jsx)("span",{className:"formfield-label",children:"Social Platform"})}),(0,r.jsx)("div",{className:"input-side",children:(0,r.jsxs)(N.Z,{style:{width:240},className:"social-dropdown",placeholder:"Social platform...",defaultValue:l,value:l,onSelect:function(e){t&&t(e)},children:[n.map((function(e){var n=e.platform,a=e.icon,t=e.key,l="".concat(Z.WB).concat(a.slice(1));return(0,r.jsxs)(N.Z.Option,{className:"social-option",value:t,children:[(0,r.jsx)("span",{className:"option-icon",children:(0,r.jsx)("img",{src:l,alt:"",className:"option-icon"})}),(0,r.jsx)("span",{className:"option-label",children:n})]},"platform-".concat(t))})),(0,r.jsx)(N.Z.Option,{className:"social-option",value:k.z_,children:"Other..."},"platform-".concat(k.z_))]})})]})]})},b=a(35159),y=a(19411),S=a(24389),w=a(83192),C=a(25521),_=d.Z.Title,z=function(){var e=(0,u.useState)([]),n=e[0],a=e[1],d=(0,u.useState)([]),N=d[0],z=d[1],E=(0,u.useState)(!1),O=E[0],I=E[1],T=(0,u.useState)(!1),H=T[0],L=T[1],A=(0,u.useState)(!1),B=A[0],P=A[1],U=(0,u.useState)(-1),D=U[0],V=U[1],W=(0,u.useState)(k.wC),F=W[0],K=W[1],Q=(0,u.useState)(null),R=Q[0],Y=Q[1],$=(0,u.useContext)(b.aC)||{},q=$.serverConfig,G=$.setFieldInConfigState,J=q.instanceDetails,M=J.socialHandles,X=null,ee=function(){var e=(0,t.Z)((function(){var e,n,t;return(0,o.__generator)(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),[4,(0,Z.rQ)(Z.$i,{auth:!1})];case 1:return e=l.sent(),n=Object.keys(e).map((function(n){return(0,s.Z)({key:n},e[n])})),a(n),[3,3];case 2:return t=l.sent(),console.log(t),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),ne=function(e){return n.find((function(n){return n.key===e}))||!1},ae=""!==F.platform&&!n.find((function(e){return e.key===F.platform}));(0,u.useEffect)((function(){ee()}),[]),(0,u.useEffect)((function(){J.socialHandles&&z(M)}),[J]);var te=function(){Y(null),X=null,clearTimeout(X)},le=function(){I(!1),V(-1),L(!1),P(!1),K((0,s.Z)({},k.wC))},se=function(){le()},ie=function(e,n){K((0,i.Z)((0,s.Z)({},F),(0,l.Z)({},e,n)))},ce=function(){var e=(0,t.Z)((function(e){return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,k.Si)({apiPath:k.c9,data:{value:e},onSuccess:function(){G({fieldName:"socialHandles",value:e,path:"instanceDetails"}),P(!1),se(),Y((0,w.kg)(w.zv)),X=setTimeout(te,k.sI)},onError:function(e){Y((0,w.kg)(w.Un,"There was an error: ".concat(e))),P(!1),X=setTimeout(te,k.sI)}})];case 1:return n.sent(),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),oe=[{title:"Social Link",dataIndex:"",key:"combo",render:function(e,n){var a=n.platform,t=n.url,l=ne(a);if(!l)return(0,r.jsx)("div",{className:"social-handle-cell",children:(0,r.jsxs)("p",{className:"option-label",children:[(0,r.jsx)("strong",{children:a}),(0,r.jsx)("span",{className:"handle-url",title:t,children:t})]})});var s=l.icon,i=l.platform,c="".concat(Z.WB).concat(s.slice(1));return(0,r.jsxs)("div",{className:"social-handle-cell",children:[(0,r.jsx)("span",{className:"option-icon",children:(0,r.jsx)("img",{src:c,alt:"",className:"option-icon"})}),(0,r.jsxs)("p",{className:"option-label",children:[(0,r.jsx)("strong",{children:i}),(0,r.jsx)("span",{className:"handle-url",title:t,children:t})]})]})}},{title:"",dataIndex:"",key:"edit",render:function(e,n,a){return(0,r.jsxs)("div",{className:"actions",children:[(0,r.jsx)(f.Z,{size:"small",onClick:function(){var e=N[a];V(a),K((0,s.Z)({},e)),I(!0),ne(e.platform)||L(!0)},children:"Edit"}),(0,r.jsx)(f.Z,{icon:(0,r.jsx)(x.Z,{}),size:"small",hidden:0===a,onClick:function(){return function(e){if(!(e<=0||e>=N.length)){var n=(0,c.Z)(N),a=n[e-1];n[e-1]=n[e],n[e]=a,ce(n)}}(a)}}),(0,r.jsx)(f.Z,{icon:(0,r.jsx)(j.Z,{}),size:"small",hidden:a===N.length-1,onClick:function(){return function(e){if(!(e<0||e>=N.length-1)){var n=(0,c.Z)(N),a=n[e+1];n[e+1]=n[e],n[e]=a,ce(n)}}(a)}}),(0,r.jsx)(f.Z,{className:"delete-button",icon:(0,r.jsx)(v.Z,{}),size:"small",onClick:function(){return function(e){var n=(0,c.Z)(N);n.splice(e,1),ce(n)}(a)}})]})}}],re={disabled:!(0,y.Z)(F.url)},ue=(0,r.jsxs)("div",{className:"other-field-container formfield-container",children:[(0,r.jsx)("div",{className:"label-side"}),(0,r.jsx)("div",{className:"input-side",children:(0,r.jsx)(m.Z,{placeholder:"Other platform name",defaultValue:F.platform,onChange:function(e){var n=e.target.value;ie("platform",n)}})})]});return(0,r.jsxs)("div",{className:"social-links-edit-container",children:[(0,r.jsx)(_,{level:3,className:"section-title",children:"Your Social Handles"}),(0,r.jsx)("p",{className:"description",children:"Add all your social media handles and links to your other profiles here."}),(0,r.jsx)(C.E,{status:R}),(0,r.jsx)(p.Z,{className:"social-handles-table",pagination:!1,size:"small",rowKey:function(e){return"".concat(e.platform,"-").concat(e.url)},columns:oe,dataSource:N}),(0,r.jsx)(h.Z,{title:"Edit Social Handle",visible:O,onOk:function(){P(!0);var e=N.length?(0,c.Z)(N):[];-1===D?e.push(F):e.splice(D,1,F),ce(e)},onCancel:se,confirmLoading:B,okButtonProps:re,children:(0,r.jsxs)("div",{className:"social-handle-modal-content",children:[(0,r.jsx)(g,{iconList:n,selectedOption:ae?k.z_:F.platform,onSelected:function(e){e===k.z_?(L(!0),ie("platform","")):(L(!1),ie("platform",e))}}),H&&ue,(0,r.jsx)("br",{}),(0,r.jsx)(S.nv,{fieldName:"social-url",label:"URL",placeholder:{mastodon:"https://mastodon.social/@username",twitter:"https://twitter.com/username"}[F.platform]||"Url to page",value:F.url,onChange:function(e){var n=e.value;ie("url",n)},useTrim:!0,type:"url",pattern:y.a}),(0,r.jsx)(C.E,{status:R})]})}),(0,r.jsx)("br",{}),(0,r.jsx)(f.Z,{type:"primary",onClick:function(){le(),I(!0)},children:"Add a new social link"})]})}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/2877-c114745c37bb026b.js b/static/web/_next/static/chunks/2877-c114745c37bb026b.js deleted file mode 100644 index 42db81664..000000000 --- a/static/web/_next/static/chunks/2877-c114745c37bb026b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2877],{72877:function(e,n,a){a.d(n,{h:function(){return C}});var t=a(47568),s=a(14924),l=a(26042),i=a(69396),c=a(29815),o=a(70655),r=a(85893),u=a(67294),d=a(84485),f=a(71577),m=a(69677),p=a(10355),h=a(85402),x=a(48689),j=a(38939),v=a(58827),N=a(25964),k=function(e){var n=e.iconList,a=e.selectedOption,t=e.onSelected,s=""===a?null:a;return(0,r.jsxs)("div",{className:"social-dropdown-container",children:[(0,r.jsx)("p",{className:"description",children:"If you are looking for a platform name not on this list, please select Other and type in your own name. A logo will not be provided."}),(0,r.jsxs)("div",{className:"formfield-container",children:[(0,r.jsx)("div",{className:"label-side",children:(0,r.jsx)("span",{className:"formfield-label",children:"Social Platform"})}),(0,r.jsx)("div",{className:"input-side",children:(0,r.jsxs)(j.Z,{style:{width:240},className:"social-dropdown",placeholder:"Social platform...",defaultValue:s,value:s,onSelect:function(e){t&&t(e)},children:[n.map((function(e){var n=e.platform,a=e.icon,t=e.key,s="".concat(v.WB).concat(a.slice(1));return(0,r.jsxs)(j.Z.Option,{className:"social-option",value:t,children:[(0,r.jsx)("span",{className:"option-icon",children:(0,r.jsx)("img",{src:s,alt:"",className:"option-icon"})}),(0,r.jsx)("span",{className:"option-label",children:n})]},"platform-".concat(t))})),(0,r.jsx)(j.Z.Option,{className:"social-option",value:N.z_,children:"Other..."},"platform-".concat(N.z_))]})})]})]})},Z=a(35159),b=a(19411),g=a(24389),y=a(83192),S=a(25521),w=d.Z.Title,C=function(){var e=(0,u.useState)([]),n=e[0],a=e[1],d=(0,u.useState)([]),j=d[0],C=d[1],_=(0,u.useState)(!1),E=_[0],O=_[1],z=(0,u.useState)(!1),I=z[0],T=z[1],H=(0,u.useState)(!1),L=H[0],A=H[1],B=(0,u.useState)(-1),P=B[0],U=B[1],D=(0,u.useState)(N.wC),V=D[0],W=D[1],F=(0,u.useState)(null),K=F[0],Q=F[1],R=(0,u.useContext)(Z.aC)||{},Y=R.serverConfig,$=R.setFieldInConfigState,q=Y.instanceDetails,G=q.socialHandles,J=null,M=function(){var e=(0,t.Z)((function(){var e,n,t;return(0,o.__generator)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,(0,v.rQ)(v.$i,{auth:!1})];case 1:return e=s.sent(),n=Object.keys(e).map((function(n){return(0,l.Z)({key:n},e[n])})),a(n),[3,3];case 2:return t=s.sent(),console.log(t),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),X=function(e){return n.find((function(n){return n.key===e}))||!1},ee=""!==V.platform&&!n.find((function(e){return e.key===V.platform}));(0,u.useEffect)((function(){M()}),[]),(0,u.useEffect)((function(){q.socialHandles&&C(G)}),[q]);var ne=function(){Q(null),J=null,clearTimeout(J)},ae=function(){O(!1),U(-1),T(!1),A(!1),W((0,l.Z)({},N.wC))},te=function(){ae()},se=function(e,n){W((0,i.Z)((0,l.Z)({},V),(0,s.Z)({},e,n)))},le=function(){var e=(0,t.Z)((function(e){return(0,o.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,N.Si)({apiPath:N.c9,data:{value:e},onSuccess:function(){$({fieldName:"socialHandles",value:e,path:"instanceDetails"}),A(!1),te(),Q((0,y.kg)(y.zv)),J=setTimeout(ne,N.sI)},onError:function(e){Q((0,y.kg)(y.Un,"There was an error: ".concat(e))),A(!1),J=setTimeout(ne,N.sI)}})];case 1:return n.sent(),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),ie=[{title:"Social Link",dataIndex:"",key:"combo",render:function(e,n){var a=n.platform,t=n.url,s=X(a);if(!s)return(0,r.jsx)("div",{className:"social-handle-cell",children:(0,r.jsxs)("p",{className:"option-label",children:[(0,r.jsx)("strong",{children:a}),(0,r.jsx)("span",{className:"handle-url",title:t,children:t})]})});var l=s.icon,i=s.platform,c="".concat(v.WB).concat(l.slice(1));return(0,r.jsxs)("div",{className:"social-handle-cell",children:[(0,r.jsx)("span",{className:"option-icon",children:(0,r.jsx)("img",{src:c,alt:"",className:"option-icon"})}),(0,r.jsxs)("p",{className:"option-label",children:[(0,r.jsx)("strong",{children:i}),(0,r.jsx)("span",{className:"handle-url",title:t,children:t})]})]})}},{title:"",dataIndex:"",key:"edit",render:function(e,n,a){return(0,r.jsxs)("div",{className:"actions",children:[(0,r.jsx)(f.Z,{size:"small",onClick:function(){var e=j[a];U(a),W((0,l.Z)({},e)),O(!0),X(e.platform)||T(!0)},children:"Edit"}),(0,r.jsx)(f.Z,{className:"delete-button",icon:(0,r.jsx)(x.Z,{}),size:"small",onClick:function(){return function(e){var n=(0,c.Z)(j);n.splice(e,1),le(n)}(a)}})]})}}],ce={disabled:!(0,b.Z)(V.url)},oe=(0,r.jsxs)("div",{className:"other-field-container formfield-container",children:[(0,r.jsx)("div",{className:"label-side"}),(0,r.jsx)("div",{className:"input-side",children:(0,r.jsx)(m.Z,{placeholder:"Other platform name",defaultValue:V.platform,onChange:function(e){var n=e.target.value;se("platform",n)}})})]});return(0,r.jsxs)("div",{className:"social-links-edit-container",children:[(0,r.jsx)(w,{level:3,className:"section-title",children:"Your Social Handles"}),(0,r.jsx)("p",{className:"description",children:"Add all your social media handles and links to your other profiles here."}),(0,r.jsx)(S.E,{status:K}),(0,r.jsx)(p.Z,{className:"social-handles-table",pagination:!1,size:"small",rowKey:function(e){return"".concat(e.platform,"-").concat(e.url)},columns:ie,dataSource:j}),(0,r.jsx)(h.Z,{title:"Edit Social Handle",visible:E,onOk:function(){A(!0);var e=j.length?(0,c.Z)(j):[];-1===P?e.push(V):e.splice(P,1,V),le(e)},onCancel:te,confirmLoading:L,okButtonProps:ce,children:(0,r.jsxs)("div",{className:"social-handle-modal-content",children:[(0,r.jsx)(k,{iconList:n,selectedOption:ee?N.z_:V.platform,onSelected:function(e){e===N.z_?(T(!0),se("platform","")):(T(!1),se("platform",e))}}),I&&oe,(0,r.jsx)("br",{}),(0,r.jsx)(g.nv,{fieldName:"social-url",label:"URL",placeholder:{mastodon:"https://mastodon.social/@username",twitter:"https://twitter.com/username"}[V.platform]||"Url to page",value:V.url,onChange:function(e){var n=e.value;se("url",n)},useTrim:!0,type:"url",pattern:b.a}),(0,r.jsx)(S.E,{status:K})]})}),(0,r.jsx)("br",{}),(0,r.jsx)(f.Z,{type:"primary",onClick:function(){ae(),O(!0)},children:"Add a new social link"})]})}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/355-bd89fb21c9e9d2de.js b/static/web/_next/static/chunks/355-bd89fb21c9e9d2de.js deleted file mode 100644 index ebd26245f..000000000 --- a/static/web/_next/static/chunks/355-bd89fb21c9e9d2de.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[355],{32808:function(e,n,t){t.d(n,{Z:function(){return N}});var r=t(4942),o=t(87462),a=t(94184),i=t.n(a),l=t(50132),c=t(67294),d=t(53124),s=t(65223),u=t(74902),f=t(97685),p=t(98423),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 o=0;for(r=Object.getOwnPropertySymbols(e);o0&&(a=M().map((function(e){return c.createElement(k,{prefixCls:L,key:e.value.toString(),disabled:"disabled"in e?e.disabled:C.disabled,value:e.value,checked:-1!==S.indexOf(e.value),onChange:e.onChange,className:"".concat(T,"-item"),style:e.style},e.label)})));var A={toggleOption:function(e){var n=S.indexOf(e.value),t=(0,u.Z)(S);-1===n?t.push(e.value):t.splice(n,1),"value"in C||K(t);var r=M();null===x||void 0===x||x(t.filter((function(e){return-1!==D.indexOf(e)})).sort((function(e,n){return r.findIndex((function(n){return n.value===e}))-r.findIndex((function(e){return e.value===n}))})))},value:S,disabled:C.disabled,name:C.name,registerValue:function(e){R((function(n){return[].concat((0,u.Z)(n),[e])}))},cancelValue:function(e){R((function(n){return n.filter((function(n){return n!==e}))}))}},H=i()(T,(0,r.Z)({},"".concat(T,"-rtl"),"rtl"===N),y);return c.createElement("div",(0,o.Z)({className:H,style:g},I,{ref:n}),c.createElement(m.Provider,{value:A},a))},y=c.forwardRef(h),g=c.memo(y),x=t(98866),C=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 o=0;for(r=Object.getOwnPropertySymbols(e);o=t}(t,p||1,null===e||void 0===e?void 0:e.startRow,null===e||void 0===e?void 0:e.endRow);return{onHover:null===e||void 0===e?void 0:e.onHover,hovering:n}})),m=v.onHover,y=v.hovering;return u.createElement(z,(0,a.Z)({},e,{colSpan:f,rowSpan:p,hovering:y,ref:n,onHover:m}))}));_.displayName="WrappedCell";var F=_,j=u.createContext(null);function B(e,n,t,r,o){var a,i,l=t[e]||{},c=t[n]||{};"left"===l.fixed?a=r.left[e]:"right"===c.fixed&&(i=r.right[n]);var d=!1,s=!1,u=!1,f=!1,p=t[n+1],v=t[e-1];if("rtl"===o){if(void 0!==a)f=!(v&&"left"===v.fixed);else if(void 0!==i){u=!(p&&"right"===p.fixed)}}else if(void 0!==a){d=!(p&&"left"===p.fixed)}else if(void 0!==i){s=!(v&&"right"===v.fixed)}return{fixLeft:a,fixRight:i,lastFixLeft:d,firstFixRight:s,lastFixRight:u,firstFixLeft:f,isSticky:r.isSticky}}function V(e){var n,t=e.cells,r=e.stickyOffsets,o=e.flattenColumns,i=e.rowComponent,l=e.cellComponent,c=e.onHeaderRow,d=e.index,s=u.useContext(j),f=s.prefixCls,p=s.direction;c&&(n=c(t.map((function(e){return e.column})),d));var v=w(t.map((function(e){return e.column})));return u.createElement(i,n,t.map((function(e,n){var t,i=e.column,c=B(e.colStart,e.colEnd,o,r,p);return i&&i.onHeaderCell&&(t=e.column.onHeaderCell(i)),u.createElement(F,(0,a.Z)({},e,{ellipsis:i.ellipsis,align:i.align,component:l,prefixCls:f,key:v[n]},c,{additionalProps:t,rowType:"header"}))})))}V.displayName="HeaderRow";var W=V;var U=function(e){var n=e.stickyOffsets,t=e.columns,r=e.flattenColumns,o=e.onHeaderRow,a=u.useContext(j),i=a.prefixCls,l=a.getComponent,c=u.useMemo((function(){return function(e){var n=[];!function e(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n[o]=n[o]||[];var a=r;return t.filter(Boolean).map((function(t){var r={key:t.key,className:t.className||"",children:t.title,column:t,colStart:a},i=1,l=t.children;return l&&l.length>0&&(i=e(l,a,o+1).reduce((function(e,n){return e+n}),0),r.hasSubColumns=!0),"colSpan"in t&&(i=t.colSpan),"rowSpan"in t&&(r.rowSpan=t.rowSpan),r.colSpan=i,r.colEnd=r.colStart+i-1,n[o].push(r),a+=i,i}))}(e,0);for(var t=n.length,r=function(e){n[e].forEach((function(n){"rowSpan"in n||n.hasSubColumns||(n.rowSpan=t-e)}))},o=0;o1?t-1:0),a=1;a0?[].concat((0,s.Z)(e),(0,s.Z)(ue(o).map((function(e){return(0,d.Z)({fixed:r},e)})))):[].concat((0,s.Z)(e),[(0,d.Z)((0,d.Z)({},n),{},{fixed:r})])}),[])}var fe=function(e,n){var t=e.prefixCls,r=e.columns,a=e.children,i=e.expandable,l=e.expandedKeys,c=e.columnTitle,s=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,v=e.rowExpandable,m=e.expandIconColumnIndex,h=e.direction,y=e.expandRowByClick,g=e.columnWidth,x=e.fixed,C=u.useMemo((function(){return r||se(a)}),[r,a]),E=u.useMemo((function(){if(i){var e,n=C.slice();if(!n.includes(le)){var r=m||0;r>=0&&n.splice(r,0,le)}0;var a=n.indexOf(le);n=n.filter((function(e,n){return e!==le||n===a}));var d,h=C[a];d="left"!==x&&!x||m?"right"!==x&&!x||m!==C.length?h?h.fixed:null:"right":"left";var E=(e={},(0,o.Z)(e,ie,{className:"".concat(t,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),(0,o.Z)(e,"title",c),(0,o.Z)(e,"fixed",d),(0,o.Z)(e,"className","".concat(t,"-row-expand-icon-cell")),(0,o.Z)(e,"width",g),(0,o.Z)(e,"render",(function(e,n,r){var o=s(n,r),a=l.has(o),i=!v||v(n),c=p({prefixCls:t,expanded:a,expandable:i,record:n,onExpand:f});return y?u.createElement("span",{onClick:function(e){return e.stopPropagation()}},c):c})),e);return n.map((function(e){return e===le?E:e}))}return C.filter((function(e){return e!==le}))}),[i,C,s,l,p,h]),Z=u.useMemo((function(){var e=E;return n&&(e=n(e)),e.length||(e=[{render:function(){return null}}]),e}),[n,E,h]),N=u.useMemo((function(){return"rtl"===h?function(e){return e.map((function(e){var n=e.fixed,t=(0,k.Z)(e,de),r=n;return"left"===n?r="right":"right"===n&&(r="left"),(0,d.Z)({fixed:r},t)}))}(ue(Z)):ue(Z)}),[Z,h]);return[Z,N]};function pe(e){var n=(0,u.useRef)(e),t=(0,u.useState)({}),r=(0,i.Z)(t,2)[1],o=(0,u.useRef)(null),a=(0,u.useRef)([]);return(0,u.useEffect)((function(){return function(){o.current=null}}),[]),[n.current,function(e){a.current.push(e);var t=Promise.resolve();o.current=t,t.then((function(){if(o.current===t){var e=a.current,i=n.current;a.current=[],e.forEach((function(e){n.current=e(n.current)})),o.current=null,i!==n.current&&r({})}}))}]}var ve=function(e,n,t){return(0,u.useMemo)((function(){for(var r=[],o=[],a=0,i=0,l=0;l=0;i-=1){var l=n[i],c=t&&t[i],d=c&&c[ie];if(l||d||o){var s=d||{},f=(s.columnType,(0,k.Z)(s,me));r.unshift(u.createElement("col",(0,a.Z)({key:i,style:{width:l}},f))),o=!0}}return u.createElement("colgroup",null,r)};var ye=function(e){var n=e.className,t=e.children;return u.createElement("div",{className:n},t)},ge=u.createContext({});var xe=["children"];function Ce(e){return e.children}Ce.Row=function(e){var n=e.children,t=(0,k.Z)(e,xe);return u.createElement("tr",t,n)},Ce.Cell=function(e){var n=e.className,t=e.index,r=e.children,o=e.colSpan,i=void 0===o?1:o,l=e.rowSpan,c=e.align,d=u.useContext(j),s=d.prefixCls,f=d.direction,p=u.useContext(ge),v=p.scrollColumnIndex,m=p.stickyOffsets,h=t+i-1+1===v?i+1:i,y=B(t,t+h-1,p.flattenColumns,m,f);return u.createElement(F,(0,a.Z)({className:n,index:t,component:"td",prefixCls:s,record:null,dataIndex:null,align:c,colSpan:h,rowSpan:l,render:function(){return r}},y))};var Ee=Ce;var ke=function(e){var n=e.children,t=e.stickyOffsets,r=e.flattenColumns,o=u.useContext(j).prefixCls,a=r.length-1,i=r[a],l=u.useMemo((function(){return{stickyOffsets:t,flattenColumns:r,scrollColumnIndex:(null===i||void 0===i?void 0:i.scrollbar)?a:null}}),[i,r,a,t]);return u.createElement(ge.Provider,{value:l},u.createElement("tfoot",{className:"".concat(o,"-summary")},n))},Ze=Ee;function Ne(e){var n,t=e.prefixCls,r=e.record,a=e.onExpand,i=e.expanded,l=e.expandable,d="".concat(t,"-row-expand-icon");if(!l)return u.createElement("span",{className:c()(d,"".concat(t,"-row-spaced"))});return u.createElement("span",{className:c()(d,(n={},(0,o.Z)(n,"".concat(t,"-row-expanded"),i),(0,o.Z)(n,"".concat(t,"-row-collapsed"),!i),n)),onClick:function(e){a(r,e),e.stopPropagation()}})}var be=t(64019),we=t(27678),Se=function(e,n){var t,r,a=e.scrollBodyRef,l=e.onScroll,s=e.offsetScroll,f=e.container,p=u.useContext(j).prefixCls,v=(null===(t=a.current)||void 0===t?void 0:t.scrollWidth)||0,m=(null===(r=a.current)||void 0===r?void 0:r.clientWidth)||0,h=v&&m*(m/v),y=u.useRef(),g=pe({scrollLeft:0,isHiddenScrollBar:!1}),C=(0,i.Z)(g,2),E=C[0],k=C[1],Z=u.useRef({delta:0,x:0}),N=u.useState(!1),b=(0,i.Z)(N,2),w=b[0],S=b[1],K=function(){S(!1)},O=function(e){var n,t=(e||(null===(n=window)||void 0===n?void 0:n.event)).buttons;if(w&&0!==t){var r=Z.current.x+e.pageX-Z.current.x-Z.current.delta;r<=0&&(r=0),r+h>=m&&(r=m-h),l({scrollLeft:r/m*(v+2)}),Z.current.x=e.pageX}else w&&S(!1)},P=function(){if(a.current){var e=(0,we.os)(a.current).top,n=e+a.current.offsetHeight,t=f===window?document.documentElement.scrollTop+window.innerHeight:(0,we.os)(f).top+f.clientHeight;n-(0,x.Z)()<=t||e>=t-s?k((function(e){return(0,d.Z)((0,d.Z)({},e),{},{isHiddenScrollBar:!0})})):k((function(e){return(0,d.Z)((0,d.Z)({},e),{},{isHiddenScrollBar:!1})}))}},D=function(e){k((function(n){return(0,d.Z)((0,d.Z)({},n),{},{scrollLeft:e/v*m||0})}))};return u.useImperativeHandle(n,(function(){return{setScrollLeft:D}})),u.useEffect((function(){var e=(0,be.Z)(document.body,"mouseup",K,!1),n=(0,be.Z)(document.body,"mousemove",O,!1);return P(),function(){e.remove(),n.remove()}}),[h,w]),u.useEffect((function(){var e=(0,be.Z)(f,"scroll",P,!1),n=(0,be.Z)(window,"resize",P,!1);return function(){e.remove(),n.remove()}}),[f]),u.useEffect((function(){E.isHiddenScrollBar||k((function(e){var n=a.current;return n?(0,d.Z)((0,d.Z)({},e),{},{scrollLeft:n.scrollLeft/n.scrollWidth*n.clientWidth}):e}))}),[E.isHiddenScrollBar]),v<=m||!h||E.isHiddenScrollBar?null:u.createElement("div",{style:{height:(0,x.Z)(),width:m,bottom:s},className:"".concat(p,"-sticky-scroll")},u.createElement("div",{onMouseDown:function(e){e.persist(),Z.current.delta=e.pageX-E.scrollLeft,Z.current.x=0,S(!0),e.preventDefault()},ref:y,className:c()("".concat(p,"-sticky-scroll-bar"),(0,o.Z)({},"".concat(p,"-sticky-scroll-bar-active"),w)),style:{width:"".concat(h,"px"),transform:"translate3d(".concat(E.scrollLeft,"px, 0, 0)")}}))},Ke=u.forwardRef(Se),Oe=(0,t(98924).Z)()?window:null;var Pe=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];var De=u.forwardRef((function(e,n){var t=e.className,r=e.noData,a=e.columns,i=e.flattenColumns,l=e.colWidths,f=e.columCount,p=e.stickyOffsets,v=e.direction,m=e.fixHeader,h=e.stickyTopOffset,y=e.stickyBottomOffset,g=e.stickyClassName,x=e.onScroll,C=e.maxContentScroll,E=e.children,N=(0,k.Z)(e,Pe),b=u.useContext(j),w=b.prefixCls,S=b.scrollbarSize,K=b.isSticky,O=K&&!m?0:S,P=u.useRef(null),D=u.useCallback((function(e){(0,Z.mH)(n,e),(0,Z.mH)(P,e)}),[]);u.useEffect((function(){var e;function n(e){var n=e.currentTarget,t=e.deltaX;t&&(x({currentTarget:n,scrollLeft:n.scrollLeft+t}),e.preventDefault())}return null===(e=P.current)||void 0===e||e.addEventListener("wheel",n),function(){var e;null===(e=P.current)||void 0===e||e.removeEventListener("wheel",n)}}),[]);var R=u.useMemo((function(){return i.every((function(e){return e.width>=0}))}),[i]),M=i[i.length-1],L={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(w,"-cell-scrollbar")}}},T=(0,u.useMemo)((function(){return O?[].concat((0,s.Z)(a),[L]):a}),[O,a]),I=(0,u.useMemo)((function(){return O?[].concat((0,s.Z)(i),[L]):i}),[O,i]),A=(0,u.useMemo)((function(){var e=p.right,n=p.left;return(0,d.Z)((0,d.Z)({},p),{},{left:"rtl"===v?[].concat((0,s.Z)(n.map((function(e){return e+O}))),[0]):n,right:"rtl"===v?e:[].concat((0,s.Z)(e.map((function(e){return e+O}))),[0]),isSticky:K})}),[O,p,K]),H=function(e,n){return(0,u.useMemo)((function(){for(var t=[],r=0;r0)):(ln(a>0),un(a1&&void 0!==arguments[1]?arguments[1]:{},t=n.getContainer,r=void 0===t?function(){return window}:t,o=n.callback,a=n.duration,i=void 0===a?450:a,l=r(),c=Ye(l,!0),d=Date.now(),s=function n(){var t=Date.now()-d,r=Xe(t>i?i:t,c,e,i);qe(l)?l.scrollTo(window.pageXOffset,r):l instanceof HTMLDocument||"HTMLDocument"===l.constructor.name?l.documentElement.scrollTop=r:l.scrollTop=r,t0&&(M=x.map((function(e){return"string"===typeof e||"number"===typeof e?u.createElement(On,{key:e.toString(),prefixCls:D,disabled:k,value:e,checked:v===e},e):u.createElement(On,{key:"radio-group-value-options-".concat(e.value),prefixCls:D,disabled:e.disabled||k,value:e.value,checked:v===e.value,style:e.style},e.label)})));var L=N||s,T=c()(R,"".concat(R,"-").concat(E),(t={},(0,o.Z)(t,"".concat(R,"-").concat(L),L),(0,o.Z)(t,"".concat(R,"-rtl"),"rtl"===d),t),g);return u.createElement("div",(0,a.Z)({},(0,gn.Z)(e),{className:T,style:b,onMouseEnter:S,onMouseLeave:K,onFocus:O,onBlur:P,id:w,ref:n}),u.createElement(Cn,{value:{onChange:function(n){var t=v,r=n.target.value;"value"in e||m(r);var o=e.onChange;o&&r!==t&&o(n)},value:v,disabled:e.disabled,name:e.name,optionType:e.optionType}},M))})),Dn=u.memo(Pn),Rn=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 o=0;for(r=Object.getOwnPropertySymbols(e);o1&&void 0!==arguments[1]?arguments[1]:null;return t.map((function(u,f){for(var p,v=pt(r?r.pos:"0",f),m=Yn(u[a],v),h=0;h1&&void 0!==arguments[1]?arguments[1]:{},t=n.initWrapper,r=n.processEntity,o=n.onProcessFinished,a=n.externalGetKey,i=n.childrenPropName,l=n.fieldNames,c=arguments.length>2?arguments[2]:void 0,d=a||c,s={},u={},f={posEntities:s,keyEntities:u};return t&&(f=t(f)||f),et(e,(function(e){var n=e.node,t=e.index,o=e.pos,a=e.key,i=e.parentPos,l=e.level,c={node:n,nodes:e.nodes,index:t,key:a,pos:o,level:l},d=Yn(a,o);s[o]=c,u[d]=c,c.parent=s[i],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c)),r&&r(c,f)}),{externalGetKey:d,childrenPropName:i,fieldNames:l}),o&&o(f),f}function tt(e,n){var t=n.expandedKeys,r=n.selectedKeys,o=n.loadedKeys,a=n.loadingKeys,i=n.checkedKeys,l=n.halfCheckedKeys,c=n.dragOverNodeKey,d=n.dropPosition,s=n.keyEntities[e];return{eventKey:e,expanded:-1!==t.indexOf(e),selected:-1!==r.indexOf(e),loaded:-1!==o.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==i.indexOf(e),halfChecked:-1!==l.indexOf(e),pos:String(s?s.pos:""),dragOver:c===e&&0===d,dragOverGapTop:c===e&&-1===d,dragOverGapBottom:c===e&&1===d}}function rt(e){var n=e.data,t=e.expanded,r=e.selected,o=e.checked,a=e.loaded,i=e.loading,l=e.halfChecked,c=e.dragOver,s=e.dragOverGapTop,u=e.dragOverGapBottom,f=e.pos,p=e.active,v=e.eventKey,m=(0,d.Z)((0,d.Z)({},n),{},{expanded:t,selected:r,checked:o,loaded:a,loading:i,halfChecked:l,dragOver:c,dragOverGapTop:s,dragOverGapBottom:u,pos:f,active:p,key:v});return"props"in m||Object.defineProperty(m,"props",{get:function(){return(0,y.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}var ot=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],at="open",it="close",lt=function(e){(0,Bn.Z)(t,e);var n=(0,Vn.Z)(t);function t(){var e;(0,_n.Z)(this,t);for(var r=arguments.length,o=new Array(r),a=0;a=0&&t.splice(r,1),t}function ut(e,n){var t=(e||[]).slice();return-1===t.indexOf(n)&&t.push(n),t}function ft(e){return e.split("-")}function pt(e,n){return"".concat(e,"-").concat(n)}function vt(e,n){var t=[];return function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];n.forEach((function(n){var r=n.key,o=n.children;t.push(r),e(o)}))}(n[e].children),t}function mt(e){if(e.parent){var n=ft(e.pos);return Number(n[n.length-1])===e.parent.children.length-1}return!1}function ht(e,n,t,r,o,a,i,l,c,d){var s,u=e.clientX,f=e.clientY,p=e.target.getBoundingClientRect(),v=p.top,m=p.height,h=(("rtl"===d?-1:1)*(((null===o||void 0===o?void 0:o.x)||0)-u)-12)/r,y=l[t.props.eventKey];if(f-1.5?a({dragNode:w,dropNode:S,dropPosition:1})?Z=1:K=!1:a({dragNode:w,dropNode:S,dropPosition:0})?Z=0:a({dragNode:w,dropNode:S,dropPosition:1})?Z=1:K=!1:a({dragNode:w,dropNode:S,dropPosition:1})?Z=1:K=!1,{dropPosition:Z,dropLevelOffset:N,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:k,dropContainerKey:0===Z?null:(null===(s=y.parent)||void 0===s?void 0:s.key)||null,dropAllowed:K}}function yt(e,n){if(e)return n.multiple?e.slice():e.length?[e[0]]:e}function gt(e){if(!e)return null;var n;if(Array.isArray(e))n={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,r.Z)(e))return(0,y.ZP)(!1,"`checkedKeys` is not an array or an object"),null;n={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return n}function xt(e,n){var t=new Set;function r(e){if(!t.has(e)){var o=n[e];if(o){t.add(e);var a=o.parent;o.node.disabled||a&&r(a.key)}}}return(e||[]).forEach((function(e){r(e)})),(0,s.Z)(t)}var Ct=t(73453),Et=t(62874),kt=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],Zt=function(e,n){var t=e.className,r=e.style,o=e.motion,l=e.motionNodes,d=e.motionType,s=e.onMotionStart,f=e.onMotionEnd,p=e.active,v=e.treeNodeRequiredProps,m=(0,k.Z)(e,kt),h=u.useState(!0),y=(0,i.Z)(h,2),g=y[0],x=y[1],C=u.useContext(Un).prefixCls,E=u.useRef(!1),Z=function(){E.current||f(),E.current=!0};return(0,u.useEffect)((function(){l&&"hide"===d&&g&&x(!1)}),[l]),(0,u.useEffect)((function(){return l&&s(),function(){l&&Z()}}),[]),l?u.createElement(Et.Z,(0,a.Z)({ref:n,visible:g},o,{motionAppear:"show"===d,onAppearEnd:Z,onLeaveEnd:Z}),(function(e,n){var t=e.className,r=e.style;return u.createElement("div",{ref:n,className:c()("".concat(C,"-treenode-motion"),t),style:r},l.map((function(e){var n=(0,a.Z)({},e.data),t=e.title,r=e.key,o=e.isStart,i=e.isEnd;delete n.children;var l=tt(r,v);return u.createElement(dt,(0,a.Z)({},n,l,{title:t,active:p,data:e.data,key:r,isStart:o,isEnd:i}))})))})):u.createElement(dt,(0,a.Z)({domRef:n,className:t,style:r},m,{active:p}))};Zt.displayName="MotionTreeNode";var Nt=u.forwardRef(Zt);function bt(e,n,t){var r=e.findIndex((function(e){return e.key===t})),o=e[r+1],a=n.findIndex((function(e){return e.key===t}));if(o){var i=n.findIndex((function(e){return e.key===o.key}));return n.slice(a+1,i)}return n.slice(a+1)}var wt=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],St={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Kt=function(){},Ot="RC_TREE_MOTION_".concat(Math.random()),Pt={key:Ot},Dt={key:Ot,level:0,index:0,pos:"0",node:Pt,nodes:[Pt]},Rt={parent:null,children:[],pos:Dt.pos,data:Pt,title:null,key:Ot,isStart:[],isEnd:[]};function Mt(e,n,t,r){return!1!==n&&t?e.slice(0,Math.ceil(t/r)+1):e}function Lt(e){return Yn(e.key,e.pos)}var Tt=u.forwardRef((function(e,n){var t=e.prefixCls,r=e.data,o=(e.selectable,e.checkable,e.expandedKeys),l=e.selectedKeys,c=e.checkedKeys,d=e.loadedKeys,s=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,v=e.disabled,m=e.dragging,h=e.dragOverNodeKey,y=e.dropPosition,g=e.motion,x=e.height,C=e.itemHeight,E=e.virtual,Z=e.focusable,N=e.activeItem,b=e.focused,w=e.tabIndex,S=e.onKeyDown,K=e.onFocus,O=e.onBlur,P=e.onActiveChange,D=e.onListChangeStart,R=e.onListChangeEnd,M=(0,k.Z)(e,wt),L=u.useRef(null),T=u.useRef(null);u.useImperativeHandle(n,(function(){return{scrollTo:function(e){L.current.scrollTo(e)},getIndentWidth:function(){return T.current.offsetWidth}}}));var I=u.useState(o),A=(0,i.Z)(I,2),H=A[0],z=A[1],_=u.useState(r),F=(0,i.Z)(_,2),j=F[0],B=F[1],V=u.useState(r),W=(0,i.Z)(V,2),U=W[0],G=W[1],X=u.useState([]),q=(0,i.Z)(X,2),Y=q[0],$=q[1],J=u.useState(null),Q=(0,i.Z)(J,2),ee=Q[0],ne=Q[1],te=u.useRef(r);function re(){var e=te.current;B(e),G(e),$([]),ne(null),R()}te.current=r,u.useEffect((function(){z(o);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=e.length,r=n.length;if(1!==Math.abs(t-r))return{add:!1,key:null};function o(e,n){var t=new Map;e.forEach((function(e){t.set(e,!0)}));var r=n.filter((function(e){return!t.has(e)}));return 1===r.length?r[0]:null}return t ").concat(n);return n}(N)),u.createElement("div",null,u.createElement("input",{style:St,disabled:!1===Z||v,tabIndex:!1!==Z?w:null,onKeyDown:S,onFocus:K,onBlur:O,value:"",onChange:Kt,"aria-label":"for screen reader"})),u.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden"}},u.createElement("div",{className:"".concat(t,"-indent")},u.createElement("div",{ref:T,className:"".concat(t,"-indent-unit")}))),u.createElement(Ct.Z,(0,a.Z)({},M,{data:oe,itemKey:Lt,height:x,fullHeight:!1,virtual:E,itemHeight:C,prefixCls:"".concat(t,"-list"),ref:L,onVisibleChange:function(e,n){var t=new Set(e);n.filter((function(e){return!t.has(e)})).some((function(e){return Lt(e)===Ot}))&&re()}}),(function(e){var n=e.pos,t=(0,a.Z)({},e.data),r=e.title,o=e.key,i=e.isStart,l=e.isEnd,c=Yn(o,n);delete t.key,delete t.children;var d=tt(c,ae);return u.createElement(Nt,(0,a.Z)({},t,d,{title:r,active:!!N&&o===N.key,pos:n,data:e.data,isStart:i,isEnd:l,motion:g,motionNodes:o===Ot?Y:null,motionType:ee,onMotionStart:D,onMotionEnd:re,treeNodeRequiredProps:ae,onMouseMove:function(){P(null)}}))})))}));Tt.displayName="NodeList";var It=Tt;function At(e,n){var t=new Set;return e.forEach((function(e){n.has(e)||t.add(e)})),t}function Ht(e){var n=e||{},t=n.disabled,r=n.disableCheckbox,o=n.checkable;return!(!t&&!r)||!1===o}function zt(e,n,t,r){var o,a=[];o=r||Ht;var i,l=new Set(e.filter((function(e){var n=!!t[e];return n||a.push(e),n}))),c=new Map,d=0;return Object.keys(t).forEach((function(e){var n=t[e],r=n.level,o=c.get(r);o||(o=new Set,c.set(r,o)),o.add(n),d=Math.max(d,r)})),(0,y.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map((function(e){return"'".concat(e,"'")})).join(", "))),i=!0===n?function(e,n,t,r){for(var o=new Set(e),a=new Set,i=0;i<=t;i+=1)(n.get(i)||new Set).forEach((function(e){var n=e.key,t=e.node,a=e.children,i=void 0===a?[]:a;o.has(n)&&!r(t)&&i.filter((function(e){return!r(e.node)})).forEach((function(e){o.add(e.key)}))}));for(var l=new Set,c=t;c>=0;c-=1)(n.get(c)||new Set).forEach((function(e){var n=e.parent,t=e.node;if(!r(t)&&e.parent&&!l.has(e.parent.key))if(r(e.parent.node))l.add(n.key);else{var i=!0,c=!1;(n.children||[]).filter((function(e){return!r(e.node)})).forEach((function(e){var n=e.key,t=o.has(n);i&&!t&&(i=!1),c||!t&&!a.has(n)||(c=!0)})),i&&o.add(n.key),c&&a.add(n.key),l.add(n.key)}}));return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(At(a,o))}}(l,c,d,o):function(e,n,t,r,o){for(var a=new Set(e),i=new Set(n),l=0;l<=r;l+=1)(t.get(l)||new Set).forEach((function(e){var n=e.key,t=e.node,r=e.children,l=void 0===r?[]:r;a.has(n)||i.has(n)||o(t)||l.filter((function(e){return!o(e.node)})).forEach((function(e){a.delete(e.key)}))}));i=new Set;for(var c=new Set,d=r;d>=0;d-=1)(t.get(d)||new Set).forEach((function(e){var n=e.parent,t=e.node;if(!o(t)&&e.parent&&!c.has(e.parent.key))if(o(e.parent.node))c.add(n.key);else{var r=!0,l=!1;(n.children||[]).filter((function(e){return!o(e.node)})).forEach((function(e){var n=e.key,t=a.has(n);r&&!t&&(r=!1),l||!t&&!i.has(n)||(l=!0)})),r||a.delete(n.key),l&&i.add(n.key),c.add(n.key)}}));return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(At(i,a))}}(l,n.halfCheckedKeys,c,d,o),i}var _t=function(e){(0,Bn.Z)(t,e);var n=(0,Vn.Z)(t);function t(){var e;(0,_n.Z)(this,t);for(var r=arguments.length,o=new Array(r),a=0;a2&&void 0!==arguments[2]&&arguments[2],a=e.state,i=a.dragChildrenKeys,l=a.dropPosition,c=a.dropTargetKey,s=a.dropTargetPos,u=a.dropAllowed;if(u){var f=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==c){var p=(0,d.Z)((0,d.Z)({},tt(c,e.getTreeNodeRequiredProps())),{},{active:(null===(r=e.getActiveItem())||void 0===r?void 0:r.key)===c,data:e.state.keyEntities[c].node}),v=-1!==i.indexOf(c);(0,y.ZP)(!v,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var m=ft(s),h={event:n,node:rt(p),dragNode:e.dragNode?rt(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(i),dropToGap:0!==l,dropPosition:l+Number(m[m.length-1])};o||null===f||void 0===f||f(h),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(n,t){var r=e.state,o=r.expandedKeys,a=r.flattenNodes,i=t.expanded,l=t.key;if(!(t.isLeaf||n.shiftKey||n.metaKey||n.ctrlKey)){var c=a.filter((function(e){return e.key===l}))[0],s=rt((0,d.Z)((0,d.Z)({},tt(l,e.getTreeNodeRequiredProps())),{},{data:c.data}));e.setExpandedKeys(i?st(o,l):ut(o,l)),e.onNodeExpand(n,s)}},e.onNodeClick=function(n,t){var r=e.props,o=r.onClick;"click"===r.expandAction&&e.triggerExpandActionExpand(n,t),null===o||void 0===o||o(n,t)},e.onNodeDoubleClick=function(n,t){var r=e.props,o=r.onDoubleClick;"doubleClick"===r.expandAction&&e.triggerExpandActionExpand(n,t),null===o||void 0===o||o(n,t)},e.onNodeSelect=function(n,t){var r=e.state.selectedKeys,o=e.state,a=o.keyEntities,i=o.fieldNames,l=e.props,c=l.onSelect,d=l.multiple,s=t.selected,u=t[i.key],f=!s,p=(r=f?d?ut(r,u):[u]:st(r,u)).map((function(e){var n=a[e];return n?n.node:null})).filter((function(e){return e}));e.setUncontrolledState({selectedKeys:r}),null===c||void 0===c||c(r,{event:"select",selected:f,node:t,selectedNodes:p,nativeEvent:n.nativeEvent})},e.onNodeCheck=function(n,t,r){var o,a=e.state,i=a.keyEntities,l=a.checkedKeys,c=a.halfCheckedKeys,d=e.props,u=d.checkStrictly,f=d.onCheck,p=t.key,v={event:"check",node:t,checked:r,nativeEvent:n.nativeEvent};if(u){var m=r?ut(l,p):st(l,p);o={checked:m,halfChecked:st(c,p)},v.checkedNodes=m.map((function(e){return i[e]})).filter((function(e){return e})).map((function(e){return e.node})),e.setUncontrolledState({checkedKeys:m})}else{var h=zt([].concat((0,s.Z)(l),[p]),!0,i),y=h.checkedKeys,g=h.halfCheckedKeys;if(!r){var x=new Set(y);x.delete(p);var C=zt(Array.from(x),{checked:!1,halfCheckedKeys:g},i);y=C.checkedKeys,g=C.halfCheckedKeys}o=y,v.checkedNodes=[],v.checkedNodesPositions=[],v.halfCheckedKeys=g,y.forEach((function(e){var n=i[e];if(n){var t=n.node,r=n.pos;v.checkedNodes.push(t),v.checkedNodesPositions.push({node:t,pos:r})}})),e.setUncontrolledState({checkedKeys:y},!1,{halfCheckedKeys:g})}null===f||void 0===f||f(o,v)},e.onNodeLoad=function(n){var t=n.key,r=new Promise((function(r,o){e.setState((function(a){var i=a.loadedKeys,l=void 0===i?[]:i,c=a.loadingKeys,d=void 0===c?[]:c,s=e.props,u=s.loadData,f=s.onLoad;return u&&-1===l.indexOf(t)&&-1===d.indexOf(t)?(u(n).then((function(){var o=ut(e.state.loadedKeys,t);null===f||void 0===f||f(o,{event:"load",node:n}),e.setUncontrolledState({loadedKeys:o}),e.setState((function(e){return{loadingKeys:st(e.loadingKeys,t)}})),r()})).catch((function(n){if(e.setState((function(e){return{loadingKeys:st(e.loadingKeys,t)}})),e.loadingRetryTimes[t]=(e.loadingRetryTimes[t]||0)+1,e.loadingRetryTimes[t]>=10){var a=e.state.loadedKeys;(0,y.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:ut(a,t)}),r()}o(n)})),{loadingKeys:ut(d,t)}):null}))}));return r.catch((function(){})),r},e.onNodeMouseEnter=function(n,t){var r=e.props.onMouseEnter;null===r||void 0===r||r({event:n,node:t})},e.onNodeMouseLeave=function(n,t){var r=e.props.onMouseLeave;null===r||void 0===r||r({event:n,node:t})},e.onNodeContextMenu=function(n,t){var r=e.props.onRightClick;r&&(n.preventDefault(),r({event:n,node:t}))},e.onFocus=function(){var n=e.props.onFocus;e.setState({focused:!0});for(var t=arguments.length,r=new Array(t),o=0;o1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var o=!1,a=!0,i={};Object.keys(n).forEach((function(t){t in e.props?a=!1:(o=!0,i[t]=n[t])})),!o||t&&!a||e.setState((0,d.Z)((0,d.Z)({},i),r))}},e.scrollTo=function(n){e.listRef.current.scrollTo(n)},e}return(0,Fn.Z)(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props.activeKey;void 0!==e&&e!==this.state.activeKey&&(this.setState({activeKey:e}),null!==e&&this.scrollTo({key:e}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,n,t=this.state,i=t.focused,l=t.flattenNodes,d=t.keyEntities,s=t.draggingNodeKey,f=t.activeKey,v=t.dropLevelOffset,m=t.dropContainerKey,h=t.dropTargetKey,y=t.dropPosition,g=t.dragOverNodeKey,x=t.indent,C=this.props,E=C.prefixCls,k=C.className,Z=C.style,N=C.showLine,b=C.focusable,w=C.tabIndex,S=void 0===w?0:w,K=C.selectable,O=C.showIcon,P=C.icon,D=C.switcherIcon,R=C.draggable,M=C.checkable,L=C.checkStrictly,T=C.disabled,I=C.motion,A=C.loadData,H=C.filterTreeNode,z=C.height,_=C.itemHeight,F=C.virtual,j=C.titleRender,B=C.dropIndicatorRender,V=C.onContextMenu,W=C.onScroll,U=C.direction,G=C.rootClassName,X=C.rootStyle,q=(0,p.Z)(this.props,{aria:!0,data:!0});return R&&(n="object"===(0,r.Z)(R)?R:"function"===typeof R?{nodeDraggable:R}:{}),u.createElement(Un.Provider,{value:{prefixCls:E,selectable:K,showIcon:O,icon:P,switcherIcon:D,draggable:n,draggingNodeKey:s,checkable:M,checkStrictly:L,disabled:T,keyEntities:d,dropLevelOffset:v,dropContainerKey:m,dropTargetKey:h,dropPosition:y,dragOverNodeKey:g,indent:x,direction:U,dropIndicatorRender:B,loadData:A,filterTreeNode:H,titleRender:j,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},u.createElement("div",{role:"tree",className:c()(E,k,G,(e={},(0,o.Z)(e,"".concat(E,"-show-line"),N),(0,o.Z)(e,"".concat(E,"-focused"),i),(0,o.Z)(e,"".concat(E,"-active-focused"),null!==f),e)),style:X},u.createElement(It,(0,a.Z)({ref:this.listRef,prefixCls:E,style:Z,data:l,disabled:T,selectable:K,checkable:!!M,motion:I,dragging:null!==s,height:z,itemHeight:_,virtual:F,focusable:b,focused:i,tabIndex:S,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:V,onScroll:W},this.getTreeNodeRequiredProps(),q))))}}],[{key:"getDerivedStateFromProps",value:function(e,n){var t,r=n.prevProps,a={prevProps:e};function i(n){return!r&&n in e||r&&r[n]!==e[n]}var l=n.fieldNames;if(i("fieldNames")&&(l=$n(e.fieldNames),a.fieldNames=l),i("treeData")?t=e.treeData:i("children")&&((0,y.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),t=Jn(e.children)),t){a.treeData=t;var c=nt(t,{fieldNames:l});a.keyEntities=(0,d.Z)((0,o.Z)({},Ot,Dt),c.keyEntities)}var s,u=a.keyEntities||n.keyEntities;if(i("expandedKeys")||r&&i("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!r&&e.defaultExpandParent?xt(e.expandedKeys,u):e.expandedKeys;else if(!r&&e.defaultExpandAll){var f=(0,d.Z)({},u);delete f[Ot],a.expandedKeys=Object.keys(f).map((function(e){return f[e].key}))}else!r&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?xt(e.defaultExpandedKeys,u):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,t||a.expandedKeys){var p=Qn(t||n.treeData,a.expandedKeys||n.expandedKeys,l);a.flattenNodes=p}if((e.selectable&&(i("selectedKeys")?a.selectedKeys=yt(e.selectedKeys,e):!r&&e.defaultSelectedKeys&&(a.selectedKeys=yt(e.defaultSelectedKeys,e))),e.checkable)&&(i("checkedKeys")?s=gt(e.checkedKeys)||{}:!r&&e.defaultCheckedKeys?s=gt(e.defaultCheckedKeys)||{}:t&&(s=gt(e.checkedKeys)||{checkedKeys:n.checkedKeys,halfCheckedKeys:n.halfCheckedKeys}),s)){var v=s,m=v.checkedKeys,h=void 0===m?[]:m,g=v.halfCheckedKeys,x=void 0===g?[]:g;if(!e.checkStrictly){var C=zt(h,!0,u);h=C.checkedKeys,x=C.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=x}return i("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),t}(u.Component);_t.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var n=e.dropPosition,t=e.dropLevelOffset,r=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(n){case-1:o.top=0,o.left=-t*r;break;case 1:o.bottom=0,o.left=-t*r;break;case 0:o.bottom=0,o.left=r}return u.createElement("div",{style:o})},allowDrop:function(){return!0},expandAction:!1},_t.TreeNode=dt;var Ft=_t,jt=t(33603),Bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},Vt=function(e,n){return u.createElement(an.Z,(0,d.Z)((0,d.Z)({},e),{},{ref:n,icon:Bt}))};Vt.displayName="FileOutlined";var Wt=u.forwardRef(Vt),Ut={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},Gt=function(e,n){return u.createElement(an.Z,(0,d.Z)((0,d.Z)({},e),{},{ref:n,icon:Ut}))};Gt.displayName="FolderOpenOutlined";var Xt=u.forwardRef(Gt),qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},Yt=function(e,n){return u.createElement(an.Z,(0,d.Z)((0,d.Z)({},e),{},{ref:n,icon:qt}))};Yt.displayName="FolderOutlined";var $t,Jt=u.forwardRef(Yt);function Qt(e,n){e.forEach((function(e){var t=e.key,r=e.children;!1!==n(t,e)&&Qt(r||[],n)}))}function er(e){var n=e.treeData,t=e.expandedKeys,r=e.startKey,o=e.endKey,a=[],i=$t.None;if(r&&r===o)return[r];if(!r||!o)return[];return Qt(n,(function(e){if(i===$t.End)return!1;if(function(e){return e===r||e===o}(e)){if(a.push(e),i===$t.None)i=$t.Start;else if(i===$t.Start)return i=$t.End,!1}else i===$t.Start&&a.push(e);return-1!==t.indexOf(e)})),a}function nr(e,n){var t=(0,s.Z)(n),r=[];return Qt(e,(function(e,n){var o=t.indexOf(e);return-1!==o&&(r.push(n),t.splice(o,1)),!!t.length})),r}!function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}($t||($t={}));var tr=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 o=0;for(r=Object.getOwnPropertySymbols(e);o0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1},n=e.confirm,t=e.closeDropdown;n&&Q([]),t&&L(!1),Y(""),z(S?(K||[]).map((function(e){return String(e)})):[])},te=c()((0,o.Z)({},"".concat(s,"-menu-without-submenu"),!(d.filters||[]).some((function(e){return e.children})))),re=function(e){if(e.target.checked){var n=Mr(null===d||void 0===d?void 0:d.filters).map((function(e){return String(e)}));z(n)}else z([])},oe=function e(n){return(n.filters||[]).map((function(n,t){var r=String(n.value),o={title:n.text,key:void 0!==n.value?r:t};return n.children&&(o.children=e({filters:n.children})),o}))},ae=function e(n){var t;return(0,a.Z)((0,a.Z)({},n),{text:n.title,value:n.key,children:(null===(t=n.children)||void 0===t?void 0:t.map((function(n){return e(n)})))||[]})};if("function"===typeof d.filterDropdown)J=d.filterDropdown({prefixCls:"".concat(s,"-custom"),setSelectedKeys:function(e){return _({selectedKeys:e})},selectedKeys:H(),confirm:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0}).closeDropdown&&L(!1),Q(H())},clearFilters:ne,filters:d.filters,visible:t});else if(d.filterDropdown)J=d.filterDropdown;else{var ie=H()||[];J=u.createElement(u.Fragment,null,0===(d.filters||[]).length?u.createElement(vn.Z,{image:vn.Z.PRESENTED_IMAGE_SIMPLE,description:C.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):"tree"===m?u.createElement(u.Fragment,null,u.createElement(wr,{filterSearch:y,value:q,onChange:$,tablePrefixCls:r,locale:C}),u.createElement("div",{className:"".concat(r,"-filter-dropdown-tree")},p?u.createElement(fn.Z,{checked:ie.length===Mr(d.filters).length,indeterminate:ie.length>0&&ie.length0?c:e}),h=Math.ceil((c||e)/m.pageSize);m.current>h&&(m.current=h||1);var y=function(e,n){v({current:null!==e&&void 0!==e?e:1,pageSize:n||m.pageSize})};return!1===n?[{},function(){}]:[(0,a.Z)((0,a.Z)({},m),{onChange:function(e,r){var o;n&&(null===(o=n.onChange)||void 0===o||o.call(n,e,r)),y(e,r),t(e,r||(null===m||void 0===m?void 0:m.pageSize))}}),y]}var zr=t(84506),_r=t(80882),Fr={},jr="SELECT_ALL",Br="SELECT_INVERT",Vr="SELECT_NONE",Wr=[];function Ur(e,n){var t=[];return(e||[]).forEach((function(e){t.push(e),e&&"object"===(0,r.Z)(e)&&n in e&&(t=[].concat((0,s.Z)(t),(0,s.Z)(Ur(e[n],n))))})),t}function Gr(e,n){var t=e||{},r=t.preserveSelectedRowKeys,l=t.selectedRowKeys,c=t.defaultSelectedRowKeys,d=t.getCheckboxProps,f=t.onChange,p=t.onSelect,v=t.onSelectAll,m=t.onSelectInvert,h=t.onSelectNone,y=t.onSelectMultiple,g=t.columnWidth,x=t.type,C=t.selections,E=t.fixed,k=t.renderCell,Z=t.hideSelectAll,N=t.checkStrictly,b=void 0===N||N,w=n.prefixCls,S=n.data,K=n.pageData,O=n.getRecordByKey,P=n.getRowKey,D=n.expandType,R=n.childrenColumnName,M=n.locale,L=n.getPopupContainer,T=(0,yn.Z)(l||c||Wr,{value:l}),I=(0,i.Z)(T,2),A=I[0],H=I[1],z=u.useRef(new Map),_=(0,u.useCallback)((function(e){if(r){var n=new Map;e.forEach((function(e){var t=O(e);!t&&z.current.has(e)&&(t=z.current.get(e)),n.set(e,t)})),z.current=n}}),[O,r]);u.useEffect((function(){_(A)}),[A]);var F=(0,u.useMemo)((function(){return b?{keyEntities:null}:nt(S,{externalGetKey:P,childrenPropName:R})}),[S,P,b,R]).keyEntities,j=(0,u.useMemo)((function(){return Ur(K,R)}),[K,R]),B=(0,u.useMemo)((function(){var e=new Map;return j.forEach((function(n,t){var r=P(n,t),o=(d?d(n):null)||{};e.set(r,o)})),e}),[j,P,d]),V=(0,u.useCallback)((function(e){var n;return!!(null===(n=B.get(P(e)))||void 0===n?void 0:n.disabled)}),[B,P]),W=(0,u.useMemo)((function(){if(b)return[A||[],[]];var e=zt(A,!0,F,V);return[e.checkedKeys||[],e.halfCheckedKeys]}),[A,b,F,V]),U=(0,i.Z)(W,2),G=U[0],X=U[1],q=(0,u.useMemo)((function(){var e="radio"===x?G.slice(0,1):G;return new Set(e)}),[G,x]),Y=(0,u.useMemo)((function(){return"radio"===x?new Set:new Set(X)}),[X,x]),$=(0,u.useState)(null),J=(0,i.Z)($,2),Q=J[0],ee=J[1];u.useEffect((function(){e||H(Wr)}),[!!e]);var ne=(0,u.useCallback)((function(e,n){var t,o;_(e),r?(t=e,o=e.map((function(e){return z.current.get(e)}))):(t=[],o=[],e.forEach((function(e){var n=O(e);void 0!==n&&(t.push(e),o.push(n))}))),H(t),null===f||void 0===f||f(t,o,{type:n})}),[H,O,f,r]),te=(0,u.useCallback)((function(e,n,t,r){if(p){var o=t.map((function(e){return O(e)}));p(O(e),n,o,r)}ne(t,"single")}),[p,O,ne]),re=(0,u.useMemo)((function(){return!C||Z?null:(!0===C?[jr,Br,Vr]:C).map((function(e){return e===jr?{key:"all",text:M.selectionAll,onSelect:function(){ne(S.map((function(e,n){return P(e,n)})).filter((function(e){var n=B.get(e);return!(null===n||void 0===n?void 0:n.disabled)||q.has(e)})),"all")}}:e===Br?{key:"invert",text:M.selectInvert,onSelect:function(){var e=new Set(q);K.forEach((function(n,t){var r=P(n,t),o=B.get(r);(null===o||void 0===o?void 0:o.disabled)||(e.has(r)?e.delete(r):e.add(r))}));var n=Array.from(e);m&&m(n),ne(n,"invert")}}:e===Vr?{key:"none",text:M.selectNone,onSelect:function(){null===h||void 0===h||h(),ne(Array.from(q).filter((function(e){var n=B.get(e);return null===n||void 0===n?void 0:n.disabled})),"none")}}:e})).map((function(e){return(0,a.Z)((0,a.Z)({},e),{onSelect:function(){for(var n,t,r=arguments.length,o=new Array(r),a=0;a2&&void 0!==arguments[2]&&arguments[2],r=(0,a.Z)((0,a.Z)({},le),e);t&&(le.resetPagination(),r.pagination.current&&(r.pagination.current=1),h&&h.onChange&&h.onChange(1,r.pagination.pageSize)),D&&!1!==D.scrollToFirstRowOnChange&&re.body.current&&$e(0,{getContainer:function(){return re.body.current}}),null===Z||void 0===Z||Z(r.pagination,r.filters,r.sorter,{currentDataSource:Tr(lo(q,r.sorterStates,ne),r.filterStates),action:n})},de=co({prefixCls:$,mergedColumns:z,onSorterChange:function(e,n){ce({sorter:e,sorterStates:n},"sort",!1)},sortDirections:R||["ascend","descend"],tableLocale:X,showSorterTooltip:T}),ue=(0,i.Z)(de,4),fe=ue[0],pe=ue[1],ve=ue[2],me=ue[3],he=u.useMemo((function(){return lo(q,pe,ne)}),[q,pe]);le.sorter=me(),le.sorterStates=pe;var ye=Ir({prefixCls:$,locale:X,dropdownPrefixCls:J,mergedColumns:z,onFilterChange:function(e,n){ce({filters:e,filterStates:n},"filter",!0)},getPopupContainer:N}),ge=(0,i.Z)(ye,3),xe=ge[0],Ce=ge[1],Ee=ge[2],ke=Tr(he,Ce);le.filters=Ee,le.filterStates=Ce;var Ze=uo(u.useMemo((function(){var e={};return Object.keys(Ee).forEach((function(n){null!==Ee[n]&&(e[n]=Ee[n])})),(0,a.Z)((0,a.Z)({},ve),{filters:e})}),[ve,Ee])),Ne=(0,i.Z)(Ze,1)[0],be=Hr(ke.length,h,(function(e,n){ce({pagination:(0,a.Z)((0,a.Z)({},le.pagination),{current:e,pageSize:n})},"paginate")})),we=(0,i.Z)(be,2),Se=we[0],Ke=we[1];le.pagination=!1===h?{}:function(e,n){var t={current:n.current,pageSize:n.pageSize},o=e&&"object"===(0,r.Z)(e)?e:{};return Object.keys(o).forEach((function(e){var r=n[e];"function"!==typeof r&&(t[e]=r)})),t}(h,Se),le.resetPagination=Ke;var Oe=u.useMemo((function(){if(!1===h||!Se.pageSize)return ke;var e=Se.current,n=void 0===e?1:e,t=Se.total,r=Se.pageSize,o=void 0===r?10:r;return ke.lengtho?ke.slice((n-1)*o,n*o):ke:ke.slice((n-1)*o,n*o)}),[!!h,ke,Se&&Se.current,Se&&Se.pageSize,Se&&Se.total]),Pe=Gr(y,{prefixCls:$,data:ke,pageData:Oe,getRowKey:oe,getRecordByKey:ie,expandType:te,childrenColumnName:ne,locale:X,getPopupContainer:N}),De=(0,i.Z)(Pe,2),Re=De[0],Me=De[1];Q.__PARENT_RENDER_ICON__=Q.expandIcon,Q.expandIcon=Q.expandIcon||w||en(X),"nest"===te&&void 0===Q.expandIconColumnIndex?Q.expandIconColumnIndex=y?1:0:Q.expandIconColumnIndex>0&&y&&(Q.expandIconColumnIndex-=1),"number"!==typeof Q.indentSize&&(Q.indentSize="number"===typeof P?P:15);var Le,Ie,Ae,Ge=u.useCallback((function(e){return Ne(Re(xe(fe(e))))}),[fe,xe,Re]);if(!1!==h&&(null===Se||void 0===Se?void 0:Se.total)){var Xe;Xe=Se.size?Se.size:"small"===G||"middle"===G?"small":void 0;var qe=function(e){return u.createElement(We.Z,(0,a.Z)({},Se,{className:c()("".concat($,"-pagination ").concat($,"-pagination-").concat(e),Se.className),size:Xe}))},Ye="rtl"===U?"left":"right",Je=Se.position;if(null!==Je&&Array.isArray(Je)){var Qe=Je.find((function(e){return-1!==e.indexOf("top")})),nn=Je.find((function(e){return-1!==e.indexOf("bottom")})),tn=Je.every((function(e){return"none"==="".concat(e)}));Qe||nn||tn||(Ie=qe(Ye)),Qe&&(Le=qe(Qe.toLowerCase().replace("top",""))),nn&&(Ie=qe(nn.toLowerCase().replace("bottom","")))}else Ie=qe(Ye)}"boolean"===typeof b?Ae={spinning:b}:"object"===(0,r.Z)(b)&&(Ae=(0,a.Z)({spinning:!0},b));var rn=c()("".concat($,"-wrapper"),(0,o.Z)({},"".concat($,"-wrapper-rtl"),"rtl"===U),d);return u.createElement("div",{ref:n,className:rn,style:s},u.createElement(Ue.Z,(0,a.Z)({spinning:!1},Ae),Le,u.createElement(He,(0,a.Z)({},_,{columns:z,direction:U,expandable:Q,prefixCls:$,className:c()((t={},(0,o.Z)(t,"".concat($,"-middle"),"middle"===G),(0,o.Z)(t,"".concat($,"-small"),"small"===G),(0,o.Z)(t,"".concat($,"-bordered"),p),(0,o.Z)(t,"".concat($,"-empty"),0===q.length),t)),data:Oe,rowKey:oe,rowClassName:function(e,n,t){var r;return r="function"===typeof x?c()(x(e,n,t)):c()(x),c()((0,o.Z)({},"".concat($,"-row-selected"),Me.has(oe(e,n))),r)},emptyText:M&&M.emptyText||(W||Fe.Z)("Table"),internalHooks:Te,internalRefs:re,transformColumns:Ge})),Ie))}var vo=u.forwardRef(po);vo.defaultProps={rowKey:"key"},vo.SELECTION_COLUMN=Fr,vo.EXPAND_COLUMN=He.EXPAND_COLUMN,vo.SELECTION_ALL=jr,vo.SELECTION_INVERT=Br,vo.SELECTION_NONE=Vr,vo.Column=Je,vo.ColumnGroup=Qe,vo.Summary=Ze;var mo=vo},50132:function(e,n,t){var r=t(87462),o=t(4942),a=t(91),i=t(1413),l=t(15671),c=t(43144),d=t(60136),s=t(33643),u=t(67294),f=t(94184),p=t.n(f),v=function(e){(0,d.Z)(t,e);var n=(0,s.Z)(t);function t(e){var r;(0,l.Z)(this,t),(r=n.call(this,e)).handleChange=function(e){var n=r.props,t=n.disabled,o=n.onChange;t||("checked"in r.props||r.setState({checked:e.target.checked}),o&&o({target:(0,i.Z)((0,i.Z)({},r.props),{},{checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e.nativeEvent}))},r.saveInput=function(e){r.input=e};var o="checked"in e?e.checked:e.defaultChecked;return r.state={checked:o},r}return(0,c.Z)(t,[{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"render",value:function(){var e,n=this.props,t=n.prefixCls,i=n.className,l=n.style,c=n.name,d=n.id,s=n.type,f=n.disabled,v=n.readOnly,m=n.tabIndex,h=n.onClick,y=n.onFocus,g=n.onBlur,x=n.onKeyDown,C=n.onKeyPress,E=n.onKeyUp,k=n.autoFocus,Z=n.value,N=n.required,b=(0,a.Z)(n,["prefixCls","className","style","name","id","type","disabled","readOnly","tabIndex","onClick","onFocus","onBlur","onKeyDown","onKeyPress","onKeyUp","autoFocus","value","required"]),w=Object.keys(b).reduce((function(e,n){return"aria-"!==n.substr(0,5)&&"data-"!==n.substr(0,5)&&"role"!==n||(e[n]=b[n]),e}),{}),S=this.state.checked,K=p()(t,i,(e={},(0,o.Z)(e,"".concat(t,"-checked"),S),(0,o.Z)(e,"".concat(t,"-disabled"),f),e));return u.createElement("span",{className:K,style:l},u.createElement("input",(0,r.Z)({name:c,id:d,type:s,required:N,readOnly:v,disabled:f,tabIndex:m,className:"".concat(t,"-input"),checked:!!S,onClick:h,onFocus:y,onBlur:g,onKeyUp:E,onKeyDown:x,onKeyPress:C,onChange:this.handleChange,autoFocus:k,ref:this.saveInput,value:Z},w)),u.createElement("span",{className:"".concat(t,"-inner")}))}}],[{key:"getDerivedStateFromProps",value:function(e,n){return"checked"in e?(0,i.Z)((0,i.Z)({},n),{},{checked:e.checked}):null}}]),t}(u.Component);v.defaultProps={prefixCls:"rc-checkbox",className:"",style:{},type:"checkbox",defaultChecked:!1,onFocus:function(){},onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){}},n.Z=v},27678:function(e,n,t){t.d(n,{g1:function(){return r},os:function(){return o}});function r(){return{width:document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}}function o(e){var n=e.getBoundingClientRect(),t=document.documentElement;return{left:n.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||document.body.clientLeft||0),top:n.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||document.body.clientTop||0)}}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/3626-ffcb249be5918774.js b/static/web/_next/static/chunks/3626-ffcb249be5918774.js new file mode 100644 index 000000000..cf29343dc --- /dev/null +++ b/static/web/_next/static/chunks/3626-ffcb249be5918774.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3626],{10010:function(e,n,t){t.d(n,{Z:function(){return c}});var r=t(1413),o=t(67294),a={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"},i=t(42135),l=function(e,n){return o.createElement(i.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:n,icon:a}))};l.displayName="CaretUpOutlined";var c=o.forwardRef(l)},32808:function(e,n,t){t.d(n,{Z:function(){return N}});var r=t(4942),o=t(87462),a=t(94184),i=t.n(a),l=t(50132),c=t(67294),d=t(53124),s=t(65223),u=t(74902),f=t(97685),p=t(98423),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 o=0;for(r=Object.getOwnPropertySymbols(e);o0&&(a=M().map((function(e){return c.createElement(k,{prefixCls:L,key:e.value.toString(),disabled:"disabled"in e?e.disabled:C.disabled,value:e.value,checked:-1!==S.indexOf(e.value),onChange:e.onChange,className:"".concat(T,"-item"),style:e.style},e.label)})));var A={toggleOption:function(e){var n=S.indexOf(e.value),t=(0,u.Z)(S);-1===n?t.push(e.value):t.splice(n,1),"value"in C||K(t);var r=M();null===x||void 0===x||x(t.filter((function(e){return-1!==D.indexOf(e)})).sort((function(e,n){return r.findIndex((function(n){return n.value===e}))-r.findIndex((function(e){return e.value===n}))})))},value:S,disabled:C.disabled,name:C.name,registerValue:function(e){R((function(n){return[].concat((0,u.Z)(n),[e])}))},cancelValue:function(e){R((function(n){return n.filter((function(n){return n!==e}))}))}},H=i()(T,(0,r.Z)({},"".concat(T,"-rtl"),"rtl"===N),y);return c.createElement("div",(0,o.Z)({className:H,style:g},I,{ref:n}),c.createElement(m.Provider,{value:A},a))},y=c.forwardRef(h),g=c.memo(y),x=t(98866),C=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 o=0;for(r=Object.getOwnPropertySymbols(e);o=t}(t,p||1,null===e||void 0===e?void 0:e.startRow,null===e||void 0===e?void 0:e.endRow);return{onHover:null===e||void 0===e?void 0:e.onHover,hovering:n}})),m=v.onHover,y=v.hovering;return u.createElement(z,(0,a.Z)({},e,{colSpan:f,rowSpan:p,hovering:y,ref:n,onHover:m}))}));_.displayName="WrappedCell";var F=_,j=u.createContext(null);function B(e,n,t,r,o){var a,i,l=t[e]||{},c=t[n]||{};"left"===l.fixed?a=r.left[e]:"right"===c.fixed&&(i=r.right[n]);var d=!1,s=!1,u=!1,f=!1,p=t[n+1],v=t[e-1];if("rtl"===o){if(void 0!==a)f=!(v&&"left"===v.fixed);else if(void 0!==i){u=!(p&&"right"===p.fixed)}}else if(void 0!==a){d=!(p&&"left"===p.fixed)}else if(void 0!==i){s=!(v&&"right"===v.fixed)}return{fixLeft:a,fixRight:i,lastFixLeft:d,firstFixRight:s,lastFixRight:u,firstFixLeft:f,isSticky:r.isSticky}}function V(e){var n,t=e.cells,r=e.stickyOffsets,o=e.flattenColumns,i=e.rowComponent,l=e.cellComponent,c=e.onHeaderRow,d=e.index,s=u.useContext(j),f=s.prefixCls,p=s.direction;c&&(n=c(t.map((function(e){return e.column})),d));var v=w(t.map((function(e){return e.column})));return u.createElement(i,n,t.map((function(e,n){var t,i=e.column,c=B(e.colStart,e.colEnd,o,r,p);return i&&i.onHeaderCell&&(t=e.column.onHeaderCell(i)),u.createElement(F,(0,a.Z)({},e,{ellipsis:i.ellipsis,align:i.align,component:l,prefixCls:f,key:v[n]},c,{additionalProps:t,rowType:"header"}))})))}V.displayName="HeaderRow";var W=V;var U=function(e){var n=e.stickyOffsets,t=e.columns,r=e.flattenColumns,o=e.onHeaderRow,a=u.useContext(j),i=a.prefixCls,l=a.getComponent,c=u.useMemo((function(){return function(e){var n=[];!function e(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;n[o]=n[o]||[];var a=r;return t.filter(Boolean).map((function(t){var r={key:t.key,className:t.className||"",children:t.title,column:t,colStart:a},i=1,l=t.children;return l&&l.length>0&&(i=e(l,a,o+1).reduce((function(e,n){return e+n}),0),r.hasSubColumns=!0),"colSpan"in t&&(i=t.colSpan),"rowSpan"in t&&(r.rowSpan=t.rowSpan),r.colSpan=i,r.colEnd=r.colStart+i-1,n[o].push(r),a+=i,i}))}(e,0);for(var t=n.length,r=function(e){n[e].forEach((function(n){"rowSpan"in n||n.hasSubColumns||(n.rowSpan=t-e)}))},o=0;o1?t-1:0),a=1;a0?[].concat((0,s.Z)(e),(0,s.Z)(ue(o).map((function(e){return(0,d.Z)({fixed:r},e)})))):[].concat((0,s.Z)(e),[(0,d.Z)((0,d.Z)({},n),{},{fixed:r})])}),[])}var fe=function(e,n){var t=e.prefixCls,r=e.columns,a=e.children,i=e.expandable,l=e.expandedKeys,c=e.columnTitle,s=e.getRowKey,f=e.onTriggerExpand,p=e.expandIcon,v=e.rowExpandable,m=e.expandIconColumnIndex,h=e.direction,y=e.expandRowByClick,g=e.columnWidth,x=e.fixed,C=u.useMemo((function(){return r||se(a)}),[r,a]),E=u.useMemo((function(){if(i){var e,n=C.slice();if(!n.includes(le)){var r=m||0;r>=0&&n.splice(r,0,le)}0;var a=n.indexOf(le);n=n.filter((function(e,n){return e!==le||n===a}));var d,h=C[a];d="left"!==x&&!x||m?"right"!==x&&!x||m!==C.length?h?h.fixed:null:"right":"left";var E=(e={},(0,o.Z)(e,ie,{className:"".concat(t,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),(0,o.Z)(e,"title",c),(0,o.Z)(e,"fixed",d),(0,o.Z)(e,"className","".concat(t,"-row-expand-icon-cell")),(0,o.Z)(e,"width",g),(0,o.Z)(e,"render",(function(e,n,r){var o=s(n,r),a=l.has(o),i=!v||v(n),c=p({prefixCls:t,expanded:a,expandable:i,record:n,onExpand:f});return y?u.createElement("span",{onClick:function(e){return e.stopPropagation()}},c):c})),e);return n.map((function(e){return e===le?E:e}))}return C.filter((function(e){return e!==le}))}),[i,C,s,l,p,h]),Z=u.useMemo((function(){var e=E;return n&&(e=n(e)),e.length||(e=[{render:function(){return null}}]),e}),[n,E,h]),N=u.useMemo((function(){return"rtl"===h?function(e){return e.map((function(e){var n=e.fixed,t=(0,k.Z)(e,de),r=n;return"left"===n?r="right":"right"===n&&(r="left"),(0,d.Z)({fixed:r},t)}))}(ue(Z)):ue(Z)}),[Z,h]);return[Z,N]};function pe(e){var n=(0,u.useRef)(e),t=(0,u.useState)({}),r=(0,i.Z)(t,2)[1],o=(0,u.useRef)(null),a=(0,u.useRef)([]);return(0,u.useEffect)((function(){return function(){o.current=null}}),[]),[n.current,function(e){a.current.push(e);var t=Promise.resolve();o.current=t,t.then((function(){if(o.current===t){var e=a.current,i=n.current;a.current=[],e.forEach((function(e){n.current=e(n.current)})),o.current=null,i!==n.current&&r({})}}))}]}var ve=function(e,n,t){return(0,u.useMemo)((function(){for(var r=[],o=[],a=0,i=0,l=0;l=0;i-=1){var l=n[i],c=t&&t[i],d=c&&c[ie];if(l||d||o){var s=d||{},f=(s.columnType,(0,k.Z)(s,me));r.unshift(u.createElement("col",(0,a.Z)({key:i,style:{width:l}},f))),o=!0}}return u.createElement("colgroup",null,r)};var ye=function(e){var n=e.className,t=e.children;return u.createElement("div",{className:n},t)},ge=u.createContext({});var xe=["children"];function Ce(e){return e.children}Ce.Row=function(e){var n=e.children,t=(0,k.Z)(e,xe);return u.createElement("tr",t,n)},Ce.Cell=function(e){var n=e.className,t=e.index,r=e.children,o=e.colSpan,i=void 0===o?1:o,l=e.rowSpan,c=e.align,d=u.useContext(j),s=d.prefixCls,f=d.direction,p=u.useContext(ge),v=p.scrollColumnIndex,m=p.stickyOffsets,h=t+i-1+1===v?i+1:i,y=B(t,t+h-1,p.flattenColumns,m,f);return u.createElement(F,(0,a.Z)({className:n,index:t,component:"td",prefixCls:s,record:null,dataIndex:null,align:c,colSpan:h,rowSpan:l,render:function(){return r}},y))};var Ee=Ce;var ke=function(e){var n=e.children,t=e.stickyOffsets,r=e.flattenColumns,o=u.useContext(j).prefixCls,a=r.length-1,i=r[a],l=u.useMemo((function(){return{stickyOffsets:t,flattenColumns:r,scrollColumnIndex:(null===i||void 0===i?void 0:i.scrollbar)?a:null}}),[i,r,a,t]);return u.createElement(ge.Provider,{value:l},u.createElement("tfoot",{className:"".concat(o,"-summary")},n))},Ze=Ee;function Ne(e){var n,t=e.prefixCls,r=e.record,a=e.onExpand,i=e.expanded,l=e.expandable,d="".concat(t,"-row-expand-icon");if(!l)return u.createElement("span",{className:c()(d,"".concat(t,"-row-spaced"))});return u.createElement("span",{className:c()(d,(n={},(0,o.Z)(n,"".concat(t,"-row-expanded"),i),(0,o.Z)(n,"".concat(t,"-row-collapsed"),!i),n)),onClick:function(e){a(r,e),e.stopPropagation()}})}var be=t(64019),we=t(27678),Se=function(e,n){var t,r,a=e.scrollBodyRef,l=e.onScroll,s=e.offsetScroll,f=e.container,p=u.useContext(j).prefixCls,v=(null===(t=a.current)||void 0===t?void 0:t.scrollWidth)||0,m=(null===(r=a.current)||void 0===r?void 0:r.clientWidth)||0,h=v&&m*(m/v),y=u.useRef(),g=pe({scrollLeft:0,isHiddenScrollBar:!1}),C=(0,i.Z)(g,2),E=C[0],k=C[1],Z=u.useRef({delta:0,x:0}),N=u.useState(!1),b=(0,i.Z)(N,2),w=b[0],S=b[1],K=function(){S(!1)},O=function(e){var n,t=(e||(null===(n=window)||void 0===n?void 0:n.event)).buttons;if(w&&0!==t){var r=Z.current.x+e.pageX-Z.current.x-Z.current.delta;r<=0&&(r=0),r+h>=m&&(r=m-h),l({scrollLeft:r/m*(v+2)}),Z.current.x=e.pageX}else w&&S(!1)},P=function(){if(a.current){var e=(0,we.os)(a.current).top,n=e+a.current.offsetHeight,t=f===window?document.documentElement.scrollTop+window.innerHeight:(0,we.os)(f).top+f.clientHeight;n-(0,x.Z)()<=t||e>=t-s?k((function(e){return(0,d.Z)((0,d.Z)({},e),{},{isHiddenScrollBar:!0})})):k((function(e){return(0,d.Z)((0,d.Z)({},e),{},{isHiddenScrollBar:!1})}))}},D=function(e){k((function(n){return(0,d.Z)((0,d.Z)({},n),{},{scrollLeft:e/v*m||0})}))};return u.useImperativeHandle(n,(function(){return{setScrollLeft:D}})),u.useEffect((function(){var e=(0,be.Z)(document.body,"mouseup",K,!1),n=(0,be.Z)(document.body,"mousemove",O,!1);return P(),function(){e.remove(),n.remove()}}),[h,w]),u.useEffect((function(){var e=(0,be.Z)(f,"scroll",P,!1),n=(0,be.Z)(window,"resize",P,!1);return function(){e.remove(),n.remove()}}),[f]),u.useEffect((function(){E.isHiddenScrollBar||k((function(e){var n=a.current;return n?(0,d.Z)((0,d.Z)({},e),{},{scrollLeft:n.scrollLeft/n.scrollWidth*n.clientWidth}):e}))}),[E.isHiddenScrollBar]),v<=m||!h||E.isHiddenScrollBar?null:u.createElement("div",{style:{height:(0,x.Z)(),width:m,bottom:s},className:"".concat(p,"-sticky-scroll")},u.createElement("div",{onMouseDown:function(e){e.persist(),Z.current.delta=e.pageX-E.scrollLeft,Z.current.x=0,S(!0),e.preventDefault()},ref:y,className:c()("".concat(p,"-sticky-scroll-bar"),(0,o.Z)({},"".concat(p,"-sticky-scroll-bar-active"),w)),style:{width:"".concat(h,"px"),transform:"translate3d(".concat(E.scrollLeft,"px, 0, 0)")}}))},Ke=u.forwardRef(Se),Oe=(0,t(98924).Z)()?window:null;var Pe=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];var De=u.forwardRef((function(e,n){var t=e.className,r=e.noData,a=e.columns,i=e.flattenColumns,l=e.colWidths,f=e.columCount,p=e.stickyOffsets,v=e.direction,m=e.fixHeader,h=e.stickyTopOffset,y=e.stickyBottomOffset,g=e.stickyClassName,x=e.onScroll,C=e.maxContentScroll,E=e.children,N=(0,k.Z)(e,Pe),b=u.useContext(j),w=b.prefixCls,S=b.scrollbarSize,K=b.isSticky,O=K&&!m?0:S,P=u.useRef(null),D=u.useCallback((function(e){(0,Z.mH)(n,e),(0,Z.mH)(P,e)}),[]);u.useEffect((function(){var e;function n(e){var n=e.currentTarget,t=e.deltaX;t&&(x({currentTarget:n,scrollLeft:n.scrollLeft+t}),e.preventDefault())}return null===(e=P.current)||void 0===e||e.addEventListener("wheel",n),function(){var e;null===(e=P.current)||void 0===e||e.removeEventListener("wheel",n)}}),[]);var R=u.useMemo((function(){return i.every((function(e){return e.width>=0}))}),[i]),M=i[i.length-1],L={fixed:M?M.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(w,"-cell-scrollbar")}}},T=(0,u.useMemo)((function(){return O?[].concat((0,s.Z)(a),[L]):a}),[O,a]),I=(0,u.useMemo)((function(){return O?[].concat((0,s.Z)(i),[L]):i}),[O,i]),A=(0,u.useMemo)((function(){var e=p.right,n=p.left;return(0,d.Z)((0,d.Z)({},p),{},{left:"rtl"===v?[].concat((0,s.Z)(n.map((function(e){return e+O}))),[0]):n,right:"rtl"===v?e:[].concat((0,s.Z)(e.map((function(e){return e+O}))),[0]),isSticky:K})}),[O,p,K]),H=function(e,n){return(0,u.useMemo)((function(){for(var t=[],r=0;r0)):(ln(a>0),un(a1&&void 0!==arguments[1]?arguments[1]:{},t=n.getContainer,r=void 0===t?function(){return window}:t,o=n.callback,a=n.duration,i=void 0===a?450:a,l=r(),c=Ye(l,!0),d=Date.now(),s=function n(){var t=Date.now()-d,r=Xe(t>i?i:t,c,e,i);qe(l)?l.scrollTo(window.pageXOffset,r):l instanceof HTMLDocument||"HTMLDocument"===l.constructor.name?l.documentElement.scrollTop=r:l.scrollTop=r,t0&&(M=x.map((function(e){return"string"===typeof e||"number"===typeof e?u.createElement(On,{key:e.toString(),prefixCls:D,disabled:k,value:e,checked:v===e},e):u.createElement(On,{key:"radio-group-value-options-".concat(e.value),prefixCls:D,disabled:e.disabled||k,value:e.value,checked:v===e.value,style:e.style},e.label)})));var L=N||s,T=c()(R,"".concat(R,"-").concat(E),(t={},(0,o.Z)(t,"".concat(R,"-").concat(L),L),(0,o.Z)(t,"".concat(R,"-rtl"),"rtl"===d),t),g);return u.createElement("div",(0,a.Z)({},(0,gn.Z)(e),{className:T,style:b,onMouseEnter:S,onMouseLeave:K,onFocus:O,onBlur:P,id:w,ref:n}),u.createElement(Cn,{value:{onChange:function(n){var t=v,r=n.target.value;"value"in e||m(r);var o=e.onChange;o&&r!==t&&o(n)},value:v,disabled:e.disabled,name:e.name,optionType:e.optionType}},M))})),Dn=u.memo(Pn),Rn=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 o=0;for(r=Object.getOwnPropertySymbols(e);o1&&void 0!==arguments[1]?arguments[1]:null;return t.map((function(u,f){for(var p,v=pt(r?r.pos:"0",f),m=Yn(u[a],v),h=0;h1&&void 0!==arguments[1]?arguments[1]:{},t=n.initWrapper,r=n.processEntity,o=n.onProcessFinished,a=n.externalGetKey,i=n.childrenPropName,l=n.fieldNames,c=arguments.length>2?arguments[2]:void 0,d=a||c,s={},u={},f={posEntities:s,keyEntities:u};return t&&(f=t(f)||f),et(e,(function(e){var n=e.node,t=e.index,o=e.pos,a=e.key,i=e.parentPos,l=e.level,c={node:n,nodes:e.nodes,index:t,key:a,pos:o,level:l},d=Yn(a,o);s[o]=c,u[d]=c,c.parent=s[i],c.parent&&(c.parent.children=c.parent.children||[],c.parent.children.push(c)),r&&r(c,f)}),{externalGetKey:d,childrenPropName:i,fieldNames:l}),o&&o(f),f}function tt(e,n){var t=n.expandedKeys,r=n.selectedKeys,o=n.loadedKeys,a=n.loadingKeys,i=n.checkedKeys,l=n.halfCheckedKeys,c=n.dragOverNodeKey,d=n.dropPosition,s=n.keyEntities[e];return{eventKey:e,expanded:-1!==t.indexOf(e),selected:-1!==r.indexOf(e),loaded:-1!==o.indexOf(e),loading:-1!==a.indexOf(e),checked:-1!==i.indexOf(e),halfChecked:-1!==l.indexOf(e),pos:String(s?s.pos:""),dragOver:c===e&&0===d,dragOverGapTop:c===e&&-1===d,dragOverGapBottom:c===e&&1===d}}function rt(e){var n=e.data,t=e.expanded,r=e.selected,o=e.checked,a=e.loaded,i=e.loading,l=e.halfChecked,c=e.dragOver,s=e.dragOverGapTop,u=e.dragOverGapBottom,f=e.pos,p=e.active,v=e.eventKey,m=(0,d.Z)((0,d.Z)({},n),{},{expanded:t,selected:r,checked:o,loaded:a,loading:i,halfChecked:l,dragOver:c,dragOverGapTop:s,dragOverGapBottom:u,pos:f,active:p,key:v});return"props"in m||Object.defineProperty(m,"props",{get:function(){return(0,y.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),m}var ot=["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","data","onMouseMove","selectable"],at="open",it="close",lt=function(e){(0,Bn.Z)(t,e);var n=(0,Vn.Z)(t);function t(){var e;(0,_n.Z)(this,t);for(var r=arguments.length,o=new Array(r),a=0;a=0&&t.splice(r,1),t}function ut(e,n){var t=(e||[]).slice();return-1===t.indexOf(n)&&t.push(n),t}function ft(e){return e.split("-")}function pt(e,n){return"".concat(e,"-").concat(n)}function vt(e,n){var t=[];return function e(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];n.forEach((function(n){var r=n.key,o=n.children;t.push(r),e(o)}))}(n[e].children),t}function mt(e){if(e.parent){var n=ft(e.pos);return Number(n[n.length-1])===e.parent.children.length-1}return!1}function ht(e,n,t,r,o,a,i,l,c,d){var s,u=e.clientX,f=e.clientY,p=e.target.getBoundingClientRect(),v=p.top,m=p.height,h=(("rtl"===d?-1:1)*(((null===o||void 0===o?void 0:o.x)||0)-u)-12)/r,y=l[t.props.eventKey];if(f-1.5?a({dragNode:w,dropNode:S,dropPosition:1})?Z=1:K=!1:a({dragNode:w,dropNode:S,dropPosition:0})?Z=0:a({dragNode:w,dropNode:S,dropPosition:1})?Z=1:K=!1:a({dragNode:w,dropNode:S,dropPosition:1})?Z=1:K=!1,{dropPosition:Z,dropLevelOffset:N,dropTargetKey:y.key,dropTargetPos:y.pos,dragOverNodeKey:k,dropContainerKey:0===Z?null:(null===(s=y.parent)||void 0===s?void 0:s.key)||null,dropAllowed:K}}function yt(e,n){if(e)return n.multiple?e.slice():e.length?[e[0]]:e}function gt(e){if(!e)return null;var n;if(Array.isArray(e))n={checkedKeys:e,halfCheckedKeys:void 0};else{if("object"!==(0,r.Z)(e))return(0,y.ZP)(!1,"`checkedKeys` is not an array or an object"),null;n={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0}}return n}function xt(e,n){var t=new Set;function r(e){if(!t.has(e)){var o=n[e];if(o){t.add(e);var a=o.parent;o.node.disabled||a&&r(a.key)}}}return(e||[]).forEach((function(e){r(e)})),(0,s.Z)(t)}var Ct=t(73453),Et=t(62874),kt=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],Zt=function(e,n){var t=e.className,r=e.style,o=e.motion,l=e.motionNodes,d=e.motionType,s=e.onMotionStart,f=e.onMotionEnd,p=e.active,v=e.treeNodeRequiredProps,m=(0,k.Z)(e,kt),h=u.useState(!0),y=(0,i.Z)(h,2),g=y[0],x=y[1],C=u.useContext(Un).prefixCls,E=u.useRef(!1),Z=function(){E.current||f(),E.current=!0};return(0,u.useEffect)((function(){l&&"hide"===d&&g&&x(!1)}),[l]),(0,u.useEffect)((function(){return l&&s(),function(){l&&Z()}}),[]),l?u.createElement(Et.Z,(0,a.Z)({ref:n,visible:g},o,{motionAppear:"show"===d,onAppearEnd:Z,onLeaveEnd:Z}),(function(e,n){var t=e.className,r=e.style;return u.createElement("div",{ref:n,className:c()("".concat(C,"-treenode-motion"),t),style:r},l.map((function(e){var n=(0,a.Z)({},e.data),t=e.title,r=e.key,o=e.isStart,i=e.isEnd;delete n.children;var l=tt(r,v);return u.createElement(dt,(0,a.Z)({},n,l,{title:t,active:p,data:e.data,key:r,isStart:o,isEnd:i}))})))})):u.createElement(dt,(0,a.Z)({domRef:n,className:t,style:r},m,{active:p}))};Zt.displayName="MotionTreeNode";var Nt=u.forwardRef(Zt);function bt(e,n,t){var r=e.findIndex((function(e){return e.key===t})),o=e[r+1],a=n.findIndex((function(e){return e.key===t}));if(o){var i=n.findIndex((function(e){return e.key===o.key}));return n.slice(a+1,i)}return n.slice(a+1)}var wt=["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"],St={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Kt=function(){},Ot="RC_TREE_MOTION_".concat(Math.random()),Pt={key:Ot},Dt={key:Ot,level:0,index:0,pos:"0",node:Pt,nodes:[Pt]},Rt={parent:null,children:[],pos:Dt.pos,data:Pt,title:null,key:Ot,isStart:[],isEnd:[]};function Mt(e,n,t,r){return!1!==n&&t?e.slice(0,Math.ceil(t/r)+1):e}function Lt(e){return Yn(e.key,e.pos)}var Tt=u.forwardRef((function(e,n){var t=e.prefixCls,r=e.data,o=(e.selectable,e.checkable,e.expandedKeys),l=e.selectedKeys,c=e.checkedKeys,d=e.loadedKeys,s=e.loadingKeys,f=e.halfCheckedKeys,p=e.keyEntities,v=e.disabled,m=e.dragging,h=e.dragOverNodeKey,y=e.dropPosition,g=e.motion,x=e.height,C=e.itemHeight,E=e.virtual,Z=e.focusable,N=e.activeItem,b=e.focused,w=e.tabIndex,S=e.onKeyDown,K=e.onFocus,O=e.onBlur,P=e.onActiveChange,D=e.onListChangeStart,R=e.onListChangeEnd,M=(0,k.Z)(e,wt),L=u.useRef(null),T=u.useRef(null);u.useImperativeHandle(n,(function(){return{scrollTo:function(e){L.current.scrollTo(e)},getIndentWidth:function(){return T.current.offsetWidth}}}));var I=u.useState(o),A=(0,i.Z)(I,2),H=A[0],z=A[1],_=u.useState(r),F=(0,i.Z)(_,2),j=F[0],B=F[1],V=u.useState(r),W=(0,i.Z)(V,2),U=W[0],G=W[1],X=u.useState([]),q=(0,i.Z)(X,2),Y=q[0],$=q[1],J=u.useState(null),Q=(0,i.Z)(J,2),ee=Q[0],ne=Q[1],te=u.useRef(r);function re(){var e=te.current;B(e),G(e),$([]),ne(null),R()}te.current=r,u.useEffect((function(){z(o);var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t=e.length,r=n.length;if(1!==Math.abs(t-r))return{add:!1,key:null};function o(e,n){var t=new Map;e.forEach((function(e){t.set(e,!0)}));var r=n.filter((function(e){return!t.has(e)}));return 1===r.length?r[0]:null}return t ").concat(n);return n}(N)),u.createElement("div",null,u.createElement("input",{style:St,disabled:!1===Z||v,tabIndex:!1!==Z?w:null,onKeyDown:S,onFocus:K,onBlur:O,value:"",onChange:Kt,"aria-label":"for screen reader"})),u.createElement("div",{className:"".concat(t,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden"}},u.createElement("div",{className:"".concat(t,"-indent")},u.createElement("div",{ref:T,className:"".concat(t,"-indent-unit")}))),u.createElement(Ct.Z,(0,a.Z)({},M,{data:oe,itemKey:Lt,height:x,fullHeight:!1,virtual:E,itemHeight:C,prefixCls:"".concat(t,"-list"),ref:L,onVisibleChange:function(e,n){var t=new Set(e);n.filter((function(e){return!t.has(e)})).some((function(e){return Lt(e)===Ot}))&&re()}}),(function(e){var n=e.pos,t=(0,a.Z)({},e.data),r=e.title,o=e.key,i=e.isStart,l=e.isEnd,c=Yn(o,n);delete t.key,delete t.children;var d=tt(c,ae);return u.createElement(Nt,(0,a.Z)({},t,d,{title:r,active:!!N&&o===N.key,pos:n,data:e.data,isStart:i,isEnd:l,motion:g,motionNodes:o===Ot?Y:null,motionType:ee,onMotionStart:D,onMotionEnd:re,treeNodeRequiredProps:ae,onMouseMove:function(){P(null)}}))})))}));Tt.displayName="NodeList";var It=Tt;function At(e,n){var t=new Set;return e.forEach((function(e){n.has(e)||t.add(e)})),t}function Ht(e){var n=e||{},t=n.disabled,r=n.disableCheckbox,o=n.checkable;return!(!t&&!r)||!1===o}function zt(e,n,t,r){var o,a=[];o=r||Ht;var i,l=new Set(e.filter((function(e){var n=!!t[e];return n||a.push(e),n}))),c=new Map,d=0;return Object.keys(t).forEach((function(e){var n=t[e],r=n.level,o=c.get(r);o||(o=new Set,c.set(r,o)),o.add(n),d=Math.max(d,r)})),(0,y.ZP)(!a.length,"Tree missing follow keys: ".concat(a.slice(0,100).map((function(e){return"'".concat(e,"'")})).join(", "))),i=!0===n?function(e,n,t,r){for(var o=new Set(e),a=new Set,i=0;i<=t;i+=1)(n.get(i)||new Set).forEach((function(e){var n=e.key,t=e.node,a=e.children,i=void 0===a?[]:a;o.has(n)&&!r(t)&&i.filter((function(e){return!r(e.node)})).forEach((function(e){o.add(e.key)}))}));for(var l=new Set,c=t;c>=0;c-=1)(n.get(c)||new Set).forEach((function(e){var n=e.parent,t=e.node;if(!r(t)&&e.parent&&!l.has(e.parent.key))if(r(e.parent.node))l.add(n.key);else{var i=!0,c=!1;(n.children||[]).filter((function(e){return!r(e.node)})).forEach((function(e){var n=e.key,t=o.has(n);i&&!t&&(i=!1),c||!t&&!a.has(n)||(c=!0)})),i&&o.add(n.key),c&&a.add(n.key),l.add(n.key)}}));return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(At(a,o))}}(l,c,d,o):function(e,n,t,r,o){for(var a=new Set(e),i=new Set(n),l=0;l<=r;l+=1)(t.get(l)||new Set).forEach((function(e){var n=e.key,t=e.node,r=e.children,l=void 0===r?[]:r;a.has(n)||i.has(n)||o(t)||l.filter((function(e){return!o(e.node)})).forEach((function(e){a.delete(e.key)}))}));i=new Set;for(var c=new Set,d=r;d>=0;d-=1)(t.get(d)||new Set).forEach((function(e){var n=e.parent,t=e.node;if(!o(t)&&e.parent&&!c.has(e.parent.key))if(o(e.parent.node))c.add(n.key);else{var r=!0,l=!1;(n.children||[]).filter((function(e){return!o(e.node)})).forEach((function(e){var n=e.key,t=a.has(n);r&&!t&&(r=!1),l||!t&&!i.has(n)||(l=!0)})),r||a.delete(n.key),l&&i.add(n.key),c.add(n.key)}}));return{checkedKeys:Array.from(a),halfCheckedKeys:Array.from(At(i,a))}}(l,n.halfCheckedKeys,c,d,o),i}var _t=function(e){(0,Bn.Z)(t,e);var n=(0,Vn.Z)(t);function t(){var e;(0,_n.Z)(this,t);for(var r=arguments.length,o=new Array(r),a=0;a2&&void 0!==arguments[2]&&arguments[2],a=e.state,i=a.dragChildrenKeys,l=a.dropPosition,c=a.dropTargetKey,s=a.dropTargetPos,u=a.dropAllowed;if(u){var f=e.props.onDrop;if(e.setState({dragOverNodeKey:null}),e.cleanDragState(),null!==c){var p=(0,d.Z)((0,d.Z)({},tt(c,e.getTreeNodeRequiredProps())),{},{active:(null===(r=e.getActiveItem())||void 0===r?void 0:r.key)===c,data:e.state.keyEntities[c].node}),v=-1!==i.indexOf(c);(0,y.ZP)(!v,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var m=ft(s),h={event:n,node:rt(p),dragNode:e.dragNode?rt(e.dragNode.props):null,dragNodesKeys:[e.dragNode.props.eventKey].concat(i),dropToGap:0!==l,dropPosition:l+Number(m[m.length-1])};o||null===f||void 0===f||f(h),e.dragNode=null}}},e.cleanDragState=function(){null!==e.state.draggingNodeKey&&e.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),e.dragStartMousePosition=null,e.currentMouseOverDroppableNodeKey=null},e.triggerExpandActionExpand=function(n,t){var r=e.state,o=r.expandedKeys,a=r.flattenNodes,i=t.expanded,l=t.key;if(!(t.isLeaf||n.shiftKey||n.metaKey||n.ctrlKey)){var c=a.filter((function(e){return e.key===l}))[0],s=rt((0,d.Z)((0,d.Z)({},tt(l,e.getTreeNodeRequiredProps())),{},{data:c.data}));e.setExpandedKeys(i?st(o,l):ut(o,l)),e.onNodeExpand(n,s)}},e.onNodeClick=function(n,t){var r=e.props,o=r.onClick;"click"===r.expandAction&&e.triggerExpandActionExpand(n,t),null===o||void 0===o||o(n,t)},e.onNodeDoubleClick=function(n,t){var r=e.props,o=r.onDoubleClick;"doubleClick"===r.expandAction&&e.triggerExpandActionExpand(n,t),null===o||void 0===o||o(n,t)},e.onNodeSelect=function(n,t){var r=e.state.selectedKeys,o=e.state,a=o.keyEntities,i=o.fieldNames,l=e.props,c=l.onSelect,d=l.multiple,s=t.selected,u=t[i.key],f=!s,p=(r=f?d?ut(r,u):[u]:st(r,u)).map((function(e){var n=a[e];return n?n.node:null})).filter((function(e){return e}));e.setUncontrolledState({selectedKeys:r}),null===c||void 0===c||c(r,{event:"select",selected:f,node:t,selectedNodes:p,nativeEvent:n.nativeEvent})},e.onNodeCheck=function(n,t,r){var o,a=e.state,i=a.keyEntities,l=a.checkedKeys,c=a.halfCheckedKeys,d=e.props,u=d.checkStrictly,f=d.onCheck,p=t.key,v={event:"check",node:t,checked:r,nativeEvent:n.nativeEvent};if(u){var m=r?ut(l,p):st(l,p);o={checked:m,halfChecked:st(c,p)},v.checkedNodes=m.map((function(e){return i[e]})).filter((function(e){return e})).map((function(e){return e.node})),e.setUncontrolledState({checkedKeys:m})}else{var h=zt([].concat((0,s.Z)(l),[p]),!0,i),y=h.checkedKeys,g=h.halfCheckedKeys;if(!r){var x=new Set(y);x.delete(p);var C=zt(Array.from(x),{checked:!1,halfCheckedKeys:g},i);y=C.checkedKeys,g=C.halfCheckedKeys}o=y,v.checkedNodes=[],v.checkedNodesPositions=[],v.halfCheckedKeys=g,y.forEach((function(e){var n=i[e];if(n){var t=n.node,r=n.pos;v.checkedNodes.push(t),v.checkedNodesPositions.push({node:t,pos:r})}})),e.setUncontrolledState({checkedKeys:y},!1,{halfCheckedKeys:g})}null===f||void 0===f||f(o,v)},e.onNodeLoad=function(n){var t=n.key,r=new Promise((function(r,o){e.setState((function(a){var i=a.loadedKeys,l=void 0===i?[]:i,c=a.loadingKeys,d=void 0===c?[]:c,s=e.props,u=s.loadData,f=s.onLoad;return u&&-1===l.indexOf(t)&&-1===d.indexOf(t)?(u(n).then((function(){var o=ut(e.state.loadedKeys,t);null===f||void 0===f||f(o,{event:"load",node:n}),e.setUncontrolledState({loadedKeys:o}),e.setState((function(e){return{loadingKeys:st(e.loadingKeys,t)}})),r()})).catch((function(n){if(e.setState((function(e){return{loadingKeys:st(e.loadingKeys,t)}})),e.loadingRetryTimes[t]=(e.loadingRetryTimes[t]||0)+1,e.loadingRetryTimes[t]>=10){var a=e.state.loadedKeys;(0,y.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),e.setUncontrolledState({loadedKeys:ut(a,t)}),r()}o(n)})),{loadingKeys:ut(d,t)}):null}))}));return r.catch((function(){})),r},e.onNodeMouseEnter=function(n,t){var r=e.props.onMouseEnter;null===r||void 0===r||r({event:n,node:t})},e.onNodeMouseLeave=function(n,t){var r=e.props.onMouseLeave;null===r||void 0===r||r({event:n,node:t})},e.onNodeContextMenu=function(n,t){var r=e.props.onRightClick;r&&(n.preventDefault(),r({event:n,node:t}))},e.onFocus=function(){var n=e.props.onFocus;e.setState({focused:!0});for(var t=arguments.length,r=new Array(t),o=0;o1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e.destroyed){var o=!1,a=!0,i={};Object.keys(n).forEach((function(t){t in e.props?a=!1:(o=!0,i[t]=n[t])})),!o||t&&!a||e.setState((0,d.Z)((0,d.Z)({},i),r))}},e.scrollTo=function(n){e.listRef.current.scrollTo(n)},e}return(0,Fn.Z)(t,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var e=this.props.activeKey;void 0!==e&&e!==this.state.activeKey&&(this.setState({activeKey:e}),null!==e&&this.scrollTo({key:e}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var e,n,t=this.state,i=t.focused,l=t.flattenNodes,d=t.keyEntities,s=t.draggingNodeKey,f=t.activeKey,v=t.dropLevelOffset,m=t.dropContainerKey,h=t.dropTargetKey,y=t.dropPosition,g=t.dragOverNodeKey,x=t.indent,C=this.props,E=C.prefixCls,k=C.className,Z=C.style,N=C.showLine,b=C.focusable,w=C.tabIndex,S=void 0===w?0:w,K=C.selectable,O=C.showIcon,P=C.icon,D=C.switcherIcon,R=C.draggable,M=C.checkable,L=C.checkStrictly,T=C.disabled,I=C.motion,A=C.loadData,H=C.filterTreeNode,z=C.height,_=C.itemHeight,F=C.virtual,j=C.titleRender,B=C.dropIndicatorRender,V=C.onContextMenu,W=C.onScroll,U=C.direction,G=C.rootClassName,X=C.rootStyle,q=(0,p.Z)(this.props,{aria:!0,data:!0});return R&&(n="object"===(0,r.Z)(R)?R:"function"===typeof R?{nodeDraggable:R}:{}),u.createElement(Un.Provider,{value:{prefixCls:E,selectable:K,showIcon:O,icon:P,switcherIcon:D,draggable:n,draggingNodeKey:s,checkable:M,checkStrictly:L,disabled:T,keyEntities:d,dropLevelOffset:v,dropContainerKey:m,dropTargetKey:h,dropPosition:y,dragOverNodeKey:g,indent:x,direction:U,dropIndicatorRender:B,loadData:A,filterTreeNode:H,titleRender:j,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},u.createElement("div",{role:"tree",className:c()(E,k,G,(e={},(0,o.Z)(e,"".concat(E,"-show-line"),N),(0,o.Z)(e,"".concat(E,"-focused"),i),(0,o.Z)(e,"".concat(E,"-active-focused"),null!==f),e)),style:X},u.createElement(It,(0,a.Z)({ref:this.listRef,prefixCls:E,style:Z,data:l,disabled:T,selectable:K,checkable:!!M,motion:I,dragging:null!==s,height:z,itemHeight:_,virtual:F,focusable:b,focused:i,tabIndex:S,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:V,onScroll:W},this.getTreeNodeRequiredProps(),q))))}}],[{key:"getDerivedStateFromProps",value:function(e,n){var t,r=n.prevProps,a={prevProps:e};function i(n){return!r&&n in e||r&&r[n]!==e[n]}var l=n.fieldNames;if(i("fieldNames")&&(l=$n(e.fieldNames),a.fieldNames=l),i("treeData")?t=e.treeData:i("children")&&((0,y.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),t=Jn(e.children)),t){a.treeData=t;var c=nt(t,{fieldNames:l});a.keyEntities=(0,d.Z)((0,o.Z)({},Ot,Dt),c.keyEntities)}var s,u=a.keyEntities||n.keyEntities;if(i("expandedKeys")||r&&i("autoExpandParent"))a.expandedKeys=e.autoExpandParent||!r&&e.defaultExpandParent?xt(e.expandedKeys,u):e.expandedKeys;else if(!r&&e.defaultExpandAll){var f=(0,d.Z)({},u);delete f[Ot],a.expandedKeys=Object.keys(f).map((function(e){return f[e].key}))}else!r&&e.defaultExpandedKeys&&(a.expandedKeys=e.autoExpandParent||e.defaultExpandParent?xt(e.defaultExpandedKeys,u):e.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,t||a.expandedKeys){var p=Qn(t||n.treeData,a.expandedKeys||n.expandedKeys,l);a.flattenNodes=p}if((e.selectable&&(i("selectedKeys")?a.selectedKeys=yt(e.selectedKeys,e):!r&&e.defaultSelectedKeys&&(a.selectedKeys=yt(e.defaultSelectedKeys,e))),e.checkable)&&(i("checkedKeys")?s=gt(e.checkedKeys)||{}:!r&&e.defaultCheckedKeys?s=gt(e.defaultCheckedKeys)||{}:t&&(s=gt(e.checkedKeys)||{checkedKeys:n.checkedKeys,halfCheckedKeys:n.halfCheckedKeys}),s)){var v=s,m=v.checkedKeys,h=void 0===m?[]:m,g=v.halfCheckedKeys,x=void 0===g?[]:g;if(!e.checkStrictly){var C=zt(h,!0,u);h=C.checkedKeys,x=C.halfCheckedKeys}a.checkedKeys=h,a.halfCheckedKeys=x}return i("loadedKeys")&&(a.loadedKeys=e.loadedKeys),a}}]),t}(u.Component);_t.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:function(e){var n=e.dropPosition,t=e.dropLevelOffset,r=e.indent,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(n){case-1:o.top=0,o.left=-t*r;break;case 1:o.bottom=0,o.left=-t*r;break;case 0:o.bottom=0,o.left=r}return u.createElement("div",{style:o})},allowDrop:function(){return!0},expandAction:!1},_t.TreeNode=dt;var Ft=_t,jt=t(33603),Bt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"},Vt=function(e,n){return u.createElement(an.Z,(0,d.Z)((0,d.Z)({},e),{},{ref:n,icon:Bt}))};Vt.displayName="FileOutlined";var Wt=u.forwardRef(Vt),Ut={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},Gt=function(e,n){return u.createElement(an.Z,(0,d.Z)((0,d.Z)({},e),{},{ref:n,icon:Ut}))};Gt.displayName="FolderOpenOutlined";var Xt=u.forwardRef(Gt),qt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},Yt=function(e,n){return u.createElement(an.Z,(0,d.Z)((0,d.Z)({},e),{},{ref:n,icon:qt}))};Yt.displayName="FolderOutlined";var $t,Jt=u.forwardRef(Yt);function Qt(e,n){e.forEach((function(e){var t=e.key,r=e.children;!1!==n(t,e)&&Qt(r||[],n)}))}function er(e){var n=e.treeData,t=e.expandedKeys,r=e.startKey,o=e.endKey,a=[],i=$t.None;if(r&&r===o)return[r];if(!r||!o)return[];return Qt(n,(function(e){if(i===$t.End)return!1;if(function(e){return e===r||e===o}(e)){if(a.push(e),i===$t.None)i=$t.Start;else if(i===$t.Start)return i=$t.End,!1}else i===$t.Start&&a.push(e);return-1!==t.indexOf(e)})),a}function nr(e,n){var t=(0,s.Z)(n),r=[];return Qt(e,(function(e,n){var o=t.indexOf(e);return-1!==o&&(r.push(n),t.splice(o,1)),!!t.length})),r}!function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}($t||($t={}));var tr=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 o=0;for(r=Object.getOwnPropertySymbols(e);o0&&void 0!==arguments[0]?arguments[0]:{confirm:!1,closeDropdown:!1},n=e.confirm,t=e.closeDropdown;n&&Q([]),t&&L(!1),Y(""),z(S?(K||[]).map((function(e){return String(e)})):[])},te=c()((0,o.Z)({},"".concat(s,"-menu-without-submenu"),!(d.filters||[]).some((function(e){return e.children})))),re=function(e){if(e.target.checked){var n=Mr(null===d||void 0===d?void 0:d.filters).map((function(e){return String(e)}));z(n)}else z([])},oe=function e(n){return(n.filters||[]).map((function(n,t){var r=String(n.value),o={title:n.text,key:void 0!==n.value?r:t};return n.children&&(o.children=e({filters:n.children})),o}))},ae=function e(n){var t;return(0,a.Z)((0,a.Z)({},n),{text:n.title,value:n.key,children:(null===(t=n.children)||void 0===t?void 0:t.map((function(n){return e(n)})))||[]})};if("function"===typeof d.filterDropdown)J=d.filterDropdown({prefixCls:"".concat(s,"-custom"),setSelectedKeys:function(e){return _({selectedKeys:e})},selectedKeys:H(),confirm:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{closeDropdown:!0}).closeDropdown&&L(!1),Q(H())},clearFilters:ne,filters:d.filters,visible:t});else if(d.filterDropdown)J=d.filterDropdown;else{var ie=H()||[];J=u.createElement(u.Fragment,null,0===(d.filters||[]).length?u.createElement(vn.Z,{image:vn.Z.PRESENTED_IMAGE_SIMPLE,description:C.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):"tree"===m?u.createElement(u.Fragment,null,u.createElement(wr,{filterSearch:y,value:q,onChange:$,tablePrefixCls:r,locale:C}),u.createElement("div",{className:"".concat(r,"-filter-dropdown-tree")},p?u.createElement(fn.Z,{checked:ie.length===Mr(d.filters).length,indeterminate:ie.length>0&&ie.length0?c:e}),h=Math.ceil((c||e)/m.pageSize);m.current>h&&(m.current=h||1);var y=function(e,n){v({current:null!==e&&void 0!==e?e:1,pageSize:n||m.pageSize})};return!1===n?[{},function(){}]:[(0,a.Z)((0,a.Z)({},m),{onChange:function(e,r){var o;n&&(null===(o=n.onChange)||void 0===o||o.call(n,e,r)),y(e,r),t(e,r||(null===m||void 0===m?void 0:m.pageSize))}}),y]}var zr=t(84506),_r=t(80882),Fr={},jr="SELECT_ALL",Br="SELECT_INVERT",Vr="SELECT_NONE",Wr=[];function Ur(e,n){var t=[];return(e||[]).forEach((function(e){t.push(e),e&&"object"===(0,r.Z)(e)&&n in e&&(t=[].concat((0,s.Z)(t),(0,s.Z)(Ur(e[n],n))))})),t}function Gr(e,n){var t=e||{},r=t.preserveSelectedRowKeys,l=t.selectedRowKeys,c=t.defaultSelectedRowKeys,d=t.getCheckboxProps,f=t.onChange,p=t.onSelect,v=t.onSelectAll,m=t.onSelectInvert,h=t.onSelectNone,y=t.onSelectMultiple,g=t.columnWidth,x=t.type,C=t.selections,E=t.fixed,k=t.renderCell,Z=t.hideSelectAll,N=t.checkStrictly,b=void 0===N||N,w=n.prefixCls,S=n.data,K=n.pageData,O=n.getRecordByKey,P=n.getRowKey,D=n.expandType,R=n.childrenColumnName,M=n.locale,L=n.getPopupContainer,T=(0,yn.Z)(l||c||Wr,{value:l}),I=(0,i.Z)(T,2),A=I[0],H=I[1],z=u.useRef(new Map),_=(0,u.useCallback)((function(e){if(r){var n=new Map;e.forEach((function(e){var t=O(e);!t&&z.current.has(e)&&(t=z.current.get(e)),n.set(e,t)})),z.current=n}}),[O,r]);u.useEffect((function(){_(A)}),[A]);var F=(0,u.useMemo)((function(){return b?{keyEntities:null}:nt(S,{externalGetKey:P,childrenPropName:R})}),[S,P,b,R]).keyEntities,j=(0,u.useMemo)((function(){return Ur(K,R)}),[K,R]),B=(0,u.useMemo)((function(){var e=new Map;return j.forEach((function(n,t){var r=P(n,t),o=(d?d(n):null)||{};e.set(r,o)})),e}),[j,P,d]),V=(0,u.useCallback)((function(e){var n;return!!(null===(n=B.get(P(e)))||void 0===n?void 0:n.disabled)}),[B,P]),W=(0,u.useMemo)((function(){if(b)return[A||[],[]];var e=zt(A,!0,F,V);return[e.checkedKeys||[],e.halfCheckedKeys]}),[A,b,F,V]),U=(0,i.Z)(W,2),G=U[0],X=U[1],q=(0,u.useMemo)((function(){var e="radio"===x?G.slice(0,1):G;return new Set(e)}),[G,x]),Y=(0,u.useMemo)((function(){return"radio"===x?new Set:new Set(X)}),[X,x]),$=(0,u.useState)(null),J=(0,i.Z)($,2),Q=J[0],ee=J[1];u.useEffect((function(){e||H(Wr)}),[!!e]);var ne=(0,u.useCallback)((function(e,n){var t,o;_(e),r?(t=e,o=e.map((function(e){return z.current.get(e)}))):(t=[],o=[],e.forEach((function(e){var n=O(e);void 0!==n&&(t.push(e),o.push(n))}))),H(t),null===f||void 0===f||f(t,o,{type:n})}),[H,O,f,r]),te=(0,u.useCallback)((function(e,n,t,r){if(p){var o=t.map((function(e){return O(e)}));p(O(e),n,o,r)}ne(t,"single")}),[p,O,ne]),re=(0,u.useMemo)((function(){return!C||Z?null:(!0===C?[jr,Br,Vr]:C).map((function(e){return e===jr?{key:"all",text:M.selectionAll,onSelect:function(){ne(S.map((function(e,n){return P(e,n)})).filter((function(e){var n=B.get(e);return!(null===n||void 0===n?void 0:n.disabled)||q.has(e)})),"all")}}:e===Br?{key:"invert",text:M.selectInvert,onSelect:function(){var e=new Set(q);K.forEach((function(n,t){var r=P(n,t),o=B.get(r);(null===o||void 0===o?void 0:o.disabled)||(e.has(r)?e.delete(r):e.add(r))}));var n=Array.from(e);m&&m(n),ne(n,"invert")}}:e===Vr?{key:"none",text:M.selectNone,onSelect:function(){null===h||void 0===h||h(),ne(Array.from(q).filter((function(e){var n=B.get(e);return null===n||void 0===n?void 0:n.disabled})),"none")}}:e})).map((function(e){return(0,a.Z)((0,a.Z)({},e),{onSelect:function(){for(var n,t,r=arguments.length,o=new Array(r),a=0;a2&&void 0!==arguments[2]&&arguments[2],r=(0,a.Z)((0,a.Z)({},le),e);t&&(le.resetPagination(),r.pagination.current&&(r.pagination.current=1),h&&h.onChange&&h.onChange(1,r.pagination.pageSize)),D&&!1!==D.scrollToFirstRowOnChange&&re.body.current&&$e(0,{getContainer:function(){return re.body.current}}),null===Z||void 0===Z||Z(r.pagination,r.filters,r.sorter,{currentDataSource:Tr(ao(q,r.sorterStates,ne),r.filterStates),action:n})},de=io({prefixCls:$,mergedColumns:z,onSorterChange:function(e,n){ce({sorter:e,sorterStates:n},"sort",!1)},sortDirections:R||["ascend","descend"],tableLocale:X,showSorterTooltip:T}),ue=(0,i.Z)(de,4),fe=ue[0],pe=ue[1],ve=ue[2],me=ue[3],he=u.useMemo((function(){return ao(q,pe,ne)}),[q,pe]);le.sorter=me(),le.sorterStates=pe;var ye=Ir({prefixCls:$,locale:X,dropdownPrefixCls:J,mergedColumns:z,onFilterChange:function(e,n){ce({filters:e,filterStates:n},"filter",!0)},getPopupContainer:N}),ge=(0,i.Z)(ye,3),xe=ge[0],Ce=ge[1],Ee=ge[2],ke=Tr(he,Ce);le.filters=Ee,le.filterStates=Ce;var Ze=co(u.useMemo((function(){var e={};return Object.keys(Ee).forEach((function(n){null!==Ee[n]&&(e[n]=Ee[n])})),(0,a.Z)((0,a.Z)({},ve),{filters:e})}),[ve,Ee])),Ne=(0,i.Z)(Ze,1)[0],be=Hr(ke.length,h,(function(e,n){ce({pagination:(0,a.Z)((0,a.Z)({},le.pagination),{current:e,pageSize:n})},"paginate")})),we=(0,i.Z)(be,2),Se=we[0],Ke=we[1];le.pagination=!1===h?{}:function(e,n){var t={current:n.current,pageSize:n.pageSize},o=e&&"object"===(0,r.Z)(e)?e:{};return Object.keys(o).forEach((function(e){var r=n[e];"function"!==typeof r&&(t[e]=r)})),t}(h,Se),le.resetPagination=Ke;var Oe=u.useMemo((function(){if(!1===h||!Se.pageSize)return ke;var e=Se.current,n=void 0===e?1:e,t=Se.total,r=Se.pageSize,o=void 0===r?10:r;return ke.lengtho?ke.slice((n-1)*o,n*o):ke:ke.slice((n-1)*o,n*o)}),[!!h,ke,Se&&Se.current,Se&&Se.pageSize,Se&&Se.total]),Pe=Gr(y,{prefixCls:$,data:ke,pageData:Oe,getRowKey:oe,getRecordByKey:ie,expandType:te,childrenColumnName:ne,locale:X,getPopupContainer:N}),De=(0,i.Z)(Pe,2),Re=De[0],Me=De[1];Q.__PARENT_RENDER_ICON__=Q.expandIcon,Q.expandIcon=Q.expandIcon||w||en(X),"nest"===te&&void 0===Q.expandIconColumnIndex?Q.expandIconColumnIndex=y?1:0:Q.expandIconColumnIndex>0&&y&&(Q.expandIconColumnIndex-=1),"number"!==typeof Q.indentSize&&(Q.indentSize="number"===typeof P?P:15);var Le,Ie,Ae,Ge=u.useCallback((function(e){return Ne(Re(xe(fe(e))))}),[fe,xe,Re]);if(!1!==h&&(null===Se||void 0===Se?void 0:Se.total)){var Xe;Xe=Se.size?Se.size:"small"===G||"middle"===G?"small":void 0;var qe=function(e){return u.createElement(We.Z,(0,a.Z)({},Se,{className:c()("".concat($,"-pagination ").concat($,"-pagination-").concat(e),Se.className),size:Xe}))},Ye="rtl"===U?"left":"right",Je=Se.position;if(null!==Je&&Array.isArray(Je)){var Qe=Je.find((function(e){return-1!==e.indexOf("top")})),nn=Je.find((function(e){return-1!==e.indexOf("bottom")})),tn=Je.every((function(e){return"none"==="".concat(e)}));Qe||nn||tn||(Ie=qe(Ye)),Qe&&(Le=qe(Qe.toLowerCase().replace("top",""))),nn&&(Ie=qe(nn.toLowerCase().replace("bottom","")))}else Ie=qe(Ye)}"boolean"===typeof b?Ae={spinning:b}:"object"===(0,r.Z)(b)&&(Ae=(0,a.Z)({spinning:!0},b));var rn=c()("".concat($,"-wrapper"),(0,o.Z)({},"".concat($,"-wrapper-rtl"),"rtl"===U),d);return u.createElement("div",{ref:n,className:rn,style:s},u.createElement(Ue.Z,(0,a.Z)({spinning:!1},Ae),Le,u.createElement(He,(0,a.Z)({},_,{columns:z,direction:U,expandable:Q,prefixCls:$,className:c()((t={},(0,o.Z)(t,"".concat($,"-middle"),"middle"===G),(0,o.Z)(t,"".concat($,"-small"),"small"===G),(0,o.Z)(t,"".concat($,"-bordered"),p),(0,o.Z)(t,"".concat($,"-empty"),0===q.length),t)),data:Oe,rowKey:oe,rowClassName:function(e,n,t){var r;return r="function"===typeof x?c()(x(e,n,t)):c()(x),c()((0,o.Z)({},"".concat($,"-row-selected"),Me.has(oe(e,n))),r)},emptyText:M&&M.emptyText||(W||Fe.Z)("Table"),internalHooks:Te,internalRefs:re,transformColumns:Ge})),Ie))}var fo=u.forwardRef(uo);fo.defaultProps={rowKey:"key"},fo.SELECTION_COLUMN=Fr,fo.EXPAND_COLUMN=He.EXPAND_COLUMN,fo.SELECTION_ALL=jr,fo.SELECTION_INVERT=Br,fo.SELECTION_NONE=Vr,fo.Column=Je,fo.ColumnGroup=Qe,fo.Summary=Ze;var po=fo},50132:function(e,n,t){var r=t(87462),o=t(4942),a=t(91),i=t(1413),l=t(15671),c=t(43144),d=t(60136),s=t(33643),u=t(67294),f=t(94184),p=t.n(f),v=function(e){(0,d.Z)(t,e);var n=(0,s.Z)(t);function t(e){var r;(0,l.Z)(this,t),(r=n.call(this,e)).handleChange=function(e){var n=r.props,t=n.disabled,o=n.onChange;t||("checked"in r.props||r.setState({checked:e.target.checked}),o&&o({target:(0,i.Z)((0,i.Z)({},r.props),{},{checked:e.target.checked}),stopPropagation:function(){e.stopPropagation()},preventDefault:function(){e.preventDefault()},nativeEvent:e.nativeEvent}))},r.saveInput=function(e){r.input=e};var o="checked"in e?e.checked:e.defaultChecked;return r.state={checked:o},r}return(0,c.Z)(t,[{key:"focus",value:function(){this.input.focus()}},{key:"blur",value:function(){this.input.blur()}},{key:"render",value:function(){var e,n=this.props,t=n.prefixCls,i=n.className,l=n.style,c=n.name,d=n.id,s=n.type,f=n.disabled,v=n.readOnly,m=n.tabIndex,h=n.onClick,y=n.onFocus,g=n.onBlur,x=n.onKeyDown,C=n.onKeyPress,E=n.onKeyUp,k=n.autoFocus,Z=n.value,N=n.required,b=(0,a.Z)(n,["prefixCls","className","style","name","id","type","disabled","readOnly","tabIndex","onClick","onFocus","onBlur","onKeyDown","onKeyPress","onKeyUp","autoFocus","value","required"]),w=Object.keys(b).reduce((function(e,n){return"aria-"!==n.substr(0,5)&&"data-"!==n.substr(0,5)&&"role"!==n||(e[n]=b[n]),e}),{}),S=this.state.checked,K=p()(t,i,(e={},(0,o.Z)(e,"".concat(t,"-checked"),S),(0,o.Z)(e,"".concat(t,"-disabled"),f),e));return u.createElement("span",{className:K,style:l},u.createElement("input",(0,r.Z)({name:c,id:d,type:s,required:N,readOnly:v,disabled:f,tabIndex:m,className:"".concat(t,"-input"),checked:!!S,onClick:h,onFocus:y,onBlur:g,onKeyUp:E,onKeyDown:x,onKeyPress:C,onChange:this.handleChange,autoFocus:k,ref:this.saveInput,value:Z},w)),u.createElement("span",{className:"".concat(t,"-inner")}))}}],[{key:"getDerivedStateFromProps",value:function(e,n){return"checked"in e?(0,i.Z)((0,i.Z)({},n),{},{checked:e.checked}):null}}]),t}(u.Component);v.defaultProps={prefixCls:"rc-checkbox",className:"",style:{},type:"checkbox",defaultChecked:!1,onFocus:function(){},onBlur:function(){},onChange:function(){},onKeyDown:function(){},onKeyPress:function(){},onKeyUp:function(){}},n.Z=v},27678:function(e,n,t){t.d(n,{g1:function(){return r},os:function(){return o}});function r(){return{width:document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight}}function o(e){var n=e.getBoundingClientRect(),t=document.documentElement;return{left:n.left+(window.pageXOffset||t.scrollLeft)-(t.clientLeft||document.body.clientLeft||0),top:n.top+(window.pageYOffset||t.scrollTop)-(t.clientTop||document.body.clientTop||0)}}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/7781.2553454a5caad033.js b/static/web/_next/static/chunks/7781.c2410185d16b1336.js similarity index 99% rename from static/web/_next/static/chunks/7781.2553454a5caad033.js rename to static/web/_next/static/chunks/7781.c2410185d16b1336.js index 2ccae65f7..824d8b168 100644 --- a/static/web/_next/static/chunks/7781.2553454a5caad033.js +++ b/static/web/_next/static/chunks/7781.c2410185d16b1336.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7781],{87781:function(e,n,t){"use strict";t.r(n),t.d(n,{ChatModerationActionMenu:function(){return H}});var r=t(47568),s=t(70655),a=t(85893),o=t(11475),i=t(90420),c=t(18429),l=t(64942),u=t(85402),d=t(12461),h=t(66516),f=t(38504),p=t(26713),x=t(67294),j=t(32365),g=t(54907),m=t(25968),v=t(6226),y=t(71577),_=t(11382),Z=t(20550),b=t(10355),C=t(58091),k=t(48689),w=t(51438),M=function(){function e(){(0,w.Z)(this,e)}return e.removeMessage=function(e,n){return(0,r.Z)((function(){var t,r,a;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return(t=new URL("/api/chat/messagevisibility",window.location.toString())).searchParams.append("accessToken",n),r=t.toString(),a={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idArray:[e]})},[4,fetch(r,a)];case 1:return s.sent(),[2]}}))}))()},e.banUser=function(e,n){return(0,r.Z)((function(){var t,r,a;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return(t=new URL("/api/chat/users/setenabled",window.location.toString())).searchParams.append("accessToken",n),r=t.toString(),a={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})},[4,fetch(r,a)];case 1:return s.sent(),[2]}}))}))()},e}(),S=t(62638),A=t.n(S),P=t(2766),N=g.Z.Panel,D=function(){var e=(0,r.Z)((function(e,n){return(0,s.__generator)(this,(function(t){try{M.removeMessage(e,n)}catch(r){console.error(r)}return[2]}))}));return function(n,t){return e.apply(this,arguments)}}(),O=function(e){var n=e.label,t=e.value;return(0,a.jsxs)(m.Z,{justify:"space-around",align:"middle",children:[(0,a.jsx)(v.Z,{span:12,children:n}),(0,a.jsx)(v.Z,{span:12,children:t})]})},T=function(e){var n=e.client,t=n.messageCount,r=n.connectedAt,s=n.geo,o=(0,C.Z)(new Date(r),"PP pp");return(0,a.jsxs)("div",{children:[(0,a.jsx)(O,{label:"Messages Sent",value:"".concat(t)}),"N/A"!==s&&(0,a.jsx)(O,{label:"Geo",value:s}),(0,a.jsx)(O,{label:"Connected At",value:o})]})},I=function(e){var n=e.color,t="var(--theme-color-users-".concat(n,")");return(0,a.jsxs)("div",{className:A().colorBlock,style:{backgroundColor:t},children:["Color ",n]})},B=function(e){var n=e.userId,t=e.accessToken,o=(0,x.useState)(null),i=o[0],c=o[1],l=(0,x.useState)(!0),u=l[0],d=l[1],h=function(){var e=(0,r.Z)((function(){var e,r;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,fetch("/api/moderation/chat/user/".concat(n,"?accessToken=").concat(t))];case 1:return[4,s.sent().json()];case 2:return e=s.sent(),c(e),d(!1),[3,4];case 3:return r=s.sent(),console.error(r),[3,4];case 4:return[2]}}))}));return function(){return e.apply(this,arguments)}}();if((0,x.useEffect)((function(){h()}),[]),!i)return null;var f=i.user,p=i.connectedClients,j=i.messages,m=f.displayColor,v=f.createdAt,w=f.previousNames,M=f.scopes,S=f.isBot,A=f.authenticated,B=p.reduce((function(e,n){return e+n.messageCount}),0),U=(0,C.Z)(new Date(v),"PP pp"),z=[{title:"Message",dataIndex:"body",key:"body"},{title:"Sent At",dataIndex:"timestamp",key:"timestamp",render:function(e){return(0,C.Z)(new Date(e),"PP pp")}},{title:"Delete",key:"delete",render:function(e,n){return(0,a.jsx)(y.Z,{type:"primary",ghost:!0,icon:(0,a.jsx)(k.Z,{}),onClick:function(){return D(n.id,t)}})}}];return(0,a.jsxs)(_.Z,{spinning:u,children:[(0,a.jsx)(I,{color:m}),M.map((function(e){return(0,a.jsx)(Z.Z,{children:e},e)})),A&&(0,a.jsx)(Z.Z,{children:"Authenticated"}),S&&(0,a.jsx)(Z.Z,{children:"Bot"}),(0,a.jsx)(O,{label:"Messages Sent Across Clients",value:B.toString()}),(0,a.jsx)(O,{label:"User Created",value:U}),(0,a.jsx)(O,{label:"Known As",value:w.join(",")}),(0,a.jsxs)(g.Z,{accordion:!0,children:[(0,a.jsx)(N,{header:"Currently Connected Clients",children:(0,a.jsx)(g.Z,{accordion:!0,children:p.map((function(e){return(0,a.jsx)(N,{header:(0,P.AB)(e.userAgent),children:(0,a.jsx)(T,{client:e})},e.userAgent)}))})},"connected-clients"),(0,a.jsx)(g.Z,{accordion:!0,children:(0,a.jsx)(N,{header:"Recent Chat Messages",children:(0,a.jsx)(b.Z,{size:"small",pagination:null,columns:z,dataSource:j})},"chat-messages")})]})]})},U=t(31833),z=t.n(U),F=u.Z.confirm,H=function(e){var n=e.messageID,t=e.userID,u=e.userDisplayName,g=e.accessToken,m=(0,x.useState)(!1),v=m[0],y=m[1],_=function(){var e=(0,r.Z)((function(){var e;return(0,s.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,M.banUser(t,g)];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),console.error(e),d.ZP.error(e),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=(0,r.Z)((function(){var e;return(0,s.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,M.removeMessage(n,g)];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.error(e),d.ZP.error(e),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),b=function(){var e=(0,r.Z)((function(){return(0,s.__generator)(this,(function(e){return F({icon:(0,a.jsx)(o.Z,{}),content:"Are you sure you want to remove this message from ".concat(u,"?"),onOk:function(){Z()}}),[2]}))}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=(0,r.Z)((function(){return(0,s.__generator)(this,(function(e){return F({icon:(0,a.jsx)(o.Z,{}),content:"Are you sure you want to ban ".concat(u," from chat?"),onOk:function(){_()}}),[2]}))}));return function(){return e.apply(this,arguments)}}(),k=(0,a.jsx)(h.Z,{onClick:function(e){var n=e.key;"hide-message"===n?b():"ban-user"===n?C():"more-info"===n&&y(!0)},items:[{label:(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:z().icon,children:(0,a.jsx)(i.Z,{})}),"Hide Message"]}),key:"hide-message"},{label:(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:z().icon,children:(0,a.jsx)(c.Z,{})}),"Ban User"]}),key:"ban-user"},{label:(0,a.jsx)("div",{children:"More Info..."}),key:"more-info"}]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Z,{overlay:k,trigger:["click"],children:(0,a.jsx)("button",{type:"button",onClick:function(e){return e.preventDefault()},children:(0,a.jsx)(p.Z,{children:(0,a.jsx)(l.Z,{})})})}),(0,a.jsx)(j.Modal,{title:u,visible:v,handleCancel:function(){y(!1)},children:(0,a.jsx)(B,{userId:t,accessToken:g})})]})}},32365:function(e,n,t){"use strict";t.r(n),t.d(n,{Modal:function(){return u}});var r=t(85893),s=t(85402),a=t(26303),o=t(11382),i=t(67294),c=t(78890),l=t.n(c),u=function(e){var n=e.title,t=e.url,c=e.visible,u=e.handleOk,d=e.handleCancel,h=e.afterClose,f=e.height,p=e.width,x=e.children,j=(0,i.useState)(!!t),g=j[0],m=j[1],v={padding:"0px",minHeight:f},y=t&&(0,r.jsx)("iframe",{title:n,src:t,width:"100%",height:"100%",sandbox:"allow-same-origin allow-scripts allow-popups allow-forms",frameBorder:"0",allowFullScreen:!0,onLoad:function(){return m(!1)}}),_=g?"none":"inline";return(0,r.jsx)(s.Z,{title:n,visible:c,onOk:u,onCancel:d,afterClose:h,bodyStyle:v,width:p,zIndex:9999,footer:null,centered:!0,destroyOnClose:!0,children:(0,r.jsxs)(r.Fragment,{children:[g&&(0,r.jsx)(a.Z,{active:g,style:{padding:"10px"},paragraph:{rows:10}}),y&&(0,r.jsx)("div",{style:{display:_},children:y}),x&&(0,r.jsx)("div",{className:l().content,children:x}),g&&(0,r.jsx)(o.Z,{className:l().spinner,spinning:g,size:"large"})]})})};n.default=u,u.defaultProps={url:void 0,children:void 0,handleOk:void 0,handleCancel:void 0,afterClose:void 0,height:"40vh",width:"70%"}},31833:function(e){e.exports={icon:"ChatModerationActionMenu_icon__9j6DF"}},62638:function(e){e.exports={modalContainer:"ChatModerationDetailsModal_modalContainer__czndV",chatHistory:"ChatModerationDetailsModal_chatHistory__PunRk",colorBlock:"ChatModerationDetailsModal_colorBlock___rAlw",displayName:"ChatModerationDetailsModal_displayName__p7pLI"}},78890:function(e){e.exports={spinner:"Modal_spinner__GiSS0",content:"Modal_content__h9my9"}}}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7781],{87781:function(e,n,t){"use strict";t.r(n),t.d(n,{ChatModerationActionMenu:function(){return H}});var r=t(47568),s=t(70655),a=t(85893),o=t(11475),i=t(90420),c=t(18429),l=t(64942),u=t(85402),d=t(12461),h=t(66516),f=t(38504),p=t(26713),x=t(67294),j=t(32365),g=t(54907),m=t(25968),v=t(6226),y=t(71577),_=t(11382),Z=t(20550),b=t(93626),C=t(58091),k=t(48689),w=t(51438),M=function(){function e(){(0,w.Z)(this,e)}return e.removeMessage=function(e,n){return(0,r.Z)((function(){var t,r,a;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return(t=new URL("/api/chat/messagevisibility",window.location.toString())).searchParams.append("accessToken",n),r=t.toString(),a={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idArray:[e]})},[4,fetch(r,a)];case 1:return s.sent(),[2]}}))}))()},e.banUser=function(e,n){return(0,r.Z)((function(){var t,r,a;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return(t=new URL("/api/chat/users/setenabled",window.location.toString())).searchParams.append("accessToken",n),r=t.toString(),a={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e})},[4,fetch(r,a)];case 1:return s.sent(),[2]}}))}))()},e}(),S=t(62638),A=t.n(S),P=t(2766),N=g.Z.Panel,D=function(){var e=(0,r.Z)((function(e,n){return(0,s.__generator)(this,(function(t){try{M.removeMessage(e,n)}catch(r){console.error(r)}return[2]}))}));return function(n,t){return e.apply(this,arguments)}}(),O=function(e){var n=e.label,t=e.value;return(0,a.jsxs)(m.Z,{justify:"space-around",align:"middle",children:[(0,a.jsx)(v.Z,{span:12,children:n}),(0,a.jsx)(v.Z,{span:12,children:t})]})},T=function(e){var n=e.client,t=n.messageCount,r=n.connectedAt,s=n.geo,o=(0,C.Z)(new Date(r),"PP pp");return(0,a.jsxs)("div",{children:[(0,a.jsx)(O,{label:"Messages Sent",value:"".concat(t)}),"N/A"!==s&&(0,a.jsx)(O,{label:"Geo",value:s}),(0,a.jsx)(O,{label:"Connected At",value:o})]})},I=function(e){var n=e.color,t="var(--theme-color-users-".concat(n,")");return(0,a.jsxs)("div",{className:A().colorBlock,style:{backgroundColor:t},children:["Color ",n]})},B=function(e){var n=e.userId,t=e.accessToken,o=(0,x.useState)(null),i=o[0],c=o[1],l=(0,x.useState)(!0),u=l[0],d=l[1],h=function(){var e=(0,r.Z)((function(){var e,r;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),[4,fetch("/api/moderation/chat/user/".concat(n,"?accessToken=").concat(t))];case 1:return[4,s.sent().json()];case 2:return e=s.sent(),c(e),d(!1),[3,4];case 3:return r=s.sent(),console.error(r),[3,4];case 4:return[2]}}))}));return function(){return e.apply(this,arguments)}}();if((0,x.useEffect)((function(){h()}),[]),!i)return null;var f=i.user,p=i.connectedClients,j=i.messages,m=f.displayColor,v=f.createdAt,w=f.previousNames,M=f.scopes,S=f.isBot,A=f.authenticated,B=p.reduce((function(e,n){return e+n.messageCount}),0),U=(0,C.Z)(new Date(v),"PP pp"),z=[{title:"Message",dataIndex:"body",key:"body"},{title:"Sent At",dataIndex:"timestamp",key:"timestamp",render:function(e){return(0,C.Z)(new Date(e),"PP pp")}},{title:"Delete",key:"delete",render:function(e,n){return(0,a.jsx)(y.Z,{type:"primary",ghost:!0,icon:(0,a.jsx)(k.Z,{}),onClick:function(){return D(n.id,t)}})}}];return(0,a.jsxs)(_.Z,{spinning:u,children:[(0,a.jsx)(I,{color:m}),M.map((function(e){return(0,a.jsx)(Z.Z,{children:e},e)})),A&&(0,a.jsx)(Z.Z,{children:"Authenticated"}),S&&(0,a.jsx)(Z.Z,{children:"Bot"}),(0,a.jsx)(O,{label:"Messages Sent Across Clients",value:B.toString()}),(0,a.jsx)(O,{label:"User Created",value:U}),(0,a.jsx)(O,{label:"Known As",value:w.join(",")}),(0,a.jsxs)(g.Z,{accordion:!0,children:[(0,a.jsx)(N,{header:"Currently Connected Clients",children:(0,a.jsx)(g.Z,{accordion:!0,children:p.map((function(e){return(0,a.jsx)(N,{header:(0,P.AB)(e.userAgent),children:(0,a.jsx)(T,{client:e})},e.userAgent)}))})},"connected-clients"),(0,a.jsx)(g.Z,{accordion:!0,children:(0,a.jsx)(N,{header:"Recent Chat Messages",children:(0,a.jsx)(b.Z,{size:"small",pagination:null,columns:z,dataSource:j})},"chat-messages")})]})]})},U=t(31833),z=t.n(U),F=u.Z.confirm,H=function(e){var n=e.messageID,t=e.userID,u=e.userDisplayName,g=e.accessToken,m=(0,x.useState)(!1),v=m[0],y=m[1],_=function(){var e=(0,r.Z)((function(){var e;return(0,s.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,M.banUser(t,g)];case 1:return n.sent(),[3,3];case 2:return e=n.sent(),console.error(e),d.ZP.error(e),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),Z=function(){var e=(0,r.Z)((function(){var e;return(0,s.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,M.removeMessage(n,g)];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.error(e),d.ZP.error(e),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),b=function(){var e=(0,r.Z)((function(){return(0,s.__generator)(this,(function(e){return F({icon:(0,a.jsx)(o.Z,{}),content:"Are you sure you want to remove this message from ".concat(u,"?"),onOk:function(){Z()}}),[2]}))}));return function(){return e.apply(this,arguments)}}(),C=function(){var e=(0,r.Z)((function(){return(0,s.__generator)(this,(function(e){return F({icon:(0,a.jsx)(o.Z,{}),content:"Are you sure you want to ban ".concat(u," from chat?"),onOk:function(){_()}}),[2]}))}));return function(){return e.apply(this,arguments)}}(),k=(0,a.jsx)(h.Z,{onClick:function(e){var n=e.key;"hide-message"===n?b():"ban-user"===n?C():"more-info"===n&&y(!0)},items:[{label:(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:z().icon,children:(0,a.jsx)(i.Z,{})}),"Hide Message"]}),key:"hide-message"},{label:(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:z().icon,children:(0,a.jsx)(c.Z,{})}),"Ban User"]}),key:"ban-user"},{label:(0,a.jsx)("div",{children:"More Info..."}),key:"more-info"}]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Z,{overlay:k,trigger:["click"],children:(0,a.jsx)("button",{type:"button",onClick:function(e){return e.preventDefault()},children:(0,a.jsx)(p.Z,{children:(0,a.jsx)(l.Z,{})})})}),(0,a.jsx)(j.Modal,{title:u,visible:v,handleCancel:function(){y(!1)},children:(0,a.jsx)(B,{userId:t,accessToken:g})})]})}},32365:function(e,n,t){"use strict";t.r(n),t.d(n,{Modal:function(){return u}});var r=t(85893),s=t(85402),a=t(26303),o=t(11382),i=t(67294),c=t(78890),l=t.n(c),u=function(e){var n=e.title,t=e.url,c=e.visible,u=e.handleOk,d=e.handleCancel,h=e.afterClose,f=e.height,p=e.width,x=e.children,j=(0,i.useState)(!!t),g=j[0],m=j[1],v={padding:"0px",minHeight:f},y=t&&(0,r.jsx)("iframe",{title:n,src:t,width:"100%",height:"100%",sandbox:"allow-same-origin allow-scripts allow-popups allow-forms",frameBorder:"0",allowFullScreen:!0,onLoad:function(){return m(!1)}}),_=g?"none":"inline";return(0,r.jsx)(s.Z,{title:n,visible:c,onOk:u,onCancel:d,afterClose:h,bodyStyle:v,width:p,zIndex:9999,footer:null,centered:!0,destroyOnClose:!0,children:(0,r.jsxs)(r.Fragment,{children:[g&&(0,r.jsx)(a.Z,{active:g,style:{padding:"10px"},paragraph:{rows:10}}),y&&(0,r.jsx)("div",{style:{display:_},children:y}),x&&(0,r.jsx)("div",{className:l().content,children:x}),g&&(0,r.jsx)(o.Z,{className:l().spinner,spinning:g,size:"large"})]})})};n.default=u,u.defaultProps={url:void 0,children:void 0,handleOk:void 0,handleCancel:void 0,afterClose:void 0,height:"40vh",width:"70%"}},31833:function(e){e.exports={icon:"ChatModerationActionMenu_icon__9j6DF"}},62638:function(e){e.exports={modalContainer:"ChatModerationDetailsModal_modalContainer__czndV",chatHistory:"ChatModerationDetailsModal_chatHistory__PunRk",colorBlock:"ChatModerationDetailsModal_colorBlock___rAlw",displayName:"ChatModerationDetailsModal_displayName__p7pLI"}},78890:function(e){e.exports={spinner:"Modal_spinner__GiSS0",content:"Modal_content__h9my9"}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/8763-5f3081892e9117b4.js b/static/web/_next/static/chunks/8763-5f3081892e9117b4.js new file mode 100644 index 000000000..3f1ea72fc --- /dev/null +++ b/static/web/_next/static/chunks/8763-5f3081892e9117b4.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8763],{28763:function(e,t,n){"use strict";n.r(t),n.d(t,{ChatContainer:function(){return me}});var s=n(85893),a=n(9764),r=n(67294),o=n(36531),i=n(11622),l=n(13545),c=n.n(l),u=n(14924),d=n(86492),h=n.n(d),m=n(94184),g=n.n(m),p=n(94199),f=n(29158),x=n(4480),_=n(5152),C=n.n(_),v=n(78583),j=n.n(v);function y(e){var t=new Date(e);if(Number.isNaN(t))return"";if(function(e){var t="string"===typeof e?new Date(e):e;return(new Date-t)/864e5}(e)>=1){var n=t.toLocaleDateString("en-US",{dateStyle:"medium"});return"at ".concat(n," at ").concat(t.toLocaleTimeString())}return"".concat(t.toLocaleTimeString())}var N,M,b,w,S,E=n(79010),T=n.n(E),k=function(e){var t=e.badge,n=e.userColor,a="var(--theme-user-colors-".concat(n,")"),r={color:a,borderColor:a};return(0,s.jsx)("span",{style:r,className:T().badge,children:t})},B=n(1899),U=C()((function(){return Promise.all([n.e(8939),n.e(3903),n.e(3698),n.e(3626),n.e(8091),n.e(1300),n.e(7781)]).then(n.bind(n,87781)).then((function(e){return e.ChatModerationActionMenu}))}),{loadableGenerated:{webpack:function(){return[87781]}}}),A=C()((function(){return Promise.resolve().then(n.bind(n,47049)).then((function(e){return e.Highlight}))}),{loadableGenerated:{webpack:function(){return[47049]}}}),D=function(e){var t=e.message,n=e.highlightString,a=e.showModeratorMenu,o=e.sentBySelf,i=e.sameUserAsLast,l=e.isAuthorModerator,c=e.isAuthorAuthenticated,d=t.id,m=t.body,_=t.user,C=t.timestamp,v=_.id,N=_.displayName,M=_.displayColor,b=(0,x.sJ)(B.FI),w="var(--theme-color-users-".concat(M,")"),S="Sent ".concat(y(C)),E=(0,r.useState)(m),T=E[0],D=E[1],O=[];return l&&O.push((0,s.jsx)(k,{badge:"mod",userColor:M},"mod")),c&&O.push((0,s.jsx)(k,{badge:(0,s.jsx)(f.Z,{title:"authenticated"}),userColor:M},"auth")),(0,r.useEffect)((function(){D(h().decode(m))}),[t]),(0,s.jsx)("div",{className:g()(j().messagePadding,i&&j().messagePaddingCollapsed),children:(0,s.jsxs)("div",{className:g()(j().root,(0,u.Z)({},j().ownMessage,o)),style:{borderColor:w},children:[!i&&(0,s.jsx)(p.Z,{title:"user info goes here",placement:"topLeft",mouseEnterDelay:1,children:(0,s.jsxs)("div",{className:j().user,style:{color:w},children:[(0,s.jsx)("span",{className:j().userName,children:N}),(0,s.jsx)("span",{children:O})]})}),(0,s.jsx)(p.Z,{title:S,mouseEnterDelay:1,children:(0,s.jsx)(A,{search:n,children:(0,s.jsx)("div",{className:j().message,dangerouslySetInnerHTML:{__html:T}})})}),a&&(0,s.jsx)("div",{className:j().modMenuWrapper,children:(0,s.jsx)(U,{messageID:d,accessToken:b,userID:v,userDisplayName:N})}),(0,s.jsx)("div",{className:j().background,style:{color:w}})]})})},O=n(26042),I=n(69396),R=n(828),Z=n(93045),L=n(27496),F=n(55241),H=n(77493),P=n(96391),W=n(25882),V=n.n(W),G=C()((function(){return Promise.all([n.e(7741),n.e(786)]).then(n.bind(n,30786)).then((function(e){return e.EmojiPicker}))}),{loadableGenerated:{webpack:function(){return[30786]}}}),Y=function(e){var t=e.attributes,n=e.element,a=e.children,r=(0,P.vt)(),o=(0,P.UE)();return(0,s.jsxs)("span",(0,I.Z)((0,O.Z)({},t),{contentEditable:!1,children:[(0,s.jsx)("img",{alt:n.alt,src:n.src,title:n.name,style:{display:"inline",maxWidth:"50px",maxHeight:"20px",boxShadow:"".concat(r&&o?"0 0 0 3px #B4D5FF":"none")}}),a]}))},J=function(e){var t,n;if(H.xv.isText(e))return e.text;0===e.children.length?t=[{text:""}]:t=null===(n=e.children)||void 0===n?void 0:n.map((function(e){return J(e)})).join("");switch(e.type){case"paragraph":return"

".concat(t,"

");case"image":return'').concat(e.alt,'');default:return t}},z=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1],a=(0,x.sJ)(B.Gt),o=(0,r.useMemo)((function(){return(0,P.BU)(function(e){var t=e.isVoid;return e.isVoid=function(e){return"image"===e.type||t(e)},e.isInline=function(e){return"image"===e.type},e}((0,H.Jh)()))}),[]),l=function(){if(a){var e=J(o);a.send({type:i.C.CHAT,body:e}),H.YR.delete(o,{at:{anchor:H.ML.start(o,[]),focus:H.ML.end(o,[])}})}else console.log("websocketService is not defined")},c=function(e,t){if(e){var n=o.selection,s=function(e,t,n){return{type:"image",alt:e,src:t,name:n,children:[{text:""}]}}(t,e,t);if(H.YR.insertNodes(o,s,{select:!0}),n){var a,r=(0,R.Z)(H.ML.parent(o,null===(a=n.focus)||void 0===a?void 0:a.path),2),i=r[0],l=r[1];o.isVoid(i)||H.NB.string(i).length?H.YR.insertNodes(o,s,{at:H.y$.next(l),select:!0}):(H.YR.insertNodes(o,s,{at:l,select:!0}),H.ML.normalize(o,{force:!0}))}else H.YR.insertNodes(o,s,{select:!0})}};return(0,s.jsx)("div",{className:V().root,children:(0,s.jsxs)("div",{className:V().inputWrap,children:[(0,s.jsxs)(P.mH,{editor:o,value:[{type:"paragraph",children:[{text:""}]}],children:[(0,s.jsx)(P.CX,{onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),l())},renderElement:function(e){return"image"===e.element.type?(0,s.jsx)(Y,(0,O.Z)({},e)):(0,s.jsx)("p",(0,O.Z)({},e))},placeholder:"Chat message goes here...",style:{width:"100%"},autoFocus:!0}),(0,s.jsx)(F.Z,{content:(0,s.jsx)(G,{onEmojiSelect:function(e){if(P.F3.focus(o),e.url){var t=e.url;c(t,t)}else{var n=e.emoji;H.YR.insertText(o,n)}},onCustomEmojiSelect:function(e){P.F3.focus(o);var t=e.url;c(t,t)}}),trigger:"click",onVisibleChange:function(e){return n(e)},visible:t})]}),(0,s.jsxs)("div",{style:{display:"flex",paddingLeft:"5px"},children:[(0,s.jsx)("button",{type:"button",className:V().emojiButton,title:"Emoji picker button",onClick:function(){return n(!t)},children:(0,s.jsx)(Z.Z,{})}),(0,s.jsx)("button",{type:"button",className:V().emojiButton,title:"Send message Button",onClick:l,children:(0,s.jsx)(L.Z,{})})]})]})})},X=n(93174),q=n.n(X);function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t12e4)&&s===(null===a||void 0===a?void 0:a.user.id)}function he(e){var t=e.user.scopes;return!(!t||0===t.length)&&t.includes("MODERATOR")}var me=function(e){var t=e.messages,n=e.usernameToHighlight,l=e.chatUserId,u=e.isModerator,d=e.showInput,h=e.height,m=(0,r.useState)(!1),g=m[0],p=m[1],f=(0,r.useRef)(null),x=function(e,a){switch(a.type){case i.C.CHAT:var r,d,h;return(0,s.jsx)(D,{message:a,showModeratorMenu:u,highlightString:n,sentBySelf:(null===(r=a.user)||void 0===r?void 0:r.id)===l,sameUserAsLast:de(t,e),isAuthorModerator:null===(d=a.user.scopes)||void 0===d?void 0:d.includes("MODERATOR"),isAuthorAuthenticated:null===(h=a.user)||void 0===h?void 0:h.authenticated},a.id);case i.C.NAME_CHANGE:return function(e){var t=e.oldName,n=e.user,a=n.displayName,r=n.displayColor,i="var(--theme-color-users-".concat(r,")");return(0,s.jsxs)("div",{className:c().nameChangeView,children:[(0,s.jsx)("div",{style:{marginRight:5,height:"max-content",margin:"auto 5px auto 0"},children:(0,s.jsx)(o.Z,{})}),(0,s.jsxs)("div",{className:c().nameChangeText,children:[(0,s.jsx)("span",{style:{color:i},children:t}),(0,s.jsx)("span",{className:c().plain,children:" is now known as "}),(0,s.jsx)("span",{style:{color:i},children:a})]})]})}(a);case i.C.CONNECTED_USER_INFO:return function(e){if(!he(e))return(0,s.jsx)("div",{style:{width:"1px",height:"1px"}});return(0,s.jsx)(Q,{})}(a);case i.C.USER_JOINED:return function(e){var t=e.user,n=t.displayName,a=t.displayColor,r=he(e);return(0,s.jsx)(ie,{displayName:n,userColor:a,isAuthorModerator:r})}(a);case i.C.SYSTEM:return(0,s.jsx)(se,{message:a,highlightString:n},a.id);default:return null}},_=(0,r.useMemo)((function(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.OO,{style:{height:h},className:c().virtuoso,ref:f,initialTopMostItemIndex:t.length-1,data:t,itemContent:function(e,t){return x(e,t)},followOutput:"auto",alignToBottom:!0,atBottomStateChange:function(e){return p(e)}}),!g&&(0,s.jsx)(ue,{chatContainerRef:f,messages:t})]})}),[t,n,l,u,g]);return(0,s.jsxs)("div",{className:c().chatContainer,children:[_,d&&(0,s.jsx)(z,{})]})};me.defaultProps={showInput:!0,height:"auto"}},13545:function(e){e.exports={chatHeader:"ChatContainer_chatHeader__EJsYI",toBottomWrap:"ChatContainer_toBottomWrap__3V5wa",toBottomBtn:"ChatContainer_toBottomBtn__453AG",nameChangeView:"ChatContainer_nameChangeView__ziyXN",nameChangeText:"ChatContainer_nameChangeText__yXG__",plain:"ChatContainer_plain__IPS19",chatContainer:"ChatContainer_chatContainer__O2lYN",virtuoso:"ChatContainer_virtuoso__OS9Kz"}},83066:function(e){e.exports={root:"ChatJoinMessage_root__vuVXa"}},93174:function(e){e.exports={chatModerationNotification:"ChatModeratorNotification_chatModerationNotification__kgFWe",icon:"ChatModeratorNotification_icon__7FdGg"}},31681:function(e){e.exports={chatSystemMessage:"ChatSystemMessage_chatSystemMessage__c6XEN",user:"ChatSystemMessage_user__6yHSJ",message:"ChatSystemMessage_message__ySq5g"}},25882:function(e){e.exports={root:"ChatTextField_root__4oUkJ",inputWrap:"ChatTextField_inputWrap__1mAjD",emojiButton:"ChatTextField_emojiButton__ON_Cu"}},79010:function(e){e.exports={badge:"ChatUserBadge_badge__1EdUp"}},78583:function(e){e.exports={root:"ChatUserMessage_root__79heB",user:"ChatUserMessage_user__xUEp9",message:"ChatUserMessage_message__MJ9LD",ownMessage:"ChatUserMessage_ownMessage__d28A3",background:"ChatUserMessage_background__Tfghp",modMenuWrapper:"ChatUserMessage_modMenuWrapper__7fblv",messagePadding:"ChatUserMessage_messagePadding__Xp1F6",messagePaddingCollapsed:"ChatUserMessage_messagePaddingCollapsed__qxN0E"}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/8763-ddc977899642b6f9.js b/static/web/_next/static/chunks/8763-ddc977899642b6f9.js deleted file mode 100644 index a562072e6..000000000 --- a/static/web/_next/static/chunks/8763-ddc977899642b6f9.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8763],{28763:function(e,t,n){"use strict";n.r(t),n.d(t,{ChatContainer:function(){return me}});var s=n(85893),a=n(9764),r=n(67294),o=n(36531),i=n(11622),l=n(13545),c=n.n(l),u=n(14924),d=n(86492),h=n.n(d),m=n(94184),g=n.n(m),p=n(94199),f=n(29158),x=n(4480),_=n(5152),C=n.n(_),v=n(78583),j=n.n(v);function y(e){var t=new Date(e);if(Number.isNaN(t))return"";if(function(e){var t="string"===typeof e?new Date(e):e;return(new Date-t)/864e5}(e)>=1){var n=t.toLocaleDateString("en-US",{dateStyle:"medium"});return"at ".concat(n," at ").concat(t.toLocaleTimeString())}return"".concat(t.toLocaleTimeString())}var N,M,b,w,S,E=n(79010),T=n.n(E),k=function(e){var t=e.badge,n=e.userColor,a="var(--theme-user-colors-".concat(n,")"),r={color:a,borderColor:a};return(0,s.jsx)("span",{style:r,className:T().badge,children:t})},B=n(1899),U=C()((function(){return Promise.all([n.e(8939),n.e(3903),n.e(3698),n.e(355),n.e(8091),n.e(1300),n.e(7781)]).then(n.bind(n,87781)).then((function(e){return e.ChatModerationActionMenu}))}),{loadableGenerated:{webpack:function(){return[87781]}}}),A=C()((function(){return Promise.resolve().then(n.bind(n,47049)).then((function(e){return e.Highlight}))}),{loadableGenerated:{webpack:function(){return[47049]}}}),D=function(e){var t=e.message,n=e.highlightString,a=e.showModeratorMenu,o=e.sentBySelf,i=e.sameUserAsLast,l=e.isAuthorModerator,c=e.isAuthorAuthenticated,d=t.id,m=t.body,_=t.user,C=t.timestamp,v=_.id,N=_.displayName,M=_.displayColor,b=(0,x.sJ)(B.FI),w="var(--theme-color-users-".concat(M,")"),S="Sent ".concat(y(C)),E=(0,r.useState)(m),T=E[0],D=E[1],O=[];return l&&O.push((0,s.jsx)(k,{badge:"mod",userColor:M},"mod")),c&&O.push((0,s.jsx)(k,{badge:(0,s.jsx)(f.Z,{title:"authenticated"}),userColor:M},"auth")),(0,r.useEffect)((function(){D(h().decode(m))}),[t]),(0,s.jsx)("div",{className:g()(j().messagePadding,i&&j().messagePaddingCollapsed),children:(0,s.jsxs)("div",{className:g()(j().root,(0,u.Z)({},j().ownMessage,o)),style:{borderColor:w},children:[!i&&(0,s.jsx)(p.Z,{title:"user info goes here",placement:"topLeft",mouseEnterDelay:1,children:(0,s.jsxs)("div",{className:j().user,style:{color:w},children:[(0,s.jsx)("span",{className:j().userName,children:N}),(0,s.jsx)("span",{children:O})]})}),(0,s.jsx)(p.Z,{title:S,mouseEnterDelay:1,children:(0,s.jsx)(A,{search:n,children:(0,s.jsx)("div",{className:j().message,dangerouslySetInnerHTML:{__html:T}})})}),a&&(0,s.jsx)("div",{className:j().modMenuWrapper,children:(0,s.jsx)(U,{messageID:d,accessToken:b,userID:v,userDisplayName:N})}),(0,s.jsx)("div",{className:j().background,style:{color:w}})]})})},O=n(26042),I=n(69396),R=n(828),Z=n(93045),L=n(27496),F=n(55241),H=n(77493),P=n(96391),W=n(25882),V=n.n(W),G=C()((function(){return Promise.all([n.e(7741),n.e(786)]).then(n.bind(n,30786)).then((function(e){return e.EmojiPicker}))}),{loadableGenerated:{webpack:function(){return[30786]}}}),Y=function(e){var t=e.attributes,n=e.element,a=e.children,r=(0,P.vt)(),o=(0,P.UE)();return(0,s.jsxs)("span",(0,I.Z)((0,O.Z)({},t),{contentEditable:!1,children:[(0,s.jsx)("img",{alt:n.alt,src:n.src,title:n.name,style:{display:"inline",maxWidth:"50px",maxHeight:"20px",boxShadow:"".concat(r&&o?"0 0 0 3px #B4D5FF":"none")}}),a]}))},J=function(e){var t,n;if(H.xv.isText(e))return e.text;0===e.children.length?t=[{text:""}]:t=null===(n=e.children)||void 0===n?void 0:n.map((function(e){return J(e)})).join("");switch(e.type){case"paragraph":return"

".concat(t,"

");case"image":return'').concat(e.alt,'');default:return t}},z=function(){var e=(0,r.useState)(!1),t=e[0],n=e[1],a=(0,x.sJ)(B.Gt),o=(0,r.useMemo)((function(){return(0,P.BU)(function(e){var t=e.isVoid;return e.isVoid=function(e){return"image"===e.type||t(e)},e.isInline=function(e){return"image"===e.type},e}((0,H.Jh)()))}),[]),l=function(){if(a){var e=J(o);a.send({type:i.C.CHAT,body:e}),H.YR.delete(o,{at:{anchor:H.ML.start(o,[]),focus:H.ML.end(o,[])}})}else console.log("websocketService is not defined")},c=function(e,t){if(e){var n=o.selection,s=function(e,t,n){return{type:"image",alt:e,src:t,name:n,children:[{text:""}]}}(t,e,t);if(H.YR.insertNodes(o,s,{select:!0}),n){var a,r=(0,R.Z)(H.ML.parent(o,null===(a=n.focus)||void 0===a?void 0:a.path),2),i=r[0],l=r[1];o.isVoid(i)||H.NB.string(i).length?H.YR.insertNodes(o,s,{at:H.y$.next(l),select:!0}):(H.YR.insertNodes(o,s,{at:l,select:!0}),H.ML.normalize(o,{force:!0}))}else H.YR.insertNodes(o,s,{select:!0})}};return(0,s.jsx)("div",{className:V().root,children:(0,s.jsxs)("div",{className:V().inputWrap,children:[(0,s.jsxs)(P.mH,{editor:o,value:[{type:"paragraph",children:[{text:""}]}],children:[(0,s.jsx)(P.CX,{onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),l())},renderElement:function(e){return"image"===e.element.type?(0,s.jsx)(Y,(0,O.Z)({},e)):(0,s.jsx)("p",(0,O.Z)({},e))},placeholder:"Chat message goes here...",style:{width:"100%"},autoFocus:!0}),(0,s.jsx)(F.Z,{content:(0,s.jsx)(G,{onEmojiSelect:function(e){if(P.F3.focus(o),e.url){var t=e.url;c(t,t)}else{var n=e.emoji;H.YR.insertText(o,n)}},onCustomEmojiSelect:function(e){P.F3.focus(o);var t=e.url;c(t,t)}}),trigger:"click",onVisibleChange:function(e){return n(e)},visible:t})]}),(0,s.jsxs)("div",{style:{display:"flex",paddingLeft:"5px"},children:[(0,s.jsx)("button",{type:"button",className:V().emojiButton,title:"Emoji picker button",onClick:function(){return n(!t)},children:(0,s.jsx)(Z.Z,{})}),(0,s.jsx)("button",{type:"button",className:V().emojiButton,title:"Send message Button",onClick:l,children:(0,s.jsx)(L.Z,{})})]})]})})},X=n(93174),q=n.n(X);function K(){return K=Object.assign?Object.assign.bind():function(e){for(var t=1;t12e4)&&s===(null===a||void 0===a?void 0:a.user.id)}function he(e){var t=e.user.scopes;return!(!t||0===t.length)&&t.includes("MODERATOR")}var me=function(e){var t=e.messages,n=e.usernameToHighlight,l=e.chatUserId,u=e.isModerator,d=e.showInput,h=e.height,m=(0,r.useState)(!1),g=m[0],p=m[1],f=(0,r.useRef)(null),x=function(e,a){switch(a.type){case i.C.CHAT:var r,d,h;return(0,s.jsx)(D,{message:a,showModeratorMenu:u,highlightString:n,sentBySelf:(null===(r=a.user)||void 0===r?void 0:r.id)===l,sameUserAsLast:de(t,e),isAuthorModerator:null===(d=a.user.scopes)||void 0===d?void 0:d.includes("MODERATOR"),isAuthorAuthenticated:null===(h=a.user)||void 0===h?void 0:h.authenticated},a.id);case i.C.NAME_CHANGE:return function(e){var t=e.oldName,n=e.user,a=n.displayName,r=n.displayColor,i="var(--theme-color-users-".concat(r,")");return(0,s.jsxs)("div",{className:c().nameChangeView,children:[(0,s.jsx)("div",{style:{marginRight:5,height:"max-content",margin:"auto 5px auto 0"},children:(0,s.jsx)(o.Z,{})}),(0,s.jsxs)("div",{className:c().nameChangeText,children:[(0,s.jsx)("span",{style:{color:i},children:t}),(0,s.jsx)("span",{className:c().plain,children:" is now known as "}),(0,s.jsx)("span",{style:{color:i},children:a})]})]})}(a);case i.C.CONNECTED_USER_INFO:return function(e){if(!he(e))return(0,s.jsx)("div",{style:{width:"1px",height:"1px"}});return(0,s.jsx)(Q,{})}(a);case i.C.USER_JOINED:return function(e){var t=e.user,n=t.displayName,a=t.displayColor,r=he(e);return(0,s.jsx)(ie,{displayName:n,userColor:a,isAuthorModerator:r})}(a);case i.C.SYSTEM:return(0,s.jsx)(se,{message:a,highlightString:n},a.id);default:return null}},_=(0,r.useMemo)((function(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.OO,{style:{height:h},className:c().virtuoso,ref:f,initialTopMostItemIndex:t.length-1,data:t,itemContent:function(e,t){return x(e,t)},followOutput:"auto",alignToBottom:!0,atBottomStateChange:function(e){return p(e)}}),!g&&(0,s.jsx)(ue,{chatContainerRef:f,messages:t})]})}),[t,n,l,u,g]);return(0,s.jsxs)("div",{className:c().chatContainer,children:[_,d&&(0,s.jsx)(z,{})]})};me.defaultProps={showInput:!0,height:"auto"}},13545:function(e){e.exports={chatHeader:"ChatContainer_chatHeader__EJsYI",toBottomWrap:"ChatContainer_toBottomWrap__3V5wa",toBottomBtn:"ChatContainer_toBottomBtn__453AG",nameChangeView:"ChatContainer_nameChangeView__ziyXN",nameChangeText:"ChatContainer_nameChangeText__yXG__",plain:"ChatContainer_plain__IPS19",chatContainer:"ChatContainer_chatContainer__O2lYN",virtuoso:"ChatContainer_virtuoso__OS9Kz"}},83066:function(e){e.exports={root:"ChatJoinMessage_root__vuVXa"}},93174:function(e){e.exports={chatModerationNotification:"ChatModeratorNotification_chatModerationNotification__kgFWe",icon:"ChatModeratorNotification_icon__7FdGg"}},31681:function(e){e.exports={chatSystemMessage:"ChatSystemMessage_chatSystemMessage__c6XEN",user:"ChatSystemMessage_user__6yHSJ",message:"ChatSystemMessage_message__ySq5g"}},25882:function(e){e.exports={root:"ChatTextField_root__4oUkJ",inputWrap:"ChatTextField_inputWrap__1mAjD",emojiButton:"ChatTextField_emojiButton__ON_Cu"}},79010:function(e){e.exports={badge:"ChatUserBadge_badge__1EdUp"}},78583:function(e){e.exports={root:"ChatUserMessage_root__79heB",user:"ChatUserMessage_user__xUEp9",message:"ChatUserMessage_message__MJ9LD",ownMessage:"ChatUserMessage_ownMessage__d28A3",background:"ChatUserMessage_background__Tfghp",modMenuWrapper:"ChatUserMessage_modMenuWrapper__7fblv",messagePadding:"ChatUserMessage_messagePadding__Xp1F6",messagePaddingCollapsed:"ChatUserMessage_messagePaddingCollapsed__qxN0E"}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/9640-9346df51762e2ae7.js b/static/web/_next/static/chunks/9640-e282810d6fb4f58d.js similarity index 99% rename from static/web/_next/static/chunks/9640-9346df51762e2ae7.js rename to static/web/_next/static/chunks/9640-e282810d6fb4f58d.js index bc4a87e59..4a083fc2b 100644 --- a/static/web/_next/static/chunks/9640-9346df51762e2ae7.js +++ b/static/web/_next/static/chunks/9640-e282810d6fb4f58d.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9640],{77891:function(e,n,t){t.d(n,{e:function(){return h}});var r=t(47568),s=t(70655),a=t(85893),i=t(85402),l=t(71577),o=t(21640),c=t(82911),u=t(84674),d=t(58827),h=function(e){var n=e.user,t=e.isEnabled,h=e.label,m=e.onClick;function f(){return f=(0,r.Z)((function(e){var n,r,a;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:n=e.id,r={userId:n,enabled:!t},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,d.rQ)(d.NM,{data:r,method:"POST",auth:!0})];case 2:return[2,s.sent().success];case 3:return a=s.sent(),console.error(a),[3,4];case 4:return[2,!1]}}))})),f.apply(this,arguments)}var x=t?"ban":"unban",j=t?(0,a.jsx)(o.Z,{style:{color:"var(--ant-error)"}}):(0,a.jsx)(c.Z,{style:{color:"var(--ant-warning)"}}),b=(0,a.jsxs)(a.Fragment,{children:["Are you sure you want to ",x," ",(0,a.jsx)("strong",{children:n.displayName}),t?" and remove their messages?":"?"]});return(0,a.jsx)(l.Z,{onClick:function(){i.Z.confirm({title:"Confirm ".concat(x),content:b,onCancel:function(){},onOk:function(){return new Promise((function(e,t){var r=function(e){return f.apply(this,arguments)}(n);r?setTimeout((function(){e(r),null===m||void 0===m||m()}),3e3):t()}))},okType:"danger",okText:t?"Absolutely":null,icon:j})},size:"small",icon:t?(0,a.jsx)(u.Z,{twoToneColor:"#ff4d4f"}):null,className:"block-user-button",children:h||x})};h.defaultProps={label:"",onClick:null}},11085:function(e,n,t){t.d(n,{Z:function(){return A}});var r=t(29815),s=t(85893),a=t(67294),i=t(94199),l=t(85402),o=t(84485),c=t(25968),u=t(6226),d=t(27049),h=t(26713),m=t(45938),f=t(58091),x=t(96486),j=t(77891),b=t(47568),p=t(70655),v=t(71577),y=t(21640),g=t(82911),Z=t(84674),k=t(24478),C=t(58827),w=function(e){var n,t=e.user,r=e.onClick;function a(){return a=(0,b.Z)((function(e,n){var t,r,s;return(0,p.__generator)(this,(function(a){switch(a.label){case 0:t=e.id,r={userId:t,isModerator:n},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,(0,C.rQ)(C.jr,{data:r,method:"POST",auth:!0})];case 2:return[2,a.sent().success];case 3:return s=a.sent(),console.error(s),[3,4];case 4:return[2,!1]}}))})),a.apply(this,arguments)}var i=null===(n=t.scopes)||void 0===n?void 0:n.includes("MODERATOR"),o=i?"remove moderator":"add moderator",c=i?(0,s.jsx)(y.Z,{style:{color:"var(--ant-error)"}}):(0,s.jsx)(g.Z,{style:{color:"var(--ant-warning)"}}),u=(0,s.jsxs)(s.Fragment,{children:["Are you sure you want to ",o," ",(0,s.jsx)("strong",{children:t.displayName}),"?"]});return(0,s.jsx)(v.Z,{onClick:function(){l.Z.confirm({title:"Confirm ".concat(o),content:u,onCancel:function(){},onOk:function(){return new Promise((function(e,n){var s=function(e,n){return a.apply(this,arguments)}(t,!i);s?setTimeout((function(){e(s),null===r||void 0===r||r()}),3e3):n()}))},okType:"danger",okText:i?"Yup!":null,icon:c})},size:"small",icon:i?(0,s.jsx)(Z.Z,{twoToneColor:"#ff4d4f"}):(0,s.jsx)(k.Z,{twoToneColor:"#22bb44"}),className:"block-user-button",children:o})};w.defaultProps={onClick:null};var T=t(41542),N=t(2766),A=function(e){var n=e.user,t=e.connectionInfo,b=e.children,p=(0,a.useState)(!1),v=p[0],y=p[1],g=function(){y(!1)},Z=n.displayName,k=n.createdAt,C=n.previousNames,A=n.nameChangedAt,D=n.disabledAt,P=t||{},O=P.connectedAt,_=P.messageCount,E=P.userAgent,I=null,M=C&&(0,r.Z)(C);C&&C.length>1&&A&&(I=new Date(A),M.reverse());var S=new Date(k),F=(0,f.Z)(S,"PP pp"),z=I?(0,m.Z)(I):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Z,{title:(0,s.jsxs)(s.Fragment,{children:["Created at: ",F,".",(0,s.jsx)("br",{})," Click for more info."]}),placement:"bottomLeft",children:(0,s.jsx)("button",{type:"button","aria-label":"Display more details about this user",className:"user-item-container",onClick:function(){y(!0)},children:b})}),(0,s.jsx)(l.Z,{destroyOnClose:!0,width:600,cancelText:"Close",okButtonProps:{style:{display:"none"}},title:"User details: ".concat(Z),visible:v,onOk:g,onCancel:g,children:(0,s.jsxs)("div",{className:"user-details",children:[(0,s.jsx)(o.Z.Title,{level:4,children:Z}),(0,s.jsxs)("p",{className:"created-at",children:["User created at ",F,"."]}),(0,s.jsxs)(c.Z,{gutter:16,children:[t&&(0,s.jsxs)(u.Z,{md:I?12:24,children:[(0,s.jsx)(o.Z.Title,{level:5,children:"This user is currently connected to Chat."}),(0,s.jsxs)("ul",{className:"connection-info",children:[(0,s.jsxs)("li",{children:[(0,s.jsx)("strong",{children:"Active for:"})," ",(0,m.Z)(new Date(O))]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("strong",{children:"Messages sent:"})," ",_]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("strong",{children:"User Agent:"}),(0,s.jsx)("br",{}),(0,N.AB)(E)]})]})]}),I&&(0,s.jsxs)(u.Z,{md:t?12:24,children:[(0,s.jsx)(o.Z.Title,{level:5,children:"This user is also seen as:"}),(0,s.jsx)("ul",{className:"previous-names-list",children:(0,x.uniq)(M).map((function(e,n){return(0,s.jsxs)("li",{className:0===n?"latest":"",children:[(0,s.jsx)("span",{className:"user-name-item",children:e}),0===n?" (Changed ".concat(z," ago)"):""]})}))})]})]}),(0,s.jsx)(d.Z,{}),(0,s.jsxs)(h.Z,{direction:"horizontal",children:[D?(0,s.jsxs)(s.Fragment,{children:["This user was banned on ",(0,s.jsx)("code",{children:(0,T.u)(D)}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)(j.e,{label:"Unban this user",user:n,isEnabled:!1,onClick:g})]}):(0,s.jsx)(j.e,{label:"Ban this user",user:n,isEnabled:!0,onClick:g}),(0,s.jsx)(w,{user:n,onClick:g})]})]})})]})};A.defaultProps={connectionInfo:null}},41542:function(e,n,t){t.d(n,{K:function(){return c},u:function(){return o}});var r=t(85893),s=t(10355),a=t(58091),i=t(11085),l=t(77891);function o(e){return(0,a.Z)(new Date(e),"MMM d H:mma")}var c=function(e){var n=e.data,t=[{title:"Last Known Display Name",dataIndex:"displayName",key:"displayName",render:function(e,n){return(0,r.jsx)(i.Z,{user:n,children:(0,r.jsx)("span",{className:"display-name",children:e})})}},{title:"Created",dataIndex:"createdAt",key:"createdAt",render:function(e){return o(e)},sorter:function(e,n){return new Date(e.createdAt).getTime()-new Date(n.createdAt).getTime()},sortDirections:["descend","ascend"]},{title:"Disabled at",dataIndex:"disabledAt",key:"disabledAt",defaultSortOrder:"descend",render:function(e){return e?o(e):null},sorter:function(e,n){return new Date(e.disabledAt).getTime()-new Date(n.disabledAt).getTime()},sortDirections:["descend","ascend"]},{title:"",key:"block",className:"actions-col",render:function(e,n){return(0,r.jsx)(l.e,{user:n,isEnabled:!n.disabledAt})}}];return(0,r.jsx)(s.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:t,dataSource:n,size:"small",rowKey:"id"})}}}]); \ No newline at end of file +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9640],{77891:function(e,n,t){t.d(n,{e:function(){return h}});var r=t(47568),s=t(70655),a=t(85893),i=t(85402),l=t(71577),o=t(21640),c=t(82911),u=t(84674),d=t(58827),h=function(e){var n=e.user,t=e.isEnabled,h=e.label,m=e.onClick;function f(){return f=(0,r.Z)((function(e){var n,r,a;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:n=e.id,r={userId:n,enabled:!t},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,d.rQ)(d.NM,{data:r,method:"POST",auth:!0})];case 2:return[2,s.sent().success];case 3:return a=s.sent(),console.error(a),[3,4];case 4:return[2,!1]}}))})),f.apply(this,arguments)}var x=t?"ban":"unban",j=t?(0,a.jsx)(o.Z,{style:{color:"var(--ant-error)"}}):(0,a.jsx)(c.Z,{style:{color:"var(--ant-warning)"}}),b=(0,a.jsxs)(a.Fragment,{children:["Are you sure you want to ",x," ",(0,a.jsx)("strong",{children:n.displayName}),t?" and remove their messages?":"?"]});return(0,a.jsx)(l.Z,{onClick:function(){i.Z.confirm({title:"Confirm ".concat(x),content:b,onCancel:function(){},onOk:function(){return new Promise((function(e,t){var r=function(e){return f.apply(this,arguments)}(n);r?setTimeout((function(){e(r),null===m||void 0===m||m()}),3e3):t()}))},okType:"danger",okText:t?"Absolutely":null,icon:j})},size:"small",icon:t?(0,a.jsx)(u.Z,{twoToneColor:"#ff4d4f"}):null,className:"block-user-button",children:h||x})};h.defaultProps={label:"",onClick:null}},11085:function(e,n,t){t.d(n,{Z:function(){return A}});var r=t(29815),s=t(85893),a=t(67294),i=t(94199),l=t(85402),o=t(84485),c=t(25968),u=t(6226),d=t(27049),h=t(26713),m=t(45938),f=t(58091),x=t(96486),j=t(77891),b=t(47568),p=t(70655),v=t(71577),y=t(21640),g=t(82911),Z=t(84674),k=t(24478),C=t(58827),w=function(e){var n,t=e.user,r=e.onClick;function a(){return a=(0,b.Z)((function(e,n){var t,r,s;return(0,p.__generator)(this,(function(a){switch(a.label){case 0:t=e.id,r={userId:t,isModerator:n},a.label=1;case 1:return a.trys.push([1,3,,4]),[4,(0,C.rQ)(C.jr,{data:r,method:"POST",auth:!0})];case 2:return[2,a.sent().success];case 3:return s=a.sent(),console.error(s),[3,4];case 4:return[2,!1]}}))})),a.apply(this,arguments)}var i=null===(n=t.scopes)||void 0===n?void 0:n.includes("MODERATOR"),o=i?"remove moderator":"add moderator",c=i?(0,s.jsx)(y.Z,{style:{color:"var(--ant-error)"}}):(0,s.jsx)(g.Z,{style:{color:"var(--ant-warning)"}}),u=(0,s.jsxs)(s.Fragment,{children:["Are you sure you want to ",o," ",(0,s.jsx)("strong",{children:t.displayName}),"?"]});return(0,s.jsx)(v.Z,{onClick:function(){l.Z.confirm({title:"Confirm ".concat(o),content:u,onCancel:function(){},onOk:function(){return new Promise((function(e,n){var s=function(e,n){return a.apply(this,arguments)}(t,!i);s?setTimeout((function(){e(s),null===r||void 0===r||r()}),3e3):n()}))},okType:"danger",okText:i?"Yup!":null,icon:c})},size:"small",icon:i?(0,s.jsx)(Z.Z,{twoToneColor:"#ff4d4f"}):(0,s.jsx)(k.Z,{twoToneColor:"#22bb44"}),className:"block-user-button",children:o})};w.defaultProps={onClick:null};var T=t(41542),N=t(2766),A=function(e){var n=e.user,t=e.connectionInfo,b=e.children,p=(0,a.useState)(!1),v=p[0],y=p[1],g=function(){y(!1)},Z=n.displayName,k=n.createdAt,C=n.previousNames,A=n.nameChangedAt,D=n.disabledAt,P=t||{},O=P.connectedAt,_=P.messageCount,E=P.userAgent,I=null,M=C&&(0,r.Z)(C);C&&C.length>1&&A&&(I=new Date(A),M.reverse());var S=new Date(k),F=(0,f.Z)(S,"PP pp"),z=I?(0,m.Z)(I):null;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Z,{title:(0,s.jsxs)(s.Fragment,{children:["Created at: ",F,".",(0,s.jsx)("br",{})," Click for more info."]}),placement:"bottomLeft",children:(0,s.jsx)("button",{type:"button","aria-label":"Display more details about this user",className:"user-item-container",onClick:function(){y(!0)},children:b})}),(0,s.jsx)(l.Z,{destroyOnClose:!0,width:600,cancelText:"Close",okButtonProps:{style:{display:"none"}},title:"User details: ".concat(Z),visible:v,onOk:g,onCancel:g,children:(0,s.jsxs)("div",{className:"user-details",children:[(0,s.jsx)(o.Z.Title,{level:4,children:Z}),(0,s.jsxs)("p",{className:"created-at",children:["User created at ",F,"."]}),(0,s.jsxs)(c.Z,{gutter:16,children:[t&&(0,s.jsxs)(u.Z,{md:I?12:24,children:[(0,s.jsx)(o.Z.Title,{level:5,children:"This user is currently connected to Chat."}),(0,s.jsxs)("ul",{className:"connection-info",children:[(0,s.jsxs)("li",{children:[(0,s.jsx)("strong",{children:"Active for:"})," ",(0,m.Z)(new Date(O))]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("strong",{children:"Messages sent:"})," ",_]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("strong",{children:"User Agent:"}),(0,s.jsx)("br",{}),(0,N.AB)(E)]})]})]}),I&&(0,s.jsxs)(u.Z,{md:t?12:24,children:[(0,s.jsx)(o.Z.Title,{level:5,children:"This user is also seen as:"}),(0,s.jsx)("ul",{className:"previous-names-list",children:(0,x.uniq)(M).map((function(e,n){return(0,s.jsxs)("li",{className:0===n?"latest":"",children:[(0,s.jsx)("span",{className:"user-name-item",children:e}),0===n?" (Changed ".concat(z," ago)"):""]})}))})]})]}),(0,s.jsx)(d.Z,{}),(0,s.jsxs)(h.Z,{direction:"horizontal",children:[D?(0,s.jsxs)(s.Fragment,{children:["This user was banned on ",(0,s.jsx)("code",{children:(0,T.u)(D)}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)(j.e,{label:"Unban this user",user:n,isEnabled:!1,onClick:g})]}):(0,s.jsx)(j.e,{label:"Ban this user",user:n,isEnabled:!0,onClick:g}),(0,s.jsx)(w,{user:n,onClick:g})]})]})})]})};A.defaultProps={connectionInfo:null}},41542:function(e,n,t){t.d(n,{K:function(){return c},u:function(){return o}});var r=t(85893),s=t(93626),a=t(58091),i=t(11085),l=t(77891);function o(e){return(0,a.Z)(new Date(e),"MMM d H:mma")}var c=function(e){var n=e.data,t=[{title:"Last Known Display Name",dataIndex:"displayName",key:"displayName",render:function(e,n){return(0,r.jsx)(i.Z,{user:n,children:(0,r.jsx)("span",{className:"display-name",children:e})})}},{title:"Created",dataIndex:"createdAt",key:"createdAt",render:function(e){return o(e)},sorter:function(e,n){return new Date(e.createdAt).getTime()-new Date(n.createdAt).getTime()},sortDirections:["descend","ascend"]},{title:"Disabled at",dataIndex:"disabledAt",key:"disabledAt",defaultSortOrder:"descend",render:function(e){return e?o(e):null},sorter:function(e,n){return new Date(e.disabledAt).getTime()-new Date(n.disabledAt).getTime()},sortDirections:["descend","ascend"]},{title:"",key:"block",className:"actions-col",render:function(e,n){return(0,r.jsx)(l.e,{user:n,isEnabled:!n.disabledAt})}}];return(0,r.jsx)(s.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:t,dataSource:n,size:"small",rowKey:"id"})}}}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin-2443e7998747a17b.js b/static/web/_next/static/chunks/pages/admin-cc18916a0b499b94.js similarity index 98% rename from static/web/_next/static/chunks/pages/admin-2443e7998747a17b.js rename to static/web/_next/static/chunks/pages/admin-cc18916a0b499b94.js index 07aea513c..2c20267c4 100644 --- a/static/web/_next/static/chunks/pages/admin-2443e7998747a17b.js +++ b/static/web/_next/static/chunks/pages/admin-cc18916a0b499b94.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6964],{64830:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return t(47073)}])},38856:function(e,n,t){"use strict";t.d(n,{o:function(){return h}});var s=t(85893),r=(t(67294),t(84485)),i=t(20550),a=t(10355),o=t(53731),l=t(58091),c=r.Z.Title;function d(e,n){var t="black";return"warning"===n.level?t="orange":"error"===n.level&&(t="red"),(0,s.jsx)(i.Z,{color:t,children:e})}function u(e){return(0,s.jsx)(o.Z,{children:e})}var h=function(e){var n=e.logs,t=e.pageSize;if(!(null===n||void 0===n?void 0:n.length))return null;var r=[{title:"Level",dataIndex:"level",key:"level",filters:[{text:"Info",value:"info"},{text:"Warning",value:"warning"},{text:"Error",value:"Error"}],onFilter:function(e,n){return 0===n.level.indexOf(e)},render:d},{title:"Timestamp",dataIndex:"time",key:"time",render:function(e){var n=new Date(e);return(0,l.Z)(n,"pp P")},sorter:function(e,n){return new Date(e.time).getTime()-new Date(n.time).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Message",dataIndex:"message",key:"message",render:u}];return(0,s.jsxs)("div",{className:"logs-section",children:[(0,s.jsx)(c,{children:"Logs"}),(0,s.jsx)(a.Z,{size:"middle",dataSource:n,columns:r,rowKey:function(e){return e.time},pagination:{pageSize:t||20}})]})}},71630:function(e,n,t){"use strict";t.d(n,{j:function(){return v}});var s=t(85893),r=t(8751),i=t(11475),a=t(25968),o=t(6226),l=t(74763),c=t(84485),d=t(14670),u=t(71577),h=t(41664),m=t.n(h),x=t(67294),f=t(35159),v=function(e){var n=e.showTroubleshootButton,t=(0,x.useContext)(f.aC).health;if(!t)return null;var h=t.healthy,v=t.healthPercentage,j=t.message,p=t.representation,g="#3f8600",w="info";return v<80?(g="#cf000f",w="error"):v<30&&(g="#f0ad4e",w="error"),(0,s.jsxs)("div",{children:[(0,s.jsxs)(a.Z,{gutter:8,children:[(0,s.jsx)(o.Z,{span:12,children:(0,s.jsx)(l.Z,{title:"Healthy Stream",value:h?"Yes":"No",valueStyle:{color:g},prefix:h?(0,s.jsx)(r.Z,{}):(0,s.jsx)(i.Z,{})})}),(0,s.jsx)(o.Z,{span:12,children:(0,s.jsx)(l.Z,{title:"Playback Health",value:v,valueStyle:{color:g},suffix:"%"})})]}),(0,s.jsx)(a.Z,{style:{display:p<100&&0!==p?"grid":"none"},children:(0,s.jsxs)(c.Z.Text,{type:"secondary",style:{textAlign:"center",fontSize:"0.7em",opacity:"0.3"},children:["Stream health represents ",p,"% of all known players. Other player status is unknown."]})}),(0,s.jsx)(a.Z,{gutter:16,style:{width:"100%",display:j?"grid":"none",marginTop:"10px"},children:(0,s.jsx)(o.Z,{span:24,children:(0,s.jsx)(d.Z,{message:j,type:w,showIcon:!0,action:n&&(0,s.jsx)(m(),{passHref:!0,href:"/stream-health",children:(0,s.jsx)(u.Z,{size:"small",type:"text",style:{color:"black"},children:"TROUBLESHOOT"})})})})})]})};v.defaultProps={showTroubleshootButton:!0}},47073:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return V}});var s=t(47568),r=t(70655),i=t(85893),a=t(67294),o=t(26303),l=t(74763),c=t(59652),d=t(25968),u=t(6226),h=t(24019),m=t(87547),x=t(19642),f=t(45938),v=t(35159),j=t(38856),p=t(66567),g=t(63179),w=t(78346),Z=t(27482),y=t(84485),b=t(41664),k=t.n(b),N=t(60113),S=t(26042),_=t(69396),C=t(54907),T=t(58091),O=t(58827),E=C.Z.Panel,D=y.Z.Title,P=y.Z.Link,U=function(e){var n=e.title,t=e.url,s=e.content_html,r=e.date_published,a=new Date(r),o=(0,T.Z)(a,"MMM dd, yyyy, HH:mm");return(0,i.jsx)("article",{children:(0,i.jsx)(C.Z,{children:(0,i.jsxs)(E,{header:n,children:[(0,i.jsxs)("p",{className:"timestamp",children:[o," (",(0,i.jsx)(P,{href:"".concat("https://owncast.online").concat(t),target:"_blank",rel:"noopener noreferrer",children:"Link"}),")"]}),(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:s}})]},t)})})},I=function(){var e=(0,a.useState)([]),n=e[0],t=e[1],l=(0,a.useState)(!0),c=l[0],d=l[1],u=function(){var e=(0,s.Z)((function(){var e,n;return(0,r.__generator)(this,(function(s){switch(s.label){case 0:d(!1),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,O.kg)("https://owncast.online/news/index.json")];case 2:return(null===(e=s.sent())||void 0===e?void 0:e.items.length)>0&&t(e.items),[3,4];case 3:return n=s.sent(),console.log("==== error",n),[3,4];case 4:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,a.useEffect)((function(){u()}),[]);var h=c?(0,i.jsx)(o.Z,{loading:!0,active:!0}):null,m=c||0!==n.length?null:(0,i.jsx)("div",{children:"No news."});return(0,i.jsxs)("section",{className:"news-feed form-module",children:[(0,i.jsx)(D,{level:2,children:"News & Updates from Owncast"}),h,n.map((function(e){return(0,a.createElement)(U,(0,_.Z)((0,S.Z)({},e),{key:e.url}))})),m]})},z=y.Z.Paragraph,B=y.Z.Text,L=y.Z.Title,F=c.Z.Meta;var H=function(e){var n,s,r,o,l=e.logs,h=void 0===l?[]:l,m=e.config,x=((0,a.useContext)(v.aC)||{}).serverConfig,f=x.streamKey,y=x.rtmpServerPort,b=(null===(n=t.g.window)||void 0===n?void 0:n.location.hostname)||"";b&&y&&(o=function(e,n){return"rtmp://".concat(e.replace(/(^\w+:|^)\/\//,""),":").concat(n,"/live")}(b,y));var S=[{icon:(0,i.jsx)(p.Z,{twoToneColor:"#6f42c1"}),title:"Use your broadcasting software",content:(0,i.jsxs)("div",{children:[(0,i.jsx)("a",{href:"https://owncast.online/docs/broadcasting/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn how to point your existing software to your new server and start streaming your content."}),(0,i.jsxs)("div",{className:"stream-info-container",children:[(0,i.jsx)(B,{strong:!0,className:"stream-info-label",children:"Streaming URL:"}),o&&(0,i.jsx)(z,{className:"stream-info-box",copyable:!0,children:o}),(0,i.jsx)(B,{strong:!0,className:"stream-info-label",children:"Stream Key:"}),(0,i.jsx)(z,{className:"stream-info-box",copyable:{text:f},children:"*********************"})]})]})},{icon:(0,i.jsx)(g.Z,{twoToneColor:"#f9826c"}),title:"Embed your video onto other sites",content:(0,i.jsx)("div",{children:(0,i.jsx)("a",{href:"https://owncast.online/docs/embed?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn how you can add your Owncast stream to other sites you control."})})}];return(null===m||void 0===m?void 0:m.chatDisabled)||S.push({icon:(0,i.jsx)(w.Z,{twoToneColor:"#0366d6"}),title:"Chat is disabled",content:(0,i.jsx)("span",{children:"Chat will continue to be disabled until you begin a live stream."})}),(null===m||void 0===m||null===(s=m.yp)||void 0===s?void 0:s.enabled)||S.push({icon:(0,i.jsx)(Z.Z,{twoToneColor:"#D18BFE"}),title:"Find an audience on the Owncast Directory",content:(0,i.jsxs)("div",{children:["List yourself in the Owncast Directory and show off your stream. Enable it in"," ",(0,i.jsx)(k(),{href:"/config-public-details",children:"settings."})]})}),(null===m||void 0===m||null===(r=m.federation)||void 0===r?void 0:r.enabled)||S.push({icon:(0,i.jsx)("img",{alt:"fediverse",width:"20px",src:"fediverse-white.png"}),title:"Add your Owncast instance to the Fediverse",content:(0,i.jsxs)("div",{children:[(0,i.jsx)(k(),{href:"/config-federation",children:"Enable Owncast social"})," features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream."]})}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.Z,{children:(0,i.jsx)(u.Z,{span:12,offset:6,children:(0,i.jsxs)("div",{className:"offline-intro",children:[(0,i.jsx)("span",{className:"logo",children:(0,i.jsx)(N.C,{variant:"simple"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(L,{level:2,children:"No stream is active"}),(0,i.jsx)("p",{children:"You should start one."})]})]})})}),(0,i.jsxs)(d.Z,{gutter:[16,16],className:"offline-content",children:[(0,i.jsx)(u.Z,{span:12,xs:24,sm:24,md:24,lg:12,className:"list-section",children:S.map((function(e){return(0,i.jsx)(c.Z,{size:"small",bordered:!1,children:(0,i.jsx)(F,{avatar:e.icon,title:e.title,description:e.content})},e.title)}))}),(0,i.jsx)(u.Z,{span:12,xs:24,sm:24,md:24,lg:12,children:(0,i.jsx)(I,{})})]}),(0,i.jsx)(j.o,{logs:h,pageSize:5})]})},M=t(71630),A=t(2766);function Q(e){return(0,i.jsxs)("ul",{className:"statistics-list",children:[(0,i.jsxs)("li",{children:[e.videoCodec||"Unknown"," @ ",e.videoBitrate||"Unknown"," kbps"]}),(0,i.jsxs)("li",{children:[e.framerate||"Unknown"," fps"]}),(0,i.jsxs)("li",{children:[e.width," x ",e.height]})]})}function V(){var e,n,t=(0,a.useContext)(v.aC),p=t||{},g=p.broadcaster,w=p.serverConfig,Z=g||{},y=Z.remoteAddr,b=Z.streamDetails,k=(null===b||void 0===b?void 0:b.encoder)||"Unknown encoder",N=(0,a.useState)([]),S=N[0],_=N[1],C=function(){var e=(0,s.Z)((function(){var e,n;return(0,r.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,O.rQ)(O.WQ)];case 1:return e=t.sent(),_(e),[3,3];case 2:return n=t.sent(),console.log("==== error",n),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),T=function(){C()};if((0,a.useEffect)((function(){T();var e;return e=setInterval(T,O.NE),function(){clearInterval(e)}}),[]),(0,A.Qr)(w)||(0,A.Qr)(t))return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.Z,{active:!0}),(0,i.jsx)(o.Z,{active:!0}),(0,i.jsx)(o.Z,{active:!0})]});if(!g)return(0,i.jsx)(H,{logs:S,config:w});var E=null===t||void 0===t||null===(e=t.currentBroadcast)||void 0===e||null===(n=e.outputSettings)||void 0===n?void 0:n.map((function(e){var n=e.audioPassthrough,t=e.videoPassthrough,s=e.audioBitrate,r=e.videoBitrate,a=e.framerate,o=n?"".concat(b.audioCodec||"Unknown",", ").concat(b.audioBitrate," kbps"):"".concat(s||"Unknown"," kbps"),c=t?"".concat(b.videoBitrate||"Unknown"," kbps, ").concat(b.framerate," fps ").concat(b.width," x ").concat(b.height):"".concat(r||"Unknown"," kbps, ").concat(a," fps");return(0,i.jsxs)("div",{className:"stream-details-item-container",children:[(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Outbound Video Stream",value:c}),(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Outbound Audio Stream",value:o})]})})),D=t.viewerCount,P=t.sessionPeakViewerCount,U="".concat(b.audioCodec,", ").concat(b.audioBitrate||"Unknown"," kbps"),z=new Date(g.time);return(0,i.jsxs)("div",{className:"home-container",children:[(0,i.jsxs)("div",{className:"sections-container",children:[(0,i.jsx)("div",{className:"online-status-section",children:(0,i.jsxs)(c.Z,{size:"small",type:"inner",className:"online-details-card",children:[(0,i.jsxs)(d.Z,{gutter:[16,16],align:"middle",children:[(0,i.jsx)(u.Z,{span:8,sm:24,md:8,children:(0,i.jsx)(l.Z,{title:"Stream started ".concat((0,x.Z)(z,Date.now())),value:(0,f.Z)(z),prefix:(0,i.jsx)(h.Z,{})})}),(0,i.jsx)(u.Z,{span:8,sm:24,md:8,children:(0,i.jsx)(l.Z,{title:"Viewers",value:D,prefix:(0,i.jsx)(m.Z,{})})}),(0,i.jsx)(u.Z,{span:8,sm:24,md:8,children:(0,i.jsx)(l.Z,{title:"Peak viewer count",value:P,prefix:(0,i.jsx)(m.Z,{})})})]}),(0,i.jsx)(M.j,{})]})}),(0,i.jsxs)(d.Z,{gutter:[16,16],className:"section stream-details-section",children:[(0,i.jsxs)(u.Z,{className:"stream-details",span:12,sm:24,md:24,lg:12,children:[(0,i.jsx)(c.Z,{size:"small",title:"Outbound Stream Details",type:"inner",className:"outbound-details",children:E}),(0,i.jsxs)(c.Z,{size:"small",title:"Inbound Stream Details",type:"inner",children:[(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Input",value:"".concat(k," ").concat((0,A.t5)(y))}),(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Inbound Video Stream",value:b,formatter:Q}),(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Inbound Audio Stream",value:U})]})]}),(0,i.jsx)(u.Z,{span:12,xs:24,sm:24,md:24,lg:12,children:(0,i.jsx)(I,{})})]})]}),(0,i.jsx)("br",{}),(0,i.jsx)(j.o,{logs:S,pageSize:5})]})}}},function(e){e.O(0,[8939,3903,3698,355,8091,2944,5938,5315,4763,2429,5300,9774,2888,179],(function(){return n=64830,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6964],{64830:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin",function(){return t(47073)}])},38856:function(e,n,t){"use strict";t.d(n,{o:function(){return h}});var s=t(85893),r=(t(67294),t(84485)),i=t(20550),a=t(93626),o=t(53731),l=t(58091),c=r.Z.Title;function d(e,n){var t="black";return"warning"===n.level?t="orange":"error"===n.level&&(t="red"),(0,s.jsx)(i.Z,{color:t,children:e})}function u(e){return(0,s.jsx)(o.Z,{children:e})}var h=function(e){var n=e.logs,t=e.pageSize;if(!(null===n||void 0===n?void 0:n.length))return null;var r=[{title:"Level",dataIndex:"level",key:"level",filters:[{text:"Info",value:"info"},{text:"Warning",value:"warning"},{text:"Error",value:"Error"}],onFilter:function(e,n){return 0===n.level.indexOf(e)},render:d},{title:"Timestamp",dataIndex:"time",key:"time",render:function(e){var n=new Date(e);return(0,l.Z)(n,"pp P")},sorter:function(e,n){return new Date(e.time).getTime()-new Date(n.time).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Message",dataIndex:"message",key:"message",render:u}];return(0,s.jsxs)("div",{className:"logs-section",children:[(0,s.jsx)(c,{children:"Logs"}),(0,s.jsx)(a.Z,{size:"middle",dataSource:n,columns:r,rowKey:function(e){return e.time},pagination:{pageSize:t||20}})]})}},71630:function(e,n,t){"use strict";t.d(n,{j:function(){return v}});var s=t(85893),r=t(8751),i=t(11475),a=t(25968),o=t(6226),l=t(74763),c=t(84485),d=t(14670),u=t(71577),h=t(41664),m=t.n(h),x=t(67294),f=t(35159),v=function(e){var n=e.showTroubleshootButton,t=(0,x.useContext)(f.aC).health;if(!t)return null;var h=t.healthy,v=t.healthPercentage,j=t.message,p=t.representation,g="#3f8600",w="info";return v<80?(g="#cf000f",w="error"):v<30&&(g="#f0ad4e",w="error"),(0,s.jsxs)("div",{children:[(0,s.jsxs)(a.Z,{gutter:8,children:[(0,s.jsx)(o.Z,{span:12,children:(0,s.jsx)(l.Z,{title:"Healthy Stream",value:h?"Yes":"No",valueStyle:{color:g},prefix:h?(0,s.jsx)(r.Z,{}):(0,s.jsx)(i.Z,{})})}),(0,s.jsx)(o.Z,{span:12,children:(0,s.jsx)(l.Z,{title:"Playback Health",value:v,valueStyle:{color:g},suffix:"%"})})]}),(0,s.jsx)(a.Z,{style:{display:p<100&&0!==p?"grid":"none"},children:(0,s.jsxs)(c.Z.Text,{type:"secondary",style:{textAlign:"center",fontSize:"0.7em",opacity:"0.3"},children:["Stream health represents ",p,"% of all known players. Other player status is unknown."]})}),(0,s.jsx)(a.Z,{gutter:16,style:{width:"100%",display:j?"grid":"none",marginTop:"10px"},children:(0,s.jsx)(o.Z,{span:24,children:(0,s.jsx)(d.Z,{message:j,type:w,showIcon:!0,action:n&&(0,s.jsx)(m(),{passHref:!0,href:"/stream-health",children:(0,s.jsx)(u.Z,{size:"small",type:"text",style:{color:"black"},children:"TROUBLESHOOT"})})})})})]})};v.defaultProps={showTroubleshootButton:!0}},47073:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return V}});var s=t(47568),r=t(70655),i=t(85893),a=t(67294),o=t(26303),l=t(74763),c=t(59652),d=t(25968),u=t(6226),h=t(24019),m=t(87547),x=t(19642),f=t(45938),v=t(35159),j=t(38856),p=t(66567),g=t(63179),w=t(78346),Z=t(27482),y=t(84485),b=t(41664),k=t.n(b),N=t(60113),S=t(26042),_=t(69396),C=t(54907),T=t(58091),O=t(58827),E=C.Z.Panel,D=y.Z.Title,P=y.Z.Link,U=function(e){var n=e.title,t=e.url,s=e.content_html,r=e.date_published,a=new Date(r),o=(0,T.Z)(a,"MMM dd, yyyy, HH:mm");return(0,i.jsx)("article",{children:(0,i.jsx)(C.Z,{children:(0,i.jsxs)(E,{header:n,children:[(0,i.jsxs)("p",{className:"timestamp",children:[o," (",(0,i.jsx)(P,{href:"".concat("https://owncast.online").concat(t),target:"_blank",rel:"noopener noreferrer",children:"Link"}),")"]}),(0,i.jsx)("div",{dangerouslySetInnerHTML:{__html:s}})]},t)})})},I=function(){var e=(0,a.useState)([]),n=e[0],t=e[1],l=(0,a.useState)(!0),c=l[0],d=l[1],u=function(){var e=(0,s.Z)((function(){var e,n;return(0,r.__generator)(this,(function(s){switch(s.label){case 0:d(!1),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,(0,O.kg)("https://owncast.online/news/index.json")];case 2:return(null===(e=s.sent())||void 0===e?void 0:e.items.length)>0&&t(e.items),[3,4];case 3:return n=s.sent(),console.log("==== error",n),[3,4];case 4:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,a.useEffect)((function(){u()}),[]);var h=c?(0,i.jsx)(o.Z,{loading:!0,active:!0}):null,m=c||0!==n.length?null:(0,i.jsx)("div",{children:"No news."});return(0,i.jsxs)("section",{className:"news-feed form-module",children:[(0,i.jsx)(D,{level:2,children:"News & Updates from Owncast"}),h,n.map((function(e){return(0,a.createElement)(U,(0,_.Z)((0,S.Z)({},e),{key:e.url}))})),m]})},z=y.Z.Paragraph,B=y.Z.Text,L=y.Z.Title,F=c.Z.Meta;var H=function(e){var n,s,r,o,l=e.logs,h=void 0===l?[]:l,m=e.config,x=((0,a.useContext)(v.aC)||{}).serverConfig,f=x.streamKey,y=x.rtmpServerPort,b=(null===(n=t.g.window)||void 0===n?void 0:n.location.hostname)||"";b&&y&&(o=function(e,n){return"rtmp://".concat(e.replace(/(^\w+:|^)\/\//,""),":").concat(n,"/live")}(b,y));var S=[{icon:(0,i.jsx)(p.Z,{twoToneColor:"#6f42c1"}),title:"Use your broadcasting software",content:(0,i.jsxs)("div",{children:[(0,i.jsx)("a",{href:"https://owncast.online/docs/broadcasting/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn how to point your existing software to your new server and start streaming your content."}),(0,i.jsxs)("div",{className:"stream-info-container",children:[(0,i.jsx)(B,{strong:!0,className:"stream-info-label",children:"Streaming URL:"}),o&&(0,i.jsx)(z,{className:"stream-info-box",copyable:!0,children:o}),(0,i.jsx)(B,{strong:!0,className:"stream-info-label",children:"Stream Key:"}),(0,i.jsx)(z,{className:"stream-info-box",copyable:{text:f},children:"*********************"})]})]})},{icon:(0,i.jsx)(g.Z,{twoToneColor:"#f9826c"}),title:"Embed your video onto other sites",content:(0,i.jsx)("div",{children:(0,i.jsx)("a",{href:"https://owncast.online/docs/embed?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn how you can add your Owncast stream to other sites you control."})})}];return(null===m||void 0===m?void 0:m.chatDisabled)||S.push({icon:(0,i.jsx)(w.Z,{twoToneColor:"#0366d6"}),title:"Chat is disabled",content:(0,i.jsx)("span",{children:"Chat will continue to be disabled until you begin a live stream."})}),(null===m||void 0===m||null===(s=m.yp)||void 0===s?void 0:s.enabled)||S.push({icon:(0,i.jsx)(Z.Z,{twoToneColor:"#D18BFE"}),title:"Find an audience on the Owncast Directory",content:(0,i.jsxs)("div",{children:["List yourself in the Owncast Directory and show off your stream. Enable it in"," ",(0,i.jsx)(k(),{href:"/config-public-details",children:"settings."})]})}),(null===m||void 0===m||null===(r=m.federation)||void 0===r?void 0:r.enabled)||S.push({icon:(0,i.jsx)("img",{alt:"fediverse",width:"20px",src:"fediverse-white.png"}),title:"Add your Owncast instance to the Fediverse",content:(0,i.jsxs)("div",{children:[(0,i.jsx)(k(),{href:"/config-federation",children:"Enable Owncast social"})," features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream."]})}),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.Z,{children:(0,i.jsx)(u.Z,{span:12,offset:6,children:(0,i.jsxs)("div",{className:"offline-intro",children:[(0,i.jsx)("span",{className:"logo",children:(0,i.jsx)(N.C,{variant:"simple"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(L,{level:2,children:"No stream is active"}),(0,i.jsx)("p",{children:"You should start one."})]})]})})}),(0,i.jsxs)(d.Z,{gutter:[16,16],className:"offline-content",children:[(0,i.jsx)(u.Z,{span:12,xs:24,sm:24,md:24,lg:12,className:"list-section",children:S.map((function(e){return(0,i.jsx)(c.Z,{size:"small",bordered:!1,children:(0,i.jsx)(F,{avatar:e.icon,title:e.title,description:e.content})},e.title)}))}),(0,i.jsx)(u.Z,{span:12,xs:24,sm:24,md:24,lg:12,children:(0,i.jsx)(I,{})})]}),(0,i.jsx)(j.o,{logs:h,pageSize:5})]})},M=t(71630),A=t(2766);function Q(e){return(0,i.jsxs)("ul",{className:"statistics-list",children:[(0,i.jsxs)("li",{children:[e.videoCodec||"Unknown"," @ ",e.videoBitrate||"Unknown"," kbps"]}),(0,i.jsxs)("li",{children:[e.framerate||"Unknown"," fps"]}),(0,i.jsxs)("li",{children:[e.width," x ",e.height]})]})}function V(){var e,n,t=(0,a.useContext)(v.aC),p=t||{},g=p.broadcaster,w=p.serverConfig,Z=g||{},y=Z.remoteAddr,b=Z.streamDetails,k=(null===b||void 0===b?void 0:b.encoder)||"Unknown encoder",N=(0,a.useState)([]),S=N[0],_=N[1],C=function(){var e=(0,s.Z)((function(){var e,n;return(0,r.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,O.rQ)(O.WQ)];case 1:return e=t.sent(),_(e),[3,3];case 2:return n=t.sent(),console.log("==== error",n),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),T=function(){C()};if((0,a.useEffect)((function(){T();var e;return e=setInterval(T,O.NE),function(){clearInterval(e)}}),[]),(0,A.Qr)(w)||(0,A.Qr)(t))return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.Z,{active:!0}),(0,i.jsx)(o.Z,{active:!0}),(0,i.jsx)(o.Z,{active:!0})]});if(!g)return(0,i.jsx)(H,{logs:S,config:w});var E=null===t||void 0===t||null===(e=t.currentBroadcast)||void 0===e||null===(n=e.outputSettings)||void 0===n?void 0:n.map((function(e){var n=e.audioPassthrough,t=e.videoPassthrough,s=e.audioBitrate,r=e.videoBitrate,a=e.framerate,o=n?"".concat(b.audioCodec||"Unknown",", ").concat(b.audioBitrate," kbps"):"".concat(s||"Unknown"," kbps"),c=t?"".concat(b.videoBitrate||"Unknown"," kbps, ").concat(b.framerate," fps ").concat(b.width," x ").concat(b.height):"".concat(r||"Unknown"," kbps, ").concat(a," fps");return(0,i.jsxs)("div",{className:"stream-details-item-container",children:[(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Outbound Video Stream",value:c}),(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Outbound Audio Stream",value:o})]})})),D=t.viewerCount,P=t.sessionPeakViewerCount,U="".concat(b.audioCodec,", ").concat(b.audioBitrate||"Unknown"," kbps"),z=new Date(g.time);return(0,i.jsxs)("div",{className:"home-container",children:[(0,i.jsxs)("div",{className:"sections-container",children:[(0,i.jsx)("div",{className:"online-status-section",children:(0,i.jsxs)(c.Z,{size:"small",type:"inner",className:"online-details-card",children:[(0,i.jsxs)(d.Z,{gutter:[16,16],align:"middle",children:[(0,i.jsx)(u.Z,{span:8,sm:24,md:8,children:(0,i.jsx)(l.Z,{title:"Stream started ".concat((0,x.Z)(z,Date.now())),value:(0,f.Z)(z),prefix:(0,i.jsx)(h.Z,{})})}),(0,i.jsx)(u.Z,{span:8,sm:24,md:8,children:(0,i.jsx)(l.Z,{title:"Viewers",value:D,prefix:(0,i.jsx)(m.Z,{})})}),(0,i.jsx)(u.Z,{span:8,sm:24,md:8,children:(0,i.jsx)(l.Z,{title:"Peak viewer count",value:P,prefix:(0,i.jsx)(m.Z,{})})})]}),(0,i.jsx)(M.j,{})]})}),(0,i.jsxs)(d.Z,{gutter:[16,16],className:"section stream-details-section",children:[(0,i.jsxs)(u.Z,{className:"stream-details",span:12,sm:24,md:24,lg:12,children:[(0,i.jsx)(c.Z,{size:"small",title:"Outbound Stream Details",type:"inner",className:"outbound-details",children:E}),(0,i.jsxs)(c.Z,{size:"small",title:"Inbound Stream Details",type:"inner",children:[(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Input",value:"".concat(k," ").concat((0,A.t5)(y))}),(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Inbound Video Stream",value:b,formatter:Q}),(0,i.jsx)(l.Z,{className:"stream-details-item",title:"Inbound Audio Stream",value:U})]})]}),(0,i.jsx)(u.Z,{span:12,xs:24,sm:24,md:24,lg:12,children:(0,i.jsx)(I,{})})]})]}),(0,i.jsx)("br",{}),(0,i.jsx)(j.o,{logs:S,pageSize:5})]})}}},function(e){e.O(0,[8939,3903,3698,3626,8091,2944,5938,5315,4763,2429,5300,9774,2888,179],(function(){return n=64830,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/access-tokens-8b84a4df3eda8be0.js b/static/web/_next/static/chunks/pages/admin/access-tokens-ffe8732ccbc0256e.js similarity index 98% rename from static/web/_next/static/chunks/pages/admin/access-tokens-8b84a4df3eda8be0.js rename to static/web/_next/static/chunks/pages/admin/access-tokens-ffe8732ccbc0256e.js index 68717306e..9e03bad64 100644 --- a/static/web/_next/static/chunks/pages/admin/access-tokens-8b84a4df3eda8be0.js +++ b/static/web/_next/static/chunks/pages/admin/access-tokens-ffe8732ccbc0256e.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9882],{48689:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1413),o=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},a=n(42135),s=function(e,t){return o.createElement(a.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))};s.displayName="DeleteOutlined";var i=o.forwardRef(s)},6226:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4942),o=n(87462),c=n(71002),a=n(94184),s=n.n(a),i=n(67294),l=n(53124),u=n(99134),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0){var I=m[0]/2;A.paddingLeft=I,A.paddingRight=I}if(m&&m[1]>0&&!x){var R=m[1]/2;A.paddingTop=R,A.paddingBottom=R}return E&&(A.flex=function(e){return"number"===typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(E),!1!==y||A.minWidth||(A.minWidth=0)),i.createElement("div",(0,o.Z)({},S,{style:(0,o.Z)((0,o.Z)({},A),N),className:T,ref:t}),C)}))},99134:function(e,t,n){"use strict";var r=(0,n(67294).createContext)({});t.Z=r},25968:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(87462),o=n(4942),c=n(71002),a=n(97685),s=n(94184),i=n.n(s),l=n(67294),u=n(53124),f=n(98082),p=n(24308),d=n(93355),v=n(99134),h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0?I[0]/-2:void 0,G=null!=I[1]&&I[1]>0?I[1]/-2:void 0;if(D&&(M.marginLeft=D,M.marginRight=D),P){var H=(0,a.Z)(I,2);M.rowGap=H[1]}else G&&(M.marginTop=G,M.marginBottom=G);var $=(0,a.Z)(I,2),z=$[0],W=$[1],B=l.useMemo((function(){return{gutter:[z,W],wrap:j,supportFlexGap:P}}),[z,W,j,P]);return l.createElement(v.Z.Provider,{value:B},l.createElement("div",(0,r.Z)({},w,{className:R,style:(0,r.Z)((0,r.Z)({},M),x),ref:t}),b))}))},20550:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r=n(4942),o=n(87462),c=n(97685),a=n(97937),s=n(94184),i=n.n(s),l=n(98423),u=n(67294),f=n(53124),p=n(98787),d=n(68349),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=t||n<0||m&&e-v>=u}function g(){var e=o();if(Z(e))return j(e);p=setTimeout(g,function(e){var n=t-(e-d);return m?s(n,u-(e-v)):n}(e))}function j(e){return p=void 0,y&&i?x(e):(i=l=void 0,f)}function w(){var e=o(),n=Z(e);if(i=arguments,l=this,d=e,n){if(void 0===p)return b(d);if(m)return clearTimeout(p),p=setTimeout(g,t),x(d)}return void 0===p&&(p=setTimeout(g,t)),f}return t=c(t)||0,r(n)&&(h=!!n.leading,u=(m="maxWait"in n)?a(c(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),w.cancel=function(){void 0!==p&&clearTimeout(p),v=0,i=d=l=p=void 0},w.flush=function(){return void 0===p?f:j(o())},w}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),o=n(13218),c=n(33448),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(c(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||i.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},26562:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/access-tokens",function(){return n(75575)}])},75575:function(e,t,n){"use strict";n.r(t);var r=n(47568),o=n(70655),c=n(85893),a=n(67294),s=n(84485),i=n(94199),l=n(20550),u=n(6226),f=n(32808),p=n(85402),d=n(69677),v=n(25968),h=n(71577),m=n(26713),y=n(10355),x=n(48689),b=n(58091),Z=n(58827),g=s.Z.Title,j=s.Z.Paragraph,w={CAN_SEND_SYSTEM_MESSAGES:{name:"System messages",description:"Can send official messages on behalf of the system.",color:"purple"},CAN_SEND_MESSAGES:{name:"User chat messages",description:"Can send chat messages on behalf of the owner of this token.",color:"green"},HAS_ADMIN_ACCESS:{name:"Has admin access",description:"Can perform administrative actions such as moderation, get server statuses, etc.",color:"red"}};var k=function(e){var t=e.onOk,n=e.onCancel,r=e.visible,o=(0,a.useState)([]),s=o[0],i=o[1],l=(0,a.useState)(""),m=l[0],y=l[1],x=Object.keys(w).map((function(e){return{value:e,label:w[e].description}})),b={disabled:0===s.length||""===m},Z=x.map((function(e){return(0,c.jsx)(u.Z,{span:8,children:(0,c.jsx)(f.Z,{value:e.value,children:e.label})},e.value)}));return(0,c.jsxs)(p.Z,{title:"Create New Access token",visible:r,onOk:function(){t(m,s),i([]),y("")},onCancel:n,okButtonProps:b,children:[(0,c.jsxs)("p",{children:[(0,c.jsx)("p",{children:"The name will be displayed as the chat user when sending messages with this access token."}),(0,c.jsx)(d.Z,{value:m,placeholder:"Name of bot, service, or integration",onChange:function(e){return y(e.currentTarget.value)}})]}),(0,c.jsx)("p",{children:"Select the permissions this access token will have. It cannot be edited after it's created."}),(0,c.jsx)(f.Z.Group,{style:{width:"100%"},value:s,onChange:function(e){i(e)},children:(0,c.jsx)(v.Z,{children:Z})}),(0,c.jsx)("p",{children:(0,c.jsx)(h.Z,{type:"primary",onClick:function(){i(Object.keys(w))},children:"Select all"})})]})};t.default=function(){var e=function(e){console.error("error",e)},t=(0,a.useState)([]),n=t[0],s=t[1],u=(0,a.useState)(!1),f=u[0],p=u[1];function v(){return O.apply(this,arguments)}function O(){return(O=(0,r.Z)((function(){var t,n;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,Z.rQ)(Z.ms)];case 1:return t=r.sent(),s(t),[3,3];case 2:return n=r.sent(),e(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function C(){return(C=(0,r.Z)((function(t){var n;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,Z.rQ)(Z.Wr,{method:"POST",data:{token:t}})];case 1:return r.sent(),v(),[3,3];case 2:return n=r.sent(),e(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function E(){return(E=(0,r.Z)((function(t,r){var c,a;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,(0,Z.rQ)(Z.IO,{method:"POST",data:{name:t,scopes:r}})];case 1:return c=o.sent(),s(n.concat(c)),[3,3];case 2:return a=o.sent(),e(a),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}(0,a.useEffect)((function(){v()}),[]);var N=[{title:"",key:"delete",render:function(e,t){return(0,c.jsx)(m.Z,{size:"middle",children:(0,c.jsx)(h.Z,{onClick:function(){return function(e){return C.apply(this,arguments)}(t.accessToken)},icon:(0,c.jsx)(x.Z,{})})})}},{title:"Name",dataIndex:"displayName",key:"displayName"},{title:"Token",dataIndex:"accessToken",key:"accessToken",render:function(e){return(0,c.jsx)(d.Z.Password,{size:"small",bordered:!1,value:e})}},{title:"Scopes",dataIndex:"scopes",key:"scopes",render:function(e){return(0,c.jsx)(c.Fragment,{children:e.map((function(e){return function(e){if(!e||!w[e])return null;var t=w[e];return(0,c.jsx)(i.Z,{title:t.description,children:(0,c.jsx)(l.Z,{color:t.color,children:t.name})},e)}(e)}))})}},{title:"Last Used",dataIndex:"lastUsed",key:"lastUsed",render:function(e){if(!e)return"Never";var t=new Date(e);return(0,b.Z)(t,"P p")}}];return(0,c.jsxs)("div",{children:[(0,c.jsx)(g,{children:"Access Tokens"}),(0,c.jsx)(j,{children:"Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control."}),(0,c.jsxs)(j,{children:["Read more about how to use these tokens, with examples, at"," ",(0,c.jsx)("a",{href:"https://owncast.online/docs/integrations/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"our documentation"}),"."]}),(0,c.jsx)(y.Z,{rowKey:"token",columns:N,dataSource:n,pagination:!1}),(0,c.jsx)("br",{}),(0,c.jsx)(h.Z,{type:"primary",onClick:function(){p(!0)},children:"Create Access Token"}),(0,c.jsx)(k,{visible:f,onOk:function(e,t){p(!1),function(e,t){E.apply(this,arguments)}(e,t)},onCancel:function(){p(!1)}})]})}}},function(e){e.O(0,[8939,3903,3698,355,8091,9774,2888,179],(function(){return t=26562,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9882],{48689:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(1413),o=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},a=n(42135),s=function(e,t){return o.createElement(a.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))};s.displayName="DeleteOutlined";var i=o.forwardRef(s)},6226:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4942),o=n(87462),c=n(71002),a=n(94184),s=n.n(a),i=n(67294),l=n(53124),u=n(99134),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0){var I=m[0]/2;A.paddingLeft=I,A.paddingRight=I}if(m&&m[1]>0&&!x){var R=m[1]/2;A.paddingTop=R,A.paddingBottom=R}return E&&(A.flex=function(e){return"number"===typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(E),!1!==y||A.minWidth||(A.minWidth=0)),i.createElement("div",(0,o.Z)({},S,{style:(0,o.Z)((0,o.Z)({},A),N),className:T,ref:t}),C)}))},99134:function(e,t,n){"use strict";var r=(0,n(67294).createContext)({});t.Z=r},25968:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(87462),o=n(4942),c=n(71002),a=n(97685),s=n(94184),i=n.n(s),l=n(67294),u=n(53124),f=n(98082),p=n(24308),d=n(93355),v=n(99134),h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0?I[0]/-2:void 0,G=null!=I[1]&&I[1]>0?I[1]/-2:void 0;if(D&&(M.marginLeft=D,M.marginRight=D),P){var H=(0,a.Z)(I,2);M.rowGap=H[1]}else G&&(M.marginTop=G,M.marginBottom=G);var $=(0,a.Z)(I,2),z=$[0],W=$[1],B=l.useMemo((function(){return{gutter:[z,W],wrap:j,supportFlexGap:P}}),[z,W,j,P]);return l.createElement(v.Z.Provider,{value:B},l.createElement("div",(0,r.Z)({},w,{className:R,style:(0,r.Z)((0,r.Z)({},M),x),ref:t}),b))}))},20550:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});var r=n(4942),o=n(87462),c=n(97685),a=n(97937),s=n(94184),i=n.n(s),l=n(98423),u=n(67294),f=n(53124),p=n(98787),d=n(68349),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=t||n<0||m&&e-v>=u}function g(){var e=o();if(Z(e))return j(e);p=setTimeout(g,function(e){var n=t-(e-d);return m?s(n,u-(e-v)):n}(e))}function j(e){return p=void 0,y&&i?x(e):(i=l=void 0,f)}function w(){var e=o(),n=Z(e);if(i=arguments,l=this,d=e,n){if(void 0===p)return b(d);if(m)return clearTimeout(p),p=setTimeout(g,t),x(d)}return void 0===p&&(p=setTimeout(g,t)),f}return t=c(t)||0,r(n)&&(h=!!n.leading,u=(m="maxWait"in n)?a(c(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),w.cancel=function(){void 0!==p&&clearTimeout(p),v=0,i=d=l=p=void 0},w.flush=function(){return void 0===p?f:j(o())},w}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),o=n(13218),c=n(33448),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(c(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||i.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},26562:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/access-tokens",function(){return n(75575)}])},75575:function(e,t,n){"use strict";n.r(t);var r=n(47568),o=n(70655),c=n(85893),a=n(67294),s=n(84485),i=n(94199),l=n(20550),u=n(6226),f=n(32808),p=n(85402),d=n(69677),v=n(25968),h=n(71577),m=n(26713),y=n(93626),x=n(48689),b=n(58091),Z=n(58827),g=s.Z.Title,j=s.Z.Paragraph,w={CAN_SEND_SYSTEM_MESSAGES:{name:"System messages",description:"Can send official messages on behalf of the system.",color:"purple"},CAN_SEND_MESSAGES:{name:"User chat messages",description:"Can send chat messages on behalf of the owner of this token.",color:"green"},HAS_ADMIN_ACCESS:{name:"Has admin access",description:"Can perform administrative actions such as moderation, get server statuses, etc.",color:"red"}};var k=function(e){var t=e.onOk,n=e.onCancel,r=e.visible,o=(0,a.useState)([]),s=o[0],i=o[1],l=(0,a.useState)(""),m=l[0],y=l[1],x=Object.keys(w).map((function(e){return{value:e,label:w[e].description}})),b={disabled:0===s.length||""===m},Z=x.map((function(e){return(0,c.jsx)(u.Z,{span:8,children:(0,c.jsx)(f.Z,{value:e.value,children:e.label})},e.value)}));return(0,c.jsxs)(p.Z,{title:"Create New Access token",visible:r,onOk:function(){t(m,s),i([]),y("")},onCancel:n,okButtonProps:b,children:[(0,c.jsxs)("p",{children:[(0,c.jsx)("p",{children:"The name will be displayed as the chat user when sending messages with this access token."}),(0,c.jsx)(d.Z,{value:m,placeholder:"Name of bot, service, or integration",onChange:function(e){return y(e.currentTarget.value)}})]}),(0,c.jsx)("p",{children:"Select the permissions this access token will have. It cannot be edited after it's created."}),(0,c.jsx)(f.Z.Group,{style:{width:"100%"},value:s,onChange:function(e){i(e)},children:(0,c.jsx)(v.Z,{children:Z})}),(0,c.jsx)("p",{children:(0,c.jsx)(h.Z,{type:"primary",onClick:function(){i(Object.keys(w))},children:"Select all"})})]})};t.default=function(){var e=function(e){console.error("error",e)},t=(0,a.useState)([]),n=t[0],s=t[1],u=(0,a.useState)(!1),f=u[0],p=u[1];function v(){return O.apply(this,arguments)}function O(){return(O=(0,r.Z)((function(){var t,n;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,Z.rQ)(Z.ms)];case 1:return t=r.sent(),s(t),[3,3];case 2:return n=r.sent(),e(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function C(){return(C=(0,r.Z)((function(t){var n;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,Z.rQ)(Z.Wr,{method:"POST",data:{token:t}})];case 1:return r.sent(),v(),[3,3];case 2:return n=r.sent(),e(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function E(){return(E=(0,r.Z)((function(t,r){var c,a;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,(0,Z.rQ)(Z.IO,{method:"POST",data:{name:t,scopes:r}})];case 1:return c=o.sent(),s(n.concat(c)),[3,3];case 2:return a=o.sent(),e(a),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}(0,a.useEffect)((function(){v()}),[]);var N=[{title:"",key:"delete",render:function(e,t){return(0,c.jsx)(m.Z,{size:"middle",children:(0,c.jsx)(h.Z,{onClick:function(){return function(e){return C.apply(this,arguments)}(t.accessToken)},icon:(0,c.jsx)(x.Z,{})})})}},{title:"Name",dataIndex:"displayName",key:"displayName"},{title:"Token",dataIndex:"accessToken",key:"accessToken",render:function(e){return(0,c.jsx)(d.Z.Password,{size:"small",bordered:!1,value:e})}},{title:"Scopes",dataIndex:"scopes",key:"scopes",render:function(e){return(0,c.jsx)(c.Fragment,{children:e.map((function(e){return function(e){if(!e||!w[e])return null;var t=w[e];return(0,c.jsx)(i.Z,{title:t.description,children:(0,c.jsx)(l.Z,{color:t.color,children:t.name})},e)}(e)}))})}},{title:"Last Used",dataIndex:"lastUsed",key:"lastUsed",render:function(e){if(!e)return"Never";var t=new Date(e);return(0,b.Z)(t,"P p")}}];return(0,c.jsxs)("div",{children:[(0,c.jsx)(g,{children:"Access Tokens"}),(0,c.jsx)(j,{children:"Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control."}),(0,c.jsxs)(j,{children:["Read more about how to use these tokens, with examples, at"," ",(0,c.jsx)("a",{href:"https://owncast.online/docs/integrations/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"our documentation"}),"."]}),(0,c.jsx)(y.Z,{rowKey:"token",columns:N,dataSource:n,pagination:!1}),(0,c.jsx)("br",{}),(0,c.jsx)(h.Z,{type:"primary",onClick:function(){p(!0)},children:"Create Access Token"}),(0,c.jsx)(k,{visible:f,onOk:function(e,t){p(!1),function(e,t){E.apply(this,arguments)}(e,t)},onCancel:function(){p(!1)}})]})}}},function(e){e.O(0,[8939,3903,3698,3626,8091,9774,2888,179],(function(){return t=26562,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/actions-a66e823c70116568.js b/static/web/_next/static/chunks/pages/admin/actions-e6982b17ca2b6d30.js similarity index 98% rename from static/web/_next/static/chunks/pages/admin/actions-a66e823c70116568.js rename to static/web/_next/static/chunks/pages/admin/actions-e6982b17ca2b6d30.js index d50c7082b..c1d7c49d4 100644 --- a/static/web/_next/static/chunks/pages/admin/actions-a66e823c70116568.js +++ b/static/web/_next/static/chunks/pages/admin/actions-e6982b17ca2b6d30.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5685],{48689:function(t,n,e){"use strict";e.d(n,{Z:function(){return c}});var r=e(1413),o=e(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},a=e(42135),u=function(t,n){return o.createElement(a.Z,(0,r.Z)((0,r.Z)({},t),{},{ref:n,icon:i}))};u.displayName="DeleteOutlined";var c=o.forwardRef(u)},27561:function(t,n,e){var r=e(67990),o=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(o,""):t}},67990:function(t){var n=/\s/;t.exports=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},23279:function(t,n,e){var r=e(13218),o=e(7771),i=e(14841),a=Math.max,u=Math.min;t.exports=function(t,n,e){var c,l,s,f,d,p,h=0,v=!1,x=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(n){var e=c,r=l;return c=l=void 0,h=n,f=t.apply(r,e)}function g(t){return h=t,d=setTimeout(j,n),v?m(t):f}function b(t){var e=t-p;return void 0===p||e>=n||e<0||x&&t-h>=s}function j(){var t=o();if(b(t))return Z(t);d=setTimeout(j,function(t){var e=n-(t-p);return x?u(e,s-(t-h)):e}(t))}function Z(t){return d=void 0,y&&c?m(t):(c=l=void 0,f)}function w(){var t=o(),e=b(t);if(c=arguments,l=this,p=t,e){if(void 0===d)return g(p);if(x)return clearTimeout(d),d=setTimeout(j,n),m(p)}return void 0===d&&(d=setTimeout(j,n)),f}return n=i(n)||0,r(e)&&(v=!!e.leading,s=(x="maxWait"in e)?a(i(e.maxWait)||0,n):s,y="trailing"in e?!!e.trailing:y),w.cancel=function(){void 0!==d&&clearTimeout(d),h=0,c=p=l=d=void 0},w.flush=function(){return void 0===d?f:Z(o())},w}},33448:function(t,n,e){var r=e(44239),o=e(37005);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},7771:function(t,n,e){var r=e(55639);t.exports=function(){return r.Date.now()}},14841:function(t,n,e){var r=e(27561),o=e(13218),i=e(33448),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=o(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var e=u.test(t);return e||c.test(t)?l(t.slice(2),e?2:8):a.test(t)?NaN:+t}},54005:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/actions",function(){return e(4437)}])},4437:function(t,n,e){"use strict";e.r(n);var r=e(47568),o=e(29815),i=e(70655),a=e(85893),u=e(48689),c=e(84485),l=e(85402),s=e(69677),f=e(32808),d=e(26713),p=e(71577),h=e(10355),v=e(67294),x=e(25521),y=e(25964),m=e(83192),g=e(35159),b=e(19411),j=c.Z.Title,Z=c.Z.Paragraph,w=null,k=function(t){var n=t.onOk,e=t.onCancel,r=t.visible,o=(0,v.useState)(""),i=o[0],u=o[1],c=(0,v.useState)(""),d=c[0],p=c[1],h=(0,v.useState)(""),x=h[0],y=h[1],m=(0,v.useState)(""),g=m[0],j=m[1],Z=(0,v.useState)(""),w=Z[0],k=Z[1],C=(0,v.useState)(!1),T=C[0],S=C[1],_={disabled:!function(){try{if("https:"!==new URL(i).protocol)return!1}catch(t){return!1}return(0,b.Z)(i)&&""!==d}()};return(0,a.jsx)(l.Z,{title:"Create New Action",visible:r,onOk:function(){n(i,d,x,g,w,T),u(""),p(""),y(""),j(""),k(""),S(!1)},onCancel:e,okButtonProps:_,children:(0,a.jsxs)("div",{children:["Add the URL for the external action you want to present."," ",(0,a.jsx)("strong",{children:"Only HTTPS urls are supported."}),(0,a.jsx)("p",{children:(0,a.jsx)("a",{href:"https://owncast.online/thirdparty/actions/",target:"_blank",rel:"noopener noreferrer",children:"Read more about external actions."})}),(0,a.jsx)("p",{children:(0,a.jsx)(s.Z,{value:i,required:!0,placeholder:"https://myserver.com/action (required)",onChange:function(t){return u(t.currentTarget.value.trim())},type:"url",pattern:b.a})}),(0,a.jsx)("p",{children:(0,a.jsx)(s.Z,{value:d,required:!0,placeholder:"Your action title (required)",onChange:function(t){return p(t.currentTarget.value)}})}),(0,a.jsx)("p",{children:(0,a.jsx)(s.Z,{value:x,placeholder:"Optional description",onChange:function(t){return y(t.currentTarget.value)}})}),(0,a.jsx)("p",{children:(0,a.jsx)(s.Z,{value:g,placeholder:"https://myserver.com/action/icon.png (optional)",onChange:function(t){return j(t.currentTarget.value)}})}),(0,a.jsxs)("p",{children:[(0,a.jsx)(s.Z,{type:"color",value:w,onChange:function(t){return k(t.currentTarget.value)}}),"Optional background color of the action button."]}),(0,a.jsx)(f.Z,{checked:T,defaultChecked:T,onChange:function(t){S(t.target.checked)},children:"Open in a new tab instead of within your page."})]})})};n.default=function(){var t=(0,v.useContext)(g.aC)||{},n=t.serverConfig,e=t.setFieldInConfigState,c=n.externalActions,l=(0,v.useState)([]),s=l[0],f=l[1],b=(0,v.useState)(!1),C=b[0],T=b[1],S=(0,v.useState)(null),_=S[0],I=S[1],E=function(){I(null),w=null,clearTimeout(w)};function O(t){return A.apply(this,arguments)}function A(){return(A=(0,r.Z)((function(t){return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,y.Si)({apiPath:y.os,data:{value:t},onSuccess:function(){e({fieldName:"externalActions",value:t,path:""}),I((0,m.kg)(m.zv,"Updated.")),w=setTimeout(E,y.sI)},onError:function(t){console.log(t),I((0,m.kg)(m.Un,t)),w=setTimeout(E,y.sI)}})];case 1:return n.sent(),[2]}}))}))).apply(this,arguments)}function N(){return(N=(0,r.Z)((function(t){var n,e;return(0,i.__generator)(this,(function(r){n=(0,o.Z)(s),e=s.findIndex((function(n){return n.url===t.url})),n.splice(e,1);try{f(n),O(n)}catch(i){console.error(i)}return[2]}))}))).apply(this,arguments)}function U(){return(U=(0,r.Z)((function(t,n,e,r,a,u){var c,l,d;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),c=(0,o.Z)(s),l=c.concat({url:t,title:n,description:e,icon:r,color:a,openExternally:u}),f(l),[4,O(l)];case 1:return i.sent(),[3,3];case 2:return d=i.sent(),console.error(d),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}(0,v.useEffect)((function(){f(c||[])}),[c]);var R=[{title:"",key:"delete",render:function(t,n){return(0,a.jsx)(d.Z,{size:"middle",children:(0,a.jsx)(p.Z,{onClick:function(){return function(t){return N.apply(this,arguments)}(n)},icon:(0,a.jsx)(u.Z,{})})})}},{title:"Name",dataIndex:"title",key:"title"},{title:"Description",dataIndex:"description",key:"description"},{title:"URL",dataIndex:"url",key:"url"},{title:"Icon",dataIndex:"icon",key:"icon",render:function(t){return t?(0,a.jsx)("img",{style:{width:"2vw"},src:t,alt:""}):null}},{title:"Color",dataIndex:"color",key:"color",render:function(t){return t?(0,a.jsx)("div",{style:{backgroundColor:t,height:"30px"},children:t}):null}},{title:"Opens",dataIndex:"openExternally",key:"openExternally",render:function(t){return t?"In a new tab":"In a modal"}}];return(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{children:"External Actions"}),(0,a.jsx)(Z,{children:"External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action."}),(0,a.jsxs)(Z,{children:["Read more about how to use actions, with examples, at"," ",(0,a.jsx)("a",{href:"https://owncast.online/thirdparty/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"our documentation"}),"."]}),(0,a.jsx)(h.Z,{rowKey:function(t){return"".concat(t.title,"-").concat(t.url)},columns:R,dataSource:s,pagination:!1}),(0,a.jsx)("br",{}),(0,a.jsx)(p.Z,{type:"primary",onClick:function(){T(!0)},children:"Create New Action"}),(0,a.jsx)(x.E,{status:_}),(0,a.jsx)(k,{visible:C,onOk:function(t,n,e,r,o,i){T(!1),function(t,n,e,r,o,i){U.apply(this,arguments)}(t,n,e,r,o,i)},onCancel:function(){T(!1)}})]})}},20943:function(t,n,e){"use strict";function r(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e=n||e<0||x&&t-h>=s}function j(){var t=o();if(b(t))return Z(t);d=setTimeout(j,function(t){var e=n-(t-p);return x?u(e,s-(t-h)):e}(t))}function Z(t){return d=void 0,y&&c?m(t):(c=l=void 0,f)}function w(){var t=o(),e=b(t);if(c=arguments,l=this,p=t,e){if(void 0===d)return g(p);if(x)return clearTimeout(d),d=setTimeout(j,n),m(p)}return void 0===d&&(d=setTimeout(j,n)),f}return n=i(n)||0,r(e)&&(v=!!e.leading,s=(x="maxWait"in e)?a(i(e.maxWait)||0,n):s,y="trailing"in e?!!e.trailing:y),w.cancel=function(){void 0!==d&&clearTimeout(d),h=0,c=p=l=d=void 0},w.flush=function(){return void 0===d?f:Z(o())},w}},33448:function(t,n,e){var r=e(44239),o=e(37005);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},7771:function(t,n,e){var r=e(55639);t.exports=function(){return r.Date.now()}},14841:function(t,n,e){var r=e(27561),o=e(13218),i=e(33448),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(o(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=o(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var e=u.test(t);return e||c.test(t)?l(t.slice(2),e?2:8):a.test(t)?NaN:+t}},54005:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/actions",function(){return e(4437)}])},4437:function(t,n,e){"use strict";e.r(n);var r=e(47568),o=e(29815),i=e(70655),a=e(85893),u=e(48689),c=e(84485),l=e(85402),s=e(69677),f=e(32808),d=e(26713),p=e(71577),h=e(93626),v=e(67294),x=e(25521),y=e(25964),m=e(83192),g=e(35159),b=e(19411),j=c.Z.Title,Z=c.Z.Paragraph,w=null,k=function(t){var n=t.onOk,e=t.onCancel,r=t.visible,o=(0,v.useState)(""),i=o[0],u=o[1],c=(0,v.useState)(""),d=c[0],p=c[1],h=(0,v.useState)(""),x=h[0],y=h[1],m=(0,v.useState)(""),g=m[0],j=m[1],Z=(0,v.useState)(""),w=Z[0],k=Z[1],C=(0,v.useState)(!1),T=C[0],S=C[1],_={disabled:!function(){try{if("https:"!==new URL(i).protocol)return!1}catch(t){return!1}return(0,b.Z)(i)&&""!==d}()};return(0,a.jsx)(l.Z,{title:"Create New Action",visible:r,onOk:function(){n(i,d,x,g,w,T),u(""),p(""),y(""),j(""),k(""),S(!1)},onCancel:e,okButtonProps:_,children:(0,a.jsxs)("div",{children:["Add the URL for the external action you want to present."," ",(0,a.jsx)("strong",{children:"Only HTTPS urls are supported."}),(0,a.jsx)("p",{children:(0,a.jsx)("a",{href:"https://owncast.online/thirdparty/actions/",target:"_blank",rel:"noopener noreferrer",children:"Read more about external actions."})}),(0,a.jsx)("p",{children:(0,a.jsx)(s.Z,{value:i,required:!0,placeholder:"https://myserver.com/action (required)",onChange:function(t){return u(t.currentTarget.value.trim())},type:"url",pattern:b.a})}),(0,a.jsx)("p",{children:(0,a.jsx)(s.Z,{value:d,required:!0,placeholder:"Your action title (required)",onChange:function(t){return p(t.currentTarget.value)}})}),(0,a.jsx)("p",{children:(0,a.jsx)(s.Z,{value:x,placeholder:"Optional description",onChange:function(t){return y(t.currentTarget.value)}})}),(0,a.jsx)("p",{children:(0,a.jsx)(s.Z,{value:g,placeholder:"https://myserver.com/action/icon.png (optional)",onChange:function(t){return j(t.currentTarget.value)}})}),(0,a.jsxs)("p",{children:[(0,a.jsx)(s.Z,{type:"color",value:w,onChange:function(t){return k(t.currentTarget.value)}}),"Optional background color of the action button."]}),(0,a.jsx)(f.Z,{checked:T,defaultChecked:T,onChange:function(t){S(t.target.checked)},children:"Open in a new tab instead of within your page."})]})})};n.default=function(){var t=(0,v.useContext)(g.aC)||{},n=t.serverConfig,e=t.setFieldInConfigState,c=n.externalActions,l=(0,v.useState)([]),s=l[0],f=l[1],b=(0,v.useState)(!1),C=b[0],T=b[1],S=(0,v.useState)(null),_=S[0],I=S[1],E=function(){I(null),w=null,clearTimeout(w)};function O(t){return A.apply(this,arguments)}function A(){return(A=(0,r.Z)((function(t){return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return[4,(0,y.Si)({apiPath:y.os,data:{value:t},onSuccess:function(){e({fieldName:"externalActions",value:t,path:""}),I((0,m.kg)(m.zv,"Updated.")),w=setTimeout(E,y.sI)},onError:function(t){console.log(t),I((0,m.kg)(m.Un,t)),w=setTimeout(E,y.sI)}})];case 1:return n.sent(),[2]}}))}))).apply(this,arguments)}function N(){return(N=(0,r.Z)((function(t){var n,e;return(0,i.__generator)(this,(function(r){n=(0,o.Z)(s),e=s.findIndex((function(n){return n.url===t.url})),n.splice(e,1);try{f(n),O(n)}catch(i){console.error(i)}return[2]}))}))).apply(this,arguments)}function U(){return(U=(0,r.Z)((function(t,n,e,r,a,u){var c,l,d;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),c=(0,o.Z)(s),l=c.concat({url:t,title:n,description:e,icon:r,color:a,openExternally:u}),f(l),[4,O(l)];case 1:return i.sent(),[3,3];case 2:return d=i.sent(),console.error(d),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}(0,v.useEffect)((function(){f(c||[])}),[c]);var R=[{title:"",key:"delete",render:function(t,n){return(0,a.jsx)(d.Z,{size:"middle",children:(0,a.jsx)(p.Z,{onClick:function(){return function(t){return N.apply(this,arguments)}(n)},icon:(0,a.jsx)(u.Z,{})})})}},{title:"Name",dataIndex:"title",key:"title"},{title:"Description",dataIndex:"description",key:"description"},{title:"URL",dataIndex:"url",key:"url"},{title:"Icon",dataIndex:"icon",key:"icon",render:function(t){return t?(0,a.jsx)("img",{style:{width:"2vw"},src:t,alt:""}):null}},{title:"Color",dataIndex:"color",key:"color",render:function(t){return t?(0,a.jsx)("div",{style:{backgroundColor:t,height:"30px"},children:t}):null}},{title:"Opens",dataIndex:"openExternally",key:"openExternally",render:function(t){return t?"In a new tab":"In a modal"}}];return(0,a.jsxs)("div",{children:[(0,a.jsx)(j,{children:"External Actions"}),(0,a.jsx)(Z,{children:"External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action."}),(0,a.jsxs)(Z,{children:["Read more about how to use actions, with examples, at"," ",(0,a.jsx)("a",{href:"https://owncast.online/thirdparty/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"our documentation"}),"."]}),(0,a.jsx)(h.Z,{rowKey:function(t){return"".concat(t.title,"-").concat(t.url)},columns:R,dataSource:s,pagination:!1}),(0,a.jsx)("br",{}),(0,a.jsx)(p.Z,{type:"primary",onClick:function(){T(!0)},children:"Create New Action"}),(0,a.jsx)(x.E,{status:_}),(0,a.jsx)(k,{visible:C,onOk:function(t,n,e,r,o,i){T(!1),function(t,n,e,r,o,i){U.apply(this,arguments)}(t,n,e,r,o,i)},onCancel:function(){T(!1)}})]})}},20943:function(t,n,e){"use strict";function r(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e0?(0,c.jsx)(m.Z,{style:{color:"var(--ant-success)"}}):(0,c.jsx)(f.Z,{style:{color:"var(--ant-warning)"}}));var _="Click to ".concat(t?"hide":"show"," this message");return(0,c.jsxs)("div",{className:"toggle-switch ".concat(t?"":"hidden"),children:[(0,c.jsx)("span",{className:"outcome-icon",children:j}),(0,c.jsx)(y.Z,{title:_,placement:"topRight",children:(0,c.jsx)(d.Z,{shape:"circle",size:"small",type:"text",icon:t?(0,c.jsx)(Z.Z,{}):(0,c.jsx)(b.Z,{}),onClick:N})})]})},j=n(11085),_=l.Z.Title;var T=3e3;function C(){var e=(0,o.useState)([]),t=e[0],n=e[1],l=(0,o.useState)([]),p=l[0],y=l[1],Z=(0,o.useState)(!1),b=Z[0],C=Z[1],S=(0,o.useState)(null),k=S[0],E=S[1],I=(0,o.useState)(""),M=I[0],O=I[1],P=null,z=null,A=function(){var e=(0,s.Z)((function(){var e,t;return(0,u.__generator)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,(0,x.rQ)(x.WE,{auth:!0})];case 1:return e=s.sent(),(0,w.Qr)(e)?n([]):n(e),[3,3];case 2:return t=s.sent(),console.log("==== error",t),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){return A(),z=setInterval((function(){A()}),x.NE),function(){clearTimeout(P),clearTimeout(z)}}),[]);var Q=function(e){return e.reduce((function(e,t){var n=t.user.id;return e.some((function(e){return e.text===n}))||e.push({text:n,value:n}),e}),[]).sort((function(e,t){var n=e.text.toUpperCase(),s=t.text.toUpperCase();return ns?1:0}))}(t),U={selectedRowKeys:p,onChange:function(e){y(e)}},D=function(e){var s=t.findIndex((function(t){return t.id===e.id}));t.splice(s,1,e),n((0,a.Z)(t))},H=function(){P=setTimeout((function(){E(null),O("")}),T)},V=function(){var e=(0,s.Z)((function(e){var s,o;return(0,u.__generator)(this,(function(u){switch(u.label){case 0:return C(!0),[4,(0,x.rQ)(x.hn,{auth:!0,method:"POST",data:{visible:e,idArray:p}})];case 1:return(s=u.sent()).success&&"changed"===s.message?(E((0,c.jsx)(m.Z,{})),H(),o=(0,a.Z)(t),p.map((function(n){var s=o.findIndex((function(e){return e.id===n})),a=(0,i.Z)((0,r.Z)({},t[s]),{visible:e});return o.splice(s,1,a),null})),n(o),y([])):(E((0,c.jsx)(f.Z,{})),H()),C(!1),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),F=[{title:"Time",dataIndex:"timestamp",key:"timestamp",className:"timestamp-col",defaultSortOrder:"descend",render:function(e){var t=new Date(e);return(0,v.Z)(t,"PP pp")},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},width:90},{title:"User",dataIndex:"user",key:"user",className:"name-col",filters:Q,onFilter:function(e,t){return t.user.id===e},sorter:function(e,t){return e.user.displayName.localeCompare(t.user.displayName)},sortDirections:["ascend","descend"],ellipsis:!0,render:function(e){var t=e.displayName;return(0,c.jsx)(j.Z,{user:e,children:t})},width:110},{title:"Message",dataIndex:"body",key:"body",className:"message-col",width:320,render:function(e){return(0,c.jsx)("div",{className:"message-contents",dangerouslySetInnerHTML:{__html:e}})}},{title:"",dataIndex:"hiddenAt",key:"hiddenAt",className:"toggle-col",filters:[{text:"Visible messages",value:!0},{text:"Hidden messages",value:!1}],onFilter:function(e,t){return t.visible===e},render:function(e,t){return(0,c.jsx)(N,{isVisible:!e,message:t,setMessage:D})},width:30}],K=g()({"bulk-editor":!0,active:p.length});return(0,c.jsxs)("div",{className:"chat-messages",children:[(0,c.jsx)(_,{children:"Chat Messages"}),(0,c.jsx)("p",{children:"Manage the messages from viewers that show up on your stream."}),(0,c.jsxs)("div",{className:K,children:[(0,c.jsx)("span",{className:"label",children:"Check multiple messages to change their visibility to: "}),(0,c.jsx)(d.Z,{type:"primary",size:"small",shape:"round",className:"button",loading:"show"===M&&b,icon:"show"===M&&k,disabled:!p.length||M&&"show"!==M,onClick:function(){O("show"),V(!0)},children:"Show"}),(0,c.jsx)(d.Z,{type:"primary",size:"small",shape:"round",className:"button",loading:"hide"===M&&b,icon:"hide"===M&&k,disabled:!p.length||M&&"hide"!==M,onClick:function(){O("hide"),V(!1)},children:"Hide"})]}),(0,c.jsx)(h.Z,{size:"small",className:"table-container",pagination:{defaultPageSize:100,showSizeChanger:!0},scroll:{y:540},rowClassName:function(e){return e.hiddenAt?"hidden":""},dataSource:t,columns:F,rowKey:function(e){return e.id},rowSelection:U})]})}}},function(e){e.O(0,[3662,8939,3903,3698,355,8091,5938,2460,9640,9774,2888,179],(function(){return t=62433,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7095],{62433:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/chat/messages",function(){return n(28599)}])},28599:function(e,t,n){"use strict";n.r(t),n.d(t,{OUTCOME_TIMEOUT:function(){return T},default:function(){return C}});var s=n(47568),r=n(26042),i=n(69396),a=n(29815),u=n(70655),c=n(85893),o=n(67294),l=n(84485),d=n(71577),h=n(93626),m=n(89739),f=n(21640),p=n(94184),g=n.n(p),v=n(58091),x=n(58827),w=n(2766),y=n(94199),Z=n(99611),b=n(90420),N=function(e){var t=e.isVisible,n=e.message,a=e.setMessage;if(!n||(0,w.Qr)(n))return null;var l=null,h=(0,o.useState)(0),p=h[0],g=h[1],v=(n||{}).id;(0,o.useEffect)((function(){return function(){clearTimeout(l)}}));var N=function(){var e=(0,s.Z)((function(){var e;return(0,u.__generator)(this,(function(s){switch(s.label){case 0:return clearTimeout(l),g(0),[4,(0,x.rQ)(x.hn,{auth:!0,method:"POST",data:{visible:!t,idArray:[v]}})];case 1:return(e=s.sent()).success&&"changed"===e.message?(a((0,i.Z)((0,r.Z)({},n),{visible:!t})),g(1)):(a((0,i.Z)((0,r.Z)({},n),{visible:t})),g(-1)),l=setTimeout((function(){g(0)}),T),[2]}}))}));return function(){return e.apply(this,arguments)}}(),j=(0,c.jsx)(m.Z,{style:{color:"transparent"}});p&&(j=p>0?(0,c.jsx)(m.Z,{style:{color:"var(--ant-success)"}}):(0,c.jsx)(f.Z,{style:{color:"var(--ant-warning)"}}));var _="Click to ".concat(t?"hide":"show"," this message");return(0,c.jsxs)("div",{className:"toggle-switch ".concat(t?"":"hidden"),children:[(0,c.jsx)("span",{className:"outcome-icon",children:j}),(0,c.jsx)(y.Z,{title:_,placement:"topRight",children:(0,c.jsx)(d.Z,{shape:"circle",size:"small",type:"text",icon:t?(0,c.jsx)(Z.Z,{}):(0,c.jsx)(b.Z,{}),onClick:N})})]})},j=n(11085),_=l.Z.Title;var T=3e3;function C(){var e=(0,o.useState)([]),t=e[0],n=e[1],l=(0,o.useState)([]),p=l[0],y=l[1],Z=(0,o.useState)(!1),b=Z[0],C=Z[1],S=(0,o.useState)(null),k=S[0],E=S[1],I=(0,o.useState)(""),M=I[0],O=I[1],P=null,z=null,A=function(){var e=(0,s.Z)((function(){var e,t;return(0,u.__generator)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,(0,x.rQ)(x.WE,{auth:!0})];case 1:return e=s.sent(),(0,w.Qr)(e)?n([]):n(e),[3,3];case 2:return t=s.sent(),console.log("==== error",t),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){return A(),z=setInterval((function(){A()}),x.NE),function(){clearTimeout(P),clearTimeout(z)}}),[]);var Q=function(e){return e.reduce((function(e,t){var n=t.user.id;return e.some((function(e){return e.text===n}))||e.push({text:n,value:n}),e}),[]).sort((function(e,t){var n=e.text.toUpperCase(),s=t.text.toUpperCase();return ns?1:0}))}(t),U={selectedRowKeys:p,onChange:function(e){y(e)}},D=function(e){var s=t.findIndex((function(t){return t.id===e.id}));t.splice(s,1,e),n((0,a.Z)(t))},H=function(){P=setTimeout((function(){E(null),O("")}),T)},V=function(){var e=(0,s.Z)((function(e){var s,o;return(0,u.__generator)(this,(function(u){switch(u.label){case 0:return C(!0),[4,(0,x.rQ)(x.hn,{auth:!0,method:"POST",data:{visible:e,idArray:p}})];case 1:return(s=u.sent()).success&&"changed"===s.message?(E((0,c.jsx)(m.Z,{})),H(),o=(0,a.Z)(t),p.map((function(n){var s=o.findIndex((function(e){return e.id===n})),a=(0,i.Z)((0,r.Z)({},t[s]),{visible:e});return o.splice(s,1,a),null})),n(o),y([])):(E((0,c.jsx)(f.Z,{})),H()),C(!1),[2]}}))}));return function(t){return e.apply(this,arguments)}}(),F=[{title:"Time",dataIndex:"timestamp",key:"timestamp",className:"timestamp-col",defaultSortOrder:"descend",render:function(e){var t=new Date(e);return(0,v.Z)(t,"PP pp")},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},width:90},{title:"User",dataIndex:"user",key:"user",className:"name-col",filters:Q,onFilter:function(e,t){return t.user.id===e},sorter:function(e,t){return e.user.displayName.localeCompare(t.user.displayName)},sortDirections:["ascend","descend"],ellipsis:!0,render:function(e){var t=e.displayName;return(0,c.jsx)(j.Z,{user:e,children:t})},width:110},{title:"Message",dataIndex:"body",key:"body",className:"message-col",width:320,render:function(e){return(0,c.jsx)("div",{className:"message-contents",dangerouslySetInnerHTML:{__html:e}})}},{title:"",dataIndex:"hiddenAt",key:"hiddenAt",className:"toggle-col",filters:[{text:"Visible messages",value:!0},{text:"Hidden messages",value:!1}],onFilter:function(e,t){return t.visible===e},render:function(e,t){return(0,c.jsx)(N,{isVisible:!e,message:t,setMessage:D})},width:30}],K=g()({"bulk-editor":!0,active:p.length});return(0,c.jsxs)("div",{className:"chat-messages",children:[(0,c.jsx)(_,{children:"Chat Messages"}),(0,c.jsx)("p",{children:"Manage the messages from viewers that show up on your stream."}),(0,c.jsxs)("div",{className:K,children:[(0,c.jsx)("span",{className:"label",children:"Check multiple messages to change their visibility to: "}),(0,c.jsx)(d.Z,{type:"primary",size:"small",shape:"round",className:"button",loading:"show"===M&&b,icon:"show"===M&&k,disabled:!p.length||M&&"show"!==M,onClick:function(){O("show"),V(!0)},children:"Show"}),(0,c.jsx)(d.Z,{type:"primary",size:"small",shape:"round",className:"button",loading:"hide"===M&&b,icon:"hide"===M&&k,disabled:!p.length||M&&"hide"!==M,onClick:function(){O("hide"),V(!1)},children:"Hide"})]}),(0,c.jsx)(h.Z,{size:"small",className:"table-container",pagination:{defaultPageSize:100,showSizeChanger:!0},scroll:{y:540},rowClassName:function(e){return e.hiddenAt?"hidden":""},dataSource:t,columns:F,rowKey:function(e){return e.id},rowSelection:U})]})}}},function(e){e.O(0,[3662,8939,3903,3698,3626,8091,5938,2460,9640,9774,2888,179],(function(){return t=62433,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/chat/users-30d91538da7a1ac3.js b/static/web/_next/static/chunks/pages/admin/chat/users-1d48f6dca8230410.js similarity index 96% rename from static/web/_next/static/chunks/pages/admin/chat/users-30d91538da7a1ac3.js rename to static/web/_next/static/chunks/pages/admin/chat/users-1d48f6dca8230410.js index 74f2c1aee..566bc08e8 100644 --- a/static/web/_next/static/chunks/pages/admin/chat/users-30d91538da7a1ac3.js +++ b/static/web/_next/static/chunks/pages/admin/chat/users-1d48f6dca8230410.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9522],{55583:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/chat/users",function(){return t(66540)}])},66540:function(e,n,t){"use strict";t.r(n),t.d(n,{FETCH_INTERVAL:function(){return k},default:function(){return C}});var r=t(47568),s=t(70655),a=t(85893),c=t(67294),o=t(2944),i=t(35159),u=t(58827),d=t(41542),l=t(69677),f=t(10355),h=t(68795),p=t(45938),m=t(11085),g=t(77891),x=t(2766),y=function(e){var n=e.data,t=[{title:"Display Name",key:"username",render:function(e){var n=e.user,t={connectedAt:e.connectedAt,messageCount:e.messageCount,userAgent:e.userAgent};return(0,a.jsx)(m.Z,{user:n,connectionInfo:t,children:(0,a.jsx)("span",{className:"display-name",children:n.displayName})})},sorter:function(e,n){return n.user.displayName.localeCompare(e.user.displayName)},filterIcon:(0,a.jsx)(h.Z,{}),filterDropdown:function(e){var n=e.setSelectedKeys,t=e.selectedKeys,r=e.confirm;return(0,a.jsx)("div",{style:{padding:8},children:(0,a.jsx)(l.Z,{placeholder:"Search display names...",value:t[0],onChange:function(e){n(e.target.value?[e.target.value]:[]),r({closeDropdown:!1})}})})},onFilter:function(e,n){return n.user.displayName.includes(e)},sortDirections:["descend","ascend"]},{title:"Messages sent",dataIndex:"messageCount",key:"messageCount",className:"number-col",width:"12%",sorter:function(e,n){return e.messageCount-n.messageCount},sortDirections:["descend","ascend"],render:function(e){return(0,a.jsx)("div",{style:{textAlign:"center"},children:e})}},{title:"Connected Time",dataIndex:"connectedAt",key:"connectedAt",defaultSortOrder:"ascend",render:function(e){return(0,p.Z)(new Date(e))},sorter:function(e,n){return new Date(n.connectedAt).getTime()-new Date(e.connectedAt).getTime()},sortDirections:["descend","ascend"]},{title:"User Agent",dataIndex:"userAgent",key:"userAgent",render:function(e){return(0,x.AB)(e)}},{title:"Location",dataIndex:"geo",key:"geo",render:function(e){return e?"".concat(e.regionName,", ").concat(e.countryCode):"-"}},{title:"",key:"block",className:"actions-col",render:function(e,n){return(0,a.jsx)(g.e,{user:n.user,isEnabled:!n.user.disabledAt})}}];return(0,a.jsx)(f.Z,{className:"table-container",pagination:{hideOnSinglePage:!0},columns:t,dataSource:n,size:"small",rowKey:"id"})},j=t(71577),v=t(58091),A=t(84674);function w(){return(w=(0,r.Z)((function(e){var n;return(0,s.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,u.rQ)(u.RB,{data:{value:e},method:"POST",auth:!0})];case 1:return t.sent(),[3,3];case 2:return n=t.sent(),console.error(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}var b=function(e){var n=e.data,t=[{title:"IP Address",dataIndex:"ipAddress",key:"ipAddress"},{title:"Reason",dataIndex:"notes",key:"notes"},{title:"Created",dataIndex:"createdAt",key:"createdAt",render:function(e){return function(e){return(0,v.Z)(new Date(e),"MMM d H:mma")}(e)},sorter:function(e,n){return new Date(e.createdAt).getTime()-new Date(n.createdAt).getTime()},sortDirections:["descend","ascend"]},{title:"",key:"block",className:"actions-col",render:function(e,n){return(0,a.jsx)(j.Z,{title:"Remove IP Address Ban",onClick:function(){return function(e){return w.apply(this,arguments)}(n.ipAddress)},icon:(0,a.jsx)(A.Z,{twoToneColor:"#ff4d4f"}),className:"block-user-button"})}}];return(0,a.jsx)(f.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:t,dataSource:n,size:"large",rowKey:"ipAddress"})},N=o.Z.TabPane,k=1e4;function C(){var e=((0,c.useContext)(i.aC)||{}).online,n=(0,c.useState)([]),t=n[0],l=n[1],f=(0,c.useState)([]),h=f[0],p=f[1],m=(0,c.useState)([]),g=m[0],x=m[1],j=(0,c.useState)([]),v=j[0],A=j[1],w=function(){var e=(0,r.Z)((function(){var e,n,t,r,a,c,o,i;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,(0,u.rQ)(u.qk)];case 1:return e=s.sent(),l(e),[3,3];case 2:return n=s.sent(),console.log("==== error",n),[3,3];case 3:return s.trys.push([3,5,,6]),[4,(0,u.rQ)(u.Kp)];case 4:return t=s.sent(),x(t),[3,6];case 5:return r=s.sent(),console.log("==== error",r),[3,6];case 6:return s.trys.push([6,8,,9]),[4,(0,u.rQ)(u.GC)];case 7:return a=s.sent(),A(a),[3,9];case 8:return c=s.sent(),console.error("error fetching moderators",c),[3,9];case 9:return s.trys.push([9,11,,12]),[4,(0,u.rQ)(u.Bu)];case 10:return o=s.sent(),p(o),[3,12];case 11:return i=s.sent(),console.error("error fetching banned ips",i),[3,12];case 12:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){var e;return w(),e=setInterval(w,k),function(){clearInterval(e)}}),[e]);var C=e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{data:g}),(0,a.jsxs)("p",{className:"description",children:["Visit the"," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/viewers/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"documentation"})," ","to configure additional details about your viewers."]})]}):(0,a.jsx)("p",{className:"description",children:"When a stream is active and chat is enabled, connected chat clients will be displayed here."});return(0,a.jsxs)(o.Z,{defaultActiveKey:"1",children:[(0,a.jsx)(N,{tab:(0,a.jsxs)("span",{children:["Connected ",e?"(".concat(g.length,")"):"(offline)"]}),children:C},"1"),(0,a.jsx)(N,{tab:(0,a.jsxs)("span",{children:["Banned Users (",t.length,")"]}),children:(0,a.jsx)(d.K,{data:t})},"2"),(0,a.jsx)(N,{tab:(0,a.jsxs)("span",{children:["IP Bans (",h.length,")"]}),children:(0,a.jsx)(b,{data:h})},"3"),(0,a.jsx)(N,{tab:(0,a.jsxs)("span",{children:["Moderators (",v.length,")"]}),children:(0,a.jsx)(d.K,{data:v})},"4")]})}}},function(e){e.O(0,[3662,8939,3903,3698,355,8091,2944,5938,2460,9640,9774,2888,179],(function(){return n=55583,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9522],{55583:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/chat/users",function(){return t(66540)}])},66540:function(e,n,t){"use strict";t.r(n),t.d(n,{FETCH_INTERVAL:function(){return k},default:function(){return C}});var r=t(47568),s=t(70655),a=t(85893),c=t(67294),o=t(2944),i=t(35159),u=t(58827),d=t(41542),l=t(69677),f=t(93626),h=t(68795),p=t(45938),m=t(11085),g=t(77891),x=t(2766),y=function(e){var n=e.data,t=[{title:"Display Name",key:"username",render:function(e){var n=e.user,t={connectedAt:e.connectedAt,messageCount:e.messageCount,userAgent:e.userAgent};return(0,a.jsx)(m.Z,{user:n,connectionInfo:t,children:(0,a.jsx)("span",{className:"display-name",children:n.displayName})})},sorter:function(e,n){return n.user.displayName.localeCompare(e.user.displayName)},filterIcon:(0,a.jsx)(h.Z,{}),filterDropdown:function(e){var n=e.setSelectedKeys,t=e.selectedKeys,r=e.confirm;return(0,a.jsx)("div",{style:{padding:8},children:(0,a.jsx)(l.Z,{placeholder:"Search display names...",value:t[0],onChange:function(e){n(e.target.value?[e.target.value]:[]),r({closeDropdown:!1})}})})},onFilter:function(e,n){return n.user.displayName.includes(e)},sortDirections:["descend","ascend"]},{title:"Messages sent",dataIndex:"messageCount",key:"messageCount",className:"number-col",width:"12%",sorter:function(e,n){return e.messageCount-n.messageCount},sortDirections:["descend","ascend"],render:function(e){return(0,a.jsx)("div",{style:{textAlign:"center"},children:e})}},{title:"Connected Time",dataIndex:"connectedAt",key:"connectedAt",defaultSortOrder:"ascend",render:function(e){return(0,p.Z)(new Date(e))},sorter:function(e,n){return new Date(n.connectedAt).getTime()-new Date(e.connectedAt).getTime()},sortDirections:["descend","ascend"]},{title:"User Agent",dataIndex:"userAgent",key:"userAgent",render:function(e){return(0,x.AB)(e)}},{title:"Location",dataIndex:"geo",key:"geo",render:function(e){return e?"".concat(e.regionName,", ").concat(e.countryCode):"-"}},{title:"",key:"block",className:"actions-col",render:function(e,n){return(0,a.jsx)(g.e,{user:n.user,isEnabled:!n.user.disabledAt})}}];return(0,a.jsx)(f.Z,{className:"table-container",pagination:{hideOnSinglePage:!0},columns:t,dataSource:n,size:"small",rowKey:"id"})},j=t(71577),v=t(58091),A=t(84674);function w(){return(w=(0,r.Z)((function(e){var n;return(0,s.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,u.rQ)(u.RB,{data:{value:e},method:"POST",auth:!0})];case 1:return t.sent(),[3,3];case 2:return n=t.sent(),console.error(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}var b=function(e){var n=e.data,t=[{title:"IP Address",dataIndex:"ipAddress",key:"ipAddress"},{title:"Reason",dataIndex:"notes",key:"notes"},{title:"Created",dataIndex:"createdAt",key:"createdAt",render:function(e){return function(e){return(0,v.Z)(new Date(e),"MMM d H:mma")}(e)},sorter:function(e,n){return new Date(e.createdAt).getTime()-new Date(n.createdAt).getTime()},sortDirections:["descend","ascend"]},{title:"",key:"block",className:"actions-col",render:function(e,n){return(0,a.jsx)(j.Z,{title:"Remove IP Address Ban",onClick:function(){return function(e){return w.apply(this,arguments)}(n.ipAddress)},icon:(0,a.jsx)(A.Z,{twoToneColor:"#ff4d4f"}),className:"block-user-button"})}}];return(0,a.jsx)(f.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:t,dataSource:n,size:"large",rowKey:"ipAddress"})},N=o.Z.TabPane,k=1e4;function C(){var e=((0,c.useContext)(i.aC)||{}).online,n=(0,c.useState)([]),t=n[0],l=n[1],f=(0,c.useState)([]),h=f[0],p=f[1],m=(0,c.useState)([]),g=m[0],x=m[1],j=(0,c.useState)([]),v=j[0],A=j[1],w=function(){var e=(0,r.Z)((function(){var e,n,t,r,a,c,o,i;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,(0,u.rQ)(u.qk)];case 1:return e=s.sent(),l(e),[3,3];case 2:return n=s.sent(),console.log("==== error",n),[3,3];case 3:return s.trys.push([3,5,,6]),[4,(0,u.rQ)(u.Kp)];case 4:return t=s.sent(),x(t),[3,6];case 5:return r=s.sent(),console.log("==== error",r),[3,6];case 6:return s.trys.push([6,8,,9]),[4,(0,u.rQ)(u.GC)];case 7:return a=s.sent(),A(a),[3,9];case 8:return c=s.sent(),console.error("error fetching moderators",c),[3,9];case 9:return s.trys.push([9,11,,12]),[4,(0,u.rQ)(u.Bu)];case 10:return o=s.sent(),p(o),[3,12];case 11:return i=s.sent(),console.error("error fetching banned ips",i),[3,12];case 12:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){var e;return w(),e=setInterval(w,k),function(){clearInterval(e)}}),[e]);var C=e?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{data:g}),(0,a.jsxs)("p",{className:"description",children:["Visit the"," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/viewers/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"documentation"})," ","to configure additional details about your viewers."]})]}):(0,a.jsx)("p",{className:"description",children:"When a stream is active and chat is enabled, connected chat clients will be displayed here."});return(0,a.jsxs)(o.Z,{defaultActiveKey:"1",children:[(0,a.jsx)(N,{tab:(0,a.jsxs)("span",{children:["Connected ",e?"(".concat(g.length,")"):"(offline)"]}),children:C},"1"),(0,a.jsx)(N,{tab:(0,a.jsxs)("span",{children:["Banned Users (",t.length,")"]}),children:(0,a.jsx)(d.K,{data:t})},"2"),(0,a.jsx)(N,{tab:(0,a.jsxs)("span",{children:["IP Bans (",h.length,")"]}),children:(0,a.jsx)(b,{data:h})},"3"),(0,a.jsx)(N,{tab:(0,a.jsxs)("span",{children:["Moderators (",v.length,")"]}),children:(0,a.jsx)(d.K,{data:v})},"4")]})}}},function(e){e.O(0,[3662,8939,3903,3698,3626,8091,2944,5938,2460,9640,9774,2888,179],(function(){return n=55583,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/config-public-details-0c8d1d299601525b.js b/static/web/_next/static/chunks/pages/admin/config-public-details-61013ad2a35fbe56.js similarity index 99% rename from static/web/_next/static/chunks/pages/admin/config-public-details-0c8d1d299601525b.js rename to static/web/_next/static/chunks/pages/admin/config-public-details-61013ad2a35fbe56.js index 89ba183d6..fcb478ec9 100644 --- a/static/web/_next/static/chunks/pages/admin/config-public-details-0c8d1d299601525b.js +++ b/static/web/_next/static/chunks/pages/admin/config-public-details-61013ad2a35fbe56.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4311],{86045:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/config-public-details",function(){return t(42992)}])},80939:function(e,n,t){"use strict";t.d(n,{Q:function(){return u},Y:function(){return d}});var a=t(85893),s=t(67294),i=t(84485),r=t(20550),l=t(24389),o=t(25521),c=i.Z.Title,u="#5a67d8",d=function(e){var n=e.title,t=e.description,i=e.placeholder,d=e.maxLength,f=e.values,h=e.handleDeleteIndex,m=e.handleCreateString,p=e.submitStatus,g=e.continuousStatusMessage,v=(0,s.useState)(""),x=v[0],j=v[1];return(0,a.jsxs)("div",{className:"edit-string-array-container",children:[(0,a.jsx)(c,{level:3,className:"section-title",children:n}),(0,a.jsx)("p",{className:"description",children:t}),(0,a.jsx)("div",{className:"edit-current-strings",children:null===f||void 0===f?void 0:f.map((function(e,n){return(0,a.jsx)(r.Z,{closable:!0,onClose:function(){h(n)},color:u,children:e},"tag-".concat(e,"-").concat(n))}))}),g&&(0,a.jsx)("div",{className:"continuous-status-section",children:(0,a.jsx)(o.E,{status:g})}),(0,a.jsx)("div",{className:"add-new-string-section",children:(0,a.jsx)(l.nv,{fieldName:"string-input",value:x,onChange:function(e){var n=e.value;j(n)},onPressEnter:function(){var e=x.trim();m(e),j("")},maxLength:d,placeholder:i,status:p})})]})};d.defaultProps={maxLength:50,description:null,submitStatus:null,continuousStatusMessage:null}},3664:function(e,n,t){"use strict";t.d(n,{Z:function(){return f}});var a=t(47568),s=t(70655),i=t(85893),r=t(67294),l=t(94594),o=t(83192),c=t(25521),u=t(25964),d=t(35159),f=function(e){var n=e.apiPath,t=e.checked,f=e.reversed,h=void 0!==f&&f,m=e.configPath,p=void 0===m?"":m,g=e.disabled,v=void 0!==g&&g,x=e.fieldName,j=e.label,N=e.tip,C=e.useSubmit,S=e.onChange,y=(0,r.useState)(null),b=y[0],w=y[1],k=null,Z=((0,r.useContext)(d.aC)||{}).setFieldInConfigState,T=function(){w(null),clearTimeout(k),k=null},_=function(){var e=(0,a.Z)((function(e){var t;return(0,s.__generator)(this,(function(a){switch(a.label){case 0:return C?(w((0,o.kg)(o.Jk)),t=h?!e:e,[4,(0,u.Si)({apiPath:n,data:{value:t},onSuccess:function(){Z({fieldName:x,value:t,path:p}),w((0,o.kg)(o.zv))},onError:function(e){w((0,o.kg)(o.Un,"There was an error: ".concat(e)))}})]):[3,2];case 1:a.sent(),k=setTimeout(T,u.sI),a.label=2;case 2:return S&&S(e),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),P=null!==b&&b.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)(l.Z,{className:"switch field-".concat(x),loading:P,onChange:_,defaultChecked:t,checked:t,checkedChildren:"ON",unCheckedChildren:"OFF",disabled:v}),(0,i.jsx)(c.E,{status:b})]}),(0,i.jsx)("p",{className:"field-tip",children:N})]})]})};f.defaultProps={apiPath:"",checked:!1,reversed:!1,configPath:"",disabled:!1,label:"",tip:"",useSubmit:!1,onChange:null}},42992:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return $}});var a=t(85893),s=t(67294),i=t(84485),r=t(14924),l=t(26042),o=t(69396),c=t(45200),u=t(35159),d=t(25964),f=t(3664),h=t(47568),m=t(70655),p=t(77916),g=t(71577),v=t(50888),x=t(88484),j=t(25521),N=t(83192),C=t(58827),S=["image/png","image/jpeg","image/gif"];var y=function(){var e,n=(0,s.useState)(null),t=n[0],i=n[1],r=(0,s.useState)(!1),l=r[0],o=r[1],c=(0,s.useState)(0),f=c[0],y=c[1],b=(0,s.useContext)(u.aC)||{},w=b.setFieldInConfigState,k=b.serverConfig,Z=null===k||void 0===k||null===(e=k.instanceDetails)||void 0===e?void 0:e.logo,T=(0,s.useState)(null),_=T[0],P=T[1],E=null,L=d.ZQ.apiPath,U=d.ZQ.tip,I=function(){P(null),clearTimeout(E),E=null},D=function(){var e=(0,h.Z)((function(){return(0,m.__generator)(this,(function(e){switch(e.label){case 0:return t===Z?[3,2]:(P((0,N.kg)(N.Jk)),[4,(0,d.Si)({apiPath:L,data:{value:t},onSuccess:function(){w({fieldName:"logo",value:t,path:""}),P((0,N.kg)(N.zv)),o(!1),y(Math.floor(100*Math.random()))},onError:function(e){P((0,N.kg)(N.Un,"There was an error: ".concat(e))),o(!1)}})]);case 1:e.sent(),E=setTimeout(I,d.sI),e.label=2;case 2:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),F="".concat(C.WB,"logo?random=").concat(f);return(0,a.jsxs)("div",{className:"formfield-container logo-upload-container",children:[(0,a.jsx)("div",{className:"label-side",children:(0,a.jsx)("span",{className:"formfield-label",children:"Logo"})}),(0,a.jsxs)("div",{className:"input-side",children:[(0,a.jsxs)("div",{className:"input-group",children:[(0,a.jsx)("img",{src:F,alt:"avatar",className:"logo-preview"}),(0,a.jsx)(p.Z,{name:"logo",listType:"picture",className:"avatar-uploader",showUploadList:!1,accept:S.join(","),beforeUpload:function(e){return o(!0),new Promise((function(n,t){if(!S.includes(e.type)){var a="File type is not supported: ".concat(e.type);return P((0,N.kg)(N.Un,"There was an error: ".concat(a))),E=setTimeout(I,d.sI),o(!1),t()}!function(e,n){var t=new FileReader;t.addEventListener("load",(function(){return n(t.result)})),t.readAsDataURL(e)}(e,(function(e){return i(e),n()}))}))},customRequest:D,disabled:l,children:l?(0,a.jsx)(v.Z,{style:{color:"white"}}):(0,a.jsx)(g.Z,{icon:(0,a.jsx)(x.Z,{})})})]}),(0,a.jsx)(j.E,{status:_}),(0,a.jsx)("p",{className:"field-tip",children:U})]})]})},b=i.Z.Title,w=function(){var e=(0,s.useState)(null),n=e[0],t=e[1],i=((0,s.useContext)(u.aC)||{}).serverConfig,h=i.instanceDetails,m=i.yp,p=m.instanceUrl;if((0,s.useEffect)((function(){t((0,l.Z)({},h,m))}),[h,m]),!n)return null;var g=function(e){var a=e.fieldName,s=e.value;t((0,o.Z)((0,l.Z)({},n),(0,r.Z)({},a,s)))},v=""!==p;return(0,a.jsxs)("div",{className:"edit-general-settings",children:[(0,a.jsx)(b,{level:3,className:"section-title",children:"Configure Instance Details"}),(0,a.jsx)("br",{}),(0,a.jsx)(c.$7,(0,o.Z)((0,l.Z)({fieldName:"name"},d.RE),{value:n.name,initialValue:h.name,onChange:g})),(0,a.jsx)(c.$7,(0,o.Z)((0,l.Z)({fieldName:"instanceUrl"},d.cj),{value:n.instanceUrl,initialValue:m.instanceUrl,type:c.xA,onChange:g,onSubmit:function(){""===n.instanceUrl&&!0===m.enabled&&(0,d.Si)({apiPath:d.AP,data:{value:!1}})}})),(0,a.jsx)(c.$7,(0,o.Z)((0,l.Z)({fieldName:"summary"},d.rs),{type:c.Sk,value:n.summary,initialValue:h.summary,onChange:g})),(0,a.jsx)(c.$7,(0,o.Z)((0,l.Z)({fieldName:"offlineMessage"},d.rd),{type:c.Sk,value:n.offlineMessage,initialValue:h.offlineMessage,onChange:g})),(0,a.jsx)(y,{}),(0,a.jsx)(f.Z,(0,o.Z)((0,l.Z)({fieldName:"hideViewerCount",useSubmit:!0},d._X),{checked:n.hideViewerCount,onChange:function(e){g({fieldName:"hideViewerCount",value:e})}})),(0,a.jsx)("br",{}),(0,a.jsxs)("p",{className:"description",children:["Increase your audience by appearing in the"," ",(0,a.jsx)("a",{href:"https://directory.owncast.online",target:"_blank",rel:"noreferrer",children:(0,a.jsx)("strong",{children:"Owncast Directory"})}),". This is an external service run by the Owncast project."," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/directory/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn more"}),"."]}),!m.instanceUrl&&(0,a.jsxs)("p",{className:"description",children:["You must set your ",(0,a.jsx)("strong",{children:"Server URL"})," above to enable the directory."]}),(0,a.jsxs)("div",{className:"config-yp-container",children:[(0,a.jsx)(f.Z,(0,o.Z)((0,l.Z)({fieldName:"enabled",useSubmit:!0},d.P),{checked:n.enabled,disabled:!v})),(0,a.jsx)(f.Z,(0,o.Z)((0,l.Z)({fieldName:"nsfw",useSubmit:!0},d.EY),{checked:n.nsfw,disabled:!v}))]})]})},k=t(29815),Z=t(20550),T=t(24389),_=t(80939),P=i.Z.Title,E=function(){var e=(0,s.useState)(""),n=e[0],t=e[1],i=(0,s.useState)(null),r=i[0],l=i[1],o=(0,s.useContext)(u.aC)||{},c=o.serverConfig,f=o.setFieldInConfigState,p=c.instanceDetails.tags,g=void 0===p?[]:p,v=d.y_.apiPath,x=d.y_.maxLength,j=d.y_.placeholder,C=d.y_.configPath,S=null;(0,s.useEffect)((function(){return function(){clearTimeout(S)}}),[]);var y=function(){l(null),S=null,clearTimeout(S)},b=function(){var e=(0,h.Z)((function(e){return(0,m.__generator)(this,(function(n){switch(n.label){case 0:return l((0,N.kg)(N.Jk)),[4,(0,d.Si)({apiPath:v,data:{value:e},onSuccess:function(){f({fieldName:"tags",value:e,path:C}),l((0,N.kg)(N.zv,"Tags updated.")),t(""),S=setTimeout(y,d.sI)},onError:function(e){l((0,N.kg)(N.Un,e)),S=setTimeout(y,d.sI)}})];case 1:return n.sent(),[2]}}))}));return function(n){return e.apply(this,arguments)}}();return(0,a.jsxs)("div",{className:"tag-editor-container",children:[(0,a.jsx)(P,{level:3,className:"section-title",children:"Add Tags"}),(0,a.jsx)("p",{className:"description",children:"This is a great way to categorize your Owncast server on the Directory!"}),(0,a.jsx)("div",{className:"edit-current-strings",children:g.map((function(e,n){return(0,a.jsx)(Z.Z,{closable:!0,onClose:function(){!function(e){y();var n=(0,k.Z)(g);n.splice(e,1),b(n)}(n)},color:_.Q,children:e},"tag-".concat(e,"-").concat(n))}))}),(0,a.jsx)("div",{className:"add-new-string-section",children:(0,a.jsx)(T.nv,{fieldName:"tag-input",value:n,className:"new-tag-input",onChange:function(e){var n=e.value;r||l(null),t(n)},onPressEnter:function(){y();var e=n.trim();if(""!==e)if(g.some((function(n){return n.toLowerCase()===e.toLowerCase()})))l((0,N.kg)(N.dG,"This tag is already used!"));else{var t=(0,k.Z)(g).concat([e]);b(t)}else l((0,N.kg)(N.dG,"Please enter a tag"))},maxLength:x,placeholder:j,status:r})})]})},L=t(72877),U=t(5152),I=t.n(U),D=t(9980),F=t.n(D),M=(t(69596),new(F())),z=I()((function(){return t.e(7610).then(t.bind(t,77610))}),{loadableGenerated:{webpack:function(){return[77610]}},ssr:!1}),O=i.Z.Title,V=function(){var e=(0,s.useState)(""),n=e[0],t=e[1],i=(0,s.useState)(null),r=i[0],l=i[1],o=(0,s.useState)(!1),c=o[0],f=o[1],p=(0,s.useContext)(u.aC)||{},v=p.serverConfig,x=p.setFieldInConfigState,C=v.instanceDetails,S=C.extraPageContent,y=null,b=function(){l(null),f(!1),clearTimeout(y),y=null};function w(){return(w=(0,h.Z)((function(){return(0,m.__generator)(this,(function(e){switch(e.label){case 0:return l((0,N.kg)(N.Jk)),[4,(0,d.Si)({apiPath:d.AA,data:{value:n},onSuccess:function(e){x({fieldName:"extraPageContent",value:n,path:"instanceDetails"}),l((0,N.kg)(N.zv,e))},onError:function(e){l((0,N.kg)(N.Un,e))}})];case 1:return e.sent(),y=setTimeout(b,d.sI),[2]}}))}))).apply(this,arguments)}return(0,s.useEffect)((function(){t(S)}),[C]),(0,a.jsxs)("div",{className:"edit-page-content",children:[(0,a.jsx)(O,{level:3,className:"section-title",children:"Custom Page Content"}),(0,a.jsxs)("p",{className:"description",children:["Edit the content of your page by using simple"," ",(0,a.jsx)("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noopener noreferrer",children:"Markdown syntax"}),"."]}),(0,a.jsx)(z,{style:{height:"30em"},value:n,renderHTML:function(e){return M.render(e)},onChange:function(e){var n=e.text;t(n),n===S||c?n===S&&c&&f(!1):f(!0)},config:{htmlClass:"markdown-editor-preview-pane",markdownClass:"markdown-editor-pane"}}),(0,a.jsx)("br",{}),(0,a.jsxs)("div",{className:"page-content-actions",children:[c&&(0,a.jsx)(g.Z,{type:"primary",onClick:function(){return w.apply(this,arguments)},children:"Save"}),(0,a.jsx)(j.E,{status:r})]})]})},A=i.Z.Title,J=function(){var e=(0,s.useState)(""),n=e[0],t=e[1],i=(0,s.useState)(null),r=i[0],l=i[1],o=(0,s.useState)(!1),c=o[0],f=o[1],p=(0,s.useContext)(u.aC)||{},v=p.serverConfig,x=p.setFieldInConfigState,C=v.instanceDetails,S=C.customStyles,y=null,b=function(){l(null),f(!1),clearTimeout(y),y=null};function w(){return(w=(0,h.Z)((function(){return(0,m.__generator)(this,(function(e){switch(e.label){case 0:return l((0,N.kg)(N.Jk)),[4,(0,d.Si)({apiPath:d.d$,data:{value:n},onSuccess:function(e){x({fieldName:"customStyles",value:n,path:"instanceDetails"}),l((0,N.kg)(N.zv,e))},onError:function(e){l((0,N.kg)(N.Un,e))}})];case 1:return e.sent(),y=setTimeout(b,d.sI),[2]}}))}))).apply(this,arguments)}return(0,s.useEffect)((function(){t(S)}),[C]),(0,a.jsxs)("div",{className:"edit-custom-css",children:[(0,a.jsx)(A,{level:3,className:"section-title",children:"Customize your page styling with CSS"}),(0,a.jsxs)("p",{className:"description",children:["Customize the look and feel of your Owncast instance by overriding the CSS styles of various components on the page. Refer to the"," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/website/",rel:"noopener noreferrer",target:"_blank",children:"CSS & Components guide"}),"."]}),(0,a.jsx)("p",{className:"description",children:"Please input plain CSS text, as this will be directly injected onto your page during load."}),(0,a.jsx)(T.nv,{fieldName:"customStyles",type:T.Sk,value:n,maxLength:null,onChange:function(e){var n=e.value;t(n),n===S||c?n===S&&c&&f(!1):f(!0)},placeholder:"/* Enter custom CSS here */"}),(0,a.jsx)("br",{}),(0,a.jsxs)("div",{className:"page-content-actions",children:[c&&(0,a.jsx)(g.Z,{type:"primary",onClick:function(){return w.apply(this,arguments)},children:"Save"}),(0,a.jsx)(j.E,{status:r})]})]})},R=i.Z.Title;function $(){return(0,a.jsxs)("div",{className:"config-public-details-page",children:[(0,a.jsx)(R,{children:"General Settings"}),(0,a.jsxs)("p",{className:"description",children:["The following are displayed on your site to describe your stream and its content."," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/website/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn more."})]}),(0,a.jsxs)("div",{className:"top-container",children:[(0,a.jsx)("div",{className:"form-module instance-details-container",children:(0,a.jsx)(w,{})}),(0,a.jsxs)("div",{className:"form-module social-items-container ",children:[(0,a.jsx)("div",{className:"form-module tags-module",children:(0,a.jsx)(E,{})}),(0,a.jsx)("div",{className:"form-module social-handles-container",children:(0,a.jsx)(L.h,{})})]})]}),(0,a.jsx)("div",{className:"form-module page-content-module",children:(0,a.jsx)(V,{})}),(0,a.jsx)("div",{className:"form-module page-content-module",children:(0,a.jsx)(J,{})})]})}}},function(e){e.O(0,[8939,3903,3698,355,9654,7910,9839,2877,9774,2888,179],(function(){return n=86045,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4311],{86045:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/config-public-details",function(){return t(42992)}])},80939:function(e,n,t){"use strict";t.d(n,{Q:function(){return u},Y:function(){return d}});var a=t(85893),s=t(67294),i=t(84485),r=t(20550),l=t(24389),o=t(25521),c=i.Z.Title,u="#5a67d8",d=function(e){var n=e.title,t=e.description,i=e.placeholder,d=e.maxLength,f=e.values,h=e.handleDeleteIndex,m=e.handleCreateString,p=e.submitStatus,g=e.continuousStatusMessage,v=(0,s.useState)(""),x=v[0],j=v[1];return(0,a.jsxs)("div",{className:"edit-string-array-container",children:[(0,a.jsx)(c,{level:3,className:"section-title",children:n}),(0,a.jsx)("p",{className:"description",children:t}),(0,a.jsx)("div",{className:"edit-current-strings",children:null===f||void 0===f?void 0:f.map((function(e,n){return(0,a.jsx)(r.Z,{closable:!0,onClose:function(){h(n)},color:u,children:e},"tag-".concat(e,"-").concat(n))}))}),g&&(0,a.jsx)("div",{className:"continuous-status-section",children:(0,a.jsx)(o.E,{status:g})}),(0,a.jsx)("div",{className:"add-new-string-section",children:(0,a.jsx)(l.nv,{fieldName:"string-input",value:x,onChange:function(e){var n=e.value;j(n)},onPressEnter:function(){var e=x.trim();m(e),j("")},maxLength:d,placeholder:i,status:p})})]})};d.defaultProps={maxLength:50,description:null,submitStatus:null,continuousStatusMessage:null}},3664:function(e,n,t){"use strict";t.d(n,{Z:function(){return f}});var a=t(47568),s=t(70655),i=t(85893),r=t(67294),l=t(94594),o=t(83192),c=t(25521),u=t(25964),d=t(35159),f=function(e){var n=e.apiPath,t=e.checked,f=e.reversed,h=void 0!==f&&f,m=e.configPath,p=void 0===m?"":m,g=e.disabled,v=void 0!==g&&g,x=e.fieldName,j=e.label,N=e.tip,C=e.useSubmit,S=e.onChange,y=(0,r.useState)(null),b=y[0],w=y[1],k=null,Z=((0,r.useContext)(d.aC)||{}).setFieldInConfigState,T=function(){w(null),clearTimeout(k),k=null},_=function(){var e=(0,a.Z)((function(e){var t;return(0,s.__generator)(this,(function(a){switch(a.label){case 0:return C?(w((0,o.kg)(o.Jk)),t=h?!e:e,[4,(0,u.Si)({apiPath:n,data:{value:t},onSuccess:function(){Z({fieldName:x,value:t,path:p}),w((0,o.kg)(o.zv))},onError:function(e){w((0,o.kg)(o.Un,"There was an error: ".concat(e)))}})]):[3,2];case 1:a.sent(),k=setTimeout(T,u.sI),a.label=2;case 2:return S&&S(e),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),P=null!==b&&b.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)(l.Z,{className:"switch field-".concat(x),loading:P,onChange:_,defaultChecked:t,checked:t,checkedChildren:"ON",unCheckedChildren:"OFF",disabled:v}),(0,i.jsx)(c.E,{status:b})]}),(0,i.jsx)("p",{className:"field-tip",children:N})]})]})};f.defaultProps={apiPath:"",checked:!1,reversed:!1,configPath:"",disabled:!1,label:"",tip:"",useSubmit:!1,onChange:null}},42992:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return $}});var a=t(85893),s=t(67294),i=t(84485),r=t(14924),l=t(26042),o=t(69396),c=t(45200),u=t(35159),d=t(25964),f=t(3664),h=t(47568),m=t(70655),p=t(77916),g=t(71577),v=t(50888),x=t(88484),j=t(25521),N=t(83192),C=t(58827),S=["image/png","image/jpeg","image/gif"];var y=function(){var e,n=(0,s.useState)(null),t=n[0],i=n[1],r=(0,s.useState)(!1),l=r[0],o=r[1],c=(0,s.useState)(0),f=c[0],y=c[1],b=(0,s.useContext)(u.aC)||{},w=b.setFieldInConfigState,k=b.serverConfig,Z=null===k||void 0===k||null===(e=k.instanceDetails)||void 0===e?void 0:e.logo,T=(0,s.useState)(null),_=T[0],P=T[1],E=null,L=d.ZQ.apiPath,U=d.ZQ.tip,I=function(){P(null),clearTimeout(E),E=null},D=function(){var e=(0,h.Z)((function(){return(0,m.__generator)(this,(function(e){switch(e.label){case 0:return t===Z?[3,2]:(P((0,N.kg)(N.Jk)),[4,(0,d.Si)({apiPath:L,data:{value:t},onSuccess:function(){w({fieldName:"logo",value:t,path:""}),P((0,N.kg)(N.zv)),o(!1),y(Math.floor(100*Math.random()))},onError:function(e){P((0,N.kg)(N.Un,"There was an error: ".concat(e))),o(!1)}})]);case 1:e.sent(),E=setTimeout(I,d.sI),e.label=2;case 2:return[2]}}))}));return function(){return e.apply(this,arguments)}}(),F="".concat(C.WB,"logo?random=").concat(f);return(0,a.jsxs)("div",{className:"formfield-container logo-upload-container",children:[(0,a.jsx)("div",{className:"label-side",children:(0,a.jsx)("span",{className:"formfield-label",children:"Logo"})}),(0,a.jsxs)("div",{className:"input-side",children:[(0,a.jsxs)("div",{className:"input-group",children:[(0,a.jsx)("img",{src:F,alt:"avatar",className:"logo-preview"}),(0,a.jsx)(p.Z,{name:"logo",listType:"picture",className:"avatar-uploader",showUploadList:!1,accept:S.join(","),beforeUpload:function(e){return o(!0),new Promise((function(n,t){if(!S.includes(e.type)){var a="File type is not supported: ".concat(e.type);return P((0,N.kg)(N.Un,"There was an error: ".concat(a))),E=setTimeout(I,d.sI),o(!1),t()}!function(e,n){var t=new FileReader;t.addEventListener("load",(function(){return n(t.result)})),t.readAsDataURL(e)}(e,(function(e){return i(e),n()}))}))},customRequest:D,disabled:l,children:l?(0,a.jsx)(v.Z,{style:{color:"white"}}):(0,a.jsx)(g.Z,{icon:(0,a.jsx)(x.Z,{})})})]}),(0,a.jsx)(j.E,{status:_}),(0,a.jsx)("p",{className:"field-tip",children:U})]})]})},b=i.Z.Title,w=function(){var e=(0,s.useState)(null),n=e[0],t=e[1],i=((0,s.useContext)(u.aC)||{}).serverConfig,h=i.instanceDetails,m=i.yp,p=m.instanceUrl;if((0,s.useEffect)((function(){t((0,l.Z)({},h,m))}),[h,m]),!n)return null;var g=function(e){var a=e.fieldName,s=e.value;t((0,o.Z)((0,l.Z)({},n),(0,r.Z)({},a,s)))},v=""!==p;return(0,a.jsxs)("div",{className:"edit-general-settings",children:[(0,a.jsx)(b,{level:3,className:"section-title",children:"Configure Instance Details"}),(0,a.jsx)("br",{}),(0,a.jsx)(c.$7,(0,o.Z)((0,l.Z)({fieldName:"name"},d.RE),{value:n.name,initialValue:h.name,onChange:g})),(0,a.jsx)(c.$7,(0,o.Z)((0,l.Z)({fieldName:"instanceUrl"},d.cj),{value:n.instanceUrl,initialValue:m.instanceUrl,type:c.xA,onChange:g,onSubmit:function(){""===n.instanceUrl&&!0===m.enabled&&(0,d.Si)({apiPath:d.AP,data:{value:!1}})}})),(0,a.jsx)(c.$7,(0,o.Z)((0,l.Z)({fieldName:"summary"},d.rs),{type:c.Sk,value:n.summary,initialValue:h.summary,onChange:g})),(0,a.jsx)(c.$7,(0,o.Z)((0,l.Z)({fieldName:"offlineMessage"},d.rd),{type:c.Sk,value:n.offlineMessage,initialValue:h.offlineMessage,onChange:g})),(0,a.jsx)(y,{}),(0,a.jsx)(f.Z,(0,o.Z)((0,l.Z)({fieldName:"hideViewerCount",useSubmit:!0},d._X),{checked:n.hideViewerCount,onChange:function(e){g({fieldName:"hideViewerCount",value:e})}})),(0,a.jsx)("br",{}),(0,a.jsxs)("p",{className:"description",children:["Increase your audience by appearing in the"," ",(0,a.jsx)("a",{href:"https://directory.owncast.online",target:"_blank",rel:"noreferrer",children:(0,a.jsx)("strong",{children:"Owncast Directory"})}),". This is an external service run by the Owncast project."," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/directory/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn more"}),"."]}),!m.instanceUrl&&(0,a.jsxs)("p",{className:"description",children:["You must set your ",(0,a.jsx)("strong",{children:"Server URL"})," above to enable the directory."]}),(0,a.jsxs)("div",{className:"config-yp-container",children:[(0,a.jsx)(f.Z,(0,o.Z)((0,l.Z)({fieldName:"enabled",useSubmit:!0},d.P),{checked:n.enabled,disabled:!v})),(0,a.jsx)(f.Z,(0,o.Z)((0,l.Z)({fieldName:"nsfw",useSubmit:!0},d.EY),{checked:n.nsfw,disabled:!v}))]})]})},k=t(29815),Z=t(20550),T=t(24389),_=t(80939),P=i.Z.Title,E=function(){var e=(0,s.useState)(""),n=e[0],t=e[1],i=(0,s.useState)(null),r=i[0],l=i[1],o=(0,s.useContext)(u.aC)||{},c=o.serverConfig,f=o.setFieldInConfigState,p=c.instanceDetails.tags,g=void 0===p?[]:p,v=d.y_.apiPath,x=d.y_.maxLength,j=d.y_.placeholder,C=d.y_.configPath,S=null;(0,s.useEffect)((function(){return function(){clearTimeout(S)}}),[]);var y=function(){l(null),S=null,clearTimeout(S)},b=function(){var e=(0,h.Z)((function(e){return(0,m.__generator)(this,(function(n){switch(n.label){case 0:return l((0,N.kg)(N.Jk)),[4,(0,d.Si)({apiPath:v,data:{value:e},onSuccess:function(){f({fieldName:"tags",value:e,path:C}),l((0,N.kg)(N.zv,"Tags updated.")),t(""),S=setTimeout(y,d.sI)},onError:function(e){l((0,N.kg)(N.Un,e)),S=setTimeout(y,d.sI)}})];case 1:return n.sent(),[2]}}))}));return function(n){return e.apply(this,arguments)}}();return(0,a.jsxs)("div",{className:"tag-editor-container",children:[(0,a.jsx)(P,{level:3,className:"section-title",children:"Add Tags"}),(0,a.jsx)("p",{className:"description",children:"This is a great way to categorize your Owncast server on the Directory!"}),(0,a.jsx)("div",{className:"edit-current-strings",children:g.map((function(e,n){return(0,a.jsx)(Z.Z,{closable:!0,onClose:function(){!function(e){y();var n=(0,k.Z)(g);n.splice(e,1),b(n)}(n)},color:_.Q,children:e},"tag-".concat(e,"-").concat(n))}))}),(0,a.jsx)("div",{className:"add-new-string-section",children:(0,a.jsx)(T.nv,{fieldName:"tag-input",value:n,className:"new-tag-input",onChange:function(e){var n=e.value;r||l(null),t(n)},onPressEnter:function(){y();var e=n.trim();if(""!==e)if(g.some((function(n){return n.toLowerCase()===e.toLowerCase()})))l((0,N.kg)(N.dG,"This tag is already used!"));else{var t=(0,k.Z)(g).concat([e]);b(t)}else l((0,N.kg)(N.dG,"Please enter a tag"))},maxLength:x,placeholder:j,status:r})})]})},L=t(72877),U=t(5152),I=t.n(U),D=t(9980),F=t.n(D),M=(t(69596),new(F())),z=I()((function(){return t.e(7610).then(t.bind(t,77610))}),{loadableGenerated:{webpack:function(){return[77610]}},ssr:!1}),O=i.Z.Title,V=function(){var e=(0,s.useState)(""),n=e[0],t=e[1],i=(0,s.useState)(null),r=i[0],l=i[1],o=(0,s.useState)(!1),c=o[0],f=o[1],p=(0,s.useContext)(u.aC)||{},v=p.serverConfig,x=p.setFieldInConfigState,C=v.instanceDetails,S=C.extraPageContent,y=null,b=function(){l(null),f(!1),clearTimeout(y),y=null};function w(){return(w=(0,h.Z)((function(){return(0,m.__generator)(this,(function(e){switch(e.label){case 0:return l((0,N.kg)(N.Jk)),[4,(0,d.Si)({apiPath:d.AA,data:{value:n},onSuccess:function(e){x({fieldName:"extraPageContent",value:n,path:"instanceDetails"}),l((0,N.kg)(N.zv,e))},onError:function(e){l((0,N.kg)(N.Un,e))}})];case 1:return e.sent(),y=setTimeout(b,d.sI),[2]}}))}))).apply(this,arguments)}return(0,s.useEffect)((function(){t(S)}),[C]),(0,a.jsxs)("div",{className:"edit-page-content",children:[(0,a.jsx)(O,{level:3,className:"section-title",children:"Custom Page Content"}),(0,a.jsxs)("p",{className:"description",children:["Edit the content of your page by using simple"," ",(0,a.jsx)("a",{href:"https://www.markdownguide.org/basic-syntax/",target:"_blank",rel:"noopener noreferrer",children:"Markdown syntax"}),"."]}),(0,a.jsx)(z,{style:{height:"30em"},value:n,renderHTML:function(e){return M.render(e)},onChange:function(e){var n=e.text;t(n),n===S||c?n===S&&c&&f(!1):f(!0)},config:{htmlClass:"markdown-editor-preview-pane",markdownClass:"markdown-editor-pane"}}),(0,a.jsx)("br",{}),(0,a.jsxs)("div",{className:"page-content-actions",children:[c&&(0,a.jsx)(g.Z,{type:"primary",onClick:function(){return w.apply(this,arguments)},children:"Save"}),(0,a.jsx)(j.E,{status:r})]})]})},A=i.Z.Title,J=function(){var e=(0,s.useState)(""),n=e[0],t=e[1],i=(0,s.useState)(null),r=i[0],l=i[1],o=(0,s.useState)(!1),c=o[0],f=o[1],p=(0,s.useContext)(u.aC)||{},v=p.serverConfig,x=p.setFieldInConfigState,C=v.instanceDetails,S=C.customStyles,y=null,b=function(){l(null),f(!1),clearTimeout(y),y=null};function w(){return(w=(0,h.Z)((function(){return(0,m.__generator)(this,(function(e){switch(e.label){case 0:return l((0,N.kg)(N.Jk)),[4,(0,d.Si)({apiPath:d.d$,data:{value:n},onSuccess:function(e){x({fieldName:"customStyles",value:n,path:"instanceDetails"}),l((0,N.kg)(N.zv,e))},onError:function(e){l((0,N.kg)(N.Un,e))}})];case 1:return e.sent(),y=setTimeout(b,d.sI),[2]}}))}))).apply(this,arguments)}return(0,s.useEffect)((function(){t(S)}),[C]),(0,a.jsxs)("div",{className:"edit-custom-css",children:[(0,a.jsx)(A,{level:3,className:"section-title",children:"Customize your page styling with CSS"}),(0,a.jsxs)("p",{className:"description",children:["Customize the look and feel of your Owncast instance by overriding the CSS styles of various components on the page. Refer to the"," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/website/",rel:"noopener noreferrer",target:"_blank",children:"CSS & Components guide"}),"."]}),(0,a.jsx)("p",{className:"description",children:"Please input plain CSS text, as this will be directly injected onto your page during load."}),(0,a.jsx)(T.nv,{fieldName:"customStyles",type:T.Sk,value:n,maxLength:null,onChange:function(e){var n=e.value;t(n),n===S||c?n===S&&c&&f(!1):f(!0)},placeholder:"/* Enter custom CSS here */"}),(0,a.jsx)("br",{}),(0,a.jsxs)("div",{className:"page-content-actions",children:[c&&(0,a.jsx)(g.Z,{type:"primary",onClick:function(){return w.apply(this,arguments)},children:"Save"}),(0,a.jsx)(j.E,{status:r})]})]})},R=i.Z.Title;function $(){return(0,a.jsxs)("div",{className:"config-public-details-page",children:[(0,a.jsx)(R,{children:"General Settings"}),(0,a.jsxs)("p",{className:"description",children:["The following are displayed on your site to describe your stream and its content."," ",(0,a.jsx)("a",{href:"https://owncast.online/docs/website/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"Learn more."})]}),(0,a.jsxs)("div",{className:"top-container",children:[(0,a.jsx)("div",{className:"form-module instance-details-container",children:(0,a.jsx)(w,{})}),(0,a.jsxs)("div",{className:"form-module social-items-container ",children:[(0,a.jsx)("div",{className:"form-module tags-module",children:(0,a.jsx)(E,{})}),(0,a.jsx)("div",{className:"form-module social-handles-container",children:(0,a.jsx)(L.h,{})})]})]}),(0,a.jsx)("div",{className:"form-module page-content-module",children:(0,a.jsx)(V,{})}),(0,a.jsx)("div",{className:"form-module page-content-module",children:(0,a.jsx)(J,{})})]})}}},function(e){e.O(0,[8939,3903,3698,3626,9654,7910,9839,2877,9774,2888,179],(function(){return n=86045,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/config-social-items-d6bb1606e719eea2.js b/static/web/_next/static/chunks/pages/admin/config-social-items-0c9506f9b2b2acaf.js similarity index 96% rename from static/web/_next/static/chunks/pages/admin/config-social-items-d6bb1606e719eea2.js rename to static/web/_next/static/chunks/pages/admin/config-social-items-0c9506f9b2b2acaf.js index 5061f4a8f..1fe2e3f83 100644 --- a/static/web/_next/static/chunks/pages/admin/config-social-items-d6bb1606e719eea2.js +++ b/static/web/_next/static/chunks/pages/admin/config-social-items-0c9506f9b2b2acaf.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[30],{48689:function(t,n,r){"use strict";r.d(n,{Z:function(){return a}});var e=r(1413),i=r(67294),o={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},u=r(42135),c=function(t,n){return i.createElement(u.Z,(0,e.Z)((0,e.Z)({},t),{},{ref:n,icon:o}))};c.displayName="DeleteOutlined";var a=i.forwardRef(c)},27561:function(t,n,r){var e=r(67990),i=/^\s+/;t.exports=function(t){return t?t.slice(0,e(t)+1).replace(i,""):t}},67990:function(t){var n=/\s/;t.exports=function(t){for(var r=t.length;r--&&n.test(t.charAt(r)););return r}},23279:function(t,n,r){var e=r(13218),i=r(7771),o=r(14841),u=Math.max,c=Math.min;t.exports=function(t,n,r){var a,f,s,l,v,d,m=0,p=!1,h=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function b(n){var r=a,e=f;return a=f=void 0,m=n,l=t.apply(e,r)}function g(t){return m=t,v=setTimeout(w,n),p?b(t):l}function x(t){var r=t-d;return void 0===d||r>=n||r<0||h&&t-m>=s}function w(){var t=i();if(x(t))return Z(t);v=setTimeout(w,function(t){var r=n-(t-d);return h?c(r,s-(t-m)):r}(t))}function Z(t){return v=void 0,y&&a?b(t):(a=f=void 0,l)}function _(){var t=i(),r=x(t);if(a=arguments,f=this,d=t,r){if(void 0===v)return g(d);if(h)return clearTimeout(v),v=setTimeout(w,n),b(d)}return void 0===v&&(v=setTimeout(w,n)),l}return n=o(n)||0,e(r)&&(p=!!r.leading,s=(h="maxWait"in r)?u(o(r.maxWait)||0,n):s,y="trailing"in r?!!r.trailing:y),_.cancel=function(){void 0!==v&&clearTimeout(v),m=0,a=d=f=v=void 0},_.flush=function(){return void 0===v?l:Z(i())},_}},33448:function(t,n,r){var e=r(44239),i=r(37005);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==e(t)}},7771:function(t,n,r){var e=r(55639);t.exports=function(){return e.Date.now()}},14841:function(t,n,r){var e=r(27561),i=r(13218),o=r(33448),u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,a=/^0o[0-7]+$/i,f=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=i(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=e(t);var r=c.test(t);return r||a.test(t)?f(t.slice(2),r?2:8):u.test(t)?NaN:+t}},81009:function(t,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/config-social-items",function(){return r(97063)}])},97063:function(t,n,r){"use strict";r.r(n),r.d(n,{default:function(){return c}});var e=r(85893),i=(r(67294),r(84485)),o=r(72877),u=i.Z.Title;function c(){return(0,e.jsxs)("div",{className:"config-social-items",children:[(0,e.jsx)(u,{children:"Social Items"}),(0,e.jsx)(o.h,{})]})}},20943:function(t,n,r){"use strict";function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r=n||r<0||h&&t-m>=s}function w(){var t=i();if(x(t))return Z(t);v=setTimeout(w,function(t){var r=n-(t-d);return h?c(r,s-(t-m)):r}(t))}function Z(t){return v=void 0,y&&a?b(t):(a=f=void 0,l)}function _(){var t=i(),r=x(t);if(a=arguments,f=this,d=t,r){if(void 0===v)return g(d);if(h)return clearTimeout(v),v=setTimeout(w,n),b(d)}return void 0===v&&(v=setTimeout(w,n)),l}return n=o(n)||0,e(r)&&(p=!!r.leading,s=(h="maxWait"in r)?u(o(r.maxWait)||0,n):s,y="trailing"in r?!!r.trailing:y),_.cancel=function(){void 0!==v&&clearTimeout(v),m=0,a=d=f=v=void 0},_.flush=function(){return void 0===v?l:Z(i())},_}},33448:function(t,n,r){var e=r(44239),i=r(37005);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==e(t)}},7771:function(t,n,r){var e=r(55639);t.exports=function(){return e.Date.now()}},14841:function(t,n,r){var e=r(27561),i=r(13218),o=r(33448),u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,a=/^0o[0-7]+$/i,f=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=i(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=e(t);var r=c.test(t);return r||a.test(t)?f(t.slice(2),r?2:8):u.test(t)?NaN:+t}},81009:function(t,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/config-social-items",function(){return r(97063)}])},97063:function(t,n,r){"use strict";r.r(n),r.d(n,{default:function(){return c}});var e=r(85893),i=(r(67294),r(84485)),o=r(72877),u=i.Z.Title;function c(){return(0,e.jsxs)("div",{className:"config-social-items",children:[(0,e.jsx)(u,{children:"Social Items"}),(0,e.jsx)(o.h,{})]})}},20943:function(t,n,r){"use strict";function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,e=new Array(n);r=e||n<0||m&&t-p>=f}function g(){var t=i();if(x(t))return _(t);d=setTimeout(g,function(t){var n=e-(t-v);return m?u(n,f-(t-p)):n}(t))}function _(t){return d=void 0,E&&s?y(t):(s=c=void 0,l)}function I(){var t=i(),n=x(t);if(s=arguments,c=this,v=t,n){if(void 0===d)return w(v);if(m)return clearTimeout(d),d=setTimeout(g,e),y(v)}return void 0===d&&(d=setTimeout(g,e)),l}return e=o(e)||0,r(n)&&(h=!!n.leading,f=(m="maxWait"in n)?a(o(n.maxWait)||0,e):f,E="trailing"in n?!!n.trailing:E),I.cancel=function(){void 0!==d&&clearTimeout(d),p=0,s=v=c=d=void 0},I.flush=function(){return void 0===d?l:_(i())},I}},33448:function(t,e,n){var r=n(44239),i=n(37005);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},7771:function(t,e,n){var r=n(55639);t.exports=function(){return r.Date.now()}},14841:function(t,e,n){var r=n(27561),i=n(13218),o=n(33448),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=u.test(t);return n||s.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},10203:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/federation/actions",function(){return n(13268)}])},13268:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return p}});var r=n(47568),i=n(70655),o=n(85893),a=n(67294),u=n(84485),s=n(10355),c=n(58091),f=n(58827),l=n(2766),d=u.Z.Title,v=u.Z.Paragraph;function p(){var t=(0,a.useState)([]),e=t[0],n=t[1],u=(0,a.useState)(0),p=u[0],h=u[1],m=(0,a.useState)(0),E=m[0],y=m[1],w=function(){var t=(0,r.Z)((function(){var t,e,r,o,a,u;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),50,t=50*E,e="".concat(f.op,"?offset=").concat(t,"&limit=").concat(50),[4,(0,f.rQ)(e,{auth:!0})];case 1:return r=i.sent(),o=r.results,a=r.total,h(a),(0,l.Qr)(o)?n([]):n(o),[3,3];case 2:return u=i.sent(),console.log("==== error",u),[3,3];case 3:return[2]}}))}));return function(){return t.apply(this,arguments)}}();(0,a.useEffect)((function(){w()}),[E]);var x,g,_=[{title:"Action",dataIndex:"type",key:"type",width:50,render:function(t,e){var n,r;switch(e.type){case"FEDIVERSE_ENGAGEMENT_REPOST":n="/img/repost.svg",r="Share";break;case"FEDIVERSE_ENGAGEMENT_LIKE":n="/img/like.svg",r="Like";break;case"FEDIVERSE_ENGAGEMENT_FOLLOW":n="/img/follow.svg",r="Follow";break;default:n=""}return(0,o.jsxs)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[(0,o.jsx)("img",{src:n,width:"70%",alt:r,title:r}),(0,o.jsx)("div",{style:{fontSize:"0.7rem"},children:r})]})}},{title:"From",dataIndex:"actorIRI",key:"from",render:function(t,e){return(0,o.jsx)("a",{href:e.actorIRI,children:e.actorIRI})}},{title:"When",dataIndex:"timestamp",key:"timestamp",render:function(t,e){var n=new Date(e.timestamp);return(0,c.Z)(n,"P pp")}}];return(0,o.jsxs)("div",{children:[(0,o.jsx)(d,{level:3,children:"Fediverse Actions"}),(0,o.jsx)(v,{children:"Below is a list of actions that were taken by others in response to your posts as well as people who requested to follow you."}),(x=e,g=_,(0,o.jsx)(s.Z,{dataSource:x,columns:g,size:"small",rowKey:function(t){return t.iri},pagination:{pageSize:50,hideOnSinglePage:!0,showSizeChanger:!1,total:p},onChange:function(t){var e=t.current;y(e)}}))]})}}},function(t){t.O(0,[8939,3903,3698,355,8091,9774,2888,179],(function(){return e=10203,t(t.s=e);var e}));var e=t.O();_N_E=e}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4976],{27561:function(t,e,n){var r=n(67990),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},67990:function(t){var e=/\s/;t.exports=function(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}},23279:function(t,e,n){var r=n(13218),i=n(7771),o=n(14841),a=Math.max,u=Math.min;t.exports=function(t,e,n){var s,c,f,l,d,v,p=0,h=!1,m=!1,E=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function y(e){var n=s,r=c;return s=c=void 0,p=e,l=t.apply(r,n)}function w(t){return p=t,d=setTimeout(g,e),h?y(t):l}function x(t){var n=t-v;return void 0===v||n>=e||n<0||m&&t-p>=f}function g(){var t=i();if(x(t))return _(t);d=setTimeout(g,function(t){var n=e-(t-v);return m?u(n,f-(t-p)):n}(t))}function _(t){return d=void 0,E&&s?y(t):(s=c=void 0,l)}function I(){var t=i(),n=x(t);if(s=arguments,c=this,v=t,n){if(void 0===d)return w(v);if(m)return clearTimeout(d),d=setTimeout(g,e),y(v)}return void 0===d&&(d=setTimeout(g,e)),l}return e=o(e)||0,r(n)&&(h=!!n.leading,f=(m="maxWait"in n)?a(o(n.maxWait)||0,e):f,E="trailing"in n?!!n.trailing:E),I.cancel=function(){void 0!==d&&clearTimeout(d),p=0,s=v=c=d=void 0},I.flush=function(){return void 0===d?l:_(i())},I}},33448:function(t,e,n){var r=n(44239),i=n(37005);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},7771:function(t,e,n){var r=n(55639);t.exports=function(){return r.Date.now()}},14841:function(t,e,n){var r=n(27561),i=n(13218),o=n(33448),a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=u.test(t);return n||s.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},10203:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/federation/actions",function(){return n(13268)}])},13268:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return p}});var r=n(47568),i=n(70655),o=n(85893),a=n(67294),u=n(84485),s=n(93626),c=n(58091),f=n(58827),l=n(2766),d=u.Z.Title,v=u.Z.Paragraph;function p(){var t=(0,a.useState)([]),e=t[0],n=t[1],u=(0,a.useState)(0),p=u[0],h=u[1],m=(0,a.useState)(0),E=m[0],y=m[1],w=function(){var t=(0,r.Z)((function(){var t,e,r,o,a,u;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),50,t=50*E,e="".concat(f.op,"?offset=").concat(t,"&limit=").concat(50),[4,(0,f.rQ)(e,{auth:!0})];case 1:return r=i.sent(),o=r.results,a=r.total,h(a),(0,l.Qr)(o)?n([]):n(o),[3,3];case 2:return u=i.sent(),console.log("==== error",u),[3,3];case 3:return[2]}}))}));return function(){return t.apply(this,arguments)}}();(0,a.useEffect)((function(){w()}),[E]);var x,g,_=[{title:"Action",dataIndex:"type",key:"type",width:50,render:function(t,e){var n,r;switch(e.type){case"FEDIVERSE_ENGAGEMENT_REPOST":n="/img/repost.svg",r="Share";break;case"FEDIVERSE_ENGAGEMENT_LIKE":n="/img/like.svg",r="Like";break;case"FEDIVERSE_ENGAGEMENT_FOLLOW":n="/img/follow.svg",r="Follow";break;default:n=""}return(0,o.jsxs)("div",{style:{width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[(0,o.jsx)("img",{src:n,width:"70%",alt:r,title:r}),(0,o.jsx)("div",{style:{fontSize:"0.7rem"},children:r})]})}},{title:"From",dataIndex:"actorIRI",key:"from",render:function(t,e){return(0,o.jsx)("a",{href:e.actorIRI,children:e.actorIRI})}},{title:"When",dataIndex:"timestamp",key:"timestamp",render:function(t,e){var n=new Date(e.timestamp);return(0,c.Z)(n,"P pp")}}];return(0,o.jsxs)("div",{children:[(0,o.jsx)(d,{level:3,children:"Fediverse Actions"}),(0,o.jsx)(v,{children:"Below is a list of actions that were taken by others in response to your posts as well as people who requested to follow you."}),(x=e,g=_,(0,o.jsx)(s.Z,{dataSource:x,columns:g,size:"small",rowKey:function(t){return t.iri},pagination:{pageSize:50,hideOnSinglePage:!0,showSizeChanger:!1,total:p},onChange:function(t){var e=t.current;y(e)}}))]})}}},function(t){t.O(0,[8939,3903,3698,3626,8091,9774,2888,179],(function(){return e=10203,t(t.s=e);var e}));var e=t.O();_N_E=e}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/federation/followers-5504ff57b0a1d9c0.js b/static/web/_next/static/chunks/pages/admin/federation/followers-340617dfd678f424.js similarity index 98% rename from static/web/_next/static/chunks/pages/admin/federation/followers-5504ff57b0a1d9c0.js rename to static/web/_next/static/chunks/pages/admin/federation/followers-340617dfd678f424.js index 365cf653f..b7d11917d 100644 --- a/static/web/_next/static/chunks/pages/admin/federation/followers-5504ff57b0a1d9c0.js +++ b/static/web/_next/static/chunks/pages/admin/federation/followers-340617dfd678f424.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2476],{24093:function(e,t,n){"use strict";n.d(t,{C:function(){return C}});var r=n(87462),a=n(4942),i=n(71002),o=n(97685),c=n(94184),s=n.n(c),u=n(48555),l=n(42550),f=n(67294),d=n(53124),p=n(25378),m=n(24308),h=f.createContext("default"),v=function(e){var t=e.children,n=e.size;return f.createElement(h.Consumer,null,(function(e){return f.createElement(h.Provider,{value:n||e},t)}))},g=h,y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a=t||n<0||v&&e-m>=l}function Z(){var e=a();if(w(e))return b(e);d=setTimeout(Z,function(e){var n=t-(e-p);return v?c(n,l-(e-m)):n}(e))}function b(e){return d=void 0,g&&s?y(e):(s=u=void 0,f)}function j(){var e=a(),n=w(e);if(s=arguments,u=this,p=e,n){if(void 0===d)return x(p);if(v)return clearTimeout(d),d=setTimeout(Z,t),y(p)}return void 0===d&&(d=setTimeout(Z,t)),f}return t=i(t)||0,r(n)&&(h=!!n.leading,l=(v="maxWait"in n)?o(i(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),j.cancel=function(){void 0!==d&&clearTimeout(d),m=0,s=p=u=d=void 0},j.flush=function(){return void 0===d?f:b(a())},j}},33448:function(e,t,n){var r=n(44239),a=n(37005);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),a=n(13218),i=n(33448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||s.test(e)?u(e.slice(2),n?2:8):o.test(e)?NaN:+e}},89675:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/federation/followers",function(){return n(72301)}])},72301:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return E}});var r=n(47568),a=n(29815),i=n(70655),o=n(85893),c=n(67294),s=n(2944),u=n(10355),l=n(24093),f=n(71577),d=n(58091),p=n(1413),m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 888.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 349c0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 349c0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"user-add",theme:"outlined"},h=n(42135),v=function(e,t){return c.createElement(h.Z,(0,p.Z)((0,p.Z)({},e),{},{ref:t,icon:m}))};v.displayName="UserAddOutlined";var g=c.forwardRef(v),y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M678.3 655.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 518 759.6 444.7 759.6 362c0-137-110.8-248-247.5-248S264.7 225 264.7 362c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 901.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 641.2 432.2 610 512.2 610c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 534c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 362c0-45.9 17.9-89.1 50.3-121.6S466.3 190 512.2 190s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 362c0 45.9-17.9 89.1-50.3 121.6C601.1 516.1 558 534 512.2 534zM880 772H640c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h240c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"user-delete",theme:"outlined"},x=function(e,t){return c.createElement(h.Z,(0,p.Z)((0,p.Z)({},e),{},{ref:t,icon:y}))};x.displayName="UserDeleteOutlined";var w=c.forwardRef(x),Z=n(35159),b=n(58827),j=n(2766),k=s.Z.TabPane;function E(){var e=function(e,t){return(0,o.jsx)(u.Z,{dataSource:e,columns:t,size:"small",rowKey:function(e){return e.link},pagination:{pageSize:50,hideOnSinglePage:!0,showSizeChanger:!1,total:C},onChange:function(e){var t=e.current;N(t)}})},t=(0,c.useState)([]),n=t[0],p=t[1],m=(0,c.useState)([]),h=m[0],v=m[1],y=(0,c.useState)([]),x=y[0],E=y[1],S=(0,c.useState)(0),C=S[0],O=S[1],T=(0,c.useState)(0),_=T[0],N=T[1],P=((0,c.useContext)(Z.aC)||{}).serverConfig.federation.isPrivate,z=function(){var e=(0,r.Z)((function(){var e,t,n,r,a,o,c,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),50,e=50*_,t="".concat(b.HP,"?offset=").concat(e,"&limit=").concat(50),[4,(0,b.rQ)(t,{auth:!0})];case 1:return n=i.sent(),r=n.results,a=n.total,(0,j.Qr)(r)?E([]):(O(a),E(r)),[4,(0,b.rQ)(b.E8,{auth:!0})];case 2:return o=i.sent(),(0,j.Qr)(o)?p([]):p(o),[4,(0,b.rQ)(b.Y9,{auth:!0})];case 3:return c=i.sent(),(0,j.Qr)(h)?v([]):v(c),[3,5];case 4:return s=i.sent(),console.log("==== error",s),[3,5];case 5:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){z()}),[]);var I=[{title:"",dataIndex:"image",key:"image",width:90,render:function(e){return(0,o.jsx)(l.C,{size:40,src:e||"/img/logo.svg"})}},{title:"Name",dataIndex:"name",key:"name",render:function(e,t){return(0,o.jsx)("a",{href:t.link,target:"_blank",rel:"noreferrer",children:t.name||t.username})}},{title:"URL",dataIndex:"link",key:"link",render:function(e,t){return(0,o.jsx)("a",{href:t.link,target:"_blank",rel:"noreferrer",children:t.link})}}];function A(e){return D.apply(this,arguments)}function D(){return(D=(0,r.Z)((function(e){var t;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,b.rQ)(b.kb,{auth:!0,method:"POST",data:{actorIRI:e.link,approved:!0}})];case 1:return n.sent(),z(),[3,3];case 2:return t=n.sent(),console.error(t),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function R(e){return M.apply(this,arguments)}function M(){return(M=(0,r.Z)((function(e){var t;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,b.rQ)(b.kb,{auth:!0,method:"POST",data:{actorIRI:e.link,approved:!1}})];case 1:return n.sent(),z(),[3,3];case 2:return t=n.sent(),console.error(t),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}var Q=(0,a.Z)(I);Q.unshift({title:"Approve",dataIndex:null,key:null,render:function(e){return(0,o.jsx)(f.Z,{type:"primary",icon:(0,o.jsx)(g,{}),onClick:function(){A(e)}})},width:50},{title:"Reject",dataIndex:null,key:null,render:function(e){return(0,o.jsx)(f.Z,{type:"primary",danger:!0,icon:(0,o.jsx)(w,{}),onClick:function(){R(e)}})},width:50}),Q.push({title:"Requested",dataIndex:"timestamp",key:"requested",width:200,render:function(e){var t=new Date(e);return(0,o.jsx)(o.Fragment,{children:(0,d.Z)(t,"P")})},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"});var F=(0,a.Z)(I);F.unshift({title:"Approve",dataIndex:null,key:null,render:function(e){return(0,o.jsx)(f.Z,{type:"primary",icon:(0,o.jsx)(g,{}),size:"large",onClick:function(){A(e)}})},width:50}),F.push({title:"Requested",dataIndex:"timestamp",key:"requested",width:200,render:function(e){var t=new Date(e);return(0,o.jsx)(o.Fragment,{children:(0,d.Z)(t,"P")})},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Rejected/Blocked",dataIndex:"timestamp",key:"disabled_at",width:200,render:function(e){var t=new Date(e);return(0,o.jsx)(o.Fragment,{children:(0,d.Z)(t,"P")})},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"});var q=(0,a.Z)(I);q.push({title:"Added",dataIndex:"timestamp",key:"timestamp",width:200,render:function(e){var t=new Date(e);return(0,o.jsx)(o.Fragment,{children:(0,d.Z)(t,"P")})},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Remove",dataIndex:null,key:null,render:function(e){return(0,o.jsx)(f.Z,{type:"primary",danger:!0,icon:(0,o.jsx)(w,{}),onClick:function(){R(e)}})},width:50});var H=P&&(0,o.jsxs)(k,{tab:(0,o.jsxs)("span",{children:["Requests ",n.length>0&&"(".concat(n.length,")")]}),children:[(0,o.jsxs)("p",{children:["The following people are requesting to follow your Owncast server on the"," ",(0,o.jsx)("a",{href:"https://en.wikipedia.org/wiki/Fediverse",target:"_blank",rel:"noopener noreferrer",children:"Fediverse"})," ","and be alerted to when you go live. Each must be approved."]}),e(n,Q)]},"2");return(0,o.jsx)("div",{className:"followers-section",children:(0,o.jsxs)(s.Z,{defaultActiveKey:"1",children:[(0,o.jsxs)(k,{tab:(0,o.jsxs)("span",{children:["Followers ",x.length>0&&"(".concat(x.length,")")]}),children:[(0,o.jsx)("p",{children:"The following accounts get notified when you go live or send a post."}),e(x,q)," "]},"1"),H,(0,o.jsxs)(k,{tab:(0,o.jsxs)("span",{children:["Blocked ",h.length>0&&"(".concat(h.length,")")]}),children:[(0,o.jsx)("p",{children:"The following people were either rejected or blocked by you. You can approve them as a follower."}),(0,o.jsx)("p",{children:e(h,F)})]},"3")]})})}},20943:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t||n<0||v&&e-m>=l}function Z(){var e=a();if(w(e))return b(e);d=setTimeout(Z,function(e){var n=t-(e-p);return v?c(n,l-(e-m)):n}(e))}function b(e){return d=void 0,g&&s?y(e):(s=u=void 0,f)}function j(){var e=a(),n=w(e);if(s=arguments,u=this,p=e,n){if(void 0===d)return x(p);if(v)return clearTimeout(d),d=setTimeout(Z,t),y(p)}return void 0===d&&(d=setTimeout(Z,t)),f}return t=i(t)||0,r(n)&&(h=!!n.leading,l=(v="maxWait"in n)?o(i(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),j.cancel=function(){void 0!==d&&clearTimeout(d),m=0,s=p=u=d=void 0},j.flush=function(){return void 0===d?f:b(a())},j}},33448:function(e,t,n){var r=n(44239),a=n(37005);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),a=n(13218),i=n(33448),o=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||s.test(e)?u(e.slice(2),n?2:8):o.test(e)?NaN:+e}},89675:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/federation/followers",function(){return n(72301)}])},72301:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return E}});var r=n(47568),a=n(29815),i=n(70655),o=n(85893),c=n(67294),s=n(2944),u=n(93626),l=n(24093),f=n(71577),d=n(58091),p=n(1413),m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 888.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 349c0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 349c0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"user-add",theme:"outlined"},h=n(42135),v=function(e,t){return c.createElement(h.Z,(0,p.Z)((0,p.Z)({},e),{},{ref:t,icon:m}))};v.displayName="UserAddOutlined";var g=c.forwardRef(v),y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M678.3 655.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 518 759.6 444.7 759.6 362c0-137-110.8-248-247.5-248S264.7 225 264.7 362c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 901.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 641.2 432.2 610 512.2 610c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 534c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 362c0-45.9 17.9-89.1 50.3-121.6S466.3 190 512.2 190s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 362c0 45.9-17.9 89.1-50.3 121.6C601.1 516.1 558 534 512.2 534zM880 772H640c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h240c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"user-delete",theme:"outlined"},x=function(e,t){return c.createElement(h.Z,(0,p.Z)((0,p.Z)({},e),{},{ref:t,icon:y}))};x.displayName="UserDeleteOutlined";var w=c.forwardRef(x),Z=n(35159),b=n(58827),j=n(2766),k=s.Z.TabPane;function E(){var e=function(e,t){return(0,o.jsx)(u.Z,{dataSource:e,columns:t,size:"small",rowKey:function(e){return e.link},pagination:{pageSize:50,hideOnSinglePage:!0,showSizeChanger:!1,total:C},onChange:function(e){var t=e.current;N(t)}})},t=(0,c.useState)([]),n=t[0],p=t[1],m=(0,c.useState)([]),h=m[0],v=m[1],y=(0,c.useState)([]),x=y[0],E=y[1],S=(0,c.useState)(0),C=S[0],O=S[1],T=(0,c.useState)(0),_=T[0],N=T[1],P=((0,c.useContext)(Z.aC)||{}).serverConfig.federation.isPrivate,z=function(){var e=(0,r.Z)((function(){var e,t,n,r,a,o,c,s;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),50,e=50*_,t="".concat(b.HP,"?offset=").concat(e,"&limit=").concat(50),[4,(0,b.rQ)(t,{auth:!0})];case 1:return n=i.sent(),r=n.results,a=n.total,(0,j.Qr)(r)?E([]):(O(a),E(r)),[4,(0,b.rQ)(b.E8,{auth:!0})];case 2:return o=i.sent(),(0,j.Qr)(o)?p([]):p(o),[4,(0,b.rQ)(b.Y9,{auth:!0})];case 3:return c=i.sent(),(0,j.Qr)(h)?v([]):v(c),[3,5];case 4:return s=i.sent(),console.log("==== error",s),[3,5];case 5:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){z()}),[]);var I=[{title:"",dataIndex:"image",key:"image",width:90,render:function(e){return(0,o.jsx)(l.C,{size:40,src:e||"/img/logo.svg"})}},{title:"Name",dataIndex:"name",key:"name",render:function(e,t){return(0,o.jsx)("a",{href:t.link,target:"_blank",rel:"noreferrer",children:t.name||t.username})}},{title:"URL",dataIndex:"link",key:"link",render:function(e,t){return(0,o.jsx)("a",{href:t.link,target:"_blank",rel:"noreferrer",children:t.link})}}];function A(e){return D.apply(this,arguments)}function D(){return(D=(0,r.Z)((function(e){var t;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,b.rQ)(b.kb,{auth:!0,method:"POST",data:{actorIRI:e.link,approved:!0}})];case 1:return n.sent(),z(),[3,3];case 2:return t=n.sent(),console.error(t),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function R(e){return M.apply(this,arguments)}function M(){return(M=(0,r.Z)((function(e){var t;return(0,i.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,(0,b.rQ)(b.kb,{auth:!0,method:"POST",data:{actorIRI:e.link,approved:!1}})];case 1:return n.sent(),z(),[3,3];case 2:return t=n.sent(),console.error(t),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}var Q=(0,a.Z)(I);Q.unshift({title:"Approve",dataIndex:null,key:null,render:function(e){return(0,o.jsx)(f.Z,{type:"primary",icon:(0,o.jsx)(g,{}),onClick:function(){A(e)}})},width:50},{title:"Reject",dataIndex:null,key:null,render:function(e){return(0,o.jsx)(f.Z,{type:"primary",danger:!0,icon:(0,o.jsx)(w,{}),onClick:function(){R(e)}})},width:50}),Q.push({title:"Requested",dataIndex:"timestamp",key:"requested",width:200,render:function(e){var t=new Date(e);return(0,o.jsx)(o.Fragment,{children:(0,d.Z)(t,"P")})},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"});var F=(0,a.Z)(I);F.unshift({title:"Approve",dataIndex:null,key:null,render:function(e){return(0,o.jsx)(f.Z,{type:"primary",icon:(0,o.jsx)(g,{}),size:"large",onClick:function(){A(e)}})},width:50}),F.push({title:"Requested",dataIndex:"timestamp",key:"requested",width:200,render:function(e){var t=new Date(e);return(0,o.jsx)(o.Fragment,{children:(0,d.Z)(t,"P")})},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Rejected/Blocked",dataIndex:"timestamp",key:"disabled_at",width:200,render:function(e){var t=new Date(e);return(0,o.jsx)(o.Fragment,{children:(0,d.Z)(t,"P")})},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"});var q=(0,a.Z)(I);q.push({title:"Added",dataIndex:"timestamp",key:"timestamp",width:200,render:function(e){var t=new Date(e);return(0,o.jsx)(o.Fragment,{children:(0,d.Z)(t,"P")})},sorter:function(e,t){return new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Remove",dataIndex:null,key:null,render:function(e){return(0,o.jsx)(f.Z,{type:"primary",danger:!0,icon:(0,o.jsx)(w,{}),onClick:function(){R(e)}})},width:50});var H=P&&(0,o.jsxs)(k,{tab:(0,o.jsxs)("span",{children:["Requests ",n.length>0&&"(".concat(n.length,")")]}),children:[(0,o.jsxs)("p",{children:["The following people are requesting to follow your Owncast server on the"," ",(0,o.jsx)("a",{href:"https://en.wikipedia.org/wiki/Fediverse",target:"_blank",rel:"noopener noreferrer",children:"Fediverse"})," ","and be alerted to when you go live. Each must be approved."]}),e(n,Q)]},"2");return(0,o.jsx)("div",{className:"followers-section",children:(0,o.jsxs)(s.Z,{defaultActiveKey:"1",children:[(0,o.jsxs)(k,{tab:(0,o.jsxs)("span",{children:["Followers ",x.length>0&&"(".concat(x.length,")")]}),children:[(0,o.jsx)("p",{children:"The following accounts get notified when you go live or send a post."}),e(x,q)," "]},"1"),H,(0,o.jsxs)(k,{tab:(0,o.jsxs)("span",{children:["Blocked ",h.length>0&&"(".concat(h.length,")")]}),children:[(0,o.jsx)("p",{children:"The following people were either rejected or blocked by you. You can approve them as a follower."}),(0,o.jsx)("p",{children:e(h,F)})]},"3")]})})}},20943:function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=n||t<0||g&&e-p>=f}function _(){var e=i();if(y(e))return T(e);v=setTimeout(_,function(e){var t=n-(e-d);return g?a(t,f-(e-p)):t}(e))}function T(e){return v=void 0,x&&c?h(e):(c=s=void 0,l)}function E(){var e=i(),t=y(e);if(c=arguments,s=this,d=e,t){if(void 0===v)return w(d);if(g)return clearTimeout(v),v=setTimeout(_,n),h(d)}return void 0===v&&(v=setTimeout(_,n)),l}return n=o(n)||0,r(t)&&(m=!!t.leading,f=(g="maxWait"in t)?u(o(t.maxWait)||0,n):f,x="trailing"in t?!!t.trailing:x),E.cancel=function(){void 0!==v&&clearTimeout(v),p=0,c=d=s=v=void 0},E.flush=function(){return void 0===v?l:T(i())},E}},33448:function(e,n,t){var r=t(44239),i=t(37005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7771:function(e,n,t){var r=t(55639);e.exports=function(){return r.Date.now()}},14841:function(e,n,t){var r=t(27561),i=t(13218),o=t(33448),u=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=i(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var t=a.test(e);return t||c.test(e)?s(e.slice(2),t?2:8):u.test(e)?NaN:+e}},23426:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/logs",function(){return t(65502)}])},38856:function(e,n,t){"use strict";t.d(n,{o:function(){return v}});var r=t(85893),i=(t(67294),t(84485)),o=t(20550),u=t(10355),a=t(53731),c=t(58091),s=i.Z.Title;function f(e,n){var t="black";return"warning"===n.level?t="orange":"error"===n.level&&(t="red"),(0,r.jsx)(o.Z,{color:t,children:e})}function l(e){return(0,r.jsx)(a.Z,{children:e})}var v=function(e){var n=e.logs,t=e.pageSize;if(!(null===n||void 0===n?void 0:n.length))return null;var i=[{title:"Level",dataIndex:"level",key:"level",filters:[{text:"Info",value:"info"},{text:"Warning",value:"warning"},{text:"Error",value:"Error"}],onFilter:function(e,n){return 0===n.level.indexOf(e)},render:f},{title:"Timestamp",dataIndex:"time",key:"time",render:function(e){var n=new Date(e);return(0,c.Z)(n,"pp P")},sorter:function(e,n){return new Date(e.time).getTime()-new Date(n.time).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Message",dataIndex:"message",key:"message",render:l}];return(0,r.jsxs)("div",{className:"logs-section",children:[(0,r.jsx)(s,{children:"Logs"}),(0,r.jsx)(u.Z,{size:"middle",dataSource:n,columns:i,rowKey:function(e){return e.time},pagination:{pageSize:t||20}})]})}},65502:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return s}});var r=t(47568),i=t(70655),o=t(85893),u=t(67294),a=t(38856),c=t(58827);function s(){var e=(0,u.useState)([]),n=e[0],t=e[1],s=function(){var e=(0,r.Z)((function(){var e,n;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,c.rQ)(c.sG)];case 1:return e=r.sent(),t(e),[3,3];case 2:return n=r.sent(),console.log("==== error",n),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}();return(0,u.useEffect)((function(){var e;return setInterval(s,5e3),s(),e=setInterval(s,5e3),function(){clearInterval(e)}}),[]),(0,o.jsx)(a.o,{logs:n,pageSize:20})}}},function(e){e.O(0,[8939,3903,3698,355,8091,2429,9774,2888,179],(function(){return n=23426,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1774],{27561:function(e,n,t){var r=t(67990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},67990:function(e){var n=/\s/;e.exports=function(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}},23279:function(e,n,t){var r=t(13218),i=t(7771),o=t(14841),u=Math.max,a=Math.min;e.exports=function(e,n,t){var c,s,f,l,v,d,p=0,m=!1,g=!1,x=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(n){var t=c,r=s;return c=s=void 0,p=n,l=e.apply(r,t)}function w(e){return p=e,v=setTimeout(_,n),m?h(e):l}function y(e){var t=e-d;return void 0===d||t>=n||t<0||g&&e-p>=f}function _(){var e=i();if(y(e))return T(e);v=setTimeout(_,function(e){var t=n-(e-d);return g?a(t,f-(e-p)):t}(e))}function T(e){return v=void 0,x&&c?h(e):(c=s=void 0,l)}function E(){var e=i(),t=y(e);if(c=arguments,s=this,d=e,t){if(void 0===v)return w(d);if(g)return clearTimeout(v),v=setTimeout(_,n),h(d)}return void 0===v&&(v=setTimeout(_,n)),l}return n=o(n)||0,r(t)&&(m=!!t.leading,f=(g="maxWait"in t)?u(o(t.maxWait)||0,n):f,x="trailing"in t?!!t.trailing:x),E.cancel=function(){void 0!==v&&clearTimeout(v),p=0,c=d=s=v=void 0},E.flush=function(){return void 0===v?l:T(i())},E}},33448:function(e,n,t){var r=t(44239),i=t(37005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},7771:function(e,n,t){var r=t(55639);e.exports=function(){return r.Date.now()}},14841:function(e,n,t){var r=t(27561),i=t(13218),o=t(33448),u=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=i(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var t=a.test(e);return t||c.test(e)?s(e.slice(2),t?2:8):u.test(e)?NaN:+e}},23426:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/logs",function(){return t(65502)}])},38856:function(e,n,t){"use strict";t.d(n,{o:function(){return v}});var r=t(85893),i=(t(67294),t(84485)),o=t(20550),u=t(93626),a=t(53731),c=t(58091),s=i.Z.Title;function f(e,n){var t="black";return"warning"===n.level?t="orange":"error"===n.level&&(t="red"),(0,r.jsx)(o.Z,{color:t,children:e})}function l(e){return(0,r.jsx)(a.Z,{children:e})}var v=function(e){var n=e.logs,t=e.pageSize;if(!(null===n||void 0===n?void 0:n.length))return null;var i=[{title:"Level",dataIndex:"level",key:"level",filters:[{text:"Info",value:"info"},{text:"Warning",value:"warning"},{text:"Error",value:"Error"}],onFilter:function(e,n){return 0===n.level.indexOf(e)},render:f},{title:"Timestamp",dataIndex:"time",key:"time",render:function(e){var n=new Date(e);return(0,c.Z)(n,"pp P")},sorter:function(e,n){return new Date(e.time).getTime()-new Date(n.time).getTime()},sortDirections:["descend","ascend"],defaultSortOrder:"descend"},{title:"Message",dataIndex:"message",key:"message",render:l}];return(0,r.jsxs)("div",{className:"logs-section",children:[(0,r.jsx)(s,{children:"Logs"}),(0,r.jsx)(u.Z,{size:"middle",dataSource:n,columns:i,rowKey:function(e){return e.time},pagination:{pageSize:t||20}})]})}},65502:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return s}});var r=t(47568),i=t(70655),o=t(85893),u=t(67294),a=t(38856),c=t(58827);function s(){var e=(0,u.useState)([]),n=e[0],t=e[1],s=function(){var e=(0,r.Z)((function(){var e,n;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,c.rQ)(c.sG)];case 1:return e=r.sent(),t(e),[3,3];case 2:return n=r.sent(),console.log("==== error",n),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}();return(0,u.useEffect)((function(){var e;return setInterval(s,5e3),s(),e=setInterval(s,5e3),function(){clearInterval(e)}}),[]),(0,o.jsx)(a.o,{logs:n,pageSize:20})}}},function(e){e.O(0,[8939,3903,3698,3626,8091,2429,9774,2888,179],(function(){return n=23426,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/upgrade-d37fb18597de81d5.js b/static/web/_next/static/chunks/pages/admin/upgrade-a2690af66d4d3214.js similarity index 88% rename from static/web/_next/static/chunks/pages/admin/upgrade-d37fb18597de81d5.js rename to static/web/_next/static/chunks/pages/admin/upgrade-a2690af66d4d3214.js index 0f5e21285..cef8b4294 100644 --- a/static/web/_next/static/chunks/pages/admin/upgrade-d37fb18597de81d5.js +++ b/static/web/_next/static/chunks/pages/admin/upgrade-a2690af66d4d3214.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9262],{70918:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/upgrade",function(){return r(73143)}])},73143:function(e,n,r){"use strict";r.r(n);var t=r(47568),a=r(26042),u=r(70655),s=r(85893),i=r(67294),c=r(16153),l=r(84485),o=r(10355),d=r(58827),f=l.Z.Title,h=function(e){var n=Object.values(e),r=[{title:"Name",dataIndex:"name",key:"name",render:function(e,n){return(0,s.jsx)("a",{href:n.browser_download_url,children:e})}},{title:"Size",dataIndex:"size",key:"size",render:function(e){return"".concat((e/1024/1024).toFixed(2)," MB")}}];return(0,s.jsx)(o.Z,{dataSource:n,columns:r,rowKey:function(e){return e.id},size:"large",pagination:!1})};n.default=function(){var e=(0,i.useState)({html_url:"",name:"",created_at:null,body:"",assets:[]}),n=e[0],r=e[1],l=function(){var e=(0,t.Z)((function(){var e,n;return(0,u.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,d.Kt)()];case 1:return e=t.sent(),r(e),[3,3];case 2:return n=t.sent(),console.log("==== error",n),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}();return(0,i.useEffect)((function(){l()}),[]),n?(0,s.jsxs)("div",{className:"upgrade-page",children:[(0,s.jsx)(f,{level:2,children:(0,s.jsx)("a",{href:n.html_url,children:n.name})}),(0,s.jsx)(f,{level:5,children:new Date(n.created_at).toDateString()}),(0,s.jsx)(c.D,{children:n.body}),(0,s.jsx)("h3",{children:"Downloads"}),(0,s.jsx)(h,(0,a.Z)({},n.assets))]}):null}}},function(e){e.O(0,[8939,3903,3698,355,3812,9774,2888,179],(function(){return n=70918,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9262],{70918:function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/upgrade",function(){return r(73143)}])},73143:function(e,n,r){"use strict";r.r(n);var t=r(47568),a=r(26042),u=r(70655),s=r(85893),i=r(67294),c=r(16153),l=r(84485),o=r(93626),d=r(58827),f=l.Z.Title,h=function(e){var n=Object.values(e),r=[{title:"Name",dataIndex:"name",key:"name",render:function(e,n){return(0,s.jsx)("a",{href:n.browser_download_url,children:e})}},{title:"Size",dataIndex:"size",key:"size",render:function(e){return"".concat((e/1024/1024).toFixed(2)," MB")}}];return(0,s.jsx)(o.Z,{dataSource:n,columns:r,rowKey:function(e){return e.id},size:"large",pagination:!1})};n.default=function(){var e=(0,i.useState)({html_url:"",name:"",created_at:null,body:"",assets:[]}),n=e[0],r=e[1],l=function(){var e=(0,t.Z)((function(){var e,n;return(0,u.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,d.Kt)()];case 1:return e=t.sent(),r(e),[3,3];case 2:return n=t.sent(),console.log("==== error",n),[3,3];case 3:return[2]}}))}));return function(){return e.apply(this,arguments)}}();return(0,i.useEffect)((function(){l()}),[]),n?(0,s.jsxs)("div",{className:"upgrade-page",children:[(0,s.jsx)(f,{level:2,children:(0,s.jsx)("a",{href:n.html_url,children:n.name})}),(0,s.jsx)(f,{level:5,children:new Date(n.created_at).toDateString()}),(0,s.jsx)(c.D,{children:n.body}),(0,s.jsx)("h3",{children:"Downloads"}),(0,s.jsx)(h,(0,a.Z)({},n.assets))]}):null}}},function(e){e.O(0,[8939,3903,3698,3626,3812,9774,2888,179],(function(){return n=70918,e(e.s=n);var n}));var n=e.O();_N_E=n}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/viewer-info-d4da40ea621ba733.js b/static/web/_next/static/chunks/pages/admin/viewer-info-a302c2034b7c758f.js similarity index 97% rename from static/web/_next/static/chunks/pages/admin/viewer-info-d4da40ea621ba733.js rename to static/web/_next/static/chunks/pages/admin/viewer-info-a302c2034b7c758f.js index b44040c0d..b153898e7 100644 --- a/static/web/_next/static/chunks/pages/admin/viewer-info-d4da40ea621ba733.js +++ b/static/web/_next/static/chunks/pages/admin/viewer-info-a302c2034b7c758f.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6109],{87547:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(1413),a=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},o=n(42135),s=function(e,t){return a.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:i}))};s.displayName="UserOutlined";var u=a.forwardRef(s)},77349:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(83946),a=n(19013),i=n(13882);function o(e,t){(0,i.Z)(2,arguments);var n=(0,a.Z)(e),o=(0,r.Z)(t);return isNaN(o)?new Date(NaN):o?(n.setDate(n.getDate()+o),n):n}},11640:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(83946),a=n(19013),i=n(13882);function o(e,t){(0,i.Z)(2,arguments);var n=(0,a.Z)(e),o=(0,r.Z)(t);if(isNaN(o))return new Date(NaN);if(!o)return n;var s=n.getDate(),u=new Date(n.getTime());u.setMonth(n.getMonth()+o+1,0);var c=u.getDate();return s>=c?u:(n.setFullYear(u.getFullYear(),u.getMonth(),s),n)}},23279:function(e,t,n){var r=n(13218),a=n(7771),i=n(14841),o=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,f,d,v,m=0,h=!1,x=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,m=t,f=e.apply(r,n)}function Z(e){return m=e,d=setTimeout(w,t),h?y(e):f}function g(e){var n=e-v;return void 0===v||n>=t||n<0||x&&e-m>=l}function w(){var e=a();if(g(e))return j(e);d=setTimeout(w,function(e){var n=t-(e-v);return x?s(n,l-(e-m)):n}(e))}function j(e){return d=void 0,p&&u?y(e):(u=c=void 0,f)}function S(){var e=a(),n=g(e);if(u=arguments,c=this,v=e,n){if(void 0===d)return Z(v);if(x)return clearTimeout(d),d=setTimeout(w,t),y(v)}return void 0===d&&(d=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(h=!!n.leading,l=(x="maxWait"in n)?o(i(n.maxWait)||0,t):l,p="trailing"in n?!!n.trailing:p),S.cancel=function(){void 0!==d&&clearTimeout(d),m=0,u=v=c=d=void 0},S.flush=function(){return void 0===d?f:j(a())},S}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},92794:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/viewer-info",function(){return n(80961)}])},51222:function(e,t,n){"use strict";n.d(t,{k:function(){return l}});var r=n(85893),a=n(29217),i=n(92616),o=n.n(i),s=n(58091),u=n(60727);function c(e){var t={};return e.forEach((function(e){var n=new Date(e.time),r=(0,s.Z)(n,"H:mma");t[r]=e.value})),t}o().use(a.Z);var l=function(e){var t=e.data,n=e.title,a=e.color,i=e.unit,o=e.dataCollections,s=e.yFlipped,l=e.yLogarithmic,f=[];t&&t.length>0&&f.push({name:n,color:a,data:c(t)}),o.forEach((function(e){f.push({name:e.name,data:c(e.data),color:e.color,dataset:e.options})}));var d={scales:{y:{reverse:!1,type:"linear"},x:{type:"time"}}};return d.scales.y.reverse=s,d.scales.y.type=l?"logarithmic":"linear",(0,r.jsx)("div",{className:"line-chart-container",children:(0,r.jsx)(u.wW,{xtitle:"Time",ytitle:n,suffix:i,legend:"bottom",color:a,data:f,download:n,library:d})})};l.defaultProps={dataCollections:[],data:[],title:"",yFlipped:!1,yLogarithmic:!1}},97206:function(e,t,n){"use strict";n.d(t,{m:function(){return m}});var r=n(26042),a=n(85893),i=n(84485),o=n(97910),s=n(74763),u=n(59652),c=i.Z.Text,l={title:"",value:0,prefix:null,suffix:null,color:"",progress:!1,centered:!1,formatter:null},f=function(e){var t=e.prefix,n=e.value,r=e.suffix,i=e.title;return(0,a.jsxs)("div",{children:[t,(0,a.jsx)("div",{children:(0,a.jsx)(c,{type:"secondary",children:i})}),(0,a.jsx)("div",{children:(0,a.jsxs)(c,{type:"secondary",children:[n,r||"%"]})})]})},d=function(e){var t=e.title,n=e.value,r=e.prefix,i=e.suffix,s=e.color,u=n>90?"red":s,c=(0,a.jsx)(f,{prefix:r,value:n,suffix:i,title:t});return(0,a.jsx)(o.Z,{type:"dashboard",percent:n,width:120,strokeColor:{"0%":s,"90%":u},format:function(){return c}})};d.defaultProps=l;var v=function(e){var t=e.title,n=e.value,r=e.prefix,i=e.formatter;return(0,a.jsx)(s.Z,{title:t,value:n,prefix:r,formatter:i})};v.defaultProps=l;var m=function(e){var t=e.progress,n=e.centered,i=t?d:v,o=n?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return(0,a.jsx)(u.Z,{type:"inner",children:(0,a.jsx)("div",{style:o,children:(0,a.jsx)(i,(0,r.Z)({},e))})})};m.defaultProps=l},80961:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var r=n(47568),a=n(70655),i=n(85893),o=n(67294),s=n(66516),u=n(84485),c=n(25968),l=n(6226),f=n(14670),d=n(11382),v=n(38504),m=n(87547),h=n(80882),x=n(77349),p=n(13882),y=n(83946);function Z(e,t){(0,p.Z)(2,arguments);var n=(0,y.Z)(t);return(0,x.Z)(e,-n)}var g=n(11640);function w(e,t){(0,p.Z)(2,arguments);var n=(0,y.Z)(t);return(0,g.Z)(e,-n)}function j(e){return j="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function S(e,t){if((0,p.Z)(2,arguments),!t||"object"!==j(t))return new Date(NaN);var n=t.years?(0,y.Z)(t.years):0,r=t.months?(0,y.Z)(t.months):0,a=t.weeks?(0,y.Z)(t.weeks):0,i=t.days?(0,y.Z)(t.days):0,o=t.hours?(0,y.Z)(t.hours):0,s=t.minutes?(0,y.Z)(t.minutes):0,u=t.seconds?(0,y.Z)(t.seconds):0,c=w(e,r+12*n),l=Z(c,i+7*a),f=s+60*o,d=u+60*f,v=1e3*d,m=new Date(l.getTime()-v);return m}var b=n(19013);function D(e){(0,p.Z)(1,arguments);var t=(0,b.Z)(e),n=t.getTime();return n}var N=n(51222),k=n(97206),T=n(10355),C=n(45938),_=n(2766);var E=function(e){var t=e.data,n=[{title:"User Agent",dataIndex:"userAgent",key:"userAgent",render:function(e){return(0,_.AB)(e)}},{title:"Location",dataIndex:"geo",key:"geo",render:function(e){return e?"".concat(e.regionName,", ").concat(e.countryCode):"-"}},{title:"Watch Time",dataIndex:"firstSeen",key:"firstSeen",defaultSortOrder:"ascend",render:function(e){return(0,C.Z)(new Date(e))},sorter:function(e,t){return new Date(e.firstSeen).getTime()-new Date(t.firstSeen).getTime()},sortDirections:["descend","ascend"]}];return(0,i.jsx)(T.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:n,dataSource:t,size:"small",rowKey:"id"})},M=n(35159),P=n(58827);function I(){var e,t=(0,o.useContext)(M.aC)||{},n=t.online,x=t.broadcaster,y=t.viewerCount,Z=t.overallPeakViewerCount,g=t.sessionPeakViewerCount;x&&x.time&&(e=new Date(x.time));var w=[{title:"Current stream",start:e},{title:"Last 12 hours",start:S(new Date,{hours:12})},{title:"Last 24 hours",start:S(new Date,{hours:24})},{title:"Last 7 days",start:S(new Date,{days:7})},{title:"Last 30 days",start:S(new Date,{days:30})},{title:"Last 3 months",start:S(new Date,{months:3})},{title:"Last 6 months",start:S(new Date,{months:6})}],j=(0,o.useState)(!0),b=j[0],T=j[1],C=(0,o.useState)([]),_=C[0],I=C[1],L=(0,o.useState)([]),A=L[0],F=L[1],O=(0,o.useState)(w[1]),V=O[0],W=O[1],z=function(){var e=(0,r.Z)((function(){var e,t,n,r,i;return(0,a.__generator)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),e="".concat(P.iV,"?windowStart=").concat(function(e){return(0,p.Z)(1,arguments),Math.floor(D(e)/1e3)}(V.start)),[4,(0,P.rQ)(e)];case 1:return t=a.sent(),I(t),T(!1),[3,3];case 2:return n=a.sent(),console.log("==== error",n),[3,3];case 3:return a.trys.push([3,5,,6]),[4,(0,P.rQ)(P.a_)];case 4:return r=a.sent(),F(r),[3,6];case 5:return i=a.sent(),console.log("==== error",i),[3,6];case 6:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){var e=null;return z(),n?(e=setInterval(z,6e4),function(){clearInterval(e)}):function(){return[]}}),[n,V]);var B=function(e){var t=e.key;W(w[t])},Q=(0,i.jsxs)(s.Z,{children:[n&&e&&(0,i.jsx)(s.Z.Item,{onClick:B,children:w[0].title},"0"),w.slice(1).map((function(e,t){return(0,i.jsx)(s.Z.Item,{onClick:B,children:e.title},t+1)}))]});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.Z.Title,{children:"Viewer Info"}),(0,i.jsx)("br",{}),(0,i.jsxs)(c.Z,{gutter:[16,16],justify:"space-around",children:[n&&(0,i.jsx)(l.Z,{span:8,md:8,children:(0,i.jsx)(k.m,{title:"Current viewers",value:y.toString(),prefix:(0,i.jsx)(m.Z,{})})}),(0,i.jsx)(l.Z,{md:n?8:12,children:(0,i.jsx)(k.m,{title:n?"Max viewers this stream":"Max viewers last stream",value:g.toString(),prefix:(0,i.jsx)(m.Z,{})})}),(0,i.jsx)(l.Z,{md:n?8:12,children:(0,i.jsx)(k.m,{title:"All-time max viewers",value:Z.toString(),prefix:(0,i.jsx)(m.Z,{})})})]}),!_.length&&(0,i.jsx)(f.Z,{style:{marginTop:"10px"},banner:!0,message:"Please wait",description:"No viewer data has been collected yet.",type:"info"}),(0,i.jsxs)(d.Z,{spinning:!_.length||b,children:[(0,i.jsx)(v.Z,{overlay:Q,trigger:["click"],children:(0,i.jsxs)("button",{type:"button",style:{float:"right",background:"transparent",border:"unset"},children:[V.title," ",(0,i.jsx)(h.Z,{})]})}),_.length>0&&(0,i.jsx)(N.k,{title:"Viewers",data:_,color:"#2087E2",unit:""}),(0,i.jsx)(E,{data:A})]})]})}}},function(e){e.O(0,[2757,8939,3903,3698,355,8091,2944,5938,5315,4763,2139,7910,9774,2888,179],(function(){return t=92794,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6109],{87547:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var r=n(1413),a=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}}]},name:"user",theme:"outlined"},o=n(42135),s=function(e,t){return a.createElement(o.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:i}))};s.displayName="UserOutlined";var u=a.forwardRef(s)},77349:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(83946),a=n(19013),i=n(13882);function o(e,t){(0,i.Z)(2,arguments);var n=(0,a.Z)(e),o=(0,r.Z)(t);return isNaN(o)?new Date(NaN):o?(n.setDate(n.getDate()+o),n):n}},11640:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(83946),a=n(19013),i=n(13882);function o(e,t){(0,i.Z)(2,arguments);var n=(0,a.Z)(e),o=(0,r.Z)(t);if(isNaN(o))return new Date(NaN);if(!o)return n;var s=n.getDate(),u=new Date(n.getTime());u.setMonth(n.getMonth()+o+1,0);var c=u.getDate();return s>=c?u:(n.setFullYear(u.getFullYear(),u.getMonth(),s),n)}},23279:function(e,t,n){var r=n(13218),a=n(7771),i=n(14841),o=Math.max,s=Math.min;e.exports=function(e,t,n){var u,c,l,f,d,v,m=0,h=!1,x=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=u,r=c;return u=c=void 0,m=t,f=e.apply(r,n)}function Z(e){return m=e,d=setTimeout(w,t),h?y(e):f}function g(e){var n=e-v;return void 0===v||n>=t||n<0||x&&e-m>=l}function w(){var e=a();if(g(e))return j(e);d=setTimeout(w,function(e){var n=t-(e-v);return x?s(n,l-(e-m)):n}(e))}function j(e){return d=void 0,p&&u?y(e):(u=c=void 0,f)}function S(){var e=a(),n=g(e);if(u=arguments,c=this,v=e,n){if(void 0===d)return Z(v);if(x)return clearTimeout(d),d=setTimeout(w,t),y(v)}return void 0===d&&(d=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(h=!!n.leading,l=(x="maxWait"in n)?o(i(n.maxWait)||0,t):l,p="trailing"in n?!!n.trailing:p),S.cancel=function(){void 0!==d&&clearTimeout(d),m=0,u=v=c=d=void 0},S.flush=function(){return void 0===d?f:j(a())},S}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},92794:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/viewer-info",function(){return n(80961)}])},51222:function(e,t,n){"use strict";n.d(t,{k:function(){return l}});var r=n(85893),a=n(29217),i=n(92616),o=n.n(i),s=n(58091),u=n(60727);function c(e){var t={};return e.forEach((function(e){var n=new Date(e.time),r=(0,s.Z)(n,"H:mma");t[r]=e.value})),t}o().use(a.Z);var l=function(e){var t=e.data,n=e.title,a=e.color,i=e.unit,o=e.dataCollections,s=e.yFlipped,l=e.yLogarithmic,f=[];t&&t.length>0&&f.push({name:n,color:a,data:c(t)}),o.forEach((function(e){f.push({name:e.name,data:c(e.data),color:e.color,dataset:e.options})}));var d={scales:{y:{reverse:!1,type:"linear"},x:{type:"time"}}};return d.scales.y.reverse=s,d.scales.y.type=l?"logarithmic":"linear",(0,r.jsx)("div",{className:"line-chart-container",children:(0,r.jsx)(u.wW,{xtitle:"Time",ytitle:n,suffix:i,legend:"bottom",color:a,data:f,download:n,library:d})})};l.defaultProps={dataCollections:[],data:[],title:"",yFlipped:!1,yLogarithmic:!1}},97206:function(e,t,n){"use strict";n.d(t,{m:function(){return m}});var r=n(26042),a=n(85893),i=n(84485),o=n(97910),s=n(74763),u=n(59652),c=i.Z.Text,l={title:"",value:0,prefix:null,suffix:null,color:"",progress:!1,centered:!1,formatter:null},f=function(e){var t=e.prefix,n=e.value,r=e.suffix,i=e.title;return(0,a.jsxs)("div",{children:[t,(0,a.jsx)("div",{children:(0,a.jsx)(c,{type:"secondary",children:i})}),(0,a.jsx)("div",{children:(0,a.jsxs)(c,{type:"secondary",children:[n,r||"%"]})})]})},d=function(e){var t=e.title,n=e.value,r=e.prefix,i=e.suffix,s=e.color,u=n>90?"red":s,c=(0,a.jsx)(f,{prefix:r,value:n,suffix:i,title:t});return(0,a.jsx)(o.Z,{type:"dashboard",percent:n,width:120,strokeColor:{"0%":s,"90%":u},format:function(){return c}})};d.defaultProps=l;var v=function(e){var t=e.title,n=e.value,r=e.prefix,i=e.formatter;return(0,a.jsx)(s.Z,{title:t,value:n,prefix:r,formatter:i})};v.defaultProps=l;var m=function(e){var t=e.progress,n=e.centered,i=t?d:v,o=n?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return(0,a.jsx)(u.Z,{type:"inner",children:(0,a.jsx)("div",{style:o,children:(0,a.jsx)(i,(0,r.Z)({},e))})})};m.defaultProps=l},80961:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var r=n(47568),a=n(70655),i=n(85893),o=n(67294),s=n(66516),u=n(84485),c=n(25968),l=n(6226),f=n(14670),d=n(11382),v=n(38504),m=n(87547),h=n(80882),x=n(77349),p=n(13882),y=n(83946);function Z(e,t){(0,p.Z)(2,arguments);var n=(0,y.Z)(t);return(0,x.Z)(e,-n)}var g=n(11640);function w(e,t){(0,p.Z)(2,arguments);var n=(0,y.Z)(t);return(0,g.Z)(e,-n)}function j(e){return j="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j(e)}function S(e,t){if((0,p.Z)(2,arguments),!t||"object"!==j(t))return new Date(NaN);var n=t.years?(0,y.Z)(t.years):0,r=t.months?(0,y.Z)(t.months):0,a=t.weeks?(0,y.Z)(t.weeks):0,i=t.days?(0,y.Z)(t.days):0,o=t.hours?(0,y.Z)(t.hours):0,s=t.minutes?(0,y.Z)(t.minutes):0,u=t.seconds?(0,y.Z)(t.seconds):0,c=w(e,r+12*n),l=Z(c,i+7*a),f=s+60*o,d=u+60*f,v=1e3*d,m=new Date(l.getTime()-v);return m}var b=n(19013);function D(e){(0,p.Z)(1,arguments);var t=(0,b.Z)(e),n=t.getTime();return n}var N=n(51222),k=n(97206),T=n(93626),C=n(45938),_=n(2766);var E=function(e){var t=e.data,n=[{title:"User Agent",dataIndex:"userAgent",key:"userAgent",render:function(e){return(0,_.AB)(e)}},{title:"Location",dataIndex:"geo",key:"geo",render:function(e){return e?"".concat(e.regionName,", ").concat(e.countryCode):"-"}},{title:"Watch Time",dataIndex:"firstSeen",key:"firstSeen",defaultSortOrder:"ascend",render:function(e){return(0,C.Z)(new Date(e))},sorter:function(e,t){return new Date(e.firstSeen).getTime()-new Date(t.firstSeen).getTime()},sortDirections:["descend","ascend"]}];return(0,i.jsx)(T.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:n,dataSource:t,size:"small",rowKey:"id"})},M=n(35159),P=n(58827);function I(){var e,t=(0,o.useContext)(M.aC)||{},n=t.online,x=t.broadcaster,y=t.viewerCount,Z=t.overallPeakViewerCount,g=t.sessionPeakViewerCount;x&&x.time&&(e=new Date(x.time));var w=[{title:"Current stream",start:e},{title:"Last 12 hours",start:S(new Date,{hours:12})},{title:"Last 24 hours",start:S(new Date,{hours:24})},{title:"Last 7 days",start:S(new Date,{days:7})},{title:"Last 30 days",start:S(new Date,{days:30})},{title:"Last 3 months",start:S(new Date,{months:3})},{title:"Last 6 months",start:S(new Date,{months:6})}],j=(0,o.useState)(!0),b=j[0],T=j[1],C=(0,o.useState)([]),_=C[0],I=C[1],L=(0,o.useState)([]),A=L[0],F=L[1],O=(0,o.useState)(w[1]),V=O[0],W=O[1],z=function(){var e=(0,r.Z)((function(){var e,t,n,r,i;return(0,a.__generator)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),e="".concat(P.iV,"?windowStart=").concat(function(e){return(0,p.Z)(1,arguments),Math.floor(D(e)/1e3)}(V.start)),[4,(0,P.rQ)(e)];case 1:return t=a.sent(),I(t),T(!1),[3,3];case 2:return n=a.sent(),console.log("==== error",n),[3,3];case 3:return a.trys.push([3,5,,6]),[4,(0,P.rQ)(P.a_)];case 4:return r=a.sent(),F(r),[3,6];case 5:return i=a.sent(),console.log("==== error",i),[3,6];case 6:return[2]}}))}));return function(){return e.apply(this,arguments)}}();(0,o.useEffect)((function(){var e=null;return z(),n?(e=setInterval(z,6e4),function(){clearInterval(e)}):function(){return[]}}),[n,V]);var B=function(e){var t=e.key;W(w[t])},Q=(0,i.jsxs)(s.Z,{children:[n&&e&&(0,i.jsx)(s.Z.Item,{onClick:B,children:w[0].title},"0"),w.slice(1).map((function(e,t){return(0,i.jsx)(s.Z.Item,{onClick:B,children:e.title},t+1)}))]});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.Z.Title,{children:"Viewer Info"}),(0,i.jsx)("br",{}),(0,i.jsxs)(c.Z,{gutter:[16,16],justify:"space-around",children:[n&&(0,i.jsx)(l.Z,{span:8,md:8,children:(0,i.jsx)(k.m,{title:"Current viewers",value:y.toString(),prefix:(0,i.jsx)(m.Z,{})})}),(0,i.jsx)(l.Z,{md:n?8:12,children:(0,i.jsx)(k.m,{title:n?"Max viewers this stream":"Max viewers last stream",value:g.toString(),prefix:(0,i.jsx)(m.Z,{})})}),(0,i.jsx)(l.Z,{md:n?8:12,children:(0,i.jsx)(k.m,{title:"All-time max viewers",value:Z.toString(),prefix:(0,i.jsx)(m.Z,{})})})]}),!_.length&&(0,i.jsx)(f.Z,{style:{marginTop:"10px"},banner:!0,message:"Please wait",description:"No viewer data has been collected yet.",type:"info"}),(0,i.jsxs)(d.Z,{spinning:!_.length||b,children:[(0,i.jsx)(v.Z,{overlay:Q,trigger:["click"],children:(0,i.jsxs)("button",{type:"button",style:{float:"right",background:"transparent",border:"unset"},children:[V.title," ",(0,i.jsx)(h.Z,{})]})}),_.length>0&&(0,i.jsx)(N.k,{title:"Viewers",data:_,color:"#2087E2",unit:""}),(0,i.jsx)(E,{data:A})]})]})}}},function(e){e.O(0,[2757,8939,3903,3698,3626,8091,2944,5938,5315,4763,2139,7910,9774,2888,179],(function(){return t=92794,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/pages/admin/webhooks-4bf13fb3eb979bed.js b/static/web/_next/static/chunks/pages/admin/webhooks-31e1e30a1af46238.js similarity index 98% rename from static/web/_next/static/chunks/pages/admin/webhooks-4bf13fb3eb979bed.js rename to static/web/_next/static/chunks/pages/admin/webhooks-31e1e30a1af46238.js index ae8026030..b396a1326 100644 --- a/static/web/_next/static/chunks/pages/admin/webhooks-4bf13fb3eb979bed.js +++ b/static/web/_next/static/chunks/pages/admin/webhooks-31e1e30a1af46238.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1234],{48689:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1413),o=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},a=n(42135),i=function(e,t){return o.createElement(a.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))};i.displayName="DeleteOutlined";var s=o.forwardRef(i)},6226:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4942),o=n(87462),c=n(71002),a=n(94184),i=n.n(a),s=n(67294),l=n(53124),u=n(99134),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0){var I=m[0]/2;A.paddingLeft=I,A.paddingRight=I}if(m&&m[1]>0&&!b){var R=m[1]/2;A.paddingTop=R,A.paddingBottom=R}return k&&(A.flex=function(e){return"number"===typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(k),!1!==y||A.minWidth||(A.minWidth=0)),s.createElement("div",(0,o.Z)({},N,{style:(0,o.Z)((0,o.Z)({},A),P),className:T,ref:t}),E)}))},99134:function(e,t,n){"use strict";var r=(0,n(67294).createContext)({});t.Z=r},25968:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(87462),o=n(4942),c=n(71002),a=n(97685),i=n(94184),s=n.n(i),l=n(67294),u=n(53124),f=n(98082),p=n(24308),d=n(93355),h=n(99134),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0?I[0]/-2:void 0,D=null!=I[1]&&I[1]>0?I[1]/-2:void 0;if(M&&(W.marginLeft=M,W.marginRight=M),_){var G=(0,a.Z)(I,2);W.rowGap=G[1]}else D&&(W.marginTop=D,W.marginBottom=D);var H=(0,a.Z)(I,2),$=H[0],B=H[1],U=l.useMemo((function(){return{gutter:[$,B],wrap:j,supportFlexGap:_}}),[$,B,j,_]);return l.createElement(h.Z.Provider,{value:U},l.createElement("div",(0,r.Z)({},w,{className:R,style:(0,r.Z)((0,r.Z)({},W),b),ref:t}),x))}))},20550:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r=n(4942),o=n(87462),c=n(97685),a=n(97937),i=n(94184),s=n.n(i),l=n(98423),u=n(67294),f=n(53124),p=n(98787),d=n(68349),h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=t||n<0||m&&e-h>=u}function Z(){var e=o();if(g(e))return j(e);p=setTimeout(Z,function(e){var n=t-(e-d);return m?i(n,u-(e-h)):n}(e))}function j(e){return p=void 0,y&&s?b(e):(s=l=void 0,f)}function w(){var e=o(),n=g(e);if(s=arguments,l=this,d=e,n){if(void 0===p)return x(d);if(m)return clearTimeout(p),p=setTimeout(Z,t),b(d)}return void 0===p&&(p=setTimeout(Z,t)),f}return t=c(t)||0,r(n)&&(v=!!n.leading,u=(m="maxWait"in n)?a(c(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),w.cancel=function(){void 0!==p&&clearTimeout(p),h=0,s=d=l=p=void 0},w.flush=function(){return void 0===p?f:j(o())},w}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),o=n(13218),c=n(33448),a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(c(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=i.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},67742:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/webhooks",function(){return n(822)}])},822:function(e,t,n){"use strict";n.r(t);var r=n(47568),o=n(70655),c=n(85893),a=n(48689),i=n(84485),s=n(94199),l=n(20550),u=n(6226),f=n(32808),p=n(85402),d=n(69677),h=n(25968),v=n(71577),m=n(26713),y=n(10355),b=n(67294),x=n(58827),g=n(19411),Z=i.Z.Title,j=i.Z.Paragraph,w={CHAT:{name:"Chat messages",description:"When a user sends a chat message",color:"purple"},USER_JOINED:{name:"User joined",description:"When a user joins the chat",color:"green"},NAME_CHANGE:{name:"User name changed",description:"When a user changes their name",color:"blue"},"VISIBILITY-UPDATE":{name:"Message visibility changed",description:"When a message visibility changes, likely due to moderation",color:"red"},STREAM_STARTED:{name:"Stream started",description:"When a stream starts",color:"orange"},STREAM_STOPPED:{name:"Stream stopped",description:"When a stream stops",color:"cyan"}};var O=function(e){var t=e.onOk,n=e.onCancel,r=e.visible,o=(0,b.useState)([]),a=o[0],i=o[1],s=(0,b.useState)(""),l=s[0],m=s[1],y=Object.keys(w).map((function(e){return{value:e,label:w[e].description}})),x={disabled:0===(null===a||void 0===a?void 0:a.length)||!(0,g.Z)(l)},Z=y.map((function(e){return(0,c.jsx)(u.Z,{span:8,children:(0,c.jsx)(f.Z,{value:e.value,children:e.label})},e.value)}));return(0,c.jsxs)(p.Z,{title:"Create New Webhook",visible:r,onOk:function(){t(l,a),m(""),i(null)},onCancel:n,okButtonProps:x,children:[(0,c.jsx)("div",{children:(0,c.jsx)(d.Z,{value:l,placeholder:"https://myserver.com/webhook",onChange:function(e){return m(e.currentTarget.value.trim())},type:"url",pattern:g.a})}),(0,c.jsx)("p",{children:"Select the events that will be sent to this webhook."}),(0,c.jsx)(f.Z.Group,{style:{width:"100%"},value:a,onChange:function(e){i(e)},children:(0,c.jsx)(h.Z,{children:Z})}),(0,c.jsx)("p",{children:(0,c.jsx)(v.Z,{type:"primary",onClick:function(){i(Object.keys(w))},children:"Select all"})})]})};t.default=function(){var e=function(e){console.error("error",e)},t=(0,b.useState)([]),n=t[0],i=t[1],u=(0,b.useState)(!1),f=u[0],p=u[1];function d(){return h.apply(this,arguments)}function h(){return(h=(0,r.Z)((function(){var t,n;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,x.rQ)(x.XA)];case 1:return t=r.sent(),i(t),[3,3];case 2:return n=r.sent(),e(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function g(){return(g=(0,r.Z)((function(t){var n;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,x.rQ)(x.M_,{method:"POST",data:{id:t}})];case 1:return r.sent(),d(),[3,3];case 2:return n=r.sent(),e(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function C(){return(C=(0,r.Z)((function(t,r){var c,a;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,(0,x.rQ)(x.iG,{method:"POST",data:{url:t,events:r}})];case 1:return c=o.sent(),i(n.concat(c)),[3,3];case 2:return a=o.sent(),e(a),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}(0,b.useEffect)((function(){d()}),[]);var E=[{title:"",key:"delete",render:function(e,t){return(0,c.jsx)(m.Z,{size:"middle",children:(0,c.jsx)(v.Z,{onClick:function(){return function(e){return g.apply(this,arguments)}(t.id)},icon:(0,c.jsx)(a.Z,{})})})}},{title:"URL",dataIndex:"url",key:"url"},{title:"Events",dataIndex:"events",key:"events",render:function(e){return(0,c.jsx)(c.Fragment,{children:e.map((function(e){return function(e){if(!e||!w[e])return null;var t=w[e];return(0,c.jsx)(s.Z,{title:t.description,children:(0,c.jsx)(l.Z,{color:t.color,children:t.name})},e)}(e)}))})}}];return(0,c.jsxs)("div",{children:[(0,c.jsx)(Z,{children:"Webhooks"}),(0,c.jsx)(j,{children:"A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming."}),(0,c.jsxs)(j,{children:["Read more about how to use webhooks, with examples, at"," ",(0,c.jsx)("a",{href:"https://owncast.online/docs/integrations/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"our documentation"}),"."]}),(0,c.jsx)(y.Z,{rowKey:function(e){return e.id},columns:E,dataSource:n,pagination:!1}),(0,c.jsx)("br",{}),(0,c.jsx)(v.Z,{type:"primary",onClick:function(){p(!0)},children:"Create Webhook"}),(0,c.jsx)(O,{visible:f,onOk:function(e,t){p(!1),function(e,t){C.apply(this,arguments)}(e,t)},onCancel:function(){p(!1)}})]})}}},function(e){e.O(0,[8939,3903,3698,355,9774,2888,179],(function(){return t=67742,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1234],{48689:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(1413),o=n(67294),c={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},a=n(42135),i=function(e,t){return o.createElement(a.Z,(0,r.Z)((0,r.Z)({},e),{},{ref:t,icon:c}))};i.displayName="DeleteOutlined";var s=o.forwardRef(i)},6226:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(4942),o=n(87462),c=n(71002),a=n(94184),i=n.n(a),s=n(67294),l=n(53124),u=n(99134),f=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0){var I=m[0]/2;A.paddingLeft=I,A.paddingRight=I}if(m&&m[1]>0&&!b){var R=m[1]/2;A.paddingTop=R,A.paddingBottom=R}return k&&(A.flex=function(e){return"number"===typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(k),!1!==y||A.minWidth||(A.minWidth=0)),s.createElement("div",(0,o.Z)({},N,{style:(0,o.Z)((0,o.Z)({},A),P),className:T,ref:t}),E)}))},99134:function(e,t,n){"use strict";var r=(0,n(67294).createContext)({});t.Z=r},25968:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var r=n(87462),o=n(4942),c=n(71002),a=n(97685),i=n(94184),s=n.n(i),l=n(67294),u=n(53124),f=n(98082),p=n(24308),d=n(93355),h=n(99134),v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0?I[0]/-2:void 0,D=null!=I[1]&&I[1]>0?I[1]/-2:void 0;if(M&&(W.marginLeft=M,W.marginRight=M),_){var G=(0,a.Z)(I,2);W.rowGap=G[1]}else D&&(W.marginTop=D,W.marginBottom=D);var H=(0,a.Z)(I,2),$=H[0],B=H[1],U=l.useMemo((function(){return{gutter:[$,B],wrap:j,supportFlexGap:_}}),[$,B,j,_]);return l.createElement(h.Z.Provider,{value:U},l.createElement("div",(0,r.Z)({},w,{className:R,style:(0,r.Z)((0,r.Z)({},W),b),ref:t}),x))}))},20550:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r=n(4942),o=n(87462),c=n(97685),a=n(97937),i=n(94184),s=n.n(i),l=n(98423),u=n(67294),f=n(53124),p=n(98787),d=n(68349),h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=t||n<0||m&&e-h>=u}function Z(){var e=o();if(g(e))return j(e);p=setTimeout(Z,function(e){var n=t-(e-d);return m?i(n,u-(e-h)):n}(e))}function j(e){return p=void 0,y&&s?b(e):(s=l=void 0,f)}function w(){var e=o(),n=g(e);if(s=arguments,l=this,d=e,n){if(void 0===p)return x(d);if(m)return clearTimeout(p),p=setTimeout(Z,t),b(d)}return void 0===p&&(p=setTimeout(Z,t)),f}return t=c(t)||0,r(n)&&(v=!!n.leading,u=(m="maxWait"in n)?a(c(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),w.cancel=function(){void 0!==p&&clearTimeout(p),h=0,s=d=l=p=void 0},w.flush=function(){return void 0===p?f:j(o())},w}},33448:function(e,t,n){var r=n(44239),o=n(37005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},7771:function(e,t,n){var r=n(55639);e.exports=function(){return r.Date.now()}},14841:function(e,t,n){var r=n(27561),o=n(13218),c=n(33448),a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(c(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=i.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},67742:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/webhooks",function(){return n(822)}])},822:function(e,t,n){"use strict";n.r(t);var r=n(47568),o=n(70655),c=n(85893),a=n(48689),i=n(84485),s=n(94199),l=n(20550),u=n(6226),f=n(32808),p=n(85402),d=n(69677),h=n(25968),v=n(71577),m=n(26713),y=n(93626),b=n(67294),x=n(58827),g=n(19411),Z=i.Z.Title,j=i.Z.Paragraph,w={CHAT:{name:"Chat messages",description:"When a user sends a chat message",color:"purple"},USER_JOINED:{name:"User joined",description:"When a user joins the chat",color:"green"},NAME_CHANGE:{name:"User name changed",description:"When a user changes their name",color:"blue"},"VISIBILITY-UPDATE":{name:"Message visibility changed",description:"When a message visibility changes, likely due to moderation",color:"red"},STREAM_STARTED:{name:"Stream started",description:"When a stream starts",color:"orange"},STREAM_STOPPED:{name:"Stream stopped",description:"When a stream stops",color:"cyan"}};var O=function(e){var t=e.onOk,n=e.onCancel,r=e.visible,o=(0,b.useState)([]),a=o[0],i=o[1],s=(0,b.useState)(""),l=s[0],m=s[1],y=Object.keys(w).map((function(e){return{value:e,label:w[e].description}})),x={disabled:0===(null===a||void 0===a?void 0:a.length)||!(0,g.Z)(l)},Z=y.map((function(e){return(0,c.jsx)(u.Z,{span:8,children:(0,c.jsx)(f.Z,{value:e.value,children:e.label})},e.value)}));return(0,c.jsxs)(p.Z,{title:"Create New Webhook",visible:r,onOk:function(){t(l,a),m(""),i(null)},onCancel:n,okButtonProps:x,children:[(0,c.jsx)("div",{children:(0,c.jsx)(d.Z,{value:l,placeholder:"https://myserver.com/webhook",onChange:function(e){return m(e.currentTarget.value.trim())},type:"url",pattern:g.a})}),(0,c.jsx)("p",{children:"Select the events that will be sent to this webhook."}),(0,c.jsx)(f.Z.Group,{style:{width:"100%"},value:a,onChange:function(e){i(e)},children:(0,c.jsx)(h.Z,{children:Z})}),(0,c.jsx)("p",{children:(0,c.jsx)(v.Z,{type:"primary",onClick:function(){i(Object.keys(w))},children:"Select all"})})]})};t.default=function(){var e=function(e){console.error("error",e)},t=(0,b.useState)([]),n=t[0],i=t[1],u=(0,b.useState)(!1),f=u[0],p=u[1];function d(){return h.apply(this,arguments)}function h(){return(h=(0,r.Z)((function(){var t,n;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,x.rQ)(x.XA)];case 1:return t=r.sent(),i(t),[3,3];case 2:return n=r.sent(),e(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function g(){return(g=(0,r.Z)((function(t){var n;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,(0,x.rQ)(x.M_,{method:"POST",data:{id:t}})];case 1:return r.sent(),d(),[3,3];case 2:return n=r.sent(),e(n),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}function C(){return(C=(0,r.Z)((function(t,r){var c,a;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,(0,x.rQ)(x.iG,{method:"POST",data:{url:t,events:r}})];case 1:return c=o.sent(),i(n.concat(c)),[3,3];case 2:return a=o.sent(),e(a),[3,3];case 3:return[2]}}))}))).apply(this,arguments)}(0,b.useEffect)((function(){d()}),[]);var E=[{title:"",key:"delete",render:function(e,t){return(0,c.jsx)(m.Z,{size:"middle",children:(0,c.jsx)(v.Z,{onClick:function(){return function(e){return g.apply(this,arguments)}(t.id)},icon:(0,c.jsx)(a.Z,{})})})}},{title:"URL",dataIndex:"url",key:"url"},{title:"Events",dataIndex:"events",key:"events",render:function(e){return(0,c.jsx)(c.Fragment,{children:e.map((function(e){return function(e){if(!e||!w[e])return null;var t=w[e];return(0,c.jsx)(s.Z,{title:t.description,children:(0,c.jsx)(l.Z,{color:t.color,children:t.name})},e)}(e)}))})}}];return(0,c.jsxs)("div",{children:[(0,c.jsx)(Z,{children:"Webhooks"}),(0,c.jsx)(j,{children:"A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming."}),(0,c.jsxs)(j,{children:["Read more about how to use webhooks, with examples, at"," ",(0,c.jsx)("a",{href:"https://owncast.online/docs/integrations/?source=admin",target:"_blank",rel:"noopener noreferrer",children:"our documentation"}),"."]}),(0,c.jsx)(y.Z,{rowKey:function(e){return e.id},columns:E,dataSource:n,pagination:!1}),(0,c.jsx)("br",{}),(0,c.jsx)(v.Z,{type:"primary",onClick:function(){p(!0)},children:"Create Webhook"}),(0,c.jsx)(O,{visible:f,onOk:function(e,t){p(!1),function(e,t){C.apply(this,arguments)}(e,t)},onCancel:function(){p(!1)}})]})}}},function(e){e.O(0,[8939,3903,3698,3626,9774,2888,179],(function(){return t=67742,e(e.s=t);var t}));var t=e.O();_N_E=t}]); \ No newline at end of file diff --git a/static/web/_next/static/chunks/webpack-73a0b616e2c4289a.js b/static/web/_next/static/chunks/webpack-73a0b616e2c4289a.js new file mode 100644 index 000000000..4e7c5a2f5 --- /dev/null +++ b/static/web/_next/static/chunks/webpack-73a0b616e2c4289a.js @@ -0,0 +1 @@ +!function(){"use strict";var e={},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}},u=!0;try{e[r].call(i.exports,i,i.exports,n),u=!1}finally{u&&delete t[r]}return i.loaded=!0,i.exports}n.m=e,n.amdO={},function(){var e=[];n.O=function(t,r,o,i){if(!r){var u=1/0;for(d=0;d=i)&&Object.keys(n.O).every((function(e){return n.O[e](r[f])}))?r.splice(f--,1):(c=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[r,o,i]}}(),n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"===typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"===typeof r.then)return r}var i=Object.create(null);n.r(i);var u={};e=e||[null,t({}),t([]),t(t)];for(var c=2&o&&r;"object"==typeof c&&!~e.indexOf(c);c=t(c))Object.getOwnPropertyNames(c).forEach((function(e){u[e]=function(){return r[e]}}));return u.default=function(){return r},n.d(i,u),i}}(),n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,r){return n.f[r](e,t),t}),[]))},n.u=function(e){return 8939===e?"static/chunks/8939-b1631aef52fbaa8f.js":3903===e?"static/chunks/3903-bdaee0333fdb7201.js":3698===e?"static/chunks/3698-35a1751ec66f28c7.js":3626===e?"static/chunks/3626-ffcb249be5918774.js":8091===e?"static/chunks/8091-d7457a988f3f1d54.js":2944===e?"static/chunks/2944-6793cb651dad1c89.js":"static/chunks/"+e+"."+{786:"4acfb7a7ae4e2dbe",1300:"4b32175d5676e8df",2365:"1fdb4082fa6c06b8",5135:"53533171eca4a3fd",7373:"434a6b2e473e7b0b",7610:"95543cd3023fceae",7735:"d76060cd6e9f5115",7741:"bf7d3bd533d1fccb",7781:"c2410185d16b1336",8225:"4dd26c9f3db1b3d0",9674:"3b07138ac351a119"}[e]+".js"},n.miniCssF=function(e){return"static/css/"+{955:"094c475c62728b4d",1681:"7c735c05af084bb2",2365:"19d74602c45ee60b",2888:"e5e891bf9996e5d0",3126:"8283b6095a0a048a",5135:"edb3f793b986286c",5405:"07e0886dce1d8889",7373:"3b9d9d2670048e8a",7735:"ffd83995160971e6",7781:"b92b45b3f2e03f44",8399:"d2120b8ad68b9567",9674:"ed28f196ebbc4ea9",9839:"1f5ee95fffd43a71"}[e]+".css"},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="_N_E:";n.l=function(r,o,i,u){if(e[r])e[r].push(o);else{var c,f;if(void 0!==i)for(var a=document.getElementsByTagName("script"),d=0;d=i)&&Object.keys(n.O).every((function(e){return n.O[e](r[f])}))?r.splice(f--,1):(c=!1,i0&&e[d-1][2]>i;d--)e[d]=e[d-1];e[d]=[r,o,i]}}(),n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"===typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"===typeof r.then)return r}var i=Object.create(null);n.r(i);var u={};e=e||[null,t({}),t([]),t(t)];for(var c=2&o&&r;"object"==typeof c&&!~e.indexOf(c);c=t(c))Object.getOwnPropertyNames(c).forEach((function(e){u[e]=function(){return r[e]}}));return u.default=function(){return r},n.d(i,u),i}}(),n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=function(e){return Promise.all(Object.keys(n.f).reduce((function(t,r){return n.f[r](e,t),t}),[]))},n.u=function(e){return 8939===e?"static/chunks/8939-b1631aef52fbaa8f.js":3903===e?"static/chunks/3903-bdaee0333fdb7201.js":3698===e?"static/chunks/3698-35a1751ec66f28c7.js":355===e?"static/chunks/355-bd89fb21c9e9d2de.js":8091===e?"static/chunks/8091-d7457a988f3f1d54.js":2944===e?"static/chunks/2944-6793cb651dad1c89.js":"static/chunks/"+e+"."+{786:"4acfb7a7ae4e2dbe",1300:"4b32175d5676e8df",2365:"1fdb4082fa6c06b8",5135:"53533171eca4a3fd",7373:"434a6b2e473e7b0b",7610:"95543cd3023fceae",7735:"d76060cd6e9f5115",7741:"bf7d3bd533d1fccb",7781:"2553454a5caad033",8225:"4dd26c9f3db1b3d0",9674:"3b07138ac351a119"}[e]+".js"},n.miniCssF=function(e){return"static/css/"+{955:"094c475c62728b4d",1681:"7c735c05af084bb2",2365:"19d74602c45ee60b",2888:"e5e891bf9996e5d0",3126:"8283b6095a0a048a",5135:"edb3f793b986286c",5405:"07e0886dce1d8889",7373:"3b9d9d2670048e8a",7735:"ffd83995160971e6",7781:"b92b45b3f2e03f44",8399:"d2120b8ad68b9567",9674:"ed28f196ebbc4ea9",9839:"1f5ee95fffd43a71"}[e]+".css"},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="_N_E:";n.l=function(r,o,i,u){if(e[r])e[r].push(o);else{var c,f;if(void 0!==i)for(var a=document.getElementsByTagName("script"),d=0;dOwncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Access Tokens

Access tokens are used to allow external, 3rd party tools to perform specific actions on your Owncast server. They should be kept secure and never included in client code, instead they should be kept on a server that you control.
Read more about how to use these tokens, with examples, at our documentation.
NameTokenScopesLast Used
No Data

\ No newline at end of file diff --git a/static/web/admin/actions/index.html b/static/web/admin/actions/index.html index 476f07395..546e76dbd 100644 --- a/static/web/admin/actions/index.html +++ b/static/web/admin/actions/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

External Actions

External action URLs are 3rd party UI you can display, embedded, into your Owncast page when a user clicks on a button to launch your action.
Read more about how to use actions, with examples, at our documentation.
NameDescriptionURLIconColorOpens
No Data

\ No newline at end of file diff --git a/static/web/admin/chat/messages/index.html b/static/web/admin/chat/messages/index.html index 7671789e9..1e3840ccb 100644 --- a/static/web/admin/chat/messages/index.html +++ b/static/web/admin/chat/messages/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Chat Messages

Manage the messages from viewers that show up on your stream.

Check multiple messages to change their visibility to:
Time
User
Message
No Data
\ No newline at end of file diff --git a/static/web/admin/chat/users/index.html b/static/web/admin/chat/users/index.html index d71fdf1d3..d13afa173 100644 --- a/static/web/admin/chat/users/index.html +++ b/static/web/admin/chat/users/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

When a stream is active and chat is enabled, connected chat clients will be displayed here.

\ No newline at end of file diff --git a/static/web/admin/config-chat/index.html b/static/web/admin/config-chat/index.html index 39c49b914..b182eba1d 100644 --- a/static/web/admin/config-chat/index.html +++ b/static/web/admin/config-chat/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/config-federation/index.html b/static/web/admin/config-federation/index.html index 218d75064..068e524e0 100644 --- a/static/web/admin/config-federation/index.html +++ b/static/web/admin/config-federation/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/config-notify/index.html b/static/web/admin/config-notify/index.html index 13a6791f8..b0ffb2c57 100644 --- a/static/web/admin/config-notify/index.html +++ b/static/web/admin/config-notify/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Notifications

Let your viewers know when you go live by supporting any of the below notification channels. Learn more about live notifications.


The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

Browser Alerts

Viewers can opt into being notified when you go live with their browser.

Not all browsers support this.

Enable browser notifications

The text to send when you go live.

Twitter

Let your Twitter followers know each time you go live.

Enable Twitter

The text to send when you go live.

Discord

Let your Discord channel know each time you go live.

Create a webhook under Edit Channel / Integrations on your Discord channel and provide it below.

Enable Discord

The webhook assigned to your channel.

The text to send when you go live.

Fediverse Social

Enabling the Fediverse social features will not just alert people to when you go live, but also enable other functionality.

Fediverse social features: Disabled

Configure

Custom

Build your own notifications by using custom webhooks.

Create
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Notifications

Let your viewers know when you go live by supporting any of the below notification channels. Learn more about live notifications.


The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

The full url to your Owncast server is required to enable social features. Must use SSL (https). Once people start following your instance you should not change this.

Browser Alerts

Viewers can opt into being notified when you go live with their browser.

Not all browsers support this.

Enable browser notifications

The text to send when you go live.

Twitter

Let your Twitter followers know each time you go live.

Enable Twitter

The text to send when you go live.

Discord

Let your Discord channel know each time you go live.

Create a webhook under Edit Channel / Integrations on your Discord channel and provide it below.

Enable Discord

The webhook assigned to your channel.

The text to send when you go live.

Fediverse Social

Enabling the Fediverse social features will not just alert people to when you go live, but also enable other functionality.

Fediverse social features: Disabled

Configure

Custom

Build your own notifications by using custom webhooks.

Create
\ No newline at end of file diff --git a/static/web/admin/config-public-details/index.html b/static/web/admin/config-public-details/index.html index 9681487c5..a8255a24d 100644 --- a/static/web/admin/config-public-details/index.html +++ b/static/web/admin/config-public-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


Customize your page styling with CSS

Customize the look and feel of your Owncast instance by overriding the CSS styles of various components on the page. Refer to the CSS & Components guide.

Please input plain CSS text, as this will be directly injected onto your page during load.


\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

General Settings

The following are displayed on your site to describe your stream and its content. Learn more.

Custom Page Content

Edit the content of your page by using simple Markdown syntax.


Customize your page styling with CSS

Customize the look and feel of your Owncast instance by overriding the CSS styles of various components on the page. Refer to the CSS & Components guide.

Please input plain CSS text, as this will be directly injected onto your page during load.


\ No newline at end of file diff --git a/static/web/admin/config-server-details/index.html b/static/web/admin/config-server-details/index.html index f53f98872..f5c9e7b85 100644 --- a/static/web/admin/config-server-details/index.html +++ b/static/web/admin/config-server-details/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Server Settings

You should change your stream key from the default and keep it safe. For most people it's likely the other settings will not need to be changed.

\ No newline at end of file diff --git a/static/web/admin/config-social-items/index.html b/static/web/admin/config-social-items/index.html index 33b47f589..b71a3a8a2 100644 --- a/static/web/admin/config-social-items/index.html +++ b/static/web/admin/config-social-items/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Social Items

\ No newline at end of file diff --git a/static/web/admin/config-storage/index.html b/static/web/admin/config-storage/index.html index c444a062f..8ac07eb86 100644 --- a/static/web/admin/config-storage/index.html +++ b/static/web/admin/config-storage/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Storage

Owncast supports optionally using external storage providers to stream your video. Learn more about this by visiting our Storage Documentation.

Configuring this incorrectly will likely cause your video to be unplayable. Double check the documentation for your storage provider on how to configure the bucket you created for Owncast.

Keep in mind this is for live streaming, not for archival, recording or VOD purposes.

\ No newline at end of file diff --git a/static/web/admin/config-video/index.html b/static/web/admin/config-video/index.html index e39467b2b..50d485091 100644 --- a/static/web/admin/config-video/index.html +++ b/static/web/admin/config-video/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Video configuration

Before changing your video configuration visit the video documentation to learn how it impacts your stream performance. The general rule is to start conservatively by having one middle quality stream output variant and experiment with adding more of varied qualities.

Stream output

NameVideo bitrateCPU Usage
No name800 kbpsMedium

Latency Buffer

While it's natural to want to keep your latency as low as possible, you may experience reduced error tolerance and stability the lower you go. The lowest setting is not recommended.

For interactive live streams you may want to experiment with a lower latency, for non-interactive broadcasts you may want to increase it. Read to learn more.

LowestHighest

\ No newline at end of file diff --git a/static/web/admin/federation/actions/index.html b/static/web/admin/federation/actions/index.html index 94e989ab8..0082bf0ef 100644 --- a/static/web/admin/federation/actions/index.html +++ b/static/web/admin/federation/actions/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Fediverse Actions

Below is a list of actions that were taken by others in response to your posts as well as people who requested to follow you.
ActionFromWhen
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Fediverse Actions

Below is a list of actions that were taken by others in response to your posts as well as people who requested to follow you.
ActionFromWhen
No Data
\ No newline at end of file diff --git a/static/web/admin/federation/followers/index.html b/static/web/admin/federation/followers/index.html index f18cdc3b0..a789a7854 100644 --- a/static/web/admin/federation/followers/index.html +++ b/static/web/admin/federation/followers/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

The following accounts get notified when you go live or send a post.

NameURL
Added
Remove
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

The following accounts get notified when you go live or send a post.

NameURL
Added
Remove
No Data
\ No newline at end of file diff --git a/static/web/admin/hardware-info/index.html b/static/web/admin/hardware-info/index.html index 56ccbada1..b8ce7b9fe 100644 --- a/static/web/admin/hardware-info/index.html +++ b/static/web/admin/hardware-info/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


CPU
0%
Memory
0%
Disk
0%
Loading...
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Hardware Info


CPU
0%
Memory
0%
Disk
0%
Loading...
\ No newline at end of file diff --git a/static/web/admin/help/index.html b/static/web/admin/help/index.html index f413156c4..a4904654e 100644 --- a/static/web/admin/help/index.html +++ b/static/web/admin/help/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

How can we help you?

Troubleshooting

Fix your problems

Documentation

Read the Docs

Common tasks

I want to configure my owncast instance
Help configuring my broadcasting software
I want to embed my stream into another site
I want to customize my website
I want to tweak my video output
I want to use an external storage provider

Other

I found a bug
If you found a bug, then please let us know
I have a general question
Most general questions are answered in our FAQ or exist in our discussions
I want to build add-ons for Owncast
You can build your own bots, overlays, tools and add-ons with our developer APIs. 
\ No newline at end of file diff --git a/static/web/admin/index.html b/static/web/admin/index.html index 9456100df..3595ee3b6 100644 --- a/static/web/admin/index.html +++ b/static/web/admin/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
fediverse
Add your Owncast instance to the Fediverse
Enable Owncast social features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream.

News & Updates from Owncast

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

No stream is active

You should start one.

Use your broadcasting software
Chat is disabled
Chat will continue to be disabled until you begin a live stream.
Find an audience on the Owncast Directory
List yourself in the Owncast Directory and show off your stream. Enable it in settings.
fediverse
Add your Owncast instance to the Fediverse
Enable Owncast social features to have your instance join the Fediverse, allowing people to follow, share and engage with your live stream.

News & Updates from Owncast

\ No newline at end of file diff --git a/static/web/admin/logs/index.html b/static/web/admin/logs/index.html index 1cf384fb1..b2b9ad5a0 100644 --- a/static/web/admin/logs/index.html +++ b/static/web/admin/logs/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline
\ No newline at end of file diff --git a/static/web/admin/stream-health/index.html b/static/web/admin/stream-health/index.html index 935530d0b..56ed5811f 100644 --- a/static/web/admin/stream-health/index.html +++ b/static/web/admin/stream-health/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Stream Performance

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Stream Performance

\ No newline at end of file diff --git a/static/web/admin/upgrade/index.html b/static/web/admin/upgrade/index.html index 20b812d30..f11e17a98 100644 --- a/static/web/admin/upgrade/index.html +++ b/static/web/admin/upgrade/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Thu Jan 01 1970

Downloads

NameSize
No Data
\ No newline at end of file diff --git a/static/web/admin/viewer-info/index.html b/static/web/admin/viewer-info/index.html index 5e6645e43..4da67a19a 100644 --- a/static/web/admin/viewer-info/index.html +++ b/static/web/admin/viewer-info/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Viewer Info


Max viewers last stream
0
All-time max viewers
0
User AgentLocation
Watch Time
No Data
\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Viewer Info


Max viewers last stream
0
All-time max viewers
0
User AgentLocation
Watch Time
No Data
\ No newline at end of file diff --git a/static/web/admin/webhooks/index.html b/static/web/admin/webhooks/index.html index af6e881b3..215617fe5 100644 --- a/static/web/admin/webhooks/index.html +++ b/static/web/admin/webhooks/index.html @@ -1 +1 @@ -Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No Data

\ No newline at end of file +Owncast Admin

What is your stream about today?

What is your stream about today?
Offline

Webhooks

A webhook is a callback made to an external API in response to an event that takes place within Owncast. This can be used to build chat bots or sending automatic notifications that you've started streaming.
Read more about how to use webhooks, with examples, at our documentation.
URLEvents
No Data

\ No newline at end of file diff --git a/static/web/embed/chat/readonly/index.html b/static/web/embed/chat/readonly/index.html index b2a0bf726..169ce90cd 100644 --- a/static/web/embed/chat/readonly/index.html +++ b/static/web/embed/chat/readonly/index.html @@ -1 +1 @@ -
\ No newline at end of file +
\ No newline at end of file diff --git a/static/web/embed/chat/readwrite/index.html b/static/web/embed/chat/readwrite/index.html index c4cdf3648..7116aedb4 100644 --- a/static/web/embed/chat/readwrite/index.html +++ b/static/web/embed/chat/readwrite/index.html @@ -1 +1 @@ -

Chat message goes here...

\ No newline at end of file +

Chat message goes here...

\ No newline at end of file diff --git a/static/web/embed/video/index.html b/static/web/embed/video/index.html index c3010b240..b8fa31e38 100644 --- a/static/web/embed/video/index.html +++ b/static/web/embed/video/index.html @@ -1 +1 @@ -
Stream is offline text goes here.
Offline
\ No newline at end of file +
Stream is offline text goes here.
Offline
\ No newline at end of file diff --git a/static/web/index.html b/static/web/index.html index aa4031669..162b1658f 100644 --- a/static/web/index.html +++ b/static/web/index.html @@ -1,4 +1,4 @@
Chat offline
Offline
Logo
Preview
\ No newline at end of file +
Chat offline
Offline
Logo
Preview
\ No newline at end of file