/*! For license information please see vendors~init.js.LICENSE.txt */ (window.webpackJsonp=window.webpackJsonp||[]).push([[25],[function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(4),r=n.n(o);r.a.methodFactory=function(e,t,n){return function(...t){this.prefix&&t.unshift(this.prefix);return"error"===e||"warn"===e||"trace"===e||"info"===e?console[e](...t):console.log(...t)}};const i=r.a.getLogger("matrix");function a(e){e.withPrefix=function(e){return function(e){const t=r.a.getLogger("matrix-"+e);t.prefix!==e&&(a(t),t.prefix=e,t.setLevel(r.a.levels.DEBUG));return t}((this.prefix||"")+e)}}i.setLevel(r.a.levels.DEBUG),a(i)},function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"g",(function(){return a})),n.d(t,"u",(function(){return s})),n.d(t,"n",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return u})),n.d(t,"j",(function(){return h})),n.d(t,"m",(function(){return p})),n.d(t,"r",(function(){return m})),n.d(t,"p",(function(){return g})),n.d(t,"v",(function(){return f})),n.d(t,"q",(function(){return _})),n.d(t,"i",(function(){return v})),n.d(t,"l",(function(){return y})),n.d(t,"h",(function(){return E})),n.d(t,"w",(function(){return S})),n.d(t,"o",(function(){return w})),n.d(t,"e",(function(){return C})),n.d(t,"s",(function(){return T})),n.d(t,"t",(function(){return x})),n.d(t,"b",(function(){return O})),n.d(t,"k",(function(){return R}));var o=n(30),r=n.n(o);function i(e){let t="";for(const n in e)e.hasOwnProperty(n)&&(t+="&"+encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.substring(1)}function a(e,t){for(const n in t)t.hasOwnProperty(n)&&(e=e.replace(n,encodeURIComponent(t[n])));return e}function s(e,t,n){let o,r;if(n){for(o=e.length-1;o>=0;o--)if(t(e[o],o,e))return r=e[o],e.splice(o,1),r}else for(o=0;o?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g,"").toLowerCase()}const b=/[\u2000-\u200F\u202A-\u202F\u0300-\u036f\uFEFF\s]/g;function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function y(e,t){t="boolean"!=typeof t||t;let n=v(e);return n=n.replace(/\\\*/g,".*"),n=n.replace(/\?/g,"."),t&&(n=n.replace(/\\\[(!|)(.*)\\]/g,(function(e,t,n,o,r){return"["+(t?"^":"")+n.replace(/\\-/,"-")+"]"}))),n}function E(e){return e&&e.endsWith("/")?e.substr(0,e.length-1):e}function S(e,t){return new Promise(n=>{setTimeout(n,e,t)})}function w(e){return null==e}function C(){let e,t;const n=new Promise((n,o)=>{e=n,t=o});return{resolve:e,reject:t,promise:n}}async function T(e,t){for(const n of await e)await t(await n)}function x(e){return new Promise(t=>t(e()))}async function O(e,t){const n=[];for(let o=0;oe())));return n}let k;function R(){return k}},,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(40);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var r=n(41);Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}));var i=n(42);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var a=n(12);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var s=n(43);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var c=n(44);Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}})}));var l=n(45);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}));var d=n(46);Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}})}));var u=n(21);Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}})}));var h=n(47);Object.keys(h).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return h[e]}})}));var p=n(48);Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return p[e]}})}));var m=n(49);Object.keys(m).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return m[e]}})}));var g=n(13);Object.keys(g).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return g[e]}})}));var f=n(10);Object.keys(f).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return f[e]}})}));var _=n(11);Object.keys(_).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return _[e]}})}));var b=n(23);Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return b[e]}})}));var v=n(50);Object.keys(v).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return v[e]}})}));var y=n(51);Object.keys(y).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return y[e]}})}));var E=n(52);Object.keys(E).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return E[e]}})}));var S=n(53);Object.keys(S).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return S[e]}})}));var w=n(54);Object.keys(w).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return w[e]}})}));var C=n(55);Object.keys(C).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return C[e]}})}));var T=n(56);Object.keys(T).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return T[e]}})}));var x=n(14);Object.keys(x).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return x[e]}})}));var O=n(57);Object.keys(O).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return O[e]}})}));var k=n(58);Object.keys(k).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return k[e]}})}));var R=n(59);Object.keys(R).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return R[e]}})}));var I=n(22);Object.keys(I).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}})}));var D=n(60);Object.keys(D).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return D[e]}})}));var A=n(61);Object.keys(A).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return A[e]}})}));var N=n(62);Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return N[e]}})}));var F=n(63);Object.keys(F).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return F[e]}})}));var M=n(64);Object.keys(M).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return M[e]}})}));var P=n(65);Object.keys(P).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return P[e]}})}));var L=n(15);Object.keys(L).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return L[e]}})}));var j=n(25);Object.keys(j).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return j[e]}})}));var U=n(26);Object.keys(U).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return U[e]}})}));var B=n(27);Object.keys(B).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return B[e]}})}));var G=n(66);Object.keys(G).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return G[e]}})}));var q=n(67);Object.keys(q).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return q[e]}})}));var V=n(24);Object.keys(V).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return V[e]}})}));var H=n(68);Object.keys(H).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return H[e]}})}))},function(e,t,n){var o,r;!function(i,a){"use strict";void 0===(r="function"==typeof(o=function(){var e=function(){},t="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function o(e,t){var n=e[t];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function r(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function i(n){return"debug"===n&&(n="log"),"undefined"!=typeof console&&("trace"===n&&t?r:void 0!==console[n]?o(console,n):void 0!==console.log?o(console,"log"):e)}function a(t,o){for(var r=0;r=0&&t<=i.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(r=t,!1!==o&&function(e){var t=(n[e]||"silent").toUpperCase();if("undefined"!=typeof window&&s){try{return void(window.localStorage[s]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(s)+"="+t+";"}catch(e){}}}(t),a.call(i,t,e),"undefined"==typeof console&&t0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=h.bind(o);return r.listener=n,o.wrapFn=r,r}function m(e,t,n){var o=e._events;if(void 0===o)return[];var r=o[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var l=c.length,d=f(c,l);for(n=0;n=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;o--)this.removeListener(e,t[o]);return this},s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(e,t,n){"use strict";function o(e,t){return Number.isFinite(e)?Number(e):t}function r(e,t,n){return Math.min(Math.max(e,t),n)}function i(...e){return[...e].reduce((e,t)=>t+e,0)}function a(e,t,n){return e*(n-t)+t}function s(e,t,n){return(e-t)/(n-t)}n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"e",(function(){return i})),n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return s}))},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.invertedDirection=function(e){if(e===o.ToWidget)return o.FromWidget;if(e===o.FromWidget)return o.ToWidget;throw new Error("Invalid direction")},t.WidgetApiDirection=void 0,t.WidgetApiDirection=o,function(e){e.ToWidget="toWidget",e.FromWidget="fromWidget"}(o||(t.WidgetApiDirection=o={}))},function(e,t,n){"use strict";var o,r;Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentApiVersions=t.UnstableApiVersion=t.MatrixApiVersion=void 0,t.MatrixApiVersion=o,function(e){e.Prerelease1="0.0.1",e.Prerelease2="0.0.2"}(o||(t.MatrixApiVersion=o={})),t.UnstableApiVersion=r,function(e){e.MSC2762="org.matrix.msc2762",e.MSC2871="org.matrix.msc2871",e.MSC2931="org.matrix.msc2931",e.MSC2974="org.matrix.msc2974",e.MSC2876="org.matrix.msc2876"}(r||(t.UnstableApiVersion=r={}));var i=[o.Prerelease1,o.Prerelease2,r.MSC2762,r.MSC2871,r.MSC2931,r.MSC2974,r.MSC2876];t.CurrentApiVersions=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PostmessageTransport=void 0;var o=n(8),r=n(3);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function s(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:null;return!this.isState&&this.eventType===e&&("m.room.message"!==this.eventType||null===this.keyStr||this.keyStr===t)}}])&&i(t.prototype,n),r&&i(t,r),e}();t.WidgetEventCapability=s},,,function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){var o,r,i;r=[],void 0===(i="function"==typeof(o=function(){var e=XMLHttpRequest;if(!e)throw new Error("missing XMLHttpRequest");function t(i,a){if("function"!=typeof a)throw new Error("Bad callback given: "+a);if(!i)throw new Error("No options given");var s=i.onResponse;if((i="string"==typeof i?{uri:i}:JSON.parse(JSON.stringify(i))).onResponse=s,i.verbose&&(t.log=function(){var e,t,n={},i=["trace","debug","info","warn","error"];for(t=0;t>18&63,i=c>>12&63,a=c>>6&63,s=63&c,p[u++]=l.charAt(r)+l.charAt(i)+l.charAt(a)+l.charAt(s)}while(d299)&&o.error){for(var r in e=new Error("CouchDB error: "+(o.error.reason||o.error.error)),o)e[r]=o[r];return n(e,t,o)}return n(e,t,o)}))},t})?o.apply(t,r):o)||(e.exports=i)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(0),r=n(1);class i{constructor(e){(e=e||{}).maxTimelineEntries=e.maxTimelineEntries||50,this.opts=e,this.accountData={},this.inviteRooms={},this.joinRooms={},this.nextBatch=null,this.groups={invite:{},join:{},leave:{}}}accumulate(e,t){this._accumulateRooms(e,t),this._accumulateGroups(e),this._accumulateAccountData(e),this.nextBatch=e.next_batch}_accumulateAccountData(e){e.account_data&&e.account_data.events&&e.account_data.events.forEach(e=>{this.accountData[e.type]=e})}_accumulateRooms(e,t){e.rooms&&(e.rooms.invite&&Object.keys(e.rooms.invite).forEach(n=>{this._accumulateRoom(n,"invite",e.rooms.invite[n],t)}),e.rooms.join&&Object.keys(e.rooms.join).forEach(n=>{this._accumulateRoom(n,"join",e.rooms.join[n],t)}),e.rooms.leave&&Object.keys(e.rooms.leave).forEach(n=>{this._accumulateRoom(n,"leave",e.rooms.leave[n],t)}))}_accumulateRoom(e,t,n,r){switch(t){case"invite":this._accumulateInviteState(e,n);break;case"join":this.inviteRooms[e]&&delete this.inviteRooms[e],this._accumulateJoinState(e,n,r);break;case"leave":this.inviteRooms[e]?delete this.inviteRooms[e]:delete this.joinRooms[e];break;default:o.a.error("Unknown cateogory: ",t)}}_accumulateInviteState(e,t){if(!t.invite_state||!t.invite_state.events)return;if(!this.inviteRooms[e])return void(this.inviteRooms[e]={invite_state:t.invite_state});const n=this.inviteRooms[e];t.invite_state.events.forEach(e=>{let t=!1;for(let o=0;o{o._accountData[e.type]=e}),t.unread_notifications&&(o._unreadNotifications=t.unread_notifications),t.summary){const e="m.heroes",n="m.invited_member_count",r="m.joined_member_count",i=o._summary,a=t.summary;i[e]=a[e]||i[e],i[r]=a[r]||i[r],i[n]=a[n]||i[n]}if(t.ephemeral&&t.ephemeral.events&&t.ephemeral.events.forEach(e=>{"m.receipt"===e.type&&e.content&&Object.keys(e.content).forEach(t=>{e.content[t]["m.read"]&&Object.keys(e.content[t]["m.read"]).forEach(n=>{o._readReceipts[n]={data:e.content[t]["m.read"][n],eventId:t}})})}),t.timeline&&t.timeline.limited&&(o._timeline=[]),t.state&&t.state.events&&t.state.events.forEach(e=>{a(o._currentState,e)}),t.timeline&&t.timeline.events&&t.timeline.events.forEach((e,r)=>{let i;if(a(o._currentState,e),n)i=e;else{i=Object.assign({},e),void 0!==i.unsigned&&(i.unsigned=Object.assign({},i.unsigned));const t=e.unsigned?e.unsigned.age:e.age;void 0!==t&&(i._localTs=Date.now()-t)}o._timeline.push({event:i,token:0===r?t.timeline.prev_batch:null})}),o._timeline.length>this.opts.maxTimelineEntries){for(let e=o._timeline.length-this.opts.maxTimelineEntries;e{this._accumulateGroup(t,"invite",e.groups.invite[t])}),e.groups.join&&Object.keys(e.groups.join).forEach(t=>{this._accumulateGroup(t,"join",e.groups.join[t])}),e.groups.leave&&Object.keys(e.groups.leave).forEach(t=>{this._accumulateGroup(t,"leave",e.groups.leave[t])}))}_accumulateGroup(e,t,n){for(const t of["invite","join","leave"])delete this.groups[t][e];this.groups[t][e]=n}getJSON(e){const t={join:{},invite:{},leave:{}};Object.keys(this.inviteRooms).forEach(e=>{t.invite[e]=this.inviteRooms[e]}),Object.keys(this.joinRooms).forEach(n=>{const o=this.joinRooms[n],i={ephemeral:{events:[]},account_data:{events:[]},state:{events:[]},timeline:{events:[],prev_batch:null},unread_notifications:o._unreadNotifications,summary:o._summary};Object.keys(o._accountData).forEach(e=>{i.account_data.events.push(o._accountData[e])});const s={type:"m.receipt",room_id:n,content:{}};Object.keys(o._readReceipts).forEach(e=>{const t=o._readReceipts[e];s.content[t.eventId]||(s.content[t.eventId]={"m.read":{}}),s.content[t.eventId]["m.read"][e]=t.data}),Object.keys(s.content).length>0&&i.ephemeral.events.push(s),o._timeline.forEach(t=>{if(!i.timeline.prev_batch){if(!t.token)return;i.timeline.prev_batch=t.token}let n;!e&&t.event._localTs?(n=Object.assign({},t.event),void 0!==n.unsigned&&(n.unsigned=Object.assign({},n.unsigned)),delete n._localTs,n.unsigned=n.unsigned||{},n.unsigned.age=Date.now()-t.event._localTs):n=t.event,i.timeline.events.push(n)});const c=Object.create(null);for(let e=i.timeline.events.length-1;e>=0;e--){const t=i.timeline.events[e];if(null===t.state_key||void 0===t.state_key)continue;const n=Object(r.d)(t);n.unsigned&&(n.unsigned.prev_content&&(n.content=n.unsigned.prev_content),n.unsigned.prev_sender&&(n.sender=n.unsigned.prev_sender)),a(c,n)}Object.keys(o._currentState).forEach(e=>{Object.keys(o._currentState[e]).forEach(t=>{let n=o._currentState[e][t];c[e]&&c[e][t]&&(n=c[e][t]),i.state.events.push(n)})}),t.join[n]=i});const n=[];return Object.keys(this.accountData).forEach(e=>{n.push(this.accountData[e])}),{nextBatch:this.nextBatch,roomsData:t,groupsData:this.groups,accountData:n}}getNextBatchToken(){return this.nextBatch}}function a(e,t){null!==t.state_key&&void 0!==t.state_key&&t.type&&(e[t.type]||(e[t.type]=Object.create(null)),e[t.type][t.state_key]=t)}},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.MatrixWidgetType=void 0,t.MatrixWidgetType=o,function(e){e.Custom="m.custom",e.JitsiMeet="m.jitsi",e.Stickerpicker="m.stickerpicker"}(o||(t.MatrixWidgetType=o={}))},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.BuiltInModalButtonID=void 0,t.BuiltInModalButtonID=o,function(e){e.Close="m.close"}(o||(t.BuiltInModalButtonID=o={}))},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.VideoConferenceCapabilities=t.StickerpickerCapabilities=t.MatrixCapabilities=void 0,t.MatrixCapabilities=o,function(e){e.Screenshots="m.capability.screenshot",e.StickerSending="m.sticker",e.AlwaysOnScreen="m.always_on_screen",e.MSC2931Navigate="org.matrix.msc2931.navigate"}(o||(t.MatrixCapabilities=o={}));var r=[o.StickerSending];t.StickerpickerCapabilities=r;var i=[o.AlwaysOnScreen];t.VideoConferenceCapabilities=i},function(e,t,n){"use strict";function o(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw a}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n{let r=!0;const i=e.open(t);i.onupgradeneeded=()=>{r=!1},i.onblocked=()=>o(),i.onsuccess=()=>{i.result.close(),r||e.deleteDatabase(t),n(r)},i.onerror=e=>o(e.target.error)})}n.d(t,"a",(function(){return o}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n(20),r=n(1),i=n(28),a=n(0);function s(e,t,n){const o=e.openCursor(t);return new Promise((e,t)=>{const r=[];o.onerror=e=>{t(new Error("Query failed: "+e.target.errorCode))},o.onsuccess=t=>{const o=t.target.result;o?(r.push(n(o)),o.continue()):e(r)}})}function c(e){return new Promise((t,n)=>{e.oncomplete=function(e){t(e)},e.onerror=function(e){n(e.target.error)}})}function l(e){return new Promise((t,n)=>{e.onsuccess=function(e){t(e)},e.onerror=function(e){n(e.target.error)}})}function d(e){return l(e).then(e=>e.target.result)}function u(e,t){this.indexedDB=e,this._dbName="matrix-js-sdk:"+(t||"default"),this.db=null,this._disconnected=!0,this._syncAccumulator=new o.a,this._isNewlyCreated=!1}u.exists=function(e,t){return t="matrix-js-sdk:"+(t||"default"),i.a(e,t)},u.prototype={connect:function(){if(!this._disconnected)return a.a.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this._disconnected=!1,a.a.log("LocalIndexedDBStoreBackend.connect: connecting...");const e=this.indexedDB.open(this._dbName,3);return e.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;a.a.log("LocalIndexedDBStoreBackend.connect: upgrading from "+n),n<1&&(this._isNewlyCreated=!0,function(e){e.createObjectStore("users",{keyPath:["userId"]}),e.createObjectStore("accountData",{keyPath:["type"]}),e.createObjectStore("sync",{keyPath:["clobber"]})}(t)),n<2&&function(e){e.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]}).createIndex("room","room_id")}(t),n<3&&function(e){e.createObjectStore("client_options",{keyPath:["clobber"]})}(t)},e.onblocked=()=>{a.a.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},a.a.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),l(e).then(e=>(a.a.log("LocalIndexedDBStoreBackend.connect: connected"),this.db=e.target.result,this.db.onversionchange=()=>{this.db.close()},this._init()))},isNewlyCreated:function(){return Promise.resolve(this._isNewlyCreated)},_init:function(){return Promise.all([this._loadAccountData(),this._loadSyncData()]).then(([e,t])=>{a.a.log("LocalIndexedDBStoreBackend: loaded initial data"),this._syncAccumulator.accumulate({next_batch:t.nextBatch,rooms:t.roomsData,groups:t.groupsData,account_data:{events:e}},!0)})},getOutOfBandMembers:function(e){return new Promise((t,n)=>{const o=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),r=IDBKeyRange.only(e),i=o.openCursor(r),a=[];let s=!1;i.onsuccess=e=>{const n=e.target.result;if(!n)return a.length||s?t(a):t(null);const o=n.value;o.oob_written?s=!0:a.push(o),n.continue()},i.onerror=e=>{n(e)}}).then(t=>(a.a.log("LL: got "+(t&&t.length)+` membershipEvents from storage for room ${e} ...`),t))},setOutOfBandMembers:async function(e,t){a.a.log("LL: backend about to store "+t.length+" members for "+e);const n=this.db.transaction(["oob_membership_events"],"readwrite"),o=n.objectStore("oob_membership_events");t.forEach(e=>{o.put(e)});const r={room_id:e,oob_written:!0,state_key:0};o.put(r),await c(n),a.a.log(`LL: backend done storing for ${e}!`)},clearOutOfBandMembers:async function(e){const t=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),n=IDBKeyRange.only(e),o=d(t.openKeyCursor(n,"next")).then(e=>e&&e.primaryKey[1]),r=d(t.openKeyCursor(n,"prev")).then(e=>e&&e.primaryKey[1]),[i,s]=await Promise.all([o,r]),c=this.db.transaction(["oob_membership_events"],"readwrite").objectStore("oob_membership_events"),l=IDBKeyRange.bound([e,i],[e,s]);var u;a.a.log(`LL: Deleting all users + marker in storage for room ${e}, with key range:`,[e,i],[e,s]),await(u=c.delete(l),new Promise((e,t)=>{u.onsuccess=()=>e(u),u.onerror=e=>t(e)}))},clearDatabase:function(){return new Promise((e,t)=>{a.a.log("Removing indexeddb instance: "+this._dbName);const n=this.indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{a.a.log("can't yet delete indexeddb "+this._dbName+" because it is open elsewhere")},n.onerror=t=>{a.a.warn("unable to delete js-sdk store indexeddb: "+t.target.error),e()},n.onsuccess=()=>{a.a.log("Removed indexeddb instance: "+this._dbName),e()}})},getSavedSync:function(e){void 0===e&&(e=!0);const t=this._syncAccumulator.getJSON();return t.nextBatch?e?Promise.resolve(r.d(t)):Promise.resolve(t):Promise.resolve(null)},getNextBatchToken:function(){return Promise.resolve(this._syncAccumulator.getNextBatchToken())},setSyncData:function(e){return Promise.resolve().then(()=>{this._syncAccumulator.accumulate(e)})},syncToDatabase:function(e){const t=this._syncAccumulator.getJSON(!0);return Promise.all([this._persistUserPresenceEvents(e),this._persistAccountData(t.accountData),this._persistSyncData(t.nextBatch,t.roomsData,t.groupsData)])},_persistSyncData:function(e,t,n){return a.a.log("Persisting sync data up to",e),r.t(()=>{const o=this.db.transaction(["sync"],"readwrite");return o.objectStore("sync").put({clobber:"-",nextBatch:e,roomsData:t,groupsData:n}),c(o)})},_persistAccountData:function(e){return r.t(()=>{const t=this.db.transaction(["accountData"],"readwrite"),n=t.objectStore("accountData");for(let t=0;t{const t=this.db.transaction(["users"],"readwrite"),n=t.objectStore("users");for(const t of e)n.put({userId:t[0],event:t[1]});return c(t)})},getUserPresenceEvents:function(){return r.t(()=>s(this.db.transaction(["users"],"readonly").objectStore("users"),void 0,e=>[e.value.userId,e.value.event]))},_loadAccountData:function(){return a.a.log("LocalIndexedDBStoreBackend: loading account data..."),r.t(()=>s(this.db.transaction(["accountData"],"readonly").objectStore("accountData"),void 0,e=>e.value).then(e=>(a.a.log("LocalIndexedDBStoreBackend: loaded account data"),e)))},_loadSyncData:function(){return a.a.log("LocalIndexedDBStoreBackend: loading sync data..."),r.t(()=>s(this.db.transaction(["sync"],"readonly").objectStore("sync"),void 0,e=>e.value).then(e=>(a.a.log("LocalIndexedDBStoreBackend: loaded sync data"),e.length>1&&a.a.warn("loadSyncData: More than 1 sync row found."),e.length>0?e[0]:{})))},getClientOptions:function(){return Promise.resolve().then(()=>s(this.db.transaction(["client_options"],"readonly").objectStore("client_options"),void 0,e=>{if(e.value&&e.value&&e.value.options)return e.value.options}).then(e=>e[0]))},storeClientOptions:async function(e){const t=this.db.transaction(["client_options"],"readwrite");t.objectStore("client_options").put({clobber:"-",options:e}),await c(t)}}},function(e,t,n){"use strict";var o=n(36);var r=RegExp(Object.keys(o).map((function(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")})).join("|"),"g");function i(e){return o[e]}e.exports=function(e){return e.replace(r,i)}},,,,,function(e,t,n){"use strict";(function(e){var o=n(37),r=n(38),i=n(39);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(e).length;default:if(o)return B(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,n){var o=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return x(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function f(e,t,n){var o=e[t];e[t]=e[n],e[n]=o}function _(e,t,n,o,r){if(0===e.length)return-1;if("string"==typeof n?(o=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=c.from(t,o)),c.isBuffer(t))return 0===t.length?-1:b(e,t,n,o,r);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,o,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,o,r){var i,a=1,s=e.length,c=t.length;if(void 0!==o&&("ucs2"===(o=String(o).toLowerCase())||"ucs-2"===o||"utf16le"===o||"utf-16le"===o)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var d=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){for(var u=!0,h=0;hr&&(o=r):o=r;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");o>i/2&&(o=i/2);for(var a=0;a>8,r=n%256,i.push(r),i.push(o);return i}(t,e.length-n),e,n,o)}function T(e,t,n){return 0===t&&n===e.length?o.fromByteArray(e):o.fromByteArray(e.slice(t,n))}function x(e,t,n){n=Math.min(e.length,n);for(var o=[],r=t;r239?4:l>223?3:l>191?2:1;if(r+u<=n)switch(u){case 1:l<128&&(d=l);break;case 2:128==(192&(i=e[r+1]))&&(c=(31&l)<<6|63&i)>127&&(d=c);break;case 3:i=e[r+1],a=e[r+2],128==(192&i)&&128==(192&a)&&(c=(15&l)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(d=c);break;case 4:i=e[r+1],a=e[r+2],s=e[r+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&l)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(d=c)}null===d?(d=65533,u=1):d>65535&&(d-=65536,o.push(d>>>10&1023|55296),d=56320|1023&d),o.push(d),r+=u}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",o=0;for(;o0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},c.prototype.compare=function(e,t,n,o,r){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===o&&(o=0),void 0===r&&(r=this.length),t<0||n>e.length||o<0||r>this.length)throw new RangeError("out of range index");if(o>=r&&t>=n)return 0;if(o>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(r>>>=0)-(o>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),l=this.slice(o,r),d=e.slice(t,n),u=0;ur)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");for(var i=!1;;)switch(o){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return y(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(e,t,n){var o="";n=Math.min(e.length,n);for(var r=t;ro)&&(n=o);for(var r="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,o,r,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function N(e,t,n,o){t<0&&(t=65535+t+1);for(var r=0,i=Math.min(e.length-n,2);r>>8*(o?r:1-r)}function F(e,t,n,o){t<0&&(t=4294967295+t+1);for(var r=0,i=Math.min(e.length-n,4);r>>8*(o?r:3-r)&255}function M(e,t,n,o,r,i){if(n+o>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,o,i){return i||M(e,0,n,4),r.write(e,t,n,o,23,4),n+4}function L(e,t,n,o,i){return i||M(e,0,n,8),r.write(e,t,n,o,52,8),n+8}c.prototype.slice=function(e,t){var n,o=this.length;if((e=~~e)<0?(e+=o)<0&&(e=0):e>o&&(e=o),(t=void 0===t?o:~~t)<0?(t+=o)<0&&(t=0):t>o&&(t=o),t0&&(r*=256);)o+=this[e+--t]*r;return o},c.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var o=this[e],r=1,i=0;++i=(r*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var o=t,r=1,i=this[e+--o];o>0&&(r*=256);)i+=this[e+--o]*r;return i>=(r*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),r.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),r.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),r.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),r.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,o){(e=+e,t|=0,n|=0,o)||A(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+r]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):F(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,o){if(e=+e,t|=0,!o){var r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+n},c.prototype.writeIntBE=function(e,t,n,o){if(e=+e,t|=0,!o){var r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):F(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):F(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,o){if(n||(n=0),o||0===o||(o=this.length),t>=e.length&&(t=e.length),t||(t=0),o>0&&o=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t=0;--r)e[r+t]=this[r+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===o){(t-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function G(e){return o.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,o){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}}).call(this,n(7))},function(e){e.exports=JSON.parse('{"0":"O","1":"l","֭":"֖","֮":"֘","֨":"֙","֤":"֚","᪴":"ۛ","⃛":"ۛ","ؙ":"̓","ࣳ":"̓","̓":"̓","̕":"̓","ُ":"̓","ٝ":"̔","֜":"́","֝":"́","ؘ":"́","݇":"́","́":"́","॔":"́","َ":"́","̀":"̀","॓":"̀","̌":"̆","꙼":"̆","٘":"̆","ٚ":"̆","ͮ":"̆","ۨ":"̆̇","̐":"̆̇","ँ":"̆̇","ঁ":"̆̇","ઁ":"̆̇","ଁ":"̆̇","ఀ":"̆̇","ಁ":"̆̇","ഁ":"̆̇","𑒿":"̆̇","᳐":"̂","̑":"̂","ٛ":"̂","߮":"̂","꛰":"̂","֯":"̊","۟":"̊","៓":"̊","゚":"̊","ْ":"̊","ஂ":"̊","ံ":"̊","ំ":"̊","𑌀":"̊","ํ":"̊","ໍ":"̊","ͦ":"̊","ⷪ":"̊","࣫":"̈","߳":"̈","ً":"̋","ࣰ":"̋","͂":"̃","ٓ":"̃","ׄ":"̇","۬":"̇","݀":"̇","࣪":"̇","݁":"̇","͘":"̇","ֹ":"̇","ֺ":"̇","ׂ":"̇","ׁ":"̇","߭":"̇","ं":"̇","ਂ":"̇","ં":"̇","்":"̇","̷":"̸","᪷":"̨","̢":"̨","ͅ":"̨","᳒":"̄","̅":"̄","ٙ":"̄","߫":"̄","꛱":"̄","᳚":"̎","ٗ":"̒","͗":"͐","ࣿ":"͐","ࣸ":"͐","ऀ":"͒","᳭":"̖","᳜":"̩","ٖ":"̩","᳕":"̫","͇":"̳","ࣹ":"͔","ࣺ":"͕","゛":"゙","゜":"゚","̶":"̵","〬":"̉","ׅ":"̣","࣭":"̣","᳝":"̣","ִ":"̣","ٜ":"̣","़":"̣","়":"̣","਼":"̣","઼":"̣","଼":"̣","𑇊":"̣","𑓃":"̣","𐨺":"̣","࣮":"̤","᳞":"̤","༷":"̥","〭":"̥","̧":"̦","̡":"̦","̹":"̦","᳙":"̭","᳘":"̮","॒":"̱","̠":"̱","ࣱ":"ٌ","ࣨ":"ٌ","ࣥ":"ٌ","ﱞ":"ﹲّ","ࣲ":"ٍ","ﱟ":"ﹴّ","ﳲ":"ﹷّ","ﱠ":"ﹶّ","ﳳ":"ﹹّ","ﱡ":"ﹸّ","ؚ":"ِ","̗":"ِ","ﳴ":"ﹻّ","ﱢ":"ﹺّ","ﱣ":"ﹼٰ","ٟ":"ٕ","̍":"ٰ","݂":"ܼ","ਃ":"ঃ","ః":"ঃ","ಃ":"ঃ","ഃ":"ঃ","ඃ":"ঃ","း":"ঃ","𑓁":"ঃ","់":"่","່":"่","້":"้","໊":"๊","໋":"๋","꙯":"⃩","\\u2028":" ","\\u2029":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" ","ߺ":"_","﹍":"_","﹎":"_","﹏":"_","‐":"-","‑":"-","‒":"-","–":"-","﹘":"-","۔":"-","⁃":"-","˗":"-","−":"-","➖":"-","Ⲻ":"-","⨩":"-̓","⸚":"-̈","﬩":"-̇","∸":"-̇","⨪":"-̣","꓾":"-.","~":"〜","؍":",","٫":",","‚":",","¸":",","ꓹ":",","⸲":"،","٬":"،",";":";","⸵":"؛","ः":":","ઃ":":",":":":","։":":","܃":":","܄":":","᛬":":","︰":":","᠃":":","᠉":":","⁚":":","׃":":","˸":":","꞉":":","∶":":","ː":":","ꓽ":":","⩴":"::=","⧴":":→","!":"!","ǃ":"!","ⵑ":"!","‼":"!!","⁉":"!?","ʔ":"?","Ɂ":"?","ॽ":"?","Ꭾ":"?","ꛫ":"?","⁈":"?!","⁇":"??","⸮":"؟","𝅭":".","․":".","܁":".","܂":".","꘎":".","𐩐":".","٠":".","۰":".","ꓸ":".","ꓻ":".,","‥":"..","ꓺ":"..","…":"...","꛴":"꛳꛳","・":"·","・":"·","᛫":"·","·":"·","⸱":"·","𐄁":"·","•":"·","‧":"·","∙":"·","⋅":"·","ꞏ":"·","ᐧ":"·","⋯":"···","ⵈ":"···","ᑄ":"·<","⋗":"·>","ᐷ":"·>","ᑀ":"·>","ᔯ":"·4","ᑾ":"·b","ᒀ":"·ḃ","ᑺ":"·d","ᒘ":"·J","ᒶ":"·L","ᑶ":"·P","ᑗ":"·U","ᐺ":"·V","ᐼ":"·Ʌ","ᒮ":"·Γ","ᐎ":"·Δ","ᑙ":"·Ո","ᐌ":"·ᐁ","ᐐ":"·ᐄ","ᐒ":"·ᐅ","ᐔ":"·ᐆ","ᐗ":"·ᐊ","ᐙ":"·ᐋ","ᐾ":"·ᐲ","ᑂ":"·ᐴ","ᑆ":"·ᐹ","ᑛ":"·ᑏ","ᑔ":"·ᑐ","ᑝ":"·ᑐ","ᑟ":"·ᑑ","ᑡ":"·ᑕ","ᑣ":"·ᑖ","ᑴ":"·ᑫ","ᑸ":"·ᑮ","ᑼ":"·ᑰ","ᒒ":"·ᒉ","ᒔ":"·ᒋ","ᒖ":"·ᒌ","ᒚ":"·ᒎ","ᒜ":"·ᒐ","ᒞ":"·ᒑ","ᒬ":"·ᒣ","ᒰ":"·ᒦ","ᒲ":"·ᒧ","ᒴ":"·ᒨ","ᒸ":"·ᒫ","ᓉ":"·ᓀ","ᣆ":"·ᓂ","ᣈ":"·ᓃ","ᣊ":"·ᓄ","ᣌ":"·ᓅ","ᓋ":"·ᓇ","ᓍ":"·ᓈ","ᓜ":"·ᓓ","ᓞ":"·ᓕ","ᓠ":"·ᓖ","ᓢ":"·ᓗ","ᓤ":"·ᓘ","ᓦ":"·ᓚ","ᓨ":"·ᓛ","ᓶ":"·ᓭ","ᓸ":"·ᓯ","ᓺ":"·ᓰ","ᓼ":"·ᓱ","ᓾ":"·ᓲ","ᔀ":"·ᓴ","ᔂ":"·ᓵ","ᔗ":"·ᔐ","ᔙ":"·ᔑ","ᔛ":"·ᔒ","ᔝ":"·ᔓ","ᔟ":"·ᔔ","ᔡ":"·ᔕ","ᔣ":"·ᔖ","ᔱ":"·ᔨ","ᔳ":"·ᔩ","ᔵ":"·ᔪ","ᔷ":"·ᔫ","ᔹ":"·ᔭ","ᔻ":"·ᔮ","ᣎ":"·ᕃ","ᣏ":"·ᕆ","ᣐ":"·ᕇ","ᣑ":"·ᕈ","ᣒ":"·ᕉ","ᣓ":"·ᕋ","ᕎ":"·ᕌ","ᕛ":"·ᕚ","ᕨ":"·ᕧ","ᢳ":"·ᢱ","ᢶ":"·ᢴ","ᢹ":"·ᢸ","ᣂ":"·ᣀ","꠰":"।","॥":"।।","᰼":"᰻᰻","။":"၊၊","᪩":"᪨᪨","᪫":"᪪᪨","᭟":"᭞᭞","𐩗":"𐩖𐩖","𑑌":"𑑋𑑋","𑙂":"𑙁𑙁","𑱂":"𑱁𑱁","᱿":"᱾᱾","՝":"\'","'":"\'","‘":"\'","’":"\'","‛":"\'","′":"\'","‵":"\'","՚":"\'","׳":"\'","`":"\'","`":"\'","`":"\'","´":"\'","΄":"\'","´":"\'","᾽":"\'","᾿":"\'","῾":"\'","ʹ":"\'","ʹ":"\'","ˈ":"\'","ˊ":"\'","ˋ":"\'","˴":"\'","ʻ":"\'","ʽ":"\'","ʼ":"\'","ʾ":"\'","ꞌ":"\'","י":"\'","ߴ":"\'","ߵ":"\'","ᑊ":"\'","ᛌ":"\'","𖽑":"\'","𖽒":"\'","᳓":"\'\'","\\"":"\'\'",""":"\'\'","“":"\'\'","”":"\'\'","‟":"\'\'","″":"\'\'","‶":"\'\'","〃":"\'\'","״":"\'\'","˝":"\'\'","ʺ":"\'\'","˶":"\'\'","ˮ":"\'\'","ײ":"\'\'","‴":"\'\'\'","‷":"\'\'\'","⁗":"\'\'\'\'","Ɓ":"\'B","Ɗ":"\'D","ʼn":"\'n","Ƥ":"\'P","Ƭ":"\'T","Ƴ":"\'Y","[":"(","❨":"(","❲":"(","〔":"(","﴾":"(","⸨":"((","㈠":"(ー)","⑵":"(2)","⒇":"(2O)","⑶":"(3)","⑷":"(4)","⑸":"(5)","⑹":"(6)","⑺":"(7)","⑻":"(8)","⑼":"(9)","⒜":"(a)","🄐":"(A)","⒝":"(b)","🄑":"(B)","⒞":"(c)","🄒":"(C)","⒟":"(d)","🄓":"(D)","⒠":"(e)","🄔":"(E)","⒡":"(f)","🄕":"(F)","⒢":"(g)","🄖":"(G)","⒣":"(h)","🄗":"(H)","⒤":"(i)","⒥":"(j)","🄙":"(J)","⒦":"(k)","🄚":"(K)","⑴":"(l)","🄘":"(l)","⒧":"(l)","🄛":"(L)","⑿":"(l2)","⒀":"(l3)","⒁":"(l4)","⒂":"(l5)","⒃":"(l6)","⒄":"(l7)","⒅":"(l8)","⒆":"(l9)","⑾":"(ll)","⑽":"(lO)","🄜":"(M)","⒩":"(n)","🄝":"(N)","⒪":"(o)","🄞":"(O)","⒫":"(p)","🄟":"(P)","⒬":"(q)","🄠":"(Q)","⒭":"(r)","🄡":"(R)","⒨":"(rn)","⒮":"(s)","🄢":"(S)","🄪":"(S)","⒯":"(t)","🄣":"(T)","⒰":"(u)","🄤":"(U)","⒱":"(v)","🄥":"(V)","⒲":"(w)","🄦":"(W)","⒳":"(x)","🄧":"(X)","⒴":"(y)","🄨":"(Y)","⒵":"(z)","🄩":"(Z)","㈀":"(ᄀ)","㈎":"(가)","㈁":"(ᄂ)","㈏":"(나)","㈂":"(ᄃ)","㈐":"(다)","㈃":"(ᄅ)","㈑":"(라)","㈄":"(ᄆ)","㈒":"(마)","㈅":"(ᄇ)","㈓":"(바)","㈆":"(ᄉ)","㈔":"(사)","㈇":"(ᄋ)","㈕":"(아)","㈝":"(오전)","㈞":"(오후)","㈈":"(ᄌ)","㈖":"(자)","㈜":"(주)","㈉":"(ᄎ)","㈗":"(차)","㈊":"(ᄏ)","㈘":"(카)","㈋":"(ᄐ)","㈙":"(타)","㈌":"(ᄑ)","㈚":"(파)","㈍":"(ᄒ)","㈛":"(하)","㈦":"(七)","㈢":"(三)","🉁":"(三)","㈨":"(九)","㈡":"(二)","🉂":"(二)","㈤":"(五)","㈹":"(代)","㈽":"(企)","㉁":"(休)","㈧":"(八)","㈥":"(六)","㈸":"(労)","🉇":"(勝)","㈩":"(十)","㈿":"(協)","㈴":"(名)","㈺":"(呼)","㈣":"(四)","㈯":"(土)","㈻":"(学)","🉃":"(安)","🉅":"(打)","🉈":"(敗)","㈰":"(日)","㈪":"(月)","㈲":"(有)","㈭":"(木)","🉀":"(本)","㈱":"(株)","㈬":"(水)","㈫":"(火)","🉄":"(点)","㈵":"(特)","🉆":"(盗)","㈼":"(監)","㈳":"(社)","㈷":"(祝)","㉀":"(祭)","㉂":"(自)","㉃":"(至)","㈶":"(財)","㈾":"(資)","㈮":"(金)","]":")","❩":")","❳":")","〕":")","﴿":")","⸩":"))","❴":"{","𝄔":"{","❵":"}","〚":"⟦","〛":"⟧","⟨":"❬","〈":"❬","〈":"❬","㇛":"❬","く":"❬","𡿨":"❬","⟩":"❭","〉":"❭","〉":"❭","^":"︿","⸿":"¶","⁎":"*","٭":"*","∗":"*","𐌟":"*","᜵":"/","⁁":"/","∕":"/","⁄":"/","╱":"/","⟋":"/","⧸":"/","𝈺":"/","㇓":"/","〳":"/","Ⳇ":"/","ノ":"/","丿":"/","⼃":"/","⧶":"/̄","⫽":"//","⫻":"///","\":"\\\\","﹨":"\\\\","∖":"\\\\","⟍":"\\\\","⧵":"\\\\","⧹":"\\\\","𝈏":"\\\\","𝈻":"\\\\","㇔":"\\\\","丶":"\\\\","⼂":"\\\\","⳹":"\\\\\\\\","⑊":"\\\\\\\\","⟈":"\\\\ᑕ","ꝸ":"&","૰":"॰","𑂻":"॰","𑇇":"॰","⚬":"॰","𑇛":"꣼","៙":"๏","៕":"๚","៚":"๛","༌":"་","༎":"།།","˄":"^","ˆ":"^","꙾":"ˇ","˘":"ˇ","‾":"ˉ","﹉":"ˉ","﹊":"ˉ","﹋":"ˉ","﹌":"ˉ","¯":"ˉ"," ̄":"ˉ","▔":"ˉ","ъ":"ˉb","ꙑ":"ˉbi","͵":"ˏ","˻":"˪","꜖":"˪","꜔":"˫","。":"˳","⸰":"°","˚":"°","∘":"°","○":"°","◦":"°","⍜":"°̲","⍤":"°̈","℃":"°C","℉":"°F","௵":"௳","༛":"༚༚","༟":"༚༝","࿎":"༝༚","༞":"༝༝","Ⓒ":"©","Ⓡ":"®","Ⓟ":"℗","𝈛":"⅄","⯬":"↞","⯭":"↟","⯮":"↠","⯯":"↡","↵":"↲","⥥":"⇃⇂","⥯":"⇃ᛚ","𝛛":"∂","𝜕":"∂","𝝏":"∂","𝞉":"∂","𝟃":"∂","𞣌":"∂","𞣍":"∂̵","ð":"∂̵","⌀":"∅","𝛁":"∇","𝛻":"∇","𝜵":"∇","𝝯":"∇","𝞩":"∇","𑢨":"∇","⍢":"∇̈","⍫":"∇̴","█":"∎","■":"∎","⨿":"∐","᛭":"+","➕":"+","𐊛":"+","⨣":"+̂","⨢":"+̊","⨤":"+̃","∔":"+̇","⨥":"+̣","⨦":"+̰","⨧":"+₂","➗":"÷","‹":"<","❮":"<","˂":"<","𝈶":"<","ᐸ":"<","ᚲ":"<","⋖":"<·","Ⲵ":"<·","ᑅ":"<·","≪":"<<","⋘":"<<<","᐀":"=","⹀":"=","゠":"=","꓿":"=","≚":"=̆","≙":"=̂","≗":"=̊","≐":"=̇","≑":"=̣̇","⩮":"=⃰","⩵":"==","⩶":"===","≞":"=ͫ","›":">","❯":">","˃":">","𝈷":">","ᐳ":">","𖼿":">","ᑁ":">·","⪥":"><","≫":">>","⨠":">>","⋙":">>>","⁓":"~","˜":"~","῀":"~","∼":"~","⍨":"~̈","⸞":"~̇","⩪":"~̇","⸟":"~̣","𞣈":"∠","⋀":"∧","∯":"∮∮","∰":"∮∮∮","⸫":"∴","⸪":"∵","⸬":"∷","𑇞":"≈","♎":"≏","🝞":"≏","≣":"≡","⨃":"⊍","⨄":"⊎","𝈸":"⊏","𝈹":"⊐","⨅":"⊓","⨆":"⊔","⨂":"⊗","⍟":"⊛","🝱":"⊠","🝕":"⊡","◁":"⊲","▷":"⊳","⍣":"⋆̈","︴":"⌇","◠":"⌒","⨽":"⌙","⌥":"⌤","⧇":"⌻","◎":"⌾","⦾":"⌾","⧅":"⍂","⦰":"⍉","⏃":"⍋","⏂":"⍎","⏁":"⍕","⏆":"⍭","☸":"⎈","︵":"⏜","︶":"⏝","︷":"⏞","︸":"⏟","︹":"⏠","︺":"⏡","▱":"⏥","⏼":"⏻","︱":"│","|":"│","┃":"│","┏":"┌","┣":"├","▐":"▌","▗":"▖","▝":"▘","☐":"□","■":"▪","▸":"▶","►":"▶","⳩":"☧","🜊":"☩","🌒":"☽","🌙":"☽","⏾":"☾","🌘":"☾","⧙":"⦚","🜺":"⧟","⨾":"⨟","𐆠":"⳨","♩":"𝅘𝅥","♪":"𝅘𝅥𝅮","⓪":"🄍","↺":"🄎","˙":"ॱ","ൎ":"ॱ","-":"ー","—":"ー","―":"ー","─":"ー","━":"ー","㇐":"ー","ꟷ":"ー","ᅳ":"ー","ㅡ":"ー","一":"ー","⼀":"ー","ᆖ":"ーー","ힹ":"ーᅡ","ힺ":"ーᅥ","ힻ":"ーᅥ丨","ힼ":"ーᅩ","ᆕ":"ーᅮ","ᅴ":"ー丨","ㅢ":"ー丨","ᆗ":"ー丨ᅮ","🄏":"$⃠","₤":"£","〒":"₸","〶":"₸","᭜":"᭐","꧆":"꧐","𑓑":"১","೧":"౧","ၥ":"၁","①":"➀","⑩":"➉","⏨":"₁₀","𝟐":"2","𝟚":"2","𝟤":"2","𝟮":"2","𝟸":"2","🯲":"2","Ꝛ":"2","Ƨ":"2","Ϩ":"2","Ꙅ":"2","ᒿ":"2","ꛯ":"2","ꧏ":"٢","۲":"٢","૨":"२","𑓒":"২","೨":"౨","②":"➁","ƻ":"2̵","🄃":"2,","⒉":"2.","㏵":"22日","㍮":"22点","㏶":"23日","㍯":"23点","㏷":"24日","㍰":"24点","㏸":"25日","㏹":"26日","㏺":"27日","㏻":"28日","㏼":"29日","㏴":"2l日","㍭":"2l点","⒛":"2O.","㏳":"2O日","㍬":"2O点","෩":"෨ා","෯":"෨ී","㏡":"2日","㋁":"2月","㍚":"2点","𝈆":"3","𝟑":"3","𝟛":"3","𝟥":"3","𝟯":"3","𝟹":"3","🯳":"3","Ɜ":"3","Ȝ":"3","Ʒ":"3","Ꝫ":"3","Ⳍ":"3","З":"3","Ӡ":"3","𖼻":"3","𑣊":"3","۳":"٣","𞣉":"٣","૩":"३","③":"➂","Ҙ":"3̦","🄄":"3,","⒊":"3.","㏾":"3l日","㏽":"3O日","㏢":"3日","㋂":"3月","㍛":"3点","𝟒":"4","𝟜":"4","𝟦":"4","𝟰":"4","𝟺":"4","🯴":"4","Ꮞ":"4","𑢯":"4","۴":"٤","૪":"४","④":"➃","🄅":"4,","⒋":"4.","ᔰ":"4·","㏣":"4日","㋃":"4月","㍜":"4点","𝟓":"5","𝟝":"5","𝟧":"5","𝟱":"5","𝟻":"5","🯵":"5","Ƽ":"5","𑢻":"5","⑤":"➄","🄆":"5,","⒌":"5.","㏤":"5日","㋄":"5月","㍝":"5点","𝟔":"6","𝟞":"6","𝟨":"6","𝟲":"6","𝟼":"6","🯶":"6","Ⳓ":"6","б":"6","Ꮾ":"6","𑣕":"6","۶":"٦","𑓖":"৬","⑥":"➅","🄇":"6,","⒍":"6.","㏥":"6日","㋅":"6月","㍞":"6点","𝈒":"7","𝟕":"7","𝟟":"7","𝟩":"7","𝟳":"7","𝟽":"7","🯷":"7","𐓒":"7","𑣆":"7","⑦":"➆","🄈":"7,","⒎":"7.","㏦":"7日","㋆":"7月","㍟":"7点","ଃ":"8","৪":"8","੪":"8","𞣋":"8","𝟖":"8","𝟠":"8","𝟪":"8","𝟴":"8","𝟾":"8","🯸":"8","ȣ":"8","Ȣ":"8","𐌚":"8","૮":"८","⑧":"➇","🄉":"8,","⒏":"8.","㏧":"8日","㋇":"8月","㍠":"8点","੧":"9","୨":"9","৭":"9","൭":"9","𝟗":"9","𝟡":"9","𝟫":"9","𝟵":"9","𝟿":"9","🯹":"9","Ꝯ":"9","Ⳋ":"9","𑣌":"9","𑢬":"9","𑣖":"9","१":"٩","𑣤":"٩","۹":"٩","೯":"౯","⑨":"➈","🄊":"9,","⒐":"9.","㏨":"9日","㋈":"9月","㍡":"9点","⍺":"a","a":"a","𝐚":"a","𝑎":"a","𝒂":"a","𝒶":"a","𝓪":"a","𝔞":"a","𝕒":"a","𝖆":"a","𝖺":"a","𝗮":"a","𝘢":"a","𝙖":"a","𝚊":"a","ɑ":"a","α":"a","𝛂":"a","𝛼":"a","𝜶":"a","𝝰":"a","𝞪":"a","а":"a","ⷶ":"ͣ","A":"A","𝐀":"A","𝐴":"A","𝑨":"A","𝒜":"A","𝓐":"A","𝔄":"A","𝔸":"A","𝕬":"A","𝖠":"A","𝗔":"A","𝘈":"A","𝘼":"A","𝙰":"A","Α":"A","𝚨":"A","𝛢":"A","𝜜":"A","𝝖":"A","𝞐":"A","А":"A","Ꭺ":"A","ᗅ":"A","ꓮ":"A","𖽀":"A","𐊠":"A","⍶":"a̲","ǎ":"ă","Ǎ":"Ă","ȧ":"å","Ȧ":"Å","ẚ":"ả","℀":"a/c","℁":"a/s","ꜳ":"aa","Ꜳ":"AA","æ":"ae","ӕ":"ae","Æ":"AE","Ӕ":"AE","ꜵ":"ao","Ꜵ":"AO","🜇":"AR","ꜷ":"au","Ꜷ":"AU","ꜹ":"av","ꜻ":"av","Ꜹ":"AV","Ꜻ":"AV","ꜽ":"ay","Ꜽ":"AY","ꭺ":"ᴀ","∀":"Ɐ","𝈗":"Ɐ","ᗄ":"Ɐ","ꓯ":"Ɐ","𐐟":"Ɒ","𝐛":"b","𝑏":"b","𝒃":"b","𝒷":"b","𝓫":"b","𝔟":"b","𝕓":"b","𝖇":"b","𝖻":"b","𝗯":"b","𝘣":"b","𝙗":"b","𝚋":"b","Ƅ":"b","Ь":"b","Ꮟ":"b","ᑲ":"b","ᖯ":"b","B":"B","ℬ":"B","𝐁":"B","𝐵":"B","𝑩":"B","𝓑":"B","𝔅":"B","𝔹":"B","𝕭":"B","𝖡":"B","𝗕":"B","𝘉":"B","𝘽":"B","𝙱":"B","Ꞵ":"B","Β":"B","𝚩":"B","𝛣":"B","𝜝":"B","𝝗":"B","𝞑":"B","В":"B","Ᏼ":"B","ᗷ":"B","ꓐ":"B","𐊂":"B","𐊡":"B","𐌁":"B","ɓ":"b̔","ᑳ":"ḃ","ƃ":"b̄","Ƃ":"b̄","Б":"b̄","ƀ":"b̵","ҍ":"b̵","Ҍ":"b̵","ѣ":"b̵","Ѣ":"b̵","ᑿ":"b·","ᒁ":"ḃ·","ᒈ":"b\'","Ы":"bl","в":"ʙ","ᏼ":"ʙ","c":"c","ⅽ":"c","𝐜":"c","𝑐":"c","𝒄":"c","𝒸":"c","𝓬":"c","𝔠":"c","𝕔":"c","𝖈":"c","𝖼":"c","𝗰":"c","𝘤":"c","𝙘":"c","𝚌":"c","ᴄ":"c","ϲ":"c","ⲥ":"c","с":"c","ꮯ":"c","𐐽":"c","ⷭ":"ͨ","🝌":"C","𑣲":"C","𑣩":"C","C":"C","Ⅽ":"C","ℂ":"C","ℭ":"C","𝐂":"C","𝐶":"C","𝑪":"C","𝒞":"C","𝓒":"C","𝕮":"C","𝖢":"C","𝗖":"C","𝘊":"C","𝘾":"C","𝙲":"C","Ϲ":"C","Ⲥ":"C","С":"C","Ꮯ":"C","ꓚ":"C","𐊢":"C","𐌂":"C","𐐕":"C","𐔜":"C","¢":"c̸","ȼ":"c̸","₡":"C⃫","🅮":"C⃠","ç":"c̦","ҫ":"c̦","Ç":"C̦","Ҫ":"C̦","Ƈ":"C\'","℅":"c/o","℆":"c/u","🅭":"㏄\\t⃝","⋴":"ꞓ","ɛ":"ꞓ","ε":"ꞓ","ϵ":"ꞓ","𝛆":"ꞓ","𝛜":"ꞓ","𝜀":"ꞓ","𝜖":"ꞓ","𝜺":"ꞓ","𝝐":"ꞓ","𝝴":"ꞓ","𝞊":"ꞓ","𝞮":"ꞓ","𝟄":"ꞓ","ⲉ":"ꞓ","є":"ꞓ","ԑ":"ꞓ","ꮛ":"ꞓ","𑣎":"ꞓ","𐐩":"ꞓ","€":"Ꞓ","Ⲉ":"Ꞓ","Є":"Ꞓ","⍷":"ꞓ̲","ͽ":"ꜿ","Ͽ":"Ꜿ","ⅾ":"d","ⅆ":"d","𝐝":"d","𝑑":"d","𝒅":"d","𝒹":"d","𝓭":"d","𝔡":"d","𝕕":"d","𝖉":"d","𝖽":"d","𝗱":"d","𝘥":"d","𝙙":"d","𝚍":"d","ԁ":"d","Ꮷ":"d","ᑯ":"d","ꓒ":"d","Ⅾ":"D","ⅅ":"D","𝐃":"D","𝐷":"D","𝑫":"D","𝒟":"D","𝓓":"D","𝔇":"D","𝔻":"D","𝕯":"D","𝖣":"D","𝗗":"D","𝘋":"D","𝘿":"D","𝙳":"D","Ꭰ":"D","ᗞ":"D","ᗪ":"D","ꓓ":"D","ɗ":"d̔","ɖ":"d̨","ƌ":"d̄","đ":"d̵","Đ":"D̵","Ð":"D̵","Ɖ":"D̵","₫":"ḏ̵","ꝺ":"Ꝺ","ᑻ":"d·","ᒇ":"d\'","ʤ":"dȝ","dz":"dz","ʣ":"dz","Dz":"Dz","DZ":"DZ","dž":"dž","Dž":"Dž","DŽ":"DŽ","ʥ":"dʑ","ꭰ":"ᴅ","⸹":"ẟ","δ":"ẟ","𝛅":"ẟ","𝛿":"ẟ","𝜹":"ẟ","𝝳":"ẟ","𝞭":"ẟ","ծ":"ẟ","ᕷ":"ẟ","℮":"e","e":"e","ℯ":"e","ⅇ":"e","𝐞":"e","𝑒":"e","𝒆":"e","𝓮":"e","𝔢":"e","𝕖":"e","𝖊":"e","𝖾":"e","𝗲":"e","𝘦":"e","𝙚":"e","𝚎":"e","ꬲ":"e","е":"e","ҽ":"e","ⷷ":"ͤ","⋿":"E","E":"E","ℰ":"E","𝐄":"E","𝐸":"E","𝑬":"E","𝓔":"E","𝔈":"E","𝔼":"E","𝕰":"E","𝖤":"E","𝗘":"E","𝘌":"E","𝙀":"E","𝙴":"E","Ε":"E","𝚬":"E","𝛦":"E","𝜠":"E","𝝚":"E","𝞔":"E","Е":"E","ⴹ":"E","Ꭼ":"E","ꓰ":"E","𑢦":"E","𑢮":"E","𐊆":"E","ě":"ĕ","Ě":"Ĕ","ɇ":"e̸","Ɇ":"E̸","ҿ":"ę","ꭼ":"ᴇ","ə":"ǝ","ә":"ǝ","∃":"Ǝ","ⴺ":"Ǝ","ꓱ":"Ǝ","ɚ":"ǝ˞","ᴔ":"ǝo","ꭁ":"ǝo̸","ꭂ":"ǝo̵","Ә":"Ə","𝈡":"Ɛ","ℇ":"Ɛ","Ԑ":"Ɛ","Ꮛ":"Ɛ","𖼭":"Ɛ","𐐁":"Ɛ","ᶟ":"ᵋ","ᴈ":"ɜ","з":"ɜ","ҙ":"ɜ̦","𐑂":"ɞ","ꞝ":"ʚ","𐐪":"ʚ","𝐟":"f","𝑓":"f","𝒇":"f","𝒻":"f","𝓯":"f","𝔣":"f","𝕗":"f","𝖋":"f","𝖿":"f","𝗳":"f","𝘧":"f","𝙛":"f","𝚏":"f","ꬵ":"f","ꞙ":"f","ſ":"f","ẝ":"f","ք":"f","𝈓":"F","ℱ":"F","𝐅":"F","𝐹":"F","𝑭":"F","𝓕":"F","𝔉":"F","𝔽":"F","𝕱":"F","𝖥":"F","𝗙":"F","𝘍":"F","𝙁":"F","𝙵":"F","Ꞙ":"F","Ϝ":"F","𝟊":"F","ᖴ":"F","ꓝ":"F","𑣂":"F","𑢢":"F","𐊇":"F","𐊥":"F","𐔥":"F","ƒ":"f̦","Ƒ":"F̦","ᵮ":"f̴","℻":"FAX","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ʩ":"fŋ","ᖵ":"Ⅎ","ꓞ":"Ⅎ","𝈰":"ꟻ","ᖷ":"ꟻ","g":"g","ℊ":"g","𝐠":"g","𝑔":"g","𝒈":"g","𝓰":"g","𝔤":"g","𝕘":"g","𝖌":"g","𝗀":"g","𝗴":"g","𝘨":"g","𝙜":"g","𝚐":"g","ɡ":"g","ᶃ":"g","ƍ":"g","ց":"g","𝐆":"G","𝐺":"G","𝑮":"G","𝒢":"G","𝓖":"G","𝔊":"G","𝔾":"G","𝕲":"G","𝖦":"G","𝗚":"G","𝘎":"G","𝙂":"G","𝙶":"G","Ԍ":"G","Ꮐ":"G","Ᏻ":"G","ꓖ":"G","ᶢ":"ᵍ","ɠ":"g̔","ǧ":"ğ","Ǧ":"Ğ","ǵ":"ģ","ǥ":"g̵","Ǥ":"G̵","Ɠ":"G\'","ԍ":"ɢ","ꮐ":"ɢ","ᏻ":"ɢ","h":"h","ℎ":"h","𝐡":"h","𝒉":"h","𝒽":"h","𝓱":"h","𝔥":"h","𝕙":"h","𝖍":"h","𝗁":"h","𝗵":"h","𝘩":"h","𝙝":"h","𝚑":"h","һ":"h","հ":"h","Ꮒ":"h","H":"H","ℋ":"H","ℌ":"H","ℍ":"H","𝐇":"H","𝐻":"H","𝑯":"H","𝓗":"H","𝕳":"H","𝖧":"H","𝗛":"H","𝘏":"H","𝙃":"H","𝙷":"H","Η":"H","𝚮":"H","𝛨":"H","𝜢":"H","𝝜":"H","𝞖":"H","Ⲏ":"H","Н":"H","Ꮋ":"H","ᕼ":"H","ꓧ":"H","𐋏":"H","ᵸ":"ᴴ","ɦ":"h̔","ꚕ":"h̔","Ᏺ":"h̔","Ⱨ":"H̩","Ң":"H̩","ħ":"h̵","ℏ":"h̵","ћ":"h̵","Ħ":"H̵","Ӊ":"H̦","Ӈ":"H̦","н":"ʜ","ꮋ":"ʜ","ң":"ʜ̩","ӊ":"ʜ̦","ӈ":"ʜ̦","Ԋ":"Ƕ","ꮀ":"ⱶ","Ͱ":"Ⱶ","Ꭸ":"Ⱶ","Ꮀ":"Ⱶ","ꚱ":"Ⱶ","ꞕ":"ꜧ","˛":"i","⍳":"i","i":"i","ⅰ":"i","ℹ":"i","ⅈ":"i","𝐢":"i","𝑖":"i","𝒊":"i","𝒾":"i","𝓲":"i","𝔦":"i","𝕚":"i","𝖎":"i","𝗂":"i","𝗶":"i","𝘪":"i","𝙞":"i","𝚒":"i","ı":"i","𝚤":"i","ɪ":"i","ɩ":"i","ι":"i","ι":"i","ͺ":"i","𝛊":"i","𝜄":"i","𝜾":"i","𝝸":"i","𝞲":"i","і":"i","ꙇ":"i","ӏ":"i","ꭵ":"i","Ꭵ":"i","𑣃":"i","ⓛ":"Ⓘ","⍸":"i̲","ǐ":"ĭ","Ǐ":"Ĭ","ɨ":"i̵","ᵻ":"i̵","ᵼ":"i̵","ⅱ":"ii","ⅲ":"iii","ij":"ij","ⅳ":"iv","ⅸ":"ix","j":"j","ⅉ":"j","𝐣":"j","𝑗":"j","𝒋":"j","𝒿":"j","𝓳":"j","𝔧":"j","𝕛":"j","𝖏":"j","𝗃":"j","𝗷":"j","𝘫":"j","𝙟":"j","𝚓":"j","ϳ":"j","ј":"j","J":"J","𝐉":"J","𝐽":"J","𝑱":"J","𝒥":"J","𝓙":"J","𝔍":"J","𝕁":"J","𝕵":"J","𝖩":"J","𝗝":"J","𝘑":"J","𝙅":"J","𝙹":"J","Ʝ":"J","Ϳ":"J","Ј":"J","Ꭻ":"J","ᒍ":"J","ꓙ":"J","ɉ":"j̵","Ɉ":"J̵","ᒙ":"J·","𝚥":"ȷ","յ":"ȷ","ꭻ":"ᴊ","𝐤":"k","𝑘":"k","𝒌":"k","𝓀":"k","𝓴":"k","𝔨":"k","𝕜":"k","𝖐":"k","𝗄":"k","𝗸":"k","𝘬":"k","𝙠":"k","𝚔":"k","K":"K","K":"K","𝐊":"K","𝐾":"K","𝑲":"K","𝒦":"K","𝓚":"K","𝔎":"K","𝕂":"K","𝕶":"K","𝖪":"K","𝗞":"K","𝘒":"K","𝙆":"K","𝙺":"K","Κ":"K","𝚱":"K","𝛫":"K","𝜥":"K","𝝟":"K","𝞙":"K","Ⲕ":"K","К":"K","Ꮶ":"K","ᛕ":"K","ꓗ":"K","𐔘":"K","ƙ":"k̔","Ⱪ":"K̩","Қ":"K̩","₭":"K̵","Ꝁ":"K̵","Ҟ":"K̵","Ƙ":"K\'","׀":"l","|":"l","∣":"l","⏽":"l","│":"l","١":"l","۱":"l","𐌠":"l","𞣇":"l","𝟏":"l","𝟙":"l","𝟣":"l","𝟭":"l","𝟷":"l","🯱":"l","I":"l","I":"l","Ⅰ":"l","ℐ":"l","ℑ":"l","𝐈":"l","𝐼":"l","𝑰":"l","𝓘":"l","𝕀":"l","𝕴":"l","𝖨":"l","𝗜":"l","𝘐":"l","𝙄":"l","𝙸":"l","Ɩ":"l","l":"l","ⅼ":"l","ℓ":"l","𝐥":"l","𝑙":"l","𝒍":"l","𝓁":"l","𝓵":"l","𝔩":"l","𝕝":"l","𝖑":"l","𝗅":"l","𝗹":"l","𝘭":"l","𝙡":"l","𝚕":"l","ǀ":"l","Ι":"l","𝚰":"l","𝛪":"l","𝜤":"l","𝝞":"l","𝞘":"l","Ⲓ":"l","І":"l","Ӏ":"l","ו":"l","ן":"l","ا":"l","𞸀":"l","𞺀":"l","ﺎ":"l","ﺍ":"l","ߊ":"l","ⵏ":"l","ᛁ":"l","ꓲ":"l","𖼨":"l","𐊊":"l","𐌉":"l","𝈪":"L","Ⅼ":"L","ℒ":"L","𝐋":"L","𝐿":"L","𝑳":"L","𝓛":"L","𝔏":"L","𝕃":"L","𝕷":"L","𝖫":"L","𝗟":"L","𝘓":"L","𝙇":"L","𝙻":"L","Ⳑ":"L","Ꮮ":"L","ᒪ":"L","ꓡ":"L","𖼖":"L","𑢣":"L","𑢲":"L","𐐛":"L","𐔦":"L","ﴼ":"l̋","ﴽ":"l̋","ł":"l̸","Ł":"L̸","ɭ":"l̨","Ɨ":"l̵","ƚ":"l̵","ɫ":"l̴","إ":"lٕ","ﺈ":"lٕ","ﺇ":"lٕ","ٳ":"lٕ","ŀ":"l·","Ŀ":"l·","ᒷ":"l·","🄂":"l,","⒈":"l.","ױ":"l\'","⒓":"l2.","㏫":"l2日","㋋":"l2月","㍤":"l2点","⒔":"l3.","㏬":"l3日","㍥":"l3点","⒕":"l4.","㏭":"l4日","㍦":"l4点","⒖":"l5.","㏮":"l5日","㍧":"l5点","⒗":"l6.","㏯":"l6日","㍨":"l6点","⒘":"l7.","㏰":"l7日","㍩":"l7点","⒙":"l8.","㏱":"l8日","㍪":"l8点","⒚":"l9.","㏲":"l9日","㍫":"l9点","lj":"lj","IJ":"lJ","Lj":"Lj","LJ":"LJ","‖":"ll","∥":"ll","Ⅱ":"ll","ǁ":"ll","װ":"ll","𐆙":"l̵l̵","⒒":"ll.","Ⅲ":"lll","𐆘":"l̵l̵S̵","㏪":"ll日","㋊":"ll月","㍣":"ll点","Ю":"lO","⒑":"lO.","㏩":"lO日","㋉":"lO月","㍢":"lO点","ʪ":"ls","₶":"lt","Ⅳ":"lV","Ⅸ":"lX","ɮ":"lȝ","ʫ":"lz","أ":"lٴ","ﺄ":"lٴ","ﺃ":"lٴ","ٲ":"lٴ","ٵ":"lٴ","ﷳ":"lكبر","ﷲ":"lللّٰo","㏠":"l日","㋀":"l月","㍙":"l点","ⳑ":"ʟ","ꮮ":"ʟ","𐑃":"ʟ","M":"M","Ⅿ":"M","ℳ":"M","𝐌":"M","𝑀":"M","𝑴":"M","𝓜":"M","𝔐":"M","𝕄":"M","𝕸":"M","𝖬":"M","𝗠":"M","𝘔":"M","𝙈":"M","𝙼":"M","Μ":"M","𝚳":"M","𝛭":"M","𝜧":"M","𝝡":"M","𝞛":"M","Ϻ":"M","Ⲙ":"M","М":"M","Ꮇ":"M","ᗰ":"M","ᛖ":"M","ꓟ":"M","𐊰":"M","𐌑":"M","Ӎ":"M̦","🝫":"MB","ⷨ":"ᷟ","𝐧":"n","𝑛":"n","𝒏":"n","𝓃":"n","𝓷":"n","𝔫":"n","𝕟":"n","𝖓":"n","𝗇":"n","𝗻":"n","𝘯":"n","𝙣":"n","𝚗":"n","ո":"n","ռ":"n","N":"N","ℕ":"N","𝐍":"N","𝑁":"N","𝑵":"N","𝒩":"N","𝓝":"N","𝔑":"N","𝕹":"N","𝖭":"N","𝗡":"N","𝘕":"N","𝙉":"N","𝙽":"N","Ν":"N","𝚴":"N","𝛮":"N","𝜨":"N","𝝢":"N","𝞜":"N","Ⲛ":"N","ꓠ":"N","𐔓":"N","𐆎":"N̊","ɳ":"n̨","ƞ":"n̩","η":"n̩","𝛈":"n̩","𝜂":"n̩","𝜼":"n̩","𝝶":"n̩","𝞰":"n̩","Ɲ":"N̦","ᵰ":"n̴","nj":"nj","Nj":"Nj","NJ":"NJ","№":"No","ͷ":"ᴎ","и":"ᴎ","𐑍":"ᴎ","ņ":"ɲ","ం":"o","ಂ":"o","ം":"o","ං":"o","०":"o","੦":"o","૦":"o","௦":"o","౦":"o","೦":"o","൦":"o","๐":"o","໐":"o","၀":"o","٥":"o","۵":"o","o":"o","ℴ":"o","𝐨":"o","𝑜":"o","𝒐":"o","𝓸":"o","𝔬":"o","𝕠":"o","𝖔":"o","𝗈":"o","𝗼":"o","𝘰":"o","𝙤":"o","𝚘":"o","ᴏ":"o","ᴑ":"o","ꬽ":"o","ο":"o","𝛐":"o","𝜊":"o","𝝄":"o","𝝾":"o","𝞸":"o","σ":"o","𝛔":"o","𝜎":"o","𝝈":"o","𝞂":"o","𝞼":"o","ⲟ":"o","о":"o","ჿ":"o","օ":"o","ס":"o","ه":"o","𞸤":"o","𞹤":"o","𞺄":"o","ﻫ":"o","ﻬ":"o","ﻪ":"o","ﻩ":"o","ھ":"o","ﮬ":"o","ﮭ":"o","ﮫ":"o","ﮪ":"o","ہ":"o","ﮨ":"o","ﮩ":"o","ﮧ":"o","ﮦ":"o","ە":"o","ഠ":"o","ဝ":"o","𐓪":"o","𑣈":"o","𑣗":"o","𐐬":"o","߀":"O","০":"O","୦":"O","〇":"O","𑓐":"O","𑣠":"O","𝟎":"O","𝟘":"O","𝟢":"O","𝟬":"O","𝟶":"O","🯰":"O","O":"O","𝐎":"O","𝑂":"O","𝑶":"O","𝒪":"O","𝓞":"O","𝔒":"O","𝕆":"O","𝕺":"O","𝖮":"O","𝗢":"O","𝘖":"O","𝙊":"O","𝙾":"O","Ο":"O","𝚶":"O","𝛰":"O","𝜪":"O","𝝤":"O","𝞞":"O","Ⲟ":"O","О":"O","Օ":"O","ⵔ":"O","ዐ":"O","ଠ":"O","𐓂":"O","ꓳ":"O","𑢵":"O","𐊒":"O","𐊫":"O","𐐄":"O","𐔖":"O","⁰":"º","ᵒ":"º","ǒ":"ŏ","Ǒ":"Ŏ","ۿ":"ô","Ő":"Ö","ø":"o̸","ꬾ":"o̸","Ø":"O̸","ⵁ":"O̸","Ǿ":"Ó̸","ɵ":"o̵","ꝋ":"o̵","ө":"o̵","ѳ":"o̵","ꮎ":"o̵","ꮻ":"o̵","⊖":"O̵","⊝":"O̵","⍬":"O̵","𝈚":"O̵","🜔":"O̵","Ɵ":"O̵","Ꝋ":"O̵","θ":"O̵","ϑ":"O̵","𝛉":"O̵","𝛝":"O̵","𝜃":"O̵","𝜗":"O̵","𝜽":"O̵","𝝑":"O̵","𝝷":"O̵","𝞋":"O̵","𝞱":"O̵","𝟅":"O̵","Θ":"O̵","ϴ":"O̵","𝚯":"O̵","𝚹":"O̵","𝛩":"O̵","𝛳":"O̵","𝜣":"O̵","𝜭":"O̵","𝝝":"O̵","𝝧":"O̵","𝞗":"O̵","𝞡":"O̵","Ө":"O̵","Ѳ":"O̵","ⴱ":"O̵","Ꮎ":"O̵","Ꮻ":"O̵","ꭴ":"ơ","ﳙ":"oٰ","🄁":"O,","🄀":"O.","ơ":"o\'","Ơ":"O\'","Ꭴ":"O\'","%":"º/₀","٪":"º/₀","⁒":"º/₀","‰":"º/₀₀","؉":"º/₀₀","‱":"º/₀₀₀","؊":"º/₀₀₀","œ":"oe","Œ":"OE","ɶ":"oᴇ","∞":"oo","ꝏ":"oo","ꚙ":"oo","Ꝏ":"OO","Ꚙ":"OO","ﳗ":"oج","ﱑ":"oج","ﳘ":"oم","ﱒ":"oم","ﶓ":"oمج","ﶔ":"oمم","ﱓ":"oى","ﱔ":"oى","ൟ":"oരo","တ":"oာ","㍘":"O点","ↄ":"ɔ","ᴐ":"ɔ","ͻ":"ɔ","𐑋":"ɔ","Ↄ":"Ɔ","Ͻ":"Ɔ","ꓛ":"Ɔ","𐐣":"Ɔ","ꬿ":"ɔ̸","ꭢ":"ɔe","𐐿":"ɷ","⍴":"p","p":"p","𝐩":"p","𝑝":"p","𝒑":"p","𝓅":"p","𝓹":"p","𝔭":"p","𝕡":"p","𝖕":"p","𝗉":"p","𝗽":"p","𝘱":"p","𝙥":"p","𝚙":"p","ρ":"p","ϱ":"p","𝛒":"p","𝛠":"p","𝜌":"p","𝜚":"p","𝝆":"p","𝝔":"p","𝞀":"p","𝞎":"p","𝞺":"p","𝟈":"p","ⲣ":"p","р":"p","P":"P","ℙ":"P","𝐏":"P","𝑃":"P","𝑷":"P","𝒫":"P","𝓟":"P","𝔓":"P","𝕻":"P","𝖯":"P","𝗣":"P","𝘗":"P","𝙋":"P","𝙿":"P","Ρ":"P","𝚸":"P","𝛲":"P","𝜬":"P","𝝦":"P","𝞠":"P","Ⲣ":"P","Р":"P","Ꮲ":"P","ᑭ":"P","ꓑ":"P","𐊕":"P","ƥ":"p̔","ᵽ":"p̵","ᑷ":"p·","ᒆ":"P\'","ᴩ":"ᴘ","ꮲ":"ᴘ","φ":"ɸ","ϕ":"ɸ","𝛗":"ɸ","𝛟":"ɸ","𝜑":"ɸ","𝜙":"ɸ","𝝋":"ɸ","𝝓":"ɸ","𝞅":"ɸ","𝞍":"ɸ","𝞿":"ɸ","𝟇":"ɸ","ⲫ":"ɸ","ф":"ɸ","𝐪":"q","𝑞":"q","𝒒":"q","𝓆":"q","𝓺":"q","𝔮":"q","𝕢":"q","𝖖":"q","𝗊":"q","𝗾":"q","𝘲":"q","𝙦":"q","𝚚":"q","ԛ":"q","գ":"q","զ":"q","ℚ":"Q","𝐐":"Q","𝑄":"Q","𝑸":"Q","𝒬":"Q","𝓠":"Q","𝔔":"Q","𝕼":"Q","𝖰":"Q","𝗤":"Q","𝘘":"Q","𝙌":"Q","𝚀":"Q","ⵕ":"Q","ʠ":"q̔","🜀":"QE","ᶐ":"ɋ","ᴋ":"ĸ","κ":"ĸ","ϰ":"ĸ","𝛋":"ĸ","𝛞":"ĸ","𝜅":"ĸ","𝜘":"ĸ","𝜿":"ĸ","𝝒":"ĸ","𝝹":"ĸ","𝞌":"ĸ","𝞳":"ĸ","𝟆":"ĸ","ⲕ":"ĸ","к":"ĸ","ꮶ":"ĸ","қ":"ĸ̩","ҟ":"ĸ̵","𝐫":"r","𝑟":"r","𝒓":"r","𝓇":"r","𝓻":"r","𝔯":"r","𝕣":"r","𝖗":"r","𝗋":"r","𝗿":"r","𝘳":"r","𝙧":"r","𝚛":"r","ꭇ":"r","ꭈ":"r","ᴦ":"r","ⲅ":"r","г":"r","ꮁ":"r","𝈖":"R","ℛ":"R","ℜ":"R","ℝ":"R","𝐑":"R","𝑅":"R","𝑹":"R","𝓡":"R","𝕽":"R","𝖱":"R","𝗥":"R","𝘙":"R","𝙍":"R","𝚁":"R","Ʀ":"R","Ꭱ":"R","Ꮢ":"R","𐒴":"R","ᖇ":"R","ꓣ":"R","𖼵":"R","ɽ":"r̨","ɼ":"r̩","ɍ":"r̵","ғ":"r̵","ᵲ":"r̴","ґ":"r\'","𑣣":"rn","m":"rn","ⅿ":"rn","𝐦":"rn","𝑚":"rn","𝒎":"rn","𝓂":"rn","𝓶":"rn","𝔪":"rn","𝕞":"rn","𝖒":"rn","𝗆":"rn","𝗺":"rn","𝘮":"rn","𝙢":"rn","𝚖":"rn","𑜀":"rn","₥":"rn̸","ɱ":"rn̦","ᵯ":"rn̴","₨":"Rs","ꭱ":"ʀ","ꮢ":"ʀ","я":"ᴙ","ᵳ":"ɾ̴","℩":"ɿ","s":"s","𝐬":"s","𝑠":"s","𝒔":"s","𝓈":"s","𝓼":"s","𝔰":"s","𝕤":"s","𝖘":"s","𝗌":"s","𝘀":"s","𝘴":"s","𝙨":"s","𝚜":"s","ꜱ":"s","ƽ":"s","ѕ":"s","ꮪ":"s","𑣁":"s","𐑈":"s","S":"S","𝐒":"S","𝑆":"S","𝑺":"S","𝒮":"S","𝓢":"S","𝔖":"S","𝕊":"S","𝕾":"S","𝖲":"S","𝗦":"S","𝘚":"S","𝙎":"S","𝚂":"S","Ѕ":"S","Տ":"S","Ꮥ":"S","Ꮪ":"S","ꓢ":"S","𖼺":"S","𐊖":"S","𐐠":"S","ʂ":"s̨","ᵴ":"s̴","ꞵ":"ß","β":"ß","ϐ":"ß","𝛃":"ß","𝛽":"ß","𝜷":"ß","𝝱":"ß","𝞫":"ß","Ᏸ":"ß","🝜":"sss","st":"st","∫":"ʃ","ꭍ":"ʃ","∑":"Ʃ","⅀":"Ʃ","Σ":"Ʃ","𝚺":"Ʃ","𝛴":"Ʃ","𝜮":"Ʃ","𝝨":"Ʃ","𝞢":"Ʃ","ⵉ":"Ʃ","∬":"ʃʃ","∭":"ʃʃʃ","⨌":"ʃʃʃʃ","𝐭":"t","𝑡":"t","𝒕":"t","𝓉":"t","𝓽":"t","𝔱":"t","𝕥":"t","𝖙":"t","𝗍":"t","𝘁":"t","𝘵":"t","𝙩":"t","𝚝":"t","⊤":"T","⟙":"T","🝨":"T","T":"T","𝐓":"T","𝑇":"T","𝑻":"T","𝒯":"T","𝓣":"T","𝔗":"T","𝕋":"T","𝕿":"T","𝖳":"T","𝗧":"T","𝘛":"T","𝙏":"T","𝚃":"T","Τ":"T","𝚻":"T","𝛵":"T","𝜯":"T","𝝩":"T","𝞣":"T","Ⲧ":"T","Т":"T","Ꭲ":"T","ꓔ":"T","𖼊":"T","𑢼":"T","𐊗":"T","𐊱":"T","𐌕":"T","ƭ":"t̔","⍡":"T̈","Ⱦ":"T̸","Ț":"Ţ","Ʈ":"T̨","Ҭ":"T̩","₮":"T⃫","ŧ":"t̵","Ŧ":"T̵","ᵵ":"t̴","Ⴀ":"Ꞇ","Ꜩ":"T3","ʨ":"tɕ","℡":"TEL","ꝷ":"tf","ʦ":"ts","ʧ":"tʃ","ꜩ":"tȝ","τ":"ᴛ","𝛕":"ᴛ","𝜏":"ᴛ","𝝉":"ᴛ","𝞃":"ᴛ","𝞽":"ᴛ","т":"ᴛ","ꭲ":"ᴛ","ҭ":"ᴛ̩","ţ":"ƫ","ț":"ƫ","Ꮏ":"ƫ","𝐮":"u","𝑢":"u","𝒖":"u","𝓊":"u","𝓾":"u","𝔲":"u","𝕦":"u","𝖚":"u","𝗎":"u","𝘂":"u","𝘶":"u","𝙪":"u","𝚞":"u","ꞟ":"u","ᴜ":"u","ꭎ":"u","ꭒ":"u","ʋ":"u","υ":"u","𝛖":"u","𝜐":"u","𝝊":"u","𝞄":"u","𝞾":"u","ս":"u","𐓶":"u","𑣘":"u","∪":"U","⋃":"U","𝐔":"U","𝑈":"U","𝑼":"U","𝒰":"U","𝓤":"U","𝔘":"U","𝕌":"U","𝖀":"U","𝖴":"U","𝗨":"U","𝘜":"U","𝙐":"U","𝚄":"U","Ս":"U","ሀ":"U","𐓎":"U","ᑌ":"U","ꓴ":"U","𖽂":"U","𑢸":"U","ǔ":"ŭ","Ǔ":"Ŭ","ᵾ":"u̵","ꮜ":"u̵","Ʉ":"U̵","Ꮜ":"U̵","ᑘ":"U·","ᑧ":"U\'","ᵫ":"ue","ꭣ":"uo","ṃ":"ꭑ","պ":"ɰ","ሣ":"ɰ","℧":"Ʊ","ᘮ":"Ʊ","ᘴ":"Ʊ","ᵿ":"ʊ̵","∨":"v","⋁":"v","v":"v","ⅴ":"v","𝐯":"v","𝑣":"v","𝒗":"v","𝓋":"v","𝓿":"v","𝔳":"v","𝕧":"v","𝖛":"v","𝗏":"v","𝘃":"v","𝘷":"v","𝙫":"v","𝚟":"v","ᴠ":"v","ν":"v","𝛎":"v","𝜈":"v","𝝂":"v","𝝼":"v","𝞶":"v","ѵ":"v","ט":"v","𑜆":"v","ꮩ":"v","𑣀":"v","𝈍":"V","٧":"V","۷":"V","Ⅴ":"V","𝐕":"V","𝑉":"V","𝑽":"V","𝒱":"V","𝓥":"V","𝔙":"V","𝕍":"V","𝖁":"V","𝖵":"V","𝗩":"V","𝘝":"V","𝙑":"V","𝚅":"V","Ѵ":"V","ⴸ":"V","Ꮩ":"V","ᐯ":"V","ꛟ":"V","ꓦ":"V","𖼈":"V","𑢠":"V","𐔝":"V","𐆗":"V̵","ᐻ":"V·","🝬":"VB","ⅵ":"vi","ⅶ":"vii","ⅷ":"viii","Ⅵ":"Vl","Ⅶ":"Vll","Ⅷ":"Vlll","🜈":"Vᷤ","ᴧ":"ʌ","𐓘":"ʌ","٨":"Ʌ","۸":"Ʌ","Λ":"Ʌ","𝚲":"Ʌ","𝛬":"Ʌ","𝜦":"Ʌ","𝝠":"Ʌ","𝞚":"Ʌ","Л":"Ʌ","ⴷ":"Ʌ","𐒰":"Ʌ","ᐱ":"Ʌ","ꛎ":"Ʌ","ꓥ":"Ʌ","𖼽":"Ʌ","𐊍":"Ʌ","Ӆ":"Ʌ̦","ᐽ":"Ʌ·","ɯ":"w","𝐰":"w","𝑤":"w","𝒘":"w","𝓌":"w","𝔀":"w","𝔴":"w","𝕨":"w","𝖜":"w","𝗐":"w","𝘄":"w","𝘸":"w","𝙬":"w","𝚠":"w","ᴡ":"w","ѡ":"w","ԝ":"w","ա":"w","𑜊":"w","𑜎":"w","𑜏":"w","ꮃ":"w","𑣯":"W","𑣦":"W","𝐖":"W","𝑊":"W","𝑾":"W","𝒲":"W","𝓦":"W","𝔚":"W","𝕎":"W","𝖂":"W","𝖶":"W","𝗪":"W","𝘞":"W","𝙒":"W","𝚆":"W","Ԝ":"W","Ꮃ":"W","Ꮤ":"W","ꓪ":"W","ѽ":"w҆҇","𑓅":"ẇ","₩":"W̵","ꝡ":"w̦","ᴍ":"ʍ","м":"ʍ","ꮇ":"ʍ","ӎ":"ʍ̦","᙮":"x","×":"x","⤫":"x","⤬":"x","⨯":"x","x":"x","ⅹ":"x","𝐱":"x","𝑥":"x","𝒙":"x","𝓍":"x","𝔁":"x","𝔵":"x","𝕩":"x","𝖝":"x","𝗑":"x","𝘅":"x","𝘹":"x","𝙭":"x","𝚡":"x","х":"x","ᕁ":"x","ᕽ":"x","ⷯ":"ͯ","᙭":"X","╳":"X","𐌢":"X","𑣬":"X","X":"X","Ⅹ":"X","𝐗":"X","𝑋":"X","𝑿":"X","𝒳":"X","𝓧":"X","𝔛":"X","𝕏":"X","𝖃":"X","𝖷":"X","𝗫":"X","𝘟":"X","𝙓":"X","𝚇":"X","Ꭓ":"X","Χ":"X","𝚾":"X","𝛸":"X","𝜲":"X","𝝬":"X","𝞦":"X","Ⲭ":"X","Х":"X","ⵝ":"X","ᚷ":"X","ꓫ":"X","𐊐":"X","𐊴":"X","𐌗":"X","𐔧":"X","⨰":"ẋ","Ҳ":"X̩","𐆖":"X̵","ⅺ":"xi","ⅻ":"xii","Ⅺ":"Xl","Ⅻ":"Xll","ɣ":"y","ᶌ":"y","y":"y","𝐲":"y","𝑦":"y","𝒚":"y","𝓎":"y","𝔂":"y","𝔶":"y","𝕪":"y","𝖞":"y","𝗒":"y","𝘆":"y","𝘺":"y","𝙮":"y","𝚢":"y","ʏ":"y","ỿ":"y","ꭚ":"y","γ":"y","ℽ":"y","𝛄":"y","𝛾":"y","𝜸":"y","𝝲":"y","𝞬":"y","у":"y","ү":"y","ყ":"y","𑣜":"y","Y":"Y","𝐘":"Y","𝑌":"Y","𝒀":"Y","𝒴":"Y","𝓨":"Y","𝔜":"Y","𝕐":"Y","𝖄":"Y","𝖸":"Y","𝗬":"Y","𝘠":"Y","𝙔":"Y","𝚈":"Y","Υ":"Y","ϒ":"Y","𝚼":"Y","𝛶":"Y","𝜰":"Y","𝝪":"Y","𝞤":"Y","Ⲩ":"Y","У":"Y","Ү":"Y","Ꭹ":"Y","Ꮍ":"Y","ꓬ":"Y","𖽃":"Y","𑢤":"Y","𐊲":"Y","ƴ":"y̔","ɏ":"y̵","ұ":"y̵","¥":"Y̵","Ɏ":"Y̵","Ұ":"Y̵","ʒ":"ȝ","ꝫ":"ȝ","ⳍ":"ȝ","ӡ":"ȝ","ჳ":"ȝ","𝐳":"z","𝑧":"z","𝒛":"z","𝓏":"z","𝔃":"z","𝔷":"z","𝕫":"z","𝖟":"z","𝗓":"z","𝘇":"z","𝘻":"z","𝙯":"z","𝚣":"z","ᴢ":"z","ꮓ":"z","𑣄":"z","𐋵":"Z","𑣥":"Z","Z":"Z","ℤ":"Z","ℨ":"Z","𝐙":"Z","𝑍":"Z","𝒁":"Z","𝒵":"Z","𝓩":"Z","𝖅":"Z","𝖹":"Z","𝗭":"Z","𝘡":"Z","𝙕":"Z","𝚉":"Z","Ζ":"Z","𝚭":"Z","𝛧":"Z","𝜡":"Z","𝝛":"Z","𝞕":"Z","Ꮓ":"Z","ꓜ":"Z","𑢩":"Z","ʐ":"z̨","ƶ":"z̵","Ƶ":"Z̵","ȥ":"z̦","Ȥ":"Z̦","ᵶ":"z̴","ƿ":"þ","ϸ":"þ","Ϸ":"Þ","𐓄":"Þ","⁹":"ꝰ","ᴤ":"ƨ","ϩ":"ƨ","ꙅ":"ƨ","ь":"ƅ","ꮟ":"ƅ","ы":"ƅi","ꭾ":"ɂ","ˤ":"ˁ","ꛍ":"ʡ","⊙":"ʘ","☉":"ʘ","⨀":"ʘ","Ꙩ":"ʘ","ⵙ":"ʘ","𐓃":"ʘ","ℾ":"Γ","𝚪":"Γ","𝛤":"Γ","𝜞":"Γ","𝝘":"Γ","𝞒":"Γ","Ⲅ":"Γ","Г":"Γ","Ꮁ":"Γ","ᒥ":"Γ","𖼇":"Γ","Ғ":"Γ̵","ᒯ":"Γ·","Ґ":"Γ\'","∆":"Δ","△":"Δ","🜂":"Δ","𝚫":"Δ","𝛥":"Δ","𝜟":"Δ","𝝙":"Δ","𝞓":"Δ","Ⲇ":"Δ","ⵠ":"Δ","ᐃ":"Δ","𖼚":"Δ","𐊅":"Δ","𐊣":"Δ","⍙":"Δ̲","ᐏ":"Δ·","ᐬ":"Δᐠ","𝟋":"ϝ","𝛇":"ζ","𝜁":"ζ","𝜻":"ζ","𝝵":"ζ","𝞯":"ζ","ⳤ":"ϗ","𝛌":"λ","𝜆":"λ","𝝀":"λ","𝝺":"λ","𝞴":"λ","Ⲗ":"λ","𐓛":"λ","µ":"μ","𝛍":"μ","𝜇":"μ","𝝁":"μ","𝝻":"μ","𝞵":"μ","𝛏":"ξ","𝜉":"ξ","𝝃":"ξ","𝝽":"ξ","𝞷":"ξ","𝚵":"Ξ","𝛯":"Ξ","𝜩":"Ξ","𝝣":"Ξ","𝞝":"Ξ","ϖ":"π","ℼ":"π","𝛑":"π","𝛡":"π","𝜋":"π","𝜛":"π","𝝅":"π","𝝕":"π","𝝿":"π","𝞏":"π","𝞹":"π","𝟉":"π","ᴨ":"π","п":"π","∏":"Π","ℿ":"Π","𝚷":"Π","𝛱":"Π","𝜫":"Π","𝝥":"Π","𝞟":"Π","Ⲡ":"Π","П":"Π","ꛛ":"Π","𐊭":"Ϙ","𐌒":"Ϙ","ϛ":"ς","𝛓":"ς","𝜍":"ς","𝝇":"ς","𝞁":"ς","𝞻":"ς","𝚽":"Φ","𝛷":"Φ","𝜱":"Φ","𝝫":"Φ","𝞥":"Φ","Ⲫ":"Φ","Ф":"Φ","Փ":"Φ","ቀ":"Φ","ᛰ":"Φ","𐊳":"Φ","ꭓ":"χ","ꭕ":"χ","𝛘":"χ","𝜒":"χ","𝝌":"χ","𝞆":"χ","𝟀":"χ","ⲭ":"χ","𝛙":"ψ","𝜓":"ψ","𝝍":"ψ","𝞇":"ψ","𝟁":"ψ","ѱ":"ψ","𐓹":"ψ","𝚿":"Ψ","𝛹":"Ψ","𝜳":"Ψ","𝝭":"Ψ","𝞧":"Ψ","Ⲯ":"Ψ","Ѱ":"Ψ","𐓑":"Ψ","ᛘ":"Ψ","𐊵":"Ψ","⍵":"ω","ꞷ":"ω","𝛚":"ω","𝜔":"ω","𝝎":"ω","𝞈":"ω","𝟂":"ω","ⲱ":"ω","ꙍ":"ω","Ω":"Ω","𝛀":"Ω","𝛺":"Ω","𝜴":"Ω","𝝮":"Ω","𝞨":"Ω","ᘯ":"Ω","ᘵ":"Ω","𐊶":"Ω","⍹":"ω̲","ώ":"ῴ","☰":"Ⲷ","Ⳝ":"Ϭ","җ":"ж̩","Җ":"Ж̩","𝈋":"И","Ͷ":"И","ꚡ":"И","𐐥":"И","Й":"Ѝ","Ҋ":"Ѝ̦","ѝ":"й","ҋ":"й̦","𐒼":"Ӄ","ᴫ":"л","ӆ":"л̦","ꭠ":"љ","𐓫":"ꙩ","ᷮ":"ⷬ","𐓍":"Ћ","𝈂":"Ӿ","𝈢":"Ѡ","Ꮗ":"Ѡ","ᗯ":"Ѡ","Ѽ":"Ѡ҆҇","ᣭ":"Ѡ·","Ꞷ":"Ꙍ","ӌ":"ҷ","Ӌ":"Ҷ","Ҿ":"Ҽ̨","ⲽ":"ш","Ⲽ":"Ш","Ꙑ":"Ъl","℈":"Э","🜁":"Ꙙ","𖼜":"Ꙙ","ꦒ":"ⰿ","և":"եւ","ኔ":"ձ","ﬔ":"մե","ﬕ":"մի","ﬗ":"մխ","ﬓ":"մն","∩":"Ո","⋂":"Ո","𝉅":"Ո","በ":"Ո","ᑎ":"Ո","ꓵ":"Ո","ᑚ":"Ո·","ᑨ":"Ո\'","ﬖ":"վն","₽":"Ք","˓":"ՙ","ʿ":"ՙ","ℵ":"א","ﬡ":"א","אָ":"אַ","אּ":"אַ","ﭏ":"אל","ℶ":"ב","ℷ":"ג","ℸ":"ד","ﬢ":"ד","ﬣ":"ה","יּ":"יִ","ﬤ":"כ","ﬥ":"ל","ﬦ":"ם","ﬠ":"ע","ﬧ":"ר","שׂ":"שׁ","שּ":"שׁ","שּׂ":"שּׁ","ﬨ":"ת","ﺀ":"ء","۽":"ء͈","ﺂ":"آ","ﺁ":"آ","ﭑ":"ٱ","ﭐ":"ٱ","𞸁":"ب","𞸡":"ب","𞹡":"ب","𞺁":"ب","𞺡":"ب","ﺑ":"ب","ﺒ":"ب","ﺐ":"ب","ﺏ":"ب","ݑ":"بۛ","ࢶ":"بۢ","ࢡ":"بٔ","ﲠ":"بo","ﳢ":"بo","ﲜ":"بج","ﰅ":"بج","ﲝ":"بح","ﰆ":"بح","ﷂ":"بحى","ﲞ":"بخ","ﰇ":"بخ","ﳒ":"بخ","ﱋ":"بخ","ﶞ":"بخى","ﱪ":"بر","ﱫ":"بز","ﲟ":"بم","ﳡ":"بم","ﱬ":"بم","ﰈ":"بم","ﱭ":"بن","ﱮ":"بى","ﰉ":"بى","ﱯ":"بى","ﰊ":"بى","ﭔ":"ٻ","ﭕ":"ٻ","ﭓ":"ٻ","ﭒ":"ٻ","ې":"ٻ","ﯦ":"ٻ","ﯧ":"ٻ","ﯥ":"ٻ","ﯤ":"ٻ","ﭜ":"ڀ","ﭝ":"ڀ","ﭛ":"ڀ","ﭚ":"ڀ","ࢩ":"ݔ","ݧ":"ݔ","⍥":"ة","ö":"ة","ﺔ":"ة","ﺓ":"ة","ۃ":"ة","𞸕":"ت","𞸵":"ت","𞹵":"ت","𞺕":"ت","𞺵":"ت","ﺗ":"ت","ﺘ":"ت","ﺖ":"ت","ﺕ":"ت","ﲥ":"تo","ﳤ":"تo","ﲡ":"تج","ﰋ":"تج","ﵐ":"تجم","ﶠ":"تجى","ﶟ":"تجى","ﲢ":"تح","ﰌ":"تح","ﵒ":"تحج","ﵑ":"تحج","ﵓ":"تحم","ﲣ":"تخ","ﰍ":"تخ","ﵔ":"تخم","ﶢ":"تخى","ﶡ":"تخى","ﱰ":"تر","ﱱ":"تز","ﲤ":"تم","ﳣ":"تم","ﱲ":"تم","ﰎ":"تم","ﵕ":"تمج","ﵖ":"تمح","ﵗ":"تمخ","ﶤ":"تمى","ﶣ":"تمى","ﱳ":"تن","ﱴ":"تى","ﰏ":"تى","ﱵ":"تى","ﰐ":"تى","ﭠ":"ٺ","ﭡ":"ٺ","ﭟ":"ٺ","ﭞ":"ٺ","ﭤ":"ٿ","ﭥ":"ٿ","ﭣ":"ٿ","ﭢ":"ٿ","𞸂":"ج","𞸢":"ج","𞹂":"ج","𞹢":"ج","𞺂":"ج","𞺢":"ج","ﺟ":"ج","ﺠ":"ج","ﺞ":"ج","ﺝ":"ج","ﲧ":"جح","ﰕ":"جح","ﶦ":"جحى","ﶾ":"جحى","ﷻ":"جل جلlلo","ﲨ":"جم","ﰖ":"جم","ﵙ":"جمح","ﵘ":"جمح","ﶧ":"جمى","ﶥ":"جمى","ﴝ":"جى","ﴁ":"جى","ﴞ":"جى","ﴂ":"جى","ﭸ":"ڃ","ﭹ":"ڃ","ﭷ":"ڃ","ﭶ":"ڃ","ﭴ":"ڄ","ﭵ":"ڄ","ﭳ":"ڄ","ﭲ":"ڄ","ﭼ":"چ","ﭽ":"چ","ﭻ":"چ","ﭺ":"چ","ﮀ":"ڇ","ﮁ":"ڇ","ﭿ":"ڇ","ﭾ":"ڇ","𞸇":"ح","𞸧":"ح","𞹇":"ح","𞹧":"ح","𞺇":"ح","𞺧":"ح","ﺣ":"ح","ﺤ":"ح","ﺢ":"ح","ﺡ":"ح","څ":"حۛ","ځ":"حٔ","ݲ":"حٔ","ﲩ":"حج","ﰗ":"حج","ﶿ":"حجى","ﲪ":"حم","ﰘ":"حم","ﵛ":"حمى","ﵚ":"حمى","ﴛ":"حى","ﳿ":"حى","ﴜ":"حى","ﴀ":"حى","𞸗":"خ","𞸷":"خ","𞹗":"خ","𞹷":"خ","𞺗":"خ","𞺷":"خ","ﺧ":"خ","ﺨ":"خ","ﺦ":"خ","ﺥ":"خ","ﲫ":"خج","ﰙ":"خج","ﰚ":"خح","ﲬ":"خم","ﰛ":"خم","ﴟ":"خى","ﴃ":"خى","ﴠ":"خى","ﴄ":"خى","𐋡":"د","𞸃":"د","𞺃":"د","𞺣":"د","ﺪ":"د","ﺩ":"د","ڈ":"دؕ","ﮉ":"دؕ","ﮈ":"دؕ","ڎ":"دۛ","ﮇ":"دۛ","ﮆ":"دۛ","ۮ":"د̂","ࢮ":"د̤̣","𞸘":"ذ","𞺘":"ذ","𞺸":"ذ","ﺬ":"ذ","ﺫ":"ذ","ﱛ":"ذٰ","ڋ":"ڊؕ","ﮅ":"ڌ","ﮄ":"ڌ","ﮃ":"ڍ","ﮂ":"ڍ","𞸓":"ر","𞺓":"ر","𞺳":"ر","ﺮ":"ر","ﺭ":"ر","ڑ":"رؕ","ﮍ":"رؕ","ﮌ":"رؕ","ژ":"رۛ","ﮋ":"رۛ","ﮊ":"رۛ","ڒ":"ر̆","ࢹ":"ر̆̇","ۯ":"ر̂","ݬ":"رٔ","ﱜ":"رٰ","ﷶ":"رسول","﷼":"رىlل","𞸆":"ز","𞺆":"ز","𞺦":"ز","ﺰ":"ز","ﺯ":"ز","ࢲ":"ز̂","ݱ":"ڗؕ","𞸎":"س","𞸮":"س","𞹎":"س","𞹮":"س","𞺎":"س","𞺮":"س","ﺳ":"س","ﺴ":"س","ﺲ":"س","ﺱ":"س","ش":"سۛ","𞸔":"سۛ","𞸴":"سۛ","𞹔":"سۛ","𞹴":"سۛ","𞺔":"سۛ","𞺴":"سۛ","ﺷ":"سۛ","ﺸ":"سۛ","ﺶ":"سۛ","ﺵ":"سۛ","ݾ":"س̂","ﴱ":"سo","ﳨ":"سo","ﴲ":"سۛo","ﳪ":"سۛo","ﲭ":"سج","ﴴ":"سج","ﰜ":"سج","ﴭ":"سۛج","ﴷ":"سۛج","ﴥ":"سۛج","ﴉ":"سۛج","ﵝ":"سجح","ﵞ":"سجى","ﵩ":"سۛجى","ﲮ":"سح","ﴵ":"سح","ﰝ":"سح","ﴮ":"سۛح","ﴸ":"سۛح","ﴦ":"سۛح","ﴊ":"سۛح","ﵜ":"سحج","ﵨ":"سۛحم","ﵧ":"سۛحم","ﶪ":"سۛحى","ﲯ":"سخ","ﴶ":"سخ","ﰞ":"سخ","ﴯ":"سۛخ","ﴹ":"سۛخ","ﴧ":"سۛخ","ﴋ":"سۛخ","ﶨ":"سخى","ﷆ":"سخى","ﴪ":"سر","ﴎ":"سر","ﴩ":"سۛر","ﴍ":"سۛر","ﲰ":"سم","ﳧ":"سم","ﰟ":"سم","ﴰ":"سۛم","ﳩ":"سۛم","ﴨ":"سۛم","ﴌ":"سۛم","ﵡ":"سمج","ﵠ":"سمح","ﵟ":"سمح","ﵫ":"سۛمخ","ﵪ":"سۛمخ","ﵣ":"سمم","ﵢ":"سمم","ﵭ":"سۛمم","ﵬ":"سۛمم","ﴗ":"سى","ﳻ":"سى","ﴘ":"سى","ﳼ":"سى","ﴙ":"سۛى","ﳽ":"سۛى","ﴚ":"سۛى","ﳾ":"سۛى","𐋲":"ص","𞸑":"ص","𞸱":"ص","𞹑":"ص","𞹱":"ص","𞺑":"ص","𞺱":"ص","ﺻ":"ص","ﺼ":"ص","ﺺ":"ص","ﺹ":"ص","ڞ":"صۛ","ࢯ":"ص̤̣","ﲱ":"صح","ﰠ":"صح","ﵥ":"صحح","ﵤ":"صحح","ﶩ":"صحى","ﲲ":"صخ","ﴫ":"صر","ﴏ":"صر","ﷵ":"صلعم","ﷹ":"صلى","ﷰ":"صلى","ﷺ":"صلى lللo علىo وسلم","ﲳ":"صم","ﰡ":"صم","ﷅ":"صمم","ﵦ":"صمم","ﴡ":"صى","ﴅ":"صى","ﴢ":"صى","ﴆ":"صى","𞸙":"ض","𞸹":"ض","𞹙":"ض","𞹹":"ض","𞺙":"ض","𞺹":"ض","ﺿ":"ض","ﻀ":"ض","ﺾ":"ض","ﺽ":"ض","ﲴ":"ضج","ﰢ":"ضج","ﲵ":"ضح","ﰣ":"ضح","ﵮ":"ضحى","ﶫ":"ضحى","ﲶ":"ضخ","ﰤ":"ضخ","ﵰ":"ضخم","ﵯ":"ضخم","ﴬ":"ضر","ﴐ":"ضر","ﲷ":"ضم","ﰥ":"ضم","ﴣ":"ضى","ﴇ":"ضى","ﴤ":"ضى","ﴈ":"ضى","𐋨":"ط","𞸈":"ط","𞹨":"ط","𞺈":"ط","𞺨":"ط","ﻃ":"ط","ﻄ":"ط","ﻂ":"ط","ﻁ":"ط","ڟ":"طۛ","ﲸ":"طح","ﰦ":"طح","ﴳ":"طم","ﴺ":"طم","ﰧ":"طم","ﵲ":"طمح","ﵱ":"طمح","ﵳ":"طمم","ﵴ":"طمى","ﴑ":"طى","ﳵ":"طى","ﴒ":"طى","ﳶ":"طى","𞸚":"ظ","𞹺":"ظ","𞺚":"ظ","𞺺":"ظ","ﻇ":"ظ","ﻈ":"ظ","ﻆ":"ظ","ﻅ":"ظ","ﲹ":"ظم","ﴻ":"ظم","ﰨ":"ظم","؏":"ع","𞸏":"ع","𞸯":"ع","𞹏":"ع","𞹯":"ع","𞺏":"ع","𞺯":"ع","ﻋ":"ع","ﻌ":"ع","ﻊ":"ع","ﻉ":"ع","ﲺ":"عج","ﰩ":"عج","ﷄ":"عجم","ﵵ":"عجم","ﷷ":"علىo","ﲻ":"عم","ﰪ":"عم","ﵷ":"عمم","ﵶ":"عمم","ﵸ":"عمى","ﶶ":"عمى","ﴓ":"عى","ﳷ":"عى","ﴔ":"عى","ﳸ":"عى","𞸛":"غ","𞸻":"غ","𞹛":"غ","𞹻":"غ","𞺛":"غ","𞺻":"غ","ﻏ":"غ","ﻐ":"غ","ﻎ":"غ","ﻍ":"غ","ﲼ":"غج","ﰫ":"غج","ﲽ":"غم","ﰬ":"غم","ﵹ":"غمم","ﵻ":"غمى","ﵺ":"غمى","ﴕ":"غى","ﳹ":"غى","ﴖ":"غى","ﳺ":"غى","𞸐":"ف","𞸰":"ف","𞹰":"ف","𞺐":"ف","𞺰":"ف","ﻓ":"ف","ﻔ":"ف","ﻒ":"ف","ﻑ":"ف","ڧ":"ف","ﲾ":"فج","ﰭ":"فج","ﲿ":"فح","ﰮ":"فح","ﳀ":"فخ","ﰯ":"فخ","ﵽ":"فخم","ﵼ":"فخم","ﳁ":"فم","ﰰ":"فم","ﷁ":"فمى","ﱼ":"فى","ﰱ":"فى","ﱽ":"فى","ﰲ":"فى","𞸞":"ڡ","𞹾":"ڡ","ࢻ":"ڡ","ٯ":"ڡ","𞸟":"ڡ","𞹟":"ڡ","ࢼ":"ڡ","ڤ":"ڡۛ","ﭬ":"ڡۛ","ﭭ":"ڡۛ","ﭫ":"ڡۛ","ﭪ":"ڡۛ","ڨ":"ڡۛ","ࢤ":"ڢۛ","ﭰ":"ڦ","ﭱ":"ڦ","ﭯ":"ڦ","ﭮ":"ڦ","𞸒":"ق","𞸲":"ق","𞹒":"ق","𞹲":"ق","𞺒":"ق","𞺲":"ق","ﻗ":"ق","ﻘ":"ق","ﻖ":"ق","ﻕ":"ق","ﳂ":"قح","ﰳ":"قح","ﷱ":"قلى","ﳃ":"قم","ﰴ":"قم","ﶴ":"قمح","ﵾ":"قمح","ﵿ":"قمم","ﶲ":"قمى","ﱾ":"قى","ﰵ":"قى","ﱿ":"قى","ﰶ":"قى","𞸊":"ك","𞸪":"ك","𞹪":"ك","ﻛ":"ك","ﻜ":"ك","ﻚ":"ك","ﻙ":"ك","ک":"ك","ﮐ":"ك","ﮑ":"ك","ﮏ":"ك","ﮎ":"ك","ڪ":"ك","ڭ":"كۛ","ﯕ":"كۛ","ﯖ":"كۛ","ﯔ":"كۛ","ﯓ":"كۛ","ݣ":"كۛ","ﲀ":"كl","ﰷ":"كl","ﳄ":"كج","ﰸ":"كج","ﳅ":"كح","ﰹ":"كح","ﳆ":"كخ","ﰺ":"كخ","ﳇ":"كل","ﳫ":"كل","ﲁ":"كل","ﰻ":"كل","ﳈ":"كم","ﳬ":"كم","ﲂ":"كم","ﰼ":"كم","ﷃ":"كمم","ﶻ":"كمم","ﶷ":"كمى","ﲃ":"كى","ﰽ":"كى","ﲄ":"كى","ﰾ":"كى","ݢ":"ڬ","ﮔ":"گ","ﮕ":"گ","ﮓ":"گ","ﮒ":"گ","ࢰ":"گ","ڴ":"گۛ","ﮜ":"ڱ","ﮝ":"ڱ","ﮛ":"ڱ","ﮚ":"ڱ","ﮘ":"ڳ","ﮙ":"ڳ","ﮗ":"ڳ","ﮖ":"ڳ","𞸋":"ل","𞸫":"ل","𞹋":"ل","𞺋":"ل","𞺫":"ل","ﻟ":"ل","ﻠ":"ل","ﻞ":"ل","ﻝ":"ل","ڷ":"لۛ","ڵ":"ل̆","ﻼ":"لl","ﻻ":"لl","ﻺ":"لlٕ","ﻹ":"لlٕ","ﻸ":"لlٴ","ﻷ":"لlٴ","ﳍ":"لo","ﻶ":"لآ","ﻵ":"لآ","ﳉ":"لج","ﰿ":"لج","ﶃ":"لجج","ﶄ":"لجج","ﶺ":"لجم","ﶼ":"لجم","ﶬ":"لجى","ﳊ":"لح","ﱀ":"لح","ﶵ":"لحم","ﶀ":"لحم","ﶂ":"لحى","ﶁ":"لحى","ﳋ":"لخ","ﱁ":"لخ","ﶆ":"لخم","ﶅ":"لخم","ﳌ":"لم","ﳭ":"لم","ﲅ":"لم","ﱂ":"لم","ﶈ":"لمح","ﶇ":"لمح","ﶭ":"لمى","ﲆ":"لى","ﱃ":"لى","ﲇ":"لى","ﱄ":"لى","𞸌":"م","𞸬":"م","𞹬":"م","𞺌":"م","𞺬":"م","ﻣ":"م","ﻤ":"م","ﻢ":"م","ﻡ":"م","ࢧ":"مۛ","۾":"م͈","ﲈ":"مl","ﳎ":"مج","ﱅ":"مج","ﶌ":"مجح","ﶒ":"مجخ","ﶍ":"مجم","ﷀ":"مجى","ﳏ":"مح","ﱆ":"مح","ﶉ":"محج","ﶊ":"محم","ﷴ":"محمد","ﶋ":"محى","ﳐ":"مخ","ﱇ":"مخ","ﶎ":"مخج","ﶏ":"مخم","ﶹ":"مخى","ﳑ":"مم","ﲉ":"مم","ﱈ":"مم","ﶱ":"ممى","ﱉ":"مى","ﱊ":"مى","𞸍":"ن","𞸭":"ن","𞹍":"ن","𞹭":"ن","𞺍":"ن","𞺭":"ن","ﻧ":"ن","ﻨ":"ن","ﻦ":"ن","ﻥ":"ن","ݨ":"نؕ","ݩ":"ن̆","ﳖ":"نo","ﳯ":"نo","ﶸ":"نجح","ﶽ":"نجح","ﶘ":"نجم","ﶗ":"نجم","ﶙ":"نجى","ﷇ":"نجى","ﳓ":"نح","ﱌ":"نح","ﶕ":"نحم","ﶖ":"نحى","ﶳ":"نحى","ﳔ":"نخ","ﱍ":"نخ","ﲊ":"نر","ﲋ":"نز","ﳕ":"نم","ﳮ":"نم","ﲌ":"نم","ﱎ":"نم","ﶛ":"نمى","ﶚ":"نمى","ﲍ":"نن","ﲎ":"نى","ﱏ":"نى","ﲏ":"نى","ﱐ":"نى","ۂ":"ۀ","ﮥ":"ۀ","ﮤ":"ۀ","𐋤":"و","𞸅":"و","𞺅":"و","𞺥":"و","ﻮ":"و","ﻭ":"و","ࢱ":"و","ۋ":"وۛ","ﯟ":"وۛ","ﯞ":"وۛ","ۇ":"و̓","ﯘ":"و̓","ﯗ":"و̓","ۆ":"و̆","ﯚ":"و̆","ﯙ":"و̆","ۉ":"و̂","ﯣ":"و̂","ﯢ":"و̂","ۈ":"وٰ","ﯜ":"وٰ","ﯛ":"وٰ","ؤ":"وٴ","ﺆ":"وٴ","ﺅ":"وٴ","ٶ":"وٴ","ٷ":"و̓ٴ","ﯝ":"و̓ٴ","ﷸ":"وسلم","ﯡ":"ۅ","ﯠ":"ۅ","ٮ":"ى","𞸜":"ى","𞹼":"ى","ں":"ى","𞸝":"ى","𞹝":"ى","ﮟ":"ى","ﮞ":"ى","ࢽ":"ى","ﯨ":"ى","ﯩ":"ى","ﻰ":"ى","ﻯ":"ى","ي":"ى","𞸉":"ى","𞸩":"ى","𞹉":"ى","𞹩":"ى","𞺉":"ى","𞺩":"ى","ﻳ":"ى","ﻴ":"ى","ﻲ":"ى","ﻱ":"ى","ی":"ى","ﯾ":"ى","ﯿ":"ى","ﯽ":"ى","ﯼ":"ى","ے":"ى","ﮯ":"ى","ﮮ":"ى","ٹ":"ىؕ","ﭨ":"ىؕ","ﭩ":"ىؕ","ﭧ":"ىؕ","ﭦ":"ىؕ","ڻ":"ىؕ","ﮢ":"ىؕ","ﮣ":"ىؕ","ﮡ":"ىؕ","ﮠ":"ىؕ","پ":"ىۛ","ﭘ":"ىۛ","ﭙ":"ىۛ","ﭗ":"ىۛ","ﭖ":"ىۛ","ث":"ىۛ","𞸖":"ىۛ","𞸶":"ىۛ","𞹶":"ىۛ","𞺖":"ىۛ","𞺶":"ىۛ","ﺛ":"ىۛ","ﺜ":"ىۛ","ﺚ":"ىۛ","ﺙ":"ىۛ","ڽ":"ىۛ","ۑ":"ىۛ","ؿ":"ىۛ","ࢷ":"ىۛۢ","ݖ":"ى̆","ێ":"ى̆","ࢺ":"ى̆̇","ؽ":"ى̂","ࢨ":"ىٔ","ﲐ":"ىٰ","ﱝ":"ىٰ","ﳞ":"ىo","ﳱ":"ىo","ﳦ":"ىۛo","ئ":"ىٴ","ﺋ":"ىٴ","ﺌ":"ىٴ","ﺊ":"ىٴ","ﺉ":"ىٴ","ٸ":"ىٴ","ﯫ":"ىٴl","ﯪ":"ىٴl","ﲛ":"ىٴo","ﳠ":"ىٴo","ﯭ":"ىٴo","ﯬ":"ىٴo","ﯸ":"ىٴٻ","ﯷ":"ىٴٻ","ﯶ":"ىٴٻ","ﲗ":"ىٴج","ﰀ":"ىٴج","ﲘ":"ىٴح","ﰁ":"ىٴح","ﲙ":"ىٴخ","ﱤ":"ىٴر","ﱥ":"ىٴز","ﲚ":"ىٴم","ﳟ":"ىٴم","ﱦ":"ىٴم","ﰂ":"ىٴم","ﱧ":"ىٴن","ﯯ":"ىٴو","ﯮ":"ىٴو","ﯱ":"ىٴو̓","ﯰ":"ىٴو̓","ﯳ":"ىٴو̆","ﯲ":"ىٴو̆","ﯵ":"ىٴوٰ","ﯴ":"ىٴوٰ","ﯻ":"ىٴى","ﯺ":"ىٴى","ﱨ":"ىٴى","ﯹ":"ىٴى","ﰃ":"ىٴى","ﱩ":"ىٴى","ﰄ":"ىٴى","ﳚ":"ىج","ﱕ":"ىج","ﰑ":"ىۛج","ﶯ":"ىجى","ﳛ":"ىح","ﱖ":"ىح","ﶮ":"ىحى","ﳜ":"ىخ","ﱗ":"ىخ","ﲑ":"ىر","ﱶ":"ىۛر","ﲒ":"ىز","ﱷ":"ىۛز","ﳝ":"ىم","ﳰ":"ىم","ﲓ":"ىم","ﱘ":"ىم","ﲦ":"ىۛم","ﳥ":"ىۛم","ﱸ":"ىۛم","ﰒ":"ىۛم","ﶝ":"ىمم","ﶜ":"ىمم","ﶰ":"ىمى","ﲔ":"ىن","ﱹ":"ىۛن","ﲕ":"ىى","ﱙ":"ىى","ﲖ":"ىى","ﱚ":"ىى","ﱺ":"ىۛى","ﰓ":"ىۛى","ﱻ":"ىۛى","ﰔ":"ىۛى","ﮱ":"ۓ","ﮰ":"ۓ","𐊸":"ⵀ","⁞":"ⵂ","⸽":"ⵂ","⦙":"ⵂ","︙":"ⵗ","⁝":"ⵗ","⋮":"ⵗ","Մ":"ሆ","Ռ":"ቡ","Ի":"ኮ","Պ":"ጣ","आ":"अा","ऒ":"अाॆ","ओ":"अाे","औ":"अाै","ऄ":"अॆ","ऑ":"अॉ","ऍ":"एॅ","ऎ":"एॆ","ऐ":"एे","ई":"र्इ","ઽ":"ऽ","𑇜":"ꣻ","𑇋":"ऺ","ુ":"ु","ૂ":"ू","ੋ":"ॆ","੍":"्","્":"्","আ":"অা","ৠ":"ঋৃ","ৡ":"ঋৃ","𑒒":"ঘ","𑒔":"চ","𑒖":"জ","𑒘":"ঞ","𑒙":"ট","𑒛":"ড","𑒪":"ণ","𑒞":"ত","𑒟":"থ","𑒠":"দ","𑒡":"ধ","𑒢":"ন","𑒣":"প","𑒩":"ব","𑒧":"ম","𑒨":"য","𑒫":"র","𑒝":"ল","𑒭":"ষ","𑒮":"স","𑓄":"ঽ","𑒰":"া","𑒱":"ি","𑒹":"ে","𑒼":"ো","𑒾":"ৌ","𑓂":"্","𑒽":"ৗ","ਉ":"ੳੁ","ਊ":"ੳੂ","ਆ":"ਅਾ","ਐ":"ਅੈ","ਔ":"ਅੌ","ਇ":"ੲਿ","ਈ":"ੲੀ","ਏ":"ੲੇ","આ":"અા","ઑ":"અાૅ","ઓ":"અાે","ઔ":"અાૈ","ઍ":"અૅ","એ":"અે","ઐ":"અૈ","ଆ":"ଅା","௮":"அ","ர":"ஈ","ா":"ஈ","௫":"ஈு","௨":"உ","ഉ":"உ","ஊ":"உள","ഊ":"உൗ","௭":"எ","௷":"எவ","ஜ":"ஐ","ജ":"ஐ","௧":"க","௪":"ச","௬":"சு","௲":"சூ","ഺ":"டி","ണ":"ண","௺":"நீ","௴":"மீ","௰":"ய","ഴ":"ழ","ௗ":"ள","ை":"ன","ശ":"ஶ","௸":"ஷ","ി":"ி","ീ":"ி","ொ":"ெஈ","ௌ":"ெள","ோ":"ேஈ","ಅ":"అ","ಆ":"ఆ","ಇ":"ఇ","ౠ":"ఋా","ౡ":"ఌా","ಒ":"ఒ","ఔ":"ఒౌ","ಔ":"ఒౌ","ఓ":"ఒౕ","ಓ":"ఒౕ","ಜ":"జ","ಞ":"ఞ","ఢ":"డ̣","ಣ":"ణ","థ":"ధּ","భ":"బ̣","ಯ":"య","ఠ":"రּ","ಱ":"ఱ","ಲ":"ల","ష":"వ̣","హ":"వా","మ":"వు","ూ":"ుా","ౄ":"ృా","ೡ":"ಌಾ","ഈ":"ഇൗ","ഐ":"എെ","ഓ":"ഒാ","ഔ":"ഒൗ","ൡ":"ഞ","൫":"ദ്ര","൹":"നു","ഌ":"നു","ങ":"നു","൯":"ന്","ൻ":"ന്","൬":"ന്ന","൚":"ന്മ","റ":"ര","൪":"ര്","ർ":"ര്","൮":"വ്ര","൶":"ഹ്മ","ൂ":"ു","ൃ":"ു","ൈ":"െെ","෪":"ජ","෫":"ද","𑐓":"𑐴𑑂𑐒","𑐙":"𑐴𑑂𑐘","𑐤":"𑐴𑑂𑐣","𑐪":"𑐴𑑂𑐩","𑐭":"𑐴𑑂𑐬","𑐯":"𑐴𑑂𑐮","𑗘":"𑖂","𑗙":"𑖂","𑗚":"𑖃","𑗛":"𑖄","𑗜":"𑖲","𑗝":"𑖳","ฃ":"ข","ด":"ค","ต":"ค","ม":"ฆ","ຈ":"จ","ซ":"ช","ฏ":"ฎ","ท":"ฑ","ບ":"บ","ປ":"ป","ຝ":"ฝ","ພ":"พ","ຟ":"ฟ","ฦ":"ภ","ຍ":"ย","។":"ฯ","ๅ":"า","ำ":"̊า","ិ":"ิ","ី":"ี","ឹ":"ึ","ឺ":"ื","ຸ":"ุ","ູ":"ู","แ":"เเ","ໜ":"ຫນ","ໝ":"ຫມ","ຳ":"̊າ","༂":"འུྂཿ","༃":"འུྂ༔","ཪ":"ར","ༀ":"ཨོཾ","ཷ":"ྲཱྀ","ཹ":"ླཱྀ","𑲲":"𑲪","ႁ":"ဂှ","က":"ဂာ","ၰ":"ဃှ","ၦ":"ပှ","ဟ":"ပာ","ၯ":"ပာှ","ၾ":"ၽှ","ဩ":"သြ","ဪ":"သြော်","႞":"ႃ̊","ឣ":"អ","᧐":"ᦞ","᧑":"ᦱ","᪀":"ᩅ","᪐":"ᩅ","꩓":"ꨁ","꩖":"ꨣ","᭒":"ᬍ","᭓":"ᬑ","᭘":"ᬨ","ꦣ":"ꦝ","ᢖ":"ᡜ","ᡕ":"ᠵ","ῶ":"Ꮿ","ᐍ":"ᐁ·","ᐫ":"ᐁᐠ","ᐑ":"ᐄ·","ᐓ":"ᐅ·","ᐭ":"ᐅᐠ","ᐕ":"ᐆ·","ᐘ":"ᐊ·","ᐮ":"ᐊᐠ","ᐚ":"ᐋ·","ᣝ":"ᐞᣟ","ᓑ":"ᐡ","ᕀ":"ᐩ","ᐿ":"ᐲ·","ᑃ":"ᐴ·","⍩":"ᐵ","ᑇ":"ᐹ·","ᑜ":"ᑏ·","⸧":"ᑐ","⊃":"ᑐ","ᑞ":"ᑐ·","ᑩ":"ᑐ\'","⟉":"ᑐ/","⫗":"ᑐᑕ","ᑠ":"ᑑ·","⸦":"ᑕ","⊂":"ᑕ","ᑢ":"ᑕ·","ᑪ":"ᑕ\'","ᑤ":"ᑖ·","ᑵ":"ᑫ·","ᒅ":"ᑫ\'","ᑹ":"ᑮ·","ᑽ":"ᑰ·","ᘃ":"ᒉ","ᒓ":"ᒉ·","ᒕ":"ᒋ·","ᒗ":"ᒌ·","ᒛ":"ᒎ·","ᘂ":"ᒐ","ᒝ":"ᒐ·","ᒟ":"ᒑ·","ᒭ":"ᒣ·","ᒱ":"ᒦ·","ᒳ":"ᒧ·","ᒵ":"ᒨ·","ᒹ":"ᒫ·","ᓊ":"ᓀ·","ᣇ":"ᓂ·","ᣉ":"ᓃ·","ᣋ":"ᓄ·","ᣍ":"ᓅ·","ᓌ":"ᓇ·","ᓎ":"ᓈ·","ᘄ":"ᓓ","ᓝ":"ᓓ·","ᓟ":"ᓕ·","ᓡ":"ᓖ·","ᓣ":"ᓗ·","ᓥ":"ᓘ·","ᘇ":"ᓚ","ᓧ":"ᓚ·","ᓩ":"ᓛ·","ᓷ":"ᓭ·","ᓹ":"ᓯ·","ᓻ":"ᓰ·","ᓽ":"ᓱ·","ᓿ":"ᓲ·","ᔁ":"ᓴ·","ᔃ":"ᓵ·","ᔌ":"ᔋ<","ᔎ":"ᔋb","ᔍ":"ᔋᑕ","ᔏ":"ᔋᒐ","ᔘ":"ᔐ·","ᔚ":"ᔑ·","ᔜ":"ᔒ·","ᔞ":"ᔓ·","ᔠ":"ᔔ·","ᔢ":"ᔕ·","ᔤ":"ᔖ·","ᔲ":"ᔨ·","ᔴ":"ᔩ·","ᔶ":"ᔪ·","ᔸ":"ᔫ·","ᔺ":"ᔭ·","ᔼ":"ᔮ·","ᘢ":"ᕃ","ᣠ":"ᕃ·","ᘣ":"ᕆ","ᘤ":"ᕊ","ᕏ":"ᕌ·","ᖃ":"ᕐb","ᖄ":"ᕐḃ","ᖁ":"ᕐd","ᕿ":"ᕐP","ᙯ":"ᕐᑫ","ᕾ":"ᕐᑬ","ᖀ":"ᕐᑮ","ᖂ":"ᕐᑰ","ᖅ":"ᕐᒃ","ᕜ":"ᕚ·","ᣣ":"ᕞ·","ᣤ":"ᕦ·","ᕩ":"ᕧ·","ᣥ":"ᕫ·","ᣨ":"ᖆ·","ᖑ":"ᖕJ","ᙰ":"ᖕᒉ","ᖎ":"ᖕᒊ","ᖏ":"ᖕᒋ","ᖐ":"ᖕᒌ","ᖒ":"ᖕᒎ","ᖓ":"ᖕᒐ","ᖔ":"ᖕᒑ","ᙳ":"ᖖJ","ᙱ":"ᖖᒋ","ᙲ":"ᖖᒌ","ᙴ":"ᖖᒎ","ᙵ":"ᖖᒐ","ᙶ":"ᖖᒑ","ᣪ":"ᖗ·","ᙷ":"ᖧ·","ᙸ":"ᖨ·","ᙹ":"ᖩ·","ᙺ":"ᖪ·","ᙻ":"ᖫ·","ᙼ":"ᖬ·","ᙽ":"ᖭ·","⪫":"ᗒ","⪪":"ᗕ","ꓷ":"ᗡ","ᣰ":"ᗴ·","ᣲ":"ᘛ·","ᶻ":"ᙆ","ꓭ":"ᙠ","ᶺ":"ᣔ","ᴾ":"ᣖ","ᣜ":"ᣟᐞ","ˡ":"ᣳ","ʳ":"ᣴ","ˢ":"ᣵ","ᣛ":"ᣵ","ꚰ":"ᚹ","ᛡ":"ᚼ","⍿":"ᚽ","ᛂ":"ᚽ","𝈿":"ᛋ","↑":"ᛏ","↿":"ᛐ","⥮":"ᛐ⇂","⥣":"ᛐᛚ","ⵣ":"ᛯ","↾":"ᛚ","⨡":"ᛚ","⋄":"ᛜ","◇":"ᛜ","◊":"ᛜ","♢":"ᛜ","🝔":"ᛜ","𑢷":"ᛜ","𐊔":"ᛜ","⍚":"ᛜ̲","⋈":"ᛞ","⨝":"ᛞ","𐓐":"ᛦ","↕":"ᛨ","𐳼":"𐲂","𐳺":"𐲥","ㄱ":"ᄀ","ᆨ":"ᄀ","ᄁ":"ᄀᄀ","ㄲ":"ᄀᄀ","ᆩ":"ᄀᄀ","ᇺ":"ᄀᄂ","ᅚ":"ᄀᄃ","ᇃ":"ᄀᄅ","ᇻ":"ᄀᄇ","ᆪ":"ᄀᄉ","ㄳ":"ᄀᄉ","ᇄ":"ᄀᄉᄀ","ᇼ":"ᄀᄎ","ᇽ":"ᄀᄏ","ᇾ":"ᄀᄒ","ㄴ":"ᄂ","ᆫ":"ᄂ","ᄓ":"ᄂᄀ","ᇅ":"ᄂᄀ","ᄔ":"ᄂᄂ","ㅥ":"ᄂᄂ","ᇿ":"ᄂᄂ","ᄕ":"ᄂᄃ","ㅦ":"ᄂᄃ","ᇆ":"ᄂᄃ","ퟋ":"ᄂᄅ","ᄖ":"ᄂᄇ","ᅛ":"ᄂᄉ","ᇇ":"ᄂᄉ","ㅧ":"ᄂᄉ","ᅜ":"ᄂᄌ","ᆬ":"ᄂᄌ","ㄵ":"ᄂᄌ","ퟌ":"ᄂᄎ","ᇉ":"ᄂᄐ","ᅝ":"ᄂᄒ","ᆭ":"ᄂᄒ","ㄶ":"ᄂᄒ","ᇈ":"ᄂᅀ","ㅨ":"ᄂᅀ","ㄷ":"ᄃ","ᆮ":"ᄃ","ᄗ":"ᄃᄀ","ᇊ":"ᄃᄀ","ᄄ":"ᄃᄃ","ㄸ":"ᄃᄃ","ퟍ":"ᄃᄃ","ퟎ":"ᄃᄃᄇ","ᅞ":"ᄃᄅ","ᇋ":"ᄃᄅ","ꥠ":"ᄃᄆ","ꥡ":"ᄃᄇ","ퟏ":"ᄃᄇ","ꥢ":"ᄃᄉ","ퟐ":"ᄃᄉ","ퟑ":"ᄃᄉᄀ","ꥣ":"ᄃᄌ","ퟒ":"ᄃᄌ","ퟓ":"ᄃᄎ","ퟔ":"ᄃᄐ","ㄹ":"ᄅ","ᆯ":"ᄅ","ꥤ":"ᄅᄀ","ᆰ":"ᄅᄀ","ㄺ":"ᄅᄀ","ꥥ":"ᄅᄀᄀ","ퟕ":"ᄅᄀᄀ","ᇌ":"ᄅᄀᄉ","ㅩ":"ᄅᄀᄉ","ퟖ":"ᄅᄀᄒ","ᄘ":"ᄅᄂ","ᇍ":"ᄅᄂ","ꥦ":"ᄅᄃ","ᇎ":"ᄅᄃ","ㅪ":"ᄅᄃ","ꥧ":"ᄅᄃᄃ","ᇏ":"ᄅᄃᄒ","ᄙ":"ᄅᄅ","ᇐ":"ᄅᄅ","ퟗ":"ᄅᄅᄏ","ꥨ":"ᄅᄆ","ᆱ":"ᄅᄆ","ㄻ":"ᄅᄆ","ᇑ":"ᄅᄆᄀ","ᇒ":"ᄅᄆᄉ","ퟘ":"ᄅᄆᄒ","ꥩ":"ᄅᄇ","ᆲ":"ᄅᄇ","ㄼ":"ᄅᄇ","ퟙ":"ᄅᄇᄃ","ꥪ":"ᄅᄇᄇ","ᇓ":"ᄅᄇᄉ","ㅫ":"ᄅᄇᄉ","ꥫ":"ᄅᄇᄋ","ᇕ":"ᄅᄇᄋ","ퟚ":"ᄅᄇᄑ","ᇔ":"ᄅᄇᄒ","ꥬ":"ᄅᄉ","ᆳ":"ᄅᄉ","ㄽ":"ᄅᄉ","ᇖ":"ᄅᄉᄉ","ᄛ":"ᄅᄋ","ퟝ":"ᄅᄋ","ꥭ":"ᄅᄌ","ꥮ":"ᄅᄏ","ᇘ":"ᄅᄏ","ᆴ":"ᄅᄐ","ㄾ":"ᄅᄐ","ᆵ":"ᄅᄑ","ㄿ":"ᄅᄑ","ᄚ":"ᄅᄒ","ㅀ":"ᄅᄒ","ᄻ":"ᄅᄒ","ᆶ":"ᄅᄒ","ퟲ":"ᄅᄒ","ᇗ":"ᄅᅀ","ㅬ":"ᄅᅀ","ퟛ":"ᄅᅌ","ᇙ":"ᄅᅙ","ㅭ":"ᄅᅙ","ퟜ":"ᄅᅙᄒ","ㅁ":"ᄆ","ᆷ":"ᄆ","ꥯ":"ᄆᄀ","ᇚ":"ᄆᄀ","ퟞ":"ᄆᄂ","ퟟ":"ᄆᄂᄂ","ꥰ":"ᄆᄃ","ᇛ":"ᄆᄅ","ퟠ":"ᄆᄆ","ᄜ":"ᄆᄇ","ㅮ":"ᄆᄇ","ᇜ":"ᄆᄇ","ퟡ":"ᄆᄇᄉ","ꥱ":"ᄆᄉ","ᇝ":"ᄆᄉ","ㅯ":"ᄆᄉ","ᇞ":"ᄆᄉᄉ","ᄝ":"ᄆᄋ","ㅱ":"ᄆᄋ","ᇢ":"ᄆᄋ","ퟢ":"ᄆᄌ","ᇠ":"ᄆᄎ","ᇡ":"ᄆᄒ","ᇟ":"ᄆᅀ","ㅰ":"ᄆᅀ","ㅂ":"ᄇ","ᆸ":"ᄇ","ᄞ":"ᄇᄀ","ㅲ":"ᄇᄀ","ᄟ":"ᄇᄂ","ᄠ":"ᄇᄃ","ㅳ":"ᄇᄃ","ퟣ":"ᄇᄃ","ᇣ":"ᄇᄅ","ퟤ":"ᄇᄅᄑ","ퟥ":"ᄇᄆ","ᄈ":"ᄇᄇ","ㅃ":"ᄇᄇ","ퟦ":"ᄇᄇ","ᄬ":"ᄇᄇᄋ","ㅹ":"ᄇᄇᄋ","ᄡ":"ᄇᄉ","ㅄ":"ᄇᄉ","ᆹ":"ᄇᄉ","ᄢ":"ᄇᄉᄀ","ㅴ":"ᄇᄉᄀ","ᄣ":"ᄇᄉᄃ","ㅵ":"ᄇᄉᄃ","ퟧ":"ᄇᄉᄃ","ᄤ":"ᄇᄉᄇ","ᄥ":"ᄇᄉᄉ","ᄦ":"ᄇᄉᄌ","ꥲ":"ᄇᄉᄐ","ᄫ":"ᄇᄋ","ㅸ":"ᄇᄋ","ᇦ":"ᄇᄋ","ᄧ":"ᄇᄌ","ㅶ":"ᄇᄌ","ퟨ":"ᄇᄌ","ᄨ":"ᄇᄎ","ퟩ":"ᄇᄎ","ꥳ":"ᄇᄏ","ᄩ":"ᄇᄐ","ㅷ":"ᄇᄐ","ᄪ":"ᄇᄑ","ᇤ":"ᄇᄑ","ꥴ":"ᄇᄒ","ᇥ":"ᄇᄒ","ㅅ":"ᄉ","ᆺ":"ᄉ","ᄭ":"ᄉᄀ","ㅺ":"ᄉᄀ","ᇧ":"ᄉᄀ","ᄮ":"ᄉᄂ","ㅻ":"ᄉᄂ","ᄯ":"ᄉᄃ","ㅼ":"ᄉᄃ","ᇨ":"ᄉᄃ","ᄰ":"ᄉᄅ","ᇩ":"ᄉᄅ","ᄱ":"ᄉᄆ","ퟪ":"ᄉᄆ","ᄲ":"ᄉᄇ","ㅽ":"ᄉᄇ","ᇪ":"ᄉᄇ","ᄳ":"ᄉᄇᄀ","ퟫ":"ᄉᄇᄋ","ᄊ":"ᄉᄉ","ㅆ":"ᄉᄉ","ᆻ":"ᄉᄉ","ퟬ":"ᄉᄉᄀ","ퟭ":"ᄉᄉᄃ","ꥵ":"ᄉᄉᄇ","ᄴ":"ᄉᄉᄉ","ᄵ":"ᄉᄋ","ᄶ":"ᄉᄌ","ㅾ":"ᄉᄌ","ퟯ":"ᄉᄌ","ᄷ":"ᄉᄎ","ퟰ":"ᄉᄎ","ᄸ":"ᄉᄏ","ᄹ":"ᄉᄐ","ퟱ":"ᄉᄐ","ᄺ":"ᄉᄑ","ퟮ":"ᄉᅀ","ㅇ":"ᄋ","ᆼ":"ᄋ","ᅁ":"ᄋᄀ","ᇬ":"ᄋᄀ","ᇭ":"ᄋᄀᄀ","ᅂ":"ᄋᄃ","ꥶ":"ᄋᄅ","ᅃ":"ᄋᄆ","ᅄ":"ᄋᄇ","ᅅ":"ᄋᄉ","ᇱ":"ᄋᄉ","ㆂ":"ᄋᄉ","ᅇ":"ᄋᄋ","ㆀ":"ᄋᄋ","ᇮ":"ᄋᄋ","ᅈ":"ᄋᄌ","ᅉ":"ᄋᄎ","ᇯ":"ᄋᄏ","ᅊ":"ᄋᄐ","ᅋ":"ᄋᄑ","ꥷ":"ᄋᄒ","ᅆ":"ᄋᅀ","ᇲ":"ᄋᅀ","ㆃ":"ᄋᅀ","ㅈ":"ᄌ","ᆽ":"ᄌ","ퟷ":"ᄌᄇ","ퟸ":"ᄌᄇᄇ","ᅍ":"ᄌᄋ","ᄍ":"ᄌᄌ","ㅉ":"ᄌᄌ","ퟹ":"ᄌᄌ","ꥸ":"ᄌᄌᄒ","ㅊ":"ᄎ","ᆾ":"ᄎ","ᅒ":"ᄎᄏ","ᅓ":"ᄎᄒ","ㅋ":"ᄏ","ᆿ":"ᄏ","ㅌ":"ᄐ","ᇀ":"ᄐ","ꥹ":"ᄐᄐ","ㅍ":"ᄑ","ᇁ":"ᄑ","ᅖ":"ᄑᄇ","ᇳ":"ᄑᄇ","ퟺ":"ᄑᄉ","ᅗ":"ᄑᄋ","ㆄ":"ᄑᄋ","ᇴ":"ᄑᄋ","ퟻ":"ᄑᄐ","ꥺ":"ᄑᄒ","ㅎ":"ᄒ","ᇂ":"ᄒ","ᇵ":"ᄒᄂ","ᇶ":"ᄒᄅ","ᇷ":"ᄒᄆ","ᇸ":"ᄒᄇ","ꥻ":"ᄒᄉ","ᅘ":"ᄒᄒ","ㆅ":"ᄒᄒ","ᄽ":"ᄼᄼ","ᄿ":"ᄾᄾ","ㅿ":"ᅀ","ᇫ":"ᅀ","ퟳ":"ᅀᄇ","ퟴ":"ᅀᄇᄋ","ㆁ":"ᅌ","ᇰ":"ᅌ","ퟵ":"ᅌᄆ","ퟶ":"ᅌᄒ","ᅏ":"ᅎᅎ","ᅑ":"ᅐᅐ","ㆆ":"ᅙ","ᇹ":"ᅙ","ꥼ":"ᅙᅙ","ㅤ":"ᅠ","ㅏ":"ᅡ","ᆣ":"ᅡー","ᅶ":"ᅡᅩ","ᅷ":"ᅡᅮ","ᅢ":"ᅡ丨","ㅐ":"ᅡ丨","ㅑ":"ᅣ","ᅸ":"ᅣᅩ","ᅹ":"ᅣᅭ","ᆤ":"ᅣᅮ","ᅤ":"ᅣ丨","ㅒ":"ᅣ丨","ㅓ":"ᅥ","ᅼ":"ᅥー","ᅺ":"ᅥᅩ","ᅻ":"ᅥᅮ","ᅦ":"ᅥ丨","ㅔ":"ᅥ丨","ㅕ":"ᅧ","ᆥ":"ᅧᅣ","ᅽ":"ᅧᅩ","ᅾ":"ᅧᅮ","ᅨ":"ᅧ丨","ㅖ":"ᅧ丨","ㅗ":"ᅩ","ᅪ":"ᅩᅡ","ㅘ":"ᅩᅡ","ᅫ":"ᅩᅡ丨","ㅙ":"ᅩᅡ丨","ᆦ":"ᅩᅣ","ᆧ":"ᅩᅣ丨","ᅿ":"ᅩᅥ","ᆀ":"ᅩᅥ丨","ힰ":"ᅩᅧ","ᆁ":"ᅩᅧ丨","ᆂ":"ᅩᅩ","ힱ":"ᅩᅩ丨","ᆃ":"ᅩᅮ","ᅬ":"ᅩ丨","ㅚ":"ᅩ丨","ㅛ":"ᅭ","ힲ":"ᅭᅡ","ힳ":"ᅭᅡ丨","ᆄ":"ᅭᅣ","ㆇ":"ᅭᅣ","ᆆ":"ᅭᅣ","ᆅ":"ᅭᅣ丨","ㆈ":"ᅭᅣ丨","ힴ":"ᅭᅥ","ᆇ":"ᅭᅩ","ᆈ":"ᅭ丨","ㆉ":"ᅭ丨","ㅜ":"ᅮ","ᆉ":"ᅮᅡ","ᆊ":"ᅮᅡ丨","ᅯ":"ᅮᅥ","ㅝ":"ᅮᅥ","ᆋ":"ᅮᅥー","ᅰ":"ᅮᅥ丨","ㅞ":"ᅮᅥ丨","ힵ":"ᅮᅧ","ᆌ":"ᅮᅧ丨","ᆍ":"ᅮᅮ","ᅱ":"ᅮ丨","ㅟ":"ᅮ丨","ힶ":"ᅮ丨丨","ㅠ":"ᅲ","ᆎ":"ᅲᅡ","ힷ":"ᅲᅡ丨","ᆏ":"ᅲᅥ","ᆐ":"ᅲᅥ丨","ᆑ":"ᅲᅧ","ㆊ":"ᅲᅧ","ᆒ":"ᅲᅧ丨","ㆋ":"ᅲᅧ丨","ힸ":"ᅲᅩ","ᆓ":"ᅲᅮ","ᆔ":"ᅲ丨","ㆌ":"ᅲ丨","ㆍ":"ᆞ","ퟅ":"ᆞᅡ","ᆟ":"ᆞᅥ","ퟆ":"ᆞᅥ丨","ᆠ":"ᆞᅮ","ᆢ":"ᆞᆞ","ᆡ":"ᆞ丨","ㆎ":"ᆞ丨","ヘ":"へ","⍁":"〼","⧄":"〼","꒞":"ꁊ","꒬":"ꁐ","꒜":"ꃀ","꒨":"ꄲ","꒿":"ꉙ","꒾":"ꊱ","꒔":"ꋍ","꓀":"ꎫ","꓂":"ꎵ","꒺":"ꎿ","꒰":"ꏂ","꒧":"ꑘ","⊥":"ꓕ","⟂":"ꓕ","𝈜":"ꓕ","Ʇ":"ꓕ","Ꞟ":"ꓤ","⅁":"ꓨ","⅂":"ꓶ","𝈕":"ꓶ","𝈫":"ꓶ","𖼦":"ꓶ","𐐑":"ꓶ","⅃":"𖼀","𑫦":"𑫥𑫯","𑫨":"𑫥𑫥","𑫩":"𑫥𑫥𑫯","𑫪":"𑫥𑫥𑫰","𑫧":"𑫥𑫰","𑫴":"𑫳𑫯","𑫶":"𑫳𑫳","𑫷":"𑫳𑫳𑫯","𑫸":"𑫳𑫳𑫰","𑫵":"𑫳𑫰","𑫬":"𑫫𑫯","𑫭":"𑫫𑫫","𑫮":"𑫫𑫫𑫯","⊕":"𐊨","⨁":"𐊨","🜨":"𐊨","Ꚛ":"𐊨","▽":"𐊼","𝈔":"𐊼","🜄":"𐊼","⧖":"𐋀","ꞛ":"𐐺","Ꞛ":"𐐒","𐒠":"𐒆","𐏑":"𐎂","𐏓":"𐎓","𒀸":"𐎚","☥":"𐦞","𓋹":"𐦞","〹":"卄","不":"不","丽":"丽","並":"並","⎜":"丨","⎟":"丨","⎢":"丨","⎥":"丨","⎪":"丨","⎮":"丨","㇑":"丨","ᅵ":"丨","ㅣ":"丨","⼁":"丨","ᆜ":"丨ー","ᆘ":"丨ᅡ","ᆙ":"丨ᅣ","ힽ":"丨ᅣᅩ","ힾ":"丨ᅣ丨","ힿ":"丨ᅧ","ퟀ":"丨ᅧ丨","ᆚ":"丨ᅩ","ퟁ":"丨ᅩ丨","ퟂ":"丨ᅭ","ᆛ":"丨ᅮ","ퟃ":"丨ᅲ","ᆝ":"丨ᆞ","ퟄ":"丨丨","串":"串","丸":"丸","丹":"丹","乁":"乁","㇠":"乙","⼄":"乙","㇟":"乚","⺃":"乚","㇖":"乛","⺂":"乛","⻲":"亀","亂":"亂","㇚":"亅","⼅":"亅","了":"了","ニ":"二","⼆":"二","𠄢":"𠄢","⼇":"亠","亮":"亮","⼈":"人","イ":"亻","⺅":"亻","什":"什","仌":"仌","令":"令","你":"你","倂":"併","倂":"併","侀":"侀","來":"來","例":"例","侮":"侮","侮":"侮","侻":"侻","便":"便","值":"値","倫":"倫","偺":"偺","備":"備","像":"像","僚":"僚","僧":"僧","僧":"僧","㒞":"㒞","⼉":"儿","兀":"兀","⺎":"兀","充":"充","免":"免","免":"免","兔":"兔","兤":"兤","⼊":"入","內":"內","全":"全","兩":"兩","ハ":"八","⼋":"八","六":"六","具":"具","𠔜":"𠔜","𠔥":"𠔥","冀":"冀","㒹":"㒹","⼌":"冂","再":"再","𠕋":"𠕋","冒":"冒","冕":"冕","㒻":"㒻","最":"最","⼍":"冖","冗":"冗","冤":"冤","⼎":"冫","冬":"冬","况":"况","况":"况","冷":"冷","凉":"凉","凌":"凌","凜":"凜","凞":"凞","⼏":"几","𠘺":"𠘺","凵":"凵","⼐":"凵","⼑":"刀","⺉":"刂","刃":"刃","切":"切","切":"切","列":"列","利":"利","㓟":"㓟","刺":"刺","刻":"刻","剆":"剆","割":"割","剷":"剷","劉":"劉","𠠄":"𠠄","カ":"力","力":"力","⼒":"力","劣":"劣","㔕":"㔕","劳":"劳","勇":"勇","勇":"勇","勉":"勉","勉":"勉","勒":"勒","勞":"勞","勤":"勤","勤":"勤","勵":"勵","⼓":"勹","勺":"勺","勺":"勺","包":"包","匆":"匆","𠣞":"𠣞","⼔":"匕","北":"北","北":"北","⼕":"匚","⼖":"匸","匿":"匿","⼗":"十","〸":"十","〺":"卅","卉":"卉","࿖":"卍","࿕":"卐","卑":"卑","卑":"卑","博":"博","ト":"卜","⼘":"卜","⼙":"卩","⺋":"㔾","即":"即","卵":"卵","卽":"卽","卿":"卿","卿":"卿","卿":"卿","⼚":"厂","𠨬":"𠨬","⼛":"厶","參":"參","⼜":"又","及":"及","叟":"叟","𠭣":"𠭣","ロ":"口","⼝":"口","囗":"口","⼞":"口","句":"句","叫":"叫","叱":"叱","吆":"吆","吏":"吏","吝":"吝","吸":"吸","呂":"呂","呈":"呈","周":"周","咞":"咞","咢":"咢","咽":"咽","䎛":"㖈","哶":"哶","唐":"唐","啓":"啓","啟":"啓","啕":"啕","啣":"啣","善":"善","善":"善","喇":"喇","喙":"喙","喙":"喙","喝":"喝","喝":"喝","喫":"喫","喳":"喳","嗀":"嗀","嗂":"嗂","嗢":"嗢","嘆":"嘆","嘆":"嘆","噑":"噑","噴":"噴","器":"器","囹":"囹","圖":"圖","圗":"圗","⼟":"土","士":"土","⼠":"土","型":"型","城":"城","㦳":"㘽","埴":"埴","堍":"堍","報":"報","堲":"堲","塀":"塀","塚":"塚","塚":"塚","塞":"塞","填":"塡","壿":"墫","墬":"墬","墳":"墳","壘":"壘","壟":"壟","𡓤":"𡓤","壮":"壮","売":"売","壷":"壷","⼡":"夂","夆":"夆","⼢":"夊","タ":"夕","⼣":"夕","多":"多","夢":"夢","⼤":"大","奄":"奄","奈":"奈","契":"契","奔":"奔","奢":"奢","女":"女","⼥":"女","𡚨":"𡚨","𡛪":"𡛪","姘":"姘","姬":"姬","娛":"娛","娧":"娧","婢":"婢","婦":"婦","嬀":"媯","㛮":"㛮","㛼":"㛼","媵":"媵","嬈":"嬈","嬨":"嬨","嬾":"嬾","嬾":"嬾","⼦":"子","⼧":"宀","宅":"宅","𡧈":"𡧈","寃":"寃","寘":"寘","寧":"寧","寧":"寧","寧":"寧","寮":"寮","寳":"寳","𡬘":"𡬘","⼨":"寸","寿":"寿","将":"将","⼩":"小","尢":"尢","⺐":"尢","⼪":"尢","⺏":"尣","㞁":"㞁","⼫":"尸","尿":"尿","屠":"屠","屢":"屢","層":"層","履":"履","屮":"屮","屮":"屮","⼬":"屮","𡴋":"𡴋","⼭":"山","峀":"峀","岍":"岍","𡷤":"𡷤","𡷦":"𡷦","崙":"崙","嵃":"嵃","嵐":"嵐","嵫":"嵫","嵮":"嵮","嵼":"嵼","嶲":"嶲","嶺":"嶺","⼮":"巛","巢":"巢","エ":"工","⼯":"工","⼰":"己","⺒":"巳","㠯":"㠯","巽":"巽","⼱":"巾","帲":"帡","帨":"帨","帽":"帽","幩":"幩","㡢":"㡢","𢆃":"𢆃","⼲":"干","年":"年","𢆟":"𢆟","⺓":"幺","⼳":"幺","⼴":"广","度":"度","㡼":"㡼","庰":"庰","庳":"庳","庶":"庶","廊":"廊","廊":"廊","廉":"廉","廒":"廒","廓":"廓","廙":"廙","廬":"廬","⼵":"廴","廾":"廾","⼶":"廾","𢌱":"𢌱","𢌱":"𢌱","弄":"弄","⼷":"弋","⼸":"弓","弢":"弢","弢":"弢","⼹":"彐","⺔":"彑","当":"当","㣇":"㣇","⼺":"彡","形":"形","彩":"彩","彫":"彫","⼻":"彳","律":"律","㣣":"㣣","徚":"徚","復":"復","徭":"徭","⼼":"心","⺖":"忄","⺗":"㣺","忍":"忍","志":"志","念":"念","忹":"忹","怒":"怒","怜":"怜","恵":"恵","㤜":"㤜","㤺":"㤺","悁":"悁","悔":"悔","悔":"悔","惇":"惇","惘":"惘","惡":"惡","𢛔":"𢛔","愈":"愈","慨":"慨","慄":"慄","慈":"慈","慌":"慌","慌":"慌","慎":"慎","慎":"慎","慠":"慠","慺":"慺","憎":"憎","憎":"憎","憎":"憎","憐":"憐","憤":"憤","憯":"憯","憲":"憲","𢡄":"𢡄","𢡊":"𢡊","懞":"懞","懲":"懲","懲":"懲","懲":"懲","懶":"懶","懶":"懶","戀":"戀","⼽":"戈","成":"成","戛":"戛","戮":"戮","戴":"戴","⼾":"戶","戸":"戶","⼿":"手","⺘":"扌","扝":"扝","抱":"抱","拉":"拉","拏":"拏","拓":"拓","拔":"拔","拼":"拼","拾":"拾","𢬌":"𢬌","挽":"挽","捐":"捐","捨":"捨","捻":"捻","掃":"掃","掠":"掠","掩":"掩","揄":"揄","揤":"揤","摒":"摒","𢯱":"𢯱","搜":"搜","搢":"搢","揅":"揅","摩":"摩","摷":"摷","摾":"摾","㨮":"㨮","搉":"㩁","撚":"撚","撝":"撝","擄":"擄","㩬":"㩬","⽀":"支","⽁":"攴","⺙":"攵","敏":"敏","敏":"敏","敖":"敖","敬":"敬","數":"數","𣀊":"𣀊","⽂":"文","⻫":"斉","⽃":"斗","料":"料","⽄":"斤","⽅":"方","旅":"旅","⽆":"无","⺛":"旡","既":"既","旣":"旣","⽇":"日","易":"易","曶":"㫚","㫤":"㫤","晉":"晉","晩":"晚","晴":"晴","晴":"晴","暑":"暑","暑":"暑","暈":"暈","㬈":"㬈","暜":"暜","暴":"暴","曆":"曆","㬙":"㬙","𣊸":"𣊸","⽈":"曰","更":"更","書":"書","⽉":"月","𣍟":"𣍟","肦":"朌","胐":"朏","胊":"朐","脁":"朓","胶":"㬵","朗":"朗","朗":"朗","朗":"朗","脧":"朘","望":"望","望":"望","幐":"㬺","䐠":"㬻","𣎓":"𣎓","膧":"朣","𣎜":"𣎜","⽊":"木","李":"李","杓":"杓","杖":"杖","杞":"杞","𣏃":"𣏃","柿":"杮","杻":"杻","枅":"枅","林":"林","㭉":"㭉","𣏕":"𣏕","柳":"柳","柺":"柺","栗":"栗","栟":"栟","桒":"桒","𣑭":"𣑭","梁":"梁","梅":"梅","梅":"梅","梎":"梎","梨":"梨","椔":"椔","楂":"楂","㮝":"㮝","㮝":"㮝","槩":"㮣","樧":"榝","榣":"榣","槪":"槪","樂":"樂","樂":"樂","樂":"樂","樓":"樓","𣚣":"𣚣","檨":"檨","櫓":"櫓","櫛":"櫛","欄":"欄","㰘":"㰘","⽋":"欠","次":"次","𣢧":"𣢧","歔":"歔","㱎":"㱎","⽌":"止","⻭":"歯","歲":"歲","歷":"歷","歹":"歹","⽍":"歹","⺞":"歺","殟":"殟","殮":"殮","⽎":"殳","殺":"殺","殺":"殺","殺":"殺","殻":"殻","𣪍":"𣪍","⽏":"毋","⺟":"母","𣫺":"𣫺","⽐":"比","⽑":"毛","⽒":"氏","⺠":"民","⽓":"气","⽔":"水","⺡":"氵","⺢":"氺","汎":"汎","汧":"汧","沈":"沈","沿":"沿","泌":"泌","泍":"泍","泥":"泥","𣲼":"𣲼","洛":"洛","洞":"洞","洴":"洴","派":"派","流":"流","流":"流","流":"流","洖":"洖","浩":"浩","浪":"浪","海":"海","海":"海","浸":"浸","涅":"涅","𣴞":"𣴞","淋":"淋","淚":"淚","淪":"淪","淹":"淹","渚":"渚","港":"港","湮":"湮","潙":"溈","滋":"滋","滋":"滋","溜":"溜","溺":"溺","滇":"滇","滑":"滑","滛":"滛","㴳":"㴳","漏":"漏","漢":"漢","漢":"漢","漣":"漣","𣻑":"𣻑","潮":"潮","𣽞":"𣽞","𣾎":"𣾎","濆":"濆","濫":"濫","濾":"濾","瀛":"瀛","瀞":"瀞","瀞":"瀞","瀹":"瀹","灊":"灊","㶖":"㶖","⽕":"火","⺣":"灬","灰":"灰","灷":"灷","災":"災","炙":"炙","炭":"炭","烈":"烈","烙":"烙","煮":"煮","煮":"煮","𤉣":"𤉣","煅":"煅","煉":"煉","𤋮":"𤋮","熜":"熜","燎":"燎","燐":"燐","𤎫":"𤎫","爐":"爐","爛":"爛","爨":"爨","⽖":"爪","爫":"爫","⺤":"爫","爵":"爵","爵":"爵","⽗":"父","⽘":"爻","⺦":"丬","⽙":"爿","⽚":"片","牐":"牐","⽛":"牙","𤘈":"𤘈","⽜":"牛","牢":"牢","犀":"犀","犕":"犕","⽝":"犬","⺨":"犭","犯":"犯","狀":"狀","𤜵":"𤜵","狼":"狼","猪":"猪","猪":"猪","𤠔":"𤠔","獵":"獵","獺":"獺","⽞":"玄","率":"率","率":"率","⽟":"玉","王":"王","㺬":"㺬","玥":"玥","玲":"玲","㺸":"㺸","㺸":"㺸","珞":"珞","琉":"琉","理":"理","琢":"琢","瑇":"瑇","瑜":"瑜","瑩":"瑩","瑱":"瑱","瑱":"瑱","璅":"璅","璉":"璉","璘":"璘","瓊":"瓊","⽠":"瓜","⽡":"瓦","㼛":"㼛","甆":"甆","⽢":"甘","⽣":"生","甤":"甤","⽤":"用","⽥":"田","画":"画","甾":"甾","𤰶":"𤰶","留":"留","略":"略","異":"異","異":"異","𤲒":"𤲒","⽦":"疋","⽧":"疒","痢":"痢","瘐":"瘐","瘟":"瘟","瘝":"瘝","療":"療","癩":"癩","⽨":"癶","⽩":"白","𤾡":"𤾡","𤾸":"𤾸","⽪":"皮","⽫":"皿","𥁄":"𥁄","㿼":"㿼","益":"益","益":"益","盛":"盛","盧":"盧","䀈":"䀈","⽬":"目","直":"直","直":"直","𥃲":"𥃲","𥃳":"𥃳","省":"省","䀘":"䀘","𥄙":"𥄙","眞":"眞","真":"真","真":"真","𥄳":"𥄳","着":"着","睊":"睊","睊":"睊","鿃":"䀹","䀹":"䀹","䀹":"䀹","晣":"䀿","䁆":"䁆","瞋":"瞋","𥉉":"𥉉","瞧":"瞧","⽭":"矛","⽮":"矢","⽯":"石","䂖":"䂖","𥐝":"𥐝","硏":"研","硎":"硎","硫":"硫","碌":"碌","碌":"碌","碑":"碑","磊":"磊","磌":"磌","磌":"磌","磻":"磻","䃣":"䃣","礪":"礪","⽰":"示","⺭":"礻","礼":"礼","社":"社","祈":"祈","祉":"祉","𥘦":"𥘦","祐":"祐","祖":"祖","祖":"祖","祝":"祝","神":"神","祥":"祥","視":"視","視":"視","祿":"祿","𥚚":"𥚚","禍":"禍","禎":"禎","福":"福","福":"福","𥛅":"𥛅","禮":"禮","⽱":"禸","⽲":"禾","秊":"秊","䄯":"䄯","秫":"秫","稜":"稜","穊":"穊","穀":"穀","穀":"穀","穏":"穏","⽳":"穴","突":"突","𥥼":"𥥼","窱":"窱","立":"立","⽴":"立","⻯":"竜","𥪧":"𥪧","𥪧":"𥪧","竮":"竮","⽵":"竹","笠":"笠","節":"節","節":"節","䈂":"䈂","𥮫":"𥮫","篆":"篆","䈧":"䈧","築":"築","𥲀":"𥲀","𥳐":"𥳐","簾":"簾","籠":"籠","⽶":"米","类":"类","粒":"粒","精":"精","糒":"糒","糖":"糖","糨":"糨","䊠":"䊠","糣":"糣","糧":"糧","⽷":"糸","⺯":"糹","𥾆":"𥾆","紀":"紀","紐":"紐","索":"索","累":"累","絶":"絕","絣":"絣","絛":"絛","綠":"綠","綾":"綾","緇":"緇","練":"練","練":"練","練":"練","縂":"縂","䌁":"䌁","縉":"縉","縷":"縷","繁":"繁","繅":"繅","𦇚":"𦇚","䌴":"䌴","⽸":"缶","𦈨":"𦈨","缾":"缾","𦉇":"𦉇","⽹":"网","⺫":"罒","⺲":"罒","⺱":"罓","䍙":"䍙","署":"署","𦋙":"𦋙","罹":"罹","罺":"罺","羅":"羅","𦌾":"𦌾","⽺":"羊","羕":"羕","羚":"羚","羽":"羽","⽻":"羽","翺":"翺","老":"老","⽼":"老","⺹":"耂","者":"者","者":"者","者":"者","⽽":"而","𦓚":"𦓚","⽾":"耒","𦔣":"𦔣","⽿":"耳","聆":"聆","聠":"聠","𦖨":"𦖨","聯":"聯","聰":"聰","聾":"聾","⾀":"聿","⺺":"肀","⾁":"肉","肋":"肋","肭":"肭","育":"育","䏕":"䏕","䏙":"䏙","腁":"胼","脃":"脃","脾":"脾","䐋":"䐋","朡":"朡","𦞧":"𦞧","𦞵":"𦞵","朦":"䑃","臘":"臘","⾂":"臣","臨":"臨","⾃":"自","臭":"臭","⾄":"至","⾅":"臼","舁":"舁","舁":"舁","舄":"舄","⾆":"舌","舘":"舘","⾇":"舛","⾈":"舟","䑫":"䑫","⾉":"艮","良":"良","⾊":"色","⾋":"艸","艹":"艹","艹":"艹","⺾":"艹","⺿":"艹","⻀":"艹","芋":"芋","芑":"芑","芝":"芝","花":"花","芳":"芳","芽":"芽","若":"若","若":"若","苦":"苦","𦬼":"𦬼","茶":"茶","荒":"荒","荣":"荣","茝":"茝","茣":"茣","莽":"莽","荓":"荓","菉":"菉","菊":"菊","菌":"菌","菜":"菜","菧":"菧","華":"華","菱":"菱","著":"著","著":"著","𦰶":"𦰶","莭":"莭","落":"落","葉":"葉","蔿":"蒍","𦳕":"𦳕","𦵫":"𦵫","蓮":"蓮","蓱":"蓱","蓳":"蓳","蓼":"蓼","蔖":"蔖","䔫":"䔫","蕤":"蕤","𦼬":"𦼬","藍":"藍","䕝":"䕝","𦾱":"𦾱","䕡":"䕡","藺":"藺","蘆":"蘆","䕫":"䕫","蘒":"蘒","蘭":"蘭","𧃒":"𧃒","虁":"蘷","蘿":"蘿","⾌":"虍","⻁":"虎","虐":"虐","虜":"虜","虜":"虜","虧":"虧","虩":"虩","⾍":"虫","蚩":"蚩","蚈":"蚈","蛢":"蛢","蜎":"蜎","蜨":"蜨","蝫":"蝫","蟡":"蟡","蝹":"蝹","蝹":"蝹","螆":"螆","䗗":"䗗","𧏊":"𧏊","螺":"螺","蠁":"蠁","䗹":"䗹","蠟":"蠟","⾎":"血","行":"行","⾏":"行","衠":"衠","衣":"衣","⾐":"衣","⻂":"衤","裂":"裂","𧙧":"𧙧","裏":"裏","裗":"裗","裞":"裞","裡":"裡","裸":"裸","裺":"裺","䘵":"䘵","褐":"褐","襁":"襁","襤":"襤","⾑":"襾","⻄":"西","⻃":"覀","覆":"覆","見":"見","⾒":"見","𧢮":"𧢮","⻅":"见","⾓":"角","⾔":"言","𧥦":"𧥦","詽":"訮","訞":"䚶","䚾":"䚾","䛇":"䛇","誠":"誠","說":"說","說":"說","調":"調","請":"請","諒":"諒","論":"論","諭":"諭","諭":"諭","諸":"諸","諸":"諸","諾":"諾","諾":"諾","謁":"謁","謁":"謁","謹":"謹","謹":"謹","識":"識","讀":"讀","讏":"讆","變":"變","變":"變","⻈":"讠","⾕":"谷","⾖":"豆","豈":"豈","豕":"豕","⾗":"豕","豣":"豜","⾘":"豸","𧲨":"𧲨","⾙":"貝","貫":"貫","賁":"賁","賂":"賂","賈":"賈","賓":"賓","贈":"贈","贈":"贈","贛":"贛","⻉":"贝","⾚":"赤","⾛":"走","起":"起","趆":"赿","𧻓":"𧻓","𧼯":"𧼯","⾜":"足","跋":"跋","趼":"趼","跺":"跥","路":"路","跰":"跰","躛":"躗","⾝":"身","車":"車","⾞":"車","軔":"軔","輧":"軿","輦":"輦","輪":"輪","輸":"輸","輸":"輸","輻":"輻","轢":"轢","⻋":"车","⾟":"辛","辞":"辞","辰":"辰","⾠":"辰","⾡":"辵","辶":"辶","⻌":"辶","⻍":"辶","巡":"巡","連":"連","逸":"逸","逸":"逸","遲":"遲","遼":"遼","𨗒":"𨗒","𨗭":"𨗭","邏":"邏","⾢":"邑","邔":"邔","郎":"郎","郞":"郎","郞":"郎","郱":"郱","都":"都","𨜮":"𨜮","鄑":"鄑","鄛":"鄛","⾣":"酉","酪":"酪","醙":"醙","醴":"醴","⾤":"釆","里":"里","⾥":"里","量":"量","金":"金","⾦":"金","鈴":"鈴","鈸":"鈸","鉶":"鉶","鋗":"鋗","鋘":"鋘","鉼":"鉼","錄":"錄","鍊":"鍊","鎮":"鎭","鏹":"鏹","鐕":"鐕","𨯺":"𨯺","⻐":"钅","⻑":"長","⾧":"長","⻒":"镸","⻓":"长","⾨":"門","開":"開","䦕":"䦕","閭":"閭","閷":"閷","𨵷":"𨵷","⻔":"门","⾩":"阜","⻏":"阝","⻖":"阝","阮":"阮","陋":"陋","降":"降","陵":"陵","陸":"陸","陼":"陼","隆":"隆","隣":"隣","䧦":"䧦","⾪":"隶","隷":"隷","隸":"隷","隸":"隷","⾫":"隹","雃":"雃","離":"離","難":"難","難":"難","⾬":"雨","零":"零","雷":"雷","霣":"霣","𩅅":"𩅅","露":"露","靈":"靈","⾭":"靑","⻘":"青","靖":"靖","靖":"靖","𩇟":"𩇟","⾮":"非","⾯":"面","𩈚":"𩈚","⾰":"革","䩮":"䩮","䩶":"䩶","⾱":"韋","韛":"韛","韠":"韠","⻙":"韦","⾲":"韭","𩐊":"𩐊","⾳":"音","響":"響","響":"響","⾴":"頁","䪲":"䪲","頋":"頋","頋":"頋","頋":"頋","領":"領","頩":"頩","𩒖":"𩒖","頻":"頻","頻":"頻","類":"類","⻚":"页","⾵":"風","𩖶":"𩖶","⻛":"风","⾶":"飛","⻜":"飞","⻝":"食","⾷":"食","⻟":"飠","飢":"飢","飯":"飯","飼":"飼","䬳":"䬳","館":"館","餩":"餩","⻠":"饣","⾸":"首","⾹":"香","馧":"馧","⾺":"馬","駂":"駂","駱":"駱","駾":"駾","驪":"驪","⻢":"马","⾻":"骨","䯎":"䯎","⾼":"高","⾽":"髟","𩬰":"𩬰","鬒":"鬒","鬒":"鬒","⾾":"鬥","⾿":"鬯","⿀":"鬲","⿁":"鬼","⻤":"鬼","⿂":"魚","魯":"魯","鱀":"鱀","鱗":"鱗","⻥":"鱼","⿃":"鳥","鳽":"鳽","䳎":"䳎","鵧":"鵧","䳭":"䳭","𪃎":"𪃎","鶴":"鶴","𪄅":"𪄅","䳸":"䳸","鷺":"鷺","𪈎":"𪈎","鸞":"鸞","鹃":"鹂","⿄":"鹵","鹿":"鹿","⿅":"鹿","𪊑":"𪊑","麗":"麗","麟":"麟","⿆":"麥","⻨":"麦","麻":"麻","⿇":"麻","𪎒":"𪎒","⿈":"黃","⻩":"黄","⿉":"黍","黎":"黎","䵖":"䵖","⿊":"黑","黒":"黑","墨":"墨","黹":"黹","⿋":"黹","⿌":"黽","鼅":"鼅","黾":"黾","⿍":"鼎","鼏":"鼏","⿎":"鼓","鼖":"鼖","⿏":"鼠","鼻":"鼻","⿐":"鼻","齃":"齃","⿑":"齊","⻬":"齐","⿒":"齒","𪘀":"𪘀","⻮":"齿","龍":"龍","⿓":"龍","龎":"龎","⻰":"龙","龜":"龜","龜":"龜","龜":"龜","⿔":"龜","⻳":"龟","⿕":"龠"}')},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],o=t[1];return 3*(n+o)/4-o},t.toByteArray=function(e){var t,n,o=l(e),a=o[0],s=o[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),d=0,u=s>0?a-4:a;for(n=0;n>16&255,c[d++]=t>>8&255,c[d++]=255&t;2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[d++]=255&t);1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[d++]=t>>8&255,c[d++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],a=0,s=n-r;as?s:a+16383));1===r?(t=e[n-1],i.push(o[t>>2]+o[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(o[t>>10]+o[t>>4&63]+o[t<<2&63]+"="));return i.join("")};for(var o=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function d(e,t,n){for(var r,i,a=[],s=t;s>18&63]+o[i>>12&63]+o[i>>6&63]+o[63&i]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,o,r){var i,a,s=8*r-o-1,c=(1<>1,d=-7,u=n?r-1:0,h=n?-1:1,p=e[t+u];for(u+=h,i=p&(1<<-d)-1,p>>=-d,d+=s;d>0;i=256*i+e[t+u],u+=h,d-=8);for(a=i&(1<<-d)-1,i>>=-d,d+=o;d>0;a=256*a+e[t+u],u+=h,d-=8);if(0===i)i=1-l;else{if(i===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,o),i-=l}return(p?-1:1)*a*Math.pow(2,i-o)},t.write=function(e,t,n,o,r,i){var a,s,c,l=8*i-r-1,d=(1<>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=o?0:i-1,m=o?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+u>=1?h/c:h*Math.pow(2,1-u))*c>=2&&(a++,c/=2),a+u>=d?(s=0,a=d):a+u>=1?(s=(t*c-1)*Math.pow(2,r),a+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,r),a=0));r>=8;e[n+p]=255&s,p+=m,s/=256,r-=8);for(a=a<0;e[n+p]=255&a,p+=m,a/=256,l-=8);e[n+p-m]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetApi=void 0;var o=n(8),r=n(10),i=n(11),a=n(12),s=n(13),c=n(14),l=n(21),d=n(22),u=n(15);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(p(this,_),(e=h.call(this)).clientOrigin=n,y(b(e),"transport",void 0),y(b(e),"capabilitiesFinished",!1),y(b(e),"supportsMSC2974Renegotiate",!1),y(b(e),"requestedCapabilities",[]),y(b(e),"approvedCapabilities",void 0),y(b(e),"cachedClientVersions",void 0),!window.parent)throw new Error("No parent window. This widget doesn't appear to be embedded properly.");return e.transport=new a.PostmessageTransport(r.WidgetApiDirection.FromWidget,t,window.parent,window),e.transport.targetOrigin=n,e.transport.on("message",e.handleMessage.bind(b(e))),e}return t=_,(n=[{key:"hasCapability",value:function(e){return Array.isArray(this.approvedCapabilities)?this.approvedCapabilities.includes(e):this.requestedCapabilities.includes(e)}},{key:"requestCapability",value:function(e){if(this.capabilitiesFinished&&!this.supportsMSC2974Renegotiate)throw new Error("Capabilities have already been negotiated");this.requestedCapabilities.push(e)}},{key:"requestCapabilities",value:function(e){var t=this;e.forEach((function(e){return t.requestCapability(e)}))}},{key:"requestCapabilityToSendState",value:function(e,t){this.requestCapability(u.WidgetEventCapability.forStateEvent(u.EventDirection.Send,e,t).raw)}},{key:"requestCapabilityToReceiveState",value:function(e,t){this.requestCapability(u.WidgetEventCapability.forStateEvent(u.EventDirection.Receive,e,t).raw)}},{key:"requestCapabilityToSendEvent",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomEvent(u.EventDirection.Send,e).raw)}},{key:"requestCapabilityToReceiveEvent",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomEvent(u.EventDirection.Receive,e).raw)}},{key:"requestCapabilityToSendMessage",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomMessageEvent(u.EventDirection.Send,e).raw)}},{key:"requestCapabilityToReceiveMessage",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomMessageEvent(u.EventDirection.Receive,e).raw)}},{key:"requestOpenIDConnectToken",value:function(){var e=this;return new Promise((function(t,n){e.transport.sendComplete(s.WidgetApiFromWidgetAction.GetOpenIDCredentials,{}).then((function(o){var r=o.response;r.state===c.OpenIDRequestState.Allowed?t(r):r.state===c.OpenIDRequestState.Blocked?n(new Error("User declined to verify their identity")):r.state===c.OpenIDRequestState.PendingUserConfirmation?e.on("action:".concat(s.WidgetApiToWidgetAction.OpenIDCredentials),(function i(a){a.preventDefault();var l=a.detail;l.data.original_request_id===o.requestId&&(l.data.state===c.OpenIDRequestState.Allowed?(t(l.data),e.transport.reply(l,{})):l.data.state===c.OpenIDRequestState.Blocked?(n(new Error("User declined to verify their identity")),e.transport.reply(l,{})):(n(new Error("Invalid state on reply: "+r.state)),e.transport.reply(l,{error:{message:"Invalid state"}})),e.off("action:".concat(s.WidgetApiToWidgetAction.OpenIDCredentials),i))})):n(new Error("Invalid state: "+r.state))})).catch(n)}))}},{key:"updateRequestedCapabilities",value:function(){return this.transport.send(s.WidgetApiFromWidgetAction.MSC2974RenegotiateCapabilities,{capabilities:this.requestedCapabilities}).then()}},{key:"sendContentLoaded",value:function(){return this.transport.send(s.WidgetApiFromWidgetAction.ContentLoaded,{}).then()}},{key:"sendSticker",value:function(e){return this.transport.send(s.WidgetApiFromWidgetAction.SendSticker,e).then()}},{key:"setAlwaysOnScreen",value:function(e){return this.transport.send(s.WidgetApiFromWidgetAction.UpdateAlwaysOnScreen,{value:e}).then((function(e){return e.success}))}},{key:"openModalWidget",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:l.MatrixWidgetType.Custom;return this.transport.send(s.WidgetApiFromWidgetAction.OpenModalWidget,{type:r,url:e,name:t,buttons:n,data:o}).then()}},{key:"closeModalWidget",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.transport.send(s.WidgetApiFromWidgetAction.CloseModalWidget,e).then()}},{key:"sendRoomEvent",value:function(e,t){return this.transport.send(s.WidgetApiFromWidgetAction.SendEvent,{type:e,content:t})}},{key:"sendStateEvent",value:function(e,t,n){return this.transport.send(s.WidgetApiFromWidgetAction.SendEvent,{type:e,content:n,state_key:t})}},{key:"readRoomEvents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25,n=arguments.length>2?arguments[2]:void 0;return this.transport.send(s.WidgetApiFromWidgetAction.MSC2876ReadEvents,{type:e,msgtype:n,limit:t}).then((function(e){return e.events}))}},{key:"readStateEvents",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:25,n=arguments.length>2?arguments[2]:void 0;return this.transport.send(s.WidgetApiFromWidgetAction.MSC2876ReadEvents,{type:e,state_key:void 0===n||n,limit:t}).then((function(e){return e.events}))}},{key:"setModalButtonEnabled",value:function(e,t){if(e===d.BuiltInModalButtonID.Close)throw new Error("The close button cannot be disabled");return this.transport.send(s.WidgetApiFromWidgetAction.SetModalButtonEnabled,{button:e,enabled:t}).then()}},{key:"navigateTo",value:function(e){if(!e||!e.startsWith("https://matrix.to/#"))throw new Error("Invalid matrix.to URI");return this.transport.send(s.WidgetApiFromWidgetAction.MSC2931Navigate,{uri:e}).then()}},{key:"start",value:function(){var e=this;this.transport.start(),this.getClientVersions().then((function(t){t.includes(i.UnstableApiVersion.MSC2974)&&(e.supportsMSC2974Renegotiate=!0)}))}},{key:"handleMessage",value:function(e){var t=new CustomEvent("action:".concat(e.detail.action),{detail:e.detail,cancelable:!0});if(this.emit("action:".concat(e.detail.action),t),!t.defaultPrevented)switch(e.detail.action){case s.WidgetApiToWidgetAction.SupportedApiVersions:return this.replyVersions(e.detail);case s.WidgetApiToWidgetAction.Capabilities:return this.handleCapabilities(e.detail);case s.WidgetApiToWidgetAction.UpdateVisibility:case s.WidgetApiToWidgetAction.NotifyCapabilities:return this.transport.reply(e.detail,{});default:return this.transport.reply(e.detail,{error:{message:"Unknown or unsupported action: "+e.detail.action}})}}},{key:"replyVersions",value:function(e){this.transport.reply(e,{supported_versions:i.CurrentApiVersions})}},{key:"getClientVersions",value:function(){var e=this;return Array.isArray(this.cachedClientVersions)?Promise.resolve(this.cachedClientVersions):this.transport.send(s.WidgetApiFromWidgetAction.SupportedApiVersions,{}).then((function(t){return e.cachedClientVersions=t.supported_versions,t.supported_versions})).catch((function(e){return console.warn("non-fatal error getting supported client versions: ",e),[]}))}},{key:"handleCapabilities",value:function(e){var t=this;return this.capabilitiesFinished?this.transport.reply(e,{error:{message:"Capability negotiation already completed"}}):this.getClientVersions().then((function(n){return n.includes(i.UnstableApiVersion.MSC2871)?t.once("action:".concat(s.WidgetApiToWidgetAction.NotifyCapabilities),(function(e){t.approvedCapabilities=e.detail.data.approved,t.emit("ready")})):t.emit("ready"),t.capabilitiesFinished=!0,t.transport.reply(e,{capabilities:t.requestedCapabilities})}))}}])&&m(t.prototype,n),o&&m(t,o),_}(o.EventEmitter);t.WidgetApi=E},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientWidgetApi=void 0;var o=n(8),r=n(12),i=n(10),a=n(13),s=n(23),c=n(11),l=n(15),d=n(14),u=n(24);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function m(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;return this.allowedEvents.some((function(n){return n.matchesAsRoomEvent(e,t)&&n.direction===l.EventDirection.Send}))}},{key:"canSendStateEvent",value:function(e,t){return this.allowedEvents.some((function(n){return n.matchesAsStateEvent(e,t)&&n.direction===l.EventDirection.Send}))}},{key:"canReceiveRoomEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.allowedEvents.some((function(n){return n.matchesAsRoomEvent(e,t)&&n.direction===l.EventDirection.Receive}))}},{key:"canReceiveStateEvent",value:function(e,t){return this.allowedEvents.some((function(n){return n.matchesAsStateEvent(e,t)&&n.direction===l.EventDirection.Receive}))}},{key:"stop",value:function(){this.isStopped=!0,this.transport.stop()}},{key:"onIframeLoad",value:function(e){this.beginCapabilities(),this.iframe.removeEventListener("onload",this.onIframeLoad.bind(this))}},{key:"beginCapabilities",value:function(){var e,t=this;if(this.capabilitiesFinished)throw new Error("Capabilities exchange already completed");this.emit("preparing"),this.transport.send(a.WidgetApiToWidgetAction.Capabilities,{}).then((function(n){return e=n.capabilities,t.driver.validateCapabilities(new Set(n.capabilities))})).then((function(n){console.log("Widget ".concat(t.widget.id," is allowed capabilities:"),Array.from(n)),t.allowedCapabilities=n,t.allowedEvents=l.WidgetEventCapability.findEventCapabilities(n),t.capabilitiesFinished=!0,t.notifyCapabilities(e),t.emit("ready")}))}},{key:"notifyCapabilities",value:function(e){this.transport.send(a.WidgetApiToWidgetAction.NotifyCapabilities,{requested:e,approved:Array.from(this.allowedCapabilities)}).catch((function(e){console.warn("non-fatal error notifying widget of approved capabilities:",e)}))}},{key:"handleContentLoadedAction",value:function(e){this.widget.waitForIframeLoad?this.transport.reply(e,{error:{message:"Improper sequence: not expecting load event"}}):(this.transport.reply(e,{}),this.beginCapabilities())}},{key:"replyVersions",value:function(e){this.transport.reply(e,{supported_versions:c.CurrentApiVersions})}},{key:"handleCapabilitiesRenegotiate",value:function(e){var t,n=this;this.transport.reply(e,{});var o=(null===(t=e.data)||void 0===t?void 0:t.capabilities)||[],r=new Set(o.filter((function(e){return!n.hasCapability(e)})));if(0===r.size)return this.notifyCapabilities([]);this.driver.validateCapabilities(r).then((function(e){return e.forEach((function(e){return n.allowedCapabilities.add(e)})),l.WidgetEventCapability.findEventCapabilities(e).forEach((function(e){return n.allowedEvents.push(e)})),n.notifyCapabilities(Array.from(r))}))}},{key:"handleNavigate",value:function(e){var t,n,o=this;if(!this.hasCapability(s.MatrixCapabilities.MSC2931Navigate))return this.transport.reply(e,{error:{message:"Missing capability"}});if(!(null===(t=e.data)||void 0===t?void 0:t.uri)||!(null===(n=e.data)||void 0===n?void 0:n.uri.toString().startsWith("https://matrix.to/#")))return this.transport.reply(e,{error:{message:"Invalid matrix.to URI"}});var r=function(t){return console.error("[ClientWidgetApi] Failed to handle navigation: ",t),o.transport.reply(e,{error:{message:"Error handling navigation"}})};try{this.driver.navigate(e.data.uri.toString()).catch((function(e){return r(e)})).then((function(){return o.transport.reply(e,{})}))}catch(e){return r(e)}}},{key:"handleOIDC",value:function(e){var t=this,n=1,o=function(o,r){return r=r||{},n>1?t.transport.send(a.WidgetApiToWidgetAction.OpenIDCredentials,m({state:o,original_request_id:e.requestId},r)):t.transport.reply(e,m({state:o},r))},r=function(r){return console.error("[ClientWidgetApi] Failed to handle OIDC: ",r),n>1?o(d.OpenIDRequestState.Blocked):t.transport.reply(e,{error:{message:r}})},i=new u.SimpleObservable((function(e){return e.state===d.OpenIDRequestState.PendingUserConfirmation&&n>1?(i.close(),r("client provided out-of-phase response to OIDC flow")):e.state===d.OpenIDRequestState.PendingUserConfirmation?(o(e.state),void n++):e.state!==d.OpenIDRequestState.Allowed||e.token?(e.state===d.OpenIDRequestState.Blocked&&(e.token=null),i.close(),o(e.state,e.token)):r("client provided invalid OIDC token for an allowed request")}));this.driver.askOpenID(i)}},{key:"handleReadEvents",value:function(e){var t=this;if(!e.data.type)return this.transport.reply(e,{error:{message:"Invalid request - missing event type"}});if(void 0!==e.data.limit&&(!e.data.limit||e.data.limit<0))return this.transport.reply(e,{error:{message:"Invalid request - limit out of range"}});var n=e.data.limit||0,o=Promise.resolve([]);if(void 0!==e.data.state_key){var r=!0===e.data.state_key?void 0:e.data.state_key.toString();if(!this.canReceiveStateEvent(e.data.type,r))return this.transport.reply(e,{error:{message:"Cannot read state events of this type"}});o=this.driver.readStateEvents(e.data.type,r,n)}else{if(!this.canReceiveRoomEvent(e.data.type,e.data.msgtype))return this.transport.reply(e,{error:{message:"Cannot read room events of this type"}});o=this.driver.readRoomEvents(e.data.type,e.data.msgtype,n)}return o.then((function(n){return t.transport.reply(e,{events:n})}))}},{key:"handleSendEvent",value:function(e){var t,n=this;if(!e.data.type)return this.transport.reply(e,{error:{message:"Invalid request - missing event type"}});if(null!==e.data.state_key&&void 0!==e.data.state_key){if(!this.canSendStateEvent(e.data.type,e.data.state_key))return this.transport.reply(e,{error:{message:"Cannot send state events of this type"}});t=this.driver.sendEvent(e.data.type,e.data.content||{},e.data.state_key)}else{var o=e.data.content||{},r=o.msgtype;if(!this.canSendRoomEvent(e.data.type,r))return this.transport.reply(e,{error:{message:"Cannot send room events of this type"}});t=this.driver.sendEvent(e.data.type,o,null)}t.then((function(t){return n.transport.reply(e,{room_id:t.roomId,event_id:t.eventId})})).catch((function(t){return console.error("error sending event: ",t),n.transport.reply(e,{error:{message:"Error sending event"}})}))}},{key:"handleMessage",value:function(e){if(!this.isStopped){var t=new CustomEvent("action:".concat(e.detail.action),{detail:e.detail,cancelable:!0});if(this.emit("action:".concat(e.detail.action),t),!t.defaultPrevented)switch(e.detail.action){case a.WidgetApiFromWidgetAction.ContentLoaded:return this.handleContentLoadedAction(e.detail);case a.WidgetApiFromWidgetAction.SupportedApiVersions:return this.replyVersions(e.detail);case a.WidgetApiFromWidgetAction.SendEvent:return this.handleSendEvent(e.detail);case a.WidgetApiFromWidgetAction.GetOpenIDCredentials:return this.handleOIDC(e.detail);case a.WidgetApiFromWidgetAction.MSC2931Navigate:return this.handleNavigate(e.detail);case a.WidgetApiFromWidgetAction.MSC2974RenegotiateCapabilities:return this.handleCapabilitiesRenegotiate(e.detail);case a.WidgetApiFromWidgetAction.MSC2876ReadEvents:return this.handleReadEvents(e.detail);default:return this.transport.reply(e.detail,{error:{message:"Unknown or unsupported action: "+e.detail.action}})}}}},{key:"takeScreenshot",value:function(){return this.transport.send(a.WidgetApiToWidgetAction.TakeScreenshot,{})}},{key:"updateVisibility",value:function(e){return this.transport.send(a.WidgetApiToWidgetAction.UpdateVisibility,{visible:e})}},{key:"sendWidgetConfig",value:function(e){return this.transport.send(a.WidgetApiToWidgetAction.WidgetConfig,e).then()}},{key:"notifyModalWidgetButtonClicked",value:function(e){return this.transport.send(a.WidgetApiToWidgetAction.ButtonClicked,{id:e}).then()}},{key:"notifyModalWidgetClose",value:function(e){return this.transport.send(a.WidgetApiToWidgetAction.CloseModalWidget,e).then()}},{key:"feedEvent",value:function(e){if(void 0!==e.state_key&&null!==e.state_key){if(!this.canReceiveStateEvent(e.type,e.state_key))return Promise.resolve()}else if(!this.canReceiveRoomEvent(e.type,(e.content||{}).msgtype))return Promise.resolve();return this.transport.send(a.WidgetApiToWidgetAction.SendEvent,e).then()}}])&&g(t.prototype,n),o&&g(t,o),p}(o.EventEmitter);t.ClientWidgetApi=S},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorResponse=function(e){if("error"in e){return!!e.error.message}return!1}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetKind=void 0,t.WidgetKind=o,function(e){e.Room="room",e.Account="account",e.Modal="modal"}(o||(t.WidgetKind=o={}))},function(e,t,n){"use strict";var o;Object.defineProperty(t,"__esModule",{value:!0}),t.ModalButtonKind=void 0,t.ModalButtonKind=o,function(e){e.Primary="m.primary",e.Secondary="m.secondary",e.Warning="m.warning",e.Danger="m.danger",e.Link="m.link"}(o||(t.ModalButtonKind=o={}))},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetParser=void 0;var o=n(27),r=n(25);function i(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,c=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){c=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(c)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n(.*?)<\\/${t}>|<${t}>|<${t}\\s*\\/>)`]=n[t];o=b(o,e)}return o}(function(e,t){let n;t&&"object"==typeof t&&(n=t.count,Object.keys(t).forEach(e=>{void 0===t[e]&&(console.warn("safeCounterpartTranslate called with undefined interpolation name: "+e),t[e]="undefined"),null===t[e]&&(console.warn("safeCounterpartTranslate called with null interpolation name: "+e),t[e]="null")}));let o=a.a.translate(e,t);return void 0===o&&void 0!==n&&(o=a.a.translate(e,Object.assign({},t,{locale:"en"}))),o}(e,Object.assign({interpolate:!1},t)),t,n);return o}function b(e,t){const n=[e];let o=!1;for(const r in t){const i=new RegExp(r,"g");let a=!1;for(let e=0;e{o=t;for(let t=0;t{if(a.a.registerTranslations(n,e),a.a.setLocale(n),l.b.setValue("language",null,h.a.DEVICE,n),console.log("set language to "+n),"en"!==n)return O("i18n/"+o.en.fileName)}).then(e=>{e&&a.a.registerTranslations("en",e)})}function y(){return x().then(e=>{const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push({value:n,label:e[n].label});return t})}function E(){return navigator.languages&&navigator.languages.length?navigator.languages:navigator.language?[navigator.language]:[navigator.userLanguage||"en"]}function S(e){const t=[],n=w(e),o=n.split("-");return 2===o.length&&o[0]===o[1]?t.push(o[0]):(t.push(n),2===o.length&&t.push(o[0])),t}function w(e){return e.toLowerCase().replace("_","-")}function C(){return a.a.getLocale()}function T(e){const t=C(),n=e.map(w);{const o=n.indexOf(t);if(o>-1)return e[o]}{const o=n.findIndex(e=>e.substr(0,2)===t.substr(0,2));if(o>-1)return e[o]}{const t=n.findIndex(e=>e.startsWith("en"));if(t>-1)return e[t]}return e[0]}function x(){return new Promise((e,t)=>{let n;n="string"==typeof u.a?u.a:"i18n/languages.json",r()({method:"GET",url:n},(o,r,i)=>{o?t(o):r.status<200||r.status>=300?t(new Error(`Failed to load ${n}, got ${r.status}`)):e(JSON.parse(i))})})}async function O(e,t=3){return Object(p.b)(()=>function(e){return new Promise((t,n)=>{r()({method:"GET",url:e},(o,r,i)=>{o?n(o):r.status<200||r.status>=300?n(new Error(`Failed to load ${e}, got ${r.status}`)):t(function(e){const t={};for(const n of Object.keys(e)){const o=n.split("|",2);if(2===o.length){let r=t[o[0]];void 0===r&&(r={},t[o[0]]=r),r[o[1]]=e[n]}else t[n]=e[n]}return t}(JSON.parse(i)))})})}(e),t,t=>(console.log("Failed to load i18n",e),console.error(t),!0))}a.a.setSeparator("|"),a.a.setFallbackLocale("en")},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(90);function r(e,t){return()=>o.getComponent(e)||t}},function(e,t,n){"use strict";n.r(t),n.d(t,"loadSkin",(function(){return r})),n.d(t,"resetSkin",(function(){return i})),n.d(t,"getComponent",(function(){return a}));var o=n(798);n(1393);function r(e){o.a.load(e)}function i(){o.a.reset()}function a(e){return o.a.getComponent(e)}},function(e,t,n){e.exports=n(804)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return A}));var o=n(18),r=n.n(o),i=n(277),a=n(1),s=n(159),c=n(374),l=n(90),d=n(688),u=n(94),h=n(93);function p(e,t,n){return{action:"MatrixActions.sync",state:t,prevState:n,matrixClient:e}}function m(e,t){return{action:"MatrixActions.accountData",event:t,event_type:t.getType(),event_content:t.getContent()}}function g(e,t,n){return{action:"MatrixActions.Room.accountData",event:t,event_type:t.getType(),event_content:t.getContent(),room:n}}function f(e,t){return{action:"MatrixActions.Room",room:t}}function _(e,t,n){return{action:"MatrixActions.Room.tags",room:n}}function b(e,t,n){return{action:"MatrixActions.Room.receipt",event:t,room:n,matrixClient:e}}function v(e,t,n,o,r,i){return{action:"MatrixActions.Room.timeline",event:t,isLiveEvent:i.liveEvent,isLiveUnfilteredRoomTimelineEvent:n&&i.timeline.getTimelineSet()===n.getUnfilteredTimelineSet()}}function y(e,t,n,o){return{action:"MatrixActions.Room.myMembership",room:t,membership:n,oldMembership:o}}function E(e,t){return{action:"MatrixActions.Event.decrypted",event:t}}var S={_matrixClientListenersStop:[],start(e){this._addMatrixClientListener(e,"sync",p),this._addMatrixClientListener(e,"accountData",m),this._addMatrixClientListener(e,"Room.accountData",g),this._addMatrixClientListener(e,"Room",f),this._addMatrixClientListener(e,"Room.tags",_),this._addMatrixClientListener(e,"Room.receipt",b),this._addMatrixClientListener(e,"Room.timeline",v),this._addMatrixClientListener(e,"Room.myMembership",y),this._addMatrixClientListener(e,"Event.decrypted",E)},_addMatrixClientListener(e,t,n){const o=(...t)=>{const o=n(e,...t);o&&h.a.dispatch(o,!0)};e.on(t,o),this._matrixClientListenersStop.push(()=>{e.removeListener(t,o)})},stop(){this._matrixClientListenersStop.forEach(e=>e())}},w=n(95),C=n(347),T=n(368),x=n(364),O=n(206),k=n(172),R=n(298),I=n(226);class D{constructor(){r()(this,"opts",{initialSyncLimit:20}),r()(this,"matrixClient",null),r()(this,"justRegisteredUserId",void 0),r()(this,"currentClientCreds",void 0)}setIndexedDbWorkerScript(e){d.a.indexedDbWorkerScript=e}get(){return this.matrixClient}unset(){this.matrixClient=null,S.stop()}setJustRegisteredUserId(e){this.justRegisteredUserId=e,e&&window.localStorage.setItem("mx_registration_time",String((new Date).getTime()))}currentUserIsJustRegistered(){return this.matrixClient&&this.matrixClient.credentials.userId===this.justRegisteredUserId}userRegisteredWithinLastHours(e){try{const t=new Date(window.localStorage.getItem("mx_registration_time"));return((new Date).getTime()-t.getTime())/36e5<=e}catch(e){return!1}}replaceUsingCreds(e){this.currentClientCreds=e,this.createClient(e)}async assign(){for(const e of["indexeddb","memory"])try{const e=this.matrixClient.store.startup();console.log("MatrixClientPeg: waiting for MatrixClient store to initialise"),await e;break}catch(t){if("indexeddb"!==e)throw console.error("Failed to start memory store!",t),t;console.error("Error starting matrixclient store - falling back to memory store",t),this.matrixClient.store=new i.a({localStorage:localStorage})}x.f(this.matrixClient);try{!u.b.getValue("lowBandwidth")&&this.matrixClient.initCrypto&&(await this.matrixClient.initCrypto(),this.matrixClient.setCryptoTrustCrossSignedDevices(!u.b.getValue("e2ee.manuallyVerifyAllSessions")),await Object(k.f)(this.matrixClient),x.e(!0))}catch(e){if(e&&"InvalidCryptoStoreError"===e.name){const e=l.getComponent("views.dialogs.CryptoStoreTooNewDialog");w.a.createDialog(e)}console.warn("Unable to initialise e2e",e)}const e=a.d(this.opts);return e.pendingEventOrdering="detached",e.lazyLoadMembers=!0,e.clientWellKnownPollPeriod=7200,S.start(this.matrixClient),T.a.matrixClient=this.matrixClient,e}async start(){const e=await this.assign();console.log("MatrixClientPeg: really starting MatrixClient"),await this.get().startClient(e),console.log("MatrixClientPeg: MatrixClient started")}getCredentials(){return{homeserverUrl:this.matrixClient.baseUrl,identityServerUrl:this.matrixClient.idBaseUrl,userId:this.matrixClient.credentials.userId,deviceId:this.matrixClient.getDeviceId(),accessToken:this.matrixClient.getAccessToken(),guest:this.matrixClient.isGuest()}}getHomeserverName(){const e=/^@[^:]+:(.+)$/.exec(this.matrixClient.credentials.userId);if(null===e||e.length<1)throw new Error("Failed to derive homeserver name from user ID!");return e[1]}createClient(e){const t={baseUrl:e.homeserverUrl,idBaseUrl:e.identityServerUrl,accessToken:e.accessToken,userId:e.userId,deviceId:e.deviceId,pickleKey:e.pickleKey,timelineSupport:!0,forceTURN:!u.b.getValue("webRtcAllowPeerToPeer"),fallbackICEServerAllowed:!!u.b.getValue("fallbackICEServerAllowed"),iceCandidatePoolSize:20,verificationMethods:[C.d.SAS,R.d,C.d.RECIPROCATE_QR_CODE],unstableClientRelationAggregation:!0,identityServer:new O.a,cryptoCallbacks:{}};Object.assign(t.cryptoCallbacks,k.c),I.a.getDehydrationKey&&(t.cryptoCallbacks.getDehydrationKey=I.a.getDehydrationKey),this.matrixClient=Object(d.a)(t),this.matrixClient.setMaxListeners(500),this.matrixClient.setGuest(Boolean(e.guest));const n=new c.a(null,{timelineSupport:!0});n.getLiveTimeline().setPaginationToken("",s.a.BACKWARDS),this.matrixClient.setNotifTimelineSet(n)}}window.mxMatrixClientPeg||(window.mxMatrixClientPeg=new D);const A=window.mxMatrixClientPeg},function(e,t,n){"use strict";(function(e){var o=n(802),r=n(379);class i extends o.Dispatcher{dispatch(e,t=!1){e instanceof r.a?e.fn(e=>{this.dispatch(e,t)}):t?super.dispatch(e):setTimeout(super.dispatch.bind(this,e),0)}fire(e,t=!1){this.dispatch({action:e},t)}}const a=new i,s=e;s.mxDispatcher||(s.mxDispatcher=a),t.a=a}).call(this,n(7))},function(e,t,n){"use strict";n.d(t,"a",(function(){return D})),n.d(t,"b",(function(){return A}));var o=n(18),r=n.n(o),i=n(237),a=n(92),s=n(102),c=n(169);class l extends i.a{constructor(e,t){super(),this.featureNames=e,this.watchers=t}getValue(e,t){if(this.featureNames.includes(e))return this.readFeature(e);if("notificationsEnabled"===e){const e=localStorage.getItem("notifications_enabled");return"string"==typeof e?"true"===e:null}if("notificationBodyEnabled"===e){const e=localStorage.getItem("notifications_body_enabled");return"string"==typeof e?"true"===e:null}if("audioNotificationsEnabled"===e){const e=localStorage.getItem("audio_notifications_enabled");return"string"==typeof e?"true"===e:null}if(["showRightPanelInRoom","showRightPanelInGroup","lastRightPanelPhaseForRoom","lastRightPanelPhaseForGroup"].includes(e)){return JSON.parse(localStorage.getItem("mx_"+e)||"{}").value}if("layout"===e){const t=this.getSettings()||{};return t.useIRCLayout?c.a.IRC:t[e]}return(this.getSettings()||{})[e]}setValue(e,t,n){if(this.featureNames.includes(e))return this.writeFeature(e,n),Promise.resolve();if("notificationsEnabled"===e)return localStorage.setItem("notifications_enabled",n),this.watchers.notifyUpdate(e,null,s.a.DEVICE,n),Promise.resolve();if("notificationBodyEnabled"===e)return localStorage.setItem("notifications_body_enabled",n),this.watchers.notifyUpdate(e,null,s.a.DEVICE,n),Promise.resolve();if("audioNotificationsEnabled"===e)return localStorage.setItem("audio_notifications_enabled",n),this.watchers.notifyUpdate(e,null,s.a.DEVICE,n),Promise.resolve();if(["showRightPanelInRoom","showRightPanelInGroup","lastRightPanelPhaseForRoom","lastRightPanelPhaseForGroup"].includes(e))return localStorage.setItem("mx_"+e,JSON.stringify({value:n})),this.watchers.notifyUpdate(e,null,s.a.DEVICE,n),Promise.resolve();if("layout"===e){const t=this.getSettings()||{};return delete t.useIRCLayout,t.layout=n,localStorage.setItem("mx_local_settings",JSON.stringify(t)),this.watchers.notifyUpdate(e,null,s.a.DEVICE,n),Promise.resolve()}const o=this.getSettings()||{};return o[e]=n,localStorage.setItem("mx_local_settings",JSON.stringify(o)),this.watchers.notifyUpdate(e,null,s.a.DEVICE,n),Promise.resolve()}canSetValue(e,t){return!0}isSupported(){return void 0!==localStorage&&null!==localStorage}watchSetting(e,t,n){this.watchers.watchSetting(e,t,n)}unwatchSetting(e){this.watchers.unwatchSetting(e)}getSettings(){const e=localStorage.getItem("mx_local_settings");return e?JSON.parse(e):null}readFeature(e){if(a.a.get()&&a.a.get().isGuest())return!1;const t=localStorage.getItem("mx_labs_feature_"+e);return"true"===t||"false"!==t&&null}writeFeature(e,t){localStorage.setItem("mx_labs_feature_"+e,""+t),this.watchers.notifyUpdate(e,null,s.a.DEVICE,t)}}class d extends i.a{constructor(e){super(),this.watchers=e}getValue(e,t){if("blacklistUnverifiedDevices"===e){const e=this.read("mx_local_settings");if(e&&e.blacklistUnverifiedDevicesPerRoom)return e.blacklistUnverifiedDevicesPerRoom[t]}const n=this.read(this.getKey(e,t));return n?n.value:null}setValue(e,t,n){if("blacklistUnverifiedDevices"===e){let o=this.read("mx_local_settings");return o||(o={}),o.blacklistUnverifiedDevicesPerRoom||(o.blacklistUnverifiedDevicesPerRoom={}),o.blacklistUnverifiedDevicesPerRoom[t]=n,localStorage.setItem("mx_local_settings",JSON.stringify(o)),this.watchers.notifyUpdate(e,t,s.a.ROOM_DEVICE,n),Promise.resolve()}return null===n?localStorage.removeItem(this.getKey(e,t)):(n=JSON.stringify({value:n}),localStorage.setItem(this.getKey(e,t),n)),this.watchers.notifyUpdate(e,t,s.a.ROOM_DEVICE,n),Promise.resolve()}canSetValue(e,t){return!0}isSupported(){return void 0!==localStorage&&null!==localStorage}read(e){const t=localStorage.getItem(e);return t?JSON.parse(t):null}getKey(e,t){return"mx_setting_"+e+"_"+t}}class u extends i.a{constructor(e,t){super(),this.defaults=e,this.invertedDefaults=t}getValue(e,t){let n=this.defaults[e];return void 0===n&&(n=this.invertedDefaults[e]),n}async setValue(e,t,n){throw new Error("Cannot set values on the default level handler")}canSetValue(e,t){return!1}isSupported(){return!0}}var h=n(368),p=n(135);class m extends h.a{constructor(e){super(),this.watchers=e,r()(this,"onAccountData",(e,t,n)=>{const o=t.roomId;if("org.matrix.room.preview_urls"===e.getType()){let t=e.getContent().disable;t="boolean"!=typeof t?null:!t,this.watchers.notifyUpdate("urlPreviewsEnabled",o,s.a.ROOM_ACCOUNT,t)}else if("org.matrix.room.color_scheme"===e.getType())this.watchers.notifyUpdate("roomColor",o,s.a.ROOM_ACCOUNT,e.getContent());else if("im.vector.web.settings"===e.getType()){const t=n?n.getContent():{},r=Object(p.d)(t,e.getContent());for(const t of r){const n=e.getContent()[t];this.watchers.notifyUpdate(t,o,s.a.ROOM_ACCOUNT,n)}}else"im.vector.setting.allowed_widgets"===e.getType()&&this.watchers.notifyUpdate("allowedWidgets",o,s.a.ROOM_ACCOUNT,e.getContent())})}initMatrixClient(e,t){e&&e.removeListener("Room.accountData",this.onAccountData),t.on("Room.accountData",this.onAccountData)}getValue(e,t){if("urlPreviewsEnabled"===e){const e=this.getSettings(t,"org.matrix.room.preview_urls")||{};return"boolean"!=typeof e.disable?null:!e.disable}if("roomColor"===e)return this.getSettings(t,"org.matrix.room.color_scheme");if("allowedWidgets"===e)return this.getSettings(t,"im.vector.setting.allowed_widgets");return(this.getSettings(t)||{})[e]}setValue(e,t,n){if("urlPreviewsEnabled"===e){const e=this.getSettings(t,"org.matrix.room.preview_urls")||{};return e.disable=!n,a.a.get().setRoomAccountData(t,"org.matrix.room.preview_urls",e)}if("roomColor"===e)return a.a.get().setRoomAccountData(t,"org.matrix.room.color_scheme",n);if("allowedWidgets"===e)return a.a.get().setRoomAccountData(t,"im.vector.setting.allowed_widgets",n);const o=this.getSettings(t)||{};return o[e]=n,a.a.get().setRoomAccountData(t,"im.vector.web.settings",o)}canSetValue(e,t){const n=a.a.get().getRoom(t);return null!=n}isSupported(){const e=a.a.get();return null!=e&&!e.isGuest()}getSettings(e,t="im.vector.web.settings"){const n=a.a.get().getRoom(e);if(!n)return null;const o=n.getAccountData(t);return o&&o.getContent()?Object(p.a)(o.getContent()):null}}const g=["im.vector.riot.breadcrumb_rooms","im.vector.setting.breadcrumbs"];class f extends h.a{constructor(e){super(),this.watchers=e,r()(this,"onAccountData",(e,t)=>{if("org.matrix.preview_urls"===e.getType()){let t=e.getContent().disable;t="boolean"!=typeof t?null:!t,this.watchers.notifyUpdate("urlPreviewsEnabled",null,s.a.ACCOUNT,t)}else if("im.vector.web.settings"===e.getType()){const n=t?t.getContent():{},o=Object(p.d)(n,e.getContent());for(const t of o){const n=e.getContent()[t];this.watchers.notifyUpdate(t,null,s.a.ACCOUNT,n)}}else if(g.includes(e.getType()))this.notifyBreadcrumbsUpdate(e);else if("im.vector.setting.integration_provisioning"===e.getType()){const t=e.getContent().enabled;this.watchers.notifyUpdate("integrationProvisioning",null,s.a.ACCOUNT,t)}else if("io.element.recent_emoji"===e.getType()){const t=e.getContent().enabled;this.watchers.notifyUpdate("recent_emoji",null,s.a.ACCOUNT,t)}})}initMatrixClient(e,t){e&&e.removeListener("accountData",this.onAccountData),t.on("accountData",this.onAccountData)}getValue(e,t){if("urlPreviewsEnabled"===e){const e=this.getSettings("org.matrix.preview_urls")||{};return"boolean"!=typeof e.disable?null:!e.disable}if("breadcrumb_rooms"===e){let e=this.getSettings("im.vector.setting.breadcrumbs");return e&&e.recent_rooms||(e=this.getSettings("im.vector.riot.breadcrumb_rooms"),e&&(e.recent_rooms=e.rooms)),e&&e.recent_rooms?e.recent_rooms:[]}if("recent_emoji"===e){const e=this.getSettings("io.element.recent_emoji");return e?e.recent_emoji:null}if("integrationProvisioning"===e){const e=this.getSettings("im.vector.setting.integration_provisioning");return e?e.enabled:null}const n=this.getSettings()||{};let o=n[e];return null==o&&("hideAvatarChanges"!==e&&"hideDisplaynameChanges"!==e||(o=n.hideAvatarDisplaynameChanges)),o}setValue(e,t,n){if("urlPreviewsEnabled"===e){const e=this.getSettings("org.matrix.preview_urls")||{};return e.disable=!n,a.a.get().setAccountData("org.matrix.preview_urls",e)}if("breadcrumb_rooms"===e){let e=this.getSettings("im.vector.setting.breadcrumbs");return e&&e.recent_rooms||(e=this.getSettings("im.vector.riot.breadcrumb_rooms")),e||(e={}),e.recent_rooms=n,a.a.get().setAccountData("im.vector.setting.breadcrumbs",e)}if("recent_emoji"===e){const e=this.getSettings("io.element.recent_emoji")||{};return e.recent_emoji=n,a.a.get().setAccountData("io.element.recent_emoji",e)}if("integrationProvisioning"===e){const e=this.getSettings("im.vector.setting.integration_provisioning")||{};return e.enabled=n,a.a.get().setAccountData("im.vector.setting.integration_provisioning",e)}const o=this.getSettings()||{};return o[e]=n,a.a.get().setAccountData("im.vector.web.settings",o)}canSetValue(e,t){return!0}isSupported(){const e=a.a.get();return null!=e&&!e.isGuest()}getSettings(e="im.vector.web.settings"){const t=a.a.get();if(!t)return null;const n=t.getAccountData(e);return n&&n.getContent()?Object(p.a)(n.getContent()):null}notifyBreadcrumbsUpdate(e){let t=[];if("im.vector.riot.breadcrumb_rooms"===e.getType()){const n=this.getSettings("im.vector.setting.breadcrumbs");t=n?n.recent_rooms:e.getContent().rooms}else{if("im.vector.setting.breadcrumbs"!==e.getType())return;t=e.getContent().recent_rooms}this.watchers.notifyUpdate("breadcrumb_rooms",null,s.a.ACCOUNT,t||[])}}class _ extends h.a{constructor(e){super(),this.watchers=e,r()(this,"onEvent",(e,t,n)=>{const o=e.getRoomId(),r=this.client.getRoom(o);if(r&&(!r||t===r.currentState))if("org.matrix.room.preview_urls"===e.getType()){let t=e.getContent().disable;t="boolean"!=typeof t?null:!t,this.watchers.notifyUpdate("urlPreviewsEnabled",o,s.a.ROOM,t)}else if("im.vector.web.settings"===e.getType()){const t=n?n.getContent():{},r=Object(p.d)(t,e.getContent());for(const t of r)this.watchers.notifyUpdate(t,o,s.a.ROOM,e.getContent()[t])}})}initMatrixClient(e,t){e&&e.removeListener("RoomState.events",this.onEvent),t.on("RoomState.events",this.onEvent)}getValue(e,t){if("urlPreviewsEnabled"===e){const e=this.getSettings(t,"org.matrix.room.preview_urls")||{};return"boolean"!=typeof e.disable?null:!e.disable}return(this.getSettings(t)||{})[e]}setValue(e,t,n){if("urlPreviewsEnabled"===e){const e=this.getSettings(t,"org.matrix.room.preview_urls")||{};return e.disable=!n,a.a.get().sendStateEvent(t,"org.matrix.room.preview_urls",e)}const o=this.getSettings(t)||{};return o[e]=n,a.a.get().sendStateEvent(t,"im.vector.web.settings",o,"")}canSetValue(e,t){const n=a.a.get(),o=n.getRoom(t);let r="im.vector.web.settings";return"urlPreviewsEnabled"===e&&(r="org.matrix.room.preview_urls"),!!o&&o.currentState.maySendStateEvent(r,n.getUserId())}isSupported(){const e=a.a.get();return null!=e}getSettings(e,t="im.vector.web.settings"){const n=a.a.get().getRoom(e);if(!n)return null;const o=n.currentState.getStateEvents(t,"");return o&&o.getContent()?Object(p.a)(o.getContent()):null}}var b=n(98),v=n(1);class y extends i.a{constructor(e){super(),this.featureNames=e}getValue(e,t){const n=b.a.get()||{};if(this.featureNames.includes(e)){const t=(n.features||{})[e];return Object(v.o)(t)?null:!0===t||!1===t?t:"enable"===t||"disable"!==t&&null}if("theme"===e)return n.default_theme;const o=n.settingDefaults;return!o||Object(v.o)(o[e])?null:o[e]}async setValue(e,t,n){throw new Error("Cannot change settings at the config level")}canSetValue(e,t){return!1}isSupported(){return!0}}var E=n(88),S=n(93),w=n(772);class C extends i.a{constructor(e){super(),this.handler=e,r()(this,"cache",{})}getValue(e,t){const n=t||"UNDEFINED",o=this.cache[e];return o&&o.hasOwnProperty(n)?o[n]:this.handler.getValue(e,t)}setValue(e,t,n){this.cache[e]||(this.cache[e]={});const o=this.cache[e],r=t||"UNDEFINED";o[r]=n;const i=this.handler.setValue(e,t,n);return Promise.resolve(i).finally(()=>{delete o[r]})}canSetValue(e,t){return this.handler.canSetValue(e,t)}isSupported(){return this.handler.isSupported()}}const T=Symbol("irrelevant-room");const x=new class{constructor(){r()(this,"watchers",new Map)}watchSetting(e,t,n){this.watchers.has(e)||this.watchers.set(e,new Map),this.watchers.get(e).has(t)||this.watchers.get(e).set(t,[]),this.watchers.get(e).get(t).push(n)}unwatchSetting(e){this.watchers.forEach(t=>{t.forEach(t=>{let n;for(;-1!==(n=t.indexOf(e));)t.splice(n,1)})})}notifyUpdate(e,t,n,o){if(!this.watchers.has(e))return;const r=this.watchers.get(e),i=[];if(null!==t&&r.has(t)&&i.push(...r.get(t)),t)r.has(T)&&i.push(...r.get(T));else{const e=Array.from(r.values()).flat(1);e.push(...e)}for(const e of i)e(t,n,o)}},O={},k={},R=[];for(const e of Object.keys(w.a))O[e]=w.a[e].default,w.a[e].isFeature&&R.push(e),w.a[e].invertedSettingName&&(k[w.a[e].invertedSettingName]=!w.a[e].default);const I={[s.a.DEVICE]:new l(R,x),[s.a.ROOM_DEVICE]:new d(x),[s.a.ROOM_ACCOUNT]:new m(x),[s.a.ACCOUNT]:new f(x),[s.a.ROOM]:new _(x),[s.a.CONFIG]:new y(R),[s.a.DEFAULT]:new u(O,k)};for(const e of Object.keys(I))I[e]=new C(I[e]);const D=[s.a.DEVICE,s.a.ROOM_DEVICE,s.a.ROOM_ACCOUNT,s.a.ACCOUNT,s.a.ROOM,s.a.CONFIG,s.a.DEFAULT];class A{static getFeatureSettingNames(){return Object.keys(w.a).filter(e=>A.isFeature(e))}static watchSetting(e,t,n){const o=w.a[e],r=e;if(!o)throw new Error(e+" is not a setting");o.invertedSettingName&&(e=o.invertedSettingName);const i=`${(new Date).getTime()}_${A.watcherCount++}_${e}_${t}`,a=(e,t,o)=>{const i=A.getValue(r);n(r,e,t,o,i)};return A.watchers.set(i,a),x.watchSetting(e,t,a),i}static unwatchSetting(e){A.watchers.has(e)?(x.unwatchSetting(A.watchers.get(e)),A.watchers.delete(e)):console.warn("Ending non-existent watcher ID "+e)}static monitorSetting(e,t){t=t||null,this.monitors.has(e)||this.monitors.set(e,new Map);const n=()=>{this.monitors.get(e).set(t,A.watchSetting(e,t,(e,t,n,o,r)=>{S.a.dispatch({action:"setting_updated",settingName:e,roomId:t,level:n,newValueAtLevel:o,newValue:r})}))},o=Array.from(this.monitors.get(e).keys());o.find(e=>e===t||null===e)?null===t&&(o.forEach(t=>{A.unwatchSetting(this.monitors.get(e).get(t))}),this.monitors.get(e).clear(),n()):n()}static getDisplayName(e,t=s.a.DEFAULT){if(!w.a[e]||!w.a[e].displayName)return null;let n=w.a[e].displayName;return n instanceof Object&&(n=n[t]?n[t]:n.default),Object(E.a)(n)}static isFeature(e){return!!w.a[e]&&w.a[e].isFeature}static getBetaInfo(e){var t;if(A.isFeature(e)&&!1!==A.getValueAt(s.a.CONFIG,e,null,!0,!0))return null===(t=w.a[e])||void 0===t?void 0:t.betaInfo}static isEnabled(e){return!!w.a[e]&&(!w.a[e].controller||!w.a[e].controller.settingDisabled)}static getValue(e,t=null,n=!1){if(!w.a[e])throw new Error("Setting '"+e+"' does not appear to be a setting.");const o=w.a[e],r=o.supportedLevelsAreOrdered?o.supportedLevels:D;return A.getValueAt(r[0],e,t,!1,n)}static getValueAt(e,t,n=null,o=!1,r=!1){const i=w.a[t];if(!i)throw new Error("Setting '"+t+"' does not appear to be a setting.");const a=i.supportedLevelsAreOrdered?i.supportedLevels:D;a.includes(s.a.DEFAULT)||a.push(s.a.DEFAULT);const c=a.indexOf(e);if(-1===c)throw new Error("Level "+e+" is not prioritized");const l=A.getHandlers(t);if(i.invertedSettingName&&(t=i.invertedSettingName),o){const o=l[e];if(!o)return A.getFinalValue(i,e,n,null,null);const r=o.getValue(t,n);return A.getFinalValue(i,e,n,r,e)}for(let o=c;o")),console.log("--- default level order: "+JSON.stringify(D)),console.log("--- registered handlers: "+JSON.stringify(Object.keys(I)));const o=e=>{for(const n of Object.keys(I)){const o=I[n];try{const r=o.getValue(e,t);console.log(`--- ${n}@${t||""} = ${JSON.stringify(r)}`)}catch(e){console.log(`--- ${o}@${t||""} THREW ERROR: ${e.message}`),console.error(e)}if(t)try{const t=o.getValue(e,null);console.log(`--- ${n}@ = ${JSON.stringify(t)}`)}catch(e){console.log(`--- ${o}@ THREW ERROR: ${e.message}`),console.error(e)}}console.log("--- calculating as returned by SettingsStore"),console.log("--- these might not match if the setting uses a controller - be warned!");try{const n=A.getValue(e,t);console.log(`--- SettingsStore#generic@${t||""} = ${JSON.stringify(n)}`)}catch(e){console.log(`--- SettingsStore#generic@${t||""} THREW ERROR: ${e.message}`),console.error(e)}if(t)try{const t=A.getValue(e,null);console.log("--- SettingsStore#generic@ = "+JSON.stringify(t))}catch(e){console.log("--- SettingsStore#generic@$ THREW ERROR: "+e.message),console.error(e)}for(const n of D){try{const o=A.getValueAt(n,e,t);console.log(`--- SettingsStore#${n}@${t||""} = ${JSON.stringify(o)}`)}catch(e){console.log(`--- SettingsStore#${n}@${t||""} THREW ERROR: ${e.message}`),console.error(e)}if(t)try{const t=A.getValueAt(n,e,null);console.log(`--- SettingsStore#${n}@ = ${JSON.stringify(t)}`)}catch(e){console.log(`--- SettingsStore#${n}@$ THREW ERROR: ${e.message}`),console.error(e)}}};o(e),n.invertedSettingName&&(console.log("--- TESTING INVERTED SETTING NAME"),console.log("--- inverted: "+n.invertedSettingName),o(n.invertedSettingName)),console.log("--- END DEBUG")}static getHandler(e,t){const n=A.getHandlers(e);return n[t]?n[t]:null}static getHandlers(e){if(!w.a[e])return{};const t={};for(const n of w.a[e].supportedLevels){if(!I[n])throw new Error("Unexpected level "+n);A.isLevelSupported(n)&&(t[n]=I[n])}return t.default||(t.default=I.default),t}}r()(A,"watchers",new Map),r()(A,"monitors",new Map),r()(A,"watcherCount",1),window.mxSettingsStore=A},function(e,t,n){"use strict";var o=n(99),r=n.n(o),i=n(18),a=n.n(i),s=n(87),c=n.n(s),l=n(152),d=n.n(l),u=n(97),h=n.n(u),p=n(126),m=n(93),g=n(140),f=n(90),_=n(91),b=n.n(_),v=n(88);class y extends c.a.Component{constructor(...e){super(...e),a()(this,"state",{component:null,error:null}),a()(this,"_onWrapperCancelClick",()=>{this.props.onFinished(!1)})}componentDidMount(){this._unmounted=!1,console.log("Starting load of AsyncWrapper for modal"),this.props.prom.then(e=>{if(this._unmounted)return;const t=e.default?e.default:e;this.setState({component:t})}).catch(e=>{console.warn("AsyncWrapper promise failed",e),this.setState({error:e})})}componentWillUnmount(){this._unmounted=!0}render(){if(this.state.component){const e=this.state.component;return c.a.createElement(e,this.props)}if(this.state.error){const e=f.getComponent("views.dialogs.BaseDialog"),t=f.getComponent("views.elements.DialogButtons");return c.a.createElement(e,{onFinished:this.props.onFinished,title:Object(v.a)("Error")},Object(v.a)("Unable to load! Check your network connectivity and try again."),c.a.createElement(t,{primaryButton:Object(v.a)("Dismiss"),onPrimaryButtonClick:this._onWrapperCancelClick,hasCancel:!1}))}{const e=f.getComponent("elements.Spinner");return c.a.createElement(e,null)}}}a()(y,"propTypes",{prom:b.a.object.isRequired});class E{constructor(){a()(this,"counter",0),a()(this,"priorityModal",null),a()(this,"staticModal",null),a()(this,"modals",[]),a()(this,"onBackgroundClick",()=>{const e=this.getCurrentModal();e&&(e.closeReason="backgroundClick",e.close(),e.closeReason=null)})}static getOrCreateContainer(){let e=document.getElementById("mx_Dialog_Container");return e||(e=document.createElement("div"),e.id="mx_Dialog_Container",document.body.appendChild(e)),e}static getOrCreateStaticContainer(){let e=document.getElementById("mx_Dialog_StaticContainer");return e||(e=document.createElement("div"),e.id="mx_Dialog_StaticContainer",document.body.appendChild(e)),e}toggleCurrentDialogVisibility(){const e=this.getCurrentModal();e&&(e.hidden=!e.hidden)}hasDialogs(){return this.priorityModal||this.staticModal||this.modals.length>0}createTrackedDialog(e,t,...n){return p.a.trackEvent("Modal",e,t),this.createDialog(...n)}appendTrackedDialog(e,t,...n){return p.a.trackEvent("Modal",e,t),this.appendDialog(...n)}createDialog(e,...t){return this.createDialogAsync(Promise.resolve(e),...t)}appendDialog(e,...t){return this.appendDialogAsync(Promise.resolve(e),...t)}createTrackedDialogAsync(e,t,...n){return p.a.trackEvent("Modal",e,t),this.createDialogAsync(...n)}appendTrackedDialogAsync(e,t,...n){return p.a.trackEvent("Modal",e,t),this.appendDialogAsync(...n)}closeCurrentModal(e){const t=this.getCurrentModal();t&&(t.closeReason=e,t.close())}buildModal(e,t,n,o){const i={onFinished:t?t.onFinished:null,onBeforeClose:o.onBeforeClose,beforeClosePromise:null,closeReason:null,className:n,elem:null,close:null},[a,s]=this.getCloseFn(i,t),l=this.counter++;return i.elem=c.a.createElement(y,r()({key:l,prom:e},t,{onFinished:a})),i.close=a,{modal:i,closeDialog:a,onFinishedProm:s}}getCloseFn(e,t){const n=Object(g.a)();return[async(...o)=>{if(e.beforeClosePromise)await e.beforeClosePromise;else if(e.onBeforeClose){e.beforeClosePromise=e.onBeforeClose(e.closeReason);const t=await e.beforeClosePromise;if(e.beforeClosePromise=null,!t)return}n.resolve(o),t&&t.onFinished&&t.onFinished.apply(null,o);const r=this.modals.indexOf(e);r>=0&&this.modals.splice(r,1),this.priorityModal===e&&(this.priorityModal=null,this.modals=[]),this.staticModal===e&&(this.staticModal=null,this.modals=[]),this.reRender()},n.promise]}createDialogAsync(e,t,n,o=!1,r=!1,i={}){const{modal:a,closeDialog:s,onFinishedProm:c}=this.buildModal(e,t,n,i);return o?this.priorityModal=a:r?this.staticModal=a:this.modals.unshift(a),this.reRender(),{close:s,finished:c}}appendDialogAsync(e,t,n){const{modal:o,closeDialog:r,onFinishedProm:i}=this.buildModal(e,t,n,{});return this.modals.push(o),this.reRender(),{close:r,finished:i}}getCurrentModal(){return this.priorityModal?this.priorityModal:this.modals[0]||this.staticModal}reRender(){if(0===this.modals.length&&!this.priorityModal&&!this.staticModal)return m.a.dispatch({action:"aria_unhide_main_app"}),d.a.unmountComponentAtNode(E.getOrCreateContainer()),void d.a.unmountComponentAtNode(E.getOrCreateStaticContainer());if(m.a.dispatch({action:"aria_hide_main_app"}),this.staticModal){const e=h()("mx_Dialog_wrapper mx_Dialog_staticWrapper",this.staticModal.className),t=c.a.createElement("div",{className:e},c.a.createElement("div",{className:"mx_Dialog"},this.staticModal.elem),c.a.createElement("div",{className:"mx_Dialog_background mx_Dialog_staticBackground",onClick:this.onBackgroundClick}));d.a.render(t,E.getOrCreateStaticContainer())}else d.a.unmountComponentAtNode(E.getOrCreateStaticContainer());const e=this.getCurrentModal();if(e===this.staticModal||e.hidden)d.a.unmountComponentAtNode(E.getOrCreateContainer());else{const t=h()("mx_Dialog_wrapper",e.className,{mx_Dialog_wrapperWithStaticUnder:this.staticModal}),n=c.a.createElement("div",{className:t},c.a.createElement("div",{className:"mx_Dialog"},e.elem),c.a.createElement("div",{className:"mx_Dialog_background",onClick:this.onBackgroundClick}));d.a.render(n,E.getOrCreateContainer())}}}window.singletonModalManager||(window.singletonModalManager=new E);t.a=window.singletonModalManager},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(104),r=n.n(o),i=n(87),a=n.n(i),s=n(106),c=n(97),l=n.n(c);function d(e){let{element:t,onClick:n,children:o,kind:i,disabled:c,inputRef:d,className:u}=e,h=r()(e,["element","onClick","children","kind","disabled","inputRef","className"]);const p=h;return c||(p.onClick=n,p.onKeyDown=e=>{if(e.key===s.a.ENTER)return e.stopPropagation(),e.preventDefault(),n(e);e.key===s.a.SPACE&&(e.stopPropagation(),e.preventDefault())},p.onKeyUp=e=>{if(e.key===s.a.SPACE)return e.stopPropagation(),e.preventDefault(),n(e);e.key===s.a.ENTER&&(e.stopPropagation(),e.preventDefault())}),p.ref=d,p.className=l()("mx_AccessibleButton",u,{mx_AccessibleButton_hasKind:i,["mx_AccessibleButton_kind_"+i]:i,mx_AccessibleButton_disabled:c}),a.a.createElement(t,h,o)}d.defaultProps={element:"div",role:"button",tabIndex:0},d.displayName="AccessibleButton"},function(e,t,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return A})),n.d(t,"b",(function(){return N})),n.d(t,"p",(function(){return F})),n.d(t,"k",(function(){return M})),n.d(t,"l",(function(){return P})),n.d(t,"m",(function(){return L})),n.d(t,"q",(function(){return j})),n.d(t,"o",(function(){return U})),n.d(t,"n",(function(){return B}));var o=n(99),r=n.n(o),i=n(18),a=n.n(i),s=n(87),c=n.n(s),l=n(152),d=n.n(l),u=n(97),h=n.n(u),p=n(106),m=n(89),g=n(145),f=n(517);n.d(t,"c",(function(){return f.a}));var _=n(279);n.d(t,"d",(function(){return _.a}));var b=n(518);n.d(t,"e",(function(){return b.a}));var v=n(519);n.d(t,"f",(function(){return v.a}));var y=n(520);n.d(t,"g",(function(){return y.a}));var E=n(521);n.d(t,"h",(function(){return E.a}));var S=n(522);n.d(t,"i",(function(){return S.a}));var w,C,T,x,O=n(523);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function R(e){for(var t=1;t{if(!e)return;let t=e.querySelector('[role^="menuitem"]');t||(t=e.querySelector("[tab-index]")),t&&t.focus(),this.setState({contextMenuElem:e})}),a()(this,"onContextMenu",t=>{if(this.props.onFinished){this.props.onFinished(),t.preventDefault(),t.stopPropagation();const n=t.clientX,o=t.clientY;e(()=>{const e=document.createEvent("MouseEvents");e.initMouseEvent("contextmenu",!0,!0,window,0,0,0,n,o,!1,!1,!1,!1,0,null),document.elementFromPoint(n,o).dispatchEvent(e)})}}),a()(this,"onContextMenuPreventBubbling",e=>{e.stopPropagation()}),a()(this,"onFinished",e=>{e.stopPropagation(),e.preventDefault(),this.props.onFinished&&this.props.onFinished()}),a()(this,"onMoveFocus",(e,t)=>{let n=!1;do{const o=t?e.lastElementChild:e.firstElementChild,r=t?e.previousElementSibling:e.nextElementSibling;n?o?e=o:r?e=r:(n=!1,e=e.parentElement):r?(e=r,n=!0):e=e.parentElement,e&&e.classList.contains("mx_ContextualMenu")&&(e=t?e.lastElementChild:e.firstElementChild,n=!0)}while(e&&!D.has(e.getAttribute("role")));e&&e.focus()}),a()(this,"onMoveFocusHomeEnd",(e,t)=>{let n=e.querySelectorAll('[role^="menuitem"]');n||(n=e.querySelectorAll("[tab-index]")),n&&n.length&&(t?n[0].focus():n[n.length-1].focus())}),a()(this,"onKeyDown",e=>{if(e.stopPropagation(),!this.props.managed)return void(e.key===p.a.ESCAPE&&(this.props.onFinished(),e.preventDefault()));let t=!0;switch(e.key){case p.a.TAB:case p.a.ESCAPE:case p.a.ARROW_LEFT:case p.a.ARROW_RIGHT:this.props.onFinished();break;case p.a.ARROW_UP:this.onMoveFocus(e.target,!0);break;case p.a.ARROW_DOWN:this.onMoveFocus(e.target,!1);break;case p.a.HOME:this.onMoveFocusHomeEnd(this.state.contextMenuElem,!0);break;case p.a.END:this.onMoveFocusHomeEnd(this.state.contextMenuElem,!1);break;default:t=!1}t&&e.preventDefault()}),this.state={contextMenuElem:null},this.initialFocus=document.activeElement}componentWillUnmount(){this.initialFocus.focus()}renderMenu(e=this.props.hasBackground){const t={},n=this.props;let o;n.top?t.top=n.top:t.bottom=n.bottom,n.left?(t.left=n.left,o=A.Left):(t.right=n.right,o=A.Right);const r=this.state.contextMenuElem?this.state.contextMenuElem.getBoundingClientRect():null,i={};n.chevronFace&&(o=n.chevronFace);const a=o&&o!==A.None;if(o===A.Top||o===A.Bottom)i.left=n.chevronOffset;else if(void 0!==t.top){const e=t.top;let o=e;if(r){const e=10;o=Math.min(t.top,document.body.clientHeight-r.height-e)}t.top=o,i.top=Math.max(n.chevronOffset,n.chevronOffset+e-o)}let s;a&&(s=c.a.createElement("div",{style:i,className:"mx_ContextualMenu_chevron_"+o}));const l=h()({mx_ContextualMenu:!0,mx_ContextualMenu_left:!a&&t.left,mx_ContextualMenu_right:!a&&t.right,mx_ContextualMenu_top:!a&&t.top,mx_ContextualMenu_bottom:!a&&t.bottom,mx_ContextualMenu_withChevron_left:o===A.Left,mx_ContextualMenu_withChevron_right:o===A.Right,mx_ContextualMenu_withChevron_top:o===A.Top,mx_ContextualMenu_withChevron_bottom:o===A.Bottom}),d={};n.menuWidth&&(d.width=n.menuWidth),n.menuHeight&&(d.height=n.menuHeight),isNaN(Number(n.menuPaddingTop))||(d.paddingTop=n.menuPaddingTop),isNaN(Number(n.menuPaddingLeft))||(d.paddingLeft=n.menuPaddingLeft),isNaN(Number(n.menuPaddingBottom))||(d.paddingBottom=n.menuPaddingBottom),isNaN(Number(n.menuPaddingRight))||(d.paddingRight=n.menuPaddingRight);const u={};let p;return isNaN(Number(n.zIndex))||(d.zIndex=n.zIndex+1,u.zIndex=n.zIndex),e&&(p=c.a.createElement("div",{className:"mx_ContextualMenu_background",style:u,onClick:this.onFinished,onContextMenu:this.onContextMenu})),c.a.createElement("div",{className:h()("mx_ContextualMenu_wrapper",this.props.wrapperClassName),style:R(R({},t),u),onKeyDown:this.onKeyDown,onContextMenu:this.onContextMenuPreventBubbling},c.a.createElement("div",{className:l,style:d,ref:this.collectContextMenuRect,role:this.props.managed?"menu":void 0},s,n.children),p)}render(){return d.a.createPortal(this.renderMenu(),I())}},a()(C,"defaultProps",{hasBackground:!0,managed:!0}),w=T))||w;const F=(e,t=12)=>{const n=e.right+window.pageXOffset+3;let o=e.top+e.height/2+window.pageYOffset;return o-=t+8,{left:n,top:o,chevronOffset:t}},M=(e,t=A.None,n=0)=>{const o={chevronFace:t},r=e.right+window.pageXOffset,i=e.bottom+window.pageYOffset,a=e.top+window.pageYOffset;return o.right=g.b.instance.windowWidth-r,i{const o={chevronFace:t},r=e.right+window.pageXOffset,i=e.bottom+window.pageYOffset,a=e.top+window.pageYOffset;return o.right=g.b.instance.windowWidth-r,i{const o={chevronFace:t},r=e.left+window.pageXOffset,i=e.top+window.pageYOffset;return o.left=r,o.bottom=g.b.instance.windowHeight-i+n,o},j=()=>{const e=Object(s.useRef)(null),[t,n]=Object(s.useState)(!1);return[t,e,()=>{n(!0)},()=>{n(!1)},n]};let U=Object(m.a)("structures.LegacyContextMenu")(x=class extends N{render(){return this.renderMenu(!1)}})||x;function B(e,t){const n=function(...e){d.a.unmountComponentAtNode(I()),t&&t.onFinished&&t.onFinished.apply(null,e)},o=c.a.createElement(U,r()({},t,{onFinished:n,windowResize:n}),c.a.createElement(e,r()({},t,{onFinished:n})));return d.a.render(o,I()),{close:n}}}).call(this,n(168).setImmediate)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"c",(function(){return a}));const o={HOME:"Home",END:"End",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",BACKSPACE:"Backspace",DELETE:"Delete",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",TAB:"Tab",ESCAPE:"Escape",ENTER:"Enter",ALT:"Alt",CONTROL:"Control",META:"Meta",SHIFT:"Shift",CONTEXT_MENU:"ContextMenu",COMMA:",",PERIOD:".",LESS_THAN:"<",GREATER_THAN:">",BACKTICK:"`",SPACE:" ",SLASH:"/",SQUARE_BRACKET_LEFT:"[",SQUARE_BRACKET_RIGHT:"]",A:"a",B:"b",C:"c",D:"d",E:"e",F:"f",G:"g",H:"h",I:"i",J:"j",K:"k",L:"l",M:"m",N:"n",O:"o",P:"p",Q:"q",R:"r",S:"s",T:"t",U:"u",V:"v",W:"w",X:"x",Y:"y",Z:"z"},r=navigator.platform.toUpperCase().indexOf("MAC")>=0;function i(e){return r?e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey:e.ctrlKey&&!e.altKey&&!e.metaKey&&!e.shiftKey}function a(e){return r?e.metaKey&&!e.altKey&&!e.ctrlKey:e.ctrlKey&&!e.altKey&&!e.metaKey}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var o=n(104),r=n.n(o),i=n(18),a=n.n(i),s=n(87),c=n.n(s),l=n(97),d=n.n(l),u=n(90),h=n(111);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function m(e){for(var t=1;t{this.validate({focused:!0})},200)),a()(this,"onFocus",e=>{this.setState({focused:!0}),this.props.validateOnFocus&&this.validate({focused:!0}),this.props.onFocus&&this.props.onFocus(e)}),a()(this,"onChange",e=>{this.props.validateOnChange&&this.validateOnChange(),this.props.onChange&&this.props.onChange(e)}),a()(this,"onBlur",e=>{this.setState({focused:!1}),this.props.validateOnBlur&&this.validate({focused:!1}),this.props.onBlur&&this.props.onBlur(e)}),this.state={valid:void 0,feedback:void 0,feedbackVisible:!1,focused:!1},this.id=this.props.id||"mx_Field_"+g++}focus(){this.input.focus()}async validate({focused:e,allowEmpty:t=!0}){if(!this.props.onValidate)return;const n=this.input?this.input.value:null,{valid:o,feedback:r}=await this.props.onValidate({value:n,focused:e,allowEmpty:t});return this.state.focused&&r?this.setState({valid:o,feedback:r,feedbackVisible:!0}):this.setState({valid:o,feedbackVisible:!1}),o}render(){const e=this.props,{element:t,prefixComponent:n,postfixComponent:o,className:i,onValidate:a,children:s,tooltipContent:l,forceValidity:h,tooltipClassName:p,list:g,validateOnBlur:f,validateOnChange:_,validateOnFocus:b}=e,v=r()(e,["element","prefixComponent","postfixComponent","className","onValidate","children","tooltipContent","forceValidity","tooltipClassName","list","validateOnBlur","validateOnChange","validateOnFocus"]);v.placeholder=v.placeholder||v.label,v.id=this.id,v.onFocus=this.onFocus,v.onChange=this.onChange,v.onBlur=this.onBlur;const y=m(m({},v),{},{ref:e=>this.input=e,list:g}),E=c.a.createElement(this.props.element,y,s);let S=null;n&&(S=c.a.createElement("span",{className:"mx_Field_prefix"},n));let w=null;o&&(w=c.a.createElement("span",{className:"mx_Field_postfix"},o));const C=null!=h,T=d()("mx_Field","mx_Field_"+this.props.element,i,{mx_Field_labelAlwaysTopLeft:n,mx_Field_valid:C?h:a&&!0===this.state.valid,mx_Field_invalid:C?!h:a&&!1===this.state.valid}),x=u.getComponent("elements.Tooltip");let O;return(l||this.state.feedback)&&(O=c.a.createElement(x,{tooltipClassName:d()("mx_Field_tooltip",p),visible:this.state.focused&&this.props.forceTooltipVisible||this.state.feedbackVisible,label:l||this.state.feedback,alignment:x.Alignment.Right})),c.a.createElement("div",{className:T},S,E,c.a.createElement("label",{htmlFor:this.id},this.props.label),w,O)}}a()(f,"defaultProps",{element:"input",type:"text",validateOnFocus:!0,validateOnBlur:!0,validateOnChange:!0})},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return l}));var o=n(8),r=n(1),i=n(0);const a={NOT_SENT:"not_sent",ENCRYPTING:"encrypting",SENDING:"sending",QUEUED:"queued",SENT:"sent",CANCELLED:"cancelled"},s={};function c(e){return s[e]||(s[e]=e),s[e]}const l=function(e){["state_key","type","sender","room_id","membership"].forEach(t=>{e[t]&&(e[t]=c(e[t]))}),["membership","avatar_url","displayname"].forEach(t=>{e.content&&e.content[t]&&(e.content[t]=c(e.content[t]))}),["rel_type"].forEach(t=>{e.content&&e.content["m.relates_to"]&&e.content["m.relates_to"][t]&&(e.content["m.relates_to"][t]=c(e.content["m.relates_to"][t]))}),this.event=e||{},this.sender=null,this.target=null,this.status=null,this.error=null,this.forwardLooking=!0,this._pushActions=null,this._replacingEvent=null,this._localRedactionEvent=null,this._isCancelled=!1,this._clearEvent={},this._senderCurve25519Key=null,this._claimedEd25519Key=null,this._forwardingCurve25519KeyChain=[],this._untrusted=null,this._decryptionPromise=null,this._retryDecryption=!1,this.verificationRequest=null,this._txnId=e.txn_id||null,this._localTimestamp=Date.now()-this.getAge()};r.m(l,o.EventEmitter),r.j(l.prototype,{getId:function(){return this.event.event_id},getSender:function(){return this.event.sender||this.event.user_id},getType:function(){return this._clearEvent.type||this.event.type},getWireType:function(){return this.event.type},getRoomId:function(){return this.event.room_id},getTs:function(){return this.event.origin_server_ts},getDate:function(){return this.event.origin_server_ts?new Date(this.event.origin_server_ts):null},getOriginalContent:function(){return this._localRedactionEvent?{}:this._clearEvent.content||this.event.content||{}},getContent:function(){return this._localRedactionEvent?{}:this._replacingEvent?this._replacingEvent.getContent()["m.new_content"]||{}:this.getOriginalContent()},getWireContent:function(){return this.event.content||{}},getPrevContent:function(){return this.getUnsigned().prev_content||this.event.prev_content||{}},getDirectionalContent:function(){return this.forwardLooking?this.getContent():this.getPrevContent()},getAge:function(){return this.getUnsigned().age||this.event.age},getLocalAge:function(){return Date.now()-this._localTimestamp},getStateKey:function(){return this.event.state_key},isState:function(){return void 0!==this.event.state_key},makeEncrypted:function(e,t,n,o){this._clearEvent={type:this.event.type,content:this.event.content},this.event.type=e,this.event.content=t,this._senderCurve25519Key=n,this._claimedEd25519Key=o},isBeingDecrypted:function(){return null!=this._decryptionPromise},isDecryptionFailure:function(){return this._clearEvent&&this._clearEvent.content&&"m.bad.encrypted"===this._clearEvent.content.msgtype},shouldAttemptDecryption:function(){return this.isEncrypted()&&!this.isBeingDecrypted()&&null===this.getClearContent()},attemptDecryption:async function(e,t={}){if("boolean"==typeof t&&(t={isRetry:t}),!this.isEncrypted())throw new Error("Attempt to decrypt event which isn't encrypted");if(this._clearEvent&&this._clearEvent.content&&"m.bad.encrypted"!==this._clearEvent.content.msgtype)throw new Error("Attempt to decrypt event which has already been decrypted");return this._decryptionPromise?(i.a.log(`Event ${this.getId()} already being decrypted; queueing a retry`),this._retryDecryption=!0,this._decryptionPromise):(this._decryptionPromise=this._decryptionLoop(e,t),this._decryptionPromise)},cancelAndResendKeyRequest:function(e,t){const n=this.getWireContent();return e.requestRoomKey({algorithm:n.algorithm,room_id:this.getRoomId(),session_id:n.session_id,sender_key:n.sender_key},this.getKeyRequestRecipients(t),!0)},getKeyRequestRecipients:function(e){const t=this.getWireContent(),n=[{userId:e,deviceId:"*"}],o=this.getSender();return o!==e&&n.push({userId:o,deviceId:t.device_id}),n},_decryptionLoop:async function(e,t={}){for(await Promise.resolve();;){let n,o;this._retryDecryption=!1;try{e?(n=await e.decryptEvent(this),!0===t.isRetry&&i.a.info(`Decrypted event on retry (id=${this.getId()})`)):n=this._badEncryptedMessage("Encryption not enabled")}catch(e){if("DecryptionError"!==e.name){const n=t.isRetry?"re":"";return i.a.error(`Error ${n}decrypting event (id=${this.getId()}): ${e.stack||e}`),this._decryptionPromise=null,void(this._retryDecryption=!1)}if(o=e,this._retryDecryption){i.a.log(`Got error decrypting event (id=${this.getId()}: `+e+"), but retrying");continue}i.a.warn(`Error decrypting event (id=${this.getId()}): ${e.detailedString}`),n=this._badEncryptedMessage(e.message)}return this._decryptionPromise=null,this._retryDecryption=!1,this._setClearData(n),this.setPushActions(null),void(!1!==t.emit&&this.emit("Event.decrypted",this,o))}},_badEncryptedMessage:function(e){return{clearEvent:{type:"m.room.message",content:{msgtype:"m.bad.encrypted",body:"** Unable to decrypt: "+e+" **"}}}},_setClearData:function(e){this._clearEvent=e.clearEvent,this._senderCurve25519Key=e.senderCurve25519Key||null,this._claimedEd25519Key=e.claimedEd25519Key||null,this._forwardingCurve25519KeyChain=e.forwardingCurve25519KeyChain||[],this._untrusted=e.untrusted||!1},getClearContent:function(){const e=this._clearEvent;return e&&e.content?e.content:null},isEncrypted:function(){return!this.isState()&&"m.room.encrypted"===this.event.type},getSenderKey:function(){return this._senderCurve25519Key},getKeysClaimed:function(){return{ed25519:this._claimedEd25519Key}},getClaimedEd25519Key:function(){return this._claimedEd25519Key},getForwardingCurve25519KeyChain:function(){return this._forwardingCurve25519KeyChain},isKeySourceUntrusted:function(){return this._untrusted},getUnsigned:function(){return this.event.unsigned||{}},unmarkLocallyRedacted:function(){const e=this._localRedactionEvent;return this._localRedactionEvent=null,this.event.unsigned&&(this.event.unsigned.redacted_because=null),!!e},markLocallyRedacted:function(e){this._localRedactionEvent||(this.emit("Event.beforeRedaction",this,e),this._localRedactionEvent=e,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event)},makeRedacted:function(e){if(!e.event)throw new Error("invalid redaction_event in makeRedacted");let t;for(t in this._localRedactionEvent=null,this.emit("Event.beforeRedaction",this,e),this._replacingEvent=null,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event,this.event)this.event.hasOwnProperty(t)&&(d[t]||delete this.event[t]);const n=u[this.getType()]||{},o=this.getContent();for(t in o)o.hasOwnProperty(t)&&(n[t]||delete o[t])},isRedacted:function(){return Boolean(this.getUnsigned().redacted_because)},isRedaction:function(){return"m.room.redaction"===this.getType()},getRedactionEvent:function(){return this.isRedacted()?this._clearEvent.unsigned?this._clearEvent.unsigned.redacted_because:this.event.unsigned.redacted_because?this.event.unsigned.redacted_because:{}:null},getPushActions:function(){return this._pushActions},setPushActions:function(e){this._pushActions=e},handleRemoteEcho:function(e){const t=this.getUnsigned(),n=this.getId();this.event=e,t.redacted_because&&(this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=t.redacted_because),this.setStatus(null),this.getId()!==n&&this.emit("Event.localEventIdReplaced",this)},isSending(){return!!this.status},setStatus(e){this.status=e,this.emit("Event.status",this,e)},replaceLocalEventId(e){this.event.event_id=e,this.emit("Event.localEventIdReplaced",this)},isRelation(e){const t=this.getWireContent(),n=t&&t["m.relates_to"];return n&&n.rel_type&&n.event_id&&(e&&n.rel_type===e||!e)},getRelation(){return this.isRelation()?this.getWireContent()["m.relates_to"]:null},makeReplaced(e){this.isRedacted()&&e||this._replacingEvent!==e&&(this._replacingEvent=e,this.emit("Event.replaced",this))},getAssociatedStatus(){return this._replacingEvent?this._replacingEvent.status:this._localRedactionEvent?this._localRedactionEvent.status:this.status},getServerAggregatedRelation(e){const t=this.getUnsigned()["m.relations"];if(t)return t[e]},replacingEventId(){const e=this.getServerAggregatedRelation("m.replace");return e?e.event_id:this._replacingEvent?this._replacingEvent.getId():void 0},replacingEvent(){return this._replacingEvent},replacingEventDate(){const e=this.getServerAggregatedRelation("m.replace");if(e){const t=e.origin_server_ts;if(Number.isFinite(t))return new Date(t)}else if(this._replacingEvent)return this._replacingEvent.getDate()},localRedactionEvent(){return this._localRedactionEvent},getAssociatedId(){const e=this.getRelation();return e?e.event_id:this.isRedaction()?this.event.redacts:void 0},hasAssocation(){return!!this.getAssociatedId()},updateAssociatedId(e){const t=this.getRelation();t?t.event_id=e:this.isRedaction()&&(this.event.redacts=e)},flagCancelled(e=!0){this._isCancelled=e},isCancelled(){return this._isCancelled},toJSON(){const e={type:this.getType(),sender:this.getSender(),content:this.getContent(),event_id:this.getId(),origin_server_ts:this.getTs(),unsigned:this.getUnsigned(),room_id:this.getRoomId()};return this.isRedaction()&&(e.redacts=this.event.redacts),this.isEncrypted()?{decrypted:e,encrypted:this.event}:e},setVerificationRequest:function(e){this.verificationRequest=e},setTxnId(e){this._txnId=e},getTxnId(){return this._txnId}});const d=["event_id","type","room_id","user_id","sender","state_key","prev_state","content","unsigned","origin_server_ts"].reduce((function(e,t){return e[t]=1,e}),{}),u={"m.room.member":{membership:1},"m.room.create":{creator:1},"m.room.join_rules":{join_rule:1},"m.room.power_levels":{ban:1,events:1,events_default:1,kick:1,redact:1,state_default:1,users:1,users_default:1},"m.room.aliases":{aliases:1}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var o,r=n(99),i=n.n(r),a=n(104),s=n.n(a),c=n(18),l=n.n(c),d=n(87),u=n.n(d),h=n(97),p=n.n(h),m=n(96),g=n(186),f=n(89);let _=Object(f.a)("views.elements.AccessibleTooltipButton")(o=class extends u.a.PureComponent{constructor(e){super(e),l()(this,"onMouseOver",()=>{this.props.forceHide||this.setState({hover:!0})}),l()(this,"onMouseLeave",()=>{this.setState({hover:!1})}),this.state={hover:!1}}componentDidUpdate(e){!e.forceHide&&this.props.forceHide&&this.state.hover&&this.setState({hover:!1})}render(){const e=this.props,{title:t,tooltip:n,children:o,tooltipClassName:r,forceHide:a,yOffset:c}=e,l=s()(e,["title","tooltip","children","tooltipClassName","forceHide","yOffset"]),d=this.state.hover?u.a.createElement(g.b,{className:"mx_AccessibleTooltipButton_container",tooltipClassName:p()("mx_AccessibleTooltipButton_tooltip",r),label:n||t,yOffset:c}):u.a.createElement("div",null);return u.a.createElement(m.a,i()({},l,{onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave,"aria-label":t}),o,d)}})||o},function(e,t,n){"use strict";let o,r;n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"d",(function(){return a})),function(e){e.RoomCanonicalAlias="m.room.canonical_alias",e.RoomCreate="m.room.create",e.RoomJoinRules="m.room.join_rules",e.RoomMember="m.room.member",e.RoomThirdPartyInvite="m.room.third_party_invite",e.RoomPowerLevels="m.room.power_levels",e.RoomName="m.room.name",e.RoomTopic="m.room.topic",e.RoomAvatar="m.room.avatar",e.RoomPinnedEvents="m.room.pinned_events",e.RoomEncryption="m.room.encryption",e.RoomHistoryVisibility="m.room.history_visibility",e.RoomGuestAccess="m.room.guest_access",e.RoomServerAcl="m.room.server_acl",e.RoomTombstone="m.room.tombstone",e.RoomAliases="m.room.aliases",e.SpaceChild="m.space.child",e.SpaceParent="m.space.parent",e.RoomRedaction="m.room.redaction",e.RoomMessage="m.room.message",e.RoomMessageEncrypted="m.room.encrypted",e.Sticker="m.sticker",e.CallInvite="m.call.invite",e.CallCandidates="m.call.candidates",e.CallAnswer="m.call.answer",e.CallHangup="m.call.hangup",e.CallReject="m.call.reject",e.CallSelectAnswer="m.call.select_answer",e.CallNegotiate="m.call.negotiate",e.CallReplaces="m.call.replaces",e.CallAssertedIdentity="m.call.asserted_identity",e.CallAssertedIdentityPrefix="org.matrix.call.asserted_identity",e.KeyVerificationRequest="m.key.verification.request",e.KeyVerificationStart="m.key.verification.start",e.KeyVerificationCancel="m.key.verification.cancel",e.KeyVerificationMac="m.key.verification.mac",e.KeyVerificationDone="m.key.verification.done",e.RoomMessageFeedback="m.room.message.feedback",e.Reaction="m.reaction",e.Typing="m.typing",e.Receipt="m.receipt",e.Presence="m.presence",e.FullyRead="m.fully_read",e.Tag="m.tag",e.PushRules="m.push_rules",e.Direct="m.direct",e.IgnoredUserList="m.ignored_user_list",e.RoomKey="m.room_key",e.RoomKeyRequest="m.room_key_request",e.ForwardedRoomKey="m.forwarded_room_key",e.Dummy="m.dummy"}(o||(o={})),function(e){e.Text="m.text",e.Emote="m.emote",e.Notice="m.notice",e.Image="m.image",e.File="m.file",e.Audio="m.audio",e.Location="m.location",e.Video="m.video"}(r||(r={}));const i="type";let a;!function(e){e.Space="m.space"}(a||(a={}))},function(e,t,n){(function(e,o){var r;(function(){var i="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],c="[object Arguments]",l="[object Array]",d="[object Boolean]",u="[object Date]",h="[object Error]",p="[object Function]",m="[object GeneratorFunction]",g="[object Map]",f="[object Number]",_="[object Object]",b="[object RegExp]",v="[object Set]",y="[object String]",E="[object Symbol]",S="[object WeakMap]",w="[object ArrayBuffer]",C="[object DataView]",T="[object Float32Array]",x="[object Float64Array]",O="[object Int8Array]",k="[object Int16Array]",R="[object Int32Array]",I="[object Uint8Array]",D="[object Uint16Array]",A="[object Uint32Array]",N=/\b__p \+= '';/g,F=/\b(__p \+=) '' \+/g,M=/(__e\(.*?\)|\b__t\)) \+\n'';/g,P=/&(?:amp|lt|gt|quot|#39);/g,L=/[&<>"']/g,j=RegExp(P.source),U=RegExp(L.source),B=/<%-([\s\S]+?)%>/g,G=/<%([\s\S]+?)%>/g,q=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,H=/^\w*$/,z=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,K=/[\\^$.*+?()[\]{}|]/g,W=RegExp(K.source),Y=/^\s+/,$=/\s/,Q=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,X=/,? & /,Z=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/[()=,{}\[\]\/\s]/,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,oe=/\w*$/,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,se=/^0o[0-7]+$/i,ce=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,de=/($^)/,ue=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",me="[\\ud800-\\udfff]",ge="["+pe+"]",fe="["+he+"]",_e="\\d+",be="[\\u2700-\\u27bf]",ve="[a-z\\xdf-\\xf6\\xf8-\\xff]",ye="[^\\ud800-\\udfff"+pe+_e+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",Ee="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",we="(?:\\ud83c[\\udde6-\\uddff]){2}",Ce="[\\ud800-\\udbff][\\udc00-\\udfff]",Te="[A-Z\\xc0-\\xd6\\xd8-\\xde]",xe="(?:"+ve+"|"+ye+")",Oe="(?:"+Te+"|"+ye+")",ke="(?:"+fe+"|"+Ee+")"+"?",Re="[\\ufe0e\\ufe0f]?"+ke+("(?:\\u200d(?:"+[Se,we,Ce].join("|")+")[\\ufe0e\\ufe0f]?"+ke+")*"),Ie="(?:"+[be,we,Ce].join("|")+")"+Re,De="(?:"+[Se+fe+"?",fe,we,Ce,me].join("|")+")",Ae=RegExp("['’]","g"),Ne=RegExp(fe,"g"),Fe=RegExp(Ee+"(?="+Ee+")|"+De+Re,"g"),Me=RegExp([Te+"?"+ve+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ge,Te,"$"].join("|")+")",Oe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ge,Te+xe,"$"].join("|")+")",Te+"?"+xe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Te+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_e,Ie].join("|"),"g"),Pe=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Le=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,je=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ue=-1,Be={};Be[T]=Be[x]=Be[O]=Be[k]=Be[R]=Be[I]=Be["[object Uint8ClampedArray]"]=Be[D]=Be[A]=!0,Be[c]=Be[l]=Be[w]=Be[d]=Be[C]=Be[u]=Be[h]=Be[p]=Be[g]=Be[f]=Be[_]=Be[b]=Be[v]=Be[y]=Be[S]=!1;var Ge={};Ge[c]=Ge[l]=Ge[w]=Ge[C]=Ge[d]=Ge[u]=Ge[T]=Ge[x]=Ge[O]=Ge[k]=Ge[R]=Ge[g]=Ge[f]=Ge[_]=Ge[b]=Ge[v]=Ge[y]=Ge[E]=Ge[I]=Ge["[object Uint8ClampedArray]"]=Ge[D]=Ge[A]=!0,Ge[h]=Ge[p]=Ge[S]=!1;var qe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,He=parseInt,ze="object"==typeof e&&e&&e.Object===Object&&e,Ke="object"==typeof self&&self&&self.Object===Object&&self,We=ze||Ke||Function("return this")(),Ye=t&&!t.nodeType&&t,$e=Ye&&"object"==typeof o&&o&&!o.nodeType&&o,Qe=$e&&$e.exports===Ye,Je=Qe&&ze.process,Xe=function(){try{var e=$e&&$e.require&&$e.require("util").types;return e||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Ze=Xe&&Xe.isArrayBuffer,et=Xe&&Xe.isDate,tt=Xe&&Xe.isMap,nt=Xe&&Xe.isRegExp,ot=Xe&&Xe.isSet,rt=Xe&&Xe.isTypedArray;function it(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,o){for(var r=-1,i=null==e?0:e.length;++r-1}function ht(e,t,n){for(var o=-1,r=null==e?0:e.length;++o-1;);return n}function Mt(e,t){for(var n=e.length;n--&&Et(t,e[n],0)>-1;);return n}function Pt(e,t){for(var n=e.length,o=0;n--;)e[n]===t&&++o;return o}var Lt=xt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),jt=xt({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ut(e){return"\\"+qe[e]}function Bt(e){return Pe.test(e)}function Gt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,o){n[++t]=[o,e]})),n}function qt(e,t){return function(n){return e(t(n))}}function Vt(e,t){for(var n=-1,o=e.length,r=0,i=[];++n",""":'"',"'":"'"});var Qt=function e(t){var n,o=(t=null==t?We:Qt.defaults(We.Object(),t,Qt.pick(We,je))).Array,r=t.Date,$=t.Error,he=t.Function,pe=t.Math,me=t.Object,ge=t.RegExp,fe=t.String,_e=t.TypeError,be=o.prototype,ve=he.prototype,ye=me.prototype,Ee=t["__core-js_shared__"],Se=ve.toString,we=ye.hasOwnProperty,Ce=0,Te=(n=/[^.]+$/.exec(Ee&&Ee.keys&&Ee.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",xe=ye.toString,Oe=Se.call(me),ke=We._,Re=ge("^"+Se.call(we).replace(K,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Qe?t.Buffer:void 0,De=t.Symbol,Fe=t.Uint8Array,Pe=Ie?Ie.allocUnsafe:void 0,qe=qt(me.getPrototypeOf,me),ze=me.create,Ke=ye.propertyIsEnumerable,Ye=be.splice,$e=De?De.isConcatSpreadable:void 0,Je=De?De.iterator:void 0,Xe=De?De.toStringTag:void 0,bt=function(){try{var e=ti(me,"defineProperty");return e({},"",{}),e}catch(e){}}(),xt=t.clearTimeout!==We.clearTimeout&&t.clearTimeout,Jt=r&&r.now!==We.Date.now&&r.now,Xt=t.setTimeout!==We.setTimeout&&t.setTimeout,Zt=pe.ceil,en=pe.floor,tn=me.getOwnPropertySymbols,nn=Ie?Ie.isBuffer:void 0,on=t.isFinite,rn=be.join,an=qt(me.keys,me),sn=pe.max,cn=pe.min,ln=r.now,dn=t.parseInt,un=pe.random,hn=be.reverse,pn=ti(t,"DataView"),mn=ti(t,"Map"),gn=ti(t,"Promise"),fn=ti(t,"Set"),_n=ti(t,"WeakMap"),bn=ti(me,"create"),vn=_n&&new _n,yn={},En=ki(pn),Sn=ki(mn),wn=ki(gn),Cn=ki(fn),Tn=ki(_n),xn=De?De.prototype:void 0,On=xn?xn.valueOf:void 0,kn=xn?xn.toString:void 0;function Rn(e){if(za(e)&&!Fa(e)&&!(e instanceof Nn)){if(e instanceof An)return e;if(we.call(e,"__wrapped__"))return Ri(e)}return new An(e)}var In=function(){function e(){}return function(t){if(!Ha(t))return{};if(ze)return ze(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Dn(){}function An(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function Nn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Fn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function Jn(e,t,n,o,r,i){var a,s=1&t,l=2&t,h=4&t;if(n&&(a=r?n(e,o,r,i):n(e)),void 0!==a)return a;if(!Ha(e))return e;var S=Fa(e);if(S){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&we.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return vr(e,a)}else{var N=ri(e),F=N==p||N==m;if(ja(e))return pr(e,s);if(N==_||N==c||F&&!r){if(a=l||F?{}:ai(e),!s)return l?function(e,t){return yr(e,oi(e),t)}(e,function(e,t){return e&&yr(t,Ss(t),e)}(a,e)):function(e,t){return yr(e,ni(e),t)}(e,Wn(a,e))}else{if(!Ge[N])return r?e:{};a=function(e,t,n){var o=e.constructor;switch(t){case w:return mr(e);case d:case u:return new o(+e);case C:return function(e,t){var n=t?mr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case T:case x:case O:case k:case R:case I:case"[object Uint8ClampedArray]":case D:case A:return gr(e,n);case g:return new o;case f:case y:return new o(e);case b:return function(e){var t=new e.constructor(e.source,oe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case v:return new o;case E:return r=e,On?me(On.call(r)):{}}var r}(e,N,s)}}i||(i=new jn);var M=i.get(e);if(M)return M;i.set(e,a),Qa(e)?e.forEach((function(o){a.add(Jn(o,t,n,o,e,i))})):Ka(e)&&e.forEach((function(o,r){a.set(r,Jn(o,t,n,r,e,i))}));var P=S?void 0:(h?l?Yr:Wr:l?Ss:Es)(e);return st(P||e,(function(o,r){P&&(o=e[r=o]),Hn(a,r,Jn(o,t,n,r,e,i))})),a}function Xn(e,t,n){var o=n.length;if(null==e)return!o;for(e=me(e);o--;){var r=n[o],i=t[r],a=e[r];if(void 0===a&&!(r in e)||!i(a))return!1}return!0}function Zn(e,t,n){if("function"!=typeof e)throw new _e(i);return Ei((function(){e.apply(void 0,n)}),t)}function eo(e,t,n,o){var r=-1,i=ut,a=!0,s=e.length,c=[],l=t.length;if(!s)return c;n&&(t=pt(t,Dt(n))),o?(i=ht,a=!1):t.length>=200&&(i=Nt,a=!1,t=new Ln(t));e:for(;++r-1},Mn.prototype.set=function(e,t){var n=this.__data__,o=zn(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this},Pn.prototype.clear=function(){this.size=0,this.__data__={hash:new Fn,map:new(mn||Mn),string:new Fn}},Pn.prototype.delete=function(e){var t=Zr(this,e).delete(e);return this.size-=t?1:0,t},Pn.prototype.get=function(e){return Zr(this,e).get(e)},Pn.prototype.has=function(e){return Zr(this,e).has(e)},Pn.prototype.set=function(e,t){var n=Zr(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this},Ln.prototype.add=Ln.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ln.prototype.has=function(e){return this.__data__.has(e)},jn.prototype.clear=function(){this.__data__=new Mn,this.size=0},jn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},jn.prototype.get=function(e){return this.__data__.get(e)},jn.prototype.has=function(e){return this.__data__.has(e)},jn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Mn){var o=n.__data__;if(!mn||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pn(o)}return n.set(e,t),this.size=n.size,this};var to=wr(lo),no=wr(uo,!0);function oo(e,t){var n=!0;return to(e,(function(e,o,r){return n=!!t(e,o,r)})),n}function ro(e,t,n){for(var o=-1,r=e.length;++o0&&n(s)?t>1?ao(s,t-1,n,o,r):mt(r,s):o||(r[r.length]=s)}return r}var so=Cr(),co=Cr(!0);function lo(e,t){return e&&so(e,t,Es)}function uo(e,t){return e&&co(e,t,Es)}function ho(e,t){return dt(t,(function(t){return Ga(e[t])}))}function po(e,t){for(var n=0,o=(t=lr(t,e)).length;null!=e&&nt}function _o(e,t){return null!=e&&we.call(e,t)}function bo(e,t){return null!=e&&t in me(e)}function vo(e,t,n){for(var r=n?ht:ut,i=e[0].length,a=e.length,s=a,c=o(a),l=1/0,d=[];s--;){var u=e[s];s&&t&&(u=pt(u,Dt(t))),l=cn(u.length,l),c[s]=!n&&(t||i>=120&&u.length>=120)?new Ln(s&&u):void 0}u=e[0];var h=-1,p=c[0];e:for(;++h=s)return c;var l=n[o];return c*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function Mo(e,t,n){for(var o=-1,r=t.length,i={};++o-1;)s!==e&&Ye.call(s,c,1),Ye.call(e,c,1);return e}function Lo(e,t){for(var n=e?t.length:0,o=n-1;n--;){var r=t[n];if(n==o||r!==i){var i=r;ci(r)?Ye.call(e,r,1):tr(e,r)}}return e}function jo(e,t){return e+en(un()*(t-e+1))}function Uo(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=en(t/2))&&(e+=e)}while(t);return n}function Bo(e,t){return Si(fi(e,t,Ws),e+"")}function Go(e){return Bn(Is(e))}function qo(e,t){var n=Is(e);return Ti(n,Qn(t,0,n.length))}function Vo(e,t,n,o){if(!Ha(e))return e;for(var r=-1,i=(t=lr(t,e)).length,a=i-1,s=e;null!=s&&++ri?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=o(i);++r>>1,a=e[i];null!==a&&!Xa(a)&&(n?a<=t:a=200){var l=t?null:Ur(e);if(l)return Ht(l);a=!1,r=Nt,c=new Ln}else c=t?[]:s;e:for(;++o=o?e:Wo(e,t,n)}var hr=xt||function(e){return We.clearTimeout(e)};function pr(e,t){if(t)return e.slice();var n=e.length,o=Pe?Pe(n):new e.constructor(n);return e.copy(o),o}function mr(e){var t=new e.constructor(e.byteLength);return new Fe(t).set(new Fe(e)),t}function gr(e,t){var n=t?mr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function fr(e,t){if(e!==t){var n=void 0!==e,o=null===e,r=e==e,i=Xa(e),a=void 0!==t,s=null===t,c=t==t,l=Xa(t);if(!s&&!l&&!i&&e>t||i&&a&&c&&!s&&!l||o&&a&&c||!n&&c||!r)return 1;if(!o&&!i&&!l&&e1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(r--,i):void 0,a&&li(n[0],n[1],a)&&(i=r<3?void 0:i,r=1),t=me(t);++o-1?r[i?t[a]:a]:void 0}}function Rr(e){return Kr((function(t){var n=t.length,o=n,r=An.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new _e(i);if(r&&!s&&"wrapper"==Qr(a))var s=new An([],!0)}for(o=s?o:n;++o1&&v.reverse(),u&&ls))return!1;var l=i.get(e),d=i.get(t);if(l&&d)return l==t&&d==e;var u=-1,h=!0,p=2&n?new Ln:void 0;for(i.set(e,t),i.set(t,e);++u-1&&e%1==0&&e1?"& ":"")+t[o],t=t.join(n>2?", ":" "),e.replace(Q,"{\n/* [wrapped with "+t+"] */\n")}(o,function(e,t){return st(s,(function(n){var o="_."+n[0];t&n[1]&&!ut(e,o)&&e.push(o)})),e.sort()}(function(e){var t=e.match(J);return t?t[1].split(X):[]}(o),n)))}function Ci(e){var t=0,n=0;return function(){var o=ln(),r=16-(o-n);if(n=o,r>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ti(e,t){var n=-1,o=e.length,r=o-1;for(t=void 0===t?o:t;++n1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,$i(e,n)}));function na(e){var t=Rn(e);return t.__chain__=!0,t}function oa(e,t){return t(e)}var ra=Kr((function(e){var t=e.length,n=t?e[0]:0,o=this.__wrapped__,r=function(t){return $n(t,e)};return!(t>1||this.__actions__.length)&&o instanceof Nn&&ci(n)?((o=o.slice(n,+n+(t?1:0))).__actions__.push({func:oa,args:[r],thisArg:void 0}),new An(o,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(r)}));var ia=Er((function(e,t,n){we.call(e,n)?++e[n]:Yn(e,n,1)}));var aa=kr(Ni),sa=kr(Fi);function ca(e,t){return(Fa(e)?st:to)(e,Xr(t,3))}function la(e,t){return(Fa(e)?ct:no)(e,Xr(t,3))}var da=Er((function(e,t,n){we.call(e,n)?e[n].push(t):Yn(e,n,[t])}));var ua=Bo((function(e,t,n){var r=-1,i="function"==typeof t,a=Pa(e)?o(e.length):[];return to(e,(function(e){a[++r]=i?it(t,e,n):yo(e,t,n)})),a})),ha=Er((function(e,t,n){Yn(e,n,t)}));function pa(e,t){return(Fa(e)?pt:Ro)(e,Xr(t,3))}var ma=Er((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ga=Bo((function(e,t){if(null==e)return[];var n=t.length;return n>1&&li(e,t[0],t[1])?t=[]:n>2&&li(t[0],t[1],t[2])&&(t=[t[0]]),Fo(e,ao(t,1),[])})),fa=Jt||function(){return We.Date.now()};function _a(e,t,n){return t=n?void 0:t,Gr(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ba(e,t){var n;if("function"!=typeof t)throw new _e(i);return e=rs(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var va=Bo((function(e,t,n){var o=1;if(n.length){var r=Vt(n,Jr(va));o|=32}return Gr(e,o,t,n,r)})),ya=Bo((function(e,t,n){var o=3;if(n.length){var r=Vt(n,Jr(ya));o|=32}return Gr(t,o,e,n,r)}));function Ea(e,t,n){var o,r,a,s,c,l,d=0,u=!1,h=!1,p=!0;if("function"!=typeof e)throw new _e(i);function m(t){var n=o,i=r;return o=r=void 0,d=t,s=e.apply(i,n)}function g(e){return d=e,c=Ei(_,t),u?m(e):s}function f(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-d>=a}function _(){var e=fa();if(f(e))return b(e);c=Ei(_,function(e){var n=t-(e-l);return h?cn(n,a-(e-d)):n}(e))}function b(e){return c=void 0,p&&o?m(e):(o=r=void 0,s)}function v(){var e=fa(),n=f(e);if(o=arguments,r=this,l=e,n){if(void 0===c)return g(l);if(h)return hr(c),c=Ei(_,t),m(l)}return void 0===c&&(c=Ei(_,t)),s}return t=as(t)||0,Ha(n)&&(u=!!n.leading,a=(h="maxWait"in n)?sn(as(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),v.cancel=function(){void 0!==c&&hr(c),d=0,o=l=r=c=void 0},v.flush=function(){return void 0===c?s:b(fa())},v}var Sa=Bo((function(e,t){return Zn(e,1,t)})),wa=Bo((function(e,t,n){return Zn(e,as(t)||0,n)}));function Ca(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new _e(i);var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],i=n.cache;if(i.has(r))return i.get(r);var a=e.apply(this,o);return n.cache=i.set(r,a)||i,a};return n.cache=new(Ca.Cache||Pn),n}function Ta(e){if("function"!=typeof e)throw new _e(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ca.Cache=Pn;var xa=dr((function(e,t){var n=(t=1==t.length&&Fa(t[0])?pt(t[0],Dt(Xr())):pt(ao(t,1),Dt(Xr()))).length;return Bo((function(o){for(var r=-1,i=cn(o.length,n);++r=t})),Na=Eo(function(){return arguments}())?Eo:function(e){return za(e)&&we.call(e,"callee")&&!Ke.call(e,"callee")},Fa=o.isArray,Ma=Ze?Dt(Ze):function(e){return za(e)&&go(e)==w};function Pa(e){return null!=e&&Va(e.length)&&!Ga(e)}function La(e){return za(e)&&Pa(e)}var ja=nn||ac,Ua=et?Dt(et):function(e){return za(e)&&go(e)==u};function Ba(e){if(!za(e))return!1;var t=go(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Ya(e)}function Ga(e){if(!Ha(e))return!1;var t=go(e);return t==p||t==m||"[object AsyncFunction]"==t||"[object Proxy]"==t}function qa(e){return"number"==typeof e&&e==rs(e)}function Va(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ha(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function za(e){return null!=e&&"object"==typeof e}var Ka=tt?Dt(tt):function(e){return za(e)&&ri(e)==g};function Wa(e){return"number"==typeof e||za(e)&&go(e)==f}function Ya(e){if(!za(e)||go(e)!=_)return!1;var t=qe(e);if(null===t)return!0;var n=we.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==Oe}var $a=nt?Dt(nt):function(e){return za(e)&&go(e)==b};var Qa=ot?Dt(ot):function(e){return za(e)&&ri(e)==v};function Ja(e){return"string"==typeof e||!Fa(e)&&za(e)&&go(e)==y}function Xa(e){return"symbol"==typeof e||za(e)&&go(e)==E}var Za=rt?Dt(rt):function(e){return za(e)&&Va(e.length)&&!!Be[go(e)]};var es=Pr(ko),ts=Pr((function(e,t){return e<=t}));function ns(e){if(!e)return[];if(Pa(e))return Ja(e)?Wt(e):vr(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=ri(e);return(t==g?Gt:t==v?Ht:Is)(e)}function os(e){return e?(e=as(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function rs(e){var t=os(e),n=t%1;return t==t?n?t-n:t:0}function is(e){return e?Qn(rs(e),0,4294967295):0}function as(e){if("number"==typeof e)return e;if(Xa(e))return NaN;if(Ha(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ha(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=It(e);var n=ie.test(e);return n||se.test(e)?He(e.slice(2),n?2:8):re.test(e)?NaN:+e}function ss(e){return yr(e,Ss(e))}function cs(e){return null==e?"":Zo(e)}var ls=Sr((function(e,t){if(pi(t)||Pa(t))yr(t,Es(t),e);else for(var n in t)we.call(t,n)&&Hn(e,n,t[n])})),ds=Sr((function(e,t){yr(t,Ss(t),e)})),us=Sr((function(e,t,n,o){yr(t,Ss(t),e,o)})),hs=Sr((function(e,t,n,o){yr(t,Es(t),e,o)})),ps=Kr($n);var ms=Bo((function(e,t){e=me(e);var n=-1,o=t.length,r=o>2?t[2]:void 0;for(r&&li(t[0],t[1],r)&&(o=1);++n1),t})),yr(e,Yr(e),n),o&&(n=Jn(n,7,Hr));for(var r=t.length;r--;)tr(n,t[r]);return n}));var xs=Kr((function(e,t){return null==e?{}:function(e,t){return Mo(e,t,(function(t,n){return _s(e,n)}))}(e,t)}));function Os(e,t){if(null==e)return{};var n=pt(Yr(e),(function(e){return[e]}));return t=Xr(t),Mo(e,n,(function(e,n){return t(e,n[0])}))}var ks=Br(Es),Rs=Br(Ss);function Is(e){return null==e?[]:At(e,Es(e))}var Ds=xr((function(e,t,n){return t=t.toLowerCase(),e+(n?As(t):t)}));function As(e){return Bs(cs(e).toLowerCase())}function Ns(e){return(e=cs(e))&&e.replace(le,Lt).replace(Ne,"")}var Fs=xr((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ms=xr((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Ps=Tr("toLowerCase");var Ls=xr((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var js=xr((function(e,t,n){return e+(n?" ":"")+Bs(t)}));var Us=xr((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Bs=Tr("toUpperCase");function Gs(e,t,n){return e=cs(e),void 0===(t=n?void 0:t)?function(e){return Le.test(e)}(e)?function(e){return e.match(Me)||[]}(e):function(e){return e.match(Z)||[]}(e):e.match(t)||[]}var qs=Bo((function(e,t){try{return it(e,void 0,t)}catch(e){return Ba(e)?e:new $(e)}})),Vs=Kr((function(e,t){return st(t,(function(t){t=Oi(t),Yn(e,t,va(e[t],e))})),e}));function Hs(e){return function(){return e}}var zs=Rr(),Ks=Rr(!0);function Ws(e){return e}function Ys(e){return To("function"==typeof e?e:Jn(e,1))}var $s=Bo((function(e,t){return function(n){return yo(n,e,t)}})),Qs=Bo((function(e,t){return function(n){return yo(e,n,t)}}));function Js(e,t,n){var o=Es(t),r=ho(t,o);null!=n||Ha(t)&&(r.length||!o.length)||(n=t,t=e,e=this,r=ho(t,Es(t)));var i=!(Ha(n)&&"chain"in n&&!n.chain),a=Ga(e);return st(r,(function(n){var o=t[n];e[n]=o,a&&(e.prototype[n]=function(){var t=this.__chain__;if(i||t){var n=e(this.__wrapped__),r=n.__actions__=vr(this.__actions__);return r.push({func:o,args:arguments,thisArg:e}),n.__chain__=t,n}return o.apply(e,mt([this.value()],arguments))})})),e}function Xs(){}var Zs=Nr(pt),ec=Nr(lt),tc=Nr(_t);function nc(e){return di(e)?Tt(Oi(e)):function(e){return function(t){return po(t,e)}}(e)}var oc=Mr(),rc=Mr(!0);function ic(){return[]}function ac(){return!1}var sc=Ar((function(e,t){return e+t}),0),cc=jr("ceil"),lc=Ar((function(e,t){return e/t}),1),dc=jr("floor");var uc,hc=Ar((function(e,t){return e*t}),1),pc=jr("round"),mc=Ar((function(e,t){return e-t}),0);return Rn.after=function(e,t){if("function"!=typeof t)throw new _e(i);return e=rs(e),function(){if(--e<1)return t.apply(this,arguments)}},Rn.ary=_a,Rn.assign=ls,Rn.assignIn=ds,Rn.assignInWith=us,Rn.assignWith=hs,Rn.at=ps,Rn.before=ba,Rn.bind=va,Rn.bindAll=Vs,Rn.bindKey=ya,Rn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Fa(e)?e:[e]},Rn.chain=na,Rn.chunk=function(e,t,n){t=(n?li(e,t,n):void 0===t)?1:sn(rs(t),0);var r=null==e?0:e.length;if(!r||t<1)return[];for(var i=0,a=0,s=o(Zt(r/t));ir?0:r+n),(o=void 0===o||o>r?r:rs(o))<0&&(o+=r),o=n>o?0:is(o);n>>0)?(e=cs(e))&&("string"==typeof t||null!=t&&!$a(t))&&!(t=Zo(t))&&Bt(e)?ur(Wt(e),0,n):e.split(t,n):[]},Rn.spread=function(e,t){if("function"!=typeof e)throw new _e(i);return t=null==t?0:sn(rs(t),0),Bo((function(n){var o=n[t],r=ur(n,0,t);return o&&mt(r,o),it(e,this,r)}))},Rn.tail=function(e){var t=null==e?0:e.length;return t?Wo(e,1,t):[]},Rn.take=function(e,t,n){return e&&e.length?Wo(e,0,(t=n||void 0===t?1:rs(t))<0?0:t):[]},Rn.takeRight=function(e,t,n){var o=null==e?0:e.length;return o?Wo(e,(t=o-(t=n||void 0===t?1:rs(t)))<0?0:t,o):[]},Rn.takeRightWhile=function(e,t){return e&&e.length?or(e,Xr(t,3),!1,!0):[]},Rn.takeWhile=function(e,t){return e&&e.length?or(e,Xr(t,3)):[]},Rn.tap=function(e,t){return t(e),e},Rn.throttle=function(e,t,n){var o=!0,r=!0;if("function"!=typeof e)throw new _e(i);return Ha(n)&&(o="leading"in n?!!n.leading:o,r="trailing"in n?!!n.trailing:r),Ea(e,t,{leading:o,maxWait:t,trailing:r})},Rn.thru=oa,Rn.toArray=ns,Rn.toPairs=ks,Rn.toPairsIn=Rs,Rn.toPath=function(e){return Fa(e)?pt(e,Oi):Xa(e)?[e]:vr(xi(cs(e)))},Rn.toPlainObject=ss,Rn.transform=function(e,t,n){var o=Fa(e),r=o||ja(e)||Za(e);if(t=Xr(t,4),null==n){var i=e&&e.constructor;n=r?o?new i:[]:Ha(e)&&Ga(i)?In(qe(e)):{}}return(r?st:lo)(e,(function(e,o,r){return t(n,e,o,r)})),n},Rn.unary=function(e){return _a(e,1)},Rn.union=zi,Rn.unionBy=Ki,Rn.unionWith=Wi,Rn.uniq=function(e){return e&&e.length?er(e):[]},Rn.uniqBy=function(e,t){return e&&e.length?er(e,Xr(t,2)):[]},Rn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?er(e,void 0,t):[]},Rn.unset=function(e,t){return null==e||tr(e,t)},Rn.unzip=Yi,Rn.unzipWith=$i,Rn.update=function(e,t,n){return null==e?e:nr(e,t,cr(n))},Rn.updateWith=function(e,t,n,o){return o="function"==typeof o?o:void 0,null==e?e:nr(e,t,cr(n),o)},Rn.values=Is,Rn.valuesIn=function(e){return null==e?[]:At(e,Ss(e))},Rn.without=Qi,Rn.words=Gs,Rn.wrap=function(e,t){return Oa(cr(t),e)},Rn.xor=Ji,Rn.xorBy=Xi,Rn.xorWith=Zi,Rn.zip=ea,Rn.zipObject=function(e,t){return ar(e||[],t||[],Hn)},Rn.zipObjectDeep=function(e,t){return ar(e||[],t||[],Vo)},Rn.zipWith=ta,Rn.entries=ks,Rn.entriesIn=Rs,Rn.extend=ds,Rn.extendWith=us,Js(Rn,Rn),Rn.add=sc,Rn.attempt=qs,Rn.camelCase=Ds,Rn.capitalize=As,Rn.ceil=cc,Rn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=as(n))==n?n:0),void 0!==t&&(t=(t=as(t))==t?t:0),Qn(as(e),t,n)},Rn.clone=function(e){return Jn(e,4)},Rn.cloneDeep=function(e){return Jn(e,5)},Rn.cloneDeepWith=function(e,t){return Jn(e,5,t="function"==typeof t?t:void 0)},Rn.cloneWith=function(e,t){return Jn(e,4,t="function"==typeof t?t:void 0)},Rn.conformsTo=function(e,t){return null==t||Xn(e,t,Es(t))},Rn.deburr=Ns,Rn.defaultTo=function(e,t){return null==e||e!=e?t:e},Rn.divide=lc,Rn.endsWith=function(e,t,n){e=cs(e),t=Zo(t);var o=e.length,r=n=void 0===n?o:Qn(rs(n),0,o);return(n-=t.length)>=0&&e.slice(n,r)==t},Rn.eq=Ia,Rn.escape=function(e){return(e=cs(e))&&U.test(e)?e.replace(L,jt):e},Rn.escapeRegExp=function(e){return(e=cs(e))&&W.test(e)?e.replace(K,"\\$&"):e},Rn.every=function(e,t,n){var o=Fa(e)?lt:oo;return n&&li(e,t,n)&&(t=void 0),o(e,Xr(t,3))},Rn.find=aa,Rn.findIndex=Ni,Rn.findKey=function(e,t){return vt(e,Xr(t,3),lo)},Rn.findLast=sa,Rn.findLastIndex=Fi,Rn.findLastKey=function(e,t){return vt(e,Xr(t,3),uo)},Rn.floor=dc,Rn.forEach=ca,Rn.forEachRight=la,Rn.forIn=function(e,t){return null==e?e:so(e,Xr(t,3),Ss)},Rn.forInRight=function(e,t){return null==e?e:co(e,Xr(t,3),Ss)},Rn.forOwn=function(e,t){return e&&lo(e,Xr(t,3))},Rn.forOwnRight=function(e,t){return e&&uo(e,Xr(t,3))},Rn.get=fs,Rn.gt=Da,Rn.gte=Aa,Rn.has=function(e,t){return null!=e&&ii(e,t,_o)},Rn.hasIn=_s,Rn.head=Pi,Rn.identity=Ws,Rn.includes=function(e,t,n,o){e=Pa(e)?e:Is(e),n=n&&!o?rs(n):0;var r=e.length;return n<0&&(n=sn(r+n,0)),Ja(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&Et(e,t,n)>-1},Rn.indexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=null==n?0:rs(n);return r<0&&(r=sn(o+r,0)),Et(e,t,r)},Rn.inRange=function(e,t,n){return t=os(t),void 0===n?(n=t,t=0):n=os(n),function(e,t,n){return e>=cn(t,n)&&e=-9007199254740991&&e<=9007199254740991},Rn.isSet=Qa,Rn.isString=Ja,Rn.isSymbol=Xa,Rn.isTypedArray=Za,Rn.isUndefined=function(e){return void 0===e},Rn.isWeakMap=function(e){return za(e)&&ri(e)==S},Rn.isWeakSet=function(e){return za(e)&&"[object WeakSet]"==go(e)},Rn.join=function(e,t){return null==e?"":rn.call(e,t)},Rn.kebabCase=Fs,Rn.last=Bi,Rn.lastIndexOf=function(e,t,n){var o=null==e?0:e.length;if(!o)return-1;var r=o;return void 0!==n&&(r=(r=rs(n))<0?sn(o+r,0):cn(r,o-1)),t==t?function(e,t,n){for(var o=n+1;o--;)if(e[o]===t)return o;return o}(e,t,r):yt(e,wt,r,!0)},Rn.lowerCase=Ms,Rn.lowerFirst=Ps,Rn.lt=es,Rn.lte=ts,Rn.max=function(e){return e&&e.length?ro(e,Ws,fo):void 0},Rn.maxBy=function(e,t){return e&&e.length?ro(e,Xr(t,2),fo):void 0},Rn.mean=function(e){return Ct(e,Ws)},Rn.meanBy=function(e,t){return Ct(e,Xr(t,2))},Rn.min=function(e){return e&&e.length?ro(e,Ws,ko):void 0},Rn.minBy=function(e,t){return e&&e.length?ro(e,Xr(t,2),ko):void 0},Rn.stubArray=ic,Rn.stubFalse=ac,Rn.stubObject=function(){return{}},Rn.stubString=function(){return""},Rn.stubTrue=function(){return!0},Rn.multiply=hc,Rn.nth=function(e,t){return e&&e.length?No(e,rs(t)):void 0},Rn.noConflict=function(){return We._===this&&(We._=ke),this},Rn.noop=Xs,Rn.now=fa,Rn.pad=function(e,t,n){e=cs(e);var o=(t=rs(t))?Kt(e):0;if(!t||o>=t)return e;var r=(t-o)/2;return Fr(en(r),n)+e+Fr(Zt(r),n)},Rn.padEnd=function(e,t,n){e=cs(e);var o=(t=rs(t))?Kt(e):0;return t&&ot){var o=e;e=t,t=o}if(n||e%1||t%1){var r=un();return cn(e+r*(t-e+Ve("1e-"+((r+"").length-1))),t)}return jo(e,t)},Rn.reduce=function(e,t,n){var o=Fa(e)?gt:Ot,r=arguments.length<3;return o(e,Xr(t,4),n,r,to)},Rn.reduceRight=function(e,t,n){var o=Fa(e)?ft:Ot,r=arguments.length<3;return o(e,Xr(t,4),n,r,no)},Rn.repeat=function(e,t,n){return t=(n?li(e,t,n):void 0===t)?1:rs(t),Uo(cs(e),t)},Rn.replace=function(){var e=arguments,t=cs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Rn.result=function(e,t,n){var o=-1,r=(t=lr(t,e)).length;for(r||(r=1,e=void 0);++o9007199254740991)return[];var n=4294967295,o=cn(e,4294967295);e-=4294967295;for(var r=Rt(o,t=Xr(t));++n=i)return e;var s=n-Kt(o);if(s<1)return o;var c=a?ur(a,0,s).join(""):e.slice(0,s);if(void 0===r)return c+o;if(a&&(s+=c.length-s),$a(r)){if(e.slice(s).search(r)){var l,d=c;for(r.global||(r=ge(r.source,cs(oe.exec(r))+"g")),r.lastIndex=0;l=r.exec(d);)var u=l.index;c=c.slice(0,void 0===u?s:u)}}else if(e.indexOf(Zo(r),s)!=s){var h=c.lastIndexOf(r);h>-1&&(c=c.slice(0,h))}return c+o},Rn.unescape=function(e){return(e=cs(e))&&j.test(e)?e.replace(P,$t):e},Rn.uniqueId=function(e){var t=++Ce;return cs(e)+t},Rn.upperCase=Us,Rn.upperFirst=Bs,Rn.each=ca,Rn.eachRight=la,Rn.first=Pi,Js(Rn,(uc={},lo(Rn,(function(e,t){we.call(Rn.prototype,t)||(uc[t]=e)})),uc),{chain:!1}),Rn.VERSION="4.17.21",st(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Rn[e].placeholder=Rn})),st(["drop","take"],(function(e,t){Nn.prototype[e]=function(n){n=void 0===n?1:sn(rs(n),0);var o=this.__filtered__&&!t?new Nn(this):this.clone();return o.__filtered__?o.__takeCount__=cn(n,o.__takeCount__):o.__views__.push({size:cn(n,4294967295),type:e+(o.__dir__<0?"Right":"")}),o},Nn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),st(["filter","map","takeWhile"],(function(e,t){var n=t+1,o=1==n||3==n;Nn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Xr(e,3),type:n}),t.__filtered__=t.__filtered__||o,t}})),st(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Nn.prototype[e]=function(){return this[n](1).value()[0]}})),st(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Nn.prototype[e]=function(){return this.__filtered__?new Nn(this):this[n](1)}})),Nn.prototype.compact=function(){return this.filter(Ws)},Nn.prototype.find=function(e){return this.filter(e).head()},Nn.prototype.findLast=function(e){return this.reverse().find(e)},Nn.prototype.invokeMap=Bo((function(e,t){return"function"==typeof e?new Nn(this):this.map((function(n){return yo(n,e,t)}))})),Nn.prototype.reject=function(e){return this.filter(Ta(Xr(e)))},Nn.prototype.slice=function(e,t){e=rs(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Nn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=rs(t))<0?n.dropRight(-t):n.take(t-e)),n)},Nn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Nn.prototype.toArray=function(){return this.take(4294967295)},lo(Nn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),o=/^(?:head|last)$/.test(t),r=Rn[o?"take"+("last"==t?"Right":""):t],i=o||/^find/.test(t);r&&(Rn.prototype[t]=function(){var t=this.__wrapped__,a=o?[1]:arguments,s=t instanceof Nn,c=a[0],l=s||Fa(t),d=function(e){var t=r.apply(Rn,mt([e],a));return o&&u?t[0]:t};l&&n&&"function"==typeof c&&1!=c.length&&(s=l=!1);var u=this.__chain__,h=!!this.__actions__.length,p=i&&!u,m=s&&!h;if(!i&&l){t=m?t:new Nn(this);var g=e.apply(t,a);return g.__actions__.push({func:oa,args:[d],thisArg:void 0}),new An(g,u)}return p&&m?e.apply(this,a):(g=this.thru(d),p?o?g.value()[0]:g.value():g)})})),st(["pop","push","shift","sort","splice","unshift"],(function(e){var t=be[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);Rn.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var r=this.value();return t.apply(Fa(r)?r:[],e)}return this[n]((function(n){return t.apply(Fa(n)?n:[],e)}))}})),lo(Nn.prototype,(function(e,t){var n=Rn[t];if(n){var o=n.name+"";we.call(yn,o)||(yn[o]=[]),yn[o].push({name:t,func:n})}})),yn[Ir(void 0,2).name]=[{name:"wrapper",func:void 0}],Nn.prototype.clone=function(){var e=new Nn(this.__wrapped__);return e.__actions__=vr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=vr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=vr(this.__views__),e},Nn.prototype.reverse=function(){if(this.__filtered__){var e=new Nn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Nn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Fa(e),o=t<0,r=n?e.length:0,i=function(e,t,n){var o=-1,r=n.length;for(;++o=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Rn.prototype.plant=function(e){for(var t,n=this;n instanceof Dn;){var o=Ri(n);o.__index__=0,o.__values__=void 0,t?r.__wrapped__=o:t=o;var r=o;n=n.__wrapped__}return r.__wrapped__=e,t},Rn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Nn){var t=e;return this.__actions__.length&&(t=new Nn(this)),(t=t.reverse()).__actions__.push({func:oa,args:[Hi],thisArg:void 0}),new An(t,this.__chain__)}return this.thru(Hi)},Rn.prototype.toJSON=Rn.prototype.valueOf=Rn.prototype.value=function(){return rr(this.__wrapped__,this.__actions__)},Rn.prototype.first=Rn.prototype.head,Je&&(Rn.prototype[Je]=function(){return this}),Rn}();We._=Qt,void 0===(r=function(){return Qt}.call(t,n,t,o))||(o.exports=r)}).call(this)}).call(this,n(7),n(380)(e))},function(e,t,n){"use strict";let o;n.d(t,"a",(function(){return o})),function(e){e.AdvancedEncryption="UIFeature.advancedEncryption",e.URLPreviews="UIFeature.urlPreviews",e.Widgets="UIFeature.widgets",e.Voip="UIFeature.voip",e.Feedback="UIFeature.feedback",e.Registration="UIFeature.registration",e.PasswordReset="UIFeature.passwordReset",e.Deactivate="UIFeature.deactivate",e.ShareQRCode="UIFeature.shareQrCode",e.ShareSocial="UIFeature.shareSocial",e.IdentityServer="UIFeature.identityServer",e.ThirdPartyID="UIFeature.thirdPartyId",e.Flair="UIFeature.flair",e.Communities="UIFeature.communities",e.AdvancedSettings="UIFeature.advancedSettings",e.RoomHistorySettings="UIFeature.roomHistorySettings"}(o||(o={}))},function(e,t,n){"use strict";var o=n(18),r=n.n(o);class i{constructor(){r()(this,"platform",null)}get(){return this.platform}set(e){this.platform=e}}window.mxPlatformPeg||(window.mxPlatformPeg=new i),t.a=window.mxPlatformPeg},function(e,t,n){"use strict";n.d(t,"a",(function(){return w}));var o=n(104),r=n.n(o),i=n(18),a=n.n(i),s=n(176),c=n(88),l=n(113),d=n(98),u=n(92),h=n(140),p=n(129),m=n(100),g=n(322);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _(e){for(var t=1;t{const t=(new b).encode(e),n=await window.crypto.subtle.digest("sha-256",t);return[...new Uint8Array(n)].map(e=>e.toString(16).padStart(2,"0")).join("")},E=new Set(["register","login","forgot_password","soft_logout","new","settings","welcome","home","start","directory","start_sso","start_cas","groups","complete_security","post_registration","room","user","group"]);const S=e=>{var t,n;const o=u.a.get(),r=null==o?void 0:o.getRoom(e);return{num_users:null==r?void 0:r.getJoinedMemberCount(),is_encrypted:null==o?void 0:o.isRoomEncrypted(e),is_public:"public"===(null==r||null===(t=r.currentState.getStateEvents("m.room.join_rules",""))||void 0===t||null===(n=t.getContent())||void 0===n?void 0:n.join_rule)}};class w{constructor(){a()(this,"baseUrl",null),a()(this,"appKey",null),a()(this,"userKey",null),a()(this,"anonymous",void 0),a()(this,"appPlatform",void 0),a()(this,"appVersion","unknown"),a()(this,"initTime",w.getTimestamp()),a()(this,"firstPage",!0),a()(this,"heartbeatIntervalId",void 0),a()(this,"activityIntervalId",void 0),a()(this,"trackTime",!0),a()(this,"lastBeat",void 0),a()(this,"storedDuration",0),a()(this,"lastView",void 0),a()(this,"lastViewTime",0),a()(this,"lastViewStoredDuration",0),a()(this,"sessionStarted",!1),a()(this,"heartbeatEnabled",!1),a()(this,"inactivityCounter",0),a()(this,"pendingEvents",[]),a()(this,"lastMsTs",0),a()(this,"getOrientation",()=>window.matchMedia("(orientation: landscape)").matches?v.Landscape:v.Portrait),a()(this,"reportOrientation",()=>{this.track("[CLY]_orientation",{mode:this.getOrientation()})}),a()(this,"endSession",()=>{this.sessionStarted&&(window.removeEventListener("resize",this.reportOrientation),this.reportViewDuration(),this.request({end_session:1,session_duration:w.getTimestamp()-this.lastBeat})),this.sessionStarted=!1}),a()(this,"onVisibilityChange",()=>{document.hidden?this.stopTime():this.startTime()}),a()(this,"onUserActivity",()=>{this.inactivityCounter>=20&&this.startTime(),this.inactivityCounter=0})}static get instance(){return w.internalInstance}get disabled(){return!this.baseUrl}canEnable(){var e,t;const n=d.a.get();return Boolean("1"!==navigator.doNotTrack&&(null==n||null===(e=n.countly)||void 0===e?void 0:e.url)&&(null==n||null===(t=n.countly)||void 0===t?void 0:t.appKey))}async changeUserKey(e,t=!1){const n=this.userKey;this.userKey=e,n&&t&&await this.request({old_device_id:n})}async enable(e=!0){if(!this.disabled&&this.anonymous===e)return;if(!this.canEnable())return;this.disabled||this.request();const t=d.a.get();this.baseUrl=new URL("/i",t.countly.url),this.appKey=t.countly.appKey,this.anonymous=e,e?await this.changeUserKey(Object(s.b)(64)):await this.changeUserKey(await y(u.a.get().getUserId()),!0);const n=l.a.get();this.appPlatform=n.getHumanReadableName();try{this.appVersion=await n.getAppVersion()}catch(e){console.warn("Failed to get app version, using 'unknown'")}this.heartbeatIntervalId=setInterval(this.heartbeat.bind(this),5e3),this.trackSessions(),this.trackErrors()}async disable(){this.disabled||(await this.track("Opt-Out"),this.endSession(),window.clearInterval(this.heartbeatIntervalId),window.clearTimeout(this.activityIntervalId),this.baseUrl=null,window.removeEventListener("beforeunload",this.endSession),window.removeEventListener("unload",this.endSession),window.removeEventListener("visibilitychange",this.onVisibilityChange),window.removeEventListener("mousemove",this.onUserActivity),window.removeEventListener("click",this.onUserActivity),window.removeEventListener("keydown",this.onUserActivity),window.removeEventListener("scroll",this.onUserActivity))}reportFeedback(e,t){this.track("[CLY]_star_rating",{rating:e,comment:t},null,{},!0)}trackPageChange(e){this.disabled||this.trackPageView()}async trackPageView(){this.reportViewDuration(),await Object(h.c)(0);const e=await async function(e=!0){const t=Object(s.b)(8),{origin:n,hash:o}=window.location;let{pathname:r}=window.location;n.startsWith("file://")&&(r=`//`);let[i,a,...c]=o.split("/");E.has(a)||(a=``);for(let n=0;n`:await y(c[n]);const l=n+r+`${i}/${a}/${c.join("/")}`,d={};let u="$/"+o;switch(a){case"room":{u="view_room";const e=p.a.getRoomId();u+=" "+c[0],d.room_id=c[0],Object.assign(d,S(e));break}}return{name:u,url:l,meta:d}}(this.anonymous),t=e.name;this.lastView=t,this.lastViewTime=w.getTimestamp();const n=_(_({},e.meta),{},{name:t,visit:1,domain:window.location.hostname,view:e.url,segment:this.appPlatform,start:this.firstPage});this.firstPage&&(this.firstPage=!1),this.track("[CLY]_view",n)}static getTimestamp(){return Math.floor((new Date).getTime()/1e3)}getMsTimestamp(){const e=(new Date).getTime();return this.lastMsTs>=e?this.lastMsTs++:this.lastMsTs=e,this.lastMsTs}async recordError(e,t=!1){if(this.disabled||this.anonymous)return;let n="";"object"==typeof e?void 0!==e.stack?n=e.stack:(void 0!==e.name&&(n+=e.name+":"),void 0!==e.message&&(n+=e.message+"\n"),void 0!==e.fileName&&(n+="in "+e.fileName+"\n"),void 0!==e.lineNumber&&(n+="on "+e.lineNumber),void 0!==e.columnNumber&&(n+=":"+e.columnNumber)):n=e+"",n=await(async(e,t,n)=>{const o=[];e.replace(t,(...e)=>(o.push(n(...e)),""));const r=await Promise.all(o);return e.replace(t,()=>r.shift())})(n,/([!@+#]).+?:[\w:.]+/g,async(e,t)=>t+await y(e.substring(1)));const o=this.getMetrics(),r={_resolution:null==o?void 0:o._resolution,_error:n,_app_version:this.appVersion,_run:w.getTimestamp()-this.initTime,_nonfatal:!t,_view:this.lastView};void 0!==navigator.onLine&&(r._online=navigator.onLine),r._background=document.hasFocus(),this.request({crash:JSON.stringify(r)})}trackErrors(){window.onerror=(e,t,n,o,r)=>{if(void 0!==r)this.recordError(r,!1);else{let r="";void 0!==e&&(r+=e+"\n"),void 0!==t&&(r+="at "+t),void 0!==n&&(r+=":"+n),void 0!==o&&(r+=":"+o),r+="\n";try{const e=[];let t=arguments.callee.caller;for(;t;)e.push(t.name),t=t.caller;r+=e.join("\n")}catch(e){}this.recordError(r,!1)}},window.addEventListener("unhandledrejection",e=>{var t;this.recordError(new Error(`Unhandled rejection (reason: ${(null===(t=e.reason)||void 0===t?void 0:t.stack)||e.reason}).`),!0)})}heartbeat(){const e={};if(this.sessionStarted&&this.trackTime){const t=w.getTimestamp();t-this.lastBeat>=60&&(e.session_duration=t-this.lastBeat,this.lastBeat=t)}(this.pendingEvents.length>0||e.session_duration)&&this.request(e)}async request(e={}){const t=_(_({app_key:this.appKey,device_id:this.userKey},this.getTimeParams()),e);if(this.pendingEvents.length>0){const e=10,n=this.pendingEvents.splice(0,e);t.events=JSON.stringify(n)}const n=new URLSearchParams(t);try{await window.fetch(this.baseUrl.toString(),{method:"POST",mode:"no-cors",cache:"no-cache",redirect:"follow",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n})}catch(e){console.error("Analytics error: ",e)}}getTimeParams(){const e=new Date;return{timestamp:this.getMsTimestamp(),hour:e.getHours(),dow:e.getDay()}}queue(e){const{count:t=1}=e,n=r()(e,["count"]),o=_(_(_({},this.getTimeParams()),n),{},{count:t,platform:this.appPlatform,app_version:this.appVersion});this.pendingEvents.push(o),this.pendingEvents.length>1e3&&this.pendingEvents.shift()}startTime(){this.trackTime||(this.trackTime=!0,this.lastBeat=w.getTimestamp()-this.storedDuration,this.lastViewTime=w.getTimestamp()-this.lastViewStoredDuration,this.lastViewStoredDuration=0)}stopTime(){this.trackTime&&(this.trackTime=!1,this.storedDuration=w.getTimestamp()-this.lastBeat,this.lastViewStoredDuration=w.getTimestamp()-this.lastViewTime)}getMetrics(){if(this.anonymous)return;const e={};return e._app_version=this.appVersion,e._ua=navigator.userAgent,screen.width&&screen.height&&(e._resolution=`${screen.width}x${screen.height}`),window.devicePixelRatio&&(e._density=window.devicePixelRatio),e._locale=Object(c.d)(),e}async beginSession(e=!0){if(!this.sessionStarted){this.reportOrientation(),window.addEventListener("resize",this.reportOrientation),this.lastBeat=w.getTimestamp(),this.sessionStarted=!0,this.heartbeatEnabled=e;const t={custom:{home_server:u.a.get()&&u.a.getHomeserverName(),anonymous:this.anonymous}},n={begin_session:1,user_details:JSON.stringify(t)},o=this.getMetrics();o&&(n.metrics=JSON.stringify(o)),await this.request(n)}}reportViewDuration(){this.lastView&&(this.track("[CLY]_view",{name:this.lastView},null,{dur:this.trackTime?w.getTimestamp()-this.lastViewTime:this.lastViewStoredDuration}),this.lastView=null)}trackSessions(){this.beginSession(),this.startTime(),window.addEventListener("beforeunload",this.endSession),window.addEventListener("unload",this.endSession),window.addEventListener("visibilitychange",this.onVisibilityChange),window.addEventListener("mousemove",this.onUserActivity),window.addEventListener("click",this.onUserActivity),window.addEventListener("keydown",this.onUserActivity),window.addEventListener("scroll",this.onUserActivity),this.activityIntervalId=setInterval(()=>{this.inactivityCounter++,this.inactivityCounter>=20&&this.stopTime()},6e4)}trackBeginInvite(e){this.track("begin_invite",{},e)}trackSendInvite(e,t,n){this.track("send_invite",{},t,{dur:w.getTimestamp()-e,sum:n})}async trackRoomCreate(e,t){if(this.disabled)return;let n=w.getTimestamp();const o=u.a.get();o.getRoom(t)||(await new Promise(e=>{const n=r=>{r.roomId===t&&(o.off("Room",n),e())};o.on("Room",n)}),n=w.getTimestamp()),this.track("create_room",{},t,{dur:n-e})}trackRoomJoin(e,t,n){this.track(m.a.JoinRoom,{type:n},t,{dur:w.getTimestamp()-e})}async trackSendMessage(e,t,n,o,r,i){if(this.disabled)return;const a=u.a.get().getRoom(n),s=(await t).event_id;let c=w.getTimestamp();a.findEventById(s)||(await new Promise(e=>{const t=n=>{n.getId()===s&&(a.off("Room.localEchoUpdated",t),e())};a.on("Room.localEchoUpdated",t)}),c=w.getTimestamp()),this.track("send_message",{is_edit:o,is_reply:r,msgtype:i.msgtype,format:i.format},n,{dur:c-e})}trackStartCall(e,t=!1,n=!1){this.track("start_call",{is_video:t,is_jitsi:n},e)}trackJoinCall(e,t=!1,n=!1){this.track("join_call",{is_video:t,is_jitsi:n},e)}trackRoomDirectoryBegin(){this.track("room_directory")}trackRoomDirectory(e){this.track("room_directory_done",{},null,{dur:w.getTimestamp()-e})}trackRoomDirectorySearch(e,t){this.track("room_directory_search",{query_length:t.length,query_num_words:t.split(" ").length},null,{sum:e})}async track(e,t,n,o,r=!1){if(this.disabled&&!r)return;let i=t||{};n&&(i=_(_({room_id:await y(n)},S(n)),t)),this.queue(_({key:e,count:1,segmentation:i},o)),this.disabled&&r&&await this.request({device_id:Object(s.b)(64)})}}a()(w,"internalInstance",new w),window.mxCountlyAnalytics=w},function(e,t,n){"use strict";n.d(t,"a",(function(){return g})),n.d(t,"e",(function(){return f})),n.d(t,"h",(function(){return _})),n.d(t,"g",(function(){return b})),n.d(t,"f",(function(){return v})),n.d(t,"d",(function(){return y})),n.d(t,"k",(function(){return E})),n.d(t,"l",(function(){return S})),n.d(t,"c",(function(){return w})),n.d(t,"j",(function(){return T})),n.d(t,"i",(function(){return x})),n.d(t,"b",(function(){return D}));var o=n(18),r=n.n(o),i=n(948),a=n.n(i),s=n(1),c=n(110),l=n(92),d=n(574),u=n(575);class h extends u.b{constructor(e){if(super(),r()(this,"elementUrl",void 0),this.elementUrl=e,!this.elementUrl.startsWith("http:")&&!this.elementUrl.startsWith("https:"))throw new Error("Element prefix URL does not appear to be an HTTP(S) URL")}forEvent(e,t,n){return`${this.elementUrl}/#/room/${e}/${t}${this.encodeServerCandidates(n)}`}forRoom(e,t){return`${this.elementUrl}/#/room/${e}${this.encodeServerCandidates(t)}`}forUser(e){return`${this.elementUrl}/#/user/${e}`}forGroup(e){return`${this.elementUrl}/#/group/${e}`}forEntity(e){if("!"===e[0]||"#"===e[0])return this.forRoom(e);if("@"===e[0])return this.forUser(e);if("+"===e[0])return this.forGroup(e);throw new Error("Unrecognized entity")}isPermalinkHost(e){const t=new URL(this.elementUrl);return e===(t.host||t.hostname)}encodeServerCandidates(e){return e&&0!==e.length?"?via="+e.map(e=>encodeURIComponent(e)).join("&via="):""}parsePermalink(e){if(!e||!e.startsWith(this.elementUrl))throw new Error("Does not appear to be a permalink");const t=e.substring((this.elementUrl+"/#/").length);return h.parseAppRoute(t)}static parseAppRoute(e){const t=e.split("/");if(t.length<2)throw new Error("URL is missing parts");const[n]=t.splice(-1,1),[o,r=""]=n.split("?");t.push(o);const i=t[0],a=t[1];if("user"===i)return u.a.forUser(a);if("group"===i)return u.a.forGroup(a);if("room"===i){const e=t.length>2?t.slice(2).join("/"):"",n=r.split(/&?via=/).filter(e=>!!e);return u.a.forEvent(a,e,n)}throw new Error("Unknown entity type in permalink")}}var p=n(412),m=n(98);class g{constructor(e,t=null){if(r()(this,"room",void 0),r()(this,"roomId",void 0),r()(this,"highestPlUserId",void 0),r()(this,"populationMap",void 0),r()(this,"bannedHostsRegexps",void 0),r()(this,"allowedHostsRegexps",void 0),r()(this,"_serverCandidates",void 0),r()(this,"started",void 0),r()(this,"onRoomState",e=>{switch(e.getType()){case c.a.RoomServerAcl:return this.updateAllowedServers(),this.updateHighestPlUser(),this.updatePopulationMap(),void this.updateServerCandidates();case c.a.RoomPowerLevels:return this.updateHighestPlUser(),void this.updateServerCandidates()}}),r()(this,"onMembership",(e,t,n)=>{const o=t.userId,r=t.membership,i=O(o),a="join"!==n&&"join"===r;"join"===n&&"join"!==r?this.populationMap[i]--:a&&this.populationMap[i]++,this.updateHighestPlUser(),this.updateServerCandidates()}),this.room=e,this.roomId=e?e.roomId:t,this.highestPlUserId=null,this.populationMap=null,this.bannedHostsRegexps=null,this.allowedHostsRegexps=null,this._serverCandidates=null,this.started=!1,!this.roomId)throw new Error("Failed to resolve a roomId for the permalink creator to use")}load(){this.room&&this.room.currentState?(this.updateAllowedServers(),this.updateHighestPlUser(),this.updatePopulationMap(),this.updateServerCandidates()):console.warn("Tried to load a permalink creator with no room state")}start(){this.load(),this.room.on("RoomMember.membership",this.onMembership),this.room.on("RoomState.events",this.onRoomState),this.started=!0}stop(){this.room.removeListener("RoomMember.membership",this.onMembership),this.room.removeListener("RoomState.events",this.onRoomState),this.started=!1}get serverCandidates(){return this._serverCandidates}isStarted(){return this.started}forEvent(e){return C().forEvent(this.roomId,e,this._serverCandidates)}forShareableRoom(){if(this.room){const e=this.room.getCanonicalAlias();if(e)return C().forRoom(e,this._serverCandidates)}return C().forRoom(this.roomId,this._serverCandidates)}forRoom(){return C().forRoom(this.roomId,this._serverCandidates)}updateHighestPlUser(){const e=this.room.currentState.getStateEvents("m.room.power_levels","");if(e){const t=e.getContent();if(t){const e=t.users;if(e){const t=Object.entries(e).filter(([e])=>{const t=this.room.getMember(e);if(!t||"join"!==t.membership)return!1;const n=O(e);return!I(n)&&!R(n,this.bannedHostsRegexps)&&R(n,this.allowedHostsRegexps)}).reduce((e,t)=>t[1]>e[1]?t:e,[null,0]),[n,o]=t;if(null!==n&&o>=50)return void(this.highestPlUserId=n)}}}this.highestPlUserId=null}updateAllowedServers(){const e=[];let t=[new RegExp(".*")];if(this.room.currentState){const n=this.room.currentState.getStateEvents("m.room.server_acl","");if(n&&n.getContent()){const o=e=>new RegExp("^"+s.l(e,!1)+"$");(n.getContent().deny||[]).forEach(t=>e.push(o(t)));const r=n.getContent().allow||[];t=[],r.forEach(e=>t.push(o(e)))}}this.bannedHostsRegexps=e,this.allowedHostsRegexps=t}updatePopulationMap(){const e={};for(const t of this.room.getJoinedMembers()){const n=O(t.userId);e[n]||(e[n]=0),e[n]++}this.populationMap=e}updateServerCandidates(){let e=[];this.highestPlUserId&&e.push(O(this.highestPlUserId));const t=Object.keys(this.populationMap).sort((e,t)=>this.populationMap[t]-this.populationMap[e]).filter(t=>!e.includes(t)&&!I(t)&&!R(t,this.bannedHostsRegexps)&&R(t,this.allowedHostsRegexps)).slice(0,3-e.length);e=e.concat(t),this._serverCandidates=e}}function f(e){return C().forEntity(e)}function _(e){return C().forUser(e)}function b(e){if(!e)throw new Error("can't permalink a falsey roomId");if("!"!==e[0])return C().forRoom(e,[]);const t=l.a.get().getRoom(e);if(!t)return C().forRoom(e,[]);const n=new g(t);return n.load(),n.forRoom()}function v(e){return C().forGroup(e)}function y(e){return!!(new d.b).isPermalinkHost(e)||C().isPermalinkHost(e)}function E(e){return e?"#"===e[0]||"!"===e[0]?b(e):"@"===e[0]?_(e):"+"===e[0]?v(e):S(e):null}function S(e){if(!e.startsWith("http:")&&!e.startsWith("https:"))return e;try{const t=decodeURIComponent(e).match(p.a.ELEMENT_URL_PATTERN);if(t)return t[1]}catch(t){return e}try{const t=T(e);if(t)if(t.roomIdOrAlias){const n=t.eventId?"/"+t.eventId:"";e=`#/room/${t.roomIdOrAlias}${n}`,t.viaServers.length>0&&(e+=(new d.b).encodeServerCandidates(t.viaServers))}else t.groupId?e="#/group/"+t.groupId:t.userId&&(e="#/user/"+t.userId)}catch(e){}return e}function w(e){try{let t=T(e);if(!t){const n=e.match(p.a.ELEMENT_URL_PATTERN);if(n){const e=new h("http://localhost"),o=n[1].split("#").slice(1).join("#");t=e.parsePermalink("http://localhost/#"+o)}}if(!t)return null;if(t.userId)return t.userId;if(t.groupId)return t.groupId;if(t.roomIdOrAlias)return t.roomIdOrAlias}catch(e){}return null}function C(){const e=m.a.get().permalinkPrefix;return e&&e!==d.a?new h(e):new d.b}function T(e){const t=m.a.get().permalinkPrefix;return decodeURIComponent(e).startsWith(d.a)?(new d.b).parsePermalink(decodeURIComponent(e)):t&&e.startsWith(t)?new h(t).parsePermalink(e):null}function x(e){try{const t=e.replace("#/","");return h.parseAppRoute(t)}catch(e){}return null}function O(e){return e.split(":").splice(1).join(":")}function k(e){return e?new URL("https://"+e).hostname:null}function R(e,t){if(!(e=k(e)))return!0;if(t.length>0&&!t[0].test)throw new Error(t[0].toString());return t.filter(t=>t.test(e)).length>0}function I(e){return!!(e=k(e))&&(e.startsWith("[")&&e.endsWith("]")&&(e=e.substring(1,e.length-1)),a()(e))}const D=e=>{const t=new g(e);return t.load(),t.serverCandidates}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var o=n(18),r=n.n(o),i=n(8),a=n(524),s=n.n(a);const c="update";class l extends i.EventEmitter{constructor(e,t={}){super(),this.dispatcher=e,r()(this,"storeState",void 0),r()(this,"lock",new s.a),r()(this,"dispatcherRef",void 0),this.dispatcherRef=e.register(this.onDispatch.bind(this)),this.storeState=t}get state(){return this.storeState}stop(){this.dispatcherRef&&this.dispatcher.unregister(this.dispatcherRef)}async updateState(e){await this.lock.acquireAsync();try{this.storeState=Object.freeze(Object.assign({},this.storeState,e)),this.emit(c,this)}finally{await this.lock.release()}}async reset(e=null,t=!1){await this.lock.acquireAsync();try{this.storeState=Object.freeze(e||{}),t||this.emit(c,this)}finally{await this.lock.release()}}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"i",(function(){return i})),n.d(t,"g",(function(){return a})),n.d(t,"h",(function(){return s})),n.d(t,"j",(function(){return c})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return u})),n.d(t,"a",(function(){return h})),n.d(t,"k",(function(){return p})),n.d(t,"f",(function(){return m}));var o=n(9);function r(e,t){if(e.length===t)return e;const n=[];if(e.length>t){const o=Math.round(e.length/t);for(let t=0;tt){for(;n.length>2*t||0===n.length;){n=[];for(let t=1;tObject(o.d)(Object(o.c)(e,r,i),t,n))}function s(e,t){const n=[];for(let o=0;ot?e.slice(0,t):e.concat(n.slice(0,t-e.length))}function l(e){return e.slice(0,e.length)}function d(e,t){if(e.length===t.length){for(let n=0;n!e.includes(t))||!!e.some(e=>!t.includes(e)))}function h(e,t){return{added:t.filter(t=>!e.includes(t)),removed:e.filter(e=>!t.includes(e))}}function p(e,t){return e.filter(e=>t.includes(e))}function m(...e){return Array.from(e.reduce((e,t)=>(t.forEach(t=>e.add(t)),e),new Set))}},function(e,t,n){"use strict";var o=n(87),r=n.n(o),i=n(91),a=n.n(i),s=n(88);const c=({w:e=32,h:t=32,message:n})=>r.a.createElement("div",{className:"mx_Spinner"},n&&r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{className:"mx_Spinner_Msg"},n)," "),r.a.createElement("div",{className:"mx_Spinner_icon",style:{width:e,height:t},"aria-label":Object(s.a)("Loading...")}));c.propTypes={w:a.a.number,h:a.a.number,message:a.a.node},t.a=c},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return S}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(446),u=n.n(d),h=n(91),p=n.n(h),m=n(97),g=n.n(m),f=n(106),_=n(96),b=n(92),v=n(88),y=n(101),E=n(89);let S=Object(E.a)("views.dialogs.BaseDialog")((i=r=class extends l.a.Component{constructor(e){super(e),s()(this,"_onKeyDown",e=>{this.props.onKeyDown&&this.props.onKeyDown(e),this.props.hasCancel&&e.key===f.a.ESCAPE&&(e.stopPropagation(),e.preventDefault(),this.props.onFinished(!1))}),s()(this,"_onCancelClick",e=>{this.props.onFinished(!1)}),this._matrixClient=b.a.get()}render(){let e,t;return this.props.hasCancel&&(e=l.a.createElement(_.a,{onClick:this._onCancelClick,className:"mx_Dialog_cancelButton","aria-label":Object(v.a)("Close dialog")})),this.props.headerImage&&(t=l.a.createElement("img",{className:"mx_Dialog_titleImage",src:this.props.headerImage,alt:""})),l.a.createElement(y.a.Provider,{value:this._matrixClient},l.a.createElement(u.a,{returnFocus:!0,lockProps:{onKeyDown:this._onKeyDown,role:"dialog","aria-labelledby":"mx_BaseDialog_title","aria-describedby":this.props.contentId},className:g()({[this.props.className]:!0,mx_Dialog_fixedWidth:this.props.fixedWidth})},l.a.createElement("div",{className:g()("mx_Dialog_header",{mx_Dialog_headerWithButton:!!this.props.headerButton,mx_Dialog_headerWithCancel:!!e})},l.a.createElement("div",{className:g()("mx_Dialog_title",this.props.titleClass),id:"mx_BaseDialog_title"},t,this.props.title),this.props.headerButton,e),this.props.children))}},s()(r,"propTypes",{onFinished:p.a.func.isRequired,hasCancel:p.a.bool,onKeyDown:p.a.func,className:p.a.string,fixedWidth:p.a.bool,title:p.a.node.isRequired,headerImage:p.a.string,children:p.a.node,contentId:p.a.string,titleClass:p.a.oneOfType([p.a.string,p.a.object,p.a.arrayOf(p.a.string)])}),s()(r,"defaultProps",{hasCancel:!0,fixedWidth:!0}),o=i))||o},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(87),r=n.n(o);class i extends r.a.Component{constructor(e){super(e),this._collectContainerRef=this._collectContainerRef.bind(this)}_collectContainerRef(e){e&&!this.containerRef&&(this.containerRef=e),this.props.wrappedRef&&this.props.wrappedRef(e)}getScrollTop(){return this.containerRef.scrollTop}render(){return r.a.createElement("div",{ref:this._collectContainerRef,style:this.props.style,className:["mx_AutoHideScrollbar",this.props.className].join(" "),onScroll:this.props.onScroll,onWheel:this.props.onWheel,tabIndex:this.props.tabIndex},this.props.children)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(18),r=n.n(o),i=n(92),a=n(111);class s{constructor(e){r()(this,"matrixClient",void 0),r()(this,"roomToUser",null),r()(this,"userToRooms",null),r()(this,"hasSentOutPatchDirectAccountDataPatch",void 0),r()(this,"mDirectEvent",void 0),r()(this,"onAccountData",e=>{"m.direct"==e.getType()&&(this.mDirectEvent=this.matrixClient.getAccountData("m.direct").getContent()||{},this.userToRooms=null,this.roomToUser=null)}),this.matrixClient=e,this.hasSentOutPatchDirectAccountDataPatch=!1;const t=e.getAccountData("m.direct");this.mDirectEvent=t?t.getContent():{}}static makeShared(){return s.sharedInstance=new s(i.a.get()),s.sharedInstance}static setShared(e){s.sharedInstance=e}static shared(){return s.sharedInstance}start(){this.populateRoomToUser(),this.matrixClient.on("accountData",this.onAccountData)}stop(){this.matrixClient.removeListener("accountData",this.onAccountData)}patchUpSelfDMs(e){const t=this.matrixClient.getUserId(),n=e[t];if(n){const o=n.map(e=>{const n=this.matrixClient.getRoom(e);if(n){const o=n.guessDMUserId();if(o&&o!==t)return{userId:o,roomId:e}}}).filter(e=>!!e);return!!o.length&&(e[t]=n.filter(e=>!o.some(t=>t.roomId===e)),o.forEach(({userId:t,roomId:n})=>{const o=e[t];o?(o.push(n),e[t]=Object(a.uniq)(o)):e[t]=[n]}),!0)}}getDMRoomsForUserId(e){return this.getUserToRooms()[e]||[]}getDMRoomForIdentifiers(e){let t=this.getDMRoomsForUserId(e[0]);for(let n=1;no.includes(e))}return t.map(e=>i.a.get().getRoom(e)).filter(e=>e&&"join"===e.getMyMembership())[0]}getUserIdForRoomId(e){if(null==this.roomToUser&&this.populateRoomToUser(),void 0===this.roomToUser[e]){const t=this.matrixClient.getRoom(e);if(t)return t.getDMInviter()}return this.roomToUser[e]}getUniqueRoomsWithIndividuals(){return this.roomToUser?Object.keys(this.roomToUser).map(e=>({userId:this.getUserIdForRoomId(e),room:this.matrixClient.getRoom(e)})).filter(e=>e.userId&&e.room&&2===e.room.getInvitedAndJoinedMemberCount()).reduce((e,t)=>(e[t.userId]=t.room)&&e,{}):{}}getUserToRooms(){if(!this.userToRooms){const e=this.mDirectEvent,t=e[this.matrixClient.getUserId()];if(t&&t.length){const t=this.patchUpSelfDMs(e);console.warn("Invalid m.direct account data detected (self-chats that shouldn't be), patching it up."),t&&!this.hasSentOutPatchDirectAccountDataPatch&&(this.hasSentOutPatchDirectAccountDataPatch=!0,this.matrixClient.setAccountData("m.direct",e))}this.userToRooms=e}return this.userToRooms}populateRoomToUser(){this.roomToUser={};for(const e of Object.keys(this.getUserToRooms()))for(const t of this.userToRooms[e])this.roomToUser[t]=e}}r()(s,"sharedInstance",void 0)},function(e,t,n){"use strict";var o=n(18),r=n.n(o),i=n(8),a=n.n(i),s=n(323),c=n(160),l=n(92),d=n(93);function u(e){return e.chunk.map(e=>Object(s.c)(e))}function h(e){return e.chunk.map(e=>Object(s.d)(e))}let p=0;const m=[];async function g(e){p>=3&&await new Promise((e,t)=>{m.push(e)}),p++;try{return await e()}catch(e){throw e}finally{p--,function(){const e=m.shift();"function"==typeof e&&e()}()}}class f extends a.a{constructor(){super(),r()(this,"STATE_KEY",{GroupMembers:"GroupMembers",GroupInvitedMembers:"GroupInvitedMembers",Summary:"Summary",GroupRooms:"GroupRooms"}),this._state={},this._state[this.STATE_KEY.Summary]={},this._state[this.STATE_KEY.GroupRooms]={},this._state[this.STATE_KEY.GroupMembers]={},this._state[this.STATE_KEY.GroupInvitedMembers]={},this._ready={},this._ready[this.STATE_KEY.Summary]={},this._ready[this.STATE_KEY.GroupRooms]={},this._ready[this.STATE_KEY.GroupMembers]={},this._ready[this.STATE_KEY.GroupInvitedMembers]={},this._fetchResourcePromise={[this.STATE_KEY.Summary]:{},[this.STATE_KEY.GroupRooms]:{},[this.STATE_KEY.GroupMembers]:{},[this.STATE_KEY.GroupInvitedMembers]:{}},this._resourceFetcher={[this.STATE_KEY.Summary]:e=>g(()=>l.a.get().getGroupSummary(e)),[this.STATE_KEY.GroupRooms]:e=>g(()=>l.a.get().getGroupRooms(e).then(h)),[this.STATE_KEY.GroupMembers]:e=>g(()=>l.a.get().getGroupUsers(e).then(u)),[this.STATE_KEY.GroupInvitedMembers]:e=>g(()=>l.a.get().getGroupInvitedUsers(e).then(u))}}_fetchResource(e,t){if(this._fetchResourcePromise[e][t])return;const n=this._resourceFetcher[e](t);return this._fetchResourcePromise[e][t]=n,n.then(n=>{this._state[e][t]=n,this._ready[e][t]=!0,this._notifyListeners()}).catch(n=>{e===this.STATE_KEY.GroupInvitedMembers&&403===n.httpStatus||(console.error(`Failed to get resource ${e} for ${t}`,n),this.emit("error",n,t,e))}).finally(()=>{delete this._fetchResourcePromise[e][t]}),n}_notifyListeners(){this.emit("update")}registerListener(e,t){return this.on("update",t),this.emit("update"),e&&(this._fetchResource(this.STATE_KEY.Summary,e),this._fetchResource(this.STATE_KEY.GroupRooms,e),this._fetchResource(this.STATE_KEY.GroupMembers,e),this._fetchResource(this.STATE_KEY.GroupInvitedMembers,e)),{unregister:()=>{this.unregisterListener(t)}}}unregisterListener(e){this.removeListener("update",e)}isStateReady(e,t){return this._ready[t][e]}getGroupIdsForRoomId(e){return Object.keys(this._state[this.STATE_KEY.GroupRooms]).filter(t=>(this._state[this.STATE_KEY.GroupRooms][t]||[]).some(t=>t.roomId===e))}getSummary(e){return this._state[this.STATE_KEY.Summary][e]||{}}getGroupRooms(e){return this._state[this.STATE_KEY.GroupRooms][e]||[]}getGroupMembers(e){return this._state[this.STATE_KEY.GroupMembers][e]||[]}getGroupInvitedMembers(e){return this._state[this.STATE_KEY.GroupInvitedMembers][e]||[]}getGroupPublicity(e){return(this._state[this.STATE_KEY.Summary][e]||{}).user?(this._state[this.STATE_KEY.Summary][e]||{}).user.is_publicised:null}isUserPrivileged(e){return(this._state[this.STATE_KEY.Summary][e]||{}).user?(this._state[this.STATE_KEY.Summary][e]||{}).user.is_privileged:null}refreshGroupRooms(e){return this._fetchResource(this.STATE_KEY.GroupRooms,e)}refreshGroupMembers(e){return this._fetchResource(this.STATE_KEY.GroupMembers,e)}addRoomToGroup(e,t,n){return l.a.get().addRoomToGroup(e,t,n).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e))}updateGroupRoomVisibility(e,t,n){return l.a.get().updateGroupRoomVisibility(e,t,n).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e))}removeRoomFromGroup(e,t){return l.a.get().removeRoomFromGroup(e,t).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e))}inviteUserToGroup(e,t){return l.a.get().inviteUserToGroup(e,t).then(this._fetchResource.bind(this,this.STATE_KEY.GroupInvitedMembers,e))}acceptGroupInvite(e){return l.a.get().acceptGroupInvite(e).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupMembers,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupInvitedMembers,e))}joinGroup(e){return l.a.get().joinGroup(e).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupMembers,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupInvitedMembers,e))}leaveGroup(e){return d.a.dispatch({action:"deselect_tags",tag:e}),l.a.get().leaveGroup(e).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupRooms,e)).then(this._fetchResource.bind(this,this.STATE_KEY.GroupMembers,e))}addRoomToGroupSummary(e,t,n){return l.a.get().addRoomToGroupSummary(e,t,n).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}addUserToGroupSummary(e,t,n){return l.a.get().addUserToGroupSummary(e,t,n).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}removeRoomFromGroupSummary(e,t){return l.a.get().removeRoomFromGroupSummary(e,t).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}removeUserFromGroupSummary(e,t){return l.a.get().removeUserFromGroupSummary(e,t).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}setGroupPublicity(e,t){return l.a.get().setGroupPublicity(e,t).then(()=>{c.a.invalidatePublicisedGroups(l.a.get().credentials.userId)}).then(this._fetchResource.bind(this,this.STATE_KEY.Summary,e))}}let _=null;_||(_=new f),t.a=_},function(e,t,n){"use strict";let o;n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),function(e){e.RoomMemberList="RoomMemberList",e.FilePanel="FilePanel",e.NotificationPanel="NotificationPanel",e.RoomMemberInfo="RoomMemberInfo",e.EncryptionPanel="EncryptionPanel",e.RoomSummary="RoomSummary",e.Widget="Widget",e.Room3pidMemberInfo="Room3pidMemberInfo",e.GroupMemberList="GroupMemberList",e.GroupRoomList="GroupRoomList",e.GroupRoomInfo="GroupRoomInfo",e.GroupMemberInfo="GroupMemberInfo",e.SpaceMemberList="SpaceMemberList",e.SpaceMemberInfo="SpaceMemberInfo",e.Space3pidMemberInfo="Space3pidMemberInfo"}(o||(o={}));const r=[o.RoomSummary,o.NotificationPanel,o.FilePanel,o.RoomMemberList,o.GroupMemberList,o.GroupRoomList],i=[o.SpaceMemberList,o.Space3pidMemberInfo,o.SpaceMemberInfo]},function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var o,r,i,a=n(99),s=n.n(a),c=n(104),l=n.n(c),d=n(18),u=n.n(d),h=n(87),p=n.n(h),m=n(153),g=n(511),f=n(92),_=n(95),b=n(214),v=n(89),y=n(103);let E=Object(v.a)("views.avatars.RoomAvatar")((i=r=class e extends p.a.Component{constructor(t){super(t),u()(this,"onRoomStateEvents",t=>{this.props.room&&t.getRoomId()===this.props.room.roomId&&"m.room.avatar"===t.getType()&&this.setState({urls:e.getImageUrls(this.props)})}),u()(this,"onRoomAvatarClick",()=>{const e={src:b.b(this.props.room,null,null,null),name:this.props.room.name};_.a.createDialog(g.a,e,"mx_Dialog_lightbox",null,!0)}),this.state={urls:e.getImageUrls(this.props)}}componentDidMount(){f.a.get().on("RoomState.events",this.onRoomStateEvents)}componentWillUnmount(){const e=f.a.get();e&&e.removeListener("RoomState.events",this.onRoomStateEvents)}static getDerivedStateFromProps(t){return{urls:e.getImageUrls(t)}}static getImageUrls(t){let n=null;return t.oobData.avatarUrl&&(n=Object(y.b)(t.oobData.avatarUrl).getThumbnailOfSourceHttp(t.width,t.height,t.resizeMethod)),[n,e.getRoomAvatarUrl(t)].filter((function(e){return null!==e&&""!==e}))}static getRoomAvatarUrl(e){return e.room?b.b(e.room,e.width,e.height,e.resizeMethod):null}render(){const e=this.props,{room:t,oobData:n,viewAvatarOnClick:o,onClick:r}=e,i=l()(e,["room","oobData","viewAvatarOnClick","onClick"]),a=t?t.name:n.name;return p.a.createElement(m.a,s()({},i,{name:a,idName:t?t.roomId:null,urls:this.state.urls,onClick:o&&this.state.urls[0]?this.onRoomAvatarClick:r}))}},u()(r,"defaultProps",{width:36,height:36,resizeMethod:"crop",oobData:{}}),o=i))||o},function(e,t,n){"use strict";var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(88),c=n(113),l=n(98),d=n(95),u=n(90);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function p(e){for(var t=1;t"):e.replace(m,"#/$1"):(console.warn(`Unexpected hash location "${e}"`),"#/")}(t)}const _={"App Platform":{id:1,expl:Object(s.b)("The platform you're on"),example:"Electron Platform"},"App Version":{id:2,expl:Object(s.b)("The version of %(brand)s"),getTextVariables:()=>({brand:l.a.get().brand}),example:"15.0.0"},"User Type":{id:3,expl:Object(s.b)("Whether or not you're logged in (we don't record your username)"),example:"Logged In"},"Chosen Language":{id:4,expl:Object(s.b)("Your language of choice"),example:"en"},Instance:{id:5,expl:Object(s.b)("Which officially provided instance you are using, if any"),example:"app"},"RTE: Uses Richtext Mode":{id:6,expl:Object(s.b)("Whether or not you're using the Richtext mode of the Rich Text Editor"),example:"off"},"Homeserver URL":{id:7,expl:Object(s.b)("Your homeserver's URL"),example:"https://matrix.org"},"Touch Input":{id:8,expl:Object(s.b)("Whether you're using %(brand)s on a device where touch is the primary input mechanism"),getTextVariables:()=>({brand:l.a.get().brand}),example:"false"},Breadcrumbs:{id:9,expl:Object(s.b)("Whether or not you're using the 'breadcrumbs' feature (avatars above the room list)"),example:"disabled"},"Installed PWA":{id:10,expl:Object(s.b)("Whether you're using %(brand)s as an installed Progressive Web App"),getTextVariables:()=>({brand:l.a.get().brand}),example:"false"}};const b="mx_Riot_Analytics_uid";class v{constructor(){r()(this,"baseUrl",null),r()(this,"siteId",null),r()(this,"visitVariables",{}),r()(this,"firstPage",!0),r()(this,"heartbeatIntervalID",null),r()(this,"creationTs",void 0),r()(this,"lastVisitTs",void 0),r()(this,"visitCount",void 0),r()(this,"showDetailsModal",()=>{let e=[];e=this.disabled?Object.keys(_).map(e=>[e,Object(s.a)("e.g. %(exampleValue)s",{exampleValue:_[e].example})]):Object.values(this.visitVariables);const t=`${window.screen.width}x${window.screen.height}`,n=[{expl:Object(s.b)("Every page you use in the app"),value:Object(s.a)("e.g. ",{},{CurrentPageURL:f})},{expl:Object(s.b)("Your user agent"),value:navigator.userAgent},{expl:Object(s.b)("Your device resolution"),value:t}],o=u.getComponent("dialogs.ErrorDialog");d.a.createTrackedDialog("Analytics Details","",o,{title:Object(s.a)("Analytics"),description:a.a.createElement("div",{className:"mx_AnalyticsModal"},a.a.createElement("div",null,Object(s.a)("The information being sent to us to help make %(brand)s better includes:",{brand:l.a.get().brand})),a.a.createElement("table",null,e.map(e=>a.a.createElement("tr",{key:e[0]},a.a.createElement("td",null,Object(s.a)(_[e[0]].expl,_[e[0]].getTextVariables?_[e[0]].getTextVariables():null)),void 0!==e[1]&&a.a.createElement("td",null,a.a.createElement("code",null,e[1])))),n.map((e,t)=>a.a.createElement("tr",{key:t},a.a.createElement("td",null,Object(s.a)(e.expl)),a.a.createElement("td",null,a.a.createElement("code",null,e.value))))),a.a.createElement("div",null,Object(s.a)("Where this page includes identifiable information, such as a room, user or group ID, that data is removed before being sent to the server.")))})}),this.creationTs=localStorage&&localStorage.getItem("mx_Riot_Analytics_cts"),!this.creationTs&&localStorage&&localStorage.setItem("mx_Riot_Analytics_cts",this.creationTs=String((new Date).getTime())),this.lastVisitTs=localStorage&&localStorage.getItem("mx_Riot_Analytics_lvts"),this.visitCount=localStorage&&localStorage.getItem("mx_Riot_Analytics_vc")||"0",this.visitCount=String(parseInt(this.visitCount,10)+1),localStorage&&localStorage.setItem("mx_Riot_Analytics_vc",this.visitCount)}get disabled(){return!this.baseUrl}canEnable(){const e=l.a.get();return"1"!==navigator.doNotTrack&&e&&e.piwik&&e.piwik.url&&e.piwik.siteId}async enable(){if(!this.disabled)return;if(!this.canEnable())return;const e=l.a.get();this.baseUrl=new URL("piwik.php",e.piwik.url),this.baseUrl.searchParams.set("rec","1"),this.baseUrl.searchParams.set("idsite",e.piwik.siteId),this.baseUrl.searchParams.set("apiv","1"),this.baseUrl.searchParams.set("send_image","0"),this.baseUrl.searchParams.set("_id",function(){try{let e=localStorage&&localStorage.getItem(b);return!e&&localStorage&&localStorage.setItem(b,e=[...Array(16)].map(()=>Math.random().toString(16)[2]).join("")),e}catch(e){return console.error("Analytics error: ",e),""}}()),this.baseUrl.searchParams.set("_idts",this.creationTs),this.baseUrl.searchParams.set("_idvc",this.visitCount),this.lastVisitTs&&this.baseUrl.searchParams.set("_viewts",this.lastVisitTs);const t=c.a.get();this.setVisitVariable("App Platform",t.getHumanReadableName());try{this.setVisitVariable("App Version",await t.getAppVersion())}catch(e){this.setVisitVariable("App Version","unknown")}this.setVisitVariable("Chosen Language",Object(s.d)());const n=window.location.hostname;"riot.im"===n?this.setVisitVariable("Instance",window.location.pathname):n.endsWith(".element.io")&&this.setVisitVariable("Instance",n.replace(".element.io",""));let o="unknown";try{o=String(window.matchMedia("(display-mode: standalone)").matches)}catch(e){}this.setVisitVariable("Installed PWA",o);let r="unknown";try{r=String(window.matchMedia("(pointer: coarse)").matches)}catch(e){}this.setVisitVariable("Touch Input",r),this.heartbeatIntervalID=window.setInterval(this.ping.bind(this),3e4)}disable(){this.disabled||(this.trackEvent("Analytics","opt-out"),window.clearInterval(this.heartbeatIntervalID),this.baseUrl=null,this.visitVariables={},localStorage.removeItem(b),localStorage.removeItem("mx_Riot_Analytics_cts"),localStorage.removeItem("mx_Riot_Analytics_vc"),localStorage.removeItem("mx_Riot_Analytics_lvts"))}async _track(e){if(this.disabled)return;const t=new Date,n=p(p({},e),{},{url:f(),_cvar:JSON.stringify(this.visitVariables),res:`${window.screen.width}x${window.screen.height}`,rand:String(Math.random()).slice(2,8),h:t.getHours(),m:t.getMinutes(),s:t.getSeconds()}),o=new URL(this.baseUrl.toString());for(const e in n)o.searchParams.set(e,n[e]);try{await window.fetch(o.toString(),{method:"GET",mode:"no-cors",cache:"no-cache",redirect:"follow"})}catch(e){console.error("Analytics error: ",e)}}ping(){this._track({ping:"1"}),localStorage.setItem("mx_Riot_Analytics_lvts",String((new Date).getTime()))}trackPageChange(e){this.disabled||(this.firstPage?this.firstPage=!1:("number"!=typeof e&&console.warn("Analytics.trackPageChange: expected generationTimeMs to be a number"),this._track({gt_ms:String(e)})))}trackEvent(e,t,n,o){this.disabled||this._track({e_c:e,e_a:t,e_n:n,e_v:o})}setVisitVariable(e,t){this.disabled||(this.visitVariables[_[e].id]=[e,t])}setLoggedIn(e,t){if(this.disabled)return;const n=l.a.get();if(!n.piwik)return;const o=n.piwik.whitelistedHSUrls||[];var r;this.setVisitVariable("User Type",e?"Guest":"Logged In"),this.setVisitVariable("Homeserver URL",(r=t,o.includes(r)?r:""))}setBreadcrumbs(e){this.disabled||this.setVisitVariable("Breadcrumbs",e?"enabled":"disabled")}}window.mxAnalytics||(window.mxAnalytics=new v),t.a=window.mxAnalytics},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(91),u=n.n(d),h=n(90),p=n(88),m=n(89);let g=Object(m.a)("views.dialogs.ErrorDialog")((i=r=class extends l.a.Component{constructor(...e){super(...e),s()(this,"onClick",()=>{this.props.onFinished(!0)})}render(){const e=h.getComponent("views.dialogs.BaseDialog");return l.a.createElement(e,{className:"mx_ErrorDialog",onFinished:this.props.onFinished,title:this.props.title||Object(p.a)("Error"),headerImage:this.props.headerImage,contentId:"mx_Dialog_content"},l.a.createElement("div",{className:"mx_Dialog_content",id:"mx_Dialog_content"},this.props.description||Object(p.a)("An error has occurred.")),l.a.createElement("div",{className:"mx_Dialog_buttons"},l.a.createElement("button",{className:"mx_Dialog_primary",onClick:this.onClick,autoFocus:this.props.focus},this.props.button||Object(p.a)("OK"))))}},s()(r,"propTypes",{title:u.a.string,description:u.a.oneOfType([u.a.element,u.a.string]),button:u.a.string,focus:u.a.bool,onFinished:u.a.func.isRequired,headerImage:u.a.string}),s()(r,"defaultProps",{focus:!0,title:null,description:null,button:null}),o=i))||o},function(e,t,n){"use strict";n.d(t,"a",(function(){return U})),n.d(t,"j",(function(){return B})),n.d(t,"i",(function(){return G})),n.d(t,"h",(function(){return q})),n.d(t,"d",(function(){return V})),n.d(t,"e",(function(){return H})),n.d(t,"b",(function(){return $})),n.d(t,"g",(function(){return Q})),n.d(t,"f",(function(){return J})),n.d(t,"c",(function(){return X}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(339),c=n.n(s),l=n(951),d=n(412),u=n(956),h=n.n(u),p=n(958),m=n.n(p),g=n(97),f=n.n(g),_=n(607),b=n.n(_),v=n(130),y=n.n(v),E=n(962),S=n.n(E),w=n(415),C=n(94),T=n(578),x=n.n(T),O=n(115),k=n(290),R=n(250),I=n(103);function D(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function A(e){for(var t=1;t{const r=n[e],i=t[e];i&&"string"==typeof i&&j.test(i)&&(o+=r+":"+i+";",delete t[e])}),o&&(t.style=o),{tagName:e,attribs:t}}},K={allowedTags:["font","del","h1","h2","h3","h4","h5","h6","blockquote","p","a","ul","ol","sup","sub","nl","li","b","i","u","strong","em","strike","code","hr","br","div","table","thead","caption","tbody","tr","th","td","pre","span","img","details","summary"],allowedAttributes:{font:["color","data-mx-bg-color","data-mx-color","style"],span:["data-mx-maths","data-mx-bg-color","data-mx-color","data-mx-spoiler","style"],div:["data-mx-maths"],a:["href","name","target","rel"],img:["src","width","height","alt","title"],ol:["start"],code:["class"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:U,allowProtocolRelative:!1,transformTags:z,nestingLimit:50},W=A(A({},K),{},{transformTags:{code:z.code,"*":z["*"]}});class Y extends class{constructor(e,t){this.highlightClass=e,this.highlightLink=t}applyHighlights(e,t){let n,o=0,r=[];const i=t[0];for(;(n=e.toLowerCase().indexOf(i.toLowerCase(),o))>=0;){if(n>o){const i=e.substring(o,n);r=r.concat(this.applySubHighlights(i,t))}const a=n+i.length;r.push(this.processSnippet(e.substring(n,a),!0)),o=a}if(o!==e.length){const n=e.substring(o,void 0);r=r.concat(this.applySubHighlights(n,t))}return r}applySubHighlights(e,t){return t[1]?this.applyHighlights(e,t.slice(1)):[this.processSnippet(e,!1)]}}{processSnippet(e,t){if(!t)return e;let n=`${e}`;return this.highlightLink&&(n=`${n}`),n}}function $(e,t,n={}){const o="org.matrix.custom.html"===e.format&&e.formatted_body;let r,i,s,l=!1,d=K;n.forComposerQuote&&(d=W);try{if(t&&t.length>0){const e=new Y("mx_EventTile_searchHighlight",n.highlightLink),o=t.map((function(e){return c()(e,d)}));d.textFilter=function(t){return e.applyHighlights(t,o).join("")}}let a="string"==typeof e.formatted_body?e.formatted_body:null;const h="string"==typeof e.body?e.body:"";if(n.stripReplyFallback&&a&&(a=R.a.stripHTMLReply(a)),r=n.stripReplyFallback?R.a.stripPlainReply(h):h,u=o?a:h,l=N.test(u)||F.test(u),o&&(s=!0,i=c()(a,d),C.b.getValue("feature_latex_maths"))){const e=x.a.load(i,{_useHtmlParser2:!0,decodeEntities:!1});e('div, span[data-mx-maths!=""]').replaceWith((function(t,n){return S.a.renderToString(w.AllHtmlEntities.decode(e(n).attr("data-mx-maths")),{throwOnError:!1,displayMode:"div"==n.name,output:"htmlAndMathml"})})),i=e.html()}}finally{delete d.textFilter}var u;const h=s?i:r;if(n.returnString)return h;let p=!1;if(!n.disableBigEmoji&&l){let t=void 0!==h?h.trim():"";t=t.replace(P,""),t=t.replace(M,"");const n=L.exec(t);p=n&&n[0]&&n[0].length===t.length&&(r===i||void 0===e.formatted_body||!e.formatted_body.includes("http:")&&!e.formatted_body.includes("https:"))}const m=f()({mx_EventTile_body:!0,mx_EventTile_bigEmoji:p,"markdown-body":o&&!p});return s?a.a.createElement("span",{key:"body",ref:n.ref,className:m,dangerouslySetInnerHTML:{__html:i},dir:"auto"}):a.a.createElement("span",{key:"body",ref:n.ref,className:m,dir:"auto"},r)}function Q(e,t=d.a.options){return h()(e,t)}function J(e,t=d.a.options){return c()(function(e,t=d.a.options){return m()(e,t)}(e,t),K)}function X(e){switch(e.nodeName){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":case"PRE":case"BLOCKQUOTE":case"P":case"UL":case"OL":case"LI":case"HR":case"TABLE":case"THEAD":case"TBODY":case"TR":case"TH":case"TD":return!0;case"DIV":return!e.hasAttribute("data-mx-maths");default:return!1}}},function(e,t,n){"use strict";var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(321),c=n(93),l=n(92),d=n(90),u=n(95),h=n(88),p=n(532),m=n(100),g=n(140),f=n(114);function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function b(e){for(var t=1;tn.joinRoom(o,b({viaServers:r},e.opts)),5,e=>504===e.httpStatus),f.a.instance.trackRoomJoin(t,this.state.roomId,e._type),c.a.dispatch({action:m.a.JoinRoomReady,roomId:this.state.roomId})}catch(e){c.a.dispatch({action:m.a.JoinRoomError,roomId:this.state.roomId,err:e})}}getInvitingUserId(e){const t=l.a.get(),n=t.getRoom(e);if(n&&"invite"===n.getMyMembership()){const e=n.getMember(t.getUserId()),o=e?e.events.member:null;return o&&o.getSender()}}joinRoomError(e){this.setState({joining:!1,joinError:e.err});const t=e.err;let n=t.message?t.message:JSON.stringify(t);if(console.log("Failed to join room:",n),"ConnectionError"===t.name)n=Object(h.a)("There was an error joining the room");else if("M_INCOMPATIBLE_ROOM_VERSION"===t.errcode)n=a.a.createElement("div",null,Object(h.a)("Sorry, your homeserver is too old to participate in this room."),a.a.createElement("br",null),Object(h.a)("Please contact your homeserver administrator."));else if(404===t.httpStatus){const e=this.getInvitingUserId(this.state.roomId);e&&(n=e.endsWith(":"+l.a.get().getDomain())?Object(h.a)("The person who invited you already left the room."):Object(h.a)("The person who invited you already left the room, or their server is offline."))}const o=d.getComponent("dialogs.ErrorDialog");u.a.createTrackedDialog("Failed to join room","",o,{title:Object(h.a)("Failed to join room"),description:n})}reset(){this.state=Object.assign({},v)}getRoomId(){return this.state.roomId}getInitialEventId(){return this.state.initialEventId}isInitialEventHighlighted(){return this.state.isInitialEventHighlighted}getRoomAlias(){return this.state.roomAlias}isRoomLoading(){return this.state.roomLoading}getRoomLoadError(){return this.state.roomLoadError}isJoining(){return this.state.joining}getJoinError(){return this.state.joinError}getForwardingEvent(){return this.state.forwardingEvent}getQuotingEvent(){return this.state.replyingToEvent}shouldPeek(){return this.state.shouldPeek}getWasContextSwitch(){return this.state.wasContextSwitch}}let E=null;E||(E=new y),t.a=E},function(e,t,n){"use strict";var o=n(960),r=n(961);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){r.isString(e)&&(e=v(e));return e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(l),u=["%","/","?",";","#"].concat(d),h=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},_={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=n(2);function v(e,t,n){if(e&&r.isObject(e)&&e instanceof i)return e;var o=new i;return o.parse(e,t,n),o}i.prototype.parse=function(e,t,n){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i127?N+="x":N+=A[F];if(!N.match(p)){var P=I.slice(0,O),L=I.slice(O+1),j=A.match(m);j&&(P.push(j[1]),L.unshift(j[2])),L.length&&(v="/"+L.join(".")+v),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=o.toASCII(this.hostname));var U=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+U,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!g[S])for(O=0,D=d.length;O0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift());return n.search=e.search,n.query=e.query,r.isNull(n.pathname)&&r.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!w.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var T=w.slice(-1)[0],x=(n.host||e.host||w.length>1)&&("."===T||".."===T)||""===T,O=0,k=w.length;k>=0;k--)"."===(T=w[k])?w.splice(k,1):".."===T?(w.splice(k,1),O++):O&&(w.splice(k,1),O--);if(!E&&!S)for(;O--;O)w.unshift("..");!E||""===w[0]||w[0]&&"/"===w[0].charAt(0)||w.unshift(""),x&&"/"!==w.join("/").substr(-1)&&w.push("");var R,I=""===w[0]||w[0]&&"/"===w[0].charAt(0);C&&(n.hostname=n.host=I?"":w.length?w.shift():"",(R=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=R.shift(),n.host=n.hostname=R.shift()));return(E=E||n.host&&w.length)&&!I&&w.unshift(""),w.length?n.pathname=w.join("/"):(n.pathname=null,n.path=null),r.isNull(n.pathname)&&r.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(87);const r=(e,t,n)=>{const r=Object(o.useRef)(n);Object(o.useEffect)(()=>{r.current=n},[n]),Object(o.useEffect)(()=>{if(!e)return;const n=(...e)=>r.current(...e);return e.on(t,n),()=>{e.removeListener(t,n)}},[t,e])}},function(e,t,n){"use strict";n.d(t,"b",(function(){return y})),n.d(t,"a",(function(){return E})),n.d(t,"d",(function(){return S})),n.d(t,"g",(function(){return w})),n.d(t,"c",(function(){return C})),n.d(t,"f",(function(){return T})),n.d(t,"e",(function(){return x})),n.d(t,"h",(function(){return O}));var o=n(110),r=n(92),i=n(95),a=n(90),s=n(88),c=n(93),l=n(259),d=n(122),u=n(220),h=n(260),p=n(123),m=n(114),g=n(201),f=n(133),_=n(138),b=n(303),v=n(100);let y,E;function S(e){void 0===(e=e||{}).spinner&&(e.spinner=!0),void 0===e.guestAccess&&(e.guestAccess=!0),void 0===e.encryption&&(e.encryption=!1);const t=m.a.getTimestamp(),n=a.getComponent("dialogs.ErrorDialog"),d=a.getComponent("elements.Spinner"),h=r.a.get();if(h.isGuest())return c.a.dispatch({action:"require_registration"}),Promise.resolve(null);const g=e.dmUserId?E.TrustedPrivateChat:E.PrivateChat,f=e.createOpts||{};if(f.preset=f.preset||g,f.visibility=f.visibility||y.Private,e.dmUserId&&void 0===f.invite)switch(Object(u.c)(e.dmUserId)){case"mx-user-id":f.invite=[e.dmUserId];break;case"email":f.invite_3pid=[{id_server:r.a.get().getIdentityServerUrl(!0),medium:"email",address:e.dmUserId}]}let S,w;return e.dmUserId&&void 0===f.is_direct&&(f.is_direct=!0),void 0===e.andView&&(e.andView=!0),f.initial_state=f.initial_state||[],e.guestAccess&&f.initial_state.push({type:"m.room.guest_access",state_key:"",content:{guest_access:"can_join"}}),e.encryption&&f.initial_state.push({type:"m.room.encryption",state_key:"",content:{algorithm:"m.megolm.v1.aes-sha2"}}),e.parentSpace&&(e.createOpts.initial_state.push(Object(b.a)(e.parentSpace,!0)),e.createOpts.initial_state.push({type:o.a.RoomHistoryVisibility,content:{history_visibility:e.createOpts.preset===E.PublicChat?"world_readable":"invited"}})),e.spinner&&(S=i.a.createDialog(d,null,"mx_Dialog_spinner")),h.createRoom(f).finally((function(){S&&S.close()})).then((function(t){return w=t.room_id,e.dmUserId?l.c(w,e.dmUserId):Promise.resolve()})).then(()=>e.parentSpace?_.e.instance.addRoomToSpace(e.parentSpace,w,[h.getDomain()],!0):e.associatedWithCommunity?p.a.addRoomToGroup(e.associatedWithCommunity,w,!1):void 0).then((function(){return e.andView&&c.a.dispatch({action:"view_room",room_id:w,should_peek:!1,joining:!0,justCreatedOpts:e}),m.a.instance.trackRoomCreate(t,w),w}),(function(t){if(e.inlineErrors)throw t;c.a.dispatch({action:v.a.JoinRoomError,roomId:w}),console.error("Failed to create room "+w+" "+t);let o=Object(s.a)("Server may be unavailable, overloaded, or you hit a bug.");return"M_UNSUPPORTED_ROOM_VERSION"===t.errcode&&(o=Object(s.a)("The server does not support the room version specified.")),i.a.createTrackedDialog("Failure to create room","",n,{title:Object(s.a)("Failure to create room"),description:o}),null}))}function w(e,t){const n=d.a.shared().getDMRoomsForUserId(t).map(t=>e.getRoom(t)).filter(e=>{if(e&&"join"===e.getMyMembership()){const n=e.currentState.getMembers().filter(e=>Object(g.c)(e.membership));return n.find(e=>e.userId===t)&&2===n.length}return!1}).sort((e,t)=>t.getLastActiveTimestamp()-e.getLastActiveTimestamp());if(n.length)return n[0]}async function C(e,t){try{const n=await e.downloadKeys(t);return Object.values(n).every(e=>Object.keys(e).length>0)}catch(e){return console.error("Error determining if it's possible to encrypt to all users: ",e),!1}}async function T(e,t,n){const o=w(e,t);let r;return r=o?o.roomId:await S({dmUserId:t,spinner:!1,andView:!1,createOpts:{creation_content:{[f.c]:n}}}),r}async function x(e,t){const n=w(e,t);let o;if(n)o=n.roomId;else{let n=void 0;O()&&(n=await C(e,[t])),o=await S({encryption:n,dmUserId:t,spinner:!1,andView:!1}),await async function(e,t,n,o={timeout:1500}){const{timeout:r}=o;let i;return new Promise(o=>{i=function(e,r,i){i.userId===n&&i.roomId===t&&o(!0)},e.on("RoomState.newMember",i),setTimeout(o,r,!1)}).finally(()=>{e.removeListener("RoomState.newMember",i)})}(e,o,t)}return o}function O(){const e=Object(h.b)();if(e){return!(!1===e.default)}return!0}!function(e){e.Public="public",e.Private="private"}(y||(y={})),function(e){e.PrivateChat="private_chat",e.TrustedPrivateChat="trusted_private_chat",e.PublicChat="public_chat"}(E||(E={}))},function(e,t,n){"use strict";(function(e){n.d(t,"c",(function(){return j})),n.d(t,"b",(function(){return B})),n.d(t,"a",(function(){return G})),n.d(t,"d",(function(){return q}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(92),c=n(113),l=n(95),d=n(88),u=n(93),h=n(134),p=n(261),m=n(94),g=n(445),f=n(155),_=n(102),b=n(635),v=n(136),y=n(127),E=n(223),S=n(262),w=n(5),C=n(151),T=n(126),x=n(114),O=n(112),k=n(0),R=n(636),I=n(100),D=n(646),A=n(1095),N=n(176),F=n(8),M=n.n(F),P=n(98),L=n(132);const j="im.vector.is_virtual_room";var U;let B,G;!function(e){e.Ring="ringAudio",e.Ringback="ringbackAudio",e.CallEnd="callendAudio",e.Busy="busyAudio"}(U||(U={})),function(e){e.Voice="voice",e.Video="video",e.ScreenSharing="screensharing"}(B||(B={})),function(e){e.CallsChanged="calls_changed",e.CallChangeRoom="call_change_room"}(G||(G={}));class q extends M.a{constructor(...e){super(...e),r()(this,"calls",new Map),r()(this,"transferees",new Map),r()(this,"audioPromises",new Map),r()(this,"dispatcherRef",null),r()(this,"supportsPstnProtocol",null),r()(this,"pstnSupportPrefixed",null),r()(this,"supportsSipNativeVirtual",null),r()(this,"pstnSupportCheckTimer",void 0),r()(this,"invitedRoomsAreVirtual",new Map),r()(this,"invitedRoomCheckInProgress",!1),r()(this,"assertedIdentityNativeUsers",new Map),r()(this,"onCallIncoming",e=>{u.a.dispatch({action:"incoming_call",call:e},!0)}),r()(this,"onAction",e=>{switch(e.action){case"place_call":{if(Object(A.b)())return void Object(A.a)(e.room_id);if(!s.a.get().supportsVoip())return void l.a.createTrackedDialog("Call Handler","VoIP is unsupported",y.a,{title:Object(d.a)("VoIP is unsupported"),description:Object(d.a)("You cannot place VoIP calls in this browser.")});if(this.getAllActiveCalls().length>1)return void l.a.createTrackedDialog("Call Handler","Existing Call",y.a,{title:Object(d.a)("Too Many Calls"),description:Object(d.a)("You've reached the maximum number of simultaneous calls.")});const t=s.a.get().getRoom(e.room_id);if(!t)return void console.error(`Room ${e.room_id} does not exist.`);if(this.getCallForRoom(t.roomId))return void l.a.createTrackedDialog("Call Handler","Existing Call with user",y.a,{title:Object(d.a)("Already in call"),description:Object(d.a)("You're already in a call with this person.")});const n=t.getJoinedMembers();if(n.length<=1)return void l.a.createTrackedDialog("Call Handler","Cannot place call with self",y.a,{description:Object(d.a)("You cannot place a call with yourself.")});2===n.length?(console.info(`Place ${e.type} call in ${e.room_id}`),this.placeCall(e.room_id,e.type,e.transferee)):u.a.dispatch({action:"place_conference_call",room_id:e.room_id,type:e.type})}break;case"place_conference_call":console.info("Place conference call in "+e.room_id),T.a.trackEvent("voip","placeConferenceCall"),x.a.instance.trackStartCall(e.room_id,e.type===B.Video,!0),this.startCallApp(e.room_id,e.type);break;case"end_conference":console.info("Terminating conference call in "+e.room_id),this.terminateCallApp(e.room_id);break;case"hangup_conference":console.info("Leaving conference call in "+e.room_id),this.hangupCallApp(e.room_id);break;case"incoming_call":{if(!s.a.get().supportsVoip())return;const t=e.call,n=q.sharedInstance().roomIdForCall(t);if(this.getCallForRoom(n))return;T.a.trackEvent("voip","receiveCall","type",t.type),this.calls.set(n,t),this.emit(G.CallsChanged,this.calls),this.setCallListeners(t);const o=s.a.get();o.prepareToEncrypt(o.getRoom(t.roomId))}break;case"hangup":case"reject":if(!this.calls.get(e.room_id))return;"reject"===e.action?this.calls.get(e.room_id).reject():this.calls.get(e.room_id).hangup(C.b.UserHangup,!1);break;case"hangup_all":for(const e of this.calls.values())e.hangup(C.b.UserHangup,!1);break;case"answer":{if(!this.calls.has(e.room_id))return;if(this.getAllActiveCalls().length>1)return void l.a.createTrackedDialog("Call Handler","Existing Call",y.a,{title:Object(d.a)("Too Many Calls"),description:Object(d.a)("You've reached the maximum number of simultaneous calls.")});const t=this.calls.get(e.room_id);t.answer(),this.setActiveCallRoomId(e.room_id),x.a.instance.trackJoinCall(e.room_id,t.type===C.f.Video,!1),u.a.dispatch({action:"view_room",room_id:e.room_id});break}}})}static sharedInstance(){return window.mxCallHandler||(window.mxCallHandler=new q),window.mxCallHandler}roomIdForCall(e){if(!e)return null;const t=P.a.get().voip;if(t&&t.obeyAssertedIdentity){const t=this.assertedIdentityNativeUsers[e.callId];if(t){const e=Object(L.g)(s.a.get(),t);if(e)return e.roomId}}return D.a.sharedInstance().nativeRoomForVirtualRoom(e.roomId)||e.roomId}start(){this.dispatcherRef=u.a.register(this.onAction),navigator.mediaSession&&(navigator.mediaSession.setActionHandler("play",(function(){})),navigator.mediaSession.setActionHandler("pause",(function(){})),navigator.mediaSession.setActionHandler("seekbackward",(function(){})),navigator.mediaSession.setActionHandler("seekforward",(function(){})),navigator.mediaSession.setActionHandler("previoustrack",(function(){})),navigator.mediaSession.setActionHandler("nexttrack",(function(){}))),m.b.getValue(O.a.Voip)&&s.a.get().on("Call.incoming",this.onCallIncoming),this.checkProtocols(3)}stop(){const e=s.a.get();e&&e.removeListener("Call.incoming",this.onCallIncoming),null!==this.dispatcherRef&&(u.a.unregister(this.dispatcherRef),this.dispatcherRef=null)}async checkProtocols(e){try{const e=await s.a.get().getThirdpartyProtocols();void 0!==e["m.protocol.pstn"]?(this.supportsPstnProtocol=Boolean(e["m.protocol.pstn"]),this.supportsPstnProtocol&&(this.pstnSupportPrefixed=!1)):void 0!==e["im.vector.protocol.pstn"]?(this.supportsPstnProtocol=Boolean(e["im.vector.protocol.pstn"]),this.supportsPstnProtocol&&(this.pstnSupportPrefixed=!0)):this.supportsPstnProtocol=null,u.a.dispatch({action:I.a.PstnSupportUpdated}),void 0!==e["im.vector.protocol.sip_native"]&&void 0!==e["im.vector.protocol.sip_virtual"]&&(this.supportsSipNativeVirtual=Boolean(e["im.vector.protocol.sip_native"]&&e["im.vector.protocol.sip_virtual"])),u.a.dispatch({action:I.a.VirtualRoomSupportUpdated})}catch(t){1===e?console.log("Failed to check for protocol support and no retries remain: assuming no support",t):(console.log("Failed to check for protocol support: will retry",t),this.pstnSupportCheckTimer=setTimeout(()=>{this.checkProtocols(e-1)},1e4))}}getSupportsPstnProtocol(){return this.supportsPstnProtocol}getSupportsVirtualRooms(){return this.supportsPstnProtocol}pstnLookup(e){return s.a.get().getThirdpartyUser(this.pstnSupportPrefixed?"im.vector.protocol.pstn":"m.protocol.pstn",{"m.id.phone":e})}sipVirtualLookup(e){return s.a.get().getThirdpartyUser("im.vector.protocol.sip_virtual",{native_mxid:e})}sipNativeLookup(e){return s.a.get().getThirdpartyUser("im.vector.protocol.sip_native",{virtual_mxid:e})}getCallForRoom(e){return this.calls.get(e)||null}getAnyActiveCall(){for(const e of this.calls.values())if(e.state!==C.e.Ended)return e;return null}getAllActiveCalls(){const e=[];for(const t of this.calls.values())t.state!==C.e.Ended&&t.state!==C.e.Ringing&&e.push(t);return e}getAllActiveCallsNotInRoom(e){const t=[];for(const[n,o]of this.calls.entries())n!==e&&o.state!==C.e.Ended&&t.push(o);return t}getTransfereeForCallId(e){return this.transferees[e]}play(e){const t=document.getElementById(e);if(t){const n=async()=>{try{await t.play()}catch(e){console.log("Unable to play audio clip",e)}};this.audioPromises.has(e)?this.audioPromises.set(e,this.audioPromises.get(e).then(()=>(t.load(),n()))):this.audioPromises.set(e,n())}}pause(e){const t=document.getElementById(e);t&&(this.audioPromises.has(e)?this.audioPromises.set(e,this.audioPromises.get(e).then(()=>t.pause())):t.pause())}matchesCallForThisRoom(e){const t=this.roomIdForCall(e),n=this.getCallForRoom(t);return n&&e.callId===n.callId}setCallListeners(e){let t=q.sharedInstance().roomIdForCall(e);e.on(C.c.Error,t=>{this.matchesCallForThisRoom(e)&&(T.a.trackEvent("voip","callError","error",t.toString()),console.error("Call error:",t),t.code!==C.b.NoUserMedia?0!==s.a.get().getTurnServers().length||null!==m.b.getValue("fallbackICEServerAllowed")?l.a.createTrackedDialog("Call Failed","",y.a,{title:Object(d.a)("Call Failed"),description:t.message}):this.showICEFallbackPrompt():this.showMediaCaptureError(e))}),e.on(C.c.Hangup,()=>{this.matchesCallForThisRoom(e)&&(T.a.trackEvent("voip","callHangup"),this.removeCallForRoom(t))}),e.on(C.c.State,(n,o)=>{if(this.matchesCallForThisRoom(e)){switch(this.setCallState(e,n),o){case C.e.Ringing:this.pause(U.Ring);break;case C.e.InviteSent:this.pause(U.Ringback)}switch(n){case C.e.Ringing:this.play(U.Ring);break;case C.e.InviteSent:this.play(U.Ringback);break;case C.e.Ended:if(T.a.trackEvent("voip","callEnded","hangupReason",e.hangupReason),this.removeCallForRoom(t),o===C.e.InviteSent&&(e.hangupParty===C.d.Remote||e.hangupParty===C.d.Local&&e.hangupReason===C.b.InviteTimeout)){let t,n;this.play(U.Busy),e.hangupReason===C.b.UserHangup?(t=Object(d.a)("Call Declined"),n=Object(d.a)("The other party declined the call.")):e.hangupReason===C.b.UserBusy?(t=Object(d.a)("User Busy"),n=Object(d.a)("The user you called is busy.")):e.hangupReason===C.b.InviteTimeout?(t=Object(d.a)("Call Failed"),n=Object(d.a)("The remote side failed to pick up")+"."):(t=Object(d.a)("Call Failed"),n=Object(d.a)("The call could not be established")),l.a.createTrackedDialog("Call Handler","Call Failed",y.a,{title:t,description:n})}else e.hangupReason===C.b.AnsweredElsewhere&&o===C.e.Connecting?l.a.createTrackedDialog("Call Handler","Call Failed",y.a,{title:Object(d.a)("Answered Elsewhere"),description:Object(d.a)("The call was answered on another device.")}):o!==C.e.Fledgling&&o!==C.e.Ringing&&this.play(U.CallEnd);this.logCallStats(e,t)}}}),e.on(C.c.Replaced,n=>{this.matchesCallForThisRoom(e)&&(console.log(`Call ID ${e.callId} is being replaced by call ID ${n.callId}`),e.state===C.e.Ringing?this.pause(U.Ring):e.state===C.e.InviteSent&&this.pause(U.Ringback),this.calls.set(t,n),this.emit(G.CallsChanged,this.calls),this.setCallListeners(n),this.setCallState(n,n.state))}),e.on(C.c.AssertedIdentityChanged,async()=>{if(!this.matchesCallForThisRoom(e))return;console.log(`Call ID ${e.callId} got new asserted identity:`,e.getRemoteAssertedIdentity());const n=e.getRemoteAssertedIdentity().id;let o=n;if(n){const e=await this.sipNativeLookup(n);e.length&&(o=e[0].userid)}if(console.log(`Asserted identity ${n} mapped to ${o}`),o){this.assertedIdentityNativeUsers[e.callId]=o,await Object(L.e)(s.a.get(),o);const n=this.roomIdForCall(e);console.log(`Old room ID: ${t}, new room ID: ${n}`),n!==t&&(this.removeCallForRoom(t),t=n,this.calls.set(t,e),this.emit(G.CallChangeRoom,e))}})}async logCallStats(e,t){const n=await e.getCurrentCallStats();if(k.a.debug(`Call completed. Call ID: ${e.callId}, virtual room ID: ${e.roomId}, user-facing room ID: ${t}, direction: ${e.direction}, our Party ID: ${e.ourPartyId}, hangup party: ${e.hangupParty}, hangup reason: `+e.hangupReason),n){k.a.debug("Local candidates:");for(const e of n.filter(e=>"local-candidate"===e.type)){const t=e.address||e.ip;k.a.debug(`${e.id} - type: ${e.candidateType}, address: ${t}, port: ${e.port}, protocol: ${e.protocol}, relay protocol: ${e.relayProtocol}, network type: ${e.networkType}`)}k.a.debug("Remote candidates:");for(const e of n.filter(e=>"remote-candidate"===e.type)){const t=e.address||e.ip;k.a.debug(`${e.id} - type: ${e.candidateType}, address: ${t}, port: ${e.port}, protocol: `+e.protocol)}k.a.debug("Candidate pairs:");for(const e of n.filter(e=>"candidate-pair"===e.type))k.a.debug(`${e.localCandidateId} / ${e.remoteCandidateId} - state: ${e.state}, nominated: ${e.nominated}, requests sent ${e.requestsSent}, requests received ${e.requestsReceived}, responses received: ${e.responsesReceived}, responses sent: ${e.responsesSent}, bytes received: ${e.bytesReceived}, bytes sent: ${e.bytesSent}, `)}else k.a.debug("Call statistics are undefined. The call has probably failed before a peerConn was established")}setCallState(e,t){const n=q.sharedInstance().roomIdForCall(e);console.log(`Call state in ${n} changed to ${t}`),u.a.dispatch({action:"call_state",room_id:n,state:t})}removeCallForRoom(e){this.calls.delete(e),this.emit(G.CallsChanged,this.calls)}showICEFallbackPrompt(){const e=s.a.get(),t=e=>a.a.createElement("code",null,e);l.a.createTrackedDialog("No TURN servers","",v.a,{title:Object(d.a)("Call failed due to misconfigured server"),description:a.a.createElement("div",null,a.a.createElement("p",null,Object(d.a)("Please ask the administrator of your homeserver (%(homeserverDomain)s) to configure a TURN server in order for calls to work reliably.",{homeserverDomain:e.getDomain()},{code:t})),a.a.createElement("p",null,Object(d.a)("Alternatively, you can try to use the public server at turn.matrix.org, but this will not be as reliable, and it will share your IP address with that server. You can also manage this in Settings.",null,{code:t}))),button:Object(d.a)("Try using turn.matrix.org"),cancelButton:Object(d.a)("OK"),onFinished:t=>{m.b.setValue("fallbackICEServerAllowed",null,_.a.DEVICE,t),e.setFallbackICEServerAllowed(t)}},null,!0)}showMediaCaptureError(e){let t,n;e.type===C.f.Voice?(t=Object(d.a)("Unable to access microphone"),n=a.a.createElement("div",null,Object(d.a)("Call failed because microphone could not be accessed. Check that a microphone is plugged in and set up correctly."))):e.type===C.f.Video&&(t=Object(d.a)("Unable to access webcam / microphone"),n=a.a.createElement("div",null,Object(d.a)("Call failed because webcam or microphone could not be accessed. Check that:"),a.a.createElement("ul",null,a.a.createElement("li",null,Object(d.a)("A microphone and webcam are plugged in and set up correctly")),a.a.createElement("li",null,Object(d.a)("Permission is granted to use the webcam")),a.a.createElement("li",null,Object(d.a)("No other application is using the webcam"))))),l.a.createTrackedDialog("Media capture failed","",y.a,{title:t,description:n},null,!0)}async placeCall(e,t,n){T.a.trackEvent("voip","placeCall","type",t),x.a.instance.trackStartCall(e,t===B.Video,!1);const o=await D.a.sharedInstance().getOrCreateVirtualRoomForRoom(e)||e;k.a.debug("Mapped real room "+e+" to room ID "+o);const r=s.a.get().getTurnServersExpiry()-Date.now();console.log("Current turn creds expire in "+r+" ms");const i=s.a.get().createCall(o);if(this.calls.set(e,i),this.emit(G.CallsChanged,this.calls),n&&(this.transferees[i.callId]=n),this.setCallListeners(i),this.setActiveCallRoomId(e),t===B.Voice)i.placeVoiceCall();else if("video"===t)i.placeVideoCall();else if(t===B.ScreenSharing){const t=c.a.get().screenCaptureErrorString();if(t)return this.removeCallForRoom(e),console.log("Can't capture screen: "+t),void l.a.createTrackedDialog("Call Handler","Unable to capture screen",y.a,{title:Object(d.a)("Unable to capture screen"),description:t});i.placeScreenSharingCall(async()=>{const{finished:e}=l.a.createDialog(R.a),[t]=await e;return t})}else console.error("Unknown conf call type: "+t)}setActiveCallRoomId(e){k.a.info("Setting call in room "+e+" active");for(const[t,n]of this.calls.entries())n.state!==C.e.Ended&&(t===e?n.setRemoteOnHold(!1):(k.a.info("Holding call in room "+t+" because another call is being set active"),n.setRemoteOnHold(!0)))}hasAnyUnheldCall(){for(const e of this.calls.values())if(e.state!==C.e.Ended&&!e.isRemoteOnHold())return!0;return!1}async startCallApp(t,n){u.a.dispatch({action:"appsDrawer",show:!0});const o=s.a.get().getRoom(t),r=h.a.getRoomWidgetsOfType(o,f.a.JITSI);if(r.length>0||p.a.roomHasPendingWidgetsOfType(t,r,f.a.JITSI))return void l.a.createTrackedDialog("Call already in progress","",y.a,{title:Object(d.a)("Call in Progress"),description:Object(d.a)("A call is currently being placed!")});const i=g.a.getInstance().preferredDomain,a=await g.a.getInstance().getJitsiAuth();let c;if("openidtoken-jwt"===a)c=b.base32.stringify(e.from(t),{pad:!1});else{c="Jitsi"+(Object(N.c)(1)+Object(N.a)(23))}let m=h.a.getLocalJitsiWrapperUrl({auth:a});const _=new URL(m);_.search="",_.searchParams.set("confId",c),m=_.toString();const v={conferenceId:c,isAudioOnly:"voice"===n,domain:i,auth:a,roomName:o.name},E="jitsi_"+s.a.get().credentials.userId+"_"+Date.now();h.a.setRoomWidget(t,E,f.a.JITSI,m,"Jitsi",v).then(()=>{console.log("Jitsi widget added")}).catch(e=>{"M_FORBIDDEN"===e.errcode&&l.a.createTrackedDialog("Call Failed","",y.a,{title:Object(d.a)("Permission Required"),description:Object(d.a)("You do not have permission to start a conference call in this room")}),console.error(e)})}terminateCallApp(e){l.a.createTrackedDialog("Confirm Jitsi Terminate","",v.a,{hasCancelButton:!0,title:Object(d.a)("End conference"),description:Object(d.a)("This will end the conference for everyone. Continue?"),button:Object(d.a)("End conference"),onFinished:t=>{if(!t)return;E.a.instance.getRoom(e).widgets.filter(e=>f.a.JITSI.matches(e.type)).forEach(t=>{h.a.setRoomWidget(e,t.id)})}})}hangupCallApp(e){const t=E.a.instance.getRoom(e);if(!t)return;t.widgets.filter(e=>f.a.JITSI.matches(e.type)).forEach(e=>{const t=S.a.instance.getMessagingForId(e.id);t&&t.transport.send(w.a.HangupCall,{})})}}}).call(this,n(35).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n(130),r=n(92),i=n(98),a=n(93),s=n(261),c=n(94),l=n(175),d=n(155),u=n(135),h=n(88),p=n(3);class m{static canUserModifyWidgets(e){if(!e)return console.warn("No room ID specified"),!1;const t=r.a.get();if(!t)return console.warn("User must be be logged in"),!1;const n=t.getRoom(e);if(!n)return console.warn(`Room ID ${e} is not recognised`),!1;const o=t.credentials.userId;return o?"join"!==n.getMyMembership()?(console.warn(`User ${o} is not in room ${e}`),!1):n.currentState.maySendStateEvent("im.vector.modular.widgets",o):(console.warn("Failed to get user ID"),!1)}static isScalarUrl(e){if(!e)return console.error("Scalar URL check failed. No URL specified"),!1;const t=o.parse(e);let n=i.a.get().integrations_widgets_urls;if(!n||0===n.length){const e=l.a.sharedInstance().getPrimaryManager();n=e?[e.apiUrl]:[]}for(let e=0;e{function i(n){return!(!n||!n.getContent())&&(t?void 0!==n.getContent()[e]:void 0===n.getContent()[e])}if(i(r.a.get().getAccountData("m.widgets")))return void n();function a(e){i(r.a.get().getAccountData("m.widgets"))&&(r.a.get().removeListener("accountData",a),clearTimeout(s),n())}const s=setTimeout(()=>{r.a.get().removeListener("accountData",a),o(new Error("Timed out waiting for widget ID "+e+" to appear"))},2e4);r.a.get().on("accountData",a)})}static waitForRoomWidget(e,t,n){return new Promise((o,i)=>{function a(t){const o=t.some(t=>t.getContent()&&t.getContent().id===e);return n?o:!o}const s=r.a.get().getRoom(t);if(a(s.currentState.getStateEvents("im.vector.modular.widgets")))return void o();function c(e){if(e.getRoomId()!==t)return;a(s.currentState.getStateEvents("im.vector.modular.widgets"))&&(r.a.get().removeListener("RoomState.events",c),clearTimeout(l),o())}const l=setTimeout(()=>{r.a.get().removeListener("RoomState.events",c),i(new Error("Timed out waiting for widget ID "+e+" to appear"))},2e4);r.a.get().on("RoomState.events",c)})}static setUserWidget(e,t,n,o,i){const s={type:t.preferred,url:n,name:o,data:i},c=r.a.get(),l=Object(u.a)(m.getUserWidgets());try{delete l[e]}catch(e){console.error("$widgetId is non-configurable")}const d=Boolean(n);return d&&(l[e]={content:s,sender:c.getUserId(),state_key:e,type:"m.widget",id:e}),c.setAccountData("m.widgets",l).then(()=>m.waitForUserWidget(e,d)).then(()=>{a.a.dispatch({action:"user_widget_updated"})})}static setRoomWidget(e,t,n,o,r,i){let a;return a=Boolean(o)?{type:n.legacy,url:o,name:r,data:i}:{},m.setRoomWidgetContent(e,t,a)}static setRoomWidgetContent(e,t,n){const o=!!n.url;s.a.setRoomWidgetEcho(e,t,n);return r.a.get().sendStateEvent(e,"im.vector.modular.widgets",n,t).then(()=>m.waitForRoomWidget(t,e,o)).finally(()=>{s.a.removeRoomWidgetEcho(e,t)})}static getRoomWidgets(e){const t=e.currentState.getStateEvents("im.vector.modular.widgets");return t?t.filter(e=>e.getContent().type&&e.getContent().url):[]}static getUserWidgets(){const e=r.a.get();if(!e)throw new Error("User not logged in");const t=e.getAccountData("m.widgets");return t&&t.getContent()?t.getContent():{}}static getUserWidgetsArray(){return Object.values(m.getUserWidgets())}static getStickerpickerWidgets(){return m.getUserWidgetsArray().filter(e=>e.content&&"m.stickerpicker"===e.content.type)}static getIntegrationManagerWidgets(){return m.getUserWidgetsArray().filter(e=>e.content&&"m.integration_manager"===e.content.type)}static getRoomWidgetsOfType(e,t){return(m.getRoomWidgets(e)||[]).filter(e=>{const n=e.getContent();return n.url&&t.matches(n.type)})}static removeIntegrationManagerWidgets(){const e=r.a.get();if(!e)throw new Error("User not logged in");const t=e.getAccountData("m.widgets");if(!t)return;const n=t.getContent()||{};return Object.entries(n).forEach(([e,t])=>{t.content&&"m.integration_manager"===t.content.type&&delete n[e]}),e.setAccountData("m.widgets",n)}static addIntegrationManagerWidget(e,t,n){return m.setUserWidget("integration_manager_"+(new Date).getTime(),d.a.INTEGRATION_MANAGER,t,"Integration Manager: "+e,{api_url:n})}static removeStickerpickerWidgets(){const e=r.a.get();if(!e)throw new Error("User not logged in");const t=e.getAccountData("m.widgets");if(!t)return;const n=t.getContent()||{};return Object.entries(n).forEach(([e,t])=>{t.content&&"m.stickerpicker"===t.content.type&&delete n[e]}),e.setAccountData("m.widgets",n)}static makeAppConfig(e,t,n,o,r){if(!n)throw new Error("Widgets must be created by someone - provide a senderUserId");return t.creatorUserId=n,t.id=e,t.roomId=o,t.eventId=r,t.name=t.name||t.type,t}static getCapWhitelistForAppTypeInRoomId(e,t){const n=c.b.getValue("enableWidgetScreenshots",t)?[p.MatrixCapabilities.Screenshots]:[];return d.a.JITSI.matches(e)&&n.push(p.MatrixCapabilities.AlwaysOnScreen),n}static getLocalJitsiWrapperUrl(e={}){const t=["conferenceDomain=$domain","conferenceId=$conferenceId","isAudioOnly=$isAudioOnly","displayName=$matrix_display_name","avatarUrl=$matrix_avatar_url","userId=$matrix_user_id","roomId=$matrix_room_id","theme=$theme","roomName=$roomName"];e.auth&&t.push("auth="+e.auth);const n=t.join("&");let o=window.location.href;"https:"===window.location.protocol||e.forLocalRender||(o="https://app.element.io/");return new URL("jitsi.html#"+n,o).href}static getWidgetName(e){var t;return(null==e||null===(t=e.name)||void 0===t?void 0:t.trim())||Object(h.a)("Unknown App")}static getWidgetDataTitle(e){var t,n;return(null==e||null===(t=e.data)||void 0===t||null===(n=t.title)||void 0===n?void 0:n.trim())||""}static editWidget(e,t){c.b.getValue("feature_many_integration_managers")?l.a.sharedInstance().openAll(e,"type_"+t.type,t.id):l.a.sharedInstance().getPrimaryManager().open(e,"type_"+t.type,t.id)}static isManagedByManager(e){if(m.isScalarUrl(e.url)){const e=l.a.sharedInstance();if(e.hasManager()){const t=e.getPrimaryManager();return m.isScalarUrl(t.apiUrl)}}return!1}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"f",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"a",(function(){return l}));var o=n(117);function r(e,t){const n=new Map(Object.entries(e));for(const e of t)n.delete(e);return Array.from(n.entries()).reduce((e,[t,n])=>(e[t]=n,e),{})}function i(e,t){const n=Object.keys(e),i=Object(o.a)(n,t);return 0===i.removed.length?a(e):r(e,i.removed)}function a(e,t){const n={};for(const[o,r]of Object.entries(e))n[o]=r,t&&(n[o]=t(o,r));return n}function s(e,t){if(e===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!0;const i=Object(o.k)(n,r);return i.length!==n.length||i.some(n=>e[n]!==t[n])}function c(e,t){const n=function(e,t){const n=Object.keys(e),r=Object.keys(t),i=Object(o.a)(n,r);return{changed:Object(o.k)(n,r).filter(n=>e[n]!==t[n]),added:i.added,removed:i.removed}}(e,t);return Object(o.f)(n.removed,n.added,n.changed)}function l(e){return JSON.parse(JSON.stringify(e))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(91),c=n.n(s),l=n(97),d=n.n(l),u=n(90),h=n(88);class p extends a.a.Component{constructor(...e){super(...e),r()(this,"onOk",()=>{this.props.onFinished(!0)}),r()(this,"onCancel",()=>{this.props.onFinished(!1)})}render(){const e=u.getComponent("views.dialogs.BaseDialog"),t=u.getComponent("views.elements.DialogButtons");let n="";return this.props.danger&&(n="danger"),a.a.createElement(e,{className:d()("mx_QuestionDialog",this.props.className),onFinished:this.props.onFinished,title:this.props.title,contentId:"mx_Dialog_content",headerImage:this.props.headerImage,hasCancel:this.props.hasCancelButton,fixedWidth:this.props.fixedWidth},a.a.createElement("div",{className:"mx_Dialog_content",id:"mx_Dialog_content"},this.props.description),a.a.createElement(t,{primaryButton:this.props.button||Object(h.a)("OK"),primaryButtonClass:n,primaryDisabled:this.props.buttonDisabled,cancelButton:this.props.cancelButton,hasCancel:this.props.hasCancelButton&&!this.props.quitOnly,onPrimaryButtonClick:this.onOk,focus:this.props.focus,onCancel:this.onCancel},this.props.extraButtons))}}r()(p,"propTypes",{title:c.a.string,description:c.a.node,extraButtons:c.a.node,button:c.a.string,buttonDisabled:c.a.bool,danger:c.a.bool,focus:c.a.bool,onFinished:c.a.func.isRequired,headerImage:c.a.string,quitOnly:c.a.bool,fixedWidth:c.a.bool,className:c.a.string}),r()(p,"defaultProps",{title:"",description:"",extraButtons:null,focus:!0,hasCancelButton:!0,danger:!1,quitOnly:!1})},function(e,t,n){"use strict";function o(e,t){return function(e){const t=Object.keys(e),n=[];for(const o of t){const t=e[o];(Number.isFinite(t)||e[t.toString()]!==Number(o))&&n.push(t)}return n}(e).includes(t)}let r;n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return s})),function(e){e.Invite="im.vector.fake.invite",e.Untagged="im.vector.fake.recent",e.Archived="im.vector.fake.archived",e.LowPriority="m.lowpriority",e.Favourite="m.favourite",e.DM="im.vector.fake.direct",e.ServerNotice="m.server_notice",e.Suggested="im.vector.fake.suggested"}(r||(r={}));const i=[r.Invite,r.Favourite,r.DM,r.Untagged,r.LowPriority,r.ServerNotice,r.Suggested,r.Archived];function a(e){return!o(r,e)}let s;!function(e){e.Timeline="TIMELINE",e.PossibleTagChange="POSSIBLE_TAG_CHANGE",e.ReadReceipt="READ_RECEIPT",e.NewRoom="NEW_ROOM",e.RoomRemoved="ROOM_REMOVED"}(s||(s={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return w})),n.d(t,"d",(function(){return C})),n.d(t,"b",(function(){return T})),n.d(t,"c",(function(){return x})),n.d(t,"f",(function(){return R})),n.d(t,"e",(function(){return A}));var o=n(18),r=n.n(o),i=n(111),a=n(110),s=n(146),c=n(93),l=n(154),d=n(94),u=n(122),h=n(208),p=n(117),m=n(225);class g extends m.b{constructor(e,t){super(),this.spaceId=e,this.getRoomFn=t,r()(this,"rooms",[]),r()(this,"states",{}),r()(this,"onRoomNotificationStateUpdate",()=>{this.calculateTotalState()})}get symbol(){return null}setRooms(e){const t=this.rooms,n=Object(p.a)(t,e);this.rooms=e;for(const e of n.removed){const t=this.states[e.roomId];t&&(delete this.states[e.roomId],t.off(m.a,this.onRoomNotificationStateUpdate))}for(const e of n.added){const t=this.getRoomFn(e);t.on(m.a,this.onRoomNotificationStateUpdate),this.states[e.roomId]=t}this.calculateTotalState()}destroy(){super.destroy();for(const e of Object.values(this.states))e.off(m.a,this.onRoomNotificationStateUpdate);this.states={}}calculateTotalState(){const e=this.snapshot();this._count=0,this._color=h.a.None;for(const e of Object.values(this.states))this._count+=e.count,this._color=Math.max(this.color,e.color);this.emitIfUpdated(e)}}var f=n(166),_=n(137),b=n(351),v=n(411),y=n(129);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function S(e){for(var t=1;t"mx_space_context_"+((null==e?void 0:e.roomId)||"ALL_ROOMS"),k=e=>e.reduce((e,t)=>(e[t.isSpaceRoom()?0:1].push(t),e),[[],[]]),R=(e,t,n)=>{let o=null;return"string"==typeof e&&Array.from(e).every(e=>{const t=e.charCodeAt(0);return t>=32&&t<=126})&&(o=e),[o,t,n]},I=e=>f.a.instance.getRoomState(e);class D extends s.a{constructor(){super(c.a,{}),r()(this,"rootSpaces",[]),r()(this,"parentMap",new b.a),r()(this,"notificationStateMap",new Map),r()(this,"spaceFilteredRooms",new Map),r()(this,"_activeSpace",null),r()(this,"_suggestedRooms",[]),r()(this,"_invitedSpaces",new Set),r()(this,"fetchSuggestedRooms",async(e,t=20)=>{try{const n=await this.matrixClient.getSpaceSummary(e.roomId,0,!0,!1,t),o=new b.a;return n.events.forEach(e=>{var t;e.type===a.a.SpaceChild&&null!==(t=e.content.via)&&void 0!==t&&t.length&&e.content.via.forEach(t=>{o.getOrCreate(e.state_key,new Set).add(t)})}),n.rooms.filter(e=>{var t;return e.room_type!==a.d.Space&&"join"!==(null===(t=this.matrixClient.getRoom(e.room_id))||void 0===t?void 0:t.getMyMembership())}).map(e=>S(S({},e),{},{viaServers:Array.from(o.get(e.room_id)||[])}))}catch(e){console.error(e)}return[]}),r()(this,"getSpaceFilteredRoomIds",e=>e?this.spaceFilteredRooms.get(e.roomId)||new Set:new Set(this.matrixClient.getVisibleRooms().map(e=>e.roomId))),r()(this,"rebuild",Object(i.throttle)(()=>{const[e,t]=k(this.matrixClient.getVisibleRooms()),[n,o]=e.reduce((e,t)=>("join"===t.getMyMembership()?e[0].push(t):"invite"===t.getMyMembership()&&e[1].push(t),e),[[],[]]),r=new Set([...t,...n]),a=new b.a,s=Object(i.sortBy)(n,e=>e.roomId);s.forEach(e=>{this.getChildren(e.roomId).forEach(t=>{r.delete(t),a.getOrCreate(t.roomId,new Set).add(e.roomId)})});const[c]=k(Array.from(r)),l=new Set(s),d=(e,t)=>{const n=[e];for(;n.length;){const e=n.pop();t.delete(e),this.getChildSpaces(e.roomId).forEach(e=>{t.has(e)&&n.push(e)})}};c.forEach(e=>{d(e,l)}),Array.from(l).forEach(e=>{l.has(e)&&(l.delete(e),c.push(e),d(e,l))}),this.rootSpaces=c,this.parentMap=a,this._activeSpace&&l.has(this._activeSpace)&&this.setActiveSpace(null,!1),this.onRoomsUpdate(),this.emit(C,this.spacePanelSpaces),this._invitedSpaces=new Set(o),this.emit(T,this.invitedSpaces)},100,{trailing:!0,leading:!0})),r()(this,"onSpaceUpdate",()=>{this.rebuild()}),r()(this,"onSpaceMembersChange",e=>{u.a.shared().getDMRoomsForUserId(e.getStateKey()).length<1||this.onRoomsUpdate()}),r()(this,"onRoomsUpdate",Object(i.throttle)(()=>{const e=this.matrixClient.getVisibleRooms(),t=this.spaceFilteredRooms;this.spaceFilteredRooms=new Map,this.rootSpaces.forEach(e=>{const t=(e,n)=>{var o;if(n.has(e))return;if(this.spaceFilteredRooms.has(e))return this.spaceFilteredRooms.get(e);const[r,i]=k(this.getChildren(e)),a=new Set(i.map(e=>e.roomId)),s=null===(o=this.matrixClient)||void 0===o?void 0:o.getRoom(e);null==s||s.getMembers().forEach(e=>{"join"!==e.membership&&"invite"!==e.membership||u.a.shared().getDMRoomsForUserId(e.userId).forEach(e=>{a.add(e)})});const c=new Set(n).add(e);return r.forEach(e=>{var n;null===(n=t(e.roomId,c))||void 0===n||n.forEach(e=>{a.add(e)})}),this.spaceFilteredRooms.set(e,a),a};t(e.roomId,new Set)});const n=Object(b.b)(t,this.spaceFilteredRooms),o=n.changed.filter(e=>Object(v.a)(t.get(e),this.spaceFilteredRooms.get(e)));[...n.added,...n.removed,...o].forEach(e=>{this.emit(e)}),this.spaceFilteredRooms.forEach((t,n)=>{var o;null===(o=this.getNotificationState(n))||void 0===o||o.setRooms(e.filter(e=>!!t.has(e.roomId)&&(!u.a.shared().getUserIdForRoomId(e.roomId)||l.b.instance.getTagsForRoom(e).includes(_.a.Favourite))))})},100,{trailing:!0,leading:!0})),r()(this,"switchToRelatedSpace",e=>{if(this.suggestedRooms.find(t=>t.room_id===e))return;let t=this.getCanonicalParent(e);if(t||(t=this.rootSpaces.find(t=>{var n;return null===(n=this.spaceFilteredRooms.get(t.roomId))||void 0===n?void 0:n.has(e)})),!t){t=Array.from(this.parentMap.get(e)||[]).find(e=>this.matrixClient.getRoom(e))}this.setActiveSpace(t||null,!1)}),r()(this,"onRoom",(e,t,n)=>{const o=t||e.getMyMembership();if(e.isSpaceRoom())"invite"===o?(this._invitedSpaces.add(e),this.emit(T,this.invitedSpaces)):"invite"===n&&"join"!==o?(this._invitedSpaces.delete(e),this.emit(T,this.invitedSpaces)):(this.onSpaceUpdate(),this.emit(e.roomId)),"join"===o&&e.roomId===y.a.getRoomId()&&this.setActiveSpace(e,!1);else if(this.onRoomsUpdate(),"join"===o){const n=this._suggestedRooms.length;this._suggestedRooms=this._suggestedRooms.filter(t=>t.room_id!==e.roomId),n!==this._suggestedRooms.length&&this.emit(w,this._suggestedRooms),"join"===t&&e.roomId===y.a.getRoomId()&&this.switchToRelatedSpace(e.roomId)}}),r()(this,"onRoomState",e=>{const t=this.matrixClient.getRoom(e.getRoomId());if(t)switch(e.getType()){case a.a.SpaceChild:t.isSpaceRoom()&&(this.onSpaceUpdate(),this.emit(t.roomId));break;case a.a.SpaceParent:t.isSpaceRoom()&&this.onSpaceUpdate(),this.emit(t.roomId);break;case a.a.RoomMember:t.isSpaceRoom()&&this.onSpaceMembersChange(e)}})}get invitedSpaces(){return Array.from(this._invitedSpaces)}get spacePanelSpaces(){return this.rootSpaces}get activeSpace(){return this._activeSpace||null}get suggestedRooms(){return this._suggestedRooms}async setActiveSpace(e,t=!0){if(e!==this.activeSpace&&(!e||null!=e&&e.isSpaceRoom())){if(this._activeSpace=e,this.emit(x,this.activeSpace),this.emit(w,this._suggestedRooms=[]),t){var n,o;const t=window.localStorage.getItem(O(this.activeSpace));"invite"!==(null==e?void 0:e.getMyMembership)&&"join"===(null===(n=this.matrixClient)||void 0===n||null===(o=n.getRoom(t))||void 0===o?void 0:o.getMyMembership())?c.a.dispatch({action:"view_room",room_id:t,context_switch:!0}):e?c.a.dispatch({action:"view_room",room_id:e.roomId,context_switch:!0}):c.a.dispatch({action:"view_home_page"})}if(e?window.localStorage.setItem("mx_active_space",e.roomId):window.localStorage.removeItem("mx_active_space"),e){const t=await this.fetchSuggestedRooms(e);this._activeSpace===e&&(this._suggestedRooms=t,this.emit(w,this._suggestedRooms))}}}addRoomToSpace(e,t,n,o=!1,r=!1){return this.matrixClient.sendStateEvent(e.roomId,a.a.SpaceChild,{via:n,suggested:o,auto_join:r},t)}getChildren(e){var t;const n=null===(t=this.matrixClient)||void 0===t?void 0:t.getRoom(e),o=null==n?void 0:n.currentState.getStateEvents(a.a.SpaceChild).filter(e=>{var t;return null===(t=e.getContent())||void 0===t?void 0:t.via});return Object(i.sortBy)(o,e=>{var t,n;const o=e.getStateKey(),r=null===(t=this.matrixClient)||void 0===t?void 0:t.getRoom(o),i=null==r||null===(n=r.currentState.getStateEvents(a.a.RoomCreate,""))||void 0===n?void 0:n.getTs();return R(e.getContent().order,i,o)}).map(e=>this.matrixClient.getRoom(e.getStateKey())).filter(e=>"join"===(null==e?void 0:e.getMyMembership())||"invite"===(null==e?void 0:e.getMyMembership()))||[]}getChildRooms(e){return this.getChildren(e).filter(e=>!e.isSpaceRoom())}getChildSpaces(e){return this.getChildren(e).filter(e=>e.isSpaceRoom()&&"join"===e.getMyMembership())}getParents(e,t=!1){var n;const o=null===(n=this.matrixClient)||void 0===n?void 0:n.getRoom(e);return(null==o?void 0:o.currentState.getStateEvents(a.a.SpaceParent).filter(e=>{var n;const o=e.getContent();return!(null==o||null===(n=o.via)||void 0===n||!n.length)&&!(t&&(null==o||!o.canonical))}).map(e=>this.matrixClient.getRoom(e.getStateKey())).filter(Boolean))||[]}getCanonicalParent(e){var t;const n=this.getParents(e,!0);return(null===(t=Object(i.sortBy)(n,e=>e.roomId))||void 0===t?void 0:t[0])||null}async reset(){this.rootSpaces=[],this.parentMap=new b.a,this.notificationStateMap=new Map,this.spaceFilteredRooms=new Map,this._activeSpace=null,this._suggestedRooms=[],this._invitedSpaces=new Set}async onNotReady(){d.b.getValue("feature_spaces")&&(this.matrixClient&&(this.matrixClient.removeListener("Room",this.onRoom),this.matrixClient.removeListener("Room.myMembership",this.onRoom),this.matrixClient.removeListener("RoomState.events",this.onRoomState)),await this.reset())}async onReady(){if(!d.b.getValue("feature_spaces"))return;this.matrixClient.on("Room",this.onRoom),this.matrixClient.on("Room.myMembership",this.onRoom),this.matrixClient.on("RoomState.events",this.onRoomState),await this.onSpaceUpdate();const e=window.localStorage.getItem("mx_active_space");e&&this.setActiveSpace(this.matrixClient.getRoom(e))}async onAction(e){if(d.b.getValue("feature_spaces"))switch(e.action){case"view_room":{var t;if(e.context_switch)break;const n=e.room_id,o=null===(t=this.matrixClient)||void 0===t?void 0:t.getRoom(n);null!=o&&o.isSpaceRoom()?this.setActiveSpace(o,!1):this.activeSpace&&!this.getSpaceFilteredRoomIds(this.activeSpace).has(n)&&this.switchToRelatedSpace(n),window.localStorage.setItem(O(this.activeSpace),e.room_id);break}case"after_leave_room":this._activeSpace&&e.room_id===this._activeSpace.roomId&&this.setActiveSpace(null,!1)}}getNotificationState(e){if(this.notificationStateMap.has(e))return this.notificationStateMap.get(e);const t=new g(e,I);return this.notificationStateMap.set(e,t),t}traverseSpace(e,t,n=!1,o){if(o&&o.has(e))return;t(e);const r=new Set(o).add(e),[i,a]=k(this.getChildren(e));n&&a.forEach(e=>t(e.roomId)),i.forEach(e=>this.traverseSpace(e.roomId,t,n,r))}}class A{static get instance(){return A.internalInstance}}r()(A,"internalInstance",new D),window.mxSpaceStore=A.instance},function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var o,r,i,a=n(99),s=n.n(a),c=n(104),l=n.n(c),d=n(18),u=n.n(d),h=n(87),p=n.n(h),m=n(176),g=n(89);let f=Object(g.a)("views.elements.StyledCheckbox")((i=r=class extends p.a.PureComponent{constructor(e){super(e),u()(this,"id",void 0),this.id="checkbox_"+Object(m.b)(10)}render(){const e=this.props,{children:t,className:o}=e,r=l()(e,["children","className"]);return p.a.createElement("span",{className:"mx_Checkbox "+o},p.a.createElement("input",s()({id:this.id},r,{type:"checkbox"})),p.a.createElement("label",{htmlFor:this.id},p.a.createElement("div",{className:"mx_Checkbox_background"},p.a.createElement("img",{src:n(800)})),p.a.createElement("div",null,this.props.children)))}},u()(r,"defaultProps",{className:""}),o=i))||o},function(e,t,n){"use strict";function o(e,t){return new Promise(n=>{setTimeout(n,e,t)})}async function r(e,t,n){const o=new Promise(o=>{const r=setTimeout(o,n,t);e.then(()=>{clearTimeout(r)})});return Promise.race([e,o])}function i(){let e,t;const n=new Promise((n,o)=>{e=n,t=o});return{resolve:e,reject:t,promise:n}}async function a(e,t,n){let o;for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:0;return n={},(0,r.default)(n,e,t),(0,r.default)(n,"x"===e?"y":"x",o),n};var a=t.distance=function(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))};t.closest=function(e,t){return Math.min.apply(Math,(0,o.default)(t.map((function(t){return a(e,t)}))))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"d",(function(){return u})),n.d(t,"e",(function(){return h})),n.d(t,"f",(function(){return p}));var o=n(88);function r(){return[Object(o.a)("Sun"),Object(o.a)("Mon"),Object(o.a)("Tue"),Object(o.a)("Wed"),Object(o.a)("Thu"),Object(o.a)("Fri"),Object(o.a)("Sat")]}function i(){return[Object(o.a)("Jan"),Object(o.a)("Feb"),Object(o.a)("Mar"),Object(o.a)("Apr"),Object(o.a)("May"),Object(o.a)("Jun"),Object(o.a)("Jul"),Object(o.a)("Aug"),Object(o.a)("Sep"),Object(o.a)("Oct"),Object(o.a)("Nov"),Object(o.a)("Dec")]}function a(e){return(e<10?"0":"")+e}function s(e,t=!1){let n=e.getHours()%12;const r=a(e.getMinutes()),i=e.getHours()>=12?Object(o.a)("PM"):Object(o.a)("AM");if(n=n||12,t){return`${n}:${r}:${a(e.getSeconds())}${i}`}return`${n}:${r}${i}`}function c(e,t=!1){const n=new Date,a=r(),s=i();return e.toDateString()===n.toDateString()?h(e,t):n.getTime()-e.getTime()<5184e5?Object(o.a)("%(weekDayName)s %(time)s",{weekDayName:a[e.getDay()],time:h(e,t)}):n.getFullYear()===e.getFullYear()?Object(o.a)("%(weekDayName)s, %(monthName)s %(day)s %(time)s",{weekDayName:a[e.getDay()],monthName:s[e.getMonth()],day:e.getDate(),time:h(e,t)}):d(e,t)}function l(e){const t=r(),n=i();return Object(o.a)("%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s",{weekDayName:t[e.getDay()],monthName:n[e.getMonth()],day:e.getDate(),fullYear:e.getFullYear()})}function d(e,t=!1,n=!0){const a=r(),s=i();return Object(o.a)("%(weekDayName)s, %(monthName)s %(day)s %(fullYear)s %(time)s",{weekDayName:a[e.getDay()],monthName:s[e.getMonth()],day:e.getDate(),fullYear:e.getFullYear(),time:n?u(e,t):h(e,t)})}function u(e,t=!1){return t?s(e,!0):a(e.getHours())+":"+a(e.getMinutes())+":"+a(e.getSeconds())}function h(e,t=!1){return t?s(e):a(e.getHours())+":"+a(e.getMinutes())}function p(e,t){return!(!t||!e)&&(Math.abs(e.getTime()-t.getTime())>864e5||e.getDay()!==t.getDay())}},function(e,t,n){"use strict";n.r(t),function(e,o){n.d(t,"OLM_ALGORITHM",(function(){return c})),n.d(t,"MEGOLM_ALGORITHM",(function(){return l})),n.d(t,"MEGOLM_BACKUP_ALGORITHM",(function(){return d})),n.d(t,"encryptMessageForDevice",(function(){return u})),n.d(t,"getExistingOlmSessions",(function(){return h})),n.d(t,"ensureOlmSessionsForDevices",(function(){return p})),n.d(t,"verifySignature",(function(){return g})),n.d(t,"pkSign",(function(){return f})),n.d(t,"pkVerify",(function(){return _})),n.d(t,"encodeBase64",(function(){return b})),n.d(t,"encodeUnpaddedBase64",(function(){return v})),n.d(t,"decodeBase64",(function(){return y}));var r=n(0),i=n(1),a=n(346),s=n.n(a);const c="m.olm.v1.curve25519-aes-sha2",l="m.megolm.v1.aes-sha2",d="m.megolm_backup.v1.curve25519-aes-sha2";async function u(e,t,n,o,a,s,c){const l=s.getIdentityKey(),d=await o.getSessionIdForDevice(l);if(null===d)return;r.a.log("Using sessionid "+d+" for device "+a+":"+s.deviceId);const u={sender:t,sender_device:n,keys:{ed25519:o.deviceEd25519Key},recipient:a,recipient_keys:{ed25519:s.getFingerprint()}};i.j(u,c),e[l]=await o.encryptMessage(l,d,JSON.stringify(u))}async function h(e,t,n){const o={},r={},i=[];for(const[t,a]of Object.entries(n))for(const n of a){const a=n.deviceId,s=n.getIdentityKey();i.push((async()=>{const i=await e.getSessionIdForDevice(s,!0);null===i?(o[t]=o[t]||[],o[t].push(n)):(r[t]=r[t]||{},r[t][a]={device:n,sessionId:i})})())}return await Promise.all(i),[o,r]}async function p(e,t,n,o,i,a,s){"number"==typeof o&&(s=a,a=i,i=o,o=!1),s||(s=r.a);const c=[],l={},d={};for(const[,t]of Object.entries(n))for(const n of t){const t=n.getIdentityKey();t!==e.deviceCurve25519Key&&(e._sessionsInProgress[t]||(e._sessionsInProgress[t]=new Promise(n=>{d[t]=(...o)=>{delete e._sessionsInProgress[t],n(...o)}})))}for(const[t,r]of Object.entries(n)){l[t]={};for(const n of r){const r=n.deviceId,i=n.getIdentityKey();if(i===e.deviceCurve25519Key){s.info("Attempted to start session with ourself! Ignoring"),l[t][r]={device:n,sessionId:null};continue}const a=`for ${i} (${t}:${r})`,u=await e.getSessionIdForDevice(i,d[i],s);null!==u&&d[i]&&d[i](),(null===u||o)&&(o?s.info("Forcing new Olm session "+a):s.info("Making new Olm session "+a),c.push([t,r])),l[t][r]={device:n,sessionId:u}}}if(0===c.length)return l;let u,h=`one-time keys for ${c.length} devices`;try{s.debug("Claiming "+h),u=await t.claimOneTimeKeys(c,"signed_curve25519",i),s.debug("Claimed "+h)}catch(e){for(const e of Object.values(d))e();throw s.log("Failed to claim "+h,e,c),e}a&&"failures"in u&&a.push(...Object.keys(u.failures));const p=u.one_time_keys||{},g=[];for(const[t,r]of Object.entries(n)){const n=p[t]||{};for(let i=0;i{d[u]&&d[u](e),l[t][c].sessionId=e},e=>{throw d[u]&&d[u](),e})):(s.warn(`No one-time keys (alg=signed_curve25519) for device ${t}:${c}`),d[u]&&d[u]())}}return h=`Olm sessions for ${g.length} devices`,s.debug("Starting "+h),await Promise.all(g),s.debug("Started "+h),l}async function m(e,t,n,o){const i=o.deviceId;try{await g(e,t,n,i,o.getFingerprint())}catch(e){return r.a.error("Unable to verify signature on one-time key for device "+n+":"+i+":",e),null}let a;try{a=await e.createOutboundSession(o.getIdentityKey(),t.key)}catch(e){return r.a.error("Error starting olm session with device "+n+":"+i+": "+e),null}return r.a.log("Started new olm sessionid "+a+" for device "+n+":"+i),a}async function g(e,t,n,o,r){const i="ed25519:"+o,a=((t.signatures||{})[n]||{})[i];if(!a)throw Error("No signature");const c=Object.assign({},t);delete c.unsigned,delete c.signatures;const l=s.a.stringify(c);e.verifySignature(r,l,a)}function f(t,n,o,r){let i=!1;if(n instanceof Uint8Array){const t=new e.Olm.PkSigning;r=t.init_with_seed(n),n=t,i=!0}const a=t.signatures||{};delete t.signatures;const c=t.unsigned;t.unsigned&&delete t.unsigned;try{const e=a[o]||{};return a[o]=e,e["ed25519:"+r]=n.sign(s.a.stringify(t))}finally{t.signatures=a,c&&(t.unsigned=c),i&&n.free()}}function _(t,n,o){const r="ed25519:"+n;if(!(t.signatures&&t.signatures[o]&&t.signatures[o][r]))throw new Error("No signature");const i=t.signatures[o][r],a=new e.Olm.Utility,c=t.signatures;delete t.signatures;const l=t.unsigned;t.unsigned&&delete t.unsigned;try{a.ed25519_verify(n,s.a.stringify(t),i)}finally{t.signatures=c,l&&(t.unsigned=l),a.free()}}function b(e){return o.from(e).toString("base64")}function v(e){return b(e).replace(/=+$/g,"")}function y(e){return o.from(e,"base64")}}.call(this,n(7),n(35).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(18),r=n.n(o),i=n(8),a=n.n(i);class s extends a.a{constructor(...e){super(...e),r()(this,"toasts",[]),r()(this,"countSeen",0)}static sharedInstance(){return window.mxToastStore||(window.mxToastStore=new s),window.mxToastStore}reset(){this.toasts=[],this.countSeen=0}addOrReplaceToast(e){const t=this.toasts.findIndex(t=>t.key===e.key);if(-1===t){let t=this.toasts.length;for(;t>0&&this.toasts[t-1].priorityt.key!==e),t!==this.toasts.length&&(0===this.toasts.length&&(this.countSeen=0),this.emit("update"))}getToasts(){return this.toasts}getCountSeen(){return this.countSeen}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var o=n(18),r=n.n(o),i=n(8),a=n.n(i),s=n(516),c=n.n(s);let l;!function(e){e.Resize="resize"}(l||(l={}));class d extends a.a{constructor(){super(),r()(this,"resizeObserver",void 0),r()(this,"uiElementDimensions",new Map),r()(this,"trackedUiElements",new Map),r()(this,"windowWidth",void 0),r()(this,"windowHeight",void 0),r()(this,"resizeObserverCallback",e=>{const t=e.find(e=>e.target===document.body);t&&(this.windowWidth=t.contentRect.width,this.windowHeight=t.contentRect.height),e.forEach(e=>{const t=this.trackedUiElements.get(e.target);t&&(this.uiElementDimensions.set(t,e.contentRect),this.emit(t,l.Resize,e))}),this.emit(l.Resize,e)}),this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.resizeObserver=new c.a(this.resizeObserverCallback),this.resizeObserver.observe(document.body)}static get instance(){return d._instance||(d._instance=new d),d._instance}static destroy(){d._instance&&(d._instance.resizeObserver.disconnect(),d._instance.removeAllListeners(),d._instance=null)}getElementDimensions(e){return this.uiElementDimensions.get(e)}trackElementDimensions(e,t){this.trackedUiElements.set(t,e),this.resizeObserver.observe(t)}stopTrackingElementDimensions(e){let t;this.trackedUiElements.forEach((n,o)=>{n===e&&(t=o)}),t&&(this.resizeObserver.unobserve(t),this.uiElementDimensions.delete(e),this.trackedUiElements.delete(t))}isTrackingElementDimensions(e){return this.uiElementDimensions.has(e)}}r()(d,"_instance",null),window.mxUIStore=d.instance},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(18),r=n.n(o),i=n(116),a=n(525);class s extends i.a{constructor(e,t={}){super(e,t),r()(this,"readyStore",void 0);const n=this;this.readyStore=new class extends a.a{get mxClient(){return this.matrixClient}async onReady(){return n.onReady()}async onNotReady(){return n.onNotReady()}}(e)}get matrixClient(){return this.readyStore.mxClient}async onReady(){}async onNotReady(){}async onDispatch(e){await this.onAction(e)}}},function(e,t){var n=e.exports={version:"2.6.12"};"number"==typeof __e&&(__e=n)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,n=void 0,r=[],i=void 0,a=!1,s=function(e,n){return t(e,r[n])},c=function(){for(var t=arguments.length,o=Array(t),c=0;cPromise.resolve({states:e,inviter:n}))}function m(e){const t=c.getComponent("dialogs.InviteDialog");s.a.createTrackedDialog("Start DM","",t,{kind:d.b,initialText:e},null,!1,!0)}function g(e,t=""){s.a.createTrackedDialog("Invite Users","",d.d,{kind:d.c,initialText:t,roomId:e},null,!1,!0)}function f(e,t){s.a.createTrackedDialog("Invite Users to Community","",u.a,{communityName:t,roomId:e},null,!1,!0)}function _(e){const t=h.a.instance.getGeneralChat(e);if(!t)throw new Error("Failed to locate appropriate room to start an invite in");{const n=h.a.instance.getCommunityName(e);f(t.roomId,n)}}function b(e){if(!e||"m.room.third_party_invite"!==e.getType())return!1;const t=["key_validity_url","public_key","display_name"];for(let n=0;n{const n=i.a.get().getRoom(e);y(t.states,n,t.inviter)}).catch(e=>{console.error(e.stack);const t=c.getComponent("dialogs.ErrorDialog");s.a.createTrackedDialog("Failed to invite","",t,{title:Object(l.a)("Failed to invite"),description:e&&e.message?e.message:Object(l.a)("Operation failed")})})}function y(e,t,n){const o=Object.keys(e).filter(t=>"error"===e[t]);if(1===o.length&&n.fatal){const e=c.getComponent("dialogs.ErrorDialog");return s.a.createTrackedDialog("Failed to invite users to the room","",e,{title:Object(l.a)("Failed to invite users to the room:",{roomName:t.name}),description:n.getErrorText(o[0])}),!1}{const i=[];for(const t of o)if("error"===e[t]){const e=n.getErrorText(t);i.push(t+": "+e)}if(i.length>0){const e=r.a.createElement("div",null,i.map(e=>r.a.createElement("div",{key:e},e))),n=c.getComponent("dialogs.ErrorDialog");return s.a.createTrackedDialog("Failed to invite the following users to the room","",n,{title:Object(l.a)("Failed to invite the following users to the %(roomName)s room:",{roomName:t.name}),description:e}),!1}}return!0}},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"request",(function(){return I})),n.d(t,"getRequest",(function(){return D})),n.d(t,"wrapRequest",(function(){return A})),n.d(t,"setCryptoStoreFactory",(function(){return F})),n.d(t,"createClient",(function(){return M}));var o=n(295),r=n(277),i=n(436),a=n(180);n.d(t,"CRYPTO_ENABLED",(function(){return a.a})),n.d(t,"MatrixClient",(function(){return a.b}));var s=n(296);n.d(t,"PREFIX_R0",(function(){return s.h})),n.d(t,"PREFIX_UNSTABLE",(function(){return s.i})),n.d(t,"PREFIX_IDENTITY_V1",(function(){return s.e})),n.d(t,"PREFIX_IDENTITY_V2",(function(){return s.f})),n.d(t,"PREFIX_MEDIA_R0",(function(){return s.g})),n.d(t,"MatrixHttpApi",(function(){return s.d})),n.d(t,"MatrixError",(function(){return s.c})),n.d(t,"ConnectionError",(function(){return s.b})),n.d(t,"AbortError",(function(){return s.a})),n.d(t,"retryNetworkOperation",(function(){return s.j}));var c=n(258);n.d(t,"AutoDiscovery",(function(){return c.a}));var l=n(20);n.d(t,"SyncAccumulator",(function(){return l.a}));var d=n(221);n.d(t,"InvalidStoreError",(function(){return d.b})),n.d(t,"InvalidCryptoStoreError",(function(){return d.a})),n.d(t,"KeySignatureUploadError",(function(){return d.c}));var u=n(108);n.d(t,"EventStatus",(function(){return u.a})),n.d(t,"MatrixEvent",(function(){return u.b}));var h=n(234);n.d(t,"Room",(function(){return h.a}));var p=n(257);n.d(t,"Group",(function(){return p.a}));var m=n(159);n.d(t,"EventTimeline",(function(){return m.a}));var g=n(374);n.d(t,"EventTimelineSet",(function(){return g.a}));var f=n(167);n.d(t,"RoomMember",(function(){return f.a}));var _=n(377);n.d(t,"RoomState",(function(){return _.a}));var b=n(213);n.d(t,"User",(function(){return b.a})),n.d(t,"MatrixScheduler",(function(){return i.a}));var v=n(316);n.d(t,"Filter",(function(){return v.a}));var y=n(442);n.d(t,"TimelineWindow",(function(){return y.b})),n.d(t,"TimelineIndex",(function(){return y.a}));var E=n(443);n.d(t,"InteractiveAuth",(function(){return E.a}));var S=n(205);n.d(t,"SERVICE_TYPES",(function(){return S.a})),n.d(t,"MemoryStore",(function(){return r.a}));var w=n(350);n.d(t,"IndexedDBStore",(function(){return w.a}));var C=n(444);n.d(t,"WebStorageSessionStore",(function(){return C.a})),n.d(t,"MemoryCryptoStore",(function(){return o.a}));var T=n(162);n.d(t,"IndexedDBCryptoStore",(function(){return T.a}));var x=n(278);n.d(t,"getHttpUriForMxc",(function(){return x.a}));var O=n(345);n.d(t,"ContentHelpers",(function(){return O}));var k=n(151);let R;function I(e){R=e}function D(){return R}function A(e){const t=R;R=function(n,o){return e(t,n,o)}}n.d(t,"createNewMatrixCall",(function(){return k.g})),n.d(t,"setMatrixCallAudioInput",(function(){return k.i})),n.d(t,"setMatrixCallVideoInput",(function(){return k.j}));let N=()=>new o.a;function F(e){N=e}function M(t){return"string"==typeof t&&(t={baseUrl:t}),t.request=t.request||R,t.store=t.store||new r.a({localStorage:e.localStorage}),t.scheduler=t.scheduler||new i.a,t.cryptoStore=t.cryptoStore||N(),new a.b(t)}}.call(this,n(7))},function(e,t,n){"use strict";n.d(t,"e",(function(){return h})),n.d(t,"f",(function(){return p})),n.d(t,"a",(function(){return m})),n.d(t,"d",(function(){return g})),n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return _})),n.d(t,"h",(function(){return v})),n.d(t,"i",(function(){return O})),n.d(t,"j",(function(){return k})),n.d(t,"g",(function(){return R}));var o=n(18),r=n.n(o),i=n(0),a=n(8),s=n(1),c=n(110),l=n(176);let d;!function(e){e.Usermedia="m.usermedia",e.Screenshare="m.screenshare"}(d||(d={}));var u=n(438);let h,p,m,g,f,_;var b;!function(e){e.Fledgling="fledgling",e.InviteSent="invite_sent",e.WaitLocalMedia="wait_local_media",e.CreateOffer="create_offer",e.CreateAnswer="create_answer",e.Connecting="connecting",e.Connected="connected",e.Ringing="ringing",e.Ended="ended"}(h||(h={})),function(e){e.Voice="voice",e.Video="video"}(p||(p={})),function(e){e.Inbound="inbound",e.Outbound="outbound"}(m||(m={})),function(e){e.Local="local",e.Remote="remote"}(g||(g={})),function(e){e.Hangup="hangup",e.State="state",e.Error="error",e.Replaced="replaced",e.LocalHoldUnhold="local_hold_unhold",e.RemoteHoldUnhold="remote_hold_unhold",e.HoldUnhold="hold_unhold",e.FeedsChanged="feeds_changed",e.AssertedIdentityChanged="asserted_identity_changed"}(f||(f={})),function(e){e.UserHangup="user_hangup",e.LocalOfferFailed="local_offer_failed",e.NoUserMedia="no_user_media",e.UnknownDevices="unknown_devices",e.SendInvite="send_invite",e.CreateAnswer="create_answer",e.SendAnswer="send_answer",e.SetRemoteDescription="set_remote_description",e.SetLocalDescription="set_local_description",e.AnsweredElsewhere="answered_elsewhere",e.IceFailed="ice_failed",e.InviteTimeout="invite_timeout",e.Replaced="replaced",e.SignallingFailed="signalling_timeout",e.UserBusy="user_busy"}(_||(_={})),function(e){e.Audio="audio",e.Video="video"}(b||(b={}));function v(){return window.electron.getDesktopCapturerSources({thumbnailSize:{height:176,width:312},types:["screen","window"]})}class y extends Error{constructor(e,t,n){super(t+": "+n),r()(this,"code",void 0),this.code=e}}function E(){return Date.now().toString()+Object(l.b)(16)}class S extends a.EventEmitter{constructor(e){super(),r()(this,"roomId",void 0),r()(this,"type",void 0),r()(this,"callId",void 0),r()(this,"state",void 0),r()(this,"hangupParty",void 0),r()(this,"hangupReason",void 0),r()(this,"direction",void 0),r()(this,"ourPartyId",void 0),r()(this,"client",void 0),r()(this,"forceTURN",void 0),r()(this,"turnServers",void 0),r()(this,"candidateSendQueue",void 0),r()(this,"candidateSendTries",void 0),r()(this,"sentEndOfCandidates",void 0),r()(this,"peerConn",void 0),r()(this,"feeds",void 0),r()(this,"screenSharingStream",void 0),r()(this,"localAVStream",void 0),r()(this,"inviteOrAnswerSent",void 0),r()(this,"waitForLocalAVStream",void 0),r()(this,"config",void 0),r()(this,"successor",void 0),r()(this,"opponentMember",void 0),r()(this,"opponentVersion",void 0),r()(this,"opponentPartyId",void 0),r()(this,"opponentCaps",void 0),r()(this,"inviteTimeout",void 0),r()(this,"remoteOnHold",void 0),r()(this,"unholdingRemote",void 0),r()(this,"micMuted",void 0),r()(this,"vidMuted",void 0),r()(this,"callStatsAtEnd",void 0),r()(this,"makingOffer",void 0),r()(this,"ignoreOffer",void 0),r()(this,"remoteCandidateBuffer",new Map),r()(this,"remoteAssertedIdentity",void 0),r()(this,"gotUserMediaForInvite",async e=>{if(this.successor)this.successor.gotUserMediaForAnswer(e);else if(this.callHasEnded())this.stopAllMedia();else{this.localAVStream=e,i.a.info("Got local AV stream with id "+this.localAVStream.id),this.setState(h.CreateOffer),i.a.debug("gotUserMediaForInvite -> "+this.type),this.screenSharingStream?(i.a.debug("Setting screen sharing stream to the local video element"),this.pushNewFeed(this.screenSharingStream,this.client.getUserId(),d.Screenshare)):this.pushNewFeed(e,this.client.getUserId(),d.Usermedia),w(e.getAudioTracks(),!0);for(const t of e.getAudioTracks())i.a.info("Adding audio track with id "+t.id),this.peerConn.addTrack(t,e);for(const t of(this.screenSharingStream||e).getVideoTracks())i.a.info("Adding video track with id "+t.id),this.peerConn.addTrack(t,e)}}),r()(this,"gotUserMediaForAnswer",async e=>{if(this.callHasEnded())return;this.pushNewFeed(e,this.client.getUserId(),d.Usermedia),this.localAVStream=e,i.a.info("Got local AV stream with id "+this.localAVStream.id),w(e.getAudioTracks(),!0);for(const t of e.getTracks())this.peerConn.addTrack(t,e);let t;this.setState(h.CreateAnswer);try{t=await this.peerConn.createAnswer()}catch(e){return i.a.debug("Failed to create answer: ",e),void this.terminate(g.Local,_.CreateAnswer,!0)}try{await this.peerConn.setLocalDescription(t),this.setState(h.Connecting),await new Promise(e=>{setTimeout(e,200)}),this.sendAnswer()}catch(e){return i.a.debug("Error setting local description!",e),void this.terminate(g.Local,_.SetLocalDescription,!0)}}),r()(this,"gotLocalIceCandidate",e=>{if(e.candidate){if(i.a.debug("Call "+this.callId+" got local ICE "+e.candidate.sdpMid+" candidate: "+e.candidate.candidate),this.callHasEnded())return;""===e.candidate.candidate&&this.sentEndOfCandidates||(this.queueCandidate(e.candidate),""===e.candidate.candidate&&(this.sentEndOfCandidates=!0))}}),r()(this,"onIceGatheringStateChange",e=>{if(i.a.debug("ice gathering state changed to "+this.peerConn.iceGatheringState),"complete"===this.peerConn.iceGatheringState&&!this.sentEndOfCandidates){const e={candidate:""};this.queueCandidate(e),this.sentEndOfCandidates=!0}}),r()(this,"gotLocalOffer",async e=>{if(i.a.debug("Created offer: ",e),this.callHasEnded())return void i.a.debug("Ignoring newly created offer on call ID "+this.callId+" because the call has ended");try{await this.peerConn.setLocalDescription(e)}catch(e){return i.a.debug("Error setting local description!",e),void this.terminate(g.Local,_.SetLocalDescription,!0)}if("gathering"===this.peerConn.iceGatheringState&&await new Promise(e=>{setTimeout(e,200)}),this.callHasEnded())return;const t=this.state===h.CreateOffer?c.a.CallInvite:c.a.CallNegotiate,n={lifetime:6e4};this.state===h.CreateOffer?n.offer=this.peerConn.localDescription:n.description=this.peerConn.localDescription,this.client._supportsCallTransfer&&(n.capabilities={"m.call.transferee":!0}),i.a.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`),this.candidateSendQueue=[];try{await this.sendVoipEvent(t,n)}catch(e){i.a.error("Failed to send invite",e),e.event&&this.client.cancelPendingEvent(e.event);let t=_.SignallingFailed,n="Signalling failed";return this.state===h.CreateOffer&&(t=_.SendInvite,n="Failed to send invite"),"UnknownDeviceError"==e.name&&(t=_.UnknownDevices,n="Unknown devices present in the room"),this.emit(f.Error,new y(t,n,e)),void this.terminate(g.Local,t,!1)}this.sendCandidateQueue(),this.state===h.CreateOffer&&(this.inviteOrAnswerSent=!0,this.setState(h.InviteSent),this.inviteTimeout=setTimeout(()=>{this.inviteTimeout=null,this.state===h.InviteSent&&this.hangup(_.InviteTimeout,!1)},6e4))}),r()(this,"getLocalOfferFailed",e=>{i.a.error("Failed to get local offer",e),this.emit(f.Error,new y(_.LocalOfferFailed,"Failed to get local offer!",e)),this.terminate(g.Local,_.LocalOfferFailed,!1)}),r()(this,"getUserMediaFailed",e=>{this.successor?this.successor.getUserMediaFailed(e):(i.a.warn("Failed to get user media - ending call",e),this.emit(f.Error,new y(_.NoUserMedia,"Couldn't start capturing media! Is your microphone set up and does this app have permission?",e)),this.terminate(g.Local,_.NoUserMedia,!1))}),r()(this,"onIceConnectionStateChanged",()=>{this.callHasEnded()||(i.a.debug("Call ID "+this.callId+": ICE connection state changed to: "+this.peerConn.iceConnectionState),"connected"==this.peerConn.iceConnectionState?this.setState(h.Connected):"failed"==this.peerConn.iceConnectionState&&this.hangup(_.IceFailed,!1))}),r()(this,"onSignallingStateChanged",()=>{i.a.debug("call "+this.callId+": Signalling state changed to: "+this.peerConn.signalingState)}),r()(this,"onTrack",e=>{var t;if(0===e.streams.length)return void i.a.warn(`Streamless ${e.track.kind} found: ignoring.`);const n=null===(t=this.feeds.find(e=>!e.isLocal()))||void 0===t?void 0:t.stream;if(n&&e.streams[0].id!==n.id)return void i.a.warn(`Ignoring new stream ID ${e.streams[0].id}: we already have stream ID ${n.id}`);n||i.a.info("Got remote stream with id "+e.streams[0].id);const o=e.streams[0];i.a.debug(`Track id ${e.track.id} of kind ${e.track.kind} added`),this.pushNewFeed(o,this.getOpponentMember().userId,d.Usermedia),i.a.info("playing remote. stream active? "+o.active)}),r()(this,"onNegotiationNeeded",async()=>{if(i.a.info("Negotation is needed!"),this.state===h.CreateOffer||0!==this.opponentVersion){this.makingOffer=!0;try{const e=await this.peerConn.createOffer();await this.gotLocalOffer(e)}catch(e){return void this.getLocalOfferFailed(e)}finally{this.makingOffer=!1}}else i.a.info("Opponent does not support renegotiation: ignoring negotiationneeded event")}),r()(this,"onHangupReceived",e=>{i.a.debug("Hangup received for call ID "+this.callId),this.partyIdMatches(e)||this.state===h.Ringing?this.terminate(g.Remote,e.reason||_.UserHangup,!0):i.a.info(`Ignoring message from party ID ${e.party_id}: our partner is ${this.opponentPartyId}`)}),r()(this,"onRejectReceived",e=>{i.a.debug("Reject received for call ID "+this.callId);[h.InviteSent,h.Ringing].includes(this.state)||this.state===h.Fledgling&&this.direction===m.Inbound?this.terminate(g.Remote,e.reason||_.UserHangup,!0):i.a.debug(`Call is in state: ${this.state}: ignoring reject`)}),r()(this,"onAnsweredElsewhere",e=>{i.a.debug("Call ID "+this.callId+" answered elsewhere"),this.terminate(g.Remote,_.AnsweredElsewhere,!0)}),this.roomId=e.roomId,this.client=e.client,this.type=null,this.forceTURN=e.forceTURN,this.ourPartyId=this.client.deviceId,this.turnServers=e.turnServers||[],0===this.turnServers.length&&this.client.isFallbackICEServerAllowed()&&this.turnServers.push({urls:["stun:turn.matrix.org"]});for(const e of this.turnServers)s.a(e,["urls"]);this.callId=E(),this.state=h.Fledgling,this.candidateSendQueue=[],this.candidateSendTries=0,this.sentEndOfCandidates=!1,this.inviteOrAnswerSent=!1,this.makingOffer=!1,this.remoteOnHold=!1,this.unholdingRemote=!1,this.micMuted=!1,this.vidMuted=!1,this.feeds=[]}async placeVoiceCall(){i.a.debug("placeVoiceCall"),this.checkForErrorListener();const e=C(b.Audio);this.type=p.Voice,await this.placeCallWithConstraints(e)}async placeVideoCall(){i.a.debug("placeVideoCall"),this.checkForErrorListener();const e=C(b.Video);this.type=p.Video,await this.placeCallWithConstraints(e)}async placeScreenSharingCall(e){i.a.debug("placeScreenSharingCall"),this.checkForErrorListener();try{var t;const n=await async function(e){var t;if(null!==(t=window.electron)&&void 0!==t&&t.getDesktopCapturerSources&&e){i.a.debug("Electron getDesktopCapturerSources() is available...");const t=await e();return t?{audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t.id}}}:null}return i.a.debug("Electron desktopCapturer is not available..."),{audio:!1,video:!0}}(e);if(!n)return void this.terminate(g.Local,_.NoUserMedia,!1);null!==(t=window.electron)&&void 0!==t&&t.getDesktopCapturerSources?(i.a.debug("Getting screen stream using getUserMedia()..."),this.screenSharingStream=await navigator.mediaDevices.getUserMedia(n)):(i.a.debug("Getting screen stream using getDisplayMedia()..."),this.screenSharingStream=await navigator.mediaDevices.getDisplayMedia(n)),i.a.debug("Got screen stream, requesting audio stream...");const o=C(b.Audio);this.placeCallWithConstraints(o)}catch(e){this.emit(f.Error,new y(_.NoUserMedia,"Failed to get screen-sharing stream: ",e)),this.terminate(g.Local,_.NoUserMedia,!1)}this.type=p.Video}getOpponentMember(){return this.opponentMember}opponentCanBeTransferred(){return Boolean(this.opponentCaps&&this.opponentCaps["m.call.transferee"])}getRemoteAssertedIdentity(){return this.remoteAssertedIdentity}getFeeds(){return this.feeds}getLocalFeeds(){return this.feeds.filter(e=>e.isLocal())}getRemoteFeeds(){return this.feeds.filter(e=>!e.isLocal())}noIncomingFeeds(){return!this.feeds.some(e=>!e.isLocal())}pushNewFeed(e,t,n){const o=this.feeds.find(t=>t.stream.id===e.id);o?o.setNewStream(e):(this.feeds.push(new u.a(e,t,n,this.client,this.roomId)),this.emit(f.FeedsChanged,this.feeds))}deleteAllFeeds(){this.feeds=[],this.emit(f.FeedsChanged,this.feeds)}async getCurrentCallStats(){return this.callHasEnded()?this.callStatsAtEnd:this.collectCallStats()}async collectCallStats(){if(!this.peerConn)return;const e=await this.peerConn.getStats(),t=[];for(const n of e)t.push(n[1]);return t}async initWithInvite(e){var t;const n=e.getContent();this.direction=m.Inbound;await this.client._checkTurnServers()||i.a.warn("Failed to get TURN credentials! Proceeding with call anyway..."),this.peerConn=this.createPeerConnection(),this.chooseOpponent(e);try{await this.peerConn.setRemoteDescription(n.offer),await this.addBufferedIceCandidates()}catch(e){return i.a.debug("Failed to set remote description",e),void this.terminate(g.Local,_.SetRemoteDescription,!1)}const o=null===(t=this.feeds.find(e=>!e.isLocal()))||void 0===t?void 0:t.stream;if(!o||0===o.getTracks().length)return i.a.error("No remote stream or no tracks after setting remote description!"),void this.terminate(g.Local,_.SetRemoteDescription,!1);this.type=o.getTracks().some(e=>"video"===e.kind)?p.Video:p.Voice,this.setState(h.Ringing),e.getLocalAge()&&setTimeout(()=>{this.state==h.Ringing&&(i.a.debug("Call invite has expired. Hanging up."),this.hangupParty=g.Remote,this.setState(h.Ended),this.stopAllMedia(),"closed"!=this.peerConn.signalingState&&this.peerConn.close(),this.emit(f.Hangup))},n.lifetime-e.getLocalAge())}initWithHangup(e){this.setState(h.Ended)}async answer(){if(!this.inviteOrAnswerSent)if(i.a.debug(`Answering call ${this.callId} of type ${this.type}`),this.localAVStream||this.waitForLocalAVStream)this.localAVStream?this.gotUserMediaForAnswer(this.localAVStream):this.waitForLocalAVStream&&this.setState(h.WaitLocalMedia);else{const e=C(this.type==p.Video?b.Video:b.Audio);i.a.log("Getting user media with constraints",e),this.setState(h.WaitLocalMedia),this.waitForLocalAVStream=!0;try{const t=await navigator.mediaDevices.getUserMedia(e);this.waitForLocalAVStream=!1,this.gotUserMediaForAnswer(t)}catch(e){return void this.getUserMediaFailed(e)}}}replacedBy(e){i.a.debug(this.callId+" being replaced by "+e.callId),this.state===h.WaitLocalMedia?(i.a.debug("Telling new call to wait for local media"),e.waitForLocalAVStream=!0):(this.state===h.CreateOffer||this.state===h.InviteSent)&&(i.a.debug("Handing local stream to new call"),e.gotUserMediaForAnswer(this.localAVStream),delete this.localAVStream),this.successor=e,this.emit(f.Replaced,e),this.hangup(_.Replaced,!0)}hangup(e,t){if(this.callHasEnded())return;if(i.a.debug("Ending call "+this.callId),this.terminate(g.Local,e,!t),this.state===h.WaitLocalMedia)return;const n={};e!==_.UserHangup&&(n.reason=e),this.sendVoipEvent(c.a.CallHangup,n)}reject(){if(this.state!==h.Ringing)throw Error("Call must be in 'ringing' state to reject!");if(this.opponentVersion<1)return i.a.info(`Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`),void this.hangup(_.UserHangup,!0);i.a.debug("Rejecting call: "+this.callId),this.terminate(g.Local,_.UserHangup,!0),this.sendVoipEvent(c.a.CallReject,{})}setLocalVideoMuted(e){this.vidMuted=e,this.updateMuteStatus()}isLocalVideoMuted(){return this.vidMuted}setMicrophoneMuted(e){this.micMuted=e,this.updateMuteStatus()}isMicrophoneMuted(){return this.micMuted}isRemoteOnHold(){return this.remoteOnHold}setRemoteOnHold(e){if(this.isRemoteOnHold()!==e){this.remoteOnHold=e,e||(this.unholdingRemote=!0);for(const t of this.peerConn.getTransceivers())t.direction=e?"inactive":"sendrecv";this.updateMuteStatus(),this.emit(f.RemoteHoldUnhold,this.remoteOnHold)}}isLocalOnHold(){if(this.state!==h.Connected)return!1;if(this.unholdingRemote)return!1;let e=!0;for(const t of this.peerConn.getTransceivers()){["inactive","recvonly"].includes(t.currentDirection)||(e=!1)}return e}sendDtmfDigit(e){for(const t of this.peerConn.getSenders())if("audio"===t.track.kind&&t.dtmf)return void t.dtmf.insertDTMF(e);throw new Error("Unable to find a track to send DTMF on")}updateMuteStatus(){if(!this.localAVStream)return;const e=this.micMuted||this.remoteOnHold;w(this.localAVStream.getAudioTracks(),!e);const t=this.vidMuted||this.remoteOnHold;w(this.localAVStream.getVideoTracks(),!t)}async sendAnswer(){const e={answer:{sdp:this.peerConn.localDescription.sdp,type:this.peerConn.localDescription.type}};this.client._supportsCallTransfer&&(e.capabilities={"m.call.transferee":!0}),i.a.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`),this.candidateSendQueue=[];try{await this.sendVoipEvent(c.a.CallAnswer,e),this.inviteOrAnswerSent=!0}catch(e){this.setState(h.Ringing),this.client.cancelPendingEvent(e.event);let t=_.SendAnswer,n="Failed to send answer";throw"UnknownDeviceError"==e.name&&(t=_.UnknownDevices,n="Unknown devices present in the room"),this.emit(f.Error,new y(t,n,e)),e}this.sendCandidateQueue()}async onRemoteIceCandidatesReceived(e){if(this.callHasEnded())return;const t=e.getContent().candidates;if(!t)return void i.a.info("Ignoring candidates event with no candidates!");const n=0===e.getContent().version?null:e.getContent().party_id||null;if(void 0===this.opponentPartyId){i.a.info(`Bufferring ${t.length} candidates until we pick an opponent`);const e=this.remoteCandidateBuffer.get(n)||[];return e.push(...t),void this.remoteCandidateBuffer.set(n,e)}this.partyIdMatches(e.getContent())?await this.addIceCandidates(t):i.a.info(`Ignoring candidates from party ID ${e.getContent().party_id}: we have chosen party ID `+this.opponentPartyId)}async onAnswerReceived(e){if(i.a.debug(`Got answer for call ID ${this.callId} from party ID ${e.getContent().party_id}`),this.callHasEnded())i.a.debug(`Ignoring answer because call ID ${this.callId} has ended`);else if(void 0===this.opponentPartyId){this.chooseOpponent(e),await this.addBufferedIceCandidates(),this.setState(h.Connecting);try{await this.peerConn.setRemoteDescription(e.getContent().answer)}catch(e){return i.a.debug("Failed to set remote description",e),void this.terminate(g.Local,_.SetRemoteDescription,!1)}if(null!==this.opponentPartyId)try{await this.sendVoipEvent(c.a.CallSelectAnswer,{selected_party_id:this.opponentPartyId})}catch(e){i.a.warn("Failed to send select_answer event",e)}}else i.a.info(`Ignoring answer from party ID ${e.getContent().party_id}: we already have an answer/reject from `+this.opponentPartyId)}async onSelectAnswerReceived(e){if(this.direction!==m.Inbound)return void i.a.warn("Got select_answer for an outbound call: ignoring");const t=e.getContent().selected_party_id;null!=t?t!==this.ourPartyId&&(i.a.info(`Got select_answer for party ID ${t}: we are party ID ${this.ourPartyId}.`),this.terminate(g.Remote,_.AnsweredElsewhere,!0)):i.a.warn("Got nonsensical select_answer with null/undefined selected_party_id: ignoring")}async onNegotiateReceived(e){const t=e.getContent().description;if(!t||!t.sdp||!t.type)return void i.a.info("Ignoring invalid m.call.negotiate event");const n=this.direction===m.Inbound,o="offer"===t.type&&(this.makingOffer||"stable"!=this.peerConn.signalingState);if(this.ignoreOffer=!n&&o,this.ignoreOffer)return void i.a.info("Ignoring colliding negotiate event because we're impolite");const r=this.isLocalOnHold();"answer"===t.type&&(this.unholdingRemote=!1);try{if(await this.peerConn.setRemoteDescription(t),"offer"===t.type){for(const e of this.peerConn.getTransceivers())e.direction=this.isRemoteOnHold()?"inactive":"sendrecv";const e=await this.peerConn.createAnswer();await this.peerConn.setLocalDescription(e);for(const e of this.peerConn.getTransceivers())e.direction=e.currentDirection;this.sendVoipEvent(c.a.CallNegotiate,{description:this.peerConn.localDescription})}}catch(e){i.a.warn("Failed to complete negotiation",e)}const a=this.isLocalOnHold();r!==a&&(this.emit(f.LocalHoldUnhold,a),this.emit(f.HoldUnhold,a))}async onAssertedIdentityReceived(e){e.getContent().asserted_identity&&(this.remoteAssertedIdentity={id:e.getContent().asserted_identity.id,displayName:e.getContent().asserted_identity.display_name},this.emit(f.AssertedIdentityChanged))}callHasEnded(){return this.state===h.Ended}setState(e){const t=this.state;this.state=e,this.emit(f.State,e,t)}sendVoipEvent(e,t){return this.client.sendEvent(this.roomId,e,Object.assign({},t,{version:1,call_id:this.callId,party_id:this.ourPartyId}))}queueCandidate(e){if(this.candidateSendQueue.push(e),this.state===h.Ringing||!this.inviteOrAnswerSent)return;const t=this.direction===m.Inbound?500:2e3;0===this.candidateSendTries&&setTimeout(()=>{this.sendCandidateQueue()},t)}async transfer(e){const t=await this.client.getProfileInfo(e),n=E(),o={replacement_id:E(),target_user:{id:e,display_name:t.display_name,avatar_url:t.avatar_url},create_call:n};await this.sendVoipEvent(c.a.CallReplaces,o),await this.terminate(g.Local,_.Replaced,!0)}async transferToCall(e){const t=await this.client.getProfileInfo(e.getOpponentMember().userId),n=await this.client.getProfileInfo(this.getOpponentMember().userId),o=E(),r={replacement_id:E(),target_user:{id:this.getOpponentMember().userId,display_name:n.display_name,avatar_url:n.avatar_url},await_call:o};await e.sendVoipEvent(c.a.CallReplaces,r);const i={replacement_id:E(),target_user:{id:e.getOpponentMember().userId,display_name:t.display_name,avatar_url:t.avatar_url},create_call:o};await this.sendVoipEvent(c.a.CallReplaces,i),await this.terminate(g.Local,_.Replaced,!0),await e.terminate(g.Local,_.Replaced,!0)}async terminate(e,t,n){this.callHasEnded()||(this.callStatsAtEnd=await this.collectCallStats(),this.inviteTimeout&&(clearTimeout(this.inviteTimeout),this.inviteTimeout=null),t!==_.Replaced&&this.stopAllMedia(),this.deleteAllFeeds(),this.hangupParty=e,this.hangupReason=t,this.setState(h.Ended),this.peerConn&&"closed"!==this.peerConn.signalingState&&this.peerConn.close(),n&&this.emit(f.Hangup,this))}stopAllMedia(){i.a.debug(`stopAllMedia (stream=${this.localAVStream})`);for(const e of this.feeds)for(const t of e.stream.getTracks())t.stop()}checkForErrorListener(){if(0===this.listeners("error").length)throw new Error("You MUST attach an error listener using call.on('error', function() {})")}async sendCandidateQueue(){if(0===this.candidateSendQueue.length)return;const e=this.candidateSendQueue;this.candidateSendQueue=[],++this.candidateSendTries;const t={candidates:e};i.a.debug("Attempting to send "+e.length+" candidates");try{await this.sendVoipEvent(c.a.CallCandidates,t)}catch(t){if(t.event&&this.client.cancelPendingEvent(t.event),this.candidateSendQueue.push(...e),this.candidateSendTries>5){i.a.debug("Failed to send candidates on attempt "+this.candidateSendTries+". Giving up on this call.",t);const e=_.SignallingFailed,n="Signalling failed";return this.emit(f.Error,new y(e,n,t)),void this.hangup(e,!1)}const n=500*Math.pow(2,this.candidateSendTries);++this.candidateSendTries,i.a.debug("Failed to send candidates. Retrying in "+n+"ms",t),setTimeout(()=>{this.sendCandidateQueue()},n)}}async placeCallWithConstraints(e){i.a.log("Getting user media with constraints",e),this.client._callEventHandler.calls.set(this.callId,this),this.setState(h.WaitLocalMedia),this.direction=m.Outbound,this.config=e;await this.client._checkTurnServers()||i.a.warn("Failed to get TURN credentials! Proceeding with call anyway..."),this.peerConn=this.createPeerConnection();try{const t=await navigator.mediaDevices.getUserMedia(e);this.gotUserMediaForInvite(t)}catch(e){return void this.getUserMediaFailed(e)}}createPeerConnection(){const e=new window.RTCPeerConnection({iceTransportPolicy:this.forceTURN?"relay":void 0,iceServers:this.turnServers,iceCandidatePoolSize:this.client._iceCandidatePoolSize});return e.addEventListener("iceconnectionstatechange",this.onIceConnectionStateChanged),e.addEventListener("signalingstatechange",this.onSignallingStateChanged),e.addEventListener("icecandidate",this.gotLocalIceCandidate),e.addEventListener("icegatheringstatechange",this.onIceGatheringStateChange),e.addEventListener("track",this.onTrack),e.addEventListener("negotiationneeded",this.onNegotiationNeeded),e}partyIdMatches(e){return(0===e.version?null:e.party_id||null)===this.opponentPartyId}chooseOpponent(e){const t=e.getContent();i.a.debug(`Choosing party ID ${t.party_id} for call ID ${this.callId}`),this.opponentVersion=t.version,0===this.opponentVersion?this.opponentPartyId=null:this.opponentPartyId=t.party_id||null,this.opponentCaps=t.capabilities||{},this.opponentMember=e.sender}async addBufferedIceCandidates(){const e=this.remoteCandidateBuffer.get(this.opponentPartyId);e&&(i.a.info(`Adding ${e.length} buffered candidates for opponent ${this.opponentPartyId}`),await this.addIceCandidates(e)),this.remoteCandidateBuffer=null}async addIceCandidates(e){for(const t of e)if(null!==t.sdpMid&&void 0!==t.sdpMid||null!==t.sdpMLineIndex&&void 0!==t.sdpMLineIndex){i.a.debug("Call "+this.callId+" got remote ICE "+t.sdpMid+" candidate: "+t.candidate);try{await this.peerConn.addIceCandidate(t)}catch(e){this.ignoreOffer||i.a.info("Failed to add remote ICE candidate",e)}}else i.a.debug("Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex")}}function w(e,t){for(let n=0;n{let n=[];return h.b.getValue("lowBandwidth")||(n=t||[],e&&(n=[e,...n])),Array.from(new Set(n))};t.a=e=>{const{name:t,idName:n,title:o,url:i,urls:l,width:h=40,height:v=40,resizeMethod:y="crop",defaultToInitialLetter:E=!0,onClick:S,inputRef:w,className:C}=e,T=a()(e,["name","idName","title","url","urls","width","height","resizeMethod","defaultToInitialLetter","onClick","inputRef","className"]),[x,O]=(({url:e,urls:t})=>{const[n,o]=Object(s.useState)(b(e,t)),[r,i]=Object(s.useState)(0),a=Object(s.useCallback)(()=>{i(e=>e+1)},[]);Object(s.useEffect)(()=>{o(b(e,t)),i(0)},[e,JSON.stringify(t)]);const c=Object(s.useContext)(m.a),l=Object(s.useCallback)((e,t)=>{"ERROR"!==e&&t!==e&&i(0)},[]);Object(g.a)(c,"sync",l);return[n[r],a]})({url:i,urls:l});if(!x&&E){const e=u.e(t),i=c.a.createElement("span",{className:"mx_BaseAvatar_initial","aria-hidden":"true",style:{fontSize:Object(f.a)(.65*h),width:Object(f.a)(h),lineHeight:Object(f.a)(v)}},e),a=c.a.createElement("img",{className:"mx_BaseAvatar_image",src:u.d(n||t),alt:"",title:o,onError:O,style:{width:Object(f.a)(h),height:Object(f.a)(v)},"aria-hidden":"true"});return S?c.a.createElement(p.a,r()({"aria-label":Object(_.a)("Avatar")},T,{element:"span",className:d()("mx_BaseAvatar",C),onClick:S,inputRef:w}),i,a):c.a.createElement("span",r()({className:d()("mx_BaseAvatar",C),ref:w},T,{role:"presentation"}),i,a)}return S?c.a.createElement(p.a,r()({className:d()("mx_BaseAvatar mx_BaseAvatar_image",C),element:"img",src:x,onClick:S,onError:O,style:{width:Object(f.a)(h),height:Object(f.a)(v)},title:o,alt:Object(_.a)("Avatar"),inputRef:w},T)):c.a.createElement("img",r()({className:d()("mx_BaseAvatar mx_BaseAvatar_image",C),src:x,onError:O,style:{width:Object(f.a)(h),height:Object(f.a)(v)},title:o,alt:"",ref:w},T))}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return T}));var o=n(18),r=n.n(o),i=n(94),a=n(137),s=n(249),c=n(93),l=n(571),d=n(286),u=n(1416),h=n(129),p=n(1413),m=n(201),g=n(1),f=n(780),_=n(1343),b=n(146),v=n(721),y=n(166),E=n(512),S=n(1344);const w="lists_update";class C extends b.a{constructor(){super(c.a),r()(this,"initialListsGenerated",!1),r()(this,"algorithm",new p.a),r()(this,"filterConditions",[]),r()(this,"prefilterConditions",[]),r()(this,"tagWatcher",void 0),r()(this,"spaceWatcher",void 0),r()(this,"updateFn",new _.a(()=>{for(const e of Object.keys(this.orderedLists))y.a.instance.getListState(e).setRooms(this.orderedLists[e]);this.emit(w)})),r()(this,"watchedSettings",["feature_custom_tags","advancedRoomListLogging"]),r()(this,"onAlgorithmListUpdated",()=>{i.b.getValue("advancedRoomListLogging")&&console.log("Underlying algorithm has triggered a list update - marking"),this.updateFn.mark()}),r()(this,"onAlgorithmFilterUpdated",()=>{this.updateFn.trigger()}),r()(this,"onPrefilterUpdated",async()=>{await this.recalculatePrefiltering(),this.updateFn.trigger()}),this.checkLoggingEnabled();for(const e of this.watchedSettings)i.b.monitorSetting(e,null);h.a.addListener(()=>this.handleRVSUpdate({})),this.algorithm.on(p.b,this.onAlgorithmListUpdated),this.algorithm.on(d.a,this.onAlgorithmFilterUpdated),this.setupWatchers()}setupWatchers(){i.b.getValue("feature_spaces")?this.spaceWatcher=new S.a(this):this.tagWatcher=new u.a(this)}get unfilteredLists(){return this.algorithm?this.algorithm.getUnfilteredRooms():{}}get orderedLists(){return this.algorithm?this.algorithm.getOrderedRooms():{}}async resetStore(){await this.reset(),this.filterConditions=[],this.prefilterConditions=[],this.initialListsGenerated=!1,this.setupWatchers(),this.algorithm.off(p.b,this.onAlgorithmListUpdated),this.algorithm.off(d.a,this.onAlgorithmListUpdated),this.algorithm=new p.a,this.algorithm.on(p.b,this.onAlgorithmListUpdated),this.algorithm.on(d.a,this.onAlgorithmListUpdated),await this.reset(null,!0)}async makeReady(e){e&&this.readyStore.useUnitTestClient(e),this.checkLoggingEnabled(),console.log("Regenerating room lists: Startup"),await this.readAndCacheSettingsFromStore(),await this.regenerateAllLists({trigger:!1}),await this.handleRVSUpdate({trigger:!1}),this.updateFn.mark(),this.updateFn.trigger()}checkLoggingEnabled(){i.b.getValue("advancedRoomListLogging")&&console.warn("Advanced room list logging is enabled")}async readAndCacheSettingsFromStore(){const e=i.b.getValue("feature_custom_tags");await this.updateState({tagsEnabled:e}),await this.updateAlgorithmInstances()}async handleRVSUpdate({trigger:e=!0}){if(!this.matrixClient)return;const t=h.a.getRoomId();if(!t&&this.algorithm.stickyRoom)await this.algorithm.setStickyRoom(null);else if(t){const e=this.matrixClient.getRoom(t);e?e!==this.algorithm.stickyRoom&&(i.b.getValue("advancedRoomListLogging")&&console.log("Changing sticky room to "+t),await this.algorithm.setStickyRoom(e)):(console.warn(t+" is current in RVS but missing from client - clearing sticky room"),await this.algorithm.setStickyRoom(null))}e&&this.updateFn.trigger()}async onReady(){await this.makeReady()}async onNotReady(){await this.resetStore()}async onAction(t){this.matrixClient&&this.initialListsGenerated&&(C.TEST_MODE?await this.onDispatchAsync(t):e(()=>this.onDispatchAsync(t)))}async onDispatchAsync(e){if(this.matrixClient&&this.initialListsGenerated){if("setting_updated"===e.action&&this.watchedSettings.includes(e.settingName)){if("advancedRoomListLogging"===e.settingName){const e=i.b.getValue("advancedRoomListLogging");return void console.warn("Advanced room list logging is enabled? "+e)}console.log("Regenerating room lists: Settings changed"),await this.readAndCacheSettingsFromStore(),await this.regenerateAllLists({trigger:!1}),this.updateFn.trigger()}if(!this.algorithm)throw new Error("Room list store has no algorithm to process dispatcher update with");if("MatrixActions.Room.receipt"===e.action){if(Object(l.a)(e.event,this.matrixClient)){const t=e.room;return t?(i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Got own read receipt in "+t.roomId),await this.handleRoomUpdate(t,a.c.ReadReceipt),void this.updateFn.trigger()):void console.warn("Own read receipt was in unknown room "+t.roomId)}}else if("MatrixActions.Room.tags"===e.action){const t=e;i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Got tag change in "+t.room.roomId),await this.handleRoomUpdate(t.room,a.c.PossibleTagChange),this.updateFn.trigger()}else if("MatrixActions.Room.timeline"===e.action){const t=e;if(!t.isLiveEvent||!e.isLiveUnfilteredRoomTimelineEvent)return;const n=t.event.getRoomId(),o=this.matrixClient.getRoom(n),r=async e=>{if(i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Live timeline event "+t.event.getId()+" in "+e.roomId),"m.room.tombstone"===t.event.getType()&&""===t.event.getStateKey()){i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Got tombstone event - trying to remove now-dead room");if(this.matrixClient.getRoom(t.event.getContent().replacement_room))return}await this.handleRoomUpdate(e,a.c.Timeline),this.updateFn.trigger()};if(!o)return console.warn(`Live timeline event ${t.event.getId()} received without associated room`),console.warn("Queuing failed room update for retry as a result."),void setTimeout(async()=>{const e=this.matrixClient.getRoom(n);await r(e)},100);await r(o)}else if("MatrixActions.Event.decrypted"===e.action){const t=e,n=t.event.getRoomId();if(!n)return;const o=this.matrixClient.getRoom(n);if(!o)return void console.warn(`Event ${t.event.getId()} was decrypted in an unknown room ${n}`);i.b.getValue("advancedRoomListLogging")&&console.log(`[RoomListDebug] Decrypted timeline event ${t.event.getId()} in ${n}`),await this.handleRoomUpdate(o,a.c.Timeline),this.updateFn.trigger()}else if("MatrixActions.accountData"===e.action&&"m.direct"===e.event_type){const t=e;i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Received updated DM map");const n=t.event.getContent();for(const e of Object.keys(n)){const t=n[e];for(const e of t){const t=this.matrixClient.getRoom(e);t?await this.handleRoomUpdate(t,a.c.PossibleTagChange):console.warn(e+" was found in DMs but the room is not in the store")}}this.updateFn.trigger()}else if("MatrixActions.Room.myMembership"===e.action){const t=e,n=Object(m.b)(t.oldMembership),o=Object(m.b)(t.membership);if(n!==m.a.Join&&o===m.a.Join){i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Handling new room "+t.room.roomId);const e=t.room.currentState.getStateEvents("m.room.create","");if(e&&e.getContent().predecessor){i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Room has a predecessor");const t=this.matrixClient.getRoom(e.getContent().predecessor.room_id);if(t){this.algorithm.stickyRoom===t&&(i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Clearing sticky room due to room upgrade"),await this.algorithm.setStickyRoom(null)),i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Removing previous room from room list"),await this.algorithm.handleRoomUpdate(t,a.c.RoomRemoved)}}return i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Adding new room to room list"),await this.handleRoomUpdate(t.room,a.c.NewRoom),void this.updateFn.trigger()}if(n!==m.a.Invite&&o===m.a.Invite)return i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Handling invite to "+t.room.roomId),await this.handleRoomUpdate(t.room,a.c.NewRoom),void this.updateFn.trigger();if(n!==o)return i.b.getValue("advancedRoomListLogging")&&console.log("[RoomListDebug] Handling membership change in "+t.room.roomId),await this.handleRoomUpdate(t.room,a.c.PossibleTagChange),void this.updateFn.trigger()}}}async handleRoomUpdate(e,t){if(t===a.c.NewRoom&&"invite"===e.getMyMembership()&&await E.a.instance.onNewInvitedRoom(e),!E.a.instance.isRoomVisible(e))return;if((t===a.c.NewRoom||t===a.c.PossibleTagChange)&&!this.prefilterConditions.every(t=>t.isVisible(e)))return;await this.algorithm.handleRoomUpdate(e,t)&&(i.b.getValue("advancedRoomListLogging")&&console.log(`[DEBUG] Room "${e.name}" (${e.roomId}) triggered by ${t} requires list update`),this.updateFn.mark())}async recalculatePrefiltering(){if(!this.algorithm)return;if(!this.algorithm.hasTagSortingMap)return;i.b.getValue("advancedRoomListLogging")&&console.log("Calculating new prefiltered room list"),this.algorithm.updatesInhibited=!0;const e=this.getPlausibleRooms(),t=this.algorithm.stickyRoom,n=t&&e.includes(t);await this.algorithm.setStickyRoom(null),await this.algorithm.setKnownRooms(e),n&&await this.algorithm.setStickyRoom(t),this.updateFn.mark(),this.algorithm.updatesInhibited=!1}async setTagSorting(e,t){await this.setAndPersistTagSorting(e,t),this.updateFn.trigger()}async setAndPersistTagSorting(e,t){await this.algorithm.setTagSorting(e,t),localStorage.setItem("mx_tagSort_"+e,t)}getTagSorting(e){return this.algorithm.getTagSorting(e)}getStoredTagSorting(e){return localStorage.getItem("mx_tagSort_"+e)}calculateTagSorting(e){const t=e===a.a.Invite||e===a.a.DM?s.b.Recent:s.b.Alphabetic,n=i.b.getValue("RoomList.orderAlphabetically",null,!0),o=this.getTagSorting(e),r=this.getStoredTagSorting(e);let c=t;return r?c=r:Object(g.o)(n)?o&&(c=o):c=n?s.b.Alphabetic:s.b.Recent,c}async setListOrder(e,t){await this.setAndPersistListOrder(e,t),this.updateFn.trigger()}async setAndPersistListOrder(e,t){await this.algorithm.setListOrdering(e,t),localStorage.setItem("mx_listOrder_"+e,t)}getListOrder(e){return this.algorithm.getListOrdering(e)}getStoredListOrder(e){return localStorage.getItem("mx_listOrder_"+e)}calculateListOrder(e){const t=s.a.Natural,n=i.b.getValue("RoomList.orderByImportance",null,!0),o=this.getListOrder(e),r=this.getStoredListOrder(e);let a=t;return r?a=r:Object(g.o)(n)?o&&(a=o):a=n?s.a.Importance:s.a.Natural,a}async updateAlgorithmInstances(){this.updateFn.mark();for(const e of Object.keys(this.orderedLists)){const t=this.getTagSorting(e),n=this.getListOrder(e),o=this.calculateTagSorting(e),r=this.calculateListOrder(e);o!==t&&await this.setAndPersistTagSorting(e,o),r!==n&&await this.setAndPersistListOrder(e,r)}}getPlausibleRooms(){if(!this.matrixClient)return[];let e=this.matrixClient.getVisibleRooms().filter(e=>E.a.instance.isRoomVisible(e));return!(this.prefilterConditions.length>0)||i.b.getValue("feature_spaces")&&this.filterConditions.length||(e=e.filter(e=>{for(const t of this.prefilterConditions)if(!t.isVisible(e))return!1;return!0})),e}async regenerateAllLists({trigger:e=!0}){console.warn("Regenerating all room lists");const t=this.getPlausibleRooms(),n=new Set;if(this.state.tagsEnabled)for(const e of t){if(!e.tags)continue;Object.keys(e.tags).filter(e=>Object(a.d)(e)).forEach(e=>n.add(e))}const o={},r={},i=[...a.b,...Array.from(n)];for(const e of i)o[e]=this.calculateTagSorting(e),r[e]=this.calculateListOrder(e),f.a.instance.ensureLayoutExists(e);await this.algorithm.populateTags(o,r),await this.algorithm.setKnownRooms(t),this.initialListsGenerated=!0,e&&this.updateFn.trigger()}async addFilter(e){i.b.getValue("advancedRoomListLogging")&&console.log("Adding filter condition:",e);let t=Promise.resolve();e.kind===d.b.Prefilter?(e.on(d.a,this.onPrefilterUpdated),this.prefilterConditions.push(e),t=this.recalculatePrefiltering()):(this.filterConditions.push(e),i.b.getValue("feature_spaces")&&await this.recalculatePrefiltering(),this.algorithm&&this.algorithm.addFilterCondition(e)),t.then(()=>this.updateFn.trigger())}removeFilter(e){i.b.getValue("advancedRoomListLogging")&&console.log("Removing filter condition:",e);let t=Promise.resolve(),n=this.filterConditions.indexOf(e);n>=0&&(this.filterConditions.splice(n,1),this.algorithm&&this.algorithm.removeFilterCondition(e),i.b.getValue("feature_spaces")&&(t=this.recalculatePrefiltering())),n=this.prefilterConditions.indexOf(e),n>=0&&(e.off(d.a,this.onPrefilterUpdated),this.prefilterConditions.splice(n,1),t=this.recalculatePrefiltering()),t.then(()=>this.updateFn.trigger())}getFirstNameFilterCondition(){for(const e of this.filterConditions)if(e instanceof v.a)return e;return null}getTagsForRoom(e){const t=this.algorithm.getTagsForRoom(e);return t||[a.a.Untagged]}async manualRoomUpdate(e,t){await this.handleRoomUpdate(e,t),this.updateFn.trigger()}}r()(C,"TEST_MODE",!1);class T{static get instance(){return T.internalInstance||(T.internalInstance=new C),T.internalInstance}}r()(T,"internalInstance",void 0),window.mxRoomListStore=T.instance}).call(this,n(168).setImmediate)},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(18),r=n.n(o);class i{constructor(e,t){this.preferred=e,this.legacy=t}matches(e){return e===this.preferred||e===this.legacy}static fromString(e){const t=Object.values(i).filter(e=>e instanceof i).find(t=>t.matches(e));return t||new i(e,e)}}r()(i,"JITSI",new i("m.jitsi","jitsi")),r()(i,"STICKERPICKER",new i("m.stickerpicker","m.stickerpicker")),r()(i,"INTEGRATION_MANAGER",new i("m.integration_manager","m.integration_manager")),r()(i,"CUSTOM",new i("m.custom","m.custom"))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));class o{getValueOverride(e,t,n,o){return null}onChange(e,t,n){}get settingDisabled(){return!1}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(87),r=n.n(o),i=n(97),a=n.n(i);function s({description:e,hideDescriptionIfValid:t,deriveData:n,rules:o}){return async function({value:i,focused:s,allowEmpty:c=!0}){if(!i&&c)return{valid:null,feedback:null};const l={value:i,allowEmpty:c},d=n?await n(l):void 0,u=[];let h,p,m,g=!0;if(o&&o.length)for(const e of o){if(!e.key||!e.test)continue;if(!g&&e.final)continue;if(e.skip&&e.skip.call(this,l,d))continue;const t=await e.test.call(this,l,d);if(g=g&&t,t&&e.valid){const t=e.valid.call(this,d);if(!t)continue;u.push({key:e.key,valid:!0,text:t})}else if(!t&&e.invalid){const t=e.invalid.call(this,d);if(!t)continue;u.push({key:e.key,valid:!1,text:t})}}if(!s)return{valid:g,feedback:null};if(u&&u.length&&(h=r.a.createElement("ul",{className:"mx_Validation_details"},u.map(e=>{const t=a()({mx_Validation_detail:!0,mx_Validation_valid:e.valid,mx_Validation_invalid:!e.valid});return r.a.createElement("li",{key:e.key,className:t},e.text)}))),e&&(h||!t)){const t=e.call(this,d);p=r.a.createElement("div",{className:"mx_Validation_description"},t)}return(p||h)&&(m=r.a.createElement("div",{className:"mx_Validation"},p,h)),{valid:g,feedback:m}}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return f})),n.d(t,"e",(function(){return _})),n.d(t,"d",(function(){return c})),n.d(t,"a",(function(){return l.a})),n.d(t,"b",(function(){return d.a}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(106);const c=({children:e,inputRef:t})=>{const[n,o,r]=_(t);return e({onFocus:n,isActive:o,ref:r})};var l=n(490),d=n(491);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function h(e){for(var t=1;t{}});var m;p.displayName="RovingTabIndexContext",function(e){e.Register="REGISTER",e.Unregister="UNREGISTER",e.SetFocus="SET_FOCUS"}(m||(m={}));const g=(e,t)=>{switch(t.type){case m.Register:{if(0===e.refs.length)return h(h({},e),{},{activeRef:t.payload.ref,refs:[t.payload.ref]});if(e.refs.includes(t.payload.ref))return e;let n=e.refs.findIndex(e=>2&e.current.compareDocumentPosition(t.payload.ref.current));return n<0&&(n=e.refs.length),h(h({},e),{},{refs:[...e.refs.slice(0,n),t.payload.ref,...e.refs.slice(n)]})}case m.Unregister:{const n=e.refs.filter(e=>e!==t.payload.ref);if(n.length===e.refs.length)return e;if(e.activeRef===t.payload.ref){const o=e.refs.findIndex(e=>e===t.payload.ref);return h(h({},e),{},{activeRef:o>=n.length?n[n.length-1]:n[o],refs:n})}return h(h({},e),{},{refs:n})}case m.SetFocus:return h(h({},e),{},{activeRef:t.payload.ref});default:return e}},f=({children:e,handleHomeEnd:t,onKeyDown:n})=>{const[o,r]=Object(i.useReducer)(g,{activeRef:null,refs:[]}),c=Object(i.useMemo)(()=>({state:o,dispatch:r}),[o]),l=Object(i.useCallback)(e=>{let o=!1;if(t&&"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName)switch(e.key){case s.a.HOME:o=!0,c.state.refs.length>0&&c.state.refs[0].current.focus();break;case s.a.END:o=!0,c.state.refs.length>0&&c.state.refs[c.state.refs.length-1].current.focus()}if(o)e.preventDefault(),e.stopPropagation();else if(n)return n(e,c.state)},[c.state,n,t]);return a.a.createElement(p.Provider,{value:c},e({onKeyDownHandler:l}))},_=e=>{const t=Object(i.useContext)(p);let n=Object(i.useRef)(null);e&&(n=e),Object(i.useLayoutEffect)(()=>(t.dispatch({type:m.Register,payload:{ref:n}}),()=>{t.dispatch({type:m.Unregister,payload:{ref:n}})}),[]);return[Object(i.useCallback)(()=>{t.dispatch({type:m.SetFocus,payload:{ref:n}})},[n,t]),t.state.activeRef===n,n]}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(377);function r(e){this._eventTimelineSet=e,this._roomId=e.room?e.room.roomId:null,this._events=[],this._baseIndex=0,this._startState=new o.a(this._roomId),this._startState.paginationToken=null,this._endState=new o.a(this._roomId),this._endState.paginationToken=null,this._prevTimeline=null,this._nextTimeline=null,this._paginationRequests={b:null,f:null},this._name=this._roomId+":"+(new Date).toISOString()}r.BACKWARDS="b",r.FORWARDS="f",r.prototype.initialiseState=function(e){if(this._events.length>0)throw new Error("Cannot initialise state after events are added");for(const t of e)Object.freeze(t);this._startState.setStateEvents(e),this._endState.setStateEvents(e)},r.prototype.forkLive=function(e){const t=this.getState(e),n=new r(this._eventTimelineSet);return n._startState=t.clone(),n._endState=t,this._endState=t.clone(),n},r.prototype.fork=function(e){const t=this.getState(e),n=new r(this._eventTimelineSet);return n._startState=t.clone(),n._endState=t.clone(),n},r.prototype.getRoomId=function(){return this._roomId},r.prototype.getFilter=function(){return this._eventTimelineSet.getFilter()},r.prototype.getTimelineSet=function(){return this._eventTimelineSet},r.prototype.getBaseIndex=function(){return this._baseIndex},r.prototype.getEvents=function(){return this._events},r.prototype.getState=function(e){if(e==r.BACKWARDS)return this._startState;if(e==r.FORWARDS)return this._endState;throw new Error("Invalid direction '"+e+"'")},r.prototype.getPaginationToken=function(e){return this.getState(e).paginationToken},r.prototype.setPaginationToken=function(e,t){this.getState(t).paginationToken=e},r.prototype.getNeighbouringTimeline=function(e){if(e==r.BACKWARDS)return this._prevTimeline;if(e==r.FORWARDS)return this._nextTimeline;throw new Error("Invalid direction '"+e+"'")},r.prototype.setNeighbouringTimeline=function(e,t){if(this.getNeighbouringTimeline(t))throw new Error("timeline already has a neighbouring timeline - cannot reset neighbour (direction: "+t+")");if(t==r.BACKWARDS)this._prevTimeline=e;else{if(t!=r.FORWARDS)throw new Error("Invalid direction '"+t+"'");this._nextTimeline=e}this.setPaginationToken(null,t)},r.prototype.addEvent=function(e,t){const n=t?this._startState:this._endState,o=this.getTimelineSet();let i;o.room&&o.room.getUnfilteredTimelineSet()===o&&(r.setEventMetadata(e,n,t),e.isState()&&(n.setStateEvents([e]),e.sender&&("m.room.member"!==e.getType()||t)||r.setEventMetadata(e,n,t))),i=t?0:this._events.length,this._events.splice(i,0,e),t&&this._baseIndex++},r.setEventMetadata=function(e,t,n){e.sender=t.getSentinelMember(e.getSender()),"m.room.member"===e.getType()&&(e.target=t.getSentinelMember(e.getStateKey())),e.isState()&&n&&(e.forwardLooking=!1)},r.prototype.removeEvent=function(e){for(let t=this._events.length-1;t>=0;t--){const n=this._events[t];if(n.getId()==e)return this._events.splice(t,1),t{this._usersPending[t].resolve=e,this._usersPending[t].reject=n}).then(e=>(this._userGroups[t]=e,setTimeout(()=>{delete this._userGroups[t]},18e5),this._userGroups[t])).catch(e=>{if("M_UNRECOGNIZED"===e.errcode)return console.warn("Cannot display flair, server does not support groups"),void(i=!1);throw console.error("Could not get groups for user",t,e),e}).finally(()=>{delete this._usersInFlight[t]}),this._debounceTimeoutID&&clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this._batchedGetPublicGroups(e)},200),this._usersPending[t].prom)}async _batchedGetPublicGroups(e){this._usersInFlight=this._usersPending,this._usersPending={};let t={users:[]};try{t=await e.getPublicisedGroups(Object.keys(this._usersInFlight))}catch(e){return void Object.keys(this._usersInFlight).forEach(t=>{this._usersInFlight[t]&&this._usersInFlight[t].reject(e)})}const n=t.users;Object.keys(this._usersInFlight).forEach(e=>{this._usersInFlight[e]&&this._usersInFlight[e].resolve(n[e]||[])})}getGroupProfileCachedFast(e,t){return e&&t?this._groupProfiles[t]?this._groupProfiles[t]:(this.getGroupProfileCached(e,t),null):null}async getGroupProfileCached(e,t){if(this._groupProfiles[t])return this._groupProfiles[t];if(this._groupProfilesPromise[t]){try{await this._groupProfilesPromise[t]}catch(e){return null}return this._groupProfiles[t]}let n;console.log("FlairStore: Request group profile of "+t),this._groupProfilesPromise[t]=e.getGroupProfile(t);try{n=await this._groupProfilesPromise[t]}catch(e){return console.log("FlairStore: Failed to get group profile for "+t,e),delete this._groupProfilesPromise[t],null}return this._groupProfiles[t]={groupId:t,avatarUrl:n.avatar_url,name:n.name,shortDescription:n.short_description},delete this._groupProfilesPromise[t],console.log("FlairStore: Emit updateGroupProfile for "+t),this.emit("updateGroupProfile"),setTimeout(()=>{this.refreshGroupProfile(e,t)},18e5),this._groupProfiles[t]}refreshGroupProfile(e,t){return delete this._groupProfiles[t],this.getGroupProfileCached(e,t)}}void 0===e.singletonFlairStore&&(e.singletonFlairStore=new a),t.a=e.singletonFlairStore}).call(this,n(7))},function(e,t,n){var o=n(558);function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}e.exports=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==o(e)&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(n,a,s):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));var o=n(0),r=n(627),i=n(295),a=n(1041),s=n(221),c=n(28);class l{constructor(e,t){this._indexedDB=e,this._dbName=t,this._backendPromise=null,this._backend=null}static exists(e,t){return c.a(e,t)}startup(){return this._backendPromise||(this._backendPromise=new Promise((e,t)=>{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));o.a.log("connecting to indexeddb "+this._dbName);const n=this._indexedDB.open(this._dbName,a.b);n.onupgradeneeded=e=>{const t=e.target.result,n=e.oldVersion;a.c(t,n)},n.onblocked=()=>{o.a.log("can't yet open IndexedDBCryptoStore because it is open elsewhere")},n.onerror=e=>{o.a.log("Error connecting to indexeddb",e),t(e.target.error)},n.onsuccess=t=>{const n=t.target.result;o.a.log("connected to indexeddb "+this._dbName),e(new a.a(n))}}).then(e=>e.doTxn("readonly",[l.STORE_INBOUND_GROUP_SESSIONS,l.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],t=>{e.getEndToEndInboundGroupSession("","",t,()=>{})}).then(()=>e)).catch(t=>{if("VersionError"===t.name)throw o.a.warn("Crypto DB is too new for us to use!",t),new s.a(s.a.TOO_NEW);o.a.warn("unable to connect to indexeddb "+this._dbName+": falling back to localStorage store: "+t);try{return new r.a(e.localStorage)}catch(t){return o.a.warn("unable to open localStorage: falling back to in-memory store: "+t),new i.a}}).then(e=>{this._backend=e})),this._backendPromise}deleteAllData(){return new Promise((e,t)=>{if(!this._indexedDB)return void t(new Error("no indexeddb support available"));o.a.log("Removing indexeddb instance: "+this._dbName);const n=this._indexedDB.deleteDatabase(this._dbName);n.onblocked=()=>{o.a.log("can't yet delete IndexedDBCryptoStore because it is open elsewhere")},n.onerror=e=>{o.a.log("Error deleting data from indexeddb",e),t(e.target.error)},n.onsuccess=()=>{o.a.log("Removed indexeddb instance: "+this._dbName),e()}}).catch(e=>{o.a.warn("unable to delete IndexedDBCryptoStore: "+e)})}getOrAddOutgoingRoomKeyRequest(e){return this._backend.getOrAddOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequest(e){return this._backend.getOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequestByState(e){return this._backend.getOutgoingRoomKeyRequestByState(e)}getAllOutgoingRoomKeyRequestsByState(e){return this._backend.getAllOutgoingRoomKeyRequestsByState(e)}getOutgoingRoomKeyRequestsByTarget(e,t,n){return this._backend.getOutgoingRoomKeyRequestsByTarget(e,t,n)}updateOutgoingRoomKeyRequest(e,t,n){return this._backend.updateOutgoingRoomKeyRequest(e,t,n)}deleteOutgoingRoomKeyRequest(e,t){return this._backend.deleteOutgoingRoomKeyRequest(e,t)}getAccount(e,t){this._backend.getAccount(e,t)}storeAccount(e,t){this._backend.storeAccount(e,t)}getCrossSigningKeys(e,t){this._backend.getCrossSigningKeys(e,t)}getSecretStorePrivateKey(e,t,n){this._backend.getSecretStorePrivateKey(e,t,n)}storeCrossSigningKeys(e,t){this._backend.storeCrossSigningKeys(e,t)}storeSecretStorePrivateKey(e,t,n){this._backend.storeSecretStorePrivateKey(e,t,n)}countEndToEndSessions(e,t){this._backend.countEndToEndSessions(e,t)}getEndToEndSession(e,t,n,o){this._backend.getEndToEndSession(e,t,n,o)}getEndToEndSessions(e,t,n){this._backend.getEndToEndSessions(e,t,n)}getAllEndToEndSessions(e,t){this._backend.getAllEndToEndSessions(e,t)}storeEndToEndSession(e,t,n,o){this._backend.storeEndToEndSession(e,t,n,o)}storeEndToEndSessionProblem(e,t,n){return this._backend.storeEndToEndSessionProblem(e,t,n)}getEndToEndSessionProblem(e,t){return this._backend.getEndToEndSessionProblem(e,t)}filterOutNotifiedErrorDevices(e){return this._backend.filterOutNotifiedErrorDevices(e)}getEndToEndInboundGroupSession(e,t,n,o){this._backend.getEndToEndInboundGroupSession(e,t,n,o)}getAllEndToEndInboundGroupSessions(e,t){this._backend.getAllEndToEndInboundGroupSessions(e,t)}addEndToEndInboundGroupSession(e,t,n,o){this._backend.addEndToEndInboundGroupSession(e,t,n,o)}storeEndToEndInboundGroupSession(e,t,n,o){this._backend.storeEndToEndInboundGroupSession(e,t,n,o)}storeEndToEndInboundGroupSessionWithheld(e,t,n,o){this._backend.storeEndToEndInboundGroupSessionWithheld(e,t,n,o)}storeEndToEndDeviceData(e,t){this._backend.storeEndToEndDeviceData(e,t)}getEndToEndDeviceData(e,t){this._backend.getEndToEndDeviceData(e,t)}storeEndToEndRoom(e,t,n){this._backend.storeEndToEndRoom(e,t,n)}getEndToEndRooms(e,t){this._backend.getEndToEndRooms(e,t)}getSessionsNeedingBackup(e){return this._backend.getSessionsNeedingBackup(e)}countSessionsNeedingBackup(e){return this._backend.countSessionsNeedingBackup(e)}unmarkSessionsNeedingBackup(e,t){return this._backend.unmarkSessionsNeedingBackup(e,t)}markSessionsNeedingBackup(e,t){return this._backend.markSessionsNeedingBackup(e,t)}addSharedHistoryInboundGroupSession(e,t,n,o){this._backend.addSharedHistoryInboundGroupSession(e,t,n,o)}getSharedHistoryInboundGroupSessions(e,t){return this._backend.getSharedHistoryInboundGroupSessions(e,t)}doTxn(e,t,n,o){return this._backend.doTxn(e,t,n,o)}}l.STORE_ACCOUNT="account",l.STORE_SESSIONS="sessions",l.STORE_INBOUND_GROUP_SESSIONS="inbound_group_sessions",l.STORE_INBOUND_GROUP_SESSIONS_WITHHELD="inbound_group_sessions_withheld",l.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS="shared_history_inbound_group_sessions",l.STORE_DEVICE_DATA="device_data",l.STORE_ROOMS="rooms",l.STORE_BACKUP="sessions_needing_backup"}).call(this,n(7))},function(e,t,n){"use strict";var o=n(87),r=n.n(o),i=n(453);t.a=({description:e,detail:t,acceptLabel:n,rejectLabel:o,onAccept:a,onReject:s})=>{const c=t?r.a.createElement("div",{className:"mx_Toast_detail"},t):null;return r.a.createElement("div",null,r.a.createElement("div",{className:"mx_Toast_description"},e,c),r.a.createElement("div",{className:"mx_Toast_buttons","aria-live":"off"},s&&o&&r.a.createElement(i.a,{label:o,kind:"danger",onClick:s}),r.a.createElement(i.a,{label:n,onClick:a})))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(88),u=n(89);let h=Object(u.a)("views.elements.InlineSpinner")((i=r=class extends l.a.PureComponent{render(){return l.a.createElement("div",{className:"mx_InlineSpinner"},l.a.createElement("div",{className:"mx_InlineSpinner_icon mx_Spinner_icon",style:{width:this.props.w,height:this.props.h},"aria-label":Object(d.a)("Loading...")},this.props.children))}},s()(r,"defaultProps",{w:16,h:16}),o=i))||o},function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return c})),n.d(t,"b",(function(){return l}));var o=n(88);function r(e){return e<1e3?e.toString():e<1e4?(e/1e3).toFixed(1)+"K":e<1e5?(e/1e3).toFixed(0)+"K":e<1e7?(e/1e6).toFixed(1)+"M":e<1e8?(e/1e6).toFixed(0)+"M":(e/1e9).toFixed(1)+"B"}function i(e){return(new Intl.NumberFormat).format(e)}function a(e,t=2){if(0===e)return"0 Bytes";const n=t<0?0:t,o=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,o)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][o]}function s(e){return e.match(/.{1,4}/g).join(" ")}function c(e){return"mx_Username_color"+(function(e){let t,n,o=0;if(0===e.length)return o;for(t=0;t0)return e=e.slice(0,t),Object(o.a)("%(items)s and %(count)s others",{items:e.join(", "),count:n});{const t=e.pop();return Object(o.a)("%(items)s and %(lastItem)s",{items:e.join(", "),lastItem:t})}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var o=n(18),r=n.n(o),i=n(146),a=n(93),s=n(137),c=n(208),l=n(117),d=n(225);class u extends d.b{constructor(e=!1,t,n){super(),this.byTileCount=e,this.tagId=t,this.getRoomFn=n,r()(this,"rooms",[]),r()(this,"states",{}),r()(this,"onRoomNotificationStateUpdate",()=>{this.calculateTotalState()})}get symbol(){return null}setRooms(e){if(this.byTileCount)return this.rooms=e,void this.calculateTotalState();const t=this.rooms,n=Object(l.a)(t,e);this.rooms=e;for(const e of n.removed){const t=this.states[e.roomId];t&&(delete this.states[e.roomId],t.off(d.a,this.onRoomNotificationStateUpdate))}for(const e of n.added){const t=this.getRoomFn(e);t.on(d.a,this.onRoomNotificationStateUpdate),this.states[e.roomId]=t}this.calculateTotalState()}getForRoom(e){const t=this.states[e.roomId];if(!t)throw new Error("Unknown room for notification state");return t}destroy(){super.destroy();for(const e of Object.values(this.states))e.off(d.a,this.onRoomNotificationStateUpdate);this.states={}}calculateTotalState(){const e=this.snapshot();if(this.byTileCount)this._color=c.a.Red,this._count=this.rooms.length;else{this._count=0,this._color=c.a.None;for(const e of Object.values(this.states))this._count+=e.count,this._color=Math.max(this.color,e.color)}this.emitIfUpdated(e)}}var h=n(92),p=n(201),m=n(571),g=n(324),f=n(573);class _ extends d.b{constructor(e){super(),this.room=e,r()(this,"handleReadReceipt",(e,t)=>{Object(m.a)(e,h.a.get())&&t.roomId===this.room.roomId&&this.updateNotificationState()}),r()(this,"handleMembershipUpdate",()=>{this.updateNotificationState()}),r()(this,"handleRoomEventUpdate",e=>{e.getRoomId()===this.room.roomId&&this.updateNotificationState()}),r()(this,"handleAccountDataUpdate",e=>{"m.push_rules"===e.getType()&&this.updateNotificationState()}),this.room.on("Room.receipt",this.handleReadReceipt),this.room.on("Room.timeline",this.handleRoomEventUpdate),this.room.on("Room.redaction",this.handleRoomEventUpdate),this.room.on("Room.myMembership",this.handleMembershipUpdate),h.a.get().on("Event.decrypted",this.handleRoomEventUpdate),h.a.get().on("accountData",this.handleAccountDataUpdate),this.updateNotificationState()}get roomIsInvite(){return Object(p.b)(this.room.getMyMembership())===p.a.Invite}destroy(){super.destroy(),this.room.removeListener("Room.receipt",this.handleReadReceipt),this.room.removeListener("Room.timeline",this.handleRoomEventUpdate),this.room.removeListener("Room.redaction",this.handleRoomEventUpdate),this.room.removeListener("Room.myMembership",this.handleMembershipUpdate),h.a.get()&&(h.a.get().removeListener("Event.decrypted",this.handleRoomEventUpdate),h.a.get().removeListener("accountData",this.handleAccountDataUpdate))}updateNotificationState(){const e=this.snapshot();if(g.f(this.room.roomId)===g.d)this._color=c.a.None,this._symbol=null,this._count=0;else if(this.roomIsInvite)this._color=c.a.Red,this._symbol="!",this._count=1;else{const e=g.g(this.room,"highlight"),t=g.g(this.room,"total"),n=t||(e||0);if(e>0)this._color=c.a.Red,this._count=n,this._symbol=null;else if(t>0)this._color=c.a.Grey,this._count=n,this._symbol=null;else{const e=f.a(this.room);this._color=e?c.a.Bold:c.a.None,this._count=0,this._symbol=null}}this.emitIfUpdated(e)}}class b extends d.b{constructor(){super(),r()(this,"totalStatesWithUnread",0),this._symbol=null,this._count=0,this._color=c.a.None}get numUnreadStates(){return this.totalStatesWithUnread}add(e,t=!1){e.symbol&&t&&(this._symbol=e.symbol),e.count&&(this._count+=e.count),e.color>this.color&&(this._color=e.color),e.hasUnreadCount&&this.totalStatesWithUnread++}}var v=n(512);class y extends i.a{constructor(){super(a.a,{}),r()(this,"roomMap",new Map),r()(this,"listMap",new Map)}get globalState(){if(!this.matrixClient)return new b;const e=new b;for(const t of this.matrixClient.getVisibleRooms())v.a.instance.isRoomVisible(t)&&e.add(this.getRoomState(t));return e}getListState(e){if(this.listMap.has(e))return this.listMap.get(e);const t=e===s.a.Invite,n=new u(t,e,e=>this.getRoomState(e));return this.listMap.set(e,n),n}getRoomState(e){return this.roomMap.has(e)||this.roomMap.set(e,new _(e)),this.roomMap.get(e)}static get instance(){return y.internalInstance}async onNotReady(){for(const e of this.roomMap.values())e.destroy()}async onAction(e){return Promise.resolve()}}r()(y,"internalInstance",new y)},function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var o=n(8),r=n(278),i=n(1);function a(e,t){this.roomId=e,this.userId=t,this.typing=!1,this.name=t,this.rawDisplayName=t,this.powerLevel=0,this.powerLevelNorm=0,this.user=null,this.membership=null,this.events={member:null},this._isOutOfBand=!1,this._updateModifiedTime()}i.m(a,o.EventEmitter),a.prototype.markOutOfBand=function(){this._isOutOfBand=!0},a.prototype.isOutOfBand=function(){return this._isOutOfBand},a.prototype.setMembershipEvent=function(e,t){if("m.room.member"!==e.getType())return;this._isOutOfBand=!1,this.events.member=e;const n=this.membership;this.membership=e.getDirectionalContent().membership;const o=this.name;this.name=function(e,t,n){if(!t||t===e)return e;if(!i.v(t))return e;if(!n)return t;let o=s.test(t);o||(o=c.test(t));if(!o){const r=n.getUserIdsWithDisplayName(t);o=r.some(t=>t!==e)}if(o)return t+" ("+e+")";return t}(this.userId,e.getDirectionalContent().displayname,t),this.rawDisplayName=e.getDirectionalContent().displayname||this.userId,n!==this.membership&&(this._updateModifiedTime(),this.emit("RoomMember.membership",e,this,n)),o!==this.name&&(this._updateModifiedTime(),this.emit("RoomMember.name",e,this,o))},a.prototype.setPowerLevelEvent=function(e){if("m.room.power_levels"!==e.getType())return;const t=e.getDirectionalContent();let n=t.users_default||0;const o=t.users||{};Object.values(o).forEach((function(e){n=Math.max(n,e)}));const r=this.powerLevel,i=this.powerLevelNorm;void 0!==o[this.userId]?this.powerLevel=o[this.userId]:void 0!==t.users_default?this.powerLevel=t.users_default:this.powerLevel=0,this.powerLevelNorm=0,n>0&&(this.powerLevelNorm=100*this.powerLevel/n),r===this.powerLevel&&i===this.powerLevelNorm||(this._updateModifiedTime(),this.emit("RoomMember.powerLevel",e,this))},a.prototype.setTypingEvent=function(e){if("m.typing"!==e.getType())return;const t=this.typing;this.typing=!1;const n=e.getContent().user_ids;Array.isArray(n)&&(-1!==n.indexOf(this.userId)&&(this.typing=!0),t!==this.typing&&(this._updateModifiedTime(),this.emit("RoomMember.typing",e,this)))},a.prototype._updateModifiedTime=function(){this._modified=Date.now()},a.prototype.getLastModifiedTime=function(){return this._modified},a.prototype.isKicked=function(){return"leave"===this.membership&&this.events.member.getSender()!==this.events.member.getStateKey()},a.prototype.getDMInviter=function(){if(this.events.member){const e=this.events.member;let t=e.getContent(),n=e.getSender();if("join"===t.membership&&(t=e.getPrevContent(),n=e.getUnsigned().prev_sender),"invite"===t.membership&&t.is_direct)return n}},a.prototype.getAvatarUrl=function(e,t,n,o,i,a){void 0===i&&(i=!0);const s=this.getMxcAvatarUrl();if(!s&&!i)return null;const c=Object(r.a)(e,s,t,n,o,a);return c||null},a.prototype.getMxcAvatarUrl=function(){return this.events.member?this.events.member.getDirectionalContent().avatar_url:this.user?this.user.avatarUrl:null};const s=/@.+:.+/,c=/[\u200E\u200F\u202A-\u202F]/},function(e,t,n){(function(e){var o=void 0!==e&&e||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(r.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new i(r.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(799),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(7))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var o=n(91),r=n.n(o);let i;!function(e){e.IRC="irc",e.Group="group"}(i||(i={}));const a=r.a.oneOf(Object.values(i))},function(e,t,n){var o=n(387)("wks"),r=n(327),i=n(190).Symbol,a="function"==typeof i;(e.exports=function(e){return o[e]||(o[e]=a&&i[e]||(a?i:r)("Symbol."+e))}).store=o},function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o,r,i,a=n(99),s=n.n(a),c=n(104),l=n.n(c),d=n(18),u=n.n(d),h=n(87),p=n.n(h),m=n(93),g=n(100),f=n(153),_=n(89),b=n(103);let v=Object(_.a)("views.avatars.MemberAvatar")((i=r=class e extends p.a.Component{constructor(t){super(t),this.state=e.getState(t)}static getDerivedStateFromProps(t){return e.getState(t)}static getState(e){var t;if(null!==(t=e.member)&&void 0!==t&&t.name){let t=null;return e.member.getMxcAvatarUrl()&&(t=Object(b.b)(e.member.getMxcAvatarUrl()).getThumbnailOfSourceHttp(e.width,e.height,e.resizeMethod)),{name:e.member.name,title:e.title||e.member.userId,imageUrl:t}}if(e.fallbackUserId)return{name:e.fallbackUserId,title:e.fallbackUserId};console.error("MemberAvatar called somehow with null member or fallbackUserId")}render(){let e=this.props,{member:t,fallbackUserId:n,onClick:o,viewUserOnClick:r}=e,i=l()(e,["member","fallbackUserId","onClick","viewUserOnClick"]);const a=t?t.userId:n;return r&&(o=()=>{m.a.dispatch({action:g.a.ViewUser,member:this.props.member})}),p.a.createElement(f.a,s()({},i,{name:this.state.name,title:this.state.title,idName:a,url:this.state.imageUrl,onClick:o}))}},u()(r,"defaultProps",{width:40,height:40,resizeMethod:"crop",viewUserOnClick:!1}),o=i))||o},function(e,t,n){"use strict";n.d(t,"d",(function(){return E})),n.d(t,"a",(function(){return S})),n.d(t,"c",(function(){return x})),n.d(t,"e",(function(){return O})),n.d(t,"b",(function(){return k})),n.d(t,"f",(function(){return R}));var o=n(95),r=n(90),i=n(92),a=n(440),s=n(441),c=n(88),l=n(143),d=n(260),u=n(653),h=n(269),p=n(94),m=n(226);let g={},f={},_=!1,b=!1,v={};function y(){return _}function E(){return _}class S extends Error{constructor(){super("Secret storage access canceled")}}async function w(){const e=r.getComponent("dialogs.QuestionDialog"),[t]=await o.a.createDialog(e,{title:Object(c.a)("Cancel entering passphrase?"),description:Object(c.a)("Are you sure you want to cancel entering passphrase?"),danger:!1,button:Object(c.a)("Go Back"),cancelButton:Object(c.a)("Cancel")}).finished;return!t}function C(e){return async({passphrase:t,recoveryKey:n})=>t?Object(a.a)(t,e.passphrase.salt,e.passphrase.iterations):Object(s.a)(n)}function T(e,t,n){y()&&(g[e]=n,f[e]=t)}const x={getSecretStorageKey:async function({keys:e},t){var n;const r=i.a.get();let a,s=await r.getDefaultSecretStorageKeyId();if(s&&(a=e[s],a||(s=void 0)),!s){const t=Object.entries(e);if(t.length>1)throw new Error("Multiple storage key requests not implemented");[s,a]=t[0]}if(y()&&g[s])return[s,g[s]];if(v.key&&await i.a.get().checkSecretStorageKey(v.key,a))return T(s,a,v.key),[s,v.key];const c=null===(n=m.a.getSecretStorageKey)||void 0===n?void 0:n.call(m.a);if(c)return console.log("Using key from security customisations (secret storage)"),T(s,a,c),[s,c];if(b)throw new Error("Could not unlock non-interactively");const l=C(a),{finished:d}=o.a.createTrackedDialog("Access Secret Storage dialog","",u.a,{keyInfo:a,checkPrivateKey:async e=>{const t=await l(e);return await i.a.get().checkSecretStorageKey(t,a)}},null,!1,!1,{onBeforeClose:async e=>"backgroundClick"!==e||w()}),[h]=await d;if(!h)throw new S;const p=await l(h);return T(s,a,p),[s,p]},cacheSecretStorageKey:T,onSecretRequested:async function(e,t,n,o,r){console.log("onSecretRequested",e,t,n,o,r);const a=i.a.get();if(e===a.getUserId())if(r&&r.isVerified()){if("m.cross_signing.master"===o||"m.cross_signing.self_signing"===o||"m.cross_signing.user_signing"===o){const e=a.getCrossSigningCacheCallbacks();if(!e.getCrossSigningKeyCache)return;const n=o.replace("m.cross_signing.",""),r=await e.getCrossSigningKeyCache(n);return r||console.log(`${n} requested by ${t}, but not found in cache`),r&&Object(l.encodeBase64)(r)}if("m.megolm_backup.v1"===o){const e=await a._crypto.getSessionBackupPrivateKey();return e||console.log(`session backup key requested by ${t}, but not found in cache`),e&&Object(l.encodeBase64)(e)}console.warn("onSecretRequested didn't recognise the secret named ",o)}else console.log("Ignoring secret request from untrusted device "+t)},getDehydrationKey:async function(e,t){var n;const r=null===(n=m.a.getSecretStorageKey)||void 0===n?void 0:n.call(m.a);if(r)return console.log("Using key from security customisations (dehydration)"),r;const i=C(e),{finished:a}=o.a.createTrackedDialog("Access Secret Storage dialog","",u.a,{keyInfo:e,checkPrivateKey:async e=>{const n=await i(e);try{return t(n),!0}catch(e){return!1}}},null,!1,!1,{onBeforeClose:async e=>"backgroundClick"!==e||w()}),[s]=await a;if(!s)throw new S;const c=await i(s);return v={key:new Uint8Array(c),keyInfo:e},c}};async function O(){let e;const{finished:t}=o.a.createTrackedDialog("Restore Backup","",h.a,{showSummary:!1,keyCallback:t=>e=t},null,!1,!0);if(!await t)throw new Error("Key backup prompt cancelled");return e}async function k(e=(async()=>{}),t=!1){const a=i.a.get();_=!0;try{if(!await a.hasSecretStorageKey()||t){const{finished:e}=o.a.createTrackedDialogAsync("Create Secret Storage dialog","",n.e(27).then(n.bind(null,1401)),{forceReset:t},null,!1,!0,{onBeforeClose:async e=>"backgroundClick"!==e||!Object(d.d)()}),[r]=await e;if(!r)throw new Error("Secret storage creation canceled")}else{const e=r.getComponent("dialogs.InteractiveAuthDialog");await a.bootstrapCrossSigning({authUploadDeviceSigningKeys:async t=>{const{finished:n}=o.a.createTrackedDialog("Cross-signing keys dialog","",e,{title:Object(c.a)("Setting up keys"),matrixClient:a,makeRequest:t}),[r]=await n;if(!r)throw new Error("Cross-signing key upload auth canceled")}}),await a.bootstrapSecretStorage({getKeyBackupPassphrase:O});const t=Object.keys(g)[0];if(t&&p.b.getValue("feature_dehydration")){let e={};f[t]&&f[t].passphrase&&(e={passphrase:f[t].passphrase}),console.log("Setting dehydration key"),await a.setDehydrationKey(g[t],e,"Backup device")}else t?console.log("Not setting dehydration key: feature disabled"):console.warn("Not setting dehydration key: no SSSS key found")}return await e()}catch(e){var s;throw null===(s=m.a.catchAccessSecretStorageError)||void 0===s||s.call(m.a,e),console.error(e),e}finally{_=!1,y()||(g={},f={})}}async function R(e){const t=v.key;let n=!1;if(t&&await e.isSecretStorageReady()){console.log("Trying to set up cross-signing using dehydration key"),_=!0,b=!0;try{await e.checkOwnCrossSigningTrust();let o={};v.keyInfo&&v.keyInfo.passphrase&&(o={passphrase:v.keyInfo.passphrase}),await e.setDehydrationKey(t,o,"Backup device");const r=await e.getKeyBackupVersion();r&&(n=!0,e.restoreKeyBackupWithSecretStorage(r).finally(()=>{_=!1,b=!1,y()||(g={},f={})}))}finally{v={},n||(_=!1,b=!1,y()||(g={},f={}))}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(91),u=n.n(d),h=n(304),p=n(89);let m=Object(p.a)("views.elements.LabelledToggleSwitch")((i=r=class extends l.a.Component{render(){let e=l.a.createElement("span",{className:"mx_SettingsFlag_label"},this.props.label),t=l.a.createElement(h.a,{checked:this.props.value,disabled:this.props.disabled,onChange:this.props.onChange,"aria-label":this.props.label});if(this.props.toggleInFront){const n=e;e=t,t=n}const n="mx_SettingsFlag "+(this.props.className||"");return l.a.createElement("div",{className:n},e,t)}},s()(r,"propTypes",{value:u.a.bool.isRequired,onChange:u.a.func.isRequired,label:u.a.string.isRequired,disabled:u.a.bool,toggleInFront:u.a.bool,className:u.a.string}),o=i))||o},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n(18),r=n.n(o),i=n(146),a=n(93),s=n(201),c=n(94),l=n(1),d=n(116),u=n(160),h=n(188),p=n(123);class m extends i.a{constructor(){super(a.a,{})}static get instance(){return m.internalInstance}static getUpdateEventName(e){return`${d.b}:${e}`}getSelectedCommunityId(){return c.b.getValue("feature_communities_v2_prototypes")?h.a.getSelectedTags()[0]:null}getSelectedCommunityName(){return m.instance.getCommunityName(this.getSelectedCommunityId())}getSelectedCommunityGeneralChat(){const e=this.getSelectedCommunityId();if(e)return this.getGeneralChat(e)}getCommunityName(e){const t=u.a.getGroupProfileCachedFast(this.matrixClient,e);return(null==t?void 0:t.name)||e}getCommunityProfile(e){return u.a.getGroupProfileCachedFast(this.matrixClient,e)}getGeneralChat(e){const t=p.a.getGroupRooms(e).map(e=>this.matrixClient.getRoom(e.roomId)).filter(e=>!!e);let n=t.find(t=>{const n=t.currentState.getStateEvents("im.vector.general_chat","");return!(!n||n.getContent().groupId!==e)});return n||(n=t[0]),n}isAdminOf(e){const t=p.a.getGroupMembers(e).find(e=>e.userId===this.matrixClient.getUserId());return null==t?void 0:t.isPrivileged}canInviteTo(e){const t=this.getGeneralChat(e);if(!t)return this.isAdminOf(e);const n=t.getMember(this.matrixClient.getUserId());if(!n)return this.isAdminOf(e);const o=t.currentState.getStateEvents("m.room.power_levels","");if(!o)return this.isAdminOf(e);return(Object(l.o)(o.invite)?50:Number(o.invite))<=n.powerLevel}async onAction(e){if(this.matrixClient&&c.b.getValue("feature_communities_v2_prototypes"))if("MatrixActions.Room.myMembership"===e.action){const t=e.room,n=Object(s.b)(e.membership);if(n===Object(s.b)(e.oldMembership))return;if(n===s.a.Invite)try{const e=l.g("/rooms/$roomId/group_info",{$roomId:t.roomId}),n=await this.matrixClient._http.authedRequest(void 0,"GET",e,void 0,void 0,{prefix:"/_matrix/client/unstable/im.vector.custom"});await this.matrixClient.setAccountData("im.vector.group_info."+t.roomId,n)}catch(e){console.warn("Non-fatal error getting group information for invite:",e)}}else if("MatrixActions.accountData"===e.action){if(e.event_type.startsWith("im.vector.group_info.")){const t=e.event_type.substring("im.vector.group_info.".length);this.emit(m.getUpdateEventName(t),t)}}else if("select_tag"===e.action){const t=this.getGeneralChat(e.tag);t&&a.a.dispatch({action:"view_room",room_id:t.roomId})}}getInviteProfile(e){if(!this.matrixClient)return{displayName:null,avatarMxc:null};const t=this.matrixClient.getRoom(e);if(c.b.getValue("feature_communities_v2_prototypes")){const t=this.matrixClient.getAccountData("im.vector.group_info."+e);if(t&&t.getContent())return{displayName:t.getContent().name,avatarMxc:t.getContent().avatar_url}}return{displayName:t.name,avatarMxc:t.avatar_url}}async onReady(){for(const e of this.matrixClient.getRooms()){const t=e.currentState.getMembers().find(e=>e.userId===this.matrixClient.getUserId());t&&(Object(s.b)(t.membership)===s.a.Invite&&this.emit(m.getUpdateEventName(e.roomId),e.roomId))}}}r()(m,"internalInstance",new m)},function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var o=n(18),r=n.n(o),i=n(98),a=n(95),s=n(130),c=n.n(s),l=n(94),d=n(300),u=n(92),h=n(19),p=n.n(h),m=n(205);class g{constructor(e,t){this.apiUrl=e,this.uiUrl=t,r()(this,"scalarToken",void 0),r()(this,"termsInteractionCallback",void 0),r()(this,"isDefaultManager",void 0),this.scalarToken=null,this.termsInteractionCallback=void 0;const n=i.a.get().integrations_rest_url,o=i.a.get().integrations_ui_url;this.isDefaultManager=e===n&&o===t}writeTokenToStore(){window.localStorage.setItem("mx_scalar_token_at_"+this.apiUrl,this.scalarToken),this.isDefaultManager&&window.localStorage.removeItem("mx_scalar_token")}readTokenFromStore(){let e=window.localStorage.getItem("mx_scalar_token_at_"+this.apiUrl);return!e&&this.isDefaultManager&&(e=window.localStorage.getItem("mx_scalar_token")),e}readToken(){return this.scalarToken?this.scalarToken:this.readTokenFromStore()}setTermsInteractionCallback(e){this.termsInteractionCallback=e}connect(){return this.getScalarToken().then(e=>{this.scalarToken=e})}hasCredentials(){return null!=this.scalarToken}getScalarToken(){const e=this.readToken();return e?this.checkToken(e).catch(e=>{if(e instanceof d.b)throw e;return this.registerForToken()}):this.registerForToken()}getAccountName(e){const t=this.apiUrl+"/account";return new Promise((function(n,o){p()({method:"GET",uri:t,qs:{scalar_token:e,v:"1.1"},json:!0},(e,t,r)=>{e?o(e):r&&"M_TERMS_NOT_SIGNED"===r.errcode?o(new d.b):t.statusCode/100!=2?o(r):r&&r.user_id?n(r.user_id):o(new Error("Missing user_id in response"))})}))}checkToken(e){return this.getAccountName(e).then(t=>{const n=u.a.get().getUserId();if(t!==n)throw new Error("Scalar token is owned by someone else: "+n);return e}).catch(t=>{if(t instanceof d.b){console.log("Integration manager requires new terms to be agreed to");const t=c.a.parse(this.apiUrl);return t.path="",t.pathname="",Object(d.d)([new d.a(m.a.IM,c.a.format(t),e)],this.termsInteractionCallback).then(()=>e)}throw t})}registerForToken(){return u.a.get().getOpenIdToken().then(e=>this.exchangeForScalarToken(e)).then(e=>this.checkToken(e)).then(e=>(this.scalarToken=e,this.writeTokenToStore(),e))}exchangeForScalarToken(e){const t=this.apiUrl;return new Promise((function(n,o){p()({method:"POST",uri:t+"/register",qs:{v:"1.1"},body:e,json:!0},(e,t,r)=>{e?o(e):t.statusCode/100!=2?o(new Error("Scalar request failed: "+t.statusCode)):r&&r.scalar_token?n(r.scalar_token):o(new Error("Missing scalar_token in response"))})}))}getScalarPageTitle(e){let t=this.apiUrl+"/widgets/title_lookup";return t=this.getStarterLink(t),t+="&curl="+encodeURIComponent(e),new Promise((function(e,n){p()({method:"GET",uri:t,json:!0},(t,o,r)=>{if(t)n(t);else if(o.statusCode/100!=2)n(new Error("Scalar request failed: "+o.statusCode));else if(r){let t="";r.page_title_cache_item&&r.page_title_cache_item.cached_title&&(t=r.page_title_cache_item.cached_title),e(t)}else n(new Error("Missing page title in response"))})}))}disableWidgetAssets(e,t){let n=this.apiUrl+"/widgets/set_assets_state";return n=this.getStarterLink(n),new Promise((o,r)=>{p()({method:"GET",uri:n,json:!0,qs:{widget_type:e.preferred,widget_id:t,state:"disable"}},(e,t,n)=>{e?r(e):t.statusCode/100!=2?r(new Error("Scalar request failed: "+t.statusCode)):n?o():r(new Error("Failed to set widget assets state"))})})}getScalarInterfaceUrlForRoom(e,t,n){const o=e.roomId,r=e.name;let i=this.uiUrl;return i+="?scalar_token="+encodeURIComponent(this.scalarToken),i+="&room_id="+encodeURIComponent(o),i+="&room_name="+encodeURIComponent(r),i+="&theme="+encodeURIComponent(l.b.getValue("theme")),n&&(i+="&integ_id="+encodeURIComponent(n)),t&&(i+="&screen="+encodeURIComponent(t)),i}getStarterLink(e){return e+"?scalar_token="+encodeURIComponent(this.scalarToken)}}var f=n(630);let _;!function(e){e.Account="account",e.Config="config",e.Homeserver="homeserver"}(_||(_={}));class b{constructor(e,t,n=t,o){r()(this,"apiUrl",void 0),r()(this,"uiUrl",void 0),r()(this,"kind",void 0),r()(this,"id",void 0),this.kind=e,this.apiUrl=t,this.uiUrl=n,this.id=o}get name(){return c.a.parse(this.uiUrl).host}get trimmedApiUrl(){const e=c.a.parse(this.apiUrl);return e.pathname="",e.path="",c.a.format(e)}getScalarClient(){return new g(this.apiUrl,this.uiUrl)}async open(e=null,t=null,n=null){if(!l.b.getValue("integrationProvisioning"))return C.sharedInstance().showDisabledDialog();const o=a.a.createTrackedDialog("Integration Manager","",f.a,{loading:!0},"mx_IntegrationManager"),r=this.getScalarClient();r.setTermsInteractionCallback((e,t)=>Object(d.c)(e,t,"mx_TermsDialog_forIntegrationManager"));const i={};try{await r.connect(),r.hasCredentials()?i.url=r.getScalarInterfaceUrlForRoom(e,t,n):i.connected=!1}catch(e){if(e instanceof d.b)return void o.close();console.error(e),i.connected=!1}o.close(),a.a.createTrackedDialog("Integration Manager","",f.a,i,"mx_IntegrationManager")}}var v=n(631),y=n(632),E=n(634),S=n(134);const w=[_.Account,_.Homeserver,_.Config];class C{static sharedInstance(){return C.instance||(C.instance=new C),C.instance}constructor(){r()(this,"managers",[]),r()(this,"client",void 0),r()(this,"primaryManager",void 0),r()(this,"setupHomeserverManagers",async e=>{if(console.log("Updating homeserver-configured integration managers..."),e&&e["m.integrations"]){let t=e["m.integrations"].managers;Array.isArray(t)||(t=[]),console.log(`Homeserver has ${t.length} integration managers`),this.managers=this.managers.filter(e=>e.kind!==_.Homeserver);for(const e of t)e.api_url&&this.managers.push(new b(_.Homeserver,e.api_url,e.ui_url));this.primaryManager=null}else console.log("Homeserver has no integration managers")}),r()(this,"onAccountData",e=>{"m.widgets"===e.getType()&&this.compileManagers()}),this.compileManagers()}startWatching(){this.stopWatching(),this.client=u.a.get(),this.client.on("accountData",this.onAccountData),this.client.on("WellKnown.client",this.setupHomeserverManagers),this.compileManagers()}stopWatching(){this.client&&(this.client.removeListener("accountData",this.onAccountData),this.client.removeListener("WellKnown.client",this.setupHomeserverManagers))}compileManagers(){this.managers=[],this.setupConfiguredManager(),this.setupAccountManagers()}setupConfiguredManager(){const e=i.a.get().integrations_rest_url,t=i.a.get().integrations_ui_url;e&&t&&(this.managers.push(new b(_.Config,e,t)),this.primaryManager=null)}setupAccountManagers(){if(!this.client||!this.client.getUserId())return;S.a.getIntegrationManagerWidgets().forEach(e=>{const t=e.content.data;if(!t)return;const n=e.content.url,o=t.api_url;if(!o||!n)return;const r=new b(_.Account,o,n,e.id||e.state_key||"");this.managers.push(r)}),this.primaryManager=null}hasManager(){return this.managers.length>0}getOrderedManagers(){const e=[];for(const t of w){const n=this.managers.filter(e=>e.kind===t);n&&n.length&&(t===_.Account&&n.sort((e,t)=>e.id.localeCompare(t.id)),e.push(...n))}return e}getPrimaryManager(){return this.hasManager()?(this.primaryManager||(this.primaryManager=this.getOrderedManagers()[0]),this.primaryManager):null}openNoManagerDialog(){a.a.createTrackedDialog("Integrations impossible","",v.a)}openAll(e=null,t=null,n=null){return l.b.getValue("integrationProvisioning")?0===this.managers.length?this.openNoManagerDialog():void a.a.createTrackedDialog("Tabbed Integration Manager","",y.a,{room:e,screen:t,integrationId:n},"mx_TabbedIntegrationManagerDialog"):this.showDisabledDialog()}showDisabledDialog(){a.a.createTrackedDialog("Integrations disabled","",E.a)}async overwriteManagerOnAccount(e){await S.a.removeIntegrationManagerWidgets(),await S.a.addIntegrationManagerWidget(e.name,e.uiUrl,e.apiUrl)}async tryDiscoverManager(e){let t;console.log("Looking up integration manager via .well-known"),(e.startsWith("http:")||e.startsWith("https:"))&&(e=c.a.parse(e).host);try{const n=await fetch(`https://${e}/.well-known/matrix/integrations`);t=await n.json()}catch(e){return console.error(e),console.warn("Failed to locate integration manager"),null}if(!t||!t["m.integrations_widget"])return console.warn("Missing integrations widget on .well-known response"),null;const n=t["m.integrations_widget"];if(!n.url||!n.data||!n.data.api_url)return console.warn("Malformed .well-known response for integrations widget"),null;const o=new b(_.Account,n.data.api_url,n.url);return console.log("Got an integration manager (untested)"),o}}r()(C,"instance",void 0),window.mxIntegrationManagers=C},function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return i}));function o(e){return a(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function r(e){return a(e,"abcdefghijklmnopqrstuvwxyz")}function i(e){return a(e,"ABCDEFGHIJKLMNOPQRSTUVWXYZ")}function a(e,t){let n="";for(let o=0;o{let{label:t,iconClassName:n,active:o,className:i}=e,s=a()(e,["label","iconClassName","active","className"]);return c.a.createElement(u.h,r()({},s,{className:d()(i,{mx_IconizedContextMenu_active:o}),active:o,label:t}),c.a.createElement("span",{className:d()("mx_IconizedContextMenu_icon",n)}),c.a.createElement("span",{className:"mx_IconizedContextMenu_label"},t),o&&c.a.createElement("span",{className:"mx_IconizedContextMenu_icon mx_IconizedContextMenu_checked"}))},p=e=>{let{label:t,iconClassName:n,active:o,className:i}=e,s=a()(e,["label","iconClassName","active","className"]);return c.a.createElement(u.g,r()({},s,{className:d()(i,{mx_IconizedContextMenu_active:o}),active:o,label:t}),c.a.createElement("span",{className:d()("mx_IconizedContextMenu_icon",n)}),c.a.createElement("span",{className:"mx_IconizedContextMenu_label"},t),o&&c.a.createElement("span",{className:"mx_IconizedContextMenu_icon mx_IconizedContextMenu_checked"}))},m=e=>{let{label:t,iconClassName:n}=e,o=a()(e,["label","iconClassName"]);return c.a.createElement(u.f,r()({},o,{label:t}),n&&c.a.createElement("span",{className:d()("mx_IconizedContextMenu_icon",n)}),c.a.createElement("span",{className:"mx_IconizedContextMenu_label"},t))},g=({first:e,red:t,className:n,children:o})=>{const r=d()("mx_IconizedContextMenu_optionList",n,{mx_IconizedContextMenu_optionList_notFirst:!e,mx_IconizedContextMenu_optionList_red:t});return c.a.createElement("div",{className:r},o)};t.e=e=>{let{className:t,children:n,compact:o}=e,i=a()(e,["className","children","compact"]);const s=d()("mx_IconizedContextMenu",t,{mx_IconizedContextMenu_compact:o});return c.a.createElement(u.b,r()({chevronFace:u.a.None},i),c.a.createElement("div",{className:s},n))}},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(533),i=(o=r)&&o.__esModule?o:{default:o};t.default=function(e,t,n){return t in e?(0,i.default)(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";class o{constructor(e){const t={},n=this._getOverriddenMethods(this,t);for(const o of Object.keys(n))"function"==typeof n[o]&&(t[o]=e[o],e[o]=n[o])}_getOverriddenMethods(){throw new Error("Not implemented")}}o.install=function(e,t,n){e.__mixins||(e.__mixins=[]);for(let n=0;n{const t=e.getPushActions(),n=this._pushProcessor.actionsForEvent(e);e.setPushActions(n);const o=this.getRoom(e.getRoomId());if(!o)return;const r=o.getUnreadNotificationCount("highlight"),i=!(!t||!t.tweaks)&&!!t.tweaks.highlight,a=!(!n||!n.tweaks)&&!!n.tweaks.highlight;if((i!==a||r>0)&&!o.hasUserReadEvent(this.getUserId(),e.getId())){let e=r;a&&!i&&e++,!a&&i&&e--,o.setUnreadNotificationCount("highlight",e);o.getUnreadNotificationCount("total"){if(t&&this.isRoomEncrypted(t.roomId)){const n=e.getContent();if(!(Object.keys(n).filter(e=>Object.keys(n[e]["m.read"]).includes(this.getUserId())).length>0))return;const o=20,r=t.getLiveTimeline().getEvents();let i=0;for(let e=r.length-1;e>=0;e--){if(e===r.length-o)return;const n=r[e];if(t.hasUserReadEvent(this.getUserId(),n.getId()))break;const a=this.getPushActionsForEvent(n);i+=a.tweaks&&a.tweaks.highlight?1:0}t.setUnreadNotificationCount("highlight",i)}})}async function M(e,t,n,o,r,i){if(!e._crypto)throw new Error("End-to-End encryption disabled");await e._crypto.setDeviceVerification(t,n,o,r,i)}function P(e,t){for(const n of t)e.prototype[n]=function(...e){if(!this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto[n](...e)}}function L(e,t,n,o){return Promise.resolve().then((function(){const o=function(e,t,n){if(t.isEncrypted())return null;if(!e.isRoomEncrypted(t.getRoomId()))return null;if(!e._crypto&&e.usingExternalCrypto)return null;if("m.reaction"===t.getType())return null;if(!e._crypto)throw new Error("This room is configured to use encryption, but your client does not support encryption.");return e._crypto.encryptEvent(t,n)}(e,n,t);return o?(j(t,n,l.a.ENCRYPTING),o.then(()=>{j(t,n,l.a.SENDING)})):null})).then((function(){let o;return e.scheduler&&(o=e.scheduler.queueEvent(n),o&&e.scheduler.getQueueForEvent(n).length>1&&j(t,n,l.a.QUEUED)),o||(o=U(e,n),t&&(o=o.then(e=>(t.updatePendingEvent(n,l.a.SENT,e.event_id),e)))),o})).then((function(e){return o&&o(null,e),e}),(function(e){S.a.error("Error sending event",e.stack||e);try{n.error=e,j(t,n,l.a.NOT_SENT),e.event=n,o&&o(e)}catch(t){S.a.error("Exception in error handler!",t.stack||e)}throw e}))}function j(e,t,n){e?e.updatePendingEvent(t,n):t.setStatus(n)}function U(e,t){let n=t.getTxnId();n||(n=e.makeTxnId(),t.setTxnId(n));const o={$roomId:t.getRoomId(),$eventType:t.getWireType(),$stateKey:t.getStateKey(),$txnId:n};let r;if(t.isState()){let e="/rooms/$roomId/state/$eventType";t.getStateKey()&&t.getStateKey().length>0&&(e="/rooms/$roomId/state/$eventType/$stateKey"),r=g.g(e,o)}else if(t.isRedaction()){const e="/rooms/$roomId/redact/$redactsEventId/$txnId";r=g.g(e,Object.assign({$redactsEventId:t.event.redacts},o))}else r=g.g("/rooms/$roomId/send/$eventType/$txnId",o);return e._http.authedRequest(void 0,"PUT",r,void 0,t.getWireContent()).then(e=>(S.a.log(`Event sent to ${t.getRoomId()} with event id ${e.event_id}`),e))}function B(e,t,n,o,r,i){g.n(r)&&(i=r,r=void 0);const a=g.g("/rooms/$room_id/$membership",{$room_id:t,$membership:o});return e._http.authedRequest(i,"POST",a,void 0,{user_id:n,reason:r})}function G(e,t,n){e&&e(n),t(n)}function q(e,t,n){e&&e(null,n),t(n)}function V(e,t={}){const n=Boolean(t.preventReEmit),o=!1!==t.decrypt;return function(t){const r=new l.b(t);return r.isEncrypted()&&(n||e.reEmitter.reEmit(r,["Event.decrypted"]),o&&e.decryptEventIfNeeded(r)),n||e.reEmitter.reEmit(r,["Event.replaced"]),r}}g.m(F,i.EventEmitter),g.j(F.prototype,a.a.prototype),F.prototype.rehydrateDevice=async function(){if(this._crypto)throw new Error("Cannot rehydrate device after crypto is initialized");if(!this._cryptoCallbacks.getDehydrationKey)return;const t=await this.getDehydratedDevice();if(!t)return;if(!t.device_data||!t.device_id)return void S.a.info("no dehydrated device found");const n=new e.Olm.Account;try{const e=t.device_data;if(e.algorithm!==I.a)return void S.a.warn("Wrong algorithm for dehydrated device");S.a.log("unpickling dehydrated device");const o=await this._cryptoCallbacks.getDehydrationKey(e,t=>{n.unpickle(new Uint8Array(t),e.account)});n.unpickle(o,e.account),S.a.log("unpickled device");if(!0===(await this._http.authedRequest(void 0,"POST","/dehydrated_device/claim",void 0,{device_id:t.device_id},{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})).success){this.deviceId=t.device_id,S.a.info("using dehydrated device");const e=this.pickleKey||"DEFAULT_KEY";return this._exportedOlmDeviceToImport={pickledAccount:n.pickle(e),sessions:[],pickleKey:e},n.free(),this.deviceId}return n.free(),void S.a.info("not using dehydrated device")}catch(e){n.free(),S.a.warn("could not unpickle",e)}},F.prototype.getDehydratedDevice=async function(){try{return await this._http.authedRequest(void 0,"GET","/dehydrated_device",void 0,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})}catch(e){return void S.a.info("could not get dehydrated device",e.toString())}},F.prototype.setDehydrationKey=async function(e,t={},n){if(this._crypto)return await this._crypto._dehydrationManager.setKeyAndQueueDehydration(e,t,n);S.a.warn("not dehydrating device if crypto is not enabled")},F.prototype.createDehydratedDevice=async function(e,t={},n){if(this._crypto)return await this._crypto._dehydrationManager.setKey(e,t,n),await this._crypto._dehydrationManager.dehydrateDevice();S.a.warn("not dehydrating device if crypto is not enabled")},F.prototype.exportDevice=async function(){if(this._crypto)return{userId:this.credentials.userId,deviceId:this.deviceId,olmDevice:await this._crypto._olmDevice.export()};S.a.warn("not exporting device if crypto is not enabled")},F.prototype.clearStores=function(){if(this._clientRunning)throw new Error("Cannot clear stores while client is running");const e=[];return e.push(this.store.deleteAllData()),this._cryptoStore&&e.push(this._cryptoStore.deleteAllData()),Promise.all(e)},F.prototype.getUserId=function(){return this.credentials&&this.credentials.userId?this.credentials.userId:null},F.prototype.getDomain=function(){return this.credentials&&this.credentials.userId?this.credentials.userId.replace(/^.*?:/,""):null},F.prototype.getUserIdLocalpart=function(){return this.credentials&&this.credentials.userId?this.credentials.userId.split(":")[0].substring(1):null},F.prototype.getDeviceId=function(){return this.deviceId},F.prototype.supportsVoip=function(){return this._supportsVoip},F.prototype.setForceTURN=function(e){this._forceTURN=e},F.prototype.setSupportsCallTransfer=function(e){this._supportsCallTransfer=e},F.prototype.createCall=function(e){return Object(p.g)(this,e)},F.prototype.getSyncState=function(){return this._syncApi?this._syncApi.getSyncState():null},F.prototype.getSyncStateData=function(){return this._syncApi?this._syncApi.getSyncStateData():null},F.prototype.isInitialSyncComplete=function(){const e=this.getSyncState();return!!e&&("PREPARED"===e||"SYNCING"===e)},F.prototype.isGuest=function(){return this._isGuest},F.prototype.getScheduler=function(){return this.scheduler},F.prototype.setGuest=function(e){this._isGuest=e},F.prototype.retryImmediately=function(){return this._syncApi.retryImmediately()},F.prototype.getNotifTimelineSet=function(){return this._notifTimelineSet},F.prototype.setNotifTimelineSet=function(e){this._notifTimelineSet=e},F.prototype.getCapabilities=function(e=!1){const t=(new Date).getTime();return this._cachedCapabilities&&!e&&t(S.a.error(e),null)).then(e=>{e||(e={});const n=e.capabilities||{},o=Object.keys(n).length?216e5:6e4+5e3*Math.random();return this._cachedCapabilities={capabilities:n,expiration:t+o},S.a.log("Caching capabilities: ",n),n})},F.prototype.initCrypto=async function(){if(!Object(w.c)())throw new Error("End-to-end encryption not supported in this js-sdk build: did you remember to load the olm library?");if(this._crypto)return void S.a.warn("Attempt to re-initialise e2e encryption on MatrixClient");if(!this._sessionStore)throw new Error("Cannot enable encryption: no sessionStore provided");if(!this._cryptoStore)throw new Error("Cannot enable encryption: no cryptoStore provided");S.a.log("Crypto: Starting up crypto store..."),await this._cryptoStore.startup(),S.a.log("Crypto: initialising roomlist..."),await this._roomList.init();const e=this.getUserId();if(null===e)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");if(null===this.deviceId)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");const t=new w.a(this,this._sessionStore,e,this.deviceId,this.store,this._cryptoStore,this._roomList,this._verificationMethods);this.reEmitter.reEmit(t,["crypto.keyBackupFailed","crypto.keyBackupSessionsRemaining","crypto.roomKeyRequest","crypto.roomKeyRequestCancellation","crypto.warning","crypto.devicesUpdated","crypto.willUpdateDevices","deviceVerificationChanged","userTrustStatusChanged","crossSigning.keysChanged"]),S.a.log("Crypto: initialising crypto object..."),await t.init({exportedOlmDevice:this._exportedOlmDeviceToImport,pickleKey:this.pickleKey}),delete this._exportedOlmDeviceToImport,this.olmVersion=w.a.getOlmVersion(),t.registerEventHandlers(this),this._crypto=t},F.prototype.isCryptoEnabled=function(){return null!==this._crypto},F.prototype.getDeviceEd25519Key=function(){return this._crypto?this._crypto.getDeviceEd25519Key():null},F.prototype.getDeviceCurve25519Key=function(){return this._crypto?this._crypto.getDeviceCurve25519Key():null},F.prototype.uploadKeys=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.uploadDeviceKeys()},F.prototype.downloadKeys=function(e,t){return null===this._crypto?Promise.reject(new Error("End-to-end encryption disabled")):this._crypto.downloadKeys(e,t)},F.prototype.getStoredDevicesForUser=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getStoredDevicesForUser(e)||[]},F.prototype.getStoredDevice=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getStoredDevice(e,t)||null},F.prototype.setDeviceVerified=function(e,t,n){void 0===n&&(n=!0);const o=M(this,e,t,n,null);return e==this.credentials.userId&&this._crypto.checkKeyBackup(),o},F.prototype.setDeviceBlocked=function(e,t,n){return void 0===n&&(n=!0),M(this,e,t,null,n)},F.prototype.setDeviceKnown=function(e,t,n){return void 0===n&&(n=!0),M(this,e,t,null,null,n)},F.prototype.requestVerificationDM=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.requestVerificationDM(e,t)},F.prototype.findVerificationRequestDMInProgress=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.findVerificationRequestDMInProgress(e)},F.prototype.getVerificationRequestsToDeviceInProgress=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getVerificationRequestsToDeviceInProgress(e)},F.prototype.requestVerification=function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.requestVerification(e,t)},F.prototype.beginKeyVerification=function(e,t,n){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.beginKeyVerification(e,t,n)},F.prototype.setGlobalBlacklistUnverifiedDevices=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.setGlobalBlacklistUnverifiedDevices(e)},F.prototype.getGlobalBlacklistUnverifiedDevices=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getGlobalBlacklistUnverifiedDevices()},F.prototype.setGlobalErrorOnUnknownDevices=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.setGlobalErrorOnUnknownDevices(e)},F.prototype.getGlobalErrorOnUnknownDevices=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.getGlobalErrorOnUnknownDevices()},P(F,["getCrossSigningId","getStoredCrossSigningForUser","checkUserTrust","checkDeviceTrust","checkOwnCrossSigningTrust","checkCrossSigningPrivateKey","legacyDeviceVerification","prepareToEncrypt","isCrossSigningReady","bootstrapCrossSigning","getCryptoTrustCrossSignedDevices","setCryptoTrustCrossSignedDevices","countSessionsNeedingBackup"]),P(F,["getEventEncryptionInfo","createRecoveryKeyFromPassphrase","isSecretStorageReady","bootstrapSecretStorage","addSecretStorageKey","hasSecretStorageKey","storeSecret","getSecret","isSecretStored","requestSecret","getDefaultSecretStorageKeyId","setDefaultSecretStorageKeyId","checkSecretStorageKey","checkSecretStoragePrivateKey"]),F.prototype.getEventSenderDeviceInfo=async function(e){return this._crypto?this._crypto.getEventSenderDeviceInfo(e):null},F.prototype.isEventSenderVerified=async function(e){const t=await this.getEventSenderDeviceInfo(e);return!!t&&t.isVerified()},F.prototype.cancelAndResendEventRoomKeyRequest=function(e){return e.cancelAndResendKeyRequest(this._crypto,this.getUserId())},F.prototype.setRoomEncryption=function(e,t){if(!this._crypto)throw new Error("End-to-End encryption disabled");return this._crypto.setRoomEncryption(e,t)},F.prototype.isRoomEncrypted=function(e){const t=this.getRoom(e);if(!t)return!1;return!!t.currentState.getStateEvents("m.room.encryption","")||this._roomList.isRoomEncrypted(e)},F.prototype.forceDiscardSession=function(e){if(!this._crypto)throw new Error("End-to-End encryption disabled");this._crypto.forceDiscardSession(e)},F.prototype.exportRoomKeys=function(){return this._crypto?this._crypto.exportRoomKeys():Promise.reject(new Error("End-to-end encryption disabled"))},F.prototype.importRoomKeys=function(e,t){if(!this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.importRoomKeys(e,t)},F.prototype.checkKeyBackup=function(){return this._crypto.checkKeyBackup()},F.prototype.getKeyBackupVersion=function(){return this._http.authedRequest(void 0,"GET","/room_keys/version",void 0,void 0,{prefix:f.i}).then(e=>{if(e.algorithm!==v.MEGOLM_BACKUP_ALGORITHM){const t="Unknown backup algorithm: "+e.algorithm;return Promise.reject(t)}if("object"==typeof e.auth_data&&e.auth_data.public_key)return e;{const e="Invalid backup data returned";return Promise.reject(e)}}).catch(e=>{if("M_NOT_FOUND"===e.errcode)return null;throw e})},F.prototype.isKeyBackupTrusted=function(e){return this._crypto.isKeyBackupTrusted(e)},F.prototype.getKeyBackupEnabled=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto._checkedForBackup?Boolean(this._crypto.backupKey):null},F.prototype.enableKeyBackup=function(t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo=t,this._crypto.backupKey&&this._crypto.backupKey.free(),this._crypto.backupKey=new e.Olm.PkEncryption,this._crypto.backupKey.set_recipient_key(t.auth_data.public_key),this.emit("crypto.keyBackupStatus",!0),this._crypto.scheduleKeyBackupSend()},F.prototype.disableKeyBackup=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo=null,this._crypto.backupKey&&this._crypto.backupKey.free(),this._crypto.backupKey=null,this.emit("crypto.keyBackupStatus",!1)},F.prototype.prepareKeyBackupVersion=async function(e,{secureSecretStorage:t=!1}={}){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const{keyInfo:n,encodedPrivateKey:o,privateKey:r}=await this.createRecoveryKeyFromPassphrase(e);t&&(await this.storeSecret("m.megolm_backup.v1",Object(v.encodeBase64)(r)),S.a.info("Key backup private key stored in secret storage"));const i={public_key:n.pubkey};return n.passphrase&&(i.private_key_salt=n.passphrase.salt,i.private_key_iterations=n.passphrase.iterations),{algorithm:v.MEGOLM_BACKUP_ALGORITHM,auth_data:i,recovery_key:o}},F.prototype.isKeyBackupKeyStored=async function(){return this.isSecretStored("m.megolm_backup.v1",!1)},F.prototype.createKeyBackupVersion=async function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const t={algorithm:e.algorithm,auth_data:e.auth_data};await this._crypto._signObject(t.auth_data),this._cryptoCallbacks.getCrossSigningKey&&this._crypto._crossSigningInfo.getId()&&await this._crypto._crossSigningInfo.signObject(t.auth_data,"master");const n=await this._http.authedRequest(void 0,"POST","/room_keys/version",void 0,t,{prefix:f.i});return await this.checkKeyBackup(),this.getKeyBackupEnabled()||S.a.error("Key backup not usable even though we just created it"),n},F.prototype.deleteKeyBackupVersion=function(e){if(null===this._crypto)throw new Error("End-to-end encryption disabled");this._crypto.backupInfo&&this._crypto.backupInfo.version===e&&this.disableKeyBackup();const t=g.g("/room_keys/version/$version",{$version:e});return this._http.authedRequest(void 0,"DELETE",t,void 0,void 0,{prefix:f.i})},F.prototype._makeKeyBackupPath=function(e,t,n){let o;o=void 0!==t?g.g("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:t}):void 0!==e?g.g("/room_keys/keys/$roomId",{$roomId:e}):"/room_keys/keys";return{path:o,queryData:void 0===n?void 0:{version:n}}},F.prototype.sendKeyBackup=function(e,t,n,o){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const r=this._makeKeyBackupPath(e,t,n);return this._http.authedRequest(void 0,"PUT",r.path,r.queryData,o,{prefix:f.i})},F.prototype.scheduleAllGroupSessionsForBackup=async function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");await this._crypto.scheduleAllGroupSessionsForBackup()},F.prototype.flagAllGroupSessionsForBackup=function(){if(null===this._crypto)throw new Error("End-to-end encryption disabled");return this._crypto.flagAllGroupSessionsForBackup()},F.prototype.isValidRecoveryKey=function(e){try{return Object(C.a)(e),!0}catch(e){return!1}},F.prototype.keyBackupKeyFromPassword=function(e,t){return Object(T.b)(t.auth_data,e)},F.prototype.keyBackupKeyFromRecoveryKey=function(e){return Object(C.a)(e)},F.RESTORE_BACKUP_ERROR_BAD_KEY="RESTORE_BACKUP_ERROR_BAD_KEY",F.prototype.restoreKeyBackupWithPassword=async function(e,t,n,o,r){const i=await Object(T.b)(o.auth_data,e);return this._restoreKeyBackup(i,t,n,o,r)},F.prototype.restoreKeyBackupWithSecretStorage=async function(e,t,n,o){const r=await this.getSecret("m.megolm_backup.v1"),i=Object(w.b)(r);if(i){const[e]=await this._crypto.getSecretStorageKey();await this.storeSecret("m.megolm_backup.v1",i,[e])}const a=Object(v.decodeBase64)(i||r);return this._restoreKeyBackup(a,t,n,e,o)},F.prototype.restoreKeyBackupWithRecoveryKey=function(e,t,n,o,r){const i=Object(C.a)(e);return this._restoreKeyBackup(i,t,n,o,r)},F.prototype.restoreKeyBackupWithCache=async function(e,t,n,o){const r=await this._crypto.getSessionBackupPrivateKey();if(!r)throw new Error("Couldn't get key");return this._restoreKeyBackup(r,e,t,n,o)},F.prototype._restoreKeyBackup=function(t,n,o,r,{cacheCompleteCallback:i,progressCallback:a}={}){if(null===this._crypto)throw new Error("End-to-end encryption disabled");let s=0,c=[];const l=this._makeKeyBackupPath(n,o,r.version),d=new e.Olm.PkDecryption;let u;try{u=d.init_with_private_key(t)}catch(e){throw d.free(),e}return u!==r.auth_data.public_key?Promise.reject({errcode:F.RESTORE_BACKUP_ERROR_BAD_KEY}):(this._crypto.storeSessionBackupPrivateKey(t).catch(e=>{S.a.warn("Error caching session backup key:",e)}).then(i),a&&a({stage:"fetch"}),this._http.authedRequest(void 0,"GET",l.path,l.queryData,void 0,{prefix:f.i}).then(e=>{if(e.rooms)for(const[t,n]of Object.entries(e.rooms)){if(!n.sessions)continue;s+=Object.keys(n.sessions).length;const e=A(n.sessions,d,t);for(const n of e)n.room_id=t,c.push(n)}else if(e.sessions)s=Object.keys(e.sessions).length,c=A(e.sessions,d,n);else{s=1;try{const t=N(e,d);t.room_id=n,t.session_id=o,c.push(t)}catch(e){S.a.log("Failed to decrypt megolm session from backup",e)}}return this.importRoomKeys(c,{progressCallback:a,untrusted:!0,source:"backup"})}).then(()=>this._crypto.setTrustedBackupPubKey(u)).then(()=>({total:s,imported:c.length})).finally(()=>{d.free()}))},F.prototype.deleteKeysFromBackup=function(e,t,n){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const o=this._makeKeyBackupPath(e,t,n);return this._http.authedRequest(void 0,"DELETE",o.path,o.queryData,void 0,{prefix:f.i})},F.prototype.sendSharedHistoryKeys=async function(e,t){if(null===this._crypto)throw new Error("End-to-end encryption disabled");const n=this._roomList.getRoomEncryption(e);if(!n)return void S.a.error("Unknown room. Not sharing decryption keys");const o=await this._crypto.downloadKeys(t),r={};for(const[e,t]of Object.entries(o))r[e]=Object.values(t);const i=this._crypto._getRoomDecryptor(e,n.algorithm);i.sendSharedHistoryInboundSessions?await i.sendSharedHistoryInboundSessions(r):S.a.warning("Algorithm does not support sharing previous keys",n.algorithm)},F.prototype.getGroup=function(e){return this.store.getGroup(e)},F.prototype.getGroups=function(){return this.store.getGroups()},F.prototype.getMediaConfig=function(e){return this._http.authedRequest(e,"GET","/config",void 0,void 0,{prefix:f.g})},F.prototype.getRoom=function(e){return this.store.getRoom(e)},F.prototype.getRooms=function(){return this.store.getRooms()},F.prototype.getVisibleRooms=function(){const e=this.store.getRooms(),t=new Set;for(const n of e){const e=n.currentState.getStateEvents("m.room.create","");if(e){const n=e.getContent().predecessor;n&&n.room_id&&t.add(n.room_id)}}return e.filter(e=>!e.currentState.getStateEvents("m.room.tombstone","")||!t.has(e.roomId))},F.prototype.getUser=function(e){return this.store.getUser(e)},F.prototype.getUsers=function(){return this.store.getUsers()},F.prototype.setAccountData=function(e,t,n){const o=g.g("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e}),r=Object(f.j)(5,()=>this._http.authedRequest(void 0,"PUT",o,void 0,t));return n&&r.then(e=>n(null,e),n),r},F.prototype.getAccountData=function(e){return this.store.getAccountData(e)},F.prototype.getAccountDataFromServer=async function(e){if(this.isInitialSyncComplete()){const t=this.store.getAccountData(e);return t?t.getContent():null}const t=g.g("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e});try{return await this._http.authedRequest(void 0,"GET",t,void 0)}catch(e){if(e.data&&"M_NOT_FOUND"===e.data.errcode)return null;throw e}},F.prototype.getIgnoredUsers=function(){const e=this.getAccountData("m.ignored_user_list");return e&&e.getContent()&&e.getContent().ignored_users?Object.keys(e.getContent().ignored_users):[]},F.prototype.setIgnoredUsers=function(e,t){const n={ignored_users:{}};return e.map(e=>n.ignored_users[e]={}),this.setAccountData("m.ignored_user_list",n,t)},F.prototype.isUserIgnored=function(e){return-1!==this.getIgnoredUsers().indexOf(e)},F.prototype.joinRoom=function(e,t,n){if(g.n(t))throw new Error("Expected 'opts' object, got function.");void 0===(t=t||{}).syncRoom&&(t.syncRoom=!0);const o=this.getRoom(e);if(o&&o.hasMembershipState(this.credentials.userId,"join"))return Promise.resolve(o);let r=Promise.resolve();t.inviteSignUrl&&(r=this._http.requestOtherUrl(void 0,"POST",t.inviteSignUrl,{mxid:this.credentials.userId}));const i={};t.viaServers&&(i.server_name=t.viaServers);const a={qsStringifyOptions:{arrayFormat:"repeat"}},s=this;return new Promise((o,l)=>{r.then((function(t){const n={};t&&(n.third_party_signed=t);const o=g.g("/join/$roomid",{$roomid:e});return s._http.authedRequest(void 0,"POST",o,i,n,a)})).then((function(e){const n=e.room_id,o=new c.a(s,s._clientOpts).createRoom(n);return t.syncRoom,Promise.resolve(o)})).then((function(e){q(n,o,e)}),(function(e){G(n,l,e)}))})},F.prototype.resendEvent=function(e,t){return j(t,e,l.a.SENDING),L(this,t,e)},F.prototype.cancelPendingEvent=function(e){if([l.a.QUEUED,l.a.NOT_SENT].indexOf(e.status)<0)throw new Error("cannot cancel an event with status "+e.status);this.scheduler&&this.scheduler.removeEventFromQueue(e);j(this.getRoom(e.getRoomId()),e,l.a.CANCELLED)},F.prototype.setRoomName=function(e,t,n){return this.sendStateEvent(e,"m.room.name",{name:t},void 0,n)},F.prototype.setRoomTopic=function(e,t,n){return this.sendStateEvent(e,"m.room.topic",{topic:t},void 0,n)},F.prototype.getRoomTags=function(e,t){const n=g.g("/user/$userId/rooms/$roomId/tags/",{$userId:this.credentials.userId,$roomId:e});return this._http.authedRequest(t,"GET",n,void 0)},F.prototype.setRoomTag=function(e,t,n,o){const r=g.g("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this._http.authedRequest(o,"PUT",r,void 0,n)},F.prototype.deleteRoomTag=function(e,t,n){const o=g.g("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this._http.authedRequest(n,"DELETE",o,void 0,void 0)},F.prototype.setRoomAccountData=function(e,t,n,o){const r=g.g("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:t});return this._http.authedRequest(o,"PUT",r,void 0,n)},F.prototype.setPowerLevel=function(e,t,n,o,r){let i={users:{}};o&&"m.room.power_levels"===o.getType()&&(i=g.d(o.getContent())),i.users[t]=n;const a=g.g("/rooms/$roomId/state/m.room.power_levels",{$roomId:e});return this._http.authedRequest(r,"PUT",a,void 0,i)},F.prototype.sendEvent=function(e,t,n,o,r){return this._sendCompleteEvent(e,{type:t,content:n},o,r)},F.prototype._sendCompleteEvent=function(e,t,n,o){g.n(n)&&(o=n,n=void 0),n||(n=this.makeTxnId());const r=new l.b(Object.assign(t,{event_id:"~"+e+":"+n,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:e,origin_server_ts:(new Date).getTime()})),i=this.getRoom(e),a=r.getAssociatedId();if(a&&a.startsWith("~")){const e=i.getPendingEvents().find(e=>e.getId()===a);e.once("Event.localEventIdReplaced",()=>{r.updateAssociatedId(e.getId())})}const s=r.getType();return S.a.log(`sendEvent of type ${s} in ${e} with txnId ${n}`),r.setTxnId(n),r.setStatus(l.a.SENDING),i&&i.addPendingEvent(r,n),r.status===l.a.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):L(this,i,r,o)},F.prototype.redactEvent=function(e,t,n,o){const r=("object"==typeof o?o:{}).reason,i="function"==typeof o?o:void 0;return this._sendCompleteEvent(e,{type:"m.room.redaction",content:{reason:r},redacts:t},n,i)},F.prototype.sendMessage=function(e,t,n,o){return g.n(n)&&(o=n,n=void 0),this.sendEvent(e,"m.room.message",t,n,o)},F.prototype.sendTextMessage=function(e,t,n,o){const r=b.makeTextMessage(t);return this.sendMessage(e,r,n,o)},F.prototype.sendNotice=function(e,t,n,o){const r=b.makeNotice(t);return this.sendMessage(e,r,n,o)},F.prototype.sendEmoteMessage=function(e,t,n,o){const r=b.makeEmoteMessage(t);return this.sendMessage(e,r,n,o)},F.prototype.sendImageMessage=function(e,t,n,o,r){g.n(o)&&(r=o,o=void 0),o||(o="Image");const i={msgtype:"m.image",url:t,info:n,body:o};return this.sendMessage(e,i,r)},F.prototype.sendStickerMessage=function(e,t,n,o,r){g.n(o)&&(r=o,o=void 0),o||(o="Sticker");const i={url:t,info:n,body:o};return this.sendEvent(e,"m.sticker",i,r,void 0)},F.prototype.sendHtmlMessage=function(e,t,n,o){const r=b.makeHtmlMessage(t,n);return this.sendMessage(e,r,o)},F.prototype.sendHtmlNotice=function(e,t,n,o){const r=b.makeHtmlNotice(t,n);return this.sendMessage(e,r,o)},F.prototype.sendHtmlEmote=function(e,t,n,o){const r=b.makeHtmlEmote(t,n);return this.sendMessage(e,r,o)},F.prototype.sendReceipt=function(e,t,n,o){if("function"==typeof n&&(o=n,n={}),this.isGuest())return Promise.resolve({});const r=g.g("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:t,$eventId:e.getId()}),i=this._http.authedRequest(o,"POST",r,void 0,n||{}),a=this.getRoom(e.getRoomId());return a&&a._addLocalEchoReceipt(this.credentials.userId,e,t),i},F.prototype.sendReadReceipt=async function(e,t,n){"function"==typeof t&&(n=t,t={}),t||(t={});const o=e.getId(),r=this.getRoom(e.getRoomId());if(r&&r.hasPendingEvent(o))throw new Error(`Cannot set read receipt to a pending event (${o})`);const i={"m.hidden":Boolean(t.hidden)};return this.sendReceipt(e,"m.read",i,n)},F.prototype.setRoomReadMarkers=async function(e,t,n,o){const r=this.getRoom(e);if(r&&r.hasPendingEvent(t))throw new Error(`Cannot set read marker to a pending event (${t})`);let i;if(n){if(i=n.getId(),r&&r.hasPendingEvent(i))throw new Error(`Cannot set read receipt to a pending event (${i})`);r&&r._addLocalEchoReceipt(this.credentials.userId,n,"m.read")}return this.setRoomReadMarkersHttpRequest(e,t,i,o)},F.prototype.getUrlPreview=function(e,t,n){const o=(t=6e4*Math.floor(t/6e4))+"_"+e,r=this.urlPreviewCache[o];if(r)return n&&r.then(n).catch(n),r;const i=this._http.authedRequest(n,"GET","/preview_url",{url:e,ts:t},void 0,{prefix:f.g});return this.urlPreviewCache[o]=i,i},F.prototype.sendTyping=function(e,t,n,o){if(this.isGuest())return Promise.resolve({});const r=g.g("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.credentials.userId}),i={typing:t};return t&&(i.timeout=n||2e4),this._http.authedRequest(o,"PUT",r,void 0,i)},F.prototype.getRoomUpgradeHistory=function(e,t=!1){let n=this.getRoom(e);if(!n)return[];const o=[n];let r=n.currentState.getStateEvents("m.room.create","");for(;r;){S.a.log("Looking at "+r.getId());const e=r.getContent().predecessor;if(!e||!e.room_id)break;{S.a.log("Looking at predecessor "+e.room_id);const n=this.getRoom(e.room_id);if(!n)break;if(t){const e=n.currentState.getStateEvents("m.room.tombstone","");if(!e||e.getContent().replacement_room!==n.roomId)break}o.splice(0,0,n),r=n.currentState.getStateEvents("m.room.create","")}}let i=n.currentState.getStateEvents("m.room.tombstone","");for(;i;){const e=this.getRoom(i.getContent().replacement_room);if(!e)break;if(e.roomId===n.roomId)break;if(t){if(r=e.currentState.getStateEvents("m.room.create",""),!r||!r.getContent().predecessor)break;if(r.getContent().predecessor.room_id!==n.roomId)break}o.push(e);if(new Set(o.map(e=>e.roomId)).sizethis.leave(e).then(()=>{r[e]=null}).catch(t=>(r[e]=t,null));for(const e of o)i.push(a(e.roomId));return Promise.all(i).then(()=>r)},F.prototype.ban=function(e,t,n,o){return B(this,e,t,"ban",n,o)},F.prototype.forget=function(e,t,n){void 0===t&&(t=!0);const o=B(this,e,void 0,"forget",void 0,n);if(!t)return o;const r=this;return o.then((function(t){return r.store.removeRoom(e),r.emit("deleteRoom",e),t}))},F.prototype.unban=function(e,t,n){const o=g.g("/rooms/$roomId/unban",{$roomId:e}),r={user_id:t};return this._http.authedRequest(n,"POST",o,void 0,r)},F.prototype.kick=function(e,t,n,o){return function(e,t,n,o,r,i){g.n(r)&&(i=r,r=void 0);const a=g.g("/rooms/$roomId/state/m.room.member/$userId",{$roomId:t,$userId:n});return e._http.authedRequest(i,"PUT",a,void 0,{membership:o,reason:r})}(this,e,t,"leave",n,o)},F.prototype.getPushActionsForEvent=function(e){return e.getPushActions()||e.setPushActions(this._pushProcessor.actionsForEvent(e)),e.getPushActions()},F.prototype.setProfileInfo=function(e,t,n){const o=g.g("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this._http.authedRequest(n,"PUT",o,void 0,t)},F.prototype.setDisplayName=async function(e,t){const n=await this.setProfileInfo("displayname",{displayname:e},t),o=this.getUser(this.getUserId());return o&&(o.displayName=e,o.emit("User.displayName",o.events.presence,o)),n},F.prototype.setAvatarUrl=async function(e,t){const n=await this.setProfileInfo("avatar_url",{avatar_url:e},t),o=this.getUser(this.getUserId());return o&&(o.avatarUrl=e,o.emit("User.avatarUrl",o.events.presence,o)),n},F.prototype.mxcUrlToHttp=function(e,t,n,o,r){return Object(_.a)(this.baseUrl,e,t,n,o,r)},F.prototype._unstable_setStatusMessage=function(e){const t="im.vector.user_status";return Promise.all(this.getRooms().map(n=>{const o="join"===n.getMyMembership(),r=2===n.getInvitedAndJoinedMemberCount();if(!o||!r)return Promise.resolve();return n.currentState.mayClientSendStateEvent(t,this)?this.sendStateEvent(n.roomId,t,{status:e},this.getUserId()):Promise.resolve()}))},F.prototype.setPresence=function(e,t){const n=g.g("/presence/$userId/status",{$userId:this.credentials.userId});"string"==typeof e&&(e={presence:e});if(-1==["offline","online","unavailable"].indexOf(e.presence))throw new Error("Bad presence value: "+e.presence);return this._http.authedRequest(t,"PUT",n,void 0,e)},F.prototype.getPresence=function(e,t){const n=g.g("/presence/$userId/status",{$userId:e});return this._http.authedRequest(t,"GET",n,void 0,void 0)},F.prototype.scrollback=function(e,t,n){g.n(t)&&(n=t,t=void 0),t=t||30;let o=0,r=this._ongoingScrollbacks[e.roomId]||{};if(r.promise)return r.promise;if(r.errorTs){const e=Date.now()-r.errorTs;o=Math.max(3e3-e,0)}if(null===e.oldState.paginationToken)return Promise.resolve(e);const i=this.store.scrollback(e,t).length;if(i===t)return Promise.resolve(e);t-=i;const a=this,s=new Promise((r,i)=>{Object(g.w)(o).then((function(){return a._createMessagesRequest(e.roomId,e.oldState.paginationToken,t,"b")})).then((function(t){const o=t.chunk.map(V(a));if(t.state){const n=t.state.map(V(a));e.currentState.setUnknownStateEvents(n)}e.addEventsToTimeline(o,!0,e.getLiveTimeline()),e.oldState.paginationToken=t.end,0===t.chunk.length&&(e.oldState.paginationToken=null),a.store.storeEvents(e,o,t.end,!0),a._ongoingScrollbacks[e.roomId]=null,q(n,r,e)}),(function(t){a._ongoingScrollbacks[e.roomId]={errorTs:Date.now()},G(n,i,t)}))});return r={promise:s,errorTs:null},this._ongoingScrollbacks[e.roomId]=r,s},F.prototype.getEventTimeline=function(e,t){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(e.getTimelineForEvent(t))return Promise.resolve(e.getTimelineForEvent(t));const n=g.g("/rooms/$roomId/context/$eventId",{$roomId:e.room.roomId,$eventId:t});let o=void 0;this._clientOpts.lazyLoadMembers&&(o={filter:JSON.stringify(s.a.LAZY_LOADING_MESSAGES_FILTER)});const r=this;return r._http.authedRequest(void 0,"GET",n,o).then((function(n){if(!n.event)throw new Error("'event' not in '/context' result - homeserver too old?");if(e.getTimelineForEvent(t))return e.getTimelineForEvent(t);n.events_after.reverse();const o=n.events_after.concat([n.event]).concat(n.events_before).map(r.getEventMapper());let i=e.getTimelineForEvent(o[0].getId());if(i){const e=n.state.map(r.getEventMapper());i.getState(d.a.BACKWARDS).setUnknownStateEvents(e)}else i=e.addTimeline(),i.initialiseState(n.state.map(r.getEventMapper())),i.getState(d.a.FORWARDS).paginationToken=n.end;e.addEventsToTimeline(o,!0,i,n.start);return e.getTimelineForEvent(t)||i}))},F.prototype._createMessagesRequest=function(e,t,n,o,r){const i=g.g("/rooms/$roomId/messages",{$roomId:e});void 0===n&&(n=30);const a={from:t,limit:n,dir:o};let c=null;return this._clientOpts.lazyLoadMembers&&(c=Object.assign({},s.a.LAZY_LOADING_MESSAGES_FILTER)),r&&(c=c||{},Object.assign(c,r.getRoomTimelineFilterComponent())),c&&(a.filter=JSON.stringify(c)),this._http.authedRequest(void 0,"GET",i,a)},F.prototype.paginateEventTimeline=function(e,t){const n=e.getTimelineSet()===this._notifTimelineSet,o=(t=t||{}).backwards||!1;if(n&&!o)throw new Error("paginateNotifTimeline can only paginate backwards");const r=o?d.a.BACKWARDS:d.a.FORWARDS,i=e.getPaginationToken(r);if(!i)return Promise.resolve(!1);const a=e._paginationRequests[r];if(a)return a;let s,c,l;const u=this;if(n)s="/notifications",c={limit:"limit"in t?t.limit:30,only:"highlight"},i&&"end"!==i&&(c.from=i),l=this._http.authedRequest(void 0,"GET","/notifications",c,void 0).then((function(t){const n=t.next_token,i=[];for(let e=0;e{r.then((function(){o.getPushRules().then((function(t){o.pushRules=t,e()}),(function(e){t(e)}))}),(function(e){o.getPushRules().then((function(n){o.pushRules=n,t(e)}),(function(n){t(e)}))}))})},F.prototype.searchMessageText=function(e,t){const n={search_term:e.query};return"keys"in e&&(n.keys=e.keys),this.search({body:{search_categories:{room_events:n}}},t)},F.prototype.searchRoomEvents=function(e){const t={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:"recent",event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},n={_query:t,results:[],highlights:[]};return this.search({body:t}).then(this._processRoomEventsSearch.bind(this,n))},F.prototype.backPaginateRoomEventsSearch=function(e){if(!e.next_batch)return Promise.reject(new Error("Cannot backpaginate event search any further"));if(e.pendingRequest)return e.pendingRequest;const t={body:e._query,next_batch:e.next_batch},n=this.search(t).then(this._processRoomEventsSearch.bind(this,e)).finally((function(){e.pendingRequest=null}));return e.pendingRequest=n,n},F.prototype._processRoomEventsSearch=function(e,t){const n=t.search_categories.room_events;e.count=n.count,e.next_batch=n.next_batch;const o={};n.highlights.forEach((function(e){o[e]=1})),e.highlights.forEach((function(e){o[e]=1})),e.highlights=Object.keys(o);const r=n.results?n.results.length:0;for(let t=0;t6e5)S.a.debug("TURN creds are valid for another "+n+" ms: not fetching new ones."),t=!0;else{S.a.debug("Fetching new TURN credentials");try{const e=await this.turnServer();if(e.uris){S.a.log("Got TURN URIs: "+e.uris+" refresh in "+e.ttl+" secs");const n={urls:e.uris,username:e.username,credential:e.password};this._turnServers=[n],this._turnServersExpiry=Date.now()+1e3*e.ttl,t=!0}}catch(t){S.a.error("Failed to get TURN URIs",t),403===t.httpStatus&&(S.a.info("TURN access unavailable for this account: stopping credentials checks"),null!==this._checkTurnServersIntervalID&&e.clearInterval(this._checkTurnServersIntervalID),this._checkTurnServersIntervalID=null)}}return t},F.prototype.setFallbackICEServerAllowed=function(e){this._fallbackICEServerAllowed=e},F.prototype.isFallbackICEServerAllowed=function(){return this._fallbackICEServerAllowed},F.prototype.isSynapseAdministrator=function(){const e=g.g("/_synapse/admin/v1/users/$userId/admin",{$userId:this.getUserId()});return this._http.authedRequest(void 0,"GET",e,void 0,void 0,{prefix:""}).then(e=>e.admin)},F.prototype.whoisSynapseUser=function(e){const t=g.g("/_synapse/admin/v1/whois/$userId",{$userId:e});return this._http.authedRequest(void 0,"GET",t,void 0,void 0,{prefix:""})},F.prototype.deactivateSynapseUser=function(e){const t=g.g("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this._http.authedRequest(void 0,"POST",t,void 0,void 0,{prefix:""})},F.prototype.startClient=async function(e){if(this.clientRunning)return;this.clientRunning=!0,"number"==typeof e&&(e={initialSyncLimit:e});const t=this.getUserId();t&&this.store.storeUser(new k.a(t)),this._crypto&&(this._crypto.uploadDeviceKeys(),this._crypto.start()),this._supportsVoip&&(this._checkTurnServersIntervalID=setInterval(()=>{this._checkTurnServers()},6e5),this._checkTurnServers()),this._syncApi&&(S.a.error("Still have sync object whilst not running: stopping old one"),this._syncApi.stop()),(e=Object.assign({},e)).crypto=this._crypto,e.canResetEntireTimeline=e=>!!this._canResetTimelineCallback&&this._canResetTimelineCallback(e),this._clientOpts=e,this._syncApi=new c.a(this,e),this._syncApi.sync(),void 0!==e.clientWellKnownPollPeriod&&(this._clientWellKnownIntervalID=setInterval(()=>{this._fetchClientWellKnown()},1e3*e.clientWellKnownPollPeriod),this._fetchClientWellKnown())},F.prototype._fetchClientWellKnown=async function(){this._clientWellKnownPromise=R.a.getRawClientConfig(this.getDomain()),this._clientWellKnown=await this._clientWellKnownPromise,this.emit("WellKnown.client",this._clientWellKnown)},F.prototype.getClientWellKnown=function(){return this._clientWellKnown},F.prototype.waitForClientWellKnown=function(){return this._clientWellKnownPromise},F.prototype._storeClientOptions=function(){const e=["boolean","string","number"],t=Object.entries(this._clientOpts).filter(([t,n])=>e.includes(typeof n)).reduce((e,[t,n])=>(e[t]=n,e),{});return this.store.storeClientOptions(t)},F.prototype._unstable_getSharedRooms=async function(e){if(!await this.doesServerSupportUnstableFeature("uk.half-shot.msc2666"))throw Error("Server does not support shared_rooms API");const t=g.g("/uk.half-shot.msc2666/user/shared_rooms/$userId",{$userId:e});return(await this._http.authedRequest(void 0,"GET",t,void 0,void 0,{prefix:f.i})).joined},F.prototype.stopClient=function(){S.a.log("stopping MatrixClient"),this.clientRunning=!1,this._syncApi&&(this._syncApi.stop(),this._syncApi=null),this._crypto&&this._crypto.stop(),this._peekSync&&this._peekSync.stopPeeking(),this._callEventHandler&&(this._callEventHandler.stop(),this._callEventHandler=null),e.clearInterval(this._checkTurnServersIntervalID),void 0!==this._clientWellKnownIntervalID&&e.clearInterval(this._clientWellKnownIntervalID)},F.prototype.getVersions=function(){return this._serverVersionsPromise||(this._serverVersionsPromise=this._http.request(void 0,"GET","/_matrix/client/versions",void 0,void 0,{prefix:""}).catch(e=>{throw this._serverVersionsPromise=null,e})),this._serverVersionsPromise},F.prototype.isVersionSupported=async function(e){const{versions:t}=await this.getVersions();return t&&t.includes(e)},F.prototype.doesServerSupportLazyLoading=async function(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,n=e.unstable_features;return t&&t.includes("r0.5.0")||n&&n["m.lazy_load_members"]},F.prototype.doesServerRequireIdServerParam=async function(){const e=await this.getVersions();if(!e)return!0;const t=e.versions;if(t&&t.includes("r0.6.0"))return!1;const n=e.unstable_features;return!n||(void 0===n["m.require_identity_server"]||n["m.require_identity_server"])},F.prototype.doesServerAcceptIdentityAccessToken=async function(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,n=e.unstable_features;return t&&t.includes("r0.6.0")||n&&n["m.id_access_token"]},F.prototype.doesServerSupportSeparateAddAndBind=async function(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,n=e.unstable_features;return t&&t.includes("r0.6.0")||n&&n["m.separate_add_and_bind"]},F.prototype.doesServerSupportUnstableFeature=async function(e){const t=await this.getVersions();if(!t)return!1;const n=t.unstable_features;return n&&!!n[e]},F.prototype.doesServerForceEncryptionForPreset=async function(e){const t=await this.getVersions();if(!t)return!1;const n=t.unstable_features;return n&&!!n["io.element.e2ee_forced."+e]},F.prototype.hasLazyLoadMembersEnabled=function(){return!!this._clientOpts.lazyLoadMembers},F.prototype.setCanResetTimelineCallback=function(e){this._canResetTimelineCallback=e},F.prototype.getCanResetTimelineCallback=function(){return this._canResetTimelineCallback},F.prototype.relations=async function(e,t,n,o,r={}){const i=function(e,t,n){return"m.reaction"===n?n:e.isRoomEncrypted(t)?"m.room.encrypted":n}(this,e,o),a=await this.fetchRelations(e,t,n,i,r),s=this.getEventMapper();let c;a.original_event&&(c=s(a.original_event));let l=a.chunk.map(s);if("m.room.encrypted"===i){const e=c?l.concat(c):l;await Promise.all(e.map(e=>new Promise(t=>e.once("Event.decrypted",t)))),l=l.filter(e=>e.getType()===o)}return c&&"m.replace"===n&&(l=l.filter(e=>e.getSender()===c.getSender())),{originalEvent:c,events:l,nextBatch:a.next_batch}},F.prototype.getEventMapper=function(e){return V(this,e)},F.prototype.getCrossSigningCacheCallbacks=function(){return this._crypto&&this._crypto._crossSigningInfo.getCacheCallbacks()},F.prototype.generateClientSecret=function(){return Object(x.b)(32)},F.prototype.decryptEventIfNeeded=function(e,t){return e.shouldAttemptDecryption()&&e.attemptDecryption(this._crypto,t),e.isBeingDecrypted()?e._decryptionPromise:Promise.resolve()}}).call(this,n(7))},function(e,t,n){"use strict";n.d(t,"c",(function(){return f})),n.d(t,"a",(function(){return _})),n.d(t,"b",(function(){return b})),n.d(t,"d",(function(){return v}));var o=n(18),r=n.n(o),i=n(94),a=n(223),s=n(155),c=n(9),l=n(93),d=n(525),u=n(102),h=n(117),p=n(116);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function g(e){for(var t=1;t{this.byRoom={};for(const e of this.matrixClient.getVisibleRooms())this.recalculateRoom(e)}),r()(this,"updateFromWidgetStore",e=>{if(e){const t=this.matrixClient.getRoom(e);t&&this.recalculateRoom(t)}else this.updateAllRooms()}),r()(this,"updateRoomFromState",e=>{if(e.getType()!==f)return;const t=this.matrixClient.getRoom(e.getRoomId());t&&this.recalculateRoom(t)}),r()(this,"updateFromSettings",(e,t)=>{if(t){const e=this.matrixClient.getRoom(t);e&&this.recalculateRoom(e)}else this.updateAllRooms()})}static get instance(){return v.internalInstance||(v.internalInstance=new v),v.internalInstance}static emissionForRoom(e){return"update_"+e.roomId}emitFor(e){this.emit(v.emissionForRoom(e))}async onReady(){this.updateAllRooms(),this.matrixClient.on("RoomState.events",this.updateRoomFromState),this.pinnedRef=i.b.watchSetting("Widgets.pinned",null,this.updateFromSettings),this.layoutRef=i.b.watchSetting("Widgets.layout",null,this.updateFromSettings),a.a.instance.on(p.b,this.updateFromWidgetStore)}async onNotReady(){this.byRoom={},i.b.unwatchSetting(this.pinnedRef),i.b.unwatchSetting(this.layoutRef),a.a.instance.off(p.b,this.updateFromWidgetStore)}recalculateRoom(e){const t=a.a.instance.getApps(e.roomId);if(null==t||!t.length)return this.byRoom[e.roomId]={},void this.emitFor(e);const n=JSON.stringify(this.byRoom[e.roomId]),o=e.currentState.getStateEvents(f,""),r=i.b.getValue("Widgets.pinned",e.roomId);let l=i.b.getValue("Widgets.layout",e.roomId);o&&l&&l.overrides!==o.getId()&&(l=null);const d=o?o.getContent():null,u=[],h=[];for(const e of t){var p,m,g,v,y;const t=null==d||null===(p=d.widgets)||void 0===p||null===(m=p[e.id])||void 0===m?void 0:m.container,n=null===(g=l)||void 0===g||null===(v=g.widgets)||void 0===v||null===(y=v[e.id])||void 0===y?void 0:y.container,o=!(null==r||!r[e.id]),i=s.a.JITSI.matches(e.type)?_.Top:_.Right;n===_.Right?h.push(e):n===_.Top||t===_.Top||o&&!t?u.push(e):(i===_.Top?u:h).push(e)}const E=u.slice(b);h.push(...E),u.sort((e,t)=>{var n,o,r,i,a,u;const h=null==d||null===(n=d.widgets)||void 0===n?void 0:n[e.id],p=null==d||null===(o=d.widgets)||void 0===o?void 0:o[t.id],m=null===(r=l)||void 0===r||null===(i=r.widgets)||void 0===i?void 0:i[e.id],g=null===(a=l)||void 0===a||null===(u=a.widgets)||void 0===u?void 0:u[t.id],f=s.a.JITSI.matches(e.type)?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,_=s.a.JITSI.matches(t.type)?Number.MIN_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,b=Object(c.b)(null==m?void 0:m.index,Object(c.b)(null==h?void 0:h.index,f)),v=Object(c.b)(null==g?void 0:g.index,Object(c.b)(null==p?void 0:p.index,_));return b===v?e.id.localeCompare(t.id):b-v});const S=[];let w=null,C=!0;for(let e=0;e0){for(let t=0;t0){const e=S.map((e,t)=>[t,e]).filter(e=>e[1]>10).map(e=>e[0]);for(const n of e)S[n]-=t/e.length}}}this.byRoom[e.roomId]={},u.length&&(this.byRoom[e.roomId][_.Top]={ordered:u,distributions:S,height:w}),h.length&&(this.byRoom[e.roomId][_.Right]={ordered:h});JSON.stringify(this.byRoom[e.roomId])!==n&&this.emitFor(e)}getContainerWidgets(e,t){var n,o;return(null===(n=this.byRoom[e.roomId])||void 0===n||null===(o=n[t])||void 0===o?void 0:o.ordered)||[]}isInContainer(e,t,n){return this.getContainerWidgets(e,n).some(e=>e.id===t.id)}canAddToContainer(e,t){return this.getContainerWidgets(e,t).lengthe.toFixed(1)+"%"))}setResizerDistributions(e,t,n){if(t!==_.Top)return;const o=n.map(e=>Number(Number(e.substring(0,e.length-1)).toFixed(1))),r=this.getContainerWidgets(e,t),i=100-Object(c.e)(...o);2===o.length&&o.splice(1,0,i),1===o.length&&o.push(i);const a={};r.forEach((n,r)=>{var i,s;a[n.id]={container:t,width:o[r],index:r,height:(null===(i=this.byRoom[e.roomId])||void 0===i||null===(s=i[t])||void 0===s?void 0:s.height)||2}}),this.updateUserLayout(e,a)}getContainerHeight(e,t){var n,o;return null===(n=this.byRoom[e.roomId])||void 0===n||null===(o=n[t])||void 0===o?void 0:o.height}setContainerHeight(e,t,n){var o,r;const i=this.getContainerWidgets(e,t),a=null===(o=this.byRoom[e.roomId])||void 0===o||null===(r=o[t])||void 0===r?void 0:r.distributions,s={};i.forEach((e,o)=>{s[e.id]={container:t,width:a[o],index:o,height:n}}),this.updateUserLayout(e,s)}moveWithinContainer(e,t,n,o){var r,i,a,s;const l=Object(h.b)(this.getContainerWidgets(e,t)),d=l.findIndex(e=>e.id===n.id);if(d<0)return;l.splice(d,1);const u=Object(c.a)(d+o,0,l.length);l.splice(u,0,n);const p=null===(r=this.byRoom[e.roomId])||void 0===r||null===(i=r[t])||void 0===i?void 0:i.distributions,m=null===(a=this.byRoom[e.roomId])||void 0===a||null===(s=a[t])||void 0===s?void 0:s.height,g={};l.forEach((e,n)=>{g[e.id]={container:t,width:p[n],index:n,height:m}}),this.updateUserLayout(e,g)}moveToContainer(e,t,n){this.getAllWidgets(e).some(([e])=>e.id===t.id)&&this.updateUserLayout(e,{[t.id]:{container:n}})}canCopyLayoutToRoom(e){return!!this.matrixClient&&e.currentState.maySendStateEvent(f,this.matrixClient.getUserId())}copyLayoutToRoom(e){const t=this.getAllWidgets(e),n={widgets:{}};for(const[s,c]of t)if(n.widgets[s.id]={container:c},c===_.Top){var o,r,i,a;const t=this.getContainerWidgets(e,c).findIndex(e=>e.id===s.id),l=null===(o=this.byRoom[e.roomId])||void 0===o||null===(r=o[c])||void 0===r?void 0:r.distributions,d=null===(i=this.byRoom[e.roomId])||void 0===i||null===(a=i[c])||void 0===a?void 0:a.height;n.widgets[s.id]=g(g({},n.widgets[s.id]),{},{height:d?Math.round(d):null,width:l[t]?Math.round(l[t]):null,index:t})}this.matrixClient.sendStateEvent(e.roomId,f,n,"")}getAllWidgets(e){const t=this.byRoom[e.roomId];if(!t)return[];const n=[];for(const e of Object.keys(t)){const o=t[e].ordered;for(const t of o)n.push([t,e])}return n}updateUserLayout(e,t){const n=this.getAllWidgets(e);for(const[i,c]of n){var o,r;const n=this.getContainerWidgets(e,c).findIndex(e=>e.id===i.id),l=null===(o=this.byRoom[e.roomId])||void 0===o||null===(r=o[c])||void 0===r?void 0:r.distributions;var a,s;if(!t[i.id])t[i.id]={container:c,index:n,height:null===(a=this.byRoom[e.roomId])||void 0===a||null===(s=a[c])||void 0===s?void 0:s.height,width:null==l?void 0:l[n]}}const c=e.currentState.getStateEvents(f,"");i.b.setValue("Widgets.layout",e.roomId,u.a.ROOM_ACCOUNT,{overrides:null==c?void 0:c.getId(),widgets:t}).catch(()=>this.recalculateRoom(e)),this.recalculateRoom(e)}}r()(v,"internalInstance",void 0),window.mxWidgetLayoutStore=v.instance},function(e,t,n){"use strict";var o=n(87),r=n(131);t.a=({room:e,children:t})=>{const[n,i]=Object(o.useState)(null==e?void 0:e.name);return Object(r.a)(e,"Room.name",()=>{i(null==e?void 0:e.name)}),Object(o.useEffect)(()=>{i(null==e?void 0:e.name)},[e]),t?t(n):n||""}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(91),u=n.n(d),h=n(88),p=n(89);let m=Object(p.a)("views.elements.DialogButtons")((i=r=class extends l.a.Component{constructor(...e){super(...e),s()(this,"_onCancelClick",()=>{this.props.onCancel()})}render(){let e,t="mx_Dialog_primary";this.props.primaryButtonClass&&(t+=" "+this.props.primaryButtonClass),(this.props.cancelButton||this.props.hasCancel)&&(e=l.a.createElement("button",{type:"button",onClick:this._onCancelClick,className:this.props.cancelButtonClass,disabled:this.props.disabled},this.props.cancelButton||Object(h.a)("Cancel")));let n=null;return this.props.additive&&(n=l.a.createElement("div",{className:"mx_Dialog_buttons_additive"},this.props.additive)),l.a.createElement("div",{className:"mx_Dialog_buttons"},n,e,this.props.children,l.a.createElement("button",{type:this.props.primaryIsSubmit?"submit":"button",className:t,onClick:this.props.onPrimaryButtonClick,autoFocus:this.props.focus,disabled:this.props.disabled||this.props.primaryDisabled},this.props.primaryButton))}},s()(r,"propTypes",{primaryButton:u.a.node.isRequired,cancelButton:u.a.node,primaryIsSubmit:u.a.bool,onPrimaryButtonClick:u.a.func,hasCancel:u.a.bool,cancelButtonClass:u.a.node,onCancel:u.a.func,focus:u.a.bool,disabled:u.a.bool,primaryDisabled:u.a.bool,additive:u.a.element}),s()(r,"defaultProps",{hasCancel:!0,disabled:!1}),o=i))||o},function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var o,r=n(99),i=n.n(r),a=n(104),s=n.n(a),c=n(18),l=n.n(c),d=n(87),u=n.n(d),h=n(97),p=n.n(h),m=n(165),g=n(94),f=n(96),_=n(225),b=n(89);let v=Object(b.a)("views.rooms.NotificationBadge")(o=class extends u.a.PureComponent{constructor(e){super(e),l()(this,"countWatcherRef",void 0),l()(this,"countPreferenceChanged",()=>{this.setState({showCounts:g.b.getValue("Notifications.alwaysShowBadgeCounts",this.roomId)})}),l()(this,"onNotificationUpdate",()=>{this.forceUpdate()}),this.props.notification.on(_.a,this.onNotificationUpdate),this.state={showCounts:g.b.getValue("Notifications.alwaysShowBadgeCounts",this.roomId)},this.countWatcherRef=g.b.watchSetting("Notifications.alwaysShowBadgeCounts",this.roomId,this.countPreferenceChanged)}get roomId(){return this.props.roomId||null}componentWillUnmount(){g.b.unwatchSetting(this.countWatcherRef),this.props.notification.off(_.a,this.onNotificationUpdate)}componentDidUpdate(e){e.notification&&e.notification.off(_.a,this.onNotificationUpdate),this.props.notification.on(_.a,this.onNotificationUpdate)}render(){const e=this.props,{notification:t,forceCount:n,roomId:o,onClick:r}=e,a=s()(e,["notification","forceCount","roomId","onClick"]);if(t.isIdle)return null;let c=!(t.symbol||t.count>0)||!t.hasUnreadCount;if(n&&(c=!1,!t.hasUnreadCount))return null;let l=t.symbol||Object(m.c)(t.count);c&&(l="");const d=p()({mx_NotificationBadge:!0,mx_NotificationBadge_visible:!!c||t.hasUnreadCount,mx_NotificationBadge_highlighted:t.hasMentions,mx_NotificationBadge_dot:c,mx_NotificationBadge_2char:l.length>0&&l.length<3,mx_NotificationBadge_3char:l.length>2});return r?u.a.createElement(f.a,i()({},a,{className:d,onClick:r}),u.a.createElement("span",{className:"mx_NotificationBadge_count"},l)):u.a.createElement("div",{className:d},u.a.createElement("span",{className:"mx_NotificationBadge_count"},l))}})||o},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return u})),n.d(t,"c",(function(){return h})),n.d(t,"f",(function(){return g}));var o=n(18),r=n.n(o),i=n(106),a=n(94);const s={getMessageComposerBindings:()=>{const e=[{action:c.SelectPrevSendHistory,keyCombo:{key:i.a.ARROW_UP,altKey:!0,ctrlKey:!0}},{action:c.SelectNextSendHistory,keyCombo:{key:i.a.ARROW_DOWN,altKey:!0,ctrlKey:!0}},{action:c.EditPrevMessage,keyCombo:{key:i.a.ARROW_UP}},{action:c.EditNextMessage,keyCombo:{key:i.a.ARROW_DOWN}},{action:c.CancelEditing,keyCombo:{key:i.a.ESCAPE}},{action:c.FormatBold,keyCombo:{key:i.a.B,ctrlOrCmd:!0}},{action:c.FormatItalics,keyCombo:{key:i.a.I,ctrlOrCmd:!0}},{action:c.FormatQuote,keyCombo:{key:i.a.GREATER_THAN,ctrlOrCmd:!0,shiftKey:!0}},{action:c.EditUndo,keyCombo:{key:i.a.Z,ctrlOrCmd:!0}},{action:c.MoveCursorToStart,keyCombo:{key:i.a.HOME,ctrlOrCmd:!0}},{action:c.MoveCursorToEnd,keyCombo:{key:i.a.END,ctrlOrCmd:!0}}];return i.b?e.push({action:c.EditRedo,keyCombo:{key:i.a.Z,ctrlOrCmd:!0,shiftKey:!0}}):e.push({action:c.EditRedo,keyCombo:{key:i.a.Y,ctrlOrCmd:!0}}),a.b.getValue("MessageComposerInput.ctrlEnterToSend")?(e.push({action:c.Send,keyCombo:{key:i.a.ENTER,ctrlOrCmd:!0}}),e.push({action:c.NewLine,keyCombo:{key:i.a.ENTER}})):(e.push({action:c.Send,keyCombo:{key:i.a.ENTER}}),e.push({action:c.NewLine,keyCombo:{key:i.a.ENTER,shiftKey:!0}}),i.b&&e.push({action:c.NewLine,keyCombo:{key:i.a.ENTER,altKey:!0}})),e},getAutocompleteBindings:()=>[{action:l.CompleteOrNextSelection,keyCombo:{key:i.a.TAB}},{action:l.CompleteOrNextSelection,keyCombo:{key:i.a.TAB,ctrlKey:!0}},{action:l.CompleteOrPrevSelection,keyCombo:{key:i.a.TAB,shiftKey:!0}},{action:l.CompleteOrPrevSelection,keyCombo:{key:i.a.TAB,ctrlKey:!0,shiftKey:!0}},{action:l.Cancel,keyCombo:{key:i.a.ESCAPE}},{action:l.PrevSelection,keyCombo:{key:i.a.ARROW_UP}},{action:l.NextSelection,keyCombo:{key:i.a.ARROW_DOWN}}],getRoomListBindings:()=>[{action:d.ClearSearch,keyCombo:{key:i.a.ESCAPE}},{action:d.PrevRoom,keyCombo:{key:i.a.ARROW_UP}},{action:d.NextRoom,keyCombo:{key:i.a.ARROW_DOWN}},{action:d.SelectRoom,keyCombo:{key:i.a.ENTER}},{action:d.CollapseSection,keyCombo:{key:i.a.ARROW_LEFT}},{action:d.ExpandSection,keyCombo:{key:i.a.ARROW_RIGHT}}],getRoomBindings:()=>{const e=[{action:u.ScrollUp,keyCombo:{key:i.a.PAGE_UP}},{action:u.RoomScrollDown,keyCombo:{key:i.a.PAGE_DOWN}},{action:u.DismissReadMarker,keyCombo:{key:i.a.ESCAPE}},{action:u.JumpToOldestUnread,keyCombo:{key:i.a.PAGE_UP,shiftKey:!0}},{action:u.UploadFile,keyCombo:{key:i.a.U,ctrlOrCmd:!0,shiftKey:!0}},{action:u.JumpToFirstMessage,keyCombo:{key:i.a.HOME,ctrlKey:!0}},{action:u.JumpToLatestMessage,keyCombo:{key:i.a.END,ctrlKey:!0}}];return a.b.getValue("ctrlFForSearch")&&e.push({action:u.FocusSearch,keyCombo:{key:i.a.F,ctrlOrCmd:!0}}),e},getNavigationBindings:()=>[{action:h.FocusRoomSearch,keyCombo:{key:i.a.K,ctrlOrCmd:!0}},{action:h.ToggleRoomSidePanel,keyCombo:{key:i.a.PERIOD,ctrlOrCmd:!0}},{action:h.ToggleUserMenu,keyCombo:{key:i.a.BACKTICK,ctrlOrCmd:!0}},{action:h.ToggleShortCutDialog,keyCombo:{key:i.a.SLASH,ctrlOrCmd:!0}},{action:h.ToggleShortCutDialog,keyCombo:{key:i.a.SLASH,ctrlOrCmd:!0,shiftKey:!0}},{action:h.GoToHome,keyCombo:{key:i.a.H,ctrlKey:!0,altKey:!i.b,shiftKey:i.b}},{action:h.SelectPrevRoom,keyCombo:{key:i.a.ARROW_UP,altKey:!0}},{action:h.SelectNextRoom,keyCombo:{key:i.a.ARROW_DOWN,altKey:!0}},{action:h.SelectPrevUnreadRoom,keyCombo:{key:i.a.ARROW_UP,altKey:!0,shiftKey:!0}},{action:h.SelectNextUnreadRoom,keyCombo:{key:i.a.ARROW_DOWN,altKey:!0,shiftKey:!0}}]};let c,l,d,u,h;function p(e,t,n){var o,r,i,a,s,c,l,d;if(void 0!==t.key)if(e.shiftKey){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1}else if(e.key!==t.key)return!1;const u=null!==(o=t.ctrlKey)&&void 0!==o&&o,h=null!==(r=t.altKey)&&void 0!==r&&r,p=null!==(i=t.shiftKey)&&void 0!==i&&i,m=null!==(a=t.metaKey)&&void 0!==a&&a,g=null!==(s=e.ctrlKey)&&void 0!==s&&s,f=null!==(c=e.altKey)&&void 0!==c&&c,_=null!==(l=e.shiftKey)&&void 0!==l&&l,b=null!==(d=e.metaKey)&&void 0!==d&&d;if(t.ctrlOrCmd){if(n){if(!b||g!==u||f!==h||_!==p)return!1}else if(!g||b!==m||f!==h||_!==p)return!1;return!0}return b===m&&g===u&&f===h&&_===p}!function(e){e.Send="Send",e.SelectPrevSendHistory="SelectPrevSendHistory",e.SelectNextSendHistory="SelectNextSendHistory",e.EditPrevMessage="EditPrevMessage",e.EditNextMessage="EditNextMessage",e.CancelEditing="CancelEditing",e.FormatBold="FormatBold",e.FormatItalics="FormatItalics",e.FormatQuote="FormatQuote",e.EditUndo="EditUndo",e.EditRedo="EditRedo",e.NewLine="NewLine",e.MoveCursorToStart="MoveCursorToStart",e.MoveCursorToEnd="MoveCursorToEnd"}(c||(c={})),function(e){e.CompleteOrPrevSelection="ApplySelection",e.CompleteOrNextSelection="CompleteOrNextSelection",e.PrevSelection="PrevSelection",e.NextSelection="NextSelection",e.Cancel="Cancel"}(l||(l={})),function(e){e.ClearSearch="ClearSearch",e.PrevRoom="PrevRoom",e.NextRoom="NextRoom",e.SelectRoom="SelectRoom",e.CollapseSection="CollapseSection",e.ExpandSection="ExpandSection"}(d||(d={})),function(e){e.ScrollUp="ScrollUp",e.RoomScrollDown="RoomScrollDown",e.DismissReadMarker="DismissReadMarker",e.JumpToOldestUnread="JumpToOldestUnread",e.UploadFile="UploadFile",e.FocusSearch="FocusSearch",e.JumpToFirstMessage="JumpToFirstMessage",e.JumpToLatestMessage="JumpToLatestMessage"}(u||(u={})),function(e){e.FocusRoomSearch="FocusRoomSearch",e.ToggleRoomSidePanel="ToggleRoomSidePanel",e.ToggleUserMenu="ToggleUserMenu",e.ToggleShortCutDialog="ToggleShortCutDialog",e.GoToHome="GoToHome",e.SelectPrevRoom="SelectPrevRoom",e.SelectNextRoom="SelectNextRoom",e.SelectPrevUnreadRoom="SelectPrevUnreadRoom",e.SelectNextUnreadRoom="SelectNextUnreadRoom"}(h||(h={}));const m=new class{constructor(){r()(this,"bindingsProviders",[s])}getAction(e,t){for(const n of e){const e=n().find(e=>p(t,e.keyCombo,i.b));if(e)return e.action}}getMessageComposerAction(e){return this.getAction(this.bindingsProviders.map(e=>e.getMessageComposerBindings),e)}getAutocompleteAction(e){return this.getAction(this.bindingsProviders.map(e=>e.getAutocompleteBindings),e)}getRoomListAction(e){return this.getAction(this.bindingsProviders.map(e=>e.getRoomListBindings),e)}getRoomAction(e){return this.getAction(this.bindingsProviders.map(e=>e.getRoomBindings),e)}getNavigationAction(e){return this.getAction(this.bindingsProviders.map(e=>e.getNavigationBindings),e)}};function g(){return m}},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return _}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(152),u=n.n(d),h=n(97),p=n.n(h),m=n(89),g=n(145);let f;!function(e){e[e.Natural=0]="Natural",e[e.Left=1]="Left",e[e.Right=2]="Right",e[e.Top=3]="Top",e[e.Bottom=4]="Bottom"}(f||(f={}));let _=Object(m.a)("views.elements.Tooltip")((i=r=class extends l.a.Component{constructor(...e){super(...e),s()(this,"tooltipContainer",void 0),s()(this,"tooltip",void 0),s()(this,"parent",void 0),s()(this,"renderTooltip",()=>{const e=this.updatePosition({});e.display=this.props.visible?"block":"none";const t=p()("mx_Tooltip",this.props.tooltipClassName,{mx_Tooltip_visible:this.props.visible,mx_Tooltip_invisible:!this.props.visible}),n=l.a.createElement("div",{className:t,style:e},l.a.createElement("div",{className:"mx_Tooltip_chevron"}),this.props.label);this.tooltip=u.a.render(n,this.tooltipContainer)})}componentDidMount(){this.tooltipContainer=document.createElement("div"),this.tooltipContainer.className="mx_Tooltip_wrapper",document.body.appendChild(this.tooltipContainer),window.addEventListener("scroll",this.renderTooltip,!0),this.parent=u.a.findDOMNode(this).parentNode,this.renderTooltip()}componentDidUpdate(){this.renderTooltip()}componentWillUnmount(){u.a.unmountComponentAtNode(this.tooltipContainer),document.body.removeChild(this.tooltipContainer),window.removeEventListener("scroll",this.renderTooltip,!0)}updatePosition(e){const t=this.parent.getBoundingClientRect();let n=0;n=t.height>25?Math.floor((t.height-25)/2):Math.floor(t.height-25);const o=g.b.instance.windowWidth,r=t.top-2+this.props.yOffset+window.pageYOffset,i=r+n,a=o-t.right-window.pageXOffset-16,s=t.right+window.pageXOffset+6,c=t.right-window.pageXOffset-t.width/2;switch(this.props.alignment){case f.Natural:if(t.right>o/2){e.right=a,e.top=i;break}case f.Right:e.left=s,e.top=i;break;case f.Left:e.right=a,e.top=i;break;case f.Top:e.top=r-16,e.left=c;break;case f.Bottom:e.top=r+t.height,e.left=c}return e}render(){return l.a.createElement("div",{className:this.props.className})}},s()(r,"Alignment",f),s()(r,"defaultProps",{visible:!0,yOffset:0,alignment:f.Natural}),o=i))||o},function(e,t,n){"use strict";e.exports=function(e,t,n,o,r,i,a,s){if(!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,o,r,i,a,s],d=0;c=new Error("Invariant Violation: "+t.replace(/%s/g,(function(){return l[d++]})))}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";(function(e){var o=n(321),r=n(93),i=n(123),a=n(126),s=n(324),c=n(92),l=n(94);const d={orderedTags:null,orderedTagsAccountData:null,hasSynced:!1,joinedGroupIds:null,selectedTags:[],anchorTag:null};class u extends o.Store{constructor(){super(r.a),this._state=Object.assign({},d),l.b.monitorSetting("TagPanel.enableTagPanel",null)}_setState(e){this._state=Object.assign(this._state,e),this.__emitChange()}__onDispatch(e){switch(e.action){case"view_room":{const t=i.a.getGroupIdsForRoomId(e.room_id);this._updateBadges(t);break}case"MatrixActions.sync":{if("SYNCING"!==e.state&&"PREPARED"!==e.state||this._updateBadges(),"PREPARED"===e.prevState||"PREPARED"!==e.state)break;const t=e.matrixClient.getAccountData("im.vector.web.tag_ordering"),n=t?t.getContent():{};this._setState({orderedTagsAccountData:n.tags||null,removedTagsAccountData:n.removedTags||null,hasSynced:!0}),this._updateOrderedTags();break}case"MatrixActions.accountData":if("im.vector.web.tag_ordering"!==e.event_type)break;if(e.event_content._storeId===this.getStoreId())break;this._setState({orderedTagsAccountData:e.event_content?e.event_content.tags:null,removedTagsAccountData:e.event_content?e.event_content.removedTags:null}),this._updateOrderedTags();break;case"GroupActions.fetchJoinedGroups.success":this._setState({joinedGroupIds:e.result.groups.sort(),hasFetchedJoinedGroups:!0}),this._updateOrderedTags();break;case"TagOrderActions.moveTag.pending":this._setState({orderedTags:e.request.tags,removedTagsAccountData:e.request.removedTags});break;case"TagOrderActions.removeTag.pending":this._setState({removedTagsAccountData:e.request.removedTags}),this._updateOrderedTags();break;case"select_tag":{const t=!l.b.getValue("feature_communities_v2_prototypes");let n=[];if(e.shiftKey&&t){let t=this._state.orderedTags.indexOf(this._state.anchorTag),o=this._state.orderedTags.indexOf(e.tag);if(-1===t&&(t=o),t>o){const e=t;t=o,o=e}n=e.ctrlOrCmdKey?this._state.selectedTags:[],n=[...new Set(this._state.orderedTags.slice(t,o+1).concat(n))]}else n=e.ctrlOrCmdKey&&t?this._state.selectedTags.includes(e.tag)?this._state.selectedTags.filter(t=>t!==e.tag):[...this._state.selectedTags,e.tag]:1===this._state.selectedTags.length&&this._state.selectedTags.includes(e.tag)?[]:[e.tag],this._state.selectedTags.includes(e.tag)||this._setState({anchorTag:e.tag});this._setState({selectedTags:n}),a.a.trackEvent("FilterStore","select_tag")}break;case"deselect_tags":e.tag?this._setState({selectedTags:this._state.selectedTags.filter(t=>t!==e.tag)}):this._setState({selectedTags:[]}),a.a.trackEvent("FilterStore","deselect_tags");break;case"on_client_not_viable":case"on_logged_out":this._state=Object.assign({},d);break;case"setting_updated":"TagPanel.enableTagPanel"!==e.settingName||e.newValue||(this._setState({selectedTags:[]}),a.a.trackEvent("FilterStore","disable_tags"))}}_updateBadges(e=this._state.joinedGroupIds){if(e&&e.length){const t=c.a.get(),n={};e.forEach(e=>{const o=i.a.getGroupRooms(e).map(e=>t.getRoom(e.roomId)).filter(e=>null!=e),r=o&&s.e(o);n[e]=r&&0!==r.count?r:void 0});const o=Object.assign({},this._state.badges,n);this._setState({badges:o})}}_updateOrderedTags(){this._setState({orderedTags:this._state.hasSynced&&this._state.hasFetchedJoinedGroups?this._mergeGroupsAndTags():null})}_mergeGroupsAndTags(){const e=this._state.joinedGroupIds||[],t=this._state.orderedTagsAccountData||[],n=new Set(this._state.removedTagsAccountData||[]),o=t.filter(t=>("+"!==t[0]||e.includes(t))&&!n.has(t)),r=e.filter(e=>!t.includes(e)&&!n.has(e));return o.concat(r)}getGroupBadge(e){const t=this._state.badges;return t&&t[e]}getOrderedTags(){return this._state.orderedTags}getRemovedTagsAccountData(){return this._state.removedTagsAccountData}getStoreId(){return this._id||(this._id=Math.random().toString(16).slice(2,10)),this._id}getSelectedTags(){return this._state.selectedTags}}void 0===e.singletonGroupFilterOrderStore&&(e.singletonGroupFilterOrderStore=new u),t.a=e.singletonGroupFilterOrderStore}).call(this,n(7))},function(e,t,n){var o=n(190),r=n(147),i=n(383),a=n(240),s=n(216),c=function(e,t,n){var l,d,u,h=e&c.F,p=e&c.G,m=e&c.S,g=e&c.P,f=e&c.B,_=e&c.W,b=p?r:r[t]||(r[t]={}),v=b.prototype,y=p?o:m?o[t]:(o[t]||{}).prototype;for(l in p&&(n=t),n)(d=!h&&y&&void 0!==y[l])&&s(b,l)||(u=d?y[l]:n[l],b[l]=p&&"function"!=typeof y[l]?n[l]:f&&d?i(u,o):_&&y[l]==u?function(e){var t=function(t,n,o){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,o)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(u):g&&"function"==typeof u?i(Function.call,u):u,g&&((b.virtual||(b.virtual={}))[l]=u,e&c.R&&v&&!v[l]&&a(v,l,u)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var o=n(241),r=n(534),i=n(384),a=Object.defineProperty;t.f=n(192)?Object.defineProperty:function(e,t,n){if(o(e),t=i(t,!0),o(n),r)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(243)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t,n){e.exports={default:n(822),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(533),i=(o=r)&&o.__esModule?o:{default:o};t.default=function(){function e(e,t){for(var n=0;n0){n[n.length-1].roomId!==e&&(t=!1)}let s={};if(t)s=await o.a.get().leaveRoomChain(e);else try{await o.a.get().leave(e)}catch(t){if(t&&t.data&&t.data.errcode){const n=t.data.error||Object(r.a)("Unexpected server error trying to leave the room");s[e]=Object.assign(new Error(n),{errcode:t.data.errcode})}else s[e]=t||new Error("Failed to leave room for unknown causes")}const u=Object.entries(s).filter(e=>!!e[1]);if(u.length>0){const t=[];for(const n of u){const o=n[1];let l=Object(r.a)("Unexpected server error trying to leave the room");if(o.errcode&&o.message){if("M_CANNOT_LEAVE_SERVER_NOTICE_ROOM"===o.errcode)return void i.a.createTrackedDialog("Error Leaving Room","",a.a,{title:Object(r.a)("Can't leave Server Notices room"),description:Object(r.a)("This room is used for important messages from the Homeserver, so you cannot leave it.")});l=s[e].message}t.push(l,c.a.createElement("BR"))}i.a.createTrackedDialog("Error Leaving Room","",a.a,{title:Object(r.a)("Error leaving room"),description:t})}else d.a.getRoomId()===e&&l.a.dispatch({action:"view_home_page"})}!function(e){e.Join="JOIN",e.Invite="INVITE",e.Leave="LEAVE"}(u||(u={}))},function(e,t,n){(function(n){var o,r,i,a,s,c,l,d,u,h,p,m,g,f,_,b,v,y,E,S,w,C,T,x,O;!function(k){var R="object"==typeof n?n:"object"==typeof self?self:"object"==typeof this?this:{};function I(e,t){return e!==R&&("function"==typeof Object.create?Object.defineProperty(e,"__esModule",{value:!0}):e.__esModule=!0),function(n,o){return e[n]=t?t(n,o):o}}void 0===(o=function(e){!function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])};r=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)},i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},c=function(e,t){return function(n,o){t(n,o,e)}},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},u=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},m=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},g=function(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(n=r[e](t)).value instanceof b?Promise.resolve(n.value.v).then(c,l):d(i[0][2],n)}catch(e){d(i[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}},y=function(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:b(e[o](t)),done:"return"===o}:r?r(t):t}:r}},E=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){(function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)})(o,r,(t=e[n](t)).done,t.value)}))}}},S=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var n=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};w=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o in e)"default"!==o&&Object.prototype.hasOwnProperty.call(e,o)&&O(t,e,o);return n(t,e),t},C=function(e){return e&&e.__esModule?e:{default:e}},T=function(e,t,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(e):o?o.value:t.get(e)},x=function(e,t,n,o,r){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?r.call(e,n):r?r.value=n:t.set(e,n),n},e("__extends",r),e("__assign",i),e("__rest",a),e("__decorate",s),e("__param",c),e("__metadata",l),e("__awaiter",d),e("__generator",u),e("__exportStar",h),e("__createBinding",O),e("__values",p),e("__read",m),e("__spread",g),e("__spreadArrays",f),e("__spreadArray",_),e("__await",b),e("__asyncGenerator",v),e("__asyncDelegator",y),e("__asyncValues",E),e("__makeTemplateObject",S),e("__importStar",w),e("__importDefault",C),e("__classPrivateFieldGet",T),e("__classPrivateFieldSet",x)}(I(R,I(e)))}.apply(t,[t]))||(e.exports=o)}()}).call(this,n(7))},function(e,t,n){"use strict";const o=t.NAMESPACES={HTML:"http://www.w3.org/1999/xhtml",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"};t.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"},t.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};const r=t.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};t.SPECIAL_ELEMENTS={[o.HTML]:{[r.ADDRESS]:!0,[r.APPLET]:!0,[r.AREA]:!0,[r.ARTICLE]:!0,[r.ASIDE]:!0,[r.BASE]:!0,[r.BASEFONT]:!0,[r.BGSOUND]:!0,[r.BLOCKQUOTE]:!0,[r.BODY]:!0,[r.BR]:!0,[r.BUTTON]:!0,[r.CAPTION]:!0,[r.CENTER]:!0,[r.COL]:!0,[r.COLGROUP]:!0,[r.DD]:!0,[r.DETAILS]:!0,[r.DIR]:!0,[r.DIV]:!0,[r.DL]:!0,[r.DT]:!0,[r.EMBED]:!0,[r.FIELDSET]:!0,[r.FIGCAPTION]:!0,[r.FIGURE]:!0,[r.FOOTER]:!0,[r.FORM]:!0,[r.FRAME]:!0,[r.FRAMESET]:!0,[r.H1]:!0,[r.H2]:!0,[r.H3]:!0,[r.H4]:!0,[r.H5]:!0,[r.H6]:!0,[r.HEAD]:!0,[r.HEADER]:!0,[r.HGROUP]:!0,[r.HR]:!0,[r.HTML]:!0,[r.IFRAME]:!0,[r.IMG]:!0,[r.INPUT]:!0,[r.LI]:!0,[r.LINK]:!0,[r.LISTING]:!0,[r.MAIN]:!0,[r.MARQUEE]:!0,[r.MENU]:!0,[r.META]:!0,[r.NAV]:!0,[r.NOEMBED]:!0,[r.NOFRAMES]:!0,[r.NOSCRIPT]:!0,[r.OBJECT]:!0,[r.OL]:!0,[r.P]:!0,[r.PARAM]:!0,[r.PLAINTEXT]:!0,[r.PRE]:!0,[r.SCRIPT]:!0,[r.SECTION]:!0,[r.SELECT]:!0,[r.SOURCE]:!0,[r.STYLE]:!0,[r.SUMMARY]:!0,[r.TABLE]:!0,[r.TBODY]:!0,[r.TD]:!0,[r.TEMPLATE]:!0,[r.TEXTAREA]:!0,[r.TFOOT]:!0,[r.TH]:!0,[r.THEAD]:!0,[r.TITLE]:!0,[r.TR]:!0,[r.TRACK]:!0,[r.UL]:!0,[r.WBR]:!0,[r.XMP]:!0},[o.MATHML]:{[r.MI]:!0,[r.MO]:!0,[r.MN]:!0,[r.MS]:!0,[r.MTEXT]:!0,[r.ANNOTATION_XML]:!0},[o.SVG]:{[r.TITLE]:!0,[r.FOREIGN_OBJECT]:!0,[r.DESC]:!0}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const o=new RegExp("^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$","i");function r(e){return o.test(e)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));const o=Object.freeze({IS:"SERVICE_TYPE_IS",IM:"SERVICE_TYPE_IM"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(205),r=n(150),i=n(92),a=n(95),s=n(90),c=n(88),l=n(300),d=n(294),u=n(256);class h extends Error{}class p{constructor(e=null){this.accessToken=null,this.authEnabled=!0,this.tempClient=e?Object(r.createClient)({baseUrl:"",idBaseUrl:e}):null}get _matrixClient(){return this.tempClient?this.tempClient:i.a.get()}_writeToken(){this.tempClient||window.localStorage.setItem("mx_is_access_token",this.accessToken)}_readToken(){return this.tempClient?null:window.localStorage.getItem("mx_is_access_token")}hasCredentials(){return null!=this.accessToken}async getAccessToken({check:e=!0}={}){if(!this.authEnabled)return null;let t=this.accessToken;if(t||(t=this._readToken()),!t)return t=await this.registerForToken(e),t&&(this.accessToken=t,this._writeToken()),t;if(e)try{await this._checkToken(t)}catch(e){if(e instanceof l.b||e instanceof h)throw e;t=await this.registerForToken(),t&&(this.accessToken=t,this._writeToken())}return t}async _checkToken(e){const t=this._matrixClient.getIdentityServerUrl();try{await this._matrixClient.getIdentityAccount(e)}catch(n){if("M_TERMS_NOT_SIGNED"===n.errcode)return console.log("Identity Server requires new terms to be agreed to"),void await Object(l.d)([new l.a(o.a.IS,t,e)]);throw n}if(!this.tempClient&&!Object(d.a)()&&!await Object(d.b)(t)){const e=s.getComponent("dialogs.QuestionDialog"),{finished:n}=a.a.createTrackedDialog("Default identity server terms warning","",e,{title:Object(c.a)("Identity server has no terms of service"),description:React.createElement("div",null,React.createElement("p",null,Object(c.a)("This action requires accessing the default identity server to validate an email address or phone number, but the server does not have any terms of service.",{},{server:()=>React.createElement("b",null,Object(u.a)(t))})),React.createElement("p",null,Object(c.a)("Only continue if you trust the owner of the server."))),button:Object(c.a)("Trust")}),[o]=await n;if(!o)throw new h("User aborted identity server action without terms");Object(d.d)()}}async registerForToken(e=!0){const t=await i.a.get().getOpenIdToken(),{access_token:n,token:o}=await this._matrixClient.registerWithIdentityServer(t),r=o||n;return e&&await this._checkToken(r),r}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FOCUS_GROUP="data-focus-lock",t.FOCUS_DISABLED="data-focus-lock-disabled",t.FOCUS_ALLOW="data-no-focus-lock",t.FOCUS_AUTO="data-autofocus-inside"},function(e,t,n){"use strict";let o;n.d(t,"a",(function(){return o})),function(e){e[e.None=0]="None",e[e.Bold=1]="Bold",e[e.Grey=2]="Grey",e[e.Red=3]="Red"}(o||(o={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n(87),r=n.n(o),i=n(91),a=n.n(i),s=n(97),c=n.n(s),l=n(88),d=n(96),u=n(186);const h={VERIFIED:"verified",WARNING:"warning",UNKNOWN:"unknown",NORMAL:"normal",UNAUTHENTICATED:"unauthenticated"},p={[h.WARNING]:Object(l.b)("This user has not verified all of their sessions."),[h.NORMAL]:Object(l.b)("You have not verified this user."),[h.VERIFIED]:Object(l.b)("You have verified this user. This user has verified all of their sessions.")},m={[h.WARNING]:Object(l.b)("Someone is using an unknown session"),[h.NORMAL]:Object(l.b)("This room is end-to-end encrypted"),[h.VERIFIED]:Object(l.b)("Everyone in this room is verified")},g=({isUser:e,status:t,className:n,size:i,onClick:a,hideTooltip:s,bordered:g})=>{const[f,_]=Object(o.useState)(!1),b=c()({mx_E2EIcon:!0,mx_E2EIcon_bordered:g,mx_E2EIcon_warning:t===h.WARNING,mx_E2EIcon_normal:t===h.NORMAL,mx_E2EIcon_verified:t===h.VERIFIED},n);let v,y;v=e?p[t]:m[t],i&&(y={width:i+"px",height:i+"px"});const E=()=>_(!0),S=()=>_(!1);let w;return f&&!s&&(w=r.a.createElement(u.b,{label:v?Object(l.a)(v):""})),a?r.a.createElement(d.a,{onClick:a,onMouseOver:E,onMouseLeave:S,className:b,style:y},w):r.a.createElement("div",{onMouseOver:E,onMouseLeave:S,className:b,style:y},w)};g.propTypes={isUser:a.a.bool,status:a.a.oneOf(Object.values(h)),className:a.a.string,size:a.a.number,onClick:a.a.func},t.b=g},function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var o,r,i,a=n(99),s=n.n(a),c=n(104),l=n.n(c),d=n(18),u=n.n(d),h=n(87),p=n.n(h),m=n(91),g=n.n(m),f=n(90),_=n(89);let b=Object(_.a)("views.elements.TextWithTooltip")((i=r=class extends p.a.Component{constructor(){super(),u()(this,"onMouseOver",()=>{this.setState({hover:!0})}),u()(this,"onMouseLeave",()=>{this.setState({hover:!1})}),this.state={hover:!1}}render(){const e=f.getComponent("elements.Tooltip"),t=this.props,{class:n,children:o,tooltip:r,tooltipClass:i,tooltipProps:a}=t,c=l()(t,["class","children","tooltip","tooltipClass","tooltipProps"]);return p.a.createElement("span",s()({},c,{onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave,className:n}),o,this.state.hover&&p.a.createElement(e,s()({},a,{label:r,tooltipClassName:i,className:"mx_TextWithTooltip_tooltip"})))}},u()(r,"propTypes",{class:g.a.string,tooltipClass:g.a.string,tooltip:g.a.node.isRequired,tooltipProps:g.a.object}),o=i))||o},function(e,t,n){"use strict";n.r(t),n.d(t,"CHAT_EFFECTS",(function(){return r}));var o=n(88);const r=[{emojis:["🎊","🎉"],msgType:"nic.custom.confetti",command:"confetti",description:()=>Object(o.b)("Sends the given message with confetti"),fallbackMessage:()=>Object(o.a)("sends confetti")+" 🎉",options:{maxCount:150,speed:3,frameInterval:15,alpha:1,gradient:!1}},{emojis:["🎆"],msgType:"nic.custom.fireworks",command:"fireworks",description:()=>Object(o.b)("Sends the given message with fireworks"),fallbackMessage:()=>Object(o.a)("sends fireworks")+" 🎆",options:{maxCount:500,gravity:.05}},{emojis:["❄","🌨"],msgType:"io.element.effect.snowfall",command:"snowfall",description:()=>Object(o.b)("Sends the given message with snowfall"),fallbackMessage:()=>Object(o.a)("sends snowfall")+" ❄",options:{maxCount:200,gravity:.05,maxDrift:5}},{emojis:["👾","🌌"],msgType:"io.element.effects.space_invaders",command:"spaceinvaders",description:()=>Object(o.b)("Sends the given message with a space themed effect"),fallbackMessage:()=>Object(o.a)("sends space invaders")+" 👾",options:{maxCount:50,gravity:.01}}]},function(e,t,n){"use strict";n.d(t,"a",(function(){return P})),n.d(t,"b",(function(){return L})),n.d(t,"c",(function(){return q})),n.d(t,"d",(function(){return H}));var o,r,i,a,s,c,l,d,u,h,p,m,g,f,_,b,v,y,E,S,w=n(18),C=n.n(w),T=n(87),x=n.n(T),O=n(97),k=n.n(O),R=n(90),I=n(88),D=n(94),A=n(96),N=n(118),F=n(114),M=n(89);!function(e){e.Password="m.login.password",e.Recaptcha="m.login.recaptcha",e.Terms="m.login.terms",e.Email="m.login.email.identity",e.Msisdn="m.login.msisdn",e.Sso="m.login.sso",e.SsoUnstable="org.matrix.login.sso"}(S||(S={}));const P=0;let L=Object(M.a)("views.auth.PasswordAuthEntry")((i=r=class extends x.a.Component{constructor(e){super(e),C()(this,"onSubmit",e=>{e.preventDefault(),this.props.busy||this.props.submitAuthDict({type:S.Password,user:this.props.matrixClient.credentials.userId,identifier:{type:"m.id.user",user:this.props.matrixClient.credentials.userId},password:this.state.password})}),C()(this,"onPasswordFieldChange",e=>{this.setState({password:e.target.value})}),this.state={password:""}}componentDidMount(){this.props.onPhaseChange(P)}render(){const e=k()({error:this.props.errorText});let t,n;if(this.props.busy){const e=R.getComponent("elements.Spinner");t=x.a.createElement(e,null)}else t=x.a.createElement("input",{type:"submit",className:"mx_Dialog_primary",disabled:!this.state.password,value:Object(I.a)("Continue")});this.props.errorText&&(n=x.a.createElement("div",{className:"error",role:"alert"},this.props.errorText));const o=R.getComponent("elements.Field");return x.a.createElement("div",null,x.a.createElement("p",null,Object(I.a)("Confirm your identity by entering your account password below.")),x.a.createElement("form",{onSubmit:this.onSubmit,className:"mx_InteractiveAuthEntryComponents_passwordSection"},x.a.createElement(o,{className:e,type:"password",name:"passwordField",label:Object(I.a)("Password"),autoFocus:!0,value:this.state.password,onChange:this.onPasswordFieldChange}),x.a.createElement("div",{className:"mx_button_row"},t)),n)}},C()(r,"LOGIN_TYPE",S.Password),o=i))||o,j=Object(M.a)("views.auth.RecaptchaAuthEntry")((c=s=class extends x.a.Component{constructor(...e){super(...e),C()(this,"onCaptchaResponse",e=>{F.a.instance.track("onboarding_grecaptcha_submit"),this.props.submitAuthDict({type:S.Recaptcha,response:e})})}componentDidMount(){this.props.onPhaseChange(P)}render(){if(this.props.busy){const e=R.getComponent("elements.Spinner");return x.a.createElement(e,null)}let e=this.props.errorText;const t=R.getComponent("views.auth.CaptchaForm");let n,o;return this.props.stageParams&&this.props.stageParams.public_key?n=this.props.stageParams.public_key:e=Object(I.a)("Missing captcha public key in homeserver configuration. Please report this to your homeserver administrator."),e&&(o=x.a.createElement("div",{className:"error",role:"alert"},e)),x.a.createElement("div",null,x.a.createElement(t,{sitePublicKey:n,onCaptchaResponse:this.onCaptchaResponse}),o)}},C()(s,"LOGIN_TYPE",S.Recaptcha),a=c))||a,U=Object(M.a)("views.auth.TermsAuthEntry")((u=d=class extends x.a.Component{constructor(e){super(e),C()(this,"tryContinue",()=>{this.trySubmit()}),C()(this,"trySubmit",()=>{let e=!0;for(const t of this.state.policies){const n=this.state.toggledPolicies[t.id];e=e&&n}e?(this.props.submitAuthDict({type:S.Terms}),F.a.instance.track("onboarding_terms_complete")):this.setState({errorText:Object(I.a)("Please review and accept all of the homeserver's policies")})});const t=this.props.stageParams.policies||{},n=D.b.getValue("language"),o={},r=[];for(const e of Object.keys(t)){const i=t[e];let a=i[n];if(a||(a=i.en),!a){a=i[Object.keys(i).find(e=>"version"!==e)]}if(!a)throw new Error("Failed to find a policy to show the user");o[e]=!1,r.push({id:e,name:a.name,url:a.url})}this.state={toggledPolicies:o,policies:r},F.a.instance.track("onboarding_terms_begin")}componentDidMount(){this.props.onPhaseChange(P)}togglePolicy(e){const t={};for(const n of this.state.policies){let o=this.state.toggledPolicies[n.id];n.id===e&&(o=!o),t[n.id]=o}this.setState({toggledPolicies:t})}render(){if(this.props.busy){const e=R.getComponent("elements.Spinner");return x.a.createElement(e,null)}const e=[];let t,n,o=!0;for(const t of this.state.policies){const n=this.state.toggledPolicies[t.id];o=o&&n,e.push(x.a.createElement("label",{key:"policy_checkbox_"+t.id,className:"mx_InteractiveAuthEntryComponents_termsPolicy"},x.a.createElement("input",{type:"checkbox",onChange:()=>this.togglePolicy(t.id),checked:n}),x.a.createElement("a",{href:t.url,target:"_blank",rel:"noreferrer noopener"},t.name)))}return(this.props.errorText||this.state.errorText)&&(t=x.a.createElement("div",{className:"error",role:"alert"},this.props.errorText||this.state.errorText)),!1!==this.props.showContinue&&(n=x.a.createElement("button",{className:"mx_InteractiveAuthEntryComponents_termsSubmit mx_GeneralButton",onClick:this.trySubmit,disabled:!o},Object(I.a)("Accept"))),x.a.createElement("div",null,x.a.createElement("p",null,Object(I.a)("Please review and accept the policies of this homeserver:")),e,t,n)}},C()(d,"LOGIN_TYPE",S.Terms),l=u))||l,B=Object(M.a)("views.auth.EmailIdentityAuthEntry")((m=p=class extends x.a.Component{componentDidMount(){this.props.onPhaseChange(P)}render(){var e;return void 0===this.props.inputs.emailAddress||null!==(e=this.props.stageState)&&void 0!==e&&e.emailSid?x.a.createElement(N.a,null):x.a.createElement("div",{className:"mx_InteractiveAuthEntryComponents_emailWrapper"},x.a.createElement("p",null,Object(I.a)("A confirmation email has been sent to %(emailAddress)s",{emailAddress:x.a.createElement("b",null,this.props.inputs.emailAddress)})),x.a.createElement("p",null,Object(I.a)("Open the link in the email to continue registration.")))}},C()(p,"LOGIN_TYPE",S.Email),h=m))||h,G=Object(M.a)("views.auth.MsisdnAuthEntry")((_=f=class extends x.a.Component{constructor(e){super(e),C()(this,"submitUrl",void 0),C()(this,"sid",void 0),C()(this,"msisdn",void 0),C()(this,"onTokenChange",e=>{this.setState({token:e.target.value})}),C()(this,"onFormSubmit",async e=>{if(e.preventDefault(),""!=this.state.token){this.setState({errorText:null});try{let e;if(!this.submitUrl)throw new Error("The registration with MSISDN flow is misconfigured");if(e=await this.props.matrixClient.submitMsisdnTokenOtherUrl(this.submitUrl,this.sid,this.props.clientSecret,this.state.token),e.success){const e={sid:this.sid,client_secret:this.props.clientSecret};this.props.submitAuthDict({type:S.Msisdn,threepid_creds:e,threepidCreds:e})}else this.setState({errorText:Object(I.a)("Token incorrect")})}catch(e){this.props.fail(e),console.log("Failed to submit msisdn token")}}}),this.state={token:"",requestingToken:!1,errorText:""}}componentDidMount(){this.props.onPhaseChange(P),this.setState({requestingToken:!0}),this.requestMsisdnToken().catch(e=>{this.props.fail(e)}).finally(()=>{this.setState({requestingToken:!1})})}requestMsisdnToken(){return this.props.matrixClient.requestRegisterMsisdnToken(this.props.inputs.phoneCountry,this.props.inputs.phoneNumber,this.props.clientSecret,1).then(e=>{this.submitUrl=e.submit_url,this.sid=e.sid,this.msisdn=e.msisdn})}render(){if(this.state.requestingToken){const e=R.getComponent("elements.Spinner");return x.a.createElement(e,null)}{const e=Boolean(this.state.token),t=k()({mx_InteractiveAuthEntryComponents_msisdnSubmit:!0,mx_GeneralButton:!0});let n;return this.state.errorText&&(n=x.a.createElement("div",{className:"error",role:"alert"},this.state.errorText)),x.a.createElement("div",null,x.a.createElement("p",null,Object(I.a)("A text message has been sent to %(msisdn)s",{msisdn:x.a.createElement("i",null,this.msisdn)})),x.a.createElement("p",null,Object(I.a)("Please enter the code it contains:")),x.a.createElement("div",{className:"mx_InteractiveAuthEntryComponents_msisdnWrapper"},x.a.createElement("form",{onSubmit:this.onFormSubmit},x.a.createElement("input",{type:"text",className:"mx_InteractiveAuthEntryComponents_msisdnEntry",value:this.state.token,onChange:this.onTokenChange,"aria-label":Object(I.a)("Code")}),x.a.createElement("br",null),x.a.createElement("input",{type:"submit",value:Object(I.a)("Submit"),className:t,disabled:!e})),n))}}},C()(f,"LOGIN_TYPE",S.Msisdn),g=_))||g,q=Object(M.a)("views.auth.SSOAuthEntry")((y=v=class e extends x.a.Component{constructor(t){super(t),C()(this,"ssoUrl",void 0),C()(this,"popupWindow",void 0),C()(this,"attemptFailed",()=>{this.setState({attemptFailed:!0})}),C()(this,"onReceiveMessage",e=>{"authDone"===e.data&&e.origin===this.props.matrixClient.getHomeserverUrl()&&this.popupWindow&&(this.popupWindow.close(),this.popupWindow=null)}),C()(this,"onStartAuthClick",()=>{this.popupWindow=window.open(this.ssoUrl,"_blank"),this.setState({phase:e.PHASE_POSTAUTH}),this.props.onPhaseChange(e.PHASE_POSTAUTH)}),C()(this,"onConfirmClick",()=>{this.props.submitAuthDict({})}),this.ssoUrl=t.matrixClient.getFallbackAuthUrl(this.props.loginType,this.props.authSessionId),this.popupWindow=null,window.addEventListener("message",this.onReceiveMessage),this.state={phase:e.PHASE_PREAUTH,attemptFailed:!1}}componentDidMount(){this.props.onPhaseChange(e.PHASE_PREAUTH)}componentWillUnmount(){window.removeEventListener("message",this.onReceiveMessage),this.popupWindow&&(this.popupWindow.close(),this.popupWindow=null)}render(){let t=null;const n=x.a.createElement(A.a,{onClick:this.props.onCancel,kind:this.props.continueKind?this.props.continueKind+"_outline":"primary_outline"},Object(I.a)("Cancel"));let o;return t=this.state.phase===e.PHASE_PREAUTH?x.a.createElement(A.a,{onClick:this.onStartAuthClick,kind:this.props.continueKind||"primary"},this.props.continueText||Object(I.a)("Single Sign On")):x.a.createElement(A.a,{onClick:this.onConfirmClick,kind:this.props.continueKind||"primary"},this.props.continueText||Object(I.a)("Confirm")),this.props.errorText?o=x.a.createElement("div",{className:"error",role:"alert"},this.props.errorText):this.state.attemptFailed&&(o=x.a.createElement("div",{className:"error",role:"alert"},Object(I.a)("Something went wrong in confirming your identity. Cancel and try again."))),x.a.createElement(x.a.Fragment,null,o,x.a.createElement("div",{className:"mx_InteractiveAuthEntryComponents_sso_buttons"},n,t))}},C()(v,"LOGIN_TYPE",S.Sso),C()(v,"UNSTABLE_LOGIN_TYPE",S.SsoUnstable),C()(v,"PHASE_PREAUTH",1),C()(v,"PHASE_POSTAUTH",2),b=y))||b,V=Object(M.a)("views.auth.FallbackAuthEntry")(E=class extends x.a.Component{constructor(e){super(e),C()(this,"popupWindow",void 0),C()(this,"fallbackButton",Object(T.createRef)()),C()(this,"focus",()=>{this.fallbackButton.current&&this.fallbackButton.current.focus()}),C()(this,"onShowFallbackClick",e=>{e.preventDefault(),e.stopPropagation();const t=this.props.matrixClient.getFallbackAuthUrl(this.props.loginType,this.props.authSessionId);this.popupWindow=window.open(t,"_blank")}),C()(this,"onReceiveMessage",e=>{"authDone"===e.data&&e.origin===this.props.matrixClient.getHomeserverUrl()&&this.props.submitAuthDict({})}),this.popupWindow=null,window.addEventListener("message",this.onReceiveMessage)}componentDidMount(){this.props.onPhaseChange(P)}componentWillUnmount(){window.removeEventListener("message",this.onReceiveMessage),this.popupWindow&&this.popupWindow.close()}render(){let e;return this.props.errorText&&(e=x.a.createElement("div",{className:"error",role:"alert"},this.props.errorText)),x.a.createElement("div",null,x.a.createElement("a",{href:"",ref:this.fallbackButton,onClick:this.onShowFallbackClick},Object(I.a)("Start authentication")),e)}})||E;function H(e){switch(e){case S.Password:return L;case S.Recaptcha:return j;case S.Email:return B;case S.Msisdn:return G;case S.Terms:return U;case S.Sso:case S.SsoUnstable:return q;default:return V}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(1),r=n(8);function i(e){this.userId=e,this.presence="offline",this.presenceStatusMsg=null,this._unstable_statusMessage="",this.displayName=e,this.rawDisplayName=e,this.avatarUrl=null,this.lastActiveAgo=0,this.lastPresenceTs=0,this.currentlyActive=!1,this.events={presence:null,profile:null},this._updateModifiedTime()}o.m(i,r.EventEmitter),i.prototype.setPresenceEvent=function(e){if("m.presence"!==e.getType())return;const t=null===this.events.presence;this.events.presence=e;const n=[];(e.getContent().presence!==this.presence||t)&&n.push("User.presence"),e.getContent().avatar_url&&e.getContent().avatar_url!==this.avatarUrl&&n.push("User.avatarUrl"),e.getContent().displayname&&e.getContent().displayname!==this.displayName&&n.push("User.displayName"),void 0!==e.getContent().currently_active&&e.getContent().currently_active!==this.currentlyActive&&n.push("User.currentlyActive"),this.presence=e.getContent().presence,n.push("User.lastPresenceTs"),e.getContent().status_msg&&(this.presenceStatusMsg=e.getContent().status_msg),e.getContent().displayname&&(this.displayName=e.getContent().displayname),e.getContent().avatar_url&&(this.avatarUrl=e.getContent().avatar_url),this.lastActiveAgo=e.getContent().last_active_ago,this.lastPresenceTs=Date.now(),this.currentlyActive=e.getContent().currently_active,this._updateModifiedTime();for(let t=0;tisNaN(parseInt(e,16)))}(i)?a="":(a=function(e){const t=document.createElement("canvas");t.width=40,t.height=40;const n=t.getContext("2d");return n?(n.fillStyle=e,n.fillRect(0,0,40,40),t.toDataURL()):""}(i),c.set(i,a))),a}function d(e){if(!e)return void console.trace("`name` argument to `getInitialLetter` not supplied");if(e.length<1)return;let t=0;const n=e[0];"@"!==n&&"#"!==n&&"+"!==n||!e[1]||t++;let o=1;const r=e.charCodeAt(t);if(r>=55296&&r<=56319&&e[t+1]){const n=e.charCodeAt(t+1);n>=56320&&n<=57343&&o++}return e.substring(t,t+o).toUpperCase()}function u(e,t,n,a){var s;if(!e)return null;if(e.getMxcAvatarUrl())return Object(r.b)(e.getMxcAvatarUrl()).getThumbnailOfSourceHttp(t,n,a);if(i.b.getValue("feature_spaces")&&e.isSpaceRoom())return null;let c=null;const l=o.a.shared().getUserIdForRoomId(e.roomId);return c=l?e.getMember(l):e.getAvatarFallbackMember(),null!==(s=c)&&void 0!==s&&s.getMxcAvatarUrl()?Object(r.b)(c.getMxcAvatarUrl()).getThumbnailOfSourceHttp(t,n,a):null}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n(18),r=n.n(o),i=n(146),a=n(93),s=n(111),c=n(92),l=n(88),d=n(103);class u extends i.a{constructor(){super(a.a,{displayName:window.localStorage.getItem("mx_profile_displayname"),avatarUrl:window.localStorage.getItem("mx_profile_avatar_url")}),r()(this,"monitoredUser",void 0),r()(this,"onProfileUpdate",async()=>{const e=await this.matrixClient.getProfileInfo(this.matrixClient.getUserId());e.displayname?window.localStorage.setItem("mx_profile_displayname",e.displayname):window.localStorage.removeItem("mx_profile_displayname"),e.avatar_url?window.localStorage.setItem("mx_profile_avatar_url",e.avatar_url):window.localStorage.removeItem("mx_profile_avatar_url"),await this.updateState({displayName:e.displayname,avatarUrl:e.avatar_url})}),r()(this,"onStateEvents",Object(s.throttle)(async e=>{const t=c.a.get().getUserId();"m.room.member"===e.getType()&&e.getSender()===t&&e.getStateKey()===t&&await this.onProfileUpdate()},200,{trailing:!0,leading:!0}))}static get instance(){return u.internalInstance}get displayName(){return this.matrixClient?this.matrixClient.isGuest()?Object(l.a)("Guest"):this.state.displayName?this.state.displayName:this.matrixClient.getUserId():this.state.displayName||null}get avatarMxc(){return this.state.avatarUrl||null}getHttpAvatarUrl(e=0){if(!this.avatarMxc)return null;const t=Object(d.b)(this.avatarMxc);return!e||e<=0?t.srcHttp:t.getSquareThumbnailHttp(e)}async onNotReady(){this.monitoredUser&&(this.monitoredUser.removeListener("User.displayName",this.onProfileUpdate),this.monitoredUser.removeListener("User.avatarUrl",this.onProfileUpdate)),this.matrixClient&&this.matrixClient.removeListener("RoomState.events",this.onStateEvents),await this.reset({})}async onReady(){const e=this.matrixClient.getUserId();this.monitoredUser=this.matrixClient.getUser(e),this.monitoredUser&&(this.monitoredUser.on("User.displayName",this.onProfileUpdate),this.monitoredUser.on("User.avatarUrl",this.onProfileUpdate)),this.matrixClient.on("RoomState.events",this.onStateEvents),await this.onProfileUpdate()}async onAction(e){}}r()(u,"internalInstance",new u)},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(871),i=(o=r)&&o.__esModule?o:{default:o};t.default=i.default||function(e){for(var t=1;t{t===C.a.get().getRoom(this.props.mxEvent.getRoomId())&&(this.shouldShowSentReceipt||this.shouldShowSendingReceipt||this.isListeningForReceipts)&&this.forceUpdate(()=>{this.shouldShowSentReceipt||this.shouldShowSendingReceipt||(this.context.removeListener("Room.receipt",this.onRoomReceipt),this.isListeningForReceipts=!1)})}),s()(this,"onDecrypted",()=>{this.verifyEvent(this.props.mxEvent),this.forceUpdate()}),s()(this,"onDeviceVerificationChanged",(e,t)=>{e===this.props.mxEvent.getSender()&&this.verifyEvent(this.props.mxEvent)}),s()(this,"onUserVerificationChanged",(e,t)=>{e===this.props.mxEvent.getSender()&&this.verifyEvent(this.props.mxEvent)}),s()(this,"toggleAllReadAvatars",()=>{this.setState({allReadAvatars:!this.state.allReadAvatars})}),s()(this,"onSenderProfileClick",e=>{const t=this.props.mxEvent;y.a.dispatch({action:"insert_mention",user_id:t.getSender()})}),s()(this,"onRequestKeysClick",()=>{this.setState({previouslyRequestedKeys:!0}),this.context.cancelAndResendEventRoomKeyRequest(this.props.mxEvent)}),s()(this,"onPermalinkClicked",e=>{e.preventDefault(),y.a.dispatch({action:"view_room",event_id:this.props.mxEvent.getId(),highlighted:!0,room_id:this.props.mxEvent.getRoomId()})}),s()(this,"onActionBarFocusChange",e=>{this.setState({actionBarFocused:e})}),s()(this,"getTile",()=>this.tile.current),s()(this,"getReplyThread",()=>this.replyThread.current),s()(this,"getReactions",()=>{if(!this.props.showReactions||!this.props.getRelationsForEvent)return null;const e=this.props.mxEvent.getId();return this.props.getRelationsForEvent(e,"m.annotation","m.reaction")}),s()(this,"onReactionsCreated",(e,t)=>{"m.annotation"===e&&"m.reaction"===t&&(this.props.mxEvent.removeListener("Event.relationsCreated",this.onReactionsCreated),this.setState({reactions:this.getReactions()}))}),this.state={actionBarFocused:!1,allReadAvatars:!1,verified:null,previouslyRequestedKeys:!1,reactions:this.getReactions()},this.suppressReadReceiptAnimation=!0,this.isListeningForReceipts=!1}get isEligibleForSpecialReceipt(){if(this.props.readReceipts&&this.props.readReceipts.length>0)return!1;if(!this.props.mxEvent)return!1;if(!this.context.getRoom(this.props.mxEvent.getRoomId()))return!1;const e=C.a.get().getUserId();if(this.props.mxEvent.getSender()!==e)return!1;return!![m.a.Sticker,m.a.RoomMessage,m.a.RoomMessageEncrypted].includes(this.props.mxEvent.getType())}get shouldShowSentReceipt(){if(!this.isEligibleForSpecialReceipt)return!1;if(!this.props.lastSuccessful)return!1;if(this.props.eventSendStatus&&"sent"!==this.props.eventSendStatus)return!1;const e=this.props.readReceipts||[],t=C.a.get().getUserId();return!e.some(e=>e.userId!==t)}get shouldShowSendingReceipt(){return!!this.isEligibleForSpecialReceipt&&!(!this.props.eventSendStatus||"sent"===this.props.eventSendStatus)}UNSAFE_componentWillMount(){this.verifyEvent(this.props.mxEvent)}componentDidMount(){this.suppressReadReceiptAnimation=!1;const e=this.context;e.on("deviceVerificationChanged",this.onDeviceVerificationChanged),e.on("userTrustStatusChanged",this.onUserVerificationChanged),this.props.mxEvent.on("Event.decrypted",this.onDecrypted),this.props.showReactions&&this.props.mxEvent.on("Event.relationsCreated",this.onReactionsCreated),(this.shouldShowSentReceipt||this.shouldShowSendingReceipt)&&(e.on("Room.receipt",this.onRoomReceipt),this.isListeningForReceipts=!0)}UNSAFE_componentWillReceiveProps(e){e.eventSendStatus!==this.props.eventSendStatus&&this.verifyEvent(e.mxEvent)}shouldComponentUpdate(e,t){return!!Object(A.c)(this.state,t)||!this.propsEqual(this.props,e)}componentWillUnmount(){const e=this.context;e.removeListener("deviceVerificationChanged",this.onDeviceVerificationChanged),e.removeListener("userTrustStatusChanged",this.onUserVerificationChanged),e.removeListener("Room.receipt",this.onRoomReceipt),this.isListeningForReceipts=!1,this.props.mxEvent.removeListener("Event.decrypted",this.onDecrypted),this.props.showReactions&&this.props.mxEvent.removeListener("Event.relationsCreated",this.onReactionsCreated)}componentDidUpdate(e,t,n){this.isListeningForReceipts||!this.shouldShowSentReceipt&&!this.shouldShowSendingReceipt||(this.context.on("Room.receipt",this.onRoomReceipt),this.isListeningForReceipts=!0)}async verifyEvent(e){if(!e.isEncrypted())return;const t=this.context.getEventEncryptionInfo(e),n=e.getSender(),o=this.context.checkUserTrust(n);if(t.mismatchedSender)return void this.setState({verified:O.a.WARNING},this.props.onHeightChanged);if(!o.isCrossSigningVerified())return void this.setState({verified:O.a.NORMAL},this.props.onHeightChanged);const r=t.sender&&this.context.checkDeviceTrust(n,t.sender.deviceId);r?r.isVerified()?t.authenticated?this.setState({verified:O.a.VERIFIED},this.props.onHeightChanged):this.setState({verified:O.a.UNAUTHENTICATED},this.props.onHeightChanged):this.setState({verified:O.a.WARNING},this.props.onHeightChanged):this.setState({verified:O.a.UNKNOWN},this.props.onHeightChanged)}propsEqual(e,t){const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(let o=0;o0&&(r=u.a.createElement("span",{className:"mx_EventTile_readAvatarRemainder",onClick:this.toggleAllReadAvatars,style:{right:"calc("+Object(k.b)(-n)+" + 15px)"}},e,"+"))}return u.a.createElement("span",{className:"mx_EventTile_readAvatars"},r,t)}renderE2EPadlock(){const e=this.props.mxEvent;if("m.bad.encrypted"===e.getContent().msgtype)return u.a.createElement(z,null);if(e.isEncrypted())return this.state.verified===O.a.NORMAL||this.state.verified===O.a.VERIFIED?void 0:this.state.verified===O.a.UNAUTHENTICATED?u.a.createElement($,null):this.state.verified===O.a.UNKNOWN?u.a.createElement(Y,null):u.a.createElement(K,null);if(this.context.isRoomEncrypted(e.getRoomId())){if(e.status===g.a.ENCRYPTING)return;if(e.status===g.a.NOT_SENT)return;if(e.isState())return;return u.a.createElement(W,null)}return null}render(){const e=v.getComponent("messages.MessageTimestamp"),t=v.getComponent("messages.SenderProfile"),n=v.getComponent("avatars.MemberAvatar"),o=this.props.mxEvent.getContent().msgtype,r=this.props.mxEvent.getType();let i=B(this.props.mxEvent);const a=r.startsWith("m.key.verification")||r===m.a.RoomMessage&&o&&o.startsWith("m.key.verification")||r===m.a.RoomCreate||r===m.a.RoomEncryption||"messages.MJitsiWidgetEvent"===i;let s=!a&&r!==m.a.RoomMessage&&r!==m.a.Sticker&&r!==m.a.RoomCreate;if(E.b.getValue("showHiddenEventsInTimeline")&&!H(this.props.mxEvent)&&(i="messages.ViewSourceEvent",s=!0),!i){const{mxEvent:e}=this.props;return console.warn(`Event type not supported: type:${e.getType()} isState:${e.isState()}`),u.a.createElement("div",{className:"mx_EventTile mx_EventTile_info mx_MNoticeBody"},u.a.createElement("div",{className:"mx_EventTile_line"},Object(_.a)("This event could not be displayed")))}const c=v.getComponent(i),l=-1!==["sending","queued","encrypting"].indexOf(this.props.eventSendStatus),d=V(this.props.mxEvent)&&this.props.isRedacted,h=this.props.mxEvent.isDecryptionFailure(),g=!!this.props.editState,b=p()({mx_EventTile_bubbleContainer:a,mx_EventTile:!0,mx_EventTile_isEditing:g,mx_EventTile_info:s,mx_EventTile_12hr:this.props.isTwelveHour,mx_EventTile_sending:!g&&l,mx_EventTile_highlight:"notif"!==this.props.tileShape&&this.shouldHighlight(),mx_EventTile_selected:this.props.isSelectedEvent,mx_EventTile_continuation:this.props.tileShape?"":this.props.continuation,mx_EventTile_last:this.props.last,mx_EventTile_lastInSection:this.props.lastInSection,mx_EventTile_contextual:this.props.contextual,mx_EventTile_actionBarFocused:this.state.actionBarFocused,mx_EventTile_verified:!a&&this.state.verified===O.a.VERIFIED,mx_EventTile_unverified:!a&&this.state.verified===O.a.WARNING,mx_EventTile_unknown:!a&&this.state.verified===O.a.UNKNOWN,mx_EventTile_bad:h,mx_EventTile_emote:"m.emote"===o}),y=null!==this.props.eventSendStatus?"off":void 0;let C,T,x,k,R="#";if(this.props.permalinkCreator&&(R=this.props.permalinkCreator.forEvent(this.props.mxEvent.getId())),"notif"===this.props.tileShape?(x=24,k=!0):"messages.RoomCreate"===i||a?(x=0,k=!1):s?(x=14,k=!1):this.props.layout==S.a.IRC?(x=14,k=!0):this.props.continuation&&"file_grid"!==this.props.tileShape?(x=0,k=!1):(x=30,k=!0),this.props.mxEvent.sender&&x){let e;e=this.props.mxEvent.getContent().third_party_invite?this.props.mxEvent.target:this.props.mxEvent.sender,C=u.a.createElement("div",{className:"mx_EventTile_avatar"},u.a.createElement(n,{member:e,width:x,height:x,viewUserOnClick:!0}))}k&&(T=this.props.tileShape&&"reply"!==this.props.tileShape&&"reply_preview"!==this.props.tileShape?u.a.createElement(t,{mxEvent:this.props.mxEvent,enableFlair:this.props.enableFlair}):u.a.createElement(t,{onClick:this.onSenderProfileClick,mxEvent:this.props.mxEvent,enableFlair:this.props.enableFlair}));const D=v.getComponent("messages.MessageActionBar"),A=g?void 0:u.a.createElement(D,{mxEvent:this.props.mxEvent,reactions:this.state.reactions,permalinkCreator:this.props.permalinkCreator,getTile:this.getTile,getReplyThread:this.getReplyThread,onFocusChange:this.onActionBarFocusChange}),N=this.props.mxEvent.getTs()?u.a.createElement(e,{showTwelveHour:this.props.isTwelveHour,ts:this.props.mxEvent.getTs()}):null,F=u.a.createElement("div",{className:"mx_EventTile_keyRequestInfo_tooltip_contents"},u.a.createElement("p",null,this.state.previouslyRequestedKeys?Object(_.a)("Your key share request has been sent - please check your other sessions for key share requests."):Object(_.a)("Key share requests are sent to your other sessions automatically. If you rejected or dismissed the key share request on your other sessions, click here to request the keys for this session again.")),u.a.createElement("p",null,Object(_.a)("If your other sessions do not have the key for this message you will not be able to decrypt them."))),M=this.state.previouslyRequestedKeys?Object(_.a)("Key request sent."):Object(_.a)("Re-request encryption keys from your other sessions.",{},{requestLink:e=>u.a.createElement("a",{onClick:this.onRequestKeysClick},e)}),P=v.getComponent("elements.TooltipButton"),L=h&&!d?u.a.createElement("div",{className:"mx_EventTile_keyRequestInfo"},u.a.createElement("span",{className:"mx_EventTile_keyRequestInfo_text"},M),u.a.createElement(P,{helpText:F})):null;let j;if(!d){const e=v.getComponent("messages.ReactionsRow");j=u.a.createElement(e,{mxEvent:this.props.mxEvent,reactions:this.state.reactions})}const U=u.a.createElement("a",{href:R,onClick:this.onPermalinkClicked,"aria-label":Object(w.e)(new Date(this.props.mxEvent.getTs()),this.props.isTwelveHour)},N),G=this.props.layout==S.a.IRC,q=G?null:U,z=G?U:null,K=!G&&!a&&this.renderE2EPadlock(),W=G&&!a&&this.renderE2EPadlock();let Y;if(this.props.showReadReceipts){const e=this.getReadAvatars();Y=u.a.createElement("div",{className:"mx_EventTile_msgOption"},e)}switch(this.props.tileShape){case"notif":{const e=this.context.getRoom(this.props.mxEvent.getRoomId());return u.a.createElement("div",{className:b,"aria-live":y,"aria-atomic":"true"},u.a.createElement("div",{className:"mx_EventTile_roomName"},u.a.createElement(I.a,{room:e,width:28,height:28}),u.a.createElement("a",{href:R,onClick:this.onPermalinkClicked},e?e.name:"")),u.a.createElement("div",{className:"mx_EventTile_senderDetails"},C,u.a.createElement("a",{href:R,onClick:this.onPermalinkClicked},T,N)),u.a.createElement("div",{className:"mx_EventTile_line"},u.a.createElement(c,{ref:this.tile,mxEvent:this.props.mxEvent,highlights:this.props.highlights,highlightLink:this.props.highlightLink,showUrlPreview:this.props.showUrlPreview,onHeightChanged:this.props.onHeightChanged})))}case"file_grid":return u.a.createElement("div",{className:b,"aria-live":y,"aria-atomic":"true"},u.a.createElement("div",{className:"mx_EventTile_line"},u.a.createElement(c,{ref:this.tile,mxEvent:this.props.mxEvent,highlights:this.props.highlights,highlightLink:this.props.highlightLink,showUrlPreview:this.props.showUrlPreview,tileShape:this.props.tileShape,onHeightChanged:this.props.onHeightChanged})),u.a.createElement("a",{className:"mx_EventTile_senderDetailsLink",href:R,onClick:this.onPermalinkClicked},u.a.createElement("div",{className:"mx_EventTile_senderDetails"},T,N)));case"reply":case"reply_preview":{let e;return"reply_preview"===this.props.tileShape&&(e=f.a.makeThread(this.props.mxEvent,this.props.onHeightChanged,this.props.permalinkCreator,this.replyThread)),u.a.createElement("div",{className:b,"aria-live":y,"aria-atomic":"true"},z,C,T,W,u.a.createElement("div",{className:"mx_EventTile_reply"},q,K,e,u.a.createElement(c,{ref:this.tile,mxEvent:this.props.mxEvent,highlights:this.props.highlights,highlightLink:this.props.highlightLink,onHeightChanged:this.props.onHeightChanged,replacingEventId:this.props.replacingEventId,showUrlPreview:!1})))}default:{const e=f.a.makeThread(this.props.mxEvent,this.props.onHeightChanged,this.props.permalinkCreator,this.replyThread,this.props.layout);return u.a.createElement("div",{className:b,tabIndex:-1,"aria-live":y,"aria-atomic":"true"},z,T,W,u.a.createElement("div",{className:"mx_EventTile_line"},q,K,e,u.a.createElement(c,{ref:this.tile,mxEvent:this.props.mxEvent,replacingEventId:this.props.replacingEventId,editState:this.props.editState,highlights:this.props.highlights,highlightLink:this.props.highlightLink,showUrlPreview:this.props.showUrlPreview,permalinkCreator:this.props.permalinkCreator,onHeightChanged:this.props.onHeightChanged}),L,j,A),Y,C)}}}},s()(r,"defaultProps",{onHeightChanged:function(){}}),s()(r,"contextType",x.a),o=i))||o;const q=["m.room.message","m.sticker"];function V(e){return q.includes(e.getType())}function H(e){if(e.isRedacted()&&!V(e))return!1;if(e.isRelation("m.replace"))return!1;const t=B(e);return void 0!==t&&("messages.TextualEvent"===t?""!==b.a(e):"messages.RoomCreate"!==t||Boolean(e.getContent().predecessor))}function z(e){return u.a.createElement(Q,l()({title:Object(_.a)("This message cannot be decrypted"),icon:"undecryptable"},e))}function K(e){return u.a.createElement(Q,l()({title:Object(_.a)("Encrypted by an unverified session"),icon:"unverified"},e))}function W(e){return u.a.createElement(Q,l()({title:Object(_.a)("Unencrypted"),icon:"unencrypted"},e))}function Y(e){return u.a.createElement(Q,l()({title:Object(_.a)("Encrypted by a deleted session"),icon:"unknown"},e))}function $(e){return u.a.createElement(Q,l()({title:Object(_.a)("The authenticity of this encrypted message can't be guaranteed on this device."),icon:"unauthenticated"},e))}class Q extends u.a.Component{constructor(e){super(e),s()(this,"onHoverStart",()=>{this.setState({hover:!0})}),s()(this,"onHoverEnd",()=>{this.setState({hover:!1})}),this.state={hover:!1}}render(){let e=null;this.state.hover&&(e=u.a.createElement(F.b,{className:"mx_EventTile_e2eIcon_tooltip",label:this.props.title}));const t="mx_EventTile_e2eIcon mx_EventTile_e2eIcon_"+this.props.icon;return u.a.createElement("div",{className:t,onMouseEnter:this.onHoverStart,onMouseLeave:this.onHoverEnd},e)}}class J extends u.a.PureComponent{constructor(e){super(e),s()(this,"onHoverStart",()=>{this.setState({hover:!0})}),s()(this,"onHoverEnd",()=>{this.setState({hover:!1})}),this.state={hover:!1}}render(){const e=!this.props.messageState||"sent"===this.props.messageState,t="not_sent"===this.props.messageState,n=p()({mx_EventTile_receiptSent:e,mx_EventTile_receiptSending:!e&&!t});let o=null;t&&(o=u.a.createElement(P.a,{notification:M.a.RED_EXCLAMATION}));let r=null;if(this.state.hover){let n=Object(_.a)("Sending your message...");"encrypting"===this.props.messageState?n=Object(_.a)("Encrypting your message..."):e?n=Object(_.a)("Your message was sent"):t&&(n=Object(_.a)("Failed to send")),r=u.a.createElement(F.b,{className:"mx_EventTile_readAvatars_receiptTooltip",label:n,yOffset:20})}return u.a.createElement("span",{className:"mx_EventTile_readAvatars"},u.a.createElement("span",{className:n,onMouseEnter:this.onHoverStart,onMouseLeave:this.onHoverEnd},o,r))}}},function(e,t){e.exports={trueFunc:function(){return!0},falseFunc:function(){return!1}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return d}));var o=n(91),r=n.n(o);const i=/^\S+@\S+\.\S+$/,a=/^@\S+:\S+$/,s=/^!\S+:\S+$/,c=["mx-user-id","mx-room-id","email"],l=r.a.shape({addressType:r.a.oneOf(c).isRequired,address:r.a.string.isRequired,displayName:r.a.string,avatarMxc:r.a.string,isKnown:r.a.bool});function d(e){const t=i.test(e),n=a.test(e),o=s.test(e);return t?"email":n?"mx-user-id":o?"mx-room-id":null}},function(e,t,n){"use strict";function o(e,t){const n=`Store is invalid because ${e}, please stop the client, delete all data and start the client again`,o=Reflect.construct(Error,[n]);return Reflect.setPrototypeOf(o,Reflect.getPrototypeOf(this)),o.reason=e,o.value=t,o}function r(e){const t=`Crypto store is invalid because ${e}, please stop the client, delete all data and start the client again`,n=Reflect.construct(Error,[t]);return Reflect.setPrototypeOf(n,Reflect.getPrototypeOf(this)),n.reason=e,n.name="InvalidCryptoStoreError",n}n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return i})),o.TOGGLED_LAZY_LOADING="TOGGLED_LAZY_LOADING",o.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Reflect.setPrototypeOf(o,Error),r.TOO_NEW="TOO_NEW",r.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),Reflect.setPrototypeOf(r,Error);class i extends Error{constructor(e,t){super(e),this.value=t}}},function(e,t,n){"use strict";n.d(t,"i",(function(){return d})),n.d(t,"j",(function(){return u})),n.d(t,"a",(function(){return h})),n.d(t,"h",(function(){return p})),n.d(t,"g",(function(){return m})),n.d(t,"e",(function(){return g})),n.d(t,"d",(function(){return f})),n.d(t,"f",(function(){return _})),n.d(t,"b",(function(){return b})),n.d(t,"c",(function(){return v})),n.d(t,"k",(function(){return y}));var o=n(18),r=n.n(o),i=n(0),a=n(8),s=n(299),c=n(298);const l="m.key.verification.",d=l+"request",u=l+"start",h=l+"cancel",p=l+"ready",m=1,g=2,f=3,_=4,b=5,v=6;class y extends a.EventEmitter{constructor(e,t,n){super(),r()(this,"_cancelOnTimeout",()=>{try{this.initiatedByMe?this.cancel({reason:"Other party didn't accept in time",code:"m.timeout"}):this.cancel({reason:"User didn't accept in time",code:"m.timeout"})}catch(e){i.a.error("Error while cancelling verification request",e)}}),this.channel=e,this.channel._request=this,this._verificationMethods=t,this._client=n,this._commonMethods=[],this._setPhase(m,!1),this._eventsByUs=new Map,this._eventsByThem=new Map,this._observeOnly=!1,this._timeoutTimer=null,this._accepting=!1,this._declining=!1,this._verifierHasFinished=!1,this._cancelled=!1,this._chosenMethod=null,this._qrCodeData=null,this._requestReceivedAt=null}static validateEvent(e,t,n){const o=t.getContent();return!(!e||!e.startsWith(l))&&(o?e!==d&&e!==p||Array.isArray(o.methods)?e!==d&&e!==p&&e!==u||"string"==typeof o.from_device&&0!==o.from_device.length||(i.a.log("VerificationRequest: validateEvent: fail because from_device"),!1):(i.a.log("VerificationRequest: validateEvent: fail because methods"),!1):(i.a.log("VerificationRequest: validateEvent: no content"),!1))}get invalid(){return this.phase===m}get requested(){return this.phase===g}get cancelled(){return this.phase===b}get ready(){return this.phase===f}get started(){return this.phase===_}get done(){return this.phase===v}get methods(){return this._commonMethods}get chosenMethod(){return this._chosenMethod}calculateEventTimeout(e){let t=this.channel.getTimestamp(e)+6e5;if(this._requestReceivedAt&&!this.initiatedByMe&&this.phase<=g){const e=this._requestReceivedAt+12e4;t=Math.min(t,e)}return Math.max(0,t-Date.now())}get timeout(){const e=this._getEventByEither(d);return e?this.calculateEventTimeout(e):0}get requestEvent(){return this._getEventByEither(d)}get phase(){return this._phase}get verifier(){return this._verifier}get canAccept(){return this.phase{const o=()=>{let r=!1;return e(this)?(t(this),r=!0):this.cancelled&&(n(new Error("cancelled")),r=!0),r&&this.off("change",o),r};o()||this.on("change",o)})}_setPhase(e,t=!0){this._phase=e,t&&this.emit("change")}_getEventByEither(e){return this._eventsByThem.get(e)||this._eventsByUs.get(e)}_getEventBy(e,t){return t?this._eventsByThem.get(e):this._eventsByUs.get(e)}_calculatePhaseTransitions(){const e=[{phase:m}],t=()=>e[e.length-1].phase,n=this._eventsByThem.has(d),o=this._getEventBy(d,n);o&&e.push({phase:g,event:o});const r=o&&this._getEventBy(p,!n);let i;if(r&&t()===g&&e.push({phase:f,event:r}),r||!o){const e=this._eventsByThem.get(u),t=this._eventsByUs.get(u);i=e&&t?e.getSender()this._verificationMethods.has(e))}if(this.observeOnly||t!==g&&t!==_&&t!==f||this.channel.receiveStartFromOtherDevices&&this._wasSentByOwnUser(n)&&!this._wasSentByOwnDevice(n)&&(this._observeOnly=!0),t===_){const{method:e}=n.getContent();this._verifier||this.observeOnly||(this._verifier=this._createVerifier(e,n),this._verifier?this._chosenMethod=e:this.cancel({code:"m.unknown_method",reason:"Unknown method: "+e}))}}_applyPhaseTransitions(){const e=this._calculatePhaseTransitions(),t=e.findIndex(e=>e.phase===this.phase),n=e.slice(t+1);for(const e of n)this._transitionToPhase(e);return n}_isWinningStartRace(e){if(e.getType()!==u)return!1;const t=this._verifier.startEvent;let n,o;if(this.isSelfVerification)if(t){const e=t.getContent();n=e&&e.from_device}else n=this._client.getDeviceId();else n=t?t.getSender():this._client.getUserId();if(this.isSelfVerification){const t=e.getContent();o=t&&t.from_device}else o=e.getSender();return oe.phase===f)){this.otherPartySupportsMethod(c.c,!0)&&(this._qrCodeData=await c.a.create(this,this._client))}const e=l[l.length-1],{phase:t}=e;this._setupTimeout(t),this._setPhase(t)}else this._observeOnly!==a&&this.emit("change")}finally{i.a.log(`Verification request ${this.channel.transactionId}: ${e} event with id:${t.getId()}, content:${JSON.stringify(t.getContent())} deviceId:${this.channel.deviceId}, sender:${t.getSender()}, isSentByUs:${r}, isLiveEvent:${n}, isRemoteEcho:${o}, phase:${s}=>${this.phase}, observeOnly:${a}=>${this._observeOnly}`)}}_setupTimeout(e){if(!this._timeoutTimer&&!this.observeOnly&&e===g&&(this._timeoutTimer=setTimeout(this._cancelOnTimeout,this.timeout)),this._timeoutTimer){(e===_||e===f||e===v||e===b)&&(clearTimeout(this._timeoutTimer),this._timeoutTimer=null)}}async _cancelOnError(e,t){if(e===u){const e=t.getContent().method;if(!this._verificationMethods.has(e))return await this.cancel(Object(s.b)(Object(s.g)())),!0}const n=e===d&&this.phase!==m,o=e===p&&this.phase!==g;if(this.phase!==m&&(n||o)){i.a.warn(`Cancelling, unexpected ${e} verification event from `+t.getSender());const n=`Unexpected ${e} event in phase ${this.phase}`;return await this.cancel(Object(s.b)(Object(s.f)({reason:n}))),!0}return!1}_adjustObserveOnly(e,t){t||(this._observeOnly=!0),this.calculateEventTimeout(e)<3e3&&(this._observeOnly=!0)}_addEvent(e,t,n){if(n?this._eventsByUs.set(e,t):this._eventsByThem.set(e,t),e===d){for(const[e,t]of this._eventsByThem.entries())t.getSender()!==this.otherUserId&&this._eventsByThem.delete(e);this._requestReceivedAt=Date.now()}}_createVerifier(e,t=null,n=null){n||(n=this.targetDevice);const{userId:o,deviceId:r}=n,a=this._verificationMethods.get(e);if(a)return new a(this.channel,this._client,o,r,t,this);i.a.warn("could not find verifier constructor for method",e)}_wasSentByOwnUser(e){return e.getSender()===this._client.getUserId()}_wasSentByOwnDevice(e){if(!this._wasSentByOwnUser(e))return!1;const t=e.getContent();return!(!t||t.from_device!==this._client.getDeviceId())}onVerifierCancelled(){this._cancelled=!0;const e=this._applyPhaseTransitions();e.length&&this._setPhase(e[e.length-1].phase)}onVerifierFinished(){this.channel.send("m.key.verification.done",{}),this._verifierHasFinished=!0;const e=this._applyPhaseTransitions();e.length&&this._setPhase(e[e.length-1].phase)}getEventFromOtherParty(e){return this._eventsByThem.get(e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n(18),r=n.n(o),i=n(146),a=n(93),s=n(261),c=n(301),l=n(134),d=n(155),u=n(116),h=n(92);function p(e){var t;return`${null!==(t=e.roomId)&&void 0!==t?t:h.a.get().getUserId()}::${e.id}`}class m extends i.a{constructor(){super(a.a,{}),r()(this,"widgetMap",new Map),r()(this,"roomMap",new Map),r()(this,"onWidgetEchoStoreUpdate",(e,t)=>{this.initRoom(e),this.loadRoomWidgets(this.matrixClient.getRoom(e)),this.emit(u.b,e)}),r()(this,"onRoom",e=>{this.initRoom(e.roomId),this.loadRoomWidgets(e),this.emit(u.b,e.roomId)}),r()(this,"onRoomStateEvents",e=>{if("im.vector.modular.widgets"!==e.getType())return;const t=e.getRoomId();this.initRoom(t),this.loadRoomWidgets(this.matrixClient.getRoom(t)),this.emit(u.b,t)}),r()(this,"getRoom",(e,t=!1)=>(t&&this.initRoom(e),this.roomMap.get(e))),s.a.on("update",this.onWidgetEchoStoreUpdate)}static get instance(){return m.internalInstance}initRoom(e){this.roomMap.has(e)||this.roomMap.set(e,{widgets:[]})}async onReady(){this.matrixClient.on("Room",this.onRoom),this.matrixClient.on("RoomState.events",this.onRoomStateEvents),this.matrixClient.getRooms().forEach(e=>{this.loadRoomWidgets(e)}),this.emit(u.b,null)}async onNotReady(){this.matrixClient.off("Room",this.onRoom),this.matrixClient.off("RoomState.events",this.onRoomStateEvents),this.widgetMap=new Map,this.roomMap=new Map,await this.reset({})}async onAction(e){}generateApps(e){return s.a.getEchoedRoomWidgets(e.roomId,l.a.getRoomWidgets(e)).map(e=>l.a.makeAppConfig(e.getStateKey(),e.getContent(),e.getSender(),e.getRoomId(),e.getId()))}loadRoomWidgets(e){if(!e)return;const t=this.roomMap.get(e.roomId)||{};t.widgets=[],Array.from(this.widgetMap.values()).forEach(t=>{t.roomId===e.roomId&&this.widgetMap.delete(p(t))});let n=!1;this.generateApps(e).forEach(e=>{const o=this.widgetMap.get(p(e));o&&console.warn(`Possible widget ID conflict for ${e.id} - wants to store in room ${e.roomId} but is currently stored as ${o.roomId} - letting the want win`),this.widgetMap.set(p(e),e),t.widgets.push(e),n=!0}),n&&!this.roomMap.has(e.roomId)&&this.roomMap.set(e.roomId,t),this.emit(e.roomId)}getApps(e){const t=this.getRoom(e);return(null==t?void 0:t.widgets)||[]}doesRoomHaveConference(e){const t=this.getRoom(e.roomId);if(!t)return!1;const n=t.widgets.filter(e=>d.a.JITSI.matches(e.type)),o=s.a.roomHasPendingWidgetsOfType(e.roomId,[],d.a.JITSI);return n.length>0||o}isJoinedToConferenceIn(e){const t=this.getRoom(e.roomId);if(!t)return!1;return t.widgets.filter(e=>d.a.JITSI.matches(e.type)).some(e=>c.a.getWidgetPersistence(e.id))}}r()(m,"internalInstance",new m),window.mxWidgetStore=m.instance},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=function(e){for(var t=Array(e.length),n=0;n=a.a.Bold}get hasUnreadCount(){return this.color>=a.a.Grey&&(!!this.count||!!this.symbol)}get hasMentions(){return this.color>=a.a.Red}emitIfUpdated(e){e.isDifferentFrom(this)&&this.emit(s)}snapshot(){return new l(this)}destroy(){this.removeAllListeners(s)}}class l{constructor(e){r()(this,"symbol",void 0),r()(this,"count",void 0),r()(this,"color",void 0),this.symbol=e.symbol,this.count=e.count,this.color=e.color}isDifferentFrom(e){const t={count:this.count,symbol:this.symbol,color:this.color},n={count:e.count,symbol:e.symbol,color:e.color};return JSON.stringify(t)!==JSON.stringify(n)}}},function(e,t,n){"use strict";t.a={SHOW_ENCRYPTION_SETUP_UI:!0}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n(87),r=n.n(o),i=n(97),a=n.n(i),s=n(121),c=n(88),l=n(96),d=n(93),u=n(100);const h=({className:e,title:t,children:n})=>r.a.createElement("div",{className:a()("mx_BaseCard_Group",e)},r.a.createElement("h1",null,t),n);t.b=({closeLabel:e,onClose:t,className:n,header:o,footer:i,withoutScrollContainer:h,previousPhase:p,children:m,refireParams:g})=>{let f,_;if(p){const e=()=>{d.a.dispatch({action:u.a.SetRightPanelPhase,phase:p,refireParams:g})};f=r.a.createElement(l.a,{className:"mx_BaseCard_back",onClick:e,title:Object(c.a)("Back")})}return t&&(_=r.a.createElement(l.a,{className:"mx_BaseCard_close",onClick:t,title:e||Object(c.a)("Close")})),h||(m=r.a.createElement(s.a,null,m)),r.a.createElement("div",{className:a()("mx_BaseCard",n)},r.a.createElement("div",{className:"mx_BaseCard_header"},f,_,o),m,i&&r.a.createElement("div",{className:"mx_BaseCard_footer"},i))}},function(e,t){var n,o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return o[e]},t.getBCHDigit=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');n=e},t.isKanjiModeEnabled=function(){return void 0!==n},t.toSJIS=function(e){return n(e)}},function(e,t,n){var o=n(657),r=n(658);t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!o.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return r.testNumeric(e)?t.NUMERIC:r.testAlphanumeric(e)?t.ALPHANUMERIC:r.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}},function(e,t){e.exports="img/warning.05cc423.svg"},function(e,t,n){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(91),c=n.n(s),l=n(90),d=n(88),u=n(97),h=n.n(u);class p extends a.a.Component{constructor(...e){super(...e),r()(this,"onFinished",()=>{this.props.onFinished()})}render(){const e=l.getComponent("views.dialogs.BaseDialog"),t=l.getComponent("views.elements.DialogButtons");return a.a.createElement(e,{className:"mx_InfoDialog",onFinished:this.props.onFinished,title:this.props.title,contentId:"mx_Dialog_content",hasCancel:this.props.hasCloseButton,onKeyDown:this.props.onKeyDown,fixedWidth:this.props.fixedWidth},a.a.createElement("div",{className:h()("mx_Dialog_content",this.props.className),id:"mx_Dialog_content"},this.props.description),!1!==this.props.button&&a.a.createElement(t,{primaryButton:this.props.button||Object(d.a)("OK"),onPrimaryButtonClick:this.onFinished,hasCancel:!1}))}}r()(p,"propTypes",{className:c.a.string,title:c.a.string,description:c.a.node,button:c.a.oneOfType([c.a.string,c.a.bool]),onFinished:c.a.func,hasCloseButton:c.a.bool,onKeyDown:c.a.func,fixedWidth:c.a.bool}),r()(p,"defaultProps",{title:"",description:"",hasCloseButton:!1})},function(e,t,n){"use strict";n.d(t,"b",(function(){return R})),n.d(t,"c",(function(){return I})),n.d(t,"a",(function(){return D})),n.d(t,"d",(function(){return A}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(91),u=n.n(d),h=n(479),p=n(88),m=n(679),g=n(94),f=n(701),_=n(702),b=n(706),v=n(709),y=n(710),E=n(711),S=n(712),w=n(714),C=n(90),T=n(98),x=n(716),O=n(112),k=n(89);const R="USER_NOTIFICATIONS_TAB",I="USER_SECURITY_TAB",D="USER_LABS_TAB";let A=Object(k.a)("views.dialogs.UserSettingsDialog")((i=r=class extends l.a.Component{constructor(){super(),this.state={mjolnirEnabled:g.b.getValue("feature_mjolnir")}}componentDidMount(){this._mjolnirWatcher=g.b.watchSetting("feature_mjolnir",null,this._mjolnirChanged.bind(this))}componentWillUnmount(){g.b.unwatchSetting(this._mjolnirWatcher)}_mjolnirChanged(e,t,n,o){this.setState({mjolnirEnabled:o})}_getTabs(){const e=[];return e.push(new h.a("USER_GENERAL_TAB",Object(p.b)("General"),"mx_UserSettingsDialog_settingsIcon",l.a.createElement(m.a,{closeSettingsFn:this.props.onFinished}))),e.push(new h.a("USER_APPEARANCE_TAB",Object(p.b)("Appearance"),"mx_UserSettingsDialog_appearanceIcon",l.a.createElement(_.a,null))),g.b.getValue(O.a.Flair)&&e.push(new h.a("USER_FLAIR_TAB",Object(p.b)("Flair"),"mx_UserSettingsDialog_flairIcon",l.a.createElement(w.a,null))),e.push(new h.a(R,Object(p.b)("Notifications"),"mx_UserSettingsDialog_bellIcon",l.a.createElement(v.a,null))),e.push(new h.a("USER_PREFERENCES_TAB",Object(p.b)("Preferences"),"mx_UserSettingsDialog_preferencesIcon",l.a.createElement(y.a,null))),g.b.getValue(O.a.Voip)&&e.push(new h.a("USER_VOICE_TAB",Object(p.b)("Voice & Video"),"mx_UserSettingsDialog_voiceIcon",l.a.createElement(E.a,null))),e.push(new h.a(I,Object(p.b)("Security & Privacy"),"mx_UserSettingsDialog_securityIcon",l.a.createElement(b.a,{closeSettingsFn:this.props.onFinished}))),(T.a.get().showLabsSettings||g.b.getFeatureSettingNames().some(e=>g.b.getBetaInfo(e)))&&e.push(new h.a(D,Object(p.b)("Labs"),"mx_UserSettingsDialog_labsIcon",l.a.createElement(f.a,null))),this.state.mjolnirEnabled&&e.push(new h.a("USER_MJOLNIR_TAB",Object(p.b)("Ignored users"),"mx_UserSettingsDialog_mjolnirIcon",l.a.createElement(x.a,null))),e.push(new h.a("USER_HELP_TAB",Object(p.b)("Help & About"),"mx_UserSettingsDialog_helpIcon",l.a.createElement(S.a,{closeSettingsFn:this.props.onFinished}))),e}render(){const e=C.getComponent("views.dialogs.BaseDialog");return l.a.createElement(e,{className:"mx_UserSettingsDialog",hasCancel:!0,onFinished:this.props.onFinished,title:Object(p.a)("Settings")},l.a.createElement("div",{className:"mx_SettingsDialog_content"},l.a.createElement(h.b,{tabs:this._getTabs(),initialTabId:this.props.initialTabId})))}},s()(r,"propTypes",{onFinished:u.a.func.isRequired,initialTabId:u.a.string}),o=i))||o},function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var o=n(18),r=n.n(o),i=n(8),a=n(374),s=n(159),c=n(278),l=n(1),d=n(108),u=n(167);function h(e,t){this.roomId=e,this.info=t}var p=n(0),m=n(437),g=n(110);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function _(e){for(var t=1;t{const t=new d.b(e);"m.room.encrypted"===t.getType()&&await t.attemptDecryption(this._client._crypto),t.setStatus(d.a.NOT_SENT),this.addPendingEvent(t,t.getTxnId())})}this._blacklistUnverifiedDevices=null,this._selfMembership=null,this._summaryHeroes=null,this._opts.lazyLoadMembers?this._membersPromise=null:this._membersPromise=Promise.resolve(),this.getTypeWarning=!1,this.getVersionWarning=!1}function E(e){return"mx_pending_events_"+e}l.m(y,i.EventEmitter),y.prototype.decryptCriticalEvents=function(){const e=this.getEventReadUpTo(this._client.getUserId(),!0),t=this.getLiveTimeline().getEvents(),n=t.findIndex(t=>t.event.event_id===e),o=t.slice(n).filter(e=>e.shouldAttemptDecryption()).reverse().map(e=>e.attemptDecryption(this._client._crypto,{isRetry:!0}));return Promise.allSettled(o)},y.prototype.decryptAllEvents=function(){const e=this.getUnfilteredTimelineSet().getLiveTimeline().getEvents().filter(e=>e.shouldAttemptDecryption()).reverse().map(e=>e.attemptDecryption(this._client._crypto,{isRetry:!0}));return Promise.allSettled(e)},y.prototype.getVersion=function(){const e=this.currentState.getStateEvents("m.room.create","");if(!e)return this.getVersionWarning||(p.a.warn("[getVersion] Room "+this.roomId+" does not have an m.room.create event"),this.getVersionWarning=!0),"1";const t=e.getContent().room_version;return void 0===t?"1":t},y.prototype.shouldUpgradeToVersion=function(){return b.includes(this.getVersion())?null:"6"},y.prototype.getRecommendedVersion=async function(){let e=(await this._client.getCapabilities())["m.room_versions"];if(!e){e={default:"6",available:{}};for(const t of b)e.available[t]="stable"}let t=this._checkVersionAgainstCapability(e);if(t.urgent&&t.needsUpgrade){p.a.warn("Refreshing room version capability because the server looks to be supporting a newer room version we don't know about.");if(e=(await this._client.getCapabilities(!0))["m.room_versions"],!e)return p.a.warn("No room version capability - assuming upgrade required."),t;t=this._checkVersionAgainstCapability(e)}return t},y.prototype._checkVersionAgainstCapability=function(e){const t=this.getVersion();p.a.log(`[${this.roomId}] Current version: ${t}`),p.a.log(`[${this.roomId}] Version capability: `,e);const n={version:t,needsUpgrade:!1,urgent:!1};if(t===e.default)return n;return Object.keys(e.available).filter(t=>"stable"===e.available[t]).includes(t)||(n.version=e.default,n.needsUpgrade=!0,n.urgent=!!this.getVersion().match(/^[0-9]+[0-9.]*$/g),n.urgent?p.a.warn("URGENT upgrade required on "+this.roomId):p.a.warn("Non-urgent upgrade required on "+this.roomId)),n},y.prototype.userMayUpgradeRoom=function(e){return this.currentState.maySendStateEvent("m.room.tombstone",e)},y.prototype.getPendingEvents=function(){if("detached"!==this._opts.pendingEventOrdering)throw new Error("Cannot call getPendingEvents with pendingEventOrdering == "+this._opts.pendingEventOrdering);return this._pendingEventList},y.prototype.removePendingEvent=function(e){if("detached"!==this._opts.pendingEventOrdering)throw new Error("Cannot call removePendingEvent with pendingEventOrdering == "+this._opts.pendingEventOrdering);const t=l.u(this._pendingEventList,(function(t){return t.getId()==e}),!1);return this._savePendingEvents(),t},y.prototype.hasPendingEvent=function(e){return"detached"===this._opts.pendingEventOrdering&&this._pendingEventList.some(t=>t.getId()===e)},y.prototype.getPendingEvent=function(e){return"detached"!==this._opts.pendingEventOrdering?null:this._pendingEventList.find(t=>t.getId()===e)},y.prototype.getLiveTimeline=function(){return this.getUnfilteredTimelineSet().getLiveTimeline()},y.prototype.getLastActiveTimestamp=function(){const e=this.getLiveTimeline().getEvents();if(e.length){return e[e.length-1].getTs()}return Number.MIN_SAFE_INTEGER},y.prototype.getMyMembership=function(){return this._selfMembership},y.prototype.getDMInviter=function(){if(this.myUserId){const e=this.getMember(this.myUserId);if(e)return e.getDMInviter()}if("invite"===this._selfMembership){if(2==this.getInvitedAndJoinedMemberCount()&&this._summaryHeroes.length)return this._summaryHeroes[0]}},y.prototype.guessDMUserId=function(){const e=this.getMember(this.myUserId);if(e){const t=e.getDMInviter();if(t)return t}if(Array.isArray(this._summaryHeroes)&&this._summaryHeroes.length)return this._summaryHeroes[0];const t=this.currentState.getMembers().find(e=>e.userId!==this.myUserId);return t?t.userId:this.myUserId},y.prototype.getAvatarFallbackMember=function(){if(this.getInvitedAndJoinedMemberCount()>2)return;const e=Array.isArray(this._summaryHeroes)&&this._summaryHeroes.length;if(e){const e=this._summaryHeroes.map(e=>this.getMember(e)).find(e=>!!e);if(e)return e}const t=this.currentState.getMembers();if(t.length<=2){const e=t.find(e=>e.userId!==this.myUserId);if(e)return e}if(e){const e=this._summaryHeroes.map(e=>this._client.getUser(e)).find(e=>!!e);if(e){const t=new u.a(this.roomId,e.userId);return t.user=e,t}}},y.prototype.updateMyMembership=function(e){const t=this._selfMembership;this._selfMembership=e,t!==e&&("leave"===e&&this._cleanupAfterLeaving(),this.emit("Room.myMembership",this,e,t))},y.prototype._loadMembersFromServer=async function(){const e=this._client.store.getSyncToken(),t=l.f({not_membership:"leave",at:e}),n=l.g("/rooms/$roomId/members?"+t,{$roomId:this.roomId}),o=this._client._http;return(await o.authedRequest(void 0,"GET",n)).chunk},y.prototype._loadMembers=async function(){let e=!1,t=await this._client.store.getOutOfBandMembers(this.roomId);null===t&&(e=!0,t=await this._loadMembersFromServer(),p.a.log(`LL: got ${t.length} members from server for room `+this.roomId));return{memberEvents:t.map(this._client.getEventMapper()),fromServer:e}},y.prototype.loadMembersIfNeeded=function(){if(this._membersPromise)return this._membersPromise;this.currentState.markOutOfBandMembersStarted();const e=this._loadMembers().then(e=>(this.currentState.setOutOfBandMembers(e.memberEvents),this._client.isCryptoEnabled()&&this._client.isRoomEncrypted(this.roomId)&&this._client._crypto.trackRoomDevices(this.roomId),e.fromServer)).catch(e=>{throw this._membersPromise=null,this.currentState.markOutOfBandMembersFailed(),e});return e.then(e=>{if(e){const e=this.currentState.getMembers().filter(e=>e.isOutOfBand()).map(e=>e.events.member.event);p.a.log("LL: telling store to write "+e.length+" members for room "+this.roomId);return this._client.store.setOutOfBandMembers(this.roomId,e).catch(e=>{p.a.log("LL: storing OOB room members failed, oh well",e)})}}).catch(e=>{p.a.error(e)}),this._membersPromise=e,this._membersPromise},y.prototype.clearLoadedMembersIfNeeded=async function(){this._opts.lazyLoadMembers&&this._membersPromise&&(await this.loadMembersIfNeeded(),await this._client.store.clearOutOfBandMembers(this.roomId),this.currentState.clearOutOfBandMembers(),this._membersPromise=null)},y.prototype._cleanupAfterLeaving=function(){this.clearLoadedMembersIfNeeded().catch(e=>{p.a.error(`error after clearing loaded members from room ${this.roomId} after leaving`),p.a.log(e)})},y.prototype.resetLiveTimeline=function(e,t){for(let n=0;ne.isUnverified()))return!0}return!1},y.prototype.getTimelineSets=function(){return this._timelineSets},y.prototype.getUnfilteredTimelineSet=function(){return this._timelineSets[0]},y.prototype.getTimelineForEvent=function(e){return this.getUnfilteredTimelineSet().getTimelineForEvent(e)},y.prototype.addTimeline=function(){return this.getUnfilteredTimelineSet().addTimeline()},y.prototype.findEventById=function(e){return this.getUnfilteredTimelineSet().findEventById(e)},y.prototype.getUnreadNotificationCount=function(e){return e=e||"total",this._notificationCounts[e]},y.prototype.setUnreadNotificationCount=function(e,t){this._notificationCounts[e]=t},y.prototype.setSummary=function(e){const t=e["m.heroes"],n=e["m.joined_member_count"],o=e["m.invited_member_count"];Number.isInteger(n)&&this.currentState.setJoinedMemberCount(n),Number.isInteger(o)&&this.currentState.setInvitedMemberCount(o),Array.isArray(t)&&(this._summaryHeroes=t.filter(e=>e!==this.myUserId))},y.prototype.setBlacklistUnverifiedDevices=function(e){this._blacklistUnverifiedDevices=e},y.prototype.getBlacklistUnverifiedDevices=function(){return this._blacklistUnverifiedDevices},y.prototype.getAvatarUrl=function(e,t,n,o,r){const i=this.currentState.getStateEvents(g.a.RoomAvatar,"");if(void 0===r&&(r=!0),!i&&!r)return null;const a=i?i.getContent().url:null;return a?Object(c.a)(e,a,t,n,o):null},y.prototype.getMxcAvatarUrl=function(){const e=this.currentState.getStateEvents(g.a.RoomAvatar,"");return e?e.getContent().url:null},y.prototype.getAliases=function(){const e=[],t=this.currentState.getStateEvents("m.room.aliases");if(t)for(let n=0;n"string"==typeof e&&("#"===e[0]&&!!e.endsWith(":"+o.getStateKey())));Array.prototype.push.apply(e,t)}}return e},y.prototype.getCanonicalAlias=function(){const e=this.currentState.getStateEvents("m.room.canonical_alias","");return e&&e.getContent().alias||null},y.prototype.getAltAliases=function(){const e=this.currentState.getStateEvents("m.room.canonical_alias","");return e&&e.getContent().alt_aliases||[]},y.prototype.addEventsToTimeline=function(e,t,n,o){n.getTimelineSet().addEventsToTimeline(e,t,n,o)},y.prototype.getMember=function(e){return this.currentState.getMember(e)},y.prototype.getMembers=function(){return this.currentState.getMembers()},y.prototype.getJoinedMembers=function(){return this.getMembersWithMembership("join")},y.prototype.getJoinedMemberCount=function(){return this.currentState.getJoinedMemberCount()},y.prototype.getInvitedMemberCount=function(){return this.currentState.getInvitedMemberCount()},y.prototype.getInvitedAndJoinedMemberCount=function(){return this.getInvitedMemberCount()+this.getJoinedMemberCount()},y.prototype.getMembersWithMembership=function(e){return this.currentState.getMembers().filter((function(t){return t.membership===e}))},y.prototype.getEncryptionTargetMembers=async function(){await this.loadMembersIfNeeded();let e=this.getMembersWithMembership("join");return this.shouldEncryptForInvitedMembers()&&(e=e.concat(this.getMembersWithMembership("invite"))),e},y.prototype.shouldEncryptForInvitedMembers=function(){const e=this.currentState.getStateEvents("m.room.history_visibility","");return e&&e.getContent()&&"joined"!==e.getContent().history_visibility},y.prototype.getDefaultRoomName=function(e){return w(this,e,!0)},y.prototype.hasMembershipState=function(e,t){const n=this.getMember(e);return!!n&&n.membership===t},y.prototype.getOrCreateFilteredTimelineSet=function(e){if(this._filteredTimelineSets[e.filterId])return this._filteredTimelineSets[e.filterId];const t=Object.assign({filter:e},this._opts),n=new a.a(this,t);this.reEmitter.reEmit(n,["Room.timeline","Room.timelineReset"]),this._filteredTimelineSets[e.filterId]=n,this._timelineSets.push(n);const o=this.getLiveTimeline();o.getEvents().forEach((function(e){n.addLiveEvent(e)}));let r=o;for(;r.getNeighbouringTimeline(s.a.BACKWARDS);)r=r.getNeighbouringTimeline(s.a.BACKWARDS);return n.getLiveTimeline().setPaginationToken(r.getPaginationToken(s.a.BACKWARDS),s.a.BACKWARDS),n},y.prototype.removeFilteredTimelineSet=function(e){const t=this._filteredTimelineSets[e.filterId];delete this._filteredTimelineSets[e.filterId];const n=this._timelineSets.indexOf(t);n>-1&&this._timelineSets.splice(n,1)},y.prototype._addLiveEvent=function(e,t,n){if(e.isRedaction()){const t=e.event.redacts,n=this.getUnfilteredTimelineSet().findEventById(t);if(n){if(n.makeRedacted(e),n.getStateKey()){this.currentState.getStateEvents(n.getType(),n.getStateKey()).getId()===n.getId()&&this.currentState.setStateEvents([n])}this.emit("Room.redaction",e,this)}}if(e.getUnsigned().transaction_id){const t=this._txnToEvent[e.getUnsigned().transaction_id];if(t)return void this._handleRemoteEcho(e,t)}for(let o=0;oe.status===d.a.NOT_SENT)&&(p.a.warn("Setting event as NOT_SENT due to messages in the same state"),e.setStatus(d.a.NOT_SENT)),this._pendingEventList.push(e),this._savePendingEvents(),e.isRelation()&&this._aggregateNonLiveRelation(e),e.isRedaction()){const t=e.event.redacts;let n=this._pendingEventList&&this._pendingEventList.find(e=>e.getId()===t);n||(n=this.getUnfilteredTimelineSet().findEventById(t)),n&&(n.markLocallyRedacted(e),this.emit("Room.redaction",e,this))}}else for(let t=0;t_(_({},e.event),{},{txn_id:e.getTxnId()})).filter(e=>{const t="m.room.encrypted"===e.type,n=this._client.isRoomEncrypted(this.roomId);return t||!n}),{store:t}=this._client._sessionStore;this._pendingEventList.length>0?t.setItem(E(this.roomId),JSON.stringify(e)):t.removeItem(E(this.roomId))}},y.prototype._aggregateNonLiveRelation=function(e){for(let t=0;t ${o} old status `+r),delete this._txnToEvent[e.getUnsigned().transaction_id],this._pendingEventList&&this.removePendingEvent(n),t.handleRemoteEcho(e.event);for(let e=0;e{const n=e.getMember(t);return n?n.name:t});else{let n=e.currentState.getMembers().filter(e=>e.userId!==t&&("invite"===e.membership||"join"===e.membership));n.sort((e,t)=>e.userId.localeCompare(t.userId)),n=n.slice(0,5),i=n.map(e=>e.name)}if(r)return C(i,r);if("join"==e.getMyMembership()){const t=e.currentState.getStateEvents("m.room.third_party_invite");if(t&&t.length){return"Inviting "+C(t.map(e=>e.getContent().display_name))}}let a=i;return a.length||(a=e.currentState.getMembers().filter(e=>e.userId!==t&&"invite"!==e.membership&&"join"!==e.membership).map(e=>e.name)),a.length?`Empty room (was ${C(a)})`:"Empty room"}function C(e,t=e.length+1){const n=t-1;if(e.length){if(1===e.length&&n<=1)return e[0];if(2===e.length&&n<=2)return`${e[0]} and ${e[1]}`;return n>1?`${e[0]} and ${n} others`:e[0]+" and 1 other"}return"Empty room"}S[d.a.ENCRYPTING]=[d.a.SENDING,d.a.NOT_SENT],S[d.a.SENDING]=[d.a.ENCRYPTING,d.a.QUEUED,d.a.NOT_SENT,d.a.SENT],S[d.a.QUEUED]=[d.a.SENDING,d.a.CANCELLED],S[d.a.SENT]=[],S[d.a.NOT_SENT]=[d.a.SENDING,d.a.QUEUED,d.a.CANCELLED],S[d.a.CANCELLED]=[],y.prototype.updatePendingEvent=function(e,t,n){if(p.a.log(`setting pendingEvent status to ${t} in ${e.getRoomId()} event ID ${e.getId()} -> ${n}`),t==d.a.SENT&&!n)throw new Error("updatePendingEvent called with status=SENT, but no new event id");if(t==d.a.SENT){if(this.getUnfilteredTimelineSet().eventIdToTimeline(n))return}const o=e.status,r=e.getId();if(!o)throw new Error("updatePendingEventStatus called on an event which is not a local echo.");const i=S[o];if(!i||i.indexOf(t)<0)throw new Error("Invalid EventStatus transition "+o+"->"+t);if(e.setStatus(t),t==d.a.SENT){e.replaceLocalEventId(n);for(let e=0;ee.getId()===r);if(-1!==e){const[t]=this._pendingEventList.splice(e,1);t.isRedaction()&&this._revertRedactionLocalEcho(t)}}this.removeEvent(r)}this._savePendingEvents(),this.emit("Room.localEchoUpdated",e,this,r,o)},y.prototype._revertRedactionLocalEcho=function(e){const t=e.event.redacts;if(!t)return;const n=this.getUnfilteredTimelineSet().findEventById(t);n&&(n.unmarkLocallyRedacted(),this.emit("Room.redactionCancelled",e,this),n.isRelation()&&this._aggregateNonLiveRelation(n))},y.prototype.addLiveEvents=function(e,t,n){let o;if(t&&-1===["replace","ignore"].indexOf(t))throw new Error("duplicateStrategy MUST be either 'replace' or 'ignore'");for(o=0;o=0;--e){const o=this.timeline[e];if(o.getId()===t)return!1;if(o.getId()===n)return!0}return!1},y.prototype.getReceiptsForEvent=function(e){return this._receiptCacheByEventId[e.getId()]||[]},y.prototype.addReceipt=function(e,t){void 0===t&&(t=!1),t||this._addReceiptsToStructure(e,this._realReceipts),this._addReceiptsToStructure(e,this._receipts),this._receiptCacheByEventId=this._buildReceiptCache(this._receipts),this.emit("Room.receipt",e,this)},y.prototype._addReceiptsToStructure=function(e,t){const n=this;Object.keys(e.getContent()).forEach((function(o){Object.keys(e.getContent()[o]).forEach((function(r){Object.keys(e.getContent()[o][r]).forEach((function(i){const a=e.getContent()[o][r][i];t[r]||(t[r]={});const s=t[r][i];if(s){const e=n.getUnfilteredTimelineSet().compareEventOrdering(s.eventId,o);if(null!==e&&e>=0)return}else t[r][i]={};t[r][i]={eventId:o,data:a}}))}))}))},y.prototype._buildReceiptCache=function(e){const t={};return Object.keys(e).forEach((function(n){Object.keys(e[n]).forEach((function(o){const r=e[n][o];t[r.eventId]||(t[r.eventId]=[]),t[r.eventId].push({userId:o,type:n,data:r.data})}))})),t},y.prototype._addLocalEchoReceipt=function(e,t,n){this.addReceipt(v(e,t,n),!0)},y.prototype.addTags=function(e){this.tags=e.getContent().tags||{},this.emit("Room.tags",e,this)},y.prototype.addAccountData=function(e){for(let t=0;tr.powerLevel&&(t=!1),t},y.prototype.getJoinRule=function(){return this.currentState.getJoinRule()},y.prototype.getType=function(){const e=this.currentState.getStateEvents("m.room.create","");if(e)return e.getContent()[g.c];this.getTypeWarning||(p.a.warn("[getType] Room "+this.roomId+" does not have an m.room.create event"),this.getTypeWarning=!0)},y.prototype.isSpaceRoom=function(){return this.getType()===g.d.Space}},function(e,t,n){"use strict";var o=n(18),r=n.n(o),i=n(113),a=n(92),s=n(167),c=n(159),l=n(140),d=n(94),u=n(8),h=n(102);class p extends u.EventEmitter{constructor(){super(),r()(this,"onSync",async(e,t,n)=>{const o=i.a.get().getEventIndexingManager();if("PREPARED"===t&&"SYNCING"===e){return await o.isEventIndexEmpty()&&await this.addInitialCheckpoints(),void this.startCrawler()}"SYNCING"!==t||"SYNCING"!==e||await o.commitLiveEvents()}),r()(this,"onRoomTimeline",async(e,t,n,o,r)=>{const i=a.a.get();i.isRoomEncrypted(t.roomId)&&!n&&r&&r.liveEvent&&!e.isRedacted()&&(await i.decryptEventIfNeeded(e),await this.addLiveEventToIndex(e))}),r()(this,"onRoomStateEvent",async(e,t)=>{a.a.get().isRoomEncrypted(t.roomId)&&("m.room.encryption"!==e.getType()||await this.isRoomIndexed(t.roomId)||(console.log("EventIndex: Adding a checkpoint for a newly encrypted room",t.roomId),this.addRoomCheckpoint(t.roomId,!0)))}),r()(this,"onEventDecrypted",async(e,t)=>{t||await this.addLiveEventToIndex(e)}),r()(this,"onRedaction",async(e,t)=>{if(!a.a.get().isRoomEncrypted(t.roomId))return;const n=i.a.get().getEventIndexingManager();try{await n.deleteEvent(e.getAssociatedId())}catch(e){console.log("EventIndex: Error deleting event from index",e)}}),r()(this,"onTimelineReset",async(e,t,n)=>{null!==e&&a.a.get().isRoomEncrypted(e.roomId)&&(console.log("EventIndex: Adding a checkpoint because of a limited timeline",e.roomId),this.addRoomCheckpoint(e.roomId,!1))}),this.crawlerCheckpoints=[],this._crawlerIdleTime=5e3,this._eventsPerCrawl=100,this._crawler=null,this._currentCheckpoint=null}async init(){const e=i.a.get().getEventIndexingManager();this.crawlerCheckpoints=await e.loadCheckpoints(),console.log("EventIndex: Loaded checkpoints",this.crawlerCheckpoints),this.registerListeners()}registerListeners(){const e=a.a.get();e.on("sync",this.onSync),e.on("Room.timeline",this.onRoomTimeline),e.on("Event.decrypted",this.onEventDecrypted),e.on("Room.timelineReset",this.onTimelineReset),e.on("Room.redaction",this.onRedaction),e.on("RoomState.events",this.onRoomStateEvent)}removeListeners(){const e=a.a.get();null!==e&&(e.removeListener("sync",this.onSync),e.removeListener("Room.timeline",this.onRoomTimeline),e.removeListener("Event.decrypted",this.onEventDecrypted),e.removeListener("Room.timelineReset",this.onTimelineReset),e.removeListener("Room.redaction",this.onRedaction),e.removeListener("RoomState.events",this.onRoomStateEvent))}async addInitialCheckpoints(){const e=i.a.get().getEventIndexingManager(),t=a.a.get(),n=t.getRooms().filter(e=>t.isRoomEncrypted(e.roomId));console.log("EventIndex: Adding initial crawler checkpoints"),await Promise.all(n.map(async t=>{const n=t.getLiveTimeline().getPaginationToken("b"),o={roomId:t.roomId,token:n,direction:"b",fullCrawl:!0},r={roomId:t.roomId,token:n,direction:"f"};try{o.token&&(await e.addCrawlerCheckpoint(o),this.crawlerCheckpoints.push(o)),r.token&&(await e.addCrawlerCheckpoint(r),this.crawlerCheckpoints.push(r))}catch(e){console.log("EventIndex: Error adding initial checkpoints for room",t.roomId,o,r,e)}}))}isValidEvent(e){const t=["m.room.message","m.room.name","m.room.topic"].includes(e.getType())&&!e.isRedacted()&&!e.isDecryptionFailure();let n=!0,o=!0;if("m.room.message"!==e.getType()||e.isRedacted())"m.room.topic"!==e.getType()||e.isRedacted()?"m.room.name"!==e.getType()||e.isRedacted()||e.getContent().name||(o=!1):e.getContent().topic||(o=!1);else{const t=e.getContent().msgtype;n=!!t&&!t.startsWith("m.key.verification"),e.getContent().body||(o=!1)}return t&&n&&o}eventToJson(e){const t=e.toJSON(),n=e.isEncrypted()?t.decrypted:t;return e.isEncrypted()?(n.curve25519Key=e.getSenderKey(),n.ed25519Key=e.getClaimedEd25519Key(),n.algorithm=e.getWireContent().algorithm,n.forwardingCurve25519KeyChain=e.getForwardingCurve25519KeyChain()):(delete n.curve25519Key,delete n.ed25519Key,delete n.algorithm,delete n.forwardingCurve25519KeyChain),n}async addLiveEventToIndex(e){const t=i.a.get().getEventIndexingManager();if(!this.isValidEvent(e))return;const n=this.eventToJson(e),o={displayname:e.sender.rawDisplayName,avatar_url:e.sender.getMxcAvatarUrl()};await t.addEventToIndex(n,o)}emitNewCheckpoint(){this.emit("changedCheckpoint",this.currentRoom())}async addEventsFromLiveTimeline(e){const t=e.getEvents();for(let e=0;e{e=!0};let o=!1;for(;!e;){let r=d.b.getValueAt(h.a.DEVICE,"crawlerSleepTime");if(r=Math.max(r,100),o&&(r=this._crawlerIdleTime),null!==this._currentCheckpoint&&(this._currentCheckpoint=null,this.emitNewCheckpoint()),await Object(l.c)(r),e)break;const i=this.crawlerCheckpoints.shift();if(void 0===i){o=!0;continue}this._currentCheckpoint=i,this.emitNewCheckpoint(),o=!1;const a=t.getEventMapper({preventReEmit:!0});let s;try{s=await t._createMessagesRequest(i.roomId,i.token,this._eventsPerCrawl,i.direction)}catch(e){if(403===e.httpStatus){console.log("EventIndex: Removing checkpoint as we don't have ","permissions to fetch messages from this room.",i);try{await n.removeCrawlerCheckpoint(i)}catch(e){console.log("EventIndex: Error removing checkpoint",i,e)}continue}console.log("EventIndex: Error crawling using checkpoint:",i,",",e),this.crawlerCheckpoints.push(i);continue}if(e){this.crawlerCheckpoints.push(i);break}if(0===s.chunk.length){console.log("EventIndex: Done with the checkpoint",i);try{await n.removeCrawlerCheckpoint(i)}catch(e){console.log("EventIndex: Error removing checkpoint",i,e)}continue}const c=s.chunk.map(a);let u=[];void 0!==s.state&&(u=s.state.map(a));const p={};u.forEach(e=>{e.event.content&&"join"===e.event.content.membership&&(p[e.event.sender]={displayname:e.event.content.displayname,avatar_url:e.event.content.avatar_url})});const m=c.filter(e=>e.isEncrypted()).map(e=>t.decryptEventIfNeeded(e,{isRetry:!0,emit:!1}));await Promise.all(m);const g=c.filter(this.isValidEvent),f=c.filter(e=>"m.room.redaction"===e.getType()),_=g.map(e=>{const t=this.eventToJson(e);let n={};t.sender in p&&(n=p[t.sender]);return{event:t,profile:n}});let b;s.end&&(b={roomId:i.roomId,token:s.end,fullCrawl:i.fullCrawl,direction:i.direction});try{for(let e=0;e{const n=h(t.event),o=new s.a(e.roomId,n.getSender());o.name=t.profile.displayname+" ("+n.getSender()+")";const r=h({content:{membership:"join",avatar_url:t.profile.avatar_url,displayname:t.profile.displayname},type:"m.room.member",event_id:n.getId()+":eventIndex",room_id:n.getRoomId(),sender:n.getSender(),origin_server_ts:n.getTs(),state_key:n.getSender()});return o.events.member=r,n.sender=o,n})}async populateFileTimeline(e,t,n,o=10,r=null,i=c.a.BACKWARDS){const a=await this.loadFileEvents(n,o,r,i);null===r&&(a.reverse(),i=i==c.a.BACKWARDS?c.a.FORWARDS:c.a.BACKWARDS),a.forEach(n=>{e.eventIdToTimeline(n.getId())||e.addEventToTimeline(n,t,i==c.a.BACKWARDS)});let s=!1,l="";return a.length>0&&(l=a[a.length-1].getId(),s=!0),console.log("EventIndex: Populating file panel with",a.length,"events and setting the pagination token to",l),t.setPaginationToken(l,c.a.BACKWARDS),s}paginateTimelineWindow(e,t,n,o){const r=t.getTimelineIndex(n);if(!r)return Promise.resolve(!1);if(r.pendingPaginate)return r.pendingPaginate;if(t.extend(n,o))return Promise.resolve(!0);const i=(async(e,t,n,o,r)=>{const i=e._timelineSet,a=t.timeline.getPaginationToken(o),s=await this.populateFileTimeline(i,t.timeline,n,r,a,o);return t.pendingPaginate=null,e.extend(o,r),s})(t,r,e,n,o);return r.pendingPaginate=i,i}async getStats(){return i.a.get().getEventIndexingManager().getStats()}async isRoomIndexed(e){return i.a.get().getEventIndexingManager().isRoomIndexed(e)}currentRoom(){if(null===this._currentCheckpoint&&0===this.crawlerCheckpoints.length)return null;const e=a.a.get();return null!==this._currentCheckpoint?e.getRoom(this._currentCheckpoint.roomId):e.getRoom(this.crawlerCheckpoints[0].roomId)}crawlingRooms(){const e=new Set,t=new Set;this.crawlerCheckpoints.forEach((e,n)=>{t.add(e.roomId)}),null!==this._currentCheckpoint&&t.add(this._currentCheckpoint.roomId);const n=a.a.get();return n.getRooms().filter(e=>n.isRoomEncrypted(e.roomId)).forEach((t,n)=>{e.add(t.roomId)}),{crawlingRooms:t,totalRooms:e}}}class m{constructor(){r()(this,"index",null),r()(this,"error",null),r()(this,"_supportIsInstalled",!1)}async init(){const e=i.a.get().getEventIndexingManager();return e?(this._supportIsInstalled=await e.supportsEventIndexing(),this.supportIsInstalled()?d.b.getValueAt(h.a.DEVICE,"enableEventIndexing")?this.initEventIndex():(console.log("EventIndex: Event indexing is disabled, not initializing"),!1):(console.log("EventIndex: Event indexing isn't installed for the platform, not initializing."),!1)):(console.log("EventIndex: Platform doesn't support event indexing, not initializing."),!1)}async initEventIndex(){const e=new p,t=i.a.get().getEventIndexingManager(),n=a.a.get(),o=n.getUserId(),r=n.getDeviceId();try{await t.initEventIndex(o,r);const n=await t.getUserVersion(),i=await t.isEventIndexEmpty();i?await t.setUserVersion(1):0!==n||i||(await t.closeEventIndex(),await this.deleteEventIndex(),await t.initEventIndex(o,r),await t.setUserVersion(1)),console.log("EventIndex: Successfully initialized the event index"),await e.init()}catch(e){return console.log("EventIndex: Error initializing the event index",e),this.error=e,!1}return this.index=e,!0}platformHasSupport(){return null!==i.a.get().getEventIndexingManager()}supportIsInstalled(){return this._supportIsInstalled}get(){return this.index}start(){null!==this.index&&this.index.startCrawler()}stop(){null!==this.index&&this.index.stopCrawler()}async unset(){null!==this.index&&(await this.index.close(),this.index=null)}async deleteEventIndex(){const e=i.a.get().getEventIndexingManager();null!==e&&(await this.unset(),console.log("EventIndex: Deleting event index."),await e.deleteEventIndex())}}window.mxEventIndexPeg||(window.mxEventIndexPeg=new m);t.a=window.mxEventIndexPeg},function(e,t){var n,o,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var c,l=[],d=!1,u=-1;function h(){d&&c&&(d=!1,c.length?l=c.concat(l):u=-1,l.length&&p())}function p(){if(!d){var e=s(h);d=!0;for(var t=l.length;t;){for(c=l,l=[];++u1)for(var n=1;n{for(let n=0;n]*)([0-9]*)$/);if(!i)return!1;const a=i[1],s=parseInt(i[2]);if(isNaN(s))return!1;switch(a){case"":case"==":return r==s;case"<":return r":return r>s;case"<=":return r<=s;case">=":return r>=s;default:return!1}},d=function(t,n){let r=n.getContent();if(n.isEncrypted()&&n.getClearContent()&&(r=n.getClearContent()),!r||!r.body||"string"!=typeof r.body)return!1;const i=e.getRoom(n.getRoomId());if(!(i&&i.currentState&&i.currentState.members&&i.currentState.getMember(e.credentials.userId)))return!1;const a=i.currentState.getMember(e.credentials.userId).name,s=new RegExp("(^|\\W)"+Object(o.i)(a)+"(\\W|$)","i");return r.body.search(s)>-1},u=function(e,t){if(!e.key)return!1;const n=p(e.key,t);if("string"!=typeof n)return!1;if(e.value)return e.value===n;if("string"!=typeof e.pattern)return!1;let o;return o="content.body"==e.key?h("(^|\\W)",e.pattern,"(\\W|$)"):h("^",e.pattern,"$"),!!n.match(o)},h=function(e,n,r){return t[n]||(t[n]=new RegExp(e+Object(o.l)(n)+r,"i")),t[n]},p=function(e,t){const n=e.split(".");let r;const i=n[0];for("content"===i?(r=t.getContent(),n.shift()):"type"===i?(r=t.getType(),n.shift()):r=t.event;n.length>0;){const e=n.shift();if(Object(o.o)(r[e]))return null;r=r[e]}return r},m=function(t,o){const r=function(t,o){return o?t.getSender()===e.credentials.userId?null:n(t,o.global):null}(t,o);if(!r)return{};const i=s.actionListToActionsObject(r.actions);return void 0===i.tweaks.highlight&&(i.tweaks.highlight="content"==r.kind),i};this.ruleMatchesEvent=function(e,t){let n=!0;for(let o=0;ot.rule_id===e.rule_id);if(t)t.default=e.default,t.conditions=e.conditions,t.actions=e.actions;else{const t=e.rule_id;r.a.warn("Adding default global override for "+t),n.push(e)}}return t}},function(e,t,n){var o=n(191),r=n(281);e.exports=n(192)?function(e,t,n){return o.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var o=n(242);e.exports=function(e){if(!o(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){var o=n(385);e.exports=function(e){return Object(o(e))}},function(e,t,n){var o=n(542),r=n(385);e.exports=function(e){return o(r(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.top,n=e.right,o=e.bottom,r=e.left;return{top:t,right:n,bottom:o,left:r,width:n-r,height:o-t,center:{x:(n+r)/2,y:(o+t)/2}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(198)),r=i(n(148));function i(e){return e&&e.__esModule?e:{default:e}}t.default=(0,r.default)((function(e,t){return(0,o.default)(t).map((function(e){return t[e]})).filter((function(t){return e.descriptor.id===t.descriptor.droppableId})).sort((function(e,t){return e.descriptor.index-t.descriptor.index}))}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(n(552)),r=i(n(398));function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.draggable,n=e.destination,i=e.previousImpact,a=e.viewport,s=t.descriptor.id,c=(0,o.default)(i.movement.displaced),l=(0,r.default)({target:t.page.withMargin,destination:n,viewport:a}),d=function(){if(!l)return!1;var e=c[s];return!e||e.shouldAnimate}();return{draggableId:s,isVisible:l,shouldAnimate:d}}},function(e,t,n){"use strict";let o,r;n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r})),function(e){e.Manual="MANUAL",e.Alphabetic="ALPHABETIC",e.Recent="RECENT"}(o||(o={})),function(e){e.Importance="IMPORTANCE",e.Natural="NATURAL"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return R}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(90),u=n(88),h=n(91),p=n.n(h),m=n(93),g=n(142),f=n(108),_=n(115),b=n(94),v=n(169),y=n(950),E=n.n(y),S=n(101),w=n(100),C=n(339),T=n.n(C),x=n(112),O=n(128),k=n(89);let R=Object(k.a)("views.elements.ReplyThread")((i=r=class e extends l.a.Component{constructor(e,t){super(e,t),s()(this,"updateForEventId",e=>{this.state.events.some(t=>t.getId()===e)&&this.forceUpdate()}),s()(this,"onEventReplaced",e=>{this.unmounted||this.updateForEventId(e.getId())}),s()(this,"onRoomRedaction",e=>{if(this.unmounted)return;const t=e.getAssociatedId();t&&this.updateForEventId(t)}),this.state={events:[],loadedEv:null,loading:!0,err:!1},this.unmounted=!1,this.context.on("Event.replaced",this.onEventReplaced),this.room=this.context.getRoom(this.props.parentEv.getRoomId()),this.room.on("Room.redaction",this.onRoomRedaction),this.room.on("Room.redactionCancelled",this.onRoomRedaction),this.onQuoteClick=this.onQuoteClick.bind(this),this.canCollapse=this.canCollapse.bind(this),this.collapse=this.collapse.bind(this)}static getParentEventId(e){if(!e||e.isRedacted())return;const t=e.getWireContent()["m.relates_to"];if(t&&t["m.in_reply_to"]){const e=t["m.in_reply_to"];if(e&&e.event_id)return e.event_id}}static stripPlainReply(e){const t=e.split("\n");for(;t.length&&t[0].startsWith("> ");)t.shift();return""===t[0]&&t.shift(),t.join("\n")}static stripHTMLReply(e){return T()(e,{allowedTags:!1,allowedAttributes:!1,allowedSchemes:[...O.a,"mxc"],exclusiveFilter:e=>"mx-reply"===e.tag})}static getNestedReplyText(e,t){if(!e)return null;let{body:n,formatted_body:o}=e.getContent();this.getParentEventId(e)&&n&&(n=this.stripPlainReply(n)),n||(n=""),o=o?this.stripHTMLReply(o):E()(n).replace(/\n/g,"
");const r=t.forEvent(e.getId()),i=Object(_.h)(e.getSender()),a=e.getSender();switch(e.getContent().msgtype){case"m.text":case"m.notice":{o=`
In reply to ${a}
${o}
`;const e=n.trim().split("\n");e.length>0&&(e[0]=`<${a}> ${e[0]}`,n=e.map(e=>"> "+e).join("\n")+"\n\n");break}case"m.image":o=`
In reply to ${a}
sent an image.
`,n=`> <${a}> sent an image.\n\n`;break;case"m.video":o=`
In reply to ${a}
sent a video.
`,n=`> <${a}> sent a video.\n\n`;break;case"m.audio":o=`
In reply to ${a}
sent an audio file.
`,n=`> <${a}> sent an audio file.\n\n`;break;case"m.file":o=`
In reply to ${a}
sent a file.
`,n=`> <${a}> sent a file.\n\n`;break;case"m.emote":{o=`
In reply to * ${a}
${o}
`;const e=n.trim().split("\n");e.length>0&&(e[0]=`* <${a}> ${e[0]}`,n=e.map(e=>"> "+e).join("\n")+"\n\n");break}default:return null}return{body:n,html:o}}static makeReplyMixIn(e){return e?{"m.relates_to":{"m.in_reply_to":{event_id:e.getId()}}}:{}}static makeThread(t,n,o,r,i){return e.getParentEventId(t)?l.a.createElement(e,{parentEv:t,onHeightChanged:n,ref:r,permalinkCreator:o,layout:i}):l.a.createElement("div",{className:"mx_ReplyThread_wrapper_empty"})}componentDidMount(){this.initialize()}componentDidUpdate(){this.props.onHeightChanged()}componentWillUnmount(){this.unmounted=!0,this.context.removeListener("Event.replaced",this.onEventReplaced),this.room&&(this.room.removeListener("Room.redaction",this.onRoomRedaction),this.room.removeListener("Room.redactionCancelled",this.onRoomRedaction))}async initialize(){const{parentEv:t}=this.props,n=await this.getEvent(e.getParentEventId(t));this.unmounted||(n?this.setState({events:[n]},this.loadNextEvent):this.setState({err:!0}))}async loadNextEvent(){if(this.unmounted)return;const t=this.state.events[0],n=e.getParentEventId(t);if(!n)return void this.setState({loading:!1});const o=await this.getEvent(n);this.unmounted||(o?this.setState({loadedEv:o}):this.setState({err:!0}))}async getEvent(e){const t=this.room.findEventById(e);if(t)return t;try{await this.context.getEventTimeline(this.room.getUnfilteredTimelineSet(),e)}catch(e){return null}return this.room.findEventById(e)}canCollapse(){return this.state.events.length>1}collapse(){this.initialize()}onQuoteClick(){const e=[this.state.loadedEv,...this.state.events];this.setState({loadedEv:null,events:e},this.loadNextEvent),m.a.fire(w.a.FocusComposer)}render(){let e=null;if(this.state.err)e=l.a.createElement("blockquote",{className:"mx_ReplyThread mx_ReplyThread_error"},Object(u.a)("Unable to load event that was replied to, it either does not exist or you do not have permission to view it."));else if(this.state.loadedEv){const t=this.state.loadedEv,n=d.getComponent("elements.Pill"),o=this.context.getRoom(t.getRoomId());e=l.a.createElement("blockquote",{className:"mx_ReplyThread"},Object(u.a)("In reply to ",{},{a:e=>l.a.createElement("a",{onClick:this.onQuoteClick,className:"mx_ReplyThread_show"},e),pill:l.a.createElement(n,{type:n.TYPE_USER_MENTION,room:o,url:Object(_.h)(t.getSender()),shouldShowPillAvatar:b.b.getValue("Pill.shouldShowPillAvatar")})}))}else if(this.state.loading){const t=d.getComponent("elements.Spinner");e=l.a.createElement(t,{w:16,h:16})}const t=d.getComponent("views.rooms.EventTile"),n=d.getComponent("messages.DateSeparator"),o=this.state.events.map(e=>{let o=null;return Object(g.f)(this.props.parentEv.getDate(),e.getDate())&&(o=l.a.createElement("a",{href:this.props.url},l.a.createElement(n,{ts:e.getTs()}))),l.a.createElement("blockquote",{className:"mx_ReplyThread",key:e.getId()},o,l.a.createElement(t,{mxEvent:e,tileShape:"reply",onHeightChanged:this.props.onHeightChanged,permalinkCreator:this.props.permalinkCreator,isRedacted:e.isRedacted(),isTwelveHour:b.b.getValue("showTwelveHourTimestamps"),layout:this.props.layout,enableFlair:b.b.getValue(x.a.Flair),replacingEventId:e.replacingEventId()}))});return l.a.createElement("div",{className:"mx_ReplyThread_wrapper"},l.a.createElement("div",null,e),l.a.createElement("div",null,o))}},s()(r,"propTypes",{parentEv:p.a.instanceOf(f.b),onHeightChanged:p.a.func.isRequired,permalinkCreator:p.a.instanceOf(_.a).isRequired,layout:v.b}),s()(r,"contextType",S.a),o=i))||o},function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RssHandler=t.DefaultHandler=t.DomUtils=t.ElementType=t.Tokenizer=t.createDomStream=t.parseDOM=t.parseDocument=t.DomHandler=t.Parser=void 0;var c=n(580);Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return c.Parser}});var l=n(582);function d(e,t){var n=new l.DomHandler(void 0,t);return new c.Parser(n,t).end(e),n.root}Object.defineProperty(t,"DomHandler",{enumerable:!0,get:function(){return l.DomHandler}}),Object.defineProperty(t,"DefaultHandler",{enumerable:!0,get:function(){return l.DomHandler}}),t.parseDocument=d,t.parseDOM=function(e,t){return d(e,t).children},t.createDomStream=function(e,t,n){var o=new l.DomHandler(e,t,n);return new c.Parser(o,t)};var u=n(581);Object.defineProperty(t,"Tokenizer",{enumerable:!0,get:function(){return s(u).default}});var h=i(n(288));t.ElementType=h,a(n(584),t),t.DomUtils=i(n(337));var p=n(584);Object.defineProperty(t,"RssHandler",{enumerable:!0,get:function(){return p.FeedHandler}})},function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(585),a=n(586);r(n(586),t);var s=/\s+/g,c={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=c),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:c,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){var e;this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null!==(e=this.parser)&&void 0!==e?e:null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,o=new a.Element(e,t,void 0,n);this.addNode(o),this.tagStack.push(o)},e.prototype.ontext=function(e){var t=this.options.normalizeWhitespace,n=this.lastNode;if(n&&n.type===i.ElementType.Text)t?n.data=(n.data+e).replace(s," "):n.data+=e;else{t&&(e=e.replace(s," "));var o=new a.Text(e);this.addNode(o),this.lastNode=o}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new a.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new a.Text(""),t=new a.NodeWithChildren(i.ElementType.CDATA,[e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new a.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var i=n(594),a=n(595);r(n(595),t);var s=/\s+/g,c={normalizeWhitespace:!1,withStartIndices:!1,withEndIndices:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=c),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:c,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){var e;this.dom=[],this.root=new a.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null!==(e=this.parser)&&void 0!==e?e:null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?i.ElementType.Tag:void 0,o=new a.Element(e,t,void 0,n);this.addNode(o),this.tagStack.push(o)},e.prototype.ontext=function(e){var t=this.options.normalizeWhitespace,n=this.lastNode;if(n&&n.type===i.ElementType.Text)t?n.data=(n.data+e).replace(s," "):n.data+=e;else{t&&(e=e.replace(s," "));var o=new a.Text(e);this.addNode(o),this.lastNode=o}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===i.ElementType.Comment)this.lastNode.data+=e;else{var t=new a.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new a.Text(""),t=new a.NodeWithChildren(i.ElementType.CDATA,[e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new a.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isHtml=t.cloneDom=t.domEach=t.cssCase=t.camelCase=t.isCheerio=t.isTag=void 0;var o=n(251),r=n(253);t.isTag=o.DomUtils.isTag,t.isCheerio=function(e){return null!=e.cheerio},t.camelCase=function(e){return e.replace(/[_.-](\w|$)/g,(function(e,t){return t.toUpperCase()}))},t.cssCase=function(e){return e.replace(/[A-Z]/g,"-$&").toLowerCase()},t.domEach=function(e,t){for(var n=e.length,o=0;o/;t.isHtml=function(e){return i.test(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isComment=t.isText=t.isCDATA=t.isTag=void 0;var o=n(288);t.isTag=function(e){return o.isTag(e)},t.isCDATA=function(e){return"cdata"===e.type},t.isText=function(e){return"text"===e.type},t.isComment=function(e){return"comment"===e.type},t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return a}));var o=n(130),r=n.n(o);function i(e){if(!e)return"";const t=r.a.parse(e);return t&&"/"===t.path?t.host:e}function a(e){if(!e)return"";let t=e;e.startsWith("https://")||(t="https://"+e);return null===r.a.parse(t).hostname?e:t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(1),r=n(8);function i(e){this.groupId=e,this.name=null,this.avatarUrl=null,this.myMembership=null,this.inviter=null}o.m(i,r.EventEmitter),i.prototype.setProfile=function(e,t){this.name===e&&this.avatarUrl===t||(this.name=e||this.groupId,this.avatarUrl=t,this.emit("Group.profile",this))},i.prototype.setMyMembership=function(e){this.myMembership!==e&&(this.myMembership=e,this.emit("Group.myMembership",this))},i.prototype.setInviter=function(e){this.inviter=e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(0),r=n(130);class i{static get ERROR_INVALID(){return"Invalid homeserver discovery response"}static get ERROR_GENERIC_FAILURE(){return"Failed to get autodiscovery configuration from server"}static get ERROR_INVALID_HS_BASE_URL(){return"Invalid base_url for m.homeserver"}static get ERROR_INVALID_HOMESERVER(){return"Homeserver URL does not appear to be a valid Matrix homeserver"}static get ERROR_INVALID_IS_BASE_URL(){return"Invalid base_url for m.identity_server"}static get ERROR_INVALID_IDENTITY_SERVER(){return"Identity server URL does not appear to be a valid identity server"}static get ERROR_INVALID_IS(){return"Invalid identity server discovery response"}static get ERROR_MISSING_WELLKNOWN(){return"No .well-known JSON file found"}static get ERROR_INVALID_JSON(){return"Invalid JSON"}static get ALL_ERRORS(){return[i.ERROR_INVALID,i.ERROR_GENERIC_FAILURE,i.ERROR_INVALID_HS_BASE_URL,i.ERROR_INVALID_HOMESERVER,i.ERROR_INVALID_IS_BASE_URL,i.ERROR_INVALID_IDENTITY_SERVER,i.ERROR_INVALID_IS,i.ERROR_MISSING_WELLKNOWN,i.ERROR_INVALID_JSON]}static get FAIL_ERROR(){return"FAIL_ERROR"}static get FAIL_PROMPT(){return"FAIL_PROMPT"}static get PROMPT(){return"PROMPT"}static get SUCCESS(){return"SUCCESS"}static async fromDiscoveryConfig(e){const t={"m.homeserver":{state:i.FAIL_ERROR,error:i.ERROR_INVALID,base_url:null},"m.identity_server":{state:i.PROMPT,error:null,base_url:null}};if(!e||!e["m.homeserver"])return o.a.error("No m.homeserver key in config"),t["m.homeserver"].state=i.FAIL_PROMPT,t["m.homeserver"].error=i.ERROR_INVALID,Promise.resolve(t);if(!e["m.homeserver"].base_url)return o.a.error("No m.homeserver base_url in config"),t["m.homeserver"].state=i.FAIL_PROMPT,t["m.homeserver"].error=i.ERROR_INVALID_HS_BASE_URL,Promise.resolve(t);const n=this._sanitizeWellKnownUrl(e["m.homeserver"].base_url);if(!n)return o.a.error("Invalid base_url for m.homeserver"),t["m.homeserver"].error=i.ERROR_INVALID_HS_BASE_URL,Promise.resolve(t);const r=await this._fetchWellKnownObject(n+"/_matrix/client/versions");if(!r||!r.raw.versions)return o.a.error("Invalid /versions response"),t["m.homeserver"].error=i.ERROR_INVALID_HOMESERVER,t["m.homeserver"].base_url=n,Promise.resolve(t);t["m.homeserver"]={state:i.SUCCESS,error:null,base_url:n};let a="";if(e["m.identity_server"]){const n={"m.homeserver":t["m.homeserver"],"m.identity_server":{state:i.FAIL_PROMPT,error:i.ERROR_INVALID_IS,base_url:null}};if(a=this._sanitizeWellKnownUrl(e["m.identity_server"].base_url),!a)return o.a.error("Invalid base_url for m.identity_server"),n["m.identity_server"].error=i.ERROR_INVALID_IS_BASE_URL,Promise.resolve(n);const r=await this._fetchWellKnownObject(a+"/_matrix/identity/api/v1");if(!r||!r.raw||"SUCCESS"!==r.action)return o.a.error("Invalid /api/v1 response"),n["m.identity_server"].error=i.ERROR_INVALID_IDENTITY_SERVER,n["m.identity_server"].base_url=a,Promise.resolve(n)}return a&&a.length>0&&(t["m.identity_server"]={state:i.SUCCESS,error:null,base_url:a}),Object.keys(e).map(n=>{if("m.homeserver"===n||"m.identity_server"===n){const o=["error","state","base_url"];for(const r of Object.keys(e[n]))o.includes(r)||(t[n][r]=e[n][r])}else t[n]=e[n]}),Promise.resolve(t)}static async findClientConfig(e){if(!e||"string"!=typeof e||0===e.length)throw new Error("'domain' must be a string of non-zero length");const t={"m.homeserver":{state:i.FAIL_ERROR,error:i.ERROR_INVALID,base_url:null},"m.identity_server":{state:i.PROMPT,error:null,base_url:null}},n=await this._fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return n&&"SUCCESS"===n.action?i.fromDiscoveryConfig(n.raw):(o.a.error("No response or error when parsing .well-known"),n.reason&&o.a.error(n.reason),"IGNORE"===n.action?t["m.homeserver"]={state:i.PROMPT,error:null,base_url:null}:(t["m.homeserver"].state=i.FAIL_PROMPT,t["m.homeserver"].error=i.ERROR_INVALID),Promise.resolve(t))}static async getRawClientConfig(e){if(!e||"string"!=typeof e||0===e.length)throw new Error("'domain' must be a string of non-zero length");const t=await this._fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return t&&t.raw||{}}static _sanitizeWellKnownUrl(e){if(!e)return!1;try{let t=null;try{t=r.URL?new r.URL(e):new URL(e)}catch(n){t=new URL(e)}if(!t||!t.hostname)return!1;if("http:"!==t.protocol&&"https:"!==t.protocol)return!1;const n=t.port?":"+t.port:"",o=t.pathname?t.pathname:"";let i=`${t.protocol}//${t.hostname}${n}${o}`;return i.endsWith("/")&&(i=i.substring(0,i.length-1)),i}catch(e){return o.a.error(e),!1}}static async _fetchWellKnownObject(e){return new Promise((function(t,o){const r=n(150).getRequest();if(!r)throw new Error("No request library available");r({method:"GET",uri:e,timeout:5e3},(e,n,o)=>{if(e||n&&(n.statusCode<200||n.statusCode>=300)){let o="FAIL_PROMPT",r=(e?e.message:null)||"General failure";return n&&404===n.statusCode&&(o="IGNORE",r=i.ERROR_MISSING_WELLKNOWN),void t({raw:{},action:o,reason:r,error:e})}try{t({raw:JSON.parse(o),action:"SUCCESS"})}catch(e){let n=i.ERROR_INVALID;"SyntaxError"===e.name&&(n=i.ERROR_INVALID_JSON),t({raw:{},action:"FAIL_PROMPT",reason:n,error:e})}})}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a}));var o=n(92);function r(e){return e.getCanonicalAlias()||e.getAltAliases()[0]}function i(e,t){let n;if(t){n=function(e,t){let n,o;for(const r of e.getJoinedMembers())r.userId!=t&&(void 0===n||r.events.member&&r.events.member.getTs()-1&&o.splice(t,1)}}if(t){const n=r[t]||[];-1==n.indexOf(e)&&n.push(e),r[t]=n}return o.a.get().setAccountData("m.direct",r)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i})),n.d(t,"d",(function(){return a})),n.d(t,"c",(function(){return c}));var o=n(92);function r(){const e=o.a.get().getClientWellKnown();return null==e?void 0:e["io.element.call_behaviour"]}function i(){const e=o.a.get().getClientWellKnown();return e&&e["io.element.e2ee"]?e["io.element.e2ee"]:e&&e["im.vector.riot.e2ee"]?e["im.vector.riot.e2ee"]:null}function a(){const e=i();return e&&!0===e.secure_backup_required}let s;function c(){const e=i();return e&&e.secure_backup_setup_methods&&e.secure_backup_setup_methods.length&&(e.secure_backup_setup_methods.includes(s.Key)||e.secure_backup_setup_methods.includes(s.Passphrase))?e.secure_backup_setup_methods:[s.Key,s.Passphrase]}!function(e){e.Key="key",e.Passphrase="passphrase"}(s||(s={}))},function(e,t,n){"use strict";var o=n(18),r=n.n(o),i=n(8),a=n.n(i);class s extends a.a{constructor(){super(),r()(this,"roomWidgetEcho",void 0),this.roomWidgetEcho={}}getEchoedRoomWidgets(e,t){const n=[],o=Object.assign({},this.roomWidgetEcho[e]);for(const e of t){const t=e.getStateKey();o[t]&&0===Object.keys(o[t]).length||n.push(e),delete o[t]}return n}roomHasPendingWidgetsOfType(e,t,n){const o=Object.assign({},this.roomWidgetEcho[e]);for(const e of t){delete o[e.getStateKey()]}return void 0===n?Object.keys(o).length>0:Object.values(o).some(e=>n.matches(e.type))}roomHasPendingWidgets(e,t){return this.roomHasPendingWidgetsOfType(e,t)}setRoomWidgetEcho(e,t,n){void 0===this.roomWidgetEcho[e]&&(this.roomWidgetEcho[e]={}),this.roomWidgetEcho[e][t]=n,this.emit("update",e,t)}removeRoomWidgetEcho(e,t){delete this.roomWidgetEcho[e][t],0===Object.keys(this.roomWidgetEcho[e]).length&&delete this.roomWidgetEcho[e],this.emit("update",e,t)}}let c=null;c||(c=new s),t.a=c},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(18),r=n.n(o),i=n(146),a=n(93),s=n(351);class c extends i.a{constructor(){super(a.a),r()(this,"widgetMap",new s.a)}static get instance(){return c.internalInstance}async onAction(e){}async onReady(){this.widgetMap.clear()}storeMessaging(e,t){this.stopMessaging(e),this.widgetMap.set(e.id,t)}stopMessaging(e){var t;null===(t=this.widgetMap.remove(e.id))||void 0===t||t.stop()}getMessaging(e){return this.widgetMap.get(e.id)}stopMessagingById(e){var t;null===(t=this.widgetMap.remove(e))||void 0===t||t.stop()}getMessagingForId(e){return this.widgetMap.get(e)}}r()(c,"internalInstance",new c)},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"Notifier",(function(){return E}));var o=n(92),r=n(98),i=n(113),a=n(343),s=n(126),c=n(214),l=n(93),d=n(90),u=n(88),h=n(95),p=n(94),m=n(452),g=n(102),f=n(649),_=n(129),b=n(454),v=n(103);const y={"m.key.verification.request":e=>{const t=(e.sender||{}).name;return Object(u.a)("%(name)s is requesting verification",{name:t})}},E={notifsByRoom:{},pendingEncryptedEventIds:[],notificationMessageForEvent:function(e){return y.hasOwnProperty(e.getContent().msgtype)?y[e.getContent().msgtype](e):a.a(e)},_displayPopupNotification:function(t,n){const o=i.a.get();if(!o)return;if(!o.supportsNotifications()||!o.maySendNotifications())return;if(e.document.hasFocus())return;let r,a=this.notificationMessageForEvent(t);if(!a)return;t.sender&&n.name!==t.sender.name?"m.room.member"===t.getType()?r=n.name:t.sender&&(r=t.sender.name+" ("+n.name+")",t.getContent().body&&!y.hasOwnProperty(t.getContent().msgtype)&&(a=t.getContent().body)):(r=n.name,t.getContent().body&&!y.hasOwnProperty(t.getContent().msgtype)&&(a=t.getContent().body)),this.isBodyEnabled()||(a="");let s=null;t.sender&&!p.b.getValue("lowBandwidth")&&(s=c.a(t.sender,40,40,"crop"));const l=o.displayNotification(r,a,s,n);l&&(void 0===this.notifsByRoom[t.getRoomId()]&&(this.notifsByRoom[t.getRoomId()]=[]),this.notifsByRoom[t.getRoomId()].push(l))},getSoundForRoom:function(e){const t=p.b.getValue("notificationSound",e);return t?t.url?t.url.startsWith("mxc://")?{url:Object(v.b)(t.url).srcHttp,name:t.name,type:t.type,size:t.size}:(console.warn(e+" has custom notification sound event, but url is not a mxc url"),null):(console.warn(e+" has custom notification sound event, but no url key"),null):null},_playAudioNotification:async function(e,t){const n=this.getSoundForRoom(t.roomId);console.log(`Got sound ${n&&n.name||"default"} for ${t.roomId}`);try{const e=document.querySelector(n?`audio[src='${n.url}']`:"#messageAudio");let t=e;if(!e){if(!n)return void console.error("No audio element or sound to play for notification");t=new Audio(n.url),n.type&&(t.type=n.type),document.body.appendChild(t)}await t.play()}catch(e){console.warn("Caught error when trying to fetch room notification sound:",e)}},start:function(){this.boundOnEvent=this.boundOnEvent||this.onEvent.bind(this),this.boundOnSyncStateChange=this.boundOnSyncStateChange||this.onSyncStateChange.bind(this),this.boundOnRoomReceipt=this.boundOnRoomReceipt||this.onRoomReceipt.bind(this),this.boundOnEventDecrypted=this.boundOnEventDecrypted||this.onEventDecrypted.bind(this),o.a.get().on("event",this.boundOnEvent),o.a.get().on("Room.receipt",this.boundOnRoomReceipt),o.a.get().on("Event.decrypted",this.boundOnEventDecrypted),o.a.get().on("sync",this.boundOnSyncStateChange),this.toolbarHidden=!1,this.isSyncing=!1},stop:function(){o.a.get()&&(o.a.get().removeListener("Event",this.boundOnEvent),o.a.get().removeListener("Room.receipt",this.boundOnRoomReceipt),o.a.get().removeListener("Event.decrypted",this.boundOnEventDecrypted),o.a.get().removeListener("sync",this.boundOnSyncStateChange)),this.isSyncing=!1},supportsDesktopNotifications:function(){const e=i.a.get();return e&&e.supportsNotifications()},setEnabled:function(e,t){const n=i.a.get();n&&(s.a.trackEvent("Notifier","Set Enabled",String(e)),p.b.isLevelSupported(g.a.DEVICE)&&p.b.setValue("audioNotificationsEnabled",null,g.a.DEVICE,this.isEnabled()),e?n.requestNotificationPermission().then(e=>{if("granted"===e)t&&t(),l.a.dispatch({action:"notifier_enabled",value:!0});else{const t=r.a.get().brand,n="denied"===e?Object(u.a)("%(brand)s does not have permission to send you notifications - please check your browser settings",{brand:t}):Object(u.a)("%(brand)s was not given permission to send notifications - please try again",{brand:t}),o=d.getComponent("dialogs.ErrorDialog");h.a.createTrackedDialog("Unable to enable Notifications",e,o,{title:Object(u.a)("Unable to enable Notifications"),description:n})}}):l.a.dispatch({action:"notifier_enabled",value:!1}),this.setPromptHidden(!0))},isEnabled:function(){return this.isPossible()&&p.b.getValue("notificationsEnabled")},isPossible:function(){const e=i.a.get();return!!e&&(!!e.supportsNotifications()&&!!e.maySendNotifications())},isBodyEnabled:function(){return this.isEnabled()&&p.b.getValue("notificationBodyEnabled")},isAudioEnabled:function(){return p.b.getValue("audioNotificationsEnabled")},setPromptHidden:function(t,n=!0){this.toolbarHidden=t,s.a.trackEvent("Notifier","Set Toolbar Hidden",String(t)),Object(m.a)(),n&&e.localStorage&&e.localStorage.setItem("notifications_hidden",String(t))},shouldShowPrompt:function(){const e=o.a.get();if(!e)return!1;return!e.isGuest()&&this.supportsDesktopNotifications()&&!Object(f.c)()&&!this.isEnabled()&&!this._isPromptHidden()},_isPromptHidden:function(){return e.localStorage?"true"===e.localStorage.getItem("notifications_hidden"):this.toolbarHidden},onSyncStateChange:function(e){"SYNCING"===e?this.isSyncing=!0:"STOPPED"!==e&&"ERROR"!==e||(this.isSyncing=!1)},onEvent:function(e){if(this.isSyncing&&(!e.sender||e.sender.userId!==o.a.get().credentials.userId))if(o.a.get().decryptEventIfNeeded(e),e.isBeingDecrypted()||e.isDecryptionFailure())for(this.pendingEncryptedEventIds.push(e.getId());this.pendingEncryptedEventIds.length>20;)this.pendingEncryptedEventIds.shift();else this._evaluateEvent(e)},onEventDecrypted:function(e){if(e.isDecryptionFailure())return;const t=this.pendingEncryptedEventIds.indexOf(e.getId());-1!==t&&(this.pendingEncryptedEventIds.splice(t,1),this._evaluateEvent(e))},onRoomReceipt:function(e,t){if(0===t.getUnreadNotificationCount()){const e=i.a.get();if(!e)return;if(void 0===this.notifsByRoom[t.roomId])return;for(const n of this.notifsByRoom[t.roomId])e.clearNotification(n);delete this.notifsByRoom[t.roomId]}},_evaluateEvent:function(e){const t=o.a.get().getRoom(e.getRoomId()),n=o.a.get().getPushActionsForEvent(e);if(n&&n.notify){if(_.a.getRoomId()===t.roomId&&b.a.sharedInstance().userActiveRecently())return;if(p.b.getValue("doNotDisturb"))return;this.isEnabled()&&this._displayPopupNotification(e,t),n.tweaks.sound&&this.isAudioEnabled()&&(i.a.get().loudNotification(e,t),this._playAudioNotification(e,t))}}};window.mxNotifier||(window.mxNotifier=E),t.default=window.mxNotifier}.call(this,n(7))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(18),r=n.n(o);class i{constructor(e){this.timeout=e,r()(this,"timerHandle",void 0),r()(this,"startTs",void 0),r()(this,"promise",void 0),r()(this,"resolve",void 0),r()(this,"reject",void 0),r()(this,"onTimeout",()=>{const e=Date.now()-this.startTs;if(e>=this.timeout)this.resolve(),this.setNotStarted();else{const t=this.timeout-e;this.timerHandle=setTimeout(this.onTimeout,t)}}),this.setNotStarted()}setNotStarted(){this.timerHandle=null,this.startTs=null,this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t}).finally(()=>{this.timerHandle=null})}changeTimeout(e){if(e===this.timeout)return;const t=e{const t=e.src&&e.src.map(e=>{let t;return e.format&&(t=`format("${e.format}")`),e.url?`url("${e.url}") ${t}`:e.local?`local("${e.local}") ${t}`:""}).join(", ");return`@font-face {${Object.keys(e).filter(e=>l.includes(e)).map(n=>{let o;return o="src"===n?t:"font-family"===n?`"${e[n]}"`:e[n],`${n}: ${o}`}).join(";")}}`}).join("\n"),t=document.createElement("style");t.setAttribute("title","custom-theme-font-faces"),t.setAttribute("type","text/css"),t.appendChild(document.createTextNode(e)),document.head.appendChild(t)}n.general&&t.setProperty("--font-family",n.general),n.monospace&&t.setProperty("--font-family-monospace",n.monospace)}}function u(e){const t=i.b.getValue("custom_themes");if(!t)throw new Error(`No custom themes set, can't set custom theme "${e}"`);const n=t.find(t=>t.name===e);if(!n){const n=t.map(e=>e.name).join(", ");throw new Error(`Can't find custom theme "${e}", only know ${n}`)}return n}async function h(t){if(!t){const e=new a.a;t=e.getEffectiveTheme()}!function(){const e=Object.values(document.body.style);for(const t of e)t.startsWith("--")&&document.body.style.removeProperty(t);const t=document.querySelector("head > style[title='custom-theme-font-faces']");t&&t.remove()}();let n=t;if(t.startsWith("custom-")){const e=u(t.substr(7));n=e.is_dark?"dark-custom":"light-custom",d(e)}const o=Object.create(null);let i;for(let e=0;i=document.getElementsByTagName("link")[e];e++){const e=i.getAttribute("href"),t=e&&e.match(/^bundles\/.*\/theme-(.*)\.css$/);t&&(o[t[1]]=i)}if(!(n in o))throw new Error("Unknown theme "+n);return o[n].disabled=!1,new Promise(i=>{const a=function(){o[n].disabled=!1,Object.values(o).forEach(e=>{e!=o[n]&&(e.disabled=!0)});const a=e.getComputedStyle(document.body);a.backgroundColor&&(document.querySelector('meta[name="theme-color"]').content=a.backgroundColor),r.a.setTheme(t),i()};let s=!1;o[n].onload=()=>{a()};for(let e=0;e{this.props.onFinished(!1)}),r()(this,"_onDone",()=>{this.props.onFinished(!0)}),r()(this,"_onUseRecoveryKeyClick",()=>{this.setState({forceRecoveryKey:!0})}),r()(this,"_progressCallback",e=>{this.setState({progress:e})}),r()(this,"_onResetRecoveryClick",()=>{this.props.onFinished(!1),Object(p.b)(()=>{},!0)}),r()(this,"_onRecoveryKeyChange",e=>{this.setState({recoveryKey:e.target.value,recoveryKeyValid:d.a.get().isValidRecoveryKey(e.target.value)})}),r()(this,"_onPassPhraseNext",async()=>{this.setState({loading:!0,restoreError:null,restoreType:0});try{const e=await d.a.get().restoreKeyBackupWithPassword(this.state.passPhrase,void 0,void 0,this.state.backupInfo,{progressCallback:this._progressCallback});if(this.props.keyCallback){const e=await d.a.get().keyBackupKeyFromPassword(this.state.passPhrase,this.state.backupInfo);this.props.keyCallback(e)}if(!this.props.showSummary)return void this.props.onFinished(!0);this.setState({loading:!1,recoverInfo:e})}catch(e){console.log("Error restoring backup",e),this.setState({loading:!1,restoreError:e})}}),r()(this,"_onRecoveryKeyNext",async()=>{if(this.state.recoveryKeyValid){this.setState({loading:!0,restoreError:null,restoreType:1});try{const e=await d.a.get().restoreKeyBackupWithRecoveryKey(this.state.recoveryKey,void 0,void 0,this.state.backupInfo,{progressCallback:this._progressCallback});if(this.props.keyCallback){const e=d.a.get().keyBackupKeyFromRecoveryKey(this.state.recoveryKey);this.props.keyCallback(e)}if(!this.props.showSummary)return void this.props.onFinished(!0);this.setState({loading:!1,recoverInfo:e})}catch(e){console.log("Error restoring backup",e),this.setState({loading:!1,restoreError:e})}}}),r()(this,"_onPassPhraseChange",e=>{this.setState({passPhrase:e.target.value})}),this.state={backupInfo:null,backupKeyStored:null,loading:!1,loadError:null,restoreError:null,recoveryKey:"",recoverInfo:null,recoveryKeyValid:!1,forceRecoveryKey:!1,passPhrase:"",restoreType:null,progress:{stage:"prefetch"}}}componentDidMount(){this._loadBackupStatus()}async _restoreWithSecretStorage(){this.setState({loading:!0,restoreError:null,restoreType:2});try{const e=await Object(p.b)(async()=>d.a.get().restoreKeyBackupWithSecretStorage(this.state.backupInfo,void 0,void 0,{progressCallback:this._progressCallback}));this.setState({loading:!1,recoverInfo:e})}catch(e){console.log("Error restoring backup",e),this.setState({restoreError:e,loading:!1})}}async _restoreWithCachedKey(e){if(!e)return!1;try{const t=await d.a.get().restoreKeyBackupWithCache(void 0,void 0,e,{progressCallback:this._progressCallback});return this.setState({recoverInfo:t}),!0}catch(e){return console.log("restoreWithCachedKey failed:",e),!1}}async _loadBackupStatus(){this.setState({loading:!0,loadError:null});try{const e=d.a.get(),t=await e.getKeyBackupVersion(),n=await e.hasSecretStorageKey()&&await e.isKeyBackupKeyStored();this.setState({backupInfo:t,backupKeyStored:n});if(await this._restoreWithCachedKey(t))return console.log("RestoreKeyBackupDialog: found cached backup key"),void this.setState({loading:!1});if(n)return this._restoreWithSecretStorage();this.setState({loadError:null,loading:!1})}catch(e){console.log("Error loading backup status",e),this.setState({loadError:e,loading:!1})}}render(){const e=l.getComponent("views.dialogs.BaseDialog"),t=l.getComponent("elements.Spinner"),n=this.state.backupInfo&&this.state.backupInfo.auth_data&&this.state.backupInfo.auth_data.private_key_salt&&this.state.backupInfo.auth_data.private_key_iterations;let o,r;if(this.state.loading){let e;if(r=Object(h.a)("Restoring keys from backup"),"fetch"===this.state.progress.stage)e=Object(h.a)("Fetching keys from server...");else if("load_keys"===this.state.progress.stage){const{total:t,successes:n,failures:o}=this.state.progress;e=Object(h.a)("%(completed)s of %(total)s keys restored",{total:t,completed:n+o})}else"prefetch"===this.state.progress.stage&&(e=Object(h.a)("Fetching keys from server..."));o=a.a.createElement("div",null,a.a.createElement("div",null,e),a.a.createElement(t,null))}else if(this.state.loadError)r=Object(h.a)("Error"),o=Object(h.a)("Unable to load backup status");else if(this.state.restoreError)this.state.restoreError.errcode===u.b.RESTORE_BACKUP_ERROR_BAD_KEY?1===this.state.restoreType?(r=Object(h.a)("Security Key mismatch"),o=a.a.createElement("div",null,a.a.createElement("p",null,Object(h.a)("Backup could not be decrypted with this Security Key: please verify that you entered the correct Security Key.")))):(r=Object(h.a)("Incorrect Security Phrase"),o=a.a.createElement("div",null,a.a.createElement("p",null,Object(h.a)("Backup could not be decrypted with this Security Phrase: please verify that you entered the correct Security Phrase.")))):(r=Object(h.a)("Error"),o=Object(h.a)("Unable to restore backup"));else if(null===this.state.backupInfo)r=Object(h.a)("Error"),o=Object(h.a)("No backup found!");else if(this.state.recoverInfo){const e=l.getComponent("views.elements.DialogButtons");let t;r=Object(h.a)("Keys restored"),this.state.recoverInfo.total>this.state.recoverInfo.imported&&(t=a.a.createElement("p",null,Object(h.a)("Failed to decrypt %(failedCount)s sessions!",{failedCount:this.state.recoverInfo.total-this.state.recoverInfo.imported}))),o=a.a.createElement("div",null,a.a.createElement("p",null,Object(h.a)("Successfully restored %(sessionCount)s keys",{sessionCount:this.state.recoverInfo.imported})),t,a.a.createElement(e,{primaryButton:Object(h.a)("OK"),onPrimaryButtonClick:this._onDone,hasCancel:!1,focus:!0}))}else if(n&&!this.state.forceRecoveryKey){const e=l.getComponent("views.elements.DialogButtons"),t=l.getComponent("elements.AccessibleButton");r=Object(h.a)("Enter Security Phrase"),o=a.a.createElement("div",null,a.a.createElement("p",null,Object(h.a)("Warning: you should only set up key backup from a trusted computer.",{},{b:e=>a.a.createElement("b",null,e)})),a.a.createElement("p",null,Object(h.a)("Access your secure message history and set up secure messaging by entering your Security Phrase.")),a.a.createElement("form",{className:"mx_RestoreKeyBackupDialog_primaryContainer"},a.a.createElement("input",{type:"password",className:"mx_RestoreKeyBackupDialog_passPhraseInput",onChange:this._onPassPhraseChange,value:this.state.passPhrase,autoFocus:!0}),a.a.createElement(e,{primaryButton:Object(h.a)("Next"),onPrimaryButtonClick:this._onPassPhraseNext,primaryIsSubmit:!0,hasCancel:!0,onCancel:this._onCancel,focus:!1})),Object(h.a)("If you've forgotten your Security Phrase you can use your Security Key or set up new recovery options",{},{button1:e=>a.a.createElement(t,{className:"mx_linkButton",element:"span",onClick:this._onUseRecoveryKeyClick},e),button2:e=>a.a.createElement(t,{className:"mx_linkButton",element:"span",onClick:this._onResetRecoveryClick},e)}))}else{r=Object(h.a)("Enter Security Key");const e=l.getComponent("views.elements.DialogButtons"),t=l.getComponent("elements.AccessibleButton");let n;n=0===this.state.recoveryKey.length?a.a.createElement("div",{className:"mx_RestoreKeyBackupDialog_keyStatus"}):this.state.recoveryKeyValid?a.a.createElement("div",{className:"mx_RestoreKeyBackupDialog_keyStatus"},"👍 ",Object(h.a)("This looks like a valid Security Key!")):a.a.createElement("div",{className:"mx_RestoreKeyBackupDialog_keyStatus"},"👎 ",Object(h.a)("Not a valid Security Key")),o=a.a.createElement("div",null,a.a.createElement("p",null,Object(h.a)("Warning: You should only set up key backup from a trusted computer.",{},{b:e=>a.a.createElement("b",null,e)})),a.a.createElement("p",null,Object(h.a)("Access your secure message history and set up secure messaging by entering your Security Key.")),a.a.createElement("div",{className:"mx_RestoreKeyBackupDialog_primaryContainer"},a.a.createElement("input",{className:"mx_RestoreKeyBackupDialog_recoveryKeyInput",onChange:this._onRecoveryKeyChange,value:this.state.recoveryKey,autoFocus:!0}),n,a.a.createElement(e,{primaryButton:Object(h.a)("Next"),onPrimaryButtonClick:this._onRecoveryKeyNext,hasCancel:!0,onCancel:this._onCancel,focus:!1,primaryDisabled:!this.state.recoveryKeyValid})),Object(h.a)("If you've forgotten your Security Key you can ",{},{button:e=>a.a.createElement(t,{className:"mx_linkButton",element:"span",onClick:this._onResetRecoveryClick},e)}))}return a.a.createElement(e,{className:"mx_RestoreKeyBackupDialog",onFinished:this.props.onFinished,title:r},a.a.createElement("div",{className:"mx_RestoreKeyBackupDialog_content"},o))}}r()(m,"propTypes",{showSummary:c.a.bool,keyCallback:c.a.func}),r()(m,"defaultProps",{showSummary:!0})},function(e,t,n){"use strict";var o=n(464);i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}();var r=i.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function i(e,t,n){return i.TYPED_ARRAY_SUPPORT||this instanceof i?"number"==typeof e?c(this,e):function(e,t,n,o){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');if("undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer)return function(e,t,n,o){if(n<0||t.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function s(e,t){var n;return i.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(t)).__proto__=i.prototype:(null===(n=e)&&(n=new i(t)),n.length=t),n}function c(e,t){var n=s(e,t<0?0:0|a(t));if(!i.TYPED_ARRAY_SUPPORT)for(var o=0;o55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===o){(t-=3)>-1&&i.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&i.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function u(e){return i.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:d(e).length)}i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),i.prototype.write=function(e,t,n){void 0===t||void 0===n&&"string"==typeof t?(n=this.length,t=0):isFinite(t)&&(t|=0,isFinite(n)?n|=0:n=void 0);var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,n,o){return function(e,t,n,o){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}(d(t,e.length-n),e,n,o)}(this,e,t,n)},i.prototype.slice=function(e,t){var n,o=this.length;if((e=~~e)<0?(e+=o)<0&&(e=0):e>o&&(e=o),(t=void 0===t?o:~~t)<0?(t+=o)<0&&(t=0):t>o&&(t=o),t=e.length&&(t=e.length),t||(t=0),o>0&&o=this.length)throw new RangeError("sourceStart out of bounds");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-t=0;--r)e[r+t]=this[r+n];else if(a<1e3||!i.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;rc({index:i},e)))}n.sort((e,t)=>{if(e.indexe.object)),r=-1===t?o.length:t;return o.slice(0,r)}processQuery(e){return!1!==this._options.fuzzy?Object(a.v)(e.toLowerCase()).toLowerCase():e.toLowerCase()}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return h})),n.d(t,"b",(function(){return p})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return g}));var o=n(18),r=n.n(o),i=n(143),a=n(93),s=n(100),c=n(487),l=n(92),d=n(364);const u="mx_sso_hs_url",h="mx_sso_is_url",p="mx_sso_idp_id";let m;!function(e){e.Checking="CHECKING",e.Error="ERROR",e.NotAvailable="NOTAVAILABLE",e.Downloading="DOWNLOADING",e.Ready="READY"}(m||(m={}));class g{constructor(){r()(this,"notificationCount",0),r()(this,"errorDidOccur",!1),r()(this,"onAction",e=>{switch(e.action){case"on_client_not_viable":case"on_logged_out":this.setNotificationCount(0)}}),a.a.register(this.onAction),this.startUpdateCheck=this.startUpdateCheck.bind(this)}setNotificationCount(e){this.notificationCount=e}setErrorStatus(e){this.errorDidOccur=e}async canSelfUpdate(){return!1}startUpdateCheck(){Object(c.a)(),localStorage.removeItem("mx_defer_update"),a.a.dispatch({action:s.a.CheckUpdates,status:m.Checking})}installUpdate(){}shouldShowUpdate(e){if(l.a.userRegisteredWithinLastHours(24))return!1;try{const[t,n]=JSON.parse(localStorage.getItem("mx_defer_update"));return e!==t||Date.now()>n}catch(e){return!0}}deferUpdate(e){const t=new Date(Date.now()+864e5);t.setHours(8,0,0,0),localStorage.setItem("mx_defer_update",JSON.stringify([e,t.getTime()])),Object(c.a)()}supportsMultiLanguageSpellCheck(){return!1}supportsNotifications(){return!1}maySendNotifications(){return!1}loudNotification(e,t){}clearNotification(e){e.close&&e.close()}screenCaptureErrorString(){return"Not implemented"}supportsAutoLaunch(){return!1}async getAutoLaunchEnabled(){return!1}async setAutoLaunchEnabled(e){throw new Error("Unimplemented")}supportsWarnBeforeExit(){return!1}async shouldWarnBeforeExit(){return!1}async setWarnBeforeExit(e){throw new Error("Unimplemented")}supportsAutoHideMenuBar(){return!1}async getAutoHideMenuBarEnabled(){return!1}async setAutoHideMenuBarEnabled(e){throw new Error("Unimplemented")}supportsMinimizeToTray(){return!1}async getMinimizeToTrayEnabled(){return!1}async setMinimizeToTrayEnabled(e){throw new Error("Unimplemented")}getEventIndexingManager(){return null}async setLanguage(e){}setSpellCheckLanguages(e){}getSpellCheckLanguages(){return null}getAvailableSpellCheckLanguages(){return null}getSSOCallbackUrl(e){const t=new URL(window.location.href);return t.hash=e||"",t}startSingleSignOn(e,t,n,o){localStorage.setItem(u,e.getHomeserverUrl()),e.getIdentityServerUrl()&&localStorage.setItem(h,e.getIdentityServerUrl()),o&&localStorage.setItem(p,o);const r=this.getSSOCallbackUrl(n);window.location.href=e.getSsoLoginUrl(r.toString(),t,o)}onKeyDown(e){return!1}async getPickleKey(e,t){if(!window.crypto||!window.crypto.subtle)return null;let n;try{n=await Object(d.c)("pickleKey",[e,t])}catch(e){}if(!n)return null;if(!n.encrypted||!n.iv||!n.cryptoKey)return console.error("Badly formatted pickle key"),null;const o=new Uint8Array(e.length+t.length+1);for(let t=0;t{if(!e)return null;const{scorePassword:t}=await n.e(26).then(n.bind(null,1404));return t(e)},rules:[{key:"required",test:({value:e,allowEmpty:t})=>t||!!e,invalid:()=>Object(m.a)(this.props.labelEnterPassword)},{key:"complexity",test:async function({value:e},t){if(!e)return!1;const n=t.score>=this.props.minScore;return h.a.get().dangerously_allow_unsafe_and_insecure_passwords||n},valid:function(e){return e.score>=this.props.minScore?Object(m.a)(this.props.labelStrongPassword):Object(m.a)(this.props.labelAllowedButUnsafe)},invalid:function(e){if(!e)return null;const{feedback:t}=e;return t.warning||t.suggestions[0]||Object(m.a)("Keep going...")}}]})),s()(this,"onValidate",async e=>{const t=await this.validate(e);return this.props.onValidate(t),t})}render(){return l.a.createElement(g.a,{id:this.props.id,autoFocus:this.props.autoFocus,className:u()("mx_PassphraseField",this.props.className),ref:this.props.fieldRef,type:"password",autoComplete:"new-password",label:Object(m.a)(this.props.label),value:this.props.value,onChange:this.props.onChange,onValidate:this.onValidate})}},s()(r,"defaultProps",{label:Object(m.b)("Password"),labelEnterPassword:Object(m.b)("Enter password"),labelStrongPassword:Object(m.b)("Nice, strong password!"),labelAllowedButUnsafe:Object(m.b)("Password is allowed, but unsafe")}),o=i))||o;t.a=_},function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return h}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(258),c=n(88);var l=n(98);const d=[s.a.ERROR_INVALID_HOMESERVER,s.a.ERROR_INVALID_IDENTITY_SERVER];class u{constructor(){r()(this,"hsUrl",void 0),r()(this,"hsName",void 0),r()(this,"hsNameIsDifferent",void 0),r()(this,"isUrl",void 0),r()(this,"isDefault",void 0),r()(this,"isNameResolvable",void 0),r()(this,"warning",void 0)}}class h{static isLivelinessError(e){return!!e&&!!d.find(t=>"string"==typeof e?t===e:t===e.message)}static authComponentStateForError(e,t="login"){if(!e)return{serverIsAlive:!0,serverErrorIsFatal:!1,serverDeadError:null};let n=Object(c.a)("Cannot reach homeserver"),o=Object(c.a)("Ensure you have a stable internet connection, or get in touch with the server admin");if(!h.isLivelinessError(e)){const e=l.a.get().brand;n=Object(c.a)("Your %(brand)s is misconfigured",{brand:e}),o=Object(c.a)("Ask your %(brand)s admin to check your config for incorrect or duplicate entries.",{brand:e},{a:e=>a.a.createElement("a",{href:"https://github.com/vector-im/element-web/blob/master/docs/config.md",target:"_blank",rel:"noreferrer noopener"},e)})}let r=!0;return("string"==typeof e?e:e.message)===s.a.ERROR_INVALID_IDENTITY_SERVER&&(r=!1,n=Object(c.a)("Cannot reach identity server"),o="register"===t?Object(c.a)("You can register, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin."):"reset_password"===t?Object(c.a)("You can reset your password, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin."):Object(c.a)("You can log in, but some features will be unavailable until the identity server is back online. If you keep seeing this warning, check your configuration or contact a server admin.")),{serverIsAlive:!1,serverErrorIsFatal:r,serverDeadError:a.a.createElement("div",null,a.a.createElement("strong",null,n),a.a.createElement("div",null,o))}}static async validateServerConfigWithStaticUrls(e,t,n=!1){if(!e)throw Object(c.h)(Object(c.b)("No homeserver URL provided"));const o={"m.homeserver":{base_url:e}};t&&(o["m.identity_server"]={base_url:t});const r=await s.a.fromDiscoveryConfig(o),i=new URL(e).hostname;return h.buildValidatedConfigFromDiscovery(i,r,n,!0)}static async validateServerName(e){const t=await s.a.findClientConfig(e);return h.buildValidatedConfigFromDiscovery(e,t)}static buildValidatedConfigFromDiscovery(e,t,n=!1,o=!1){if(!t||!t["m.homeserver"])throw console.error("Ended up in a state of not knowing which homeserver to connect to."),Object(c.h)(Object(c.b)("Unexpected error resolving homeserver configuration"));const r=t["m.homeserver"],i=t["m.identity_server"],a=l.a.get().validated_server_config;let d=a&&a.isUrl;if(i&&i.state===s.a.SUCCESS)d=i.base_url;else if(i&&i.state!==s.a.PROMPT){if(console.error("Error determining preferred identity server URL:",i),i.state===s.a.FAIL_ERROR){if(-1!==s.a.ALL_ERRORS.indexOf(i.error))throw Object(c.h)(i.error);throw Object(c.h)(Object(c.b)("Unexpected error resolving identity server configuration"))}r.error=s.a.ERROR_INVALID_IDENTITY_SERVER,i.base_url&&(d=i.base_url)}if(r.state!==s.a.SUCCESS&&(console.error("Error processing homeserver config:",r),!n||!h.isLivelinessError(r.error))){if(-1!==s.a.ALL_ERRORS.indexOf(r.error))throw Object(c.h)(r.error);throw Object(c.h)(Object(c.b)("Unexpected error resolving homeserver configuration"))}const p=r.base_url;let m=e||r.server_name;const g=new URL(p);if(m||(m=g.hostname),!m)throw console.error("Failed to parse homeserver name from homeserver URL"),Object(c.h)(Object(c.b)("Unexpected error resolving homeserver configuration"));return function(e,t){const n=new e;return Object.assign(n,t),n}(u,{hsUrl:p,hsName:m,hsNameIsDifferent:g.hostname!==m,isUrl:d,isDefault:!1,warning:r.error,isNameResolvable:!o})}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(213);function r(e){return"string"==typeof e&&!!e&&"undefined"!==e&&"null"!==e||"number"==typeof e}function i(e){e=e||{},this.rooms={},this.groups={},this.users={},this.syncToken=null,this.filters={},this.accountData={},this.localStorage=e.localStorage,this._oobMembers={},this._clientOptions={}}i.prototype={getSyncToken:function(){return this.syncToken},isNewlyCreated:function(){return Promise.resolve(!0)},setSyncToken:function(e){this.syncToken=e},storeGroup:function(e){this.groups[e.groupId]=e},getGroup:function(e){return this.groups[e]||null},getGroups:function(){return Object.values(this.groups)},storeRoom:function(e){this.rooms[e.roomId]=e,e.currentState.on("RoomState.members",this._onRoomMember.bind(this));const t=this;e.currentState.getMembers().forEach((function(n){t._onRoomMember(null,e.currentState,n)}))},_onRoomMember:function(e,t,n){if("invite"===n.membership)return;const r=this.users[n.userId]||new o.a(n.userId);n.name&&(r.setDisplayName(n.name),n.events.member&&r.setRawDisplayName(n.events.member.getDirectionalContent().displayname)),n.events.member&&n.events.member.getContent().avatar_url&&r.setAvatarUrl(n.events.member.getContent().avatar_url),this.users[r.userId]=r},getRoom:function(e){return this.rooms[e]||null},getRooms:function(){return Object.values(this.rooms)},removeRoom:function(e){this.rooms[e]&&this.rooms[e].removeListener("RoomState.members",this._onRoomMember),delete this.rooms[e]},getRoomSummaries:function(){return Object.values(this.rooms).map((function(e){return e.summary}))},storeUser:function(e){this.users[e.userId]=e},getUser:function(e){return this.users[e]||null},getUsers:function(){return Object.values(this.users)},scrollback:function(e,t){return[]},storeEvents:function(e,t,n,o){},storeFilter:function(e){e&&(this.filters[e.userId]||(this.filters[e.userId]={}),this.filters[e.userId][e.filterId]=e)},getFilter:function(e,t){return this.filters[e]&&this.filters[e][t]?this.filters[e][t]:null},getFilterIdByName:function(e){if(!this.localStorage)return null;const t="mxjssdk_memory_filter_"+e;try{const e=this.localStorage.getItem(t);if(r(e))return e}catch(e){}return null},setFilterIdByName:function(e,t){if(!this.localStorage)return;const n="mxjssdk_memory_filter_"+e;try{r(t)?this.localStorage.setItem(n,t):this.localStorage.removeItem(n)}catch(e){}},storeAccountDataEvents:function(e){const t=this;e.forEach((function(e){t.accountData[e.getType()]=e}))},getAccountData:function(e){return this.accountData[e]},setSyncData:function(e){return Promise.resolve()},wantsSave:function(){return!1},save:function(e){},startup:function(){return Promise.resolve()},getSavedSync:function(){return Promise.resolve(null)},getSavedSyncToken:function(){return Promise.resolve(null)},deleteAllData:function(){return this.rooms={},this.users={},this.syncToken=null,this.filters={},this.accountData={},Promise.resolve()},getOutOfBandMembers:function(e){return Promise.resolve(this._oobMembers[e]||null)},setOutOfBandMembers:function(e,t){return this._oobMembers[e]=t,Promise.resolve()},clearOutOfBandMembers:function(){return this._oobMembers={},Promise.resolve()},getClientOptions:function(){return Promise.resolve(this._clientOptions)},storeClientOptions:function(e){return this._clientOptions=Object.assign({},e),Promise.resolve()}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(1);function r(e,t,n,r,i,a){if("string"!=typeof t||!t)return"";if(0!==t.indexOf("mxc://"))return a?t:"";let s=t.slice(6),c="/_matrix/media/r0/download/";const l={};n&&(l.width=Math.round(n)),r&&(l.height=Math.round(r)),i&&(l.method=i),Object.keys(l).length>0&&(c="/_matrix/media/r0/thumbnail/");const d=s.indexOf("#");let u="";return d>=0&&(u=s.substr(d),s=s.substr(0,d)),e+c+s+(0===Object.keys(l).length?"":"?"+o.f(l))+u}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o=n(99),r=n.n(o),i=n(104),a=n.n(i),s=n(87),c=n.n(s),l=n(109);const d=e=>{let{isExpanded:t,children:n,onClick:o,onContextMenu:i}=e,s=a()(e,["isExpanded","children","onClick","onContextMenu"]);return c.a.createElement(l.a,r()({},s,{onClick:o,onContextMenu:i||o,"aria-haspopup":!0,"aria-expanded":t}),n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return _}));var o,r,i,a=n(99),s=n.n(a),c=n(104),l=n.n(c),d=n(18),u=n.n(d),h=n(87),p=n.n(h),m=n(97),g=n.n(m),f=n(89);let _=Object(f.a)("views.elements.StyledRadioButton")((i=r=class extends p.a.PureComponent{render(){const e=this.props,{children:t,className:n,disabled:o,outlined:r}=e,i=l()(e,["children","className","disabled","outlined"]),a=g()("mx_RadioButton",n,{mx_RadioButton_disabled:o,mx_RadioButton_enabled:!o,mx_RadioButton_checked:this.props.checked,mx_RadioButton_outlined:r});return p.a.createElement("label",{className:a},p.a.createElement("input",s()({type:"radio",disabled:o},i)),p.a.createElement("div",null,p.a.createElement("div",null)),p.a.createElement("div",{className:"mx_RadioButton_content"},t),p.a.createElement("div",{className:"mx_RadioButton_spacer"}))}},u()(r,"defaultProps",{className:""}),o=i))||o},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){e.exports={}},function(e,t,n){var o=n(541),r=n(392);e.exports=Object.keys||function(e){return o(e,r)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCorners=t.offset=t.isEqual=t.addPosition=t.add=void 0;var o,r=n(217),i=(o=r)&&o.__esModule?o:{default:o};t.add=function(e,t){return{top:e.top+t.top,left:e.left+t.left,right:e.right+t.right,bottom:e.bottom+t.bottom}},t.addPosition=function(e,t){return(0,i.default)({},e,{right:e.right+t.x,bottom:e.bottom+t.y})},t.isEqual=function(e,t){return e.top===t.top&&e.right===t.right&&e.bottom===t.bottom&&e.left===t.left},t.offset=function(e,t){return{top:e.top+t.y,right:e.right+t.x,bottom:e.bottom+t.y,left:e.left+t.x}},t.getCorners=function(e){return[{x:e.left,y:e.top},{x:e.right,y:e.top},{x:e.left,y:e.bottom},{x:e.right,y:e.bottom}]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(141);t.default=function(e){var t=e.source,n=e.sourceEdge,r=e.destination,i=e.destinationEdge,a=e.destinationAxis,s=function(e){return(0,o.patch)(a.line,e[a[i]],e[a.crossAxisStart])},c=s(r),l=(0,o.absolute)((0,o.subtract)(t.center,s(t))),d=(0,o.patch)(a.line,("end"===n?-1:1)*l[a.line],l[a.crossLine]);return(0,o.add)(c,d)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));const o="filter_changed";let r;!function(e){e[e.Prefilter=0]="Prefilter",e[e.Runtime=1]="Runtime"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(94);function r(e){const t=t=>o.b.getValue(t,e.getRoomId());if(e.isRedacted()&&!t("showRedactions"))return!0;if(e.isRelation("m.replace"))return!0;const n=function(e){const t={isMemberEvent:"m.room.member"===e.getType()};if(!t.isMemberEvent)return t;const n=e.getContent(),o=e.getPrevContent(),r=n.membership!==o.membership;t.isJoin=r&&"join"===n.membership,t.isPart=r&&"leave"===n.membership&&e.getStateKey()===e.getSender();const i=!r&&"join"===n.membership;return t.isDisplaynameChange=i&&n.displayname!==o.displayname,t.isAvatarChange=i&&n.avatar_url!==o.avatar_url,t}(e);if(n.isMemberEvent){if((n.isJoin||n.isPart)&&!t("showJoinLeaves"))return!0;if(n.isAvatarChange&&!t("showAvatarChanges"))return!0;if(n.isDisplaynameChange&&!t("showDisplaynameChanges"))return!0}return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=void 0,t.isTag=function(e){return"tag"===e.type||"script"===e.type||"style"===e.type},t.Root="root",t.Text="text",t.Directive="directive",t.Comment="comment",t.Script="script",t.Style="style",t.Tag="tag",t.CDATA="cdata",t.Doctype="doctype"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.merge=t.contains=t.root=t.parseHTML=t.text=t.xml=t.html=void 0;var o=n(202),r=o.__importStar(n(424)),i=n(601),a=n(251),s=n(593),c=n(592);function l(e,t,n){var o,r;if(t)"string"==typeof t&&(t=i.select(t,null!==(r=null==e?void 0:e._root)&&void 0!==r?r:[],n));else{if(!(null===(o=null==e?void 0:e._root)||void 0===o?void 0:o.children))return"";t=e._root.children}return n.xmlMode||n._useHtmlParser2?c.render(t,n):s.render(t)}function d(e){if(Array.isArray(e))return!0;if("object"!=typeof e||!Object.prototype.hasOwnProperty.call(e,"length")||"number"!=typeof e.length||e.length<0)return!1;for(var t=0;tr.get(d(e)),c=["people","people","control","nature","foods","places","activity","objects","symbols","flags"],l={people:[],nature:[],foods:[],places:[],activity:[],objects:[],symbols:[],flags:[]};function d(e){return e.replace(/[\uFE00-\uFE0F]$/,"")}o.forEach(e=>{const t=c[e.group];l.hasOwnProperty(t)&&l[t].push(e),e.filterString=(`${e.annotation}\n${e.shortcodes.join("\n")}}\n${e.emoticon||""}\n`+e.unicode.split("‍").join("\n")).toLowerCase(),r.set(d(e.unicode),e),e.emoticon&&i.set(e.emoticon,e),e.shortcodes&&e.shortcodes.forEach(t=>{a.set(t,e)})});const u=o},function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,o=/^data:.+\,.+$/;function r(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function a(e){var n=e,o=r(e);if(o){if(!o.path)return e;n=o.path}for(var a,s=t.isAbsolute(n),c=n.split(/\/+/),l=0,d=c.length-1;d>=0;d--)"."===(a=c[d])?c.splice(d,1):".."===a?l++:l>0&&(""===a?(c.splice(d+1,l),l=0):(c.splice(d,2),l--));return""===(n=c.join("/"))&&(n=s?"/":"."),o?(o.path=n,i(o)):n}function s(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),s=r(e);if(s&&(e=s.path||"/"),n&&!n.scheme)return s&&(n.scheme=s.scheme),i(n);if(n||t.match(o))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var c="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=c,i(s)):c}t.urlParse=r,t.urlGenerate=i,t.normalize=a,t.join=s,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var o=e.lastIndexOf("/");if(o<0)return t;if((e=e.slice(0,o)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var c=!("__proto__"in Object.create(null));function l(e){return e}function d(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function u(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=c?l:function(e){return d(e)?"$"+e:e},t.fromSetString=c?l:function(e){return d(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var o=u(e.source,t.source);return 0!==o||0!==(o=e.originalLine-t.originalLine)||0!==(o=e.originalColumn-t.originalColumn)||n||0!==(o=e.generatedColumn-t.generatedColumn)||0!==(o=e.generatedLine-t.generatedLine)?o:u(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var o=e.generatedLine-t.generatedLine;return 0!==o||0!==(o=e.generatedColumn-t.generatedColumn)||n||0!==(o=u(e.source,t.source))||0!==(o=e.originalLine-t.originalLine)||0!==(o=e.originalColumn-t.originalColumn)?o:u(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!==(n=e.generatedColumn-t.generatedColumn)||0!==(n=u(e.source,t.source))||0!==(n=e.originalLine-t.originalLine)||0!==(n=e.originalColumn-t.originalColumn)?n:u(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var o=r(n);if(!o)throw new Error("sourceMapURL could not be parsed");if(o.path){var c=o.path.lastIndexOf("/");c>=0&&(o.path=o.path.substring(0,c+1))}t=s(i(o),t)}return a(t)}},function(e,t,n){"use strict";let o,r,i,a=n(340),{isClean:s}=n(429),c=n(342),l=n(341);class d extends l{push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}each(e){if(!this.proxyOf.nodes)return;let t,n,o=this.getIterator();for(;this.indexes[o]{let o;try{o=e(t,n)}catch(e){throw t.addToError(e)}return!1!==o&&t.walk&&(o=t.walk(e)),o})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("decl"===n.type&&e.test(n.prop))return t(n,o)}):this.walk((n,o)=>{if("decl"===n.type&&n.prop===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("rule"===n.type&&e.test(n.selector))return t(n,o)}):this.walk((n,o)=>{if("rule"===n.type&&n.selector===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,o)=>{if("atrule"===n.type&&e.test(n.name))return t(n,o)}):this.walk((n,o)=>{if("atrule"===n.type&&n.name===e)return t(n,o)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}insertBefore(e,t){let n,o=0===(e=this.index(e))&&"prepend",r=this.normalize(t,this.proxyOf.nodes[e],o).reverse();for(let t of r)this.proxyOf.nodes.splice(e,0,t);for(let t in this.indexes)n=this.indexes[t],e<=n&&(this.indexes[t]=n+r.length);return this.markDirty(),this}insertAfter(e,t){e=this.index(e);let n,o=this.normalize(t,this.proxyOf.nodes[e]).reverse();for(let t of o)this.proxyOf.nodes.splice(e+1,0,t);for(let t in this.indexes)n=this.indexes[t],e=e&&(this.indexes[n]=t-1);return this.markDirty(),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(o=>{t.props&&!t.props.includes(o.prop)||t.fast&&!o.value.includes(t.fast)||(o.value=o.value.replace(e,n))}),this.markDirty(),this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}normalize(e,t){if("string"==typeof e)e=function e(t){return t.map(t=>(t.nodes&&(t.nodes=e(t.nodes)),delete t.source,t))}(o(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if("root"===e.type){e=e.nodes.slice(0);for(let t of e)t.parent&&t.parent.removeChild(t,"ignore")}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new a(e)]}else if(e.selector)e=[new r(e)];else if(e.name)e=[new i(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new c(e)]}return e.map(e=>("function"!=typeof e.markDirty&&function e(t){"atrule"===t.type?Object.setPrototypeOf(t,i.prototype):"rule"===t.type?Object.setPrototypeOf(t,r.prototype):"decl"===t.type?Object.setPrototypeOf(t,a.prototype):"comment"===t.type&&Object.setPrototypeOf(t,c.prototype),t.nodes&&t.nodes.forEach(t=>{e(t)})}(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[s]&&function e(t){if(t[s]=!1,t.proxyOf.nodes)for(let n of t.proxyOf.nodes)e(n)}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=this,e))}getProxyProcessor(){return{set:(e,t,n)=>(e[t]===n||(e[t]=n,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t]}}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}}d.registerParse=e=>{o=e},d.registerRule=e=>{r=e},d.registerAtRule=e=>{i=e},e.exports=d,d.default=d},function(e,t,n){"use strict";let o,r,i=n(292);class a extends i{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}removeChild(e,t){let n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}normalize(e,t,n){let o=super.normalize(e);if(t)if("prepend"===n)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of o)e.raws.before=t.raws.before;return o}toResult(e={}){return new o(new r,this,e).stringify()}}a.registerLazyResult=e=>{o=e},a.registerProcessor=e=>{r=e},e.exports=a,a.default=a},function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var o=n(205),r=n(98),i=n(92);function a(){return r.a.get().validated_server_config.isUrl}function s(){const e=a();i.a.get().setAccountData("m.identity_server",{base_url:e})}async function c(e){let t;try{t=await i.a.get().getTerms(o.a.IS,e)}catch(e){if(console.error(e),"rejected"!==e.cors&&404!==e.httpStatus)throw e;t=null}return t&&t.policies&&Object.keys(t.policies).length>0}function l(){const e=i.a.get().getAccountData("m.identity_server");return e&&e.getContent()&&e.getContent().base_url}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var o=n(18),r=n.n(o),i=n(0),a=n(1);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function c(e){for(var t=1;t{const n=this._getOutgoingRoomKeyRequest(t);return n?(i.a.log(`already have key request outstanding for ${t.room_id} / ${t.session_id}: not sending another`),n):(i.a.log(`enqueueing key request for ${t.room_id} / `+t.session_id),this._outgoingRoomKeyRequests.push(e),e)})}getOutgoingRoomKeyRequest(e){return Promise.resolve(this._getOutgoingRoomKeyRequest(e))}_getOutgoingRoomKeyRequest(e){for(const t of this._outgoingRoomKeyRequests)if(a.c(t.requestBody,e))return t;return null}getOutgoingRoomKeyRequestByState(e){for(const t of this._outgoingRoomKeyRequests)for(const n of e)if(t.state===n)return Promise.resolve(t);return Promise.resolve(null)}getAllOutgoingRoomKeyRequestsByState(e){return Promise.resolve(this._outgoingRoomKeyRequests.filter(t=>t.state==e))}getOutgoingRoomKeyRequestsByTarget(e,t,n){const o=[];for(const r of this._outgoingRoomKeyRequests)for(const i of n)r.state===i&&r.recipients.includes({userId:e,deviceId:t})&&o.push(r);return Promise.resolve(o)}updateOutgoingRoomKeyRequest(e,t,n){for(const o of this._outgoingRoomKeyRequests)if(o.requestId===e)return o.state!=t?(i.a.warn(`Cannot update room key request from ${t} as it was already updated to `+o.state),Promise.resolve(null)):(Object.assign(o,n),Promise.resolve(o));return Promise.resolve(null)}deleteOutgoingRoomKeyRequest(e,t){for(let n=0;n{Object.entries(n).forEach(([n,o])=>{t(c(c({},o),{},{deviceKey:e,sessionId:n}))})})}storeEndToEndSession(e,t,n,o){let r=this._sessions[e];void 0===r&&(r={},this._sessions[e]=r),r[t]=n}async storeEndToEndSessionProblem(e,t,n){const o=this._sessionProblems[e]=this._sessionProblems[e]||[];o.push({type:t,fixed:n,time:Date.now()}),o.sort((e,t)=>e.time-t.time)}async getEndToEndSessionProblem(e,t){const n=this._sessionProblems[e]||[];if(!n.length)return null;const o=n[n.length-1];for(const e of n)if(e.time>t)return Object.assign({},e,{fixed:o.fixed});return o.fixed?null:o}async filterOutNotifiedErrorDevices(e){const t=this._notifiedErrorDevices,n=[];for(const o of e){const{userId:e,deviceInfo:r}=o;e in t?r.deviceId in t[e]||(n.push(o),t[e][r.deviceId]=!0):(n.push(o),t[e]={[r.deviceId]:!0})}return n}getEndToEndInboundGroupSession(e,t,n,o){const r=e+"/"+t;o(this._inboundGroupSessions[r]||null,this._inboundGroupSessionsWithheld[r]||null)}getAllEndToEndInboundGroupSessions(e,t){for(const e of Object.keys(this._inboundGroupSessions))t({senderKey:e.substr(0,43),sessionId:e.substr(44),sessionData:this._inboundGroupSessions[e]});t(null)}addEndToEndInboundGroupSession(e,t,n,o){const r=e+"/"+t;void 0===this._inboundGroupSessions[r]&&(this._inboundGroupSessions[r]=n)}storeEndToEndInboundGroupSession(e,t,n,o){this._inboundGroupSessions[e+"/"+t]=n}storeEndToEndInboundGroupSessionWithheld(e,t,n,o){const r=e+"/"+t;this._inboundGroupSessionsWithheld[r]=n}getEndToEndDeviceData(e,t){t(this._deviceData)}storeEndToEndDeviceData(e,t){this._deviceData=e}storeEndToEndRoom(e,t,n){this._rooms[e]=t}getEndToEndRooms(e,t){t(this._rooms)}getSessionsNeedingBackup(e){const t=[];for(const n in this._sessionsNeedingBackup)if(this._inboundGroupSessions[n]&&(t.push({senderKey:n.substr(0,43),sessionId:n.substr(44),sessionData:this._inboundGroupSessions[n]}),e&&n.length>=e))break;return Promise.resolve(t)}countSessionsNeedingBackup(){return Promise.resolve(Object.keys(this._sessionsNeedingBackup).length)}unmarkSessionsNeedingBackup(e){for(const t of e){const e=t.senderKey+"/"+t.sessionId;delete this._sessionsNeedingBackup[e]}return Promise.resolve()}markSessionsNeedingBackup(e){for(const t of e){const e=t.senderKey+"/"+t.sessionId;this._sessionsNeedingBackup[e]=!0}return Promise.resolve()}addSharedHistoryInboundGroupSession(e,t,n){const o=this._sharedHistoryInboundGroupSessions[e]||[];o.push([t,n]),this._sharedHistoryInboundGroupSessions[e]=o}getSharedHistoryInboundGroupSessions(e){return Promise.resolve(this._sharedHistoryInboundGroupSessions[e]||[])}doTxn(e,t,n){return Promise.resolve(n(null))}}},function(e,t,n){"use strict";(function(e){n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return h})),n.d(t,"e",(function(){return p})),n.d(t,"f",(function(){return m})),n.d(t,"g",(function(){return g})),n.d(t,"d",(function(){return f})),n.d(t,"c",(function(){return b})),n.d(t,"b",(function(){return v})),n.d(t,"a",(function(){return y})),n.d(t,"j",(function(){return E}));var o=n(18),r=n.n(o),i=n(1035),a=n(1),s=n(0),c=n(1036);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function d(e){for(var t=1;t0&&(g+="?"+f.join("&")),s.open("POST",g),this.useAuthorizationHeader&&s.setRequestHeader("Authorization","Bearer "+this.opts.accessToken),s.setRequestHeader("Content-Type",r),s.send(l),p=t.promise,p.abort=s.abort.bind(s)}else{const e={};o&&i&&(e.filename=i),p=this.authedRequest(n.callback,"POST","/upload",e,l,{prefix:"/_matrix/media/r0",headers:{"Content-Type":r},json:!1,bodyParser:m})}const g=this,f=p.finally((function(){for(let e=0;e{v&&(m&&c.a(m),m=c.b((function(){f=!0,g&&g.abort&&g.abort(),p.reject(new b({error:"Locally timed out waiting for a response",errcode:"ORG.MATRIX.JSSDK_TIMEOUT",timeout:v}))}),v))};y();const E=p.promise;try{g=this.opts.request({uri:n,method:t,withCredentials:!1,qs:o,qsStringifyOptions:i.qsStringifyOptions,useQuerystring:!0,body:r,json:!1,timeout:v,headers:l||{},_matrix_opts:this.opts},(function(t,n,o){if(v&&(c.a(m),f))return;_(p,e,s.opts.onlyData,h)(t,n,o)})),g&&("onprogress"in g&&(g.onprogress=e=>{y()}),g.abort&&(E.abort=g.abort.bind(g)))}catch(t){p.reject(t),e&&e(t)}return E}};const _=function(e,t,n,o){return t=t||function(){},function(r,a,s){if(r){"AbortError"===r.name||"aborted"===r||r instanceof b||(r=new v("request failed",r))}if(!r)try{(a.status||a.statusCode)>=400?r=function(e,t){const n=e.status||e.statusCode,o=function(e){let t;e.getResponseHeader?t=e.getResponseHeader("Content-Type"):e.headers&&(t=e.headers["content-type"]||null);if(!t)return null;try{return Object(i.parse)(t)}catch(e){throw new Error(`Error parsing Content-Type '${t}': ${e}`)}}(e);let r;if(o)if("application/json"===o.type){const e="object"==typeof t?t:JSON.parse(t);r=new b(e)}else"text/plain"===o.type&&(r=new Error(`Server returned ${n} error: ${t}`));r||(r=new Error(`Server returned ${n} error`));return r.httpStatus=n,r}(a,s):o&&(s=o(s))}catch(e){r=new Error("Error parsing server response: "+e)}if(r)e.reject(r),t(r);else{const o={code:a.status||a.statusCode,headers:a.headers,data:s};e.resolve(n?s:o),t(null,n?s:o)}}};class b extends Error{constructor(e){super("MatrixError: "+(e=e||{}).errcode),this.errcode=e.errcode,this.name=e.errcode||"Unknown error code",this.message=e.error||"Unknown message",this.data=e}}class v extends Error{constructor(e,t){super(e+(t?": "+t.message:"")),this._cause=t}get name(){return"ConnectionError"}get cause(){return this._cause}}class y extends Error{constructor(){super("Operation aborted")}get name(){return"AbortError"}}async function E(e,t){let n=0,o=null;for(;n0){const e=1e3*Math.pow(2,n);s.a.log(`network operation failed ${n} times, retrying in ${e}ms...`),await new Promise(t=>setTimeout(t,e))}return await t()}catch(e){if(!(e instanceof v))throw e;n+=1,o=e}throw o}}).call(this,n(7))},function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d}));var o=n(1),r=n(143);const i="undefined"!=typeof window&&window.crypto?window.crypto.subtle||window.crypto.webkitSubtle:null,a=new Uint8Array(8);function s(t,n){const r=Object(o.k)(),i=r.createHmac("sha256",a).update(t).digest(),s=e.alloc(1,1),c=r.createHmac("sha256",i).update(n,"utf-8").update(s).digest();s[0]=2;return[c,r.createHmac("sha256",i).update(c).update(n,"utf-8").update(s).digest()]}async function c(e,t){const n=await i.importKey("raw",e,{name:"HKDF"},!1,["deriveBits"]),o=await i.deriveBits({name:"HKDF",salt:a,info:(new TextEncoder).encode(t),hash:"SHA-256"},n,512),r=o.slice(0,32),s=o.slice(32),c=i.importKey("raw",r,{name:"AES-CTR"},!1,["encrypt","decrypt"]),l=i.importKey("raw",s,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]);return await Promise.all([c,l])}function l(...e){return i?async function(e,t,n,o){let a;o?a=Object(r.decodeBase64)(o):(a=new Uint8Array(16),window.crypto.getRandomValues(a)),a[8]&=127;const[s,l]=await c(t,n),d=(new TextEncoder).encode(e),u=await i.encrypt({name:"AES-CTR",counter:a,length:64},s,d),h=await i.sign({name:"HMAC"},l,u);return{iv:Object(r.encodeBase64)(a),ciphertext:Object(r.encodeBase64)(u),mac:Object(r.encodeBase64)(h)}}(...e):async function(e,t,n,i){const a=Object(o.k)();if(!a)throw new Error("No usable crypto implementation");let c;c=i?Object(r.decodeBase64)(i):a.randomBytes(16),c[8]&=127;const[l,d]=s(t,n),u=a.createCipheriv("aes-256-ctr",l,c),h=u.update(e,"utf-8","base64")+u.final("base64"),p=a.createHmac("sha256",d).update(h,"base64").digest("base64");return{iv:Object(r.encodeBase64)(c),ciphertext:h,mac:p}}(...e)}function d(...e){return i?async function(e,t,n){const[o,a]=await c(t,n),s=Object(r.decodeBase64)(e.ciphertext);if(!await i.verify({name:"HMAC"},a,Object(r.decodeBase64)(e.mac),s))throw new Error(`Error decrypting secret ${n}: bad MAC`);const l=await i.decrypt({name:"AES-CTR",counter:Object(r.decodeBase64)(e.iv),length:64},o,s);return(new TextDecoder).decode(new Uint8Array(l))}(...e):async function(e,t,n){const i=Object(o.k)();if(!i)throw new Error("No usable crypto implementation");const[a,c]=s(t,n);if(i.createHmac("sha256",c).update(e.ciphertext,"base64").digest("base64").replace(/=+$/g,"")!==e.mac.replace(/=+$/g,""))throw new Error(`Error decrypting secret ${n}: bad MAC`);const l=i.createDecipheriv("aes-256-ctr",a,Object(r.decodeBase64)(e.iv));return l.update(e.ciphertext,"base64","utf-8")+l.final("utf-8")}(...e)}}).call(this,n(35).Buffer)},function(e,t,n){"use strict";(function(e,o){n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return m}));var r=n(439),i=n(299),a=n(143),s=n(0);const c="m.qr_code.show.v1",l="m.qr_code.scan.v1";class d extends r.b{static factory(...e){return new d(...e)}static get NAME(){return"m.reciprocate.v1"}async _doVerification(){if(!this.startEvent)throw new Error("It is not currently possible to start verificationwith this method yet.");const{qrCodeData:e}=this.request;if(this.startEvent.getContent().secret!==e.encodedSharedSecret)throw Object(i.d)();await new Promise((e,t)=>{this.reciprocateQREvent={confirm:e,cancel:()=>t(Object(i.h)())},this.emit("show_reciprocate_qr",this.reciprocateQREvent)});const t={};switch(e.mode){case u:{const n=e.otherUserMasterKey;t["ed25519:"+n]=n;break}case h:{const n=this.request.targetDevice.deviceId;t["ed25519:"+n]=e.otherDeviceKey;break}case p:{const n=e.myMasterKey;t["ed25519:"+n]=n;break}}await this._verifyKeys(this.userId,t,(e,n,o)=>{const r=t[e];if(!r)throw Object(i.d)();if(o!==r)throw s.a.error("key ID from key info does not match"),Object(i.d)();for(const e in n.keys){if(!e.startsWith("ed25519"))continue;const o=t[e];if(!o)throw Object(i.d)();if(n.keys[e]!==o)throw s.a.error("master key does not match"),Object(i.d)()}})}}const u=0,h=1,p=2;class m{constructor(e,t,n,o,r,i){this._sharedSecret=t,this._mode=e,this._otherUserMasterKey=n,this._otherDeviceKey=o,this._myMasterKey=r,this._buffer=i}static async create(e,t){const n=m._generateSharedSecret(),o=m._determineMode(e,t);let r=null,i=null,a=null;if(o===u){r=t.getStoredCrossSigningForUser(e.otherUserId).getId("master")}else if(o===h)i=await m._getOtherDeviceKey(e,t);else if(o===p){const e=t.getUserId();a=t.getStoredCrossSigningForUser(e).getId("master")}const s=m._generateQrData(e,t,o,n,r,i,a),c=m._generateBuffer(s);return new m(o,n,r,i,a,c)}get buffer(){return this._buffer}get mode(){return this._mode}get otherDeviceKey(){return this._otherDeviceKey}get otherUserMasterKey(){return this._otherUserMasterKey}get myMasterKey(){return this._myMasterKey}get encodedSharedSecret(){return this._sharedSecret}static _generateSharedSecret(){const t=new Uint8Array(11);return e.crypto.getRandomValues(t),Object(a.encodeUnpaddedBase64)(t)}static async _getOtherDeviceKey(e,t){const n=t.getUserId(),o=e.targetDevice,r=o?o.deviceId:null,i=t.getStoredDevice(n,r);if(!i)throw new Error("could not find device "+r);return i.getFingerprint()}static _determineMode(e,t){const n=t.getUserId(),o=e.otherUserId;let r=u;if(n===o){r=t.checkUserTrust(n).isCrossSigningVerified()?h:p}return r}static _generateQrData(e,t,n,o,r,i,a){const s=t.getUserId(),c={prefix:"MATRIX",version:2,mode:n,transactionId:e.channel.transactionId,firstKeyB64:"",secondKeyB64:"",secretB64:o},l=t.getStoredCrossSigningForUser(s);return n===u?(c.firstKeyB64=l.getId("master"),c.secondKeyB64=r):n===h?(c.firstKeyB64=l.getId("master"),c.secondKeyB64=i):n===p&&(c.firstKeyB64=t.getDeviceEd25519Key(),c.secondKeyB64=a),c}static _generateBuffer(e){let t=o.alloc(0);const n=e=>{const n=o.from([e]);t=o.concat([t,n])},r=(e,n,r=!0)=>{const i=o.from(e,n);r&&(e=>{const n=o.alloc(2);n.writeInt16BE(e,0),t=o.concat([t,n])})(i.byteLength),t=o.concat([t,i])},i=e=>{const n=Object(a.decodeBase64)(e),r=o.from(n);t=o.concat([t,r])};return r(e.prefix,"ascii",!1),n(e.version),n(e.mode),r(e.transactionId,"utf-8"),i(e.firstKeyB64),i(e.secondKeyB64),i(e.secretB64),t}}}).call(this,n(7),n(35).Buffer)},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"h",(function(){return i})),n.d(t,"e",(function(){return a})),n.d(t,"g",(function(){return s})),n.d(t,"f",(function(){return c})),n.d(t,"d",(function(){return l})),n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return u}));var o=n(108);function r(e,t){return function(n){return function(e,t,n){const r=Object.assign({},{code:e,reason:t},n);return new o.b({type:"m.key.verification.cancel",content:r})}(e,t,n)}}const i=r("m.user","Cancelled by user"),a=r("m.timeout","Timed out"),s=(r("m.unknown_transaction","Unknown transaction"),r("m.unknown_method","Unknown method")),c=r("m.unexpected_message","Unexpected message"),l=r("m.key_mismatch","Key mismatch"),d=(r("m.user_error","User mismatch"),r("m.invalid_message","Invalid message"));function u(e){const t=e.getContent();if(t){const{code:e,reason:n}=t;return{code:e,reason:n}}return{code:"Unknown error",reason:"m.unknown"}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"c",(function(){return u}));var o=n(97),r=n.n(o),i=n(92),a=n(90),s=n(95);class c extends Error{}class l{constructor(e,t,n){this.serviceType=e,this.baseUrl=t,this.accessToken=n}}async function d(e,t=u){const n=e.map(e=>i.a.get().getTerms(e.serviceType,e.baseUrl)),o=(await Promise.all(n)).map((t,n)=>({service:e[n],policies:t.policies})),r=await i.a.get().getAccountData("m.accepted_terms");let a;a=r&&r.getContent()&&r.getContent().accepted?new Set(r.getContent().accepted):new Set;const s=[];for(const{service:e,policies:t}of o){const n={};for(const[e,o]of Object.entries(t)){let t=!1;for(const e of Object.keys(o))if("version"!==e&&a.has(o[e].url)){t=!0;break}t||(n[e]=o)}Object.keys(n).length>0&&s.push({service:e,policies:n})}const c=a.size;if(s.length>0){const e=await t(s,[...a]);console.log("User has agreed to URLs",e),e.forEach(e=>a.add(e))}else console.log("User has already agreed to all required policies");if(a.size!==c){const e={accepted:Array.from(a)};await i.a.get().setAccountData("m.accepted_terms",e)}const l=o.map(e=>{const t=Array.from(a).filter(t=>{for(const n of Object.values(e.policies))for(const e of Object.keys(n))if("version"!==e&&n[e].url===t)return!0;return!1});return 0===t.length?Promise.resolve():i.a.get().agreeToTerms(e.service.serviceType,e.service.baseUrl,e.service.accessToken,t)});return Promise.all(l)}function u(e,t,n){return new Promise((o,i)=>{console.log("Terms that need agreement",e);const l=a.getComponent("views.dialogs.TermsDialog");s.a.createTrackedDialog("Terms of Service","",l,{policiesAndServicePairs:e,agreedUrls:t,onFinished:(e,t)=>{e?o(t):i(new c)}},r()("mx_TermsDialog",n))})}},function(e,t,n){"use strict";(function(e){var o=n(8),r=n.n(o),i=n(92),a=n(262);class s extends r.a{constructor(){super(),this._persistentWidgetId=null,this._roomIdByWidgetId={},this.onRoomStateEvents=this.onRoomStateEvents.bind(this),this.dispatcherRef=null}start(){i.a.get().on("RoomState.events",this.onRoomStateEvents)}stop(){i.a.get()&&i.a.get().removeListener("RoomState.events",this.onRoomStateEvents),this._roomIdByWidgetId={}}onRoomStateEvents(e,t){"im.vector.modular.widgets"===e.getType()&&e.getStateKey()===this._persistentWidgetId&&this.destroyPersistentWidget(this._persistentWidgetId)}destroyPersistentWidget(e){if(e!==this._persistentWidgetId)return;const t=this._persistentWidgetId;a.a.instance.stopMessagingById(e),this.setWidgetPersistence(t,!1),this.delRoomId(t)}setWidgetPersistence(e,t){this._persistentWidgetId!==e||t?this._persistentWidgetId!==e&&t&&(this._persistentWidgetId=e):this._persistentWidgetId=null,this.emit("update")}getWidgetPersistence(e){return this._persistentWidgetId===e}getPersistentWidgetId(){return this._persistentWidgetId}getRoomId(e){return this._roomIdByWidgetId[e]}setRoomId(e,t){this._roomIdByWidgetId[e]=t,this.emit("update")}delRoomId(e){delete this._roomIdByWidgetId[e],this.emit("update")}}void 0===e.singletonActiveWidgetStore&&(e.singletonActiveWidgetStore=new s),t.a=e.singletonActiveWidgetStore}).call(this,n(7))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignRef=function(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}},function(e,t,n){"use strict";n.d(t,"b",(function(){return f})),n.d(t,"a",(function(){return _})),n.d(t,"f",(function(){return b})),n.d(t,"c",(function(){return v})),n.d(t,"d",(function(){return y})),n.d(t,"e",(function(){return E}));var o=n(87),r=n.n(o),i=n(110),a=n(115),s=n(95),c=n(647),l=n(472),d=n(717),u=n(132),h=n(88),p=n(468),m=n(232),g=n(149);const f=(e,t)=>{const n=e.getUserId();return"join"===t.getMyMembership()&&(t.currentState.maySendStateEvent(i.a.RoomAvatar,n)||t.currentState.maySendStateEvent(i.a.RoomName,n)||t.currentState.maySendStateEvent(i.a.RoomTopic,n)||t.currentState.maySendStateEvent(i.a.RoomJoinRules,n))},_=(e,t=!1)=>({type:i.a.SpaceParent,content:{via:Object(a.b)(e),canonical:t},state_key:e.roomId}),b=(e,t)=>{s.a.createTrackedDialog("Space Settings","",c.a,{matrixClient:e,space:t},null,!1,!0)},v=async(e,t)=>s.a.createTrackedDialog("Space Landing","Add Existing",l.b,{matrixClient:e,onCreateRoomClick:y,space:t},"mx_AddExistingToSpaceDialog_wrapper").finished,y=async(e,t)=>{const n=s.a.createTrackedDialog("Space Landing","Create Room",d.a,{defaultPublic:"public"===t.getJoinRule(),parentSpace:t}),[o,r]=await n.finished;return o&&await Object(u.d)(r),o},E=(e,t="")=>{if("public"===e.getJoinRule()){const t=s.a.createTrackedDialog("Space Invite","User Menu",m.a,{title:Object(h.a)("Invite to %(spaceName)s",{spaceName:e.name}),description:r.a.createElement(r.a.Fragment,null,r.a.createElement("span",null,Object(h.a)("Share your public space")),r.a.createElement(p.a,{space:e,onFinished:()=>t.close()})),fixedWidth:!1,button:!1,className:"mx_SpacePanel_sharePublicSpace",hasCloseButton:!0})}else Object(g.g)(e.roomId,t)}},function(e,t,n){"use strict";var o=n(99),r=n.n(o),i=n(104),a=n.n(i),s=n(87),c=n.n(s),l=n(97),d=n.n(l),u=n(90);t.a=e=>{let{checked:t,disabled:n=!1,onChange:o}=e,i=a()(e,["checked","disabled","onChange"]);const s=d()({mx_ToggleSwitch:!0,mx_ToggleSwitch_on:t,mx_ToggleSwitch_enabled:!n}),l=u.getComponent("elements.AccessibleButton");return c.a.createElement(l,r()({},i,{className:s,onClick:()=>{n||o(!t)},role:"switch","aria-checked":t,"aria-disabled":n}),c.a.createElement("div",{className:"mx_ToggleSwitch_ball"}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o,r=n(87),i=(o=n(1289))&&"object"==typeof o&&"default"in o?o.default:o,a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function s(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n{if(this._usingLocalWidget())return!0;if(!e.room)return!0;const t=C.b.getValue("allowedWidgets",e.room.roomId);return void 0===t[e.app.eventId]?e.userId===e.creatorUserId:!!t[e.app.eventId]}),s()(this,"onAllowedWidgetsChange",()=>{const e=this.hasPermissionToLoad(this.props);this.state.hasPermissionToLoad&&!e&&(E.a.destroyPersistentWidget(this.props.app.id),x.a.destroyElement(this._persistKey),this._sgWidget.stop()),this.setState({hasPermissionToLoad:e})}),s()(this,"_iframeRefChange",e=>{this.iframe=e,e?this._sgWidget.start(e):this._resetWidget(this.props)}),s()(this,"_onWidgetPrepared",()=>{this.setState({loading:!1})}),s()(this,"_onWidgetReady",()=>{O.a.JITSI.matches(this.props.app.type)&&this._sgWidget.widgetApi.transport.send(R.a.ClientReady,{})}),s()(this,"_onAction",e=>{if(e.widgetId===this.props.app.id)switch(e.action){case"m.sticker":this._sgWidget.widgetApi.hasCapability(I.MatrixCapabilities.StickerSending)?y.a.dispatch({action:"post_sticker_message",data:e.data}):console.warn("Ignoring sticker message. Invalid capability")}}),s()(this,"_grantWidgetPermission",()=>{const e=this.props.room.roomId;console.info("Granting permission for widget to load: "+this.props.app.eventId);const t=C.b.getValue("allowedWidgets",e);t[this.props.app.eventId]=!0;const n=C.b.firstSupportedLevel("allowedWidgets");C.b.setValue("allowedWidgets",e,n,t).then(()=>{this.setState({hasPermissionToLoad:!0}),this._startWidget()}).catch(e=>{console.error(e)})}),s()(this,"_onPopoutWidgetClick",()=>{O.a.JITSI.matches(this.props.app.type)&&this._endWidgetActions().then(()=>{this.iframe&&(this.iframe.src=this._sgWidget.embedUrl,this.setState({}))}),Object.assign(document.createElement("a"),{target:"_blank",href:this._sgWidget.popoutUrl,rel:"noreferrer noopener"}).click()}),s()(this,"_onContextMenuClick",()=>{this.setState({menuDisplayed:!0})}),s()(this,"_closeContextMenu",()=>{this.setState({menuDisplayed:!1})}),this._persistKey=Object(x.b)(this.props.app.id),this._sgWidget=new k.b(this.props),this._sgWidget.on("preparing",this._onWidgetPrepared),this._sgWidget.on("ready",this._onWidgetReady),this.iframe=null,this.state=this._getNewState(e),this._contextMenuButton=Object(d.createRef)(),this._allowedWidgetsWatchRef=C.b.watchSetting("allowedWidgets",null,this.onAllowedWidgetsChange)}_getNewState(e){return{initialising:!0,loading:this.props.waitForIframeLoad&&!x.a.isMounted(this._persistKey),hasPermissionToLoad:this.hasPermissionToLoad(e),error:null,widgetPageTitle:e.widgetPageTitle,menuDisplayed:!1}}isMixedContent(){const e=window.location.protocol,t=l.a.parse(this.props.app.url).protocol;return"https:"===e&&"https:"!==t&&(console.warn("Refusing to load mixed-content app:",e,t,window.location,this.props.app.url),!0)}componentDidMount(){this.state.hasPermissionToLoad&&this._startWidget(),this.dispatcherRef=y.a.register(this._onAction)}componentWillUnmount(){this.dispatcherRef&&y.a.unregister(this.dispatcherRef),E.a.getWidgetPersistence(this.props.app.id)||(E.a.destroyPersistentWidget(this.props.app.id),x.a.destroyElement(this._persistKey)),this._sgWidget&&this._sgWidget.stop(),C.b.unwatchSetting(this._allowedWidgetsWatchRef)}_resetWidget(e){this._sgWidget&&this._sgWidget.stop(),this._sgWidget=new k.b(e),this._sgWidget.on("preparing",this._onWidgetPrepared),this._sgWidget.on("ready",this._onWidgetReady),this._startWidget()}_startWidget(){this._sgWidget.prepare().then(()=>{this.setState({initialising:!1})})}UNSAFE_componentWillReceiveProps(e){e.app.url!==this.props.app.url&&(this._getNewState(e),this.state.hasPermissionToLoad&&this._resetWidget(e)),e.widgetPageTitle!==this.props.widgetPageTitle&&this.setState({widgetPageTitle:e.widgetPageTitle})}async _endWidgetActions(){this.iframe&&(this.iframe.src="about:blank"),O.a.JITSI.matches(this.props.app.type)&&y.a.dispatch({action:"hangup_conference"}),x.a.destroyElement(this._persistKey),this._sgWidget.stop({forceDestroy:!0})}formatAppTileName(){let e="No name";return this.props.app.name&&this.props.app.name.trim()&&(e=this.props.app.name.trim()),e}_usingLocalWidget(){return O.a.JITSI.matches(this.props.app.type)}_getTileTitle(){const e=this.formatAppTileName(),t=u.a.createElement("span",null," - ");let n="";return this.state.widgetPageTitle&&this.state.widgetPageTitle!==this.formatAppTileName()&&(n=this.state.widgetPageTitle),u.a.createElement("span",null,u.a.createElement(A.a,{app:this.props.app}),u.a.createElement("b",null,e),u.a.createElement("span",null,n?t:"",n))}render(){let e;const t="mx_AppTileBody"+(this.props.miniMode?"_mini ":" "),n={};this.props.pointerEvents&&(n["pointer-events"]=this.props.pointerEvents);const o=u.a.createElement("div",{className:"mx_AppLoading_spinner_fadeIn"},u.a.createElement(v.a,{message:Object(f.a)("Loading...")}));if(this.state.hasPermissionToLoad)this.state.initialising?e=u.a.createElement("div",{className:t+(this.state.loading?"mx_AppLoading":""),style:n},o):this.isMixedContent()?e=u.a.createElement("div",{className:t,style:n},u.a.createElement(b.a,{errorMsg:"Error - Mixed content"})):(e=u.a.createElement("div",{className:t+(this.state.loading?"mx_AppLoading":""),style:n},this.state.loading&&o,u.a.createElement("iframe",{allow:"microphone; camera; encrypted-media; autoplay; display-capture; clipboard-write;",ref:this._iframeRefChange,src:this._sgWidget.embedUrl,allowFullScreen:!0,sandbox:"allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-presentation"})),this.props.userWidget||(e=u.a.createElement("div",{className:"mx_AppTile_persistedWrapper"},u.a.createElement(x.a,{persistKey:this._persistKey},e))));else{const o=m.a.get().isRoomEncrypted(this.props.room.roomId);e=u.a.createElement("div",{className:t,style:n},u.a.createElement(_.a,{roomId:this.props.room.roomId,creatorUserId:this.props.creatorUserId,url:this._sgWidget.embedUrl,isRoomEncrypted:o,onPermissionGranted:this._grantWidgetPermission}))}let r,a;return r=this.props.miniMode?{mx_AppTile_mini:!0}:this.props.fullWidth?{mx_AppTileFullWidth:!0}:{mx_AppTile:!0},r=w()(r),this.state.menuDisplayed&&(a=u.a.createElement(D.a,i()({},Object(T.k)(this._contextMenuButton.current.getBoundingClientRect(),null),{app:this.props.app,onFinished:this._closeContextMenu,showUnpin:!this.props.userWidget,userWidget:this.props.userWidget}))),u.a.createElement(u.a.Fragment,null,u.a.createElement("div",{className:r,id:this.props.app.id},this.props.showMenubar&&u.a.createElement("div",{className:"mx_AppTileMenuBar"},u.a.createElement("span",{className:"mx_AppTileMenuBarTitle",style:{pointerEvents:!!this.props.handleMinimisePointerEvents&&"all"}},this.props.showTitle&&this._getTileTitle()),u.a.createElement("span",{className:"mx_AppTileMenuBarWidgets"},this.props.showPopout&&u.a.createElement(g.a,{className:"mx_AppTileMenuBar_iconButton mx_AppTileMenuBar_iconButton_popout",title:Object(f.a)("Popout widget"),onClick:this._onPopoutWidgetClick}),u.a.createElement(T.c,{className:"mx_AppTileMenuBar_iconButton mx_AppTileMenuBar_iconButton_menu",label:Object(f.a)("Options"),isExpanded:this.state.menuDisplayed,inputRef:this._contextMenuButton,onClick:this._onContextMenuClick}))),e),a)}})||o;F.displayName="AppTile",F.propTypes={app:p.a.object.isRequired,room:p.a.object,fullWidth:p.a.bool,miniMode:p.a.bool,userId:p.a.string.isRequired,creatorUserId:p.a.string,waitForIframeLoad:p.a.bool,showMenubar:p.a.bool,onEditClick:p.a.func,onDeleteClick:p.a.func,onMinimiseClick:p.a.func,showTitle:p.a.bool,handleMinimisePointerEvents:p.a.bool,showPopout:p.a.bool,userWidget:p.a.bool,pointerEvents:p.a.string},F.defaultProps={waitForIframeLoad:!0,showMenubar:!0,showTitle:!0,showPopout:!0,handleMinimisePointerEvents:!1,userWidget:!1,miniMode:!1}},function(e,t,n){"use strict";n.r(t),n.d(t,"containsEmoji",(function(){return o}));const o=(e,t)=>t.some(t=>e.body&&e.body.includes(t))},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(87),r=n.n(o),i=n(97),a=n.n(i),s=n(88),c=n(96),l=n(94),d=n(102),u=n(210),h=n(95),p=n(475),m=n(98);const g=({onClick:e})=>e?r.a.createElement(u.a,{class:a()("mx_BetaCard_betaPill",{mx_BetaCard_betaPill_clickable:!!e}),tooltip:r.a.createElement("div",null,r.a.createElement("div",{className:"mx_Tooltip_title"},Object(s.a)("Spaces is a beta feature")),r.a.createElement("div",{className:"mx_Tooltip_sub"},Object(s.a)("Tap for more info"))),onClick:e,tooltipProps:{yOffset:-10}},Object(s.a)("Beta")):r.a.createElement("span",{className:a()("mx_BetaCard_betaPill",{mx_BetaCard_betaPill_clickable:!!e}),onClick:e},Object(s.a)("Beta"));t.b=({title:e,featureId:t})=>{const n=l.b.getBetaInfo(t);if(!n)return null;const{title:o,caption:i,disclaimer:a,image:u,feedbackLabel:f,feedbackSubheading:_}=n,b=l.b.getValue(t);let v;return b&&f&&_&&m.a.get().bug_report_endpoint_url&&(v=r.a.createElement(c.a,{onClick:()=>{h.a.createTrackedDialog("Beta Feedback",t,p.a,{featureId:t})},kind:"primary"},Object(s.a)("Feedback"))),r.a.createElement("div",{className:"mx_BetaCard"},r.a.createElement("div",null,r.a.createElement("h3",{className:"mx_BetaCard_title"},e||Object(s.a)(o),r.a.createElement(g,null)),r.a.createElement("span",{className:"mx_BetaCard_caption"},Object(s.a)(i)),r.a.createElement("div",null,v,r.a.createElement(c.a,{onClick:()=>l.b.setValue(t,null,d.a.DEVICE,!b),kind:v?"primary_outline":"primary"},b?Object(s.a)("Leave the beta"):Object(s.a)("Join the beta"))),a&&r.a.createElement("div",{className:"mx_BetaCard_disclaimer"},a(b))),r.a.createElement("img",{src:u,alt:""}))}},function(e,t,n){"use strict";(function(e){n.d(t,"h",(function(){return P})),n.d(t,"b",(function(){return L})),n.d(t,"a",(function(){return j})),n.d(t,"d",(function(){return U})),n.d(t,"c",(function(){return B})),n.d(t,"k",(function(){return V})),n.d(t,"l",(function(){return H})),n.d(t,"e",(function(){return z})),n.d(t,"i",(function(){return Q})),n.d(t,"m",(function(){return J})),n.d(t,"g",(function(){return X})),n.d(t,"f",(function(){return Z})),n.d(t,"j",(function(){return te})),n.d(t,"n",(function(){return oe}));var o=n(150),r=n(221),i=n(297),a=n(92),s=n(226),c=n(235),l=n(688),d=n(126),u=n(263),h=n(454),p=n(1335),m=n(93),g=n(122),f=n(95),_=n(90),b=n(301),v=n(113),y=n(310),E=n(364),S=n(94),w=n(689),C=n(144),T=n(175),x=n(481),O=n(1414),k=n(445),R=n(273),I=n(696),D=n(114),A=n(133),N=n(1340),F=n(127),M=n(88);async function P(e={}){try{let t=e.enableGuest||!1;const n=e.guestHsUrl,r=e.guestIsUrl,i=e.fragmentQueryParams||{},a=e.defaultDeviceDisplayName;if(t&&!n&&(console.warn("Cannot enable guest access: can't determine HS URL to use"),t=!1),t&&i.guest_user_id&&i.guest_access_token)return console.log("Using guest access credentials"),K({userId:i.guest_user_id,accessToken:i.guest_access_token,homeserverUrl:n,identityServerUrl:r,guest:!0},!0).then(()=>!0);return!!await V({ignoreGuest:Boolean(e.ignoreGuest)})||!!t&&function(e,t,n){console.log("Doing guest login on "+e);return Object(o.createClient)({baseUrl:e}).registerGuest({body:{initial_device_display_name:n}}).then(n=>(console.log("Registered as guest: "+n.user_id),K({userId:n.user_id,deviceId:n.device_id,accessToken:n.access_token,homeserverUrl:e,identityServerUrl:t,guest:!0},!0).then(()=>!0)),e=>(console.error("Failed to register as guest",e),!1))}(n,r,a)}catch(e){return!(e instanceof W)&&async function(e){console.error("Unable to load session",e);const t=_.getComponent("views.dialogs.SessionRestoreErrorDialog"),n=f.a.createTrackedDialog("Session Restore Error","",t,{error:e.message}),[o]=await n.finished;if(o)return await ne(),!1;return P()}(e)}}async function L(){const{hsUrl:e,userId:t,hasAccessToken:n,isGuest:o}=await B();return e&&t&&n?[t,o]:[null,null]}function j(e,t,n){if(!e.loginToken)return Promise.resolve(!1);const r=localStorage.getItem(R.a),i=localStorage.getItem(R.c);return r?Object(y.c)(r,i,"m.login.token",{token:e.loginToken,initial_device_display_name:t}).then((function(e){return console.log("Logged in with token"),ne().then(async()=>(await Y(e),sessionStorage.setItem("mx_fresh_login",String(!0)),!0))})).catch(e=>(f.a.createTrackedDialog("SSO","Token Rejected",F.a,{title:Object(M.a)("We couldn't log you in"),description:"ConnectionError"===e.name?Object(M.a)("Your homeserver was unreachable and was not able to log you in. Please try again. If this continues, please contact your homeserver administrator."):Object(M.a)("Your homeserver rejected your log in attempt. This could be due to things just taking too long. Please try again. If this continues, please contact your homeserver administrator."),button:Object(M.a)("Try again"),onFinished:e=>{if(e){const e=Object(o.createClient)({baseUrl:r,idBaseUrl:i}),t=localStorage.getItem(R.b)||void 0;v.a.get().startSingleSignOn(e,"sso",n,t)}}}),console.error("Failed to log in with login token:"),console.error(e),!1)):(console.warn("Cannot log in with token: can't determine HS URL to use"),f.a.createTrackedDialog("SSO","Unknown HS",F.a,{title:Object(M.a)("We couldn't log you in"),description:Object(M.a)("We asked the browser to remember which homeserver you use to let you sign in, but unfortunately your browser has forgotten it. Go to the sign in page and try again."),button:Object(M.a)("Try again")}),Promise.resolve(!1))}function U(e){if(e.reason===r.b.TOGGLED_LAZY_LOADING)return Promise.resolve().then(()=>{if(e.value){const e=_.getComponent("views.dialogs.LazyLoadingResyncDialog");return new Promise(t=>{f.a.createDialog(e,{onFinished:t})})}{const e=_.getComponent("views.dialogs.LazyLoadingDisabledDialog");return new Promise(t=>{f.a.createDialog(e,{onFinished:t,host:window.location.host})})}}).then(()=>a.a.get().store.deleteAllData()).then(()=>{v.a.get().reload()})}async function B(){const e=localStorage.getItem("mx_hs_url"),t=localStorage.getItem("mx_is_url");let n;try{n=await E.c("account","mx_access_token")}catch(e){}if(!n&&(n=localStorage.getItem("mx_access_token"),n))try{await E.d("account","mx_access_token",n),localStorage.removeItem("mx_access_token")}catch(e){}const o="true"===localStorage.getItem("mx_has_access_token")||!!n,r=localStorage.getItem("mx_user_id"),i=localStorage.getItem("mx_device_id");let a;return a=null!==localStorage.getItem("mx_is_guest")?"true"===localStorage.getItem("mx_is_guest"):"true"===localStorage.getItem("matrix-is-guest"),{hsUrl:e,isUrl:t,hasAccessToken:o,accessToken:n,userId:r,deviceId:i,isGuest:a}}async function G(e){const t=new Uint8Array(e.length);for(let n=0;n{f.a.createTrackedDialog("Storage evicted","",e,{onFinished:t})})}())throw await ne(),new W("Aborting login in progress because of storage inconsistency")}async function V(e){const t=null==e?void 0:e.ignoreGuest;if(!localStorage)return!1;const{hsUrl:n,isUrl:o,hasAccessToken:r,accessToken:a,userId:s,deviceId:c,isGuest:l}=await B();if(r&&!a&&q(),a&&s&&n){if(t&&l)return console.log("Ignoring stored guest account: "+s),!1;let e=a;const r=await v.a.get().getPickleKey(s,c);if(r){if(console.log("Got pickle key"),"string"!=typeof a){const t=await G(r);e=await Object(i.a)(a,t,"access_token"),t.fill(0)}}else console.log("No pickle key available");const d="true"===sessionStorage.getItem("mx_fresh_login");return sessionStorage.removeItem("mx_fresh_login"),console.log("Restoring session for "+s),await K({userId:s,deviceId:c,accessToken:e,homeserverUrl:n,identityServerUrl:o,guest:l,pickleKey:r,freshLogin:d},!1),!0}return console.log("No previous session found."),!1}async function H(e){e.freshLogin=!0,oe();const t=e.userId&&e.deviceId?await v.a.get().createPickleKey(e.userId,e.deviceId):null;return t?console.log("Created pickle key"):console.log("Pickle key not created"),K(Object.assign({},e,{pickleKey:t}),!0)}function z(e){const t=a.a.get().getUserId(),n=a.a.get().getDeviceId();oe(),localStorage.removeItem("mx_soft_logout"),$=!1;const o=e.userId!==t||e.deviceId!==n;return o&&console.warn("Clearing all data: Old session belongs to a different user/session"),K(e,o)}async function K(e,t){e.guest=Boolean(e.guest);const n=X();console.log("setLoggedIn: mxid: "+e.userId+" deviceId: "+e.deviceId+" guest: "+e.guest+" hs: "+e.homeserverUrl+" softLogout: "+n," freshLogin: "+e.freshLogin),m.a.dispatch({action:"on_logging_in"},!0),t&&await ne();const o=await E.a();o.dataInLocalStorage&&o.cryptoInited&&!o.dataInCryptoStore&&await q(),d.a.setLoggedIn(e.guest,e.homeserverUrl),a.a.replaceUsingCreds(e);const r=a.a.get();if(e.freshLogin&&S.b.getValue("feature_dehydration")){const t=await r.rehydrateDevice();t&&(e.deviceId=t),delete e.freshLogin}if(localStorage)try{await Y(e),sessionStorage.removeItem("mx_fresh_login")}catch(e){console.warn("Error using local storage: can't persist session!",e)}else console.warn("No local storage available: can't persist session!");return m.a.dispatch({action:"on_logged_in"}),await ee(!n),r}class W extends Error{}async function Y(e){var t;if(localStorage.setItem("mx_hs_url",e.homeserverUrl),e.identityServerUrl&&localStorage.setItem("mx_is_url",e.identityServerUrl),localStorage.setItem("mx_user_id",e.userId),localStorage.setItem("mx_is_guest",JSON.stringify(e.guest)),e.accessToken?localStorage.setItem("mx_has_access_token","true"):localStorage.deleteItem("mx_has_access_token"),e.pickleKey){let t;try{const n=await G(e.pickleKey);t=await Object(i.b)(e.accessToken,n,"access_token"),n.fill(0)}catch(e){console.warn("Could not encrypt access token",e)}try{await E.d("account","mx_access_token",t||e.accessToken)}catch(t){localStorage.setItem("mx_access_token",e.accessToken)}localStorage.setItem("mx_has_pickle_key",String(!0))}else{try{await E.d("account","mx_access_token",e.accessToken)}catch(t){localStorage.setItem("mx_access_token",e.accessToken)}localStorage.getItem("mx_has_pickle_key")&&console.error("Expected a pickle key, but none provided. Encryption may not work.")}e.deviceId&&localStorage.setItem("mx_device_id",e.deviceId),null===(t=s.a.persistCredentials)||void 0===t||t.call(s.a,e),console.log("Session persisted for "+e.userId)}let $=!1;function Q(){if(!a.a.get())return;if(D.a.instance.disabled||D.a.instance.enable(!0),a.a.get().isGuest())return void e(()=>te());$=!0;const t=a.a.get();v.a.get().destroyPickleKey(t.getUserId(),t.getDeviceId()),t.logout().then(te,e=>{console.log("Failed to call logout API: token will not be invalidated"),te()})}function J(){a.a.get()&&(localStorage.setItem("mx_soft_logout","true"),console.log("Soft logout initiated"),$=!0,m.a.dispatch({action:"on_client_not_viable"}),oe(!1))}function X(){return"true"===localStorage.getItem("mx_soft_logout")}function Z(){return $}async function ee(e=!0){console.log("Lifecycle: Starting MatrixClient"),m.a.dispatch({action:"will_start_client"},!0),w.a.sharedInstance().reset(),C.a.sharedInstance().reset(),u.default.start(),h.a.sharedInstance().start(),g.a.makeShared().start(),T.a.sharedInstance().startWatching(),b.a.start(),A.d.sharedInstance().start(),x.a.sharedInstance().start(),e?(await c.a.init(),await a.a.start()):(console.warn("Caller requested only auxiliary services be started"),await a.a.assign()),O.a.sharedInstance().start(),S.b.getValue("lowBandwidth")||p.a.start(),await k.a.getInstance().start(),m.a.dispatch({action:"client_started"}),X()&&J()}async function te(){var e;$=!1,m.a.dispatch({action:"on_logged_out"},!0),oe(),await ne({deleteEverything:!0}),null===(e=N.a.onLoggedOutAndStorageCleared)||void 0===e||e.call(N.a)}async function ne(e){if(d.a.disable(),window.localStorage){const t=I.a.instance.getWireInvites();window.localStorage.clear();try{await E.b("account","mx_access_token")}catch(e){}null!=e&&e.deleteEverything||t.forEach(e=>{const t=e.roomId;delete e.roomId,I.a.instance.storeInvite(t,e)})}window.sessionStorage&&window.sessionStorage.clear();const t=Object(l.a)({baseUrl:""});await c.a.deleteEventIndex(),await t.clearStores()}function oe(e=!0){u.default.stop(),A.d.sharedInstance().stop(),h.a.sharedInstance().stop(),w.a.sharedInstance().reset(),p.a.stop(),b.a.stop(),T.a.sharedInstance().stopWatching(),x.a.sharedInstance().stop(),O.a.sharedInstance().stop(),g.a.shared()&&g.a.shared().stop(),c.a.stop();const t=a.a.get();t&&(t.stopClient(),t.removeAllListeners(),e&&(a.a.unset(),c.a.unset()))}}).call(this,n(168).setImmediate)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l}));var o=n(18),r=n.n(o),i=n(150),a=n(226);let s;!function(e){e.Gitlab="gitlab",e.Github="github",e.Apple="apple",e.Google="google",e.Facebook="facebook",e.Twitter="twitter"}(s||(s={}));class c{constructor(e,t,n,o){r()(this,"hsUrl",void 0),r()(this,"isUrl",void 0),r()(this,"fallbackHsUrl",void 0),r()(this,"flows",void 0),r()(this,"defaultDeviceDisplayName",void 0),r()(this,"tempClient",void 0),this.hsUrl=e,this.isUrl=t,this.fallbackHsUrl=n,this.flows=[],this.defaultDeviceDisplayName=o.defaultDeviceDisplayName,this.tempClient=null}getHomeserverUrl(){return this.hsUrl}getIdentityServerUrl(){return this.isUrl}setHomeserverUrl(e){this.tempClient=null,this.hsUrl=e}setIdentityServerUrl(e){this.tempClient=null,this.isUrl=e}createTemporaryClient(){return this.tempClient?this.tempClient:this.tempClient=Object(i.createClient)({baseUrl:this.hsUrl,idBaseUrl:this.isUrl})}async getFlows(){const e=this.createTemporaryClient(),{flows:t}=await e.loginFlows();return this.flows=t,this.flows}loginViaPassword(e,t,n,o){const r=e.indexOf("@")>0;let i;i=t&&n?{type:"m.id.phone",country:t,phone:n,number:n}:r?{type:"m.id.thirdparty",medium:"email",address:e}:{type:"m.id.user",user:e};const a={password:o,identifier:i,initial_device_display_name:this.defaultDeviceDisplayName},s=e=>l(this.fallbackHsUrl,this.isUrl,"m.login.password",a).catch(t=>{throw console.log("fallback HS login failed",t),e});let c=null;return l(this.hsUrl,this.isUrl,"m.login.password",a).catch(e=>{if(c=e,403===e.httpStatus&&this.fallbackHsUrl)return s(c);throw c}).catch(e=>{throw console.log("Login failed",e),e})}}async function l(e,t,n,o){var r;const s=Object(i.createClient)({baseUrl:e,idBaseUrl:t}),c=await s.login(n,o),l=c.well_known;l&&(l["m.homeserver"]&&l["m.homeserver"].base_url&&(e=l["m.homeserver"].base_url,console.log(`Overrode homeserver setting with ${e} from login response`)),l["m.identity_server"]&&l["m.identity_server"].base_url&&(t=l["m.identity_server"].base_url,console.log(`Overrode IS setting with ${t} from login response`)));const d={homeserverUrl:e,identityServerUrl:t,userId:c.user_id,deviceId:c.device_id,accessToken:c.access_token};return null===(r=a.a.examineLoginResponse)||void 0===r||r.call(a.a,c,d),d}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return i}));var o=n(88);function r(e,t,n,r){let i=n[e];void 0===i&&(i=n[""]);const a=e=>t?React.createElement("a",{href:t,target:"_blank",rel:"noreferrer noopener"},e):e;return i.includes("")?Object(o.a)(i,{},Object.assign({a:a},r)):Object(o.a)(i,{},r)}function i(e){if("M_RESOURCE_LIMIT_EXCEEDED"===e.errcode){const t=r(e.data.limit_type,e.data.admin_contact,{monthly_active_user:Object(o.b)("This homeserver has hit its Monthly Active User limit."),hs_blocked:Object(o.b)("This homeserver has been blocked by its administrator."),"":Object(o.b)("This homeserver has exceeded one of its resource limits.")}),n=r(e.data.limit_type,e.data.admin_contact,{"":Object(o.b)("Please contact your service administrator to continue using the service.")});return React.createElement("div",null,React.createElement("div",null,t),React.createElement("div",null,n))}return React.createElement("div",null,Object(o.a)("Unable to connect to Homeserver. Retrying..."))}},function(e,t,n){"use strict";var o=n(94),r=n(102),i=n(150);t.a={hasAnyLabeledDevices:async function(){return(await navigator.mediaDevices.enumerateDevices()).some(e=>!!e.label)},getDevices:function(){return navigator.mediaDevices.enumerateDevices().then((function(e){const t=[],n=[],o=[];return e.forEach(e=>{switch(e.kind){case"audiooutput":t.push(e);break;case"audioinput":n.push(e);break;case"videoinput":o.push(e)}}),{audiooutput:t,audioinput:n,videoinput:o}}),e=>{console.log("Unable to refresh WebRTC Devices: ",e)})},loadDevices:function(){const e=o.b.getValue("webrtc_audioinput"),t=o.b.getValue("webrtc_videoinput");Object(i.setMatrixCallAudioInput)(e),Object(i.setMatrixCallVideoInput)(t)},setAudioOutput:function(e){o.b.setValue("webrtc_audiooutput",null,r.a.DEVICE,e)},setAudioInput:function(e){o.b.setValue("webrtc_audioinput",null,r.a.DEVICE,e),Object(i.setMatrixCallAudioInput)(e)},setVideoInput:function(e){o.b.setValue("webrtc_videoinput",null,r.a.DEVICE,e),Object(i.setMatrixCallVideoInput)(e)},getAudioOutput:function(){return o.b.getValueAt(r.a.DEVICE,"webrtc_audiooutput")},getAudioInput:function(){return o.b.getValueAt(r.a.DEVICE,"webrtc_audioinput")},getVideoInput:function(){return o.b.getValueAt(r.a.DEVICE,"webrtc_videoinput")}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(18),r=n.n(o),i=n(208),a=n(225);class s extends a.b{constructor(e,t,n){super(),this._symbol=e,this._count=t,this._color=n}static forCount(e,t){return new s(null,e,t)}static forSymbol(e,t){return new s(e,0,t)}}r()(s,"RED_EXCLAMATION",s.forSymbol("!",i.a.Red))},function(e,t,n){"use strict";n.d(t,"a",(function(){return O}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(93),c=n(92),l=n(90),d=n(88),u=n(95),h=n(129),p=n(743),m=n.n(p),g=n(1360),f=n.n(g),_=n(118),b=(n(1362),n(100)),v=n(114);const y=[0,0,22,37,0,0,22,37,1];class E extends Error{}function S(e,t,n,o){return new Promise(r=>{let i=t,a=n;a>600&&(i=Math.floor(i*(600/a)),a=600),i>800&&(a=Math.floor(a*(800/i)),i=800);const s=document.createElement("canvas");s.width=i,s.height=a,s.getContext("2d").drawImage(e,0,0,i,a),s.toBlob((function(e){r({info:{thumbnail_info:{w:i,h:a,mimetype:e.type,size:e.size},w:t,h:n},thumbnail:e})}),o)})}function w(e,t,n){let o,r="image/png";return"image/jpeg"===n.type&&(r="image/jpeg"),async function(e){const t=document.createElement("img"),n=URL.createObjectURL(e),o=new Promise((e,o)=>{t.onload=function(){URL.revokeObjectURL(n),e(t)},t.onerror=function(e){o(e)}});let r;if(t.src=n,"image/png"===e.type){r=T(e).then(e=>{const t=new Uint8Array(e),n=f()(t);for(const e of n)if("pHYs"===e.name){if(e.data.byteLength!==y.length)return;return e.data.every((e,t)=>e===y[t])}return!1})}const[i]=await Promise.all([r,o]);return{width:i?t.width>>1:t.width,height:i?t.height>>1:t.height,img:t}}(n).then((function(e){return S(e.img,e.width,e.height,r)})).then((function(n){return o=n.info,x(e,t,n.thumbnail)})).then((function(e){return o.thumbnail_url=e.url,o.thumbnail_file=e.file,o}))}function C(e,t,n){let o;return function(e){return new Promise((t,n)=>{const o=document.createElement("video"),r=new FileReader;r.onload=function(e){o.src=e.target.result,o.onloadeddata=function(){t(o)},o.onerror=function(e){n(e)}},r.onerror=function(e){n(e)},r.readAsDataURL(e)})}(n).then((function(e){return S(e,e.videoWidth,e.videoHeight,"image/jpeg")})).then((function(n){return o=n.info,x(e,t,n.thumbnail)})).then((function(e){return o.thumbnail_url=e.url,o.thumbnail_file=e.file,o}))}function T(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=function(e){t(e.target.result)},o.onerror=function(e){n(e)},o.readAsArrayBuffer(e)})}function x(e,t,n,o){let r=!1;if(e.isRoomEncrypted(t)){let t,i;const a=T(n).then((function(e){if(r)throw new E;return m.a.encryptAttachment(e)})).then((function(n){if(r)throw new E;i=n.info;const a=new Blob([n.data]);return t=e.uploadContent(a,{progressHandler:o,includeFilename:!1}),t})).then((function(e){if(r)throw new E;return i.url=e,n.type&&(i.mimetype=n.type),{file:i}}));return a.abort=()=>{r=!0,t&&c.a.get().cancelUpload(t)},a}{const t=e.uploadContent(n,{progressHandler:o}),i=t.then((function(e){if(r)throw new E;return{url:e}}));return i.abort=()=>{r=!0,c.a.get().cancelUpload(t)},i}}class O{constructor(){r()(this,"inprogress",[]),r()(this,"mediaConfig",null)}sendStickerContentToRoom(e,t,n,o,r){const i=v.a.getTimestamp(),a=c.a.get().sendStickerMessage(t,e,n,o).catch(n=>{throw console.warn(`Failed to send content with URL ${e} to room ${t}`,n),n});return v.a.instance.trackSendMessage(i,a,t,!1,!1,{msgtype:"m.sticker"}),a}getUploadLimit(){return null!==this.mediaConfig&&void 0!==this.mediaConfig["m.upload.size"]?this.mediaConfig["m.upload.size"]:null}async sendContentListToRoom(e,t,n){if(n.isGuest())return void s.a.dispatch({action:"require_registration"});if(Boolean(h.a.getQuotingEvent())){const e=l.getComponent("dialogs.QuestionDialog"),{finished:t}=u.a.createTrackedDialog("Upload Reply Warning","",e,{title:Object(d.a)("Replying With Files"),description:a.a.createElement("div",null,Object(d.a)("At this time it is not possible to reply with a file. Would you like to upload this file without replying?")),hasCancelButton:!0,button:Object(d.a)("Continue")}),[n]=await t;if(!n)return}if(!this.mediaConfig){const e=u.a.createDialog(_.a,null,"mx_Dialog_spinner");await this.ensureMediaConfigFetched(),e.close()}const o=[],r=[];for(let t=0;t0){const t=l.getComponent("dialogs.UploadFailureDialog"),{finished:n}=u.a.createTrackedDialog("Upload Failure","",t,{badFiles:o,totalFiles:e.length,contentMessages:this}),[r]=await n;if(!r)return}const i=l.getComponent("dialogs.UploadConfirmDialog");let c=!1,p=Promise.resolve();for(let e=0;e!e.canceled)}cancelUpload(e){let t;for(let n=0;n{0===e.type.indexOf("image/")?(i.msgtype="m.image",w(n,t,e).then(e=>{Object.assign(i.info,e),o()},e=>{console.error(e),i.msgtype="m.file",o()})):0===e.type.indexOf("audio/")?(i.msgtype="m.audio",o()):0===e.type.indexOf("video/")?(i.msgtype="m.video",C(n,t,e).then(e=>{Object.assign(i.info,e),o()},e=>{i.msgtype="m.file",o()})):(i.msgtype="m.file",o())});a.abort=()=>{c.canceled=!0};const c={fileName:e.name||"Attachment",roomId:t,total:e.size,loaded:0,promise:a};function h(e){c.total=e.total,c.loaded=e.loaded,s.a.dispatch({action:b.a.UploadProgress,upload:c})}let p;return this.inprogress.push(c),s.a.dispatch({action:b.a.UploadStarted,upload:c}),s.a.fire(b.a.FocusComposer),a.then((function(){if(c.canceled)throw new E;return c.promise=x(n,t,e,h),c.promise.then((function(e){i.file=e.file,i.url=e.url}))})).then(()=>o).then((function(){if(c.canceled)throw new E;const e=n.sendMessage(t,i);return v.a.instance.trackSendMessage(r,e,t,!1,!1,i),e}),(function(e){if(p=e,!c.canceled){let t=Object(d.a)("The file '%(fileName)s' failed to upload.",{fileName:c.fileName});413===e.http_status&&(t=Object(d.a)("The file '%(fileName)s' exceeds this homeserver's size limit for uploads",{fileName:c.fileName}));const n=l.getComponent("dialogs.ErrorDialog");u.a.createTrackedDialog("Upload failed","",n,{title:Object(d.a)("Upload Failed"),description:t})}})).finally(()=>{for(let e=0;ethis.mediaConfig["m.upload.size"])}ensureMediaConfigFetched(){if(null===this.mediaConfig)return console.log("[Media Config] Fetching"),c.a.get().getMediaConfig().then(e=>(console.log("[Media Config] Fetched config:",e),e)).catch(()=>(console.log("[Media Config] Could not fetch config, so not limiting uploads."),{})).then(e=>{this.mediaConfig=e})}static sharedInstance(){return void 0===window.mxContentMessages&&(window.mxContentMessages=new O),window.mxContentMessages}}},,function(e,t,n){"use strict";function o(e){this.filter_json=e,this.types=e.types||null,this.not_types=e.not_types||[],this.rooms=e.rooms||null,this.not_rooms=e.not_rooms||[],this.senders=e.senders||null,this.not_senders=e.not_senders||[],this.contains_url=e.contains_url||null}function r(e,t,n){const o=t.split(".");let r=e;for(let e=0;e0)return!1;const o=i[t];if(o&&o.length>0){if(!o.some(n))return!1}}const a=this.filter_json.contains_url;return void 0===a||a===o},o.prototype.filter=function(e){return e.filter(this.check,this)},o.prototype.limit=function(){return void 0!==this.filter_json.limit?this.filter_json.limit:10},i.LAZY_LOADING_MESSAGES_FILTER={lazy_load_members:!0},i.prototype.getFilterId=function(){return this.filterId},i.prototype.getDefinition=function(){return this.definition},i.prototype.setDefinition=function(e){this.definition=e;const t=e.room,n={};t&&(t.rooms&&(n.rooms=t.rooms),t.rooms&&(n.not_rooms=t.not_rooms),this._include_leave=t.include_leave||!1),this._room_filter=new o(n),this._room_timeline_filter=new o(t&&t.timeline||{})},i.prototype.getRoomTimelineFilterComponent=function(){return this._room_timeline_filter},i.prototype.filterRoomTimeline=function(e){return this._room_timeline_filter.filter(this._room_filter.filter(e))},i.prototype.setTimelineLimit=function(e){r(this.definition,"room.timeline.limit",e)},i.prototype.setLazyLoadMembers=function(e){r(this.definition,"room.state.lazy_load_members",!!e)},i.prototype.setIncludeLeaveRooms=function(e){r(this.definition,"room.include_leave",e)},i.fromJson=function(e,t,n){const o=new i(e,t);return o.setDefinition(n),o}},function(e,t,n){"use strict";n.d(t,"a",(function(){return Y})),n.d(t,"b",(function(){return ce}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(110),c=n(101),l=n(125),d=n(88),u=n(96),h=n(182),p=n(359),m=n(164),g=n(149),f=n(459),_=n(132),b=n(107),v=n(131),y=n(157),E=n(204),S=n(93),w=n(100),C=n(360),T=n(460),x=n(361),O=n(268),k=n(124);const R=(e,t)=>{const[n,o]=Object(i.useState)(()=>Array.isArray(t)?t:new Array(e).fill(t));return[n,(e,t)=>o(n=>{const o=[...n];return o[e]=t,o})]};var I,D=n(468),A=n(303),N=n(670),F=n(171),M=n(471),P=n(138),L=n(672),j=n(472),U=n(105),B=n(177),G=n(109),q=n(308),V=n(233),H=n(94),z=n(95),K=n(475),W=n(98);!function(e){e[e.Landing=0]="Landing",e[e.PublicCreateRooms=1]="PublicCreateRooms",e[e.PublicShare=2]="PublicShare",e[e.PrivateScope=3]="PrivateScope",e[e.PrivateInvite=4]="PrivateInvite",e[e.PrivateCreateRooms=5]="PrivateCreateRooms",e[e.PrivateExistingRooms=6]="PrivateExistingRooms"}(I||(I={}));const Y=({onClick:e})=>W.a.get().bug_report_endpoint_url?a.a.createElement("div",{className:"mx_SpaceFeedbackPrompt"},a.a.createElement("hr",null),a.a.createElement("div",null,a.a.createElement("span",{className:"mx_SpaceFeedbackPrompt_text"},Object(d.a)("Spaces are a beta feature.")),a.a.createElement(u.a,{kind:"link",onClick:()=>{e&&e(),z.a.createTrackedDialog("Beta Feedback","feature_spaces",K.a,{featureId:"feature_spaces"})}},Object(d.a)("Feedback")))):null,$=({room:e,children:t})=>{const n=Object(f.b)(e).length;return t?t(n):n},Q=e=>{const[t,n]=Object(i.useState)(e.getMyMembership());return Object(v.a)(e,"Room.myMembership",()=>{n(e.getMyMembership())}),t},J=({space:e})=>{const t=e.getJoinRule();let n;return n="public"===t?a.a.createElement("span",{className:"mx_SpaceRoomView_info_public"},Object(d.a)("Public space")):a.a.createElement("span",{className:"mx_SpaceRoomView_info_private"},Object(d.a)("Private space")),a.a.createElement("div",{className:"mx_SpaceRoomView_info"},n,"public"===t&&a.a.createElement($,{room:e},t=>t>0?a.a.createElement(u.a,{kind:"link",onClick:()=>{S.a.dispatch({action:w.a.SetRightPanelPhase,phase:k.c.RoomMemberList,refireParams:{space:e}})}},Object(d.a)("%(count)s members",{count:t})):null))},X=()=>{S.a.dispatch({action:w.a.ViewUserSettings,initialTabId:V.a})},Z=({space:e,onJoinButtonClicked:t,onRejectButtonClicked:n})=>{const o=Object(i.useContext)(c.a),r=Q(e),[s,g]=Object(i.useState)(!1),f=H.b.getValue("feature_spaces");let _,b;if("join"===r)b=a.a.createElement(u.a,{kind:"danger_outline",onClick:()=>{S.a.dispatch({action:"leave_room",room_id:e.roomId})}},Object(d.a)("Leave"));else if("invite"===r){var v,y;const r=null===(v=e.getMember(o.getUserId()))||void 0===v||null===(y=v.events.member)||void 0===y?void 0:y.getSender(),i=r&&e.getMember(r);r&&(_=a.a.createElement("div",{className:"mx_SpaceRoomView_preview_inviter"},a.a.createElement(F.a,{member:i,width:32,height:32}),a.a.createElement("div",null,a.a.createElement("div",{className:"mx_SpaceRoomView_preview_inviter_name"},Object(d.a)(" invites you",{},{inviter:()=>a.a.createElement("b",null,i.name||r)})),i?a.a.createElement("div",{className:"mx_SpaceRoomView_preview_inviter_mxid"},r):null))),b=a.a.createElement(a.a.Fragment,null,a.a.createElement(u.a,{kind:"secondary",onClick:()=>{g(!0),n()}},Object(d.a)("Reject")),a.a.createElement(u.a,{kind:"primary",onClick:()=>{g(!0),t()},disabled:!f},Object(d.a)("Accept")))}else b=a.a.createElement(u.a,{kind:"primary",onClick:()=>{g(!0),t()},disabled:!f},Object(d.a)("Join"));return s&&(b=a.a.createElement(m.a,null)),a.a.createElement("div",{className:"mx_SpaceRoomView_preview"},a.a.createElement(q.a,{onClick:X}),_,a.a.createElement(l.a,{room:e,height:80,width:80,viewAvatarOnClick:!0}),a.a.createElement("h1",{className:"mx_SpaceRoomView_preview_name"},a.a.createElement(h.a,{room:e})),a.a.createElement(J,{space:e}),a.a.createElement(p.a,{room:e},(e,t)=>a.a.createElement("div",{className:"mx_SpaceRoomView_preview_topic",ref:t},e)),"public"===e.getJoinRule()&&a.a.createElement(L.a,{room:e}),a.a.createElement("div",{className:"mx_SpaceRoomView_preview_joinButtons"},b),!f&&a.a.createElement("div",{className:"mx_SpaceRoomView_preview_spaceBetaPrompt"},"join"===r?Object(d.a)("To view %(spaceName)s, turn on the Spaces beta",{spaceName:e.name},{a:e=>a.a.createElement(u.a,{onClick:X,kind:"link"},e)}):Object(d.a)("To join %(spaceName)s, turn on the Spaces beta",{spaceName:e.name},{a:e=>a.a.createElement(u.a,{onClick:X,kind:"link"},e)})))},ee=({space:e,onNewRoomAdded:t})=>{const n=Object(i.useContext)(c.a),[o,r,s,l]=Object(U.q)();let u;if(o){const o=r.current.getBoundingClientRect();u=a.a.createElement(B.e,{left:o.left+window.pageXOffset+0,top:o.bottom+window.pageYOffset+8,chevronFace:U.a.None,onFinished:l,className:"mx_RoomTile_contextMenu",compact:!0},a.a.createElement(B.c,{first:!0},a.a.createElement(B.b,{label:Object(d.a)("Create new room"),iconClassName:"mx_RoomList_iconPlus",onClick:async o=>{o.preventDefault(),o.stopPropagation(),l(),await Object(A.d)(n,e)&&t()}}),a.a.createElement(B.b,{label:Object(d.a)("Add existing room"),iconClassName:"mx_RoomList_iconHash",onClick:async o=>{o.preventDefault(),o.stopPropagation(),l();const[r]=await Object(A.c)(n,e);r&&t()}})))}return a.a.createElement(a.a.Fragment,null,a.a.createElement(U.c,{kind:"primary",inputRef:r,onClick:s,isExpanded:o,label:Object(d.a)("Add")},Object(d.a)("Add")),u)},te=({space:e})=>{const t=Object(i.useContext)(c.a),n=Q(e),o=t.getUserId();let r;"join"===n&&e.canInvite(o)&&(r=a.a.createElement(u.a,{kind:"primary",className:"mx_SpaceRoomView_landing_inviteButton",onClick:()=>{Object(g.g)(e.roomId)}},Object(d.a)("Invite")));const m="join"===n&&e.currentState.maySendStateEvent(s.a.SpaceChild,o),[f,_]=Object(M.a)(!1);let b,v;m&&(b=a.a.createElement(ee,{space:e,onNewRoomAdded:_})),Object(A.b)(t,e)&&(v=a.a.createElement(G.a,{className:"mx_SpaceRoomView_landing_settingsButton",onClick:()=>{Object(A.f)(t,e)},title:Object(d.a)("Settings")}));return a.a.createElement("div",{className:"mx_SpaceRoomView_landing"},a.a.createElement(l.a,{room:e,height:80,width:80,viewAvatarOnClick:!0}),a.a.createElement("div",{className:"mx_SpaceRoomView_landing_name"},a.a.createElement(h.a,{room:e},e=>{const t={name:()=>a.a.createElement("div",{className:"mx_SpaceRoomView_landing_nameRow"},a.a.createElement("h1",null,e))};return Object(d.a)("Welcome to ",{},t)})),a.a.createElement("div",{className:"mx_SpaceRoomView_landing_info"},a.a.createElement(J,{space:e}),a.a.createElement(L.a,{room:e,onlyKnownUsers:!1,numShown:7,onClick:()=>{S.a.dispatch({action:w.a.SetRightPanelPhase,phase:k.c.RoomMemberList,refireParams:{space:e}})}}),r,v),a.a.createElement(p.a,{room:e},(e,t)=>a.a.createElement("div",{className:"mx_SpaceRoomView_landing_topic",ref:t},e)),a.a.createElement(Y,null),a.a.createElement("hr",null),a.a.createElement(N.a,{space:e,showRoom:N.c,refreshToken:f,additionalButtons:b}))},ne=({space:e,title:t,description:n,onFinished:o})=>{const[r,s]=Object(i.useState)(!1),[c,l]=Object(i.useState)(""),h=[Object(d.a)("General"),Object(d.a)("Random"),Object(d.a)("Support")],[p,m]=R(3,[Object(d.a)("General"),Object(d.a)("Random"),""]),g=new Array(3).fill(0).map((e,t)=>{const n="roomName"+t;return a.a.createElement(b.a,{key:n,name:n,type:"text",label:Object(d.a)("Room name"),placeholder:h[t],value:p[t],onChange:e=>m(t,e.target.value),autoFocus:2===t,disabled:r})}),f=async t=>{if(t.preventDefault(),!r){l(""),s(!0);try{const t=p.map(e=>e.trim()).filter(Boolean);await Promise.all(t.map(t=>Object(_.d)({createOpts:{preset:"public"===e.getJoinRule()?_.a.PublicChat:_.a.PrivateChat,name:t},spinner:!1,encryption:!1,andView:!1,inlineErrors:!0,parentSpace:e}))),o(t.length>0)}catch(e){console.error("Failed to create initial space rooms",e),l(Object(d.a)("Failed to create initial space rooms"))}s(!1)}};let v=e=>{e.preventDefault(),o(!1)},y=Object(d.a)("Skip for now");return p.some(e=>e.trim())&&(v=f,y=r?Object(d.a)("Creating rooms..."):Object(d.a)("Continue")),a.a.createElement("div",null,a.a.createElement("h1",null,t),a.a.createElement("div",{className:"mx_SpaceRoomView_description"},n),c&&a.a.createElement("div",{className:"mx_SpaceRoomView_errorText"},c),a.a.createElement("form",{onSubmit:v,id:"mx_SpaceSetupFirstRooms"},g),a.a.createElement("div",{className:"mx_SpaceRoomView_buttons"},a.a.createElement(u.a,{kind:"primary",disabled:r,onClick:v,element:"input",type:"submit",form:"mx_SpaceSetupFirstRooms",value:y})),a.a.createElement(Y,null))},oe=({space:e,onFinished:t})=>a.a.createElement("div",null,a.a.createElement("h1",null,Object(d.a)("What do you want to organise?")),a.a.createElement("div",{className:"mx_SpaceRoomView_description"},Object(d.a)("Pick rooms or conversations to add. This is just a space for you, no one will be informed. You can add more later.")),a.a.createElement(j.a,{space:e,emptySelectionButton:a.a.createElement(u.a,{kind:"primary",onClick:t},Object(d.a)("Skip for now")),onFinished:t}),a.a.createElement("div",{className:"mx_SpaceRoomView_buttons"}),a.a.createElement(Y,null)),re=({justCreatedOpts:e,space:t,onFinished:n,createdRooms:o})=>{var r;return a.a.createElement("div",{className:"mx_SpaceRoomView_publicShare"},a.a.createElement("h1",null,Object(d.a)("Share %(name)s",{name:(null==e||null===(r=e.createOpts)||void 0===r?void 0:r.name)||t.name})),a.a.createElement("div",{className:"mx_SpaceRoomView_description"},Object(d.a)("It's just you at the moment, it will be even better with others.")),a.a.createElement(D.a,{space:t}),a.a.createElement("div",{className:"mx_SpaceRoomView_buttons"},a.a.createElement(u.a,{kind:"primary",onClick:n},o?Object(d.a)("Go to my first room"):Object(d.a)("Go to my space"))),a.a.createElement(Y,null))},ie=({space:e,justCreatedOpts:t,onFinished:n})=>{var o;return a.a.createElement("div",{className:"mx_SpaceRoomView_privateScope"},a.a.createElement("h1",null,Object(d.a)("Who are you working with?")),a.a.createElement("div",{className:"mx_SpaceRoomView_description"},Object(d.a)("Make sure the right people have access to %(name)s",{name:(null==t||null===(o=t.createOpts)||void 0===o?void 0:o.name)||e.name})),a.a.createElement(u.a,{className:"mx_SpaceRoomView_privateScope_justMeButton",onClick:()=>{n(!1)}},a.a.createElement("h3",null,Object(d.a)("Just me")),a.a.createElement("div",null,Object(d.a)("A private space to organise your rooms"))),a.a.createElement(u.a,{className:"mx_SpaceRoomView_privateScope_meAndMyTeammatesButton",onClick:()=>{n(!0)}},a.a.createElement("h3",null,Object(d.a)("Me and my teammates")),a.a.createElement("div",null,Object(d.a)("A private space for you and your teammates"))),a.a.createElement(Y,null))},ae=Object(y.a)({rules:[{key:"email",test:({value:e})=>!e||E.a(e),invalid:()=>Object(d.a)("Doesn't look like a valid email address")}]}),se=({space:e,onFinished:t})=>{const[n,o]=Object(i.useState)(!1),[r,s]=Object(i.useState)(""),c=[Object(i.useRef)(),Object(i.useRef)(),Object(i.useRef)()],[l,h]=R(3,""),p=new Array(3).fill(0).map((e,t)=>{const o="emailAddress"+t;return a.a.createElement(b.a,{key:o,name:o,type:"text",label:Object(d.a)("Email address"),placeholder:Object(d.a)("Email"),value:l[t],onChange:e=>h(t,e.target.value),ref:c[t],onValidate:ae,autoFocus:0===t,disabled:n})}),m=async r=>{if(r.preventDefault(),n)return;s("");for(let e=0;ee.trim()).filter(Boolean);try{const n=await Object(g.a)(e.roomId,i),o=Object.keys(n.states).filter(e=>"error"===n.states[e]);o.length>0?(console.log("Failed to invite users to space: ",n),s(Object(d.a)("Failed to invite the following users to your space: %(csvUsers)s",{csvUsers:o.join(", ")}))):t()}catch(e){console.error("Failed to invite users to space: ",e),s(Object(d.a)("We couldn't invite those users. Please check the users you want to invite and try again."))}o(!1)};let f=e=>{e.preventDefault(),t()},_=Object(d.a)("Skip for now");return l.some(e=>e.trim())&&(f=m,_=n?Object(d.a)("Inviting..."):Object(d.a)("Continue")),a.a.createElement("div",{className:"mx_SpaceRoomView_inviteTeammates"},a.a.createElement("h1",null,Object(d.a)("Invite your teammates")),a.a.createElement("div",{className:"mx_SpaceRoomView_description"},Object(d.a)("Make sure the right people have access. You can invite more later.")),a.a.createElement("div",{className:"mx_SpaceRoomView_inviteTeammates_betaDisclaimer"},a.a.createElement(q.a,{onClick:X}),Object(d.a)("This is an experimental feature. For now, new users receiving an invite will have to open the invite on to actually join.",{},{b:e=>a.a.createElement("b",null,e),link:()=>a.a.createElement("a",{href:"https://app.element.io/",rel:"noreferrer noopener",target:"_blank"},"app.element.io")})),r&&a.a.createElement("div",{className:"mx_SpaceRoomView_errorText"},r),a.a.createElement("form",{onSubmit:f,id:"mx_SpaceSetupPrivateInvite"},p),a.a.createElement("div",{className:"mx_SpaceRoomView_inviteTeammates_buttons"},a.a.createElement(u.a,{className:"mx_SpaceRoomView_inviteTeammates_inviteDialogButton",onClick:()=>Object(g.g)(e.roomId)},Object(d.a)("Invite by username"))),a.a.createElement("div",{className:"mx_SpaceRoomView_buttons"},a.a.createElement(u.a,{kind:"primary",disabled:n,onClick:f,element:"input",type:"submit",form:"mx_SpaceSetupPrivateInvite",value:_})),a.a.createElement(Y,null))};class ce extends a.a.PureComponent{constructor(e,t){var n;super(e,t),r()(this,"creator",void 0),r()(this,"dispatcherRef",void 0),r()(this,"rightPanelStoreToken",void 0),r()(this,"onMyMembership",(e,t)=>{e.roomId===this.props.space.roomId&&this.setState({myMembership:t})}),r()(this,"onRightPanelStoreUpdate",()=>{this.setState({showRightPanel:O.a.getSharedInstance().isOpenForRoom})}),r()(this,"onAction",e=>{e.action!==w.a.ViewUser&&"view_3pid_invite"!==e.action||(e.action===w.a.ViewUser&&e.member?S.a.dispatch({action:w.a.SetRightPanelPhase,phase:k.c.SpaceMemberInfo,refireParams:{space:this.props.space,member:e.member}}):"view_3pid_invite"===e.action&&e.event?S.a.dispatch({action:w.a.SetRightPanelPhase,phase:k.c.Space3pidMemberInfo,refireParams:{space:this.props.space,event:e.event}}):S.a.dispatch({action:w.a.SetRightPanelPhase,phase:k.c.SpaceMemberList,refireParams:{space:this.props.space}}))}),r()(this,"goToFirstRoom",async()=>{const e=P.e.instance.getChildRooms(this.props.space.roomId);if(e.length){const t=e[0];return void S.a.dispatch({action:"view_room",room_id:t.roomId})}let t=P.e.instance.suggestedRooms;if(P.e.instance.activeSpace!==this.props.space&&(t=await P.e.instance.fetchSuggestedRooms(this.props.space,1)),t.length){var n,o;const e=t[0];S.a.dispatch({action:"view_room",room_id:e.room_id,room_alias:e.canonical_alias||(null===(n=e.aliases)||void 0===n?void 0:n[0]),via_servers:e.viaServers,oobData:{avatarUrl:e.avatar_url,name:e.name||e.canonical_alias||(null===(o=e.aliases)||void 0===o?void 0:o[0])||Object(d.a)("Empty room")}})}else this.setState({phase:I.Landing})});let o=I.Landing;this.creator=null===(n=this.props.space.currentState.getStateEvents(s.a.RoomCreate,""))||void 0===n?void 0:n.getSender();this.props.justCreatedOpts&&this.context.getUserId()===this.creator&&(o=this.props.justCreatedOpts.createOpts.preset===_.a.PublicChat?I.PublicCreateRooms:I.PrivateScope),this.state={phase:o,showRightPanel:O.a.getSharedInstance().isOpenForRoom,myMembership:this.props.space.getMyMembership()},this.dispatcherRef=S.a.register(this.onAction),this.rightPanelStoreToken=O.a.getSharedInstance().addListener(this.onRightPanelStoreUpdate),this.context.on("Room.myMembership",this.onMyMembership)}componentWillUnmount(){S.a.unregister(this.dispatcherRef),this.rightPanelStoreToken.remove(),this.context.off("Room.myMembership",this.onMyMembership)}renderBody(){var e,t;switch(this.state.phase){case I.Landing:return"join"===this.state.myMembership&&H.b.getValue("feature_spaces")?a.a.createElement(te,{space:this.props.space}):a.a.createElement(Z,{space:this.props.space,onJoinButtonClicked:this.props.onJoinButtonClicked,onRejectButtonClicked:this.props.onRejectButtonClicked});case I.PublicCreateRooms:return a.a.createElement(ne,{space:this.props.space,title:Object(d.a)("What are some things you want to discuss in %(spaceName)s?",{spaceName:(null===(e=this.props.justCreatedOpts)||void 0===e||null===(t=e.createOpts)||void 0===t?void 0:t.name)||this.props.space.name}),description:Object(d.a)("Let's create a room for each of them.")+"\n"+Object(d.a)("You can add more later too, including already existing ones."),onFinished:e=>this.setState({phase:I.PublicShare,createdRooms:e})});case I.PublicShare:return a.a.createElement(re,{justCreatedOpts:this.props.justCreatedOpts,space:this.props.space,onFinished:this.goToFirstRoom,createdRooms:this.state.createdRooms});case I.PrivateScope:return a.a.createElement(ie,{space:this.props.space,justCreatedOpts:this.props.justCreatedOpts,onFinished:e=>{this.setState({phase:e?I.PrivateInvite:I.PrivateExistingRooms})}});case I.PrivateInvite:return a.a.createElement(se,{space:this.props.space,onFinished:()=>this.setState({phase:I.PrivateCreateRooms})});case I.PrivateCreateRooms:return a.a.createElement(ne,{space:this.props.space,title:Object(d.a)("What projects are you working on?"),description:Object(d.a)("We'll create rooms for each of them. You can add more later too, including already existing ones."),onFinished:e=>this.setState({phase:I.Landing,createdRooms:e})});case I.PrivateExistingRooms:return a.a.createElement(oe,{space:this.props.space,onFinished:()=>this.setState({phase:I.Landing})})}}render(){const e=this.state.showRightPanel&&this.state.phase===I.Landing?a.a.createElement(x.a,{room:this.props.space,resizeNotifier:this.props.resizeNotifier}):null;return a.a.createElement("main",{className:"mx_SpaceRoomView"},a.a.createElement(T.a,null,a.a.createElement(C.a,{panel:e,resizeNotifier:this.props.resizeNotifier},this.renderBody())))}}r()(ce,"contextType",c.a)},function(e,t,n){"use strict";n.d(t,"a",(function(){return E}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(97),c=n.n(s),l=n(125),d=n(184),u=n(166),h=n(92),p=n(98);var m,g,f=n(88),_=n(210),b=n(122),v=n(89);function y(e){switch(e){case g.Globe:return Object(f.a)("This room is public");case g.PresenceOnline:return Object(f.a)("Online");case g.PresenceAway:return Object(f.a)("Away");case g.PresenceOffline:return Object(f.a)("Offline")}}!function(e){e.None="NONE",e.Globe="GLOBE",e.PresenceOnline="ONLINE",e.PresenceAway="AWAY",e.PresenceOffline="OFFLINE"}(g||(g={}));let E=Object(v.a)("views.avatars.DecoratedRoomAvatar")(m=class extends a.a.PureComponent{constructor(e){super(e),r()(this,"_dmUser",void 0),r()(this,"isUnmounted",!1),r()(this,"isWatchingTimeline",!1),r()(this,"onRoomTimeline",(e,t)=>{if(!this.isUnmounted&&t&&this.props.room.roomId===t.roomId&&("m.room.join_rules"===e.getType()||"m.room.member"===e.getType())){const e=this.calculateIcon();e!==this.state.icon&&this.setState({icon:e})}}),r()(this,"onPresenceUpdate",()=>{if(this.isUnmounted)return;const e=this.getPresenceIcon();e!==this.state.icon&&this.setState({icon:e})}),this.state={notificationState:u.a.instance.getRoomState(this.props.room),icon:this.calculateIcon()}}componentWillUnmount(){this.isUnmounted=!0,this.isWatchingTimeline&&this.props.room.off("Room.timeline",this.onRoomTimeline),this.dmUser=null}get isPublicRoom(){const e=this.props.room.currentState.getStateEvents("m.room.join_rules","");return"public"===(e&&e.getContent().join_rule)}get dmUser(){return this._dmUser}set dmUser(e){const t=this._dmUser;this._dmUser=e,t&&t!==this._dmUser&&(t.off("User.currentlyActive",this.onPresenceUpdate),t.off("User.presence",this.onPresenceUpdate)),this._dmUser&&t!==this._dmUser&&(this._dmUser.on("User.currentlyActive",this.onPresenceUpdate),this._dmUser.on("User.presence",this.onPresenceUpdate))}getPresenceIcon(){if(!this.dmUser)return g.None;let e=g.None;return this.dmUser.currentlyActive||"online"===this.dmUser.presence?e=g.PresenceOnline:"offline"===this.dmUser.presence?e=g.PresenceOffline:"unavailable"===this.dmUser.presence&&(e=g.PresenceAway),e}calculateIcon(){let e=g.None;const t=b.a.shared().getUserIdForRoomId(this.props.room.roomId);return t&&2===this.props.room.getJoinedMemberCount()?function(){const e=h.a.get().baseUrl,t=p.a.get().enable_presence_by_hs_url;return!t||!(!t[e]&&void 0!==t[e])}()&&t&&(this.dmUser=h.a.get().getUser(t),e=this.getPresenceIcon()):(e=this.isPublicRoom?g.Globe:g.None,this.isWatchingTimeline||(this.props.room.on("Room.timeline",this.onRoomTimeline),this.isWatchingTimeline=!0)),e}render(){let e,t;this.props.displayBadge&&(e=a.a.createElement(d.a,{notification:this.state.notificationState,forceCount:this.props.forceCount,roomId:this.props.room.roomId})),this.state.icon!==g.None&&(t=a.a.createElement(_.a,{tooltip:y(this.state.icon),class:"mx_DecoratedRoomAvatar_icon mx_DecoratedRoomAvatar_icon_"+this.state.icon.toLowerCase()}));const n=c()("mx_DecoratedRoomAvatar",{mx_DecoratedRoomAvatar_cutout:t});return a.a.createElement("div",{className:n},a.a.createElement(l.a,{room:this.props.room,width:this.props.avatarSize,height:this.props.avatarSize,oobData:this.props.oobData,viewAvatarOnClick:this.props.viewAvatarOnClick}),t,e)}})||m},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,o,r={},i=Object.keys(e);for(o=0;o=0||(r[n]=e[n]);return r}},function(e,t,n){"use strict";function o(e){return e/10+"rem"}function r(e){return e+"px"}n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r}))},function(e,t,n){e.exports.Container=n(806),e.exports.MapStore=n(808),e.exports.Mixin=n(816),e.exports.ReduceStore=n(528),e.exports.Store=n(529)},function(e,t,n){"use strict";function o(e,t,n){return t<=e&&e<=n}function r(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function i(e){this.tokens=[].slice.call(e)}i.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};function a(e,t){if(e)throw TypeError("Decoder error");return t||65533}function s(e,t){if(!(this instanceof s))return new s(e,t);if("utf-8"!==(e=void 0!==e?String(e).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");t=r(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function c(e,t){if(!(this instanceof c))return new c(e,t);if("utf-8"!==(e=void 0!==e?String(e).toLowerCase():"utf-8"))throw new Error("Encoding not supported. Only utf-8 is supported");t=r(t),this._streaming=!1,this._encoder=null,this._options={fatal:Boolean(t.fatal)},Object.defineProperty(this,"encoding",{value:"utf-8"})}function l(e){var t=e.fatal,n=0,r=0,i=0,s=128,c=191;this.handler=function(e,l){if(-1===l&&0!==i)return i=0,a(t);if(-1===l)return-1;if(0===i){if(o(l,0,127))return l;if(o(l,194,223))i=1,n=l-192;else if(o(l,224,239))224===l&&(s=160),237===l&&(c=159),i=2,n=l-224;else{if(!o(l,240,244))return a(t);240===l&&(s=144),244===l&&(c=143),i=3,n=l-240}return n<<=6*i,null}if(!o(l,s,c))return n=i=r=0,s=128,c=191,e.prepend(l),a(t);if(s=128,c=191,n+=l-128<<6*(i-(r+=1)),r!==i)return null;var d=n;return n=i=r=0,d}}function d(e){e.fatal;this.handler=function(e,t){if(-1===t)return-1;if(o(t,0,127))return t;var n,r;o(t,128,2047)?(n=1,r=192):o(t,2048,65535)?(n=2,r=224):o(t,65536,1114111)&&(n=3,r=240);for(var i=[(t>>6*n)+r];n>0;){var a=t>>6*(n-1);i.push(128|63&a),n-=1}return i}}s.prototype={decode:function(e,t){var n;n="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=r(t),this._streaming||(this._decoder=new l({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var o,a=new i(n),s=[];!a.endOfStream()&&-1!==(o=this._decoder.handler(a,a.read()));)null!==o&&(Array.isArray(o)?s.push.apply(s,o):s.push(o));if(!this._streaming){do{if(-1===(o=this._decoder.handler(a,a.read())))break;null!==o&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!a.endOfStream());this._decoder=null}return s.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===s[0]?(this._BOMseen=!0,s.shift()):this._BOMseen=!0)),function(e){for(var t="",n=0;n>10),56320+(1023&o)))}return t}(s)}},c.prototype={encode:function(e,t){e=e?String(e):"",t=r(t),this._streaming||(this._encoder=new d(this._options)),this._streaming=Boolean(t.stream);for(var n,o=[],a=new i(function(e){for(var t=String(e),n=t.length,o=0,r=[];o57343)r.push(i);else if(56320<=i&&i<=57343)r.push(65533);else if(55296<=i&&i<=56319)if(o===n-1)r.push(65533);else{var a=e.charCodeAt(o+1);if(56320<=a&&a<=57343){var s=1023&i,c=1023&a;r.push(65536+(s<<10)+c),o+=1}else r.push(65533)}o+=1}return r}(e));!a.endOfStream()&&-1!==(n=this._encoder.handler(a,a.read()));)Array.isArray(n)?o.push.apply(o,n):o.push(n);if(!this._streaming){for(;-1!==(n=this._encoder.handler(a,a.read()));)Array.isArray(n)?o.push.apply(o,n):o.push(n);this._encoder=null}return new Uint8Array(o)}},t.TextEncoder=c,t.TextDecoder=s},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return l}));var o=n(91),r=n.n(o),i=n(88);const a=r.a.shape({userId:r.a.string.isRequired,displayname:r.a.string,avatarUrl:r.a.string}),s=r.a.shape({displayname:r.a.string,name:r.a.string,roomId:r.a.string.isRequired,canonicalAlias:r.a.string,avatarUrl:r.a.string});function c(e){return{userId:e.user_id,displayname:e.displayname,avatarUrl:e.avatar_url,isPrivileged:e.is_privileged}}function l(e){return{displayname:e.name||e.canonical_alias||Object(i.a)("Unnamed Room"),name:e.name,roomId:e.room_id,canonicalAlias:e.canonical_alias,avatarUrl:e.avatar_url,topic:e.topic,numJoinedMembers:e.num_joined_members,worldReadable:e.world_readable,guestCanJoin:e.guest_can_join,isPublic:!1!==e.is_public}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"d",(function(){return c})),n.d(t,"e",(function(){return p})),n.d(t,"f",(function(){return m})),n.d(t,"h",(function(){return g})),n.d(t,"g",(function(){return f}));var o=n(92),r=n(239);const i="all_messages_loud",a="all_messages",s="mentions_only",c="mute",l=[a,i],d=[...l,s];function u(e){return l.includes(e)}function h(e){return d.includes(e)}function p(e){return e.reduce((e,t)=>{const n=m(t.roomId),o=t.getUnreadNotificationCount("highlight")>0,r=f(t),i=r>0&&u(n),a=o&&h(n);return(i||a)&&(e.count+=r,o&&(e.highlight=!0)),e},{count:0,highlight:!1})}function m(e){if(o.a.get().isGuest())return a;if(_(e))return c;let t=null;try{t=o.a.get().getRoomPushRule("global",e)}catch(e){return null}if(!t||!t.enabled)return a;if(v(t))return s;return r.a.actionListToActionsObject(t.actions).tweaks.sound?i:null}function g(e,t){return t===c?function(e){const t=o.a.get(),n=[],r=t.getRoomPushRule("global",e);r&&n.push(t.deletePushRule("global","room",r.rule_id));return n.push(t.addPushRule("global","override",e,{conditions:[{kind:"event_match",key:"room_id",pattern:e}],actions:["dont_notify"]})),Promise.all(n)}(e):function(e,t){const n=o.a.get(),r=[],i=_(e);i&&r.push(n.deletePushRule("global","override",i.rule_id));if("all_messages"===t){const t=n.getRoomPushRule("global",e);t&&r.push(n.deletePushRule("global","room",t.rule_id))}else"mentions_only"===t?(r.push(n.addPushRule("global","room",e,{actions:["dont_notify"]})),r.push(n.setPushRuleEnabled("global","room",e,!0))):(r.push(n.addPushRule("global","room",e,{actions:["notify",{set_tweak:"sound",value:"default"}]})),r.push(n.setPushRuleEnabled("global","room",e,!0)));return Promise.all(r)}(e,t)}function f(e,t=null){let n=e.getUnreadNotificationCount(t);const r=e.currentState.getStateEvents("m.room.create","");if(r&&r.getContent().predecessor){const e=r.getContent().predecessor.room_id,t=o.a.get().getRoom(e);t&&(n+=t.getUnreadNotificationCount("highlight"))}return n}function _(e){const t=o.a.get();if(!t.pushRules||!t.pushRules.global||!t.pushRules.global.override)return null;for(const n of t.pushRules.global.override)if(b(e,n)&&v(n)&&n.enabled)return n;return null}function b(e,t){if(1!==t.conditions.length)return!1;const n=t.conditions[0];return"event_match"===n.kind&&"room_id"===n.key&&n.pattern===e}function v(e){return 1===e.actions.length&&"dont_notify"===e.actions[0]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(817);Object.defineProperty(t,"DragDropContext",{enumerable:!0,get:function(){return a(o).default}});var r=n(905);Object.defineProperty(t,"Droppable",{enumerable:!0,get:function(){return a(r).default}});var i=n(926);function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"Draggable",{enumerable:!0,get:function(){return a(i).default}})},function(e,t){e.exports=!0},function(e,t){var n=0,o=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+o).toString(36))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){"use strict";t.__esModule=!0;var o,r=n(875),i=(o=r)&&o.__esModule?o:{default:o};t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{},o=Object.create(e.prototype);for(var r in n)o[r]=n[r];return o.constructor=t,t.prototype=o,t}},function(e){e.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')},function(e){e.exports=JSON.parse('{"amp":"&","apos":"\'","gt":">","lt":"<","quot":"\\""}')},function(e,t,n){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||o(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,r(n(967),t),r(n(969),t),r(n(970),t),r(n(591),t),r(n(971),t),r(n(972),t);var i=n(252);Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return i.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return i.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return i.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return i.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return i.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return i.hasChildren}})},function(e,t,n){"use strict";const o=n(976),r=n(420),i=n(977),a=n(421),s=r.CODE_POINTS,c=r.CODE_POINT_SEQUENCES,l={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},d="DATA_STATE";function u(e){return e===s.SPACE||e===s.LINE_FEED||e===s.TABULATION||e===s.FORM_FEED}function h(e){return e>=s.DIGIT_0&&e<=s.DIGIT_9}function p(e){return e>=s.LATIN_CAPITAL_A&&e<=s.LATIN_CAPITAL_Z}function m(e){return e>=s.LATIN_SMALL_A&&e<=s.LATIN_SMALL_Z}function g(e){return m(e)||p(e)}function f(e){return g(e)||h(e)}function _(e){return e>=s.LATIN_CAPITAL_A&&e<=s.LATIN_CAPITAL_F}function b(e){return e>=s.LATIN_SMALL_A&&e<=s.LATIN_SMALL_F}function v(e){return e+32}function y(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function E(e){return String.fromCharCode(v(e))}function S(e,t){const n=i[++e];let o=++e,r=o+n-1;for(;o<=r;){const e=o+r>>>1,a=i[e];if(at))return i[e+n];r=e-1}}return-1}class w{constructor(){this.preprocessor=new o,this.tokenQueue=[],this.allowCDATA=!1,this.state=d,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null}_err(){}_errOnNextCodePoint(e){this._consume(),this._err(e),this._unconsume()}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this[this.state](e)}return this.tokenQueue.shift()}write(e,t){this.active=!0,this.preprocessor.write(e,t)}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e)}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:w.HIBERNATION_TOKEN}),!0}return!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat()}_reconsumeInState(e){this.state=e,this._unconsume()}_consumeSequenceIfMatch(e,t,n){let o=0,r=!0;const i=e.length;let a=0,c=t,l=void 0;for(;a0&&(c=this._consume(),o++),c===s.EOF){r=!1;break}if(l=e[a],c!==l&&(n||c!==v(l))){r=!1;break}}if(!r)for(;o--;)this._unconsume();return r}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==c.SCRIPT_STRING.length)return!1;for(let e=0;e0&&this._err(a.endTagWithAttributes),e.selfClosing&&this._err(a.endTagWithTrailingSolidus)),this.tokenQueue.push(e)}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null)}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken()}_appendCharToCurrentCharacterToken(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t)}_emitCodePoint(e){let t=w.CHARACTER_TOKEN;u(e)?t=w.WHITESPACE_CHARACTER_TOKEN:e===s.NULL&&(t=w.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(t,y(e))}_emitSeveralCodePoints(e){for(let t=0;t-1;){const e=i[o],r=e<7;r&&1&e&&(t=2&e?[i[++o],i[++o]]:[i[++o]],n=0);const a=this._consume();if(this.tempBuff.push(a),n++,a===s.EOF)break;o=r?4&e?S(o,a):-1:a===e?++o:-1}for(;n--;)this.tempBuff.pop(),this._unconsume();return t}_isCharacterReferenceInAttribute(){return"ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE"===this.returnState||"ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE"===this.returnState||"ATTRIBUTE_VALUE_UNQUOTED_STATE"===this.returnState}_isCharacterReferenceAttributeQuirk(e){if(!e&&this._isCharacterReferenceInAttribute()){const e=this._consume();return this._unconsume(),e===s.EQUALS_SIGN||f(e)}return!1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let e=0;e")):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.state="SCRIPT_DATA_ESCAPED_STATE",this._emitChars(r.REPLACEMENT_CHARACTER)):e===s.EOF?(this._err(a.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_ESCAPED_STATE",this._emitCodePoint(e))}SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE(e){e===s.SOLIDUS?(this.tempBuff=[],this.state="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE"):g(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE")):(this._emitChars("<"),this._reconsumeInState("SCRIPT_DATA_ESCAPED_STATE"))}SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE(e){g(e)?(this._createEndTagToken(),this._reconsumeInState("SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE")):(this._emitChars("")):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitChars(r.REPLACEMENT_CHARACTER)):e===s.EOF?(this._err(a.eofInScriptHtmlCommentLikeText),this._emitEOFToken()):(this.state="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e))}SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE(e){e===s.SOLIDUS?(this.tempBuff=[],this.state="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",this._emitChars("/")):this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPED_STATE")}SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE(e){u(e)||e===s.SOLIDUS||e===s.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?"SCRIPT_DATA_ESCAPED_STATE":"SCRIPT_DATA_DOUBLE_ESCAPED_STATE",this._emitCodePoint(e)):p(e)?(this.tempBuff.push(v(e)),this._emitCodePoint(e)):m(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState("SCRIPT_DATA_DOUBLE_ESCAPED_STATE")}BEFORE_ATTRIBUTE_NAME_STATE(e){u(e)||(e===s.SOLIDUS||e===s.GREATER_THAN_SIGN||e===s.EOF?this._reconsumeInState("AFTER_ATTRIBUTE_NAME_STATE"):e===s.EQUALS_SIGN?(this._err(a.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state="ATTRIBUTE_NAME_STATE"):(this._createAttr(""),this._reconsumeInState("ATTRIBUTE_NAME_STATE")))}ATTRIBUTE_NAME_STATE(e){u(e)||e===s.SOLIDUS||e===s.GREATER_THAN_SIGN||e===s.EOF?(this._leaveAttrName("AFTER_ATTRIBUTE_NAME_STATE"),this._unconsume()):e===s.EQUALS_SIGN?this._leaveAttrName("BEFORE_ATTRIBUTE_VALUE_STATE"):p(e)?this.currentAttr.name+=E(e):e===s.QUOTATION_MARK||e===s.APOSTROPHE||e===s.LESS_THAN_SIGN?(this._err(a.unexpectedCharacterInAttributeName),this.currentAttr.name+=y(e)):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentAttr.name+=r.REPLACEMENT_CHARACTER):this.currentAttr.name+=y(e)}AFTER_ATTRIBUTE_NAME_STATE(e){u(e)||(e===s.SOLIDUS?this.state="SELF_CLOSING_START_TAG_STATE":e===s.EQUALS_SIGN?this.state="BEFORE_ATTRIBUTE_VALUE_STATE":e===s.GREATER_THAN_SIGN?(this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState("ATTRIBUTE_NAME_STATE")))}BEFORE_ATTRIBUTE_VALUE_STATE(e){u(e)||(e===s.QUOTATION_MARK?this.state="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE":e===s.APOSTROPHE?this.state="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE":e===s.GREATER_THAN_SIGN?(this._err(a.missingAttributeValue),this.state=d,this._emitCurrentToken()):this._reconsumeInState("ATTRIBUTE_VALUE_UNQUOTED_STATE"))}ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE(e){e===s.QUOTATION_MARK?this.state="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE":e===s.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentAttr.value+=r.REPLACEMENT_CHARACTER):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):this.currentAttr.value+=y(e)}ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE(e){e===s.APOSTROPHE?this.state="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE":e===s.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentAttr.value+=r.REPLACEMENT_CHARACTER):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):this.currentAttr.value+=y(e)}ATTRIBUTE_VALUE_UNQUOTED_STATE(e){u(e)?this._leaveAttrValue("BEFORE_ATTRIBUTE_NAME_STATE"):e===s.AMPERSAND?(this.returnState="ATTRIBUTE_VALUE_UNQUOTED_STATE",this.state="CHARACTER_REFERENCE_STATE"):e===s.GREATER_THAN_SIGN?(this._leaveAttrValue(d),this._emitCurrentToken()):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentAttr.value+=r.REPLACEMENT_CHARACTER):e===s.QUOTATION_MARK||e===s.APOSTROPHE||e===s.LESS_THAN_SIGN||e===s.EQUALS_SIGN||e===s.GRAVE_ACCENT?(this._err(a.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=y(e)):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):this.currentAttr.value+=y(e)}AFTER_ATTRIBUTE_VALUE_QUOTED_STATE(e){u(e)?this._leaveAttrValue("BEFORE_ATTRIBUTE_NAME_STATE"):e===s.SOLIDUS?this._leaveAttrValue("SELF_CLOSING_START_TAG_STATE"):e===s.GREATER_THAN_SIGN?(this._leaveAttrValue(d),this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):(this._err(a.missingWhitespaceBetweenAttributes),this._reconsumeInState("BEFORE_ATTRIBUTE_NAME_STATE"))}SELF_CLOSING_START_TAG_STATE(e){e===s.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInTag),this._emitEOFToken()):(this._err(a.unexpectedSolidusInTag),this._reconsumeInState("BEFORE_ATTRIBUTE_NAME_STATE"))}BOGUS_COMMENT_STATE(e){e===s.GREATER_THAN_SIGN?(this.state=d,this._emitCurrentToken()):e===s.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.data+=r.REPLACEMENT_CHARACTER):this.currentToken.data+=y(e)}MARKUP_DECLARATION_OPEN_STATE(e){this._consumeSequenceIfMatch(c.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state="COMMENT_START_STATE"):this._consumeSequenceIfMatch(c.DOCTYPE_STRING,e,!1)?this.state="DOCTYPE_STATE":this._consumeSequenceIfMatch(c.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state="CDATA_SECTION_STATE":(this._err(a.cdataInHtmlContent),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state="BOGUS_COMMENT_STATE"):this._ensureHibernation()||(this._err(a.incorrectlyOpenedComment),this._createCommentToken(),this._reconsumeInState("BOGUS_COMMENT_STATE"))}COMMENT_START_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_START_DASH_STATE":e===s.GREATER_THAN_SIGN?(this._err(a.abruptClosingOfEmptyComment),this.state=d,this._emitCurrentToken()):this._reconsumeInState("COMMENT_STATE")}COMMENT_START_DASH_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_END_STATE":e===s.GREATER_THAN_SIGN?(this._err(a.abruptClosingOfEmptyComment),this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState("COMMENT_STATE"))}COMMENT_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_END_DASH_STATE":e===s.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state="COMMENT_LESS_THAN_SIGN_STATE"):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.data+=r.REPLACEMENT_CHARACTER):e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=y(e)}COMMENT_LESS_THAN_SIGN_STATE(e){e===s.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state="COMMENT_LESS_THAN_SIGN_BANG_STATE"):e===s.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState("COMMENT_STATE")}COMMENT_LESS_THAN_SIGN_BANG_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE":this._reconsumeInState("COMMENT_STATE")}COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE":this._reconsumeInState("COMMENT_END_DASH_STATE")}COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE(e){e!==s.GREATER_THAN_SIGN&&e!==s.EOF&&this._err(a.nestedComment),this._reconsumeInState("COMMENT_END_STATE")}COMMENT_END_DASH_STATE(e){e===s.HYPHEN_MINUS?this.state="COMMENT_END_STATE":e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState("COMMENT_STATE"))}COMMENT_END_STATE(e){e===s.GREATER_THAN_SIGN?(this.state=d,this._emitCurrentToken()):e===s.EXCLAMATION_MARK?this.state="COMMENT_END_BANG_STATE":e===s.HYPHEN_MINUS?this.currentToken.data+="-":e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState("COMMENT_STATE"))}COMMENT_END_BANG_STATE(e){e===s.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state="COMMENT_END_DASH_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.incorrectlyClosedComment),this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInComment),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState("COMMENT_STATE"))}DOCTYPE_STATE(e){u(e)?this.state="BEFORE_DOCTYPE_NAME_STATE":e===s.GREATER_THAN_SIGN?this._reconsumeInState("BEFORE_DOCTYPE_NAME_STATE"):e===s.EOF?(this._err(a.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingWhitespaceBeforeDoctypeName),this._reconsumeInState("BEFORE_DOCTYPE_NAME_STATE"))}BEFORE_DOCTYPE_NAME_STATE(e){u(e)||(p(e)?(this._createDoctypeToken(E(e)),this.state="DOCTYPE_NAME_STATE"):e===s.NULL?(this._err(a.unexpectedNullCharacter),this._createDoctypeToken(r.REPLACEMENT_CHARACTER),this.state="DOCTYPE_NAME_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypeName),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=d):e===s.EOF?(this._err(a.eofInDoctype),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(y(e)),this.state="DOCTYPE_NAME_STATE"))}DOCTYPE_NAME_STATE(e){u(e)?this.state="AFTER_DOCTYPE_NAME_STATE":e===s.GREATER_THAN_SIGN?(this.state=d,this._emitCurrentToken()):p(e)?this.currentToken.name+=E(e):e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.name+=r.REPLACEMENT_CHARACTER):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=y(e)}AFTER_DOCTYPE_NAME_STATE(e){u(e)||(e===s.GREATER_THAN_SIGN?(this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(c.PUBLIC_STRING,e,!1)?this.state="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE":this._consumeSequenceIfMatch(c.SYSTEM_STRING,e,!1)?this.state="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE":this._ensureHibernation()||(this._err(a.invalidCharacterSequenceAfterDoctypeName),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE(e){u(e)?this.state="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===s.QUOTATION_MARK?(this._err(a.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this._err(a.missingWhitespaceAfterDoctypePublicKeyword),this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE(e){u(e)||(e===s.QUOTATION_MARK?(this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this.currentToken.publicId="",this.state="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE(e){e===s.QUOTATION_MARK?this.state="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.publicId+=r.REPLACEMENT_CHARACTER):e===s.GREATER_THAN_SIGN?(this._err(a.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=d):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=y(e)}DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE(e){e===s.APOSTROPHE?this.state="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE":e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.publicId+=r.REPLACEMENT_CHARACTER):e===s.GREATER_THAN_SIGN?(this._err(a.abruptDoctypePublicIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=d):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=y(e)}AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE(e){u(e)?this.state="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE":e===s.GREATER_THAN_SIGN?(this.state=d,this._emitCurrentToken()):e===s.QUOTATION_MARK?(this._err(a.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this._err(a.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE(e){u(e)||(e===s.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=d):e===s.QUOTATION_MARK?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE(e){u(e)?this.state="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===s.QUOTATION_MARK?(this._err(a.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this._err(a.missingWhitespaceAfterDoctypeSystemKeyword),this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE"))}BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE(e){u(e)||(e===s.QUOTATION_MARK?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE"):e===s.APOSTROPHE?(this.currentToken.systemId="",this.state="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE"):e===s.GREATER_THAN_SIGN?(this._err(a.missingDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this.state=d,this._emitCurrentToken()):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.missingQuoteBeforeDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE(e){e===s.QUOTATION_MARK?this.state="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.systemId+=r.REPLACEMENT_CHARACTER):e===s.GREATER_THAN_SIGN?(this._err(a.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=d):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=y(e)}DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE(e){e===s.APOSTROPHE?this.state="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE":e===s.NULL?(this._err(a.unexpectedNullCharacter),this.currentToken.systemId+=r.REPLACEMENT_CHARACTER):e===s.GREATER_THAN_SIGN?(this._err(a.abruptDoctypeSystemIdentifier),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=d):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=y(e)}AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE(e){u(e)||(e===s.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=d):e===s.EOF?(this._err(a.eofInDoctype),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(a.unexpectedCharacterAfterDoctypeSystemIdentifier),this._reconsumeInState("BOGUS_DOCTYPE_STATE")))}BOGUS_DOCTYPE_STATE(e){e===s.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=d):e===s.NULL?this._err(a.unexpectedNullCharacter):e===s.EOF&&(this._emitCurrentToken(),this._emitEOFToken())}CDATA_SECTION_STATE(e){e===s.RIGHT_SQUARE_BRACKET?this.state="CDATA_SECTION_BRACKET_STATE":e===s.EOF?(this._err(a.eofInCdata),this._emitEOFToken()):this._emitCodePoint(e)}CDATA_SECTION_BRACKET_STATE(e){e===s.RIGHT_SQUARE_BRACKET?this.state="CDATA_SECTION_END_STATE":(this._emitChars("]"),this._reconsumeInState("CDATA_SECTION_STATE"))}CDATA_SECTION_END_STATE(e){e===s.GREATER_THAN_SIGN?this.state=d:e===s.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState("CDATA_SECTION_STATE"))}CHARACTER_REFERENCE_STATE(e){this.tempBuff=[s.AMPERSAND],e===s.NUMBER_SIGN?(this.tempBuff.push(e),this.state="NUMERIC_CHARACTER_REFERENCE_STATE"):f(e)?this._reconsumeInState("NAMED_CHARACTER_REFERENCE_STATE"):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}NAMED_CHARACTER_REFERENCE_STATE(e){const t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[s.AMPERSAND];else if(t){const e=this.tempBuff[this.tempBuff.length-1]===s.SEMICOLON;this._isCharacterReferenceAttributeQuirk(e)||(e||this._errOnNextCodePoint(a.missingSemicolonAfterCharacterReference),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState}else this._flushCodePointsConsumedAsCharacterReference(),this.state="AMBIGUOS_AMPERSAND_STATE"}AMBIGUOS_AMPERSAND_STATE(e){f(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=y(e):this._emitCodePoint(e):(e===s.SEMICOLON&&this._err(a.unknownNamedCharacterReference),this._reconsumeInState(this.returnState))}NUMERIC_CHARACTER_REFERENCE_STATE(e){this.charRefCode=0,e===s.LATIN_SMALL_X||e===s.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE"):this._reconsumeInState("DECIMAL_CHARACTER_REFERENCE_START_STATE")}HEXADEMICAL_CHARACTER_REFERENCE_START_STATE(e){!function(e){return h(e)||_(e)||b(e)}(e)?(this._err(a.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState("HEXADEMICAL_CHARACTER_REFERENCE_STATE")}DECIMAL_CHARACTER_REFERENCE_START_STATE(e){h(e)?this._reconsumeInState("DECIMAL_CHARACTER_REFERENCE_STATE"):(this._err(a.absenceOfDigitsInNumericCharacterReference),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState))}HEXADEMICAL_CHARACTER_REFERENCE_STATE(e){_(e)?this.charRefCode=16*this.charRefCode+e-55:b(e)?this.charRefCode=16*this.charRefCode+e-87:h(e)?this.charRefCode=16*this.charRefCode+e-48:e===s.SEMICOLON?this.state="NUMERIC_CHARACTER_REFERENCE_END_STATE":(this._err(a.missingSemicolonAfterCharacterReference),this._reconsumeInState("NUMERIC_CHARACTER_REFERENCE_END_STATE"))}DECIMAL_CHARACTER_REFERENCE_STATE(e){h(e)?this.charRefCode=10*this.charRefCode+e-48:e===s.SEMICOLON?this.state="NUMERIC_CHARACTER_REFERENCE_END_STATE":(this._err(a.missingSemicolonAfterCharacterReference),this._reconsumeInState("NUMERIC_CHARACTER_REFERENCE_END_STATE"))}NUMERIC_CHARACTER_REFERENCE_END_STATE(){if(this.charRefCode===s.NULL)this._err(a.nullCharacterReference),this.charRefCode=s.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err(a.characterReferenceOutsideUnicodeRange),this.charRefCode=s.REPLACEMENT_CHARACTER;else if(r.isSurrogate(this.charRefCode))this._err(a.surrogateCharacterReference),this.charRefCode=s.REPLACEMENT_CHARACTER;else if(r.isUndefinedCodePoint(this.charRefCode))this._err(a.noncharacterCharacterReference);else if(r.isControlCodePoint(this.charRefCode)||this.charRefCode===s.CARRIAGE_RETURN){this._err(a.controlCharacterReference);const e=l[this.charRefCode];e&&(this.charRefCode=e)}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)}}w.CHARACTER_TOKEN="CHARACTER_TOKEN",w.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",w.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",w.START_TAG_TOKEN="START_TAG_TOKEN",w.END_TAG_TOKEN="END_TAG_TOKEN",w.COMMENT_TOKEN="COMMENT_TOKEN",w.DOCTYPE_TOKEN="DOCTYPE_TOKEN",w.EOF_TOKEN="EOF_TOKEN",w.HIBERNATION_TOKEN="HIBERNATION_TOKEN",w.MODE={DATA:d,RCDATA:"RCDATA_STATE",RAWTEXT:"RAWTEXT_STATE",SCRIPT_DATA:"SCRIPT_DATA_STATE",PLAINTEXT:"PLAINTEXT_STATE"},w.getTokenAttr=function(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null},e.exports=w},function(e,t,n){const o=n(1007),r=n(1013),{klona:i}=n(1014),{isPlainObject:a}=n(1015),s=n(1016),c=n(1017),{parse:l}=n(1018),d=["img","audio","video","picture","svg","object","map","iframe","embed"],u=["script","style"];function h(e,t){e&&Object.keys(e).forEach((function(n){t(e[n],n)}))}function p(e,t){return{}.hasOwnProperty.call(e,t)}function m(e,t){const n=[];return h(e,(function(e){t(e)&&n.push(e)})),n}e.exports=f;const g=/^[^\0\t\n\f\r /<=>]+$/;function f(e,t,n){let b="",v="";function y(e,t){const n=this;this.tag=e,this.attribs=t||{},this.tagPosition=b.length,this.text="",this.mediaChildren=[],this.updateParentNodeText=function(){if(k.length){k[k.length-1].text+=n.text}},this.updateParentNodeMediaChildren=function(){if(k.length&&d.includes(this.tag)){k[k.length-1].mediaChildren.push(this.tag)}}}(t=Object.assign({},f.defaults,t)).parser=Object.assign({},_,t.parser),u.forEach((function(e){t.allowedTags&&t.allowedTags.indexOf(e)>-1&&!t.allowVulnerableTags&&console.warn(`\n\n⚠️ Your \`allowedTags\` option includes, \`${e}\`, which is inherently\nvulnerable to XSS attacks. Please remove it from \`allowedTags\`.\nOr, to disable this warning, add the \`allowVulnerableTags\` option\nand ensure you are accounting for this risk.\n\n`)}));const E=t.nonTextTags||["script","style","textarea","option"];let S,w;t.allowedAttributes&&(S={},w={},h(t.allowedAttributes,(function(e,t){S[t]=[];const n=[];e.forEach((function(e){"string"==typeof e&&e.indexOf("*")>=0?n.push(r(e).replace(/\\\*/g,".*")):S[t].push(e)})),w[t]=new RegExp("^("+n.join("|")+")$")})));const C={};h(t.allowedClasses,(function(e,t){S&&(p(S,t)||(S[t]=[]),S[t].push("class")),C[t]=e}));const T={};let x,O,k,R,I,D,A;h(t.transformTags,(function(e,t){let n;"function"==typeof e?n=e:"string"==typeof e&&(n=f.simpleTransform(e)),"*"===t?x=n:T[t]=n}));let N=!1;M();const F=new o.Parser({onopentag:function(e,n){if(t.enforceHtmlBoundary&&"html"===e&&M(),D)return void A++;const o=new y(e,n);k.push(o);let r=!1;const d=!!o.text;let u;if(p(T,e)&&(u=T[e](e,n),o.attribs=n=u.attribs,void 0!==u.text&&(o.innerText=u.text),e!==u.tagName&&(o.name=e=u.tagName,I[O]=u.tagName)),x&&(u=x(e,n),o.attribs=n=u.attribs,e!==u.tagName&&(o.name=e=u.tagName,I[O]=u.tagName)),(t.allowedTags&&-1===t.allowedTags.indexOf(e)||"recursiveEscape"===t.disallowedTagsMode&&!function(e){for(const t in e)if(p(e,t))return!1;return!0}(R)||null!=t.nestingLimit&&O>=t.nestingLimit)&&(r=!0,R[O]=!0,"discard"===t.disallowedTagsMode&&-1!==E.indexOf(e)&&(D=!0,A=1),R[O]=!0),O++,r){if("discard"===t.disallowedTagsMode)return;v=b,b=""}b+="<"+e,(!S||p(S,e)||S["*"])&&h(n,(function(n,r){if(!g.test(r))return void delete o.attribs[r];let d,u=!1;if(!S||p(S,e)&&-1!==S[e].indexOf(r)||S["*"]&&-1!==S["*"].indexOf(r)||p(w,e)&&w[e].test(r)||w["*"]&&w["*"].test(r))u=!0;else if(S&&S[e])for(const t of S[e])if(a(t)&&t.name&&t.name===r){u=!0;let e="";if(!0===t.multiple){const o=n.split(" ");for(const n of o)-1!==t.values.indexOf(n)&&(""===e?e=n:e+=" "+n)}else t.values.indexOf(n)>=0&&(e=n);n=e}if(u){if(-1!==t.allowedSchemesAppliedToAttributes.indexOf(r)&&L(e,n))return void delete o.attribs[r];if("iframe"===e&&"src"===r){let e=!0;try{if((n=n.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//")).startsWith("relative:"))throw new Error("relative: exploit attempt");let o="relative://relative-site";for(let e=0;e<100;e++)o+="/"+e;const r=new URL(n,o);if(r&&"relative-site"===r.hostname&&"relative:"===r.protocol)e=p(t,"allowIframeRelativeUrls")?t.allowIframeRelativeUrls:!t.allowedIframeHostnames&&!t.allowedIframeDomains;else if(t.allowedIframeHostnames||t.allowedIframeDomains){const n=(t.allowedIframeHostnames||[]).find((function(e){return e===r.hostname})),o=(t.allowedIframeDomains||[]).find((function(e){return r.hostname===e||r.hostname.endsWith("."+e)}));e=n||o}}catch(t){e=!1}if(!e)return void delete o.attribs[r]}if("srcset"===r)try{if(d=c(n),d.forEach((function(e){L("srcset",e.url)&&(e.evil=!0)})),d=m(d,(function(e){return!e.evil})),!d.length)return void delete o.attribs[r];n=m(d,(function(e){return!e.evil})).map((function(e){if(!e.url)throw new Error("URL missing");return e.url+(e.w?` ${e.w}w`:"")+(e.h?` ${e.h}h`:"")+(e.d?` ${e.d}x`:"")})).join(", "),o.attribs[r]=n}catch(e){return void delete o.attribs[r]}if("class"===r){const t=C[e],i=C["*"];if(!(n=j(n,t&&i?s(t,i):t||i)).length)return void delete o.attribs[r]}if("style"===r)try{const a=l(e+" {"+n+"}");if(0===(n=function(e){return e.nodes[0].nodes.reduce((function(e,t){return e.push(t.prop+":"+t.value),e}),[]).join(";")}(function(e,t){if(!t)return e;const n=i(e),o=e.nodes[0];let r;r=t[o.selector]&&t["*"]?s(t[o.selector],t["*"]):t[o.selector]||t["*"];r&&(n.nodes[0].nodes=o.nodes.reduce(function(e){return function(t,n){if(p(e,n.prop)){e[n.prop].some((function(e){return e.test(n.value)}))&&t.push(n)}return t}}(r),[]));return n}(a,t.allowedStyles))).length)return void delete o.attribs[r]}catch(e){return void delete o.attribs[r]}b+=" "+r,n&&n.length&&(b+='="'+P(n,!0)+'"')}else delete o.attribs[r]})),-1!==t.selfClosing.indexOf(e)?b+=" />":(b+=">",!o.innerText||d||t.textFilter||(b+=P(o.innerText),N=!0)),r&&(b=v+P(b),v="")},ontext:function(e){if(D)return;const n=k[k.length-1];let o;if(n&&(o=n.tag,e=void 0!==n.innerText?n.innerText:e),"discard"!==t.disallowedTagsMode||"script"!==o&&"style"!==o){const n=P(e,!1);t.textFilter&&!N?b+=t.textFilter(n,o):N||(b+=n)}else b+=e;if(k.length){k[k.length-1].text+=e}},onclosetag:function(e){if(D){if(A--,A)return;D=!1}const n=k.pop();if(!n)return;D=!!t.enforceHtmlBoundary&&"html"===e,O--;const o=R[O];if(o){if(delete R[O],"discard"===t.disallowedTagsMode)return void n.updateParentNodeText();v=b,b=""}I[O]&&(e=I[O],delete I[O]),t.exclusiveFilter&&t.exclusiveFilter(n)?b=b.substr(0,n.tagPosition):(n.updateParentNodeMediaChildren(),n.updateParentNodeText(),-1===t.selfClosing.indexOf(e)?(b+="",o&&(b=v+P(b),v="")):o&&(b=v,v=""))}},t.parser);return F.write(e),F.end(),b;function M(){b="",O=0,k=[],R={},I={},D=!1,A=0}function P(e,n){return"string"!=typeof e&&(e+=""),t.parser.decodeEntities&&(e=e.replace(/&/g,"&").replace(//g,">"),n&&(e=e.replace(/"/g,"""))),e=e.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(//g,">"),n&&(e=e.replace(/"/g,""")),e}function L(e,n){const o=(n=(n=n.replace(/[\x00-\x20]+/g,"")).replace(//g,"")).match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!o)return!!n.match(/^[/\\]{2}/)&&!t.allowProtocolRelative;const r=o[1].toLowerCase();return p(t.allowedSchemesByTag,e)?-1===t.allowedSchemesByTag[e].indexOf(r):!t.allowedSchemes||-1===t.allowedSchemes.indexOf(r)}function j(e,t){return t?(e=e.split(/\s+/)).filter((function(e){return-1!==t.indexOf(e)})).join(" "):e}}const _={decodeEntities:!0};f.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","main","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src"]},selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1},f.simpleTransform=function(e,t,n){return n=void 0===n||n,t=t||{},function(o,r){let i;if(n)for(i in t)r[i]=t[i];else r=t;return{tagName:e,attribs:r}}}},function(e,t,n){"use strict";let o=n(341);class r extends o{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}}e.exports=r,r.default=r},function(e,t,n){"use strict";let o=n(428),r=n(616),{isClean:i}=n(429),a=n(430);class s{constructor(e={}){this.raws={},this[i]=!1;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}else this[t]=e[t]}error(e,t={}){if(this.source){let n=this.positionBy(t);return this.source.input.error(e,n.line,n.column,t)}return new o(e)}warn(e,t,n){let o={node:this};for(let e in n)o[e]=n[e];return e.warn(t,o)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(e=a){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}clone(e={}){let t=function e(t,n){let o=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;if("proxyCache"===r)continue;let i=t[r],a=typeof i;"parent"===r&&"object"===a?n&&(o[r]=n):"source"===r?o[r]=i:Array.isArray(i)?o[r]=i.map(t=>e(t,o)):("object"===a&&null!==i&&(i=e(i)),o[r]=i)}return o}(this);for(let n in e)t[n]=e[n];return t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let o of e)o===this?n=!0:n?(this.parent.insertAfter(t,o),t=o):this.parent.insertBefore(t,o);n||this.remove()}return this}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}before(e){return this.parent.insertBefore(this,e),this}after(e){return this.parent.insertAfter(this,e),this}root(){let e=this;for(;e.parent;)e=e.parent;return e}raw(e,t){return(new r).raw(this,e,t)}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}toJSON(e,t){let n={},o=null==t;t=t||new Map;let r=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e)continue;let o=this[e];if(Array.isArray(o))n[e]=o.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof o&&o.toJSON)n[e]=o.toJSON(null,t);else if("source"===e){let i=t.get(o.input);null==i&&(i=r,t.set(o.input,r),r++),n[e]={inputId:i,start:o.start,end:o.end}}else n[e]=o}return o&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}positionInside(e){let t=this.toString(),n=this.source.start.column,o=this.source.start.line;for(let r=0;r(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0),get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t]}}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}markDirty(){if(this[i]){this[i]=!1;let e=this;for(;e=e.parent;)e[i]=!1}}get proxyOf(){return this}}e.exports=s,s.default=s},function(e,t,n){"use strict";let o=n(341);class r extends o{constructor(e){super(e),this.type="comment"}}e.exports=r,r.default=r},function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var o=n(92),r=n(88),i=n(435),a=n(149),s=n(94),c=n(373),l=n(181);function d(e){const t=e.getSender(),{entity:n}=e.getPrevContent(),{entity:o,recommendation:i,reason:a}=e.getContent();return o?i&&a?o===n?c.g.includes(e.getType())?Object(r.a)("%(senderName)s updated the rule banning users matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):c.c.includes(e.getType())?Object(r.a)("%(senderName)s updated the rule banning rooms matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):c.f.includes(e.getType())?Object(r.a)("%(senderName)s updated the rule banning servers matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):Object(r.a)("%(senderName)s updated a ban rule matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):n?c.g.includes(e.getType())?Object(r.a)("%(senderName)s changed a rule that was banning users matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",{senderName:t,oldGlob:n,newGlob:o,reason:a}):c.c.includes(e.getType())?Object(r.a)("%(senderName)s changed a rule that was banning rooms matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",{senderName:t,oldGlob:n,newGlob:o,reason:a}):c.f.includes(e.getType())?Object(r.a)("%(senderName)s changed a rule that was banning servers matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",{senderName:t,oldGlob:n,newGlob:o,reason:a}):Object(r.a)("%(senderName)s updated a ban rule that was matching %(oldGlob)s to matching %(newGlob)s for %(reason)s",{senderName:t,oldGlob:n,newGlob:o,reason:a}):c.g.includes(e.getType())?Object(r.a)("%(senderName)s created a rule banning users matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):c.c.includes(e.getType())?Object(r.a)("%(senderName)s created a rule banning rooms matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):c.f.includes(e.getType())?Object(r.a)("%(senderName)s created a rule banning servers matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):Object(r.a)("%(senderName)s created a ban rule matching %(glob)s for %(reason)s",{senderName:t,glob:o,reason:a}):Object(r.a)("%(senderName)s updated an invalid ban rule",{senderName:t}):c.g.includes(e.getType())?Object(r.a)("%(senderName)s removed the rule banning users matching %(glob)s",{senderName:t,glob:n}):c.c.includes(e.getType())?Object(r.a)("%(senderName)s removed the rule banning rooms matching %(glob)s",{senderName:t,glob:n}):c.f.includes(e.getType())?Object(r.a)("%(senderName)s removed the rule banning servers matching %(glob)s",{senderName:t,glob:n}):Object(r.a)("%(senderName)s removed a ban rule matching %(glob)s",{senderName:t,glob:n})}const u={"m.room.message":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();let n=t+": "+e.getContent().body;return"m.emote"===e.getContent().msgtype?n="* "+t+" "+n:"m.image"===e.getContent().msgtype&&(n=Object(r.a)("%(senderDisplayName)s sent an image.",{senderDisplayName:t})),n},"m.call.invite":function(e){const t=e.sender?e.sender.name:Object(r.a)("Someone");let n=!0;e.getContent().offer&&e.getContent().offer.sdp&&-1!==e.getContent().offer.sdp.indexOf("m=video")&&(n=!1);const i=o.a.get().supportsVoip();return n&&i?Object(r.a)("%(senderName)s placed a voice call.",{senderName:t}):n&&!i?Object(r.a)("%(senderName)s placed a voice call. (not supported by this browser)",{senderName:t}):!n&&i?Object(r.a)("%(senderName)s placed a video call.",{senderName:t}):n||i?void 0:Object(r.a)("%(senderName)s placed a video call. (not supported by this browser)",{senderName:t})},"m.call.answer":function(e){const t=e.sender?e.sender.name:Object(r.a)("Someone"),n=o.a.get().supportsVoip()?"":Object(r.a)("(not supported by this browser)");return Object(r.a)("%(senderName)s answered the call.",{senderName:t})+" "+n},"m.call.hangup":function(e){const t=e.sender?e.sender.name:Object(r.a)("Someone"),n=e.getContent();let i="";return o.a.get().supportsVoip()?n.reason&&(i="ice_failed"===n.reason?Object(r.a)("(could not connect media)"):"ice_timeout"===n.reason?Object(r.a)("(connection failed)"):"user_media_failed"===n.reason?Object(r.a)("(their device couldn't start the camera / microphone)"):"unknown_error"===n.reason?Object(r.a)("(an error occurred)"):"invite_timeout"===n.reason?Object(r.a)("(no answer)"):"user hangup"===n.reason||"user_hangup"===n.reason?"":Object(r.a)("(unknown failure: %(reason)s)",{reason:n.reason})):i=Object(r.a)("(not supported by this browser)"),Object(r.a)("%(senderName)s ended the call.",{senderName:t})+" "+i},"m.call.reject":function(e){const t=e.sender?e.sender.name:Object(r.a)("Someone");return Object(r.a)("%(senderName)s declined the call.",{senderName:t})}},h={"m.room.canonical_alias":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender(),n=e.getPrevContent().alias,o=e.getPrevContent().alt_aliases||[],i=e.getContent().alias,a=e.getContent().alt_aliases||[],s=o.filter(e=>!a.includes(e)),c=a.filter(e=>!o.includes(e));if(s.length||c.length){if(i!==n)return Object(r.a)("%(senderName)s changed the main and alternative addresses for this room.",{senderName:t});if(c.length&&!s.length)return Object(r.a)("%(senderName)s added the alternative addresses %(addresses)s for this room.",{senderName:t,addresses:c.join(", "),count:c.length});if(s.length&&!c.length)return Object(r.a)("%(senderName)s removed the alternative addresses %(addresses)s for this room.",{senderName:t,addresses:s.join(", "),count:s.length});if(s.length&&c.length)return Object(r.a)("%(senderName)s changed the alternative addresses for this room.",{senderName:t})}else{if(i)return Object(r.a)("%(senderName)s set the main address for this room to %(address)s.",{senderName:t,address:e.getContent().alias});if(n)return Object(r.a)("%(senderName)s removed the main address for this room.",{senderName:t})}return Object(r.a)("%(senderName)s changed the addresses for this room.",{senderName:t})},"m.room.name":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();return e.getContent().name&&0!==e.getContent().name.trim().length?e.getPrevContent().name?Object(r.a)("%(senderDisplayName)s changed the room name from %(oldRoomName)s to %(newRoomName)s.",{senderDisplayName:t,oldRoomName:e.getPrevContent().name,newRoomName:e.getContent().name}):Object(r.a)("%(senderDisplayName)s changed the room name to %(roomName)s.",{senderDisplayName:t,roomName:e.getContent().name}):Object(r.a)("%(senderDisplayName)s removed the room name.",{senderDisplayName:t})},"m.room.topic":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();return Object(r.a)('%(senderDisplayName)s changed the topic to "%(topic)s".',{senderDisplayName:t,topic:e.getContent().topic})},"m.room.member":function(e){const t=e.sender?e.sender.name:e.getSender(),n=e.target?e.target.name:e.getStateKey(),o=e.getPrevContent(),i=e.getContent(),a=i.reason?Object(r.a)("Reason")+": "+i.reason:"";switch(i.membership){case"invite":{const e=i.third_party_invite;return e?e.display_name?Object(r.a)("%(targetName)s accepted the invitation for %(displayName)s.",{targetName:n,displayName:e.display_name}):Object(r.a)("%(targetName)s accepted an invitation.",{targetName:n}):Object(r.a)("%(senderName)s invited %(targetName)s.",{senderName:t,targetName:n})}case"ban":return Object(r.a)("%(senderName)s banned %(targetName)s.",{senderName:t,targetName:n})+" "+a;case"join":return o&&"join"===o.membership?o.displayname&&i.displayname&&o.displayname!==i.displayname?Object(r.a)("%(oldDisplayName)s changed their display name to %(displayName)s.",{oldDisplayName:o.displayname,displayName:i.displayname}):!o.displayname&&i.displayname?Object(r.a)("%(senderName)s set their display name to %(displayName)s.",{senderName:e.getSender(),displayName:i.displayname}):o.displayname&&!i.displayname?Object(r.a)("%(senderName)s removed their display name (%(oldDisplayName)s).",{senderName:t,oldDisplayName:o.displayname}):o.avatar_url&&!i.avatar_url?Object(r.a)("%(senderName)s removed their profile picture.",{senderName:t}):o.avatar_url&&i.avatar_url&&o.avatar_url!==i.avatar_url?Object(r.a)("%(senderName)s changed their profile picture.",{senderName:t}):!o.avatar_url&&i.avatar_url?Object(r.a)("%(senderName)s set a profile picture.",{senderName:t}):s.b.getValue("showHiddenEventsInTimeline")?Object(r.a)("%(senderName)s made no change.",{senderName:t}):"":(e.target||console.warn("Join message has no target! -- "+e.getContent().state_key),Object(r.a)("%(targetName)s joined the room.",{targetName:n}));case"leave":return e.getSender()===e.getStateKey()?"invite"===o.membership?Object(r.a)("%(targetName)s rejected the invitation.",{targetName:n}):Object(r.a)("%(targetName)s left the room.",{targetName:n}):"ban"===o.membership?Object(r.a)("%(senderName)s unbanned %(targetName)s.",{senderName:t,targetName:n}):"invite"===o.membership?Object(r.a)("%(senderName)s withdrew %(targetName)s's invitation.",{senderName:t,targetName:n})+" "+a:"join"===o.membership?Object(r.a)("%(senderName)s kicked %(targetName)s.",{senderName:t,targetName:n})+" "+a:""}},"m.room.third_party_invite":function(e){const t=e.sender?e.sender.name:e.getSender();if(!Object(a.c)(e)){const n=e.getPrevContent().display_name||Object(r.a)("Someone");return Object(r.a)("%(senderName)s revoked the invitation for %(targetDisplayName)s to join the room.",{senderName:t,targetDisplayName:n})}return Object(r.a)("%(senderName)s sent an invitation to %(targetDisplayName)s to join the room.",{senderName:t,targetDisplayName:e.getContent().display_name})},"m.room.history_visibility":function(e){const t=e.sender?e.sender.name:e.getSender();switch(e.getContent().history_visibility){case"invited":return Object(r.a)("%(senderName)s made future room history visible to all room members, from the point they are invited.",{senderName:t});case"joined":return Object(r.a)("%(senderName)s made future room history visible to all room members, from the point they joined.",{senderName:t});case"shared":return Object(r.a)("%(senderName)s made future room history visible to all room members.",{senderName:t});case"world_readable":return Object(r.a)("%(senderName)s made future room history visible to anyone.",{senderName:t});default:return Object(r.a)("%(senderName)s made future room history visible to unknown (%(visibility)s).",{senderName:t,visibility:e.getContent().history_visibility})}},"m.room.power_levels":function(e){const t=e.sender?e.sender.name:e.getSender();if(!(e.getPrevContent()&&e.getPrevContent().users&&e.getContent()&&e.getContent().users))return"";const n=e.getContent().users_default||0,o=[];Object.keys(e.getContent().users).forEach(e=>{-1===o.indexOf(e)&&o.push(e)}),Object.keys(e.getPrevContent().users).forEach(e=>{-1===o.indexOf(e)&&o.push(e)});const a=[];return o.forEach(t=>{const o=e.getPrevContent().users[t],s=e.getContent().users[t];s!==o&&a.push(Object(r.a)("%(userId)s from %(fromPowerLevel)s to %(toPowerLevel)s",{userId:t,fromPowerLevel:i.b(o,n),toPowerLevel:i.b(s,n)}))}),a.length?Object(r.a)("%(senderName)s changed the power level of %(powerLevelDiffText)s.",{senderName:t,powerLevelDiffText:a.join(", ")}):""},"m.room.pinned_events":function(e){const t=e.sender?e.sender.name:e.getSender();return Object(r.a)("%(senderName)s changed the pinned messages for the room.",{senderName:t})},"m.room.server_acl":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender(),n=e.getPrevContent(),o=e.getContent(),i=Array.isArray(n.deny)?n.deny:[],a=Array.isArray(n.allow)?n.allow:[];n.allow_ip_literals;let s="";return s=0===i.length&&0===a.length?Object(r.a)("%(senderDisplayName)s set the server ACLs for this room.",{senderDisplayName:t}):Object(r.a)("%(senderDisplayName)s changed the server ACLs for this room.",{senderDisplayName:t}),Array.isArray(o.allow)||(o.allow=[]),0===o.allow.length?s+" "+Object(r.a)("🎉 All servers are banned from participating! This room can no longer be used."):s},"m.room.tombstone":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();return Object(r.a)("%(senderDisplayName)s upgraded this room.",{senderDisplayName:t})},"m.room.join_rules":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();switch(e.getContent().join_rule){case"public":return Object(r.a)("%(senderDisplayName)s made the room public to whoever knows the link.",{senderDisplayName:t});case"invite":return Object(r.a)("%(senderDisplayName)s made the room invite only.",{senderDisplayName:t});default:return Object(r.a)("%(senderDisplayName)s changed the join rule to %(rule)s",{senderDisplayName:t,rule:e.getContent().join_rule})}},"m.room.guest_access":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender();switch(e.getContent().guest_access){case"can_join":return Object(r.a)("%(senderDisplayName)s has allowed guests to join the room.",{senderDisplayName:t});case"forbidden":return Object(r.a)("%(senderDisplayName)s has prevented guests from joining the room.",{senderDisplayName:t});default:return Object(r.a)("%(senderDisplayName)s changed guest access to %(rule)s",{senderDisplayName:t,rule:e.getContent().guest_access})}},"m.room.related_groups":function(e){const t=e.sender&&e.sender.name?e.sender.name:e.getSender(),n=e.getContent().groups||[],o=e.getPrevContent().groups||[],i=n.filter(e=>!o.includes(e)),a=o.filter(e=>!n.includes(e));return i.length&&!a.length?Object(r.a)("%(senderDisplayName)s enabled flair for %(groups)s in this room.",{senderDisplayName:t,groups:i.join(", ")}):!i.length&&a.length?Object(r.a)("%(senderDisplayName)s disabled flair for %(groups)s in this room.",{senderDisplayName:t,groups:a.join(", ")}):i.length&&a.length?Object(r.a)("%(senderDisplayName)s enabled flair for %(newGroups)s and disabled flair for %(oldGroups)s in this room.",{senderDisplayName:t,newGroups:i.join(", "),oldGroups:a.join(", ")}):""},"im.vector.modular.widgets":function(e){const t=e.getSender(),{name:n,type:o,url:i}=e.getPrevContent(),{name:a,type:s,url:c}=e.getContent()||{};let l=a||n||s||o||"";return l&&l.length>0&&(l=l[0].toUpperCase()+l.slice(1)),c?i?Object(r.a)("%(widgetName)s widget modified by %(senderName)s",{widgetName:l,senderName:t}):Object(r.a)("%(widgetName)s widget added by %(senderName)s",{widgetName:l,senderName:t}):Object(r.a)("%(widgetName)s widget removed by %(senderName)s",{widgetName:l,senderName:t})},[l.c]:function(e){var t;const n=(null===(t=e.sender)||void 0===t?void 0:t.name)||e.getSender();return Object(r.a)("%(senderName)s has updated the widget layout",{senderName:n})}};for(const e of c.a)h[e]=d;function p(e){const t=(e.isState()?h:u)[e.getType()];return t?t(e):""}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var o=n(92),r=n(220),i=n(123),a=n(88),s=n(90),c=n(95),l=n(94),d=n(140);class u{constructor(e){"+"===e[0]?(this.roomId=null,this.groupId=e):(this.roomId=e,this.groupId=null),this.canceled=!1,this.addrs=[],this.busy=!1,this.completionStates={},this.errors={},this.deferred=null}invite(e,t){if(this.addrs.length>0)throw new Error("Already inviting/invited");this.addrs.push(...e),this.reason=t;for(const e of this.addrs)null===Object(r.c)(e)&&(this.completionStates[e]="error",this.errors[e]={errcode:"M_INVALID",errorText:Object(a.a)("Unrecognised address")});return this.deferred=Object(d.a)(),this._inviteMore(0),this.deferred.promise}cancel(){this.busy&&(this._canceled=!0,this.deferred.reject(new Error("canceled")))}getCompletionState(e){return this.completionStates[e]}getErrorText(e){return this.errors[e]?this.errors[e].errorText:null}async _inviteToRoom(e,t,n){const i=Object(r.c)(t);if("email"===i)return o.a.get().inviteByEmail(e,t);if("mx-user-id"===i){const r=o.a.get().getRoom(e);if(!r)throw new Error("Room not found");const i=r.getMember(t);if(i&&["join","invite"].includes(i.membership))throw{errcode:"RIOT.ALREADY_IN_ROOM",error:"Member already invited"};if(!n&&l.b.getValue("promptBeforeInviteUnknownUsers",this.roomId)){if(!await o.a.get().getProfileInfo(t))throw new Error("User has no profile")}return o.a.get().invite(e,t,void 0,this.reason)}throw new Error("Unsupported address")}_doInvite(e,t){return new Promise((n,o)=>{let r;console.log("Inviting "+e),r=null!==this.groupId?i.a.inviteUserToGroup(this.groupId,e):this._inviteToRoom(this.roomId,e,t),r.then(()=>{this._canceled||(this.completionStates[e]="invited",delete this.errors[e],n())}).catch(r=>{if(this._canceled)return;let i;console.error(r);let s=!1;if("M_FORBIDDEN"===r.errcode)s=!0,i=Object(a.a)("You do not have permission to invite people to this room.");else if("RIOT.ALREADY_IN_ROOM"===r.errcode)i=Object(a.a)("User %(userId)s is already in the room",{userId:e});else{if("M_LIMIT_EXCEEDED"===r.errcode)return void setTimeout(()=>{this._doInvite(e,t).then(n,o)},5e3);["M_NOT_FOUND","M_USER_NOT_FOUND"].includes(r.errcode)?i=Object(a.a)("User %(user_id)s does not exist",{user_id:e}):"M_PROFILE_UNDISCLOSED"===r.errcode?i=Object(a.a)("User %(user_id)s may or may not exist",{user_id:e}):"M_PROFILE_NOT_FOUND"!==r.errcode||t?i="M_BAD_STATE"===r.errcode?Object(a.a)("The user must be unbanned before they can be invited."):"M_UNSUPPORTED_ROOM_VERSION"===r.errcode?Object(a.a)("The user's homeserver does not support the version of the room."):Object(a.a)("Unknown server error"):(console.warn(`User ${e} does not have a profile - inviting anyways automatically`),this._doInvite(e,!0).then(n,o))}this.completionStates[e]="error",this.errors[e]={errorText:i,errcode:r.errcode},this.busy=!s,this.fatal=s,s?o():n()})})}_inviteMore(e,t){if(this._canceled)return;if(e===this.addrs.length){if(this.busy=!1,Object.keys(this.errors).length>0&&!this.groupId){const e=["M_NOT_FOUND","M_USER_NOT_FOUND","M_PROFILE_UNDISCLOSED","M_PROFILE_NOT_FOUND"],t=Object.keys(this.errors).filter(t=>e.includes(this.errors[t].errcode));if(t.length>0){const e=()=>{const e=t.map(e=>this._doInvite(e,!0));Promise.all(e).then(()=>this.deferred.resolve(this.completionStates))};if(!l.b.getValue("promptBeforeInviteUnknownUsers",this.roomId))return void e();const n=s.getComponent("dialogs.AskInviteAnywayDialog");return console.log("Showing failed to invite dialog..."),void c.a.createTrackedDialog("Failed to invite","",n,{unknownProfileUsers:t.map(e=>({userId:e,errorText:this.errors[e].errorText})),onInviteAnyways:()=>e(),onGiveUp:()=>{for(const e of t)this.completionStates[e]="invited";this.deferred.resolve(this.completionStates)}})}}return void this.deferred.resolve(this.completionStates)}const n=this.addrs[e];null!==Object(r.c)(n)&&"invited"!==this.completionStates[n]?this._doInvite(n,t).then(()=>{this._inviteMore(e+1,t)}).catch(()=>this.deferred.resolve(this.completionStates)):this._inviteMore(e+1)}}},function(e,t,n){"use strict";function o(e,t){return{msgtype:"m.text",format:"org.matrix.custom.html",body:e,formatted_body:t}}function r(e,t){return{msgtype:"m.notice",format:"org.matrix.custom.html",body:e,formatted_body:t}}function i(e,t){return{msgtype:"m.emote",format:"org.matrix.custom.html",body:e,formatted_body:t}}function a(e){return{msgtype:"m.text",body:e}}function s(e){return{msgtype:"m.notice",body:e}}function c(e){return{msgtype:"m.emote",body:e}}n.r(t),n.d(t,"makeHtmlMessage",(function(){return o})),n.d(t,"makeHtmlNotice",(function(){return r})),n.d(t,"makeHtmlEmote",(function(){return i})),n.d(t,"makeTextMessage",(function(){return a})),n.d(t,"makeNotice",(function(){return s})),n.d(t,"makeEmoteMessage",(function(){return c}))},function(e,t,n){"use strict";for(var o=/[\\\"\x00-\x1F]/g,r={},i=0;i<32;++i)r[String.fromCharCode(i)]="\\U"+("0000"+i.toString(16)).slice(-4).toUpperCase();function a(e){return o.lastIndex=0,e.replace(o,(function(e){return r[e]}))}function s(e){switch(typeof e){case"string":return'"'+a(e)+'"';case"number":return isFinite(e)?e:"null";case"boolean":return e;case"object":return null===e?"null":Array.isArray(e)?function(e){for(var t="[",n="",o=0;og.a.getFromSecretStorage(e,this._secretStorage))}function L(e){if("string"!=typeof e||e.indexOf(",")<0)return null;const t=Uint8Array.from(e.split(","),e=>parseInt(e));return u.encodeBase64(t)}function j(e){if(e._oneTimeKeyCheckInProgress)return;const t=Date.now();if(null!==e._lastOneTimeKeyCheck&&t-e._lastOneTimeKeyCheck<6e4)return;e._lastOneTimeKeyCheck=t;const n=e._olmDevice.maxNumberOfOneTimeKeys(),o=Math.floor(n/2);e._oneTimeKeyCheckInProgress=!0,Promise.resolve().then(()=>void 0!==e._oneTimeKeyCount?Promise.resolve(e._oneTimeKeyCount):e._baseApis.uploadKeysRequest({}).then(e=>e.one_time_key_counts.signed_curve25519||0)).then(t=>async function(t){for(;o>t||e.getNeedsNewFallback();){if(o>t){c.a.info("generating oneTimeKeys");const n=Math.min(o-t,5);await e._olmDevice.generateOneTimeKeys(n)}e.getNeedsNewFallback()&&(c.a.info("generating fallback key"),await e._olmDevice.generateFallbackKey()),c.a.info("calling _uploadOneTimeKeys");const n=await U(e);if(!n.one_time_key_counts||!n.one_time_key_counts.signed_curve25519)throw new Error("response for uploading keys does not contain one_time_key_counts.signed_curve25519");t=n.one_time_key_counts.signed_curve25519}}(t)).catch(e=>{c.a.error("Error uploading one-time keys",e.stack||e)}).finally(()=>{e._oneTimeKeyCount=void 0,e._oneTimeKeyCheckInProgress=!1})}async function U(e){const t=[],n={};if(e.getNeedsNewFallback()){const o=await e._olmDevice.getFallbackKey();for(const[r,i]of Object.entries(o.curve25519)){const o={key:i,fallback:!0};n["signed_curve25519:"+r]=o,t.push(e._signObject(o))}e.setNeedsNewFallback(!1)}const o=await e._olmDevice.getOneTimeKeys(),r={};for(const n in o.curve25519)if(o.curve25519.hasOwnProperty(n)){const i={key:o.curve25519[n]};r["signed_curve25519:"+n]=i,t.push(e._signObject(i))}await Promise.all(t);const i=await e._baseApis.uploadKeysRequest({one_time_keys:r,"org.matrix.msc2732.fallback_keys":n});return await e._olmDevice.markKeysAsPublished(),i}l.m(P,a.EventEmitter),P.prototype.init=async function(t){const{exportedOlmDevice:n,pickleKey:o}=t||{};c.a.log("Crypto: initialising Olm..."),await e.Olm.init(),c.a.log(n?"Crypto: initialising Olm device from exported device...":"Crypto: initialising Olm device..."),await this._olmDevice.init({fromExportedDevice:n,pickleKey:o}),c.a.log("Crypto: loading device list..."),await this._deviceList.load(),this._deviceKeys["ed25519:"+this._deviceId]=this._olmDevice.deviceEd25519Key,this._deviceKeys["curve25519:"+this._deviceId]=this._olmDevice.deviceCurve25519Key,c.a.log("Crypto: fetching own devices...");let r=this._deviceList.getRawStoredDevicesForUser(this._userId);if(r||(r={}),!r[this._deviceId]){c.a.log("Crypto: adding this device to the store...");const e={keys:this._deviceKeys,algorithms:this._supportedAlgorithms,verified:A.VERIFIED,known:!0};r[this._deviceId]=e,this._deviceList.storeDevicesForUser(this._userId,r),this._deviceList.saveIfDirty()}await this._cryptoStore.doTxn("readonly",[v.a.STORE_ACCOUNT],e=>{this._cryptoStore.getCrossSigningKeys(e,e=>{e&&0!==Object.keys(e).length&&(c.a.log("Loaded cross-signing public keys from crypto store"),this._crossSigningInfo.setKeys(e))})}),this._deviceList.startTrackingDeviceList(this._userId),c.a.log("Crypto: checking for key backup..."),this._checkAndStartKeyBackup()},P.prototype.getCryptoTrustCrossSignedDevices=function(){return this._trustCrossSignedDevices},P.prototype.setCryptoTrustCrossSignedDevices=function(e){this._trustCrossSignedDevices=e;for(const e of this._deviceList.getKnownUserIds()){const t=this._deviceList.getRawStoredDevicesForUser(e);for(const n of Object.keys(t)){const t=this.checkDeviceTrust(e,n);if(!t.isLocallyVerified()&&t.isCrossSigningVerified()){const t=this._deviceList.getStoredDevice(e,n);this.emit("deviceVerificationChanged",e,n,t)}}}},P.prototype.createRecoveryKeyFromPassphrase=async function(t){const n=new e.Olm.PkDecryption;try{const e={};if(t){const o=await Object(S.c)(t);e.passphrase={algorithm:"m.pbkdf2",iterations:o.iterations,salt:o.salt},e.pubkey=n.init_with_private_key(o.key)}else e.pubkey=n.generate_key();const o=n.get_private_key();return{keyInfo:e,encodedPrivateKey:Object(w.b)(o),privateKey:o}}finally{n&&n.free()}},P.prototype.isCrossSigningReady=async function(){const e=this._crossSigningInfo.getId(),t=await this._crossSigningInfo.isStoredInKeyCache()||await this._crossSigningInfo.isStoredInSecretStorage(this._secretStorage);return!(!e||!t)},P.prototype.isSecretStorageReady=async function(){const e=await this._secretStorage.hasKey(),t=await this._crossSigningInfo.isStoredInSecretStorage(this._secretStorage),n=!this._baseApis.getKeyBackupEnabled()||this._baseApis.isKeyBackupKeyStored();return!!(e&&t&&n)},P.prototype.bootstrapCrossSigning=async function({authUploadDeviceSigningKeys:e,setupNewCrossSigning:t}={}){c.a.log("Bootstrapping cross-signing");const n=this._baseApis._cryptoCallbacks,o=new f.a(this._baseApis.store.accountData,n),r=new g.a(this._userId,o.crossSigningCallbacks,o.crossSigningCallbacks),i=async()=>{r.resetKeys(),await this._signObject(r.keys.master),o.addCrossSigningKeys(e,r.keys);const t=this._deviceList.getStoredDevice(this._userId,this._deviceId),n=await r.signDevice(this._userId,t);o.addKeySignature(this._userId,this._deviceId,n),this.backupInfo&&(await r.signObject(this.backupInfo.auth_data,"master"),o.addSessionBackup(this.backupInfo))},a=this._crossSigningInfo.getId(),s=await this._crossSigningInfo.isStoredInKeyCache(),l=await this._crossSigningInfo.isStoredInSecretStorage(this._secretStorage),d=s||l;c.a.log({setupNewCrossSigning:t,publicKeysOnDevice:a,privateKeysInCache:s,privateKeysInStorage:l,privateKeysExistSomewhere:d}),!d||t?(c.a.log("Cross-signing private keys not found locally or in secret storage, creating new keys"),await i()):a&&s?c.a.log("Cross-signing public keys trusted and private keys found locally"):l&&(c.a.log("Cross-signing private keys not found locally, but they are available in secret storage, reading storage and caching locally"),await this.checkOwnCrossSigningTrust({allowPrivateKeyRequests:!0}));const u=o.crossSigningCallbacks.privateKeys;if(u.size&&!this._baseApis._cryptoCallbacks.saveCrossSigningKeys){const e=new _.b(o.accountDataClientAdapter,o.ssssCryptoCallbacks);await e.hasKey()&&(c.a.log("Storing new cross-signing private keys in secret storage"),await g.a.storeInSecretStorage(u,e))}const h=o.buildOperation();await h.apply(this),await o.persist(this),c.a.log("Cross-signing ready")},P.prototype.bootstrapSecretStorage=async function({createSecretStorageKey:e=(async()=>({})),keyBackupInfo:t,setupNewKeyBackup:n,setupNewSecretStorage:o,getKeyBackupPassphrase:r}={}){c.a.log("Bootstrapping Secure Secret Storage");const i=this._baseApis._cryptoCallbacks,a=new f.a(this._baseApis.store.accountData,i),s=new _.b(a.accountDataClientAdapter,a.ssssCryptoCallbacks);let l=null;const d=async(e,t)=>{e=e||{},t&&(e.key=t);const{keyId:n,keyInfo:o}=await s.addKey(_.a,e);return t&&a.ssssCryptoCallbacks.addPrivateKey(n,o,t),await s.setDefaultKeyId(n),n},h=async(e,t)=>{if(!t.mac){const n=await this._baseApis._cryptoCallbacks.getSecretStorageKey({keys:{[e]:t}},"");if(n){const o=n[1];a.ssssCryptoCallbacks.addPrivateKey(e,t,o);const{iv:r,mac:i}=await _.b._calculateKeyCheck(o);t.iv=r,t.mac=i,await a.setAccountData("m.secret_storage.key."+e,t)}}},p=async e=>{if(this._crossSigningInfo.getId()&&await this._crossSigningInfo.isStoredInKeyCache("master"))try{c.a.log("Adding cross-signing signature to key backup"),await this._crossSigningInfo.signObject(e,"master")}catch(e){c.a.error("Signing key backup with cross-signing keys failed",e)}else c.a.warn("Cross-signing keys not available, skipping signature on key backup")},m=await this.getSecretStorageKey(),[b,v]=m||[null,null],y=!o&&v&&v.algorithm===_.a;if(c.a.log({keyBackupInfo:t,setupNewKeyBackup:n,setupNewSecretStorage:o,storageExists:y,oldKeyInfo:v}),y||t)if(!y&&t){c.a.log("Secret storage does not exist, using key backup key");const e=await this.getSessionBackupPrivateKey()||await r(),n={};t.auth_data.private_key_salt&&t.auth_data.private_key_iterations&&(n.passphrase={algorithm:"m.pbkdf2",iterations:t.auth_data.private_key_iterations,salt:t.auth_data.private_key_salt,bits:256}),l=await d(n,e),await s.store("m.megolm_backup.v1",u.encodeBase64(e),[l]),await p(t.auth_data),a.addSessionBackup(t)}else c.a.log("Secret storage exists"),v&&v.algorithm===_.a&&await h(b,v);else{c.a.log("Secret storage does not exist, creating new storage key");const{keyInfo:t,privateKey:n}=await e();l=await d(t,n)}if(!this._baseApis._cryptoCallbacks.saveCrossSigningKeys&&await this.isCrossSigningReady()&&(l||!await this._crossSigningInfo.isStoredInSecretStorage(s))){c.a.log("Copying cross-signing private keys from cache to secret storage");const e=await this._crossSigningInfo.getCrossSigningKeysFromCache();await g.a.storeInSecretStorage(e,s)}if(n&&!t){c.a.log("Creating new message key backup version");const e=await this._baseApis.prepareKeyBackupVersion(null,{secureSecretStorage:!1}),t=Object(w.a)(e.recovery_key);await s.store("m.megolm_backup.v1",u.encodeBase64(t));const n={algorithm:e.algorithm,auth_data:e.auth_data};await p(n.auth_data),await this._signObject(n.auth_data),a.addSessionBackup(n)}const E=await s.get("m.megolm_backup.v1");if(E){c.a.info("Got session backup key from secret storage: caching");const e=L(E);e&&await s.store("m.megolm_backup.v1",e,[l||b]);const t=new Uint8Array(u.decodeBase64(e||E));await a.addSessionBackupPrivateKeyToCache(t)}const S=a.buildOperation();await S.apply(this),await a.persist(this),c.a.log("Secure Secret Storage ready")},P.prototype.addSecretStorageKey=function(e,t,n){return this._secretStorage.addKey(e,t,n)},P.prototype.hasSecretStorageKey=function(e){return this._secretStorage.hasKey(e)},P.prototype.getSecretStorageKey=function(e){return this._secretStorage.getKey(e)},P.prototype.storeSecret=function(e,t,n){return this._secretStorage.store(e,t,n)},P.prototype.getSecret=function(e){return this._secretStorage.get(e)},P.prototype.isSecretStored=function(e,t){return this._secretStorage.isStored(e,t)},P.prototype.requestSecret=function(e,t){return t||(t=Object.keys(this._deviceList.getRawStoredDevicesForUser(this._userId))),this._secretStorage.request(e,t)},P.prototype.getDefaultSecretStorageKeyId=function(){return this._secretStorage.getDefaultKeyId()},P.prototype.setDefaultSecretStorageKeyId=function(e){return this._secretStorage.setDefaultKeyId(e)},P.prototype.checkSecretStorageKey=function(e,t){return this._secretStorage.checkKey(e,t)},P.prototype.checkSecretStoragePrivateKey=function(t,n){let o=null;try{o=new e.Olm.PkDecryption;return o.init_with_private_key(t)===n}finally{o&&o.free()}},P.prototype.getSessionBackupPrivateKey=async function(){let e=await new Promise(e=>{this._cryptoStore.doTxn("readonly",[v.a.STORE_ACCOUNT],t=>{this._cryptoStore.getSecretStorePrivateKey(t,e,"m.megolm_backup.v1")})});if(e&&"string"==typeof e&&(e=new Uint8Array(u.decodeBase64(L(e)||e)),await this.storeSessionBackupPrivateKey(e)),e&&e.ciphertext){const t=o.from(this._olmDevice._pickleKey),n=await Object(R.a)(e,t,"m.megolm_backup.v1");e=u.decodeBase64(n)}return e},P.prototype.storeSessionBackupPrivateKey=async function(e){if(!(e instanceof Uint8Array))throw new Error("storeSessionBackupPrivateKey expects Uint8Array, got "+e);const t=o.from(this._olmDevice._pickleKey);return e=await Object(R.b)(u.encodeBase64(e),t,"m.megolm_backup.v1"),this._cryptoStore.doTxn("readwrite",[v.a.STORE_ACCOUNT],t=>{this._cryptoStore.storeSecretStorePrivateKey(t,"m.megolm_backup.v1",e)})},P.prototype.checkCrossSigningPrivateKey=function(t,n){let o=null;try{o=new e.Olm.PkSigning;return o.init_with_seed(t)===n}finally{o&&o.free()}},P.prototype._afterCrossSigningLocalKeyChange=async function(){c.a.info("Starting cross-signing key change post-processing");const e=this._deviceList.getStoredDevice(this._userId,this._deviceId),t=await this._crossSigningInfo.signDevice(this._userId,e);c.a.info("Starting background key sig upload for "+this._deviceId);const n=({shouldEmit:e})=>this._baseApis.uploadKeySignatures({[this._userId]:{[this._deviceId]:t}}).then(t=>{const{failures:o}=t||{};if(Object.keys(o||[]).length>0)throw e&&this._baseApis.emit("crypto.keySignatureUploadFailure",o,"_afterCrossSigningLocalKeyChange",n),new k.c("Key upload failed",{failures:o});c.a.info("Finished background key sig upload for "+this._deviceId)}).catch(e=>{c.a.error("Error during background key sig upload for "+this._deviceId,e)});n({shouldEmit:!0});const o=this._baseApis._cryptoCallbacks.shouldUpgradeDeviceVerifications;if(o){c.a.info("Starting device verification upgrade");const e={};for(const[t,n]of Object.entries(this._deviceList._crossSigningInfo)){const o=await this._checkForDeviceVerificationUpgrade(t,g.a.fromStorage(n,t));o&&(e[t]=o)}if(Object.keys(e).length>0){c.a.info(`Found ${Object.keys(e).length} verif users to upgrade`);try{const t=await o({users:e});if(t)for(const n of t)n in e&&await this._baseApis.setDeviceVerified(n,e[n].crossSigningInfo.getId())}catch(e){c.a.log("shouldUpgradeDeviceVerifications threw an error: not upgrading",e)}}c.a.info("Finished device verification upgrade")}c.a.info("Finished cross-signing key change post-processing")},P.prototype._checkForDeviceVerificationUpgrade=async function(e,t){const n=this._crossSigningInfo.checkUserTrust(t);if(t.firstUse&&!n.verified){const n=this._deviceList.getRawStoredDevicesForUser(e),o=await this._checkForValidDeviceSignature(e,t.keys.master,n);if(o.length)return{devices:o.map(e=>p.a.fromStorage(n[e],e)),crossSigningInfo:t}}},P.prototype._checkForValidDeviceSignature=async function(e,t,n){const o=[];if(n&&t.signatures&&t.signatures[e])for(const r of Object.keys(t.signatures[e])){const[,i]=r.split(":",2);if(i in n&&n[i].verified===A.VERIFIED)try{await u.verifySignature(this._olmDevice,t,e,i,n[i].keys[r]),o.push(i)}catch(e){}}return o},P.prototype.getCrossSigningId=function(e){return this._crossSigningInfo.getId(e)},P.prototype.getStoredCrossSigningForUser=function(e){return this._deviceList.getStoredCrossSigningForUser(e)},P.prototype.checkUserTrust=function(e){const t=this._deviceList.getStoredCrossSigningForUser(e);return t?this._crossSigningInfo.checkUserTrust(t):new g.c(!1,!1,!1)},P.prototype.checkDeviceTrust=function(e,t){const n=this._deviceList.getStoredDevice(e,t);return this._checkDeviceInfoTrust(e,n)},P.prototype._checkDeviceInfoTrust=function(e,t){const n=!(!t||!t.isVerified()),o=this._deviceList.getStoredCrossSigningForUser(e);if(t&&o){const r=this._trustCrossSignedDevices||e===this._userId;return this._crossSigningInfo.checkDeviceTrust(o,t,n,r)}return new g.b(!1,!1,n,!1)},P.prototype._onDeviceListUserCrossSigningUpdated=async function(e){if(e===this._userId){const t=this._deviceList.getStoredCrossSigningForUser(e),n=t?t.getId():null,o=this._crossSigningInfo.getId(),r=o!==n;o&&n&&!r?await this.checkOwnCrossSigningTrust():(this._storeTrustedSelfKeys(null),this.emit("crossSigning.keysChanged",{}),this.emit("userTrustStatusChanged",this._userId,this.checkUserTrust(e)))}else{await this._checkDeviceVerifications(e);const t=this._deviceList.getStoredCrossSigningForUser(e);t&&(t.updateCrossSigningVerifiedBefore(this.checkUserTrust(e).isCrossSigningVerified()),this._deviceList.setRawStoredCrossSigningForUser(e,t.toStorage())),this.emit("userTrustStatusChanged",e,this.checkUserTrust(e))}},P.prototype.checkOwnCrossSigningTrust=async function({allowPrivateKeyRequests:e=!1}={}){const t=this._userId;await this.downloadKeys([this._userId]);const n=await this._crossSigningInfo.getCrossSigningKeysFromCache(),o=this._deviceList.getStoredCrossSigningForUser(t);if(!o)return void c.a.error("Got cross-signing update event for user "+t+" but no new cross-signing information found!");const r=o.getId(),i=this._crossSigningInfo.getId()!==r,a=o.getId()&&!n.has("master");if(i&&c.a.info("Got new master public key",r),e&&(i||a)){c.a.info("Attempting to retrieve cross-signing master private key");let e=null;try{e=(await this._crossSigningInfo.getCrossSigningKey("master",r))[1],c.a.info("Got cross-signing master private key")}finally{e&&e.free()}}const s=this._crossSigningInfo.getId("self_signing"),l=this._crossSigningInfo.getId("user_signing");this._storeTrustedSelfKeys(o.keys);const d=s!==o.getId("self_signing"),u=l!==o.getId("user_signing"),h=o.getId("self_signing")&&!n.has("self_signing"),p=o.getId("user_signing")&&!n.has("user_signing"),m={};if(d&&c.a.info("Got new self-signing key",o.getId("self_signing")),e&&(d||h)){c.a.info("Attempting to retrieve cross-signing self-signing private key");let e=null;try{e=(await this._crossSigningInfo.getCrossSigningKey("self_signing",o.getId("self_signing")))[1],c.a.info("Got cross-signing self-signing private key")}finally{e&&e.free()}const t=this._deviceList.getStoredDevice(this._userId,this._deviceId),n=await this._crossSigningInfo.signDevice(this._userId,t);m[this._deviceId]=n}if(u&&c.a.info("Got new user-signing key",o.getId("user_signing")),e&&(u||p)){c.a.info("Attempting to retrieve cross-signing user-signing private key");let e=null;try{e=(await this._crossSigningInfo.getCrossSigningKey("user_signing",o.getId("user_signing")))[1],c.a.info("Got cross-signing user-signing private key")}finally{e&&e.free()}}if(i){const e=this._crossSigningInfo.keys.master;await this._signObject(e);const t=e.signatures[this._userId]["ed25519:"+this._deviceId];m[this._crossSigningInfo.getId()]=Object.assign({},e,{signatures:{[this._userId]:{["ed25519:"+this._deviceId]:t}}})}const g=Object.keys(m);if(g.length){const e=({shouldEmit:t})=>(c.a.info("Starting background key sig upload for "+g),this._baseApis.uploadKeySignatures({[this._userId]:m}).then(n=>{const{failures:o}=n||{};if(c.a.info("Finished background key sig upload for "+g),Object.keys(o||[]).length>0)throw t&&this._baseApis.emit("crypto.keySignatureUploadFailure",o,"checkOwnCrossSigningTrust",e),new k.c("Key upload failed",{failures:o})}).catch(e=>{c.a.error("Error during background key sig upload for "+g,e)}));e({shouldEmit:!0})}this.emit("userTrustStatusChanged",t,this.checkUserTrust(t)),i&&(this._baseApis.emit("crossSigning.keysChanged",{}),await this._afterCrossSigningLocalKeyChange()),await this.checkKeyBackup()},P.prototype._storeTrustedSelfKeys=async function(e){e?this._crossSigningInfo.setKeys(e):this._crossSigningInfo.clearKeys(),await this._cryptoStore.doTxn("readwrite",[v.a.STORE_ACCOUNT],e=>{this._cryptoStore.storeCrossSigningKeys(e,this._crossSigningInfo.keys)})},P.prototype._checkDeviceVerifications=async function(e){const t=this._baseApis._cryptoCallbacks.shouldUpgradeDeviceVerifications;if(t){if(c.a.info("Starting device verification upgrade for "+e),this._crossSigningInfo.keys.user_signing){const n=this._deviceList.getStoredCrossSigningForUser(e);if(n){const o=await this._checkForDeviceVerificationUpgrade(e,n);if(o){(await t({users:{[e]:o}})).includes(e)&&await this._baseApis.setDeviceVerified(e,n.getId())}}}c.a.info("Finished device verification upgrade for "+e)}},P.prototype._checkAndStartKeyBackup=async function(){if(c.a.log("Checking key backup status..."),this._baseApis.isGuest())return c.a.log("Skipping key backup check since user is guest"),this._checkedForBackup=!0,null;let e;try{e=await this._baseApis.getKeyBackupVersion()}catch(e){return c.a.log("Error checking for active key backup",e),404===e.httpStatus&&(this._checkedForBackup=!0),null}this._checkedForBackup=!0;const t=await this.isKeyBackupTrusted(e);return t.usable&&!this.backupInfo?(c.a.log("Found usable key backup v"+e.version+": enabling key backups"),this._baseApis.enableKeyBackup(e)):!t.usable&&this.backupInfo?(c.a.log("No usable key backup: disabling key backup"),this._baseApis.disableKeyBackup()):t.usable||this.backupInfo?t.usable&&this.backupInfo&&(e.version!==this.backupInfo.version?(c.a.log("On backup version "+this.backupInfo.version+" but found version "+e.version+": switching."),this._baseApis.disableKeyBackup(),this._baseApis.enableKeyBackup(e),await this.scheduleAllGroupSessionsForBackup()):c.a.log("Backup version "+e.version+" still current")):c.a.log("No usable key backup: not enabling key backup"),{backupInfo:e,trustInfo:t}},P.prototype.setTrustedBackupPubKey=async function(e){this._sessionStore.setLocalTrustedBackupPubKey(e),await this.checkKeyBackup()},P.prototype.checkKeyBackup=async function(){return this._checkedForBackup=!1,this._checkAndStartKeyBackup()},P.prototype.isKeyBackupTrusted=async function(e){const t={usable:!1,trusted_locally:!1,sigs:[]};if(!(e&&e.algorithm&&e.auth_data&&e.auth_data.public_key&&e.auth_data.signatures))return c.a.info("Key backup is absent or missing required data"),t;const n=this._sessionStore.getLocalTrustedBackupPubKey();e.auth_data.public_key===n&&(c.a.info("Backup public key "+n+" is trusted locally"),t.trusted_locally=!0);const o=e.auth_data.signatures[this._userId]||[];for(const n of Object.keys(o)){const o=n.split(":");if("ed25519"!==o[0]){c.a.log("Ignoring unknown signature type: "+o[0]);continue}const r={deviceId:o[1]},i=this._crossSigningInfo.getId();if(i===r.deviceId){r.crossSigningId=!0;try{await u.verifySignature(this._olmDevice,e.auth_data,this._userId,r.deviceId,i),r.valid=!0}catch(e){c.a.warning("Bad signature from cross signing key "+i,e),r.valid=!1}t.sigs.push(r);continue}const a=this._deviceList.getStoredDevice(this._userId,r.deviceId);if(a){r.device=a,r.deviceTrust=await this.checkDeviceTrust(this._userId,r.deviceId);try{await u.verifySignature(this._olmDevice,e.auth_data,this._userId,a.deviceId,a.getFingerprint()),r.valid=!0}catch(t){c.a.info("Bad signature from key ID "+n+" userID "+this._userId+" device ID "+a.deviceId+" fingerprint: "+a.getFingerprint(),e.auth_data,t),r.valid=!1}}else r.valid=null,c.a.info("Ignoring signature from unknown key "+n);t.sigs.push(r)}return t.usable=t.sigs.some(e=>e.valid&&(e.device&&e.deviceTrust.isVerified()||e.crossSigningId)),t.usable|=t.trusted_locally,t},P.prototype.enableLazyLoading=function(){this._lazyLoadMembers=!0},P.prototype.registerEventHandlers=function(e){const t=this;e.on("RoomMember.membership",(function(e,n,o){try{t._onRoomMembership(e,n,o)}catch(e){c.a.error("Error handling membership change:",e)}})),e.on("toDeviceEvent",t._onToDeviceEvent.bind(t));const n=t._onTimelineEvent.bind(t);e.on("Room.timeline",n),e.on("Event.decrypted",n)},P.prototype.start=function(){this._outgoingRoomKeyRequestManager.start()},P.prototype.stop=function(){this._outgoingRoomKeyRequestManager.stop(),this._deviceList.stop(),this._dehydrationManager.stop()},P.getOlmVersion=function(){return d.a.getOlmVersion()},P.prototype.getDeviceEd25519Key=function(){return this._olmDevice.deviceEd25519Key},P.prototype.getDeviceCurve25519Key=function(){return this._olmDevice.deviceCurve25519Key},P.prototype.setGlobalBlacklistUnverifiedDevices=function(e){this._globalBlacklistUnverifiedDevices=e},P.prototype.getGlobalBlacklistUnverifiedDevices=function(){return this._globalBlacklistUnverifiedDevices},P.prototype.setGlobalErrorOnUnknownDevices=function(e){this._globalErrorOnUnknownDevices=e},P.prototype.getGlobalErrorOnUnknownDevices=function(){return this._globalErrorOnUnknownDevices},P.prototype.uploadDeviceKeys=function(){const e=this,t=e._userId,n=e._deviceId,o={algorithms:e._supportedAlgorithms,device_id:n,keys:e._deviceKeys,user_id:t};return e._signObject(o).then(()=>e._baseApis.uploadKeysRequest({device_keys:o}))},P.prototype.updateOneTimeKeyCount=function(e){if(!isFinite(e))throw new TypeError("Parameter for updateOneTimeKeyCount has to be a number");this._oneTimeKeyCount=e},P.prototype.setNeedsNewFallback=function(e){this._needsNewFallback=!!e},P.prototype.getNeedsNewFallback=function(){return this._needsNewFallback},P.prototype.downloadKeys=function(e,t){return this._deviceList.downloadKeys(e,t)},P.prototype.getStoredDevicesForUser=function(e){return this._deviceList.getStoredDevicesForUser(e)},P.prototype.getStoredDevice=function(e,t){return this._deviceList.getStoredDevice(e,t)},P.prototype.saveDeviceList=function(e){return this._deviceList.saveIfDirty(e)},P.prototype.setDeviceVerification=async function(e,t,n,o,r){void 0===n&&(n=null),void 0===o&&(o=null),void 0===r&&(r=null);const i=this._deviceList.getStoredCrossSigningForUser(e);if(i&&i.getId()===t){if(null!==o||null!==r)throw new Error("Cannot set blocked or known for a cross-signing key");if(!n)throw new Error("Cannot set a cross-signing key as unverified");if(this._crossSigningInfo.getId()||e!==this._crossSigningInfo.userId||(this._storeTrustedSelfKeys(i.keys),this.emit("userTrustStatusChanged",this._userId,this.checkUserTrust(e))),e!==this._userId){c.a.info("Master key "+i.getId()+" for "+e+" marked verified. Signing...");const n=await this._crossSigningInfo.signUser(i);if(n){const o=async({shouldEmit:r})=>{c.a.info("Uploading signature for "+e+"...");const i=await this._baseApis.uploadKeySignatures({[e]:{[t]:n}}),{failures:a}=i||{};if(Object.keys(a||[]).length>0)throw r&&this._baseApis.emit("crypto.keySignatureUploadFailure",a,"setDeviceVerification",o),new k.c("Key upload failed",{failures:a})};await o({shouldEmit:!0})}return n}return i}const a=this._deviceList.getRawStoredDevicesForUser(e);if(!a||!a[t])throw new Error("Unknown device "+e+":"+t);const s=a[t];let l=s.verified;n?l=A.VERIFIED:null!==n&&l==A.VERIFIED&&(l=A.UNVERIFIED),o?l=A.BLOCKED:null!==o&&l==A.BLOCKED&&(l=A.UNVERIFIED);let d=s.known;if(null!==r&&(d=r),s.verified===l&&s.known===d||(s.verified=l,s.known=d,this._deviceList.storeDevicesForUser(e,a),this._deviceList.saveIfDirty()),n&&e===this._userId){let n;c.a.info("Own device "+t+" marked verified: signing");if(this.checkDeviceTrust(e,t).isCrossSigningVerified()?c.a.log(`Own device ${t} already cross-signing verified`):n=await this._crossSigningInfo.signDevice(e,p.a.fromStorage(s,t)),n){const o=async({shouldEmit:r})=>{c.a.info("Uploading signature for "+t);const i=await this._baseApis.uploadKeySignatures({[e]:{[t]:n}}),{failures:a}=i||{};if(Object.keys(a||[]).length>0)throw r&&this._baseApis.emit("crypto.keySignatureUploadFailure",a,"setDeviceVerification",o),new k.c("Key upload failed",{failures:a})};await o({shouldEmit:!0})}}const u=p.a.fromStorage(s,t);return this.emit("deviceVerificationChanged",e,t,u),u},P.prototype.findVerificationRequestDMInProgress=function(e){return this._inRoomVerificationRequests.findRequestInProgress(e)},P.prototype.getVerificationRequestsToDeviceInProgress=function(e){return this._toDeviceVerificationRequests.getRequestsInProgress(e)},P.prototype.requestVerificationDM=function(e,t){const n=this._inRoomVerificationRequests.findRequestInProgress(t);if(n)return Promise.resolve(n);const o=new T.a(this._baseApis,t,e);return this._requestVerificationWithChannel(e,o,this._inRoomVerificationRequests)},P.prototype.requestVerification=function(e,t){t||(t=Object.keys(this._deviceList.getRawStoredDevicesForUser(e)));const n=this._toDeviceVerificationRequests.findRequestInProgress(e,t);if(n)return Promise.resolve(n);const o=new x.a(this._baseApis,e,t,x.a.makeTransactionId());return this._requestVerificationWithChannel(e,o,this._toDeviceVerificationRequests)},P.prototype._requestVerificationWithChannel=async function(e,t,n){let o=new C.k(t,this._verificationMethods,this._baseApis);t.transactionId&&n.setRequestByChannel(t,o),await o.sendRequest();const r=n.getRequestByChannel(t);return r?o=r:(c.a.log(`Crypto: adding new request to requestsByTxnId with id ${t.transactionId} ${t.roomId}`),n.setRequestByChannel(t,o)),o},P.prototype.beginKeyVerification=function(e,t,n,o=null){let r;if(o){if(r=this._toDeviceVerificationRequests.getRequestBySenderAndTxnId(t,o),!r)throw new Error(`No request found for user ${t} with transactionId `+o)}else{o=x.a.makeTransactionId();const e=new x.a(this._baseApis,t,[n],o,n);r=new C.k(e,this._verificationMethods,this._baseApis),this._toDeviceVerificationRequests.setRequestBySenderAndTxnId(t,o,r)}return r.beginKeyVerification(e,{userId:t,deviceId:n})},P.prototype.legacyDeviceVerification=async function(e,t,n){const o=x.a.makeTransactionId(),r=new x.a(this._baseApis,e,[t],o,t),i=new C.k(r,this._verificationMethods,this._baseApis);this._toDeviceVerificationRequests.setRequestBySenderAndTxnId(e,o,i);const a=i.beginKeyVerification(n,{userId:e,deviceId:t});return await Promise.race([a.verify(),i.waitFor(e=>e.started)]),i},P.prototype.getOlmSessionsForUser=async function(e){const t=this.getStoredDevicesForUser(e)||[],n={};for(let e=0;e0)return null;if(e.isKeySourceUntrusted())return null;const o=this._deviceList.getDeviceByIdentityKey(n,t);if(null===o)return null;const r=e.getClaimedEd25519Key();return r?r!==o.getFingerprint()?(c.a.warn("Event "+e.getId()+" claims ed25519 key "+r+" but sender device has key "+o.getFingerprint()),null):o:(c.a.warn("Event "+e.getId()+" claims no ed25519 key: cannot verify sending device"),null)},P.prototype.getEventEncryptionInfo=function(e){const t={};if(t.senderKey=e.getSenderKey(),t.algorithm=e.getWireContent().algorithm,!t.senderKey||!t.algorithm)return t.encrypted=!1,t;t.encrypted=!0;e.getForwardingCurve25519KeyChain().length>0||e.isKeySourceUntrusted()?t.authenticated=!1:t.authenticated=!0,t.sender=this._deviceList.getDeviceByIdentityKey(t.algorithm,t.senderKey);const n=e.getClaimedEd25519Key();return n||(c.a.warn("Event "+e.getId()+" claims no ed25519 key: cannot verify sending device"),t.mismatchedSender=!0),t.sender&&n!==t.sender.getFingerprint()&&(c.a.warn("Event "+e.getId()+" claims ed25519 key "+n+"but sender device has key "+t.sender.getFingerprint()),t.mismatchedSender=!0),t},P.prototype.forceDiscardSession=function(e){const t=this._roomEncryptors[e];if(void 0===t)throw new Error("Room not encrypted");if(void 0===t.forceDiscardSession)throw new Error("Room encryption algorithm doesn't support session discarding");t.forceDiscardSession()},P.prototype.setRoomEncryption=async function(e,t,n){if(!t.algorithm)return void c.a.log("Ignoring setRoomEncryption with no algorithm");const o=this._roomList.getRoomEncryption(e);if(o&&JSON.stringify(o)!=JSON.stringify(t))return void c.a.error("Ignoring m.room.encryption event which requests a change of config in "+e);if(this._roomEncryptors[e])return;let r=null;o||(r=this._roomList.setRoomEncryption(e,t));const i=m.c[t.algorithm];if(!i)throw new Error("Unable to encrypt with "+t.algorithm);const a=new i({userId:this._userId,deviceId:this._deviceId,crypto:this,olmDevice:this._olmDevice,baseApis:this._baseApis,roomId:e,config:t});this._roomEncryptors[e]=a,r&&await r,this._lazyLoadMembers?c.a.log("Enabling encryption in "+e):(c.a.log("Enabling encryption in "+e+"; starting to track device lists for all users therein"),await this.trackRoomDevices(e),this.inhibitDeviceQuery||this._deviceList.refreshOutdatedDeviceLists())},P.prototype.trackRoomDevices=function(e){const t=async()=>{if(!this._roomEncryptors[e])return;const t=this._clientStore.getRoom(e);if(!t)throw new Error("Unable to start tracking devices in unknown room "+e);c.a.log(`Starting to track devices for room ${e} ...`);(await t.getEncryptionTargetMembers()).forEach(e=>{this._deviceList.startTrackingDeviceList(e.userId)})};let n=this._roomDeviceTrackingState[e];return n||(n=t(),this._roomDeviceTrackingState[e]=n.catch(t=>{throw this._roomDeviceTrackingState[e]=null,t})),n},P.prototype.ensureOlmSessionsForUsers=function(e){const t={};for(let n=0;n{this._cryptoStore.getAllEndToEndInboundGroupSessions(t,t=>{if(null===t)return;const n=this._olmDevice.exportInboundGroupSession(t.senderKey,t.sessionId,t.sessionData);delete n.first_known_index,n.algorithm=u.MEGOLM_ALGORITHM,e.push(n)})}),e},P.prototype.importRoomKeys=function(e,t={}){let n=0,o=0;const r=e.length;function i(){t.progressCallback({stage:"load_keys",successes:n,failures:o,total:r})}return Promise.all(e.map(e=>{if(!e.room_id||!e.algorithm)return c.a.warn("ignoring room key entry with missing fields",e),o++,t.progressCallback&&i(),null;return this._getRoomDecryptor(e.room_id,e.algorithm).importRoomKey(e,t).finally(e=>{n++,t.progressCallback&&i()})}))},P.prototype.scheduleKeyBackupSend=async function(e=1e4){if(!this._sendingBackups){this._sendingBackups=!0;try{const t=Math.random()*e;await Object(l.w)(t);let n=0;for(;;){if(!this.backupKey)return;try{if(0===await this._backupPendingKeys(200))return;n=0}catch(e){if(n++,c.a.log("Key backup request failed",e),e.data&&("M_NOT_FOUND"==e.data.errcode||"M_WRONG_ROOM_KEYS_VERSION"==e.data.errcode))throw await this.checkKeyBackup(),this.emit("crypto.keyBackupFailed",e.data.errcode),e}n&&await Object(l.w)(1e3*Math.pow(2,Math.min(n-1,4)))}}finally{this._sendingBackups=!1}}},P.prototype._backupPendingKeys=async function(e){const t=await this._cryptoStore.getSessionsNeedingBackup(e);if(!t.length)return 0;let n=await this._cryptoStore.countSessionsNeedingBackup();this.emit("crypto.keyBackupSessionsRemaining",n);const o={};for(const e of t){const t=e.sessionData.room_id;void 0===o[t]&&(o[t]={sessions:{}});const n=await this._olmDevice.exportInboundGroupSession(e.senderKey,e.sessionId,e.sessionData);n.algorithm=u.MEGOLM_ALGORITHM,delete n.session_id,delete n.room_id;const r=n.first_known_index;delete n.first_known_index;const i=this.backupKey.encrypt(JSON.stringify(n)),a=(n.forwarding_curve25519_key_chain||[]).length,s=this._deviceList.getUserByIdentityKey(u.MEGOLM_ALGORITHM,e.senderKey),c=this._deviceList.getDeviceByIdentityKey(u.MEGOLM_ALGORITHM,e.senderKey),l=this._checkDeviceInfoTrust(s,c).isVerified();o[t].sessions[e.sessionId]={first_message_index:r,forwarded_count:a,is_verified:l,session_data:i}}return await this._baseApis.sendKeyBackup(void 0,void 0,this.backupInfo.version,{rooms:o}),await this._cryptoStore.unmarkSessionsNeedingBackup(t),n=await this._cryptoStore.countSessionsNeedingBackup(),this.emit("crypto.keyBackupSessionsRemaining",n),t.length},P.prototype.backupGroupSession=async function(e,t,n,o,r,i,a){await this._cryptoStore.markSessionsNeedingBackup([{senderKey:t,sessionId:o}]),this.backupInfo&&this.scheduleKeyBackupSend()},P.prototype.scheduleAllGroupSessionsForBackup=async function(){await this.flagAllGroupSessionsForBackup(),this.scheduleKeyBackupSend(0)},P.prototype.flagAllGroupSessionsForBackup=async function(){await this._cryptoStore.doTxn("readwrite",[v.a.STORE_INBOUND_GROUP_SESSIONS,v.a.STORE_BACKUP],e=>{this._cryptoStore.getAllEndToEndInboundGroupSessions(e,t=>{null!==t&&this._cryptoStore.markSessionsNeedingBackup([t],e)})});const e=await this._cryptoStore.countSessionsNeedingBackup();return this.emit("crypto.keyBackupSessionsRemaining",e),e},P.prototype.countSessionsNeedingBackup=function(){return this._cryptoStore.countSessionsNeedingBackup()},P.prototype.prepareToEncrypt=function(e){const t=e.roomId,n=this._roomEncryptors[t];n&&n.prepareToEncrypt(e)},P.prototype.encryptEvent=async function(e,t){if(!t)throw new Error("Cannot send encrypted messages in unknown rooms");const n=e.getRoomId(),o=this._roomEncryptors[n];if(!o)throw new Error("Room was previously configured to use encryption, but is no longer. Perhaps the homeserver is hiding the configuration event.");this._roomDeviceTrackingState[n]||this.trackRoomDevices(n),await this._roomDeviceTrackingState[n];let r=e.getContent();const i=r["m.relates_to"];i&&(r=Object.assign({},r),delete r["m.relates_to"]);const a=await o.encryptMessage(t,e.getType(),r);i&&(a["m.relates_to"]=i),e.makeEncrypted("m.room.encrypted",a,this._olmDevice.deviceCurve25519Key,this._olmDevice.deviceEd25519Key)},P.prototype.decryptEvent=async function(e){if(e.isRedacted()){const t=new D.b(e.getUnsigned().redacted_because),n=await this.decryptEvent(t);return{clearEvent:{room_id:e.getRoomId(),type:"m.room.message",content:{},unsigned:{redacted_because:n.clearEvent}}}}{const t=e.getWireContent(),n=this._getRoomDecryptor(e.getRoomId(),t.algorithm);return await n.decryptEvent(e)}},P.prototype.handleDeviceListChanges=async function(e,t){e.oldSyncToken&&await this._evalDeviceListChanges(t)},P.prototype.requestRoomKey=function(e,t,n=!1){return this._outgoingRoomKeyRequestManager.queueRoomKeyRequest(e,t,n).then(()=>{this._sendKeyRequestsImmediately&&this._outgoingRoomKeyRequestManager.sendQueuedRequests()}).catch(e=>{c.a.error("Error requesting key for event",e)})},P.prototype.cancelRoomKeyRequest=function(e){this._outgoingRoomKeyRequestManager.cancelRoomKeyRequest(e).catch(e=>{c.a.warn("Error clearing pending room key requests",e)})},P.prototype.cancelAndResendAllOutgoingKeyRequests=function(){return this._outgoingRoomKeyRequestManager.cancelAndResendAllOutgoingRequests()},P.prototype.onCryptoEvent=async function(e){const t=e.getRoomId(),n=e.getContent();try{await this.setRoomEncryption(t,n,!0)}catch(e){c.a.error("Error configuring encryption in room "+t+":",e)}},P.prototype.onSyncWillProcess=async function(e){e.oldSyncToken||(c.a.log("Initial sync performed - resetting device tracking state"),this._deviceList.stopTrackingAllDeviceLists(),this._deviceList.startTrackingDeviceList(this._userId),this._roomDeviceTrackingState={}),this._sendKeyRequestsImmediately=!1},P.prototype.onSyncCompleted=async function(e){const t=e.nextSyncToken;this._deviceList.setSyncToken(e.nextSyncToken),this._deviceList.saveIfDirty(),this._deviceList.lastKnownSyncToken=t,this._deviceList.startTrackingDeviceList(this._userId),this._deviceList.refreshOutdatedDeviceLists(),e.catchingUp||(j(this),this._processReceivedRoomKeyRequests(),this._outgoingRoomKeyRequestManager.sendQueuedRequests(),this._sendKeyRequestsImmediately=!0)},P.prototype._evalDeviceListChanges=async function(e){if(e.changed&&Array.isArray(e.changed)&&e.changed.forEach(e=>{this._deviceList.invalidateUserDeviceList(e)}),e.left&&Array.isArray(e.left)&&e.left.length){const t=new Set(await this._getTrackedE2eUsers());e.left.forEach(e=>{t.has(e)||this._deviceList.stopTrackingDeviceList(e)})}},P.prototype._getTrackedE2eUsers=async function(){const e=[];for(const t of this._getTrackedE2eRooms()){const n=await t.getEncryptionTargetMembers();for(const t of n)e.push(t.userId)}return e},P.prototype._getTrackedE2eRooms=function(){return this._clientStore.getRooms().filter(e=>{if(!this._roomEncryptors[e.roomId])return!1;if(!this._roomDeviceTrackingState[e.roomId])return!1;const t=e.getMyMembership();return"join"===t||"invite"===t})},P.prototype._onToDeviceEvent=function(e){try{c.a.log(`received to_device ${e.getType()} from: ${e.getSender()} id: ${e.getId()}`),"m.room_key"==e.getType()||"m.forwarded_room_key"==e.getType()?this._onRoomKeyEvent(e):"m.room_key_request"==e.getType()?this._onRoomKeyRequestEvent(e):"m.secret.request"===e.getType()?this._secretStorage._onRequestReceived(e):"m.secret.send"===e.getType()?this._secretStorage._onSecretReceived(e):"org.matrix.room_key.withheld"===e.getType()?this._onRoomKeyWithheldEvent(e):e.getContent().transaction_id?this._onKeyVerificationMessage(e):"m.bad.encrypted"===e.getContent().msgtype?this._onToDeviceBadEncrypted(e):(e.isBeingDecrypted()||e.shouldAttemptDecryption())&&(e.isBeingDecrypted()||e.attemptDecryption(this),e.once("Event.decrypted",e=>{this._onToDeviceEvent(e)}))}catch(e){c.a.error("Error handling toDeviceEvent:",e)}},P.prototype._onRoomKeyEvent=function(e){const t=e.getContent();if(!t.room_id||!t.algorithm)return void c.a.error("key event is missing fields");this._checkedForBackup||this._checkAndStartKeyBackup();this._getRoomDecryptor(t.room_id,t.algorithm).onRoomKeyEvent(e)},P.prototype._onRoomKeyWithheldEvent=function(e){const t=e.getContent();if(!(("m.no_olm"===t.code||t.room_id&&t.session_id)&&t.algorithm&&t.sender_key))return void c.a.error("key withheld event is missing fields");c.a.info(`Got room key withheld event from ${e.getSender()} (${t.sender_key}) for ${t.algorithm}/${t.room_id}/${t.session_id} with reason ${t.code} (${t.reason})`);const n=this._getRoomDecryptor(t.room_id,t.algorithm);if(n.onRoomKeyWithheldEvent&&n.onRoomKeyWithheldEvent(e),!t.room_id){const e=this._getRoomDecryptors(t.algorithm);for(const n of e)n.retryDecryptionFromSender(t.sender_key)}},P.prototype._onKeyVerificationMessage=function(e){if(!x.a.validateEvent(e,this._baseApis))return;this._handleVerificationEvent(e,this._toDeviceVerificationRequests,e=>{if(!x.a.canCreateRequest(x.a.getEventType(e)))return;const t=e.getContent(),n=t&&t.from_device;if(!n)return;const o=e.getSender(),r=new x.a(this._baseApis,o,[n]);return new C.k(r,this._verificationMethods,this._baseApis)})},P.prototype._onTimelineEvent=function(e,t,n,o,{liveEvent:r}={}){if(!T.a.validateEvent(e,this._baseApis))return;this._handleVerificationEvent(e,this._inRoomVerificationRequests,e=>{const t=new T.a(this._baseApis,e.getRoomId());return new C.k(t,this._verificationMethods,this._baseApis)},r)},P.prototype._handleVerificationEvent=async function(e,t,n,o=!0){let r=t.getRequest(e),i=!1;if(!r){if(r=n(e),!r)return void c.a.log("Crypto: could not find VerificationRequest for "+e.getType()+", and could not create one, so ignoring.");i=!0,t.setRequest(e,r)}e.setVerificationRequest(r);try{await r.channel.handleEvent(e,r,o)}catch(e){c.a.error("error while handling verification event: "+e.message)}i&&!r.initiatedByMe&&!r.invalid&&!r.observeOnly&&this._baseApis.emit("crypto.verification.request",r)},P.prototype._onToDeviceBadEncrypted=async function(e){const t=e.getWireContent(),n=e.getSender(),o=t.algorithm,r=t.sender_key,i=()=>{const e=this._getRoomDecryptors(u.MEGOLM_ALGORITHM);for(const t of e)t.retryDecryptionFromSender(r)};if(void 0===n||void 0===r||void 0===r)return;this._lastNewSessionForced[n]=this._lastNewSessionForced[n]||{};const a=this._lastNewSessionForced[n][r]||0;if(a+36e5>Date.now())return c.a.debug("New session already forced with device "+n+":"+r+" at "+a+": not forcing another"),await this._olmDevice.recordSessionProblem(r,"wedged",!0),void i();let s=this._deviceList.getDeviceByIdentityKey(o,r);if(!s&&(await this.downloadKeys([n],!1),s=this._deviceList.getDeviceByIdentityKey(o,r),!s))return c.a.info("Couldn't find device for identity key "+r+": not re-establishing session"),await this._olmDevice.recordSessionProblem(r,"wedged",!1),void i();const l={};l[n]=[s],await u.ensureOlmSessionsForDevices(this._olmDevice,this._baseApis,l,!0),this._lastNewSessionForced[n][r]=Date.now();const d={algorithm:u.OLM_ALGORITHM,sender_key:this._olmDevice.deviceCurve25519Key,ciphertext:{}};await u.encryptMessageForDevice(d.ciphertext,this._userId,this._deviceId,this._olmDevice,n,s,{type:"m.dummy"}),await this._olmDevice.recordSessionProblem(r,"wedged",!0),i(),await this._baseApis.sendToDevice("m.room.encrypted",{[n]:{[s.deviceId]:d}});const h=await this._outgoingRoomKeyRequestManager.getOutgoingSentRoomKeyRequest(n,s.deviceId);for(const e of h)this.requestRoomKey(e.requestBody,e.recipients,!0)},P.prototype._onRoomMembership=function(e,t,n){const o=t.roomId,r=this._roomEncryptors[o];r&&(this._roomDeviceTrackingState[o]&&("join"==t.membership?(c.a.log("Join event for "+t.userId+" in "+o),this._deviceList.startTrackingDeviceList(t.userId)):"invite"==t.membership&&this._clientStore.getRoom(o).shouldEncryptForInvitedMembers()&&(c.a.log("Invite event for "+t.userId+" in "+o),this._deviceList.startTrackingDeviceList(t.userId))),r.onRoomMembership(e,t,n))},P.prototype._onRoomKeyRequestEvent=function(e){const t=e.getContent();if("request"===t.action){const t=new B(e);this._receivedRoomKeyRequests.push(t)}else if("request_cancellation"===t.action){const t=new G(e);this._receivedRoomKeyRequestCancellations.push(t)}},P.prototype._processReceivedRoomKeyRequests=async function(){if(!this._processingRoomKeyRequests){this._processingRoomKeyRequests=!0;try{const e=this._receivedRoomKeyRequests;this._receivedRoomKeyRequests=[];const t=this._receivedRoomKeyRequestCancellations;this._receivedRoomKeyRequestCancellations=[],await Promise.all(e.map(e=>this._processReceivedRoomKeyRequest(e))),await Promise.all(t.map(e=>this._processReceivedRoomKeyRequestCancellation(e)))}catch(e){c.a.error("Error processing room key requsts: "+e)}finally{this._processingRoomKeyRequests=!1}}},P.prototype._processReceivedRoomKeyRequest=async function(e){const t=e.userId,n=e.deviceId,o=e.requestBody,r=o.room_id,i=o.algorithm;if(c.a.log(`m.room_key_request from ${t}:${n} for ${r} / ${o.session_id} (id ${e.requestId})`),t!==this._userId){if(!this._roomEncryptors[r])return void c.a.debug("room key request for unencrypted room "+r);const e=this._roomEncryptors[r],i=this._deviceList.getStoredDevice(t,n);if(!i)return void c.a.debug(`Ignoring keyshare for unknown device ${t}:${n}`);try{await e.reshareKeyWithDevice(o.sender_key,o.session_id,t,i)}catch(e){c.a.warn("Failed to re-share keys for session "+o.session_id+" with device "+t+":"+i.deviceId,e)}return}if(n===this._deviceId)return void c.a.log("Ignoring room key request from ourselves");if(!this._roomDecryptors[r])return void c.a.log("room key request for unencrypted room "+r);const a=this._roomDecryptors[r][i];if(a)if(await a.hasKeysForKeyRequest(e)){if(e.share=()=>{a.shareKeysWithDevice(e)},this.checkDeviceTrust(t,n).isVerified())return c.a.log("device is already verified: sharing keys"),void e.share();this.emit("crypto.roomKeyRequest",e)}else c.a.log(`room key request for unknown session ${r} / `+o.session_id);else c.a.log(`room key request for unknown alg ${i} in room ${r}`)},P.prototype._processReceivedRoomKeyRequestCancellation=async function(e){c.a.log(`m.room_key_request cancellation for ${e.userId}:${e.deviceId} (id ${e.requestId})`),this.emit("crypto.roomKeyRequestCancellation",e)},P.prototype._getRoomDecryptor=function(e,t){let n,o;if((e=e||null)&&(n=this._roomDecryptors[e],n||(this._roomDecryptors[e]=n={}),o=n[t],o))return o;const r=m.a[t];if(!r)throw new m.b("UNKNOWN_ENCRYPTION_ALGORITHM",'Unknown encryption algorithm "'+t+'".');return o=new r({userId:this._userId,crypto:this,olmDevice:this._olmDevice,baseApis:this._baseApis,roomId:e}),n&&(n[t]=o),o},P.prototype._getRoomDecryptors=function(e){const t=[];for(const n of Object.values(this._roomDecryptors))e in n&&t.push(n[e]);return t},P.prototype._signObject=async function(e){const t=e.signatures||{},n=e.unsigned;delete e.signatures,delete e.unsigned,t[this._userId]=t[this._userId]||{},t[this._userId]["ed25519:"+this._deviceId]=await this._olmDevice.sign(i.a.stringify(e)),e.signatures=t,void 0!==n&&(e.unsigned=n)};class B{constructor(e){const t=e.getContent();this.userId=e.getSender(),this.deviceId=t.requesting_device_id,this.requestId=t.request_id,this.requestBody=t.body||{},this.share=()=>{throw new Error("don't know how to share keys for this request yet")}}}class G{constructor(e){const t=e.getContent();this.userId=e.getSender(),this.deviceId=t.requesting_device_id,this.requestId=t.request_id}}}).call(this,n(7),n(35).Buffer)},function(e,t,n){"use strict";function o(e){Object.defineProperty(this,"deviceId",{enumerable:!0,value:e}),this.algorithms=[],this.keys={},this.verified=r.UNVERIFIED,this.known=!1,this.unsigned={},this.signatures={}}n.d(t,"a",(function(){return o})),o.fromStorage=function(e,t){const n=new o(t);for(const t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n},o.prototype.toStorage=function(){return{algorithms:this.algorithms,keys:this.keys,verified:this.verified,known:this.known,unsigned:this.unsigned,signatures:this.signatures}},o.prototype.getFingerprint=function(){return this.keys["ed25519:"+this.deviceId]},o.prototype.getIdentityKey=function(){return this.keys["curve25519:"+this.deviceId]},o.prototype.getDisplayName=function(){return this.unsigned.device_display_name||null},o.prototype.isBlocked=function(){return this.verified==r.BLOCKED},o.prototype.isVerified=function(){return this.verified==r.VERIFIED},o.prototype.isUnverified=function(){return this.verified==r.UNVERIFIED},o.prototype.isKnown=function(){return 1==this.known},o.DeviceVerification={VERIFIED:1,UNVERIFIED:0,BLOCKED:-1};const r=o.DeviceVerification},function(e,t,n){"use strict";(function(e,o){n.d(t,"a",(function(){return d})),n.d(t,"c",(function(){return h})),n.d(t,"b",(function(){return p})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return g}));var r=n(143),i=n(8),a=n(0),s=n(162),c=n(297);function l(e){return Object.values(e.keys)[0]}class d extends i.EventEmitter{constructor(e,t,n){super(),Object.defineProperty(this,"userId",{enumerable:!0,value:e}),this._callbacks=t||{},this._cacheCallbacks=n||{},this.keys={},this.firstUse=!0,this.crossSigningVerifiedBefore=!1}static fromStorage(e,t){const n=new d(t);for(const t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}toStorage(){return{keys:this.keys,firstUse:this.firstUse,crossSigningVerifiedBefore:this.crossSigningVerifiedBefore}}async getCrossSigningKey(t,n){const o=["master","self_signing","user_signing"].indexOf(t)>=0;if(!this._callbacks.getCrossSigningKey)throw new Error("No getCrossSigningKey callback supplied");function r(t){if(!t)return;const o=new e.Olm.PkSigning,r=o.init_with_seed(t);if(r===n)return[r,o];o.free()}let i;void 0===n&&(n=this.getId(t)),this._cacheCallbacks.getCrossSigningKeyCache&&o&&(i=await this._cacheCallbacks.getCrossSigningKeyCache(t,n));const a=r(i);if(a)return a;i=await this._callbacks.getCrossSigningKey(t,n);const s=r(i);if(s)return this._cacheCallbacks.storeCrossSigningKeyCache&&o&&await this._cacheCallbacks.storeCrossSigningKeyCache(t,i),s;if(!i)throw new Error("getCrossSigningKey callback for "+t+" returned falsey");throw new Error("Key type "+t+" from getCrossSigningKey callback did not match")}async isStoredInSecretStorage(e){const t=await e.isStored("m.cross_signing.master",!1)||{};function n(e){for(const n of Object.keys(t))e[n]||delete t[n]}for(const t of["self_signing","user_signing"])n(await e.isStored("m.cross_signing."+t,!1)||{});return Object.keys(t).length?t:null}static async storeInSecretStorage(e,t){for(const[n,o]of e){const e=Object(r.encodeBase64)(o);await t.store("m.cross_signing."+n,e)}}static async getFromSecretStorage(e,t){const n=await t.get("m.cross_signing."+e);return n?Object(r.decodeBase64)(n):null}async isStoredInKeyCache(e){const t=this._cacheCallbacks;if(!t)return!1;const n=e?[e]:["master","self_signing","user_signing"];for(const e of n)if(!await t.getCrossSigningKeyCache(e))return!1;return!0}async getCrossSigningKeysFromCache(){const e=new Map,t=this._cacheCallbacks;if(!t)return e;for(const n of["master","self_signing","user_signing"]){const o=await t.getCrossSigningKeyCache(n);o&&e.set(n,o)}return e}getId(e){if(e=e||"master",!this.keys[e])return null;return l(this.keys[e])}async resetKeys(t){if(!this._callbacks.saveCrossSigningKeys)throw new Error("No saveCrossSigningKeys callback supplied");if(void 0===t||t&u.MASTER||!this.keys.master)t=u.MASTER|u.USER_SIGNING|u.SELF_SIGNING;else if(0===t)return;const n={},o={};let i,a;try{if(t&u.MASTER?(i=new e.Olm.PkSigning,n.master=i.generate_seed(),a=i.init_with_seed(n.master),o.master={user_id:this.userId,usage:["master"],keys:{["ed25519:"+a]:a}}):[a,i]=await this.getCrossSigningKey("master"),t&u.SELF_SIGNING){const t=new e.Olm.PkSigning;try{n.self_signing=t.generate_seed();const e=t.init_with_seed(n.self_signing);o.self_signing={user_id:this.userId,usage:["self_signing"],keys:{["ed25519:"+e]:e}},Object(r.pkSign)(o.self_signing,i,this.userId,a)}finally{t.free()}}if(t&u.USER_SIGNING){const t=new e.Olm.PkSigning;try{n.user_signing=t.generate_seed();const e=t.init_with_seed(n.user_signing);o.user_signing={user_id:this.userId,usage:["user_signing"],keys:{["ed25519:"+e]:e}},Object(r.pkSign)(o.user_signing,i,this.userId,a)}finally{t.free()}}Object.assign(this.keys,o),this._callbacks.saveCrossSigningKeys(n)}finally{i&&i.free()}}clearKeys(){this.keys={}}setKeys(e){const t={};if(e.master){if(e.master.user_id!==this.userId){const t="Mismatched user ID "+e.master.user_id+" in master key from "+this.userId;throw a.a.error(t),new Error(t)}this.keys.master?l(e.master)!==this.getId()&&(this.firstUse=!1):this.firstUse=!0,t.master=e.master}else{if(!this.keys.master)throw new Error("Tried to set cross-signing keys without a master key");t.master=this.keys.master}const n=l(t.master);if(e.user_signing){if(e.user_signing.user_id!==this.userId){const t="Mismatched user ID "+e.master.user_id+" in user_signing key from "+this.userId;throw a.a.error(t),new Error(t)}try{Object(r.pkVerify)(e.user_signing,n,this.userId)}catch(e){throw a.a.error("invalid signature on user-signing key"),e}}if(e.self_signing){if(e.self_signing.user_id!==this.userId){const t="Mismatched user ID "+e.master.user_id+" in self_signing key from "+this.userId;throw a.a.error(t),new Error(t)}try{Object(r.pkVerify)(e.self_signing,n,this.userId)}catch(e){throw a.a.error("invalid signature on self-signing key"),e}}e.master&&(this.keys.master=e.master,this.keys.self_signing=null,this.keys.user_signing=null),e.self_signing&&(this.keys.self_signing=e.self_signing),e.user_signing&&(this.keys.user_signing=e.user_signing)}updateCrossSigningVerifiedBefore(e){!this.crossSigningVerifiedBefore&&e&&(this.crossSigningVerifiedBefore=!0)}async signObject(e,t){if(!this.keys[t])throw new Error("Attempted to sign with "+t+" key but no such key present");const[n,o]=await this.getCrossSigningKey(t);try{return Object(r.pkSign)(e,o,this.userId,n),e}finally{o.free()}}async signUser(e){if(this.keys.user_signing)return this.signObject(e.keys.master,"user_signing");a.a.info("No user signing key: not signing user")}async signDevice(e,t){if(e!==this.userId)throw new Error(`Trying to sign ${e}'s device; can only sign our own device`);if(this.keys.self_signing)return this.signObject({algorithms:t.algorithms,keys:t.keys,device_id:t.deviceId,user_id:e},"self_signing");a.a.info("No self signing key: not signing device")}checkUserTrust(e){if(this.userId===e.userId&&this.getId()&&this.getId()===e.getId()&&this.getId("self_signing")&&this.getId("self_signing")===e.getId("self_signing"))return new h(!0,!0,this.firstUse);if(!this.keys.user_signing)return new h(!1,!1,e.firstUse);let t;const n=e.keys.master,o=this.getId("user_signing");try{Object(r.pkVerify)(n,o,this.userId),t=!0}catch(e){t=!1}return new h(t,e.crossSigningVerifiedBefore,e.firstUse)}checkDeviceTrust(e,t,n,o){const i=this.checkUserTrust(e),a=e.keys.self_signing;if(!a)return new p(!1,!1,n,o);const s=function(e,t){return{algorithms:e.algorithms,keys:e.keys,device_id:e.deviceId,user_id:t,signatures:e.signatures}}(t,e.userId);try{return Object(r.pkVerify)(a,e.getId(),e.userId),Object(r.pkVerify)(s,l(a),e.userId),p.fromUserTrustLevel(i,n,o)}catch(e){return new p(!1,!1,n,o)}}getCacheCallbacks(){return this._cacheCallbacks}}const u={MASTER:4,USER_SIGNING:2,SELF_SIGNING:1};class h{constructor(e,t,n){this._crossSigningVerified=e,this._crossSigningVerifiedBefore=t,this._tofu=n}isVerified(){return this.isCrossSigningVerified()}isCrossSigningVerified(){return this._crossSigningVerified}wasCrossSigningVerified(){return this._crossSigningVerifiedBefore}isTofu(){return this._tofu}}class p{constructor(e,t,n,o){this._crossSigningVerified=e,this._tofu=t,this._localVerified=n,this._trustCrossSignedDevices=o}static fromUserTrustLevel(e,t,n){return new p(e._crossSigningVerified,e._tofu,t,n)}isVerified(){return Boolean(this.isLocallyVerified()||this._trustCrossSignedDevices&&this.isCrossSigningVerified())}isCrossSigningVerified(){return this._crossSigningVerified}isLocallyVerified(){return this._localVerified}isTofu(){return this._tofu}}function m(e,t){return{getCrossSigningKeyCache:async function(n,i){const a=await new Promise(t=>e.doTxn("readonly",[s.a.STORE_ACCOUNT],o=>{e.getSecretStorePrivateKey(o,t,n)}));if(a&&a.ciphertext){const e=o.from(t._pickleKey),i=await Object(c.a)(a,e,n);return Object(r.decodeBase64)(i)}return a},storeCrossSigningKeyCache:async function(n,i){if(!(i instanceof Uint8Array))throw new Error("storeCrossSigningKeyCache expects Uint8Array, got "+i);const a=o.from(t._pickleKey);return i=await Object(c.b)(Object(r.encodeBase64)(i),a,n),e.doTxn("readwrite",[s.a.STORE_ACCOUNT],t=>{e.storeSecretStorePrivateKey(t,n,i)})}}}async function g(e,t,n){if(e.getUserId()===t)return a.a.log("Cross-signing: Self-verification done; requesting keys"),new Promise((t,o)=>{const i=e,s=i._crypto._crossSigningInfo,c=new d(s.userId,{getCrossSigningKey:async e=>{a.a.debug("Cross-signing: requesting secret",e,n);const{promise:t}=i.requestSecret("m.cross_signing."+e,[n]),o=await t,s=Object(r.decodeBase64)(o);return Uint8Array.from(s)}},s._cacheCallbacks);c.keys=s.keys;const l=new Promise((e,t)=>{setTimeout(e,6e4,new Error("Timeout"))}),u=new Promise(async e=>{if(!await i._crypto.getSessionBackupPrivateKey()){a.a.info("No cached backup key found. Requesting...");const e=i.requestSecret("m.megolm_backup.v1",[n]),t=await e.promise;a.a.info("Got key backup key, decoding...");const o=Object(r.decodeBase64)(t);a.a.info("Decoded backup key, storing..."),i._crypto.storeSessionBackupPrivateKey(Uint8Array.from(o)),a.a.info("Backup key stored. Starting backup restore...");const s=await i.getKeyBackupVersion();i.restoreKeyBackupWithCache(void 0,void 0,s).then(()=>{a.a.info("Backup restored.")})}e()});return Promise.race([Promise.all([c.getCrossSigningKey("master"),c.getCrossSigningKey("self_signing"),c.getCrossSigningKey("user_signing"),u]),l]).then(t,o)}).catch(e=>{a.a.warn("Cross-signing: failure while requesting keys:",e)})}}).call(this,n(7),n(35).Buffer)},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u}));var o=n(277),r=n(1),i=n(8),a=n(29),s=n(1053),c=n(213),l=n(108),d=n(0);function u(t){if(o.a.call(this,t),!t.indexedDB)throw new Error("Missing required option: indexedDB");if(t.workerScript){let n=t.workerApi;n||(n=e.Worker),this.backend=new s.a(t.workerScript,t.dbName,n)}else this.backend=new a.a(t.indexedDB,t.dbName);this.startedUp=!1,this._syncTs=0,this._userModifiedMap={}}function h(e,t){return async function(...n){try{return await e.call(this,...n)}catch(e){d.a.error("IndexedDBStore failure, degrading to MemoryStore",e),this.emit("degraded",e);try{d.a.log("IndexedDBStore trying to delete degraded data"),await this.backend.clearDatabase(),d.a.log("IndexedDBStore delete after degrading succeeeded")}catch(e){d.a.warn("IndexedDBStore delete after degrading failed",e)}if(Object.setPrototypeOf(this,o.a.prototype),t)return await o.a.prototype[t].call(this,...n)}}}r.m(u,o.a),r.j(u.prototype,i.EventEmitter.prototype),u.exists=function(e,t){return a.a.exists(e,t)},u.prototype.startup=function(){return this.startedUp?(d.a.log("IndexedDBStore.startup: already started"),Promise.resolve()):(d.a.log("IndexedDBStore.startup: connecting to backend"),this.backend.connect().then(()=>(d.a.log("IndexedDBStore.startup: loading presence events"),this.backend.getUserPresenceEvents())).then(e=>{d.a.log("IndexedDBStore.startup: processing presence events"),e.forEach(([e,t])=>{const n=new c.a(e);t&&n.setPresenceEvent(new l.b(t)),this._userModifiedMap[n.userId]=n.getLastModifiedTime(),this.storeUser(n)})}))},u.prototype.getSavedSync=h((function(){return this.backend.getSavedSync()}),"getSavedSync"),u.prototype.isNewlyCreated=h((function(){return this.backend.isNewlyCreated()}),"isNewlyCreated"),u.prototype.getSavedSyncToken=h((function(){return this.backend.getNextBatchToken()}),"getSavedSyncToken"),u.prototype.deleteAllData=h((function(){return o.a.prototype.deleteAllData.call(this),this.backend.clearDatabase().then(()=>{d.a.log("Deleted indexeddb data.")},e=>{throw d.a.error("Failed to delete indexeddb data: "+e),e})})),u.prototype.wantsSave=function(){return Date.now()-this._syncTs>3e5},u.prototype.save=function(e){return e||this.wantsSave()?this._reallySave():Promise.resolve()},u.prototype._reallySave=h((function(){this._syncTs=Date.now();const e=[];for(const t of this.getUsers())this._userModifiedMap[t.userId]!==t.getLastModifiedTime()&&t.events.presence&&(e.push([t.userId,t.events.presence.event]),this._userModifiedMap[t.userId]=t.getLastModifiedTime());return this.backend.syncToDatabase(e)})),u.prototype.setSyncData=h((function(e){return this.backend.setSyncData(e)}),"setSyncData"),u.prototype.getOutOfBandMembers=h((function(e){return this.backend.getOutOfBandMembers(e)}),"getOutOfBandMembers"),u.prototype.setOutOfBandMembers=h((function(e,t){return o.a.prototype.setOutOfBandMembers.call(this,e,t),this.backend.setOutOfBandMembers(e,t)}),"setOutOfBandMembers"),u.prototype.clearOutOfBandMembers=h((function(e){return o.a.prototype.clearOutOfBandMembers.call(this),this.backend.clearOutOfBandMembers(e)}),"clearOutOfBandMembers"),u.prototype.getClientOptions=h((function(){return this.backend.getClientOptions()}),"getClientOptions"),u.prototype.storeClientOptions=h((function(e){return o.a.prototype.storeClientOptions.call(this,e),this.backend.storeClientOptions(e)}),"storeClientOptions")}).call(this,n(7))},function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}));var o=n(117);function r(e,t){const n=[...e.keys()],r=[...t.keys()],i=Object(o.a)(n,r);return{changed:Object(o.k)(n,r).filter(n=>e.get(n)!==t.get(n)),added:i.added,removed:i.removed}}class i extends Map{constructor(e){super(e)}getOrCreate(e,t){return this.has(e)?this.get(e):(this.set(e,t),t)}remove(e){const t=this.get(e);return this.delete(e),t}}},function(e,t,n){(function(n){var o,r,i,a,s,c,l,d,u,h,p,m,g,f,_,b,v,y,E,S,w,C,T,x;!function(O){var k="object"==typeof n?n:"object"==typeof self?self:"object"==typeof this?this:{};function R(e,t){return e!==k&&("function"==typeof Object.create?Object.defineProperty(e,"__esModule",{value:!0}):e.__esModule=!0),function(n,o){return e[n]=t?t(n,o):o}}void 0===(o=function(e){var t,n;t=R(k,R(e)),n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},r=function(e,t){function o(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)},i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,n,a):r(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},c=function(e,t){return function(n,o){t(n,o,e)}},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},d=function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},u=function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},m=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,r,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a},g=function(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(n=r[e](t)).value instanceof _?Promise.resolve(n.value.v).then(c,l):d(i[0][2],n)}catch(e){d(i[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function d(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}},v=function(e){var t,n;return t={},o("next"),o("throw",(function(e){throw e})),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,r){t[o]=e[o]?function(t){return(n=!n)?{value:_(e[o](t)),done:"return"===o}:r?r(t):t}:r}},y=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=p(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise((function(o,r){!function(e,t,n,o){Promise.resolve(o).then((function(t){e({value:t,done:n})}),t)}(o,r,(t=e[n](t)).done,t.value)}))}}},E=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},S=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},w=function(e){return e&&e.__esModule?e:{default:e}},C=function(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)},T=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n},t("__extends",r),t("__assign",i),t("__rest",a),t("__decorate",s),t("__param",c),t("__metadata",l),t("__awaiter",d),t("__generator",u),t("__exportStar",h),t("__createBinding",x),t("__values",p),t("__read",m),t("__spread",g),t("__spreadArrays",f),t("__await",_),t("__asyncGenerator",b),t("__asyncDelegator",v),t("__asyncValues",y),t("__makeTemplateObject",E),t("__importStar",S),t("__importDefault",w),t("__classPrivateFieldGet",C),t("__classPrivateFieldSet",T)}.apply(t,[t]))||(e.exports=o)}()}).call(this,n(7))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(207),r=n(224),i=function(e){return e.parentNode?i(e.parentNode):e};t.getAllAffectedNodes=function(e){return r.asArray(e).filter(Boolean).reduce((function(e,t){var n=t.getAttribute(o.FOCUS_GROUP);return e.push.apply(e,n?function(e){for(var t=new Set,n=e.length,o=0;o0&&t.add(r),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(o)}return e.filter((function(e,n){return!t.has(n)}))}(r.toArray(i(t).querySelectorAll("["+o.FOCUS_GROUP+'="'+n+'"]:not(['+o.FOCUS_DISABLED+'="disabled"])'))):[t]),e}),[])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(224),r=n(355),i=n(1082),a=n(1083);t.filterFocusable=function(e){return o.toArray(e).filter((function(e){return r.isVisible(e)})).filter((function(e){return r.notHiddenInput(e)}))},t.getTabbableNodes=function(e,n){return i.orderByTabIndex(t.filterFocusable(a.getFocusables(e,n)),!0,n)},t.getAllTabbableNodes=function(e){return i.orderByTabIndex(t.filterFocusable(a.getFocusables(e)),!1)},t.parentAutofocusables=function(e){return t.filterFocusable(a.getParentAutofocusables(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.isVisible=function(e){return!e||e===document||e&&e.nodeType===Node.DOCUMENT_NODE||!((n=window.getComputedStyle(e,null))&&n.getPropertyValue&&("none"===n.getPropertyValue("display")||"hidden"===n.getPropertyValue("visibility")))&&t.isVisible(e.parentNode&&e.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e.parentNode.host:e.parentNode);var n},t.notHiddenInput=function(e){return!(("INPUT"===e.tagName||"BUTTON"===e.tagName)&&("hidden"===e.type||e.disabled))},t.isGuard=function(e){return Boolean(e&&e.dataset&&e.dataset.focusGuard)},t.isNotAGuard=function(e){return!t.isGuard(e)},t.isDefined=function(e){return Boolean(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deferAction=function(e){var t=window.setImmediate;void 0!==t?t(e):setTimeout(e,1)},t.inlineProp=void 0;t.inlineProp=function(e,t){var n={};return n[e]=t,n}},function(e,t,n){"use strict";(function(e){class n{constructor(){this.keyRgb=["rgb(118, 207, 166)","rgb(234, 245, 240)","rgb(211, 239, 225)"],this.keyHex=["#76CFA6","#EAF5F0","#D3EFE1","#FFFFFF","#000000"],this.colors=[this.keyHex[0],this.keyHex[1],this.keyHex[2],this.keyHex[3],this.keyHex[4]],this.currentTint=[void 0,void 0,void 0,void 0,void 0],this.cssFixups=[],this.cssAttrs=["color","backgroundColor","borderColor","borderTopColor","borderBottomColor","borderLeftColor"],this.svgAttrs=["fill","stroke"],this.tintables=[],this.theme=void 0,this.forceTint=!1}registerTintable(e){this.tintables.push(e),e()}getKeyRgb(){return this.keyRgb}tint(e,t,n){}tintSvgWhite(e){this.currentTint[3]=e,e||(e=this.colors[3]),this.colors[3]!==e&&(this.colors[3]=e,this.tintables.forEach((function(e){e()})))}tintSvgBlack(e){this.currentTint[4]=e,e||(e=this.colors[4]),this.colors[4]!==e&&(this.colors[4]=e,this.tintables.forEach((function(e){e()})))}setTheme(e){this.theme=e,document.getElementById("mx_theme_accentColor")&&(this.keyRgb[0]=window.getComputedStyle(document.getElementById("mx_theme_accentColor")).color),document.getElementById("mx_theme_secondaryAccentColor")&&(this.keyRgb[1]=window.getComputedStyle(document.getElementById("mx_theme_secondaryAccentColor")).color),document.getElementById("mx_theme_tertiaryAccentColor")&&(this.keyRgb[2]=window.getComputedStyle(document.getElementById("mx_theme_tertiaryAccentColor")).color),this.calcCssFixups(),this.forceTint=!0,this.tint(this.currentTint[0],this.currentTint[1],this.currentTint[2]),"dark"===e?(this.tintSvgWhite("#2d2d2d"),this.tintSvgBlack("#dddddd")):(this.tintSvgWhite("#ffffff"),this.tintSvgBlack("#000000"))}calcCssFixups(){if(!this.cssFixups[this.theme]){0,this.cssFixups[this.theme]=[];for(let e=0;e{this.recheck()}),r()(this,"onAction",e=>{e.action===s.a.RecheckTheme&&this.recheck(e.forceTheme)}),this.themeWatchRef=null,this.systemThemeWatchRef=null,this.dispatcherRef=null,this.preferDark=e.matchMedia("(prefers-color-scheme: dark)"),this.preferLight=e.matchMedia("(prefers-color-scheme: light)"),this.currentTheme=this.getEffectiveTheme()}start(){this.themeWatchRef=i.b.watchSetting("theme",null,this.onChange),this.systemThemeWatchRef=i.b.watchSetting("use_system_theme",null,this.onChange),this.preferDark.addEventListener&&(this.preferDark.addEventListener("change",this.onChange),this.preferLight.addEventListener("change",this.onChange)),this.dispatcherRef=a.a.register(this.onAction)}stop(){this.preferDark.addEventListener&&(this.preferDark.removeEventListener("change",this.onChange),this.preferLight.removeEventListener("change",this.onChange)),i.b.unwatchSetting(this.systemThemeWatchRef),i.b.unwatchSetting(this.themeWatchRef),a.a.unregister(this.dispatcherRef)}recheck(e){const t=this.currentTheme;this.currentTheme=void 0===e?this.getEffectiveTheme():e,t!==this.currentTheme&&Object(l.d)(this.currentTheme)}getEffectiveTheme(){if(c.a.isLogin)return"light";if(i.b.getValueAt(d.a.DEVICE,"use_system_theme",null,!1,!0)){if(console.log("returning explicit system theme"),this.preferDark.matches)return"dark";if(this.preferLight.matches)return"light"}const e=i.b.getValueAt(d.a.DEVICE,"theme",null,!1,!0);if(e)return console.log("returning explicit theme: "+e),e;if(i.b.getValue("use_system_theme")){if(this.preferDark.matches)return"dark";if(this.preferLight.matches)return"light"}return console.log("returning theme value"),i.b.getValue("theme")}isSystemThemeSupported(){return this.preferDark.matches||this.preferLight.matches}}}).call(this,n(7))},function(e,t,n){"use strict";n.d(t,"b",(function(){return c}));var o=n(87),r=n.n(o),i=n(110),a=n(131),s=n(128);const c=e=>{var t,n,o;return null==e||null===(t=e.currentState)||void 0===t||null===(n=t.getStateEvents(i.a.RoomTopic,""))||void 0===n||null===(o=n.getContent())||void 0===o?void 0:o.topic};t.a=({room:e,children:t})=>{const[n,i]=Object(o.useState)(c(e));Object(a.a)(e.currentState,"RoomState.events",()=>{i(c(e))}),Object(o.useEffect)(()=>{i(c(e))},[e]);const l=e=>e&&Object(s.g)(e);return t?t(n,l):r.a.createElement("span",{ref:l},n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var o,r=n(18),i=n.n(r),a=n(87),s=n.n(a),c=n(305),l=n(89);let d=Object(l.a)("structures.MainSplit")(o=class extends s.a.Component{constructor(...e){super(...e),i()(this,"_onResizeStart",()=>{this.props.resizeNotifier.startResizing()}),i()(this,"_onResize",()=>{this.props.resizeNotifier.notifyRightHandleResized()}),i()(this,"_onResizeStop",(e,t,n,o)=>{this.props.resizeNotifier.stopResizing(),window.localStorage.setItem("mx_rhs_size",this._loadSidePanelSize().width+o.width)})}_loadSidePanelSize(){let e=parseInt(window.localStorage.getItem("mx_rhs_size"),10);return isNaN(e)&&(e=350),{height:"100%",width:e}}render(){const e=s.a.Children.only(this.props.children),t=this.props.panel;let n;return!this.props.collapsedRhs&&t&&(n=s.a.createElement(c.Resizable,{defaultSize:this._loadSidePanelSize(),minWidth:264,maxWidth:"50%",enable:{top:!1,right:!1,bottom:!1,left:!0,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStart:this._onResizeStart,onResize:this._onResize,onResizeStop:this._onResizeStop,className:"mx_RightPanel_ResizeWrapper",handleClasses:{left:"mx_RightPanel_ResizeHandle"}},t)),s.a.createElement("div",{className:"mx_MainSplit"},e,n)}})||o},function(e,t,n){"use strict";n.d(t,"a",(function(){return k}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(91),u=n.n(d),h=n(234),p=n(90),m=n(93),g=n(267),f=n(362),_=n(123),b=n(124),v=n(268),y=n(101),E=n(100),S=n(461),w=n(660),C=n(89),T=n(94);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function O(e){for(var t=1;t{this.props.user?m.a.dispatch({action:"view_home_page"}):this.state.phase===b.c.EncryptionPanel&&this.state.verificationRequest&&this.state.verificationRequest.pending?this.state.verificationRequest.cancel():m.a.dispatch({action:E.a.ToggleRightPanel,type:this.props.groupId?"group":"room"})}),this.state=O(O({},v.a.getSharedInstance().roomPanelPhaseParams),{},{phase:this._getPhaseFromProps(),isUserPrivilegedInGroup:null,member:this._getUserForPanel()}),this.onAction=this.onAction.bind(this),this.onRoomStateMember=this.onRoomStateMember.bind(this),this.onGroupStoreUpdated=this.onGroupStoreUpdated.bind(this),this.onInviteToGroupButtonClick=this.onInviteToGroupButtonClick.bind(this),this.onAddRoomToGroupButtonClick=this.onAddRoomToGroupButtonClick.bind(this),this._delayedUpdate=new g.a(()=>{this.forceUpdate()},500)}_getUserForPanel(){if(this.state&&this.state.member)return this.state.member;const e=v.a.getSharedInstance().roomPanelPhaseParams;return this.props.user||e.member}_getPhaseFromProps(){var e;const t=v.a.getSharedInstance(),n=this._getUserForPanel();return this.props.groupId?b.a.includes(t.groupPanelPhase)?t.groupPanelPhase:(m.a.dispatch({action:E.a.SetRightPanelPhase,phase:b.c.GroupMemberList}),b.c.GroupMemberList):T.b.getValue("feature_spaces")&&null!==(e=this.props.room)&&void 0!==e&&e.isSpaceRoom()&&!b.b.includes(t.roomPanelPhase)?b.c.SpaceMemberList:n?t.roomPanelPhaseParams.member&&n.userId===t.roomPanelPhaseParams.member.userId&&t.roomPanelPhaseParams.verificationRequest?t.roomPanelPhase:b.c.RoomMemberInfo:t.roomPanelPhase}componentDidMount(){this.dispatcherRef=m.a.register(this.onAction);this.context.on("RoomState.members",this.onRoomStateMember),this._initGroupStore(this.props.groupId)}componentWillUnmount(){m.a.unregister(this.dispatcherRef),this.context&&this.context.removeListener("RoomState.members",this.onRoomStateMember),this._unregisterGroupStore(this.props.groupId)}UNSAFE_componentWillReceiveProps(e){e.groupId!==this.props.groupId&&(this._unregisterGroupStore(this.props.groupId),this._initGroupStore(e.groupId))}_initGroupStore(e){e&&_.a.registerListener(e,this.onGroupStoreUpdated)}_unregisterGroupStore(){_.a.unregisterListener(this.onGroupStoreUpdated)}onGroupStoreUpdated(){this.setState({isUserPrivilegedInGroup:_.a.isUserPrivileged(this.props.groupId)})}onInviteToGroupButtonClick(){Object(f.b)(this.props.groupId).then(()=>{this.setState({phase:b.c.GroupMemberList})})}onAddRoomToGroupButtonClick(){Object(f.a)(this.props.groupId).then(()=>{this.forceUpdate()})}onRoomStateMember(e,t,n){this.props.room&&n.roomId===this.props.room.roomId&&(this.state.phase===b.c.RoomMemberList&&n.roomId===this.props.room.roomId||this.state.phase===b.c.RoomMemberInfo&&n.roomId===this.props.room.roomId&&n.userId===this.state.member.userId)&&this._delayedUpdate()}onAction(e){e.action===E.a.AfterRightPanelPhaseChange&&this.setState({phase:e.phase,groupRoomId:e.groupRoomId,groupId:e.groupId,member:e.member,event:e.event,verificationRequest:e.verificationRequest,verificationRequestPromise:e.verificationRequestPromise,widgetId:e.widgetId,space:e.space})}render(){const e=p.getComponent("rooms.MemberList"),t=p.getComponent("right_panel.UserInfo"),n=p.getComponent("rooms.ThirdPartyMemberInfo"),o=p.getComponent("structures.NotificationPanel"),r=p.getComponent("structures.FilePanel"),i=p.getComponent("groups.GroupMemberList"),a=p.getComponent("groups.GroupRoomList"),s=p.getComponent("groups.GroupRoomInfo");let c=l.a.createElement("div",null);const d=this.props.room?this.props.room.roomId:void 0;switch(this.state.phase){case b.c.RoomMemberList:d&&(c=l.a.createElement(e,{roomId:d,key:d,onClose:this.onClose}));break;case b.c.SpaceMemberList:c=l.a.createElement(e,{roomId:this.state.space?this.state.space.roomId:d,key:this.state.space?this.state.space.roomId:d,onClose:this.onClose});break;case b.c.GroupMemberList:this.props.groupId&&(c=l.a.createElement(i,{groupId:this.props.groupId,key:this.props.groupId}));break;case b.c.GroupRoomList:c=l.a.createElement(a,{groupId:this.props.groupId,key:this.props.groupId});break;case b.c.RoomMemberInfo:case b.c.SpaceMemberInfo:case b.c.EncryptionPanel:c=l.a.createElement(t,{user:this.state.member,room:this.state.phase===b.c.SpaceMemberInfo?this.state.space:this.props.room,key:d||this.state.member.userId,onClose:this.onClose,phase:this.state.phase,verificationRequest:this.state.verificationRequest,verificationRequestPromise:this.state.verificationRequestPromise});break;case b.c.Room3pidMemberInfo:case b.c.Space3pidMemberInfo:c=l.a.createElement(n,{event:this.state.event,key:d});break;case b.c.GroupMemberInfo:c=l.a.createElement(t,{user:this.state.member,groupId:this.props.groupId,key:this.state.member.userId,onClose:this.onClose});break;case b.c.GroupRoomInfo:c=l.a.createElement(s,{groupRoomId:this.state.groupRoomId,groupId:this.props.groupId,key:this.state.groupRoomId});break;case b.c.NotificationPanel:c=l.a.createElement(o,{onClose:this.onClose});break;case b.c.FilePanel:c=l.a.createElement(r,{roomId:d,resizeNotifier:this.props.resizeNotifier,onClose:this.onClose});break;case b.c.RoomSummary:c=l.a.createElement(S.a,{room:this.props.room,onClose:this.onClose});break;case b.c.Widget:c=l.a.createElement(w.a,{room:this.props.room,widgetId:this.state.widgetId,onClose:this.onClose})}return l.a.createElement("aside",{className:"mx_RightPanel dark-panel",id:"mx_RightPanel"},c)}},s()(r,"contextType",y.a),o=i))||o},function(e,t,n){"use strict";n.d(t,"b",(function(){return h})),n.d(t,"a",(function(){return p}));var o=n(87),r=n.n(o),i=n(95),a=n(90),s=n(344),c=n(88),l=n(92),d=n(123),u=n(139);function h(e){return new Promise((t,n)=>{const o=r.a.createElement("div",null,r.a.createElement("div",null,Object(c.a)("Who would you like to add to this community?")),r.a.createElement("div",{className:"warning"},Object(c.a)("Warning: any person you add to a community will be publicly visible to anyone who knows the community ID"))),l=a.getComponent("dialogs.AddressPickerDialog");i.a.createTrackedDialog("Group Invite","",l,{title:Object(c.a)("Invite new community members"),description:o,placeholder:Object(c.a)("Name or Matrix ID"),button:Object(c.a)("Invite to Community"),validAddressTypes:["mx-user-id"],onFinished:(o,r)=>{o&&function(e,t){const n=new s.a(e),o=t.map(e=>e.address);return n.invite(o).then(n=>{const o=[];for(const e of Object.keys(n))"error"===t[e]&&o.push(e);if(o.length>0){const t=a.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Failed to invite the following users to the group","",t,{title:Object(c.a)("Failed to invite the following users to %(groupId)s:",{groupId:e}),description:o.join(", ")})}}).catch(t=>{const n=a.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Failed to invite users to group","",n,{title:Object(c.a)("Failed to invite users to community"),description:Object(c.a)("Failed to invite users to %(groupId)s",{groupId:e})})})}(e,r).then(t,n)}},null,!1,!0)})}function p(e){return new Promise((t,n)=>{let o=!1;const s=r.a.createElement("div",null,r.a.createElement("div",null,Object(c.a)("Which rooms would you like to add to this community?"))),h=r.a.createElement(u.a,{className:"mx_GroupAddressPicker_checkboxContainer",onChange:e=>{o=e.target.checked}},Object(c.a)("Show these rooms to non-members on the community page and room list?")),p=a.getComponent("dialogs.AddressPickerDialog");i.a.createTrackedDialog("Add Rooms to Group","",p,{title:Object(c.a)("Add rooms to the community"),description:s,extraNode:h,placeholder:Object(c.a)("Room name or address"),button:Object(c.a)("Add to community"),pickerType:"room",validAddressTypes:["mx-room-id"],onFinished:(r,s)=>{r&&function(e,t,n){const o=l.a.get(),r=[];return Promise.allSettled(t.map(t=>d.a.addRoomToGroup(e,t.address,n).catch(()=>{r.push(t.address)}).then(()=>{const n=t.address,r=o.getRoom(n);if(!r||!r.currentState.mayClientSendStateEvent("m.room.related_groups",o))return;const i=r.currentState.getStateEvents("m.room.related_groups",""),a=i&&i.getContent().groups||[];return a.includes(e)?void 0:(a.push(e),l.a.get().sendStateEvent(n,"m.room.related_groups",{groups:a},""))}))).then(()=>{if(0===r.length)return;const t=a.getComponent("dialogs.ErrorDialog");i.a.createTrackedDialog("Failed to add the following room to the group","",t,{title:Object(c.a)("Failed to add the following rooms to %(groupId)s:",{groupId:e}),description:r.join(", ")})})}(e,s,o).then(t,n)}},null,!1,!0)})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return C}));var o,r,i,a=n(18),s=n.n(a),c=n(87),l=n.n(c),d=n(152),u=n.n(d),h=n(91),p=n.n(h),m=n(111),g=n(516),f=n.n(g),_=n(93),b=n(101),v=n(92),y=n(1),E=n(89);function S(e){return document.getElementById(e)}let w=Object(E.a)("views.elements.PersistedElement")((i=r=class e extends l.a.Component{constructor(){super(),s()(this,"updateChildPosition",Object(m.throttle)((e,t)=>{if(!e||!t)return;const n=t.getBoundingClientRect();Object.assign(e.style,{zIndex:Object(y.o)(this.props.zIndex)?9:this.props.zIndex,position:"absolute",top:n.top+"px",left:n.left+"px",width:n.width+"px",height:n.height+"px"})},100,{trailing:!0,leading:!0})),this.collectChildContainer=this.collectChildContainer.bind(this),this.collectChild=this.collectChild.bind(this),this._repositionChild=this._repositionChild.bind(this),this._onAction=this._onAction.bind(this),this.resizeObserver=new f.a(this._repositionChild),window.addEventListener("resize",this._repositionChild),this._dispatcherRef=_.a.register(this._onAction)}static destroyElement(e){const t=S("mx_persistedElement_"+e);t&&t.remove()}static isMounted(e){return Boolean(S("mx_persistedElement_"+e))}collectChildContainer(e){this.childContainer&&this.resizeObserver.unobserve(this.childContainer),this.childContainer=e,e&&this.resizeObserver.observe(e)}collectChild(e){this.child=e,this.updateChild()}componentDidMount(){this.updateChild(),this.renderApp()}componentDidUpdate(){this.updateChild(),this.renderApp()}componentWillUnmount(){this.updateChildVisibility(this.child,!1),this.resizeObserver.disconnect(),window.removeEventListener("resize",this._repositionChild),_.a.unregister(this._dispatcherRef)}_onAction(t){"timeline_resize"===t.action?this._repositionChild():"logout"===t.action&&e.destroyElement(this.props.persistKey)}_repositionChild(){this.updateChildPosition(this.child,this.childContainer)}updateChild(){this.updateChildPosition(this.child,this.childContainer),this.updateChildVisibility(this.child,!0)}renderApp(){const e=l.a.createElement(b.a.Provider,{value:v.a.get()},l.a.createElement("div",{ref:this.collectChild,style:this.props.style},this.props.children));u.a.render(e,function(e){let t=S(e);return t||(t=document.createElement("div"),t.id=e,document.body.appendChild(t)),t}("mx_persistedElement_"+this.props.persistKey))}updateChildVisibility(e,t){e&&(e.style.display=t?"block":"none")}render(){return l.a.createElement("div",{ref:this.collectChildContainer})}},s()(r,"propTypes",{persistKey:p.a.string.isRequired,zIndex:p.a.number}),o=i))||o;const C=e=>"widget_"+e},function(e,t,n){"use strict";n.d(t,"g",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"f",(function(){return m})),n.d(t,"e",(function(){return g})),n.d(t,"c",(function(){return b})),n.d(t,"d",(function(){return v})),n.d(t,"b",(function(){return y}));var o=n(627),r=n(126),i=n(350),a=n(162);const s=window.localStorage;let c;try{c=window.indexedDB}catch(e){}function l(e){console.log("StorageManager: "+e)}function d(e,...t){console.error("StorageManager: "+e,...t)}function u(e){r.a.trackEvent("StorageManager",e)}function h(){navigator.storage&&navigator.storage.persist?navigator.storage.persist().then(e=>{console.log("StorageManager: Persistent?",e)}):document.requestStorageAccess?document.requestStorageAccess().then(()=>console.log("StorageManager: Persistent?",!0),()=>console.log("StorageManager: Persistent?",!1)):console.log("StorageManager: Persistence unsupported")}async function p(){l("Checking storage consistency"),l("Local storage supported? "+!!s),l("IndexedDB supported? "+!!c);let e=!1,t=!1,n=!1,r=!0;if(s?(e=s.length>0,l("Local storage contains data? "+e),n=!!s.getItem("mx_crypto_initialised"),l("Crypto initialised? "+n)):(r=!1,d("Local storage cannot be used on this browser"),u("Local storage disabled")),c&&s){(await async function(){let e=!1;try{return e=await i.a.exists(c,"riot-web-sync"),l("Sync store using IndexedDB contains data? "+e),{exists:e,healthy:!0}}catch(e){d("Sync store using IndexedDB inaccessible",e),u("Sync store using IndexedDB inaccessible")}return l("Sync store using memory only"),{exists:e,healthy:!1}}()).healthy||(r=!1)}else r=!1,d("Sync store cannot be used on this browser"),u("Sync store disabled");if(c){const e=await async function(){let e=!1;try{return e=await a.a.exists(c,"matrix-js-sdk:crypto"),l("Crypto store using IndexedDB contains data? "+e),{exists:e,healthy:!0}}catch(e){d("Crypto store using IndexedDB inaccessible",e),u("Crypto store using IndexedDB inaccessible")}try{return e=await o.a.exists(s),l("Crypto store using local storage contains data? "+e),{exists:e,healthy:!0}}catch(e){d("Crypto store using local storage inaccessible",e),u("Crypto store using local storage inaccessible")}return l("Crypto store using memory only"),{exists:e,healthy:!1}}();t=e.exists,e.healthy||(r=!1)}else r=!1,d("Crypto store cannot be used on this browser"),u("Crypto store disabled");return e&&n&&!t&&(r=!1,d("Data exists in local storage and crypto is marked as initialised but no data found in crypto store. IndexedDB storage has likely been evicted by the browser!"),u("Crypto store evicted")),r?(l("Storage consistency checks passed"),u("Consistency checks passed")):(d("Storage consistency checks failed"),u("Consistency checks failed")),{dataInLocalStorage:e,dataInCryptoStore:t,cryptoInited:n,healthy:r}}function m(e){e.store&&e.store.on&&e.store.on("degraded",()=>{u("Sync store using IndexedDB degraded to memory")})}function g(e){s.setItem("mx_crypto_initialised",e)}let f=null;async function _(){if(!c)throw new Error("IndexedDB not available");f=await new Promise((e,t)=>{const n=c.open("matrix-react-sdk",1);n.onerror=t,n.onsuccess=t=>{e(n.result)},n.onupgradeneeded=e=>{const t=n.result;t.createObjectStore("pickleKey"),t.createObjectStore("account")}})}async function b(e,t){return f||await _(),new Promise((n,o)=>{const r=f.transaction([e],"readonly");r.onerror=o;const i=r.objectStore(e).get(t);i.onerror=o,i.onsuccess=e=>{n(i.result)}})}async function v(e,t,n){return f||await _(),new Promise((o,r)=>{const i=f.transaction([e],"readwrite");i.onerror=r;const a=i.objectStore(e).put(n,t);a.onerror=r,a.onsuccess=e=>{o()}})}async function y(e,t){return f||await _(),new Promise((n,o)=>{const r=f.transaction([e],"readwrite");r.onerror=o;const i=r.objectStore(e).delete(t);i.onerror=o,i.onsuccess=e=>{n()}})}},function(e,t,n){"use strict";var o=n(87),r=n.n(o),i=n(97),a=n.n(i),s=n(280);t.a=function({name:e,definitions:t,value:n,className:o,outlined:i,onChange:c}){const l=e=>{c(e.target.value)};return r.a.createElement(r.a.Fragment,null,t.map(t=>r.a.createElement(r.a.Fragment,{key:t.value},r.a.createElement(s.a,{className:a()(o,t.className),onChange:l,checked:void 0!==t.checked?t.checked:t.value===n,name:e,value:t.value,disabled:t.disabled,outlined:i},t.label),t.description)))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var o=n(18),r=n.n(o),i=n(738),a=n(739);class s{static createItem(e,t,n){return new i.a(e,t,n)}static createSizer(e,t,n){return new a.a(e,t,n)}constructor(e){this.item=e,r()(this,"beforeOffset",void 0),this.beforeOffset=e.offset()}get size(){return this.item.getSize()}set size(e){this.item.setRawSize(e)}resize(e){this.item.setSize(e)}resizeFromContainerOffset(e){this.resize(e-this.beforeOffset)}start(){this.item.start()}finish(){this.item.finish()}}},function(e,t,n){"use strict";(function(t){!function(t){var n=/^(b|B)$/,o={iec:{bits:["b","Kib","Mib","Gib","Tib","Pib","Eib","Zib","Yib"],bytes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"]},jedec:{bits:["b","Kb","Mb","Gb","Tb","Pb","Eb","Zb","Yb"],bytes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]}},r={iec:["","kibi","mebi","gibi","tebi","pebi","exbi","zebi","yobi"],jedec:["","kilo","mega","giga","tera","peta","exa","zetta","yotta"]};function i(e){var t,i,a,s,c,l,d,u,h,p,m,g,f,_,b,v=1e.kind===p)}get userRules(){return this._rules.filter(e=>e.kind===h)}get roomRules(){return this._rules.filter(e=>"m.room.rule.room"===e.kind)}async banEntity(e,t,n){await u.a.get().sendStateEvent(this._roomId,b(e,!0),{entity:t,reason:n,recommendation:l("m.ban",!0)},"rule:"+t),this._rules.push(new d(t,"m.ban",n,b(e,!1)))}async unbanEntity(e,t){await u.a.get().sendStateEvent(this._roomId,b(e,!0),{},"rule:"+t),this._rules=this._rules.filter(n=>n.kind!==b(e,!1)||n.entity!==t)}updateList(){this._rules=[];const e=u.a.get().getRoom(this._roomId);if(e)for(const t of _){const n=e.currentState.getStateEvents(t,void 0);for(const e of n){if(!e.getStateKey())continue;const n=b(t,!1),o=e.getContent().entity,r=e.getContent().recommendation,i=e.getContent().reason;o&&r&&i&&this._rules.push(new d(o,r,i,n))}}}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n(8),r=n(159),i=n(108),a=n(1),s=n(0),c=n(18),l=n.n(c);class d extends o.EventEmitter{constructor(e,t,n){super(),l()(this,"_onEventStatus",(e,t)=>{e.isSending()?t===i.a.CANCELLED&&(e.removeListener("Event.status",this._onEventStatus),this._removeEvent(e)):e.removeListener("Event.status",this._onEventStatus)}),l()(this,"_onBeforeRedaction",async e=>{if(this._relations.has(e)){if(this._relations.delete(e),"m.annotation"===this.relationType)this._removeAnnotationFromAggregation(e);else if("m.replace"===this.relationType&&this._targetEvent){const e=await this.getLastReplacement();this._targetEvent.makeReplaced(e)}e.removeListener("Event.beforeRedaction",this._onBeforeRedaction),this.emit("Relations.redaction",e)}}),this.relationType=e,this.eventType=t,this._relationEventIds=new Set,this._relations=new Set,this._annotationsByKey={},this._annotationsBySender={},this._sortedAnnotationsByKey=[],this._targetEvent=null,this._room=n,this._creationEmitted=!1}async addEvent(e){if(this._relationEventIds.has(e.getId()))return;const t=e.getRelation();if(!t)return void s.a.error("Event must have relation info");const n=t.rel_type,o=e.getType();if(this.relationType===n&&this.eventType===o){if(e.isSending()&&e.on("Event.status",this._onEventStatus),this._relations.add(e),this._relationEventIds.add(e.getId()),"m.annotation"===this.relationType)this._addAnnotationToAggregation(e);else if("m.replace"===this.relationType&&this._targetEvent){const e=await this.getLastReplacement();this._targetEvent.makeReplaced(e)}e.on("Event.beforeRedaction",this._onBeforeRedaction),this.emit("Relations.add",e),this._maybeEmitCreated()}else s.a.error("Event relation info doesn't match this container")}async _removeEvent(e){if(!this._relations.has(e))return;const t=e.getRelation();if(!t)return void s.a.error("Event must have relation info");const n=t.rel_type,o=e.getType();if(this.relationType===n&&this.eventType===o){if(this._relations.delete(e),"m.annotation"===this.relationType)this._removeAnnotationFromAggregation(e);else if("m.replace"===this.relationType&&this._targetEvent){const e=await this.getLastReplacement();this._targetEvent.makeReplaced(e)}this.emit("Relations.remove",e)}else s.a.error("Event relation info doesn't match this container")}getRelations(){return[...this._relations]}_addAnnotationToAggregation(e){const{key:t}=e.getRelation();if(!t)return;let n=this._annotationsByKey[t];n||(n=this._annotationsByKey[t]=new Set,this._sortedAnnotationsByKey.push([t,n])),n.add(e),this._sortedAnnotationsByKey.sort((e,t)=>{const n=e[1];return t[1].size-n.size});const o=e.getSender();let r=this._annotationsBySender[o];r||(r=this._annotationsBySender[o]=new Set),r.add(e)}_removeAnnotationFromAggregation(e){const{key:t}=e.getRelation();if(!t)return;const n=this._annotationsByKey[t];n&&(n.delete(e),this._sortedAnnotationsByKey.sort((e,t)=>{const n=e[1];return t[1].size-n.size}));const o=e.getSender(),r=this._annotationsBySender[o];r&&r.delete(e)}getSortedAnnotationsByKey(){return"m.annotation"!==this.relationType?null:this._sortedAnnotationsByKey}getAnnotationsBySender(){return"m.annotation"!==this.relationType?null:this._annotationsBySender}async getLastReplacement(){if("m.replace"!==this.relationType)return null;if(!this._targetEvent)return null;const e=this._targetEvent.getServerAggregatedRelation("m.replace"),t=e&&e.origin_server_ts,n=this.getRelations().reduce((e,n)=>n.getSender()!==this._targetEvent.getSender()||t&&t>n.getTs()||e&&e.getTs()>n.getTs()?e:n,null);return null!=n&&n.shouldAttemptDecryption()?await n.attemptDecryption(this._room._client._crypto):null!=n&&n.isBeingDecrypted()&&await n._decryptionPromise,n}async setTargetEvent(e){if(!this._targetEvent){if(this._targetEvent=e,"m.replace"===this.relationType){const e=await this.getLastReplacement();e&&this._targetEvent.makeReplaced(e)}this._maybeEmitCreated()}}_maybeEmitCreated(){this._creationEmitted||this._targetEvent&&this._relations.size&&(this._creationEmitted=!0,this._targetEvent.emit("Event.relationsCreated",this.relationType,this.eventType))}}let u;function h(e,t){this.room=e,this._timelineSupport=Boolean(t.timelineSupport),this._liveTimeline=new r.a(this),this._unstableClientRelationAggregation=!!t.unstableClientRelationAggregation,this._timelines=[this._liveTimeline],this._eventIdToTimeline={},this._filter=t.filter||null,this._unstableClientRelationAggregation&&(this._relations={})}u=s.a.log.bind(s.a),a.m(h,o.EventEmitter),h.prototype.getTimelines=function(){return this._timelines},h.prototype.getFilter=function(){return this._filter},h.prototype.setFilter=function(e){this._filter=e},h.prototype.getPendingEvents=function(){return this.room?this._filter?this._filter.filterRoomTimeline(this.room.getPendingEvents()):this.room.getPendingEvents():[]},h.prototype.getLiveTimeline=function(){return this._liveTimeline},h.prototype.eventIdToTimeline=function(e){return this._eventIdToTimeline[e]},h.prototype.replaceEventId=function(e,t){const n=this._eventIdToTimeline[e];n&&(delete this._eventIdToTimeline[e],this._eventIdToTimeline[t]=n)},h.prototype.resetLiveTimeline=function(e,t){const n=!this._timelineSupport||!t,o=this._liveTimeline,i=n?o.forkLive(r.a.FORWARDS):o.fork(r.a.FORWARDS);n?(this._timelines=[i],this._eventIdToTimeline={}):this._timelines.push(i),t&&o.setPaginationToken(t,r.a.FORWARDS),i.setPaginationToken(e,r.a.BACKWARDS),this._liveTimeline=i,this.emit("Room.timelineReset",this.room,this,n)},h.prototype.getTimelineForEvent=function(e){const t=this._eventIdToTimeline[e];return void 0===t?null:t},h.prototype.findEventById=function(e){const t=this.getTimelineForEvent(e);if(t)return t.getEvents().find((function(t){return t.getId()==e}))},h.prototype.addTimeline=function(){if(!this._timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");const e=new r.a(this);return this._timelines.push(e),e},h.prototype.addEventsToTimeline=function(e,t,n,o){if(!n)throw new Error("'timeline' not specified for EventTimelineSet.addEventsToTimeline");if(!t&&n==this._liveTimeline)throw new Error("EventTimelineSet.addEventsToTimeline cannot be used for adding events to the live timeline - use Room.addLiveEvents instead");if(this._filter&&!(e=this._filter.filterRoomTimeline(e)).length)return;const i=t?r.a.BACKWARDS:r.a.FORWARDS,a=t?r.a.FORWARDS:r.a.BACKWARDS;let c=!1,l=!1;for(let o=0;o{this.aggregateRelations(e)});const t=e.getRelation();if(!t)return;const n=t.event_id,o=t.rel_type,r=e.getType();let a=this._relations[n];a||(a=this._relations[n]={});let s=a[o];s||(s=a[o]={});let c,l=s[r];l||(l=s[r]=new d(o,r,this.room),c=this.findEventById(n)||this.room.getPendingEvent(n),c&&l.setTargetEvent(c)),l.addEvent(e)}},function(e,t,n){"use strict";n.d(t,"b",(function(){return L})),n.d(t,"c",(function(){return j})),n.d(t,"a",(function(){return U})),n.d(t,"d",(function(){return z}));var o=n(18),r=n.n(o),i=n(87),a=n.n(i),s=n(88),c=n(90),l=n(92),d=n(115),u=n(122),h=n(98),p=n(204),m=n(294),g=n(256),f=n(93),_=n(206),b=n(95);var v,y,E,S=n(132),w=n(149),C=n(106),T=n(100),x=n(137),O=n(154),k=n(174),R=n(94),I=n(112),D=n(114),A=n(89),N=n(103),F=n(220),M=n(153),P=n(96);const L="dm",j="invite",U="call_transfer";class B{}class G extends B{constructor(e){super(),r()(this,"_userId",void 0),r()(this,"displayName",void 0),r()(this,"avatarUrl",void 0),this._userId=e.user_id,this.displayName=e.display_name,this.avatarUrl=e.avatar_url}get name(){return this.displayName||this._userId}get userId(){return this._userId}getMxcAvatarUrl(){return this.avatarUrl}}class q extends B{constructor(e){super(),r()(this,"id",void 0),this.id=e}get isEmail(){return this.id.includes("@")}get name(){return this.id}get userId(){return this.id}getMxcAvatarUrl(){return null}}class V extends a.a.PureComponent{constructor(...e){super(...e),r()(this,"onRemove",e=>{e.preventDefault(),e.stopPropagation(),this.props.onRemove(this.props.member)})}render(){const e=this.props.member.isEmail?a.a.createElement("img",{className:"mx_InviteDialog_userTile_avatar mx_InviteDialog_userTile_threepidAvatar",src:n(719),width:20,height:20}):a.a.createElement(M.a,{className:"mx_InviteDialog_userTile_avatar",url:this.props.member.getMxcAvatarUrl()?Object(N.b)(this.props.member.getMxcAvatarUrl()).getSquareThumbnailHttp(20):null,name:this.props.member.name,idName:this.props.member.userId,width:20,height:20});let t;return this.props.onRemove&&(t=a.a.createElement(P.a,{className:"mx_InviteDialog_userTile_remove",onClick:this.onRemove},a.a.createElement("img",{src:n(1341),alt:Object(s.a)("Remove"),width:8,height:8}))),a.a.createElement("span",{className:"mx_InviteDialog_userTile"},a.a.createElement("span",{className:"mx_InviteDialog_userTile_pill"},e,a.a.createElement("span",{className:"mx_InviteDialog_userTile_name"},this.props.member.name)),t)}}class H extends a.a.PureComponent{constructor(...e){super(...e),r()(this,"onClick",e=>{e.preventDefault(),e.stopPropagation(),this.props.onToggle(this.props.member)})}highlightName(e){if(!this.props.highlightWord)return e;const t=e.toLowerCase(),n=this.props.highlightWord.toLowerCase(),o=[];let r,i=0;for(;(r=t.indexOf(n,i))>=0;){r>i&&o.push(a.a.createElement("span",{key:i+"begin"},e.substring(i,r))),i=r;const t=e.substring(i,n.length+i);o.push(a.a.createElement("span",{className:"mx_InviteDialog_roomTile_highlight",key:i+"bold"},t)),i+=t.length}return i=0?t<=15e3?Object(s.a)("a few seconds ago"):t<=75e3?Object(s.a)("about a minute ago"):n<=45?Object(s.a)("%(num)s minutes ago",{num:n}):n<=75?Object(s.a)("about an hour ago"):o<=23?Object(s.a)("%(num)s hours ago",{num:o}):o<=26?Object(s.a)("about a day ago"):Object(s.a)("%(num)s days ago",{num:r}):(t=Math.abs(t),t<=15e3?Object(s.a)("a few seconds from now"):t<=75e3?Object(s.a)("about a minute from now"):n<=45?Object(s.a)("%(num)s minutes from now",{num:n}):n<=75?Object(s.a)("about an hour from now"):o<=23?Object(s.a)("%(num)s hours from now",{num:o}):o<=26?Object(s.a)("about a day from now"):Object(s.a)("%(num)s days from now",{num:r}))}(this.props.lastActiveTs);e=a.a.createElement("span",{className:"mx_InviteDialog_roomTile_time"},t)}const t=this.props.member.isEmail?a.a.createElement("img",{src:n(719),width:36,height:36}):a.a.createElement(M.a,{url:this.props.member.getMxcAvatarUrl()?Object(N.b)(this.props.member.getMxcAvatarUrl()).getSquareThumbnailHttp(36):null,name:this.props.member.name,idName:this.props.member.userId,width:36,height:36});let o=null;this.props.isSelected&&(o=a.a.createElement("div",{className:"mx_InviteDialog_roomTile_selected"}));const r=a.a.createElement("span",{className:"mx_InviteDialog_roomTile_avatarStack"},t,o),i=this.props.member.isEmail?Object(s.a)("Invite by email"):this.highlightName(this.props.member.userId);return a.a.createElement("div",{className:"mx_InviteDialog_roomTile",onClick:this.onClick},r,a.a.createElement("span",{className:"mx_InviteDialog_roomTile_nameStack"},a.a.createElement("div",{className:"mx_InviteDialog_roomTile_name"},this.highlightName(this.props.member.name)),a.a.createElement("div",{className:"mx_InviteDialog_roomTile_userId"},i)),e)}}let z=Object(A.a)("views.dialogs.InviteDialog")((E=y=class e extends a.a.PureComponent{constructor(t){if(super(t),r()(this,"debounceTimer",null),r()(this,"editorRef",Object(i.createRef)()),r()(this,"unmounted",!1),r()(this,"onConsultFirstChange",e=>{this.setState({consultFirst:e.target.checked})}),r()(this,"startDm",async()=>{this.setState({busy:!0});const e=l.a.get(),t=this.convertFilter(),n=t.map(e=>e.userId);let o;if(o=1===n.length?Object(S.g)(e,n[0]):u.a.shared().getDMRoomForIdentifiers(n),o)return f.a.dispatch({action:"view_room",room_id:o.roomId,should_peek:!1,joining:!1}),void this.props.onFinished();const r={inlineErrors:!0};if(Object(S.h)()){if(!t.some(e=>e instanceof q)){await Object(S.c)(e,n)&&(r.encryption=!0)}}try{const t=1===n.length&&n[0]===e.getUserId();1!==n.length||t||(r.dmUserId=n[0]),n.length>1&&(r.createOpts=n.reduce((t,n)=>{const o=Object(F.c)(n);if("email"===o){const o={id_server:e.getIdentityServerUrl(!0),medium:"email",address:n};t.invite_3pid.push(o)}else"mx-user-id"===o&&t.invite.push(n);return t},{invite:[],invite_3pid:[]})),await Object(S.d)(r),this.props.onFinished()}catch(e){console.error(e),this.setState({busy:!1,errorText:Object(s.a)("We couldn't create your DM.")})}}),r()(this,"inviteUsers",async()=>{const e=D.a.getTimestamp();this.setState({busy:!0}),this.convertFilter();const t=this.convertFilter().map(e=>e.userId),n=l.a.get(),o=n.getRoom(this.props.roomId);if(!o)return console.error("Failed to find the room to invite users to"),void this.setState({busy:!1,errorText:Object(s.a)("Something went wrong trying to invite the users.")});try{const r=await Object(w.a)(this.props.roomId,t);if(D.a.instance.trackSendInvite(e,this.props.roomId,t.length),this.shouldAbortAfterInviteError(r)||this.props.onFinished(),n.isRoomEncrypted(this.props.roomId)){const e=o.currentState.getStateEvents("m.room.history_visibility",""),t=e&&e.getContent()&&e.getContent().history_visibility;if("world_readable"==t||"shared"==t){const e=[];for(const[t,n]of Object.entries(r.states))"invited"===n&&"mx-user-id"===Object(F.c)(t)&&e.push(t);console.log("Sharing history with",e),n.sendSharedHistoryKeys(this.props.roomId,e)}}}catch(e){console.error(e),this.setState({busy:!1,errorText:Object(s.a)("We couldn't invite those users. Please check the users you want to invite and try again.")})}}),r()(this,"transferCall",async()=>{this.convertFilter();const e=this.convertFilter().map(e=>e.userId);if(e.length>1&&this.setState({errorText:Object(s.a)("A call can only be transferred to a single user.")}),this.state.consultFirst){const t=await Object(S.e)(l.a.get(),e[0]);f.a.dispatch({action:"place_call",type:this.props.call.type,room_id:t,transferee:this.props.call}),f.a.dispatch({action:"view_room",room_id:t,should_peek:!1,joining:!1}),this.props.onFinished()}else{this.setState({busy:!0});try{await this.props.call.transfer(e[0]),this.setState({busy:!1}),this.props.onFinished()}catch(e){this.setState({busy:!1,errorText:Object(s.a)("Failed to transfer call")})}}}),r()(this,"onKeyDown",e=>{if(this.state.busy)return;const t=e.target.value.trim(),n=e.ctrlKey||e.shiftKey||e.metaKey;!t&&this.state.targets.length>0&&e.key===C.a.BACKSPACE&&!n?(e.preventDefault(),this.removeMember(this.state.targets[this.state.targets.length-1])):(t&&e.key===C.a.ENTER&&!n||t&&e.key===C.a.SPACE&&!n&&t.includes("@")&&!t.includes(" "))&&(e.preventDefault(),this.convertFilter())}),r()(this,"updateSuggestions",async e=>{if(l.a.get().searchUserDirectory({term:e}).then(async t=>{if(e===this.state.filterText){if(t.results||(t.results=[]),"@"===e[0]&&e.indexOf(":")>1)try{const n=await l.a.get().getProfileInfo(e);n&&t.results.splice(0,0,{user_id:e,display_name:n.displayname,avatar_url:n.avatar_url})}catch(n){console.warn("Non-fatal error trying to make an invite for a user ID"),console.warn(n),t.results.splice(0,0,{user_id:e,display_name:e,avatar_url:null})}this.setState({serverResultsMixin:t.results.map(e=>({userId:e.user_id,user:new G(e)}))})}}).catch(e=>{console.error("Error searching user directory:"),console.error(e),this.setState({serverResultsMixin:[]})}),this.state.canUseIdentityServer){if(e.indexOf("@")>0&&p.a(e)&&R.b.getValue(I.a.IdentityServer)){this.setState({threepidResultsMixin:[{user:new q(e),userId:e}]});try{const t=new _.a,n=await t.getAccessToken();if(e!==this.state.filterText)return;const o=await l.a.get().lookupThreePid("email",e,void 0,n);if(e!==this.state.filterText)return;if(!o||!o.mxid)return;const r=await l.a.get().getProfileInfo(o.mxid);if(e!==this.state.filterText||!r)return;this.setState({threepidResultsMixin:[...this.state.threepidResultsMixin,{user:new G({user_id:o.mxid,display_name:r.displayname,avatar_url:r.avatar_url}),userId:o.mxid}]})}catch(e){console.error("Error searching identity server:"),console.error(e),this.setState({threepidResultsMixin:[]})}}}else this.setState({tryingIdentityServer:!0})}),r()(this,"updateFilter",e=>{const t=e.target.value;this.setState({filterText:t}),this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.updateSuggestions(t)},150)}),r()(this,"showMoreRecents",()=>{this.setState({numRecentsShown:this.state.numRecentsShown+5})}),r()(this,"showMoreSuggestions",()=>{this.setState({numSuggestionsShown:this.state.numSuggestionsShown+5})}),r()(this,"toggleMember",e=>{if(!this.state.busy){let t=this.state.filterText;const n=this.state.targets.map(e=>e),o=n.indexOf(e);o>=0?n.splice(o,1):(n.push(e),t=""),this.setState({targets:n,filterText:t}),this.editorRef&&this.editorRef.current&&this.editorRef.current.focus()}}),r()(this,"removeMember",e=>{const t=this.state.targets.map(e=>e),n=t.indexOf(e);n>=0&&(t.splice(n,1),this.setState({targets:t})),this.editorRef&&this.editorRef.current&&this.editorRef.current.focus()}),r()(this,"onPaste",async e=>{if(this.state.filterText)return;e.preventDefault();const t=e.clipboardData.getData("text"),n=[...this.state.recents,...this.state.suggestions,...this.state.serverResultsMixin,...this.state.threepidResultsMixin],o=[],r=[],i=t.split(/[\s,]+/).map(e=>e.trim()).filter(e=>!!e);for(const t of i){const i=n.find(e=>e.userId===t);if(i)o.push(i.user);else if(t.indexOf("@")>0&&p.a(t))o.push(new q(t));else if("@"===t[0])try{const e=await l.a.get().getProfileInfo(t),n=e?e.displayname:null,r=e?e.avatar_url:null;o.push(new G({user_id:t,display_name:n,avatar_url:r}))}catch(e){console.error("Error looking up profile for "+t),console.error(e),r.push(t)}else r.push(t)}if(!this.unmounted){if(r.length>0){const e=c.getComponent("dialogs.QuestionDialog");b.a.createTrackedDialog("Invite Paste Fail","",e,{title:Object(s.a)("Failed to find the following users"),description:Object(s.a)("The following users might not exist or are invalid, and cannot be invited: %(csvNames)s",{csvNames:r.join(", ")}),button:Object(s.a)("OK")})}this.setState({targets:[...this.state.targets,...o]})}}),r()(this,"onClickInputArea",e=>{e.preventDefault(),e.stopPropagation(),this.editorRef&&this.editorRef.current&&this.editorRef.current.focus()}),r()(this,"onUseDefaultIdentityServerClick",e=>{e.preventDefault(),Object(m.d)(),this.setState({canUseIdentityServer:!0,tryingIdentityServer:!1})}),r()(this,"onManageSettingsClick",e=>{e.preventDefault(),f.a.fire(T.a.ViewUserSettings),this.props.onFinished()}),r()(this,"onCommunityInviteClick",e=>{this.props.onFinished(),Object(w.e)(k.a.instance.getSelectedCommunityId())}),t.kind===j&&!t.roomId)throw new Error("When using KIND_INVITE a roomId is required for an InviteDialog");if(t.kind===U&&!t.call)throw new Error("When using KIND_CALL_TRANSFER a call is required for an InviteDialog");const n=new Set([l.a.get().getUserId(),h.a.get().welcomeUserId]);if(t.roomId){const e=l.a.get().getRoom(t.roomId);if(!e)throw new Error("Room ID given to InviteDialog does not look like a room");e.getMembersWithMembership("invite").forEach(e=>n.add(e.userId)),e.getMembersWithMembership("join").forEach(e=>n.add(e.userId)),e.getMembersWithMembership("ban").forEach(e=>n.add(e.userId)),D.a.instance.trackBeginInvite(t.roomId)}this.state={targets:[],filterText:this.props.initialText,recents:e.buildRecents(n),numRecentsShown:3,suggestions:this.buildSuggestions(n),numSuggestionsShown:3,serverResultsMixin:[],threepidResultsMixin:[],canUseIdentityServer:!!l.a.get().getIdentityServerUrl(),tryingIdentityServer:!1,consultFirst:!1,busy:!1,errorText:null}}componentDidMount(){this.props.initialText&&this.updateSuggestions(this.props.initialText)}componentWillUnmount(){this.unmounted=!0}static buildRecents(e){const t=u.a.shared().getUniqueRoomsWithIndividuals(),n=O.b.instance.orderedLists[x.a.DM]||[],o=l.a.get().getUserId();for(const e of n){const n=e.getJoinedMembers().filter(e=>e.userId!==o);for(const o of n)t[o.userId]||(console.warn(`Adding DM room for ${o.userId} as ${e.roomId} from tag, not DM map`),t[o.userId]=e)}const r=[];for(const n in t){if(e.has(n)){console.warn(`[Invite:Recents] Excluding ${n} from recents`);continue}const o=t[n],i=o.getMember(n);if(!i){console.warn(`[Invite:Recents] ${n} is missing a member object in their own DM (${o.roomId})`);continue}const a=["m.room.message","m.room.encrypted","m.sticker"],s=20;let c=0;if(o.timeline&&o.timeline.length)for(let e=o.timeline.length-1;e>=0;e--){const t=o.timeline[e];if(a.includes(t.getType())){c=t.getTs();break}if(o.timeline.length-e>s)break}c?r.push({userId:n,user:i,lastActive:c}):console.warn(`[Invite:Recents] ${n} (${o.roomId}) has a weird last timestamp: ${c}`)}return r||console.warn("[Invite:Recents] No recents to suggest!"),r.sort((e,t)=>t.lastActive-e.lastActive),r}buildSuggestions(e){const t=l.a.get().getRooms().filter(e=>"join"===e.getMyMembership()&&e.getJoinedMemberCount()<=200).reduce((t,n)=>{if(u.a.shared().getUserIdForRoomId(n.roomId))return t;const o=n.getJoinedMembers().filter(t=>!e.has(t.userId));for(const r of o)e.has(r.userId)||(t[r.userId]||(t[r.userId]={member:r,pickedMemberRoomSize:n.getJoinedMemberCount(),rooms:[]}),t[r.userId].rooms.push(n),n.getJoinedMemberCount(){const n=t.rooms.reduce((e,t)=>e+t.getJoinedMemberCount(),0),o=200*t.rooms.length;return e[t.member.userId]={member:t.member,numRooms:t.rooms.length,score:Math.max(0,Math.pow(1-n/o,5))},e},{}),o=l.a.get().getRooms().filter(e=>"join"===e.getMyMembership()),r=(new Date).getTime(),i=r-36e5,a={},s={};for(const t of o){const n=u.a.shared().getUserIdForRoomId(t.roomId);if(Object.keys(t.tags).includes("m.lowpriority")||n)continue;const o=t.getLiveTimeline().getEvents();for(let n=o.length-1;n>=Math.max(0,o.length-50);n--){const r=o[n];if(!e.has(r.getSender())){if(r.getTs()<=i)break;(!a[r.getSender()]||a[r.getSender()]e.score===t.score?e.numRooms===t.numRooms?e.member.userId.localeCompare(t.member.userId):t.numRooms-e.numRooms:t.score-e.score),c.map(e=>({userId:e.member.userId,user:e.member}))}shouldAbortAfterInviteError(e){const t=Object.keys(e.states).filter(t=>"error"===e.states[t]);return t.length>0&&(console.log("Failed to invite users: ",e),this.setState({busy:!1,errorText:Object(s.a)("Failed to invite the following users to chat: %(csvUsers)s",{csvUsers:t.join(", ")})}),!0)}convertFilter(){if(!this.state.filterText||!this.state.filterText.includes("@"))return this.state.targets||[];let e;this.state.filterText.startsWith("@")?e=new G({user_id:this.state.filterText,display_name:null,avatar_url:null}):R.b.getValue(I.a.IdentityServer)&&(e=new q(this.state.filterText));const t=[...this.state.targets||[],e];return this.setState({targets:t,filterText:""}),t}renderSection(e){let t="recents"===e?this.state.recents:this.state.suggestions,n="recents"===e?this.state.numRecentsShown:this.state.numSuggestionsShown;const o="recents"===e?this.showMoreRecents.bind(this):this.showMoreSuggestions.bind(this);let r="recents"===e?Object(s.a)("Recent Conversations"):Object(s.a)("Suggestions"),i=null;if("suggestions"===e&&k.a.instance.getSelectedCommunityId()){const e=k.a.instance.getSelectedCommunityName();i=Object(s.a)("May include members not in %(communityName)s",{communityName:e})}this.props.kind===j&&(r="recents"===e?Object(s.a)("Recently Direct Messaged"):Object(s.a)("Suggestions"));let l=[],d=[];const u=this.state.serverResultsMixin||this.state.threepidResultsMixin;if(this.state.filterText&&u&&"suggestions"===e){const e=e=>!t.some(t=>t.userId===e.userId)&&!l.some(t=>t.userId===e.userId)&&!d.some(t=>t.userId===e.userId);d=this.state.serverResultsMixin.filter(e),l=this.state.threepidResultsMixin.filter(e)}const h=l.length>0||d.length>0;if(0===t.length&&!h)return null;if(this.state.filterText){const e=this.state.filterText.toLowerCase();if(t=t.filter(t=>t.user.name.toLowerCase().includes(e)||t.userId.toLowerCase().includes(e)),0===t.length&&!h)return a.a.createElement("div",{className:"mx_InviteDialog_section"},a.a.createElement("h3",null,r),a.a.createElement("p",null,Object(s.a)("No results")))}t=[...l,...t,...d],n===t.length-1&&n++;const p=t.slice(0,n),m=p.length{return a.a.createElement(H,{member:t.user,lastActiveTs:(n=t,"recents"===e?n.lastActive:null),key:t.userId,onToggle:this.toggleMember,highlightWord:this.state.filterText,isSelected:this.state.targets.some(e=>e.userId===t.userId)});var n});return a.a.createElement("div",{className:"mx_InviteDialog_section"},a.a.createElement("h3",null,r),i?a.a.createElement("p",{className:"mx_InviteDialog_subname"},i):null,_,f)}renderEditor(){const e=this.state.targets.map(e=>a.a.createElement(V,{member:e,onRemove:!this.state.busy&&this.removeMember,key:e.userId})),t=a.a.createElement("input",{type:"text",onKeyDown:this.onKeyDown,onChange:this.updateFilter,value:this.state.filterText,ref:this.editorRef,onPaste:this.onPaste,autoFocus:!0,disabled:this.state.busy,autoComplete:"off"});return a.a.createElement("div",{className:"mx_InviteDialog_editor",onClick:this.onClickInputArea},e,t)}renderIdentityServerWarning(){if(!this.state.tryingIdentityServer||this.state.canUseIdentityServer||!R.b.getValue(I.a.IdentityServer))return null;const e=Object(m.c)();return e?a.a.createElement("div",{className:"mx_AddressPickerDialog_identityServer"},Object(s.a)("Use an identity server to invite by email. Use the default (%(defaultIdentityServerName)s) or manage in Settings.",{defaultIdentityServerName:Object(g.a)(e)},{default:e=>a.a.createElement("a",{href:"#",onClick:this.onUseDefaultIdentityServerClick},e),settings:e=>a.a.createElement("a",{href:"#",onClick:this.onManageSettingsClick},e)})):a.a.createElement("div",{className:"mx_AddressPickerDialog_identityServer"},Object(s.a)("Use an identity server to invite by email. Manage in Settings.",{},{settings:e=>a.a.createElement("a",{href:"#",onClick:this.onManageSettingsClick},e)}))}render(){const e=c.getComponent("views.dialogs.BaseDialog"),t=c.getComponent("elements.AccessibleButton"),o=c.getComponent("elements.Spinner");let r,i,u,h,p,m=null;this.state.busy&&(m=a.a.createElement(o,{w:20,h:20}));let g=a.a.createElement("span",null);const f=R.b.getValue(I.a.IdentityServer),_=l.a.get(),b=_.getUserId();if(this.props.kind===L){if(r=Object(s.a)("Direct Messages"),i=f?Object(s.a)("Start a conversation with someone using their name, email address or username (like ).",{},{userId:()=>a.a.createElement("a",{href:Object(d.h)(b),rel:"noreferrer noopener",target:"_blank"},b)}):Object(s.a)("Start a conversation with someone using their name or username (like ).",{},{userId:()=>a.a.createElement("a",{href:Object(d.h)(b),rel:"noreferrer noopener",target:"_blank"},b)}),k.a.instance.getSelectedCommunityId()){const e=k.a.instance.getSelectedCommunityName(),n=Object(s.a)("This won't invite them to %(communityName)s. To invite someone to %(communityName)s, click here",{communityName:e},{userId:()=>a.a.createElement("a",{href:Object(d.h)(b),rel:"noreferrer noopener",target:"_blank"},b),a:e=>a.a.createElement(t,{kind:"link",onClick:this.onCommunityInviteClick},e)});i=a.a.createElement(a.a.Fragment,null,i," ",n)}u=Object(s.a)("Go"),h=this.startDm}else if(this.props.kind===j){var v;const e=null===(v=l.a.get())||void 0===v?void 0:v.getRoom(this.props.roomId),t=R.b.getValue("feature_spaces")&&(null==e?void 0:e.isSpaceRoom());let o;if(r=t?Object(s.a)("Invite to %(spaceName)s",{spaceName:e.name||Object(s.a)("Unnamed Space")}):Object(s.a)("Invite to %(roomName)s",{roomName:e.name||Object(s.a)("Unnamed Room")}),o=t?f?Object(s.b)("Invite someone using their name, email address, username (like ) or share this space."):Object(s.b)("Invite someone using their name, username (like ) or share this space."):f?Object(s.b)("Invite someone using their name, email address, username (like ) or share this room."):Object(s.b)("Invite someone using their name, username (like ) or share this room."),i=Object(s.a)(o,{},{userId:()=>a.a.createElement("a",{href:Object(d.h)(b),rel:"noreferrer noopener",target:"_blank"},b),a:e=>a.a.createElement("a",{href:Object(d.g)(this.props.roomId),rel:"noreferrer noopener",target:"_blank"},e)}),u=Object(s.a)("Invite"),h=this.inviteUsers,_.isRoomEncrypted(this.props.roomId)){const e=_.getRoom(this.props.roomId).currentState.getStateEvents("m.room.history_visibility",""),t=e&&e.getContent()&&e.getContent().history_visibility;"world_readable"!==t&&"shared"!==t||(g=a.a.createElement("p",{className:"mx_InviteDialog_helpText"},a.a.createElement("img",{src:n(1342),width:14,height:14})," "+Object(s.a)("Invited people will be able to read old messages.")))}}else this.props.kind===U?(r=Object(s.a)("Transfer"),u=Object(s.a)("Transfer"),h=this.transferCall,p=a.a.createElement("div",null,a.a.createElement("label",null,a.a.createElement("input",{type:"checkbox",checked:this.state.consultFirst,onChange:this.onConsultFirstChange}),Object(s.a)("Consult first")))):console.error("Unknown kind of InviteDialog: "+this.props.kind);const y=this.state.targets.length>0||this.state.filterText&&this.state.filterText.includes("@");return a.a.createElement(e,{className:"mx_InviteDialog",hasCancel:!0,onFinished:this.props.onFinished,title:r},a.a.createElement("div",{className:"mx_InviteDialog_content"},a.a.createElement("p",{className:"mx_InviteDialog_helpText"},i),a.a.createElement("div",{className:"mx_InviteDialog_addressBar"},this.renderEditor(),a.a.createElement("div",{className:"mx_InviteDialog_buttonAndSpinner"},a.a.createElement(t,{kind:"primary",onClick:h,className:"mx_InviteDialog_goButton",disabled:this.state.busy||!y},u),m)),g,this.renderIdentityServerWarning(),a.a.createElement("div",{className:"error"},this.state.errorText),a.a.createElement("div",{className:"mx_InviteDialog_userSections"},this.renderSection("recents"),this.renderSection("suggestions")),p))}},r()(y,"defaultProps",{kind:L,initialText:""}),v=E))||v},function(e,t,n){"use strict";var o=n(99),r=n.n(o),i=n(104),a=n.n(i),s=n(87),c=n.n(s),l=n(3),d=n(177),u=n(105),h=n(88),p=n(134),m=n(262),g=n(238),f=n(93),_=n(94),b=n(95),v=n(136),y=n(127),E=n(155),S=n(101),w=n(181),C=n(92),T=n(98),x=n(5);function O(){return T.a.get().audioStreamUrl}async function k(e,t){const n=await async function(e){const t=await C.a.get().getOpenIdToken(),n=O()+"/createStream",o=await window.fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room_id:e,openid_token:t})});return(await o.json()).stream_id}(t);await e.transport.send(x.a.StartLiveStream,{rtmpStreamKey:"rtmp://audiostream.dummy/"+n})}t.a=e=>{let{onFinished:t,app:n,userWidget:o,onDeleteClick:i,showUnpin:C}=e,T=a()(e,["onFinished","app","userWidget","onDeleteClick","showUnpin"]);const x=Object(s.useContext)(S.a),{room:R,roomId:I}=Object(s.useContext)(g.a),D=m.a.instance.getMessagingForId(n.id),A=o||p.a.canUserModifyWidgets(I);let N,F,M,P,L;if(O()&&E.a.JITSI.matches(n.type)){const e=async()=>{try{await k(D,I)}catch(e){console.error("Failed to start livestream",e);const t=e.message||Object(h.a)("Unable to start audio streaming.");b.a.createTrackedDialog("WidgetContext Menu","Livestream failed",y.a,{title:Object(h.a)("Failed to start livestream"),description:t})}t()};N=c.a.createElement(d.b,{onClick:e,label:Object(h.a)("Start audio stream")})}if(C){const e=()=>{w.d.instance.moveToContainer(R,n,w.a.Right),t()};F=c.a.createElement(d.b,{onClick:e,label:Object(h.a)("Unpin")})}if(A&&p.a.isManagedByManager(n)){const e=()=>{p.a.editWidget(R,n),t()};M=c.a.createElement(d.b,{onClick:e,label:Object(h.a)("Edit")})}if(null!=D&&D.hasCapability(l.MatrixCapabilities.Screenshots)){const e=()=>{null==D||D.takeScreenshot().then(e=>{f.a.dispatch({action:"picture_snapshot",file:e.screenshot})}).catch(e=>{console.error("Failed to take screenshot: ",e)}),t()};P=c.a.createElement(d.b,{onClick:e,label:Object(h.a)("Take a picture")})}if(i||A){const e=()=>{b.a.createTrackedDialog("Delete Widget","",v.a,{title:Object(h.a)("Delete Widget"),description:Object(h.a)("Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?"),button:Object(h.a)("Delete widget"),onFinished:e=>{e&&p.a.setRoomWidget(I,n.id)}}),t()};L=c.a.createElement(d.b,{onClick:i||e,label:o?Object(h.a)("Remove"):Object(h.a)("Remove for everyone")})}let j=_.b.getValue("allowedWidgets",I)[n.eventId];void 0===j&&(j=n.creatorUserId===x.getUserId());const U=E.a.JITSI.matches(n.type);let B;if(!o&&!U&&j){const e=()=>{console.info("Revoking permission for widget to load: "+n.eventId);const e=_.b.getValue("allowedWidgets",I);e[n.eventId]=!1;const o=_.b.firstSupportedLevel("allowedWidgets");_.b.setValue("allowedWidgets",I,o,e).catch(e=>{console.error(e)}),t()};B=c.a.createElement(d.b,{onClick:e,label:Object(h.a)("Revoke permissions")})}const G=w.d.instance.getContainerWidgets(R,w.a.Top),q=G.findIndex(e=>e.id===n.id);let V,H;if(C&&q>0){const e=()=>{w.d.instance.moveWithinContainer(R,w.a.Top,n,-1),t()};V=c.a.createElement(d.b,{onClick:e,label:Object(h.a)("Move left")})}if(C&&q{w.d.instance.moveWithinContainer(R,w.a.Top,n,1),t()};H=c.a.createElement(d.b,{onClick:e,label:Object(h.a)("Move right")})}return c.a.createElement(d.e,r()({},T,{chevronFace:u.a.None,onFinished:t}),c.a.createElement(d.c,null,N,M,B,L,P,V,H,F))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var o=n(8),r=n(167),i=n(0),a=n(1),s=n(110);function c(e,t){this.roomId=e,this.members={},this.events=new Map,this.paginationToken=null,this._sentinels={},this._updateModifiedTime(),this._displayNameToUserIds={},this._userIdsToDisplayNames={},this._tokenToInvite={},this._joinedMemberCount=null,this._summaryJoinedMemberCount=null,this._invitedMemberCount=null,this._summaryInvitedMemberCount=null,t||(t={status:1}),this._oobMemberFlags=t}function l(e,t,n){const o=e._userIdsToDisplayNames[t];if(delete e._userIdsToDisplayNames[t],o){const n=a.v(o),r=e._displayNameToUserIds[n];if(r){const o=r.filter(e=>e!==t);e._displayNameToUserIds[n]=o}}e._userIdsToDisplayNames[t]=n;const r=n&&a.v(n);r&&(e._displayNameToUserIds[r]||(e._displayNameToUserIds[r]=[]),e._displayNameToUserIds[r].push(t))}a.m(c,o.EventEmitter),c.prototype.getJoinedMemberCount=function(){return null!==this._summaryJoinedMemberCount?this._summaryJoinedMemberCount:(null===this._joinedMemberCount&&(this._joinedMemberCount=this.getMembers().reduce((e,t)=>"join"===t.membership?e+1:e,0)),this._joinedMemberCount)},c.prototype.setJoinedMemberCount=function(e){this._summaryJoinedMemberCount=e},c.prototype.getInvitedMemberCount=function(){return null!==this._summaryInvitedMemberCount?this._summaryInvitedMemberCount:(null===this._invitedMemberCount&&(this._invitedMemberCount=this.getMembers().reduce((e,t)=>"invite"===t.membership?e+1:e,0)),this._invitedMemberCount)},c.prototype.setInvitedMemberCount=function(e){this._summaryInvitedMemberCount=e},c.prototype.getMembers=function(){return Object.values(this.members)},c.prototype.getMembersExcept=function(e){return Object.values(this.members).filter(t=>!e.includes(t.userId))},c.prototype.getMember=function(e){return this.members[e]||null},c.prototype.getSentinelMember=function(e){if(!e)return null;let t=this._sentinels[e];if(void 0===t){t=new r.a(this.roomId,e);const n=this.members[e];n&&t.setMembershipEvent(n.events.member,this),this._sentinels[e]=t}return t},c.prototype.getStateEvents=function(e,t){if(!this.events.has(e))return void 0===t?[]:null;if(void 0===t)return Array.from(this.events.get(e).values());const n=this.events.get(e).get(t);return n||null},c.prototype.clone=function(){const e=new c(this.roomId,this._oobMemberFlags),t=this._oobMemberFlags.status;return this._oobMemberFlags.status=1,Array.from(this.events.values()).forEach(t=>{e.setStateEvents(Array.from(t.values()))}),this._oobMemberFlags.status=t,null!==this._summaryInvitedMemberCount&&e.setInvitedMemberCount(this.getInvitedMemberCount()),null!==this._summaryJoinedMemberCount&&e.setJoinedMemberCount(this.getJoinedMemberCount()),3==this._oobMemberFlags.status&&this.getMembers().forEach(t=>{if(t.isOutOfBand()){e.getMember(t.userId).markOutOfBand()}}),e},c.prototype.setUnknownStateEvents=function(e){const t=e.filter(e=>!this.events.has(e.getType())||!this.events.get(e.getType()).has(e.getStateKey()));this.setStateEvents(t)},c.prototype.setStateEvents=function(e){const t=this;this._updateModifiedTime(),e.forEach((function(e){if(e.getRoomId()!==t.roomId)return;if(!e.isState())return;const n=t._getStateEventMatching(e);t._setStateEvent(e),"m.room.member"===e.getType()&&(l(t,e.getStateKey(),e.getContent().displayname),function(e,t){if(!t.getContent().third_party_invite)return;const n=(t.getContent().third_party_invite.signed||{}).token;if(!n)return;if(!e.getStateEvents("m.room.third_party_invite",n))return;e._tokenToInvite[n]=t}(t,e)),t.emit("RoomState.events",e,t,n)})),e.forEach((function(e){if(e.getRoomId()===t.roomId&&e.isState())if("m.room.member"===e.getType()){const n=e.getStateKey();"leave"!==e.getContent().membership&&"ban"!==e.getContent().membership||(e.getContent().avatar_url=e.getContent().avatar_url||e.getPrevContent().avatar_url,e.getContent().displayname=e.getContent().displayname||e.getPrevContent().displayname);const o=t._getOrCreateMember(n,e);o.setMembershipEvent(e,t),t._updateMember(o),t.emit("RoomState.members",e,t,o)}else if("m.room.power_levels"===e.getType()){Object.values(t.members).forEach((function(n){const o=n.getLastModifiedTime();n.setPowerLevelEvent(e),o!==n.getLastModifiedTime()&&t.emit("RoomState.members",e,t,n)})),t._sentinels={}}}))},c.prototype._getOrCreateMember=function(e,t){let n=this.members[e];return n||(n=new r.a(this.roomId,e),this.members[e]=n,this.emit("RoomState.newMember",t,this,n)),n},c.prototype._setStateEvent=function(e){this.events.has(e.getType())||this.events.set(e.getType(),new Map),this.events.get(e.getType()).set(e.getStateKey(),e)},c.prototype._getStateEventMatching=function(e){return this.events.has(e.getType())?this.events.get(e.getType()).get(e.getStateKey()):null},c.prototype._updateMember=function(e){const t=this.getStateEvents("m.room.power_levels","");t&&e.setPowerLevelEvent(t),delete this._sentinels[e.userId],this.members[e.userId]=e,this._joinedMemberCount=null,this._invitedMemberCount=null},c.prototype.needsOutOfBandMembers=function(){return 1===this._oobMemberFlags.status},c.prototype.markOutOfBandMembersStarted=function(){1===this._oobMemberFlags.status&&(this._oobMemberFlags.status=2)},c.prototype.markOutOfBandMembersFailed=function(){2===this._oobMemberFlags.status&&(this._oobMemberFlags.status=1)},c.prototype.clearOutOfBandMembers=function(){let e=0;Object.keys(this.members).forEach(t=>{this.members[t].isOutOfBand()&&(++e,delete this.members[t])}),i.a.log(`LL: RoomState removed ${e} members...`),this._oobMemberFlags.status=1},c.prototype.setOutOfBandMembers=function(e){i.a.log(`LL: RoomState about to set ${e.length} OOB members ...`),2===this._oobMemberFlags.status&&(i.a.log("LL: RoomState put in OOB_STATUS_FINISHED state ..."),this._oobMemberFlags.status=3,e.forEach(e=>this._setOutOfBandMember(e)))},c.prototype._setOutOfBandMember=function(e){if("m.room.member"!==e.getType())return;const t=e.getStateKey(),n=this.getMember(t);if(n&&!n.isOutOfBand())return;const o=this._getOrCreateMember(t,e);o.setMembershipEvent(e,this),o.markOutOfBand(),l(this,o.userId,o.name),this._setStateEvent(e),this._updateMember(o),this.emit("RoomState.members",e,this,o)},c.prototype.setTypingEvent=function(e){Object.values(this.members).forEach((function(t){t.setTypingEvent(e)}))},c.prototype.getInviteForThreePidToken=function(e){return this._tokenToInvite[e]||null},c.prototype._updateModifiedTime=function(){this._modified=Date.now()},c.prototype.getLastModifiedTime=function(){return this._modified},c.prototype.getUserIdsWithDisplayName=function(e){return this._displayNameToUserIds[a.v(e)]||[]},c.prototype.maySendRedactionForEvent=function(e,t){const n=this.getMember(t);if(!n||"leave"===n.membership)return!1;if(e.status||e.isRedacted())return!1;const o=this.maySendEvent("m.room.redaction",t);return e.getSender()===t?o:this._hasSufficientPowerLevelFor("redact",n.powerLevel)},c.prototype._hasSufficientPowerLevelFor=function(e,t){const n=this.getStateEvents("m.room.power_levels","");let o={};n&&(o=n.getContent());let r=50;return a.p(o[e])&&(r=o[e]),t>=r},c.prototype.maySendMessage=function(e){return this._maySendEventOfType("m.room.message",e,!1)},c.prototype.maySendEvent=function(e,t){return this._maySendEventOfType(e,t,!1)},c.prototype.mayClientSendStateEvent=function(e,t){return!t.isGuest()&&this.maySendStateEvent(e,t.credentials.userId)},c.prototype.maySendStateEvent=function(e,t){return this._maySendEventOfType(e,t,!0)},c.prototype._maySendEventOfType=function(e,t,n){const o=this.getStateEvents("m.room.power_levels","");let r,i={},a=0,s=0,c=0;if(o){r=o.getContent(),i=r.events||{},a=Number.isFinite(r.state_default)?r.state_default:50;const e=r.users&&r.users[t];Number.isFinite(e)?c=e:Number.isFinite(r.users_default)&&(c=r.users_default),Number.isFinite(r.events_default)&&(s=r.events_default)}let l=n?a:s;return Number.isFinite(i[e])&&(l=i[e]),c>=l},c.prototype.mayTriggerNotifOfType=function(e,t){const n=this.getMember(t);if(!n)return!1;const o=this.getStateEvents("m.room.power_levels","");let r=50;return o&&o.getContent()&&o.getContent().notifications&&a.p(o.getContent().notifications[e])&&(r=o.getContent().notifications[e]),n.powerLevel>=r},c.prototype.getJoinRule=function(){const e=this.getStateEvents(s.a.RoomJoinRules,"");return(e?e.getContent():{}).join_rule||"invite"}},function(e,t,n){"use strict";function o(e){const t=e.embeddedPages;let n=null==t?void 0:t.homeUrl;return n||(n=e.welcomePageUrl),n}function r(e){const t=e.embeddedPages;return!0===(null==t?void 0:t.loginForWelcome)}n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var o=n(18),r=n.n(o);class i{get action(){return"NOT_USED"}constructor(e){r()(this,"fn",void 0),this.fn=e}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var o=n(87),r=n.n(o),i=n(110),a=n(97),s=n.n(a),c=n(96),l=n(118),d=n(101),u=n(526),h=n(126),p=n(114),m=n(238);const g=52;t.b=({hasAvatar:e,hasAvatarLabel:t,noAvatarLabel:n,setAvatarUrl:a,children:g})=>{const f=Object(o.useContext)(d.a),[_,b]=Object(o.useState)(!1),[v,y]=Object(o.useState)(!1),[E,S]=Object(o.useState)(!1);Object(u.b)(()=>{S(!0)},3e3),Object(u.b)(()=>{S(!1)},13e3);const w=Object(o.useRef)(),C=e||_?t:n,{room:T}=Object(o.useContext)(m.a);if(!(null==T?void 0:T.currentState.maySendStateEvent(i.a.RoomAvatar,f.getUserId())))return r.a.createElement(r.a.Fragment,null,g);const x=!!C&&(v||E);return r.a.createElement(r.a.Fragment,null,r.a.createElement("input",{type:"file",ref:w,className:"mx_MiniAvatarUploader_input",onChange:async e=>{var t;if(null===(t=e.target.files)||void 0===t||!t.length)return;b(!0),h.a.trackEvent("mini_avatar","upload"),p.a.instance.track("mini_avatar_upload");const n=e.target.files[0],o=await f.uploadContent(n);await a(o),b(!1)},accept:"image/*"}),r.a.createElement(c.a,{className:s()("mx_MiniAvatarUploader",{mx_MiniAvatarUploader_busy:_,mx_MiniAvatarUploader_hasAvatar:e}),disabled:_,onClick:()=>{w.current.click()},onMouseOver:()=>y(!0),onMouseLeave:()=>y(!1)},g,r.a.createElement("div",{className:"mx_MiniAvatarUploader_indicator"},_?r.a.createElement(l.a,{w:20,h:20}):r.a.createElement("div",{className:"mx_MiniAvatarUploader_cameraIcon"})),r.a.createElement("div",{className:s()("mx_Tooltip",{mx_Tooltip_visible:x,mx_Tooltip_invisible:!x})},r.a.createElement("div",{className:"mx_Tooltip_chevron"}),C)))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var o=n(379);function r(e,t,n){return new o.a(o=>{o({action:e+".pending",request:"function"==typeof n?n():void 0}),t().then(t=>{o({action:e+".success",result:t})}).catch(t=>{o({action:e+".failure",err:t})})})}},function(e,t,n){var o=n(821);e.exports=function(e,t,n){if(o(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,o){return e.call(t,n,o)};case 3:return function(n,o,r){return e.call(t,n,o,r)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){var o=n(242);e.exports=function(e,t){if(!o(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!o(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!o(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var o=n(387)("keys"),r=n(327);e.exports=function(e){return o[e]||(o[e]=r(e))}},function(e,t,n){var o=n(147),r=n(190),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:o.version,mode:n(326)?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){"use strict";t.__esModule=!0;var o=a(n(824)),r=a(n(836)),i="function"==typeof r.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":typeof e};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof r.default&&"symbol"===i(o.default)?function(e){return void 0===e?"undefined":i(e)}:function(e){return e&&"function"==typeof r.default&&e.constructor===r.default&&e!==r.default.prototype?"symbol":void 0===e?"undefined":i(e)}},function(e,t){var n=Math.ceil,o=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?o:n)(e)}},function(e,t,n){var o=n(241),r=n(828),i=n(392),a=n(386)("IE_PROTO"),s=function(){},c=function(){var e,t=n(535)("iframe"),o=i.length;for(t.style.display="none",n(831).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("