Files
owncast/static/web/_next/static/chunks/pages/embed/video-d7b5f3ed57c55e2b.js
2023-05-02 02:50:21 +00:00

1 line
14 KiB
JavaScript
Vendored

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3126,4114],{2350:function(){},61357:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/embed/video",function(){return n(24813)}])},21756:function(e,t,n){"use strict";n.d(t,{Q:function(){return o}});var s=n(85893),r=n(4480),i=n(44974);let o=()=>{let e=(0,r.sJ)(i.g1),{appearanceVariables:t,customStyles:n}=e,o=Object.keys(t).filter(e=>!!t[e]).map(e=>"--".concat(e,": ").concat(t[e]));return(0,s.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n :root {\n ".concat(o.join(";\n"),"\n }\n ").concat(n,"\n ")}})}},74681:function(e,t,n){"use strict";n.d(t,{R:function(){return f}});var s=n(85893),r=n(27049),i=n(45938),o=n(5152),a=n.n(o),c=n(94184),l=n.n(c),u=n(40158),d=n.n(u);let h=a()(()=>Promise.all([n.e(2074),n.e(9095)]).then(n.t.bind(n,69095,23)),{loadableGenerated:{webpack:()=>[69095]},ssr:!1}),f=e=>{let t,{streamName:n,customText:o,lastLive:a,notificationsEnabled:c,fediverseAccount:u,showsHeader:f=!0,onNotifyClick:_,onFollowClick:p,className:m}=e;return t=o||(!o&&c&&u?(0,s.jsxs)("span",{children:["This stream is offline. You can"," ",(0,s.jsx)("span",{role:"link",tabIndex:0,className:d().actionLink,onClick:_,children:"be notified"})," ","the next time ",n," goes live or"," ",(0,s.jsx)("span",{role:"link",tabIndex:0,className:d().actionLink,onClick:p,children:"follow"})," ",u," on the Fediverse."]}):!o&&c?(0,s.jsxs)("span",{children:["This stream is offline."," ",(0,s.jsx)("span",{role:"link",tabIndex:0,className:d().actionLink,onClick:_,children:"Be notified"})," ","the next time ",n," goes live."]}):!o&&u?(0,s.jsxs)("span",{children:["This stream is offline."," ",(0,s.jsx)("span",{role:"link",tabIndex:0,className:d().actionLink,onClick:p,children:"Follow"})," ",u," on the Fediverse to see the next time ",n," goes live."]}):"This stream is offline. Check back soon!"),(0,s.jsx)("div",{id:"offline-banner",className:l()(d().outerContainer,m),children:(0,s.jsxs)("div",{className:d().innerContainer,children:[f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:d().header,children:n}),(0,s.jsx)(r.Z,{className:d().separator})]}),o?(0,s.jsx)("div",{className:d().bodyText,dangerouslySetInnerHTML:{__html:t}}):(0,s.jsx)("div",{className:d().bodyText,children:t}),a&&(0,s.jsxs)("div",{className:d().lastLiveDate,children:[(0,s.jsx)(h,{className:d().clockIcon}),"Last live ".concat((0,i.Z)(new Date(a))," ago.")]})]})})}},48831:function(e,t,n){"use strict";n.d(t,{X:function(){return p}});var s=n(85893),r=n(45938),i=n(68730),o=n(67294),a=n(5152),c=n.n(a),l=n(94184),u=n.n(l),d=n(29485),h=n.n(d),f=n(63516);let _=c()(()=>Promise.all([n.e(2074),n.e(1965)]).then(n.t.bind(n,41965,23)),{loadableGenerated:{webpack:()=>[41965]},ssr:!1}),p=e=>{let t,{online:n,lastConnectTime:a,lastDisconnectTime:c,viewerCount:l,className:d}=e,[,p]=(0,o.useState)(new Date);(0,o.useEffect)(()=>{let e=setInterval(()=>p(new Date),1e3);return()=>{clearInterval(e)}},[]);let m="";if(n&&a){let e=function(e){let t="hour",n="minute",s=(0,i.Z)({start:e,end:new Date});return s.days>=1?"".concat(s.days," ").concat((0,f._6)("day",s.days),"\n ").concat(s.hours," ").concat((0,f._6)(t,s.hours)):s.hours>=1?"".concat(s.hours," ").concat((0,f._6)(t,s.hours)," ").concat(s.minutes,"\n ").concat((0,f._6)(n,s.minutes)):"".concat(s.minutes," ").concat((0,f._6)(n,s.minutes),"\n ").concat(s.seconds," ").concat((0,f._6)("second",s.seconds))}(new Date(a));m=n?"Live for ".concat(e):"Offline",t=l>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:h().viewerIcon,children:(0,s.jsx)(_,{})}),(0,s.jsx)("span",{children:" ".concat(l)})]})}else!n&&(m="Offline",c&&(t="Last live ".concat((0,r.Z)(new Date(c))," ago.")));return(0,s.jsxs)("div",{className:u()(h().statusbar,d),role:"status",children:[(0,s.jsx)("span",{className:h().onlineMessage,children:m}),(0,s.jsx)("span",{className:h().viewerCount,children:t})]})};p.defaultProps={lastConnectTime:null,lastDisconnectTime:null}},69578:function(e,t,n){var s=n(34155);n(2350);var r=n(67294),i=r&&"object"==typeof r&&"default"in r?r:{default:r};function o(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}var a=void 0!==s&&s.env&&!0,c=function(e){return"[object String]"===Object.prototype.toString.call(e)},l=function(){function e(e){var t=void 0===e?{}:e,n=t.name,s=void 0===n?"stylesheet":n,r=t.optimizeForSpeed,i=void 0===r?a:r;u(c(s),"`name` must be a string"),this._name=s,this._deletedRulePlaceholder="#"+s+"-deleted-rule____{}",u("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o=document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){u("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),u(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(u(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},n.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},n.insertRule=function(e,t){if(u(c(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return a||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var s=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,s))}return this._rulesCount++},n.replaceRule=function(e,t){if(this._optimizeForSpeed){var n=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(s){a||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var s=this._tags[e];u(s,"old rule at index `"+e+"` not found"),s.textContent=t}return e},n.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];u(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},n.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},n.cssRules=function(){var e=this;return this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},n.makeStyleTag=function(e,t,n){t&&u(c(t),"makeStyleTag accepts only strings as second parameter");var s=document.createElement("style");this._nonce&&s.setAttribute("nonce",this._nonce),s.type="text/css",s.setAttribute("data-"+e,""),t&&s.appendChild(document.createTextNode(t));var r=document.head||document.getElementsByTagName("head")[0];return n?r.insertBefore(s,n):r.appendChild(s),s},o(e.prototype,[{key:"length",get:function(){return this._rulesCount}}]),t&&o(e,t),e}();function u(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},h={};function f(e,t){if(!t)return"jsx-"+e;var n=String(t),s=e+n;return h[s]||(h[s]="jsx-"+d(e+"-"+n)),h[s]}function _(e,t){var n=e+t;return h[n]||(h[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),h[n]}var p=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,s=void 0===n?null:n,r=t.optimizeForSpeed,i=void 0!==r&&r;this._sheet=s||new l({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),s&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),s=n.styleId,r=n.rules;if(s in this._instancesCounts){this._instancesCounts[s]+=1;return}var i=r.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[s]=i,this._instancesCounts[s]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var s=this._fromServer&&this._fromServer[n];s?(s.parentNode.removeChild(s),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],s=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:s}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,s=e.id;if(n){var r=f(s,n);return{styleId:r,rules:Array.isArray(t)?t.map(function(e){return _(r,e)}):[_(r,t)]}}return{styleId:f(s),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=r.createContext(null);m.displayName="StyleSheetContext";var v=i.default.useInsertionEffect||i.default.useLayoutEffect,y=new p;function S(e){var t=y||r.useContext(m);return t&&v(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}S.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},t.style=S},36465:function(e,t,n){"use strict";e.exports=n(69578).style},24813:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return v}});var s=n(85893),r=n(36465),i=n.n(r),o=n(67294),a=n(4480),c=n(11163),l=n(26303),u=n(44974),d=n(74681),h=n(48831),f=n(22864),_=n(21756),p=n(48305),m=n.n(p);function v(){var e;let t=(0,a.sJ)(u.RI),n=(0,a.sJ)(u.g1),r=(0,a.sJ)(u.Q),{name:p}=n,{offlineMessage:v}=n,{viewerCount:y,lastConnectTime:S,lastDisconnectTime:b,streamTitle:x}=t,g=(0,a.sJ)(u.YW),j=(0,c.useRouter)(),C=null!==(e=j.asPath.split("?")[1])&&void 0!==e?e:"",k=C.split("&").reduce((e,t)=>{let[n,s]=t.split("=");return{...e,[n]:s}},{}),w="true"===k.initiallyMuted,F=(0,s.jsx)(l.Z,{active:!0,style:{padding:"10px"},paragraph:{rows:10}});(0,o.useEffect)(()=>{document.body.classList.add("body-background")},[]);let R=(0,s.jsx)(d.R,{streamName:p,customText:v,lastLive:b,notificationsEnabled:!1}),N=(0,s.jsxs)("div",{className:"jsx-c9ad39c4496ab6bc "+(m().onlineContainer||""),children:[(0,s.jsx)(i(),{id:"c9ad39c4496ab6bc",children:".body-background{background:var(--theme-color-components-video-status-bar-background)}"}),(0,s.jsx)(f.OwncastPlayer,{source:"/hls/stream.m3u8",online:g,initiallyMuted:w,title:x||p,fill:!0}),(0,s.jsx)(h.X,{online:g,lastConnectTime:S,lastDisconnectTime:b,viewerCount:y})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.me,{}),(0,s.jsx)(_.Q,{}),(0,s.jsx)("div",{className:"video-embed",children:r.appLoading?F:g?N:R})]})}},40158:function(e){e.exports={outerContainer:"OfflineBanner_outerContainer__3AbsB",innerContainer:"OfflineBanner_innerContainer__zTm13",bodyText:"OfflineBanner_bodyText__nNNy0",separator:"OfflineBanner_separator___j_Ss",lastLiveDate:"OfflineBanner_lastLiveDate___UZdO",clockIcon:"OfflineBanner_clockIcon__s0DB_",header:"OfflineBanner_header__Vu20o",footer:"OfflineBanner_footer__o3Zl5",actionLink:"OfflineBanner_actionLink__b4Mwa"}},29485:function(e){e.exports={statusbar:"Statusbar_statusbar__AtVnB",onlineMessage:"Statusbar_onlineMessage__66r5C",viewerCount:"Statusbar_viewerCount__S6_dZ",viewerIcon:"Statusbar_viewerIcon__yAOw1"}},48305:function(e){e.exports={onlineContainer:"VideoEmbed_onlineContainer__AkPYx"}},11163:function(e,t,n){e.exports=n(96885)},10434:function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(this,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},59199:function(e,t,n){"use strict";function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}n.d(t,{Z:function(){return s}})},74902:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var s=n(30907),r=n(59199),i=n(40181);function o(e){return function(e){if(Array.isArray(e))return(0,s.Z)(e)}(e)||(0,r.Z)(e)||(0,i.Z)(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}},function(e){e.O(0,[2544,2184,5938,2332,5273,9243,6959,781,9774,2888,179],function(){return e(e.s=61357)}),_N_E=e.O()}]);