Bundle embedded web app

This commit is contained in:
Owncast 2024-01-22 04:31:31 +00:00
parent 2b57741397
commit cd66581998
39 changed files with 40 additions and 40 deletions

2
static/web/404.html vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6403],{66403:function(e,o,t){"use strict";t.r(o),t.d(o,{FollowModal:function(){return FollowModal}});var l=t(85893),n=t(51024),r=t(65400),s=t(4863),a=t(89552),i=t(74048),c=t(67294),d=t(48965),u=t.n(d),h=t(89105);let FollowModal=e=>{let{handleClose:o,account:t,name:d}=e,[f,w]=(0,c.useState)(null),[_,m]=(0,c.useState)(!1),[v,p]=(0,c.useState)(!1),[g,j]=(0,c.useState)(null),handleAccountChange=e=>{w(e),(0,h.ME)(e)?m(!0):m(!1)},remoteFollowButtonPressed=async()=>{if(_){p(!0);try{let e=f.replace(/^@+/,""),t=await fetch("/api/remotefollow",{method:"POST",body:JSON.stringify({account:e})}),l=await t.json();if(l.redirectUrl&&(window.open(l.redirectUrl,"_blank"),o()),!l.success){j(l.message),p(!1);return}if(!l.redirectUrl){j("Unable to follow."),p(!1);return}}catch(e){j(e.message)}p(!1)}};return(0,l.jsxs)(i.default,{direction:"vertical",id:"follow-modal",children:[(0,l.jsxs)("div",{className:u().header,children:["By following this stream you'll get notified on the Fediverse when it goes live. Now is a great time to",(0,l.jsx)("a",{href:"https://owncast.online/join-fediverse",target:"_blank",rel:"noreferrer",children:"\xa0learn about the Fediverse\xa0"}),"if it's new to you."]}),(0,l.jsxs)(a.default,{spinning:v,children:[g&&(0,l.jsx)(s.default,{message:"Follow Error",description:g,type:"error",showIcon:!0}),(0,l.jsxs)("div",{className:u().account,children:[(0,l.jsx)("img",{src:"/logo",alt:"logo",className:u().logo}),(0,l.jsxs)("div",{className:u().username,children:[(0,l.jsx)("div",{className:u().name,children:d}),(0,l.jsx)("div",{children:t})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:u().instructions,children:"Enter your username @server to follow"}),(0,l.jsx)(n.default,{value:f,size:"large",onChange:e=>handleAccountChange(e.target.value),placeholder:"Your fediverse account @account@server",defaultValue:f}),(0,l.jsx)("div",{className:u().footer,children:"You'll be redirected to your Fediverse server and asked to confirm the action."})]}),(0,l.jsxs)(i.default,{className:u().buttons,children:[(0,l.jsx)(r.default,{disabled:!_,type:"primary",onClick:remoteFollowButtonPressed,children:"Follow"}),(0,l.jsx)(r.default,{onClick:()=>{window.open("https://owncast.online/join-fediverse","_blank")},type:"primary",children:"Join the Fediverse"})]})]})]})}},89105:function(e,o,t){"use strict";t.d(o,{Kf:function(){return isValidAccount},ME:function(){return isValidFediverseAccount},ax:function(){return l},jv:function(){return isValidUrl}});let l="https?://.*";function isValidUrl(e){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["http:","https:"];try{let t=new URL(e);if(""===t.protocol||""===t.hostname||!o.includes(t.protocol))return!1}catch(e){return!1}return!0}function isValidAccount(e,o){e.startsWith("@")&&(e=e.slice(1));let t=e.split(/:|@/),[l,n,r]=t;return l===o&&3===t.length&&!!l&&!!n&&!!r}function isValidFediverseAccount(e){let o=e.replace(/^@+/,"");return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(o).toLowerCase())}},48965:function(e){e.exports={header:"FollowModal_header__0tBbf",buttons:"FollowModal_buttons__Me7qJ",instructions:"FollowModal_instructions__JCqe7",footer:"FollowModal_footer__IBJi9",account:"FollowModal_account__OZ_ZG",logo:"FollowModal_logo__m4Z2e",username:"FollowModal_username__Voyzl",name:"FollowModal_name__fVdPj"}}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6403],{66403:function(e,t,o){"use strict";o.r(t),o.d(t,{FollowModal:function(){return FollowModal}});var l=o(85893),n=o(51024),r=o(65400),s=o(4863),i=o(89552),a=o(74048),c=o(67294),d=o(48965),u=o.n(d),h=o(89105);let FollowModal=e=>{let{handleClose:t,account:o,name:d}=e,[f,w]=(0,c.useState)(null),[m,_]=(0,c.useState)(!1),[v,p]=(0,c.useState)(!1),[g,x]=(0,c.useState)(null),handleAccountChange=e=>{w(e),(0,h.ME)(e)?_(!0):_(!1)},remoteFollowButtonPressed=async()=>{if(m){p(!0);try{let e=f.replace(/^@+/,""),o=await fetch("/api/remotefollow",{method:"POST",body:JSON.stringify({account:e})}),l=await o.json();if(l.redirectUrl&&(window.open(l.redirectUrl,"_blank"),t()),!l.success){x(l.message),p(!1);return}if(!l.redirectUrl){x("Unable to follow."),p(!1);return}}catch(e){x(e.message)}p(!1)}};return(0,l.jsxs)(a.default,{direction:"vertical",id:"follow-modal",children:[(0,l.jsxs)("div",{className:u().header,children:["By following this stream you'll get notified on the Fediverse when it goes live. Now is a great time to",(0,l.jsx)("a",{href:"https://owncast.online/join-fediverse",target:"_blank",rel:"noreferrer",children:"\xa0learn about the Fediverse\xa0"}),"if it's new to you."]}),(0,l.jsxs)(i.default,{spinning:v,children:[g&&(0,l.jsx)(s.default,{message:"Follow Error",description:g,type:"error",showIcon:!0}),(0,l.jsxs)("div",{className:u().account,children:[(0,l.jsx)("img",{src:"/logo",alt:"logo",className:u().logo}),(0,l.jsxs)("div",{className:u().username,children:[(0,l.jsx)("div",{className:u().name,children:d}),(0,l.jsx)("div",{children:o})]})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:u().instructions,children:"Enter your username @server to follow"}),(0,l.jsx)(n.default,{value:f,size:"large",onChange:e=>handleAccountChange(e.target.value),placeholder:"Your fediverse account @account@server",defaultValue:f}),(0,l.jsx)("div",{className:u().footer,children:"You'll be redirected to your Fediverse server and asked to confirm the action."})]}),(0,l.jsxs)(a.default,{className:u().buttons,children:[(0,l.jsx)(r.default,{disabled:!m,type:"primary",onClick:remoteFollowButtonPressed,children:"Follow"}),(0,l.jsx)(r.default,{onClick:()=>{window.open("https://owncast.online/join-fediverse","_blank")},type:"primary",children:"Join the Fediverse"})]})]})]})}},89105:function(e,t,o){"use strict";o.d(t,{Kf:function(){return isValidAccount},ME:function(){return isValidFediverseAccount},ax:function(){return l},bu:function(){return isValidMatrixAccount},jv:function(){return isValidUrl}});let l="https?://.*";function isValidUrl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["http:","https:"];try{let o=new URL(e);if(""===o.protocol||""===o.hostname||!t.includes(o.protocol))return!1}catch(e){return!1}return!0}function isValidAccount(e,t){e.startsWith("@")&&(e=e.slice(1));let o=e.split(/:|@/),[l,n,r]=o;return l===t&&3===o.length&&!!l&&!!n&&!!r}function isValidMatrixAccount(e){e.startsWith("matrix:")&&(e=e.slice(7)),e.startsWith("@")&&(e=e.slice(1));let t=e.split(":"),[o,l]=t;return 2===t.length&&!!o&&!!l}function isValidFediverseAccount(e){let t=e.replace(/^@+/,"");return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t).toLowerCase())}},48965:function(e){e.exports={header:"FollowModal_header__0tBbf",buttons:"FollowModal_buttons__Me7qJ",instructions:"FollowModal_instructions__JCqe7",footer:"FollowModal_footer__IBJi9",account:"FollowModal_account__OZ_ZG",logo:"FollowModal_logo__m4Z2e",username:"FollowModal_username__Voyzl",name:"FollowModal_name__fVdPj"}}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
static/web/sw.js vendored

File diff suppressed because one or more lines are too long