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.

2 lines
20 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{267:function(e,t,a){"use strict";a.d(t,"a",(function(){return v}));var o=a(13),n=a.n(o),i=a(222),r=a(151),s=a(149),l=a(129),c=a(202),m=a(124),u=a(122),d=a(121),h=a(166);const p="mx_profile_displayname",b="mx_profile_avatar_url";class v extends c.a{constructor(){super(m.a,{displayName:window.localStorage.getItem(p)||void 0,avatarUrl:window.localStorage.getItem(b)||void 0}),n()(this,"monitoredUser",void 0),n()(this,"onProfileUpdate",Object(s.throttle)((async()=>{const e=await this.matrixClient.getProfileInfo(this.matrixClient.getUserId());e.displayname?window.localStorage.setItem(p,e.displayname):window.localStorage.removeItem(p),e.avatar_url?window.localStorage.setItem(b,e.avatar_url):window.localStorage.removeItem(b),await this.updateState({displayName:e.displayname,avatarUrl:e.avatar_url,fetchedAt:Date.now()})}),200,{trailing:!0,leading:!0})),n()(this,"onStateEvents",(async e=>{const t=u.a.get().getUserId();e.getType()===l.b.RoomMember&&e.getSender()===t&&e.getStateKey()===t&&await this.onProfileUpdate()}))}static get instance(){return v.internalInstance}get displayName(){return this.matrixClient?this.matrixClient.isGuest()?Object(d.a)("Guest"):this.state.displayName?this.state.displayName:this.matrixClient.getUserId():this.state.displayName||null}get isProfileInfoFetched(){return!!this.state.fetchedAt}get avatarMxc(){return this.state.avatarUrl||null}getHttpAvatarUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!this.avatarMxc)return null;const t=Object(h.b)(this.avatarMxc);return!e||e<=0?t.srcHttp:t.getSquareThumbnailHttp(e)}async onNotReady(){var e;this.monitoredUser&&(this.monitoredUser.removeListener(i.b.DisplayName,this.onProfileUpdate),this.monitoredUser.removeListener(i.b.AvatarUrl,this.onProfileUpdate)),null===(e=this.matrixClient)||void 0===e||e.removeListener(r.b.Events,this.onStateEvents),await this.reset({})}async onReady(){const e=this.matrixClient.getUserId();this.monitoredUser=this.matrixClient.getUser(e),this.monitoredUser&&(this.monitoredUser.on(i.b.DisplayName,this.onProfileUpdate),this.monitoredUser.on(i.b.AvatarUrl,this.onProfileUpdate)),this.matrixClient.on(r.b.Events,this.onStateEvents),await this.onProfileUpdate()}async onAction(e){}}n()(v,"internalInstance",(()=>{const e=new v;return e.start(),e})())},637:function(e,t,a){"use strict";a.d(t,"a",(function(){return b}));var o=a(130),n=a.n(o),i=a(132),r=a.n(i),s=a(120),l=a.n(s),c=a(126),m=a.n(c),u=a(148),d=a(647),h=a(176);const p=["title","children","className","iconClassName"],b=e=>{let{title:t,children:a,className:o,iconClassName:i}=e,c=r()(e,p);return!!Object(s.useContext)(d.a)?l.a.createElement(h.b,n()({},c,{iconClassName:i,label:t})):l.a.createElement(u.a,n()({},c,{title:t,className:m()(o,i)}),a)}},647:function(e,t,a){"use strict";a.d(t,"a",(function(){return xe}));var o=a(13),n=a.n(o),i=a(130),r=a.n(i),s=a(126),l=a.n(s),c=a(187),m=a(120),u=a.n(m),d=a(170),h=a(121),p=a(148),b=a(637),v=a(124),g=a(144),_=a(150),C=a(133),y=a(537),k=a.n(y),E=a(1),x=a(147),f=a(127),O=a(241),j=a(268),M=a(230),w=a(123),S=a(610),N=a(165),L=a(279);const P={fifteenMins:9e5,oneHour:36e5,eightHours:288e5},T=P.fifteenMins,U=e=>Object(h.a)("Share for %(duration)s",{duration:Object(N.b)(e)});var B=e=>{let{timeout:t,onChange:a}=e;const o=Object.values(P).map((e=>({key:e.toString(),duration:e,label:U(e)})));Object.values(P).includes(t)||o.push({key:t.toString(),duration:t,label:U(t)});return u.a.createElement(L.a,{id:"live-duration","data-testid":"live-duration-dropdown",label:U(t),value:t.toString(),onOptionChange:e=>{a(+e)},className:"mx_LiveDurationDropdown"},o.map((e=>{let{key:t,label:a}=e;return u.a.createElement("div",{"data-test-id":`live-duration-option-${t}`,key:t},a)})))},I=a(269),R=a(30),D=a(155),F=a(131),A=a(339),G=a(270);let H;!function(e){e.Own="Own",e.Pin="Pin",e.Live="Live"}(H||(H={}));const W=(e,t,a)=>{const{modalParams:o,errorMessage:n}="M_FORBIDDEN"===e.errcode?(e=>{const t=e===H.Live?"Insufficient permissions to start sharing your live location":"Insufficient permissions to sen
//# sourceMappingURL=10.js.map