Files
owncast/static/web/_next/static/chunks/518.5b0f59bbea7c607c.js
2025-01-06 01:33:33 +00:00

1 line
11 KiB
JavaScript
Vendored

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[518],{82643:function(e,t,n){"use strict";n.d(t,{k:function(){return p}});var o=n(85893),r=n(93879),l=n(1461),i=n(20133),a=n(4116),s=n(56469),c=n(67294),u=n(84385),d=n.n(u),f=n(11);let p=e=>{let{handleClose:t}=e,[n,u]=(0,c.useState)(null),[p,m]=(0,c.useState)(!1),[v,h]=(0,c.useState)(!1),[g,C]=(0,c.useState)(null),w=e=>{u(e),(0,f.ME)(e)?m(!0):m(!1)},Z=async()=>{if(p){h(!0);try{let e=n.replace(/^@+/,""),o=await fetch("/api/remotefollow",{method:"POST",body:JSON.stringify({account:e})}),r=await o.json();if(r.redirectUrl&&(window.open(r.redirectUrl,"_blank"),t()),!r.success){C(r.message),h(!1);return}if(!r.redirectUrl){C("Unable to follow."),h(!1);return}}catch(e){C(e.message)}h(!1)}};return(0,o.jsxs)(r.Z,{spinning:v,children:[g&&(0,o.jsx)(l.Z,{message:"Follow Error",description:g,type:"error",closable:!0,className:d().errorAlert}),(0,o.jsxs)("div",{className:d().inputContainer,children:[(0,o.jsx)("div",{className:d().instructions,children:"Enter your username @server to follow"}),(0,o.jsx)(i.default,{value:n,size:"large",onChange:e=>w(e.target.value),placeholder:"Your fediverse account @account@server",defaultValue:n}),(0,o.jsx)("div",{className:d().footer,children:"You'll be redirected to your Fediverse server and asked to confirm the action."})]}),(0,o.jsxs)(a.Z,{className:d().buttons,children:[(0,o.jsx)(s.Z,{onClick:()=>{window.open("https://owncast.online/join-fediverse","_blank")},type:"text",children:"Join the Fediverse"}),(0,o.jsx)(s.Z,{disabled:!p,type:"primary",onClick:Z,children:"Follow"})]})]})}},20518:function(e,t,n){"use strict";n.r(t),n.d(t,{FollowModal:function(){return s}});var o=n(85893),r=n(4116),l=n(84385),i=n.n(l),a=n(82643);let s=e=>{let{handleClose:t,account:n,name:l}=e;return(0,o.jsxs)(r.Z,{direction:"vertical",id:"follow-modal",children:[(0,o.jsxs)("div",{className:i().header,children:["By following this stream you'll get notified on the Fediverse when it goes live. Now is a great time to",(0,o.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,o.jsxs)("div",{className:i().account,children:[(0,o.jsx)("img",{src:"/logo",alt:"logo",className:i().logo}),(0,o.jsxs)("div",{className:i().username,children:[(0,o.jsx)("div",{className:i().name,children:l}),(0,o.jsx)("div",{children:n})]})]}),(0,o.jsx)(a.k,{handleClose:t})]})}},19175:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var o=n(1413),r=n(67294),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},i=n(36936),a=r.forwardRef(function(e,t){return r.createElement(i.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:l}))})},16793:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var o=n(1413),r=n(67294),l={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"},i=n(36936),a=r.forwardRef(function(e,t){return r.createElement(i.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:l}))})},20133:function(e,t,n){"use strict";n.d(t,{default:function(){return F}});var o=n(87462),r=n(4942),l=n(93967),i=n.n(l),a=n(67294),s=n(17399),c=n(10475),u=n(97585),d=n(97685),f=n(71002),p=n(1413),m={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},v=n(36936),h=a.forwardRef(function(e,t){return a.createElement(v.Z,(0,p.Z)((0,p.Z)({},e),{},{ref:t,icon:m}))}),g=n(19175),C=n(97485),w=n(89157),Z=n(99948),x=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)0>t.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},y={click:"onClick",hover:"onMouseOver"},b=a.forwardRef(function(e,t){var n=e.visibilityToggle,l=void 0===n||n,c="object"===(0,f.Z)(l)&&void 0!==l.visible,p=(0,a.useState)(function(){return!!c&&l.visible}),m=(0,d.Z)(p,2),v=m[0],b=m[1],_=(0,a.useRef)(null);a.useEffect(function(){c&&b(l.visible)},[c,l]);var j=(0,Z.Z)(_),E=function(){e.disabled||(v&&j(),b(function(e){var t,n=!e;return"object"===(0,f.Z)(l)&&(null===(t=l.onVisibleChange)||void 0===t||t.call(l,n)),n}))},M=function(t){var n=e.action,o=e.iconRender,l=y[void 0===n?"click":n]||"",i=(void 0===o?function(e){return e?a.createElement(g.Z,null):a.createElement(h,null)}:o)(v),s=(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({},l,E),"className","".concat(t,"-icon")),"key","passwordIcon"),"onMouseDown",function(e){e.preventDefault()}),"onMouseUp",function(e){e.preventDefault()});return a.cloneElement(a.isValidElement(i)?i:a.createElement("span",null,i),s)};return a.createElement(s.C,null,function(n){var s=n.getPrefixCls,c=e.className,d=e.prefixCls,f=e.inputPrefixCls,p=e.size,m=x(e,["className","prefixCls","inputPrefixCls","size"]),h=s("input",f),g=s("input-password",d),Z=l&&M(g),y=i()(g,c,(0,r.Z)({},"".concat(g,"-").concat(p),!!p)),b=(0,o.Z)((0,o.Z)({},(0,C.Z)(m,["suffix","iconRender","visibilityToggle"])),{type:v?"text":"password",className:y,prefixCls:h,suffix:Z});return p&&(b.size=p),a.createElement(u.ZP,(0,o.Z)({ref:(0,w.sQ)(t,_)},b))})}),_=n(16793),j=n(56469),E=n(23173),M=n(17877),N=n(84476),z=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)0>t.indexOf(o[r])&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n},k=a.forwardRef(function(e,t){var n,l=e.prefixCls,c=e.inputPrefixCls,d=e.className,f=e.size,p=e.suffix,m=e.enterButton,v=void 0!==m&&m,h=e.addonAfter,g=e.loading,C=e.disabled,Z=e.onSearch,x=e.onChange,y=e.onCompositionStart,b=e.onCompositionEnd,k=z(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),O=a.useContext(s.E_),P=O.getPrefixCls,F=O.direction,S=a.useContext(E.Z),B=a.useRef(!1),A=P("input-search",l),L=P("input",c),R=(0,M.ri)(A,F).compactSize||f||S,T=a.useRef(null),U=function(e){var t;document.activeElement===(null===(t=T.current)||void 0===t?void 0:t.input)&&e.preventDefault()},I=function(e){var t,n;Z&&Z(null===(n=null===(t=T.current)||void 0===t?void 0:t.input)||void 0===n?void 0:n.value,e)},q="boolean"==typeof v?a.createElement(_.Z,null):null,D="".concat(A,"-button"),J=v||{},Q=J.type&&!0===J.type.__ANT_BUTTON;n=Q||"button"===J.type?(0,N.Tm)(J,(0,o.Z)({onMouseDown:U,onClick:function(e){var t,n;null===(n=null===(t=null==J?void 0:J.props)||void 0===t?void 0:t.onClick)||void 0===n||n.call(t,e),I(e)},key:"enterButton"},Q?{className:D,size:R}:{})):a.createElement(j.Z,{className:D,type:v?"primary":void 0,size:R,disabled:C,key:"enterButton",onMouseDown:U,onClick:I,loading:g,icon:q},v),h&&(n=[n,(0,N.Tm)(h,{key:"addonAfter"})]);var V=i()(A,(0,r.Z)((0,r.Z)((0,r.Z)({},"".concat(A,"-rtl"),"rtl"===F),"".concat(A,"-").concat(R),!!R),"".concat(A,"-with-button"),!!v),d);return a.createElement(u.ZP,(0,o.Z)({ref:(0,w.sQ)(T,t),onPressEnter:function(e){B.current||g||I(e)}},k,{size:R,onCompositionStart:function(e){B.current=!0,null==y||y(e)},onCompositionEnd:function(e){B.current=!1,null==b||b(e)},prefixCls:L,addonAfter:n,suffix:p,onChange:function(e){e&&e.target&&"click"===e.type&&Z&&Z(e.target.value,e),x&&x(e)},className:V,disabled:C}))}),O=n(20083),P=u.ZP;P.Group=function(e){var t=(0,a.useContext)(s.E_),n=t.getPrefixCls,l=t.direction,u=e.prefixCls,d=e.className,f=n("input-group",u),p=i()(f,(0,r.Z)((0,r.Z)((0,r.Z)((0,r.Z)({},"".concat(f,"-lg"),"large"===e.size),"".concat(f,"-sm"),"small"===e.size),"".concat(f,"-compact"),e.compact),"".concat(f,"-rtl"),"rtl"===l),void 0===d?"":d),m=(0,a.useContext)(c.aM),v=(0,a.useMemo)(function(){return(0,o.Z)((0,o.Z)({},m),{isFormItemInput:!1})},[m]);return a.createElement("span",{className:p,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},a.createElement(c.aM.Provider,{value:v},e.children))},P.Search=k,P.TextArea=O.Z,P.Password=b;var F=P},11:function(e,t,n){"use strict";n.d(t,{Kf:function(){return l},ME:function(){return i},ax:function(){return o},jv:function(){return r}});let o="https?://.*";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["http:","https:"];try{let n=new URL(e);if(""===n.protocol||""===n.hostname||!t.includes(n.protocol))return!1}catch(e){return!1}return!0}function l(e,t){e.startsWith("@")&&(e=e.slice(1));let n=e.split(/:|@/),[o,r,l]=n;return o===t&&3===n.length&&!!o&&!!r&&!!l}function i(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())}},84385:function(e){e.exports={header:"FollowModal_header__0tBbf",buttons:"FollowModal_buttons__Me7qJ",inputContainer:"FollowModal_inputContainer__Ie3e7",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",errorAlert:"FollowModal_errorAlert__UneY4"}}}]);