1 line
11 KiB
JavaScript
Vendored
1 line
11 KiB
JavaScript
Vendored
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1386],{31386:function(e,t,n){"use strict";n.r(t),n.d(t,{FollowModal:function(){return p}});var o=n(85893),r=n(96652),l=n(70936),i=n(46994),a=n(43795),s=n(90622),c=n(67294),u=n(88122),d=n.n(u),f=n(94956);let p=e=>{let{handleClose:t,account:n,name:u}=e,[p,m]=(0,c.useState)(null),[v,h]=(0,c.useState)(!1),[g,Z]=(0,c.useState)(!1),[w,C]=(0,c.useState)(null),y=e=>{m(e),(0,f.ME)(e)?h(!0):h(!1)},x=async()=>{if(v){Z(!0);try{let e=p.replace(/^@+/,""),n=await fetch("/api/remotefollow",{method:"POST",body:JSON.stringify({account:e})}),o=await n.json();if(o.redirectUrl&&(window.open(o.redirectUrl,"_blank"),t()),!o.success){C(o.message),Z(!1);return}if(!o.redirectUrl){C("Unable to follow."),Z(!1);return}}catch(e){C(e.message)}Z(!1)}};return(0,o.jsxs)(r.Z,{direction:"vertical",id:"follow-modal",children:[(0,o.jsxs)("div",{className:d().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)(l.Z,{spinning:g,children:[w&&(0,o.jsx)(i.Z,{message:"Follow Error",description:w,type:"error",showIcon:!0}),(0,o.jsxs)("div",{className:d().account,children:[(0,o.jsx)("img",{src:"/logo",alt:"logo",className:d().logo}),(0,o.jsxs)("div",{className:d().username,children:[(0,o.jsx)("div",{className:d().name,children:u}),(0,o.jsx)("div",{children:n})]})]}),(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:d().instructions,children:"Enter your username @server to follow"}),(0,o.jsx)(a.default,{value:p,size:"large",onChange:e=>y(e.target.value),placeholder:"Your fediverse account @account@server",defaultValue:p}),(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)(r.Z,{className:d().buttons,children:[(0,o.jsx)(s.Z,{disabled:!v,type:"primary",onClick:x,children:"Follow"}),(0,o.jsx)(s.Z,{onClick:()=>{window.open("https://owncast.online/join-fediverse","_blank")},type:"primary",children:"Join the Fediverse"})]})]})]})}},2850: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(32206),a=r.forwardRef(function(e,t){return r.createElement(i.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:l}))})},72909: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(32206),a=r.forwardRef(function(e,t){return r.createElement(i.Z,(0,o.Z)((0,o.Z)({},e),{},{ref:t,icon:l}))})},43795:function(e,t,n){"use strict";n.d(t,{default:function(){return S}});var o=n(87462),r=n(4942),l=n(93967),i=n.n(l),a=n(67294),s=n(71946),c=n(24061),u=n(96234),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(32206),h=a.forwardRef(function(e,t){return a.createElement(v.Z,(0,p.Z)((0,p.Z)({},e),{},{ref:t,icon:m}))}),g=n(2850),Z=n(55548),w=n(21396),C=n(95905),y=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},x={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 E=(0,C.Z)(_),j=function(){e.disabled||(v&&E(),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=x[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,j),"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=y(e,["className","prefixCls","inputPrefixCls","size"]),h=s("input",f),g=s("input-password",d),C=l&&M(g),x=i()(g,c,(0,r.Z)({},"".concat(g,"-").concat(p),!!p)),b=(0,o.Z)((0,o.Z)({},(0,Z.Z)(m,["suffix","iconRender","visibilityToggle"])),{type:v?"text":"password",className:x,prefixCls:h,suffix:C});return p&&(b.size=p),a.createElement(u.ZP,(0,o.Z)({ref:(0,w.sQ)(t,_)},b))})}),_=n(72909),E=n(90622),j=n(41395),M=n(44053),z=n(91604),N=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},O=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,Z=e.disabled,C=e.onSearch,y=e.onChange,x=e.onCompositionStart,b=e.onCompositionEnd,O=N(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),k=a.useContext(s.E_),P=k.getPrefixCls,S=k.direction,F=a.useContext(j.Z),B=a.useRef(!1),L=P("input-search",l),R=P("input",c),A=(0,M.ri)(L,S).compactSize||f||F,T=a.useRef(null),I=function(e){var t;document.activeElement===(null===(t=T.current)||void 0===t?void 0:t.input)&&e.preventDefault()},U=function(e){var t,n;C&&C(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(L,"-button"),J=v||{},Q=J.type&&!0===J.type.__ANT_BUTTON;n=Q||"button"===J.type?(0,z.Tm)(J,(0,o.Z)({onMouseDown:I,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),U(e)},key:"enterButton"},Q?{className:D,size:A}:{})):a.createElement(E.Z,{className:D,type:v?"primary":void 0,size:A,disabled:Z,key:"enterButton",onMouseDown:I,onClick:U,loading:g,icon:q},v),h&&(n=[n,(0,z.Tm)(h,{key:"addonAfter"})]);var V=i()(L,(0,r.Z)((0,r.Z)((0,r.Z)({},"".concat(L,"-rtl"),"rtl"===S),"".concat(L,"-").concat(A),!!A),"".concat(L,"-with-button"),!!v),d);return a.createElement(u.ZP,(0,o.Z)({ref:(0,w.sQ)(T,t),onPressEnter:function(e){B.current||g||U(e)}},O,{size:A,onCompositionStart:function(e){B.current=!0,null==x||x(e)},onCompositionEnd:function(e){B.current=!1,null==b||b(e)},prefixCls:R,addonAfter:n,suffix:p,onChange:function(e){e&&e.target&&"click"===e.type&&C&&C(e.target.value,e),y&&y(e)},className:V,disabled:Z}))}),k=n(36410),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=O,P.TextArea=k.Z,P.Password=b;var S=P},94956: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())}},88122: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"}}}]); |