Files
owncast/static/web/_next/static/chunks/2033.f84e1654678318d5.js
2023-01-30 17:44:49 +00:00

1 line
20 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2033],{8751:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(1413),r=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},c=n(42135),o=function(e,t){return r.createElement(c.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:t,icon:i}))};o.displayName="CheckCircleOutlined";var s=r.forwardRef(o)},18429:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(1413),r=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}},{tag:"path",attrs:{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"close-circle",theme:"outlined"},c=n(42135),o=function(e,t){return r.createElement(c.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:t,icon:i}))};o.displayName="CloseCircleOutlined";var s=r.forwardRef(o)},11475:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(1413),r=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},c=n(42135),o=function(e,t){return r.createElement(c.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:t,icon:i}))};o.displayName="ExclamationCircleOutlined";var s=r.forwardRef(o)},78860:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(1413),r=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"},c=n(42135),o=function(e,t){return r.createElement(c.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:t,icon:i}))};o.displayName="InfoCircleFilled";var s=r.forwardRef(o)},45605:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a=n(1413),r=n(67294),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},c=n(42135),o=function(e,t){return r.createElement(c.Z,(0,a.Z)((0,a.Z)({},e),{},{ref:t,icon:i}))};o.displayName="InfoCircleOutlined";var s=r.forwardRef(o)},54907:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var a=n(87462),r=n(4942),i=n(18073),c=n(94184),o=n.n(c),s=n(74902),l=n(15671),d=n(43144),u=n(60136),p=n(33643),h=n(71002),f=n(50344),m=n(67294),v=n(96774),y=n.n(v),g=n(45987),x=n(62874),Z=n(97685),C=m.forwardRef(function(e,t){var n,a=e.prefixCls,i=e.forceRender,c=e.className,s=e.style,l=e.children,d=e.isActive,u=e.role,p=m.useState(d||i),h=(0,Z.Z)(p,2),f=h[0],v=h[1];return(m.useEffect(function(){(i||d)&&v(!0)},[i,d]),f)?m.createElement("div",{ref:t,className:o()("".concat(a,"-content"),(n={},(0,r.Z)(n,"".concat(a,"-content-active"),d),(0,r.Z)(n,"".concat(a,"-content-inactive"),!d),n),c),style:s,role:u},m.createElement("div",{className:"".concat(a,"-content-box")},l)):null});C.displayName="PanelContent";var b=["className","id","style","prefixCls","headerClass","children","isActive","destroyInactivePanel","accordion","forceRender","openMotion","extra","collapsible"],N=function(e){(0,u.Z)(n,e);var t=(0,p.Z)(n);function n(){var e;(0,l.Z)(this,n);for(var a=arguments.length,r=Array(a),i=0;i<a;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))).onItemClick=function(){var t=e.props,n=t.onItemClick,a=t.panelKey;"function"==typeof n&&n(a)},e.handleKeyPress=function(t){("Enter"===t.key||13===t.keyCode||13===t.which)&&e.onItemClick()},e.renderIcon=function(){var t=e.props,n=t.showArrow,a=t.expandIcon,r=t.prefixCls,i=t.collapsible;if(!n)return null;var c="function"==typeof a?a(e.props):m.createElement("i",{className:"arrow"});return c&&m.createElement("div",{className:"".concat(r,"-expand-icon"),onClick:"header"===i||"icon"===i?e.onItemClick:null},c)},e.renderTitle=function(){var t=e.props,n=t.header,a=t.prefixCls,r=t.collapsible;return m.createElement("span",{className:"".concat(a,"-header-text"),onClick:"header"===r?e.onItemClick:null},n)},e}return(0,d.Z)(n,[{key:"shouldComponentUpdate",value:function(e){return!y()(this.props,e)}},{key:"render",value:function(){var e,t,n=this.props,i=n.className,c=n.id,s=n.style,l=n.prefixCls,d=n.headerClass,u=n.children,p=n.isActive,h=n.destroyInactivePanel,f=n.accordion,v=n.forceRender,y=n.openMotion,Z=n.extra,N=n.collapsible,w=(0,g.Z)(n,b),j="disabled"===N,I="header"===N,k="icon"===N,E=o()((e={},(0,r.Z)(e,"".concat(l,"-item"),!0),(0,r.Z)(e,"".concat(l,"-item-active"),p),(0,r.Z)(e,"".concat(l,"-item-disabled"),j),e),i),A={className:o()("".concat(l,"-header"),(t={},(0,r.Z)(t,d,d),(0,r.Z)(t,"".concat(l,"-header-collapsible-only"),I),(0,r.Z)(t,"".concat(l,"-icon-collapsible-only"),k),t)),"aria-expanded":p,"aria-disabled":j,onKeyPress:this.handleKeyPress};return I||k||(A.onClick=this.onItemClick,A.role=f?"tab":"button",A.tabIndex=j?-1:0),delete w.header,delete w.panelKey,delete w.onItemClick,delete w.showArrow,delete w.expandIcon,m.createElement("div",(0,a.Z)({},w,{className:E,style:s,id:c}),m.createElement("div",A,this.renderIcon(),this.renderTitle(),null!=Z&&"boolean"!=typeof Z&&m.createElement("div",{className:"".concat(l,"-extra")},Z)),m.createElement(x.Z,(0,a.Z)({visible:p,leavedClassName:"".concat(l,"-content-hidden")},y,{forceRender:v,removeOnLeave:h}),function(e,t){var n=e.className,a=e.style;return m.createElement(C,{ref:t,prefixCls:l,className:n,style:a,isActive:p,forceRender:v,role:f?"tabpanel":null},u)}))}}]),n}(m.Component);function w(e){var t=e;if(!Array.isArray(t)){var n=(0,h.Z)(t);t="number"===n||"string"===n?[t]:[]}return t.map(function(e){return String(e)})}N.defaultProps={showArrow:!0,isActive:!1,onItemClick:function(){},headerClass:"",forceRender:!1};var j=function(e){(0,u.Z)(n,e);var t=(0,p.Z)(n);function n(e){(0,l.Z)(this,n),(a=t.call(this,e)).onClickItem=function(e){var t=a.state.activeKey;if(a.props.accordion)t=t[0]===e?[]:[e];else{var n=(t=(0,s.Z)(t)).indexOf(e);n>-1?t.splice(n,1):t.push(e)}a.setActiveKey(t)},a.getNewChild=function(e,t){if(!e)return null;var n=a.state.activeKey,r=a.props,i=r.prefixCls,c=r.openMotion,o=r.accordion,s=r.destroyInactivePanel,l=r.expandIcon,d=r.collapsible,u=e.key||String(t),p=e.props,h=p.header,f=p.headerClass,v=p.destroyInactivePanel,y=p.collapsible,g=!1;g=o?n[0]===u:n.indexOf(u)>-1;var x=null!=y?y:d,Z={key:u,panelKey:u,header:h,headerClass:f,isActive:g,prefixCls:i,destroyInactivePanel:null!=v?v:s,openMotion:c,accordion:o,children:e.props.children,onItemClick:"disabled"===x?null:a.onClickItem,expandIcon:l,collapsible:x};return"string"==typeof e.type?e:(Object.keys(Z).forEach(function(e){void 0===Z[e]&&delete Z[e]}),m.cloneElement(e,Z))},a.getItems=function(){var e=a.props.children;return(0,f.Z)(e).map(a.getNewChild)},a.setActiveKey=function(e){"activeKey"in a.props||a.setState({activeKey:e}),a.props.onChange(a.props.accordion?e[0]:e)};var a,r=e.activeKey,i=e.defaultActiveKey;return"activeKey"in e&&(i=r),a.state={activeKey:w(i)},a}return(0,d.Z)(n,[{key:"shouldComponentUpdate",value:function(e,t){return!y()(this.props,e)||!y()(this.state,t)}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,a=t.className,i=t.style,c=t.accordion,s=o()((e={},(0,r.Z)(e,n,!0),(0,r.Z)(e,a,!!a),e));return m.createElement("div",{className:s,style:i,role:c?"tablist":null},this.getItems())}}],[{key:"getDerivedStateFromProps",value:function(e){var t={};return"activeKey"in e&&(t.activeKey=w(e.activeKey)),t}}]),n}(m.Component);j.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1},j.Panel=N,j.Panel;var I=n(98423),k=n(53124),E=n(33603),A=n(96159),P=function(e){var t,n,c=m.useContext(k.E_),s=c.getPrefixCls,l=c.direction,d=e.prefixCls,u=e.className,p=e.bordered,h=e.ghost,v=e.expandIconPosition,y=void 0===v?"start":v,g=s("collapse",d),x=m.useMemo(function(){return"left"===y?"start":"right"===y?"end":y},[y]),Z=o()("".concat(g,"-icon-position-").concat(x),(n={},(0,r.Z)(n,"".concat(g,"-borderless"),!(void 0===p||p)),(0,r.Z)(n,"".concat(g,"-rtl"),"rtl"===l),(0,r.Z)(n,"".concat(g,"-ghost"),!!h),n),void 0===u?"":u),C=(0,a.Z)((0,a.Z)({},E.ZP),{motionAppear:!1,leavedClassName:"".concat(g,"-content-hidden")});return m.createElement(j,(0,a.Z)({openMotion:C},e,{expandIcon:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.expandIcon,a=n?n(t):m.createElement(i.Z,{rotate:t.isActive?90:void 0});return(0,A.Tm)(a,function(){return{className:o()(a.props.className,"".concat(g,"-arrow"))}})},prefixCls:g,className:Z}),(t=e.children,(0,f.Z)(t).map(function(e,t){var n;if(null===(n=e.props)||void 0===n?void 0:n.disabled){var r=e.key||String(t),i=e.props,c=i.disabled,o=i.collapsible,s=(0,a.Z)((0,a.Z)({},(0,I.Z)(e.props,["disabled"])),{key:r,collapsible:null!=o?o:c?"disabled":void 0});return(0,A.Tm)(e,s)}return e})))};P.Panel=function(e){var t=m.useContext(k.E_).getPrefixCls,n=e.prefixCls,i=e.className,c=e.showArrow,s=t("collapse",n),l=o()((0,r.Z)({},"".concat(s,"-no-arrow"),!(void 0===c||c)),void 0===i?"":i);return m.createElement(j.Panel,(0,a.Z)({},e,{prefixCls:s,className:l}))};var S=P},11382:function(e,t,n){"use strict";var a=n(87462),r=n(4942),i=n(97685),c=n(94184),o=n.n(c),s=n(23279),l=n.n(s),d=n(98423),u=n(67294),p=n(53124),h=n(96159),f=n(93355),m=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)0>t.indexOf(a[r])&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n};(0,f.b)("small","default","large");var v=null,y=function(e){var t=e.spinPrefixCls,n=e.spinning,c=void 0===n||n,s=e.delay,f=e.className,y=e.size,g=void 0===y?"default":y,x=e.tip,Z=e.wrapperClassName,C=e.style,b=e.children,N=m(e,["spinPrefixCls","spinning","delay","className","size","tip","wrapperClassName","style","children"]),w=u.useState(function(){return c&&(!c||!s||!!isNaN(Number(s)))}),j=(0,i.Z)(w,2),I=j[0],k=j[1];return u.useEffect(function(){var e=l()(function(){k(c)},s);return e(),function(){var t;null===(t=null==e?void 0:e.cancel)||void 0===t||t.call(e)}},[s,c]),u.createElement(p.C,null,function(n){var i,c,s,l=n.direction,p=o()(t,(s={},(0,r.Z)(s,"".concat(t,"-sm"),"small"===g),(0,r.Z)(s,"".concat(t,"-lg"),"large"===g),(0,r.Z)(s,"".concat(t,"-spinning"),I),(0,r.Z)(s,"".concat(t,"-show-text"),!!x),(0,r.Z)(s,"".concat(t,"-rtl"),"rtl"===l),s),f),m=(0,d.Z)(N,["indicator","prefixCls"]),y=u.createElement("div",(0,a.Z)({},m,{style:C,className:p,"aria-live":"polite","aria-busy":I}),(i=e.indicator,c="".concat(t,"-dot"),null===i?null:(0,h.l$)(i)?(0,h.Tm)(i,{className:o()(i.props.className,c)}):(0,h.l$)(v)?(0,h.Tm)(v,{className:o()(v.props.className,c)}):u.createElement("span",{className:o()(c,"".concat(t,"-dot-spin"))},u.createElement("i",{className:"".concat(t,"-dot-item")}),u.createElement("i",{className:"".concat(t,"-dot-item")}),u.createElement("i",{className:"".concat(t,"-dot-item")}),u.createElement("i",{className:"".concat(t,"-dot-item")}))),x?u.createElement("div",{className:"".concat(t,"-text")},x):null);if(void 0!==b){var w=o()("".concat(t,"-container"),(0,r.Z)({},"".concat(t,"-blur"),I));return u.createElement("div",(0,a.Z)({},m,{className:o()("".concat(t,"-nested-loading"),Z)}),I&&u.createElement("div",{key:"loading"},y),u.createElement("div",{className:w,key:"container"},b))}return y})},g=function(e){var t=e.prefixCls,n=(0,u.useContext(p.E_).getPrefixCls)("spin",t),r=(0,a.Z)((0,a.Z)({},e),{spinPrefixCls:n});return u.createElement(y,(0,a.Z)({},r))};g.setDefaultIndicator=function(e){v=e},t.Z=g},50261:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthModal:function(){return A}});var a=n(85893),r=n(84381),i=n(4480),c=n(54907),o=n(85818),s=n(11382),l=n(26713),d=n(14670),u=n(79531),p=n(71577),h=n(5152),f=n.n(h),m=n(67294),v=n(37174);let{Panel:y}=c.Z,{Link:g}=o.Z,x=f()(()=>Promise.all([n.e(2074),n.e(7996)]).then(n.t.bind(n,67996,23)),{loadableGenerated:{webpack:()=>[67996]},ssr:!1}),Z=e=>{let{authenticated:t,displayName:n,accessToken:r}=e,[i,o]=(0,m.useState)(null),[h,f]=(0,m.useState)(!1),[Z,C]=(0,m.useState)(!1),[b,N]=(0,m.useState)(""),w=t?(0,a.jsxs)("span",{children:[(0,a.jsx)("b",{children:"You are already authenticated"}),". However, you can add other domains or log in as a different user."]}):(0,a.jsxs)("span",{children:["Use your own domain to authenticate ",(0,a.jsx)("span",{children:n})," or login as a previously"," ","authenticated chat user using IndieAuth."]}),j=i;j&&j.includes("url does not support indieauth")&&(j="The provided URL is either invalid or does not support IndieAuth.");let I=e=>{if(!(0,v.jv)(e)||!e.includes(".")){C(!1);return}C(!0)},k=e=>{let t=e.nativeEvent.data;if(":"===t)return;N(e.target.value);let n="https://".concat(e.target.value);I(n)},E=async()=>{if(Z){f(!0);try{let e=await fetch("/api/auth/indieauth?accessToken=".concat(r),{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({authHost:"https://".concat(b)})}),t=await e.json();if(t.message){o(t.message),f(!1);return}if(!t.redirect){o("Auth provider did not return a redirect URL."),f(!1);return}if(t.redirect){let{redirect:e}=t;window.location=e}}catch(e){o(e.message)}f(!1)}};return(0,a.jsx)(s.Z,{spinning:h,children:(0,a.jsxs)(l.Z,{direction:"vertical",children:[w,j&&(0,a.jsx)(d.Z,{message:"Error",description:j,type:"error",showIcon:!0}),(0,a.jsx)("div",{children:"Your domain"}),(0,a.jsx)(u.Z.Search,{addonBefore:"https://",onInput:k,type:"url",value:b,placeholder:"yoursite.com",status:!Z&&b.length>0?"error":void 0,onSearch:E,enterButton:(0,a.jsx)(p.Z,{type:Z?"primary":"default",disabled:!Z||0===b.length,children:(0,a.jsx)(x,{})})}),(0,a.jsx)(c.Z,{ghost:!0,children:(0,a.jsxs)(y,{header:"Learn more about using IndieAuth to authenticate with chat.",children:[(0,a.jsx)("p",{children:"IndieAuth allows for a completely independent and decentralized way of identifying yourself using your own domain."}),(0,a.jsxs)("p",{children:["If you run an Owncast instance, you can use that domain here. Otherwise,"," ",(0,a.jsx)(g,{href:"https://indieauth.net/#providers",children:"learn more about how you can support IndieAuth"}),"."]})]},"header")}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:"Note"}),": This is for authentication purposes only, and no personal information will be accessed or stored."]})]})})};var C=n(50501),b=n.n(C);let{Panel:N}=c.Z,w=f()(()=>Promise.all([n.e(2074),n.e(7996)]).then(n.t.bind(n,67996,23)),{loadableGenerated:{webpack:()=>[67996]},ssr:!1}),j=e=>{let{authenticated:t,displayName:n,accessToken:r}=e,[i,o]=(0,m.useState)(null),[h,f]=(0,m.useState)(!1),[v,y]=(0,m.useState)(!1),[g,x]=(0,m.useState)(""),[Z,C]=(0,m.useState)(""),[j,I]=(0,m.useState)(!1),k=t?(0,a.jsxs)("span",{children:[(0,a.jsx)("b",{children:"You are already authenticated"}),". However, you can add other domains or log in as a different user."]}):(0,a.jsxs)("span",{children:["Receive a direct message on the Fediverse to link your account to"," ",(0,a.jsx)("strong",{children:n}),", or login as a previously linked chat user."]}),E=i;E&&E.includes("url does not support indieauth")&&(E="The provided URL is either invalid or does not support IndieAuth.");let A=e=>{y(function(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())}(e))},P=e=>{x(e.target.value),A(e.target.value)},S=async(e,t)=>{let n=await fetch(e,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t)}),a=await n.json();a.message&&(o(a.message),f(!1))},z=async()=>{f(!0);try{await S("/api/auth/fediverse/verify?accessToken=".concat(r),{code:Z}),window.location.href="/"}catch(e){console.error(e),o(e)}f(!1)},M=async()=>{if(!v)return;f(!0),o(null);let e=g.replace(/^@+/,"");try{await S("/api/auth/fediverse?accessToken=".concat(r),{account:e}),I(!0)}catch(e){console.error(e),o(e)}f(!1)},O=(0,a.jsxs)("div",{children:["Paste in the code that was sent to your Fediverse account. If you did not receive a code, make sure you can accept direct messages.",(0,a.jsxs)("div",{className:b().codeInputContainer,children:[(0,a.jsx)(u.Z,{value:Z,onChange:e=>C(e.target.value),className:b().codeInput,placeholder:"123456",maxLength:6}),(0,a.jsx)(p.Z,{type:"primary",onClick:z,disabled:Z.length<6,className:b().submitButton,children:"Verify Code"})]})]}),_=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{children:"Your Fediverse Account"}),(0,a.jsx)(u.Z.Search,{addonBefore:"@",onInput:P,value:g,placeholder:"youraccount@yourserver.com",status:!v&&g.length>0?"error":void 0,onSearch:M,enterButton:(0,a.jsx)(p.Z,{type:v?"primary":"default",disabled:!v||0===g.length,children:(0,a.jsx)(w,{})})})]});return(0,a.jsx)(s.Z,{spinning:h,children:(0,a.jsxs)(l.Z,{direction:"vertical",children:[k,E&&(0,a.jsx)(d.Z,{message:"Error",description:E,type:"error",showIcon:!0}),j?O:_,(0,a.jsx)(c.Z,{ghost:!0,children:(0,a.jsx)(N,{header:"Learn more about using the Fediverse to authenticate with chat.",children:(0,a.jsx)("p",{children:"You can link your chat identity with your Fediverse identity. Next time you want to use this chat identity you can again go through the Fediverse authentication."})},"header")}),(0,a.jsxs)("div",{children:[(0,a.jsx)("strong",{children:"Note"}),": This is for authentication purposes only, and no personal information will be accessed or stored."]})]})})};var I=n(54639),k=n.n(I),E=n(77466);let A=e=>{let{forceTabs:t}=e,n=(0,i.sJ)(E.L4),c=(0,i.sJ)(E.FI),o=(0,i.sJ)(E.db),s=(0,i.sJ)(E.g1);if(!o)return null;let{displayName:l}=o,{federation:d}=s,{enabled:u}=d,p=(0,a.jsxs)("span",{className:k().tabContent,children:[(0,a.jsx)("img",{className:k().icon,src:"/img/indieauth.png",alt:"IndieAuth"}),"IndieAuth"]}),h=(0,a.jsx)(Z,{authenticated:n,displayName:l,accessToken:c}),f=(0,a.jsxs)("span",{className:k().tabContent,children:[(0,a.jsx)("img",{className:k().icon,src:"/img/fediverse-black.png",alt:"Fediverse auth"}),"FediAuth"]}),m=(0,a.jsx)(j,{authenticated:n,displayName:l,accessToken:c});return(0,a.jsx)("div",{children:(0,a.jsx)(r.Z,{defaultActiveKey:"1",items:[{label:p,key:"1",children:h},{label:f,key:"2",children:m}],type:"card",size:"small",renderTabBar:u||t?null:()=>null})})}},37174:function(e,t,n){"use strict";n.d(t,{Kf:function(){return i},ax:function(){return a},bu:function(){return c},jv:function(){return r}});let a="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 i(e,t){e.startsWith("@")&&(e=e.slice(1));let n=e.split(/:|@/),[a,r,i]=n;return console.log({account:e,protocol:t,service:a,user:r,host:i}),a===t&&3===n.length&&!!a&&!!r&&!!i}function c(e){if(!e.startsWith("matrix:"))return!1;(e=e.slice(7)).startsWith("@")&&(e=e.slice(1));let t=e.split(":"),[n,a]=t;return 2===t.length&&!!n&&!!a}},54639:function(e){e.exports={tabContent:"AuthModal_tabContent__KgMU3",icon:"AuthModal_icon__kpEuV"}},50501:function(e){e.exports={codeInputContainer:"FediAuthModal_codeInputContainer__M_dAD",codeInput:"FediAuthModal_codeInput__dIE6u",submitButton:"FediAuthModal_submitButton__iuF9R"}}}]);