Take control over your live stream video by running it yourself. Streaming + chat out of the box.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
7.4 KiB

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[17],{91017:function(e,n,t){t.d(n,{Z:function(){return A}});var a=t(34051),r=t.n(a),l=t(85893),o=t(67294),i=t(84916),s=t(71577),c=t(69677),u=t(17962),d=t(52455),f=t(48689),p=t(38939),m=t(58827),h=t(25964);function v(e){var n=e.iconList,t=e.selectedOption,a=e.onSelected,r=""===t?null:t;return(0,l.jsxs)("div",{className:"social-dropdown-container",children:[(0,l.jsx)("p",{className:"description",children:"If you are looking for a platform name not on this list, please select Other and type in your own name. A logo will not be provided."}),(0,l.jsxs)("div",{className:"formfield-container",children:[(0,l.jsx)("div",{className:"label-side",children:(0,l.jsx)("span",{className:"formfield-label",children:"Social Platform"})}),(0,l.jsx)("div",{className:"input-side",children:(0,l.jsxs)(p.Z,{style:{width:240},className:"social-dropdown",placeholder:"Social platform...",defaultValue:r,value:r,onSelect:function(e){a&&a(e)},children:[n.map((function(e){var n=e.platform,t=e.icon,a=e.key,r="".concat(m.WB).concat(t.slice(1));return(0,l.jsxs)(p.Z.Option,{className:"social-option",value:a,children:[(0,l.jsx)("span",{className:"option-icon",children:(0,l.jsx)("img",{src:r,alt:"",className:"option-icon"})}),(0,l.jsx)("span",{className:"option-label",children:n})]},"platform-".concat(a))})),(0,l.jsx)(p.Z.Option,{className:"social-option",value:h.z_,children:"Other..."},"platform-".concat(h.z_))]})})]})]})}var j=t(35159),x=t(19411),y=t(48419),b=t(83192),N=t(78464);function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,a=new Array(n);t<n;t++)a[t]=e[t];return a}function k(e,n,t,a,r,l,o){try{var i=e[l](o),s=i.value}catch(c){return void t(c)}i.done?n(s):Promise.resolve(s).then(a,r)}function w(e){return function(){var n=this,t=arguments;return new Promise((function(a,r){var l=e.apply(n,t);function o(e){k(l,a,r,o,i,"next",e)}function i(e){k(l,a,r,o,i,"throw",e)}o(void 0)}))}}function S(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function O(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},a=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(a=a.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),a.forEach((function(n){S(e,n,t[n])}))}return e}function Z(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"===typeof e)return g(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=i.Z.Title;function A(){var e=(0,o.useState)([]),n=e[0],t=e[1],a=(0,o.useState)([]),i=a[0],p=a[1],g=(0,o.useState)(!1),k=g[0],A=g[1],P=(0,o.useState)(!1),E=P[0],I=P[1],z=(0,o.useState)(!1),_=z[0],T=z[1],H=(0,o.useState)(-1),L=H[0],U=H[1],B=(0,o.useState)(h.wC),D=B[0],V=B[1],W=(0,o.useState)(null),$=W[0],F=W[1],K=(0,o.useContext)(j.aC)||{},M=K.serverConfig,Q=K.setFieldInConfigState,R=M.instanceDetails,Y=R.socialHandles,q=null,G=function(){var e=w(r().mark((function e(){var n,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,m.rQ)(m.$i,{auth:!1});case 3:n=e.sent,a=Object.keys(n).map((function(e){return O({key:e},n[e])})),t(a),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.log(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),J=function(e){return n.find((function(n){return n.key===e}))||!1},X=""!==D.platform&&!n.find((function(e){return e.key===D.platform}));(0,o.useEffect)((function(){G()}),[]),(0,o.useEffect)((function(){R.socialHandles&&p(Y)}),[R]);var ee=function(){F(null),q=null,clearTimeout(q)},ne=function(){A(!1),U(-1),I(!1),T(!1),V(O({},h.wC))},te=function(){ne()},ae=function(e,n){V(O({},D,S({},e,n)))},re=function(){var e=w(r().mark((function e(n){return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,h.Si)({apiPath:h.c9,data:{value:n},onSuccess:function(){Q({fieldName:"socialHandles",value:n,path:"instanceDetails"}),T(!1),te(),F((0,b.kg)(b.zv)),q=setTimeout(ee,h.sI)},onError:function(e){F((0,b.kg)(b.Un,"There was an error: ".concat(e))),T(!1),q=setTimeout(ee,h.sI)}});case 2:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),le=[{title:"Social Link",dataIndex:"",key:"combo",render:function(e,n){var t=n.platform,a=n.url,r=J(t);if(!r)return(0,l.jsx)("div",{className:"social-handle-cell",children:(0,l.jsxs)("p",{className:"option-label",children:[(0,l.jsx)("strong",{children:t}),(0,l.jsx)("span",{className:"handle-url",title:a,children:a})]})});var o=r.icon,i=r.platform,s="".concat(m.WB).concat(o.slice(1));return(0,l.jsxs)("div",{className:"social-handle-cell",children:[(0,l.jsx)("span",{className:"option-icon",children:(0,l.jsx)("img",{src:s,alt:"",className:"option-icon"})}),(0,l.jsxs)("p",{className:"option-label",children:[(0,l.jsx)("strong",{children:i}),(0,l.jsx)("span",{className:"handle-url",title:a,children:a})]})]})}},{title:"",dataIndex:"",key:"edit",render:function(e,n,t){return(0,l.jsxs)("div",{className:"actions",children:[(0,l.jsx)(s.Z,{size:"small",onClick:function(){var e=i[t];U(t),V(O({},e)),A(!0),J(e.platform)||I(!0)},children:"Edit"}),(0,l.jsx)(s.Z,{className:"delete-button",icon:(0,l.jsx)(f.Z,{}),size:"small",onClick:function(){return function(e){var n=Z(i);n.splice(e,1),re(n)}(t)}})]})}}],oe={disabled:!(0,x.Z)(D.url)},ie=(0,l.jsxs)("div",{className:"other-field-container formfield-container",children:[(0,l.jsx)("div",{className:"label-side"}),(0,l.jsx)("div",{className:"input-side",children:(0,l.jsx)(c.Z,{placeholder:"Other platform name",defaultValue:D.platform,onChange:function(e){var n=e.target.value;ae("platform",n)}})})]});return(0,l.jsxs)("div",{className:"social-links-edit-container",children:[(0,l.jsx)(C,{level:3,className:"section-title",children:"Your Social Handles"}),(0,l.jsx)("p",{className:"description",children:"Add all your social media handles and links to your other profiles here."}),(0,l.jsx)(N.Z,{status:$}),(0,l.jsx)(u.Z,{className:"social-handles-table",pagination:!1,size:"small",rowKey:function(e){return"".concat(e.platform,"-").concat(e.url)},columns:le,dataSource:i}),(0,l.jsx)(d.Z,{title:"Edit Social Handle",visible:k,onOk:function(){T(!0);var e=i.length?Z(i):[];-1===L?e.push(D):e.splice(L,1,D),re(e)},onCancel:te,confirmLoading:_,okButtonProps:oe,children:(0,l.jsxs)("div",{className:"social-handle-modal-content",children:[(0,l.jsx)(v,{iconList:n,selectedOption:X?h.z_:D.platform,onSelected:function(e){e===h.z_?(I(!0),ae("platform","")):(I(!1),ae("platform",e))}}),E&&ie,(0,l.jsx)("br",{}),(0,l.jsx)(y.ZP,{fieldName:"social-url",label:"URL",placeholder:{mastodon:"https://mastodon.social/@username",twitter:"https://twitter.com/username"}[D.platform]||"Url to page",value:D.url,onChange:function(e){var n=e.value;ae("url",n)},useTrim:!0,type:"url",pattern:x.a}),(0,l.jsx)(N.Z,{status:$})]})}),(0,l.jsx)("br",{}),(0,l.jsx)(s.Z,{type:"primary",onClick:function(){ne(),A(!0)},children:"Add a new social link"})]})}}}]);