Take control over your live stream video by running it yourself. Streaming + chat out of the box.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

2 lines
11 KiB

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6109],{11382:function(e,t,n){"use strict";var r=n(87462),a=n(4942),i=n(97685),s=n(94184),l=n.n(s),o=n(23279),c=n.n(o),u=n(98423),d=n(67294),f=n(53124),m=n(96159),p=n(93355),y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)0>t.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n};(0,p.b)("small","default","large");var x=null,v=function(e){var t=e.spinPrefixCls,n=e.spinning,s=void 0===n||n,o=e.delay,p=e.className,v=e.size,h=void 0===v?"default":v,g=e.tip,Z=e.wrapperClassName,w=e.style,j=e.children,N=y(e,["spinPrefixCls","spinning","delay","className","size","tip","wrapperClassName","style","children"]),b=d.useState(function(){return s&&(!s||!o||!!isNaN(Number(o)))}),E=(0,i.Z)(b,2),D=E[0],S=E[1];return d.useEffect(function(){var e=c()(function(){S(s)},o);return e(),function(){var t;null===(t=null==e?void 0:e.cancel)||void 0===t||t.call(e)}},[o,s]),d.createElement(f.C,null,function(n){var i,s,o,c=n.direction,f=l()(t,(o={},(0,a.Z)(o,"".concat(t,"-sm"),"small"===h),(0,a.Z)(o,"".concat(t,"-lg"),"large"===h),(0,a.Z)(o,"".concat(t,"-spinning"),D),(0,a.Z)(o,"".concat(t,"-show-text"),!!g),(0,a.Z)(o,"".concat(t,"-rtl"),"rtl"===c),o),p),y=(0,u.Z)(N,["indicator","prefixCls"]),v=d.createElement("div",(0,r.Z)({},y,{style:w,className:f,"aria-live":"polite","aria-busy":D}),(i=e.indicator,s="".concat(t,"-dot"),null===i?null:(0,m.l$)(i)?(0,m.Tm)(i,{className:l()(i.props.className,s)}):(0,m.l$)(x)?(0,m.Tm)(x,{className:l()(x.props.className,s)}):d.createElement("span",{className:l()(s,"".concat(t,"-dot-spin"))},d.createElement("i",{className:"".concat(t,"-dot-item")}),d.createElement("i",{className:"".concat(t,"-dot-item")}),d.createElement("i",{className:"".concat(t,"-dot-item")}),d.createElement("i",{className:"".concat(t,"-dot-item")}))),g?d.createElement("div",{className:"".concat(t,"-text")},g):null);if(void 0!==j){var b=l()("".concat(t,"-container"),(0,a.Z)({},"".concat(t,"-blur"),D));return d.createElement("div",(0,r.Z)({},y,{className:l()("".concat(t,"-nested-loading"),Z)}),D&&d.createElement("div",{key:"loading"},v),d.createElement("div",{className:b,key:"container"},j))}return v})},h=function(e){var t=e.prefixCls,n=(0,d.useContext(f.E_).getPrefixCls)("spin",t),a=(0,r.Z)((0,r.Z)({},e),{spinPrefixCls:n});return d.createElement(v,(0,r.Z)({},a))};h.setDefaultIndicator=function(e){x=e},t.Z=h},77349:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(83946),a=n(19013),i=n(13882);function s(e,t){(0,i.Z)(2,arguments);var n=(0,a.Z)(e),s=(0,r.Z)(t);return isNaN(s)?new Date(NaN):(s&&n.setDate(n.getDate()+s),n)}},11640:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r=n(83946),a=n(19013),i=n(13882);function s(e,t){(0,i.Z)(2,arguments);var n=(0,a.Z)(e),s=(0,r.Z)(t);if(isNaN(s))return new Date(NaN);if(!s)return n;var l=n.getDate(),o=new Date(n.getTime());return(o.setMonth(n.getMonth()+s+1,0),l>=o.getDate())?o:(n.setFullYear(o.getFullYear(),o.getMonth(),l),n)}},23279:function(e,t,n){var r=n(13218),a=n(7771),i=n(14841),s=Math.max,l=Math.min;e.exports=function(e,t,n){var o,c,u,d,f,m,p=0,y=!1,x=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function h(t){var n=o,r=c;return o=c=void 0,p=t,d=e.apply(r,n)}function g(e){var n=e-m,r=e-p;return void 0===m||n>=t||n<0||x&&r>=u}function Z(){var e,n,r,i=a();if(g(i))return w(i);f=setTimeout(Z,(e=i-m,n=i-p,r=t-e,x?l(r,u-n):r))}function w(e){return(f=void 0,v&&o)?h(e):(o=c=void 0,d)}function j(){var e,n=a(),r=g(n);if(o=arguments,c=this,m=n,r){if(void 0===f)return p=e=m,f=setTimeout(Z,t),y?h(e):d;if(x)return clearTimeout(f),f=setTimeout(Z,t),h(m)}return void 0===f&&(f=setTimeout(Z,t)),d}return t=i(t)||0,r(n)&&(y=!!n.leading,u=(x="maxWait"in n)?s(i(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),j.cancel=function(){void 0!==f&&clearTimeout(f),p=0,o=m=c=f=void 0},j.flush=function(){return void 0===f?d:w(a())},j}},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(25715)}])},36435:function(e,t,n){"use strict";n.d(t,{k:function(){return u}});var r=n(85893),a=n(9085),i=n(92616),s=n.n(i),l=n(58091),o=n(60727);function c(e){let t={};return e.forEach(e=>{let n=new Date(e.time),r=(0,l.Z)(n,"H:mma");t[r]=e.value}),t}s().use(a.ZP);let u=e=>{let{data:t,title:n,color:a,unit:i,dataCollections:s,yFlipped:l,yLogarithmic:u}=e,d=[];t&&t.length>0&&d.push({name:n,color:a,data:c(t)}),s.forEach(e=>{d.push({name:e.name,data:c(e.data),color:e.color,dataset:e.options})});let f={scales:{y:{reverse:!1,type:"linear"},x:{type:"time"}}};return f.scales.y.reverse=l,f.scales.y.type=u?"logarithmic":"linear",(0,r.jsx)("div",{className:"line-chart-container",children:(0,r.jsx)(o.wW,{xtitle:"Time",ytitle:n,suffix:i,legend:"bottom",color:a,data:d,download:n,library:f})})};u.defaultProps={dataCollections:[],data:[],title:"",yFlipped:!1,yLogarithmic:!1}},23589:function(e,t,n){"use strict";n.d(t,{m:function(){return m}});var r=n(85893),a=n(85818),i=n(97910),s=n(74763),l=n(59652);let{Text:o}=a.Z,c={title:"",value:0,prefix:null,suffix:null,color:"",progress:!1,centered:!1,formatter:null},u=e=>{let{prefix:t,value:n,suffix:a,title:i}=e;return(0,r.jsxs)("div",{children:[t,(0,r.jsx)("div",{children:(0,r.jsx)(o,{type:"secondary",children:i})}),(0,r.jsx)("div",{children:(0,r.jsxs)(o,{type:"secondary",children:[n,a||"%"]})})]})},d=e=>{let{title:t,value:n,prefix:a,suffix:s,color:l}=e,o=(0,r.jsx)(u,{prefix:a,value:n,suffix:s,title:t});return(0,r.jsx)(i.Z,{type:"dashboard",percent:n,width:120,strokeColor:{"0%":l,"90%":n>90?"red":l},format:()=>o})};d.defaultProps=c;let f=e=>{let{title:t,value:n,prefix:a,formatter:i}=e;return(0,r.jsx)(s.Z,{title:t,value:n,prefix:a,formatter:i})};f.defaultProps=c;let m=e=>{let{progress:t,centered:n}=e,a=t?d:f;return(0,r.jsx)(l.Z,{type:"inner",children:(0,r.jsx)("div",{style:n?{display:"flex",alignItems:"center",justifyContent:"center"}:{},children:(0,r.jsx)(a,{...e})})})};m.defaultProps=c},25715:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return _}});var r=n(85893),a=n(67294),i=n(66516),s=n(85818),l=n(71230),o=n(15746),c=n(14670),u=n(11382),d=n(13013),f=n(77349),m=n(13882),p=n(83946),y=n(11640);function x(e){return(x="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})(e)}function v(e,t){if((0,m.Z)(2,arguments),!t||"object"!==x(t))return new Date(NaN);var n=t.years?(0,p.Z)(t.years):0,r=t.months?(0,p.Z)(t.months):0,a=t.weeks?(0,p.Z)(t.weeks):0,i=t.days?(0,p.Z)(t.days):0,s=t.hours?(0,p.Z)(t.hours):0,l=t.minutes?(0,p.Z)(t.minutes):0,o=t.seconds?(0,p.Z)(t.seconds):0,c=function(e,t){(0,m.Z)(2,arguments);var n=(0,p.Z)(t);return(0,f.Z)(e,-n)}(function(e,t){(0,m.Z)(2,arguments);var n=(0,p.Z)(t);return(0,y.Z)(e,-n)}(e,r+12*n),i+7*a);return new Date(c.getTime()-1e3*(o+60*(l+60*s)))}var h=n(19013),g=n(5152),Z=n.n(g),w=n(36435),j=n(23589),N=n(54398),b=n(45938),E=n(70241);let D=e=>{let{data:t}=e;return(0,r.jsx)(N.Z,{pagination:{hideOnSinglePage:!0},className:"table-container",columns:[{title:"User Agent",dataIndex:"userAgent",key:"userAgent",render:e=>(0,E.AB)(e)},{title:"Location",dataIndex:"geo",key:"geo",render:e=>e?"".concat(e.regionName,", ").concat(e.countryCode):"-"},{title:"Watch Time",dataIndex:"firstSeen",key:"firstSeen",defaultSortOrder:"ascend",render:e=>(0,b.Z)(new Date(e)),sorter:(e,t)=>new Date(e.firstSeen).getTime()-new Date(t.firstSeen).getTime(),sortDirections:["descend","ascend"]}],dataSource:t,size:"small",rowKey:"id"})};var S=n(99519),C=n(64777),k=n(6960);let T=Z()(()=>Promise.all([n.e(2074),n.e(5085)]).then(n.t.bind(n,5085,23)),{loadableGenerated:{webpack:()=>[5085]},ssr:!1}),P=Z()(()=>Promise.all([n.e(2074),n.e(5412)]).then(n.t.bind(n,95412,23)),{loadableGenerated:{webpack:()=>[95412]},ssr:!1});function _(){let e;let t=(0,a.useContext)(S.aC),{online:n,broadcaster:f,viewerCount:p,overallPeakViewerCount:y,sessionPeakViewerCount:x}=t||{};f&&f.time&&(e=new Date(f.time));let g=[{title:"Current stream",start:e},{title:"Last 12 hours",start:v(new Date,{hours:12})},{title:"Last 24 hours",start:v(new Date,{hours:24})},{title:"Last 7 days",start:v(new Date,{days:7})},{title:"Last 30 days",start:v(new Date,{days:30})},{title:"Last 3 months",start:v(new Date,{months:3})},{title:"Last 6 months",start:v(new Date,{months:6})}],[Z,N]=(0,a.useState)(!0),[b,E]=(0,a.useState)([]),[k,_]=(0,a.useState)([]),[O,I]=(0,a.useState)(g[1]),L=async()=>{try{let e="".concat(C.iV,"?windowStart=").concat(function(e){return(0,m.Z)(1,arguments),Math.floor(function(e){return(0,m.Z)(1,arguments),(0,h.Z)(e).getTime()}(e)/1e3)}(O.start)),t=await (0,C.rQ)(e);E(t),N(!1)}catch(e){console.log("==== error",e)}try{let e=await (0,C.rQ)(C.a_);_(e)}catch(e){console.log("==== error",e)}};(0,a.useEffect)(()=>{let e=null;return(L(),n)?(e=setInterval(L,6e4),()=>{clearInterval(e)}):()=>[]},[n,O]);let M=e=>{let{key:t}=e;I(g[t])},A=(0,r.jsxs)(i.Z,{children:[n&&e&&(0,r.jsx)(i.Z.Item,{onClick:M,children:g[0].title},"0"),g.slice(1).map((e,t)=>(0,r.jsx)(i.Z.Item,{onClick:M,children:e.title},t+1))]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Z.Title,{children:"Viewer Info"}),(0,r.jsx)("br",{}),(0,r.jsxs)(l.Z,{gutter:[16,16],justify:"space-around",children:[n&&(0,r.jsx)(o.Z,{span:8,md:8,children:(0,r.jsx)(j.m,{title:"Current viewers",value:p.toString(),prefix:(0,r.jsx)(P,{})})}),(0,r.jsx)(o.Z,{md:n?8:12,children:(0,r.jsx)(j.m,{title:n?"Max viewers this stream":"Max viewers last stream",value:x.toString(),prefix:(0,r.jsx)(P,{})})}),(0,r.jsx)(o.Z,{md:n?8:12,children:(0,r.jsx)(j.m,{title:"All-time max viewers",value:y.toString(),prefix:(0,r.jsx)(P,{})})})]}),!b.length&&(0,r.jsx)(c.Z,{style:{marginTop:"10px"},banner:!0,message:"Please wait",description:"No viewer data has been collected yet.",type:"info"}),(0,r.jsxs)(u.Z,{spinning:!b.length||Z,children:[(0,r.jsx)(d.Z,{overlay:A,trigger:["click"],children:(0,r.jsxs)("button",{type:"button",style:{float:"right",background:"transparent",border:"unset"},children:[O.title," ",(0,r.jsx)(T,{})]})}),b.length>0&&(0,r.jsx)(w.k,{title:"Viewers",data:b,color:"#2087E2",unit:""}),(0,r.jsx)(D,{data:k})]})]})}_.getLayout=function(e){return(0,r.jsx)(k.l,{page:e})}}},function(e){e.O(0,[2196,173,164,2138,31,4931,5402,2231,492,5818,7524,9915,6386,3698,3013,4398,8091,4381,5938,5101,7910,4763,450,710,6960,9774,2888,179],function(){return e(e.s=92794)}),_N_E=e.O()}]);
//# sourceMappingURL=viewer-info-d62b903227711fbb.js.map