@element-hq/element-call-embedded 0.19.2-rc.1 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/assets/_sentry-release-injection-file-C4oXeC0H.js +2 -0
  2. package/dist/assets/{_sentry-release-injection-file-BUU9a5PD.js.map → _sentry-release-injection-file-C4oXeC0H.js.map} +1 -1
  3. package/dist/assets/{index-Djc6082U.js → index-DzoaVylG.js} +5 -5
  4. package/dist/assets/{index-Djc6082U.js.map → index-DzoaVylG.js.map} +1 -1
  5. package/dist/assets/{indexeddb-crypto-store-Bpb_zi4O.js → indexeddb-crypto-store-DDjyMFqS.js} +4 -4
  6. package/dist/assets/{indexeddb-crypto-store-Bpb_zi4O.js.map → indexeddb-crypto-store-DDjyMFqS.js.map} +1 -1
  7. package/dist/assets/{matrix-DdWlnjSh.js → matrix-BMlTzVh5.js} +5 -5
  8. package/dist/assets/{matrix-DdWlnjSh.js.map → matrix-BMlTzVh5.js.map} +1 -1
  9. package/dist/assets/{pako.esm-xdBZSMA1.js → pako.esm-UZ0EWzai.js} +2 -2
  10. package/dist/assets/{pako.esm-xdBZSMA1.js.map → pako.esm-UZ0EWzai.js.map} +1 -1
  11. package/dist/assets/{polyfill-force-BjJnj5Za.js → polyfill-force-CL46JUpA.js} +2 -2
  12. package/dist/assets/{polyfill-force-BjJnj5Za.js.map → polyfill-force-CL46JUpA.js.map} +1 -1
  13. package/dist/assets/{polyfill-force-CL7owmpV.js → polyfill-force-Dey3kAQw.js} +2 -2
  14. package/dist/assets/{polyfill-force-CL7owmpV.js.map → polyfill-force-Dey3kAQw.js.map} +1 -1
  15. package/dist/assets/{rust-crypto-C0aPoIC0.js → rust-crypto-BB1QAvrJ.js} +2 -2
  16. package/dist/assets/{rust-crypto-C0aPoIC0.js.map → rust-crypto-BB1QAvrJ.js.map} +1 -1
  17. package/dist/assets/{spa-D-aVmjgn.js → spa-BW6X0pJ7.js} +2 -2
  18. package/dist/assets/{spa-D-aVmjgn.js.map → spa-BW6X0pJ7.js.map} +1 -1
  19. package/dist/assets/{tslib.es6-DQ6HU-p4.js → tslib.es6-Cgt7ctuY.js} +2 -2
  20. package/dist/assets/{tslib.es6-DQ6HU-p4.js.map → tslib.es6-Cgt7ctuY.js.map} +1 -1
  21. package/dist/index.html +1 -1
  22. package/package.json +1 -1
  23. package/dist/assets/_sentry-release-injection-file-BUU9a5PD.js +0 -2
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./polyfill-force-CL7owmpV.js","./_sentry-release-injection-file-BUU9a5PD.js","./tslib.es6-DQ6HU-p4.js","./polyfill-force-BjJnj5Za.js"])))=>i.map(i=>d[i]);
2
- try{let e=typeof window<`u`?window:t===void 0?typeof globalThis<`u`?globalThis:typeof self<`u`?self:{}:t,n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=`dd3d5d63-7db5-4b71-bfe8-a57eb6509133`,e._sentryDebugIdIdentifier=`sentry-dbid-dd3d5d63-7db5-4b71-bfe8-a57eb6509133`)}catch{}import{a as e,o as t,t as n}from"./_sentry-release-injection-file-BUU9a5PD.js";import{Dr as r,Fr as i,Gn as a,I as o,M as s,Nr as c,On as l,Sn as u,Tn as d,Vr as f,_i as p,_n as m,ai as h,et as g,kr as _,nt as v,qt as y,rt as b,s as x,tt as S,u as C,ui as w,ut as T,vi as E,x as ee,yi as te,zt as ne}from"./indexeddb-crypto-store-Bpb_zi4O.js";import{$ as re,$i as ie,$n as ae,$r as D,$t as O,A as oe,Ai as se,An as ce,Ar as le,At as ue,B as de,Bi as fe,Bn as pe,Br as me,Bt as he,C as ge,Ci as _e,Cn as ve,Cr as ye,Ct as be,D as xe,Di as Se,Dn as Ce,Dr as we,Dt as Te,E as Ee,Ei as De,En as Oe,Er as ke,Et as Ae,F as je,Fi as Me,Fn as Ne,Fr as Pe,G as Fe,Gi as Ie,Gn as Le,Gr as Re,Gt as ze,H as Be,Hi as Ve,Hn as He,Hr as Ue,Ht as We,I as Ge,Ii as Ke,In as qe,Ir as Je,It as Ye,J as Xe,Ji as Ze,Jn as Qe,Jr as $e,Jt as et,K as tt,Ki as nt,Kn as rt,Kr as it,Kt as at,L as ot,Li as st,Ln as ct,Lr as lt,Lt as ut,M as dt,Mi as ft,Mn as pt,Mr as mt,Mt as ht,N as gt,Ni as _t,Nn as vt,Nr as yt,Nt as bt,O as xt,Oi as St,On as Ct,Or as wt,Ot as Tt,P as Et,Pi as Dt,Pn as Ot,Pr as kt,Pt as At,Q as jt,Qi as Mt,Qn as Nt,Qr as Pt,Qt as Ft,R as It,Ri as Lt,Rn as Rt,Rr as zt,Rt as Bt,S as Vt,Si as Ht,Sn as Ut,Sr as Wt,St as Gt,T as Kt,Ti as qt,Tn as Jt,Tr as Yt,Tt as Xt,U as Zt,Ui as Qt,Un as $t,Ur as en,Ut as tn,V as nn,Vi as rn,Vn as an,Vr as on,Vt as sn,W as cn,Wi as ln,Wn as un,Wr as dn,Wt as fn,X as pn,Xi as mn,Xn as hn,Xr as gn,Xt as _n,Y as vn,Yi as yn,Yn as bn,Yr as xn,Yt as Sn,Z as Cn,Zi as wn,Zn as Tn,Zr as En,Zt as Dn,_ as On,_i as kn,_n as An,_r as jn,_t as Mn,a as Nn,aa as Pn,ai as Fn,an as In,ar as Ln,at as Rn,b as zn,bi as Bn,bn as Vn,br as Hn,bt as Un,c as Wn,ca as Gn,ci as Kn,cn as qn,cr as Jn,ct as Yn,d as Xn,da as Zn,di as Qn,dn as $n,dr as er,dt as tr,ea as nr,ei as rr,en as ir,er as ar,et as or,f as sr,fa as cr,fi as lr,fn as ur,fr as dr,ft as fr,g as pr,gi as mr,gn as hr,gr,gt as _r,h as vr,hi as yr,hn as br,hr as xr,ht as Sr,i as Cr,ia as wr,ii as Tr,in as Er,ir as Dr,it as k,j as Or,ji as kr,jn as Ar,jr,jt as Mr,k as Nr,ki as Pr,kn as Fr,kr as Ir,kt as Lr,l as Rr,la as zr,li as Br,ln as Vr,lr as Hr,lt as Ur,m as Wr,ma as Gr,mi as Kr,mn as qr,mr as Jr,mt as Yr,n as Xr,na as Zr,ni as Qr,nn as $r,nr as ei,nt as ti,o as ni,oa as ri,oi as ii,on as ai,or as oi,ot as si,p as ci,pa as li,pi as ui,pn as di,pr as fi,pt as pi,q as mi,qi as A,qn as hi,qr as gi,qt as _i,r as vi,ra as yi,ri as bi,rn as xi,rr as Si,rt as Ci,s as wi,sa as Ti,si as Ei,sn as Di,sr as Oi,st as ki,t as Ai,ta as ji,ti as Mi,tn as Ni,tr as Pi,tt as Fi,u as Ii,ua as Li,ui as Ri,un as zi,ur as Bi,ut as Vi,v as Hi,vi as Ui,vn as Wi,vr as Gi,vt as Ki,w as qi,wi as Ji,wn as Yi,wr as Xi,wt as Zi,x as Qi,xi as $i,xn as ea,xr as ta,xt as na,y as ra,yi as ia,yn as aa,yr as oa,yt as sa,z as ca,zi as la,zn as j,zr as ua,zt as da}from"./matrix-DdWlnjSh.js";import{a as fa,c as pa,d as ma,f as ha,i as ga,n as _a,o as va,r as ya,s as ba,u as xa}from"./tslib.es6-DQ6HU-p4.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Sa=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){_(ee,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ca=n(((e,t)=>{t.exports=Sa()})),wa=n((e=>{Li();var t=Ca(),n=zr(),r=Gn();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function de(e,t){ce++,se[ce]=e.current,e.current=t}var fe=le(null),pe=le(null),me=le(null),he=le(null);function ge(e,t){switch(de(me,t),de(pe,e),de(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nf(t),e=rf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(fe),de(fe,e)}function _e(){ue(fe),ue(pe),ue(me)}function ve(e){e.memoizedState!==null&&de(he,e);var t=fe.current,n=rf(t,e.type);t!==n&&(de(pe,e),de(fe,n))}function ye(e){pe.current===e&&(ue(fe),ue(pe)),he.current===e&&(ue(he),fp._currentValue=oe)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./polyfill-force-Dey3kAQw.js","./_sentry-release-injection-file-C4oXeC0H.js","./tslib.es6-Cgt7ctuY.js","./polyfill-force-CL46JUpA.js"])))=>i.map(i=>d[i]);
2
+ try{let e=typeof window<`u`?window:t===void 0?typeof globalThis<`u`?globalThis:typeof self<`u`?self:{}:t,n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]=`b65ea8b7-c189-4042-96a8-5c189a6c4504`,e._sentryDebugIdIdentifier=`sentry-dbid-b65ea8b7-c189-4042-96a8-5c189a6c4504`)}catch{}import{a as e,o as t,t as n}from"./_sentry-release-injection-file-C4oXeC0H.js";import{Dr as r,Fr as i,Gn as a,I as o,M as s,Nr as c,On as l,Sn as u,Tn as d,Vr as f,_i as p,_n as m,ai as h,et as g,kr as _,nt as v,qt as y,rt as b,s as x,tt as S,u as C,ui as w,ut as T,vi as E,x as ee,yi as te,zt as ne}from"./indexeddb-crypto-store-DDjyMFqS.js";import{$ as re,$i as ie,$n as ae,$r as D,$t as O,A as oe,Ai as se,An as ce,Ar as le,At as ue,B as de,Bi as fe,Bn as pe,Br as me,Bt as he,C as ge,Ci as _e,Cn as ve,Cr as ye,Ct as be,D as xe,Di as Se,Dn as Ce,Dr as we,Dt as Te,E as Ee,Ei as De,En as Oe,Er as ke,Et as Ae,F as je,Fi as Me,Fn as Ne,Fr as Pe,G as Fe,Gi as Ie,Gn as Le,Gr as Re,Gt as ze,H as Be,Hi as Ve,Hn as He,Hr as Ue,Ht as We,I as Ge,Ii as Ke,In as qe,Ir as Je,It as Ye,J as Xe,Ji as Ze,Jn as Qe,Jr as $e,Jt as et,K as tt,Ki as nt,Kn as rt,Kr as it,Kt as at,L as ot,Li as st,Ln as ct,Lr as lt,Lt as ut,M as dt,Mi as ft,Mn as pt,Mr as mt,Mt as ht,N as gt,Ni as _t,Nn as vt,Nr as yt,Nt as bt,O as xt,Oi as St,On as Ct,Or as wt,Ot as Tt,P as Et,Pi as Dt,Pn as Ot,Pr as kt,Pt as At,Q as jt,Qi as Mt,Qn as Nt,Qr as Pt,Qt as Ft,R as It,Ri as Lt,Rn as Rt,Rr as zt,Rt as Bt,S as Vt,Si as Ht,Sn as Ut,Sr as Wt,St as Gt,T as Kt,Ti as qt,Tn as Jt,Tr as Yt,Tt as Xt,U as Zt,Ui as Qt,Un as $t,Ur as en,Ut as tn,V as nn,Vi as rn,Vn as an,Vr as on,Vt as sn,W as cn,Wi as ln,Wn as un,Wr as dn,Wt as fn,X as pn,Xi as mn,Xn as hn,Xr as gn,Xt as _n,Y as vn,Yi as yn,Yn as bn,Yr as xn,Yt as Sn,Z as Cn,Zi as wn,Zn as Tn,Zr as En,Zt as Dn,_ as On,_i as kn,_n as An,_r as jn,_t as Mn,a as Nn,aa as Pn,ai as Fn,an as In,ar as Ln,at as Rn,b as zn,bi as Bn,bn as Vn,br as Hn,bt as Un,c as Wn,ca as Gn,ci as Kn,cn as qn,cr as Jn,ct as Yn,d as Xn,da as Zn,di as Qn,dn as $n,dr as er,dt as tr,ea as nr,ei as rr,en as ir,er as ar,et as or,f as sr,fa as cr,fi as lr,fn as ur,fr as dr,ft as fr,g as pr,gi as mr,gn as hr,gr,gt as _r,h as vr,hi as yr,hn as br,hr as xr,ht as Sr,i as Cr,ia as wr,ii as Tr,in as Er,ir as Dr,it as k,j as Or,ji as kr,jn as Ar,jr,jt as Mr,k as Nr,ki as Pr,kn as Fr,kr as Ir,kt as Lr,l as Rr,la as zr,li as Br,ln as Vr,lr as Hr,lt as Ur,m as Wr,ma as Gr,mi as Kr,mn as qr,mr as Jr,mt as Yr,n as Xr,na as Zr,ni as Qr,nn as $r,nr as ei,nt as ti,o as ni,oa as ri,oi as ii,on as ai,or as oi,ot as si,p as ci,pa as li,pi as ui,pn as di,pr as fi,pt as pi,q as mi,qi as A,qn as hi,qr as gi,qt as _i,r as vi,ra as yi,ri as bi,rn as xi,rr as Si,rt as Ci,s as wi,sa as Ti,si as Ei,sn as Di,sr as Oi,st as ki,t as Ai,ta as ji,ti as Mi,tn as Ni,tr as Pi,tt as Fi,u as Ii,ua as Li,ui as Ri,un as zi,ur as Bi,ut as Vi,v as Hi,vi as Ui,vn as Wi,vr as Gi,vt as Ki,w as qi,wi as Ji,wn as Yi,wr as Xi,wt as Zi,x as Qi,xi as $i,xn as ea,xr as ta,xt as na,y as ra,yi as ia,yn as aa,yr as oa,yt as sa,z as ca,zi as la,zn as j,zr as ua,zt as da}from"./matrix-BMlTzVh5.js";import{a as fa,c as pa,d as ma,f as ha,i as ga,n as _a,o as va,r as ya,s as ba,u as xa}from"./tslib.es6-Cgt7ctuY.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Sa=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,te());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?te():S=!1}}}var te;if(typeof y==`function`)te=function(){y(ee)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,re=ne.port2;ne.port1.onmessage=ee,te=function(){re.postMessage(null)}}else te=function(){_(ee,0)};function ie(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,te()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ca=n(((e,t)=>{t.exports=Sa()})),wa=n((e=>{Li();var t=Ca(),n=zr(),r=Gn();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),te=Symbol.iterator;function ne(e){return typeof e!=`object`||!e?null:(e=te&&e[te]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,D=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function de(e,t){ce++,se[ce]=e.current,e.current=t}var fe=le(null),pe=le(null),me=le(null),he=le(null);function ge(e,t){switch(de(me,t),de(pe,e),de(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nf(t),e=rf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(fe),de(fe,e)}function _e(){ue(fe),ue(pe),ue(me)}function ve(e){e.memoizedState!==null&&de(he,e);var t=fe.current,n=rf(t,e.type);t!==n&&(de(pe,e),de(fe,n))}function ye(e){pe.current===e&&(ue(fe),ue(pe)),he.current===e&&(ue(he),fp._currentValue=oe)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
5
  `),l=s.split(`
@@ -202,7 +202,7 @@ void main() {
202
202
  void main() {
203
203
  gl_FragColor = texture2D(u_texture, v_uv);
204
204
  }
205
- `));return{framebuffer:i,texture:r,program:a,uniforms:{texture:e.getUniformLocation(a,`u_texture`),position:e.getAttribLocation(a,`position`)}}}function uY(e,t,n,r,i,a){return e.useProgram(n.program),e.bindFramebuffer(e.FRAMEBUFFER,n.framebuffer),e.viewport(0,0,i,a),e.bindBuffer(e.ARRAY_BUFFER,r),e.enableVertexAttribArray(n.uniforms.position),e.vertexAttribPointer(n.uniforms.position,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.uniform1i(n.uniforms.texture,0),e.drawArrays(e.TRIANGLES,0,6),e.bindFramebuffer(e.FRAMEBUFFER,null),n.texture}var dY=HJ(`livekit-track-processor-web-gl`),fY=e=>{let t=e.getContext(`webgl2`,{antialias:!0,premultipliedAlpha:!0}),n=null;if(!t){dY.error(`Failed to create WebGL context`);return}t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA);let r=cY(t),i=r.program,a=r.attribLocations.position,{mask:o,frame:s,background:c,disableBackground:l}=r.uniformLocations,u=rY(t),d=u.program,f=u.uniforms,p=oY(t),m=p.program,h=p.uniforms,g=KJ(t,0),_=KJ(t,1),v=XJ(t);if(!v)throw Error(`Failed to create vertex buffer`);let y=[],b=[],x=[],S=0,C=1;y.push(KJ(t,3)),y.push(KJ(t,4));let w=Math.floor(e.width/4),T=Math.floor(e.height/4),E=lY(t,w,T);b.push(YJ(t,y[0],w,T)),b.push(YJ(t,y[1],w,T));let ee=KJ(t,5),te=YJ(t,ee,e.width,e.height);x.push(KJ(t,6)),x.push(KJ(t,7));let ne=[YJ(t,x[0],e.width,e.height),YJ(t,x[1],e.width,e.height)],re=!1;t.useProgram(i),t.uniform1i(l,+!!re),t.uniform1i(c,0),t.uniform1i(s,1),t.uniform1i(o,2);let ie=null;function ae(e){if(e.codedWidth===0||x.length===0)return;let r=e.displayWidth,u=e.displayHeight;t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,_),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);let p=g;n?p=iY(t,uY(t,_,E,v,w,T),w,T,n,d,f,v,b,y):ie&&(t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,g),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,ie),p=g),t.viewport(0,0,r,u),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(a,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(a),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,p),t.uniform1i(c,0),t.uniform1i(l,+!!re),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,_),t.uniform1i(s,1),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,x[S]),t.uniform1i(o,2),t.drawArrays(t.TRIANGLES,0,6)}async function D(n){if(ie=null,n){ie=$J();try{ie=await ZJ(n,e.width,e.height)}catch(e){dY.error(`Error processing background image, falling back to black background:`,e)}t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,g),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,ie)}}function O(e){n=e?Math.max(1,Math.floor(e/4)):null,D(null)}function oe(e){re=e}function se(n){let r=[te,ne[C]],i=[ee,x[C]];iY(t,n,e.width,e.height,8,m,h,v,r,i),S=C,C=1-C}function ce(){t.deleteProgram(i),t.deleteProgram(d),t.deleteProgram(m),t.deleteTexture(g),t.deleteTexture(_),t.deleteTexture(ee),t.deleteFramebuffer(te);for(let e of y)t.deleteTexture(e);for(let e of b)t.deleteFramebuffer(e);for(let e of x)t.deleteTexture(e);for(let e of ne)t.deleteFramebuffer(e);t.deleteBuffer(v),E&&(t.deleteTexture(E.texture),t.deleteFramebuffer(E.framebuffer),t.deleteProgram(E.program)),ie&&=(ie instanceof ImageBitmap&&ie.close(),null),y=[],b=[],x=[]}return{renderFrame:ae,updateMask:se,setBackgroundImage:D,setBlurRadius:O,setBackgroundDisabled:oe,cleanup:ce}},pY=class{constructor(){this.isDisabled=!1}async init({outputCanvas:e,inputElement:t}){if(!(t instanceof HTMLVideoElement))throw TypeError(`Video transformer needs a HTMLVideoElement as input`);this.transformer=new TransformStream({transform:(e,t)=>this.transform(e,t)}),this.canvas=e||null,e&&(this.gl=fY(this.canvas||zJ(t.videoWidth,t.videoHeight))),this.inputVideo=t,this.isDisabled=!1}async restart({outputCanvas:e,inputElement:t}){var n;this.canvas=e||null,(n=this.gl)==null||n.cleanup(),this.gl=fY(this.canvas||zJ(t.videoWidth,t.videoHeight)),this.inputVideo=t,this.isDisabled=!1}async destroy(){var e;this.isDisabled=!0,this.canvas=void 0,(e=this.gl)==null||e.cleanup(),this.gl=void 0}},mY=class extends pY{constructor(e){super(),this.backgroundImageAndPath=null,this.segmentationTimeMs=0,this.isFirstFrame=!0,this.log=HJ(`livekit-processor-wrapper`),this.options=e,this.update(e)}static get isSupported(){return typeof OffscreenCanvas<`u`&&typeof VideoFrame<`u`&&typeof createImageBitmap<`u`&&!!document.createElement(`canvas`).getContext(`webgl2`)}async init({outputCanvas:e,inputElement:t}){var n,r;await super.init({outputCanvas:e,inputElement:t});let i=await LK.forVisionTasks(this.options.assetPaths?.tasksVisionFileSet??`https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${WJ[`@mediapipe/tasks-vision`]}/wasm`);this.imageSegmenter=await OJ.createFromOptions(i,{baseOptions:{modelAssetPath:this.options.assetPaths?.modelAssetPath??`https://storage.googleapis.com/mediapipe-models/image_segmenter/selfie_segmenter/float16/latest/selfie_segmenter.tflite`,delegate:`GPU`,...this.options.segmenterOptions},canvas:this.canvas,runningMode:`VIDEO`,outputCategoryMask:!0,outputConfidenceMasks:!1}),this.options?.imagePath&&await this.loadAndSetBackground(this.options.imagePath).catch(e=>this.log.error(`Error while loading processor background image: `,e)),typeof this.options.blurRadius==`number`&&((n=this.gl)==null||n.setBlurRadius(this.options.blurRadius)),(r=this.gl)==null||r.setBackgroundDisabled(this.options.backgroundDisabled??!1)}async destroy(e){await super.destroy(),await this.imageSegmenter?.close(),this.backgroundImageAndPath=null,e?.willProcessorRestart||(this.isFirstFrame=!0)}async loadAndSetBackground(e){var t;if(!this.backgroundImageAndPath||this.backgroundImageAndPath?.path!==e){let t=new Image;await new Promise((n,r)=>{t.crossOrigin=`Anonymous`,t.onload=()=>n(t),t.onerror=e=>r(e),t.src=e}),this.backgroundImageAndPath={imageData:await createImageBitmap(t),path:e}}(t=this.gl)==null||t.setBackgroundImage(this.backgroundImageAndPath.imageData)}async transform(e,t){var n,r;let i=!1;try{if(!(e instanceof VideoFrame)||e.codedWidth===0||e.codedHeight===0){this.log.debug(`empty frame detected, ignoring`);return}let a=this.isDisabled??this.options.backgroundDisabled??!1;if(typeof this.options.blurRadius!=`number`&&typeof this.options.imagePath!=`string`&&(a=!0),a){t.enqueue(e),i=!0;return}let o=Date.now();if(!this.canvas)throw TypeError(`Canvas needs to be initialized first`);this.canvas.width=e.displayWidth,this.canvas.height=e.displayHeight,this.isFirstFrame&&(t.enqueue(e.clone()),this.inputVideo&&await new Promise(e=>{this.inputVideo.requestVideoFrameCallback((t,n)=>{let r=n.expectedDisplayTime-n.presentationTime;setTimeout(e,r)})})),this.isFirstFrame=!1;let s=performance.now(),c=new Promise((t,n)=>{var r;try{let n=performance.now();(r=this.imageSegmenter)==null||r.segmentForVideo(e,n,e=>{this.segmentationTimeMs=performance.now()-n,this.segmentationResults=e,this.updateMask(e.categoryMask),e.close(),t()})}catch(e){n(e)}});if(this.drawFrame(e),this.canvas&&this.canvas.width>0&&this.canvas.height>0){let i=new VideoFrame(this.canvas,{timestamp:e.timestamp||o});t.enqueue(i);let a=performance.now()-s,c={processingTimeMs:this.segmentationTimeMs+a,segmentationTimeMs:this.segmentationTimeMs,filterTimeMs:a};(r=(n=this.options).onFrameProcessed)==null||r.call(n,c)}else t.enqueue(e);await c}catch(e){this.log.error(`Error while processing frame: `,e)}finally{i||e.close()}}async update(e){var t,n,r;this.options={...this.options,...e},(t=this.gl)==null||t.setBlurRadius(e.blurRadius??null),e.imagePath?await this.loadAndSetBackground(e.imagePath):(n=this.gl)==null||n.setBackgroundImage(null),(r=this.gl)==null||r.setBackgroundDisabled(e.backgroundDisabled??!1)}async drawFrame(e){var t;this.gl&&((t=this.gl)==null||t.renderFrame(e))}async updateMask(e){var t;e&&((t=this.gl)==null||t.updateMask(e.getAsWebGLTexture()))}},hY=()=>mY.isSupported&&UJ.isSupported,gY=``+new URL(`selfie_segmenter-DF05sdL4.tflite`,import.meta.url).href,_Y={wasmLoaderPath:new URL(``+new URL(`vision_wasm_internal-BnoE6ncW.js`,import.meta.url).href,``+import.meta.url).href,wasmBinaryPath:new URL(``+new URL(`vision_wasm_internal-DLLudqmV.wasm`,import.meta.url).href,``+import.meta.url).href},vY=class extends mY{async init({outputCanvas:e,inputElement:t}){await pY.prototype.init.call(this,{outputCanvas:e,inputElement:t}),this.imageSegmenter=await OJ.createFromOptions(_Y,{baseOptions:{modelAssetPath:gY,delegate:`GPU`,...this.options.segmenterOptions},canvas:this.canvas,runningMode:`VIDEO`,outputCategoryMask:!0,outputConfidenceMasks:!1}),this.options.blurRadius&&this.gl?.setBlurRadius(this.options.blurRadius)}},yY=(0,M.createContext)(void 0);function bY(){let e=(0,M.use)(yY);if(e===void 0)throw Error(`useTrackProcessor must be used within a ProcessorProvider`);return e}function xY(){let e=(0,M.use)(yY);if(e===void 0)throw Error(`useTrackProcessor must be used within a ProcessorProvider`);return KL(e=>e.pipe(G(([e])=>e)),[e])}var SY=(e,t,n)=>{yF([t,n]).pipe(e.bind()).subscribe(([e,t])=>{if(!t||!e)return;let{processor:n}=t;n&&!e.getProcessor()&&e.setProcessor(n),!n&&e.getProcessor()&&e.stopProcessor()})},CY=e=>{let{processor:t}=bY();(0,M.useEffect)(()=>{e&&(t&&!e.getProcessor()&&e.setProcessor(t),!t&&e.getProcessor()&&e.stopProcessor())},[t,e])},wY=({children:e})=>{let[t]=Et(Qi),n=(0,M.useMemo)(()=>hY(),[]),r=(0,M.useMemo)(()=>new UJ(new vY({blurRadius:15}),`background-blur`),[]);return(0,W.jsx)(yY,{value:(0,M.useMemo)(()=>({supported:n,processor:n&&t?r:void 0}),[n,t,r]),children:e})},TY={livekit_room_box:`_livekit_room_box_pjiap_12`},EY=function(e){return e.MISSING_MATRIX_RTC_TRANSPORT=`MISSING_MATRIX_RTC_TRANSPORT`,e.CONNECTION_LOST_ERROR=`CONNECTION_LOST_ERROR`,e.INTERNAL_MEMBERSHIP_MANAGER=`INTERNAL_MEMBERSHIP_MANAGER`,e.FAILED_TO_START_LIVEKIT=`FAILED_TO_START_LIVEKIT`,e.INSUFFICIENT_CAPACITY_ERROR=`INSUFFICIENT_CAPACITY_ERROR`,e.E2EE_NOT_SUPPORTED=`E2EE_NOT_SUPPORTED`,e.OPEN_ID_ERROR=`OPEN_ID_ERROR`,e.NO_MATRIX_2_AUTHORIZATION_SERVICE=`NO_MATRIX_2_0_AUTHORIZATION_SERVICE`,e.SFU_ERROR=`SFU_ERROR`,e.UNKNOWN_ERROR=`UNKNOWN_ERROR`,e}({}),DY=function(e){return e.CONFIGURATION_ISSUE=`CONFIGURATION_ISSUE`,e.NETWORK_CONNECTIVITY=`NETWORK_CONNECTIVITY`,e.CLIENT_CONFIGURATION=`CLIENT_CONFIGURATION`,e.UNKNOWN=`UNKNOWN`,e.SYSTEM_FAILURE=`SYSTEM_FAILURE`,e}({}),OY=class extends Error{constructor(e,t,n,r,i){super(e,{cause:i}),this.localisedTitle=e,this.localisedMessage=r,this.category=n,this.code=t}},kY=class extends OY{constructor(e){super(iN(`error.call_is_not_supported`),EY.MISSING_MATRIX_RTC_TRANSPORT,DY.CONFIGURATION_ISSUE,iN(`error.matrix_rtc_transport_missing`,{domain:e,brand:`Element Call`,errorCode:EY.MISSING_MATRIX_RTC_TRANSPORT})),this.domain=e}},AY=class extends OY{constructor(){super(iN(`error.connection_lost`),EY.CONNECTION_LOST_ERROR,DY.NETWORK_CONNECTIVITY,iN(`error.connection_lost_description`))}},jY=class extends OY{constructor(e){super(iN(`error.membership_manager`),EY.INTERNAL_MEMBERSHIP_MANAGER,DY.SYSTEM_FAILURE,iN(`error.membership_manager_description`),e)}},MY=class extends OY{constructor(){super(iN(`error.e2ee_unsupported`),EY.E2EE_NOT_SUPPORTED,DY.CLIENT_CONFIGURATION,iN(`error.e2ee_unsupported_description`))}},NY=class extends OY{constructor(e){super(iN(`error.generic`),EY.UNKNOWN_ERROR,DY.UNKNOWN,void 0,e)}},PY=class extends OY{constructor(e){super(iN(`error.generic`),EY.OPEN_ID_ERROR,DY.CONFIGURATION_ISSUE,void 0,e)}},FY=class extends OY{constructor(e){super(iN(`error.generic`),EY.NO_MATRIX_2_AUTHORIZATION_SERVICE,DY.CONFIGURATION_ISSUE,iN(`error.no_matrix_2_authorization_service`),e)}},IY=class extends OY{constructor(e){super(iN(`error.failed_to_start_livekit`),EY.FAILED_TO_START_LIVEKIT,DY.NETWORK_CONNECTIVITY,e)}},LY=class extends OY{constructor(){super(iN(`error.insufficient_capacity`),EY.INSUFFICIENT_CAPACITY_ERROR,DY.UNKNOWN,iN(`error.insufficient_capacity_description`))}},RY=class extends OY{constructor(){super(iN(`error.room_creation_restricted`),EY.SFU_ERROR,DY.CONFIGURATION_ISSUE,iN(`error.room_creation_restricted_description`))}};function zY({scope:e,membershipsWithTransport$:t,connectionManager:n}){return e.behavior(yF([t,n.connectionManagerData$]).pipe(HF(e=>e.every(t=>t.epoch===e[0].epoch)),G(([e,t])=>new hL([e.value,t.value],e.epoch)),OL(`MatrixLivekitMembers`,function*([e,t]){for(let{membership:n,transport:r}of e){let e=(r?t.getParticipantsForTransport(r):[]).find(e=>e.identity==n.rtcBackendIdentity)??null,i=r?t.getConnectionForTransport(r):null;yield{keys:[n.userId,n.deviceId,n.memberId,n.rtcBackendIdentity],data:{membership:n,participant:e,connection:i}}}},(e,t,n,r,i,a)=>{let{participant$:o,...s}=e.splitBehavior(t);return{userId:n,participant:{type:`remote`,value$:o},...s}})),new hL([],-1))}function BY(e,t){return e&&t?e.livekit_service_url===t.livekit_service_url:!e&&!t}var VY=class{constructor({client:e,resolvedConfig:t,wellKnownFetcher:n,logger:r}){this.client=e,this.resolvedConfig=t,this.wellKnownFetcher=n,this.logger=r.getChild(`[RtcTransportAutoDiscovery]`)}async discoverPreferredTransport(){let e=await this.tryBackendTransports();if(e)return this.logger.info(`Found backend transport: ${e.livekit_service_url}`),e;this.logger.info(`No backend transport found, falling back to well-known`);let t=await this.tryWellKnownTransports();if(t)return this.logger.info(`Found .well-known transport: ${t.livekit_service_url}`),t;this.logger.info(`No .well-known transport found, falling back to app config`);let n=this.tryConfigTransport();return n?(this.logger.info(`Found app config transport: ${n.livekit_service_url}`),n):null}async tryBackendTransports(){let e=this.client;if(e.getAccessToken()&&`_unstable_getRTCTransports`in e){this.logger.info(`First try to use getRTCTransports end point ...`);try{let t=await Xr(async()=>e._unstable_getRTCTransports()),n=t.filter(v)[0];if(n)return n;this.logger.info(`No livekit transport found in getRTCTransports end point`,t)}catch(e){this.logger.info(`Failed to use getRTCTransports end point: ${e}`)}}else this.logger.debug(`getRTCTransports end point not available`);return null}async tryWellKnownTransports(){let e=this.client.getDomain();if(e){let t=await this.wellKnownFetcher(e),n=t[`org.matrix.msc4143.rtc_foci`];if(n)if(!Array.isArray(n))this.logger.warn(`org.matrix.msc4143.rtc_foci is not an array in .well-known`);else return n[0];else this.logger.info(`No .well-known "org.matrix.msc4143.rtc_foci" found for ${e}`,t)}else this.logger.warn(`No domain configured for client`);return null}tryConfigTransport(){let e=this.resolvedConfig.livekit?.livekit_service_url;return e?{type:`livekit`,livekit_service_url:e}:null}},HY=h.getChild(`[LocalTransport]`),UY=function(e){return e.Legacy=`legacy`,e.Matrix_2_0=`matrix_2_0`,e}({});function WY(e){return`transport`in e&&`sfuConfig`in e}var GY=({scope:e,memberships$:t,ownMembershipIdentity:n,client:r,roomId:i,useOldestMember:a,forceJwtEndpoint:o,delayId$:s})=>{let c=KY(e,t),l=iF(new VY({client:r,resolvedConfig:ze.get(),wellKnownFetcher:y.getRawClientConfig.bind(y),logger:HY}).discoverPreferredTransport()),u=yF([Vt.value$.pipe(K(e=>e?aF({type:`livekit`,livekit_service_url:e}):l)).pipe(G(e=>{if(!e)throw new kY(r.getDomain()??``);return e}),eI(BY)),s]).pipe(K(async([e,t])=>{try{return await qY(e,o,n,i,r,t??void 0)}catch(t){throw HY.error(`Failed to authenticate to transport ${e.livekit_service_url}`,t),YY(t)}}));return a?JY(e,c,u,r,n,i):{advertised$:e.behavior(u.pipe(G(e=>e.transport),eI(BY)),null),active$:e.behavior(u.pipe(eI((e,t)=>BY(e.transport,t.transport))),null)}};function KY(e,t){return e.behavior(t.pipe(G(e=>{let t=e.value[0];if(t===void 0)return HY.info(`Oldest member: not found`),null;let n=t.getTransport(t);return n===void 0?(HY.warn(`Oldest member: ${t.userId}|${t.deviceId}|${t.memberId} has no transport`),null):v(n)?(HY.info("Oldest member: ${oldestMember.userId}|${oldestMember.deviceId}|${oldestMember.memberId} has valid transport"),n):(HY.warn(`Oldest member: ${t.userId}|${t.deviceId}|${t.memberId} has invalid transport`),null)}),eI(BY)))}async function qY(e,t,n,r,i,a){return{transport:e,sfuConfig:await XY(i,n,e.livekit_service_url,r,{forceJwtEndpoint:t,delayEndpointBaseUrl:i.baseUrl,delayId:a},HY)}}function JY(e,t,n,r,i,a){let o=t.pipe(K(e=>e===null?aF(null):iF(qY(e,UY.Legacy,i,a,r,void 0)).pipe(KF(t=>{throw HY.error(`Failed to authenticate to transport ${e.livekit_service_url}`,t),YY(t)}),fI(null))));return{advertised$:e.behavior(RF(o.pipe(G(e=>e?.transport??null)),n.pipe(G(e=>e.transport))).pipe(oI(e=>e!==null),_I(e=>HY.info(`Advertise transport: ${e.livekit_service_url}`))),null),active$:e.behavior(o.pipe(_I(e=>HY.info(`Publish on transport: ${e?.transport.livekit_service_url}`))),null)}}function YY(e){return e instanceof PY||e instanceof FY?e:new PY(e instanceof Error?e:Error(String(e)))}async function XY(e,t,n,r,i,a){let o;try{o=await Xr(async()=>e.getOpenIdToken())}catch(e){throw new PY(e instanceof Error?e:Error(`Unknown error`))}a?.debug(`Got openID token`,o);let s,c=i?.forceJwtEndpoint===void 0,l=i?.forceJwtEndpoint===UY.Matrix_2_0;if(c||l)try{return a?.info(`Trying to get JWT with delegation for focus ${n}...`),ZY(await eX(t,n,r,o,i?.delayEndpointBaseUrl,i?.delayId))}catch(e){if(a?.debug(`Failed fetching jwt with matrix 2.0 endpoint:`,e),l)throw new FY(e)}try{return a?.info(`Trying to get JWT with legacy endpoint for focus ${n}...`),s=await QY(t.deviceId,n,r,o),a?.info(`Got JWT from call's active focus URL.`),ZY(s)}catch(e){throw new PY(e instanceof Error?e:Error(`Unknown error ${e}`))}}function ZY(e){let[,n]=e.jwt.split(`.`),r=JSON.parse(t.atob(n));return{jwt:e.jwt,url:e.url,livekitAlias:r.video.room,livekitIdentity:r.sub}}async function QY(e,t,n,r){let i=await Xr(async()=>await fetch(t+`/sfu/get`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({room:n,openid_token:r,device_id:e})}));if(!i.ok)throw Error(`SFU Config fetch failed with status code `+i.status);return await i.json()}var $Y=class extends Error{constructor(e){super(e),this.name=`NotSupported`}};async function eX(e,t,n,r,i,a){let{userId:o,deviceId:s,memberId:c}=e,l={room_id:n,slot_id:`m.call#ROOM`,openid_token:r,member:{id:c,claimed_user_id:o,claimed_device_id:s}},u={};a&&i&&(u={delay_id:a,delay_timeout:ze.get().matrix_rtc_session?.delayed_leave_event_delay_ms??1e3,delay_cs_api_url:i});let d=await Xr(async()=>await fetch(t+`/get_token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...l,...u})}));if(!d.ok){let e=`SFU Config fetch failed with status code `+d.status;throw d.status===404?new $Y(e):Error(e)}return await d.json()}var tX=({client:e,livekitRooms:t,roomId:n,env:r})=>{let{t:i}=Ni(),[a,o]=Et(Kt),[c,l]=Et(ge),[u,d]=(0,M.useState)(!1);(0,M.useEffect)(()=>{e.doesServerSupportUnstableFeature(s).then(e=>{d(e)}).catch(e=>{h.warn(`Failed to check if sticky events are supported`,e)})},[e]);let[f,p]=Et(Ee),m=(0,M.useId)(),g=(0,M.useCallback)(e=>{p(e.target.value)},[p]),[_,v]=Et(Nr),[y,b]=Et(On),[x,S]=(0,M.useState)(null),[C,w]=Et(Vt),[T,E]=(0,M.useState)(C);(0,M.useEffect)(()=>{E(C)},[C]);let[ee,te]=Et(xe),ne=sn(),re=(0,M.useMemo)(()=>{let e=t?.find(e=>e.isLocal)?.room;if(e?.engine.client.ws?.url){let t=new URL(e.engine.client.ws.url);return t.search=``,t}return null},[t]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{children:i(`developer_mode.hostname`,{hostname:window.location.hostname||`unknown`})}),(0,W.jsx)(`p`,{children:i(`version`,{productName:`Element Call`,version:`embedded-v0.19.2-rc.1`})}),(0,W.jsx)(`p`,{children:i(`developer_mode.crypto_version`,{version:e.getCrypto()?.getVersion()||`unknown`})}),(0,W.jsx)(`p`,{children:i(`developer_mode.matrix_id`,{id:e.getUserId()||`unknown`})}),(0,W.jsx)(`p`,{children:i(`developer_mode.device_id`,{id:e.getDeviceId()||`unknown`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`duplicateTiles`,type:`number`,label:i(`developer_mode.duplicate_tiles_label`),value:a.toString(),min:0,onChange:(0,M.useCallback)(e=>{let t=e.target.valueAsNumber;t<0||o(Number.isNaN(t)?0:t)},[o])})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`debugTileLayout`,type:`checkbox`,checked:c,label:i(`developer_mode.debug_tile_layout_label`),onChange:e=>l(e.target.checked)})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`showConnectionStats`,type:`checkbox`,label:i(`developer_mode.show_connection_stats`),checked:!!_,onChange:(0,M.useCallback)(e=>{v(e.target.checked)},[v])})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`muteAllAudio`,type:`checkbox`,label:i(`developer_mode.mute_all_audio`),checked:ee,onChange:(0,M.useCallback)(e=>{te(e.target.checked)},[te])})}),` `,(0,W.jsxs)(AI,{children:[(0,W.jsx)(MI,{id:`alwaysShowIphoneEarpiece`,type:`checkbox`,label:i(`developer_mode.always_show_iphone_earpiece`),checked:y,onChange:(0,M.useCallback)(e=>{b(e.target.checked)},[b])}),` `]}),(0,W.jsx)(Uj,{onSubmit:e=>e.preventDefault(),helpLabel:C===null?i(`developer_mode.custom_livekit_url.from_config`):i(`developer_mode.custom_livekit_url.current_url`)+C,label:i(`developer_mode.custom_livekit_url.label`),saveButtonLabel:i(`developer_mode.custom_livekit_url.save`),savingLabel:i(`developer_mode.custom_livekit_url.saving`),cancelButtonLabel:i(`developer_mode.custom_livekit_url.reset`),onSave:(0,M.useCallback)(async t=>{if(n===void 0||T===``||T===null){w(null);return}try{let t=e.getUserId(),r=e.getDeviceId();if(t===null||r===null)throw Error(`Invalid user or device ID`);await XY(e,{userId:t,deviceId:r,memberId:``},T,n),S(null),w(T)}catch{S(`invalid URL (did not update)`)}},[T,w,e,n]),value:T??``,onChange:(0,M.useCallback)(e=>{E(e.target.value)},[E]),onCancel:(0,M.useCallback)(e=>{w(null)},[w]),serverInvalid:x!==null,children:x!==null&&(0,W.jsx)(Nj,{children:x})}),(0,W.jsx)(qr,{as:`h3`,type:`body`,weight:`semibold`,size:`lg`,children:i(`developer_mode.matrixRTCMode.title`)}),(0,W.jsxs)(Lj,{children:[(0,W.jsxs)(Wj,{name:m,control:(0,W.jsx)(xj,{checked:f===pr.Legacy,value:pr.Legacy,onChange:g}),children:[(0,W.jsx)(Ej,{children:i(`developer_mode.matrixRTCMode.Legacy.label`)}),(0,W.jsx)(Ij,{children:i(`developer_mode.matrixRTCMode.Legacy.description`)})]}),(0,W.jsxs)(Wj,{name:m,control:(0,W.jsx)(xj,{checked:f===pr.Compatibility,value:pr.Compatibility,onChange:g}),children:[(0,W.jsx)(Ej,{children:i(`developer_mode.matrixRTCMode.Comptibility.label`)}),(0,W.jsx)(Ij,{children:i(`developer_mode.matrixRTCMode.Comptibility.description`)})]}),(0,W.jsxs)(Wj,{name:m,control:(0,W.jsx)(xj,{checked:f===pr.Matrix_2_0,value:pr.Matrix_2_0,disabled:!u,onChange:g}),children:[(0,W.jsx)(Ej,{children:i(`developer_mode.matrixRTCMode.Matrix_2_0.label`)}),(0,W.jsx)(Ij,{children:i(`developer_mode.matrixRTCMode.Matrix_2_0.description`)})]})]}),t?.map(e=>(0,W.jsxs)(`div`,{className:TY.livekit_room_box,children:[(0,W.jsx)(`h4`,{children:i(`developer_mode.livekit_sfu`,{url:e.url||`unknown`})}),(0,W.jsxs)(`p`,{children:[`LivekitAlias: `,e.livekitAlias]}),(0,W.jsxs)(`p`,{children:[`connectionState (wont hot reload): `,e.room.state]}),e.isLocal&&(0,W.jsxs)(`p`,{children:[`ws-url: `,re?.href]}),(0,W.jsxs)(`p`,{children:[i(`developer_mode.livekit_server_info`),`(`,e.isLocal?`local`:`remote`,`)`]}),(0,W.jsxs)(`pre`,{className:TY.pre,children:[e.room.serverInfo?JSON.stringify(e.room.serverInfo,null,2):`undefined`,e.room.metadata]}),(0,W.jsx)(`p`,{children:`Local Participant`}),(0,W.jsx)(`pre`,{className:TY.pre,children:e.room.localParticipant.identity}),(0,W.jsx)(`p`,{children:`Remote Participants`}),(0,W.jsx)(`ul`,{children:Array.from(e.room.remoteParticipants.keys()).map(e=>(0,W.jsx)(`li`,{children:e},e))})]})),(0,W.jsx)(`p`,{children:i(`developer_mode.environment_variables`)}),(0,W.jsx)(`pre`,{children:JSON.stringify(r,null,2)}),(0,W.jsx)(`p`,{children:i(`developer_mode.url_params`)}),(0,W.jsx)(`pre`,{children:JSON.stringify(ne,null,2)})]})},nX=`audio`,rX=({open:e,onDismiss:t,tab:n,onTabChange:r,client:i,roomId:a,livekitRooms:o})=>{let{t:s}=Ni(),c=()=>{let{supported:e}=bY(),[t,n]=Et(Qi);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{children:s(`settings.background_blur_header`)}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`activateBackgroundBlur`,label:s(`settings.background_blur_label`),description:e?``:s(`settings.blur_not_supported_by_browser`),type:`checkbox`,checked:!!t,onChange:e=>n(e.target.checked),disabled:!e})})]})},l=$L();(0,M.useEffect)(()=>{e&&l.requestDeviceNames()},[e,l]);let[u,d]=Et(dt),[f,p]=(0,M.useState)(u),[m]=Et(qi),{available:h}=Gt(),{controlledAudioDevices:g}=sn(),_=k(LL),v={key:`audio`,name:s(`common.audio`),content:(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(Lj,{children:[!g&&(0,W.jsx)(KR,{device:l.audioInput,title:s(`settings.devices.microphone`),numberedLabel:e=>s(`settings.devices.microphone_numbered`,{n:e})}),_&&g&&(0,W.jsx)(Pi,{onClick:e=>{e.preventDefault(),window.controls.showNativeAudioDevicePicker?.(),window.controls.showNativeOutputDevicePicker?.()},children:s(`settings.devices.change_device_button`)}),(0,W.jsx)(KR,{device:l.audioOutput,title:s(`settings.devices.speaker`),numberedLabel:e=>s(`settings.devices.speaker_numbered`,{n:e})}),(0,W.jsxs)(`div`,{className:SI.volumeSlider,children:[(0,W.jsx)(`label`,{children:s(`settings.audio_tab.effect_volume_label`)}),(0,W.jsx)(`p`,{children:s(`settings.audio_tab.effect_volume_description`)}),(0,W.jsx)(WR,{label:s(`video_tile.volume`),value:f,onValueChange:p,onValueCommit:d,min:0,max:1,step:.01})]})]})})},y={key:`video`,name:s(`common.video`),content:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Lj,{children:(0,W.jsx)(KR,{device:l.videoInput,title:s(`settings.devices.camera`),numberedLabel:e=>s(`settings.devices.camera_numbered`,{n:e})})}),(0,W.jsx)($j,{}),(0,W.jsx)(c,{})]})},b={key:`preferences`,name:s(`common.preferences`),content:(0,W.jsx)(tR,{})},x={key:`profile`,name:s(`common.profile`),content:(0,W.jsx)(LI,{client:i})},S={key:`feedback`,name:s(`settings.feedback_tab_title`),content:(0,W.jsx)(BI,{roomId:a})},C={key:`developer`,name:s(`settings.developer_tab_title`),content:(0,W.jsx)(tX,{env:{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`embedded-v0.19.2-rc.1`,VITE_PACKAGE:`embedded`},client:i,livekitRooms:o,roomId:a})},w=[v,y];return At===null&&w.push(x),w.push(b),h&&w.push(S),m&&w.push(C),(0,W.jsx)(or,{title:s(`common.settings`),className:SI.settingsModal,open:e,onDismiss:t,tabbed:!0,children:(0,W.jsx)(wI,{label:s(`common.settings`),tab:n,onTabChange:r,tabs:w})})},iX=(0,M.forwardRef)((e,t)=>(0,W.jsxs)(`svg`,{width:22,height:22,viewBox:`0 0 22 22`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:[(0,W.jsx)(`mask`,{id:`path-1-inside-1_898_2641`,fill:`white`,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.1502 20.1214C15.3946 21.3074 13.2782 22 11 22C8.52367 22 6.23845 21.1817 4.4 19.8008C1.72821 17.794 0 14.5988 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11C22 14.797 20.0762 18.1446 17.1502 20.1214ZM11 11.55C12.8225 11.55 14.3 9.94942 14.3 7.975C14.3 6.00058 12.8225 4.4 11 4.4C9.17746 4.4 7.7 6.00058 7.7 7.975C7.7 9.94942 9.17746 11.55 11 11.55ZM11 19.8C13.3782 19.8 15.536 18.8566 17.1197 17.3237C16.1403 14.9056 13.7693 13.2 11 13.2C8.23066 13.2 5.85969 14.9056 4.88028 17.3237C6.46399 18.8566 8.62183 19.8 11 19.8Z`})}),(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.1502 20.1214C15.3946 21.3074 13.2782 22 11 22C8.52367 22 6.23845 21.1817 4.4 19.8008C1.72821 17.794 0 14.5988 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11C22 14.797 20.0762 18.1446 17.1502 20.1214ZM11 11.55C12.8225 11.55 14.3 9.94942 14.3 7.975C14.3 6.00058 12.8225 4.4 11 4.4C9.17746 4.4 7.7 6.00058 7.7 7.975C7.7 9.94942 9.17746 11.55 11 11.55ZM11 19.8C13.3782 19.8 15.536 18.8566 17.1197 17.3237C16.1403 14.9056 13.7693 13.2 11 13.2C8.23066 13.2 5.85969 14.9056 4.88028 17.3237C6.46399 18.8566 8.62183 19.8 11 19.8Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M17.1502 20.1214L17.9339 21.2814L17.1502 20.1214ZM4.4 19.8008L3.55919 20.9202H3.55919L4.4 19.8008ZM17.1197 17.3237L18.0934 18.3296L18.7717 17.6731L18.4173 16.7981L17.1197 17.3237ZM4.88028 17.3237L3.58268 16.7981L3.22829 17.6731L3.90659 18.3296L4.88028 17.3237ZM11 23.4C13.5662 23.4 15.9541 22.619 17.9339 21.2814L16.3665 18.9613C14.835 19.9959 12.9902 20.6 11 20.6V23.4ZM3.55919 20.9202C5.63176 22.477 8.21011 23.4 11 23.4V20.6C8.83723 20.6 6.84514 19.8865 5.24081 18.6814L3.55919 20.9202ZM-1.4 11C-1.4 15.0577 0.55052 18.6603 3.55919 20.9202L5.24081 18.6814C2.90591 16.9276 1.4 14.1399 1.4 11H-1.4ZM11 -1.4C4.15167 -1.4 -1.4 4.15167 -1.4 11H1.4C1.4 5.69807 5.69807 1.4 11 1.4V-1.4ZM23.4 11C23.4 4.15167 17.8483 -1.4 11 -1.4V1.4C16.3019 1.4 20.6 5.69807 20.6 11H23.4ZM17.9339 21.2814C21.2288 19.0554 23.4 15.2815 23.4 11H20.6C20.6 14.3124 18.9236 17.2337 16.3665 18.9613L17.9339 21.2814ZM12.9 7.975C12.9 9.28384 11.9459 10.15 11 10.15V12.95C13.6991 12.95 15.7 10.615 15.7 7.975H12.9ZM11 5.8C11.9459 5.8 12.9 6.66616 12.9 7.975H15.7C15.7 5.335 13.6991 3 11 3V5.8ZM9.1 7.975C9.1 6.66616 10.0541 5.8 11 5.8V3C8.30086 3 6.3 5.335 6.3 7.975H9.1ZM11 10.15C10.0541 10.15 9.1 9.28384 9.1 7.975H6.3C6.3 10.615 8.30086 12.95 11 12.95V10.15ZM16.146 16.3178C14.8129 17.6081 13.0004 18.4 11 18.4V21.2C13.756 21.2 16.2591 20.1051 18.0934 18.3296L16.146 16.3178ZM11 14.6C13.1797 14.6 15.0494 15.9415 15.8221 17.8493L18.4173 16.7981C17.2312 13.8697 14.359 11.8 11 11.8V14.6ZM6.17788 17.8493C6.95058 15.9415 8.8203 14.6 11 14.6V11.8C7.64102 11.8 4.7688 13.8697 3.58268 16.7981L6.17788 17.8493ZM11 18.4C8.99963 18.4 7.18709 17.6081 5.85397 16.3178L3.90659 18.3296C5.74088 20.1051 8.24402 21.2 11 21.2V18.4Z`,fill:`white`,mask:`url(#path-1-inside-1_898_2641)`})]})),aX=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.0988 9.01625C20.3188 9.59375 20.8825 9.97875 21.5013 9.97875C22.3263 9.97875 23 10.6525 23 11.4775V12.5225C23 13.3475 22.3263 14.0213 21.5013 14.0213C20.8825 14.0213 20.3188 14.4062 20.0988 14.9838C20.0806 15.0292 20.0624 15.0753 20.0441 15.1218C19.9792 15.2863 19.9125 15.4555 19.8375 15.6163C19.5763 16.18 19.7 16.84 20.14 17.28C20.7313 17.8575 20.7313 18.8062 20.14 19.3975L19.3975 20.14C18.82 20.7313 17.8713 20.7313 17.28 20.14C16.8538 19.7 16.18 19.5763 15.6163 19.8375C15.41 19.9338 15.2037 20.0163 14.9838 20.0988C14.4062 20.3188 14.0213 20.8825 14.0213 21.5013C14.0213 22.3263 13.3475 23 12.5225 23H11.4775C10.6525 23 9.97875 22.3263 9.97875 21.5013C9.97875 20.8825 9.59375 20.3188 9.01625 20.0988C8.97079 20.0806 8.92466 20.0624 8.87815 20.044C8.71368 19.9792 8.54454 19.9125 8.38375 19.8375C7.82 19.5763 7.16 19.7 6.72 20.14C6.1425 20.7313 5.19375 20.7313 4.6025 20.14L3.86 19.3975C3.26875 18.82 3.26875 17.8713 3.86 17.28C4.3 16.8538 4.42375 16.18 4.1625 15.6163C4.06625 15.41 3.98375 15.2037 3.90125 14.9838C3.68125 14.4062 3.1175 14.0213 2.49875 14.0213C1.67375 14.0213 1 13.3475 1 12.5225V11.4775C1 10.6525 1.67375 9.97875 2.49875 9.97875C3.1175 9.97875 3.68125 9.59375 3.90125 9.01625C3.94464 8.87742 3.99897 8.74406 4.0539 8.60926C4.086 8.53046 4.11831 8.45117 4.14875 8.37C4.41 7.80625 4.28625 7.14625 3.84625 6.70625C3.255 6.12875 3.255 5.18 3.84625 4.58875L4.6025 3.86C5.18 3.26875 6.12875 3.26875 6.72 3.86C7.14625 4.3 7.82 4.42375 8.38375 4.1625C8.59 4.06625 8.79625 3.97 9.01625 3.90125C9.59375 3.68125 9.97875 3.1175 9.97875 2.49875C9.97875 1.67375 10.6525 1 11.4775 1H12.5225C13.3475 1 14.0213 1.67375 14.0213 2.49875C14.0213 3.13125 14.4062 3.68125 14.9838 3.90125C15.0292 3.91943 15.0753 3.93762 15.1218 3.95595C15.2863 4.02079 15.4555 4.08746 15.6163 4.1625C16.18 4.42375 16.84 4.3 17.28 3.86C17.8575 3.26875 18.8062 3.26875 19.3975 3.86L20.14 4.6025C20.7313 5.18 20.7313 6.12875 20.14 6.72C19.7 7.14625 19.5763 7.82 19.8375 8.38375C19.9338 8.59 20.0163 8.79625 20.0988 9.01625ZM12 17.5C8.96125 17.5 6.5 15.0387 6.5 12C6.5 8.96125 8.96125 6.5 12 6.5C15.0387 6.5 17.5 8.96125 17.5 12C17.5 15.0387 15.0387 17.5 12 17.5Z`,fill:`#ffffff`})})),oX=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.49966 2.38889C7.49966 1.89797 7.89763 1.5 8.38855 1.5H20.1108C20.6017 1.5 20.9997 1.89797 20.9997 2.38889V21.6111C20.9997 22.102 20.6017 22.5 20.1108 22.5H8.38855C7.89763 22.5 7.49966 22.102 7.49966 21.6111V12.6667H7.49089H7.4821H7.47331H7.46452H7.45573H7.44694H7.43815H7.42936H7.42057H7.41178H7.403H7.39421H7.38542H7.37663H7.36784H7.35905H7.35026H7.34147H7.33268H7.32389H7.3151H7.30632H7.29753H7.28874H7.27995H7.27116H7.26237H7.25358H7.24479H7.236H7.22721H7.21842H7.20964H7.20085H7.19206H7.18327H7.17448H7.16569H7.1569H7.14811H7.13932H7.13053H7.12175H7.11296H7.10417H7.09538H7.08659H7.0778H7.06901H7.06022H7.05143H7.04264H7.03385H7.02507H7.01628H7.00749H6.9987H6.98991H6.98112H6.97233H6.96354H6.95475H6.94596H6.93717H6.92839H6.9196H6.91081H6.90202H6.89323H6.88444H6.87565H6.86686H6.85807H6.84928H6.8405H6.83171H6.82292H6.81413H6.80534H6.79655H6.78776H6.77897H6.77018H6.76139H6.7526H6.74382H6.73503H6.72624H6.71745H6.70866H6.69987H6.69108H6.68229H6.6735H6.66471H6.65592H6.64714H6.63835H6.62956H6.62077H6.61198H6.60319H6.5944H6.58561H6.57682H6.56803H6.55925H6.55046H6.54167H6.53288H6.52409H6.5153H6.50651H6.49772H6.48893H6.48014H6.47135H6.46257H6.45378H6.44499H6.4362H6.42741H6.41862H6.40983H6.40104H6.39225H6.38346H6.37467H6.36589H6.3571H6.34831H6.33952H6.33073H6.32194H6.31315H6.30436H6.29557H6.28678H6.27799H6.26921H6.26042H6.25163H6.24284H6.23405H6.22526H6.21647H6.20768H6.19889H6.1901H6.18132H6.17253H6.16374H6.15495H6.14616H6.13737H6.12858H6.11979H6.111H6.10221H6.09342H6.08464H6.07585H6.06706H6.05827H6.04948H6.04069H6.0319H6.02311H6.01432H6.00553H5.99674H5.98796H5.97917H5.97038H5.96159H5.9528H5.94401H5.93522H5.92643H5.91764H5.90885H5.90007H5.89128H5.88249H5.8737H5.86491H5.85612H5.84733H5.83854H5.82975H5.82096H5.81217H5.80339H5.7946H5.78581H5.77702H5.76823H5.75944H5.75065H5.74186H5.73307H5.72428H5.71549H5.70671H5.69792H5.68913H5.68034H5.67155H5.66276H5.65397H5.64518H5.63639H5.6276H5.61882H5.61003H5.60124H5.59245H5.58366H5.57487H5.56608H5.55729H5.5485H5.53971H5.53092H5.52214H5.51335H5.50456H5.49577H5.48698H5.47819H5.4694H5.46061H5.45182H5.44303H5.43424H5.42546H5.41667H5.40788H5.39909H5.3903H5.38151H5.37272H5.36393H5.35514H5.34635H5.33757H5.32878H5.31999H5.3112H5.30241H5.29362H5.28483H5.27604H5.26725H5.25846H5.24967H5.24089H5.2321H5.22331H5.21452H5.20573H5.19694H5.18815H5.17936H5.17057H5.16178H5.15299H5.14421H5.13542H5.12663H5.11784H5.10905H5.10026H5.09147H5.08268H5.07389H5.0651H5.05632H5.04753H5.03874H5.02995H5.02116H5.01237H5.00358H4.99479H4.986H4.97721H4.96842H4.95964H4.95085H4.94206H4.93327H4.92448H4.91569H4.9069H4.89811H4.88932H4.88053H4.87174H4.86296H4.85417H4.84538H4.83659H4.8278H4.81901H4.81022H4.80143H4.79264H4.78385H4.77507H4.76628H4.75749H4.7487H4.73991H4.73112H4.72233H4.71354H4.70475H4.69596H4.68717H4.67839H4.6696H4.66081H4.65202H4.64323H4.63444H4.62565H4.61686H4.60807H4.59928H4.59049H4.58171H4.57292H4.56413H4.55534H4.54655H4.53776H4.52897H4.52018H4.51139H4.5026H4.49382H4.48503H4.47624H4.46745H4.45866H4.44987H4.44108H4.43229H4.4235H4.41471H4.40592H4.39714H4.38835H4.37956H4.37077H4.36198H4.35319H4.3444H4.33561H4.32682H4.31803H4.30924H4.30046H4.29167H4.28288H4.27409H4.2653H4.25651H4.24772H4.23893H4.23014H4.22135H4.21257H4.20378H4.19499H4.1862H4.17741H4.16862H4.15983H4.15104H4.14225H4.13346H4.12467H4.11589H4.1071H4.09831H4.08952H4.08073H4.07194H4.06315H4.05436H4.04557H4.03678H4.02799H4.01921H4.01042H4.00163H3.99284H3.98405H3.97526H3.96647H3.95768H3.94889H3.9401H3.93132H3.92253H3.91374H3.90495H3.89616H3.88737H3.87858H3.86979H3.861H3.85221H3.84342H3.83464H3.82585H3.81706H3.80827H3.79948H3.79069H3.7819H3.77311H3.76432H3.75553H3.74674H3.73796H3.72917H3.72038H3.71159H3.7028H3.69401H3.68522H3.67643H3.66764H3.65885H3.65007H3.64128H3.63249H3.6237H3.61491H3.60612H3.59733H3.58854H3.57975H3.57096H3.56217H3.55339H3.5446H3.53581H3.52702H3.51823H3.50944H3.50065H3.49186H3.48307H3.47428H3.46549H3.45671H3.44792H3.43913H3.43034H3.42155H3.41276H3.40397H3.39518H3.38639H3.3776H3.36882H3.36003H3.35124H3.34245H3.33366H3.32487H3.31608H3.30729H3.2985H3.28971H3.28092H3.27214H3.26335H3.25456H3.24577H3.23698H3.22819H3.2194H3.21061H3.20182H3.19303H3.18424H3.17546H3.16667H3.15788H3.14909H3.1403H3.13151H3.12272H3.11393H3.10514H3.09635H3.08757H3.07878H3.06999H3.0612H3.05241H3.04362H3.03483H3.02604H3.01725H3.00846H2.99967C2.63148 12.6667 2.33301 12.3682 2.33301 12C2.33301 11.6318 2.63148 11.3333 2.99967 11.3333H3.00846H3.01725H3.02604H3.03483H3.04362H3.05241H3.0612H3.06999H3.07878H3.08757H3.09635H3.10514H3.11393H3.12272H3.13151H3.1403H3.14909H3.15788H3.16667H3.17546H3.18424H3.19303H3.20182H3.21061H3.2194H3.22819H3.23698H3.24577H3.25456H3.26335H3.27214H3.28092H3.28971H3.2985H3.30729H3.31608H3.32487H3.33366H3.34245H3.35124H3.36003H3.36882H3.3776H3.38639H3.39518H3.40397H3.41276H3.42155H3.43034H3.43913H3.44792H3.45671H3.46549H3.47428H3.48307H3.49186H3.50065H3.50944H3.51823H3.52702H3.53581H3.5446H3.55339H3.56217H3.57096H3.57975H3.58854H3.59733H3.60612H3.61491H3.6237H3.63249H3.64128H3.65007H3.65885H3.66764H3.67643H3.68522H3.69401H3.7028H3.71159H3.72038H3.72917H3.73796H3.74674H3.75553H3.76432H3.77311H3.7819H3.79069H3.79948H3.80827H3.81706H3.82585H3.83464H3.84342H3.85221H3.861H3.86979H3.87858H3.88737H3.89616H3.90495H3.91374H3.92253H3.93132H3.9401H3.94889H3.95768H3.96647H3.97526H3.98405H3.99284H4.00163H4.01042H4.01921H4.02799H4.03678H4.04557H4.05436H4.06315H4.07194H4.08073H4.08952H4.09831H4.1071H4.11589H4.12467H4.13346H4.14225H4.15104H4.15983H4.16862H4.17741H4.1862H4.19499H4.20378H4.21257H4.22135H4.23014H4.23893H4.24772H4.25651H4.2653H4.27409H4.28288H4.29167H4.30046H4.30924H4.31803H4.32682H4.33561H4.3444H4.35319H4.36198H4.37077H4.37956H4.38835H4.39714H4.40592H4.41471H4.4235H4.43229H4.44108H4.44987H4.45866H4.46745H4.47624H4.48503H4.49382H4.5026H4.51139H4.52018H4.52897H4.53776H4.54655H4.55534H4.56413H4.57292H4.58171H4.59049H4.59928H4.60807H4.61686H4.62565H4.63444H4.64323H4.65202H4.66081H4.6696H4.67839H4.68717H4.69596H4.70475H4.71354H4.72233H4.73112H4.73991H4.7487H4.75749H4.76628H4.77507H4.78385H4.79264H4.80143H4.81022H4.81901H4.8278H4.83659H4.84538H4.85417H4.86296H4.87174H4.88053H4.88932H4.89811H4.9069H4.91569H4.92448H4.93327H4.94206H4.95085H4.95964H4.96842H4.97721H4.986H4.99479H5.00358H5.01237H5.02116H5.02995H5.03874H5.04753H5.05631H5.0651H5.07389H5.08268H5.09147H5.10026H5.10905H5.11784H5.12663H5.13542H5.14421H5.15299H5.16178H5.17057H5.17936H5.18815H5.19694H5.20573H5.21452H5.22331H5.2321H5.24089H5.24967H5.25846H5.26725H5.27604H5.28483H5.29362H5.30241H5.3112H5.31999H5.32878H5.33757H5.34635H5.35514H5.36393H5.37272H5.38151H5.3903H5.39909H5.40788H5.41667H5.42546H5.43424H5.44303H5.45182H5.46061H5.4694H5.47819H5.48698H5.49577H5.50456H5.51335H5.52214H5.53092H5.53971H5.5485H5.55729H5.56608H5.57487H5.58366H5.59245H5.60124H5.61003H5.61882H5.6276H5.63639H5.64518H5.65397H5.66276H5.67155H5.68034H5.68913H5.69792H5.70671H5.71549H5.72428H5.73307H5.74186H5.75065H5.75944H5.76823H5.77702H5.78581H5.7946H5.80339H5.81217H5.82096H5.82975H5.83854H5.84733H5.85612H5.86491H5.8737H5.88249H5.89128H5.90007H5.90885H5.91764H5.92643H5.93522H5.94401H5.9528H5.96159H5.97038H5.97917H5.98796H5.99674H6.00553H6.01432H6.02311H6.0319H6.04069H6.04948H6.05827H6.06706H6.07585H6.08464H6.09342H6.10221H6.111H6.11979H6.12858H6.13737H6.14616H6.15495H6.16374H6.17253H6.18132H6.1901H6.19889H6.20768H6.21647H6.22526H6.23405H6.24284H6.25163H6.26042H6.26921H6.27799H6.28678H6.29557H6.30436H6.31315H6.32194H6.33073H6.33952H6.34831H6.3571H6.36589H6.37467H6.38346H6.39225H6.40104H6.40983H6.41862H6.42741H6.4362H6.44499H6.45378H6.46257H6.47135H6.48014H6.48893H6.49772H6.50651H6.5153H6.52409H6.53288H6.54167H6.55046H6.55925H6.56803H6.57682H6.58561H6.5944H6.60319H6.61198H6.62077H6.62956H6.63835H6.64714H6.65592H6.66471H6.6735H6.68229H6.69108H6.69987H6.70866H6.71745H6.72624H6.73503H6.74382H6.7526H6.76139H6.77018H6.77897H6.78776H6.79655H6.80534H6.81413H6.82292H6.83171H6.8405H6.84928H6.85807H6.86686H6.87565H6.88444H6.89323H6.90202H6.91081H6.9196H6.92839H6.93717H6.94596H6.95475H6.96354H6.97233H6.98112H6.98991H6.9987H7.00749H7.01628H7.02507H7.03385H7.04264H7.05143H7.06022H7.06901H7.0778H7.08659H7.09538H7.10417H7.11296H7.12175H7.13053H7.13932H7.14811H7.1569H7.16569H7.17448H7.18327H7.19206H7.20085H7.20964H7.21842H7.22721H7.236H7.24479H7.25358H7.26237H7.27116H7.27995H7.28874H7.29753H7.30632H7.3151H7.32389H7.33268H7.34147H7.35026H7.35905H7.36784H7.37663H7.38542H7.39421H7.403H7.41178H7.42057H7.42936H7.43815H7.44694H7.45573H7.46452H7.47331H7.4821H7.49089H7.49966V2.38889ZM13.3687 6.24853C13.1172 5.9796 12.7095 5.9796 12.458 6.24853C12.2065 6.51747 12.2065 6.9535 12.458 7.22243L16.3022 11.3336L16.2894 11.3336L16.2726 11.3336L16.2558 11.3336L16.239 11.3335L16.2223 11.3335L16.2055 11.3335L16.1887 11.3335L16.1719 11.3335L16.1552 11.3334L16.1384 11.3334L16.1216 11.3334L16.1048 11.3334L16.088 11.3334L16.0713 11.3333L16.0545 11.3333L16.0377 11.3333L16.0209 11.3333L16.0041 11.3333L15.9874 11.3332L15.9706 11.3332L15.9538 11.3332L15.937 11.3332L15.9202 11.3332L15.9035 11.3331L15.8867 11.3331L15.8699 11.3331L15.8531 11.3331L15.8364 11.3331L15.8196 11.333L15.8028 11.333L15.786 11.333L15.7692 11.333L15.7525 11.333L15.7357 11.3329L15.7189 11.3329L15.7021 11.3329L15.6853 11.3329L15.6686 11.3329L15.6518 11.3328L15.635 11.3328L15.6182 11.3328L15.6014 11.3328L15.5847 11.3328L15.5679 11.3327L15.5511 11.3327L15.5343 11.3327L15.5175 11.3327L15.5008 11.3327L15.484 11.3326L15.4672 11.3326L15.4504 11.3326L15.4337 11.3326L15.4169 11.3326L15.4001 11.3325L15.3833 11.3325L15.3665 11.3325L15.3498 11.3325L15.333 11.3324L15.3162 11.3324L15.2994 11.3324L15.2826 11.3324L15.2659 11.3324L15.2491 11.3323L15.2323 11.3323L15.2155 11.3323L15.1987 11.3323L15.182 11.3323L15.1652 11.3322L15.1484 11.3322L15.1316 11.3322L15.1148 11.3322L15.0981 11.3322L15.0813 11.3321L15.0645 11.3321L15.0477 11.3321L15.031 11.3321L15.0142 11.3321L14.9974 11.332L14.9806 11.332L14.9638 11.332L14.9471 11.332L14.9303 11.332L14.9135 11.3319L14.8967 11.3319L14.8799 11.3319L14.8632 11.3319L14.8464 11.3319L14.8296 11.3318L14.8128 11.3318L14.796 11.3318L14.7793 11.3318L14.7625 11.3318L14.7457 11.3317L14.7289 11.3317L14.7122 11.3317L14.6954 11.3317L14.6786 11.3317L14.6618 11.3316L14.645 11.3316L14.6283 11.3316L14.6115 11.3316L14.5947 11.3316L14.5779 11.3315L14.5611 11.3315L14.5444 11.3315L14.5276 11.3315L14.5108 11.3315L14.494 11.3314L14.4772 11.3314L14.4605 11.3314L14.4437 11.3314L14.4269 11.3314L14.4101 11.3313L14.3933 11.3313L14.3766 11.3313L14.3598 11.3313L14.343 11.3313L14.3262 11.3312L14.3095 11.3312L14.2927 11.3312L14.2759 11.3312L14.2591 11.3312L14.2423 11.3311L14.2256 11.3311L14.2088 11.3311L14.192 11.3311L14.1752 11.3311L14.1584 11.331L14.1417 11.331L14.1249 11.331L14.1081 11.331L14.0913 11.331L14.0745 11.3309L14.0578 11.3309L14.041 11.3309L14.0242 11.3309L14.0074 11.3309L13.9906 11.3308L13.9739 11.3308L13.9571 11.3308L13.9403 11.3308L13.9235 11.3308L13.9068 11.3307L13.89 11.3307L13.8732 11.3307L13.8564 11.3307L13.8396 11.3307L13.8229 11.3306L13.8061 11.3306L13.7893 11.3306L13.7725 11.3306L13.7557 11.3306L13.739 11.3305L13.7222 11.3305L13.7054 11.3305L13.6886 11.3305L13.6718 11.3305L13.6551 11.3304L13.6383 11.3304L13.6215 11.3304L13.6047 11.3304L13.5879 11.3304L13.5712 11.3303L13.5544 11.3303L13.5376 11.3303L13.5208 11.3303L13.5041 11.3303L13.4873 11.3302L13.4705 11.3302L13.4537 11.3302L13.4369 11.3302L13.4202 11.3302L13.4034 11.3301L13.3866 11.3301L13.3698 11.3301L13.353 11.3301L13.3363 11.33L13.3195 11.33L13.3027 11.33L13.2859 11.33L13.2691 11.33L13.2524 11.3299L13.2356 11.3299L13.2188 11.3299L13.202 11.3299L13.1853 11.3299L13.1685 11.3298L13.1517 11.3298L13.1349 11.3298L13.1181 11.3298L13.1014 11.3298L13.0846 11.3297L13.0678 11.3297L13.051 11.3297L13.0342 11.3297L13.0175 11.3297L13.0007 11.3296L12.9839 11.3296L12.9671 11.3296L12.9503 11.3296L12.9336 11.3296L12.9168 11.3295L12.9 11.3295L12.8832 11.3295L12.8664 11.3295L12.8497 11.3295L12.8329 11.3294L12.8161 11.3294L12.7993 11.3294L12.7826 11.3294L12.7658 11.3294L12.749 11.3293L12.7322 11.3293L12.7154 11.3293L12.6987 11.3293L12.6819 11.3293L12.6651 11.3292L12.6483 11.3292L12.6315 11.3292L12.6148 11.3292L12.598 11.3292L12.5812 11.3291L12.5644 11.3291L12.5476 11.3291L12.5309 11.3291L12.5141 11.3291L12.4973 11.329L12.4805 11.329L12.4637 11.329L12.447 11.329L12.4302 11.329L12.4134 11.3289L12.3966 11.3289L12.3799 11.3289L12.3631 11.3289L12.3463 11.3289L12.3295 11.3288L12.3127 11.3288L12.296 11.3288L12.2792 11.3288L12.2624 11.3288L12.2456 11.3287L12.2288 11.3287L12.2121 11.3287L12.1953 11.3287L12.1785 11.3287L12.1617 11.3286L12.1449 11.3286L12.1282 11.3286L12.1114 11.3286L12.0946 11.3286L12.0778 11.3285L12.0611 11.3285L12.0443 11.3285L12.0275 11.3285L12.0107 11.3285L11.9939 11.3284L11.9772 11.3284L11.9604 11.3284L11.9436 11.3284L11.9268 11.3284L11.91 11.3283L11.8933 11.3283L11.8765 11.3283L11.8597 11.3283L11.8429 11.3283L11.8261 11.3282L11.8094 11.3282L11.7926 11.3282L11.7758 11.3282L11.759 11.3282L11.7422 11.3281L11.7255 11.3281L11.7087 11.3281L11.6919 11.3281L11.6751 11.3281L11.6583 11.328L11.6416 11.328L11.6248 11.328L11.608 11.328L11.5912 11.328L11.5745 11.3279L11.5577 11.3279L11.5409 11.3279L11.5241 11.3279L11.5073 11.3279L11.4906 11.3278L11.4738 11.3278L11.457 11.3278L11.4402 11.3278L11.4234 11.3278L11.4067 11.3277L11.3899 11.3277L11.3731 11.3277L11.3563 11.3277L11.3395 11.3277L11.3228 11.3276L11.306 11.3276L11.2892 11.3276L11.2724 11.3276L11.2557 11.3275L11.2389 11.3275L11.2221 11.3275L11.2053 11.3275L11.1885 11.3275L11.1718 11.3274L11.155 11.3274L11.1382 11.3274L11.1214 11.3274L11.1046 11.3274L11.0879 11.3273L11.0711 11.3273L11.0543 11.3273L11.0375 11.3273L11.0207 11.3273L11.004 11.3272L10.9872 11.3272L10.9704 11.3272L10.9536 11.3272L10.9368 11.3272L10.9201 11.3271L10.9033 11.3271L10.8865 11.3271L10.8697 11.3271L10.853 11.3271L10.8362 11.327L10.8194 11.327L10.8026 11.327L10.7858 11.327L10.7691 11.327L10.7523 11.3269L10.7355 11.3269L10.7187 11.3269L10.7019 11.3269L10.6852 11.3269L10.6684 11.3268L10.6516 11.3268L10.6348 11.3268L10.618 11.3268L10.6013 11.3268L10.5845 11.3267L10.5677 11.3267L10.5509 11.3267L10.5341 11.3267L10.5174 11.3267L10.5006 11.3266L10.4838 11.3266L10.467 11.3266L10.4503 11.3266L10.4335 11.3266L10.4167 11.3265L10.3999 11.3265L10.3831 11.3265L10.3664 11.3265L10.3496 11.3265L10.3328 11.3264L10.316 11.3264L10.2992 11.3264L10.2825 11.3264L10.2657 11.3264L10.2489 11.3263L10.2321 11.3263L10.2153 11.3263L10.1986 11.3263L10.1818 11.3263L10.165 11.3262L10.1482 11.3262L10.1315 11.3262L10.1147 11.3262L10.0979 11.3262L10.0811 11.3261L10.0643 11.3261L10.0476 11.3261L10.0308 11.3261L10.014 11.3261L9.99722 11.326L9.98044 11.326L9.96366 11.326L9.94688 11.326L9.9301 11.326L9.91332 11.3259L9.89654 11.3259L9.87977 11.3259L9.86299 11.3259L9.84621 11.3259L9.82943 11.3258L9.81265 11.3258L9.79587 11.3258L9.77909 11.3258L9.76231 11.3258L9.74553 11.3257L9.72875 11.3257L9.71197 11.3257L9.69519 11.3257L9.67841 11.3257L9.66163 11.3256L9.64486 11.3256L9.62808 11.3256L9.6113 11.3256L9.59452 11.3256L9.57774 11.3255L9.56096 11.3255L9.54418 11.3255L9.5274 11.3255L9.51062 11.3255L9.49384 11.3254L9.47706 11.3254L9.46029 11.3254L9.44351 11.3254L9.42673 11.3254L9.40995 11.3253L9.39317 11.3253L9.37639 11.3253L9.35961 11.3253L9.34283 11.3253L9.32605 11.3252L9.30927 11.3252L9.29249 11.3252L9.27572 11.3252L9.25894 11.3252L9.24216 11.3251L9.22538 11.3251L9.2086 11.3251L9.19182 11.3251L9.17504 11.325L9.15826 11.325L9.14148 11.325L9.1247 11.325L9.10792 11.325L9.09115 11.3249L9.07437 11.3249L9.05759 11.3249L9.04081 11.3249L9.02403 11.3249L9.00725 11.3248L8.99047 11.3248L8.97369 11.3248L8.95691 11.3248L8.94013 11.3248L8.92335 11.3247L8.90658 11.3247L8.8898 11.3247L8.87302 11.3247L8.85624 11.3247L8.83946 11.3246L8.82268 11.3246L8.8059 11.3246L8.78912 11.3246L8.77234 11.3246L8.75556 11.3245L8.73878 11.3245L8.722 11.3245L8.70523 11.3245L8.68845 11.3245L8.67167 11.3244L8.65489 11.3244L8.63811 11.3244L8.62133 11.3244L8.60455 11.3244L8.58777 11.3243L8.57099 11.3243L8.55421 11.3243L8.53743 11.3243L8.52066 11.3243L8.50388 11.3242L8.4871 11.3242L8.47032 11.3242L8.45354 11.3242L8.43676 11.3242L8.41998 11.3241L8.4032 11.3241L8.38642 11.3241L8.36964 11.3241L8.35286 11.3241L8.33608 11.324L8.31931 11.324L8.30253 11.324L8.28575 11.324L8.26897 11.324L8.25219 11.3239L8.23541 11.3239L8.21863 11.3239L8.20185 11.3239L8.18507 11.3239L8.16829 11.3238L8.15151 11.3238L8.13474 11.3238L8.11796 11.3238L8.10118 11.3238L8.0844 11.3237L8.06762 11.3237L8.05084 11.3237L8.03406 11.3237L8.01728 11.3237L8.0005 11.3236L7.99885 12.657L8.01563 12.657L8.03241 12.657L8.04919 12.657L8.06597 12.6571L8.08274 12.6571L8.09952 12.6571L8.1163 12.6571L8.13308 12.6571L8.14986 12.6572L8.16664 12.6572L8.18342 12.6572L8.2002 12.6572L8.21698 12.6572L8.23376 12.6573L8.25054 12.6573L8.26731 12.6573L8.28409 12.6573L8.30087 12.6573L8.31765 12.6574L8.33443 12.6574L8.35121 12.6574L8.36799 12.6574L8.38477 12.6574L8.40155 12.6575L8.41833 12.6575L8.43511 12.6575L8.45189 12.6575L8.46866 12.6575L8.48544 12.6576L8.50222 12.6576L8.519 12.6576L8.53578 12.6576L8.55256 12.6576L8.56934 12.6577L8.58612 12.6577L8.6029 12.6577L8.61968 12.6577L8.63646 12.6577L8.65323 12.6578L8.67001 12.6578L8.68679 12.6578L8.70357 12.6578L8.72035 12.6578L8.73713 12.6579L8.75391 12.6579L8.77069 12.6579L8.78747 12.6579L8.80425 12.6579L8.82103 12.658L8.83781 12.658L8.85458 12.658L8.87136 12.658L8.88814 12.658L8.90492 12.6581L8.9217 12.6581L8.93848 12.6581L8.95526 12.6581L8.97204 12.6581L8.98882 12.6582L9.0056 12.6582L9.02238 12.6582L9.03915 12.6582L9.05593 12.6582L9.07271 12.6583L9.08949 12.6583L9.10627 12.6583L9.12305 12.6583L9.13983 12.6583L9.15661 12.6584L9.17339 12.6584L9.19017 12.6584L9.20695 12.6584L9.22373 12.6584L9.2405 12.6585L9.25728 12.6585L9.27406 12.6585L9.29084 12.6585L9.30762 12.6585L9.3244 12.6586L9.34118 12.6586L9.35796 12.6586L9.37474 12.6586L9.39152 12.6586L9.4083 12.6587L9.42507 12.6587L9.44185 12.6587L9.45863 12.6587L9.47541 12.6587L9.49219 12.6588L9.50897 12.6588L9.52575 12.6588L9.54253 12.6588L9.55931 12.6588L9.57609 12.6589L9.59287 12.6589L9.60964 12.6589L9.62642 12.6589L9.6432 12.6589L9.65998 12.659L9.67676 12.659L9.69354 12.659L9.71032 12.659L9.7271 12.659L9.74388 12.6591L9.76066 12.6591L9.77744 12.6591L9.79421 12.6591L9.81099 12.6591L9.82777 12.6592L9.84455 12.6592L9.86133 12.6592L9.87811 12.6592L9.89489 12.6592L9.91167 12.6593L9.92845 12.6593L9.94523 12.6593L9.96201 12.6593L9.97879 12.6594L9.99556 12.6594L10.0123 12.6594L10.0291 12.6594L10.0459 12.6594L10.0627 12.6595L10.0795 12.6595L10.0962 12.6595L10.113 12.6595L10.1298 12.6595L10.1466 12.6596L10.1634 12.6596L10.1801 12.6596L10.1969 12.6596L10.2137 12.6596L10.2305 12.6597L10.2473 12.6597L10.264 12.6597L10.2808 12.6597L10.2976 12.6597L10.3144 12.6598L10.3311 12.6598L10.3479 12.6598L10.3647 12.6598L10.3815 12.6598L10.3983 12.6599L10.415 12.6599L10.4318 12.6599L10.4486 12.6599L10.4654 12.6599L10.4822 12.66L10.4989 12.66L10.5157 12.66L10.5325 12.66L10.5493 12.66L10.5661 12.6601L10.5828 12.6601L10.5996 12.6601L10.6164 12.6601L10.6332 12.6601L10.65 12.6602L10.6667 12.6602L10.6835 12.6602L10.7003 12.6602L10.7171 12.6602L10.7338 12.6603L10.7506 12.6603L10.7674 12.6603L10.7842 12.6603L10.801 12.6603L10.8177 12.6604L10.8345 12.6604L10.8513 12.6604L10.8681 12.6604L10.8849 12.6604L10.9016 12.6605L10.9184 12.6605L10.9352 12.6605L10.952 12.6605L10.9688 12.6605L10.9855 12.6606L11.0023 12.6606L11.0191 12.6606L11.0359 12.6606L11.0526 12.6606L11.0694 12.6607L11.0862 12.6607L11.103 12.6607L11.1198 12.6607L11.1365 12.6607L11.1533 12.6608L11.1701 12.6608L11.1869 12.6608L11.2037 12.6608L11.2204 12.6608L11.2372 12.6609L11.254 12.6609L11.2708 12.6609L11.2876 12.6609L11.3043 12.6609L11.3211 12.661L11.3379 12.661L11.3547 12.661L11.3715 12.661L11.3882 12.661L11.405 12.6611L11.4218 12.6611L11.4386 12.6611L11.4553 12.6611L11.4721 12.6611L11.4889 12.6612L11.5057 12.6612L11.5225 12.6612L11.5392 12.6612L11.556 12.6612L11.5728 12.6613L11.5896 12.6613L11.6064 12.6613L11.6231 12.6613L11.6399 12.6613L11.6567 12.6614L11.6735 12.6614L11.6903 12.6614L11.707 12.6614L11.7238 12.6614L11.7406 12.6615L11.7574 12.6615L11.7742 12.6615L11.7909 12.6615L11.8077 12.6615L11.8245 12.6616L11.8413 12.6616L11.858 12.6616L11.8748 12.6616L11.8916 12.6616L11.9084 12.6617L11.9252 12.6617L11.9419 12.6617L11.9587 12.6617L11.9755 12.6617L11.9923 12.6618L12.0091 12.6618L12.0258 12.6618L12.0426 12.6618L12.0594 12.6618L12.0762 12.6619L12.093 12.6619L12.1097 12.6619L12.1265 12.6619L12.1433 12.662L12.1601 12.662L12.1768 12.662L12.1936 12.662L12.2104 12.662L12.2272 12.6621L12.244 12.6621L12.2607 12.6621L12.2775 12.6621L12.2943 12.6621L12.3111 12.6622L12.3279 12.6622L12.3446 12.6622L12.3614 12.6622L12.3782 12.6622L12.395 12.6623L12.4118 12.6623L12.4285 12.6623L12.4453 12.6623L12.4621 12.6623L12.4789 12.6624L12.4957 12.6624L12.5124 12.6624L12.5292 12.6624L12.546 12.6624L12.5628 12.6625L12.5795 12.6625L12.5963 12.6625L12.6131 12.6625L12.6299 12.6625L12.6467 12.6626L12.6634 12.6626L12.6802 12.6626L12.697 12.6626L12.7138 12.6626L12.7306 12.6627L12.7473 12.6627L12.7641 12.6627L12.7809 12.6627L12.7977 12.6627L12.8145 12.6628L12.8312 12.6628L12.848 12.6628L12.8648 12.6628L12.8816 12.6628L12.8984 12.6629L12.9151 12.6629L12.9319 12.6629L12.9487 12.6629L12.9655 12.6629L12.9822 12.663L12.999 12.663L13.0158 12.663L13.0326 12.663L13.0494 12.663L13.0661 12.6631L13.0829 12.6631L13.0997 12.6631L13.1165 12.6631L13.1333 12.6631L13.15 12.6632L13.1668 12.6632L13.1836 12.6632L13.2004 12.6632L13.2172 12.6632L13.2339 12.6633L13.2507 12.6633L13.2675 12.6633L13.2843 12.6633L13.3011 12.6633L13.3178 12.6634L13.3346 12.6634L13.3514 12.6634L13.3682 12.6634L13.3849 12.6634L13.4017 12.6635L13.4185 12.6635L13.4353 12.6635L13.4521 12.6635L13.4688 12.6635L13.4856 12.6636L13.5024 12.6636L13.5192 12.6636L13.536 12.6636L13.5527 12.6636L13.5695 12.6637L13.5863 12.6637L13.6031 12.6637L13.6199 12.6637L13.6366 12.6637L13.6534 12.6638L13.6702 12.6638L13.687 12.6638L13.7038 12.6638L13.7205 12.6638L13.7373 12.6639L13.7541 12.6639L13.7709 12.6639L13.7876 12.6639L13.8044 12.6639L13.8212 12.664L13.838 12.664L13.8548 12.664L13.8715 12.664L13.8883 12.664L13.9051 12.6641L13.9219 12.6641L13.9387 12.6641L13.9554 12.6641L13.9722 12.6641L13.989 12.6642L14.0058 12.6642L14.0226 12.6642L14.0393 12.6642L14.0561 12.6642L14.0729 12.6643L14.0897 12.6643L14.1064 12.6643L14.1232 12.6643L14.14 12.6644L14.1568 12.6644L14.1736 12.6644L14.1903 12.6644L14.2071 12.6644L14.2239 12.6645L14.2407 12.6645L14.2575 12.6645L14.2742 12.6645L14.291 12.6645L14.3078 12.6646L14.3246 12.6646L14.3414 12.6646L14.3581 12.6646L14.3749 12.6646L14.3917 12.6647L14.4085 12.6647L14.4253 12.6647L14.442 12.6647L14.4588 12.6647L14.4756 12.6648L14.4924 12.6648L14.5091 12.6648L14.5259 12.6648L14.5427 12.6648L14.5595 12.6649L14.5763 12.6649L14.593 12.6649L14.6098 12.6649L14.6266 12.6649L14.6434 12.665L14.6602 12.665L14.6769 12.665L14.6937 12.665L14.7105 12.665L14.7273 12.6651L14.7441 12.6651L14.7608 12.6651L14.7776 12.6651L14.7944 12.6651L14.8112 12.6652L14.828 12.6652L14.8447 12.6652L14.8615 12.6652L14.8783 12.6652L14.8951 12.6653L14.9118 12.6653L14.9286 12.6653L14.9454 12.6653L14.9622 12.6653L14.979 12.6654L14.9957 12.6654L15.0125 12.6654L15.0293 12.6654L15.0461 12.6654L15.0629 12.6655L15.0796 12.6655L15.0964 12.6655L15.1132 12.6655L15.13 12.6655L15.1468 12.6656L15.1635 12.6656L15.1803 12.6656L15.1971 12.6656L15.2139 12.6656L15.2306 12.6657L15.2474 12.6657L15.2642 12.6657L15.281 12.6657L15.2978 12.6657L15.3145 12.6658L15.3313 12.6658L15.3481 12.6658L15.3649 12.6658L15.3817 12.6658L15.3984 12.6659L15.4152 12.6659L15.432 12.6659L15.4488 12.6659L15.4656 12.6659L15.4823 12.666L15.4991 12.666L15.5159 12.666L15.5327 12.666L15.5495 12.666L15.5662 12.6661L15.583 12.6661L15.5998 12.6661L15.6166 12.6661L15.6333 12.6661L15.6501 12.6662L15.6669 12.6662L15.6837 12.6662L15.7005 12.6662L15.7172 12.6662L15.734 12.6663L15.7508 12.6663L15.7676 12.6663L15.7844 12.6663L15.8011 12.6663L15.8179 12.6664L15.8347 12.6664L15.8515 12.6664L15.8683 12.6664L15.885 12.6664L15.9018 12.6665L15.9186 12.6665L15.9354 12.6665L15.9522 12.6665L15.9689 12.6665L15.9857 12.6666L16.0025 12.6666L16.0193 12.6666L16.036 12.6666L16.0528 12.6666L16.0696 12.6667L16.0864 12.6667L16.1032 12.6667L16.1199 12.6667L16.1367 12.6667L16.1535 12.6668L16.1703 12.6668L16.1871 12.6668L16.2038 12.6668L16.2206 12.6669L16.2374 12.6669L16.2542 12.6669L16.271 12.6669L16.2836 12.6669L12.458 16.7581C12.2065 17.0271 12.2065 17.4631 12.458 17.732C12.7095 18.001 13.1172 18.001 13.3687 17.732L18.2822 12.4772C18.5337 12.2083 18.5337 11.7723 18.2822 11.5033L13.3687 6.24853Z`,fill:`white`})})),sX=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M18.2139 2.44646L12 3.99992H5.4375C4.64359 3.99992 4 4.64352 4 5.43742V18.5624C4 19.3563 4.64359 19.9999 5.4375 19.9999H12L18.2139 21.5534C19.1211 21.7802 20 21.094 20 20.1588V3.84104C20 2.90584 19.1211 2.21964 18.2139 2.44646ZM12 17.9999V5.99992H6V17.9999H12Z`,fill:`white`})})),cX={menuIcon:`_menuIcon_t5z8t_8`,userButton:`_userButton_t5z8t_15`},lX=({preventNavigation:e,isAuthenticated:t,isPasswordlessUser:n,userId:r,displayName:i,avatarUrl:a,onAction:o})=>{let{t:s}=Ni(),c=Pn(),l=(0,M.useMemo)(()=>{let r=[];return t&&(r.push({key:`user`,icon:iX,label:i,dataTestid:`usermenu_user`}),r.push({key:`settings`,icon:aX,label:s(`common.settings`)}),n&&!e&&r.push({key:`login`,label:s(`action.sign_in`),icon:oX,dataTestid:`usermenu_login`}),!n&&!e&&r.push({key:`logout`,label:s(`action.sign_out`),icon:sX,dataTestid:`usermenu_logout`})),r},[t,n,i,e,s]),[u,d]=(0,M.useState)(!1);return t?(0,W.jsx)(hA,{title:s(`a11y.user_menu`),showTitle:!1,align:`end`,open:u,onOpenChange:d,trigger:(0,W.jsx)(`button`,{"aria-label":s(`common.profile`),className:cX.userButton,"data-testid":`usermenu_open`,children:t&&(!n||a)?(0,W.jsx)(ue,{id:r,name:i,size:Mr.SM,src:a}):(0,W.jsx)(iX,{})}),children:l.map(({key:e,icon:t,label:n,dataTestid:r})=>(0,W.jsx)(yA,{Icon:t,label:n,"data-testid":r,onSelect:()=>o(e)},e))}):(0,W.jsx)(Ur,{to:{pathname:`/login`},state:{from:c},children:s(`log_in`)})},uX=({preventNavigation:e=!1})=>{let t=Pn(),n=ri(),{client:r,logout:i,authenticated:a,passwordlessUser:o}=ci(),{displayName:s,avatarUrl:c}=xI(r),[l,u]=(0,M.useState)(!1),d=(0,M.useCallback)(()=>u(!1),[u]),[f,p]=(0,M.useState)(nX),m=(0,M.useCallback)(e=>{switch(e){case`user`:p(`profile`),u(!0);break;case`settings`:p(`audio`),u(!0);break;case`logout`:i?.();break;case`login`:n(`/login`,{state:{from:t}})?.catch(e=>h.error(`Failed to navigate to login`,e));break}},[n,t,i,u]),g=r?.getUserIdLocalpart()??``;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(lX,{preventNavigation:e,isAuthenticated:a,isPasswordlessUser:o,avatarUrl:c,onAction:m,userId:r?.getUserId()??``,displayName:s||(g?g.replace(`@`,``):``)}),r&&(0,W.jsx)(rX,{client:r,open:l,onDismiss:d,tab:f,onTabChange:p})]})},dX=e=>{let[t,n]=(0,M.useState)(void 0),[r,i]=(0,M.useState)(void 0),a=(0,M.useRef)(void 0);return a.current||=cr({baseUrl:ze.defaultHomeserverUrl()}),(0,M.useEffect)(()=>{At||a.current.registerRequest({}).catch(e=>{n(e.data?.params[`m.login.terms`]?.policies?.privacy_policy?.en?.url),i(e.data?.params[`m.login.recaptcha`]?.public_key)})},[]),{privacyPolicyUrl:t,recaptchaKey:r,register:(0,M.useCallback)(async(t,n,r,i,o)=>{let s=new li({matrixClient:a.current,doRequest:async e=>a.current.registerRequest({username:t,password:n,auth:e||void 0}),stateUpdated:(e,t)=>{if(t.error)throw Error(t.error);e===`m.login.terms`?s.submitAuthDict({type:`m.login.terms`}).catch(e=>{h.error(e)}):e===`m.login.recaptcha`&&s.submitAuthDict({type:`m.login.recaptcha`,response:i}).catch(e=>{h.error(e)})},requestEmailToken:async()=>Promise.resolve({sid:`dummy`})}),{user_id:c,access_token:l,device_id:u}=await s.attemptAuth();await e?.logout(!0);let d=await Nn({baseUrl:ze.defaultHomeserverUrl(),accessToken:l,userId:c,deviceId:u},!1);await d.setDisplayName(r);let f={user_id:c,device_id:u,access_token:l,passwordlessUser:o};o&&(f.tempPassword=n);let p=d.getUser(d.getUserId());return p.setRawDisplayName(r),p.setDisplayName(r),[d,f]},[e])}},fX={buttons:`_buttons_1arp2_8`},pX=({onJoin:e,open:t,onDismiss:n})=>{let{t:r}=Ni();return(0,W.jsxs)(or,{title:r(`join_existing_call_modal.title`),open:t,onDismiss:n,children:[(0,W.jsx)(`p`,{children:r(`join_existing_call_modal.text`)}),(0,W.jsxs)(AI,{rightAlign:!0,className:fX.buttons,children:[(0,W.jsx)(Pi,{onClick:n,children:r(`action.no`)}),(0,W.jsx)(Pi,{onClick:e,"data-testid":`home_joinExistingRoom`,children:r(`join_existing_call_modal.join_button`)})]})]})},mX=`https://www.recaptcha.net/recaptcha/api.js?onload=mxOnRecaptchaLoaded&render=explicit`;function hX(e){let{t}=Ni(),[n]=(0,M.useState)(()=>m(16)),r=(0,M.useRef)(void 0);return(0,M.useEffect)(()=>{if(!e)return;let t=()=>{document.getElementById(n)&&window.grecaptcha.render(n,{sitekey:e,size:`invisible`,callback:e=>r.current?.resolve(e),"error-callback":()=>r.current?.reject(Error())})};if(typeof window.grecaptcha?.render==`function`)t();else if(window.mxOnRecaptchaLoaded=t,!document.querySelector(`script[src="${mX}"]`)){let e=document.createElement(`script`);e.src=mX,e.async=!0,document.body.appendChild(e)}},[n,e]),{execute:(0,M.useCallback)(async()=>e?window.grecaptcha?new Promise((e,n)=>{let i=new MutationObserver(e=>{for(let r of e)if(r.target?.style?.visibility!==`visible`){n(kI(`recaptcha_dismissed`,t)),i.disconnect();return}});r.current={resolve:t=>{e(t),i.disconnect()},reject:e=>{n(e),i.disconnect()}},window.grecaptcha.execute().then(()=>{},e=>{h.error(`Recaptcha execution failed`,e)});let a=document.querySelector(`iframe[src*="recaptcha/api2/bframe"]`);a?.parentNode?.parentNode&&i.observe(a?.parentNode?.parentNode,{attributes:!0})}):(h.log(`Recaptcha not loaded`),Promise.reject(kI(`recaptcha_not_loaded`,t))):Promise.resolve(``),[e,t]),reset:(0,M.useCallback)(()=>{window.grecaptcha?.reset()},[]),recaptchaId:n}}var gX={form:`_form_jcuzc_8`},_X=({ref:e,children:t,className:n,onSubmit:r})=>(0,W.jsx)(`form`,{onSubmit:r,className:(0,U.default)(gX.form,n),ref:e,children:t});_X.displayName=`Form`;var vX={footer:`_footer_106jg_8`,mobileLoginLink:`_mobileLoginLink_106jg_19`,form:`_form_106jg_24`,notice:`_notice_106jg_40`},yX={container:`_container_dwllg_8`,main:`_main_dwllg_15`,logo:`_logo_dwllg_23`,headline:`_headline_dwllg_28`},bX=e=>{e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296},xX=class{constructor(e){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;let{length:t,separator:n,dictionaries:r,style:i,seed:a}=e;this.dictionaries=r,this.separator=n,this.length=t,this.style=i,this.seed=a}generate(){if(!this.dictionaries)throw Error(`Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object`);if(this.length<=0)throw Error(`Invalid length provided`);if(this.length>this.dictionaries.length)throw Error(`The length cannot be bigger than the number of dictionaries.\nLength provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((t,n)=>{let r;e?(r=(e=>{if(typeof e==`string`){let t=e.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,1);return bX(Math.floor(Number(t)))}return bX(e)})(e),e=4294967296*r):r=Math.random();let i=n[Math.floor(r*n.length)]||``;if(this.style===`lowerCase`)i=i.toLowerCase();else if(this.style===`capital`){let[e,...t]=i.split(``);i=e.toUpperCase()+t.join(``)}else this.style===`upperCase`&&(i=i.toUpperCase());return t?`${t}${this.separator}${i}`:`${i}`},``)}},SX={separator:`_`,dictionaries:[]},CX=e=>{let t=[...e&&e.dictionaries||SX.dictionaries],n={...SX,...e,length:e&&e.length||t.length,dictionaries:t};if(!e||!e.dictionaries||!e.dictionaries.length)throw Error(`A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide`);return new xX(n).generate()},wX=`able.above.absent.absolute.abstract.abundant.academic.acceptable.accepted.accessible.accurate.accused.active.actual.acute.added.additional.adequate.adjacent.administrative.adorable.advanced.adverse.advisory.aesthetic.afraid.aggregate.aggressive.agreeable.agreed.agricultural.alert.alive.alleged.allied.alone.alright.alternative.amateur.amazing.ambitious.amused.ancient.angry.annoyed.annual.anonymous.anxious.appalling.apparent.applicable.appropriate.arbitrary.architectural.armed.arrogant.artificial.artistic.ashamed.asleep.assistant.associated.atomic.attractive.automatic.autonomous.available.average.awake.aware.awful.awkward.back.bad.balanced.bare.basic.beautiful.beneficial.better.bewildered.big.binding.biological.bitter.bizarre.blank.blind.blonde.bloody.blushing.boiling.bold.bored.boring.bottom.brainy.brave.breakable.breezy.brief.bright.brilliant.broad.broken.bumpy.burning.busy.calm.capable.capitalist.careful.casual.causal.cautious.central.certain.changing.characteristic.charming.cheap.cheerful.chemical.chief.chilly.chosen.christian.chronic.chubby.circular.civic.civil.civilian.classic.classical.clean.clear.clever.clinical.close.closed.cloudy.clumsy.coastal.cognitive.coherent.cold.collective.colonial.colorful.colossal.coloured.colourful.combative.combined.comfortable.coming.commercial.common.communist.compact.comparable.comparative.compatible.competent.competitive.complete.complex.complicated.comprehensive.compulsory.conceptual.concerned.concrete.condemned.confident.confidential.confused.conscious.conservation.conservative.considerable.consistent.constant.constitutional.contemporary.content.continental.continued.continuing.continuous.controlled.controversial.convenient.conventional.convinced.convincing.cooing.cool.cooperative.corporate.correct.corresponding.costly.courageous.crazy.creative.creepy.criminal.critical.crooked.crowded.crucial.crude.cruel.cuddly.cultural.curious.curly.current.curved.cute.daily.damaged.damp.dangerous.dark.dead.deaf.deafening.dear.decent.decisive.deep.defeated.defensive.defiant.definite.deliberate.delicate.delicious.delighted.delightful.democratic.dependent.depressed.desirable.desperate.detailed.determined.developed.developing.devoted.different.difficult.digital.diplomatic.direct.dirty.disabled.disappointed.disastrous.disciplinary.disgusted.distant.distinct.distinctive.distinguished.disturbed.disturbing.diverse.divine.dizzy.domestic.dominant.double.doubtful.drab.dramatic.dreadful.driving.drunk.dry.dual.due.dull.dusty.dutch.dying.dynamic.eager.early.eastern.easy.economic.educational.eerie.effective.efficient.elaborate.elated.elderly.eldest.electoral.electric.electrical.electronic.elegant.eligible.embarrassed.embarrassing.emotional.empirical.empty.enchanting.encouraging.endless.energetic.enormous.enthusiastic.entire.entitled.envious.environmental.equal.equivalent.essential.established.estimated.ethical.ethnic.eventual.everyday.evident.evil.evolutionary.exact.excellent.exceptional.excess.excessive.excited.exciting.exclusive.existing.exotic.expected.expensive.experienced.experimental.explicit.extended.extensive.external.extra.extraordinary.extreme.exuberant.faint.fair.faithful.familiar.famous.fancy.fantastic.far.fascinating.fashionable.fast.fat.fatal.favourable.favourite.federal.fellow.female.feminist.few.fierce.filthy.final.financial.fine.firm.fiscal.fit.fixed.flaky.flat.flexible.fluffy.fluttering.flying.following.fond.foolish.foreign.formal.formidable.forthcoming.fortunate.forward.fragile.frail.frantic.free.frequent.fresh.friendly.frightened.front.frozen.full.fun.functional.fundamental.funny.furious.future.fuzzy.gastric.gay.general.generous.genetic.gentle.genuine.geographical.giant.gigantic.given.glad.glamorous.gleaming.global.glorious.golden.good.gorgeous.gothic.governing.graceful.gradual.grand.grateful.greasy.great.grieving.grim.gross.grotesque.growing.grubby.grumpy.guilty.handicapped.handsome.happy.hard.harsh.head.healthy.heavy.helpful.helpless.hidden.high.hilarious.hissing.historic.historical.hollow.holy.homeless.homely.hon.honest.horizontal.horrible.hostile.hot.huge.human.hungry.hurt.hushed.husky.icy.ideal.identical.ideological.ill.illegal.imaginative.immediate.immense.imperial.implicit.important.impossible.impressed.impressive.improved.inadequate.inappropriate.inc.inclined.increased.increasing.incredible.independent.indirect.individual.industrial.inevitable.influential.informal.inherent.initial.injured.inland.inner.innocent.innovative.inquisitive.instant.institutional.insufficient.intact.integral.integrated.intellectual.intelligent.intense.intensive.interested.interesting.interim.interior.intermediate.internal.international.intimate.invisible.involved.irrelevant.isolated.itchy.jealous.jittery.joint.jolly.joyous.judicial.juicy.junior.just.keen.key.kind.known.labour.large.late.latin.lazy.leading.left.legal.legislative.legitimate.lengthy.lesser.level.lexical.liable.liberal.light.like.likely.limited.linear.linguistic.liquid.literary.little.live.lively.living.local.logical.lonely.long.loose.lost.loud.lovely.low.loyal.ltd.lucky.mad.magic.magnetic.magnificent.main.major.male.mammoth.managerial.managing.manual.many.marginal.marine.marked.married.marvellous.marxist.mass.massive.mathematical.mature.maximum.mean.meaningful.mechanical.medical.medieval.melodic.melted.mental.mere.metropolitan.mid.middle.mighty.mild.military.miniature.minimal.minimum.ministerial.minor.miserable.misleading.missing.misty.mixed.moaning.mobile.moderate.modern.modest.molecular.monetary.monthly.moral.motionless.muddy.multiple.mushy.musical.mute.mutual.mysterious.naked.narrow.nasty.national.native.natural.naughty.naval.near.nearby.neat.necessary.negative.neighbouring.nervous.net.neutral.new.nice.noble.noisy.normal.northern.nosy.notable.novel.nuclear.numerous.nursing.nutritious.nutty.obedient.objective.obliged.obnoxious.obvious.occasional.occupational.odd.official.ok.okay.old.olympic.only.open.operational.opposite.optimistic.oral.ordinary.organic.organisational.original.orthodox.other.outdoor.outer.outrageous.outside.outstanding.overall.overseas.overwhelming.painful.pale.panicky.parallel.parental.parliamentary.partial.particular.passing.passive.past.patient.payable.peaceful.peculiar.perfect.permanent.persistent.personal.petite.philosophical.physical.plain.planned.plastic.pleasant.pleased.poised.polite.political.poor.popular.positive.possible.potential.powerful.practical.precious.precise.preferred.pregnant.preliminary.premier.prepared.present.presidential.pretty.previous.prickly.primary.prime.primitive.principal.printed.prior.private.probable.productive.professional.profitable.profound.progressive.prominent.promising.proper.proposed.prospective.protective.protestant.proud.provincial.psychiatric.psychological.public.puny.pure.purring.puzzled.quaint.qualified.quarrelsome.querulous.quick.quickest.quiet.quintessential.quixotic.racial.radical.rainy.random.rapid.rare.raspy.rational.ratty.raw.ready.real.realistic.rear.reasonable.recent.reduced.redundant.regional.registered.regular.regulatory.related.relative.relaxed.relevant.reliable.relieved.religious.reluctant.remaining.remarkable.remote.renewed.representative.repulsive.required.resident.residential.resonant.respectable.respective.responsible.resulting.retail.retired.revolutionary.rich.ridiculous.right.rigid.ripe.rising.rival.roasted.robust.rolling.romantic.rotten.rough.round.royal.rubber.rude.ruling.running.rural.sacred.sad.safe.salty.satisfactory.satisfied.scared.scary.scattered.scientific.scornful.scrawny.screeching.secondary.secret.secure.select.selected.selective.selfish.semantic.senior.sensible.sensitive.separate.serious.severe.sexual.shaggy.shaky.shallow.shared.sharp.sheer.shiny.shivering.shocked.short.shrill.shy.sick.significant.silent.silky.silly.similar.simple.single.skilled.skinny.sleepy.slight.slim.slimy.slippery.slow.small.smart.smiling.smoggy.smooth.social.socialist.soft.solar.sole.solid.sophisticated.sore.sorry.sound.sour.southern.soviet.spare.sparkling.spatial.special.specific.specified.spectacular.spicy.spiritual.splendid.spontaneous.sporting.spotless.spotty.square.squealing.stable.stale.standard.static.statistical.statutory.steady.steep.sticky.stiff.still.stingy.stormy.straight.straightforward.strange.strategic.strict.striking.striped.strong.structural.stuck.stupid.subjective.subsequent.substantial.subtle.successful.successive.sudden.sufficient.suitable.sunny.super.superb.superior.supporting.supposed.supreme.sure.surprised.surprising.surrounding.surviving.suspicious.sweet.swift.symbolic.sympathetic.systematic.tall.tame.tart.tasteless.tasty.technical.technological.teenage.temporary.tender.tense.terrible.territorial.testy.then.theoretical.thick.thin.thirsty.thorough.thoughtful.thoughtless.thundering.tight.tiny.tired.top.tory.total.tough.toxic.traditional.tragic.tremendous.tricky.tropical.troubled.typical.ugliest.ugly.ultimate.unable.unacceptable.unaware.uncertain.unchanged.uncomfortable.unconscious.underground.underlying.unemployed.uneven.unexpected.unfair.unfortunate.unhappy.uniform.uninterested.unique.united.universal.unknown.unlikely.unnecessary.unpleasant.unsightly.unusual.unwilling.upper.upset.uptight.urban.urgent.used.useful.useless.usual.vague.valid.valuable.variable.varied.various.varying.vast.verbal.vertical.very.vicarious.vicious.victorious.violent.visible.visiting.visual.vital.vitreous.vivacious.vivid.vocal.vocational.voiceless.voluminous.voluntary.vulnerable.wandering.warm.wasteful.watery.weak.wealthy.weary.wee.weekly.weird.welcome.well.western.wet.whispering.whole.wicked.wide.widespread.wild.wilful.willing.willowy.wily.wise.wispy.wittering.witty.wonderful.wooden.working.worldwide.worried.worrying.worthwhile.worthy.written.wrong.xenacious.xenial.xenogeneic.xenophobic.xeric.xerothermic.yabbering.yammering.yappiest.yappy.yawning.yearling.yearning.yeasty.yelling.yelping.yielding.yodelling.young.youngest.youthful.ytterbic.yucky.yummy.zany.zealous.zeroth.zestful.zesty.zippy.zonal.zoophagous.zygomorphic.zygotic`.split(`.`),TX=`aardvark.aardwolf.albatross.alligator.alpaca.amphibian.anaconda.angelfish.anglerfish.ant.anteater.antelope.antlion.ape.aphid.armadillo.asp.baboon.badger.bandicoot.barnacle.barracuda.basilisk.bass.bat.bear.beaver.bedbug.bee.beetle.bird.bison.blackbird.boa.boar.bobcat.bobolink.bonobo.booby.bovid.bug.butterfly.buzzard.camel.canid.canidae.capybara.cardinal.caribou.carp.cat.caterpillar.catfish.catshark.cattle.centipede.cephalopod.chameleon.cheetah.chickadee.chicken.chimpanzee.chinchilla.chipmunk.cicada.clam.clownfish.cobra.cockroach.cod.condor.constrictor.coral.cougar.cow.coyote.crab.crane.crawdad.crayfish.cricket.crocodile.crow.cuckoo.damselfly.deer.dingo.dinosaur.dog.dolphin.donkey.dormouse.dove.dragon.dragonfly.duck.eagle.earthworm.earwig.echidna.eel.egret.elephant.elk.emu.ermine.falcon.felidae.ferret.finch.firefly.fish.flamingo.flea.fly.flyingfish.fowl.fox.frog.galliform.gamefowl.gayal.gazelle.gecko.gerbil.gibbon.giraffe.goat.goldfish.goose.gopher.gorilla.grasshopper.grouse.guan.guanaco.guineafowl.gull.guppy.haddock.halibut.hamster.hare.harrier.hawk.hedgehog.heron.herring.hippopotamus.hookworm.hornet.horse.hoverfly.hummingbird.hyena.iguana.impala.jackal.jaguar.jay.jellyfish.junglefowl.kangaroo.kingfisher.kite.kiwi.koala.koi.krill.ladybug.lamprey.landfowl.lark.leech.lemming.lemur.leopard.leopon.limpet.lion.lizard.llama.lobster.locust.loon.louse.lungfish.lynx.macaw.mackerel.magpie.mammal.manatee.mandrill.marlin.marmoset.marmot.marsupial.marten.mastodon.meadowlark.meerkat.mink.minnow.mite.mockingbird.mole.mollusk.mongoose.monkey.moose.mosquito.moth.mouse.mule.muskox.narwhal.newt.nightingale.ocelot.octopus.opossum.orangutan.orca.ostrich.otter.owl.ox.panda.panther.parakeet.parrot.parrotfish.partridge.peacock.peafowl.pelican.penguin.perch.pheasant.pig.pigeon.pike.pinniped.piranha.planarian.platypus.pony.porcupine.porpoise.possum.prawn.primate.ptarmigan.puffin.puma.python.quail.quelea.quokka.rabbit.raccoon.rat.rattlesnake.raven.reindeer.reptile.rhinoceros.roadrunner.rodent.rook.rooster.roundworm.sailfish.salamander.salmon.sawfish.scallop.scorpion.seahorse.shark.sheep.shrew.shrimp.silkworm.silverfish.skink.skunk.sloth.slug.smelt.snail.snake.snipe.sole.sparrow.spider.spoonbill.squid.squirrel.starfish.stingray.stoat.stork.sturgeon.swallow.swan.swift.swordfish.swordtail.tahr.takin.tapir.tarantula.tarsier.termite.tern.thrush.tick.tiger.tiglon.toad.tortoise.toucan.trout.tuna.turkey.turtle.tyrannosaurus.unicorn.urial.vicuna.viper.vole.vulture.wallaby.walrus.warbler.wasp.weasel.whale.whippet.whitefish.wildcat.wildebeest.wildfowl.wolf.wolverine.wombat.woodpecker.worm.wren.xerinae.yak.zebra`.split(`.`),EX=`amaranth.amber.amethyst.apricot.aqua.aquamarine.azure.beige.black.blue.blush.bronze.brown.chocolate.coffee.copper.coral.crimson.cyan.emerald.fuchsia.gold.gray.green.harlequin.indigo.ivory.jade.lavender.lime.magenta.maroon.moccasin.olive.orange.peach.pink.plum.purple.red.rose.salmon.sapphire.scarlet.silver.tan.teal.tomato.turquoise.violet.white.yellow`.split(`.`),DX=`hydrogen.helium.lithium.beryllium.boron.carbon.nitrogen.oxygen.fluorine.neon.sodium.magnesium.aluminum.silicon.phosphorus.sulfur.chlorine.argon.potassium.calcium.scandium.titanium.vanadium.chromium.manganese.iron.cobalt.nickel.copper.zinc.gallium.germanium.arsenic.selenium.bromine.krypton.rubidium.strontium.yttrium.zirconium.niobium.molybdenum.technetium.ruthenium.rhodium.palladium.silver.cadmium.indium.tin.antimony.tellurium.iodine.xenon.cesium.barium.lanthanum.cerium.praseodymium.neodymium.promethium.samarium.europium.gadolinium.terbium.dysprosium.holmium.erbium.thulium.ytterbium.lutetium.hafnium.tantalum.wolfram.rhenium.osmium.iridium.platinum.gold.mercury.thallium.lead.bismuth.polonium.astatine.radon.francium.radium.actinium.thorium.protactinium.uranium.neptunium.plutonium.americium.curium.berkelium.californium.einsteinium.fermium.mendelevium.nobelium.lawrencium.rutherfordium.dubnium.seaborgium.bohrium.hassium.meitnerium.darmstadtium.roentgenium.copernicium.nihonium.flerovium.moscovium.livermorium.tennessine.oganesson`.split(`.`);function OX(){return CX({dictionaries:[EX,wX,TX,DX],style:`lowerCase`,length:3,separator:`-`})}var kX=()=>{let{setClient:e}=sr(),{header:t}=sn(),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(),[o]=gt(),{recaptchaKey:s,register:c}=dX(),{execute:l,reset:u,recaptchaId:d}=hX(s),[f,p]=(0,M.useState)(!1),g=(0,M.useCallback)(()=>p(!1),[p]),[_,v]=(0,M.useState)(),y=ri(),{t:b}=Ni(),x=(0,M.useCallback)(t=>{t.preventDefault();let n=new FormData(t.target),i=wi(n.get(`callName`)),o=n.get(`displayName`);async function s(){a(void 0),r(!0);let t=await l(),[n,s]=await c(OX(),m(16),o,t,!0),u;try{u=await Ai(n,i,fn.SHARED_KEY)}catch(t){if(!e)throw t;if(t.errcode===`M_ROOM_IN_USE`){v(()=>{e(n,s),y(`/${ni(i)}`)?.catch(e=>{h.error(`Failed to navigate to alias localpart`,e)})}),r(!1),p(!0);return}else throw t}if(!e)throw Error(`setClient is undefined`);if(!u.password)throw Error(`Failed to create room with shared secret`);e(n,s),await y(Cr(u.roomId,{kind:fn.SHARED_KEY,secret:u.password},i))}s().catch(e=>{h.error(e),r(!1),a(e),u()})},[c,u,l,y,p,e]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:yX.container,children:[t===`standard`&&(0,W.jsxs)(Zi,{children:[(0,W.jsx)(Ae,{children:(0,W.jsx)(Xt,{})}),(0,W.jsx)(Te,{hideMobile:!0,children:(0,W.jsx)(uX,{})})]}),(0,W.jsxs)(`main`,{className:yX.main,children:[(0,W.jsx)(Xt,{className:yX.logo}),(0,W.jsx)(qr,{size:`lg`,weight:`semibold`,children:b(`start_new_call`)}),(0,W.jsxs)(_X,{className:vX.form,onSubmit:x,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`callName`,name:`callName`,label:b(`call_name`),placeholder:b(`call_name`),type:`text`,required:!0,autoComplete:`off`,"data-testid":`home_callName`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`displayName`,name:`displayName`,label:b(`common.display_name`),placeholder:b(`common.display_name`),type:`text`,required:!0,"data-testid":`home_displayName`,autoComplete:`off`})}),o===null&&(0,W.jsx)(ei,{size:`sm`,className:vX.notice,children:(0,W.jsx)(zI,{})}),(0,W.jsx)(ei,{size:`sm`,className:vX.notice,children:(0,W.jsxs)(ON,{i18nKey:`unauthenticated_view_ssla_caption`,children:[`By clicking "Go", you agree to our`,` `,(0,W.jsx)(Vi,{href:ze.get().ssla,children:`Software and Services License Agreement (SSLA)`})]})}),i&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:i})}),(0,W.jsx)(Pi,{type:`submit`,size:`lg`,disabled:n,"data-testid":`home_go`,children:b(n?`common.loading`:`action.go`)}),(0,W.jsx)(`div`,{id:d})]})]}),(0,W.jsxs)(`footer`,{className:vX.footer,children:[(0,W.jsx)(ei,{className:vX.mobileLoginLink,children:(0,W.jsx)(tr,{to:`/login`,"data-testid":`home_login`,children:b(`unauthenticated_view_login_button`)})}),(0,W.jsx)(ei,{children:(0,W.jsxs)(ON,{i18nKey:`unauthenticated_view_body`,children:[`Not registered yet?`,` `,(0,W.jsx)(tr,{to:`/register`,"data-testid":`home_register`,children:`Create an account`})]})})]})]}),_&&(0,W.jsx)(pX,{onJoin:_,open:f,onDismiss:g})]})},AX={};function jX(e,t){if(AX[t.roomId])return AX[t.roomId];if(!t||!t.timeline){let e=2**53-1;return AX[t.roomId]=e,e}let n=e.getUserId();if(t.getMyMembership()!==c.Join){let e=t.currentState.getStateEvents(`m.room.member`,n);if(e&&!Array.isArray(e)){let n=e.getTs();return AX[t.roomId]=n,n}}for(let e=t.timeline.length-1;e>=0;--e){let n=t.timeline[e].getTs();if(n)return AX[t.roomId]=n,n}let r=2**53-1;return AX[t.roomId]=r,r}function MX(e,t){return t.sort((t,n)=>jX(e,n)-jX(e,t))}var NX=e=>{let t=Wn(e.roomId);if(!e.hasEncryptionStateEvent()&&!t)return!1;switch(e.getJoinRule()){case ne.Public:return!0;case ne.Knock:switch(e.getMyMembership()){case c.Join:case c.Knock:return!0;case c.Invite:return e.getLiveTimeline().getState(r.FORWARDS)?.getStateEvents(i.RoomMember,e.myUserId)?.getPrevContent().membership===ne.Knock;default:return!1}default:return e.getMyMembership()===c.Join}},PX=e=>{let t=e.getMyMembership();if(t===c.Knock)return!0;if(t!==c.Join)return!1;let n=e.getLiveTimeline();if(n.getState(r.FORWARDS)?.events?.has(i.GroupCallMemberPrefix))return!0;for(let t of e._unstable_getStickyEvents())if(t.getType()===i.RTCMembership)return!0;return n.getEvents().some(e=>e.unstableStickyInfo&&e.getType()===i.GroupCallMemberPrefix)};function FX(e){let[t,n]=(0,M.useState)([]);return(0,M.useEffect)(()=>{function t(){n(MX(e,e.getRooms().filter(PX).filter(NX)).map(t=>{let n=e.matrixRTC.getRoomSession(t);return{roomAlias:t.getCanonicalAlias()??void 0,roomName:t.name,avatarUrl:t.getMxcAvatarUrl(),room:t,session:n,participants:n.memberships.filter(e=>e.sender).map(e=>t.getMember(e.sender)).filter(e=>e)}}))}return t(),e.matrixRTC.on(g.SessionStarted,t),e.on(l.MyMembership,t),()=>{e.matrixRTC.off(g.SessionStarted,t),e.off(l.MyMembership,t)}},[e]),t}var IX={form:`_form_1vjc2_8`,fieldRow:`_fieldRow_1vjc2_16`,button:`_button_1vjc2_24`,recentCallsTitle:`_recentCallsTitle_1vjc2_28`,notice:`_notice_1vjc2_32`},LX={callTileSpacer:`_callTileSpacer_l4ywf_8`,callTile:`_callTile_l4ywf_8`,callTileLink:`_callTileLink_l4ywf_28`,avatar:`_avatar_l4ywf_36`,callInfo:`_callInfo_l4ywf_40`,callName:`_callName_l4ywf_53`,facePile:`_facePile_l4ywf_59`,callList:`_callList_l4ywf_63`,disabled:`_disabled_l4ywf_74`},RX=({rooms:e,client:t})=>(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:LX.callList,children:[e.map(({room:e,roomName:n,avatarUrl:r,participants:i})=>(0,W.jsx)(zX,{client:t,name:n,avatarUrl:r,room:e,participants:i},e.roomId)),e.length>3&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:LX.callTileSpacer}),(0,W.jsx)(`div`,{className:LX.callTileSpacer})]})]})}),zX=({name:e,avatarUrl:t,room:n,client:r})=>{let{t:i}=Ni(),a=Ii(n.roomId),[o,s]=(0,M.useState)(!1),c=(0,M.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),s(!0),r.leave(n.roomId).catch(()=>s(!1))},[n,r]),l=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ue,{id:n.roomId,name:e,size:Mr.LG,src:t}),(0,W.jsx)(`div`,{className:LX.callInfo,children:(0,W.jsx)(ei,{weight:`semibold`,className:LX.callName,children:e})}),(0,W.jsx)(He,{onClick:c,disabled:o,"aria-label":i(`action.remove`),children:(0,W.jsx)(pe,{})})]});return(0,W.jsx)(`div`,{className:LX.callTile,children:o?(0,W.jsx)(`span`,{className:(0,U.default)(LX.callTileLink,LX.disabled),children:l}):(0,W.jsx)(nr,{to:Cr(n.roomId,a,n.name),className:LX.callTileLink,children:l})})},BX=({client:e})=>{let{header:t}=sn(),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(),[o]=gt(),s=ri(),{t:c}=Ni(),[l,u]=(0,M.useState)(!1),d=(0,M.useCallback)(()=>u(!1),[u]),f=(0,M.useCallback)(t=>{t.preventDefault();let n=new FormData(t.target).get(`callName`),i=typeof n==`string`?wi(n):``;async function o(){a(void 0),r(!0);let t=await Ai(e,i,fn.SHARED_KEY);if(!t.password)throw Error(`Failed to create room with shared secret`);await s(Cr(t.roomId,{kind:fn.SHARED_KEY,secret:t.password},i))}o().catch(e=>{e.errcode===`M_ROOM_IN_USE`?(g(ni(i)),r(!1),a(void 0),u(!0)):(h.error(e),r(!1),a(e))})},[e,s,u]),p=FX(e),[m,g]=(0,M.useState)(),_=(0,M.useCallback)(()=>{s(`/${m}`)?.catch(e=>{h.error(`Failed to navigate to existing alias`,e)})},[s,m]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:yX.container,children:[t===`standard`&&(0,W.jsxs)(Zi,{children:[(0,W.jsx)(Ae,{children:(0,W.jsx)(Xt,{})}),(0,W.jsx)(Te,{children:(0,W.jsx)(uX,{})})]}),(0,W.jsxs)(`main`,{className:yX.main,children:[(0,W.jsx)(Xt,{className:yX.logo}),(0,W.jsx)(qr,{size:`lg`,weight:`semibold`,children:c(`start_new_call`)}),(0,W.jsxs)(_X,{className:IX.form,onSubmit:f,children:[(0,W.jsxs)(AI,{className:IX.fieldRow,children:[(0,W.jsx)(MI,{id:`callName`,name:`callName`,label:c(`call_name`),placeholder:c(`call_name`),type:`text`,required:!0,autoComplete:`off`,"data-testid":`home_callName`}),(0,W.jsx)(Pi,{type:`submit`,size:`lg`,className:IX.button,disabled:n,"data-testid":`home_go`,children:c(n?`common.loading`:`action.go`)})]}),o===null&&(0,W.jsx)(ei,{size:`sm`,className:IX.notice,children:(0,W.jsx)(zI,{})}),i&&(0,W.jsx)(AI,{className:IX.fieldRow,children:(0,W.jsx)(NI,{error:i})})]}),p.length>0&&(0,W.jsx)(RX,{rooms:p,client:e})]})]}),(0,W.jsx)(pX,{onJoin:_,open:l,onDismiss:d})]})};function VX(e){(0,M.useEffect)(()=>{let t=`Element Call`;document.title=e?`${t} | ${e}`:t},[e])}var HX=()=>{let{t:e}=Ni();VX(e(`common.home`));let t=Wr();return t?t.state===`error`?(0,W.jsx)(vn,{widget:At,error:t.error}):t.authenticated?(0,W.jsx)(BX,{client:t.authenticated.client}):(0,W.jsx)(kX,{}):(0,W.jsx)(Cn,{})},UX=(0,M.forwardRef)((e,t)=>(0,W.jsxs)(`svg`,{width:300,height:66,viewBox:`0 0 300 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:[(0,W.jsx)(`circle`,{cx:32.6901,cy:32.6904,r:23.496,fill:`white`}),(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M32.6137 65.2274C50.6257 65.2274 65.2274 50.6257 65.2274 32.6137C65.2274 14.6016 50.6257 0 32.6137 0C14.6016 0 0 14.6016 0 32.6137C0 50.6257 14.6016 65.2274 32.6137 65.2274ZM26.6511 15.1961C26.6511 13.8796 27.7205 12.8124 29.0397 12.8124C37.9808 12.8124 45.2291 20.0456 45.2291 28.9681C45.2291 30.2846 44.1596 31.3518 42.8405 31.3518C41.5213 31.3518 40.4519 30.2846 40.4519 28.9681C40.4519 22.6785 35.3425 17.5797 29.0397 17.5797C27.7205 17.5797 26.6511 16.5125 26.6511 15.1961ZM52.4139 28.9683C52.4139 27.6518 51.3445 26.5846 50.0253 26.5846C48.7061 26.5846 47.6367 27.6518 47.6367 28.9683C47.6367 35.2579 42.5274 40.3567 36.2246 40.3567C34.9054 40.3567 33.836 41.4239 33.836 42.7404C33.836 44.0568 34.9054 45.124 36.2246 45.124C45.1657 45.124 52.4139 37.8909 52.4139 28.9683ZM38.6134 50.031C38.6134 51.3475 37.544 52.4146 36.2248 52.4146C27.2837 52.4146 20.0355 45.1815 20.0355 36.2589C20.0355 34.9425 21.1049 33.8753 22.4241 33.8753C23.7432 33.8753 24.8127 34.9425 24.8127 36.2589C24.8127 42.5486 29.922 47.6474 36.2248 47.6474C37.544 47.6474 38.6134 48.7146 38.6134 50.031ZM12.8113 36.2589C12.8113 37.5754 13.8808 38.6426 15.1999 38.6426C16.5191 38.6426 17.5885 37.5754 17.5885 36.2589C17.5885 29.9693 22.6979 24.8705 29.0007 24.8705C30.3198 24.8705 31.3893 23.8033 31.3893 22.4869C31.3893 21.1704 30.3198 20.1032 29.0007 20.1032C20.0595 20.1032 12.8113 27.3364 12.8113 36.2589Z`,fill:`#0DBD8B`}),(0,W.jsx)(`path`,{d:`M114.73 36.9816H91.7256C91.9974 39.3888 92.871 41.3107 94.3464 42.7472C95.8217 44.1449 97.763 44.8438 100.17 44.8438C101.762 44.8438 103.199 44.4555 104.48 43.679C105.761 42.9025 106.674 41.8542 107.217 40.5341H114.206C113.274 43.6014 111.527 46.0862 108.964 47.9887C106.441 49.8523 103.451 50.7842 99.9955 50.7842C95.4917 50.7842 91.8421 49.2894 89.0466 46.2998C86.29 43.3102 84.9117 39.5247 84.9117 34.9432C84.9117 30.4783 86.3094 26.7316 89.1049 23.7032C91.9003 20.6747 95.5111 19.1605 99.9373 19.1605C104.363 19.1605 107.935 20.6553 110.653 23.6449C113.41 26.5957 114.788 30.323 114.788 34.8267L114.73 36.9816ZM99.9373 24.8097C97.763 24.8097 95.9576 25.4503 94.5211 26.7316C93.0845 28.0128 92.1915 29.7212 91.8421 31.8566H107.916C107.605 29.7212 106.751 28.0128 105.353 26.7316C103.956 25.4503 102.15 24.8097 99.9373 24.8097Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M119.557 41.0583V6.40625H126.488V41.1748C126.488 42.7278 127.342 43.5043 129.05 43.5043L130.273 43.4461V50.0271C129.613 50.1435 128.914 50.2018 128.177 50.2018C125.187 50.2018 122.993 49.4447 121.596 47.9305C120.237 46.4163 119.557 44.1255 119.557 41.0583Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M162.549 36.9816H139.545C139.817 39.3888 140.69 41.3107 142.166 42.7472C143.641 44.1449 145.582 44.8438 147.99 44.8438C149.582 44.8438 151.018 44.4555 152.299 43.679C153.581 42.9025 154.493 41.8542 155.037 40.5341H162.025C161.093 43.6014 159.346 46.0862 156.784 47.9887C154.26 49.8523 151.27 50.7842 147.815 50.7842C143.311 50.7842 139.662 49.2894 136.866 46.2998C134.109 43.3102 132.731 39.5247 132.731 34.9432C132.731 30.4783 134.129 26.7316 136.924 23.7032C139.72 20.6747 143.331 19.1605 147.757 19.1605C152.183 19.1605 155.755 20.6553 158.473 23.6449C161.229 26.5957 162.608 30.323 162.608 34.8267L162.549 36.9816ZM147.757 24.8097C145.582 24.8097 143.777 25.4503 142.341 26.7316C140.904 28.0128 140.011 29.7212 139.662 31.8566H155.735C155.425 29.7212 154.571 28.0128 153.173 26.7316C151.775 25.4503 149.97 24.8097 147.757 24.8097Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M193.817 32.7302V50.0853H186.887V31.973C186.887 27.3916 184.984 25.1009 181.179 25.1009C179.122 25.1009 177.471 25.7609 176.229 27.081C175.025 28.4011 174.424 30.2065 174.424 32.4972V50.0853H167.493V19.8594H173.9V23.8779C174.637 22.519 175.763 21.393 177.277 20.5C178.792 19.607 180.675 19.1605 182.927 19.1605C187.12 19.1605 190.148 20.7524 192.012 23.9361C194.574 20.7524 197.991 19.1605 202.262 19.1605C205.795 19.1605 208.513 20.2671 210.415 22.4801C212.318 24.6544 213.269 27.5275 213.269 31.0995V50.0853H206.338V31.973C206.338 27.3916 204.436 25.1009 200.631 25.1009C198.535 25.1009 196.865 25.7803 195.623 27.1392C194.419 28.4593 193.817 30.323 193.817 32.7302Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M247.735 36.9816H224.731C225.002 39.3888 225.876 41.3107 227.351 42.7472C228.827 44.1449 230.768 44.8438 233.175 44.8438C234.767 44.8438 236.204 44.4555 237.485 43.679C238.766 42.9025 239.678 41.8542 240.222 40.5341H247.211C246.279 43.6014 244.532 46.0862 241.969 47.9887C239.446 49.8523 236.456 50.7842 233 50.7842C228.497 50.7842 224.847 49.2894 222.052 46.2998C219.295 43.3102 217.917 39.5247 217.917 34.9432C217.917 30.4783 219.314 26.7316 222.11 23.7032C224.905 20.6747 228.516 19.1605 232.942 19.1605C237.368 19.1605 240.94 20.6553 243.658 23.6449C246.415 26.5957 247.793 30.323 247.793 34.8267L247.735 36.9816ZM232.942 24.8097C230.768 24.8097 228.963 25.4503 227.526 26.7316C226.089 28.0128 225.196 29.7212 224.847 31.8566H240.921C240.61 29.7212 239.756 28.0128 238.358 26.7316C236.961 25.4503 235.155 24.8097 232.942 24.8097Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M259.085 19.8594V23.8779C259.784 22.5578 260.929 21.4513 262.521 20.5583C264.152 19.6264 266.113 19.1605 268.403 19.1605C271.975 19.1605 274.732 20.2477 276.673 22.4219C278.653 24.5961 279.643 27.4887 279.643 31.0995V50.0853H272.713V31.973C272.713 29.8376 272.208 28.1681 271.199 26.9645C270.228 25.7221 268.733 25.1009 266.714 25.1009C264.501 25.1009 262.754 25.7609 261.473 27.081C260.23 28.4011 259.609 30.2259 259.609 32.5554V50.0853H252.679V19.8594H259.085Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M299.884 43.912V49.9106C299.029 50.1435 297.826 50.26 296.273 50.26C290.371 50.26 287.42 47.2898 287.42 41.3495V25.3921H282.82V19.8594H287.42V11.9972H294.351V19.8594H300V25.3921H294.351V40.6506C294.351 43.019 295.477 44.2032 297.729 44.2032L299.884 43.912Z`,fill:`white`})]})),WX={logo:`_logo_1gx2r_8`,container:`_container_1gx2r_14`,content:`_content_1gx2r_22`,formContainer:`_formContainer_1gx2r_30`,authLinks:`_authLinks_1gx2r_62`};function GX(e){return(0,M.useCallback)(async(t,n,r)=>{let i=cr({baseUrl:t}),{user_id:a,access_token:o,device_id:s}=await new li({matrixClient:i,doRequest:async()=>i.login(`m.login.password`,{identifier:{type:`m.id.user`,user:n},password:r}),stateUpdated:()=>{},requestEmailToken:async()=>Promise.resolve({sid:``})}).attemptAuth(),c={user_id:a,access_token:o,device_id:s,passwordlessUser:!1};return await e?.logout(!0),[await Nn({baseUrl:t,accessToken:o,userId:a,deviceId:s},!1),c]},[e])}var KX=()=>{let{t:e}=Ni();VX(e(`login_title`));let{client:t,setClient:n}=sr(),r=GX(t),i=ze.defaultHomeserverUrl(),a=(0,M.useRef)(null),o=(0,M.useRef)(null),s=ri(),c=Pn(),[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(),p=(0,M.useCallback)(e=>{if(e.preventDefault(),u(!0),!i||!a.current||!o.current){f(Error(`Login parameters are undefined`)),u(!1);return}r(i,a.current.value,o.current.value).then(async([e,t])=>{if(!n)return;n(e,t);let r=c.state;r&&r.from?await s(r.from):await s(`/`),vr.instance.eventLogin.track()}).catch(e=>{f(e),u(!1)})},[r,c,s,i,n]),m=ze.defaultServerName()?.slice(0,25);return m=m?.length===ze.defaultServerName()?.length?m:m+`...`,(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:WX.container,children:(0,W.jsxs)(`div`,{className:WX.content,children:[(0,W.jsxs)(`div`,{className:WX.formContainer,children:[(0,W.jsx)(UX,{width:`auto`,height:`auto`,className:WX.logo}),(0,W.jsx)(`h2`,{children:e(`log_in`)}),(0,W.jsx)(`h4`,{children:e(`login_subheading`)}),(0,W.jsxs)(`form`,{onSubmit:p,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{type:`text`,ref:a,placeholder:e(`common.username`),label:e(`common.username`),autoCorrect:`off`,autoCapitalize:`none`,prefix:`@`,suffix:`:${m}`,"data-testid":`login_username`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{type:`password`,ref:o,placeholder:e(`common.password`),label:e(`common.password`),"data-testid":`login_password`})}),d&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:d})}),(0,W.jsx)(AI,{children:(0,W.jsx)(Pi,{type:`submit`,disabled:l,"data-testid":`login_login`,children:e(l?`logging_in`:`login_title`)})})]})]}),(0,W.jsxs)(`div`,{className:WX.authLinks,children:[(0,W.jsx)(`p`,{children:e(`login_auth_links_prompt`)}),(0,W.jsx)(`p`,{children:(0,W.jsxs)(ON,{i18nKey:`login_auth_links`,children:[(0,W.jsx)(tr,{to:`/register`,children:`Create an account`}),` Or `,(0,W.jsx)(tr,{to:`/`,children:`Access as a guest`})]})})]})]})})})},qX=()=>{let{t:e}=Ni();VX(e(`action.register`));let{loading:t,authenticated:n,passwordlessUser:r,client:i,setClient:a}=ci(),o=(0,M.useRef)(null),s=ri(),c=Pn(),[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(),[p,m]=(0,M.useState)(``),[g,_]=(0,M.useState)(``),{recaptchaKey:v,register:y}=dX(i),{execute:b,reset:x,recaptchaId:S}=hX(v),C=(0,M.useCallback)(e=>{e.preventDefault();let t=new FormData(e.target),n=t.get(`userName`),o=t.get(`password`);o===t.get(`passwordConfirmation`)&&(async()=>{u(!0);let[e,t]=await y(n,o,n,await b(),r);if(i&&i?.groupCallEventHandler&&r)for(let t of i.groupCallEventHandler.groupCalls.values()){let n=t.room.roomId;try{await e.joinRoom(n)}catch(t){t.errcode===`M_LIMIT_EXCEEDED`?(await te(t.data.retry_after_ms),await e.joinRoom(n)):(oi(t),h.error(`Couldn't join room ${n}`,t))}}a?.(e,t),vr.instance.eventSignup.cacheSignupEnd(new Date)})().then(async()=>{c.state?.from?await s(c.state?.from):await s(`/`)}).catch(e=>{f(e),u(!1),x()})},[y,c,s,r,x,b,i,a]);return(0,M.useEffect)(()=>{p&&g&&p!==g?o.current?.setCustomValidity(e(`register.passwords_must_match`)):o.current?.setCustomValidity(``)},[p,g,e]),(0,M.useEffect)(()=>{!t&&n&&!r&&!l&&s(`/`)?.catch(e=>{h.error(`Failed to navigate to /`,e)})},[t,s,n,r,l]),t?(0,W.jsx)(Cn,{}):(vr.instance.eventSignup.cacheSignupStart(new Date),(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:WX.container,children:(0,W.jsxs)(`div`,{className:WX.content,children:[(0,W.jsxs)(`div`,{className:WX.formContainer,children:[(0,W.jsx)(UX,{width:`auto`,height:`auto`,className:WX.logo}),(0,W.jsx)(`h2`,{children:e(`register_heading`)}),(0,W.jsxs)(`form`,{onSubmit:C,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{type:`text`,name:`userName`,placeholder:e(`common.username`),label:e(`common.username`),autoCorrect:`off`,autoCapitalize:`none`,prefix:`@`,suffix:`:${ze.defaultServerName()}`,"data-testid":`register_username`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{required:!0,name:`password`,type:`password`,onChange:e=>m(e.target.value),value:p,placeholder:e(`common.password`),label:e(`common.password`),"data-testid":`register_password`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{required:!0,type:`password`,name:`passwordConfirmation`,onChange:e=>_(e.target.value),value:g,placeholder:e(`register_confirm_password_label`),label:e(`register_confirm_password_label`),ref:o,"data-testid":`register_confirm_password`})}),(0,W.jsx)(ei,{size:`sm`,children:(0,W.jsxs)(ON,{i18nKey:`recaptcha_ssla_caption`,children:[`This site is protected by ReCAPTCHA and the Google`,` `,(0,W.jsx)(Vi,{href:`https://www.google.com/policies/privacy/`,children:`Privacy Policy`}),` `,`and`,` `,(0,W.jsx)(Vi,{href:`https://policies.google.com/terms`,children:`Terms of Service`}),` `,`apply.`,(0,W.jsx)(`br`,{}),`By clicking "Register", you agree to our`,` `,(0,W.jsx)(Vi,{href:ze.get().ssla,children:`Software and Services License Agreement (SSLA)`})]})}),d&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:d})}),(0,W.jsx)(AI,{children:(0,W.jsx)(Pi,{type:`submit`,disabled:l,"data-testid":`register_register`,children:e(l?`register.registering`:`action.register`)})}),(0,W.jsx)(`div`,{id:S})]})]}),(0,W.jsx)(`div`,{className:WX.authLinks,children:(0,W.jsxs)(ON,{i18nKey:`register_auth_links`,children:[(0,W.jsx)(`p`,{children:`Already have an account?`}),(0,W.jsxs)(`p`,{children:[(0,W.jsx)(tr,{to:`/login`,children:`Log in`}),` Or `,(0,W.jsx)(tr,{to:`/`,children:`Access as a guest`})]})]})})]})})}))},JX={form:`_form_1wfyo_8`,headline:`_headline_1wfyo_18`,callEndedContent:`_callEndedContent_1wfyo_23`,callEndedButton:`_callEndedButton_1wfyo_32`,container:`_container_1wfyo_37`,main:`_main_1wfyo_45`,logo:`_logo_1wfyo_53`,footer:`_footer_1wfyo_62`};function YX(){let{setClient:e}=sr(),{privacyPolicyUrl:t,recaptchaKey:n,register:r}=dX(),{execute:i,reset:a,recaptchaId:o}=hX(n);return{privacyPolicyUrl:t,registerPasswordlessUser:(0,M.useCallback)(async t=>{if(!e)throw Error(`No client context`);if(At)throw Error(`Registration was skipped: We should never try to register password-less user in embedded mode.`);try{let n=await i(),[a,o]=await r(OX(),m(16),t,n,!0);e(a,o)}catch(e){throw a(),e}},[i,a,r,e]),recaptchaId:o}}var XX=()=>{let{header:e}=sn(),[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(),{registerPasswordlessUser:a,recaptchaId:o}=YX(),s=(0,M.useCallback)(e=>{e.preventDefault(),n(!0);let t=new FormData(e.target).get(`displayName`);a(typeof t==`string`?t:``).catch(t=>{h.error(`Failed to register passwordless user`,e),n(!1),i(t)})},[a]),{t:c}=Ni(),l=Pn();return(0,W.jsxs)(W.Fragment,{children:[e===`standard`&&(0,W.jsxs)(Zi,{children:[(0,W.jsx)(Ae,{children:(0,W.jsx)(Xt,{})}),(0,W.jsx)(Te,{children:(0,W.jsx)(uX,{preventNavigation:!0})})]}),(0,W.jsxs)(`div`,{className:JX.container,children:[(0,W.jsxs)(`main`,{className:JX.main,children:[(0,W.jsx)(qr,{size:`xl`,weight:`semibold`,className:JX.headline,children:c(`lobby.join_as_guest`)}),(0,W.jsxs)(_X,{className:JX.form,onSubmit:s,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`displayName`,name:`displayName`,label:c(`common.display_name`),placeholder:c(`common.display_name`),"data-testid":`joincall_displayName`,type:`text`,required:!0,autoComplete:`off`})}),(0,W.jsx)(ei,{size:`sm`,children:(0,W.jsxs)(ON,{i18nKey:`room_auth_view_ssla_caption`,children:[`By clicking "Join call now", you agree to our`,` `,(0,W.jsx)(Vi,{href:ze.get().ssla,children:`Software and Services License Agreement (SSLA)`})]})}),r&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:r})}),(0,W.jsx)(Pi,{type:`submit`,size:`lg`,disabled:t,"data-testid":`joincall_joincall`,children:c(t?`common.loading`:`room_auth_view_continue_button`)}),(0,W.jsx)(`div`,{id:o})]})]}),(0,W.jsx)(ei,{className:JX.footer,children:(0,W.jsxs)(ON,{i18nKey:`unauthenticated_view_body`,children:[`Not registered yet?`,` `,(0,W.jsx)(tr,{to:`/register`,state:{from:l},children:`Create an account`})]})})]})]})},ZX=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof t<`u`?t:typeof self<`u`?self:{};function QX(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var $X={exports:{}},eZ=$X.exports,tZ;function nZ(){return tZ||(tZ=1,(function(e){(function(t,n){e.exports?e.exports=n():t.log=n()})(eZ,function(){var e=function(){},t=`undefined`,n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=[`trace`,`debug`,`info`,`warn`,`error`],i={},a=null;function o(e,t){var n=e[t];if(typeof n.bind==`function`)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch{return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(r){return r===`debug`&&(r=`log`),typeof console===t?!1:r===`trace`&&n?s:console[r]===void 0?console.log===void 0?e:o(console,`log`):o(console,r)}function l(){for(var n=this.getLevel(),i=0;i<r.length;i++){var a=r[i];this[a]=i<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return`No console available for logging`}function u(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function d(e,t,n){return c(e)||u.apply(this,arguments)}function f(e,n){var o=this,s,c,u,f=`loglevel`;typeof e==`string`?f+=`:`+e:typeof e==`symbol`&&(f=void 0);function p(e){var n=(r[e]||`silent`).toUpperCase();if(!(typeof window===t||!f)){try{window.localStorage[f]=n;return}catch{}try{window.document.cookie=encodeURIComponent(f)+`=`+n+`;`}catch{}}}function m(){var e;if(!(typeof window===t||!f)){try{e=window.localStorage[f]}catch{}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+`=`);i!==-1&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch{}return o.levels[e]===void 0&&(e=void 0),e}}function h(){if(!(typeof window===t||!f)){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+`=; expires=Thu, 01 Jan 1970 00:00:00 UTC`}catch{}}}function g(e){var t=e;if(typeof t==`string`&&o.levels[t.toUpperCase()]!==void 0&&(t=o.levels[t.toUpperCase()]),typeof t==`number`&&t>=0&&t<=o.levels.SILENT)return t;throw TypeError(`log.setLevel() called with invalid level: `+e)}o.name=e,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||d,o.getLevel=function(){return u??c??s},o.setLevel=function(e,t){return u=g(e),t!==!1&&p(u),l.call(o)},o.setDefaultLevel=function(e){c=g(e),m()||o.setLevel(e,!1)},o.resetLevel=function(){u=null,h(),l.call(o)},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)},o.rebuild=function(){if(a!==o&&(s=g(a.getLevel())),l.call(o),a===o)for(var e in i)i[e].rebuild()},s=g(a?a.getLevel():`WARN`);var _=m();_!=null&&(u=g(_)),l.call(o)}a=new f,a.getLogger=function(e){if(typeof e!=`symbol`&&typeof e!=`string`||e===``)throw TypeError(`You must supply a name when creating a logger.`);var t=i[e];return t||=i[e]=new f(e,a.methodFactory),t};var p=typeof window===t?void 0:window.log;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=p),a},a.getLoggers=function(){return i},a.default=a,a})})($X)),$X.exports}var rZ=QX(nZ()),iZ=function(e,t){return iZ=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])},iZ(e,t)};function aZ(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);iZ(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function oZ(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function sZ(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function cZ(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function lZ(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function uZ(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function dZ(e){return this instanceof dZ?(this.v=e,this):new dZ(e)}function fZ(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof dZ?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function pZ(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof cZ==`function`?cZ(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function mZ(e){return typeof e==`function`}function hZ(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var gZ=hZ(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
205
+ `));return{framebuffer:i,texture:r,program:a,uniforms:{texture:e.getUniformLocation(a,`u_texture`),position:e.getAttribLocation(a,`position`)}}}function uY(e,t,n,r,i,a){return e.useProgram(n.program),e.bindFramebuffer(e.FRAMEBUFFER,n.framebuffer),e.viewport(0,0,i,a),e.bindBuffer(e.ARRAY_BUFFER,r),e.enableVertexAttribArray(n.uniforms.position),e.vertexAttribPointer(n.uniforms.position,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t),e.uniform1i(n.uniforms.texture,0),e.drawArrays(e.TRIANGLES,0,6),e.bindFramebuffer(e.FRAMEBUFFER,null),n.texture}var dY=HJ(`livekit-track-processor-web-gl`),fY=e=>{let t=e.getContext(`webgl2`,{antialias:!0,premultipliedAlpha:!0}),n=null;if(!t){dY.error(`Failed to create WebGL context`);return}t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA);let r=cY(t),i=r.program,a=r.attribLocations.position,{mask:o,frame:s,background:c,disableBackground:l}=r.uniformLocations,u=rY(t),d=u.program,f=u.uniforms,p=oY(t),m=p.program,h=p.uniforms,g=KJ(t,0),_=KJ(t,1),v=XJ(t);if(!v)throw Error(`Failed to create vertex buffer`);let y=[],b=[],x=[],S=0,C=1;y.push(KJ(t,3)),y.push(KJ(t,4));let w=Math.floor(e.width/4),T=Math.floor(e.height/4),E=lY(t,w,T);b.push(YJ(t,y[0],w,T)),b.push(YJ(t,y[1],w,T));let ee=KJ(t,5),te=YJ(t,ee,e.width,e.height);x.push(KJ(t,6)),x.push(KJ(t,7));let ne=[YJ(t,x[0],e.width,e.height),YJ(t,x[1],e.width,e.height)],re=!1;t.useProgram(i),t.uniform1i(l,+!!re),t.uniform1i(c,0),t.uniform1i(s,1),t.uniform1i(o,2);let ie=null;function ae(e){if(e.codedWidth===0||x.length===0)return;let r=e.displayWidth,u=e.displayHeight;t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,_),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e);let p=g;n?p=iY(t,uY(t,_,E,v,w,T),w,T,n,d,f,v,b,y):ie&&(t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,g),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,ie),p=g),t.viewport(0,0,r,u),t.clearColor(1,1,1,1),t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,v),t.vertexAttribPointer(a,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(a),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,p),t.uniform1i(c,0),t.uniform1i(l,+!!re),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,_),t.uniform1i(s,1),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,x[S]),t.uniform1i(o,2),t.drawArrays(t.TRIANGLES,0,6)}async function D(n){if(ie=null,n){ie=$J();try{ie=await ZJ(n,e.width,e.height)}catch(e){dY.error(`Error processing background image, falling back to black background:`,e)}t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,g),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,ie)}}function O(e){n=e?Math.max(1,Math.floor(e/4)):null,D(null)}function oe(e){re=e}function se(n){let r=[te,ne[C]],i=[ee,x[C]];iY(t,n,e.width,e.height,8,m,h,v,r,i),S=C,C=1-C}function ce(){t.deleteProgram(i),t.deleteProgram(d),t.deleteProgram(m),t.deleteTexture(g),t.deleteTexture(_),t.deleteTexture(ee),t.deleteFramebuffer(te);for(let e of y)t.deleteTexture(e);for(let e of b)t.deleteFramebuffer(e);for(let e of x)t.deleteTexture(e);for(let e of ne)t.deleteFramebuffer(e);t.deleteBuffer(v),E&&(t.deleteTexture(E.texture),t.deleteFramebuffer(E.framebuffer),t.deleteProgram(E.program)),ie&&=(ie instanceof ImageBitmap&&ie.close(),null),y=[],b=[],x=[]}return{renderFrame:ae,updateMask:se,setBackgroundImage:D,setBlurRadius:O,setBackgroundDisabled:oe,cleanup:ce}},pY=class{constructor(){this.isDisabled=!1}async init({outputCanvas:e,inputElement:t}){if(!(t instanceof HTMLVideoElement))throw TypeError(`Video transformer needs a HTMLVideoElement as input`);this.transformer=new TransformStream({transform:(e,t)=>this.transform(e,t)}),this.canvas=e||null,e&&(this.gl=fY(this.canvas||zJ(t.videoWidth,t.videoHeight))),this.inputVideo=t,this.isDisabled=!1}async restart({outputCanvas:e,inputElement:t}){var n;this.canvas=e||null,(n=this.gl)==null||n.cleanup(),this.gl=fY(this.canvas||zJ(t.videoWidth,t.videoHeight)),this.inputVideo=t,this.isDisabled=!1}async destroy(){var e;this.isDisabled=!0,this.canvas=void 0,(e=this.gl)==null||e.cleanup(),this.gl=void 0}},mY=class extends pY{constructor(e){super(),this.backgroundImageAndPath=null,this.segmentationTimeMs=0,this.isFirstFrame=!0,this.log=HJ(`livekit-processor-wrapper`),this.options=e,this.update(e)}static get isSupported(){return typeof OffscreenCanvas<`u`&&typeof VideoFrame<`u`&&typeof createImageBitmap<`u`&&!!document.createElement(`canvas`).getContext(`webgl2`)}async init({outputCanvas:e,inputElement:t}){var n,r;await super.init({outputCanvas:e,inputElement:t});let i=await LK.forVisionTasks(this.options.assetPaths?.tasksVisionFileSet??`https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${WJ[`@mediapipe/tasks-vision`]}/wasm`);this.imageSegmenter=await OJ.createFromOptions(i,{baseOptions:{modelAssetPath:this.options.assetPaths?.modelAssetPath??`https://storage.googleapis.com/mediapipe-models/image_segmenter/selfie_segmenter/float16/latest/selfie_segmenter.tflite`,delegate:`GPU`,...this.options.segmenterOptions},canvas:this.canvas,runningMode:`VIDEO`,outputCategoryMask:!0,outputConfidenceMasks:!1}),this.options?.imagePath&&await this.loadAndSetBackground(this.options.imagePath).catch(e=>this.log.error(`Error while loading processor background image: `,e)),typeof this.options.blurRadius==`number`&&((n=this.gl)==null||n.setBlurRadius(this.options.blurRadius)),(r=this.gl)==null||r.setBackgroundDisabled(this.options.backgroundDisabled??!1)}async destroy(e){await super.destroy(),await this.imageSegmenter?.close(),this.backgroundImageAndPath=null,e?.willProcessorRestart||(this.isFirstFrame=!0)}async loadAndSetBackground(e){var t;if(!this.backgroundImageAndPath||this.backgroundImageAndPath?.path!==e){let t=new Image;await new Promise((n,r)=>{t.crossOrigin=`Anonymous`,t.onload=()=>n(t),t.onerror=e=>r(e),t.src=e}),this.backgroundImageAndPath={imageData:await createImageBitmap(t),path:e}}(t=this.gl)==null||t.setBackgroundImage(this.backgroundImageAndPath.imageData)}async transform(e,t){var n,r;let i=!1;try{if(!(e instanceof VideoFrame)||e.codedWidth===0||e.codedHeight===0){this.log.debug(`empty frame detected, ignoring`);return}let a=this.isDisabled??this.options.backgroundDisabled??!1;if(typeof this.options.blurRadius!=`number`&&typeof this.options.imagePath!=`string`&&(a=!0),a){t.enqueue(e),i=!0;return}let o=Date.now();if(!this.canvas)throw TypeError(`Canvas needs to be initialized first`);this.canvas.width=e.displayWidth,this.canvas.height=e.displayHeight,this.isFirstFrame&&(t.enqueue(e.clone()),this.inputVideo&&await new Promise(e=>{this.inputVideo.requestVideoFrameCallback((t,n)=>{let r=n.expectedDisplayTime-n.presentationTime;setTimeout(e,r)})})),this.isFirstFrame=!1;let s=performance.now(),c=new Promise((t,n)=>{var r;try{let n=performance.now();(r=this.imageSegmenter)==null||r.segmentForVideo(e,n,e=>{this.segmentationTimeMs=performance.now()-n,this.segmentationResults=e,this.updateMask(e.categoryMask),e.close(),t()})}catch(e){n(e)}});if(this.drawFrame(e),this.canvas&&this.canvas.width>0&&this.canvas.height>0){let i=new VideoFrame(this.canvas,{timestamp:e.timestamp||o});t.enqueue(i);let a=performance.now()-s,c={processingTimeMs:this.segmentationTimeMs+a,segmentationTimeMs:this.segmentationTimeMs,filterTimeMs:a};(r=(n=this.options).onFrameProcessed)==null||r.call(n,c)}else t.enqueue(e);await c}catch(e){this.log.error(`Error while processing frame: `,e)}finally{i||e.close()}}async update(e){var t,n,r;this.options={...this.options,...e},(t=this.gl)==null||t.setBlurRadius(e.blurRadius??null),e.imagePath?await this.loadAndSetBackground(e.imagePath):(n=this.gl)==null||n.setBackgroundImage(null),(r=this.gl)==null||r.setBackgroundDisabled(e.backgroundDisabled??!1)}async drawFrame(e){var t;this.gl&&((t=this.gl)==null||t.renderFrame(e))}async updateMask(e){var t;e&&((t=this.gl)==null||t.updateMask(e.getAsWebGLTexture()))}},hY=()=>mY.isSupported&&UJ.isSupported,gY=``+new URL(`selfie_segmenter-DF05sdL4.tflite`,import.meta.url).href,_Y={wasmLoaderPath:new URL(``+new URL(`vision_wasm_internal-BnoE6ncW.js`,import.meta.url).href,``+import.meta.url).href,wasmBinaryPath:new URL(``+new URL(`vision_wasm_internal-DLLudqmV.wasm`,import.meta.url).href,``+import.meta.url).href},vY=class extends mY{async init({outputCanvas:e,inputElement:t}){await pY.prototype.init.call(this,{outputCanvas:e,inputElement:t}),this.imageSegmenter=await OJ.createFromOptions(_Y,{baseOptions:{modelAssetPath:gY,delegate:`GPU`,...this.options.segmenterOptions},canvas:this.canvas,runningMode:`VIDEO`,outputCategoryMask:!0,outputConfidenceMasks:!1}),this.options.blurRadius&&this.gl?.setBlurRadius(this.options.blurRadius)}},yY=(0,M.createContext)(void 0);function bY(){let e=(0,M.use)(yY);if(e===void 0)throw Error(`useTrackProcessor must be used within a ProcessorProvider`);return e}function xY(){let e=(0,M.use)(yY);if(e===void 0)throw Error(`useTrackProcessor must be used within a ProcessorProvider`);return KL(e=>e.pipe(G(([e])=>e)),[e])}var SY=(e,t,n)=>{yF([t,n]).pipe(e.bind()).subscribe(([e,t])=>{if(!t||!e)return;let{processor:n}=t;n&&!e.getProcessor()&&e.setProcessor(n),!n&&e.getProcessor()&&e.stopProcessor()})},CY=e=>{let{processor:t}=bY();(0,M.useEffect)(()=>{e&&(t&&!e.getProcessor()&&e.setProcessor(t),!t&&e.getProcessor()&&e.stopProcessor())},[t,e])},wY=({children:e})=>{let[t]=Et(Qi),n=(0,M.useMemo)(()=>hY(),[]),r=(0,M.useMemo)(()=>new UJ(new vY({blurRadius:15}),`background-blur`),[]);return(0,W.jsx)(yY,{value:(0,M.useMemo)(()=>({supported:n,processor:n&&t?r:void 0}),[n,t,r]),children:e})},TY={livekit_room_box:`_livekit_room_box_pjiap_12`},EY=function(e){return e.MISSING_MATRIX_RTC_TRANSPORT=`MISSING_MATRIX_RTC_TRANSPORT`,e.CONNECTION_LOST_ERROR=`CONNECTION_LOST_ERROR`,e.INTERNAL_MEMBERSHIP_MANAGER=`INTERNAL_MEMBERSHIP_MANAGER`,e.FAILED_TO_START_LIVEKIT=`FAILED_TO_START_LIVEKIT`,e.INSUFFICIENT_CAPACITY_ERROR=`INSUFFICIENT_CAPACITY_ERROR`,e.E2EE_NOT_SUPPORTED=`E2EE_NOT_SUPPORTED`,e.OPEN_ID_ERROR=`OPEN_ID_ERROR`,e.NO_MATRIX_2_AUTHORIZATION_SERVICE=`NO_MATRIX_2_0_AUTHORIZATION_SERVICE`,e.SFU_ERROR=`SFU_ERROR`,e.UNKNOWN_ERROR=`UNKNOWN_ERROR`,e}({}),DY=function(e){return e.CONFIGURATION_ISSUE=`CONFIGURATION_ISSUE`,e.NETWORK_CONNECTIVITY=`NETWORK_CONNECTIVITY`,e.CLIENT_CONFIGURATION=`CLIENT_CONFIGURATION`,e.UNKNOWN=`UNKNOWN`,e.SYSTEM_FAILURE=`SYSTEM_FAILURE`,e}({}),OY=class extends Error{constructor(e,t,n,r,i){super(e,{cause:i}),this.localisedTitle=e,this.localisedMessage=r,this.category=n,this.code=t}},kY=class extends OY{constructor(e){super(iN(`error.call_is_not_supported`),EY.MISSING_MATRIX_RTC_TRANSPORT,DY.CONFIGURATION_ISSUE,iN(`error.matrix_rtc_transport_missing`,{domain:e,brand:`Element Call`,errorCode:EY.MISSING_MATRIX_RTC_TRANSPORT})),this.domain=e}},AY=class extends OY{constructor(){super(iN(`error.connection_lost`),EY.CONNECTION_LOST_ERROR,DY.NETWORK_CONNECTIVITY,iN(`error.connection_lost_description`))}},jY=class extends OY{constructor(e){super(iN(`error.membership_manager`),EY.INTERNAL_MEMBERSHIP_MANAGER,DY.SYSTEM_FAILURE,iN(`error.membership_manager_description`),e)}},MY=class extends OY{constructor(){super(iN(`error.e2ee_unsupported`),EY.E2EE_NOT_SUPPORTED,DY.CLIENT_CONFIGURATION,iN(`error.e2ee_unsupported_description`))}},NY=class extends OY{constructor(e){super(iN(`error.generic`),EY.UNKNOWN_ERROR,DY.UNKNOWN,void 0,e)}},PY=class extends OY{constructor(e){super(iN(`error.generic`),EY.OPEN_ID_ERROR,DY.CONFIGURATION_ISSUE,void 0,e)}},FY=class extends OY{constructor(e){super(iN(`error.generic`),EY.NO_MATRIX_2_AUTHORIZATION_SERVICE,DY.CONFIGURATION_ISSUE,iN(`error.no_matrix_2_authorization_service`),e)}},IY=class extends OY{constructor(e){super(iN(`error.failed_to_start_livekit`),EY.FAILED_TO_START_LIVEKIT,DY.NETWORK_CONNECTIVITY,e)}},LY=class extends OY{constructor(){super(iN(`error.insufficient_capacity`),EY.INSUFFICIENT_CAPACITY_ERROR,DY.UNKNOWN,iN(`error.insufficient_capacity_description`))}},RY=class extends OY{constructor(){super(iN(`error.room_creation_restricted`),EY.SFU_ERROR,DY.CONFIGURATION_ISSUE,iN(`error.room_creation_restricted_description`))}};function zY({scope:e,membershipsWithTransport$:t,connectionManager:n}){return e.behavior(yF([t,n.connectionManagerData$]).pipe(HF(e=>e.every(t=>t.epoch===e[0].epoch)),G(([e,t])=>new hL([e.value,t.value],e.epoch)),OL(`MatrixLivekitMembers`,function*([e,t]){for(let{membership:n,transport:r}of e){let e=(r?t.getParticipantsForTransport(r):[]).find(e=>e.identity==n.rtcBackendIdentity)??null,i=r?t.getConnectionForTransport(r):null;yield{keys:[n.userId,n.deviceId,n.memberId,n.rtcBackendIdentity],data:{membership:n,participant:e,connection:i}}}},(e,t,n,r,i,a)=>{let{participant$:o,...s}=e.splitBehavior(t);return{userId:n,participant:{type:`remote`,value$:o},...s}})),new hL([],-1))}function BY(e,t){return e&&t?e.livekit_service_url===t.livekit_service_url:!e&&!t}var VY=class{constructor({client:e,resolvedConfig:t,wellKnownFetcher:n,logger:r}){this.client=e,this.resolvedConfig=t,this.wellKnownFetcher=n,this.logger=r.getChild(`[RtcTransportAutoDiscovery]`)}async discoverPreferredTransport(){let e=await this.tryBackendTransports();if(e)return this.logger.info(`Found backend transport: ${e.livekit_service_url}`),e;this.logger.info(`No backend transport found, falling back to well-known`);let t=await this.tryWellKnownTransports();if(t)return this.logger.info(`Found .well-known transport: ${t.livekit_service_url}`),t;this.logger.info(`No .well-known transport found, falling back to app config`);let n=this.tryConfigTransport();return n?(this.logger.info(`Found app config transport: ${n.livekit_service_url}`),n):null}async tryBackendTransports(){let e=this.client;if(e.getAccessToken()&&`_unstable_getRTCTransports`in e){this.logger.info(`First try to use getRTCTransports end point ...`);try{let t=await Xr(async()=>e._unstable_getRTCTransports()),n=t.filter(v)[0];if(n)return n;this.logger.info(`No livekit transport found in getRTCTransports end point`,t)}catch(e){this.logger.info(`Failed to use getRTCTransports end point: ${e}`)}}else this.logger.debug(`getRTCTransports end point not available`);return null}async tryWellKnownTransports(){let e=this.client.getDomain();if(e){let t=await this.wellKnownFetcher(e),n=t[`org.matrix.msc4143.rtc_foci`];if(n)if(!Array.isArray(n))this.logger.warn(`org.matrix.msc4143.rtc_foci is not an array in .well-known`);else return n[0];else this.logger.info(`No .well-known "org.matrix.msc4143.rtc_foci" found for ${e}`,t)}else this.logger.warn(`No domain configured for client`);return null}tryConfigTransport(){let e=this.resolvedConfig.livekit?.livekit_service_url;return e?{type:`livekit`,livekit_service_url:e}:null}},HY=h.getChild(`[LocalTransport]`),UY=function(e){return e.Legacy=`legacy`,e.Matrix_2_0=`matrix_2_0`,e}({});function WY(e){return`transport`in e&&`sfuConfig`in e}var GY=({scope:e,memberships$:t,ownMembershipIdentity:n,client:r,roomId:i,useOldestMember:a,forceJwtEndpoint:o,delayId$:s})=>{let c=KY(e,t),l=iF(new VY({client:r,resolvedConfig:ze.get(),wellKnownFetcher:y.getRawClientConfig.bind(y),logger:HY}).discoverPreferredTransport()),u=yF([Vt.value$.pipe(K(e=>e?aF({type:`livekit`,livekit_service_url:e}):l)).pipe(G(e=>{if(!e)throw new kY(r.getDomain()??``);return e}),eI(BY)),s]).pipe(K(async([e,t])=>{try{return await qY(e,o,n,i,r,t??void 0)}catch(t){throw HY.error(`Failed to authenticate to transport ${e.livekit_service_url}`,t),YY(t)}}));return a?JY(e,c,u,r,n,i):{advertised$:e.behavior(u.pipe(G(e=>e.transport),eI(BY)),null),active$:e.behavior(u.pipe(eI((e,t)=>BY(e.transport,t.transport))),null)}};function KY(e,t){return e.behavior(t.pipe(G(e=>{let t=e.value[0];if(t===void 0)return HY.info(`Oldest member: not found`),null;let n=t.getTransport(t);return n===void 0?(HY.warn(`Oldest member: ${t.userId}|${t.deviceId}|${t.memberId} has no transport`),null):v(n)?(HY.info("Oldest member: ${oldestMember.userId}|${oldestMember.deviceId}|${oldestMember.memberId} has valid transport"),n):(HY.warn(`Oldest member: ${t.userId}|${t.deviceId}|${t.memberId} has invalid transport`),null)}),eI(BY)))}async function qY(e,t,n,r,i,a){return{transport:e,sfuConfig:await XY(i,n,e.livekit_service_url,r,{forceJwtEndpoint:t,delayEndpointBaseUrl:i.baseUrl,delayId:a},HY)}}function JY(e,t,n,r,i,a){let o=t.pipe(K(e=>e===null?aF(null):iF(qY(e,UY.Legacy,i,a,r,void 0)).pipe(KF(t=>{throw HY.error(`Failed to authenticate to transport ${e.livekit_service_url}`,t),YY(t)}),fI(null))));return{advertised$:e.behavior(RF(o.pipe(G(e=>e?.transport??null)),n.pipe(G(e=>e.transport))).pipe(oI(e=>e!==null),_I(e=>HY.info(`Advertise transport: ${e.livekit_service_url}`))),null),active$:e.behavior(o.pipe(_I(e=>HY.info(`Publish on transport: ${e?.transport.livekit_service_url}`))),null)}}function YY(e){return e instanceof PY||e instanceof FY?e:new PY(e instanceof Error?e:Error(String(e)))}async function XY(e,t,n,r,i,a){let o;try{o=await Xr(async()=>e.getOpenIdToken())}catch(e){throw new PY(e instanceof Error?e:Error(`Unknown error`))}a?.debug(`Got openID token`,o);let s,c=i?.forceJwtEndpoint===void 0,l=i?.forceJwtEndpoint===UY.Matrix_2_0;if(c||l)try{return a?.info(`Trying to get JWT with delegation for focus ${n}...`),ZY(await eX(t,n,r,o,i?.delayEndpointBaseUrl,i?.delayId))}catch(e){if(a?.debug(`Failed fetching jwt with matrix 2.0 endpoint:`,e),l)throw new FY(e)}try{return a?.info(`Trying to get JWT with legacy endpoint for focus ${n}...`),s=await QY(t.deviceId,n,r,o),a?.info(`Got JWT from call's active focus URL.`),ZY(s)}catch(e){throw new PY(e instanceof Error?e:Error(`Unknown error ${e}`))}}function ZY(e){let[,n]=e.jwt.split(`.`),r=JSON.parse(t.atob(n));return{jwt:e.jwt,url:e.url,livekitAlias:r.video.room,livekitIdentity:r.sub}}async function QY(e,t,n,r){let i=await Xr(async()=>await fetch(t+`/sfu/get`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({room:n,openid_token:r,device_id:e})}));if(!i.ok)throw Error(`SFU Config fetch failed with status code `+i.status);return await i.json()}var $Y=class extends Error{constructor(e){super(e),this.name=`NotSupported`}};async function eX(e,t,n,r,i,a){let{userId:o,deviceId:s,memberId:c}=e,l={room_id:n,slot_id:`m.call#ROOM`,openid_token:r,member:{id:c,claimed_user_id:o,claimed_device_id:s}},u={};a&&i&&(u={delay_id:a,delay_timeout:ze.get().matrix_rtc_session?.delayed_leave_event_delay_ms??1e3,delay_cs_api_url:i});let d=await Xr(async()=>await fetch(t+`/get_token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...l,...u})}));if(!d.ok){let e=`SFU Config fetch failed with status code `+d.status;throw d.status===404?new $Y(e):Error(e)}return await d.json()}var tX=({client:e,livekitRooms:t,roomId:n,env:r})=>{let{t:i}=Ni(),[a,o]=Et(Kt),[c,l]=Et(ge),[u,d]=(0,M.useState)(!1);(0,M.useEffect)(()=>{e.doesServerSupportUnstableFeature(s).then(e=>{d(e)}).catch(e=>{h.warn(`Failed to check if sticky events are supported`,e)})},[e]);let[f,p]=Et(Ee),m=(0,M.useId)(),g=(0,M.useCallback)(e=>{p(e.target.value)},[p]),[_,v]=Et(Nr),[y,b]=Et(On),[x,S]=(0,M.useState)(null),[C,w]=Et(Vt),[T,E]=(0,M.useState)(C);(0,M.useEffect)(()=>{E(C)},[C]);let[ee,te]=Et(xe),ne=sn(),re=(0,M.useMemo)(()=>{let e=t?.find(e=>e.isLocal)?.room;if(e?.engine.client.ws?.url){let t=new URL(e.engine.client.ws.url);return t.search=``,t}return null},[t]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{children:i(`developer_mode.hostname`,{hostname:window.location.hostname||`unknown`})}),(0,W.jsx)(`p`,{children:i(`version`,{productName:`Element Call`,version:`embedded-v0.19.2`})}),(0,W.jsx)(`p`,{children:i(`developer_mode.crypto_version`,{version:e.getCrypto()?.getVersion()||`unknown`})}),(0,W.jsx)(`p`,{children:i(`developer_mode.matrix_id`,{id:e.getUserId()||`unknown`})}),(0,W.jsx)(`p`,{children:i(`developer_mode.device_id`,{id:e.getDeviceId()||`unknown`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`duplicateTiles`,type:`number`,label:i(`developer_mode.duplicate_tiles_label`),value:a.toString(),min:0,onChange:(0,M.useCallback)(e=>{let t=e.target.valueAsNumber;t<0||o(Number.isNaN(t)?0:t)},[o])})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`debugTileLayout`,type:`checkbox`,checked:c,label:i(`developer_mode.debug_tile_layout_label`),onChange:e=>l(e.target.checked)})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`showConnectionStats`,type:`checkbox`,label:i(`developer_mode.show_connection_stats`),checked:!!_,onChange:(0,M.useCallback)(e=>{v(e.target.checked)},[v])})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`muteAllAudio`,type:`checkbox`,label:i(`developer_mode.mute_all_audio`),checked:ee,onChange:(0,M.useCallback)(e=>{te(e.target.checked)},[te])})}),` `,(0,W.jsxs)(AI,{children:[(0,W.jsx)(MI,{id:`alwaysShowIphoneEarpiece`,type:`checkbox`,label:i(`developer_mode.always_show_iphone_earpiece`),checked:y,onChange:(0,M.useCallback)(e=>{b(e.target.checked)},[b])}),` `]}),(0,W.jsx)(Uj,{onSubmit:e=>e.preventDefault(),helpLabel:C===null?i(`developer_mode.custom_livekit_url.from_config`):i(`developer_mode.custom_livekit_url.current_url`)+C,label:i(`developer_mode.custom_livekit_url.label`),saveButtonLabel:i(`developer_mode.custom_livekit_url.save`),savingLabel:i(`developer_mode.custom_livekit_url.saving`),cancelButtonLabel:i(`developer_mode.custom_livekit_url.reset`),onSave:(0,M.useCallback)(async t=>{if(n===void 0||T===``||T===null){w(null);return}try{let t=e.getUserId(),r=e.getDeviceId();if(t===null||r===null)throw Error(`Invalid user or device ID`);await XY(e,{userId:t,deviceId:r,memberId:``},T,n),S(null),w(T)}catch{S(`invalid URL (did not update)`)}},[T,w,e,n]),value:T??``,onChange:(0,M.useCallback)(e=>{E(e.target.value)},[E]),onCancel:(0,M.useCallback)(e=>{w(null)},[w]),serverInvalid:x!==null,children:x!==null&&(0,W.jsx)(Nj,{children:x})}),(0,W.jsx)(qr,{as:`h3`,type:`body`,weight:`semibold`,size:`lg`,children:i(`developer_mode.matrixRTCMode.title`)}),(0,W.jsxs)(Lj,{children:[(0,W.jsxs)(Wj,{name:m,control:(0,W.jsx)(xj,{checked:f===pr.Legacy,value:pr.Legacy,onChange:g}),children:[(0,W.jsx)(Ej,{children:i(`developer_mode.matrixRTCMode.Legacy.label`)}),(0,W.jsx)(Ij,{children:i(`developer_mode.matrixRTCMode.Legacy.description`)})]}),(0,W.jsxs)(Wj,{name:m,control:(0,W.jsx)(xj,{checked:f===pr.Compatibility,value:pr.Compatibility,onChange:g}),children:[(0,W.jsx)(Ej,{children:i(`developer_mode.matrixRTCMode.Comptibility.label`)}),(0,W.jsx)(Ij,{children:i(`developer_mode.matrixRTCMode.Comptibility.description`)})]}),(0,W.jsxs)(Wj,{name:m,control:(0,W.jsx)(xj,{checked:f===pr.Matrix_2_0,value:pr.Matrix_2_0,disabled:!u,onChange:g}),children:[(0,W.jsx)(Ej,{children:i(`developer_mode.matrixRTCMode.Matrix_2_0.label`)}),(0,W.jsx)(Ij,{children:i(`developer_mode.matrixRTCMode.Matrix_2_0.description`)})]})]}),t?.map(e=>(0,W.jsxs)(`div`,{className:TY.livekit_room_box,children:[(0,W.jsx)(`h4`,{children:i(`developer_mode.livekit_sfu`,{url:e.url||`unknown`})}),(0,W.jsxs)(`p`,{children:[`LivekitAlias: `,e.livekitAlias]}),(0,W.jsxs)(`p`,{children:[`connectionState (wont hot reload): `,e.room.state]}),e.isLocal&&(0,W.jsxs)(`p`,{children:[`ws-url: `,re?.href]}),(0,W.jsxs)(`p`,{children:[i(`developer_mode.livekit_server_info`),`(`,e.isLocal?`local`:`remote`,`)`]}),(0,W.jsxs)(`pre`,{className:TY.pre,children:[e.room.serverInfo?JSON.stringify(e.room.serverInfo,null,2):`undefined`,e.room.metadata]}),(0,W.jsx)(`p`,{children:`Local Participant`}),(0,W.jsx)(`pre`,{className:TY.pre,children:e.room.localParticipant.identity}),(0,W.jsx)(`p`,{children:`Remote Participants`}),(0,W.jsx)(`ul`,{children:Array.from(e.room.remoteParticipants.keys()).map(e=>(0,W.jsx)(`li`,{children:e},e))})]})),(0,W.jsx)(`p`,{children:i(`developer_mode.environment_variables`)}),(0,W.jsx)(`pre`,{children:JSON.stringify(r,null,2)}),(0,W.jsx)(`p`,{children:i(`developer_mode.url_params`)}),(0,W.jsx)(`pre`,{children:JSON.stringify(ne,null,2)})]})},nX=`audio`,rX=({open:e,onDismiss:t,tab:n,onTabChange:r,client:i,roomId:a,livekitRooms:o})=>{let{t:s}=Ni(),c=()=>{let{supported:e}=bY(),[t,n]=Et(Qi);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`h4`,{children:s(`settings.background_blur_header`)}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`activateBackgroundBlur`,label:s(`settings.background_blur_label`),description:e?``:s(`settings.blur_not_supported_by_browser`),type:`checkbox`,checked:!!t,onChange:e=>n(e.target.checked),disabled:!e})})]})},l=$L();(0,M.useEffect)(()=>{e&&l.requestDeviceNames()},[e,l]);let[u,d]=Et(dt),[f,p]=(0,M.useState)(u),[m]=Et(qi),{available:h}=Gt(),{controlledAudioDevices:g}=sn(),_=k(LL),v={key:`audio`,name:s(`common.audio`),content:(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(Lj,{children:[!g&&(0,W.jsx)(KR,{device:l.audioInput,title:s(`settings.devices.microphone`),numberedLabel:e=>s(`settings.devices.microphone_numbered`,{n:e})}),_&&g&&(0,W.jsx)(Pi,{onClick:e=>{e.preventDefault(),window.controls.showNativeAudioDevicePicker?.(),window.controls.showNativeOutputDevicePicker?.()},children:s(`settings.devices.change_device_button`)}),(0,W.jsx)(KR,{device:l.audioOutput,title:s(`settings.devices.speaker`),numberedLabel:e=>s(`settings.devices.speaker_numbered`,{n:e})}),(0,W.jsxs)(`div`,{className:SI.volumeSlider,children:[(0,W.jsx)(`label`,{children:s(`settings.audio_tab.effect_volume_label`)}),(0,W.jsx)(`p`,{children:s(`settings.audio_tab.effect_volume_description`)}),(0,W.jsx)(WR,{label:s(`video_tile.volume`),value:f,onValueChange:p,onValueCommit:d,min:0,max:1,step:.01})]})]})})},y={key:`video`,name:s(`common.video`),content:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Lj,{children:(0,W.jsx)(KR,{device:l.videoInput,title:s(`settings.devices.camera`),numberedLabel:e=>s(`settings.devices.camera_numbered`,{n:e})})}),(0,W.jsx)($j,{}),(0,W.jsx)(c,{})]})},b={key:`preferences`,name:s(`common.preferences`),content:(0,W.jsx)(tR,{})},x={key:`profile`,name:s(`common.profile`),content:(0,W.jsx)(LI,{client:i})},S={key:`feedback`,name:s(`settings.feedback_tab_title`),content:(0,W.jsx)(BI,{roomId:a})},C={key:`developer`,name:s(`settings.developer_tab_title`),content:(0,W.jsx)(tX,{env:{BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`embedded-v0.19.2`,VITE_PACKAGE:`embedded`},client:i,livekitRooms:o,roomId:a})},w=[v,y];return At===null&&w.push(x),w.push(b),h&&w.push(S),m&&w.push(C),(0,W.jsx)(or,{title:s(`common.settings`),className:SI.settingsModal,open:e,onDismiss:t,tabbed:!0,children:(0,W.jsx)(wI,{label:s(`common.settings`),tab:n,onTabChange:r,tabs:w})})},iX=(0,M.forwardRef)((e,t)=>(0,W.jsxs)(`svg`,{width:22,height:22,viewBox:`0 0 22 22`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:[(0,W.jsx)(`mask`,{id:`path-1-inside-1_898_2641`,fill:`white`,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.1502 20.1214C15.3946 21.3074 13.2782 22 11 22C8.52367 22 6.23845 21.1817 4.4 19.8008C1.72821 17.794 0 14.5988 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11C22 14.797 20.0762 18.1446 17.1502 20.1214ZM11 11.55C12.8225 11.55 14.3 9.94942 14.3 7.975C14.3 6.00058 12.8225 4.4 11 4.4C9.17746 4.4 7.7 6.00058 7.7 7.975C7.7 9.94942 9.17746 11.55 11 11.55ZM11 19.8C13.3782 19.8 15.536 18.8566 17.1197 17.3237C16.1403 14.9056 13.7693 13.2 11 13.2C8.23066 13.2 5.85969 14.9056 4.88028 17.3237C6.46399 18.8566 8.62183 19.8 11 19.8Z`})}),(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M17.1502 20.1214C15.3946 21.3074 13.2782 22 11 22C8.52367 22 6.23845 21.1817 4.4 19.8008C1.72821 17.794 0 14.5988 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11C22 14.797 20.0762 18.1446 17.1502 20.1214ZM11 11.55C12.8225 11.55 14.3 9.94942 14.3 7.975C14.3 6.00058 12.8225 4.4 11 4.4C9.17746 4.4 7.7 6.00058 7.7 7.975C7.7 9.94942 9.17746 11.55 11 11.55ZM11 19.8C13.3782 19.8 15.536 18.8566 17.1197 17.3237C16.1403 14.9056 13.7693 13.2 11 13.2C8.23066 13.2 5.85969 14.9056 4.88028 17.3237C6.46399 18.8566 8.62183 19.8 11 19.8Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M17.1502 20.1214L17.9339 21.2814L17.1502 20.1214ZM4.4 19.8008L3.55919 20.9202H3.55919L4.4 19.8008ZM17.1197 17.3237L18.0934 18.3296L18.7717 17.6731L18.4173 16.7981L17.1197 17.3237ZM4.88028 17.3237L3.58268 16.7981L3.22829 17.6731L3.90659 18.3296L4.88028 17.3237ZM11 23.4C13.5662 23.4 15.9541 22.619 17.9339 21.2814L16.3665 18.9613C14.835 19.9959 12.9902 20.6 11 20.6V23.4ZM3.55919 20.9202C5.63176 22.477 8.21011 23.4 11 23.4V20.6C8.83723 20.6 6.84514 19.8865 5.24081 18.6814L3.55919 20.9202ZM-1.4 11C-1.4 15.0577 0.55052 18.6603 3.55919 20.9202L5.24081 18.6814C2.90591 16.9276 1.4 14.1399 1.4 11H-1.4ZM11 -1.4C4.15167 -1.4 -1.4 4.15167 -1.4 11H1.4C1.4 5.69807 5.69807 1.4 11 1.4V-1.4ZM23.4 11C23.4 4.15167 17.8483 -1.4 11 -1.4V1.4C16.3019 1.4 20.6 5.69807 20.6 11H23.4ZM17.9339 21.2814C21.2288 19.0554 23.4 15.2815 23.4 11H20.6C20.6 14.3124 18.9236 17.2337 16.3665 18.9613L17.9339 21.2814ZM12.9 7.975C12.9 9.28384 11.9459 10.15 11 10.15V12.95C13.6991 12.95 15.7 10.615 15.7 7.975H12.9ZM11 5.8C11.9459 5.8 12.9 6.66616 12.9 7.975H15.7C15.7 5.335 13.6991 3 11 3V5.8ZM9.1 7.975C9.1 6.66616 10.0541 5.8 11 5.8V3C8.30086 3 6.3 5.335 6.3 7.975H9.1ZM11 10.15C10.0541 10.15 9.1 9.28384 9.1 7.975H6.3C6.3 10.615 8.30086 12.95 11 12.95V10.15ZM16.146 16.3178C14.8129 17.6081 13.0004 18.4 11 18.4V21.2C13.756 21.2 16.2591 20.1051 18.0934 18.3296L16.146 16.3178ZM11 14.6C13.1797 14.6 15.0494 15.9415 15.8221 17.8493L18.4173 16.7981C17.2312 13.8697 14.359 11.8 11 11.8V14.6ZM6.17788 17.8493C6.95058 15.9415 8.8203 14.6 11 14.6V11.8C7.64102 11.8 4.7688 13.8697 3.58268 16.7981L6.17788 17.8493ZM11 18.4C8.99963 18.4 7.18709 17.6081 5.85397 16.3178L3.90659 18.3296C5.74088 20.1051 8.24402 21.2 11 21.2V18.4Z`,fill:`white`,mask:`url(#path-1-inside-1_898_2641)`})]})),aX=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M20.0988 9.01625C20.3188 9.59375 20.8825 9.97875 21.5013 9.97875C22.3263 9.97875 23 10.6525 23 11.4775V12.5225C23 13.3475 22.3263 14.0213 21.5013 14.0213C20.8825 14.0213 20.3188 14.4062 20.0988 14.9838C20.0806 15.0292 20.0624 15.0753 20.0441 15.1218C19.9792 15.2863 19.9125 15.4555 19.8375 15.6163C19.5763 16.18 19.7 16.84 20.14 17.28C20.7313 17.8575 20.7313 18.8062 20.14 19.3975L19.3975 20.14C18.82 20.7313 17.8713 20.7313 17.28 20.14C16.8538 19.7 16.18 19.5763 15.6163 19.8375C15.41 19.9338 15.2037 20.0163 14.9838 20.0988C14.4062 20.3188 14.0213 20.8825 14.0213 21.5013C14.0213 22.3263 13.3475 23 12.5225 23H11.4775C10.6525 23 9.97875 22.3263 9.97875 21.5013C9.97875 20.8825 9.59375 20.3188 9.01625 20.0988C8.97079 20.0806 8.92466 20.0624 8.87815 20.044C8.71368 19.9792 8.54454 19.9125 8.38375 19.8375C7.82 19.5763 7.16 19.7 6.72 20.14C6.1425 20.7313 5.19375 20.7313 4.6025 20.14L3.86 19.3975C3.26875 18.82 3.26875 17.8713 3.86 17.28C4.3 16.8538 4.42375 16.18 4.1625 15.6163C4.06625 15.41 3.98375 15.2037 3.90125 14.9838C3.68125 14.4062 3.1175 14.0213 2.49875 14.0213C1.67375 14.0213 1 13.3475 1 12.5225V11.4775C1 10.6525 1.67375 9.97875 2.49875 9.97875C3.1175 9.97875 3.68125 9.59375 3.90125 9.01625C3.94464 8.87742 3.99897 8.74406 4.0539 8.60926C4.086 8.53046 4.11831 8.45117 4.14875 8.37C4.41 7.80625 4.28625 7.14625 3.84625 6.70625C3.255 6.12875 3.255 5.18 3.84625 4.58875L4.6025 3.86C5.18 3.26875 6.12875 3.26875 6.72 3.86C7.14625 4.3 7.82 4.42375 8.38375 4.1625C8.59 4.06625 8.79625 3.97 9.01625 3.90125C9.59375 3.68125 9.97875 3.1175 9.97875 2.49875C9.97875 1.67375 10.6525 1 11.4775 1H12.5225C13.3475 1 14.0213 1.67375 14.0213 2.49875C14.0213 3.13125 14.4062 3.68125 14.9838 3.90125C15.0292 3.91943 15.0753 3.93762 15.1218 3.95595C15.2863 4.02079 15.4555 4.08746 15.6163 4.1625C16.18 4.42375 16.84 4.3 17.28 3.86C17.8575 3.26875 18.8062 3.26875 19.3975 3.86L20.14 4.6025C20.7313 5.18 20.7313 6.12875 20.14 6.72C19.7 7.14625 19.5763 7.82 19.8375 8.38375C19.9338 8.59 20.0163 8.79625 20.0988 9.01625ZM12 17.5C8.96125 17.5 6.5 15.0387 6.5 12C6.5 8.96125 8.96125 6.5 12 6.5C15.0387 6.5 17.5 8.96125 17.5 12C17.5 15.0387 15.0387 17.5 12 17.5Z`,fill:`#ffffff`})})),oX=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M7.49966 2.38889C7.49966 1.89797 7.89763 1.5 8.38855 1.5H20.1108C20.6017 1.5 20.9997 1.89797 20.9997 2.38889V21.6111C20.9997 22.102 20.6017 22.5 20.1108 22.5H8.38855C7.89763 22.5 7.49966 22.102 7.49966 21.6111V12.6667H7.49089H7.4821H7.47331H7.46452H7.45573H7.44694H7.43815H7.42936H7.42057H7.41178H7.403H7.39421H7.38542H7.37663H7.36784H7.35905H7.35026H7.34147H7.33268H7.32389H7.3151H7.30632H7.29753H7.28874H7.27995H7.27116H7.26237H7.25358H7.24479H7.236H7.22721H7.21842H7.20964H7.20085H7.19206H7.18327H7.17448H7.16569H7.1569H7.14811H7.13932H7.13053H7.12175H7.11296H7.10417H7.09538H7.08659H7.0778H7.06901H7.06022H7.05143H7.04264H7.03385H7.02507H7.01628H7.00749H6.9987H6.98991H6.98112H6.97233H6.96354H6.95475H6.94596H6.93717H6.92839H6.9196H6.91081H6.90202H6.89323H6.88444H6.87565H6.86686H6.85807H6.84928H6.8405H6.83171H6.82292H6.81413H6.80534H6.79655H6.78776H6.77897H6.77018H6.76139H6.7526H6.74382H6.73503H6.72624H6.71745H6.70866H6.69987H6.69108H6.68229H6.6735H6.66471H6.65592H6.64714H6.63835H6.62956H6.62077H6.61198H6.60319H6.5944H6.58561H6.57682H6.56803H6.55925H6.55046H6.54167H6.53288H6.52409H6.5153H6.50651H6.49772H6.48893H6.48014H6.47135H6.46257H6.45378H6.44499H6.4362H6.42741H6.41862H6.40983H6.40104H6.39225H6.38346H6.37467H6.36589H6.3571H6.34831H6.33952H6.33073H6.32194H6.31315H6.30436H6.29557H6.28678H6.27799H6.26921H6.26042H6.25163H6.24284H6.23405H6.22526H6.21647H6.20768H6.19889H6.1901H6.18132H6.17253H6.16374H6.15495H6.14616H6.13737H6.12858H6.11979H6.111H6.10221H6.09342H6.08464H6.07585H6.06706H6.05827H6.04948H6.04069H6.0319H6.02311H6.01432H6.00553H5.99674H5.98796H5.97917H5.97038H5.96159H5.9528H5.94401H5.93522H5.92643H5.91764H5.90885H5.90007H5.89128H5.88249H5.8737H5.86491H5.85612H5.84733H5.83854H5.82975H5.82096H5.81217H5.80339H5.7946H5.78581H5.77702H5.76823H5.75944H5.75065H5.74186H5.73307H5.72428H5.71549H5.70671H5.69792H5.68913H5.68034H5.67155H5.66276H5.65397H5.64518H5.63639H5.6276H5.61882H5.61003H5.60124H5.59245H5.58366H5.57487H5.56608H5.55729H5.5485H5.53971H5.53092H5.52214H5.51335H5.50456H5.49577H5.48698H5.47819H5.4694H5.46061H5.45182H5.44303H5.43424H5.42546H5.41667H5.40788H5.39909H5.3903H5.38151H5.37272H5.36393H5.35514H5.34635H5.33757H5.32878H5.31999H5.3112H5.30241H5.29362H5.28483H5.27604H5.26725H5.25846H5.24967H5.24089H5.2321H5.22331H5.21452H5.20573H5.19694H5.18815H5.17936H5.17057H5.16178H5.15299H5.14421H5.13542H5.12663H5.11784H5.10905H5.10026H5.09147H5.08268H5.07389H5.0651H5.05632H5.04753H5.03874H5.02995H5.02116H5.01237H5.00358H4.99479H4.986H4.97721H4.96842H4.95964H4.95085H4.94206H4.93327H4.92448H4.91569H4.9069H4.89811H4.88932H4.88053H4.87174H4.86296H4.85417H4.84538H4.83659H4.8278H4.81901H4.81022H4.80143H4.79264H4.78385H4.77507H4.76628H4.75749H4.7487H4.73991H4.73112H4.72233H4.71354H4.70475H4.69596H4.68717H4.67839H4.6696H4.66081H4.65202H4.64323H4.63444H4.62565H4.61686H4.60807H4.59928H4.59049H4.58171H4.57292H4.56413H4.55534H4.54655H4.53776H4.52897H4.52018H4.51139H4.5026H4.49382H4.48503H4.47624H4.46745H4.45866H4.44987H4.44108H4.43229H4.4235H4.41471H4.40592H4.39714H4.38835H4.37956H4.37077H4.36198H4.35319H4.3444H4.33561H4.32682H4.31803H4.30924H4.30046H4.29167H4.28288H4.27409H4.2653H4.25651H4.24772H4.23893H4.23014H4.22135H4.21257H4.20378H4.19499H4.1862H4.17741H4.16862H4.15983H4.15104H4.14225H4.13346H4.12467H4.11589H4.1071H4.09831H4.08952H4.08073H4.07194H4.06315H4.05436H4.04557H4.03678H4.02799H4.01921H4.01042H4.00163H3.99284H3.98405H3.97526H3.96647H3.95768H3.94889H3.9401H3.93132H3.92253H3.91374H3.90495H3.89616H3.88737H3.87858H3.86979H3.861H3.85221H3.84342H3.83464H3.82585H3.81706H3.80827H3.79948H3.79069H3.7819H3.77311H3.76432H3.75553H3.74674H3.73796H3.72917H3.72038H3.71159H3.7028H3.69401H3.68522H3.67643H3.66764H3.65885H3.65007H3.64128H3.63249H3.6237H3.61491H3.60612H3.59733H3.58854H3.57975H3.57096H3.56217H3.55339H3.5446H3.53581H3.52702H3.51823H3.50944H3.50065H3.49186H3.48307H3.47428H3.46549H3.45671H3.44792H3.43913H3.43034H3.42155H3.41276H3.40397H3.39518H3.38639H3.3776H3.36882H3.36003H3.35124H3.34245H3.33366H3.32487H3.31608H3.30729H3.2985H3.28971H3.28092H3.27214H3.26335H3.25456H3.24577H3.23698H3.22819H3.2194H3.21061H3.20182H3.19303H3.18424H3.17546H3.16667H3.15788H3.14909H3.1403H3.13151H3.12272H3.11393H3.10514H3.09635H3.08757H3.07878H3.06999H3.0612H3.05241H3.04362H3.03483H3.02604H3.01725H3.00846H2.99967C2.63148 12.6667 2.33301 12.3682 2.33301 12C2.33301 11.6318 2.63148 11.3333 2.99967 11.3333H3.00846H3.01725H3.02604H3.03483H3.04362H3.05241H3.0612H3.06999H3.07878H3.08757H3.09635H3.10514H3.11393H3.12272H3.13151H3.1403H3.14909H3.15788H3.16667H3.17546H3.18424H3.19303H3.20182H3.21061H3.2194H3.22819H3.23698H3.24577H3.25456H3.26335H3.27214H3.28092H3.28971H3.2985H3.30729H3.31608H3.32487H3.33366H3.34245H3.35124H3.36003H3.36882H3.3776H3.38639H3.39518H3.40397H3.41276H3.42155H3.43034H3.43913H3.44792H3.45671H3.46549H3.47428H3.48307H3.49186H3.50065H3.50944H3.51823H3.52702H3.53581H3.5446H3.55339H3.56217H3.57096H3.57975H3.58854H3.59733H3.60612H3.61491H3.6237H3.63249H3.64128H3.65007H3.65885H3.66764H3.67643H3.68522H3.69401H3.7028H3.71159H3.72038H3.72917H3.73796H3.74674H3.75553H3.76432H3.77311H3.7819H3.79069H3.79948H3.80827H3.81706H3.82585H3.83464H3.84342H3.85221H3.861H3.86979H3.87858H3.88737H3.89616H3.90495H3.91374H3.92253H3.93132H3.9401H3.94889H3.95768H3.96647H3.97526H3.98405H3.99284H4.00163H4.01042H4.01921H4.02799H4.03678H4.04557H4.05436H4.06315H4.07194H4.08073H4.08952H4.09831H4.1071H4.11589H4.12467H4.13346H4.14225H4.15104H4.15983H4.16862H4.17741H4.1862H4.19499H4.20378H4.21257H4.22135H4.23014H4.23893H4.24772H4.25651H4.2653H4.27409H4.28288H4.29167H4.30046H4.30924H4.31803H4.32682H4.33561H4.3444H4.35319H4.36198H4.37077H4.37956H4.38835H4.39714H4.40592H4.41471H4.4235H4.43229H4.44108H4.44987H4.45866H4.46745H4.47624H4.48503H4.49382H4.5026H4.51139H4.52018H4.52897H4.53776H4.54655H4.55534H4.56413H4.57292H4.58171H4.59049H4.59928H4.60807H4.61686H4.62565H4.63444H4.64323H4.65202H4.66081H4.6696H4.67839H4.68717H4.69596H4.70475H4.71354H4.72233H4.73112H4.73991H4.7487H4.75749H4.76628H4.77507H4.78385H4.79264H4.80143H4.81022H4.81901H4.8278H4.83659H4.84538H4.85417H4.86296H4.87174H4.88053H4.88932H4.89811H4.9069H4.91569H4.92448H4.93327H4.94206H4.95085H4.95964H4.96842H4.97721H4.986H4.99479H5.00358H5.01237H5.02116H5.02995H5.03874H5.04753H5.05631H5.0651H5.07389H5.08268H5.09147H5.10026H5.10905H5.11784H5.12663H5.13542H5.14421H5.15299H5.16178H5.17057H5.17936H5.18815H5.19694H5.20573H5.21452H5.22331H5.2321H5.24089H5.24967H5.25846H5.26725H5.27604H5.28483H5.29362H5.30241H5.3112H5.31999H5.32878H5.33757H5.34635H5.35514H5.36393H5.37272H5.38151H5.3903H5.39909H5.40788H5.41667H5.42546H5.43424H5.44303H5.45182H5.46061H5.4694H5.47819H5.48698H5.49577H5.50456H5.51335H5.52214H5.53092H5.53971H5.5485H5.55729H5.56608H5.57487H5.58366H5.59245H5.60124H5.61003H5.61882H5.6276H5.63639H5.64518H5.65397H5.66276H5.67155H5.68034H5.68913H5.69792H5.70671H5.71549H5.72428H5.73307H5.74186H5.75065H5.75944H5.76823H5.77702H5.78581H5.7946H5.80339H5.81217H5.82096H5.82975H5.83854H5.84733H5.85612H5.86491H5.8737H5.88249H5.89128H5.90007H5.90885H5.91764H5.92643H5.93522H5.94401H5.9528H5.96159H5.97038H5.97917H5.98796H5.99674H6.00553H6.01432H6.02311H6.0319H6.04069H6.04948H6.05827H6.06706H6.07585H6.08464H6.09342H6.10221H6.111H6.11979H6.12858H6.13737H6.14616H6.15495H6.16374H6.17253H6.18132H6.1901H6.19889H6.20768H6.21647H6.22526H6.23405H6.24284H6.25163H6.26042H6.26921H6.27799H6.28678H6.29557H6.30436H6.31315H6.32194H6.33073H6.33952H6.34831H6.3571H6.36589H6.37467H6.38346H6.39225H6.40104H6.40983H6.41862H6.42741H6.4362H6.44499H6.45378H6.46257H6.47135H6.48014H6.48893H6.49772H6.50651H6.5153H6.52409H6.53288H6.54167H6.55046H6.55925H6.56803H6.57682H6.58561H6.5944H6.60319H6.61198H6.62077H6.62956H6.63835H6.64714H6.65592H6.66471H6.6735H6.68229H6.69108H6.69987H6.70866H6.71745H6.72624H6.73503H6.74382H6.7526H6.76139H6.77018H6.77897H6.78776H6.79655H6.80534H6.81413H6.82292H6.83171H6.8405H6.84928H6.85807H6.86686H6.87565H6.88444H6.89323H6.90202H6.91081H6.9196H6.92839H6.93717H6.94596H6.95475H6.96354H6.97233H6.98112H6.98991H6.9987H7.00749H7.01628H7.02507H7.03385H7.04264H7.05143H7.06022H7.06901H7.0778H7.08659H7.09538H7.10417H7.11296H7.12175H7.13053H7.13932H7.14811H7.1569H7.16569H7.17448H7.18327H7.19206H7.20085H7.20964H7.21842H7.22721H7.236H7.24479H7.25358H7.26237H7.27116H7.27995H7.28874H7.29753H7.30632H7.3151H7.32389H7.33268H7.34147H7.35026H7.35905H7.36784H7.37663H7.38542H7.39421H7.403H7.41178H7.42057H7.42936H7.43815H7.44694H7.45573H7.46452H7.47331H7.4821H7.49089H7.49966V2.38889ZM13.3687 6.24853C13.1172 5.9796 12.7095 5.9796 12.458 6.24853C12.2065 6.51747 12.2065 6.9535 12.458 7.22243L16.3022 11.3336L16.2894 11.3336L16.2726 11.3336L16.2558 11.3336L16.239 11.3335L16.2223 11.3335L16.2055 11.3335L16.1887 11.3335L16.1719 11.3335L16.1552 11.3334L16.1384 11.3334L16.1216 11.3334L16.1048 11.3334L16.088 11.3334L16.0713 11.3333L16.0545 11.3333L16.0377 11.3333L16.0209 11.3333L16.0041 11.3333L15.9874 11.3332L15.9706 11.3332L15.9538 11.3332L15.937 11.3332L15.9202 11.3332L15.9035 11.3331L15.8867 11.3331L15.8699 11.3331L15.8531 11.3331L15.8364 11.3331L15.8196 11.333L15.8028 11.333L15.786 11.333L15.7692 11.333L15.7525 11.333L15.7357 11.3329L15.7189 11.3329L15.7021 11.3329L15.6853 11.3329L15.6686 11.3329L15.6518 11.3328L15.635 11.3328L15.6182 11.3328L15.6014 11.3328L15.5847 11.3328L15.5679 11.3327L15.5511 11.3327L15.5343 11.3327L15.5175 11.3327L15.5008 11.3327L15.484 11.3326L15.4672 11.3326L15.4504 11.3326L15.4337 11.3326L15.4169 11.3326L15.4001 11.3325L15.3833 11.3325L15.3665 11.3325L15.3498 11.3325L15.333 11.3324L15.3162 11.3324L15.2994 11.3324L15.2826 11.3324L15.2659 11.3324L15.2491 11.3323L15.2323 11.3323L15.2155 11.3323L15.1987 11.3323L15.182 11.3323L15.1652 11.3322L15.1484 11.3322L15.1316 11.3322L15.1148 11.3322L15.0981 11.3322L15.0813 11.3321L15.0645 11.3321L15.0477 11.3321L15.031 11.3321L15.0142 11.3321L14.9974 11.332L14.9806 11.332L14.9638 11.332L14.9471 11.332L14.9303 11.332L14.9135 11.3319L14.8967 11.3319L14.8799 11.3319L14.8632 11.3319L14.8464 11.3319L14.8296 11.3318L14.8128 11.3318L14.796 11.3318L14.7793 11.3318L14.7625 11.3318L14.7457 11.3317L14.7289 11.3317L14.7122 11.3317L14.6954 11.3317L14.6786 11.3317L14.6618 11.3316L14.645 11.3316L14.6283 11.3316L14.6115 11.3316L14.5947 11.3316L14.5779 11.3315L14.5611 11.3315L14.5444 11.3315L14.5276 11.3315L14.5108 11.3315L14.494 11.3314L14.4772 11.3314L14.4605 11.3314L14.4437 11.3314L14.4269 11.3314L14.4101 11.3313L14.3933 11.3313L14.3766 11.3313L14.3598 11.3313L14.343 11.3313L14.3262 11.3312L14.3095 11.3312L14.2927 11.3312L14.2759 11.3312L14.2591 11.3312L14.2423 11.3311L14.2256 11.3311L14.2088 11.3311L14.192 11.3311L14.1752 11.3311L14.1584 11.331L14.1417 11.331L14.1249 11.331L14.1081 11.331L14.0913 11.331L14.0745 11.3309L14.0578 11.3309L14.041 11.3309L14.0242 11.3309L14.0074 11.3309L13.9906 11.3308L13.9739 11.3308L13.9571 11.3308L13.9403 11.3308L13.9235 11.3308L13.9068 11.3307L13.89 11.3307L13.8732 11.3307L13.8564 11.3307L13.8396 11.3307L13.8229 11.3306L13.8061 11.3306L13.7893 11.3306L13.7725 11.3306L13.7557 11.3306L13.739 11.3305L13.7222 11.3305L13.7054 11.3305L13.6886 11.3305L13.6718 11.3305L13.6551 11.3304L13.6383 11.3304L13.6215 11.3304L13.6047 11.3304L13.5879 11.3304L13.5712 11.3303L13.5544 11.3303L13.5376 11.3303L13.5208 11.3303L13.5041 11.3303L13.4873 11.3302L13.4705 11.3302L13.4537 11.3302L13.4369 11.3302L13.4202 11.3302L13.4034 11.3301L13.3866 11.3301L13.3698 11.3301L13.353 11.3301L13.3363 11.33L13.3195 11.33L13.3027 11.33L13.2859 11.33L13.2691 11.33L13.2524 11.3299L13.2356 11.3299L13.2188 11.3299L13.202 11.3299L13.1853 11.3299L13.1685 11.3298L13.1517 11.3298L13.1349 11.3298L13.1181 11.3298L13.1014 11.3298L13.0846 11.3297L13.0678 11.3297L13.051 11.3297L13.0342 11.3297L13.0175 11.3297L13.0007 11.3296L12.9839 11.3296L12.9671 11.3296L12.9503 11.3296L12.9336 11.3296L12.9168 11.3295L12.9 11.3295L12.8832 11.3295L12.8664 11.3295L12.8497 11.3295L12.8329 11.3294L12.8161 11.3294L12.7993 11.3294L12.7826 11.3294L12.7658 11.3294L12.749 11.3293L12.7322 11.3293L12.7154 11.3293L12.6987 11.3293L12.6819 11.3293L12.6651 11.3292L12.6483 11.3292L12.6315 11.3292L12.6148 11.3292L12.598 11.3292L12.5812 11.3291L12.5644 11.3291L12.5476 11.3291L12.5309 11.3291L12.5141 11.3291L12.4973 11.329L12.4805 11.329L12.4637 11.329L12.447 11.329L12.4302 11.329L12.4134 11.3289L12.3966 11.3289L12.3799 11.3289L12.3631 11.3289L12.3463 11.3289L12.3295 11.3288L12.3127 11.3288L12.296 11.3288L12.2792 11.3288L12.2624 11.3288L12.2456 11.3287L12.2288 11.3287L12.2121 11.3287L12.1953 11.3287L12.1785 11.3287L12.1617 11.3286L12.1449 11.3286L12.1282 11.3286L12.1114 11.3286L12.0946 11.3286L12.0778 11.3285L12.0611 11.3285L12.0443 11.3285L12.0275 11.3285L12.0107 11.3285L11.9939 11.3284L11.9772 11.3284L11.9604 11.3284L11.9436 11.3284L11.9268 11.3284L11.91 11.3283L11.8933 11.3283L11.8765 11.3283L11.8597 11.3283L11.8429 11.3283L11.8261 11.3282L11.8094 11.3282L11.7926 11.3282L11.7758 11.3282L11.759 11.3282L11.7422 11.3281L11.7255 11.3281L11.7087 11.3281L11.6919 11.3281L11.6751 11.3281L11.6583 11.328L11.6416 11.328L11.6248 11.328L11.608 11.328L11.5912 11.328L11.5745 11.3279L11.5577 11.3279L11.5409 11.3279L11.5241 11.3279L11.5073 11.3279L11.4906 11.3278L11.4738 11.3278L11.457 11.3278L11.4402 11.3278L11.4234 11.3278L11.4067 11.3277L11.3899 11.3277L11.3731 11.3277L11.3563 11.3277L11.3395 11.3277L11.3228 11.3276L11.306 11.3276L11.2892 11.3276L11.2724 11.3276L11.2557 11.3275L11.2389 11.3275L11.2221 11.3275L11.2053 11.3275L11.1885 11.3275L11.1718 11.3274L11.155 11.3274L11.1382 11.3274L11.1214 11.3274L11.1046 11.3274L11.0879 11.3273L11.0711 11.3273L11.0543 11.3273L11.0375 11.3273L11.0207 11.3273L11.004 11.3272L10.9872 11.3272L10.9704 11.3272L10.9536 11.3272L10.9368 11.3272L10.9201 11.3271L10.9033 11.3271L10.8865 11.3271L10.8697 11.3271L10.853 11.3271L10.8362 11.327L10.8194 11.327L10.8026 11.327L10.7858 11.327L10.7691 11.327L10.7523 11.3269L10.7355 11.3269L10.7187 11.3269L10.7019 11.3269L10.6852 11.3269L10.6684 11.3268L10.6516 11.3268L10.6348 11.3268L10.618 11.3268L10.6013 11.3268L10.5845 11.3267L10.5677 11.3267L10.5509 11.3267L10.5341 11.3267L10.5174 11.3267L10.5006 11.3266L10.4838 11.3266L10.467 11.3266L10.4503 11.3266L10.4335 11.3266L10.4167 11.3265L10.3999 11.3265L10.3831 11.3265L10.3664 11.3265L10.3496 11.3265L10.3328 11.3264L10.316 11.3264L10.2992 11.3264L10.2825 11.3264L10.2657 11.3264L10.2489 11.3263L10.2321 11.3263L10.2153 11.3263L10.1986 11.3263L10.1818 11.3263L10.165 11.3262L10.1482 11.3262L10.1315 11.3262L10.1147 11.3262L10.0979 11.3262L10.0811 11.3261L10.0643 11.3261L10.0476 11.3261L10.0308 11.3261L10.014 11.3261L9.99722 11.326L9.98044 11.326L9.96366 11.326L9.94688 11.326L9.9301 11.326L9.91332 11.3259L9.89654 11.3259L9.87977 11.3259L9.86299 11.3259L9.84621 11.3259L9.82943 11.3258L9.81265 11.3258L9.79587 11.3258L9.77909 11.3258L9.76231 11.3258L9.74553 11.3257L9.72875 11.3257L9.71197 11.3257L9.69519 11.3257L9.67841 11.3257L9.66163 11.3256L9.64486 11.3256L9.62808 11.3256L9.6113 11.3256L9.59452 11.3256L9.57774 11.3255L9.56096 11.3255L9.54418 11.3255L9.5274 11.3255L9.51062 11.3255L9.49384 11.3254L9.47706 11.3254L9.46029 11.3254L9.44351 11.3254L9.42673 11.3254L9.40995 11.3253L9.39317 11.3253L9.37639 11.3253L9.35961 11.3253L9.34283 11.3253L9.32605 11.3252L9.30927 11.3252L9.29249 11.3252L9.27572 11.3252L9.25894 11.3252L9.24216 11.3251L9.22538 11.3251L9.2086 11.3251L9.19182 11.3251L9.17504 11.325L9.15826 11.325L9.14148 11.325L9.1247 11.325L9.10792 11.325L9.09115 11.3249L9.07437 11.3249L9.05759 11.3249L9.04081 11.3249L9.02403 11.3249L9.00725 11.3248L8.99047 11.3248L8.97369 11.3248L8.95691 11.3248L8.94013 11.3248L8.92335 11.3247L8.90658 11.3247L8.8898 11.3247L8.87302 11.3247L8.85624 11.3247L8.83946 11.3246L8.82268 11.3246L8.8059 11.3246L8.78912 11.3246L8.77234 11.3246L8.75556 11.3245L8.73878 11.3245L8.722 11.3245L8.70523 11.3245L8.68845 11.3245L8.67167 11.3244L8.65489 11.3244L8.63811 11.3244L8.62133 11.3244L8.60455 11.3244L8.58777 11.3243L8.57099 11.3243L8.55421 11.3243L8.53743 11.3243L8.52066 11.3243L8.50388 11.3242L8.4871 11.3242L8.47032 11.3242L8.45354 11.3242L8.43676 11.3242L8.41998 11.3241L8.4032 11.3241L8.38642 11.3241L8.36964 11.3241L8.35286 11.3241L8.33608 11.324L8.31931 11.324L8.30253 11.324L8.28575 11.324L8.26897 11.324L8.25219 11.3239L8.23541 11.3239L8.21863 11.3239L8.20185 11.3239L8.18507 11.3239L8.16829 11.3238L8.15151 11.3238L8.13474 11.3238L8.11796 11.3238L8.10118 11.3238L8.0844 11.3237L8.06762 11.3237L8.05084 11.3237L8.03406 11.3237L8.01728 11.3237L8.0005 11.3236L7.99885 12.657L8.01563 12.657L8.03241 12.657L8.04919 12.657L8.06597 12.6571L8.08274 12.6571L8.09952 12.6571L8.1163 12.6571L8.13308 12.6571L8.14986 12.6572L8.16664 12.6572L8.18342 12.6572L8.2002 12.6572L8.21698 12.6572L8.23376 12.6573L8.25054 12.6573L8.26731 12.6573L8.28409 12.6573L8.30087 12.6573L8.31765 12.6574L8.33443 12.6574L8.35121 12.6574L8.36799 12.6574L8.38477 12.6574L8.40155 12.6575L8.41833 12.6575L8.43511 12.6575L8.45189 12.6575L8.46866 12.6575L8.48544 12.6576L8.50222 12.6576L8.519 12.6576L8.53578 12.6576L8.55256 12.6576L8.56934 12.6577L8.58612 12.6577L8.6029 12.6577L8.61968 12.6577L8.63646 12.6577L8.65323 12.6578L8.67001 12.6578L8.68679 12.6578L8.70357 12.6578L8.72035 12.6578L8.73713 12.6579L8.75391 12.6579L8.77069 12.6579L8.78747 12.6579L8.80425 12.6579L8.82103 12.658L8.83781 12.658L8.85458 12.658L8.87136 12.658L8.88814 12.658L8.90492 12.6581L8.9217 12.6581L8.93848 12.6581L8.95526 12.6581L8.97204 12.6581L8.98882 12.6582L9.0056 12.6582L9.02238 12.6582L9.03915 12.6582L9.05593 12.6582L9.07271 12.6583L9.08949 12.6583L9.10627 12.6583L9.12305 12.6583L9.13983 12.6583L9.15661 12.6584L9.17339 12.6584L9.19017 12.6584L9.20695 12.6584L9.22373 12.6584L9.2405 12.6585L9.25728 12.6585L9.27406 12.6585L9.29084 12.6585L9.30762 12.6585L9.3244 12.6586L9.34118 12.6586L9.35796 12.6586L9.37474 12.6586L9.39152 12.6586L9.4083 12.6587L9.42507 12.6587L9.44185 12.6587L9.45863 12.6587L9.47541 12.6587L9.49219 12.6588L9.50897 12.6588L9.52575 12.6588L9.54253 12.6588L9.55931 12.6588L9.57609 12.6589L9.59287 12.6589L9.60964 12.6589L9.62642 12.6589L9.6432 12.6589L9.65998 12.659L9.67676 12.659L9.69354 12.659L9.71032 12.659L9.7271 12.659L9.74388 12.6591L9.76066 12.6591L9.77744 12.6591L9.79421 12.6591L9.81099 12.6591L9.82777 12.6592L9.84455 12.6592L9.86133 12.6592L9.87811 12.6592L9.89489 12.6592L9.91167 12.6593L9.92845 12.6593L9.94523 12.6593L9.96201 12.6593L9.97879 12.6594L9.99556 12.6594L10.0123 12.6594L10.0291 12.6594L10.0459 12.6594L10.0627 12.6595L10.0795 12.6595L10.0962 12.6595L10.113 12.6595L10.1298 12.6595L10.1466 12.6596L10.1634 12.6596L10.1801 12.6596L10.1969 12.6596L10.2137 12.6596L10.2305 12.6597L10.2473 12.6597L10.264 12.6597L10.2808 12.6597L10.2976 12.6597L10.3144 12.6598L10.3311 12.6598L10.3479 12.6598L10.3647 12.6598L10.3815 12.6598L10.3983 12.6599L10.415 12.6599L10.4318 12.6599L10.4486 12.6599L10.4654 12.6599L10.4822 12.66L10.4989 12.66L10.5157 12.66L10.5325 12.66L10.5493 12.66L10.5661 12.6601L10.5828 12.6601L10.5996 12.6601L10.6164 12.6601L10.6332 12.6601L10.65 12.6602L10.6667 12.6602L10.6835 12.6602L10.7003 12.6602L10.7171 12.6602L10.7338 12.6603L10.7506 12.6603L10.7674 12.6603L10.7842 12.6603L10.801 12.6603L10.8177 12.6604L10.8345 12.6604L10.8513 12.6604L10.8681 12.6604L10.8849 12.6604L10.9016 12.6605L10.9184 12.6605L10.9352 12.6605L10.952 12.6605L10.9688 12.6605L10.9855 12.6606L11.0023 12.6606L11.0191 12.6606L11.0359 12.6606L11.0526 12.6606L11.0694 12.6607L11.0862 12.6607L11.103 12.6607L11.1198 12.6607L11.1365 12.6607L11.1533 12.6608L11.1701 12.6608L11.1869 12.6608L11.2037 12.6608L11.2204 12.6608L11.2372 12.6609L11.254 12.6609L11.2708 12.6609L11.2876 12.6609L11.3043 12.6609L11.3211 12.661L11.3379 12.661L11.3547 12.661L11.3715 12.661L11.3882 12.661L11.405 12.6611L11.4218 12.6611L11.4386 12.6611L11.4553 12.6611L11.4721 12.6611L11.4889 12.6612L11.5057 12.6612L11.5225 12.6612L11.5392 12.6612L11.556 12.6612L11.5728 12.6613L11.5896 12.6613L11.6064 12.6613L11.6231 12.6613L11.6399 12.6613L11.6567 12.6614L11.6735 12.6614L11.6903 12.6614L11.707 12.6614L11.7238 12.6614L11.7406 12.6615L11.7574 12.6615L11.7742 12.6615L11.7909 12.6615L11.8077 12.6615L11.8245 12.6616L11.8413 12.6616L11.858 12.6616L11.8748 12.6616L11.8916 12.6616L11.9084 12.6617L11.9252 12.6617L11.9419 12.6617L11.9587 12.6617L11.9755 12.6617L11.9923 12.6618L12.0091 12.6618L12.0258 12.6618L12.0426 12.6618L12.0594 12.6618L12.0762 12.6619L12.093 12.6619L12.1097 12.6619L12.1265 12.6619L12.1433 12.662L12.1601 12.662L12.1768 12.662L12.1936 12.662L12.2104 12.662L12.2272 12.6621L12.244 12.6621L12.2607 12.6621L12.2775 12.6621L12.2943 12.6621L12.3111 12.6622L12.3279 12.6622L12.3446 12.6622L12.3614 12.6622L12.3782 12.6622L12.395 12.6623L12.4118 12.6623L12.4285 12.6623L12.4453 12.6623L12.4621 12.6623L12.4789 12.6624L12.4957 12.6624L12.5124 12.6624L12.5292 12.6624L12.546 12.6624L12.5628 12.6625L12.5795 12.6625L12.5963 12.6625L12.6131 12.6625L12.6299 12.6625L12.6467 12.6626L12.6634 12.6626L12.6802 12.6626L12.697 12.6626L12.7138 12.6626L12.7306 12.6627L12.7473 12.6627L12.7641 12.6627L12.7809 12.6627L12.7977 12.6627L12.8145 12.6628L12.8312 12.6628L12.848 12.6628L12.8648 12.6628L12.8816 12.6628L12.8984 12.6629L12.9151 12.6629L12.9319 12.6629L12.9487 12.6629L12.9655 12.6629L12.9822 12.663L12.999 12.663L13.0158 12.663L13.0326 12.663L13.0494 12.663L13.0661 12.6631L13.0829 12.6631L13.0997 12.6631L13.1165 12.6631L13.1333 12.6631L13.15 12.6632L13.1668 12.6632L13.1836 12.6632L13.2004 12.6632L13.2172 12.6632L13.2339 12.6633L13.2507 12.6633L13.2675 12.6633L13.2843 12.6633L13.3011 12.6633L13.3178 12.6634L13.3346 12.6634L13.3514 12.6634L13.3682 12.6634L13.3849 12.6634L13.4017 12.6635L13.4185 12.6635L13.4353 12.6635L13.4521 12.6635L13.4688 12.6635L13.4856 12.6636L13.5024 12.6636L13.5192 12.6636L13.536 12.6636L13.5527 12.6636L13.5695 12.6637L13.5863 12.6637L13.6031 12.6637L13.6199 12.6637L13.6366 12.6637L13.6534 12.6638L13.6702 12.6638L13.687 12.6638L13.7038 12.6638L13.7205 12.6638L13.7373 12.6639L13.7541 12.6639L13.7709 12.6639L13.7876 12.6639L13.8044 12.6639L13.8212 12.664L13.838 12.664L13.8548 12.664L13.8715 12.664L13.8883 12.664L13.9051 12.6641L13.9219 12.6641L13.9387 12.6641L13.9554 12.6641L13.9722 12.6641L13.989 12.6642L14.0058 12.6642L14.0226 12.6642L14.0393 12.6642L14.0561 12.6642L14.0729 12.6643L14.0897 12.6643L14.1064 12.6643L14.1232 12.6643L14.14 12.6644L14.1568 12.6644L14.1736 12.6644L14.1903 12.6644L14.2071 12.6644L14.2239 12.6645L14.2407 12.6645L14.2575 12.6645L14.2742 12.6645L14.291 12.6645L14.3078 12.6646L14.3246 12.6646L14.3414 12.6646L14.3581 12.6646L14.3749 12.6646L14.3917 12.6647L14.4085 12.6647L14.4253 12.6647L14.442 12.6647L14.4588 12.6647L14.4756 12.6648L14.4924 12.6648L14.5091 12.6648L14.5259 12.6648L14.5427 12.6648L14.5595 12.6649L14.5763 12.6649L14.593 12.6649L14.6098 12.6649L14.6266 12.6649L14.6434 12.665L14.6602 12.665L14.6769 12.665L14.6937 12.665L14.7105 12.665L14.7273 12.6651L14.7441 12.6651L14.7608 12.6651L14.7776 12.6651L14.7944 12.6651L14.8112 12.6652L14.828 12.6652L14.8447 12.6652L14.8615 12.6652L14.8783 12.6652L14.8951 12.6653L14.9118 12.6653L14.9286 12.6653L14.9454 12.6653L14.9622 12.6653L14.979 12.6654L14.9957 12.6654L15.0125 12.6654L15.0293 12.6654L15.0461 12.6654L15.0629 12.6655L15.0796 12.6655L15.0964 12.6655L15.1132 12.6655L15.13 12.6655L15.1468 12.6656L15.1635 12.6656L15.1803 12.6656L15.1971 12.6656L15.2139 12.6656L15.2306 12.6657L15.2474 12.6657L15.2642 12.6657L15.281 12.6657L15.2978 12.6657L15.3145 12.6658L15.3313 12.6658L15.3481 12.6658L15.3649 12.6658L15.3817 12.6658L15.3984 12.6659L15.4152 12.6659L15.432 12.6659L15.4488 12.6659L15.4656 12.6659L15.4823 12.666L15.4991 12.666L15.5159 12.666L15.5327 12.666L15.5495 12.666L15.5662 12.6661L15.583 12.6661L15.5998 12.6661L15.6166 12.6661L15.6333 12.6661L15.6501 12.6662L15.6669 12.6662L15.6837 12.6662L15.7005 12.6662L15.7172 12.6662L15.734 12.6663L15.7508 12.6663L15.7676 12.6663L15.7844 12.6663L15.8011 12.6663L15.8179 12.6664L15.8347 12.6664L15.8515 12.6664L15.8683 12.6664L15.885 12.6664L15.9018 12.6665L15.9186 12.6665L15.9354 12.6665L15.9522 12.6665L15.9689 12.6665L15.9857 12.6666L16.0025 12.6666L16.0193 12.6666L16.036 12.6666L16.0528 12.6666L16.0696 12.6667L16.0864 12.6667L16.1032 12.6667L16.1199 12.6667L16.1367 12.6667L16.1535 12.6668L16.1703 12.6668L16.1871 12.6668L16.2038 12.6668L16.2206 12.6669L16.2374 12.6669L16.2542 12.6669L16.271 12.6669L16.2836 12.6669L12.458 16.7581C12.2065 17.0271 12.2065 17.4631 12.458 17.732C12.7095 18.001 13.1172 18.001 13.3687 17.732L18.2822 12.4772C18.5337 12.2083 18.5337 11.7723 18.2822 11.5033L13.3687 6.24853Z`,fill:`white`})})),sX=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M18.2139 2.44646L12 3.99992H5.4375C4.64359 3.99992 4 4.64352 4 5.43742V18.5624C4 19.3563 4.64359 19.9999 5.4375 19.9999H12L18.2139 21.5534C19.1211 21.7802 20 21.094 20 20.1588V3.84104C20 2.90584 19.1211 2.21964 18.2139 2.44646ZM12 17.9999V5.99992H6V17.9999H12Z`,fill:`white`})})),cX={menuIcon:`_menuIcon_t5z8t_8`,userButton:`_userButton_t5z8t_15`},lX=({preventNavigation:e,isAuthenticated:t,isPasswordlessUser:n,userId:r,displayName:i,avatarUrl:a,onAction:o})=>{let{t:s}=Ni(),c=Pn(),l=(0,M.useMemo)(()=>{let r=[];return t&&(r.push({key:`user`,icon:iX,label:i,dataTestid:`usermenu_user`}),r.push({key:`settings`,icon:aX,label:s(`common.settings`)}),n&&!e&&r.push({key:`login`,label:s(`action.sign_in`),icon:oX,dataTestid:`usermenu_login`}),!n&&!e&&r.push({key:`logout`,label:s(`action.sign_out`),icon:sX,dataTestid:`usermenu_logout`})),r},[t,n,i,e,s]),[u,d]=(0,M.useState)(!1);return t?(0,W.jsx)(hA,{title:s(`a11y.user_menu`),showTitle:!1,align:`end`,open:u,onOpenChange:d,trigger:(0,W.jsx)(`button`,{"aria-label":s(`common.profile`),className:cX.userButton,"data-testid":`usermenu_open`,children:t&&(!n||a)?(0,W.jsx)(ue,{id:r,name:i,size:Mr.SM,src:a}):(0,W.jsx)(iX,{})}),children:l.map(({key:e,icon:t,label:n,dataTestid:r})=>(0,W.jsx)(yA,{Icon:t,label:n,"data-testid":r,onSelect:()=>o(e)},e))}):(0,W.jsx)(Ur,{to:{pathname:`/login`},state:{from:c},children:s(`log_in`)})},uX=({preventNavigation:e=!1})=>{let t=Pn(),n=ri(),{client:r,logout:i,authenticated:a,passwordlessUser:o}=ci(),{displayName:s,avatarUrl:c}=xI(r),[l,u]=(0,M.useState)(!1),d=(0,M.useCallback)(()=>u(!1),[u]),[f,p]=(0,M.useState)(nX),m=(0,M.useCallback)(e=>{switch(e){case`user`:p(`profile`),u(!0);break;case`settings`:p(`audio`),u(!0);break;case`logout`:i?.();break;case`login`:n(`/login`,{state:{from:t}})?.catch(e=>h.error(`Failed to navigate to login`,e));break}},[n,t,i,u]),g=r?.getUserIdLocalpart()??``;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(lX,{preventNavigation:e,isAuthenticated:a,isPasswordlessUser:o,avatarUrl:c,onAction:m,userId:r?.getUserId()??``,displayName:s||(g?g.replace(`@`,``):``)}),r&&(0,W.jsx)(rX,{client:r,open:l,onDismiss:d,tab:f,onTabChange:p})]})},dX=e=>{let[t,n]=(0,M.useState)(void 0),[r,i]=(0,M.useState)(void 0),a=(0,M.useRef)(void 0);return a.current||=cr({baseUrl:ze.defaultHomeserverUrl()}),(0,M.useEffect)(()=>{At||a.current.registerRequest({}).catch(e=>{n(e.data?.params[`m.login.terms`]?.policies?.privacy_policy?.en?.url),i(e.data?.params[`m.login.recaptcha`]?.public_key)})},[]),{privacyPolicyUrl:t,recaptchaKey:r,register:(0,M.useCallback)(async(t,n,r,i,o)=>{let s=new li({matrixClient:a.current,doRequest:async e=>a.current.registerRequest({username:t,password:n,auth:e||void 0}),stateUpdated:(e,t)=>{if(t.error)throw Error(t.error);e===`m.login.terms`?s.submitAuthDict({type:`m.login.terms`}).catch(e=>{h.error(e)}):e===`m.login.recaptcha`&&s.submitAuthDict({type:`m.login.recaptcha`,response:i}).catch(e=>{h.error(e)})},requestEmailToken:async()=>Promise.resolve({sid:`dummy`})}),{user_id:c,access_token:l,device_id:u}=await s.attemptAuth();await e?.logout(!0);let d=await Nn({baseUrl:ze.defaultHomeserverUrl(),accessToken:l,userId:c,deviceId:u},!1);await d.setDisplayName(r);let f={user_id:c,device_id:u,access_token:l,passwordlessUser:o};o&&(f.tempPassword=n);let p=d.getUser(d.getUserId());return p.setRawDisplayName(r),p.setDisplayName(r),[d,f]},[e])}},fX={buttons:`_buttons_1arp2_8`},pX=({onJoin:e,open:t,onDismiss:n})=>{let{t:r}=Ni();return(0,W.jsxs)(or,{title:r(`join_existing_call_modal.title`),open:t,onDismiss:n,children:[(0,W.jsx)(`p`,{children:r(`join_existing_call_modal.text`)}),(0,W.jsxs)(AI,{rightAlign:!0,className:fX.buttons,children:[(0,W.jsx)(Pi,{onClick:n,children:r(`action.no`)}),(0,W.jsx)(Pi,{onClick:e,"data-testid":`home_joinExistingRoom`,children:r(`join_existing_call_modal.join_button`)})]})]})},mX=`https://www.recaptcha.net/recaptcha/api.js?onload=mxOnRecaptchaLoaded&render=explicit`;function hX(e){let{t}=Ni(),[n]=(0,M.useState)(()=>m(16)),r=(0,M.useRef)(void 0);return(0,M.useEffect)(()=>{if(!e)return;let t=()=>{document.getElementById(n)&&window.grecaptcha.render(n,{sitekey:e,size:`invisible`,callback:e=>r.current?.resolve(e),"error-callback":()=>r.current?.reject(Error())})};if(typeof window.grecaptcha?.render==`function`)t();else if(window.mxOnRecaptchaLoaded=t,!document.querySelector(`script[src="${mX}"]`)){let e=document.createElement(`script`);e.src=mX,e.async=!0,document.body.appendChild(e)}},[n,e]),{execute:(0,M.useCallback)(async()=>e?window.grecaptcha?new Promise((e,n)=>{let i=new MutationObserver(e=>{for(let r of e)if(r.target?.style?.visibility!==`visible`){n(kI(`recaptcha_dismissed`,t)),i.disconnect();return}});r.current={resolve:t=>{e(t),i.disconnect()},reject:e=>{n(e),i.disconnect()}},window.grecaptcha.execute().then(()=>{},e=>{h.error(`Recaptcha execution failed`,e)});let a=document.querySelector(`iframe[src*="recaptcha/api2/bframe"]`);a?.parentNode?.parentNode&&i.observe(a?.parentNode?.parentNode,{attributes:!0})}):(h.log(`Recaptcha not loaded`),Promise.reject(kI(`recaptcha_not_loaded`,t))):Promise.resolve(``),[e,t]),reset:(0,M.useCallback)(()=>{window.grecaptcha?.reset()},[]),recaptchaId:n}}var gX={form:`_form_jcuzc_8`},_X=({ref:e,children:t,className:n,onSubmit:r})=>(0,W.jsx)(`form`,{onSubmit:r,className:(0,U.default)(gX.form,n),ref:e,children:t});_X.displayName=`Form`;var vX={footer:`_footer_106jg_8`,mobileLoginLink:`_mobileLoginLink_106jg_19`,form:`_form_106jg_24`,notice:`_notice_106jg_40`},yX={container:`_container_dwllg_8`,main:`_main_dwllg_15`,logo:`_logo_dwllg_23`,headline:`_headline_dwllg_28`},bX=e=>{e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296},xX=class{constructor(e){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;let{length:t,separator:n,dictionaries:r,style:i,seed:a}=e;this.dictionaries=r,this.separator=n,this.length=t,this.style=i,this.seed=a}generate(){if(!this.dictionaries)throw Error(`Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object`);if(this.length<=0)throw Error(`Invalid length provided`);if(this.length>this.dictionaries.length)throw Error(`The length cannot be bigger than the number of dictionaries.\nLength provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((t,n)=>{let r;e?(r=(e=>{if(typeof e==`string`){let t=e.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,1);return bX(Math.floor(Number(t)))}return bX(e)})(e),e=4294967296*r):r=Math.random();let i=n[Math.floor(r*n.length)]||``;if(this.style===`lowerCase`)i=i.toLowerCase();else if(this.style===`capital`){let[e,...t]=i.split(``);i=e.toUpperCase()+t.join(``)}else this.style===`upperCase`&&(i=i.toUpperCase());return t?`${t}${this.separator}${i}`:`${i}`},``)}},SX={separator:`_`,dictionaries:[]},CX=e=>{let t=[...e&&e.dictionaries||SX.dictionaries],n={...SX,...e,length:e&&e.length||t.length,dictionaries:t};if(!e||!e.dictionaries||!e.dictionaries.length)throw Error(`A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide`);return new xX(n).generate()},wX=`able.above.absent.absolute.abstract.abundant.academic.acceptable.accepted.accessible.accurate.accused.active.actual.acute.added.additional.adequate.adjacent.administrative.adorable.advanced.adverse.advisory.aesthetic.afraid.aggregate.aggressive.agreeable.agreed.agricultural.alert.alive.alleged.allied.alone.alright.alternative.amateur.amazing.ambitious.amused.ancient.angry.annoyed.annual.anonymous.anxious.appalling.apparent.applicable.appropriate.arbitrary.architectural.armed.arrogant.artificial.artistic.ashamed.asleep.assistant.associated.atomic.attractive.automatic.autonomous.available.average.awake.aware.awful.awkward.back.bad.balanced.bare.basic.beautiful.beneficial.better.bewildered.big.binding.biological.bitter.bizarre.blank.blind.blonde.bloody.blushing.boiling.bold.bored.boring.bottom.brainy.brave.breakable.breezy.brief.bright.brilliant.broad.broken.bumpy.burning.busy.calm.capable.capitalist.careful.casual.causal.cautious.central.certain.changing.characteristic.charming.cheap.cheerful.chemical.chief.chilly.chosen.christian.chronic.chubby.circular.civic.civil.civilian.classic.classical.clean.clear.clever.clinical.close.closed.cloudy.clumsy.coastal.cognitive.coherent.cold.collective.colonial.colorful.colossal.coloured.colourful.combative.combined.comfortable.coming.commercial.common.communist.compact.comparable.comparative.compatible.competent.competitive.complete.complex.complicated.comprehensive.compulsory.conceptual.concerned.concrete.condemned.confident.confidential.confused.conscious.conservation.conservative.considerable.consistent.constant.constitutional.contemporary.content.continental.continued.continuing.continuous.controlled.controversial.convenient.conventional.convinced.convincing.cooing.cool.cooperative.corporate.correct.corresponding.costly.courageous.crazy.creative.creepy.criminal.critical.crooked.crowded.crucial.crude.cruel.cuddly.cultural.curious.curly.current.curved.cute.daily.damaged.damp.dangerous.dark.dead.deaf.deafening.dear.decent.decisive.deep.defeated.defensive.defiant.definite.deliberate.delicate.delicious.delighted.delightful.democratic.dependent.depressed.desirable.desperate.detailed.determined.developed.developing.devoted.different.difficult.digital.diplomatic.direct.dirty.disabled.disappointed.disastrous.disciplinary.disgusted.distant.distinct.distinctive.distinguished.disturbed.disturbing.diverse.divine.dizzy.domestic.dominant.double.doubtful.drab.dramatic.dreadful.driving.drunk.dry.dual.due.dull.dusty.dutch.dying.dynamic.eager.early.eastern.easy.economic.educational.eerie.effective.efficient.elaborate.elated.elderly.eldest.electoral.electric.electrical.electronic.elegant.eligible.embarrassed.embarrassing.emotional.empirical.empty.enchanting.encouraging.endless.energetic.enormous.enthusiastic.entire.entitled.envious.environmental.equal.equivalent.essential.established.estimated.ethical.ethnic.eventual.everyday.evident.evil.evolutionary.exact.excellent.exceptional.excess.excessive.excited.exciting.exclusive.existing.exotic.expected.expensive.experienced.experimental.explicit.extended.extensive.external.extra.extraordinary.extreme.exuberant.faint.fair.faithful.familiar.famous.fancy.fantastic.far.fascinating.fashionable.fast.fat.fatal.favourable.favourite.federal.fellow.female.feminist.few.fierce.filthy.final.financial.fine.firm.fiscal.fit.fixed.flaky.flat.flexible.fluffy.fluttering.flying.following.fond.foolish.foreign.formal.formidable.forthcoming.fortunate.forward.fragile.frail.frantic.free.frequent.fresh.friendly.frightened.front.frozen.full.fun.functional.fundamental.funny.furious.future.fuzzy.gastric.gay.general.generous.genetic.gentle.genuine.geographical.giant.gigantic.given.glad.glamorous.gleaming.global.glorious.golden.good.gorgeous.gothic.governing.graceful.gradual.grand.grateful.greasy.great.grieving.grim.gross.grotesque.growing.grubby.grumpy.guilty.handicapped.handsome.happy.hard.harsh.head.healthy.heavy.helpful.helpless.hidden.high.hilarious.hissing.historic.historical.hollow.holy.homeless.homely.hon.honest.horizontal.horrible.hostile.hot.huge.human.hungry.hurt.hushed.husky.icy.ideal.identical.ideological.ill.illegal.imaginative.immediate.immense.imperial.implicit.important.impossible.impressed.impressive.improved.inadequate.inappropriate.inc.inclined.increased.increasing.incredible.independent.indirect.individual.industrial.inevitable.influential.informal.inherent.initial.injured.inland.inner.innocent.innovative.inquisitive.instant.institutional.insufficient.intact.integral.integrated.intellectual.intelligent.intense.intensive.interested.interesting.interim.interior.intermediate.internal.international.intimate.invisible.involved.irrelevant.isolated.itchy.jealous.jittery.joint.jolly.joyous.judicial.juicy.junior.just.keen.key.kind.known.labour.large.late.latin.lazy.leading.left.legal.legislative.legitimate.lengthy.lesser.level.lexical.liable.liberal.light.like.likely.limited.linear.linguistic.liquid.literary.little.live.lively.living.local.logical.lonely.long.loose.lost.loud.lovely.low.loyal.ltd.lucky.mad.magic.magnetic.magnificent.main.major.male.mammoth.managerial.managing.manual.many.marginal.marine.marked.married.marvellous.marxist.mass.massive.mathematical.mature.maximum.mean.meaningful.mechanical.medical.medieval.melodic.melted.mental.mere.metropolitan.mid.middle.mighty.mild.military.miniature.minimal.minimum.ministerial.minor.miserable.misleading.missing.misty.mixed.moaning.mobile.moderate.modern.modest.molecular.monetary.monthly.moral.motionless.muddy.multiple.mushy.musical.mute.mutual.mysterious.naked.narrow.nasty.national.native.natural.naughty.naval.near.nearby.neat.necessary.negative.neighbouring.nervous.net.neutral.new.nice.noble.noisy.normal.northern.nosy.notable.novel.nuclear.numerous.nursing.nutritious.nutty.obedient.objective.obliged.obnoxious.obvious.occasional.occupational.odd.official.ok.okay.old.olympic.only.open.operational.opposite.optimistic.oral.ordinary.organic.organisational.original.orthodox.other.outdoor.outer.outrageous.outside.outstanding.overall.overseas.overwhelming.painful.pale.panicky.parallel.parental.parliamentary.partial.particular.passing.passive.past.patient.payable.peaceful.peculiar.perfect.permanent.persistent.personal.petite.philosophical.physical.plain.planned.plastic.pleasant.pleased.poised.polite.political.poor.popular.positive.possible.potential.powerful.practical.precious.precise.preferred.pregnant.preliminary.premier.prepared.present.presidential.pretty.previous.prickly.primary.prime.primitive.principal.printed.prior.private.probable.productive.professional.profitable.profound.progressive.prominent.promising.proper.proposed.prospective.protective.protestant.proud.provincial.psychiatric.psychological.public.puny.pure.purring.puzzled.quaint.qualified.quarrelsome.querulous.quick.quickest.quiet.quintessential.quixotic.racial.radical.rainy.random.rapid.rare.raspy.rational.ratty.raw.ready.real.realistic.rear.reasonable.recent.reduced.redundant.regional.registered.regular.regulatory.related.relative.relaxed.relevant.reliable.relieved.religious.reluctant.remaining.remarkable.remote.renewed.representative.repulsive.required.resident.residential.resonant.respectable.respective.responsible.resulting.retail.retired.revolutionary.rich.ridiculous.right.rigid.ripe.rising.rival.roasted.robust.rolling.romantic.rotten.rough.round.royal.rubber.rude.ruling.running.rural.sacred.sad.safe.salty.satisfactory.satisfied.scared.scary.scattered.scientific.scornful.scrawny.screeching.secondary.secret.secure.select.selected.selective.selfish.semantic.senior.sensible.sensitive.separate.serious.severe.sexual.shaggy.shaky.shallow.shared.sharp.sheer.shiny.shivering.shocked.short.shrill.shy.sick.significant.silent.silky.silly.similar.simple.single.skilled.skinny.sleepy.slight.slim.slimy.slippery.slow.small.smart.smiling.smoggy.smooth.social.socialist.soft.solar.sole.solid.sophisticated.sore.sorry.sound.sour.southern.soviet.spare.sparkling.spatial.special.specific.specified.spectacular.spicy.spiritual.splendid.spontaneous.sporting.spotless.spotty.square.squealing.stable.stale.standard.static.statistical.statutory.steady.steep.sticky.stiff.still.stingy.stormy.straight.straightforward.strange.strategic.strict.striking.striped.strong.structural.stuck.stupid.subjective.subsequent.substantial.subtle.successful.successive.sudden.sufficient.suitable.sunny.super.superb.superior.supporting.supposed.supreme.sure.surprised.surprising.surrounding.surviving.suspicious.sweet.swift.symbolic.sympathetic.systematic.tall.tame.tart.tasteless.tasty.technical.technological.teenage.temporary.tender.tense.terrible.territorial.testy.then.theoretical.thick.thin.thirsty.thorough.thoughtful.thoughtless.thundering.tight.tiny.tired.top.tory.total.tough.toxic.traditional.tragic.tremendous.tricky.tropical.troubled.typical.ugliest.ugly.ultimate.unable.unacceptable.unaware.uncertain.unchanged.uncomfortable.unconscious.underground.underlying.unemployed.uneven.unexpected.unfair.unfortunate.unhappy.uniform.uninterested.unique.united.universal.unknown.unlikely.unnecessary.unpleasant.unsightly.unusual.unwilling.upper.upset.uptight.urban.urgent.used.useful.useless.usual.vague.valid.valuable.variable.varied.various.varying.vast.verbal.vertical.very.vicarious.vicious.victorious.violent.visible.visiting.visual.vital.vitreous.vivacious.vivid.vocal.vocational.voiceless.voluminous.voluntary.vulnerable.wandering.warm.wasteful.watery.weak.wealthy.weary.wee.weekly.weird.welcome.well.western.wet.whispering.whole.wicked.wide.widespread.wild.wilful.willing.willowy.wily.wise.wispy.wittering.witty.wonderful.wooden.working.worldwide.worried.worrying.worthwhile.worthy.written.wrong.xenacious.xenial.xenogeneic.xenophobic.xeric.xerothermic.yabbering.yammering.yappiest.yappy.yawning.yearling.yearning.yeasty.yelling.yelping.yielding.yodelling.young.youngest.youthful.ytterbic.yucky.yummy.zany.zealous.zeroth.zestful.zesty.zippy.zonal.zoophagous.zygomorphic.zygotic`.split(`.`),TX=`aardvark.aardwolf.albatross.alligator.alpaca.amphibian.anaconda.angelfish.anglerfish.ant.anteater.antelope.antlion.ape.aphid.armadillo.asp.baboon.badger.bandicoot.barnacle.barracuda.basilisk.bass.bat.bear.beaver.bedbug.bee.beetle.bird.bison.blackbird.boa.boar.bobcat.bobolink.bonobo.booby.bovid.bug.butterfly.buzzard.camel.canid.canidae.capybara.cardinal.caribou.carp.cat.caterpillar.catfish.catshark.cattle.centipede.cephalopod.chameleon.cheetah.chickadee.chicken.chimpanzee.chinchilla.chipmunk.cicada.clam.clownfish.cobra.cockroach.cod.condor.constrictor.coral.cougar.cow.coyote.crab.crane.crawdad.crayfish.cricket.crocodile.crow.cuckoo.damselfly.deer.dingo.dinosaur.dog.dolphin.donkey.dormouse.dove.dragon.dragonfly.duck.eagle.earthworm.earwig.echidna.eel.egret.elephant.elk.emu.ermine.falcon.felidae.ferret.finch.firefly.fish.flamingo.flea.fly.flyingfish.fowl.fox.frog.galliform.gamefowl.gayal.gazelle.gecko.gerbil.gibbon.giraffe.goat.goldfish.goose.gopher.gorilla.grasshopper.grouse.guan.guanaco.guineafowl.gull.guppy.haddock.halibut.hamster.hare.harrier.hawk.hedgehog.heron.herring.hippopotamus.hookworm.hornet.horse.hoverfly.hummingbird.hyena.iguana.impala.jackal.jaguar.jay.jellyfish.junglefowl.kangaroo.kingfisher.kite.kiwi.koala.koi.krill.ladybug.lamprey.landfowl.lark.leech.lemming.lemur.leopard.leopon.limpet.lion.lizard.llama.lobster.locust.loon.louse.lungfish.lynx.macaw.mackerel.magpie.mammal.manatee.mandrill.marlin.marmoset.marmot.marsupial.marten.mastodon.meadowlark.meerkat.mink.minnow.mite.mockingbird.mole.mollusk.mongoose.monkey.moose.mosquito.moth.mouse.mule.muskox.narwhal.newt.nightingale.ocelot.octopus.opossum.orangutan.orca.ostrich.otter.owl.ox.panda.panther.parakeet.parrot.parrotfish.partridge.peacock.peafowl.pelican.penguin.perch.pheasant.pig.pigeon.pike.pinniped.piranha.planarian.platypus.pony.porcupine.porpoise.possum.prawn.primate.ptarmigan.puffin.puma.python.quail.quelea.quokka.rabbit.raccoon.rat.rattlesnake.raven.reindeer.reptile.rhinoceros.roadrunner.rodent.rook.rooster.roundworm.sailfish.salamander.salmon.sawfish.scallop.scorpion.seahorse.shark.sheep.shrew.shrimp.silkworm.silverfish.skink.skunk.sloth.slug.smelt.snail.snake.snipe.sole.sparrow.spider.spoonbill.squid.squirrel.starfish.stingray.stoat.stork.sturgeon.swallow.swan.swift.swordfish.swordtail.tahr.takin.tapir.tarantula.tarsier.termite.tern.thrush.tick.tiger.tiglon.toad.tortoise.toucan.trout.tuna.turkey.turtle.tyrannosaurus.unicorn.urial.vicuna.viper.vole.vulture.wallaby.walrus.warbler.wasp.weasel.whale.whippet.whitefish.wildcat.wildebeest.wildfowl.wolf.wolverine.wombat.woodpecker.worm.wren.xerinae.yak.zebra`.split(`.`),EX=`amaranth.amber.amethyst.apricot.aqua.aquamarine.azure.beige.black.blue.blush.bronze.brown.chocolate.coffee.copper.coral.crimson.cyan.emerald.fuchsia.gold.gray.green.harlequin.indigo.ivory.jade.lavender.lime.magenta.maroon.moccasin.olive.orange.peach.pink.plum.purple.red.rose.salmon.sapphire.scarlet.silver.tan.teal.tomato.turquoise.violet.white.yellow`.split(`.`),DX=`hydrogen.helium.lithium.beryllium.boron.carbon.nitrogen.oxygen.fluorine.neon.sodium.magnesium.aluminum.silicon.phosphorus.sulfur.chlorine.argon.potassium.calcium.scandium.titanium.vanadium.chromium.manganese.iron.cobalt.nickel.copper.zinc.gallium.germanium.arsenic.selenium.bromine.krypton.rubidium.strontium.yttrium.zirconium.niobium.molybdenum.technetium.ruthenium.rhodium.palladium.silver.cadmium.indium.tin.antimony.tellurium.iodine.xenon.cesium.barium.lanthanum.cerium.praseodymium.neodymium.promethium.samarium.europium.gadolinium.terbium.dysprosium.holmium.erbium.thulium.ytterbium.lutetium.hafnium.tantalum.wolfram.rhenium.osmium.iridium.platinum.gold.mercury.thallium.lead.bismuth.polonium.astatine.radon.francium.radium.actinium.thorium.protactinium.uranium.neptunium.plutonium.americium.curium.berkelium.californium.einsteinium.fermium.mendelevium.nobelium.lawrencium.rutherfordium.dubnium.seaborgium.bohrium.hassium.meitnerium.darmstadtium.roentgenium.copernicium.nihonium.flerovium.moscovium.livermorium.tennessine.oganesson`.split(`.`);function OX(){return CX({dictionaries:[EX,wX,TX,DX],style:`lowerCase`,length:3,separator:`-`})}var kX=()=>{let{setClient:e}=sr(),{header:t}=sn(),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(),[o]=gt(),{recaptchaKey:s,register:c}=dX(),{execute:l,reset:u,recaptchaId:d}=hX(s),[f,p]=(0,M.useState)(!1),g=(0,M.useCallback)(()=>p(!1),[p]),[_,v]=(0,M.useState)(),y=ri(),{t:b}=Ni(),x=(0,M.useCallback)(t=>{t.preventDefault();let n=new FormData(t.target),i=wi(n.get(`callName`)),o=n.get(`displayName`);async function s(){a(void 0),r(!0);let t=await l(),[n,s]=await c(OX(),m(16),o,t,!0),u;try{u=await Ai(n,i,fn.SHARED_KEY)}catch(t){if(!e)throw t;if(t.errcode===`M_ROOM_IN_USE`){v(()=>{e(n,s),y(`/${ni(i)}`)?.catch(e=>{h.error(`Failed to navigate to alias localpart`,e)})}),r(!1),p(!0);return}else throw t}if(!e)throw Error(`setClient is undefined`);if(!u.password)throw Error(`Failed to create room with shared secret`);e(n,s),await y(Cr(u.roomId,{kind:fn.SHARED_KEY,secret:u.password},i))}s().catch(e=>{h.error(e),r(!1),a(e),u()})},[c,u,l,y,p,e]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:yX.container,children:[t===`standard`&&(0,W.jsxs)(Zi,{children:[(0,W.jsx)(Ae,{children:(0,W.jsx)(Xt,{})}),(0,W.jsx)(Te,{hideMobile:!0,children:(0,W.jsx)(uX,{})})]}),(0,W.jsxs)(`main`,{className:yX.main,children:[(0,W.jsx)(Xt,{className:yX.logo}),(0,W.jsx)(qr,{size:`lg`,weight:`semibold`,children:b(`start_new_call`)}),(0,W.jsxs)(_X,{className:vX.form,onSubmit:x,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`callName`,name:`callName`,label:b(`call_name`),placeholder:b(`call_name`),type:`text`,required:!0,autoComplete:`off`,"data-testid":`home_callName`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`displayName`,name:`displayName`,label:b(`common.display_name`),placeholder:b(`common.display_name`),type:`text`,required:!0,"data-testid":`home_displayName`,autoComplete:`off`})}),o===null&&(0,W.jsx)(ei,{size:`sm`,className:vX.notice,children:(0,W.jsx)(zI,{})}),(0,W.jsx)(ei,{size:`sm`,className:vX.notice,children:(0,W.jsxs)(ON,{i18nKey:`unauthenticated_view_ssla_caption`,children:[`By clicking "Go", you agree to our`,` `,(0,W.jsx)(Vi,{href:ze.get().ssla,children:`Software and Services License Agreement (SSLA)`})]})}),i&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:i})}),(0,W.jsx)(Pi,{type:`submit`,size:`lg`,disabled:n,"data-testid":`home_go`,children:b(n?`common.loading`:`action.go`)}),(0,W.jsx)(`div`,{id:d})]})]}),(0,W.jsxs)(`footer`,{className:vX.footer,children:[(0,W.jsx)(ei,{className:vX.mobileLoginLink,children:(0,W.jsx)(tr,{to:`/login`,"data-testid":`home_login`,children:b(`unauthenticated_view_login_button`)})}),(0,W.jsx)(ei,{children:(0,W.jsxs)(ON,{i18nKey:`unauthenticated_view_body`,children:[`Not registered yet?`,` `,(0,W.jsx)(tr,{to:`/register`,"data-testid":`home_register`,children:`Create an account`})]})})]})]}),_&&(0,W.jsx)(pX,{onJoin:_,open:f,onDismiss:g})]})},AX={};function jX(e,t){if(AX[t.roomId])return AX[t.roomId];if(!t||!t.timeline){let e=2**53-1;return AX[t.roomId]=e,e}let n=e.getUserId();if(t.getMyMembership()!==c.Join){let e=t.currentState.getStateEvents(`m.room.member`,n);if(e&&!Array.isArray(e)){let n=e.getTs();return AX[t.roomId]=n,n}}for(let e=t.timeline.length-1;e>=0;--e){let n=t.timeline[e].getTs();if(n)return AX[t.roomId]=n,n}let r=2**53-1;return AX[t.roomId]=r,r}function MX(e,t){return t.sort((t,n)=>jX(e,n)-jX(e,t))}var NX=e=>{let t=Wn(e.roomId);if(!e.hasEncryptionStateEvent()&&!t)return!1;switch(e.getJoinRule()){case ne.Public:return!0;case ne.Knock:switch(e.getMyMembership()){case c.Join:case c.Knock:return!0;case c.Invite:return e.getLiveTimeline().getState(r.FORWARDS)?.getStateEvents(i.RoomMember,e.myUserId)?.getPrevContent().membership===ne.Knock;default:return!1}default:return e.getMyMembership()===c.Join}},PX=e=>{let t=e.getMyMembership();if(t===c.Knock)return!0;if(t!==c.Join)return!1;let n=e.getLiveTimeline();if(n.getState(r.FORWARDS)?.events?.has(i.GroupCallMemberPrefix))return!0;for(let t of e._unstable_getStickyEvents())if(t.getType()===i.RTCMembership)return!0;return n.getEvents().some(e=>e.unstableStickyInfo&&e.getType()===i.GroupCallMemberPrefix)};function FX(e){let[t,n]=(0,M.useState)([]);return(0,M.useEffect)(()=>{function t(){n(MX(e,e.getRooms().filter(PX).filter(NX)).map(t=>{let n=e.matrixRTC.getRoomSession(t);return{roomAlias:t.getCanonicalAlias()??void 0,roomName:t.name,avatarUrl:t.getMxcAvatarUrl(),room:t,session:n,participants:n.memberships.filter(e=>e.sender).map(e=>t.getMember(e.sender)).filter(e=>e)}}))}return t(),e.matrixRTC.on(g.SessionStarted,t),e.on(l.MyMembership,t),()=>{e.matrixRTC.off(g.SessionStarted,t),e.off(l.MyMembership,t)}},[e]),t}var IX={form:`_form_1vjc2_8`,fieldRow:`_fieldRow_1vjc2_16`,button:`_button_1vjc2_24`,recentCallsTitle:`_recentCallsTitle_1vjc2_28`,notice:`_notice_1vjc2_32`},LX={callTileSpacer:`_callTileSpacer_l4ywf_8`,callTile:`_callTile_l4ywf_8`,callTileLink:`_callTileLink_l4ywf_28`,avatar:`_avatar_l4ywf_36`,callInfo:`_callInfo_l4ywf_40`,callName:`_callName_l4ywf_53`,facePile:`_facePile_l4ywf_59`,callList:`_callList_l4ywf_63`,disabled:`_disabled_l4ywf_74`},RX=({rooms:e,client:t})=>(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:LX.callList,children:[e.map(({room:e,roomName:n,avatarUrl:r,participants:i})=>(0,W.jsx)(zX,{client:t,name:n,avatarUrl:r,room:e,participants:i},e.roomId)),e.length>3&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:LX.callTileSpacer}),(0,W.jsx)(`div`,{className:LX.callTileSpacer})]})]})}),zX=({name:e,avatarUrl:t,room:n,client:r})=>{let{t:i}=Ni(),a=Ii(n.roomId),[o,s]=(0,M.useState)(!1),c=(0,M.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),s(!0),r.leave(n.roomId).catch(()=>s(!1))},[n,r]),l=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ue,{id:n.roomId,name:e,size:Mr.LG,src:t}),(0,W.jsx)(`div`,{className:LX.callInfo,children:(0,W.jsx)(ei,{weight:`semibold`,className:LX.callName,children:e})}),(0,W.jsx)(He,{onClick:c,disabled:o,"aria-label":i(`action.remove`),children:(0,W.jsx)(pe,{})})]});return(0,W.jsx)(`div`,{className:LX.callTile,children:o?(0,W.jsx)(`span`,{className:(0,U.default)(LX.callTileLink,LX.disabled),children:l}):(0,W.jsx)(nr,{to:Cr(n.roomId,a,n.name),className:LX.callTileLink,children:l})})},BX=({client:e})=>{let{header:t}=sn(),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(),[o]=gt(),s=ri(),{t:c}=Ni(),[l,u]=(0,M.useState)(!1),d=(0,M.useCallback)(()=>u(!1),[u]),f=(0,M.useCallback)(t=>{t.preventDefault();let n=new FormData(t.target).get(`callName`),i=typeof n==`string`?wi(n):``;async function o(){a(void 0),r(!0);let t=await Ai(e,i,fn.SHARED_KEY);if(!t.password)throw Error(`Failed to create room with shared secret`);await s(Cr(t.roomId,{kind:fn.SHARED_KEY,secret:t.password},i))}o().catch(e=>{e.errcode===`M_ROOM_IN_USE`?(g(ni(i)),r(!1),a(void 0),u(!0)):(h.error(e),r(!1),a(e))})},[e,s,u]),p=FX(e),[m,g]=(0,M.useState)(),_=(0,M.useCallback)(()=>{s(`/${m}`)?.catch(e=>{h.error(`Failed to navigate to existing alias`,e)})},[s,m]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:yX.container,children:[t===`standard`&&(0,W.jsxs)(Zi,{children:[(0,W.jsx)(Ae,{children:(0,W.jsx)(Xt,{})}),(0,W.jsx)(Te,{children:(0,W.jsx)(uX,{})})]}),(0,W.jsxs)(`main`,{className:yX.main,children:[(0,W.jsx)(Xt,{className:yX.logo}),(0,W.jsx)(qr,{size:`lg`,weight:`semibold`,children:c(`start_new_call`)}),(0,W.jsxs)(_X,{className:IX.form,onSubmit:f,children:[(0,W.jsxs)(AI,{className:IX.fieldRow,children:[(0,W.jsx)(MI,{id:`callName`,name:`callName`,label:c(`call_name`),placeholder:c(`call_name`),type:`text`,required:!0,autoComplete:`off`,"data-testid":`home_callName`}),(0,W.jsx)(Pi,{type:`submit`,size:`lg`,className:IX.button,disabled:n,"data-testid":`home_go`,children:c(n?`common.loading`:`action.go`)})]}),o===null&&(0,W.jsx)(ei,{size:`sm`,className:IX.notice,children:(0,W.jsx)(zI,{})}),i&&(0,W.jsx)(AI,{className:IX.fieldRow,children:(0,W.jsx)(NI,{error:i})})]}),p.length>0&&(0,W.jsx)(RX,{rooms:p,client:e})]})]}),(0,W.jsx)(pX,{onJoin:_,open:l,onDismiss:d})]})};function VX(e){(0,M.useEffect)(()=>{let t=`Element Call`;document.title=e?`${t} | ${e}`:t},[e])}var HX=()=>{let{t:e}=Ni();VX(e(`common.home`));let t=Wr();return t?t.state===`error`?(0,W.jsx)(vn,{widget:At,error:t.error}):t.authenticated?(0,W.jsx)(BX,{client:t.authenticated.client}):(0,W.jsx)(kX,{}):(0,W.jsx)(Cn,{})},UX=(0,M.forwardRef)((e,t)=>(0,W.jsxs)(`svg`,{width:300,height:66,viewBox:`0 0 300 66`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:[(0,W.jsx)(`circle`,{cx:32.6901,cy:32.6904,r:23.496,fill:`white`}),(0,W.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M32.6137 65.2274C50.6257 65.2274 65.2274 50.6257 65.2274 32.6137C65.2274 14.6016 50.6257 0 32.6137 0C14.6016 0 0 14.6016 0 32.6137C0 50.6257 14.6016 65.2274 32.6137 65.2274ZM26.6511 15.1961C26.6511 13.8796 27.7205 12.8124 29.0397 12.8124C37.9808 12.8124 45.2291 20.0456 45.2291 28.9681C45.2291 30.2846 44.1596 31.3518 42.8405 31.3518C41.5213 31.3518 40.4519 30.2846 40.4519 28.9681C40.4519 22.6785 35.3425 17.5797 29.0397 17.5797C27.7205 17.5797 26.6511 16.5125 26.6511 15.1961ZM52.4139 28.9683C52.4139 27.6518 51.3445 26.5846 50.0253 26.5846C48.7061 26.5846 47.6367 27.6518 47.6367 28.9683C47.6367 35.2579 42.5274 40.3567 36.2246 40.3567C34.9054 40.3567 33.836 41.4239 33.836 42.7404C33.836 44.0568 34.9054 45.124 36.2246 45.124C45.1657 45.124 52.4139 37.8909 52.4139 28.9683ZM38.6134 50.031C38.6134 51.3475 37.544 52.4146 36.2248 52.4146C27.2837 52.4146 20.0355 45.1815 20.0355 36.2589C20.0355 34.9425 21.1049 33.8753 22.4241 33.8753C23.7432 33.8753 24.8127 34.9425 24.8127 36.2589C24.8127 42.5486 29.922 47.6474 36.2248 47.6474C37.544 47.6474 38.6134 48.7146 38.6134 50.031ZM12.8113 36.2589C12.8113 37.5754 13.8808 38.6426 15.1999 38.6426C16.5191 38.6426 17.5885 37.5754 17.5885 36.2589C17.5885 29.9693 22.6979 24.8705 29.0007 24.8705C30.3198 24.8705 31.3893 23.8033 31.3893 22.4869C31.3893 21.1704 30.3198 20.1032 29.0007 20.1032C20.0595 20.1032 12.8113 27.3364 12.8113 36.2589Z`,fill:`#0DBD8B`}),(0,W.jsx)(`path`,{d:`M114.73 36.9816H91.7256C91.9974 39.3888 92.871 41.3107 94.3464 42.7472C95.8217 44.1449 97.763 44.8438 100.17 44.8438C101.762 44.8438 103.199 44.4555 104.48 43.679C105.761 42.9025 106.674 41.8542 107.217 40.5341H114.206C113.274 43.6014 111.527 46.0862 108.964 47.9887C106.441 49.8523 103.451 50.7842 99.9955 50.7842C95.4917 50.7842 91.8421 49.2894 89.0466 46.2998C86.29 43.3102 84.9117 39.5247 84.9117 34.9432C84.9117 30.4783 86.3094 26.7316 89.1049 23.7032C91.9003 20.6747 95.5111 19.1605 99.9373 19.1605C104.363 19.1605 107.935 20.6553 110.653 23.6449C113.41 26.5957 114.788 30.323 114.788 34.8267L114.73 36.9816ZM99.9373 24.8097C97.763 24.8097 95.9576 25.4503 94.5211 26.7316C93.0845 28.0128 92.1915 29.7212 91.8421 31.8566H107.916C107.605 29.7212 106.751 28.0128 105.353 26.7316C103.956 25.4503 102.15 24.8097 99.9373 24.8097Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M119.557 41.0583V6.40625H126.488V41.1748C126.488 42.7278 127.342 43.5043 129.05 43.5043L130.273 43.4461V50.0271C129.613 50.1435 128.914 50.2018 128.177 50.2018C125.187 50.2018 122.993 49.4447 121.596 47.9305C120.237 46.4163 119.557 44.1255 119.557 41.0583Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M162.549 36.9816H139.545C139.817 39.3888 140.69 41.3107 142.166 42.7472C143.641 44.1449 145.582 44.8438 147.99 44.8438C149.582 44.8438 151.018 44.4555 152.299 43.679C153.581 42.9025 154.493 41.8542 155.037 40.5341H162.025C161.093 43.6014 159.346 46.0862 156.784 47.9887C154.26 49.8523 151.27 50.7842 147.815 50.7842C143.311 50.7842 139.662 49.2894 136.866 46.2998C134.109 43.3102 132.731 39.5247 132.731 34.9432C132.731 30.4783 134.129 26.7316 136.924 23.7032C139.72 20.6747 143.331 19.1605 147.757 19.1605C152.183 19.1605 155.755 20.6553 158.473 23.6449C161.229 26.5957 162.608 30.323 162.608 34.8267L162.549 36.9816ZM147.757 24.8097C145.582 24.8097 143.777 25.4503 142.341 26.7316C140.904 28.0128 140.011 29.7212 139.662 31.8566H155.735C155.425 29.7212 154.571 28.0128 153.173 26.7316C151.775 25.4503 149.97 24.8097 147.757 24.8097Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M193.817 32.7302V50.0853H186.887V31.973C186.887 27.3916 184.984 25.1009 181.179 25.1009C179.122 25.1009 177.471 25.7609 176.229 27.081C175.025 28.4011 174.424 30.2065 174.424 32.4972V50.0853H167.493V19.8594H173.9V23.8779C174.637 22.519 175.763 21.393 177.277 20.5C178.792 19.607 180.675 19.1605 182.927 19.1605C187.12 19.1605 190.148 20.7524 192.012 23.9361C194.574 20.7524 197.991 19.1605 202.262 19.1605C205.795 19.1605 208.513 20.2671 210.415 22.4801C212.318 24.6544 213.269 27.5275 213.269 31.0995V50.0853H206.338V31.973C206.338 27.3916 204.436 25.1009 200.631 25.1009C198.535 25.1009 196.865 25.7803 195.623 27.1392C194.419 28.4593 193.817 30.323 193.817 32.7302Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M247.735 36.9816H224.731C225.002 39.3888 225.876 41.3107 227.351 42.7472C228.827 44.1449 230.768 44.8438 233.175 44.8438C234.767 44.8438 236.204 44.4555 237.485 43.679C238.766 42.9025 239.678 41.8542 240.222 40.5341H247.211C246.279 43.6014 244.532 46.0862 241.969 47.9887C239.446 49.8523 236.456 50.7842 233 50.7842C228.497 50.7842 224.847 49.2894 222.052 46.2998C219.295 43.3102 217.917 39.5247 217.917 34.9432C217.917 30.4783 219.314 26.7316 222.11 23.7032C224.905 20.6747 228.516 19.1605 232.942 19.1605C237.368 19.1605 240.94 20.6553 243.658 23.6449C246.415 26.5957 247.793 30.323 247.793 34.8267L247.735 36.9816ZM232.942 24.8097C230.768 24.8097 228.963 25.4503 227.526 26.7316C226.089 28.0128 225.196 29.7212 224.847 31.8566H240.921C240.61 29.7212 239.756 28.0128 238.358 26.7316C236.961 25.4503 235.155 24.8097 232.942 24.8097Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M259.085 19.8594V23.8779C259.784 22.5578 260.929 21.4513 262.521 20.5583C264.152 19.6264 266.113 19.1605 268.403 19.1605C271.975 19.1605 274.732 20.2477 276.673 22.4219C278.653 24.5961 279.643 27.4887 279.643 31.0995V50.0853H272.713V31.973C272.713 29.8376 272.208 28.1681 271.199 26.9645C270.228 25.7221 268.733 25.1009 266.714 25.1009C264.501 25.1009 262.754 25.7609 261.473 27.081C260.23 28.4011 259.609 30.2259 259.609 32.5554V50.0853H252.679V19.8594H259.085Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M299.884 43.912V49.9106C299.029 50.1435 297.826 50.26 296.273 50.26C290.371 50.26 287.42 47.2898 287.42 41.3495V25.3921H282.82V19.8594H287.42V11.9972H294.351V19.8594H300V25.3921H294.351V40.6506C294.351 43.019 295.477 44.2032 297.729 44.2032L299.884 43.912Z`,fill:`white`})]})),WX={logo:`_logo_1gx2r_8`,container:`_container_1gx2r_14`,content:`_content_1gx2r_22`,formContainer:`_formContainer_1gx2r_30`,authLinks:`_authLinks_1gx2r_62`};function GX(e){return(0,M.useCallback)(async(t,n,r)=>{let i=cr({baseUrl:t}),{user_id:a,access_token:o,device_id:s}=await new li({matrixClient:i,doRequest:async()=>i.login(`m.login.password`,{identifier:{type:`m.id.user`,user:n},password:r}),stateUpdated:()=>{},requestEmailToken:async()=>Promise.resolve({sid:``})}).attemptAuth(),c={user_id:a,access_token:o,device_id:s,passwordlessUser:!1};return await e?.logout(!0),[await Nn({baseUrl:t,accessToken:o,userId:a,deviceId:s},!1),c]},[e])}var KX=()=>{let{t:e}=Ni();VX(e(`login_title`));let{client:t,setClient:n}=sr(),r=GX(t),i=ze.defaultHomeserverUrl(),a=(0,M.useRef)(null),o=(0,M.useRef)(null),s=ri(),c=Pn(),[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(),p=(0,M.useCallback)(e=>{if(e.preventDefault(),u(!0),!i||!a.current||!o.current){f(Error(`Login parameters are undefined`)),u(!1);return}r(i,a.current.value,o.current.value).then(async([e,t])=>{if(!n)return;n(e,t);let r=c.state;r&&r.from?await s(r.from):await s(`/`),vr.instance.eventLogin.track()}).catch(e=>{f(e),u(!1)})},[r,c,s,i,n]),m=ze.defaultServerName()?.slice(0,25);return m=m?.length===ze.defaultServerName()?.length?m:m+`...`,(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:WX.container,children:(0,W.jsxs)(`div`,{className:WX.content,children:[(0,W.jsxs)(`div`,{className:WX.formContainer,children:[(0,W.jsx)(UX,{width:`auto`,height:`auto`,className:WX.logo}),(0,W.jsx)(`h2`,{children:e(`log_in`)}),(0,W.jsx)(`h4`,{children:e(`login_subheading`)}),(0,W.jsxs)(`form`,{onSubmit:p,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{type:`text`,ref:a,placeholder:e(`common.username`),label:e(`common.username`),autoCorrect:`off`,autoCapitalize:`none`,prefix:`@`,suffix:`:${m}`,"data-testid":`login_username`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{type:`password`,ref:o,placeholder:e(`common.password`),label:e(`common.password`),"data-testid":`login_password`})}),d&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:d})}),(0,W.jsx)(AI,{children:(0,W.jsx)(Pi,{type:`submit`,disabled:l,"data-testid":`login_login`,children:e(l?`logging_in`:`login_title`)})})]})]}),(0,W.jsxs)(`div`,{className:WX.authLinks,children:[(0,W.jsx)(`p`,{children:e(`login_auth_links_prompt`)}),(0,W.jsx)(`p`,{children:(0,W.jsxs)(ON,{i18nKey:`login_auth_links`,children:[(0,W.jsx)(tr,{to:`/register`,children:`Create an account`}),` Or `,(0,W.jsx)(tr,{to:`/`,children:`Access as a guest`})]})})]})]})})})},qX=()=>{let{t:e}=Ni();VX(e(`action.register`));let{loading:t,authenticated:n,passwordlessUser:r,client:i,setClient:a}=ci(),o=(0,M.useRef)(null),s=ri(),c=Pn(),[l,u]=(0,M.useState)(!1),[d,f]=(0,M.useState)(),[p,m]=(0,M.useState)(``),[g,_]=(0,M.useState)(``),{recaptchaKey:v,register:y}=dX(i),{execute:b,reset:x,recaptchaId:S}=hX(v),C=(0,M.useCallback)(e=>{e.preventDefault();let t=new FormData(e.target),n=t.get(`userName`),o=t.get(`password`);o===t.get(`passwordConfirmation`)&&(async()=>{u(!0);let[e,t]=await y(n,o,n,await b(),r);if(i&&i?.groupCallEventHandler&&r)for(let t of i.groupCallEventHandler.groupCalls.values()){let n=t.room.roomId;try{await e.joinRoom(n)}catch(t){t.errcode===`M_LIMIT_EXCEEDED`?(await te(t.data.retry_after_ms),await e.joinRoom(n)):(oi(t),h.error(`Couldn't join room ${n}`,t))}}a?.(e,t),vr.instance.eventSignup.cacheSignupEnd(new Date)})().then(async()=>{c.state?.from?await s(c.state?.from):await s(`/`)}).catch(e=>{f(e),u(!1),x()})},[y,c,s,r,x,b,i,a]);return(0,M.useEffect)(()=>{p&&g&&p!==g?o.current?.setCustomValidity(e(`register.passwords_must_match`)):o.current?.setCustomValidity(``)},[p,g,e]),(0,M.useEffect)(()=>{!t&&n&&!r&&!l&&s(`/`)?.catch(e=>{h.error(`Failed to navigate to /`,e)})},[t,s,n,r,l]),t?(0,W.jsx)(Cn,{}):(vr.instance.eventSignup.cacheSignupStart(new Date),(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(`div`,{className:WX.container,children:(0,W.jsxs)(`div`,{className:WX.content,children:[(0,W.jsxs)(`div`,{className:WX.formContainer,children:[(0,W.jsx)(UX,{width:`auto`,height:`auto`,className:WX.logo}),(0,W.jsx)(`h2`,{children:e(`register_heading`)}),(0,W.jsxs)(`form`,{onSubmit:C,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{type:`text`,name:`userName`,placeholder:e(`common.username`),label:e(`common.username`),autoCorrect:`off`,autoCapitalize:`none`,prefix:`@`,suffix:`:${ze.defaultServerName()}`,"data-testid":`register_username`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{required:!0,name:`password`,type:`password`,onChange:e=>m(e.target.value),value:p,placeholder:e(`common.password`),label:e(`common.password`),"data-testid":`register_password`})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{required:!0,type:`password`,name:`passwordConfirmation`,onChange:e=>_(e.target.value),value:g,placeholder:e(`register_confirm_password_label`),label:e(`register_confirm_password_label`),ref:o,"data-testid":`register_confirm_password`})}),(0,W.jsx)(ei,{size:`sm`,children:(0,W.jsxs)(ON,{i18nKey:`recaptcha_ssla_caption`,children:[`This site is protected by ReCAPTCHA and the Google`,` `,(0,W.jsx)(Vi,{href:`https://www.google.com/policies/privacy/`,children:`Privacy Policy`}),` `,`and`,` `,(0,W.jsx)(Vi,{href:`https://policies.google.com/terms`,children:`Terms of Service`}),` `,`apply.`,(0,W.jsx)(`br`,{}),`By clicking "Register", you agree to our`,` `,(0,W.jsx)(Vi,{href:ze.get().ssla,children:`Software and Services License Agreement (SSLA)`})]})}),d&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:d})}),(0,W.jsx)(AI,{children:(0,W.jsx)(Pi,{type:`submit`,disabled:l,"data-testid":`register_register`,children:e(l?`register.registering`:`action.register`)})}),(0,W.jsx)(`div`,{id:S})]})]}),(0,W.jsx)(`div`,{className:WX.authLinks,children:(0,W.jsxs)(ON,{i18nKey:`register_auth_links`,children:[(0,W.jsx)(`p`,{children:`Already have an account?`}),(0,W.jsxs)(`p`,{children:[(0,W.jsx)(tr,{to:`/login`,children:`Log in`}),` Or `,(0,W.jsx)(tr,{to:`/`,children:`Access as a guest`})]})]})})]})})}))},JX={form:`_form_1wfyo_8`,headline:`_headline_1wfyo_18`,callEndedContent:`_callEndedContent_1wfyo_23`,callEndedButton:`_callEndedButton_1wfyo_32`,container:`_container_1wfyo_37`,main:`_main_1wfyo_45`,logo:`_logo_1wfyo_53`,footer:`_footer_1wfyo_62`};function YX(){let{setClient:e}=sr(),{privacyPolicyUrl:t,recaptchaKey:n,register:r}=dX(),{execute:i,reset:a,recaptchaId:o}=hX(n);return{privacyPolicyUrl:t,registerPasswordlessUser:(0,M.useCallback)(async t=>{if(!e)throw Error(`No client context`);if(At)throw Error(`Registration was skipped: We should never try to register password-less user in embedded mode.`);try{let n=await i(),[a,o]=await r(OX(),m(16),t,n,!0);e(a,o)}catch(e){throw a(),e}},[i,a,r,e]),recaptchaId:o}}var XX=()=>{let{header:e}=sn(),[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(),{registerPasswordlessUser:a,recaptchaId:o}=YX(),s=(0,M.useCallback)(e=>{e.preventDefault(),n(!0);let t=new FormData(e.target).get(`displayName`);a(typeof t==`string`?t:``).catch(t=>{h.error(`Failed to register passwordless user`,e),n(!1),i(t)})},[a]),{t:c}=Ni(),l=Pn();return(0,W.jsxs)(W.Fragment,{children:[e===`standard`&&(0,W.jsxs)(Zi,{children:[(0,W.jsx)(Ae,{children:(0,W.jsx)(Xt,{})}),(0,W.jsx)(Te,{children:(0,W.jsx)(uX,{preventNavigation:!0})})]}),(0,W.jsxs)(`div`,{className:JX.container,children:[(0,W.jsxs)(`main`,{className:JX.main,children:[(0,W.jsx)(qr,{size:`xl`,weight:`semibold`,className:JX.headline,children:c(`lobby.join_as_guest`)}),(0,W.jsxs)(_X,{className:JX.form,onSubmit:s,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{id:`displayName`,name:`displayName`,label:c(`common.display_name`),placeholder:c(`common.display_name`),"data-testid":`joincall_displayName`,type:`text`,required:!0,autoComplete:`off`})}),(0,W.jsx)(ei,{size:`sm`,children:(0,W.jsxs)(ON,{i18nKey:`room_auth_view_ssla_caption`,children:[`By clicking "Join call now", you agree to our`,` `,(0,W.jsx)(Vi,{href:ze.get().ssla,children:`Software and Services License Agreement (SSLA)`})]})}),r&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:r})}),(0,W.jsx)(Pi,{type:`submit`,size:`lg`,disabled:t,"data-testid":`joincall_joincall`,children:c(t?`common.loading`:`room_auth_view_continue_button`)}),(0,W.jsx)(`div`,{id:o})]})]}),(0,W.jsx)(ei,{className:JX.footer,children:(0,W.jsxs)(ON,{i18nKey:`unauthenticated_view_body`,children:[`Not registered yet?`,` `,(0,W.jsx)(tr,{to:`/register`,state:{from:l},children:`Create an account`})]})})]})]})},ZX=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof t<`u`?t:typeof self<`u`?self:{};function QX(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var $X={exports:{}},eZ=$X.exports,tZ;function nZ(){return tZ||(tZ=1,(function(e){(function(t,n){e.exports?e.exports=n():t.log=n()})(eZ,function(){var e=function(){},t=`undefined`,n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=[`trace`,`debug`,`info`,`warn`,`error`],i={},a=null;function o(e,t){var n=e[t];if(typeof n.bind==`function`)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch{return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(r){return r===`debug`&&(r=`log`),typeof console===t?!1:r===`trace`&&n?s:console[r]===void 0?console.log===void 0?e:o(console,`log`):o(console,r)}function l(){for(var n=this.getLevel(),i=0;i<r.length;i++){var a=r[i];this[a]=i<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return`No console available for logging`}function u(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function d(e,t,n){return c(e)||u.apply(this,arguments)}function f(e,n){var o=this,s,c,u,f=`loglevel`;typeof e==`string`?f+=`:`+e:typeof e==`symbol`&&(f=void 0);function p(e){var n=(r[e]||`silent`).toUpperCase();if(!(typeof window===t||!f)){try{window.localStorage[f]=n;return}catch{}try{window.document.cookie=encodeURIComponent(f)+`=`+n+`;`}catch{}}}function m(){var e;if(!(typeof window===t||!f)){try{e=window.localStorage[f]}catch{}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+`=`);i!==-1&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch{}return o.levels[e]===void 0&&(e=void 0),e}}function h(){if(!(typeof window===t||!f)){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+`=; expires=Thu, 01 Jan 1970 00:00:00 UTC`}catch{}}}function g(e){var t=e;if(typeof t==`string`&&o.levels[t.toUpperCase()]!==void 0&&(t=o.levels[t.toUpperCase()]),typeof t==`number`&&t>=0&&t<=o.levels.SILENT)return t;throw TypeError(`log.setLevel() called with invalid level: `+e)}o.name=e,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||d,o.getLevel=function(){return u??c??s},o.setLevel=function(e,t){return u=g(e),t!==!1&&p(u),l.call(o)},o.setDefaultLevel=function(e){c=g(e),m()||o.setLevel(e,!1)},o.resetLevel=function(){u=null,h(),l.call(o)},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)},o.rebuild=function(){if(a!==o&&(s=g(a.getLevel())),l.call(o),a===o)for(var e in i)i[e].rebuild()},s=g(a?a.getLevel():`WARN`);var _=m();_!=null&&(u=g(_)),l.call(o)}a=new f,a.getLogger=function(e){if(typeof e!=`symbol`&&typeof e!=`string`||e===``)throw TypeError(`You must supply a name when creating a logger.`);var t=i[e];return t||=i[e]=new f(e,a.methodFactory),t};var p=typeof window===t?void 0:window.log;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=p),a},a.getLoggers=function(){return i},a.default=a,a})})($X)),$X.exports}var rZ=QX(nZ()),iZ=function(e,t){return iZ=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])},iZ(e,t)};function aZ(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);iZ(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function oZ(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function sZ(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function cZ(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function lZ(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function uZ(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function dZ(e){return this instanceof dZ?(this.v=e,this):new dZ(e)}function fZ(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof dZ?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function pZ(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof cZ==`function`?cZ(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function mZ(e){return typeof e==`function`}function hZ(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var gZ=hZ(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
206
206
  `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
207
207
  `):``,this.name=`UnsubscriptionError`,this.errors=t}});function _Z(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var vZ=(function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=cZ(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(mZ(c))try{c()}catch(e){i=e instanceof gZ?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=cZ(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{xZ(f)}catch(e){i??=[],e instanceof gZ?i=uZ(uZ([],lZ(i)),lZ(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new gZ(i)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)xZ(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&_Z(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&_Z(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),yZ=vZ.EMPTY;function bZ(e){return e instanceof vZ||e&&`closed`in e&&mZ(e.remove)&&mZ(e.add)&&mZ(e.unsubscribe)}function xZ(e){mZ(e)?e():e.unsubscribe()}var SZ={Promise:void 0},CZ={setTimeout:function(e,t){var n=[...arguments].slice(2);return setTimeout.apply(void 0,uZ([e,t],lZ(n)))},clearTimeout:function(e){return clearTimeout(e)},delegate:void 0};function wZ(e){CZ.setTimeout(function(){throw e})}function TZ(){}function EZ(e){e()}var DZ=(function(e){aZ(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,bZ(t)&&t.add(n)):n.destination=MZ,n}return t.create=function(e,t,n){return new kZ(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(vZ),OZ=(function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){AZ(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){AZ(e)}else AZ(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){AZ(e)}},e})(),kZ=(function(e){aZ(t,e);function t(t,n,r){var i=e.call(this)||this,a;return a=mZ(t)||!t?{next:t??void 0,error:n??void 0,complete:r??void 0}:t,i.destination=new OZ(a),i}return t})(DZ);function AZ(e){wZ(e)}function jZ(e){throw e}var MZ={closed:!0,next:TZ,error:jZ,complete:TZ},NZ=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function PZ(e){return e}function FZ(e){return e.length===0?PZ:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var IZ=(function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=zZ(e)?e:new kZ(e,t,n);return EZ(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=LZ(t),new t(function(t,r){var i=new kZ({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[NZ]=function(){return this},e.prototype.pipe=function(){return FZ([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=LZ(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e})();function LZ(e){return e??SZ.Promise??Promise}function RZ(e){return e&&mZ(e.next)&&mZ(e.error)&&mZ(e.complete)}function zZ(e){return e&&e instanceof DZ||RZ(e)&&bZ(e)}function BZ(e){return mZ(e?.lift)}function VZ(e){return function(t){if(BZ(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function HZ(e,t,n,r,i){return new UZ(e,t,n,r,i)}var UZ=(function(e){aZ(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t})(DZ),WZ=hZ(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),GZ=(function(e){aZ(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new KZ(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new WZ},t.prototype.next=function(e){var t=this;EZ(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=cZ(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;EZ(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;EZ(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,`observed`,{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?yZ:(this.currentObservers=null,a.push(e),new vZ(function(){t.currentObservers=null,_Z(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new IZ;return e.source=this,e},t.create=function(e,t){return new KZ(e,t)},t})(IZ),KZ=(function(e){aZ(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??yZ},t})(GZ);(function(e){aZ(t,e);function t(t){var n=e.call(this)||this;return n._value=t,n}return Object.defineProperty(t.prototype,`value`,{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){var e=this,t=e.hasError,n=e.thrownError,r=e._value;if(t)throw n;return this._throwIfClosed(),r},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t})(GZ);var qZ={now:function(){return Date.now()}},JZ=(function(e){aZ(t,e);function t(t,n){return e.call(this)||this}return t.prototype.schedule=function(e,t){return this},t})(vZ),YZ={setInterval:function(e,t){var n=[...arguments].slice(2);return setInterval.apply(void 0,uZ([e,t],lZ(n)))},clearInterval:function(e){return clearInterval(e)},delegate:void 0},XZ=(function(e){aZ(t,e);function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return t.prototype.schedule=function(e,t){if(t===void 0&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return n===void 0&&(n=0),YZ.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(n===void 0&&(n=0),n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&YZ.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;var n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,r=t.scheduler,i=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,_Z(i,this),n!=null&&(this.id=this.recycleAsyncId(r,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(JZ),ZZ=(function(){function e(t,n){n===void 0&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=qZ.now,e})();new((function(e){aZ(t,e);function t(t,n){n===void 0&&(n=ZZ.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return t.prototype.flush=function(e){var t=this.actions;if(this._active){t.push(e);return}var n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}},t})(ZZ))(XZ);function QZ(e){return e&&mZ(e.schedule)}function $Z(e){return e[e.length-1]}function eQ(e){return QZ($Z(e))?e.pop():void 0}var tQ=(function(e){return e&&typeof e.length==`number`&&typeof e!=`function`});function nQ(e){return mZ(e?.then)}function rQ(e){return mZ(e[NZ])}function iQ(e){return Symbol.asyncIterator&&mZ(e?.[Symbol.asyncIterator])}function aQ(e){return TypeError(`You provided `+(typeof e==`object`&&e?`an invalid object`:`'`+e+`'`)+` where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function oQ(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var sQ=oQ();function cQ(e){return mZ(e?.[sQ])}function lQ(e){return fZ(this,arguments,function(){var t,n,r,i;return sZ(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,dZ(t.read())];case 3:return n=a.sent(),r=n.value,i=n.done,i?[4,dZ(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,dZ(r)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function uQ(e){return mZ(e?.getReader)}function dQ(e){if(e instanceof IZ)return e;if(e!=null){if(rQ(e))return fQ(e);if(tQ(e))return pQ(e);if(nQ(e))return mQ(e);if(iQ(e))return gQ(e);if(cQ(e))return hQ(e);if(uQ(e))return _Q(e)}throw aQ(e)}function fQ(e){return new IZ(function(t){var n=e[NZ]();if(mZ(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function pQ(e){return new IZ(function(t){for(var n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function mQ(e){return new IZ(function(t){e.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,wZ)})}function hQ(e){return new IZ(function(t){var n,r;try{for(var i=cZ(e),a=i.next();!a.done;a=i.next()){var o=a.value;if(t.next(o),t.closed)return}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()})}function gQ(e){return new IZ(function(t){vQ(e,t).catch(function(e){return t.error(e)})})}function _Q(e){return gQ(lQ(e))}function vQ(e,t){var n,r,i,a;return oZ(this,void 0,void 0,function(){var o,s;return sZ(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=pZ(e),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),r.done)return[3,4];if(o=r.value,t.next(o),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=c.sent(),i={error:s},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}function yQ(e,t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}function bQ(e,t){return t===void 0&&(t=0),VZ(function(n,r){n.subscribe(HZ(r,function(n){return yQ(r,e,function(){return r.next(n)},t)},function(){return yQ(r,e,function(){return r.complete()},t)},function(n){return yQ(r,e,function(){return r.error(n)},t)}))})}function xQ(e,t){return t===void 0&&(t=0),VZ(function(n,r){r.add(e.schedule(function(){return n.subscribe(r)},t))})}function SQ(e,t){return dQ(e).pipe(xQ(t),bQ(t))}function CQ(e,t){return dQ(e).pipe(xQ(t),bQ(t))}function wQ(e,t){return new IZ(function(n){var r=0;return t.schedule(function(){r===e.length?n.complete():(n.next(e[r++]),n.closed||this.schedule())})})}function TQ(e,t){return new IZ(function(n){var r;return yQ(n,t,function(){r=e[sQ](),yQ(n,t,function(){var e,t,i;try{e=r.next(),t=e.value,i=e.done}catch(e){n.error(e);return}i?n.complete():n.next(t)},0,!0)}),function(){return mZ(r?.return)&&r.return()}})}function EQ(e,t){if(!e)throw Error(`Iterable cannot be null`);return new IZ(function(n){yQ(n,t,function(){var r=e[Symbol.asyncIterator]();yQ(n,t,function(){r.next().then(function(e){e.done?n.complete():n.next(e.value)})},0,!0)})})}function DQ(e,t){return EQ(lQ(e),t)}function OQ(e,t){if(e!=null){if(rQ(e))return SQ(e,t);if(tQ(e))return wQ(e,t);if(nQ(e))return CQ(e,t);if(iQ(e))return EQ(e,t);if(cQ(e))return TQ(e,t);if(uQ(e))return DQ(e,t)}throw aQ(e)}function kQ(e,t){return t?OQ(e,t):dQ(e)}hZ(function(e){return function(t){t===void 0&&(t=null),e(this),this.message=`Timeout has occurred`,this.name=`TimeoutError`,this.info=t}});function AQ(e,t){return VZ(function(n,r){var i=0;n.subscribe(HZ(r,function(n){r.next(e.call(t,n,i++))}))})}Array.isArray;function jQ(e,t,n,r,i,a,o,s){var c=[],l=0,u=0,d=!1,f=function(){d&&!c.length&&!l&&t.complete()},p=function(e){return l<r?m(e):c.push(e)},m=function(e){l++;var i=!1;dQ(n(e,u++)).subscribe(HZ(t,function(e){t.next(e)},function(){i=!0},void 0,function(){if(i)try{l--;for(var e=function(){var e=c.shift();o||m(e)};c.length&&l<r;)e();f()}catch(e){t.error(e)}}))};return e.subscribe(HZ(t,p,function(){d=!0,f()})),function(){}}function MQ(e,t,n){return n===void 0&&(n=1/0),mZ(t)?MQ(function(n,r){return AQ(function(e,i){return t(n,e,r,i)})(dQ(e(n,r)))},n):(typeof t==`number`&&(n=t),VZ(function(t,r){return jQ(t,r,e,n)}))}function NQ(e){return MQ(PZ,e)}function PQ(){return NQ(1)}function FQ(){var e=[...arguments];return PQ()(kQ(e,eQ(e)))}function IQ(){var e=[...arguments],t=eQ(e);return VZ(function(n,r){(t?FQ(e,n,t):FQ(e,n)).subscribe(r)})}var LQ=`lk`;function RQ(e){return typeof e>`u`?!1:zQ(e)||BQ(e)}function zQ(e){return e?e.hasOwnProperty(`participant`)&&e.hasOwnProperty(`source`)&&e.hasOwnProperty(`track`)&&typeof e.publication?.track<`u`:!1}function BQ(e){return e?e.hasOwnProperty(`participant`)&&e.hasOwnProperty(`source`)&&e.hasOwnProperty(`publication`)&&typeof e.publication<`u`:!1}var VQ=[...[L.ConnectionStateChanged,L.RoomMetadataChanged,L.ActiveSpeakersChanged,L.ConnectionQualityChanged,L.ParticipantConnected,L.ParticipantDisconnected,L.ParticipantPermissionsChanged,L.ParticipantMetadataChanged,L.ParticipantNameChanged,L.ParticipantAttributesChanged,L.TrackMuted,L.TrackUnmuted,L.TrackPublished,L.TrackUnpublished,L.TrackStreamStateChanged,L.TrackSubscriptionFailed,L.TrackSubscriptionPermissionChanged,L.TrackSubscriptionStatusChanged],L.LocalTrackPublished,L.LocalTrackUnpublished];R.TrackPublished,R.TrackUnpublished,R.TrackMuted,R.TrackUnmuted,R.TrackStreamStateChanged,R.TrackSubscribed,R.TrackUnsubscribed,R.TrackSubscriptionPermissionChanged,R.TrackSubscriptionFailed,R.LocalTrackPublished,R.LocalTrackUnpublished,[...[R.ConnectionQualityChanged,R.IsSpeakingChanged,R.ParticipantMetadataChanged,R.ParticipantPermissionsChanged,R.TrackMuted,R.TrackUnmuted,R.TrackPublished,R.TrackUnpublished,R.TrackStreamStateChanged,R.TrackSubscriptionFailed,R.TrackSubscriptionPermissionChanged,R.TrackSubscriptionStatusChanged],R.LocalTrackPublished,R.LocalTrackUnpublished];var HQ=rZ.getLogger(`lk-components-js`);HQ.setDefaultLevel(`WARN`);var UQ=(e=>(e.AgentState=`lk.agent.state`,e.PublishOnBehalf=`lk.publish_on_behalf`,e.TranscriptionFinal=`lk.transcription_final`,e.TranscriptionSegmentId=`lk.segment_id`,e.TranscribedTrackId=`lk.transcribed_track_id`,e))(UQ||{});function WQ(e){return typeof e==`object`}function GQ(e){return Array.isArray(e)&&e.filter(WQ).length>0}function KQ(e){return`${LQ}-${e}`}function qQ(e){let t=JQ(e),n=ZQ(e.participant).pipe(AQ(()=>JQ(e)),IQ(t));return{className:KQ(e.source===V.Source.Camera||e.source===V.Source.ScreenShare?`participant-media-video`:`participant-media-audio`),trackObserver:n}}function JQ(e){if(RQ(e))return e.publication;{let{source:t,name:n,participant:r}=e;if(t&&n)return r.getTrackPublications().find(e=>e.source===t&&e.trackName===n);if(n)return r.getTrackPublicationByName(n);if(t)return r.getTrackPublication(t);throw Error(`At least one of source and name needs to be defined`)}}function YQ(e,...t){return new IZ(n=>{let r=()=>{n.next(e)};return t.forEach(t=>{e.on(t,r)}),()=>{t.forEach(t=>{e.off(t,r)})}}).pipe(IQ(e))}function XQ(e,...t){return new IZ(n=>{let r=()=>{n.next(e)};return t.forEach(t=>{e.on(t,r)}),()=>{t.forEach(t=>{e.off(t,r)})}}).pipe(IQ(e))}function ZQ(e){return XQ(e,R.TrackMuted,R.TrackUnmuted,R.ParticipantPermissionsChanged,R.TrackPublished,R.TrackUnpublished,R.LocalTrackPublished,R.LocalTrackUnpublished,R.MediaDevicesError,R.TrackSubscriptionStatusChanged).pipe(AQ(e=>{let{isMicrophoneEnabled:t,isCameraEnabled:n,isScreenShareEnabled:r}=e,i=e.getTrackPublication(V.Source.Microphone);return{isCameraEnabled:n,isMicrophoneEnabled:t,isScreenShareEnabled:r,cameraTrack:e.getTrackPublication(V.Source.Camera),microphoneTrack:i,participant:e}}))}function QQ(e,t,n=!0){let r=[e.localParticipant,...Array.from(e.remoteParticipants.values())],i=[];return r.forEach(e=>{t.forEach(t=>{let r=Array.from(e.trackPublications.values()).filter(e=>e.source===t&&(!n||e.track)).map(t=>({participant:e,publication:t,source:t.source}));i.push(...r)})}),{trackReferences:i,participants:r}}function $Q(e,t,n){let r=n.additionalRoomEvents??VQ,i=n.onlySubscribed??!0;return YQ(e,...Array.from(new Set([L.ParticipantConnected,L.ParticipantDisconnected,L.ConnectionStateChanged,L.LocalTrackPublished,L.LocalTrackUnpublished,L.TrackPublished,L.TrackUnpublished,L.TrackSubscriptionStatusChanged,...r]).values())).pipe(AQ(e=>{let n=QQ(e,t,i);return HQ.debug(`TrackReference[] was updated. (length ${n.trackReferences.length})`,n),n}),IQ(QQ(e,t,i)))}function e$(e,t){if(typeof localStorage>`u`){HQ.error(`Local storage is not available.`);return}try{if(t){let n=Object.fromEntries(Object.entries(t).filter(([,e])=>e!==``));localStorage.setItem(e,JSON.stringify(n))}}catch(e){HQ.error(`Error setting item to local storage: ${e}`)}}function t$(e){if(typeof localStorage>`u`){HQ.error(`Local storage is not available.`);return}try{let t=localStorage.getItem(e);if(!t){HQ.warn(`Item with key ${e} does not exist in local storage.`);return}return JSON.parse(t)}catch(e){HQ.error(`Error getting item from local storage: ${e}`);return}}function n$(e){return{load:()=>t$(e),save:t=>e$(e,t)}}var{load:Oee,save:kee}=n$(`${LQ}-user-choices`);M.createContext(void 0);var r$=M.createContext(void 0);function i$(){return M.useContext(r$)}function a$(e){let t=i$(),n=e??t;if(!n)throw Error(`No TrackRef, make sure you are inside a TrackRefContext or pass the TrackRef explicitly`);return n}M.createContext(void 0);var o$=M.createContext(void 0);function s$(){return M.useContext(o$)}function c$(e){let t=s$(),n=e??t;if(!n)throw Error(`No room provided, make sure you are inside a Room context or pass the room explicitly`);return n}M.createContext(void 0),M.createContext(void 0),Li();function l$(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=l$(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function u$(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=l$(e))&&(r&&(r+=` `),r+=t);return r}function d$(...e){return(...t)=>{for(let n of e)if(typeof n==`function`)try{n(...t)}catch(e){console.error(e)}}}function f$(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],i=r[e];typeof n==`function`&&typeof i==`function`&&e[0]===`o`&&e[1]===`n`&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=d$(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=u$(n,i):t[e]=i===void 0?n:i}}return t}function p$(e){return e!==void 0}function m$(...e){return f$(...e.filter(p$))}function h$(e,t){return e===`processor`&&t&&typeof t==`object`&&`name`in t?t.name:e===`e2ee`&&t?`e2ee-enabled`:t}function g$(e=[V.Source.Camera,V.Source.Microphone,V.Source.ScreenShare,V.Source.ScreenShareAudio,V.Source.Unknown],t={}){let n=c$(t.room),[r,i]=M.useState([]),[a,o]=M.useState([]),s=M.useMemo(()=>e.map(e=>WQ(e)?e.source:e),[JSON.stringify(e)]);return M.useEffect(()=>{let e=$Q(n,s,{additionalRoomEvents:t.updateOnlyOn,onlySubscribed:t.onlySubscribed}).subscribe(({trackReferences:e,participants:t})=>{HQ.debug(`setting track bundles`,e,t),i(e),o(t)});return()=>e.unsubscribe()},[n,JSON.stringify(t.onlySubscribed),JSON.stringify(t.updateOnlyOn),JSON.stringify(e)]),M.useMemo(()=>{if(GQ(e)){let t=v$(e,a),n=Array.from(r);return a.forEach(e=>{t.has(e.identity)&&(t.get(e.identity)??[]).forEach(t=>{if(r.find(({participant:n,publication:r})=>e.identity===n.identity&&r.source===t))return;HQ.debug(`Add ${t} placeholder for participant ${e.identity}.`);let i={participant:e,source:t};n.push(i)})}),n}else return r},[r,a,e])}function _$(e,t){let n=new Set(e);for(let e of t)n.delete(e);return n}function v$(e,t){let n=new Map;if(GQ(e)){let r=e.filter(e=>e.withPlaceholder).map(e=>e.source);t.forEach(e=>{let t=e.getTrackPublications().map(e=>e.track?.source).filter(e=>e!==void 0),i=Array.from(_$(new Set(r),new Set(t)));i.length>0&&n.set(e.identity,i)})}return n}UQ.AgentState;var y$={exports:{}},b$;function x$(){if(b$)return y$.exports;b$=1;var e=typeof Reflect==`object`?Reflect:null,t=e&&typeof e.apply==`function`?e.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},n=e&&typeof e.ownKeys==`function`?e.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function r(e){console&&console.warn&&console.warn(e)}var i=Number.isNaN||function(e){return e!==e};function a(){a.init.call(this)}y$.exports=a,y$.exports.once=_,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(a,`defaultMaxListeners`,{enumerable:!0,get:function(){return o},set:function(e){if(typeof e!=`number`||e<0||i(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);o=e}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||i(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function c(e){return e._maxListeners===void 0?a.defaultMaxListeners:e._maxListeners}a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)t(c,this,n);else for(var l=c.length,u=m(c,l),r=0;r<l;++r)t(u[r],this,n);return!0};function l(e,t,n,i){var a,o,l;if(s(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),l=o[t]),l===void 0)l=o[t]=n,++e._eventsCount;else if(typeof l==`function`?l=o[t]=i?[n,l]:[l,n]:i?l.unshift(n):l.push(n),a=c(e),a>0&&l.length>a&&!l.warned){l.warned=!0;var u=Error(`Possible EventEmitter memory leak detected. `+l.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);u.name=`MaxListenersExceededWarning`,u.emitter=e,u.type=t,u.count=l.length,r(u)}return e}a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}a.prototype.once=function(e,t){return s(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,a,o;if(s(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():h(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function f(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?g(i):m(i,i.length)}a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p;function p(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function m(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function g(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function _(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),t!==`error`&&v(e,i,{once:!0})})}function v(e,t,n){typeof e.on==`function`&&y(e,`error`,t,n)}function y(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}return y$.exports}x$();function S$(e,t={}){let[n,r]=M.useState(JQ(e)),[i,a]=M.useState(n?.isMuted),[o,s]=M.useState(n?.isSubscribed),[c,l]=M.useState(n?.track),[u,d]=M.useState(`landscape`),f=M.useRef(),{className:p,trackObserver:m}=M.useMemo(()=>qQ(e),[e.participant.sid??e.participant.identity,e.source,RQ(e)&&e.publication.trackSid]);return M.useEffect(()=>{let e=m.subscribe(e=>{HQ.debug(`update track`,e),r(e),a(e?.isMuted),s(e?.isSubscribed),l(e?.track)});return()=>e?.unsubscribe()},[m]),M.useEffect(()=>{var n;return c&&(f.current&&c.detach(f.current),(n=t.element)!=null&&n.current&&!(e.participant.isLocal&&c?.kind===`audio`)&&c.attach(t.element.current)),f.current=t.element?.current,()=>{f.current&&c?.detach(f.current)}},[c,t.element]),M.useEffect(()=>{typeof n?.dimensions?.width==`number`&&typeof n?.dimensions?.height==`number`&&d(n.dimensions.width>n.dimensions.height?`landscape`:`portrait`)},[n]),{publication:n,isMuted:i,isSubscribed:o,track:c,elementProps:m$(t.props,{className:p,"data-lk-local-participant":e.participant.isLocal,"data-lk-source":n?.source,...n?.kind===`video`&&{"data-lk-orientation":u}})}}var C$,w$;function T$(){if(w$)return C$;w$=1;var e=`Expected a function`,t=NaN,n=`[object Symbol]`,r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt,c=typeof ZX==`object`&&ZX&&ZX.Object===Object&&ZX,l=typeof self==`object`&&self&&self.Object===Object&&self,u=c||l||Function(`return this`)(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return u.Date.now()};function h(t,n,r){var i,a,o,s,c,l,u=0,d=!1,h=!1,_=!0;if(typeof t!=`function`)throw TypeError(e);n=y(n)||0,g(r)&&(d=!!r.leading,h=`maxWait`in r,o=h?f(y(r.maxWait)||0,n):o,_=`trailing`in r?!!r.trailing:_);function v(e){var n=i,r=a;return i=a=void 0,u=e,s=t.apply(r,n),s}function b(e){return u=e,c=setTimeout(C,n),d?v(e):s}function x(e){var t=e-l,r=e-u,i=n-t;return h?p(i,o-r):i}function S(e){var t=e-l,r=e-u;return l===void 0||t>=n||t<0||h&&r>=o}function C(){var e=m();if(S(e))return w(e);c=setTimeout(C,x(e))}function w(e){return c=void 0,_&&i?v(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function E(){return c===void 0?s:w(m())}function ee(){var e=m(),t=S(e);if(i=arguments,a=this,l=e,t){if(c===void 0)return b(l);if(h)return c=setTimeout(C,n),v(l)}return c===void 0&&(c=setTimeout(C,n)),s}return ee.cancel=T,ee.flush=E,ee}function g(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function _(e){return!!e&&typeof e==`object`}function v(e){return typeof e==`symbol`||_(e)&&d.call(e)==n}function y(e){if(typeof e==`number`)return e;if(v(e))return t;if(g(e)){var n=typeof e.valueOf==`function`?e.valueOf():e;e=g(n)?n+``:n}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(r,``);var c=a.test(e);return c||o.test(e)?s(e.slice(2),c?2:8):i.test(e)?t:+e}return C$=h,C$}var E$=QX(T$());function D$(e){let t=(0,M.useRef)(e);t.current=e,(0,M.useEffect)(()=>()=>{t.current()},[])}function O$(e,t=500,n){let r=(0,M.useRef)();D$(()=>{r.current&&r.current.cancel()});let i=(0,M.useMemo)(()=>{let i=E$(e,t,n),a=(...e)=>i(...e);return a.cancel=()=>{i.cancel()},a.isPending=()=>!!r.current,a.flush=()=>i.flush(),a},[e,t,n]);return(0,M.useEffect)(()=>{r.current=E$(e,t,n)},[e,t,n]),i}function k$(e,t,n){let r=((e,t)=>e===t),i=e instanceof Function?e():e,[a,o]=(0,M.useState)(i),s=(0,M.useRef)(i),c=O$(o,t,n);return r(s.current,i)||(c(i),s.current=i),[a,c]}function A$({threshold:e=0,root:t=null,rootMargin:n=`0%`,freezeOnceVisible:r=!1,initialIsIntersecting:i=!1,onChange:a}={}){let[o,s]=(0,M.useState)(null),[c,l]=(0,M.useState)(()=>({isIntersecting:i,entry:void 0})),u=(0,M.useRef)();u.current=a;let d=c.entry?.isIntersecting&&r;(0,M.useEffect)(()=>{if(!o||!(`IntersectionObserver`in window)||d)return;let r=new IntersectionObserver(e=>{let t=Array.isArray(r.thresholds)?r.thresholds:[r.thresholds];e.forEach(e=>{let n=e.isIntersecting&&t.some(t=>e.intersectionRatio>=t);l({isIntersecting:n,entry:e}),u.current&&u.current(n,e)})},{threshold:e,root:t,rootMargin:n});return r.observe(o),()=>{r.disconnect()}},[o,JSON.stringify(e),t,n,d,r]);let f=(0,M.useRef)(null);(0,M.useEffect)(()=>{var e;!o&&(e=c.entry)!=null&&e.target&&!r&&!d&&f.current!==c.entry.target&&(f.current=c.entry.target,l({isIntersecting:i,entry:void 0}))},[o,c.entry,r,d,i]);let p=[s,!!c.isIntersecting,c.entry];return p.ref=p[0],p.isIntersecting=p[1],p.entry=p[2],p}var j$=M.forwardRef(function({onTrackClick:e,onClick:t,onSubscriptionStatusChanged:n,trackRef:r,manageSubscription:i,...a},o){let s=a$(r),c=M.useRef(null);M.useImperativeHandle(o,()=>c.current);let l=A$({root:c.current}),[u]=k$(l,3e3);M.useEffect(()=>{i&&s.publication instanceof W_&&u?.isIntersecting===!1&&l?.isIntersecting===!1&&s.publication.setSubscribed(!1)},[u,s,i]),M.useEffect(()=>{i&&s.publication instanceof W_&&l?.isIntersecting===!0&&s.publication.setSubscribed(!0)},[l,s,i]);let{elementProps:d,publication:f,isSubscribed:p}=S$(s,{element:c,props:a});M.useEffect(()=>{n?.(!!p)},[p,n]);let m=n=>{t?.(n),e?.({participant:s?.participant,track:f})};return M.createElement(`video`,{ref:c,...d,muted:!0,onClick:m})}),M$=M.forwardRef(function({trackRef:e,onSubscriptionStatusChanged:t,volume:n,...r},i){let a=a$(e),o=M.useRef(null);M.useImperativeHandle(i,()=>o.current);let{elementProps:s,isSubscribed:c,track:l,publication:u}=S$(a,{element:o,props:r});return M.useEffect(()=>{t?.(!!c)},[c,t]),M.useEffect(()=>{l===void 0||n===void 0||(l instanceof O_?l.setVolume(n):HQ.warn(`Volume can only be set on remote audio tracks.`))},[n,l]),M.useEffect(()=>{u===void 0||r.muted===void 0||(u instanceof W_?u.setEnabled(!r.muted):HQ.warn(`Can only call setEnabled on remote track publications.`))},[r.muted,u,l]),M.createElement(`audio`,{ref:o,...s})});function N$(e,t){let[n,r]=M.useState(),i=M.useMemo(()=>new ja,[]);return M.useEffect(()=>{let n=!1,a=[];return i.lock().then(async i=>{try{(e.audio||e.video)&&(a=await I_(e),n?a.forEach(e=>e.stop()):r(a))}catch(e){t&&e instanceof Error?t(e):HQ.error(e)}finally{i()}}),()=>{n=!0,a.forEach(e=>{e.stop()})}},[JSON.stringify(e,h$),t,i]),n}var P$={inRoom:`_inRoom_nrfzp_8`,header:`_header_nrfzp_17`,filler:`_filler_nrfzp_29`,invite:`_invite_nrfzp_35`,fixedGrid:`_fixedGrid_nrfzp_40`,scrollingGrid:`_scrollingGrid_nrfzp_46`,tile:`_tile_nrfzp_65`,maximised:`_maximised_nrfzp_70`},F$={content:`_content_1cy0f_8`,wait:`_wait_1cy0f_19`,join:`_join_1cy0f_32`};function I$(e,t){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>e(...r),t)}}function L$({debounce:e,scroll:t,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){let i=n||(typeof window>`u`?class{}:window.ResizeObserver);if(!i)throw Error(`This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills`);let[a,o]=(0,M.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),s=(0,M.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),c=e?typeof e==`number`?e:e.scroll:null,l=e?typeof e==`number`?e:e.resize:null,u=(0,M.useRef)(!1);(0,M.useEffect)(()=>(u.current=!0,()=>void(u.current=!1)));let[d,f,p]=(0,M.useMemo)(()=>{let e=()=>{if(!s.current.element)return;let{left:e,top:t,width:n,height:i,bottom:a,right:c,x:l,y:d}=s.current.element.getBoundingClientRect(),f={left:e,top:t,width:n,height:i,bottom:a,right:c,x:l,y:d};s.current.element instanceof HTMLElement&&r&&(f.height=s.current.element.offsetHeight,f.width=s.current.element.offsetWidth),Object.freeze(f),u.current&&!H$(s.current.lastBounds,f)&&o(s.current.lastBounds=f)};return[e,l?I$(e,l):e,c?I$(e,c):e]},[o,r,c,l]);function m(){s.current.scrollContainers&&(s.current.scrollContainers.forEach(e=>e.removeEventListener(`scroll`,p,!0)),s.current.scrollContainers=null),s.current.resizeObserver&&(s.current.resizeObserver.disconnect(),s.current.resizeObserver=null),s.current.orientationHandler&&(`orientation`in screen&&`removeEventListener`in screen.orientation?screen.orientation.removeEventListener(`change`,s.current.orientationHandler):`onorientationchange`in window&&window.removeEventListener(`orientationchange`,s.current.orientationHandler))}function h(){s.current.element&&(s.current.resizeObserver=new i(p),s.current.resizeObserver.observe(s.current.element),t&&s.current.scrollContainers&&s.current.scrollContainers.forEach(e=>e.addEventListener(`scroll`,p,{capture:!0,passive:!0})),s.current.orientationHandler=()=>{p()},`orientation`in screen&&`addEventListener`in screen.orientation?screen.orientation.addEventListener(`change`,s.current.orientationHandler):`onorientationchange`in window&&window.addEventListener(`orientationchange`,s.current.orientationHandler))}return z$(p,!!t),R$(f),(0,M.useEffect)(()=>{m(),h()},[t,p,f]),(0,M.useEffect)(()=>m,[]),[e=>{!e||e===s.current.element||(m(),s.current.element=e,s.current.scrollContainers=B$(e),h())},a,d]}function R$(e){(0,M.useEffect)(()=>{let t=e;return window.addEventListener(`resize`,t),()=>void window.removeEventListener(`resize`,t)},[e])}function z$(e,t){(0,M.useEffect)(()=>{if(t){let t=e;return window.addEventListener(`scroll`,t,{capture:!0,passive:!0}),()=>void window.removeEventListener(`scroll`,t,!0)}},[e,t])}function B$(e){let t=[];if(!e||e===document.body)return t;let{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(e);return[n,r,i].some(e=>e===`auto`||e===`scroll`)&&t.push(e),[...t,...B$(e.parentElement)]}var V$=[`x`,`y`,`top`,`bottom`,`left`,`right`,`width`,`height`],H$=(e,t)=>V$.every(n=>e[n]===t[n]),U$={loading:`_loading_14w06_8`},W$=({size:e,loading:t,...n})=>(0,W.jsxs)(`div`,{children:[t&&(0,W.jsx)(`div`,{className:U$.loading,children:(0,W.jsx)(Aj,{size:e/3})}),(0,W.jsx)(ue,{size:e,...n})]}),G$={preview:`_preview_1jjvr_8`,mirror:`_mirror_1jjvr_24`,cameraStarting:`_cameraStarting_1jjvr_28`,avatarContainer:`_avatarContainer_1jjvr_39`,buttonBar:`_buttonBar_1jjvr_51`},K$=({matrixInfo:e,videoEnabled:t,videoTrack:n,children:r})=>{let{t:i}=Ni(),[a,o]=L$(),s=(0,M.useRef)(null);(0,M.useEffect)(()=>(s.current&&n?.attach(s.current),()=>{n?.detach()}),[n]);let c=(0,M.useMemo)(()=>t&&!n,[t,n]);return(0,W.jsxs)(`div`,{className:(0,U.default)(G$.preview),ref:a,children:[(0,W.jsx)(`video`,{className:n&&tv(n).facingMode===`user`?G$.mirror:void 0,ref:s,muted:!0,playsInline:!0,tabIndex:-1,disablePictureInPicture:!0}),(!t||c)&&(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(`div`,{className:G$.avatarContainer,children:[c&&(0,W.jsx)(`div`,{className:G$.cameraStarting,role:`status`,children:i(`video_tile.camera_starting`)}),(0,W.jsx)(W$,{id:e.userId,name:e.displayName,size:Math.min(o.width,o.height)/2,src:e.avatarUrl,loading:c})]})}),(0,W.jsx)(`div`,{className:G$.buttonBar,children:r})]})},q$=e=>{let{t}=Ni();return(0,W.jsx)(Pi,{kind:`secondary`,size:`sm`,Icon:See,...e,children:t(`action.invite`)})};function J$(e){let t=(0,M.useRef)(void 0);return t.current??={value:e()},t.current.value}var Y$=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:48,height:48,viewBox:`0 0 48 48`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsxs)(`g`,{id:`Logo Mark`,children:[(0,W.jsx)(`rect`,{width:47.86,height:48,rx:23.93,fill:`#0DBD8B`}),(0,W.jsxs)(`g`,{id:`Union`,children:[(0,W.jsx)(`path`,{d:`M21.3075 9.42871C20.3396 9.42871 19.5549 10.214 19.5549 11.1828C19.5549 12.1516 20.3396 12.9369 21.3075 12.9369C25.9321 12.9369 29.6811 16.689 29.6811 21.3175C29.6811 22.2863 30.4657 23.0716 31.4337 23.0716C32.4016 23.0716 33.1863 22.2863 33.1863 21.3175C33.1863 14.7515 27.868 9.42871 21.3075 9.42871Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M38.4591 21.3174C38.4591 20.3486 37.6745 19.5633 36.7065 19.5633C35.7386 19.5633 34.9539 20.3486 34.9539 21.3174C34.9539 25.9459 31.2049 29.698 26.5804 29.698C25.6124 29.698 24.8277 30.4833 24.8277 31.4521C24.8277 32.4209 25.6124 33.2062 26.5804 33.2062C33.1408 33.2062 38.4591 27.8834 38.4591 21.3174Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M28.3329 36.8173C28.3329 37.786 27.5482 38.5714 26.5803 38.5714C20.0198 38.5714 14.7015 33.2486 14.7015 26.6826C14.7015 25.7138 15.4862 24.9285 16.4541 24.9285C17.4221 24.9285 18.2067 25.7138 18.2067 26.6826C18.2067 31.3111 21.9557 35.0632 26.5803 35.0632C27.5482 35.0632 28.3329 35.8485 28.3329 36.8173Z`,fill:`white`}),(0,W.jsx)(`path`,{d:`M9.40112 26.6827C9.40112 27.6514 10.1858 28.4368 11.1537 28.4368C12.1217 28.4368 12.9064 27.6514 12.9064 26.6827C12.9064 22.0542 16.6553 18.3021 21.2799 18.3021C22.2478 18.3021 23.0325 17.5167 23.0325 16.548C23.0325 15.5792 22.2478 14.7939 21.2799 14.7939C14.7194 14.7939 9.40112 20.1167 9.40112 26.6827Z`,fill:`white`})]})]})})),X$=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:160,height:22,viewBox:`0 0 160 22`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`g`,{id:`Logo Type`,children:(0,W.jsxs)(`g`,{id:`Vector`,children:[(0,W.jsx)(`path`,{d:`M14.8673 15.1575H3.39742C3.53293 16.3508 3.96849 17.3036 4.70411 18.0157C5.43974 18.7087 6.40766 19.0551 7.60789 19.0551C8.40159 19.0551 9.11785 18.8626 9.75668 18.4777C10.3955 18.0927 10.8504 17.5731 11.1215 16.9186H14.606C14.1414 18.4392 13.2702 19.671 11.9926 20.6142C10.7343 21.5381 9.24368 22 7.52078 22C5.27519 22 3.45549 21.259 2.06168 19.7769C0.687227 18.2948 0 16.4182 0 14.147C0 11.9335 0.696906 10.0761 2.09072 8.5748C3.48453 7.07349 5.28487 6.32283 7.49174 6.32283C9.69861 6.32283 11.4796 7.06387 12.8347 8.54593C14.2091 10.0087 14.8964 11.8565 14.8964 14.0892L14.8673 15.1575ZM7.49174 9.12336C6.40766 9.12336 5.50749 9.44095 4.79123 10.0761C4.07496 10.7113 3.62972 11.5582 3.45549 12.6168H11.4699C11.315 11.5582 10.8892 10.7113 10.1922 10.0761C9.49534 9.44095 8.59517 9.12336 7.49174 9.12336Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M17.2743 17.1785V0H20.7298V17.2362C20.7298 18.0061 21.1557 18.3911 22.0074 18.3911L22.6172 18.3622V21.6247C22.2881 21.6824 21.9397 21.7113 21.5719 21.7113C20.0813 21.7113 18.9875 21.336 18.2906 20.5853C17.6131 19.8346 17.2743 18.699 17.2743 17.1785Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M38.71 15.1575H27.2401C27.3756 16.3508 27.8112 17.3036 28.5468 18.0157C29.2824 18.7087 30.2504 19.0551 31.4506 19.0551C32.2443 19.0551 32.9606 18.8626 33.5994 18.4777C34.2382 18.0927 34.6931 17.5731 34.9642 16.9186H38.4487C37.9841 18.4392 37.113 19.671 35.8353 20.6142C34.577 21.5381 33.0864 22 31.3635 22C29.1179 22 27.2982 21.259 25.9044 19.7769C24.5299 18.2948 23.8427 16.4182 23.8427 14.147C23.8427 11.9335 24.5396 10.0761 25.9334 8.5748C27.3272 7.07349 29.1276 6.32283 31.3344 6.32283C33.5413 6.32283 35.3223 7.06387 36.6774 8.54593C38.0518 10.0087 38.7391 11.8565 38.7391 14.0892L38.71 15.1575ZM31.3344 9.12336C30.2504 9.12336 29.3502 9.44095 28.6339 10.0761C27.9177 10.7113 27.4724 11.5582 27.2982 12.6168H35.3126C35.1577 11.5582 34.7319 10.7113 34.035 10.0761C33.3381 9.44095 32.4379 9.12336 31.3344 9.12336Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M54.3001 13.0499V21.6535H50.8446V12.6745C50.8446 10.4033 49.8961 9.26772 47.9989 9.26772C46.9729 9.26772 46.1502 9.59493 45.5307 10.2493C44.9306 10.9038 44.6306 11.7988 44.6306 12.9344V21.6535H41.1751V6.66929H44.3692V8.66142C44.737 7.98775 45.2984 7.42957 46.0534 6.98688C46.8084 6.54418 47.7473 6.32283 48.8701 6.32283C50.9608 6.32283 52.4707 7.11199 53.4 8.69029C54.6776 7.11199 56.3812 6.32283 58.5106 6.32283C60.2722 6.32283 61.6273 6.87139 62.5759 7.9685C63.5244 9.04637 63.9987 10.4707 63.9987 12.2415V21.6535H60.5432V12.6745C60.5432 10.4033 59.5947 9.26772 57.6975 9.26772C56.6522 9.26772 55.8198 9.60455 55.2003 10.2782C54.6002 10.9326 54.3001 11.8565 54.3001 13.0499Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M81.1834 15.1575H69.7135C69.849 16.3508 70.2846 17.3036 71.0202 18.0157C71.7558 18.7087 72.7237 19.0551 73.924 19.0551C74.7177 19.0551 75.4339 18.8626 76.0728 18.4777C76.7116 18.0927 77.1665 17.5731 77.4375 16.9186H80.9221C80.4575 18.4392 79.5863 19.671 78.3087 20.6142C77.0504 21.5381 75.5598 22 73.8369 22C71.5913 22 69.7716 21.259 68.3778 19.7769C67.0033 18.2948 66.3161 16.4182 66.3161 14.147C66.3161 11.9335 67.013 10.0761 68.4068 8.5748C69.8006 7.07349 71.601 6.32283 73.8078 6.32283C76.0147 6.32283 77.7957 7.06387 79.1508 8.54593C80.5252 10.0087 81.2124 11.8565 81.2124 14.0892L81.1834 15.1575ZM73.8078 9.12336C72.7237 9.12336 71.8236 9.44095 71.1073 10.0761C70.391 10.7113 69.9458 11.5582 69.7716 12.6168H77.786C77.6311 11.5582 77.2052 10.7113 76.5083 10.0761C75.8114 9.44095 74.9113 9.12336 73.8078 9.12336Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M86.8426 6.66929V8.66142C87.191 8.007 87.7621 7.45844 88.5558 7.01575C89.3689 6.55381 90.3465 6.32283 91.4886 6.32283C93.2696 6.32283 94.6441 6.86177 95.612 7.93963C96.5993 9.0175 97.0929 10.4514 97.0929 12.2415V21.6535H93.6374V12.6745C93.6374 11.6159 93.3858 10.7883 92.8824 10.1916C92.3985 9.57568 91.6532 9.26772 90.6465 9.26772C89.5431 9.26772 88.672 9.59493 88.0331 10.2493C87.4137 10.9038 87.1039 11.8084 87.1039 12.9633V21.6535H83.6484V6.66929H86.8426Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M107.185 18.5932V21.5669C106.759 21.6824 106.159 21.7402 105.384 21.7402C102.442 21.7402 100.971 20.2677 100.971 17.3228V9.41208H98.6766V6.66929H100.971V2.77165H104.426V6.66929H107.243V9.41208H104.426V16.9764C104.426 18.1505 104.987 18.7375 106.11 18.7375L107.185 18.5932Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M116.115 18.9881C114.474 17.2035 113.653 14.9429 113.653 12.2064C113.653 9.4699 114.474 7.21782 116.115 5.45015C117.773 3.66548 119.953 2.77314 122.654 2.77314C124.876 2.77314 126.756 3.38503 128.295 4.6088C129.833 5.83258 130.816 7.47277 131.244 9.52939H129.269C128.91 7.99967 128.132 6.7844 126.936 5.88357C125.739 4.98273 124.312 4.53232 122.654 4.53232C120.534 4.53232 118.824 5.23769 117.525 6.64842C116.243 8.05916 115.602 9.91182 115.602 12.2064C115.602 14.501 116.243 16.3536 117.525 17.7644C118.824 19.1751 120.534 19.8805 122.654 19.8805C124.312 19.8805 125.739 19.4301 126.936 18.5292C128.132 17.6284 128.91 16.4131 129.269 14.8834H131.244C130.816 16.94 129.833 18.5802 128.295 19.804C126.756 21.0278 124.876 21.6397 122.654 21.6397C119.953 21.6397 117.773 20.7558 116.115 18.9881Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M143.174 15.0874C140.832 15.0874 139.233 15.1384 138.379 15.2403C137.541 15.3253 136.926 15.4698 136.532 15.6738C135.831 16.0647 135.481 16.6936 135.481 17.5604C135.481 19.2261 136.473 20.0589 138.456 20.0589C139.977 20.0589 141.139 19.719 141.943 19.0391C142.763 18.3593 143.174 17.4499 143.174 16.3111V15.0874ZM138.25 21.5632C136.763 21.5632 135.626 21.2062 134.84 20.4924C134.071 19.7615 133.686 18.8012 133.686 17.6114C133.686 16.8295 133.891 16.1327 134.301 15.5208C134.729 14.9089 135.31 14.4585 136.045 14.1695C136.661 13.9316 137.455 13.7786 138.43 13.7106C139.404 13.6256 140.986 13.5831 143.174 13.5831V12.7418C143.174 10.6002 141.943 9.52939 139.481 9.52939C137.361 9.52939 136.131 10.3877 135.789 12.1044H134.019C134.207 10.8466 134.746 9.84383 135.635 9.09597C136.541 8.34811 137.849 7.97418 139.558 7.97418C141.387 7.97418 142.746 8.3991 143.635 9.24894C144.541 10.0988 144.994 11.2716 144.994 12.7673V21.2572H143.251V19.3706C142.345 20.8323 140.678 21.5632 138.25 21.5632Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M149.358 18.4018V2.13576H151.178V18.1978C151.178 18.7247 151.264 19.0901 151.435 19.2941C151.623 19.498 151.956 19.6 152.435 19.6L152.948 19.549V21.2062C152.657 21.2572 152.341 21.2827 151.999 21.2827C150.238 21.2827 149.358 20.3224 149.358 18.4018Z`,fill:`currentColor`}),(0,W.jsx)(`path`,{d:`M155.944 18.4018V2.13576H157.764V18.1978C157.764 18.7247 157.85 19.0901 158.021 19.2941C158.209 19.498 158.542 19.6 159.021 19.6L159.534 19.549V21.2062C159.243 21.2572 158.927 21.2827 158.585 21.2827C156.824 21.2827 155.944 20.3224 155.944 18.4018Z`,fill:`currentColor`})]})})})),Z$={toggle:`_toggle_z1rxf_8`},Q$=({layout:e,setLayout:t,className:n})=>{let{t:r}=Ni(),i=(0,M.useCallback)(e=>t(e.target.value),[t]);return(0,W.jsxs)(`form`,{className:(0,U.default)(Z$.toggle,n),children:[(0,W.jsx)($t,{label:r(`layout_spotlight_label`),children:(0,W.jsx)(`input`,{type:`radio`,name:`layout`,value:`spotlight`,checked:e===`spotlight`,onChange:i})}),(0,W.jsx)(QN,{"aria-hidden":!0,width:24,height:24}),(0,W.jsx)($t,{label:r(`layout_grid_label`),children:(0,W.jsx)(`input`,{type:`radio`,name:`layout`,value:`grid`,checked:e===`grid`,onChange:i})}),(0,W.jsx)(BN,{"aria-hidden":!0,width:24,height:24})]})},$$=({ref:e,children:t,asOverlay:n,hidden:r,hideControls:i,hideLogo:a,asPip:o,layoutMode:s,setLayoutMode:c,openSettings:l,audioEnabled:u,videoEnabled:d,toggleAudio:f,toggleVideo:p,sharingScreen:m,toggleScreenSharing:h,reactionIdentifier:g,reactionData:_,audioOutputSwitcher:v,hangup:y,debugTileLayout:b,tileStoreGeneration:x})=>{let S=[],C=o?`sm`:`lg`,w=l!==void 0&&!o&&!i,T=!o&&!i,E=!o||!a&&!b,ee=!a&&!o;w&&S.push((0,W.jsx)(Sr,{showForScreenWidth:`narrow`,onClick:l,"data-testid":`settings-bottom-center`},`settings`)),S.push((0,W.jsx)(Yr,{size:C,enabled:u??!1,onClick:f,disabled:f===void 0,"data-testid":`incall_mute`},`audio`),(0,W.jsx)(Ki,{size:C,enabled:d??!1,onClick:p,disabled:p===void 0,"data-testid":`incall_videomute`},`video`)),h!==void 0&&S.push((0,W.jsx)(Mn,{size:C,className:sa.shareScreen,enabled:m??!1,onClick:h,"data-testid":`incall_screenshare`},`share_screen`)),g&&_&&S.push((0,W.jsx)(re,{size:C,reactionData:_??{handsRaised$:new Ge({}),reactions$:new Ge({})},className:sa.raiseHand,identifier:g},`raise_hand`));let te=(0,M.useMemo)(()=>v===void 0?null:(0,W.jsx)(pi,{size:C,onClick:()=>v.switch(),loudspeakerModeEnabled:v.targetOutput===`earpiece`}),[v,C]);te&&S.push(te),y&&S.push((0,W.jsx)(fr,{size:C,onClick:y,"data-testid":`incall_leave`},`end_call`));let ne=(0,W.jsxs)(`div`,{className:sa.logo,children:[ee&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Y$,{width:24,height:24,"aria-hidden":!0}),(0,W.jsx)(X$,{width:80,height:11,"aria-label":`Element Call`})]}),b?`Tiles generation: ${x}`:void 0]});return(0,W.jsxs)(`div`,{ref:e,className:(0,U.default)(sa.footer,{[sa.overlay]:n,[sa.hidden]:r}),children:[(0,W.jsxs)(`div`,{className:sa.settingsLogoContainer,children:[w&&(0,W.jsx)(_r,{kind:`secondary`,showForScreenWidth:`wide`,onClick:l,"data-testid":`settings-bottom-left`},`settings`),t,E&&ne]}),!i&&(0,W.jsx)(`div`,{className:sa.buttons,children:S}),c&&s&&T&&(0,W.jsx)(Q$,{className:sa.layout,layout:s,setLayout:c})]})},e1=({client:e,matrixInfo:t,muteStates:n,onEnter:r,enterLabel:i,confineToRoom:a,hideHeader:o,participantCount:s,onShareClick:c,waitingForInvite:l})=>{(0,M.useEffect)(()=>(h.info(`[Lifecycle] LobbyView Component mounted`),()=>{h.info(`[Lifecycle] LobbyView Component unmounted`)}),[]);let{t:u}=Ni();VX(t.roomName);let d=k(n.audio.enabled$),f=k(n.video.enabled$),p=k(n.audio.toggle$),m=k(n.video.toggle$),[g,_]=(0,M.useState)(!1),[v,y]=(0,M.useState)(nX),b=(0,M.useCallback)(()=>_(!0),[_]),x=(0,M.useCallback)(()=>_(!1),[_]),S=ri(),C=(0,M.useCallback)(()=>{S(`/`)?.catch(e=>{h.error(`Failed to navigate to /`,e)})},[S]),w=Lr(`(max-height: 500px)`),T=!a&&(0,W.jsx)(tr,{className:F$.recents,to:`/`,children:u(`lobby.leave_button`)}),E=$L(),ee=XL(E.videoInput.selected$)?.id,te=J$(()=>d&&{deviceId:wL(E.audioInput.selected$)?.id}),{processor:ne}=bY(),re=J$(()=>ne),ie=N$((0,M.useMemo)(()=>({audio:Object.assign({},te),video:f&&{deviceId:ee,processor:re}}),[te,f,ee,re]),(0,M.useCallback)(e=>{h.error(`Error while creating preview Tracks:`,e),n.audio.setEnabled$.value?.(!1),n.video.setEnabled$.value?.(!1)},[n])),ae=(0,M.useMemo)(()=>ie?.find(e=>e.kind===V.Kind.Video)??null,[ie]);return(0,M.useEffect)(()=>{ae&&ee===void 0&&E.requestDeviceNames()},[E,ee,ae]),CY(ae),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:(0,U.default)(F$.room,P$.inRoom),children:[!o&&(0,W.jsxs)(Zi,{children:[(0,W.jsx)(Ae,{children:(0,W.jsx)(Tt,{id:t.roomId,name:t.roomName,avatarUrl:t.roomAvatar,encrypted:t.e2eeSystem.kind!==fn.NONE,participantCount:s})}),(0,W.jsx)(Te,{children:c!==null&&(0,W.jsx)(q$,{onClick:c})})]}),(0,W.jsxs)(`div`,{className:F$.content,children:[(0,W.jsx)(K$,{matrixInfo:t,videoEnabled:f,videoTrack:ae,children:(0,W.jsx)(Pi,{className:(0,U.default)(F$.join,{[F$.wait]:l}),size:l?`sm`:`lg`,disabled:l,onClick:()=>{l||r()},"data-testid":`lobby_joinCall`,children:i??u(`lobby.join_button`)})}),!w&&T]}),(0,W.jsx)($$,{audioEnabled:d,videoEnabled:f,toggleAudio:p??void 0,toggleVideo:m??void 0,openSettings:b,hangup:a?void 0:C,hideLogo:o,children:w&&T})]}),e&&(0,W.jsx)(rX,{client:e,open:g,onDismiss:x,tab:v,onTabChange:y})]})},t1={headline:`_headline_1em2y_8`,callEndedContent:`_callEndedContent_1em2y_15`,disconnectedButtons:`_disconnectedButtons_1em2y_26`,rageshakeButton:`_rageshakeButton_1em2y_31`,callEndedButton:`_callEndedButton_1em2y_35`,submitButton:`_submitButton_1em2y_40`,container:`_container_1em2y_47`,main:`_main_1em2y_55`,logo:`_logo_1em2y_63`,footer:`_footer_1em2y_72`},n1={starIcon:`_starIcon_1m09w_8`,starRating:`_starRating_1m09w_12`,inputContainer:`_inputContainer_1m09w_18`,hideElement:`_hideElement_1m09w_22`},r1=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:28,height:26,viewBox:`0 0 28 26`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`path`,{d:`M14 21.0267L22.24 26.0001L20.0533 16.6267L27.3333 10.3201L17.7466 9.50675L14 0.666748L10.2533 9.50675L0.666626 10.3201L7.94663 16.6267L5.75996 26.0001L14 21.0267Z`,fill:`currentColor`})})),i1=(0,M.forwardRef)((e,t)=>(0,W.jsx)(`svg`,{width:28,height:26,viewBox:`0 0 28 26`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:(0,W.jsx)(`path`,{id:`Vector`,d:`M14 7.50675L15.2933 10.5601L15.92 12.0401L17.52 12.1734L20.8133 12.4534L18.3066 14.6267L17.0933 15.6801L17.4533 17.2534L18.2 20.4667L15.3733 18.7601L14 17.9067L12.6266 18.7334L9.79996 20.4401L10.5466 17.2267L10.9066 15.6534L9.69329 14.6001L7.18663 12.4267L10.48 12.1467L12.08 12.0134L12.7066 10.5334L14 7.50675M14 0.666748L10.2533 9.50675L0.666626 10.3201L7.94663 16.6267L5.75996 26.0001L14 21.0267L22.24 26.0001L20.0533 16.6267L27.3333 10.3201L17.7466 9.50675L14 0.666748Z`,fill:`currentColor`})}));function a1({starCount:e,onChange:t,required:n}){let[r,i]=(0,M.useState)(0),[a,o]=(0,M.useState)(0),{t:s}=Ni();return(0,W.jsx)(`div`,{className:n1.starRating,children:[...Array(e)].map((e,n)=>(n+=1,(0,W.jsxs)(`div`,{className:n1.inputContainer,onMouseEnter:()=>o(n),onMouseLeave:()=>o(r),children:[(0,W.jsx)(`input`,{className:n1.hideElement,type:`radio`,id:`starInput`+String(n),value:String(n)+`Star`,name:`star rating`,onChange:e=>{i(n),t(n)},required:!0}),(0,W.jsx)(`label`,{className:n1.hideElement,id:`starInvisibleLabel`+String(n),htmlFor:`starInput`+String(n),children:s(`star_rating_input_label`,{count:n})}),(0,W.jsx)(`label`,{className:n1.starIcon,id:`starIcon`+String(n),htmlFor:`starInput`+String(n),children:n<=(a||r)?(0,W.jsx)(r1,{}):(0,W.jsx)(i1,{})})]},n)))})}var o1=({client:e,isPasswordlessUser:t,hideHeader:n,confineToRoom:r,endedCallId:i})=>{let{t:a}=Ni(),o=ri(),{displayName:s}=xI(e),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(0),[f,p]=(0,M.useState)(!1),[m,g]=(0,M.useState)(!1),_=(0,M.useCallback)(e=>{e.preventDefault();let n=new FormData(e.target).get(`feedbackText`);vr.instance.eventQualitySurvey.track(i,n,u),p(!0),setTimeout(()=>{g(!0),setTimeout(()=>{t?l(!0):r||o(`/`)?.catch(e=>{h.error(`Failed to navigate to /`,e)})},1e3)},1e3)},[i,o,t,r,u]),v=t&&(0,W.jsxs)(`div`,{className:t1.callEndedContent,children:[(0,W.jsxs)(ON,{i18nKey:`call_ended_view.create_account_prompt`,children:[(0,W.jsx)(`p`,{children:`Why not finish by setting up a password to keep your account?`}),(0,W.jsx)(`p`,{children:`You'll be able to keep your name and set an avatar for use on future calls`})]}),(0,W.jsx)(Ur,{className:t1.callEndedButton,to:`/register`,children:a(`call_ended_view.create_account_button`)})]}),y=(0,W.jsxs)(`div`,{className:t1.callEndedContent,children:[(0,W.jsx)(ON,{i18nKey:`call_ended_view.feedback_prompt`,children:(0,W.jsx)(`p`,{children:`We'd love to hear your feedback so we can improve your experience.`})}),(0,W.jsxs)(`form`,{onSubmit:_,children:[(0,W.jsx)(AI,{children:(0,W.jsx)(a1,{starCount:5,onChange:d,required:!0})}),(0,W.jsx)(AI,{children:(0,W.jsx)(MI,{className:RI.feedback,id:`feedbackText`,name:`feedbackText`,label:a(`settings.feedback_tab_description_label`),placeholder:a(`settings.feedback_tab_description_label`),type:`textarea`})}),` `,(0,W.jsx)(AI,{children:m?(0,W.jsx)(ON,{i18nKey:`call_ended_view.feedback_done`,children:(0,W.jsx)(`p`,{children:`Thanks for your feedback!`})}):(0,W.jsx)(Pi,{type:`submit`,className:t1.submitButton,"data-testid":`home_go`,children:a(f?`submitting`:`action.submit`)})})]})]});return(0,W.jsxs)(W.Fragment,{children:[!n&&(0,W.jsxs)(Zi,{children:[(0,W.jsx)(Ae,{children:!r&&(0,W.jsx)(Xt,{})}),(0,W.jsx)(Te,{})]}),(0,W.jsxs)(`div`,{className:t1.container,children:[(0,W.jsxs)(`main`,{className:t1.main,children:[(0,W.jsx)(qr,{size:`xl`,weight:`semibold`,className:t1.headline,children:c?a(`call_ended_view.headline`,{displayName:s}):a(`call_ended_view.headline`,{displayName:s})+`
208
208
  `+a(`call_ended_view.survey_prompt`)}),(!c||r)&&vr.instance.isEnabled()?y:v]}),!r&&(0,W.jsx)(ei,{className:t1.footer,children:(0,W.jsxs)(tr,{to:`/`,children:[` `,a(`call_ended_view.not_now_button`),` `]})})]})]})};function s1(e,t,n){return n.find(n=>n.kind===t&&n.label===e)?.deviceId}var c1=e=>{let t=document.activeElement;return t!==null&&t.contains(e)},l1=Object.fromEntries(ut.slice(0,5).map((e,t)=>[(t+1).toString(),e]));function u1(e,t,n,r,i,a){let o=(0,M.useRef)(!1);si(window,`keydown`,(0,M.useCallback)(s=>{e.current!==null&&c1(e.current)&&(s.altKey||s.ctrlKey||s.metaKey||s.shiftKey||(s.key===`m`?(s.preventDefault(),t?.()):s.key===`v`?(s.preventDefault(),n?.()):s.key===` `?(s.preventDefault(),o.current||(o.current=!0,r?.(!0))):s.key===`h`?(s.preventDefault(),a()):l1[s.key]&&(s.preventDefault(),i(l1[s.key]))))},[e,n,t,r,i,a]),(0,M.useMemo)(()=>({capture:!0}),[])),si(window,`keyup`,(0,M.useCallback)(t=>{e.current!==null&&c1(e.current)&&t.key===` `&&(o.current=!1,r?.(!1))},[e,r])),si(window,`blur`,(0,M.useCallback)(()=>{o.current&&(o.current=!1,r?.(!0))},[r,o]))}var d1={tile:`_tile_31vx3_8`,speaking:`_speaking_31vx3_28`,handRaised:`_handRaised_31vx3_48`,muteIcon:`_muteIcon_31vx3_75`,volumeSlider:`_volumeSlider_31vx3_83`,switchCamera:`_switchCamera_31vx3_87`},f1=k1(),p1=e=>w1(e,f1),m1=k1();p1.write=e=>w1(e,m1);var h1=k1();p1.onStart=e=>w1(e,h1);var g1=k1();p1.onFrame=e=>w1(e,g1);var _1=k1();p1.onFinish=e=>w1(e,_1);var v1=[];p1.setTimeout=(e,t)=>{let n=p1.now()+t,r=()=>{let e=v1.findIndex(e=>e.cancel==r);~e&&v1.splice(e,1),S1-=+!!~e},i={time:n,handler:e,cancel:r};return v1.splice(y1(n),0,i),S1+=1,T1(),i};var y1=e=>~(~v1.findIndex(t=>t.time>e)||~v1.length);p1.cancel=e=>{h1.delete(e),g1.delete(e),_1.delete(e),f1.delete(e),m1.delete(e)},p1.sync=e=>{C1=!0,p1.batchedUpdates(e),C1=!1},p1.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...e){t=e,p1.onStart(n)}return r.handler=e,r.cancel=()=>{h1.delete(n),t=null},r};var b1=typeof window<`u`?window.requestAnimationFrame:(()=>{});p1.use=e=>b1=e,p1.now=typeof performance<`u`?()=>performance.now():Date.now,p1.batchedUpdates=e=>e(),p1.catch=console.error,p1.frameLoop=`always`,p1.advance=()=>{p1.frameLoop===`demand`?O1():console.warn(`Cannot call the manual advancement of rafz whilst frameLoop is not set as demand`)};var x1=-1,S1=0,C1=!1;function w1(e,t){C1?(t.delete(e),e(0)):(t.add(e),T1())}function T1(){x1<0&&(x1=0,p1.frameLoop!==`demand`&&b1(D1))}function E1(){x1=-1}function D1(){~x1&&(b1(D1),p1.batchedUpdates(O1))}function O1(){let e=x1;x1=p1.now();let t=y1(x1);if(t&&(A1(v1.splice(0,t),e=>e.handler()),S1-=t),!S1){E1();return}h1.flush(),f1.flush(e?Math.min(64,x1-e):16.667),g1.flush(),m1.flush(),_1.flush()}function k1(){let e=new Set,t=e;return{add(n){S1+=+(t==e&&!e.has(n)),e.add(n)},delete(n){return S1-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,S1-=t.size,A1(t,t=>t(n)&&e.add(t)),S1+=e.size,t=e)}}}function A1(e,t){e.forEach(e=>{try{t(e)}catch(e){p1.catch(e)}})}var j1=Object.defineProperty,M1=(e,t)=>{for(var n in t)j1(e,n,{get:t[n],enumerable:!0})},N1={};M1(N1,{assign:()=>J1,colors:()=>G1,createStringInterpolator:()=>U1,skipAnimation:()=>K1,to:()=>W1,willAdvance:()=>q1});function P1(){}var F1=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),$={arr:Array.isArray,obj:e=>!!e&&e.constructor.name===`Object`,fun:e=>typeof e==`function`,str:e=>typeof e==`string`,num:e=>typeof e==`number`,und:e=>e===void 0};function I1(e,t){if($.arr(e)){if(!$.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}var L1=(e,t)=>e.forEach(t);function R1(e,t,n){if($.arr(e)){for(let r=0;r<e.length;r++)t.call(n,e[r],`${r}`);return}for(let r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r)}var z1=e=>$.und(e)?[]:$.arr(e)?e:[e];function B1(e,t){if(e.size){let n=Array.from(e);e.clear(),L1(n,t)}}var V1=(e,...t)=>B1(e,e=>e(...t)),H1=()=>typeof window>`u`||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),U1,W1,G1=null,K1=!1,q1=P1,J1=e=>{e.to&&(W1=e.to),e.now&&(p1.now=e.now),e.colors!==void 0&&(G1=e.colors),e.skipAnimation!=null&&(K1=e.skipAnimation),e.createStringInterpolator&&(U1=e.createStringInterpolator),e.requestAnimationFrame&&p1.use(e.requestAnimationFrame),e.batchedUpdates&&(p1.batchedUpdates=e.batchedUpdates),e.willAdvance&&(q1=e.willAdvance),e.frameLoop&&(p1.frameLoop=e.frameLoop)},Y1=new Set,X1=[],Z1=[],Q1=0,$1={get idle(){return!Y1.size&&!X1.length},start(e){Q1>e.priority?(Y1.add(e),p1.onStart(e0)):(t0(e),p1(r0))},advance:r0,sort(e){if(Q1)p1.onFrame(()=>$1.sort(e));else{let t=X1.indexOf(e);~t&&(X1.splice(t,1),n0(e))}},clear(){X1=[],Y1.clear()}};function e0(){Y1.forEach(t0),Y1.clear(),p1(r0)}function t0(e){X1.includes(e)||n0(e)}function n0(e){X1.splice(i0(X1,t=>t.priority>e.priority),0,e)}function r0(e){let t=Z1;for(let n=0;n<X1.length;n++){let r=X1[n];Q1=r.priority,r.idle||(q1(r),r.advance(e),r.idle||t.push(r))}return Q1=0,Z1=X1,Z1.length=0,X1=t,X1.length>0}function i0(e,t){let n=e.findIndex(t);return n<0?e.length:n}var a0=(e,t,n)=>Math.min(Math.max(n,e),t),o0={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},s0=`[-+]?\\d*\\.?\\d+`,c0=s0+`%`;function l0(...e){return`\\(\\s*(`+e.join(`)\\s*,\\s*(`)+`)\\s*\\)`}var u0=RegExp(`rgb`+l0(s0,s0,s0)),d0=RegExp(`rgba`+l0(s0,s0,s0,s0)),f0=RegExp(`hsl`+l0(s0,c0,c0)),p0=RegExp(`hsla`+l0(s0,c0,c0,s0)),m0=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,h0=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,g0=/^#([0-9a-fA-F]{6})$/,_0=/^#([0-9a-fA-F]{8})$/;function v0(e){let t;return typeof e==`number`?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=g0.exec(e))?parseInt(t[1]+`ff`,16)>>>0:G1&&G1[e]!==void 0?G1[e]:(t=u0.exec(e))?(x0(t[1])<<24|x0(t[2])<<16|x0(t[3])<<8|255)>>>0:(t=d0.exec(e))?(x0(t[1])<<24|x0(t[2])<<16|x0(t[3])<<8|C0(t[4]))>>>0:(t=m0.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+`ff`,16)>>>0:(t=_0.exec(e))?parseInt(t[1],16)>>>0:(t=h0.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=f0.exec(e))?(b0(S0(t[1]),w0(t[2]),w0(t[3]))|255)>>>0:(t=p0.exec(e))?(b0(S0(t[1]),w0(t[2]),w0(t[3]))|C0(t[4]))>>>0:null}function y0(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function b0(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,a=y0(i,r,e+1/3),o=y0(i,r,e),s=y0(i,r,e-1/3);return Math.round(a*255)<<24|Math.round(o*255)<<16|Math.round(s*255)<<8}function x0(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function S0(e){return(parseFloat(e)%360+360)%360/360}function C0(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function w0(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function T0(e){let t=v0(e);return t===null?e:(t||=0,`rgba(${(t&4278190080)>>>24}, ${(t&16711680)>>>16}, ${(t&65280)>>>8}, ${(t&255)/255})`)}var E0=(e,t,n)=>{if($.fun(e))return e;if($.arr(e))return E0({range:e,output:t,extrapolate:n});if($.str(e.output[0]))return U1(e);let r=e,i=r.output,a=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||`extend`,s=r.extrapolateRight||r.extrapolate||`extend`,c=r.easing||(e=>e);return e=>{let t=O0(e,a);return D0(e,a[t],a[t+1],i[t],i[t+1],c,o,s,r.map)}};function D0(e,t,n,r,i,a,o,s,c){let l=c?c(e):e;if(l<t){if(o===`identity`)return l;o===`clamp`&&(l=t)}if(l>n){if(s===`identity`)return l;s===`clamp`&&(l=n)}return r===i?r:t===n?e<=t?r:i:(t===-1/0?l=-l:n===1/0?l-=t:l=(l-t)/(n-t),l=a(l),r===-1/0?l=-l:i===1/0?l+=r:l=l*(i-r)+r,l)}function O0(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var k0=(e,t=`end`)=>n=>{n=t===`end`?Math.min(n,.999):Math.max(n,.001);let r=n*e;return a0(0,1,(t===`end`?Math.floor(r):Math.ceil(r))/e)},A0=1.70158,j0=A0*1.525,M0=A0+1,N0=2*Math.PI/3,P0=2*Math.PI/4.5,F0=e=>{let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},I0={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-(-2*e+2)**2/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-(1-e)**3,easeInOutCubic:e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-(1-e)**4,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-(-2*e+2)**4/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-(1-e)**5,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-(-2*e+2)**5/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:2**(10*e-10),easeOutExpo:e=>e===1?1:1-2**(-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-e**2),easeOutCirc:e=>Math.sqrt(1-(e-1)**2),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-(2*e)**2))/2:(Math.sqrt(1-(-2*e+2)**2)+1)/2,easeInBack:e=>M0*e*e*e-A0*e*e,easeOutBack:e=>1+M0*(e-1)**3+A0*(e-1)**2,easeInOutBack:e=>e<.5?(2*e)**2*((j0+1)*2*e-j0)/2:((2*e-2)**2*((j0+1)*(e*2-2)+j0)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-(2**(10*e-10))*Math.sin((e*10-10.75)*N0),easeOutElastic:e=>e===0?0:e===1?1:2**(-10*e)*Math.sin((e*10-.75)*N0)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(2**(20*e-10)*Math.sin((20*e-11.125)*P0))/2:2**(-20*e+10)*Math.sin((20*e-11.125)*P0)/2+1,easeInBounce:e=>1-F0(1-e),easeOutBounce:F0,easeInOutBounce:e=>e<.5?(1-F0(1-2*e))/2:(1+F0(2*e-1))/2,steps:k0},L0=Symbol.for(`FluidValue.get`),R0=Symbol.for(`FluidValue.observers`),z0=e=>!!(e&&e[L0]),B0=e=>e&&e[L0]?e[L0]():e,V0=e=>e[R0]||null;function H0(e,t){e.eventObserved?e.eventObserved(t):e(t)}function U0(e,t){let n=e[R0];n&&n.forEach(e=>{H0(e,t)})}var W0=class{constructor(e){if(!e&&!(e=this.get))throw Error(`Unknown getter`);G0(this,e)}},G0=(e,t)=>J0(e,L0,t);function K0(e,t){if(e[L0]){let n=e[R0];n||J0(e,R0,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function q0(e,t){let n=e[R0];if(n&&n.has(t)){let r=n.size-1;r?n.delete(t):e[R0]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var J0=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Y0=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,X0=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Z0=RegExp(`(${Y0.source})(%|[a-z]+)`,`i`),Q0=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,$0=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,e2=e=>{let[t,n]=t2(e);if(!t||H1())return e;let r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r?r.trim():n&&n.startsWith(`--`)?window.getComputedStyle(document.documentElement).getPropertyValue(n)||e:n&&$0.test(n)?e2(n):n||e},t2=e=>{let t=$0.exec(e);if(!t)return[,];let[,n,r]=t;return[n,r]},n2,r2=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,i2=e=>{n2||=G1?RegExp(`(${Object.keys(G1).join(`|`)})(?!\\w)`,`g`):/^\b$/;let t=e.output.map(e=>B0(e).replace($0,e2).replace(X0,T0).replace(n2,T0)),n=t.map(e=>e.match(Y0).map(Number)),r=n[0].map((e,t)=>n.map(e=>{if(!(t in e))throw Error(`The arity of each "output" value must be equal`);return e[t]})).map(t=>E0({...e,output:t}));return e=>{let n=!Z0.test(t[0])&&t.find(e=>Z0.test(e))?.replace(Y0,``),i=0;return t[0].replace(Y0,()=>`${r[i++](e)}${n||``}`).replace(Q0,r2)}},a2=`react-spring: `,o2=e=>{let t=e,n=!1;if(typeof t!=`function`)throw TypeError(`${a2}once requires a function parameter`);return(...e)=>{n||=(t(...e),!0)}},s2=o2(console.warn);function c2(){s2(`${a2}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var l2=o2(console.warn);function u2(){l2(`${a2}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function d2(e){return $.str(e)&&(e[0]==`#`||/\d/.test(e)||!H1()&&$0.test(e)||e in(G1||{}))}var f2=H1()?M.useEffect:M.useLayoutEffect,p2=()=>{let e=(0,M.useRef)(!1);return f2(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function m2(){let e=(0,M.useState)()[1],t=p2();return()=>{t.current&&e(Math.random())}}var h2=e=>(0,M.useEffect)(e,g2),g2=[];function _2(e){let t=(0,M.useRef)(void 0);return(0,M.useEffect)(()=>{t.current=e}),t.current}var v2=Symbol.for(`Animated:node`),y2=e=>!!e&&e[v2]===e,b2=e=>e&&e[v2],x2=(e,t)=>F1(e,v2,t),S2=e=>e&&e[v2]&&e[v2].getPayload(),C2=class{constructor(){x2(this,this)}getPayload(){return this.payload||[]}},w2=class e extends C2{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,$.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new e(t)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return $.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,$.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},T2=class e extends w2{constructor(e){super(0),this._string=null,this._toString=E0({output:[e,e]})}static create(t){return new e(t)}getValue(){return this._string??=this._toString(this._value)}setValue(e){if($.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=E0({output:[this.getValue(),e]})),this._value=0,super.reset()}},E2={dependencies:null},D2=class extends C2{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return R1(this.source,(n,r)=>{y2(n)?t[r]=n.getValue(e):z0(n)?t[r]=B0(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&L1(this.payload,e=>e.reset())}_makePayload(e){if(e){let t=new Set;return R1(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){E2.dependencies&&z0(e)&&E2.dependencies.add(e);let t=S2(e);t&&L1(t,e=>this.add(e))}},O2=class e extends D2{constructor(e){super(e)}static create(t){return new e(t)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){let t=this.getPayload();return e.length==t.length?t.map((t,n)=>t.setValue(e[n])).some(Boolean):(super.setValue(e.map(k2)),!0)}};function k2(e){return(d2(e)?T2:w2).create(e)}function A2(e){let t=b2(e);return t?t.constructor:$.arr(e)?O2:d2(e)?T2:w2}var j2=(e,t)=>{let n=!$.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,M.forwardRef)((r,i)=>{let a=(0,M.useRef)(null),o=n&&(0,M.useCallback)(e=>{a.current=P2(i,e)},[i]),[s,c]=N2(r,t),l=m2(),u=()=>{let e=a.current;n&&!e||(e?t.applyAnimatedValues(e,s.getValue(!0)):!1)===!1&&l()},d=new M2(u,c),f=(0,M.useRef)(void 0);f2(()=>(f.current=d,L1(c,e=>K0(e,d)),()=>{f.current&&(L1(f.current.deps,e=>q0(e,f.current)),p1.cancel(f.current.update))})),(0,M.useEffect)(u,[]),h2(()=>()=>{let e=f.current;L1(e.deps,t=>q0(t,e))});let p=t.getComponentProps(s.getValue());return M.createElement(e,{...p,ref:o})})},M2=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type==`change`&&p1.write(this.update)}};function N2(e,t){let n=new Set;return E2.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new D2(e),E2.dependencies=null,[e,n]}function P2(e,t){return e&&($.fun(e)?e(t):e.current=t),t}var F2=Symbol.for(`AnimatedComponent`),I2=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=e=>new D2(e),getComponentProps:r=e=>e}={})=>{let i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},a=e=>{let t=L2(e)||`Anonymous`;return e=$.str(e)?a[e]||(a[e]=j2(e,i)):e[F2]||(e[F2]=j2(e,i)),e.displayName=`Animated(${t})`,e};return R1(e,(t,n)=>{$.arr(e)&&(n=L2(t)),a[n]=a(t)}),{animated:a}},L2=e=>$.str(e)?e:e&&$.str(e.displayName)?e.displayName:$.fun(e)&&e.name||null;function R2(e,...t){return $.fun(e)?e(...t):e}var z2=(e,t)=>e===!0||!!(t&&e&&($.fun(e)?e(t):z1(e).includes(t))),B2=(e,t)=>$.obj(e)?t&&e[t]:e,V2=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,H2=e=>e,U2=(e,t=H2)=>{let n=W2;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));let r={};for(let i of n){let n=t(e[i],i);$.und(n)||(r[i]=n)}return r},W2=[`config`,`onProps`,`onStart`,`onChange`,`onPause`,`onResume`,`onRest`],G2={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function K2(e){let t={},n=0;if(R1(e,(e,r)=>{G2[r]||(t[r]=e,n++)}),n)return t}function q2(e){let t=K2(e);if(t){let n={to:t};return R1(e,(e,r)=>r in t||(n[r]=e)),n}return{...e}}function J2(e){return e=B0(e),$.arr(e)?e.map(J2):d2(e)?N1.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Y2(e){for(let t in e)return!0;return!1}function X2(e){return $.fun(e)||$.arr(e)&&$.obj(e[0])}function Z2(e,t){e.ref?.delete(e),t?.delete(e)}function Q2(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var $2={...{default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}}.default,mass:1,damping:1,easing:I0.linear,clamp:!1},e4=class{constructor(){this.velocity=0,Object.assign(this,$2)}};function t4(e,t,n){n&&(n={...n},n4(n,t),t={...n,...t}),n4(e,t),Object.assign(e,t);for(let t in $2)e[t]??(e[t]=$2[t]);let{frequency:r,damping:i}=e,{mass:a}=e;return $.und(r)||(r<.01&&(r=.01),i<0&&(i=0),e.tension=(2*Math.PI/r)**2*a,e.friction=4*Math.PI*i*a/r),e}function n4(e,t){if(!$.und(t.decay))e.duration=void 0;else{let n=!$.und(t.tension)||!$.und(t.friction);(n||!$.und(t.frequency)||!$.und(t.damping)||!$.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var r4=[],i4=class{constructor(){this.changed=!1,this.values=r4,this.toValues=null,this.fromValues=r4,this.config=new e4,this.immediate=!1}};function a4(e,{key:t,props:n,defaultProps:r,state:i,actions:a}){return new Promise((o,s)=>{let c,l,u=z2(n.cancel??r?.cancel,t);if(u)p();else{$.und(n.pause)||(i.paused=z2(n.pause,t));let e=r?.pause;e!==!0&&(e=i.paused||z2(e,t)),c=R2(n.delay||0,t),e?(i.resumeQueue.add(f),a.pause()):(a.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(l),l.cancel(),c=l.time-p1.now()}function f(){c>0&&!N1.skipAnimation?(i.delayed=!0,l=p1.setTimeout(p,c),i.pauseQueue.add(d),i.timeouts.add(l)):p()}function p(){i.delayed&&=!1,i.pauseQueue.delete(d),i.timeouts.delete(l),e<=(i.cancelId||0)&&(u=!0);try{a.start({...n,callId:e,cancel:u},o)}catch(e){s(e)}}})}var o4=(e,t)=>t.length==1?t[0]:t.some(e=>e.cancelled)?l4(e.get()):t.every(e=>e.noop)?s4(e.get()):c4(e.get(),t.every(e=>e.finished)),s4=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),c4=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),l4=e=>({value:e,cancelled:!0,finished:!1});function u4(e,t,n,r){let{callId:i,parentId:a,onRest:o}=t,{asyncTo:s,promise:c}=n;return!a&&e===s&&!t.reset?c:n.promise=(async()=>{n.asyncId=i,n.asyncTo=e;let l=U2(t,(e,t)=>t===`onRest`?void 0:e),u,d,f=new Promise((e,t)=>(u=e,d=t)),p=e=>{let t=i<=(n.cancelId||0)&&l4(r)||i!==n.asyncId&&c4(r,!1);if(t)throw e.result=t,d(e),e},m=(e,t)=>{let a=new f4,o=new p4;return(async()=>{if(N1.skipAnimation)throw d4(n),o.result=c4(r,!1),d(o),o;p(a);let s=$.obj(e)?{...e}:{...t,to:e};s.parentId=i,R1(l,(e,t)=>{$.und(s[t])&&(s[t]=e)});let c=await r.start(s);return p(a),n.paused&&await new Promise(e=>{n.resumeQueue.add(e)}),c})()},h;if(N1.skipAnimation)return d4(n),c4(r,!1);try{let t;t=$.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,r.stop.bind(r))),await Promise.all([t.then(u),f]),h=c4(r.get(),!0,!1)}catch(e){if(e instanceof f4)h=e.result;else if(e instanceof p4)h=e.result;else throw e}finally{i==n.asyncId&&(n.asyncId=a,n.asyncTo=a?s:void 0,n.promise=a?c:void 0)}return $.fun(o)&&p1.batchedUpdates(()=>{o(h,r,r.item)}),h})()}function d4(e,t){B1(e.timeouts,e=>e.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var f4=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},p4=class extends Error{constructor(){super(`SkipAnimationSignal`)}},m4=e=>e instanceof g4,h4=1,g4=class extends W0{constructor(){super(...arguments),this.id=h4++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=b2(this);return e&&e.getValue()}to(...e){return N1.to(this,e)}interpolate(...e){return c2(),N1.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){U0(this,{type:`change`,parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||$1.sort(this),U0(this,{type:`priority`,parent:this,priority:e})}},_4=Symbol.for(`SpringPhase`),v4=1,y4=2,b4=4,x4=e=>(e[_4]&v4)>0,S4=e=>(e[_4]&y4)>0,C4=e=>(e[_4]&b4)>0,w4=(e,t)=>t?e[_4]|=y4|v4:e[_4]&=~y4,T4=(e,t)=>t?e[_4]|=b4:e[_4]&=~b4,E4=class extends g4{constructor(e,t){if(super(),this.animation=new i4,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!$.und(e)||!$.und(t)){let n=$.obj(e)?{...e}:{...t,from:e};$.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(S4(this)||this._state.asyncTo)||C4(this)}get goal(){return B0(this.animation.to)}get velocity(){let e=b2(this);return e instanceof w2?e.lastVelocity||0:e.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return x4(this)}get isAnimating(){return S4(this)}get isPaused(){return C4(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1,r=this.animation,{toValues:i}=r,{config:a}=r,o=S2(r.to);!o&&z0(r.to)&&(i=z1(B0(r.to))),r.values.forEach((s,c)=>{if(s.done)return;let l=s.constructor==T2?1:o?o[c].lastPosition:i[c],u=r.immediate,d=l;if(!u){if(d=s.lastPosition,a.tension<=0){s.done=!0;return}let t=s.elapsedTime+=e,n=r.fromValues[c],i=s.v0==null?s.v0=$.arr(a.velocity)?a.velocity[c]:a.velocity:s.v0,o,f=a.precision||(n==l?.005:Math.min(1,Math.abs(l-n)*.001));if(!$.und(a.duration)){let r=1;a.duration>0&&(this._memoizedDuration!==a.duration&&(this._memoizedDuration=a.duration,s.durationProgress>0&&(s.elapsedTime=a.duration*s.durationProgress,t=s.elapsedTime+=e)),r=(a.progress||0)+t/this._memoizedDuration,r=r>1?1:r<0?0:r,s.durationProgress=r),d=n+a.easing(r)*(l-n),o=(d-s.lastPosition)/e,u=r==1}else if(a.decay){let e=a.decay===!0?.998:a.decay,r=Math.exp(-(1-e)*t);d=n+i/(1-e)*(1-r),u=Math.abs(s.lastPosition-d)<=f,o=i*r}else{o=s.lastVelocity==null?i:s.lastVelocity;let t=a.restVelocity||f/10,r=a.clamp?0:a.bounce,c=!$.und(r),p=n==l?s.v0>0:n<l,m,h=!1,g=Math.ceil(e/1);for(let e=0;e<g&&(m=Math.abs(o)>t,!(!m&&(u=Math.abs(l-d)<=f,u)));++e){c&&(h=d==l||d>l==p,h&&(o=-o*r,d=l));let e=(-a.tension*1e-6*(d-l)+-a.friction*.001*o)/a.mass;o+=e*1,d+=o*1}}s.lastVelocity=o,Number.isNaN(d)&&(console.warn(`Got NaN while animating:`,this),u=!0)}o&&!o[c].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,a.round)&&(n=!0)});let s=b2(this),c=s.getValue();if(t){let e=B0(r.to);(c!==e||n)&&!a.decay?(s.setValue(e),this._onChange(e)):n&&a.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return p1.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(S4(this)){let{to:e,config:t}=this.animation;p1.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||=[]).push(e),this}start(e,t){let n;return $.und(e)?(n=this.queue||[],this.queue=[]):n=[$.obj(e)?e:{...t,to:e}],Promise.all(n.map(e=>this._update(e))).then(e=>o4(this,e))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),d4(this._state,e&&this._lastCallId),p1.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type==`change`?this._start():e.type==`priority`&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||``,{to:n,from:r}=e;n=$.obj(n)?n[t]:n,(n==null||X2(n))&&(n=void 0),r=$.obj(r)?r[t]:r,r??=void 0;let i={to:n,from:r};return x4(this)||(e.reverse&&([n,r]=[r,n]),r=B0(r),$.und(r)?b2(this)||this._set(n):this._set(r)),i}_update({...e},t){let{key:n,defaultProps:r}=this;e.default&&Object.assign(r,U2(e,(e,t)=>/^on/.test(t)?B2(e,n):e)),M4(this,e,`onProps`),N4(this,`onProps`,e,this);let i=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return a4(++this._lastCallId,{key:n,props:e,defaultProps:r,state:a,actions:{pause:()=>{C4(this)||(T4(this,!0),V1(a.pauseQueue),N4(this,`onPause`,c4(this,D4(this,this.animation.to)),this))},resume:()=>{C4(this)&&(T4(this,!1),S4(this)&&this._resume(),V1(a.resumeQueue),N4(this,`onResume`,c4(this,D4(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(n=>{if(e.loop&&n.finished&&!(t&&n.noop)){let t=O4(e);if(t)return this._update(t,!0)}return n})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(l4(this));let r=!$.und(e.to),i=!$.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(l4(this));let{key:a,defaultProps:o,animation:s}=this,{to:c,from:l}=s,{to:u=c,from:d=l}=e;i&&!r&&(!t.default||$.und(u))&&(u=d),t.reverse&&([u,d]=[d,u]);let f=!I1(d,l);f&&(s.from=d),d=B0(d);let p=!I1(u,c);p&&this._focus(u);let m=X2(t.to),{config:h}=s,{decay:g,velocity:_}=h;(r||i)&&(h.velocity=0),t.config&&!m&&t4(h,R2(t.config,a),t.config===o.config?void 0:R2(o.config,a));let v=b2(this);if(!v||$.und(u))return n(c4(this,!0));let y=$.und(t.reset)?i&&!t.default:!$.und(d)&&z2(t.reset,a),b=y?d:this.get(),x=J2(u),S=$.num(x)||$.arr(x)||d2(x),C=!m&&(!S||z2(o.immediate||t.immediate,a));if(p){let e=A2(u);if(e!==v.constructor)if(C)v=this._set(x);else throw Error(`Cannot animate between ${v.constructor.name} and ${e.name}, as the "to" prop suggests`)}let w=v.constructor,T=z0(u),E=!1;if(!T){let e=y||!x4(this)&&f;(p||e)&&(E=I1(J2(b),x),T=!E),(!I1(s.immediate,C)&&!C||!I1(h.decay,g)||!I1(h.velocity,_))&&(T=!0)}if(E&&S4(this)&&(s.changed&&!y?T=!0:T||this._stop(c)),!m&&((T||z0(c))&&(s.values=v.getPayload(),s.toValues=z0(u)?null:w==T2?[1]:z1(x)),s.immediate!=C&&(s.immediate=C,!C&&!y&&this._set(c)),T)){let{onRest:e}=s;L1(j4,e=>M4(this,t,e));let r=c4(this,D4(this,c));V1(this._pendingCalls,r),this._pendingCalls.add(n),s.changed&&p1.batchedUpdates(()=>{s.changed=!y,e?.(r,this),y?R2(o.onRest,r):s.onStart?.(r,this)})}y&&this._set(b),m?n(u4(t.to,t,this._state,this)):T?this._start():S4(this)&&!p?this._pendingCalls.add(n):n(s4(b))}_focus(e){let t=this.animation;e!==t.to&&(V0(this)&&this._detach(),t.to=e,V0(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;z0(t)&&(K0(t,this),m4(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;z0(e)&&q0(e,this)}_set(e,t=!0){let n=B0(e);if(!$.und(n)){let e=b2(this);if(!e||!I1(n,e.getValue())){let r=A2(n);!e||e.constructor!=r?x2(this,r.create(n)):e.setValue(n),e&&p1.batchedUpdates(()=>{this._onChange(n,t)})}}return b2(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,N4(this,`onStart`,c4(this,D4(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),R2(this.animation.onChange,e,this)),R2(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;b2(this).reset(B0(e.to)),e.immediate||(e.fromValues=e.values.map(e=>e.lastPosition)),S4(this)||(w4(this,!0),C4(this)||this._resume())}_resume(){N1.skipAnimation?this.finish():$1.start(this)}_stop(e,t){if(S4(this)){w4(this,!1);let n=this.animation;L1(n.values,e=>{e.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),U0(this,{type:`idle`,parent:this});let r=t?l4(this.get()):c4(this.get(),D4(this,e??n.to));V1(this._pendingCalls,r),n.changed&&(n.changed=!1,N4(this,`onRest`,r,this))}}};function D4(e,t){let n=J2(t);return I1(J2(e.get()),n)}function O4(e,t=e.loop,n=e.to){let r=R2(t);if(r){let i=r!==!0&&q2(r),a=(i||e).reverse,o=!i||i.reset;return k4({...e,loop:t,default:!1,pause:void 0,to:!a||X2(n)?n:void 0,from:o?e.from:void 0,reset:o,...i})}}function k4(e){let{to:t,from:n}=e=q2(e),r=new Set;return $.obj(t)&&A4(t,r),$.obj(n)&&A4(n,r),e.keys=r.size?Array.from(r):null,e}function A4(e,t){R1(e,(e,n)=>e!=null&&t.add(n))}var j4=[`onStart`,`onRest`,`onChange`,`onPause`,`onResume`];function M4(e,t,n){e.animation[n]=t[n]===V2(t,n)?void 0:B2(t[n],e.key)}function N4(e,t,...n){e.animation[t]?.(...n),e.defaultProps[t]?.(...n)}var P4=[`onStart`,`onChange`,`onRest`],F4=1,I4=class{constructor(e,t){this.id=F4++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(let t in e){let n=e[t];$.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(k4(e)),this}start(e){let{queue:t}=this;return e?t=z1(e).map(k4):this.queue=[],this._flush?this._flush(this,t):(U4(this,t),L4(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let n=this.springs;L1(z1(t),t=>n[t].stop(!!e))}else d4(this._state,this._lastAsyncId),this.each(t=>t.stop(!!e));return this}pause(e){if($.und(e))this.start({pause:!0});else{let t=this.springs;L1(z1(e),e=>t[e].pause())}return this}resume(e){if($.und(e))this.start({pause:!1});else{let t=this.springs;L1(z1(e),e=>t[e].resume())}return this}each(e){R1(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,i=this._changed.size>0;(r&&!this._started||i&&!this._started)&&(this._started=!0,B1(e,([e,t])=>{t.value=this.get(),e(t,this,this._item)}));let a=!r&&this._started,o=i||a&&n.size?this.get():null;i&&t.size&&B1(t,([e,t])=>{t.value=o,e(t,this,this._item)}),a&&(this._started=!1,B1(n,([e,t])=>{t.value=o,e(t,this,this._item)}))}eventObserved(e){if(e.type==`change`)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type==`idle`)this._active.delete(e.parent);else return;p1.onFrame(this._onFrame)}};function L4(e,t){return Promise.all(t.map(t=>R4(e,t))).then(t=>o4(e,t))}async function R4(e,t,n){let{keys:r,to:i,from:a,loop:o,onRest:s,onResolve:c}=t,l=$.obj(t.default)&&t.default;o&&(t.loop=!1),i===!1&&(t.to=null),a===!1&&(t.from=null);let u=$.arr(i)||$.fun(i)?i:void 0;u?(t.to=void 0,t.onRest=void 0,l&&(l.onRest=void 0)):L1(P4,n=>{let r=t[n];if($.fun(r)){let i=e._events[n];t[n]=({finished:e,cancelled:t})=>{let n=i.get(r);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):i.set(r,{value:null,finished:e||!1,cancelled:t||!1})},l&&(l[n]=t[n])}});let d=e._state;t.pause===!d.paused?(d.paused=t.pause,V1(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);let f=(r||Object.keys(e.springs)).map(n=>e.springs[n].start(t)),p=t.cancel===!0||V2(t,`cancel`)===!0;(u||p&&d.asyncId)&&f.push(a4(++e._lastAsyncId,{props:t,state:d,actions:{pause:P1,resume:P1,start(t,n){p?(d4(d,e._lastAsyncId),n(l4(e))):(t.onRest=s,n(u4(u,t,d,e)))}}})),d.paused&&await new Promise(e=>{d.resumeQueue.add(e)});let m=o4(e,await Promise.all(f));if(o&&m.finished&&!(n&&m.noop)){let n=O4(t,o,i);if(n)return U4(e,[n]),R4(e,n,!0)}return c&&p1.batchedUpdates(()=>c(m,e,e.item)),m}function z4(e,t){let n={...e.springs};return t&&L1(z1(t),e=>{$.und(e.keys)&&(e=k4(e)),$.obj(e.to)||(e={...e,to:void 0}),H4(n,e,e=>V4(e))}),B4(e,n),n}function B4(e,t){R1(t,(t,n)=>{e.springs[n]||(e.springs[n]=t,K0(t,e))})}function V4(e,t){let n=new E4;return n.key=e,t&&K0(n,t),n}function H4(e,t,n){t.keys&&L1(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function U4(e,t){L1(t,t=>{H4(e.springs,t,t=>V4(t,e))})}var W4=M.createContext({pause:!1,immediate:!1}),G4=()=>{let e=[],t=function(t){u2();let r=[];return L1(e,(e,i)=>{if($.und(t))r.push(e.start());else{let a=n(t,e,i);a&&r.push(e.start(a))}}),r};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return L1(e,e=>e.pause(...arguments)),this},t.resume=function(){return L1(e,e=>e.resume(...arguments)),this},t.set=function(t){L1(e,(e,n)=>{let r=$.fun(t)?t(n,e):t;r&&e.set(r)})},t.start=function(t){let n=[];return L1(e,(e,r)=>{if($.und(t))n.push(e.start());else{let i=this._getProps(t,e,r);i&&n.push(e.start(i))}}),n},t.stop=function(){return L1(e,e=>e.stop(...arguments)),this},t.update=function(t){return L1(e,(e,n)=>e.update(this._getProps(t,e,n))),this};let n=function(e,t,n){return $.fun(e)?e(n,t):e};return t._getProps=n,t};function K4(e,t,n){let r=$.fun(t)&&t,{reset:i,sort:a,trail:o=0,expires:s=!0,exitBeforeEnter:c=!1,onDestroyed:l,ref:u,config:d}=r?r():t,f=(0,M.useMemo)(()=>r||arguments.length==3?G4():void 0,[]),p=z1(e),m=[],h=(0,M.useRef)(null),g=i?null:h.current;f2(()=>{h.current=m}),h2(()=>(L1(m,e=>{f?.add(e.ctrl),e.ctrl.ref=f}),()=>{L1(h.current,e=>{e.expired&&clearTimeout(e.expirationId),Z2(e.ctrl,f),e.ctrl.stop(!0)})}));let _=J4(p,r?r():t,g),v=i&&h.current||[];f2(()=>L1(v,({ctrl:e,item:t,key:n})=>{Z2(e,f),R2(l,t,n)}));let y=[];if(g&&L1(g,(e,t)=>{e.expired?(clearTimeout(e.expirationId),v.push(e)):(t=y[t]=_.indexOf(e.key),~t&&(m[t]=e))}),L1(p,(e,t)=>{m[t]||(m[t]={key:_[t],item:e,phase:`mount`,ctrl:new I4},m[t].ctrl.item=e)}),y.length){let e=-1,{leave:n}=r?r():t;L1(y,(t,r)=>{let i=g[r];~t?(e=m.indexOf(i),m[e]={...i,item:p[t]}):n&&m.splice(++e,0,i)})}$.fun(a)&&m.sort((e,t)=>a(e.item,t.item));let b=-o,x=m2(),S=U2(t),C=new Map,w=(0,M.useRef)(new Map),T=(0,M.useRef)(!1);L1(m,(e,n)=>{let i=e.key,a=e.phase,l=r?r():t,f,p,m=R2(l.delay||0,i);if(a==`mount`)f=l.enter,p=`enter`;else{let e=_.indexOf(i)<0;if(a!=`leave`)if(e)f=l.leave,p=`leave`;else if(f=l.update)p=`update`;else return;else if(!e)f=l.enter,p=`enter`;else return}if(f=R2(f,e.item,n),f=$.obj(f)?q2(f):{to:f},!f.config){let t=d||S.config;f.config=R2(t,e.item,n,p)}b+=o;let v={...S,delay:m+b,ref:u,immediate:l.immediate,reset:!1,...f};if(p==`enter`&&$.und(v.from)){let i=r?r():t;v.from=R2($.und(i.initial)||g?i.from:i.initial,e.item,n)}let{onResolve:y}=v;v.onResolve=e=>{R2(y,e);let t=h.current,n=t.find(e=>e.key===i);if(n&&!(e.cancelled&&n.phase!=`update`)&&n.ctrl.idle){let e=t.every(e=>e.ctrl.idle);if(n.phase==`leave`){let t=R2(s,n.item);if(t!==!1){let r=t===!0?0:t;if(n.expired=!0,!e&&r>0){r<=2147483647&&(n.expirationId=setTimeout(x,r));return}}}e&&t.some(e=>e.expired)&&(w.current.delete(n),c&&(T.current=!0),x())}};let E=z4(e.ctrl,v);p===`leave`&&c?w.current.set(e,{phase:p,springs:E,payload:v}):C.set(e,{phase:p,springs:E,payload:v})});let E=(0,M.useContext)(W4),ee=E!==_2(E)&&Y2(E);f2(()=>{ee&&L1(m,e=>{e.ctrl.start({default:E})})},[E]),L1(C,(e,t)=>{if(w.current.size){let e=m.findIndex(e=>e.key===t.key);m.splice(e,1)}}),f2(()=>{L1(w.current.size?w.current:C,({phase:e,payload:t},n)=>{let{ctrl:r}=n;n.phase=e,f?.add(r),ee&&e==`enter`&&r.start({default:E}),t&&(Q2(r,t.ref),(r.ref||f)&&!T.current?r.update(t):(r.start(t),T.current&&=!1))})},i?void 0:n);let te=e=>M.createElement(M.Fragment,null,m.map((t,n)=>{let{springs:r}=C.get(t)||t.ctrl,i=e({...r},t.item,t,n),a=$.str(t.key)||$.num(t.key)?t.key:t.ctrl.id,o=i?.props??{},s=o?.ref;return i&&i.type?M.createElement(i.type,{...o,key:a,ref:s}):i}));return f?[te,f]:te}var q4=1;function J4(e,{key:t,keys:n=t},r){if(n===null){let t=new Set;return e.map(e=>{let n=r&&r.find(n=>n.item===e&&n.phase!==`leave`&&!t.has(n));return n?(t.add(n),n.key):q4++})}return $.und(n)?e:$.fun(n)?e.map(n):z1(n)}var Y4=class extends g4{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=E0(...t);let n=this._get(),r=A2(n);x2(this,r.create(n))}advance(e){let t=this._get();I1(t,this.get())||(b2(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Z4(this._active)&&Q4(this)}_get(){let e=$.arr(this.source)?this.source.map(B0):z1(B0(this.source));return this.calc(...e)}_start(){this.idle&&!Z4(this._active)&&(this.idle=!1,L1(S2(this),e=>{e.done=!1}),N1.skipAnimation?(p1.batchedUpdates(()=>this.advance()),Q4(this)):$1.start(this))}_attach(){let e=1;L1(z1(this.source),t=>{z0(t)&&K0(t,this),m4(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){L1(z1(this.source),e=>{z0(e)&&q0(e,this)}),this._active.clear(),Q4(this)}eventObserved(e){e.type==`change`?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type==`idle`?this._active.delete(e.parent):e.type==`priority`&&(this.priority=z1(this.source).reduce((e,t)=>Math.max(e,(m4(t)?t.priority:0)+1),0))}};function X4(e){return e.idle!==!1}function Z4(e){return!e.size||Array.from(e).every(X4)}function Q4(e){e.idle||(e.idle=!0,L1(S2(e),e=>{e.done=!0}),U0(e,{type:`idle`,parent:e}))}N1.assign({createStringInterpolator:i2,to:(e,t)=>new Y4(e,t)}),$1.advance;var $4=e(Gn(),1),e3=/^--/;function t3(e,t){return t==null||typeof t==`boolean`||t===``?``:typeof t==`number`&&t!==0&&!e3.test(e)&&!(i3.hasOwnProperty(e)&&i3[e])?t+`px`:(``+t).trim()}var n3={};function r3(e,t){if(!e.nodeType||!e.setAttribute)return!1;let n=e.nodeName===`filter`||e.parentNode&&e.parentNode.nodeName===`filter`,{className:r,style:i,children:a,scrollTop:o,scrollLeft:s,viewBox:c,...l}=t,u=Object.values(l),d=Object.keys(l).map(t=>n||e.hasAttribute(t)?t:n3[t]||(n3[t]=t.replace(/([A-Z])/g,e=>`-`+e.toLowerCase())));a!==void 0&&(e.textContent=a);for(let t in i)if(i.hasOwnProperty(t)){let n=t3(t,i[t]);e3.test(t)?e.style.setProperty(t,n):e.style[t]=n}d.forEach((t,n)=>{e.setAttribute(t,u[n])}),r!==void 0&&(e.className=r),o!==void 0&&(e.scrollTop=o),s!==void 0&&(e.scrollLeft=s),c!==void 0&&e.setAttribute(`viewBox`,c)}var i3={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},a3=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),o3=[`Webkit`,`Ms`,`Moz`,`O`];i3=Object.keys(i3).reduce((e,t)=>(o3.forEach(n=>e[a3(n,t)]=e[t]),e),i3);var s3=/^(matrix|translate|scale|rotate|skew)/,c3=/^(translate)/,l3=/^(rotate|skew)/,u3=(e,t)=>$.num(e)&&e!==0?e+t:e,d3=(e,t)=>$.arr(e)?e.every(e=>d3(e,t)):$.num(e)?e===t:parseFloat(e)===t,f3=class extends D2{constructor({x:e,y:t,z:n,...r}){let i=[],a=[];(e||t||n)&&(i.push([e||0,t||0,n||0]),a.push(e=>[`translate3d(${e.map(e=>u3(e,`px`)).join(`,`)})`,d3(e,0)])),R1(r,(e,t)=>{if(t===`transform`)i.push([e||``]),a.push(e=>[e,e===``]);else if(s3.test(t)){if(delete r[t],$.und(e))return;let n=c3.test(t)?`px`:l3.test(t)?`deg`:``;i.push(z1(e)),a.push(t===`rotate3d`?([e,t,r,i])=>[`rotate3d(${e},${t},${r},${u3(i,n)})`,d3(i,0)]:e=>[`${t}(${e.map(e=>u3(e,n)).join(`,`)})`,d3(e,+!!t.startsWith(`scale`))])}}),i.length&&(r.transform=new p3(i,a)),super(r)}},p3=class extends W0{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||=this._get()}_get(){let e=``,t=!0;return L1(this.inputs,(n,r)=>{let i=B0(n[0]),[a,o]=this.transforms[r]($.arr(i)?i:n.map(B0));e+=` `+a,t&&=o}),t?`none`:e}observerAdded(e){e==1&&L1(this.inputs,e=>L1(e,e=>z0(e)&&K0(e,this)))}observerRemoved(e){e==0&&L1(this.inputs,e=>L1(e,e=>z0(e)&&q0(e,this)))}eventObserved(e){e.type==`change`&&(this._value=null),U0(this,e)}},m3=`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.big.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.keygen.label.legend.li.link.main.map.mark.menu.menuitem.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.section.select.small.source.span.strong.style.sub.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr.circle.clipPath.defs.ellipse.foreignObject.g.image.line.linearGradient.mask.path.pattern.polygon.polyline.radialGradient.rect.stop.svg.text.tspan`.split(`.`);N1.assign({batchedUpdates:$4.unstable_batchedUpdates,createStringInterpolator:i2,colors:o0});var h3=I2(m3,{applyAnimatedValues:r3,createAnimatedStyle:e=>new f3(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}).animated,g3={media:`_media_18k0x_8`,mirror:`_mirror_18k0x_30`,bg:`_bg_18k0x_42`,avatar:`_avatar_18k0x_51`,translucent:`_translucent_18k0x_59`,fg:`_fg_18k0x_81`,nameTag:`_nameTag_18k0x_97`,status:`_status_18k0x_114`,reactions:`_reactions_18k0x_131`,name:`_name_18k0x_97`,errorIcon:`_errorIcon_18k0x_151`},_3={reactionIndicatorWidget:`_reactionIndicatorWidget_14f9a_1`,reactionIndicatorWidgetLarge:`_reactionIndicatorWidgetLarge_14f9a_21`,reactionLarge:`_reactionLarge_14f9a_28`,reaction:`_reaction_14f9a_1`};function v3({emoji:e,miniature:t,children:n}){let{t:r}=Ni();return(0,W.jsxs)(`div`,{className:(0,U.default)(_3.reactionIndicatorWidget,{[_3.reactionIndicatorWidgetLarge]:!t}),children:[(0,W.jsx)(`div`,{className:(0,U.default)(_3.reaction,{[_3.reactionLarge]:!t}),children:(0,W.jsx)(`span`,{role:`img`,"aria-label":r(`common.reaction`),children:e})}),n]})}function y3({raisedHandTime:e,miniature:t,showTimer:n,onClick:r,tabIndex:i}){let{t:a}=Ni(),[o,s]=(0,M.useState)(``),c=(0,M.useMemo)(()=>new Intl.DurationFormat(void 0,{minutesDisplay:`always`,secondsDisplay:`always`,hoursDisplay:`auto`,style:`digital`}),[]),l=(0,M.useCallback)(e=>{r&&(e.preventDefault(),r())},[r]);if((0,M.useEffect)(()=>{if(!e||!n)return;let t=()=>{let t=Math.ceil((new Date().getTime()-e.getTime())/1e3);s(c.format({seconds:t%60,minutes:Math.floor(t/60)}))};t();let r=setInterval(t,1e3);return()=>clearInterval(r)},[s,e,n,c]),!e)return;let u=(0,W.jsx)(v3,{emoji:`✋`,miniature:t,children:n&&(0,W.jsx)(`p`,{children:o})});return r?(0,W.jsx)(`button`,{"aria-label":a(`action.lower_hand`),style:{display:`contents`,background:`none`},onClick:l,tabIndex:i,children:u}):u}var b3={modal:`_modal_13thw_8`,statsPill:`_statsPill_13thw_12`},x3=e=>{try{return new URL(e).hostname}catch(t){return console.error(`Invalid URL:`,t),e}},S3=({audio:e,video:t,focusUrl:n,rtcBackendIdentity:r,...i})=>{let[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(`none`),l=e=>{o(!0),c(e)};return(0,W.jsxs)(`div`,{className:(0,U.default)(g3.nameTag,b3.statsPill),children:[(0,W.jsx)(or,{title:`RTC Connection Stats`,open:a,onDismiss:()=>{o(!1),c(`none`)},children:(0,W.jsx)(`div`,{className:b3.modal,children:(0,W.jsx)(`pre`,{children:s!==`none`&&JSON.stringify(s===`video`?t:e,null,2)})})}),(0,W.jsxs)(ei,{as:`span`,size:`xs`,title:`rtcBackendIdentity`,children:[`rtcBackendIdentity:`,r]}),n&&(0,W.jsx)(`div`,{children:(0,W.jsxs)(ei,{as:`span`,size:`xs`,title:`focusURL`,children:[`\xA0`,x3(n)]})}),e&&(0,W.jsx)(`div`,{children:(0,W.jsx)(Pi,{onClick:()=>l(`audio`),size:`sm`,kind:`tertiary`,Icon:Ft,children:`jitter`in e&&typeof e.jitter==`number`&&(0,W.jsxs)(ei,{as:`span`,size:`xs`,title:`jitter`,children:[`\xA0`,(e.jitter*1e3).toFixed(0),`ms`]})})}),t&&(0,W.jsx)(`div`,{children:(0,W.jsxs)(Pi,{onClick:()=>l(`video`),size:`sm`,kind:`tertiary`,Icon:Sn,children:[!!t?.framesPerSecond&&(0,W.jsxs)(ei,{as:`span`,size:`xs`,title:`frame rate`,children:[`\xA0`,t.framesPerSecond.toFixed(0),`fps`]}),`jitter`in t&&typeof t.jitter==`number`&&(0,W.jsxs)(ei,{as:`span`,size:`xs`,title:`jitter`,children:[`\xA0`,(t.jitter*1e3).toFixed(0),`ms`]}),`frameHeight`in t&&typeof t.frameHeight==`number`&&`frameWidth`in t&&typeof t.frameWidth==`number`&&(0,W.jsxs)(ei,{as:`span`,size:`xs`,title:`frame size`,children:[`\xA0`,t.frameWidth,`x`,t.frameHeight]}),`qualityLimitationReason`in t&&typeof t.qualityLimitationReason==`string`&&t.qualityLimitationReason!==`none`&&(0,W.jsxs)(ei,{as:`span`,size:`xs`,title:`quality limitation reason`,children:[`\xA0`,t.qualityLimitationReason]})]})})]})},C3=({ref:e,className:t,style:n,targetWidth:r,targetHeight:i,video:a,videoFit:o,mirror:s,userId:c,videoEnabled:l,unencryptedWarning:u,nameTagLeadingIcon:d,displayName:f,mxcAvatarUrl:p,focusable:m,primaryButton:h,status:g,raisedHandTime:_,currentReaction:v,raisedHandOnClick:y,waitingForMedia:b,audioStreamStats:x,videoStreamStats:S,rtcBackendIdentity:C,focusUrl:w,...T})=>{let{t:E}=Ni(),[ee]=Et(oe),[te]=Et(Nr),ne=Math.round(Math.min(r,i)/2);return(0,W.jsxs)(h3.div,{className:(0,U.default)(g3.media,t,{[g3.mirror]:s}),style:n,ref:e,"data-testid":`videoTile`,"data-video-fit":o,...T,children:[(0,W.jsxs)(`div`,{className:g3.bg,children:[(0,W.jsx)(ue,{id:c,name:f,size:ne,src:p,className:(0,U.default)(g3.avatar,{[g3.translucent]:g}),style:{display:a&&l?`none`:`initial`}}),a?.publication!==void 0&&(0,W.jsx)(j$,{trackRef:a,tabIndex:-1,disablePictureInPicture:!0,style:{display:a&&l?`block`:`none`},"data-testid":`video`})]}),(0,W.jsxs)(`div`,{className:g3.fg,children:[(0,W.jsxs)(`div`,{className:g3.reactions,children:[(0,W.jsx)(y3,{raisedHandTime:_,miniature:ne<96,showTimer:ee,onClick:y,tabIndex:m?void 0:-1}),v&&(0,W.jsx)(v3,{miniature:ne<96,emoji:v.emoji})]}),b&&(0,W.jsxs)(`div`,{className:g3.status,children:[E(`video_tile.waiting_for_media`),te?` `+C:``]}),te&&(0,W.jsx)(W.Fragment,{children:(0,W.jsx)(S3,{audio:x,video:S,focusUrl:w,rtcBackendIdentity:C})}),g&&(0,W.jsxs)(`div`,{className:g3.status,children:[(0,W.jsx)(g.Icon,{width:16,height:16,"aria-hidden":!0}),(0,W.jsx)(ei,{as:`span`,size:`sm`,weight:`medium`,children:g.text})]}),(0,W.jsxs)(`div`,{className:g3.nameTag,children:[d,(0,W.jsx)(ei,{as:`span`,size:`sm`,weight:`medium`,className:g3.name,"data-testid":`name_tag`,children:f}),u&&(0,W.jsx)($t,{label:E(`common.unencrypted`),placement:`bottom`,isTriggerInteractive:!1,nonInteractiveTriggerTabIndex:m?void 0:-1,children:(0,W.jsx)(an,{width:20,height:20,className:g3.errorIcon,role:`img`,"aria-label":E(`common.unencrypted`)})})]}),h]})]})};C3.displayName=`MediaView`;function w3(e){let t=(0,M.useRef)(e);return t.current=e,t}var T3=(...e)=>(0,M.useCallback)(t=>e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)}),e),E3=({vm:e,className:t,...n})=>{let{t:r}=Ni(),i=k(e.pickupState$),a=k(e.videoEnabled$);return(0,W.jsx)(C3,{className:(0,U.default)(t,d1.tile),video:void 0,userId:e.userId,unencryptedWarning:!1,status:i===`ringing`?{text:r(`video_tile.calling`),Icon:a?Sn:iP}:{text:r(`video_tile.call_ended`),Icon:ir},videoEnabled:a,videoFit:`cover`,mirror:!1,...n})},D3=({ref:e,vm:t,showSpeakingIndicators:n,playbackMuted:r,waitingForMedia:i,primaryButton:a,menuStart:o,menuEnd:s,className:c,focusUrl:l,displayName:u,mxcAvatarUrl:d,focusable:f,targetWidth:p,targetHeight:m,...h})=>{let{toggleRaisedHand:g}=Ci(),{t:_}=Ni(),v=k(t.video$),y=k(t.unencryptedWarning$),b=XL(t.audioStreamStats$),x=XL(t.videoStreamStats$),S=k(t.audioEnabled$),C=k(t.videoEnabled$),w=k(t.speaking$),T=k(t.videoFit$),E=t.rtcBackendIdentity,ee=k(t.handRaised$),te=k(t.reaction$);(0,M.useEffect)(()=>{p>0&&m>0&&t.setTargetDimensions(p,m)},[p,m,t]);let ne=r?et:S?Ft:O,re=_(r?`video_tile.muted_for_me`:S?`microphone_on`:`microphone_off`),[ie,ae]=(0,M.useState)(!1),D=(0,W.jsxs)(W.Fragment,{children:[o,s]}),oe=t.local?()=>void g():void 0,se=n&&w;return(0,W.jsx)(bk,{title:u,trigger:(0,W.jsx)(C3,{ref:e,video:v,userId:t.userId,unencryptedWarning:y,videoEnabled:C,videoFit:T,className:(0,U.default)(c,d1.tile,{[d1.speaking]:se,[d1.handRaised]:!se&&ee}),nameTagLeadingIcon:(0,W.jsx)(ne,{width:20,height:20,"aria-label":re,"data-muted":r||!S,className:d1.muteIcon}),displayName:u,mxcAvatarUrl:d,focusable:f,primaryButton:a??(0,W.jsx)(hA,{open:ie,onOpenChange:ae,title:u,trigger:(0,W.jsx)(`button`,{"aria-label":_(`common.options`),tabIndex:f?void 0:-1,children:(0,W.jsx)(Dn,{"aria-hidden":!0,width:20,height:20})}),side:`left`,align:`start`,children:D}),raisedHandTime:ee??void 0,currentReaction:te??void 0,raisedHandOnClick:oe,waitingForMedia:i,focusUrl:l,audioStreamStats:b,videoStreamStats:x,rtcBackendIdentity:E,targetWidth:p,targetHeight:m,...h}),hasAccessibleAlternative:!0,children:D})};D3.displayName=`UserMediaTile`;var O3=({ref:e,vm:t,onOpenProfile:n,focusable:r,...i})=>{let{t:a}=Ni(),o=k(t.mirror$),s=k(t.alwaysShow$),c=k(t.switchCamera$),l=k(t.focusUrl$),u=w3(s),d=(0,M.useCallback)(e=>{e.preventDefault(),t.setAlwaysShow(!u.current)},[t,u]);return(0,W.jsx)(D3,{ref:e,vm:t,playbackMuted:!1,mirror:o,primaryButton:c===null?void 0:(0,W.jsx)(`button`,{className:d1.switchCamera,"aria-label":a(`switch_camera`),onClick:c,tabIndex:r?void 0:-1,children:(0,W.jsx)(eP,{"aria-hidden":!0,width:20,height:20})}),menuStart:(0,W.jsx)(eM,{Icon:gj,label:a(`video_tile.always_show`),checked:s,onSelect:d}),menuEnd:n&&(0,W.jsx)(yA,{Icon:_n,label:a(`common.profile`),onSelect:n}),focusable:r,focusUrl:l,...i})};O3.displayName=`LocalUserMediaTile`;var k3=({ref:e,vm:t,...n})=>{let{t:r}=Ni(),i=k(t.waitingForMedia$),a=k(t.playbackMuted$),o=k(t.playbackVolume$),s=k(t.focusUrl$),c=(0,M.useCallback)(e=>{e.preventDefault(),t.togglePlaybackMuted()},[t]),l=a?cP:uP;return(0,W.jsx)(D3,{ref:e,vm:t,waitingForMedia:i,playbackMuted:a,mirror:!1,menuStart:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(eM,{Icon:KN,label:r(`video_tile.mute_for_me`),checked:a,onSelect:c}),(0,W.jsx)(yA,{as:`div`,Icon:l,label:null,onSelect:null,children:(0,W.jsx)(WR,{className:d1.volumeSlider,label:r(`video_tile.volume`),value:o,onValueChange:t.adjustPlaybackVolume,onValueCommit:t.commitPlaybackVolume,min:0,max:1,step:.01})})]}),focusUrl:s,...n})};k3.displayName=`RemoteUserMediaTile`;var A3=({ref:e,vm:t,showSpeakingIndicators:n,onOpenProfile:r,...i})=>{let a=T3((0,M.useRef)(null),e),o=k(t.media$),s=k(o.displayName$),c=k(o.mxcAvatarUrl$);return o.type===`ringing`?(0,W.jsx)(E3,{ref:a,vm:o,...i,displayName:s,mxcAvatarUrl:c}):o.local?(0,W.jsx)(O3,{ref:a,vm:o,showSpeakingIndicators:n,onOpenProfile:r,displayName:s,mxcAvatarUrl:c,...i}):(0,W.jsx)(k3,{ref:a,vm:o,showSpeakingIndicators:n,displayName:s,mxcAvatarUrl:c,...i})};A3.displayName=`GridTile`;var j3=({rageshakeRequestId:e,roomId:t,open:n,onDismiss:r})=>{let{t:i}=Ni(),{submitRageshake:a,sending:o,sent:s,error:c}=Gt();return(0,M.useEffect)(()=>{s&&r()},[s,r]),(0,W.jsxs)(or,{title:i(`rageshake_request_modal.title`),open:n,onDismiss:r,children:[(0,W.jsx)(ei,{children:i(`rageshake_request_modal.body`)}),(0,W.jsx)(AI,{children:(0,W.jsx)(Pi,{onClick:()=>void a({sendLogs:!0,rageshakeRequestId:e,roomId:t}),disabled:o,children:i(o?`rageshake_sending_logs`:`rageshake_send_logs`)})}),c&&(0,W.jsx)(AI,{children:(0,W.jsx)(NI,{error:c})})]})};function M3(){(0,M.useEffect)(()=>{if(`wakeLock`in navigator){let e=!0,t=null,n=()=>{document.visibilityState===`visible`&&navigator.wakeLock.request(`screen`).then(n=>{t=n,e||t.release().catch(e=>h.warn(`Can't release wake lock`,e))},e=>{h.warn(`Can't acquire wake lock`,e)})};return n(),document.addEventListener(`visibilitychange`,n),()=>{e=!1,t!==null&&t.release().catch(e=>h.warn(`Can't release wake lock`,e)),document.removeEventListener(`visibilitychange`,n)}}},[])}var N3=0;function P3(){return(N3++).toString()}var F3=class{constructor(e){this.media$=e,this.id=P3()}},I3=class{constructor(e,t){this.media$=e,this.maximised$=t}};function L3(e,t){return{[Symbol.iterator](){let n=e[Symbol.iterator](),r=t[Symbol.iterator]();return{next(){let e;do{if(e=n.next(),!e.done&&e.value!==void 0)return e;let t=r.next();if(!t.done)return t}while(!e.done);return e}}}}}function R3(e){return e.map(e=>e.media.displayName$.value)}var z3=!1;ge.value$.subscribe(e=>z3=e);var B3=class{get media(){return this.media$.value}set media(e){this.media$.next(e)}get maximised(){return this.maximised$.value}set maximised(e){this.maximised$.next(e)}constructor(e,t){this.media$=new Ge(e),this.maximised$=new Ge(t),this.vm=new I3(this.media$,this.maximised$)}},V3=class{get media(){return this.media$.value}set media(e){this.media$.next(e)}constructor(e){this.media$=new Ge(e),this.vm=new F3(this.media$)}},H3=class e{constructor(e,t,n){this.spotlight=e,this.grid=t,this.generation=n,this.spotlightTile=this.spotlight?.vm,this.gridTiles=this.grid.map(({vm:e})=>e),this.gridTilesByMedia=new Map(this.grid.map(({vm:e,media:t})=>[t,e]))}static empty(){return new e(null,[],0)}from(t){return new U3(this.spotlight,this.grid,(t,n)=>new e(t,n,this.generation+1),t,this.generation)}},U3=class{constructor(e,t,n,r,i){this.prevSpotlight=e,this.prevGrid=t,this.construct=n,this.visibleTiles=r,this.generation=i,this.spotlight=null,this.prevSpotlightSpeaker=this.prevSpotlight?.media.length===1&&`speaking$`in this.prevSpotlight.media[0]?this.prevSpotlight.media[0]:null,this.prevGridByMedia=new Map(this.prevGrid.map((e,t)=>[e.media,[e,t]])),this.numGridEntries=0,this.stationaryGridEntries=Array(this.prevGrid.length),this.visibleGridEntries=[],this.invisibleGridEntries=[]}registerSpotlight(e,t){if(z3&&h.debug(`[TileStore, ${this.generation}] register spotlight: ${e.map(e=>e.displayName$.value)}`),this.spotlight!==null)throw Error(`Spotlight already set`);if(this.numGridEntries>0)throw Error(`Spotlight must be registered before grid tiles`);this.prevSpotlight===null?this.spotlight=new B3(e,t):(this.spotlight=this.prevSpotlight,this.spotlight.media=e,this.spotlight.maximised=t)}registerGridTile(e){if(z3&&h.debug(`[TileStore, ${this.generation}] register grid tile: ${e.displayName$.value}`),this.spotlight!==null){if(!(e.type===`user`&&e.local)&&this.spotlight.media.includes(e))return;if(e===this.prevSpotlightSpeaker&&this.spotlight.media.length===1&&`speaking$`in this.spotlight.media[0]&&this.prevSpotlightSpeaker!==this.spotlight.media[0]){let t=this.prevGridByMedia.get(this.spotlight.media[0]);if(t!==void 0){let[n,r]=t,i=r<this.visibleTiles,a=this.numGridEntries<this.visibleTiles;i===a?(this.stationaryGridEntries[r]=n,n.media=e,this.prevGridByMedia.delete(this.spotlight.media[0]),this.prevGridByMedia.set(e,t)):(a?this.visibleGridEntries:this.invisibleGridEntries).push(new V3(e)),this.numGridEntries++;return}}}let t=this.prevGridByMedia.get(e);if(t===void 0)(this.numGridEntries<this.visibleTiles?this.visibleGridEntries:this.invisibleGridEntries).push(new V3(e));else{let[e,n]=t,r=n<this.visibleTiles,i=this.numGridEntries<this.visibleTiles;r===i?this.stationaryGridEntries[n]=e:(i?this.visibleGridEntries:this.invisibleGridEntries).push(e)}this.numGridEntries++}registerPipTile(e){if(z3&&h.debug(`[TileStore, ${this.generation}] register PiP tile: ${e.displayName$.value}`),this.prevGrid.length===1){let t=this.prevGrid[0];this.stationaryGridEntries[0]=t,t.media=e,this.prevGridByMedia.delete(t.media),this.prevGridByMedia.set(e,[t,0])}else this.visibleGridEntries.push(new V3(e));this.numGridEntries++}build(){let e=[...L3(this.stationaryGridEntries,[...this.visibleGridEntries,...this.invisibleGridEntries])];return z3&&(h.debug(`[TileStore, ${this.generation}] stationary: ${R3(this.stationaryGridEntries)}`),h.debug(`[TileStore, ${this.generation}] visible: ${R3(this.visibleGridEntries)}`),h.debug(`[TileStore, ${this.generation}] invisible: ${R3(this.invisibleGridEntries)}`),h.debug(`[TileStore, ${this.generation}] result: ${R3(e)}`)),this.construct(this.spotlight,e)}};function W3(e,t,n,r){let i=r.from(t);e.spotlight!==void 0&&i.registerSpotlight(e.spotlight,e.type===`spotlight-portrait`);for(let t of e.grid)i.registerGridTile(t);let a=i.build();return[{type:e.type,spotlight:a.spotlightTile,grid:a.gridTiles,setVisibleTiles:n},a]}function G3(e,t){let n=t.from(1);n.registerSpotlight(e.spotlight,!0),e.pip!==void 0&&n.registerPipTile(e.pip);let r=n.build();return[{type:e.type,spotlight:r.spotlightTile,pip:r.gridTiles[0]},r]}function K3(e,t){let n=t.from(2);n.registerGridTile(e.pip),n.registerGridTile(e.spotlight);let r=n.build();return[{type:e.type,spotlight:r.gridTilesByMedia.get(e.spotlight),pip:r.gridTilesByMedia.get(e.pip)},r]}function q3(e,t){let n=t.from(0);n.registerSpotlight(e.spotlight,tn!==`desktop`);let r=n.build();return[{type:e.type,spotlight:r.spotlightTile},r]}function J3(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var Y3=h.getChild(`[MatrixKeyProvider]`),X3=class extends tm{constructor(){super({ratchetWindowSize:10,keyringSize:256}),this.onEncryptionKeyChanged=(e,t,n,r)=>{crypto.subtle.importKey(`raw`,e,`HKDF`,!1,[`deriveBits`,`deriveKey`]).then(e=>{this.onSetEncryptionKey(e,r,t),Y3.debug(`Sent new key to livekit room=${this.rtcSession?.room.roomId} participantId=${r} (before hash: ${n.userId}:${n.deviceId}) encryptionKeyIndex=${t}`)},e=>{Y3.error(`Failed to create key material from buffer for livekit room=${this.rtcSession?.room.roomId} participantId before hash=${n.userId}:${n.deviceId} encryptionKeyIndex=${t}`,e)})}}setRTCSession(e){this.rtcSession&&this.rtcSession.off(S.EncryptionKeyChanged,this.onEncryptionKeyChanged),this.rtcSession=e,this.rtcSession.on(S.EncryptionKeyChanged,this.onEncryptionKeyChanged),this.rtcSession.reemitEncryptionKeys()}},Z3=h.getChild(`[HomeserverConnected]`);function Q3(e,t,n){let r=jF(t,ee.Sync).pipe(fI([t.getSyncState()]),G(([e])=>e===d.Syncing)),i=e.behavior(jF(n,b.StatusChanged).pipe(G(()=>n.membershipStatus??T.Unknown)),T.Unknown),a=i.pipe(G(e=>e===T.Connected)),o=jF(n,b.ProbablyLeft).pipe(fI(null),G(()=>n.probablyLeft!==!0));return{combined$:e.behavior(TL(r,a,o).pipe(_I(e=>{Z3.info(`Homeserver connected update: ${e}`)}))),rtsSession$:i}}var $3=function(e){return e.Initialized=`Initialized`,e.FetchingConfig=`FetchingConfig`,e.Stopped=`Stopped`,e.LivekitDisconnected=`disconnected`,e.LivekitConnecting=`connecting`,e.LivekitConnected=`connected`,e.LivekitReconnecting=`reconnecting`,e.LivekitSignalReconnecting=`signalReconnecting`,e}({}),e6=class{get livekitAlias(){return this._livekitAlias}constructor(e,t){this._state$=new Ge($3.Initialized),this.state$=this._state$,this.stopped=!1,this.ownMembershipIdentity=e.ownMembershipIdentity,this.existingSFUConfig=e.existingSFUConfig,this.roomId=e.roomId,this.logger=t.getChild(`[Connection `+e.transport.livekit_service_url+`]`),this.logger.info(`constructor: ${e.transport.livekit_service_url} roomId: ${this.roomId} withSfuConfig?: ${e.existingSFUConfig?JSON.stringify(e.existingSFUConfig):`undefined`}`);let{transport:n,client:r,scope:i}=e;this.scope=i,this.livekitRoom=e.livekitRoomFactory(),this.transport=n,this.client=r,this.remoteParticipants$=i.behavior(nL(this.livekitRoom)),i.onEnd(()=>{this.logger.info(`Connection scope ended, stopping connection`),this.stop()})}async start(){this.logger.debug(`Starting Connection`),this.stopped=!1;try{this._state$.next($3.FetchingConfig);let{url:e,jwt:t,livekitAlias:n}=this.existingSFUConfig??await this.getSFUConfigForRemoteConnection();if(this.logger.debug(`Starting Connection to: `,this.transport.livekit_service_url,`jwt: `,t,`wss: `,e,`livekitAlias: `,n),this._livekitAlias=n,this.stopped)return;QI(this.livekitRoom).pipe(this.scope.bind(),G(e=>e)).subscribe(e=>{this._state$.next(e)});try{this.logger.info(`livekitRoom.connect ${e}`),await this.livekitRoom.connect(e,t),this.logger.info(`livekitRoom.connect SUCCESS ${e}`)}catch(t){if(this.logger.info(`livekitRoom.connect FAILED ${e}`,t),t instanceof I){if(t.status===503||t.status===200||t.status===429)throw new LY;if(t.status===404)throw new RY}throw t}if(this.stopped)return}catch(e){throw this.logger.debug(`Failed to connect to LiveKit room: ${e}`),this._state$.next(e instanceof OY?e:e instanceof Error?new NY(e):new NY(Error(`${e}`))),e}}async getSFUConfigForRemoteConnection(){return await XY(this.client,this.ownMembershipIdentity,this.transport.livekit_service_url,this.roomId,{},this.logger)}async stop(){this.logger.debug(`stop: disconnecing from lk room ${this.transport.livekit_service_url}`),!this.stopped&&(await this.livekitRoom.disconnect(),this._state$.next($3.Stopped),this.stopped=!0,this.logger.debug(`stop: DONE disconnecing from lk room ${this.transport.livekit_service_url}`))}},t6=function(e){return e.Waiting=`transport_waiting`,e}({}),n6=function(e){return e.WaitingForUser=`publish_waiting_for_user`,e.Publishing=`publish_publishing`,e}({}),r6=function(e){return e.WaitingForUser=`tracks_waiting_for_user`,e.Ready=`tracks_ready`,e}({}),i6=({scope:e,connectionManager:t,localTransport$:n,homeserverConnected:r,createPublisherFactory:i,joinMatrixRTC:a,logger:o,muteStates:s,matrixRTCSession:c})=>{let l=o.getChild(`[LocalMembership]`);l.debug(`Creating local membership..`);let u=e=>{let t;return t=e instanceof OY?e:new NY(e instanceof Error?e:Error(`Unknown error from localTransport`)),C(t),aF(null)},d=n.pipe(K(e=>e.advertised$),KF(u),eI(BY)),f=e.behavior(n.pipe(K(e=>yF([e.active$,e.advertised$]).pipe(G(([e,t])=>t==null?null:e?.transport??null))),KF(u),eI(BY))),p=e.behavior(yF([t.connectionManagerData$,f]).pipe(G(([{value:e},t])=>t===null?null:e.getConnectionForTransport(t)),_I(e=>{l.info(`Local connection updated: ${e?.transport?.livekit_service_url}`)})));p.pipe(K(e=>e?jF(e.livekitRoom,L.MediaDevicesError,e=>Jd.getFailure(e)??null):aF(null))).pipe(e.bind()).subscribe(e=>{e&&l.error(`Failed to create local tracks:`,e)});let m=Promise.withResolvers(),h=new Ge(!1),g=new Ge(null),_=()=>{m.resolve()},v=()=>{m.resolve(),h.next(!0)},y=()=>{h.next(!1)};e.reconcile(p,async e=>{if(l.info(`reconcile based on new localConnection:`,e?.transport.livekit_service_url),e!==null){let t=i(e);return g.next(t),Promise.resolve(async()=>{await t.destroy()})}}),e.reconcile(e.behavior(yF([g,iF(m.promise)]),null),async e=>{if(!e)return;let[t]=e;t&&await t.createAndSetupTracks().catch(e=>l.error(e))}),e.reconcile(e.behavior(yF([g,h])),async([e,t])=>{let n=e?.shouldPublish===!0;if(t&&!n)try{await e?.startPublishing()}catch(e){x(new IY(e instanceof Error?e.message:String(e)))}else if(n)try{await e?.stopPublishing()}catch(e){x(new NY(e))}});let b=new Ge(null),x=e=>{b.value===null?b.next(e):l.error(`Multiple Media Errors:`,e)},S=new Ge(null),C=e=>{S.value===null?S.next(e):l.error(`Multiple Transport Errors:`,e)},E=p.pipe(K(e=>e?e.state$:aF(null))),ee=e.behavior(yF([E,f,h,iF(m.promise).pipe(G(()=>!0),fI(!1))]).pipe(G(([e,t,n,r])=>{if(!t)return null;let i=r?r6.Ready:r6.WaitingForUser;return e!==$3.LivekitConnected||i!==r6.Ready?{connection:e,tracks:i}:n?n6.Publishing:n6.WaitingForUser}),eI(w))),te=new Ge(null),ne=e=>{te.value===null?te.next(e):l.error(`Multiple Matrix Errors:`,e)},re=e.behavior(yF([ee,r.rtsSession$,te,S,b]).pipe(G(([e,t,n,r,i])=>r===null?e&&t?{matrix:n??t,media:i??e}:t6.Waiting:r))),ie=e.behavior(TL(r.combined$,E.pipe(G(e=>e===$3.LivekitConnected))).pipe(_I(e=>l.debug(`livekit+matrix: Connected state changed`,e)))),ae=e.behavior(ie.pipe(sI(),G(([e,t])=>e===!0&&t===!1)),!1);e.behavior(h.pipe(sI(),e.bind()),[void 0,h.value]).subscribe(([e,t])=>{At&&(!e&&t&&At.api.transport.send(ht.JoinCall,{}).catch(e=>{l.error(`Failed to send join action`,e)}),e&&!t&&At.api.transport.send(ht.HangupCall,{}).catch(e=>{l.error(`Failed to send hangup action`,e)}))}),s.video.enabled$.pipe(e.bind()).subscribe(e=>{c.updateCallIntent(e?`video`:`audio`).catch(e=>{if(e instanceof Error&&e.message===`Not connected yet`)l.debug(`'not connected yet' while updating the call intent (this is expected on startup)`);else throw e})}),e.reconcile(e.behavior(yF([d,h])),async([e,t])=>{if(e&&t){try{a(e)}catch(e){l.error(`Error entering RTC session`,e),e instanceof Error&&ne(new jY(e))}return Promise.resolve(async()=>{try{await c.leaveRoomSession(1e3)}catch(e){l.error(`Error leaving RTC session`,e)}})}});let D=e.behavior(p.pipe(G(e=>e?.livekitRoom?.localParticipant??null),_I(e=>{l.debug(`participant$ updated:`,e?.identity)})));yF([D,r.combined$]).pipe(e.bind()).subscribe(([e,t])=>{if(!e)return;let n=e.trackPublications.values();if(t){for(let e of n)if(e.track?.isUpstreamPaused===!0){let t=e.track.kind;l.info(`Resuming ${t} track (MatrixRTC connection present)`),e.track.resumeUpstream().catch(e=>l.error(`Failed to resume ${t} track after MatrixRTC reconnection`,e))}}else for(let e of n)if(e.track?.isUpstreamPaused===!1){let t=e.track.kind;l.info(`Pausing ${t} track (uncertain MatrixRTC connection)`),e.track.pauseUpstream().catch(e=>l.error(`Failed to pause ${t} track after entering uncertain MatrixRTC connection`,e))}});let O=e.behavior(D.pipe(K(e=>e===null?aF(!1):a6(e)))),oe=null;return`getDisplayMedia`in(navigator.mediaDevices??{})&&!da().hideScreensharing&&(oe=()=>{let e={audio:{autoGainControl:!1,noiseSuppression:!1,voiceIsolation:!1},selfBrowserSurface:`include`,surfaceSwitching:`include`,systemAudio:`include`},t=!O.value;l.info(`toggleScreenSharing called. Switching ${t?`On`:`Off`}`),D.value?.setScreenShareEnabled(t,e).catch(l.error)}),{startTracks:_,requestJoinAndPublish:v,requestDisconnect:y,localMemberState$:re,participant$:D,reconnecting$:ae,connected$:ie,disconnected$:e.behavior(r.rtsSession$.pipe(G(e=>e===T.Disconnected))),sharingScreen$:O,toggleScreenSharing:oe,connection$:p,internalLoggerRef:l}};function a6(e){return eL(e,R.TrackPublished,R.TrackUnpublished,R.LocalTrackPublished,R.LocalTrackUnpublished).pipe(G(e=>e.isScreenShareEnabled))}function o6(e,t,n,r){let{encryptMedia:i,matrixRTCMode:a}=r;vr.instance.eventCallEnded.cacheStartCall(new Date),vr.instance.eventCallStarted.track(e.room.roomId);let{features:o,matrix_rtc_session:s}=ze.get(),c=o?.feature_use_device_session_member_events,{sendNotificationType:l,callIntent:u}=da(),d=a===pr.Compatibility||a===pr.Matrix_2_0,f;f=a===pr.Matrix_2_0?n:{livekit_alias:e.room.roomId,...n},e.joinRTCSession(t,d?[]:[f],d?f:void 0,{notificationType:l,callIntent:u,manageMediaKeys:i,...c!==void 0&&{useLegacyMemberEvents:!c},delayedLeaveEventRestartMs:s?.delayed_leave_event_restart_ms,delayedLeaveEventDelayMs:s?.delayed_leave_event_delay_ms,delayedLeaveEventRestartLocalTimeoutMs:s?.delayed_leave_event_restart_local_timeout_ms,networkErrorRetryMs:s?.network_error_retry_ms,makeKeyDelay:s?.wait_for_key_rotation_ms,membershipEventExpiryMs:s?.membership_event_expiry_ms,unstableSendStickyEvents:a===pr.Matrix_2_0})}var s6=(e,t)=>{let n=e.behavior(t.pipe(gL(e=>e.map(t=>{let n=e[0]??t,r=t.getTransport(n);return{membership:t,transport:v(r)?r:void 0}}))));return{membershipsWithTransport$:n,transports$:e.behavior(n.pipe(gL(e=>e.flatMap(({transport:e})=>e?[e]:[]))))}},c6=(e,t)=>e.behavior(jF(t,S.MembershipsChanged,(e,t)=>t).pipe(_L()),new hL(t.memberships)),l6='function e(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var t={exports:{}},n=t.exports,r;function i(){return r?t.exports:(r=1,(function(e){(function(t,n){e.exports?e.exports=n():t.log=n()})(n,function(){var e=function(){},t=`undefined`,n=typeof window!==t&&typeof window.navigator!==t&&/Trident\\/|MSIE /.test(window.navigator.userAgent),r=[`trace`,`debug`,`info`,`warn`,`error`],i={},a=null;function o(e,t){var n=e[t];if(typeof n.bind==`function`)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch{return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(r){return r===`debug`&&(r=`log`),typeof console===t?!1:r===`trace`&&n?s:console[r]===void 0?console.log===void 0?e:o(console,`log`):o(console,r)}function l(){for(var n=this.getLevel(),i=0;i<r.length;i++){var a=r[i];this[a]=i<n?e:this.methodFactory(a,n,this.name)}if(this.log=this.debug,typeof console===t&&n<this.levels.SILENT)return`No console available for logging`}function u(e){return function(){typeof console!==t&&(l.call(this),this[e].apply(this,arguments))}}function d(e,t,n){return c(e)||u.apply(this,arguments)}function f(e,n){var o=this,s,c,u,f=`loglevel`;typeof e==`string`?f+=`:`+e:typeof e==`symbol`&&(f=void 0);function p(e){var n=(r[e]||`silent`).toUpperCase();if(!(typeof window===t||!f)){try{window.localStorage[f]=n;return}catch{}try{window.document.cookie=encodeURIComponent(f)+`=`+n+`;`}catch{}}}function m(){var e;if(!(typeof window===t||!f)){try{e=window.localStorage[f]}catch{}if(typeof e===t)try{var n=window.document.cookie,r=encodeURIComponent(f),i=n.indexOf(r+`=`);i!==-1&&(e=/^([^;]+)/.exec(n.slice(i+r.length+1))[1])}catch{}return o.levels[e]===void 0&&(e=void 0),e}}function h(){if(!(typeof window===t||!f)){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+`=; expires=Thu, 01 Jan 1970 00:00:00 UTC`}catch{}}}function g(e){var t=e;if(typeof t==`string`&&o.levels[t.toUpperCase()]!==void 0&&(t=o.levels[t.toUpperCase()]),typeof t==`number`&&t>=0&&t<=o.levels.SILENT)return t;throw TypeError(`log.setLevel() called with invalid level: `+e)}o.name=e,o.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},o.methodFactory=n||d,o.getLevel=function(){return u??c??s},o.setLevel=function(e,t){return u=g(e),t!==!1&&p(u),l.call(o)},o.setDefaultLevel=function(e){c=g(e),m()||o.setLevel(e,!1)},o.resetLevel=function(){u=null,h(),l.call(o)},o.enableAll=function(e){o.setLevel(o.levels.TRACE,e)},o.disableAll=function(e){o.setLevel(o.levels.SILENT,e)},o.rebuild=function(){if(a!==o&&(s=g(a.getLevel())),l.call(o),a===o)for(var e in i)i[e].rebuild()},s=g(a?a.getLevel():`WARN`);var _=m();_!=null&&(u=g(_)),l.call(o)}a=new f,a.getLogger=function(e){if(typeof e!=`symbol`&&typeof e!=`string`||e===``)throw TypeError(`You must supply a name when creating a logger.`);var t=i[e];return t||=i[e]=new f(e,a.methodFactory),t};var p=typeof window===t?void 0:window.log;return a.noConflict=function(){return typeof window!==t&&window.log===a&&(window.log=p),a},a.getLoggers=function(){return i},a.default=a,a})})(t),t.exports)}var a=i(),o;(function(e){e[e.trace=0]=`trace`,e[e.debug=1]=`debug`,e[e.info=2]=`info`,e[e.warn=3]=`warn`,e[e.error=4]=`error`,e[e.silent=5]=`silent`})(o||={});var s;(function(e){e.Default=`livekit`,e.Room=`livekit-room`,e.TokenSource=`livekit-token-source`,e.Participant=`livekit-participant`,e.Track=`livekit-track`,e.Publication=`livekit-track-publication`,e.Engine=`livekit-engine`,e.Signal=`livekit-signal`,e.PCManager=`livekit-pc-manager`,e.PCTransport=`livekit-pc-transport`,e.E2EE=`lk-e2ee`,e.DataTracks=`livekit-data-tracks`})(s||={});let c=a.getLogger(`livekit`);Object.values(s).map(e=>a.getLogger(e)),c.setDefaultLevel(o.info);const l=a.getLogger(`lk-e2ee`);var u=Object.defineProperty,d=(e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,f=(e,t,n)=>d(e,typeof t==`symbol`?t:t+``,n),p=class{constructor(){f(this,`_locking`),f(this,`_locks`),this._locking=Promise.resolve(),this._locks=0}isLocked(){return this._locks>0}lock(){this._locks+=1;let e,t=new Promise(t=>e=()=>{--this._locks,t()}),n=this._locking.then(()=>e);return this._locking=this._locking.then(()=>t),n}},m;(function(e){e[e.WAITING=0]=`WAITING`,e[e.RUNNING=1]=`RUNNING`,e[e.COMPLETED=2]=`COMPLETED`})(m||={});var h=class{constructor(){this.pendingTasks=new Map,this.taskMutex=new p,this.nextTaskIndex=0}run(t){return e(this,void 0,void 0,function*(){let e={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:m.WAITING};this.pendingTasks.set(e.id,e);let n=yield this.taskMutex.lock();try{return e.executedAt=Date.now(),e.status=m.RUNNING,yield t()}finally{e.status=m.COMPLETED,this.pendingTasks.delete(e.id),n()}})}flush(){return e(this,void 0,void 0,function*(){return this.run(()=>e(this,void 0,void 0,function*(){}))})}snapshot(){return Array.from(this.pendingTasks.values())}};const g=`AES-GCM`,_={key:10,delta:3,audio:1,empty:0},v={sharedKey:!1,ratchetSalt:`LKFrameEncryptionKey`,ratchetWindowSize:8,failureTolerance:10,keyringSize:16,keySize:128};var y=class extends Error{constructor(e,t,n){super(t||`an error has occurred`),this.name=`LiveKitError`,this.code=e,n?.cause!==void 0&&(this.cause=n?.cause)}},b;(function(e){e[e.NotAllowed=0]=`NotAllowed`,e[e.ServerUnreachable=1]=`ServerUnreachable`,e[e.InternalError=2]=`InternalError`,e[e.Cancelled=3]=`Cancelled`,e[e.LeaveRequest=4]=`LeaveRequest`,e[e.Timeout=5]=`Timeout`,e[e.WebSocket=6]=`WebSocket`,e[e.ServiceNotFound=7]=`ServiceNotFound`})(b||={});var ee;(function(e){e[e.AlreadyOpened=0]=`AlreadyOpened`,e[e.AbnormalEnd=1]=`AbnormalEnd`,e[e.DecodeFailed=2]=`DecodeFailed`,e[e.LengthExceeded=3]=`LengthExceeded`,e[e.Incomplete=4]=`Incomplete`,e[e.HandlerAlreadyRegistered=7]=`HandlerAlreadyRegistered`,e[e.EncryptionTypeMismatch=8]=`EncryptionTypeMismatch`})(ee||={});var x;(function(e){e.PermissionDenied=`PermissionDenied`,e.NotFound=`NotFound`,e.DeviceInUse=`DeviceInUse`,e.Other=`Other`})(x||={}),(function(e){function t(t){if(t&&`name`in t)return t.name===`NotFoundError`||t.name===`DevicesNotFoundError`?e.NotFound:t.name===`NotAllowedError`||t.name===`PermissionDeniedError`?e.PermissionDenied:t.name===`NotReadableError`||t.name===`TrackStartError`?e.DeviceInUse:e.Other}e.getFailure=t})(x||={});var S;(function(e){e[e.InvalidKey=0]=`InvalidKey`,e[e.MissingKey=1]=`MissingKey`,e[e.InternalError=2]=`InternalError`})(S||={});var C=class extends y{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.InternalError,n=arguments.length>2?arguments[2]:void 0;super(40,e),this.reason=t,this.participantIdentity=n}},te;(function(e){e.SetKey=`setKey`,e.RatchetRequest=`ratchetRequest`,e.KeyRatcheted=`keyRatcheted`})(te||={});var w;(function(e){e.KeyRatcheted=`keyRatcheted`})(w||={});var ne;(function(e){e.ParticipantEncryptionStatusChanged=`participantEncryptionStatusChanged`,e.EncryptionError=`encryptionError`})(ne||={});var T;(function(e){e.Error=`cryptorError`})(T||={});function re(e){return`type`in e}function ie(t){return e(this,arguments,void 0,function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{name:g},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:`encrypt`;return function*(){return crypto.subtle.importKey(`raw`,e,t,!1,n===`derive`?[`deriveBits`,`deriveKey`]:[`encrypt`,`decrypt`])}()})}function E(e,t){let n=new TextEncoder().encode(t);switch(e){case`HKDF`:return{name:`HKDF`,salt:n,hash:`SHA-256`,info:new ArrayBuffer(128)};case`PBKDF2`:return{name:`PBKDF2`,salt:n,hash:`SHA-256`,iterations:1e5};default:throw Error(`algorithm ${e} is currently unsupported`)}}function D(t,n){return e(this,void 0,void 0,function*(){let e=E(t.algorithm.name,n.ratchetSalt);return{material:t,encryptionKey:yield crypto.subtle.deriveKey(e,t,{name:g,length:n.keySize},!1,[`encrypt`,`decrypt`])}})}function ae(t,n){return e(this,void 0,void 0,function*(){let e=E(t.algorithm.name,n);return crypto.subtle.deriveBits(e,t,256)})}function oe(e){for(var t=0;t<e.length-3;t++)if(e[t]==0&&e[t+1]==0&&e[t+2]==3)return!0;return!1}function se(e){let t=[];for(var n=e.length,r=0;r<e.length;)n-r>=3&&!e[r]&&!e[r+1]&&e[r+2]==3?(t.push(e[r++]),t.push(e[r++]),r++):t.push(e[r++]);return new Uint8Array(t)}function ce(e){let t=[];for(var n=0,r=0;r<e.length;++r){var i=e[r];i<=3&&n>=2&&(t.push(3),n=0),t.push(i),i==0?++n:n=0}return new Uint8Array(t)}var O=class t{static makeIV(e){let n=new ArrayBuffer(12),r=new DataView(n),i=crypto.getRandomValues(new Uint32Array(1));return r.setUint32(0,i[0]),r.setUint32(4,e),r.setUint32(8,e-t.sendCount%65535),t.sendCount++,n}static encrypt(n,r){return e(this,void 0,void 0,function*(){let e=t.makeIV(performance.now()),i=yield r.getKeySet();if(!i)throw Error(`No key set found`);let a=yield crypto.subtle.encrypt({name:g,iv:e},i.encryptionKey,new Uint8Array(n));return{payload:new Uint8Array(a),iv:new Uint8Array(e),keyIndex:r.getCurrentKeyIndex()}})}static decrypt(n,r,i){return e(this,arguments,void 0,function(e,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{ratchetCount:0};return function*(){let s=yield r.getKeySet(i);if(!s)throw Error(`No key set found`);try{let t=yield crypto.subtle.decrypt({name:g,iv:n},s.encryptionKey,new Uint8Array(e));return{payload:new Uint8Array(t)}}catch(c){if(r.keyProviderOptions.ratchetWindowSize>0)if(o.ratchetCount<r.keyProviderOptions.ratchetWindowSize){l.debug(`DataCryptor: ratcheting key attempt ${o.ratchetCount} of ${r.keyProviderOptions.ratchetWindowSize}, for data packet`);let c,u;(a??s)===r.getKeySet(i)&&(u=yield r.ratchetKey(i,!1),c=yield D(u.cryptoKey,r.keyProviderOptions));let d=yield t.decrypt(e,n,r,i,a,{ratchetCount:o.ratchetCount+1,encryptionKey:c?.encryptionKey});return d&&c&&(a??s)===r.getKeySet(i)&&(r.setKeySet(c,i,u),r.setCurrentKeyIndex(i)),d}else throw l.warn(`DataCryptor: maximum ratchet attempts exceeded`),new C(`DataCryptor: valid key missing for participant ${r.participantIdentity}`,S.InvalidKey,r.participantIdentity);else throw new C(`DataCryptor: Decryption failed: ${c.message}`,S.InvalidKey,r.participantIdentity)}}()})}};O.sendCount=0;var k={exports:{}},A;function j(){if(A)return k.exports;A=1;var e=typeof Reflect==`object`?Reflect:null,t=e&&typeof e.apply==`function`?e.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},n=e&&typeof e.ownKeys==`function`?e.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function r(e){console&&console.warn&&console.warn(e)}var i=Number.isNaN||function(e){return e!==e};function a(){a.init.call(this)}k.exports=a,k.exports.once=_,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(a,`defaultMaxListeners`,{enumerable:!0,get:function(){return o},set:function(e){if(typeof e!=`number`||e<0||i(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);o=e}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if(typeof e!=`number`||e<0||i(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function c(e){return e._maxListeners===void 0?a.defaultMaxListeners:e._maxListeners}a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)t(c,this,n);else for(var l=c.length,u=m(c,l),r=0;r<l;++r)t(u[r],this,n);return!0};function l(e,t,n,i){var a,o,l;if(s(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),l=o[t]),l===void 0)l=o[t]=n,++e._eventsCount;else if(typeof l==`function`?l=o[t]=i?[n,l]:[l,n]:i?l.unshift(n):l.push(n),a=c(e),a>0&&l.length>a&&!l.warned){l.warned=!0;var u=Error(`Possible EventEmitter memory leak detected. `+l.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);u.name=`MaxListenersExceededWarning`,u.emitter=e,u.type=t,u.count=l.length,r(u)}return e}a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}a.prototype.once=function(e,t){return s(t),this.on(e,d(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,d(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,i,a,o;if(s(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():h(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function f(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?g(i):m(i,i.length)}a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p;function p(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function m(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function h(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function g(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function _(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),t!==`error`&&v(e,i,{once:!0})})}function v(e,t,n){typeof e.on==`function`&&y(e,`error`,t,n)}function y(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}return k.exports}var M=j(),N;(function(e){e[e.SLICE_NON_IDR=1]=`SLICE_NON_IDR`,e[e.SLICE_PARTITION_A=2]=`SLICE_PARTITION_A`,e[e.SLICE_PARTITION_B=3]=`SLICE_PARTITION_B`,e[e.SLICE_PARTITION_C=4]=`SLICE_PARTITION_C`,e[e.SLICE_IDR=5]=`SLICE_IDR`,e[e.SEI=6]=`SEI`,e[e.SPS=7]=`SPS`,e[e.PPS=8]=`PPS`,e[e.AUD=9]=`AUD`,e[e.END_SEQ=10]=`END_SEQ`,e[e.END_STREAM=11]=`END_STREAM`,e[e.FILLER_DATA=12]=`FILLER_DATA`,e[e.SPS_EXT=13]=`SPS_EXT`,e[e.PREFIX_NALU=14]=`PREFIX_NALU`,e[e.SUBSET_SPS=15]=`SUBSET_SPS`,e[e.DPS=16]=`DPS`,e[e.SLICE_AUX=19]=`SLICE_AUX`,e[e.SLICE_EXT=20]=`SLICE_EXT`,e[e.SLICE_LAYER_EXT=21]=`SLICE_LAYER_EXT`})(N||={});var P;(function(e){e[e.TRAIL_N=0]=`TRAIL_N`,e[e.TRAIL_R=1]=`TRAIL_R`,e[e.TSA_N=2]=`TSA_N`,e[e.TSA_R=3]=`TSA_R`,e[e.STSA_N=4]=`STSA_N`,e[e.STSA_R=5]=`STSA_R`,e[e.RADL_N=6]=`RADL_N`,e[e.RADL_R=7]=`RADL_R`,e[e.RASL_N=8]=`RASL_N`,e[e.RASL_R=9]=`RASL_R`,e[e.BLA_W_LP=16]=`BLA_W_LP`,e[e.BLA_W_RADL=17]=`BLA_W_RADL`,e[e.BLA_N_LP=18]=`BLA_N_LP`,e[e.IDR_W_RADL=19]=`IDR_W_RADL`,e[e.IDR_N_LP=20]=`IDR_N_LP`,e[e.CRA_NUT=21]=`CRA_NUT`,e[e.VPS_NUT=32]=`VPS_NUT`,e[e.SPS_NUT=33]=`SPS_NUT`,e[e.PPS_NUT=34]=`PPS_NUT`,e[e.AUD_NUT=35]=`AUD_NUT`,e[e.EOS_NUT=36]=`EOS_NUT`,e[e.EOB_NUT=37]=`EOB_NUT`,e[e.FD_NUT=38]=`FD_NUT`,e[e.PREFIX_SEI_NUT=39]=`PREFIX_SEI_NUT`,e[e.SUFFIX_SEI_NUT=40]=`SUFFIX_SEI_NUT`})(P||={});function F(e){return e&31}function I(e){return e>>1&63}function L(e){return e===N.SLICE_IDR||e===N.SLICE_NON_IDR}function R(e){return e===P.TRAIL_N||e===P.TRAIL_R||e===P.TSA_N||e===P.TSA_R||e===P.STSA_N||e===P.STSA_R||e===P.RADL_N||e===P.RADL_R||e===P.RASL_N||e===P.RASL_R||e===P.BLA_W_LP||e===P.BLA_W_RADL||e===P.BLA_N_LP||e===P.IDR_W_RADL||e===P.IDR_N_LP||e===P.CRA_NUT}function le(e,t){for(let n of t){if(L(F(e[n])))return`h264`;if(R(I(e[n])))return`h265`}return`unknown`}function ue(e,t,n){for(let r of t)if(n===`h265`){if(R(I(e[r])))return r+2}else if(L(F(e[r])))return r+2;return null}function de(e){let t=[],n=0,r=0,i=e.length-3;for(;r<i;){for(;r<i&&!(r<i-1&&e[r]===0&&e[r+1]===0&&e[r+2]===0&&e[r+3]===1||e[r]===0&&e[r+1]===0&&e[r+2]===1);)r++;r>=i&&(r=e.length);let a=r;for(;a>n&&e[a-1]===0;)a--;if(n===0){if(a!==n)throw TypeError(`byte stream contains leading data`)}else t.push(n);let o=3;r<e.length-3&&e[r]===0&&e[r+1]===0&&e[r+2]===0&&e[r+3]===1&&(o=4),n=r+=o}return t}function fe(e,t){let n=de(e),r=t??le(e,n);if(r===`unknown`)return{unencryptedBytes:0,detectedCodec:r,requiresNALUProcessing:!1};let i=ue(e,n,r);if(i===null)throw TypeError(`Could not find NALU`);return{unencryptedBytes:i,detectedCodec:r,requiresNALUProcessing:!0}}function pe(t){return e(this,void 0,void 0,function*(){let e=yield crypto.subtle.digest(`SHA-256`,t),n=new Uint8Array(e);return Array.from(n).map(e=>e.toString(16).padStart(2,`0`)).join(``)})}const z={VP8KeyFrame8x8:`ef0161653d8b2b23aad46624b420af1d03ce48950e9fc85718028f91b50f9219`,H264KeyFrame2x2SPS:`f0a0e09647d891d6d50aa898bce7108090375d0d55e50a2bb21147afee558e44`,H264KeyFrame2x2PPS:`61d9665eed71b6d424ae9539330a3bdd5cb386d4d781c808219a6e36750493a7`,H264KeyFrame2x2IDR:`faffc26b68a2fc09096fa20f3351e706398b6f838a7500c8063472c2e476e90d`,OpusSilenceFrame:`aad8d31fc56b2802ca500e58c2fb9d0b29ad71bb7cb52cd6530251eade188988`};function me(t){return e(this,void 0,void 0,function*(){switch(yield pe(t)){case z.VP8KeyFrame8x8:return`vp8`;case z.H264KeyFrame2x2SPS:return`h264`;case z.H264KeyFrame2x2PPS:return`h264`;case z.H264KeyFrame2x2IDR:return`h264`;case z.OpusSilenceFrame:return`opus`;default:return null}})}const B=new Map;var V=class extends M.EventEmitter{encodeFunction(e,t){throw Error(`not implemented for subclass`)}decodeFunction(e,t){throw Error(`not implemented for subclass`)}},he=class extends V{constructor(e){super(),this.lastErrorTimestamp=new Map,this.errorCounts=new Map,this.ERROR_THROTTLE_MS=1e3,this.MAX_ERRORS_PER_MINUTE=5,this.ERROR_WINDOW_MS=6e4,this.sendCounts=new Map,this.keys=e.keys,this.participantIdentity=e.participantIdentity,this.rtpMap=new Map,this.keyProviderOptions=e.keyProviderOptions,this.sifTrailer=e.sifTrailer??Uint8Array.from([])}get logContext(){return{participant:this.participantIdentity,mediaTrackId:this.trackId,fallbackCodec:this.videoCodec}}setParticipant(e,t){l.debug(`setting new participant on cryptor`,Object.assign(Object.assign({},this.logContext),{newParticipant:e,hadPreviousParticipant:!!this.participantIdentity})),this.participantIdentity&&this.participantIdentity!==e&&(l.warn(`cryptor has already a participant set, cleaning up before switching`,{oldParticipant:this.participantIdentity,newParticipant:e,trackId:this.trackId}),this.unsetParticipant()),this.participantIdentity=e,this.keys=t}unsetParticipant(){l.debug(`unsetting participant`,this.logContext),this.currentTransform&&=void 0,this.participantIdentity=void 0,this.lastErrorTimestamp=new Map,this.errorCounts=new Map}isEnabled(){if(this.participantIdentity)return B.get(this.participantIdentity)}getParticipantIdentity(){return this.participantIdentity}getTrackId(){return this.trackId}setVideoCodec(e){this.videoCodec=e}setRtpMap(e){this.rtpMap=e}setupTransform(e,t,n,r,i,a){if(a&&(l.info(`setting codec on cryptor to`,{codec:a}),this.videoCodec=a),l.debug(`Setting up frame cryptor transform`,Object.assign({operation:e,passedTrackId:r,codec:a,isReuse:i,hasCurrentTransform:!!this.currentTransform},this.logContext)),this.trackId=r,i&&this.currentTransform&&t===this.currentTransform.readable&&n===this.currentTransform.writable){l.debug(`reusing existing transform`,Object.assign(Object.assign({},this.logContext),{trackId:r}));return}let o=Symbol(`transform`),s=e===`encode`?this.encodeFunction:this.decodeFunction,c=new TransformStream({transform:s.bind(this)});this.currentTransform={readable:t,writable:n,transformer:c,trackId:r,symbol:o},t.pipeThrough(c).pipeTo(n).catch(e=>{e instanceof TypeError&&e.message===`Destination stream closed`?l.debug(`destination stream closed`):(l.warn(`transform error`,Object.assign({error:e},this.logContext)),this.emit(T.Error,e instanceof C?e:new C(e.message,void 0,this.participantIdentity)))}).finally(()=>{this.currentTransform?.symbol===o&&(l.debug(`transform completed`,Object.assign(Object.assign({},this.logContext),{trackId:r})),this.currentTransform=void 0)})}setSifTrailer(e){l.debug(`setting SIF trailer`,Object.assign(Object.assign({},this.logContext),{trailer:e})),this.sifTrailer=e}shouldEmitError(e){let t=Date.now(),n=this.lastErrorTimestamp.get(e)??0,r=this.errorCounts.get(e)??0;return t-n>this.ERROR_WINDOW_MS?(this.errorCounts.set(e,0),this.lastErrorTimestamp.set(e,t),!0):t-n<this.ERROR_THROTTLE_MS?!1:r>=this.MAX_ERRORS_PER_MINUTE?(r===this.MAX_ERRORS_PER_MINUTE&&(l.warn(`Suppressing further decryption errors for ${this.participantIdentity}`,Object.assign(Object.assign({},this.logContext),{errorKey:e})),this.errorCounts.set(e,r+1)),!1):(this.lastErrorTimestamp.set(e,t),this.errorCounts.set(e,r+1),!0)}emitThrottledError(e){let t=`${this.participantIdentity}-${e.reason}-decrypt`;if(this.shouldEmitError(t)){let n=this.errorCounts.get(t)??0;n>1&&l.debug(`Decryption error (${n} occurrences in window)`,Object.assign(Object.assign({},this.logContext),{reason:S[e.reason]})),this.emit(T.Error,e)}}encodeFunction(t,n){return e(this,void 0,void 0,function*(){if(!this.isEnabled()||t.data.byteLength===0)return n.enqueue(t);let e=this.keys.getKeySet();if(!e){this.emitThrottledError(new C(`key set not found for ${this.participantIdentity} at index ${this.keys.getCurrentKeyIndex()}`,S.MissingKey,this.participantIdentity));return}let{encryptionKey:r}=e,i=this.keys.getCurrentKeyIndex();if(r){let e=this.makeIV(t.getMetadata().synchronizationSource??-1,t.timestamp),o=this.getUnencryptedBytes(t),s=new Uint8Array(t.data,0,o.unencryptedBytes),c=new Uint8Array(2);c[0]=12,c[1]=i;try{let i=yield crypto.subtle.encrypt({name:g,iv:e,additionalData:new Uint8Array(t.data,0,s.byteLength)},r,new Uint8Array(t.data,o.unencryptedBytes)),l=new Uint8Array(i.byteLength+e.byteLength+c.byteLength);l.set(new Uint8Array(i)),l.set(new Uint8Array(e),i.byteLength),l.set(c,i.byteLength+e.byteLength),o.requiresNALUProcessing&&(l=ce(l));var a=new Uint8Array(s.byteLength+l.byteLength);return a.set(s),a.set(l,s.byteLength),t.data=a.buffer,n.enqueue(t)}catch(e){l.error(e)}}else l.debug(`failed to encrypt, emitting error`,this.logContext),this.emitThrottledError(new C(`encryption key missing for encoding`,S.MissingKey,this.participantIdentity))})}decodeFunction(t,n){return e(this,void 0,void 0,function*(){if(!this.isEnabled()||t.data.byteLength===0)return n.enqueue(t);if(ge(t.data,this.sifTrailer)){if(t.data=t.data.slice(0,t.data.byteLength-this.sifTrailer.byteLength),yield me(t.data))return l.debug(`enqueue SIF`,this.logContext),n.enqueue(t);l.warn(`Unexpected SIF frame payload, dropping frame`,this.logContext);return}let e=new Uint8Array(t.data)[t.data.byteLength-1];if(!this.keys.hasInvalidKeyAtIndex(e))if(this.keys.getKeySet(e))try{let r=yield this.decryptFrame(t,e);if(this.keys.decryptionSuccess(e),r)return n.enqueue(r)}catch(t){t instanceof C&&t.reason===S.InvalidKey?this.keys.hasValidKey&&(this.emitThrottledError(t),this.keys.decryptionFailure(e)):l.warn(`decoding frame failed`,{error:t})}else l.warn(`skipping decryption due to missing key at index ${e}`),this.emitThrottledError(new C(`missing key at index ${e} for participant ${this.participantIdentity}`,S.MissingKey,this.participantIdentity)),this.keys.decryptionFailure(e)})}decryptFrame(t,n){return e(this,arguments,void 0,function(e,t){var n=this;let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{ratchetCount:0};return function*(){let a=n.keys.getKeySet(t);if(!i.encryptionKey&&!a)throw TypeError(`no encryption key found for decryption of ${n.participantIdentity}`);let o=n.getUnencryptedBytes(e);try{let t=new Uint8Array(e.data,0,o.unencryptedBytes);var s=new Uint8Array(e.data,t.length,e.data.byteLength-t.length);if(o.requiresNALUProcessing&&oe(s)){s=se(s);let n=new Uint8Array(t.byteLength+s.byteLength);n.set(t),n.set(s,t.byteLength),e.data=n.buffer}let n=new Uint8Array(e.data,e.data.byteLength-2,2),r=n[0],c=new Uint8Array(e.data,e.data.byteLength-r-n.byteLength,r),l=t.byteLength,u=e.data.byteLength-(t.byteLength+r+n.byteLength),d=yield crypto.subtle.decrypt({name:g,iv:c,additionalData:new Uint8Array(e.data,0,t.byteLength)},i.encryptionKey??a.encryptionKey,new Uint8Array(e.data,l,u)),f=new ArrayBuffer(t.byteLength+d.byteLength),p=new Uint8Array(f);return p.set(new Uint8Array(e.data,0,t.byteLength)),p.set(new Uint8Array(d),t.byteLength),e.data=f,e}catch(o){if(n.keyProviderOptions.ratchetWindowSize>0)if(i.ratchetCount<n.keyProviderOptions.ratchetWindowSize){l.debug(`ratcheting key attempt ${i.ratchetCount} of ${n.keyProviderOptions.ratchetWindowSize}, for kind ${e instanceof RTCEncodedAudioFrame?`audio`:`video`}`);let o,s;(r??a)===n.keys.getKeySet(t)&&(s=yield n.keys.ratchetKey(t,!1),o=yield D(s.cryptoKey,n.keyProviderOptions));let c=yield n.decryptFrame(e,t,r||a,{ratchetCount:i.ratchetCount+1,encryptionKey:o?.encryptionKey});return c&&o&&(r??a)===n.keys.getKeySet(t)&&(n.keys.setKeySet(o,t,s),n.keys.setCurrentKeyIndex(t)),c}else throw l.warn(`maximum ratchet attempts exceeded`),new C(`valid key missing for participant ${n.participantIdentity}`,S.InvalidKey,n.participantIdentity);else throw new C(`Decryption failed: ${o.message}`,S.InvalidKey,n.participantIdentity)}}()})}makeIV(e,t){let n=new ArrayBuffer(12),r=new DataView(n);this.sendCounts.has(e)||this.sendCounts.set(e,Math.floor(Math.random()*65535));let i=this.sendCounts.get(e)??0;return r.setUint32(0,e),r.setUint32(4,t),r.setUint32(8,t-i%65535),this.sendCounts.set(e,i+1),n}getUnencryptedBytes(e){if(!re(e))return{unencryptedBytes:_.audio,requiresNALUProcessing:!1};let t=this.getVideoCodec(e)??this.videoCodec;if(t!==this.detectedCodec&&(l.debug(`detected different codec`,Object.assign({detectedCodec:t,oldCodec:this.detectedCodec},this.logContext)),this.detectedCodec=t),t===`av1`)throw Error(`${t} is not yet supported for end to end encryption`);if(t===`vp8`)return{unencryptedBytes:_[e.type],requiresNALUProcessing:!1};if(t===`vp9`)return{unencryptedBytes:0,requiresNALUProcessing:!1};try{let n=t===`h264`||t===`h265`?t:void 0,r=fe(new Uint8Array(e.data),n);if(r.requiresNALUProcessing)return{unencryptedBytes:r.unencryptedBytes,requiresNALUProcessing:!0}}catch(e){l.debug(`NALU processing failed, falling back to VP8 handling`,Object.assign({error:e},this.logContext))}return{unencryptedBytes:_[e.type],requiresNALUProcessing:!1}}getVideoCodec(e){if(this.rtpMap.size===0)return;let t=e.getMetadata().payloadType;return t?this.rtpMap.get(t):void 0}};function ge(e,t){if(t.byteLength===0)return!1;let n=new Uint8Array(e.slice(e.byteLength-t.byteLength));return t.every((e,t)=>e===n[t])}var H=class extends M.EventEmitter{get hasValidKey(){return!this.hasInvalidKeyAtIndex(this.currentKeyIndex)}constructor(e,t){if(super(),this.currentKeyIndex=0,t.keyringSize<1||t.keyringSize>256)throw TypeError(`Keyring size needs to be between 1 and 256`);this.cryptoKeyRing=Array(t.keyringSize).fill(void 0),this.decryptionFailureCounts=Array(t.keyringSize).fill(0),this.keyProviderOptions=t,this.ratchetPromiseMap=new Map,this.participantIdentity=e}hasInvalidKeyAtIndex(e){return this.keyProviderOptions.failureTolerance>=0&&this.decryptionFailureCounts[e]>this.keyProviderOptions.failureTolerance}decryptionFailure(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.currentKeyIndex;this.keyProviderOptions.failureTolerance<0||(this.decryptionFailureCounts[e]+=1,this.decryptionFailureCounts[e]>this.keyProviderOptions.failureTolerance&&l.warn(`key for ${this.participantIdentity} at index ${e} is being marked as invalid`))}decryptionSuccess(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.currentKeyIndex;this.resetKeyStatus(e)}resetKeyStatus(e){e===void 0?this.decryptionFailureCounts.fill(0):this.decryptionFailureCounts[e]=0}ratchetKey(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=t??this.getCurrentKeyIndex(),i=this.ratchetPromiseMap.get(r);if(i!==void 0)return i;let a=new Promise((t,i)=>e(this,void 0,void 0,function*(){try{let e=this.getKeySet(r);if(!e)throw TypeError(`Cannot ratchet key without a valid keyset of participant ${this.participantIdentity}`);let i=e.material,a=yield ae(i,this.keyProviderOptions.ratchetSalt),o=yield ie(a,i.algorithm.name,`derive`),s={chainKey:a,cryptoKey:o};n&&(yield this.setKeyFromMaterial(o,r,s)),t(s)}catch(e){i(e)}finally{this.ratchetPromiseMap.delete(r)}}));return this.ratchetPromiseMap.set(r,a),a}setKey(t){return e(this,arguments,void 0,function(e){var t=this;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return function*(){yield t.setKeyFromMaterial(e,n,null,r),r&&t.resetKeyStatus(n)}()})}setKeyFromMaterial(t,n){return e(this,arguments,void 0,function(e,t){var n=this;let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;return function*(){let a=yield D(e,n.keyProviderOptions),o=t>=0?t%n.cryptoKeyRing.length:n.currentKeyIndex;l.debug(`setting new key with index ${t}`,{usage:e.usages,algorithm:e.algorithm,ratchetSalt:n.keyProviderOptions.ratchetSalt}),n.setKeySet(a,o,r),o>=0&&i&&(n.currentKeyIndex=o)}()})}setKeySet(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;this.cryptoKeyRing[t%this.cryptoKeyRing.length]=e,n&&this.emit(w.KeyRatcheted,n,this.participantIdentity,t)}setCurrentKeyIndex(t){return e(this,void 0,void 0,function*(){this.currentKeyIndex=t%this.cryptoKeyRing.length,this.resetKeyStatus(t)})}getCurrentKeyIndex(){return this.currentKeyIndex}getKeySet(e){return this.cryptoKeyRing[e??this.currentKeyIndex]}};const U=[],W=new Map;let G,K=new h,q=!1,J,Y=v,X=new Map;l.setDefaultLevel(`info`),onmessage=t=>{K.run(()=>e(void 0,void 0,void 0,function*(){let{kind:e,data:n}=t.data;switch(e){case`init`:l.setLevel(n.loglevel),l.info(`worker initialized`),Y=n.keyProviderOptions,q=!!n.keyProviderOptions.sharedKey,postMessage({kind:`initAck`,data:{enabled:!1}});break;case`enable`:ye(n.enabled,n.participantIdentity),l.info(`updated e2ee enabled status for ${n.participantIdentity} to ${n.enabled}`),postMessage(t.data);break;case`decode`:Z(n.participantIdentity,n.trackId).setupTransform(e,n.readableStream,n.writableStream,n.trackId,n.isReuse,n.codec);break;case`encode`:Z(n.participantIdentity,n.trackId).setupTransform(e,n.readableStream,n.writableStream,n.trackId,n.isReuse,n.codec);break;case`encryptDataRequest`:let{payload:r,iv:i,keyIndex:a}=yield O.encrypt(n.payload,Q(n.participantIdentity));console.log(`encrypted payload`,{original:n.payload,encrypted:r,iv:i}),postMessage({kind:`encryptDataResponse`,data:{payload:r,iv:i,keyIndex:a,uuid:n.uuid}});break;case`decryptDataRequest`:try{let{payload:e}=yield O.decrypt(n.payload,n.iv,Q(n.participantIdentity),n.keyIndex);postMessage({kind:`decryptDataResponse`,data:{payload:e,uuid:n.uuid}})}catch(e){l.error(`DataCryptor decryption failed`,{error:e,participantIdentity:n.participantIdentity,uuid:n.uuid}),postMessage({kind:`error`,data:{error:e instanceof Error?e:Error(String(e)),uuid:n.uuid}})}break;case`setKey`:q?yield be(n.key,n.keyIndex,n.updateCurrentKeyIndex):n.participantIdentity?(l.info(`set participant sender key ${n.participantIdentity} index ${n.keyIndex}`),yield Q(n.participantIdentity).setKey(n.key,n.keyIndex,n.updateCurrentKeyIndex)):l.error(`no participant Id was provided and shared key usage is disabled`);break;case`removeTransform`:ve(n.trackId,n.participantIdentity);break;case`updateCodec`:Z(n.participantIdentity,n.trackId).setVideoCodec(n.codec),l.info(`updated codec`,{participantIdentity:n.participantIdentity,trackId:n.trackId,codec:n.codec});break;case`setRTPMap`:X=n.map,U.forEach(e=>{e.getParticipantIdentity()===n.participantIdentity&&e.setRtpMap(n.map)});break;case`ratchetRequest`:_e(n);break;case`setSifTrailer`:Ce(n.trailer);break}}))};function _e(t){return e(this,void 0,void 0,function*(){if(q){let e=$();yield e.ratchetKey(t.keyIndex),e.resetKeyStatus()}else if(t.participantIdentity){let e=Q(t.participantIdentity);yield e.ratchetKey(t.keyIndex),e.resetKeyStatus()}else l.error(`no participant Id was provided for ratchet request and shared key usage is disabled`)})}function Z(e,t){let n=U.filter(e=>e.getTrackId()===t);if(n.length>1){let r=n.map(e=>({participant:e.getParticipantIdentity()})).join(`,`);l.error(`Found multiple cryptors for the same trackID ${t}. target participant: ${e} `,{participants:r})}let r=n[0];if(r)e!==r.getParticipantIdentity()&&r.setParticipant(e,Q(e));else{if(l.info(`creating new cryptor for`,{participantIdentity:e,trackId:t}),!Y)throw Error(`Missing keyProvider options`);r=new he({participantIdentity:e,keys:Q(e),keyProviderOptions:Y,sifTrailer:J}),r.setRtpMap(X),xe(r),U.push(r)}return r}function Q(e){if(q)return $();let t=W.get(e);return t||(t=new H(e,Y),t.on(w.KeyRatcheted,Se),W.set(e,t)),t}function $(){return G||=(l.debug(`creating new shared key handler`),new H(`shared-key`,Y)),G}function ve(e,t){let n=U.filter(n=>n.getParticipantIdentity()===t&&n.getTrackId()===e);n.length>1&&l.error(`Found multiple cryptors for the same participant and trackID combination`,{trackId:e,participantIdentity:t});let r=n[0];r?r.unsetParticipant():l.warn(`Could not unset participant on cryptor`,{trackId:e,participantIdentity:t})}function ye(e,t){l.debug(`setting encryption enabled for all tracks of ${t}`,{enable:e}),B.set(t,e)}function be(t,n,r){return e(this,void 0,void 0,function*(){l.info(`set shared key`,{index:n}),yield $().setKey(t,n,r)})}function xe(e){e.on(T.Error,e=>{let t={kind:`error`,data:{error:Error(`${S[e.reason]}: ${e.message}`),participantIdentity:e.participantIdentity}};postMessage(t)})}function Se(e,t,n){postMessage({kind:`ratchetKey`,data:{participantIdentity:t,keyIndex:n,ratchetResult:e}})}function Ce(e){J=e,U.forEach(t=>{t.setSifTrailer(e)})}self.RTCTransformEvent&&(self.onrtctransform=t=>{let n=t.transformer,{kind:r,participantIdentity:i,trackId:a,codec:o}=n.options;K.run(()=>e(void 0,void 0,void 0,function*(){let e=Z(i,a);l.debug(`onrtctransform setup`,{participantIdentity:i,trackId:a,codec:o}),e.setupTransform(r,n.readable,n.writable,a,!1,o)}))});\n//# sourceMappingURL=livekit-client.e2ee.worker-CSODH4Hx.js.map',u6=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,l6],{type:`text/javascript;charset=utf-8`});function d6(e){let t;try{if(t=u6&&(self.URL||self.webkitURL).createObjectURL(u6),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(l6),{type:`module`,name:e?.name})}}var f6={audioPreset:rf.music,dtx:!0,red:!1,forceStereo:!1,simulcast:!0,videoSimulcastLayers:[af.h180,af.h360],screenShareEncoding:sf.h1080fps30.encoding,stopMicTrackOnMute:!1,videoCodec:`vp8`,videoEncoding:af.h720.encoding,backupCodec:{codec:`vp8`,encoding:af.h720.encoding}},p6={adaptiveStream:!0,dynacast:!0,videoCaptureDefaults:{resolution:af.h720.resolution},publishDefaults:f6,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new au,disconnectOnPageLeave:!0,webAudioMix:!1},m6=class{constructor(e,t,n,r,i,a,o,s=!0,c=!0){this.client=e,this.roomId=t,this.devices=n,this.processorState$=r,this.controlledAudioDevices=a,this.livekitRoomFactory=o??(()=>new J_(h6({devices:this.devices,processorState:this.processorState$.value,e2eeLivekitOptions:i&&{keyProvider:i,worker:new d6},controlledAudioDevices:this.controlledAudioDevices,echoCancellation:s,noiseSuppression:c})))}createConnection(e,t,n,r,i){return new e6({existingSFUConfig:i,roomId:this.roomId,transport:t,client:this.client,scope:e,livekitRoomFactory:this.livekitRoomFactory,ownMembershipIdentity:n},r)}};function h6({devices:e,processorState:t,e2eeLivekitOptions:n,controlledAudioDevices:r,echoCancellation:i,noiseSuppression:a}){return{...p6,videoCaptureDefaults:{...p6.videoCaptureDefaults,deviceId:e.videoInput.selected$.value?.id,processor:t.processor},audioCaptureDefaults:{...p6.audioCaptureDefaults,deviceId:e.audioInput.selected$.value?.id,echoCancellation:i,noiseSuppression:a},audioOutput:{deviceId:r?void 0:e.audioOutput.selected$.value?.id},e2ee:n}}var g6=class{constructor(){this.store=new Map}add(e,t){let n=this.getKey(e.transport),r=this.store.get(n);r?r.participants.push(...t):this.store.set(n,{connection:e,participants:t})}getKey(e){return e.livekit_service_url}getConnections(){return Array.from(this.store.values()).map(({connection:e})=>e)}getConnectionForTransport(e){return this.store.get(this.getKey(e))?.connection??null}getParticipantsForTransport(e){let t=this.getKey(e),n=this.store.get(t);return n?n.participants:[]}};function _6({scope:e,connectionFactory:t,localTransport$:n,remoteTransports$:r,logger:i,ownMembershipIdentity:a}){let o=i.getChild(`[ConnectionManager]`),s=e.behavior(yF([r,n]).pipe(G(([e,t])=>{let n=[];t&&(n=[t]);let r=v6(e.value).filter(e=>!n.find(t=>BY(t.transport,e)));return o.debug(`remoteWithoutLocal`,r,`localTransportAsArray`,n),new hL([...n,...r],e.epoch)}))),c=e.behavior(s.pipe(OL(`ConnectionManager connections$`,function*(e){for(let t of e)WY(t)?yield{keys:[t.transport.livekit_service_url,t.sfuConfig],data:void 0}:yield{keys:[t.livekit_service_url,void 0],data:void 0}},(e,n,r,i)=>{let s=t.createConnection(e,{type:`livekit`,livekit_service_url:r},a,o,i);return s.start(),s})));return{connectionManagerData$:e.behavior(c.pipe(K(e=>{let t=e.epoch,n=e.value.map(e=>e.remoteParticipants$.pipe(G(t=>({connection:e,participants:t}))));return n.length===0?aF(new hL(new g6,t)):yF(n).pipe(G(e=>new hL(e.reduce((e,{connection:t,participants:n})=>(e.add(t,n),e),new g6),t)))})),new hL(new g6,-1))}}function v6(e){return e.reduce((e,t)=>(e.some(e=>BY(e,t))||e.push(t),e),[])}function y6(e,t){return e.behavior(jF(t,S.DidSendCallNotification),null)}function b6(e){return jF(e,l.Timeline).pipe(HF(([e])=>e.getType()===i.RTCDecline))}function x6({scope:e,memberships$:t,sentCallNotification$:n,receivedDecline$:r,options:i,localUser:a}){let o=t.pipe(sI(),HF(([{value:e},{value:t}])=>t.every(e=>e.userId===a.userId)&&e.some(e=>e.userId!==a.userId)),G(()=>{})),s=t.pipe(gL(e=>e.some(e=>e.userId!==a.userId))),c=e.behavior(n.pipe(HF(e=>e?.notification_type===`ring`),G(e=>e),K(e=>{let t=e?.lifetime??0;return EF(t===0?aF(null):IF(t).pipe(XF(),fI(`ringing`)),aF(`timeout`),zF).pipe(hI(r.pipe(HF(([t])=>t.getRelation()?.rel_type===`m.reference`&&t.getRelation()?.event_id===e.event_id&&t.getSender()!==a.userId&&l.value!==`timeout`))),iI(`decline`))})),null),l=e.behavior(i.waitForCallPickup===!0?yF([s,c],(e,t)=>e.value===!0?`success`:t??`unknown`):zF,null);return{autoLeave$:RF(i.autoLeaveWhenOthersLeft===!0?o.pipe(G(()=>`allOthersLeft`)):zF,l.pipe(HF(e=>e===`timeout`||e===`decline`))),callPickupState$:l}}var S6=new Map;function C6(e){if(S6.has(e))return S6.get(e);let t=E(e);return S6.size>500&&S6.clear(),S6.set(e,t),t}function w6(e,t,n){let{rawDisplayName:r,userId:i}=e;if(!r||r===i)return!1;let a=C6(r);return a?/@.+:.+/.test(r)||/[\u200E\u200F\u202A-\u202F]/.test(r)?!0:t.map(e=>e.userId&&n.get(e.userId)).filter(e=>!!e).filter(e=>e.userId!==i).some(e=>C6(T6(e,!1))===a):!1}function T6(e,t){let{rawDisplayName:n,userId:r}=e;if(!n||n===r)return r;let i=p(n);return t?i+` (`+r+`)`:C6(n)?i:r}var E6=h.getChild(`[MatrixMemberMetadata]`);function D6(e){return e.getMembersWithMembership(c.Join).concat(e.getMembersWithMembership(c.Invite)).reduce((e,t)=>(e.set(t.userId,{userId:t.userId,getMxcAvatarUrl:t.getMxcAvatarUrl.bind(t),rawDisplayName:t.rawDisplayName}),e),new Map)}function O6(e,t){return e.behavior(jF(t,x.Members).pipe(G(()=>D6(t))),D6(t))}var k6=(e,t,n)=>{let r=new Set;return e.behavior(yF([t,n]).pipe(G(([e,t])=>{let n=new Map;for(let i of e){let a=t.get(i.userId);if(!a){E6.error(`Could not find member for user ${i.userId}`);continue}let o=w6(a,e,t),s=r.has(i.userId)||o;s&&r.add(i.userId),n.set(i.userId,T6(a,s))}return n})))},A6=(e,t,n)=>{let r=k6(e,t,n);return{createDisplayNameBehavior$:t=>e.behavior(r.pipe(G(e=>e.get(t)))),createAvatarUrlBehavior$:t=>e.behavior(n.pipe(G(e=>e.get(t)?.getMxcAvatarUrl()))),displaynameMap$:r,avatarMap$:e.behavior(n.pipe(G(e=>Array.from(e.keys()).reduce((t,n)=>(t.set(n,e.get(n)?.getMxcAvatarUrl()),t),new Map))))}};function j6(e,t){return tL(e).pipe(G(()=>e.getTrackPublication(t)),eI(),G(n=>n&&{participant:e,publication:n,source:t}))}var M6=class{constructor(e,t,n,r,i){this.connection=e,this.muteStates=n,this.logger=i,this.shouldPublish=!1,this.scope=new pL;let{controlledAudioDevices:a}=da(),o=e.livekitRoom;o.setE2EEEnabled(o.options.e2ee!==void 0)?.catch(e=>{this.logger.error(`Failed to set E2EE enabled on room`,e)}),this.observeTrackProcessors(this.scope,o,r),this.observeMediaDevices(this.scope,t,a),this.workaroundRestartAudioInputTrackChrome(t,this.scope),this.connection.livekitRoom.localParticipant.on(R.LocalTrackPublished,this.onLocalTrackPublished.bind(this))}async destroy(){this.scope.end(),this.logger.info(`Scope ended -> unset handler`),this.muteStates.audio.unsetHandler(),this.muteStates.video.unsetHandler(),this.logger.info(`Start to stop tracks`);try{await this.stopTracks(),this.logger.info(`Done to stop tracks`)}catch(e){this.logger.error(`Failed to stop tracks: ${e}`)}}onLocalTrackPublished(e){this.logger.info(`Local track published`,e);let t=this.connection.livekitRoom;if(this.shouldPublish||this.pauseUpstreams(t,[e.source]).catch(e=>{this.logger.error(`Failed to pause upstreams`,e)}),e.source===V.Source.Microphone){let e=this.muteStates.audio.enabled$.value;t.localParticipant.setMicrophoneEnabled(e).catch(t=>{this.logger.error(`Failed to enable microphone track, enabled:${e}`,t)})}else if(e.source===V.Source.Camera){let e=this.muteStates.video.enabled$.value;t.localParticipant.setCameraEnabled(e).catch(t=>{this.logger.error(`Failed to enable camera track, enabled:${e}`,t)})}}async createAndSetupTracks(){this.logger.debug(`createAndSetupTracks called`);let e=this.connection.livekitRoom;this.observeMuteStates();let t=this.muteStates.audio.enabled$.value,n=this.muteStates.video.enabled$.value;return t&&n?e.localParticipant.enableCameraAndMicrophone():t?e.localParticipant.setMicrophoneEnabled(!0):n&&e.localParticipant.setCameraEnabled(!0),Promise.resolve()}async pauseUpstreams(e,t){for(let n of t){let t=e.localParticipant.getTrackPublication(n)?.track;t?await t.pauseUpstream():this.logger.warn(`No track found for source ${n} to pause upstream`)}}async resumeUpstreams(e,t){for(let n of t){let t=e.localParticipant.getTrackPublication(n)?.track;t?await t.resumeUpstream():this.logger.warn(`No track found for source ${n} to resume upstream`)}}async startPublishing(){if(this.shouldPublish){this.logger.debug(`Already publishing, ignoring startPublishing call`);return}this.shouldPublish=!0,this.logger.debug(`startPublishing called`);let e=this.connection.livekitRoom;try{await this.resumeUpstreams(e,[V.Source.Microphone,V.Source.Camera])}catch(e){this.logger.error(`Failed to resume upstreams`,e)}}async stopPublishing(){this.logger.debug(`stopPublishing called`),this.shouldPublish=!1,await this.pauseUpstreams(this.connection.livekitRoom,[V.Source.Microphone,V.Source.Camera,V.Source.ScreenShare])}async stopTracks(){let e=this.connection.livekitRoom;for(let t of[V.Source.Microphone,V.Source.Camera,V.Source.ScreenShare]){let n=e.localParticipant.getTrackPublication(t);n?.track&&await e.localParticipant.unpublishTrack(n.track,!0)}}workaroundRestartAudioInputTrackChrome(e,t){let n=this.connection.livekitRoom;e.audioInput.selected$.pipe(K(e=>e?.hardwareDeviceChange$??zF),t.bind()).subscribe(()=>{if(n.state!=K_.Connected)return;let e=Array.from(n.localParticipant.audioTrackPublications.values()).find(e=>e.source===V.Source.Microphone)?.track;e&&e.mediaStreamTrack.readyState!==`ended`&&(this.logger?.info(`Restarting audio device track due to active media device changed (workaroundRestartAudioInputTrackChrome)`),n.localParticipant.getTrackPublication(V.Source.Microphone)?.audioTrack?.restartTrack().catch(e=>{this.logger.error(`Failed to restart audio device track`,e)}))})}observeMediaDevices(e,t,n){let r=this.connection.livekitRoom,i=(t,n)=>n.pipe(e.bind()).subscribe(e=>{r.state==K_.Connected&&(this.logger.info(`[LivekitRoom] syncDevice room.getActiveDevice(kind) !== d.id :`,r.getActiveDevice(t),` !== `,e?.id),e!==void 0&&r.getActiveDevice(t)!==e.id&&r.switchActiveDevice(t,e.id).catch(e=>this.logger.error(`Failed to sync ${t} device with LiveKit`,e)))});i(`audioinput`,t.audioInput.selected$),n||i(`audiooutput`,t.audioOutput.selected$),i(`videoinput`,t.videoInput.selected$)}observeMuteStates(){let e=this.connection.livekitRoom;this.muteStates.audio.setHandler(async t=>{try{this.logger.debug(`handler: Setting LiveKit microphone enabled: ${t}`),await e.localParticipant.setMicrophoneEnabled(t),!this.shouldPublish&&t&&await this.pauseUpstreams(e,[V.Source.Microphone])}catch(e){this.logger.error(`Failed to update LiveKit audio input mute state`,e)}return e.localParticipant.isMicrophoneEnabled}),this.muteStates.video.setHandler(async t=>{try{this.logger.debug(`handler: Setting LiveKit camera enabled: ${t}`),await e.localParticipant.setCameraEnabled(t),!this.shouldPublish&&t&&await this.pauseUpstreams(e,[V.Source.Camera])}catch(e){this.logger.error(`Failed to update LiveKit video input mute state`,e)}return e.localParticipant.isCameraEnabled})}observeTrackProcessors(e,t,n){SY(e,e.behavior(j6(t.localParticipant,V.Source.Camera).pipe(G(e=>{let t=e?.publication.track;return t instanceof Wh?t:null})),null),n)}};function N6(e,t,n){let r=new ot,i=e=>r.next(e),a=e.behavior(yF([n,t],(e,t)=>e||t===`flat`?`spotlight`:`grid`));return{gridMode$:e.behavior(r.pipe(G(e=>e===`grid`?a.pipe(dI(t=>t!==e),fI(e)):e===a.value?a:ML(e)),fI(a),K(e=>e))),setGridMode:i}}function P6(e){let t=e.pipe(eI());return t.pipe(GF(e=>RF(IF(e?1e3:6e4),t.pipe(HF(t=>t!==e)))),fI(!1),eI())}function F6({id:e,userId:t,displayName$:n,mxcAvatarUrl$:r}){return{id:e,userId:t,displayName$:n,mxcAvatarUrl$:r}}function I6(e,t,n){return yF([j6(e,t),LF(1e3).pipe(fI(0))]).pipe(K(async([e])=>{let t=e?.publication?.track;if(!t||!(t instanceof D_||t instanceof wh))return;let r=await t.getRTCStatsReport();if(r){for(let e of r.values())if(e.type===n)return e}}),fI(void 0))}function L6(e,t){return I6(e,t,`inbound-rtp`).pipe(G(e=>e))}function R6(e,t){return I6(e,t,`outbound-rtp`).pipe(G(e=>e))}var z6=function(e){return e[e.Connecting=0]=`Connecting`,e[e.Okay=1]=`Okay`,e[e.KeyMissing=2]=`KeyMissing`,e[e.KeyInvalid=3]=`KeyInvalid`,e[e.PasswordInvalid=4]=`PasswordInvalid`,e}({});function B6(e,{participant$:t,livekitRoom$:n,audioSource:r,videoSource:i,focusUrl$:a,encryptionSystem:o,...s}){let c=n=>e.behavior(t.pipe(K(e=>e?j6(e,n):aF(void 0)))),l=c(r),u=c(i);return{...F6(s),video$:u,focusUrl$:a,unencryptedWarning$:e.behavior(yF([l,u],(e,t)=>o.kind!==fn.NONE&&(e?.publication.isEncrypted===!1||t?.publication.isEncrypted===!1))),encryptionStatus$:e.behavior(t.pipe(K(e=>e?e.isLocal||o.kind===fn.NONE?aF(z6.Okay):o.kind===fn.PER_PARTICIPANT?yF([V6(n,e,o,`MissingKey`),V6(n,e,o,`InvalidKey`),H6(e,r),H6(e,i)]).pipe(G(([e,t,n,r])=>{if(e)return z6.KeyMissing;if(t)return z6.KeyInvalid;if(n||r)return z6.Okay}),HF(e=>!!e),fI(z6.Connecting)):yF([V6(n,e,o,`InvalidKey`),H6(e,r),H6(e,i)]).pipe(G(([e,t,n])=>{if(e)return z6.PasswordInvalid;if(t||n)return z6.Okay}),HF(e=>!!e),fI(z6.Connecting)):aF(z6.Connecting))))}}function V6(e,t,n,r){return e.pipe(K(e=>e===void 0?aF(!1):ZI(e,L.EncryptionError).pipe(G(e=>{let[i]=e;return n.kind===fn.PER_PARTICIPANT?(i?.message.includes(t.identity)&&i?.message.includes(r))??!1:n.kind===fn.SHARED_KEY?!!i?.message.includes(r):!1}))),eI(),yI(1e3),fI(!1))}function H6(e,t){let n={framesDecoded:void 0,framesDropped:void 0,framesReceived:void 0};return L6(e,t).pipe(G(e=>{if(!e)return;let{framesDecoded:t,framesDropped:n,framesReceived:r}=e;return{framesDecoded:t,framesDropped:n,framesReceived:r}}),HF(e=>!!e),G(e=>{let t=n;if(n=e,typeof e.framesReceived==`number`&&typeof t.framesReceived==`number`&&typeof e.framesDecoded==`number`&&typeof t.framesDecoded==`number`){let n=e.framesReceived-t.framesReceived,r=e.framesDecoded-t.framesDecoded;if(n>0)return r>0}}),HF(e=>typeof e==`boolean`),fI(void 0))}function U6(e,t,n){let r=yF([t,n]).pipe(G(([e,t])=>{if(!e||!t||e.width===0||e.height===0||t.width===0||t.height===0)return`cover`;let n=e.width/e.height,r=t.width/t.height;return n>1==r>1?`cover`:`contain`}));return e.behavior(r,`cover`)}function W6(e){return e.pipe(K(e=>e?e.isLocal?R6(e,V.Source.Camera):L6(e,V.Source.Camera):aF(void 0))).pipe(G(e=>{if(e&&!(typeof e.frameWidth!=`number`||typeof e.frameHeight!=`number`))return{width:e.frameWidth,height:e.frameHeight}}))}function G6(e,{rtcBackendIdentity:t,handRaised$:n,reaction$:r,statsType:i,...a}){let{participant$:o}=a,s=e.behavior(o.pipe(K(e=>(e&&tL(e))??aF(void 0)))),c=new ot,l=new Ge(void 0);return{...B6(e,{...a,audioSource:V.Source.Microphone,videoSource:V.Source.Camera}),type:`user`,speaking$:e.behavior(o.pipe(K(e=>e?eL(e,R.IsSpeakingChanged).pipe(G(e=>e.isSpeaking)):aF(!1)))),audioEnabled$:e.behavior(s.pipe(G(e=>e?.microphoneTrack?.isMuted===!1))),videoEnabled$:e.behavior(s.pipe(G(e=>e?.cameraTrack?.isMuted===!1))),videoFit$:U6(e,W6(o),l),toggleCropVideo:()=>c.next(),rtcBackendIdentity:t,handRaised$:n,reaction$:r,audioStreamStats$:yF([o,Nr.value$]).pipe(K(([e,t])=>!e||!t?aF(void 0):I6(e,V.Source.Microphone,i))),videoStreamStats$:yF([o,Nr.value$]).pipe(K(([e,t])=>!e||!t?aF(void 0):I6(e,V.Source.Camera,i))),setTargetDimensions:(e,t)=>{l.next({width:e,height:t})}}}function K6(e,{mediaDevices:t,...n}){let r=G6(e,{...n,statsType:`outbound-rtp`}),i=r.video$.pipe(K(e=>{let t=e?.publication.track;return t instanceof Wh?RF(jF(t,B.Restarted).pipe(fI(null),G(()=>t)),jF(t,B.Muted).pipe(G(()=>null))):aF(null)}));return{...r,local:!0,mirror$:e.behavior(i.pipe(G(e=>e!==null&&tv(e).facingMode===`user`))),alwaysShow$:Hi.value$,setAlwaysShow:Hi.setValue,switchCamera$:e.behavior(tn===`desktop`?aF(null):i.pipe(G(e=>{if(e===null)return null;let n=tv(e).facingMode;return n!==`user`&&n!==`environment`?null:()=>void e.restartTrack({facingMode:n===`user`?`environment`:`user`}).then(()=>{let n=e.mediaStreamTrack.getSettings().deviceId;n!==void 0&&t.videoInput.select(n)}).catch(e=>h.error(`Failed to switch camera`,n,e))})))}}function q6(e,{pretendToBeDisconnected$:t,sink$:n}){let r=new ot,i=new ot,a=new ot,o=e.behavior(RF(r,i,a).pipe(bL({volume:1,committedVolume:1},(e,t)=>{switch(t){case`toggle mute`:return{...e,volume:e.volume===0?e.committedVolume:0};case`commit`:return{...e,committedVolume:e.volume===0?e.committedVolume:e.volume};default:return{...e,volume:t}}}),G(({volume:e})=>e)));return yF([n,t.pipe(K(e=>e?aF(0):o))]).pipe(e.bind()).subscribe(([e,t])=>e(t)),{playbackVolume$:o,playbackMuted$:e.behavior(o.pipe(G(e=>e===0))),togglePlaybackMuted:()=>r.next(`toggle mute`),adjustPlaybackVolume:e=>i.next(e),commitPlaybackVolume:()=>a.next(`commit`)}}function J6(e,{pretendToBeDisconnected$:t,...n}){let r=G6(e,{...n,statsType:`inbound-rtp`});return{...r,...q6(e,{pretendToBeDisconnected$:t,sink$:e.behavior(n.participant$.pipe(G(e=>t=>e?.setVolume(t))))}),local:!1,speaking$:e.behavior(t.pipe(K(e=>e?aF(!1):r.speaking$))),videoEnabled$:e.behavior(t.pipe(K(e=>e?aF(!1):r.videoEnabled$))),waitingForMedia$:e.behavior(yF([n.livekitRoom$,n.participant$],(e,t)=>e!==void 0&&t===null))}}function Y6(e,t){return{...B6(e,{...t,audioSource:V.Source.ScreenShareAudio,videoSource:V.Source.ScreenShare}),type:`screen share`}}function X6(e,t){return{...Y6(e,t),local:!0}}function Z6(e,{pretendToBeDisconnected$:t,...n}){return{...Y6(e,n),...q6(e,{pretendToBeDisconnected$:t,sink$:e.behavior(n.participant$.pipe(G(e=>t=>e?.setVolume(t,V.Source.ScreenShareAudio))))}),local:!1,videoEnabled$:e.behavior(t.pipe(G(e=>!e))),audioEnabled$:e.behavior(n.participant$.pipe(K(e=>e?j6(e,V.Source.ScreenShareAudio):aF(null)),G(Boolean)))}}var Q6=function(e){return e[e.SelfAlwaysShown=0]=`SelfAlwaysShown`,e[e.Presenters=1]=`Presenters`,e[e.Speakers=2]=`Speakers`,e[e.HandRaised=3]=`HandRaised`,e[e.Video=4]=`Video`,e[e.NoVideo=5]=`NoVideo`,e[e.SelfNotAlwaysShown=6]=`SelfNotAlwaysShown`,e}(Q6||{});function $6(e,{participant:t,mediaDevices:n,pretendToBeDisconnected$:r,...i}){let a=t.type===`local`?K6(e,{participant$:t.value$,mediaDevices:n,...i}):J6(e,{participant$:t.value$,pretendToBeDisconnected$:r,...i}),o=t.value$,s=e.behavior(o.pipe(K(e=>e===null?aF([]):eL(e,R.TrackPublished,R.TrackUnpublished,R.LocalTrackPublished,R.LocalTrackUnpublished).pipe(DL(`${i.id} screenShares$`,function*(e){e.isScreenShareEnabled&&(yield{keys:[`screen-share`],data:void 0})},(e,n,a)=>{let o=`${i.id}:${a}`;return t.type===`local`?X6(e,{...i,id:o,participant$:t.value$}):Z6(e,{...i,id:o,participant$:t.value$,pretendToBeDisconnected$:r})}))))),c=e.behavior(P6(a.speaking$)),l=e.behavior(s.pipe(G(e=>e.length>0)));return{...a,screenShares$:s,bin$:e.behavior(yF([c,l,a.videoEnabled$,a.handRaised$,a.local?a.alwaysShow$:aF(null)],(e,t,n,r,i)=>i===null?t?Q6.Presenters:e?Q6.Speakers:r?Q6.HandRaised:n?Q6.Video:Q6.NoVideo:i?Q6.SelfAlwaysShown:Q6.SelfNotAlwaysShown))}}function e8({pickupState$:e,muteStates:t,...n}){return{...F6(n),type:`ringing`,pickupState$:e,videoEnabled$:t.video.enabled$}}var t8=h.getChild(`[CallViewModel]`),n8=3,r8=4e3;function i8(e,t,n,r,i,a,o,s,c){let l=n.client,d=l.getUserId(),f=l.getDeviceId();if(!(d&&f))throw new NY(Error(`userId and deviceId are required`));let p=a8(a.encryptionSystem,t),m=a.matrixRTCMode$??ML(pr.Legacy),h=c6(e,t),g=s6(e,h),_={userId:d,deviceId:f,memberId:u()},v=e.behavior(m.pipe(AL(`CallViewModel localTransport$`,e=>({keys:[e],data:void 0}),(e,r,i)=>a.localTransport??GY({scope:e,memberships$:h,ownMembershipIdentity:_,client:l,delayId$:e.behavior(jF(t,b.DelayIdChanged).pipe(G(([e])=>e??null)),t.delayId??null),roomId:n.roomId,forceJwtEndpoint:i===pr.Matrix_2_0?UY.Matrix_2_0:UY.Legacy,useOldestMember:i===pr.Legacy})))),y=_6({scope:e,connectionFactory:a.connectionFactory??new m6(l,n.roomId,r,c,p,da().controlledAudioDevices,a.livekitRoomFactory,da().echoCancellation,da().noiseSuppression),localTransport$:e.behavior(v.pipe(K(e=>e.active$),KF(e=>(t8.info(`could not pass local transport to createConnectionManager$. localTransport$ threw an error`,e),aF(null))))),remoteTransports$:g.transports$,logger:t8,ownMembershipIdentity:_}),x=zY({scope:e,membershipsWithTransport$:g.membershipsWithTransport$,connectionManager:y}),S=e.behavior(m.pipe(G(e=>({encryptMedia:p!==void 0,matrixRTCMode:e})))),C=i6({scope:e,homeserverConnected:Q3(e,l,t),muteStates:i,joinMatrixRTC:e=>o6(t,_,e,S.value),createPublisherFactory:e=>new M6(e,r,i,c,t8.getChild(`[Publisher `+e.transport.livekit_service_url+`]`)),connectionManager:y,matrixRTCSession:t,localTransport$:v,logger:t8.getChild(`[${Date.now()}]`)}),w=e.behavior(h.pipe(G(e=>e.value.find(e=>e.userId===d&&e.deviceId===f)??null))),T=e.behavior(w.pipe(kL(e=>e!==null),G(e=>e===null?null:{membership$:e,participant:{type:`local`,value$:C.participant$},connection$:C.connection$,userId:d}))),{callPickupState$:E,autoLeave$:ee}=x6({scope:e,memberships$:h,sentCallNotification$:y6(e,t),receivedDecline$:b6(n),options:a,localUser:{userId:d,deviceId:f}}),te=O6(e,n),ne=A6(e,e.behavior(h.pipe(G(e=>e.value))),te),re=e.behavior(y.connectionManagerData$.pipe(G(e=>e.value))),ie=e.behavior(x.pipe(K(e=>yF(e.value.map(e=>yF([e.connection$,e.participant.value$]).pipe(G(([e,t])=>{if(!e||!t||t.isLocal)return null;let n=e.livekitRoom;return{url:e.transport.livekit_service_url,livekitRoom:n,participant:t.identity}}))))),G(e=>e.reduce((e,t)=>{if(!t)return e;let n=e.find(e=>e.url===t.url);return n?n.participants.push(t.participant):e.push({livekitRoom:t.livekitRoom,participants:[t.participant],url:t.url}),e},[]))),[]),ae=e.behavior(o.pipe(EL(C.reconnecting$))),D=e.behavior(s.pipe(G(e=>Object.fromEntries(Object.entries(e).map(([e,{reactionOption:t}])=>[e,t]))),EL(C.reconnecting$))),O=e.behavior(yF([T,x,Kt.value$]).pipe(DL(`CallViewModel userMedia$`,function*([e,t,n]){let r=e=>`${e.userId}:${e.membership$.value.deviceId}`,i=e?r(e):void 0,a=e?[e]:[],o=t.value.filter(e=>r(e)!==i),s=[...a,...o];for(let e of s){let{userId:t,participant:i,connection$:a,membership$:o}=e,s=o.value.rtcBackendIdentity,c=r(e);for(let e=0;e<1+n;e++)yield{keys:[e,c,t,i,a,s],data:void 0}}},(e,t,n,i,o,s,c,l)=>$6(e,{id:`${i}:${n}`,userId:o,rtcBackendIdentity:l,participant:s,encryptionSystem:a.encryptionSystem,livekitRoom$:e.behavior(c.pipe(G(e=>e?.livekitRoom))),focusUrl$:e.behavior(c.pipe(G(e=>e?.transport.livekit_service_url))),mediaDevices:r,pretendToBeDisconnected$:C.reconnecting$,displayName$:e.behavior(ne.createDisplayNameBehavior$(o).pipe(G(e=>e??o))),mxcAvatarUrl$:ne.createAvatarUrlBehavior$(o),handRaised$:e.behavior(ae.pipe(G(e=>e[i]?.time??null))),reaction$:e.behavior(D.pipe(G(e=>e[i]??void 0)))})))),oe=e.behavior(yF([O,te,E]).pipe(DL(`CallViewModel ringingMedia$`,function*([e,t,n]){if(n===`ringing`||n===`timeout`||n===`decline`)for(let r of t.values())e.some(e=>e.userId===r.userId)||(yield{keys:[r.userId],data:n})},(e,t,n)=>e8({id:`ringing:${n}`,userId:n,displayName$:e.behavior(te.pipe(G(e=>e.get(n)?.rawDisplayName||n))),mxcAvatarUrl$:ne.createAvatarUrlBehavior$(n),pickupState$:t,muteStates:i})),eI(J3),_I(e=>{e.length>1&&t8.warn(`Ringing more than one participant is not supported (ringing ${e.map(e=>e.userId).join(`, `)})`)}))),se=e.behavior(O.pipe(K(e=>e.length===0?aF([]):yF(e.map(e=>e.screenShares$),(...e)=>e.flat(1))))),ce=O.pipe(sI(),HF(([e,t])=>t.length<=8&&t.length>e.length),G(()=>{}),yI(500)),le=e.behavior(x.pipe(G(e=>e.value.length))),ue=yF([E,O]).pipe(dI(([e])=>e!==null&&e!==`success`),G(([,e])=>e),sI(),HF(([e,t])=>t.length<=8&&t.length<e.length),G(()=>{}),yI(500)),de=new ot,fe=RF(ee,RF(de,At===null?zF:jF(At.lazyActions,ht.HangupCall).pipe(_I(e=>{At.api.transport.reply(e.detail,{})}))).pipe(G(()=>`user`))).pipe(e.share),pe=e.behavior(O.pipe(K(e=>e.length===0?aF([]):yF(e.map(e=>e.speaking$.pipe(G(t=>[e,t]))))),cI((e,t)=>{let[n,r]=!e?.local&&t.find(([t])=>t===e)||[];return r?n:t.find(([e,t])=>!e.local&&t)?.[0]??n??t.find(([e])=>!e.local)?.[0]??t.find(([e])=>e.local)?.[0]},void 0))),me=e.behavior(O.pipe(K(e=>{let t=e.map(e=>e.bin$.pipe(G(t=>[e,t])));return t.length===0?aF([]):yF(t,(...e)=>e.sort(([,e],[,t])=>e-t).map(([e])=>e))}),eI(J3))),he=e.behavior(O.pipe(K(e=>{let t=e.find(e=>e.type===`user`&&e.local);return t?t.alwaysShow$.pipe(G(e=>e?t:void 0)):aF(void 0)}))),ge=e.behavior(oe.pipe(K(e=>e.length>0?aF({spotlight:e,pip$:he}):se.pipe(K(e=>e.length>0?aF({spotlight:e,pip$:pe}):pe.pipe(G(e=>({spotlight:e?[e]:[],pip$:he.pipe(G(t=>t===e?void 0:t))})))))))),_e=e.behavior(ge.pipe(G(({spotlight:e})=>e),eI(J3))),ve=e.behavior(_e.pipe(G(e=>e.some(e=>e.type===`screen share`&&!e.local)))),ye=e.behavior(oL,!1),be=a.windowSize$??e.behavior(jF(window,`resize`).pipe(fI(null),G(()=>({width:window.innerWidth,height:window.innerHeight})))),xe=e.behavior(be.pipe(G(({width:e,height:t})=>t<=400&&e<=340?`pip`:t<=600?`flat`:e<=600?`narrow`:`normal`))),Se=e.behavior(ye.pipe(K(e=>e?aF(`pip`):xe))),Ce=new ot,we=xL(e,!1,Ce),{setGridMode:Te,gridMode$:Ee}=N6(e,Se,ve),De=yF([me,_e],(e,t)=>({type:`grid`,spotlight:t.some(e=>e.type===`screen share`)?t:void 0,grid:e})),Oe=yF([me,_e],(e,t)=>({type:`spotlight-landscape`,spotlight:t,grid:e})),ke=yF([me,_e],(e,t)=>({type:`spotlight-portrait`,spotlight:t,grid:e})),Ae=ge.pipe(K(({spotlight:e,pip$:t})=>t.pipe(G(t=>({type:`spotlight-expanded`,spotlight:e,pip:t??void 0}))))),je=yF([O,se]).pipe(K(([e,t])=>{if(e.length<=2&&t.length===0){let t=e.find(e=>e.type===`user`&&e.local);if(t!==void 0){let n=e.find(e=>e.type===`user`&&!e.local);if(n!==void 0)return aF({type:`one-on-one`,spotlight:n,pip:t});if(e.length===1)return oe.pipe(G(e=>e.length===1?{type:`one-on-one`,spotlight:t,pip:e[0]}:null))}}return aF(null)})),Me=_e.pipe(G(e=>({type:`pip`,spotlight:e}))),Ne=e.behavior(Se.pipe(K(e=>{switch(e){case`normal`:return Ee.pipe(K(e=>{switch(e){case`grid`:return je.pipe(K(e=>e===null?De:aF(e)));case`spotlight`:return we.pipe(K(e=>e?Ae:Oe))}}));case`narrow`:return je.pipe(K(e=>e===null?yF([me,_e],(e,t)=>e.length>n8||t.some(e=>e.type===`screen share`)?ke:De).pipe(pI()):Ae));case`flat`:return Ee.pipe(K(e=>{switch(e){case`grid`:return Oe;case`spotlight`:return Ae}}));case`pip`:return Me}}))),Pe=new ot,Fe=e=>Pe.next(e),Ie=e.behavior(yF([Ne,Pe.pipe(fI(0),eI())]).pipe(cI(({tiles:e},[t,n])=>{let r,i;switch(t.type){case`grid`:case`spotlight-landscape`:case`spotlight-portrait`:[r,i]=W3(t,n,Fe,e);break;case`spotlight-expanded`:[r,i]=G3(t,e);break;case`one-on-one`:[r,i]=K3(t,e);break;case`pip`:[r,i]=q3(t,e);break}return{layout:r,tiles:i}},{layout:null,tiles:H3.empty()}))),Le=e.behavior(Ie.pipe(G(({layout:e})=>e))),Re=e.behavior(Ie.pipe(G(({tiles:e})=>e.generation))),ze=e.behavior(Le.pipe(G(e=>e.type!==`grid`))),Be=e.behavior(Le.pipe(K(e=>{switch(e.type){case`spotlight-landscape`:case`spotlight-portrait`:return e.spotlight.media$.pipe(G(e=>e.some(e=>e.type===`screen share`)));case`spotlight-expanded`:case`one-on-one`:return aF(!1);default:return aF(!0)}}))),Ve=e.behavior(Se.pipe(K(e=>e===`normal`?Le.pipe(G(e=>e.type===`spotlight-landscape`||e.type===`spotlight-expanded`)):aF(!1)),eI(),G(e=>e?()=>Ce.next():null))),He=new ot,Ue=new ot,Ge=new ot,Ke=new ot,qe=e.behavior(Se.pipe(G(e=>e!==`pip`&&e!==`flat`))),Je=da(),Ye=!(Je.header===Bt.None&&Je.showControls===!1),Xe=e.behavior(Se.pipe(K(e=>{switch(e){case`pip`:return aF(tn===`desktop`);case`normal`:case`narrow`:return aF(!0);case`flat`:return We()?aF(!0):RF(He.pipe(G(()=>`tap screen`)),Ue.pipe(G(()=>`tap controls`)),Ge.pipe(G(()=>`hover`))).pipe(mI((e,t)=>{switch(t){case`tap screen`:return e?aF(!1):IF(r8).pipe(G(()=>!1),fI(!0));case`tap controls`:return IF(r8).pipe(G(()=>!1),fI(!0));case`hover`:return UF(IF(r8),Ke.pipe(YF(1))).pipe(G(()=>!1),fI(!0))}},!1),fI(!1))}}))),Ze=e.behavior(Xe.pipe(G(e=>e&&Ye))),Qe=e.behavior(yF([r.audioOutput.available$,r.audioOutput.selected$],(e,t)=>t!==void 0&&e.get(t.id)?.type===`earpiece`)),$e=e.behavior(yF([r.audioOutput.available$,r.audioOutput.selected$],(e,t)=>{let n=(t&&e.get(t.id)?.type)===`speaker`?`earpiece`:`speaker`,i=[...e].find(([,e])=>e.type===n);if(i===void 0)return null;let[a]=i;return{targetOutput:n,switch:()=>r.audioOutput.select(a)}})),et=e.behavior(Or.value$.pipe(K(e=>e?D:aF({})),cI((e,t)=>{let n=[];for(let[r,i]of Object.entries(t)){let t=e.find(e=>e.sender===r&&e.emoji)?.startX??Math.ceil(Math.random()*80)+10;n.push({sender:r,emoji:i.emoji,startX:t})}return n},[]))),tt=xt.value$.pipe(K(e=>e?D:aF({})),G(e=>Object.values(e).map(e=>e.name)),cI((e,t)=>({playing:t.filter(t=>e.playing.includes(t)||e.newSounds.includes(t)),newSounds:t.filter(t=>!e.playing.includes(t)&&!e.newSounds.includes(t))}),{playing:[],newSounds:[]}),G(e=>e.newSounds)),nt=ae.pipe(G(e=>Object.keys(e).length),cI((e,t)=>({value:t,playSounds:t>e.value}),{value:0,playSounds:!1}),HF(e=>e.playSounds)),rt=se.pipe(G(e=>e.length),cI((e,t)=>({value:t,playSounds:t>e.value}),{value:0,playSounds:!1}),HF(e=>e.playSounds)),it=C.sharingScreen$,at=a.toggleScreensharing??C.toggleScreenSharing,st=e.behavior(C.localMemberState$.pipe(G(e=>{let t={};return e instanceof OY?{transportError:e}:e===t6.Waiting?null:(e.matrix instanceof OY&&(t.matrixError=e.matrix),e.media instanceof OY?t.publishError=e.media:typeof e.media==`object`&&e.media.connection instanceof OY&&(t.connectionError=e.media.connection),t)})),null);return{autoLeave$:ee,ringing$:e.behavior(E.pipe(G(e=>e===`ringing`))),leave$:fe,hangup:()=>de.next(),join:C.requestJoinAndPublish,leave:C.requestDisconnect,toggleScreenSharing:at,sharingScreen$:it,tapScreen:()=>He.next(),tapControls:()=>Ue.next(),hoverScreen:()=>Ge.next(),unhoverScreen:()=>Ke.next(),fatalError$:e.behavior(st.pipe(G(e=>(t8.debug(`errors$ to compute any fatal errors:`,e),e?.transportError??e?.matrixError??e?.connectionError??null)),HF(e=>e!==null)),null),allConnections$:re,participantCount$:le,handsRaised$:ae,reactions$:D,joinSoundEffect$:ce,leaveSoundEffect$:ue,newHandRaised$:nt,newScreenShare$:rt,audibleReactions$:tt,visibleReactions$:et,windowMode$:Se,spotlightExpanded$:we,toggleSpotlightExpanded$:Ve,gridMode$:Ee,setGridMode:Te,layout$:Le,localMatrixLivekitMember$:T,matrixLivekitMembers$:e.behavior(x.pipe(G(e=>e.value),_I(e=>{let t=e.map(e=>e.membership$.value.userId+`|`+e.membership$.value.deviceId).join(`,`);t8.debug(`matrixLivekitMembers$ updated (exported) [${t}]`)}))),tileStoreGeneration$:Re,showSpotlightIndicators$:ze,showSpeakingIndicators$:Be,showHeader$:qe,showFooter$:Ze,earpieceMode$:Qe,audioOutputSwitcher$:$e,reconnecting$:C.reconnecting$,livekitRoomItems$:ie,connected$:C.connected$}}function a8(e,t){if(e.kind!==fn.NONE){if(e.kind===fn.PER_PARTICIPANT){let e=new X3;return e.setRTCSession(t),e}else if(e.kind===fn.SHARED_KEY&&e.secret){let t=new nm;return t.setKey(e.secret).catch(e=>t8.error(`Failed to set shared key for E2EE`,e)),t}}}function o8(e,t,n){return Math.max(t,Math.min(e,n))}var s8={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function c8(e,t,n){return t===0||Math.abs(t)===1/0?e**(n*5):e*t*n/(t+n*e)}function l8(e,t,n,r=.15){return r===0?o8(e,t,n):e<t?-c8(t-e,n-t,r)+t:e>n?+c8(e-n,n-t,r)+n:e}function u8(e,[t,n],[r,i]){let[[a,o],[s,c]]=e;return[l8(t,a,o,r),l8(n,s,c,i)]}function d8(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function f8(e){var t=d8(e,`string`);return typeof t==`symbol`?t:String(t)}function p8(e,t,n){return t=f8(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function h8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?m8(Object(n),!0).forEach(function(t){p8(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m8(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var g8={pointer:{start:`down`,change:`move`,end:`up`},mouse:{start:`down`,change:`move`,end:`up`},touch:{start:`start`,change:`move`,end:`end`},gesture:{start:`start`,change:`change`,end:`end`}};function _8(e){return e?e[0].toUpperCase()+e.slice(1):``}var v8=[`enter`,`leave`];function y8(e=!1,t){return e&&!v8.includes(t)}function b8(e,t=``,n=!1){let r=g8[e],i=r&&r[t]||t;return`on`+_8(e)+_8(i)+(y8(n,i)?`Capture`:``)}var x8=[`gotpointercapture`,`lostpointercapture`];function S8(e){let t=e.substring(2).toLowerCase(),n=!!~t.indexOf(`passive`);n&&(t=t.replace(`passive`,``));let r=x8.includes(t)?`capturecapture`:`capture`,i=!!~t.indexOf(r);return i&&(t=t.replace(`capture`,``)),{device:t,capture:i,passive:n}}function C8(e,t=``){let n=g8[e];return e+(n&&n[t]||t)}function w8(e){return`touches`in e}function T8(e){return w8(e)?`touch`:`pointerType`in e?e.pointerType:`mouse`}function E8(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)==null||(r=n.contains)==null?void 0:r.call(n,t.target))})}function D8(e){return e.type===`touchend`||e.type===`touchcancel`?e.changedTouches:e.targetTouches}function O8(e){return w8(e)?D8(e)[0]:e}function k8(e){return E8(e).map(e=>e.identifier)}function A8(e){let t=O8(e);return w8(e)?t.identifier:t.pointerId}function j8(e){let t=O8(e);return[t.clientX,t.clientY]}function M8(e){let{scrollX:t,scrollY:n,scrollLeft:r,scrollTop:i}=e.currentTarget;return[t??r??0,n??i??0]}function N8(e){let t={};if(`buttons`in e&&(t.buttons=e.buttons),`shiftKey`in e){let{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:a})}return t}function P8(e,...t){return typeof e==`function`?e(...t):e}function F8(){}function I8(...e){return e.length===0?F8:e.length===1?e[0]:function(){let t;for(let n of e)t=n.apply(this,arguments)||t;return t}}function L8(e,t){return Object.assign({},t,e||{})}var R8=32,z8=class{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?P8(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:n,shared:r}=this;t.args=this.args;let i=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,N8(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);s8.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[a,o]=t._movement,[s,c]=n.threshold,{_step:l,values:u}=t;if(n.hasCustomTransform?(l[0]===!1&&(l[0]=Math.abs(a)>=s&&u[0]),l[1]===!1&&(l[1]=Math.abs(o)>=c&&u[1])):(l[0]===!1&&(l[0]=Math.abs(a)>=s&&Math.sign(a)*s),l[1]===!1&&(l[1]=Math.abs(o)>=c&&Math.sign(o)*c)),t.intentional=l[0]!==!1||l[1]!==!1,!t.intentional)return;let d=[0,0];if(n.hasCustomTransform){let[e,t]=u;d[0]=l[0]===!1?0:e-l[0],d[1]=l[1]===!1?0:t-l[1]}else d[0]=l[0]===!1?0:a-l[0],d[1]=l[1]===!1?0:o-l[1];this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);let f=t.offset,p=t._active&&!t._blocked||t.active;p&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&(`bounds`in n&&(t._bounds=P8(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));let[m,h]=t.offset,[[g,_],[v,y]]=t._bounds;t.overflow=[m<g?-1:+(m>_),h<v?-1:+(h>y)],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;let b=t._active&&n.rubberband||[0,0];if(t.offset=u8(t._bounds,t.offset,b),t.delta=s8.sub(t.offset,f),this.computeMovement(),p&&(!t.last||i>R8)){t.delta=s8.sub(t.offset,f);let e=t.delta.map(Math.abs);s8.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){let e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;let r=this.handler(h8(h8(h8({},t),e),{},{[this.aliasKey]:e.values}));r!==void 0&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}};function B8([e,t],n){let r=Math.abs(e),i=Math.abs(t);if(r>i&&r>n)return`x`;if(i>r&&i>n)return`y`}var V8=class extends z8{constructor(...e){super(...e),p8(this,`aliasKey`,`xy`)}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=s8.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=s8.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,n=this.config;if(!t.axis&&e){let r=typeof n.axisThreshold==`object`?n.axisThreshold[T8(e)]:n.axisThreshold;t.axis=B8(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case`x`:e[1]=0;break;case`y`:e[0]=0;break}}},H8=e=>e,U8=.15,W8={enabled(e=!0){return e},eventOptions(e,t,n){return h8(h8({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[U8,U8];case!1:return[0,0];default:return s8.toVector(e)}},from(e){if(typeof e==`function`)return e;if(e!=null)return s8.toVector(e)},transform(e,t,n){let r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||H8},threshold(e){return s8.toVector(e,0)}},G8=0,K8=h8(h8({},W8),{},{axis(e,t,{axis:n}){if(this.lockDirection=n===`lock`,!this.lockDirection)return n},axisThreshold(e=G8){return e},bounds(e={}){if(typeof e==`function`)return t=>K8.bounds(e(t));if(`current`in e)return()=>e.current;if(typeof HTMLElement==`function`&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=e;return[[t,n],[r,i]]}}),q8={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},J8=class extends V8{constructor(...e){super(...e),p8(this,`ingKey`,`dragging`)}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=K8.bounds(r)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,n=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;let r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(r&&r.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=A8(e),n._pointerActive=!0,this.computeValues(j8(e)),this.computeInitial(),t.preventScrollAxis&&T8(e)!==`mouse`?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,n=this.config;if(!t._pointerActive)return;let r=A8(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;let i=j8(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=s8.sub(i,t._values),this.computeValues(i)),s8.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove(`dragDelay`),t.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===n.preventScrollAxis||n.preventScrollAxis===`xy`){t._active=!1,this.clean();return}else{this.timeoutStore.remove(`startPointerDrag`),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}let t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;let r=A8(e);if(t._pointerId!==void 0&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[i,a]=t._distance;if(t.tap=i<=n.tapsThreshold&&a<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{let[e,r]=t._delta,[i,a]=t._movement,[o,s]=n.swipe.velocity,[c,l]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTime<u){let n=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);n>o&&Math.abs(i)>c&&(t.swipe[0]=Math.sign(e)),u>s&&Math.abs(a)>l&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,`change`,this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,`end`,this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,`cancel`,this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,Y8(e);let t=this.eventStore.add(this.sharedConfig.window,`touch`,`change`,this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,`touch`,`end`,t),this.eventStore.add(this.sharedConfig.window,`touch`,`cancel`,t),this.timeoutStore.add(`startPointerDrag`,this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add(`dragDelay`,()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=q8[e.key];if(t){let n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,s8.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in q8&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,`start`,this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,`change`,this.pointerMove.bind(this)),e(t,`end`,this.pointerUp.bind(this)),e(t,`cancel`,this.pointerUp.bind(this)),e(`lostPointerCapture`,``,this.pointerUp.bind(this))),this.config.keys&&(e(`key`,`down`,this.keyDown.bind(this)),e(`key`,`up`,this.keyUp.bind(this))),this.config.filterTaps&&e(`click`,``,this.pointerClick.bind(this),{capture:!0,passive:!1})}};function Y8(e){`persist`in e&&typeof e.persist==`function`&&e.persist()}var X8=typeof window<`u`&&window.document&&window.document.createElement;function Z8(){return X8&&`ontouchstart`in window}function Q8(){return Z8()||X8&&window.navigator.maxTouchPoints>1}function $8(){return X8&&`onpointerdown`in window}function e5(){return X8&&`exitPointerLock`in window.document}function t5(){try{return`constructor`in GestureEvent}catch{return!1}}var n5={isBrowser:X8,gesture:t5(),touch:Z8(),touchscreen:Q8(),pointer:$8(),pointerLock:e5()},r5=250,i5=180,a5=.5,o5=50,s5=250,c5=10,l5={mouse:0,touch:0,pen:8},u5=h8(h8({},K8),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&n5.pointerLock,n5.touch&&n?`touch`:this.pointerLock?`mouse`:n5.pointer&&!i?`pointer`:n5.touch?`touch`:`mouse`},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n==`number`?n:n||n===void 0&&e?r5:void 0,!(!n5.touchscreen||n===!1))return e||(n===void 0?void 0:`y`)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&this.device===`pointer`&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:i=void 0}){let a=s8.toVector(e,n?r:+!!i);return this.filterTaps=n,this.tapsThreshold=r,a},swipe({velocity:e=a5,distance:t=o5,duration:n=s5}={}){return{velocity:this.transform(s8.toVector(e)),distance:this.transform(s8.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return i5;case!1:return 0;default:return e}},axisThreshold(e){return e?h8(h8({},l5),e):l5},keyboardDisplacement(e=c5){return e}});h8(h8({},W8),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!n5.touch&&n5.gesture)return`gesture`;if(n5.touch&&r)return`touch`;if(n5.touchscreen){if(n5.pointer)return`pointer`;if(n5.touch)return`touch`}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){let i=e=>{let t=L8(P8(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},a=e=>{let t=L8(P8(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return typeof n!=`function`&&typeof r!=`function`?[i(),a()]:e=>[i(e),a(e)]},threshold(e,t,n){return this.lockDirection=n.axis===`lock`,s8.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?`ctrlKey`:e},pinchOnWheel(e=!0){return e}}),h8(h8({},K8),{},{mouseOnly:(e=!0)=>e});var d5=class extends V8{constructor(...e){super(...e),p8(this,`ingKey`,`scrolling`)}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add(`scrollEnd`,this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();let t=this.state,n=M8(e);t._delta=s8.sub(n,t._values),s8.addTo(t._movement,t._delta),this.computeValues(n),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e(`scroll`,``,this.scroll.bind(this))}},f5=K8;h8(h8({},K8),{},{mouseOnly:(e=!0)=>e});var p5=new Map,m5=new Map;function h5(e){p5.set(e.key,e.engine),m5.set(e.key,e.resolver)}var g5={key:`drag`,engine:J8,resolver:u5},_5={key:`scroll`,engine:d5,resolver:f5};function v5(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function y5(e,t){if(e==null)return{};var n=v5(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var b5={target(e){if(e)return()=>`current`in e?e.current:e},enabled(e=!0){return e},window(e=n5.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},x5=[`target`,`eventOptions`,`window`,`enabled`,`transform`];function S5(e={},t){let n={};for(let[r,i]of Object.entries(t))switch(typeof i){case`function`:n[r]=i.call(n,e[r],r,e);break;case`object`:n[r]=S5(e[r],i);break;case`boolean`:i&&(n[r]=e[r]);break}return n}function C5(e,t,n={}){let r=e,{target:i,eventOptions:a,window:o,enabled:s,transform:c}=r,l=y5(r,x5);if(n.shared=S5({target:i,eventOptions:a,window:o,enabled:s,transform:c},b5),t){let e=m5.get(t);n[t]=S5(h8({shared:n.shared},l),e)}else for(let e in l){let t=m5.get(e);t&&(n[e]=S5(h8({shared:n.shared},l[e]),t))}return n}var w5=class{constructor(e,t){p8(this,`_listeners`,new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,i){let a=this._listeners,o=C8(t,n),s=h8(h8({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(o,r,s);let c=()=>{e.removeEventListener(o,r,s),a.delete(c)};return a.add(c),c}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}},T5=class{constructor(){p8(this,`_timeouts`,new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}},E5=class{constructor(e){p8(this,`gestures`,new Set),p8(this,`_targetEventStore`,new w5(this)),p8(this,`gestureEventStores`,{}),p8(this,`gestureTimeoutStores`,{}),p8(this,`handlers`,{}),p8(this,`config`,{}),p8(this,`pointerIds`,new Set),p8(this,`touchIds`,new Set),p8(this,`state`,{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),O5(this,e)}setEventIds(e){if(w8(e))return this.touchIds=new Set(k8(e)),this.touchIds;if(`pointerId`in e)return e.type===`pointerup`||e.type===`pointercancel`?this.pointerIds.delete(e.pointerId):e.type===`pointerdown`&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=C5(e,t,this.config)}clean(){this._targetEventStore.clean();for(let e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t=this.config.shared,n={},r;if(!(t.target&&(r=t.target(),!r))){if(t.enabled){for(let t of this.gestures){let i=this.config[t],a=k5(n,i.eventOptions,!!r);i.enabled&&new(p5.get(t))(this,e,t).bind(a)}let i=k5(n,t.eventOptions,!!r);for(let t in this.nativeHandlers)i(t,``,n=>this.nativeHandlers[t](h8(h8({},this.state.shared),{},{event:n,args:e})),void 0,!0)}for(let e in n)n[e]=I8(...n[e]);if(!r)return n;for(let e in n){let{device:t,capture:i,passive:a}=S8(e);this._targetEventStore.add(r,t,``,n[e],{capture:i,passive:a})}}}};function D5(e,t){e.gestures.add(t),e.gestureEventStores[t]=new w5(e,t),e.gestureTimeoutStores[t]=new T5}function O5(e,t){t.drag&&D5(e,`drag`),t.wheel&&D5(e,`wheel`),t.scroll&&D5(e,`scroll`),t.move&&D5(e,`move`),t.pinch&&D5(e,`pinch`),t.hover&&D5(e,`hover`)}var k5=(e,t,n)=>(r,i,a,o={},s=!1)=>{let c=o.capture??t.capture,l=o.passive??t.passive,u=s?r:b8(r,i,c);n&&l&&(u+=`Passive`),e[u]=e[u]||[],e[u].push(a)};function A5(e,t={},n,r){let i=M.useMemo(()=>new E5(e),[]);if(i.applyHandlers(e,r),i.applyConfig(t,n),M.useEffect(i.effect.bind(i)),M.useEffect(()=>i.clean.bind(i),[]),t.target===void 0)return i.bind.bind(i)}function j5(e,t){return h5(g5),A5({drag:e},t||{},`drag`)}function M5(e,t){return h5(_5),A5({scroll:e},t||{},`scroll`)}var N5={grid:`_grid_19qx5_8`,slot:`_slot_19qx5_12`},P5={tile:`_tile_1jqw7_8`,draggable:`_draggable_1jqw7_8`},F5=(0,M.memo)(({id:e,onDrag:t,targetWidth:n,targetHeight:r,model:i,Tile:a,opacity:o,scale:s,zIndex:c,x:l,y:u,width:d,height:f})=>{let p=(0,M.useRef)(null);return j5(n=>t?.current(e,n),{target:p,filterTaps:!0}),(0,W.jsx)(a,{ref:p,className:(0,U.default)(P5.tile,{[P5.draggable]:t}),style:{opacity:o,scale:s,zIndex:c,x:l,y:u,width:d,height:f},targetWidth:n,targetHeight:r,model:i})});F5.displayName=`TileWrapper`;var I5=F5,L5=()=>Lr(`(prefers-reduced-motion)`);function R5(e,t){if(!(e.offsetParent instanceof HTMLElement)||e.offsetParent===t)return{x:e.offsetLeft,y:e.offsetTop};{let n=R5(e.offsetParent,t);return n.x+=e.offsetLeft,n.y+=e.offsetTop,n}}var z5=(0,M.createContext)(null);function B5(){let e=(0,M.use)(z5);if(e===null)throw Error(`useUpdateLayout called outside a Grid layout context`);return e}function V5(){let{setGeneration:e}=B5();(0,M.useEffect)(()=>e(e=>e===null?0:e+1))}function H5(e){let{setVisibleTilesCallback:t}=B5();(0,M.useEffect)(()=>t(()=>e),[e,t]),(0,M.useEffect)(()=>()=>t(null),[t])}function U5({model:e,Layout:t,Tile:n,className:r,style:i}){let[a,o]=L$(),[s,c]=(0,M.useState)(null),l=T3(a,c),u=(0,M.useSyncExternalStore)((0,M.useCallback)(e=>(window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)),[]),(0,M.useCallback)(()=>window.innerHeight,[])),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(null),[g,_]=(0,M.useState)(null),v=J$(()=>new Map),y=L5(),b=(0,M.useMemo)(()=>function({id:e,model:t,onDrag:n,style:r,className:i,...a}){let o=(0,M.useRef)(null);return(0,M.useEffect)(()=>(v.set(e,{id:e,model:t,onDrag:n}),()=>void v.delete(e)),[e,t,n]),(0,W.jsx)(`div`,{ref:o,className:(0,U.default)(i,N5.slot),"data-id":e,style:r,...a})},[v]),x=(0,M.useMemo)(()=>(0,M.memo)(function({ref:e,Layout:t,...n}){return(0,W.jsx)(t,{...n,ref:e})}),[]),S=(0,M.useMemo)(()=>({setGeneration:m,setVisibleTilesCallback:_}),[_]),C=(0,M.useMemo)(()=>{let e=[];if(s!==null&&d!==null){let t=d.getElementsByClassName(N5.slot);for(let n of t){let t=n.getAttribute(`data-id`);n.offsetWidth>0&&n.offsetHeight>0&&e.push({...v.get(t),...R5(n,s),width:n.offsetWidth,height:n.offsetHeight})}}return e},[s,d,v,o,p]),w=(0,M.useMemo)(()=>Math.min(o.bottom,u)-o.top,[o,u]);(0,M.useEffect)(()=>{g?.(C.filter(e=>e.y+e.height<=w).length)},[C,g,w]);let T=(0,M.useRef)(null),[E,ee]=K4(C,()=>({key:({id:e})=>e,from:({x:e,y:t,width:n,height:r})=>({opacity:0,scale:0,zIndex:1,x:e,y:t,width:n,height:r,immediate:y}),enter:{opacity:1,scale:1,immediate:y},update:({id:e,x:t,y:n,width:r,height:i})=>e===T.current?.tileId?null:{x:t,y:n,width:r,height:i,immediate:y},leave:{opacity:0,scale:0,immediate:y},config:{mass:.7,tension:252,friction:25}}));(0,M.useEffect)(()=>{ee.start().forEach(e=>void e.catch(h.error))},[C,ee]);let te=(e,t)=>{let{tileId:n,tileX:r,tileY:i}=T.current,a=C.find(e=>e.id===n);ee.current.find(e=>e.item.id===n)?.start(e?{scale:1,zIndex:1,x:a.x,y:a.y,width:a.width,height:a.height,immediate:y||(e=>e===`zIndex`),delay:e=>e===`zIndex`?500:0}:{scale:1.1,zIndex:2,x:r,y:i,immediate:y||(e=>e===`zIndex`||e===`x`||e===`y`)}).catch(h.error),e&&t({x:r,y:i,xRatio:r/(o.width-a.width),yRatio:i/(o.height-a.height)})},ne=(e,{tap:t,initial:[n,r],delta:[i,a],last:s})=>{if(!t){let t=ee.current.find(t=>t.item.id===e),c=v.get(t.item.id).onDrag;if(c!=null){if(T.current===null){let i=t.get();T.current={tileId:e,tileX:i.x,tileY:i.y,cursorX:n-o.x,cursorY:r-o.y+ie.current}}T.current.tileX+=i,T.current.tileY+=a,T.current.cursorX+=i,T.current.cursorY+=a,te(s,c),s&&(T.current=null)}}},re=(0,M.useRef)(ne);re.current=ne;let ie=(0,M.useRef)(0);return M5(({xy:[,e],delta:[,t]})=>{ie.current=e,T.current!==null&&(T.current.tileY+=t,T.current.cursorY+=t,te(!1,v.get(T.current.tileId).onDrag))},{target:s??void 0}),(0,W.jsxs)(`div`,{ref:l,className:(0,U.default)(r,N5.grid),style:i,children:[(0,W.jsx)(z5,{value:S,children:(0,W.jsx)(x,{ref:f,Layout:t,model:e,Slot:b})}),E((e,{id:t,model:r,onDrag:i,width:a,height:o})=>(0,W.jsx)(I5,{id:t,onDrag:i?re:null,targetWidth:a,targetHeight:o,model:r,Tile:n,...e},t))]})}var W5=(0,M.forwardRef)((e,t)=>(0,W.jsxs)(`svg`,{width:24,height:24,fill:`currentColor`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:[(0,W.jsx)(`path`,{d:`M4 14C4.55228 14 5 14.4477 5 15V19H9C9.55228 19 10 19.4477 10 20C10 20.5523 9.55228 21 9 21H3V15C3 14.4477 3.44772 14 4 14Z`}),(0,W.jsx)(`path`,{d:`M20 14C20.5523 14 21 14.4477 21 15V21H15C14.4477 21 14 20.5523 14 20C14 19.4477 14.4477 19 15 19H19V15C19 14.4477 19.4477 14 20 14Z`}),(0,W.jsx)(`path`,{d:`M9 3C9.55228 3 10 3.44772 10 4C10 4.55228 9.55228 5 9 5H5V9C5 9.55228 4.55228 10 4 10C3.44772 10 3 9.55228 3 9V3H9Z`}),(0,W.jsx)(`path`,{d:`M21 9C21 9.55228 20.5523 10 20 10C19.4477 10 19 9.55228 19 9V5H15C14.4477 5 14 4.55228 14 4C14 3.44772 14.4477 3 15 3H21V9Z`})]})),G5=(0,M.forwardRef)((e,t)=>(0,W.jsxs)(`svg`,{width:24,height:24,fill:`currentColor`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,ref:t,...e,children:[(0,W.jsx)(`path`,{d:`M10 20C10 20.5523 9.55228 21 9 21C8.44772 21 8 20.5523 8 20V16H4C3.44772 16 3 15.5523 3 15C3 14.4477 3.44772 14 4 14H10V20Z`}),(0,W.jsx)(`path`,{d:`M20 14C20.5523 14 21 14.4477 21 15C21 15.5523 20.5523 16 20 16H16V20C16 20.5523 15.5523 21 15 21C14.4477 21 14 20.5523 14 20V14H20Z`}),(0,W.jsx)(`path`,{d:`M9 3C9.55228 3 10 3.44772 10 4V10H4C3.44772 10 3 9.55228 3 9C3 8.44772 3.44772 8 4 8H8V4C8 3.44772 8.44772 3 9 3Z`}),(0,W.jsx)(`path`,{d:`M15 3C15.5523 3 16 3.44772 16 4V8H20C20.5523 8 21 8.44772 21 9C21 9.55228 20.5523 10 20 10H14V4C14 3.44772 14.4477 3 15 3Z`})]})),K5={contents:`_contents_4idar_8`,tile:`_tile_4idar_25`,maximised:`_maximised_4idar_25`,item:`_item_4idar_29`,snap:`_snap_4idar_36`,advance:`_advance_4idar_40`,back:`_back_4idar_76`,next:`_next_4idar_80`,expand:`_expand_4idar_84`,bottomRightButtons:`_bottomRightButtons_4idar_101`,volumeSlider:`_volumeSlider_4idar_110`,volumeMenuItem:`_volumeMenuItem_4idar_116`,menuMuteButton:`_menuMuteButton_4idar_125`,indicators:`_indicators_4idar_169`,show:`_show_4idar_181`},q5=(e,t)=>{let n=(0,M.useRef)(void 0);n.current===void 0&&(n.current=e());let r=(0,M.useRef)(void 0),[,i]=(0,M.useState)(0);return(r.current===void 0||t.length!==r.current.length||t.some((e,t)=>!Object.is(e,r.current[t])))&&(n.current=e(n.current)),r.current=t,[n.current,(0,M.useCallback)(e=>{typeof e==`function`?n.current=e(n.current):n.current=e,i(e=>e+1)},[i])]},J5=({vm:e,...t})=>(0,W.jsx)(C3,{mirror:k(e.mirror$),...t});J5.displayName=`SpotlightLocalUserMediaItem`;var Y5=({vm:e,...t})=>(0,W.jsx)(C3,{waitingForMedia:k(e.waitingForMedia$),mirror:!1,...t}),X5=({vm:e,targetWidth:t,targetHeight:n,...r})=>{let i=k(e.videoFit$),a=k(e.videoEnabled$);(0,M.useEffect)(()=>{t>0&&n>0&&e.setTargetDimensions(t,n)},[t,n,e]);let o={videoFit:i,videoEnabled:a,targetWidth:t,targetHeight:n,...r};return e.local?(0,W.jsx)(J5,{vm:e,...o}):(0,W.jsx)(Y5,{vm:e,...o})};X5.displayName=`SpotlightUserMediaItem`;var Z5=({vm:e,...t})=>(0,W.jsx)(C3,{videoFit:`contain`,mirror:!1,...t}),Q5=({vm:e,...t})=>(0,W.jsx)(Z5,{vm:e,videoEnabled:k(e.videoEnabled$),...t}),$5=({vm:e,...t})=>{let n=k(e.video$),r=k(e.unencryptedWarning$),i=k(e.focusUrl$),a={video:n??void 0,unencryptedWarning:r,focusUrl:i,...t};return e.type===`user`?(0,W.jsx)(X5,{vm:e,...a}):e.local?(0,W.jsx)(Z5,{vm:e,videoEnabled:!0,...a}):(0,W.jsx)(Q5,{vm:e,...a})},e7=({vm:e,...t})=>{let{t:n}=Ni(),r=k(e.pickupState$),i=k(e.videoEnabled$);return(0,W.jsx)(C3,{video:void 0,unencryptedWarning:!1,status:r===`ringing`?{text:n(`video_tile.calling`),Icon:i?Sn:iP}:{text:n(`video_tile.call_ended`),Icon:ir},videoEnabled:!1,videoFit:`cover`,mirror:!1,...t})},t7=({ref:e,vm:t,targetWidth:n,targetHeight:r,focusable:i,intersectionObserver$:a,snap:o,"aria-hidden":s})=>{let c=(0,M.useRef)(null),l=T3(c,e),u=k(t.displayName$),d=k(t.mxcAvatarUrl$);(0,M.useEffect)(()=>{let e=c.current,t=null,n=a.subscribe(n=>{t?.unobserve(e),n.observe(e),t=n});return()=>{n.unsubscribe(),t?.unobserve(e)}},[a]);let f={ref:l,"data-id":t.id,className:(0,U.default)(K5.item,{[K5.snap]:o}),targetWidth:n,targetHeight:r,userId:t.userId,displayName:u,mxcAvatarUrl:d,focusable:i,"aria-hidden":s};return t.type===`ringing`?(0,W.jsx)(e7,{vm:t,...f}):(0,W.jsx)($5,{vm:t,...f})};t7.displayName=`SpotlightItem`;var n7=({vm:e})=>{let{t}=Ni(),n=k(e.audioEnabled$),r=k(e.playbackMuted$),i=k(e.playbackVolume$),a=r?cP:uP,o=r?et:_i,[s,c]=(0,M.useState)(!1),l=(0,M.useCallback)(()=>e.togglePlaybackMuted(),[e]),u=(0,M.useCallback)(t=>e.adjustPlaybackVolume(t),[e]),d=(0,M.useCallback)(()=>e.commitPlaybackVolume(),[e]);return n&&(0,W.jsx)(hA,{open:s,onOpenChange:c,title:t(`video_tile.screen_share_volume`),side:`top`,align:`end`,trigger:(0,W.jsx)(`button`,{className:K5.expand,"aria-label":t(`video_tile.screen_share_volume`),children:(0,W.jsx)(o,{"aria-hidden":!0,width:20,height:20})}),children:(0,W.jsxs)(yA,{as:`div`,className:K5.volumeMenuItem,onSelect:null,label:null,hideChevron:!0,children:[(0,W.jsx)(`button`,{className:K5.menuMuteButton,onClick:l,children:(0,W.jsx)(a,{"aria-hidden":!0,width:24,height:24})}),(0,W.jsx)(WR,{className:K5.volumeSlider,label:t(`video_tile.volume`),value:i,min:0,max:1,step:.01,onValueChange:u,onValueCommit:d})]})})},r7=({ref:e,vm:t,expanded:n,onToggleExpanded:r,targetWidth:i,targetHeight:a,showIndicators:o,focusable:s=!0,className:c,style:l})=>{let{t:u}=Ni(),[d,f]=ZL(null),p=T3(d,e),m=k(t.maximised$),h=k(t.media$),[g,_]=(0,M.useState)(h[0]?.id),v=w3(h),y=w3(g),b=h.findIndex(e=>e.id===g),x=h.at(b),S=b>0,C=b!==-1&&b<h.length-1,w=(0,M.useCallback)(()=>!!(document.body&&document.fullscreenElement),[]),T=w()?G5:W5,E=(0,M.useCallback)(()=>{let e=document.body;e&&(w()?document?.exitFullscreen():e.requestFullscreen())},[w]),ee=J$(()=>f.pipe(G(e=>new IntersectionObserver(e=>{let t=e.find(e=>e.isIntersecting);t!==void 0&&_(t.target.getAttribute(`data-id`))},{root:e,threshold:.5})))),[te,ne]=q5(e=>e==null||e===g||h.every(t=>t.id!==e)?null:e,[g]),re=(0,M.useCallback)(()=>{let e=v.current,t=e.findIndex(e=>e.id===y.current);t>0&&ne(e[t-1].id)},[y,v,ne]),ie=(0,M.useCallback)(()=>{let e=v.current,t=e.findIndex(e=>e.id===y.current);t!==-1&&t!==e.length-1&&ne(e[t+1].id)},[y,v,ne]),ae=n?MN:RN;return(0,W.jsxs)(h3.div,{ref:p,className:(0,U.default)(c,K5.tile,{[K5.maximised]:m}),style:l,children:[S&&(0,W.jsx)(`button`,{className:(0,U.default)(K5.advance,K5.back),"aria-label":u(`common.back`),onClick:re,tabIndex:s?void 0:-1,children:(0,W.jsx)(nM,{"aria-hidden":!0,width:24,height:24})}),(0,W.jsx)(`div`,{className:K5.contents,children:h.map(e=>(0,W.jsx)(t7,{vm:e,targetWidth:i,targetHeight:a,focusable:s,intersectionObserver$:ee,snap:te===null||te===e.id,"aria-hidden":(te??g)!==e.id},e.id))}),(0,W.jsxs)(`div`,{className:K5.bottomRightButtons,children:[x?.type===`screen share`&&!x.local&&(0,W.jsx)(n7,{vm:x}),tn===`desktop`&&(0,W.jsx)(`button`,{className:(0,U.default)(K5.expand),"aria-label":`maximise`,onClick:E,tabIndex:s?void 0:-1,children:(0,W.jsx)(T,{"aria-hidden":!0,width:20,height:20})}),r&&(0,W.jsx)(`button`,{className:(0,U.default)(K5.expand),"aria-label":u(n?`video_tile.collapse`:`video_tile.expand`),onClick:r,tabIndex:s?void 0:-1,children:(0,W.jsx)(ae,{"aria-hidden":!0,width:20,height:20})})]}),C&&(0,W.jsx)(`button`,{className:(0,U.default)(K5.advance,K5.next),"aria-label":u(`common.next`),onClick:ie,tabIndex:s?void 0:-1,children:(0,W.jsx)(vA,{"aria-hidden":!0,width:24,height:24})}),!n&&(0,W.jsx)(`div`,{className:(0,U.default)(K5.indicators,{[K5.show]:o&&h.length>1}),children:h.map(e=>(0,W.jsx)(`div`,{className:K5.item,"data-visible":e.id===g},e.id))})]})};r7.displayName=`SpotlightTile`;var i7={fixed:`_fixed_r39jt_8`,scrolling:`_scrolling_r39jt_9`,slot:`_slot_r39jt_21`},a7={inline:`end`,block:`end`},o7={inline:`end`,block:`start`},s7=17/9,c7=4/3;function l7(e,t,n){let r=e<800?16:20,i=e*t,a=(Math.sqrt(i)/8+125)**2,o=Math.min(n,i/a),s=Math.min(o,Math.round(Math.sqrt(e/t/c7*o))),c=o/s;o===n&&(c=Math.ceil(c),s=Math.ceil(n/c));let l=(e-(s+1)*r)/s,u=(t-(c-1)*r)/c,d=l/u;return d>s7?l=u*s7:d<c7&&(u=l/c7),{tileWidth:l,tileHeight:u,gap:r,columns:s}}var u7=({minBounds$:e,spotlightAlignment$:t})=>({scrollingOnTop:!1,fixed:function({ref:e,model:n,Slot:r}){V5();let i=XL(J$(()=>t.pipe(eI((e,t)=>e.block===t.block&&e.inline===t.inline)))),a=(0,M.useCallback)(({xRatio:e,yRatio:n})=>t.next({block:n<.5?`start`:`end`,inline:e<.5?`start`:`end`}),[]);return(0,W.jsx)(`div`,{ref:e,className:i7.fixed,children:n.spotlight&&(0,W.jsx)(r,{className:i7.slot,id:`spotlight`,model:n.spotlight,onDrag:a,"data-block-alignment":i.block,"data-inline-alignment":i.inline})})},scrolling:function({ref:t,model:n,Slot:r}){V5(),H5(n.setVisibleTiles);let{width:i,height:a}=XL(e),{gap:o,tileWidth:s,tileHeight:c}=(0,M.useMemo)(()=>l7(i,a,n.grid.length),[i,a,n.grid.length]);return(0,W.jsx)(`div`,{ref:t,className:i7.scrolling,style:{width:i,"--gap":`${o}px`,"--width":`${Math.floor(s)}px`,"--height":`${Math.floor(c)}px`},children:n.grid.map(e=>(0,W.jsx)(r,{className:i7.slot,id:e.id,model:e},e.id))})}}),d7={layer:`_layer_14vqf_8`,container:`_container_14vqf_14`,local:`_local_14vqf_18`,spotlight:`_spotlight_14vqf_25`,slot:`_slot_14vqf_31`},f7=({minBounds$:e,pipAlignment$:t})=>({scrollingOnTop:!1,fixed:function({ref:e}){return V5(),(0,W.jsx)(`div`,{ref:e})},scrolling:function({ref:n,model:r,Slot:i}){V5();let{width:a,height:o}=XL(e),s=k(t),{tileWidth:c,tileHeight:l}=(0,M.useMemo)(()=>l7(a,o,1),[a,o]),u=(0,M.useCallback)(({xRatio:e,yRatio:n})=>t.next({block:n<.5?`start`:`end`,inline:e<.5?`start`:`end`}),[]);return(0,W.jsx)(`div`,{ref:n,className:d7.layer,children:(0,W.jsx)(i,{id:r.spotlight.id,model:r.spotlight,className:d7.container,style:{width:c,height:l},children:(0,W.jsx)(i,{className:(0,U.default)(d7.slot,d7.local),id:r.pip.id,model:r.pip,onDrag:u,"data-block-alignment":s.block,"data-inline-alignment":s.inline})})})}}),p7={layer:`_layer_1swii_8`,spotlight:`_spotlight_1swii_12`,pip:`_pip_1swii_17`},m7=({pipAlignment$:e})=>({scrollingOnTop:!0,fixed:function({ref:e,model:t,Slot:n}){return V5(),(0,W.jsx)(`div`,{ref:e,className:p7.layer,children:(0,W.jsx)(n,{className:p7.spotlight,id:`spotlight`,model:t.spotlight})})},scrolling:function({ref:t,model:n,Slot:r}){V5();let i=k(e),a=(0,M.useCallback)(({xRatio:t,yRatio:n})=>e.next({block:n<.5?`start`:`end`,inline:t<.5?`start`:`end`}),[]);return(0,W.jsx)(`div`,{ref:t,className:p7.layer,children:n.pip&&(0,W.jsx)(r,{className:p7.pip,id:n.pip.id,model:n.pip,onDrag:a,"data-block-alignment":i.block,"data-inline-alignment":i.inline})})}}),h7={layer:`_layer_jsvx2_8`,spotlight:`_spotlight_jsvx2_19`,slot:`_slot_jsvx2_28`,grid:`_grid_jsvx2_34`},g7=({minBounds$:e})=>({scrollingOnTop:!1,fixed:function({ref:t,model:n,Slot:r}){return V5(),XL(e),(0,W.jsxs)(`div`,{ref:t,className:h7.layer,children:[(0,W.jsx)(`div`,{className:h7.spotlight,children:(0,W.jsx)(r,{className:h7.slot,id:`spotlight`,model:n.spotlight})}),(0,W.jsx)(`div`,{className:h7.grid})]})},scrolling:function({ref:t,model:n,Slot:r}){V5(),H5(n.setVisibleTiles),XL(e);let i=XL(n.spotlight.media$).length>1;return(0,W.jsxs)(`div`,{ref:t,className:h7.layer,children:[(0,W.jsx)(`div`,{className:(0,U.default)(h7.spotlight,{[h7.withIndicators]:i})}),(0,W.jsx)(`div`,{className:h7.grid,children:n.grid.map(e=>(0,W.jsx)(r,{className:h7.slot,id:e.id,model:e},e.id))})]})}}),_7={layer:`_layer_1q32d_8`,spotlight:`_spotlight_1q32d_17`,withIndicators:`_withIndicators_1q32d_26`,slot:`_slot_1q32d_30`,grid:`_grid_1q32d_35`},v7=({minBounds$:e})=>({scrollingOnTop:!1,fixed:function({ref:e,model:t,Slot:n}){return V5(),(0,W.jsx)(`div`,{ref:e,className:_7.layer,children:(0,W.jsx)(`div`,{className:_7.spotlight,children:(0,W.jsx)(n,{className:_7.slot,id:`spotlight`,model:t.spotlight})})})},scrolling:function({ref:t,model:n,Slot:r}){V5(),H5(n.setVisibleTiles);let{width:i}=XL(e),{gap:a,tileWidth:o,tileHeight:s}=l7(i,i,n.grid.length),c=k(n.spotlight.media$).length>1;return(0,W.jsxs)(`div`,{ref:t,className:_7.layer,style:{"--grid-gap":`${a}px`,"--grid-tile-width":`${Math.floor(o)}px`,"--grid-tile-height":`${Math.floor(s)}px`},children:[(0,W.jsx)(`div`,{className:(0,U.default)(_7.spotlight,{[_7.withIndicators]:c})}),(0,W.jsx)(`div`,{className:_7.grid,children:n.grid.map(e=>(0,W.jsx)(r,{className:_7.slot,id:e.id,model:e},e.id))})]})}});async function y7(e,t,n,r,i=0,a){let o=e.createGain();o.gain.setValueAtTime(n,0);let s=e.createStereoPanner();s.pan.setValueAtTime(r,0);let c=e.createBufferSource();c.buffer=t,a?.signal.addEventListener(`abort`,()=>{c.disconnect()});let l=new Promise(e=>c.addEventListener(`ended`,()=>e()));return c.connect(o).connect(s).connect(e.destination),dL(),c.start(e.currentTime+i),l}function b7(e,t,n,r,i){if(i===0)throw Error(`Looping sounds must have a delay`);let a,o,s;return(async()=>{s=new AbortController,a=Promise.resolve();do o=y7(e,t,n,r,i,s),await a,a=o;while(!s.signal.aborted)})(),async()=>{s?.abort(),await a,await o}}function x7(e){let[t]=Et(dt),[n,r]=(0,M.useState)(),[i,a]=(0,M.useState)();(0,M.useEffect)(()=>{let t=e.sounds;if(!t)return;let n=new AudioContext({latencyHint:e.latencyHint});return(async()=>{let e={};for(let[r,i]of Object.entries(await t))e[r]=await n.decodeAudioData(i.slice(0));a(e)})().catch(e=>{h.debug(`Failed to setup audio context`,e)}),r(n),()=>{n.close().catch(e=>{h.debug(`Failed to close audio engine`,e)}),r(void 0)}},[e.sounds,e.latencyHint]);let o=XL($L().audioOutput.selected$)?.id,{controlledAudioDevices:s}=sn();(0,M.useEffect)(()=>{n&&`setSinkId`in n&&!s&&n.setSinkId(o).catch(e=>{h.warn(`Unable to change sink for audio context`,e)})},[n,o,s]);let{pan:c,volume:l}=eR();return!n||!i||e.muted?null:{playSound:async e=>{if(!i[e]){h.debug(`Tried to play a sound that wasn't buffered (${e})`);return}return y7(n,i[e],t*l,c)},playSoundLooping:(e,r)=>{if(!i[e])throw Error(`Tried to play a sound that wasn't buffered (${e})`);return b7(n,i[e],t*l,c,r)},soundDuration:Object.fromEntries(Object.entries(i).map(([e,t])=>[e,t.duration]))}}function S7(){return document.createElement(`audio`).canPlayType(`audio/ogg`)===`maybe`?`ogg`:`mp3`}var C7=S7();async function w7(e){let t={};return await Promise.all(Object.entries(e).map(async([e,n])=>{let{mp3:r,ogg:i}=n,a=await fetch(C7===`ogg`?i:r??i);if(at(a)){h.warn(`Could not load sound ${e}, response was not okay`);return}t[e]=await a.arrayBuffer()})),t}var T7=Object.fromEntries([...ut.filter(e=>e.sound!==void 0).map(e=>[e.name,e.sound]),[Ye.name,Ye.sound]]);function E7({vm:e,muted:t}){let[n]=Et(xt),[r,i]=(0,M.useState)(null),a=w3(x7({sounds:r,latencyHint:`interactive`,muted:t}));return(0,M.useEffect)(()=>{!n||r||i(w7(T7))},[r,n]),(0,M.useEffect)(()=>{let t=e.audibleReactions$.subscribe(e=>{for(let t of e)T7[t]?a.current?.playSound(t):a.current?.playSound(`generic`)});return()=>{t.unsubscribe()}},[e,a]),null}var D7={container:`_container_1ux8r_1`,reaction:`_reaction_1ux8r_12`,"reaction-up":`_reaction-up_1ux8r_1`,"reaction-up-reduced":`_reaction-up-reduced_1ux8r_1`};function O7({vm:e}){let t=k(e.visibleReactions$);return(0,W.jsx)(`div`,{className:D7.container,children:t.map(({sender:e,emoji:t,startX:n})=>(0,W.jsx)(`span`,{role:`presentation`,style:{left:`${n}vw`},className:D7.reaction,children:t},e))})}var k7=``+new URL(`join_call-dEJCP2wD.mp3`,import.meta.url).href,A7=``+new URL(`join_call-DlMV9nHk.ogg`,import.meta.url).href,j7=``+new URL(`left_call-BbqmRgnC.mp3`,import.meta.url).href,M7=``+new URL(`left_call-C7NMl6WI.ogg`,import.meta.url).href,N7=``+new URL(`raise_hand-CUbxEnt9.ogg`,import.meta.url).href,P7=``+new URL(`raise_hand-Bzqn65WB.mp3`,import.meta.url).href,F7=``+new URL(`screen_share_started-IZDL-kAw.ogg`,import.meta.url).href,I7=``+new URL(`screen_share_started-DH3qxml5.mp3`,import.meta.url).href,L7=``+new URL(`call_declined-1jWRbd4p.mp3`,import.meta.url).href,R7=``+new URL(`call_declined-C6gHsCGH.ogg`,import.meta.url).href,z7=``+new URL(`call_timeout-BCxXxRD8.mp3`,import.meta.url).href,B7=``+new URL(`call_timeout-DPKAj6sz.ogg`,import.meta.url).href,V7=w7({join:{mp3:k7,ogg:A7},left:{mp3:j7,ogg:M7},raiseHand:{mp3:P7,ogg:N7},screenshareStarted:{mp3:I7,ogg:F7},decline:{mp3:L7,ogg:R7},timeout:{mp3:z7,ogg:B7}});function H7({vm:e,muted:t}){let n=w3(x7({sounds:V7,latencyHint:`interactive`,muted:t}));return(0,M.useEffect)(()=>{let t=e.joinSoundEffect$.subscribe(()=>void n.current?.playSound(`join`)),r=e.leaveSoundEffect$.subscribe(()=>void n.current?.playSound(`left`)),i=e.newHandRaised$.subscribe(()=>void n.current?.playSound(`raiseHand`)),a=e.newScreenShare$.subscribe(()=>void n.current?.playSound(`screenshareStarted`));return()=>{t.unsubscribe(),r.unsubscribe(),i.unsubscribe(),a.unsubscribe()}},[n,e]),(0,W.jsx)(W.Fragment,{})}var U7=3e3,W7=class{constructor(e,t){this.scope=e,this.rtcSession=t,this.raisedHandsSubject$=new Ge({}),this.reactionsSubject$=new Ge({}),this.raisedHands$=this.raisedHandsSubject$.asObservable(),this.reactions$=this.reactionsSubject$.asObservable(),this.onMembershipsChanged=e=>{for(let t of Object.keys(this.raisedHandsSubject$.value).filter(t=>e.find(e=>e.userId==t)))this.removeRaisedHand(t);for(let e of this.rtcSession.memberships){if(!e.userId||!e.eventId)continue;let t=`${e.userId}:${e.deviceId}`;this.raisedHandsSubject$.value[t]&&this.raisedHandsSubject$.value[t].membershipEventId!==e.eventId&&this.removeRaisedHand(t);let n=this.getLastReactionEvent(e.eventId,e.userId);if(n){let t=n?.getId();if(!t)continue;this.addRaisedHand(`${e.userId}:${e.deviceId}`,{membershipEventId:e.eventId,reactionEventId:t,time:new Date(n.localTimestamp)})}}},this.handleReactionEvent=e=>{let t=this.rtcSession.room;if(e.getRoomId()!==t.roomId||e.isSending())return;let n=e.getSender(),r=e.getId();if(!(!n||!r)&&(t.client.decryptEventIfNeeded(e).catch(t=>h.warn(`Failed to decrypt ${e.getId()}`,t)),!(e.isBeingDecrypted()||e.isDecryptionFailure()))){if(e.getType()===`io.element.call.reaction`){let t=e.getContent(),i=t?.[`m.relates_to`]?.event_id,a=this.rtcSession.memberships.find(e=>e.eventId===i&&e.userId===n);if(!a){h.warn(`Reaction target was not a membership event for ${n}, ignoring`);return}let o=`${a.userId}:${a.deviceId}`;if(!t.emoji){h.warn(`Reaction had no emoji from ${r}`);return}let s=new Intl.Segmenter(void 0,{granularity:`grapheme`}).segment(t.emoji)[Symbol.iterator]().next().value?.segment;if(!s?.trim()){h.warn(`Reaction had no emoji from ${r} after splitting`);return}let c={...Ye,emoji:s,...ut.find(e=>e.name===t.name)},l=this.reactionsSubject$.value;if(l[o]){h.warn(`Got reaction from ${o} but one is still playing`);return}this.reactionsSubject$.next({...l,[o]:{reactionOption:c,expireAfter:new Date(Date.now()+U7)}})}else if(e.getType()===i.Reaction){let t=e.getContent(),i=t[`m.relates_to`].event_id,a=this.rtcSession.memberships.find(e=>e.eventId===i&&e.userId===n);if(!a){h.warn(`Reaction target was not a membership event for ${n}, ignoring`);return}t?.[`m.relates_to`].key===`🖐️`&&this.addRaisedHand(`${a.userId}:${a.deviceId}`,{reactionEventId:r,membershipEventId:i,time:new Date(e.localTimestamp)})}else if(e.getType()===i.RoomRedaction){let t=e.event.redacts,n=Object.entries(this.raisedHandsSubject$.value).find(([e,n])=>n.reactionEventId===t)?.[0];if(!n)return;this.removeRaisedHand(n)}}},this.reactionsSubject$.pipe($F(U7),this.scope.bind()).subscribe(e=>{let t=new Date,n=Object.fromEntries(Object.entries(e).filter(([e,n])=>n.expireAfter>t));Object.keys(e).length!==Object.keys(n).length&&this.reactionsSubject$.next(n)}),this.rtcSession.room.on(l.Timeline,this.handleReactionEvent),this.scope.onEnd(()=>this.rtcSession.room.off(l.Timeline,this.handleReactionEvent)),this.rtcSession.room.on(l.Redaction,this.handleReactionEvent),this.scope.onEnd(()=>this.rtcSession.room.off(l.Redaction,this.handleReactionEvent)),this.rtcSession.room.client.on(C.Decrypted,this.handleReactionEvent),this.scope.onEnd(()=>this.rtcSession.room.client.off(C.Decrypted,this.handleReactionEvent)),this.rtcSession.room.on(l.LocalEchoUpdated,this.handleReactionEvent),this.scope.onEnd(()=>this.rtcSession.room.off(l.LocalEchoUpdated,this.handleReactionEvent)),this.rtcSession.on(S.MembershipsChanged,this.onMembershipsChanged),this.scope.onEnd(()=>this.rtcSession.off(S.MembershipsChanged,this.onMembershipsChanged)),this.onMembershipsChanged([])}getLastReactionEvent(e,t){return(this.rtcSession.room.relations.getChildEventsForEvent(e,f.Annotation,i.Reaction)?.getRelations()??[]).find(e=>e.event.sender===t&&e.getType()===i.Reaction&&e.getContent()?.[`m.relates_to`]?.key===`🖐️`)}addRaisedHand(e,t){this.raisedHandsSubject$.next({...this.raisedHandsSubject$.value,[e]:t})}removeRaisedHand(e){this.raisedHandsSubject$.next(Object.fromEntries(Object.entries(this.raisedHandsSubject$.value).filter(([t])=>t!==e)))}},G7=h.getChild(`[MatrixAudioRenderer]`);function K7({url:e,livekitRoom:t,validIdentities:n,muted:r}){let i=g$([V.Source.Microphone,V.Source.ScreenShareAudio,V.Source.Unknown],{updateOnlyOn:[],onlySubscribed:!0,room:t}).filter(e=>e.publication.kind===V.Kind.Audio).filter(t=>n.includes(t.participant.identity)?!0:(G7.warn(`Audio track ${t.participant.identity} from ${e} has no matching matrix call member`,`current members: ${n.join()}`,`track will not get rendered`),!1)),{pan:a,volume:o}=eR(),s=a!==0,[c,l]=(0,M.useState)(void 0);(0,M.useEffect)(()=>{let e=new AudioContext;return l(e),()=>{e.close()}},[]);let u=(0,M.useMemo)(()=>({gain:c?.createGain(),pan:c?.createStereoPanner()}),[c]);return(0,M.useEffect)(()=>{u.pan&&(u.pan.pan.value=a)},[u.pan,a]),(0,M.useEffect)(()=>{u.gain&&(u.gain.gain.value=o)},[u.gain,o]),(0,W.jsx)(`div`,{style:{display:`none`},children:i.map(e=>(0,W.jsx)(q7,{trackRef:e,muted:r,audioContext:s?c:void 0,audioNodes:u},qI(e)))})}function q7({trackRef:e,muted:t,audioContext:n,audioNodes:r,...i}){let[a,o]=q5(()=>!1,[n&&r]);return(0,M.useEffect)(()=>{if(!e||a)return;let t=e.publication.track,i=n&&r.gain&&r.pan;t.setAudioContext(i?n:void 0),t.setWebAudioPlugins(i?[r.gain,r.pan]:[]),o(!0),dL()},[n,r,o,a,e]),a&&(0,W.jsx)(M$,{trackRef:e,muted:t,...i})}var J7=mL.behavior(yF([lL.pipe(fI(!0)),xe.value$],(e,t)=>!e||t)),Y7={overlay:`_overlay_kh5c3_1`,icon:`_icon_kh5c3_32`,spacer:`_spacer_kh5c3_47`},X7=({show:e,onBackToVideoPressed:t})=>{let{t:n}=Ni();return(0,W.jsxs)(`div`,{className:Y7.overlay,"data-show":e,"aria-hidden":!e,children:[(0,W.jsx)(di,{className:Y7.icon,children:(0,W.jsx)(oP,{"aria-hidden":!0})}),(0,W.jsx)(qr,{as:`h2`,weight:`semibold`,size:`md`,children:n(`handset.overlay_title`)}),(0,W.jsx)(ei,{children:n(`handset.overlay_description`)}),(0,W.jsx)(Pi,{kind:`primary`,size:`sm`,onClick:()=>{t?.()},children:n(`handset.overlay_back_button`)}),(0,W.jsx)(`div`,{className:Y7.spacer})]})},Z7={bar:`_bar_32sbm_1`},Q7=(0,M.createContext)(null),$7=({children:e})=>{let{t}=Ni(),n=(0,M.useCallback)(e=>{e.preventDefault(),window.controls.onBackButtonPressed?.()},[]),[r,i]=(0,M.useState)(``),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(null),l=(0,M.useMemo)(()=>({setTitle:i,setSecondaryButton:c,setHidden:o}),[i,o,c]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{style:{display:a?`none`:`block`},className:Z7.bar,children:(0,W.jsxs)(Zi,{disconnectedBanner:!1,children:[(0,W.jsx)(Ae,{children:(0,W.jsx)($t,{label:t(`common.back`),children:(0,W.jsx)(He,{size:`24px`,onClick:n,children:(0,W.jsx)(MN,{"aria-hidden":!0})})})}),r&&(0,W.jsx)(qr,{type:`body`,size:`lg`,weight:tn===`android`?`medium`:`semibold`,children:r}),(0,W.jsx)(Te,{children:s})]})}),(0,W.jsx)(Q7,{value:l,children:e})]})};function e9(e){let t=(0,M.use)(Q7)?.setTitle;(0,M.useEffect)(()=>{if(t!==void 0)return t(e),()=>t(``)},[e,t])}function t9(e){let t=(0,M.use)(Q7)?.setHidden;(0,M.useEffect)(()=>{if(t!==void 0)return t(e),()=>t(!1);tn!==`desktop`&&h.warn(`[AppBar] useAppBarHidden called without AppBarContext provider, this will have no effect`)},[t,e])}function n9(e){let t=(0,M.use)(Q7)?.setSecondaryButton;(0,M.useEffect)(()=>{if(t!==void 0)return t(e),()=>t(``);tn!==`desktop`&&h.warn(`[AppBar] useAppBarSecondaryButton called without AppBarContext provider, this will have no effect`)},[e,t])}var r9={toast:`_toast_z5w27_8`},i9=({open:e,onDismiss:t,autoDismiss:n,children:r,Icon:i,modal:a=!0})=>{let o=(0,M.useCallback)(e=>{e||t()},[t]);(0,M.useEffect)(()=>{if(e&&n!==void 0){let e=setTimeout(t,n);return()=>clearTimeout(e)}},[e,n,t]);let s=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Wi,{className:(0,U.default)(Fi.bg,Fi.animate)}),(0,W.jsx)(An,{"aria-describedby":void 0,asChild:!0,children:(0,W.jsxs)(hr,{className:(0,U.default)(Fi.overlay,Fi.animate,r9.toast),children:[(0,W.jsx)(ea,{asChild:!0,children:(0,W.jsx)(ei,{as:`h3`,size:`sm`,weight:`semibold`,children:r})}),i&&(0,W.jsx)(i,{width:20,height:20,"aria-hidden":!0})]})})]});return(0,W.jsx)(Vn,{open:e,onOpenChange:o,modal:a,children:a?(0,W.jsx)(aa,{children:s}):s})},a9=``+new URL(`ringtone-B2csBdU4.mp3`,import.meta.url).href,o9=``+new URL(`ringtone-B-nJXbbw.ogg`,import.meta.url).href,s9=h.getChild(`[InCallView]`),c9=e=>{let[t,n]=(0,M.useState)(null),r=sn(),i=$L(),a=xY();return(0,M.useEffect)(()=>{s9.info(`START CALL VIEW SCOPE`);let t=new pL,o=new W7(t,e.rtcSession),{autoLeaveWhenOthersLeft:s,waitForCallPickup:c,sendNotificationType:l}=r,u=i8(t,e.rtcSession,e.matrixRoom,i,e.muteStates,{encryptionSystem:e.e2eeSystem,autoLeaveWhenOthersLeft:s,waitForCallPickup:c&&l===`ring`,matrixRTCMode$:Ee.value$},o.raisedHands$,o.reactions$,t.behavior(a));return u.join(),n(u),u.leave$.pipe(t.bind()).subscribe(e.onLeft),()=>{s9.info(`END CALL VIEW SCOPE`),t.end()}},[e.rtcSession,e.matrixRoom,e.muteStates,e.e2eeSystem,e.onLeft,r,i,a]),t===null?null:(0,W.jsx)(ti,{vm:t,rtcSession:e.rtcSession,children:(0,W.jsx)(l9,{...e,vm:t})})},l9=({client:e,vm:t,matrixInfo:n,matrixRoom:r,muteStates:i,onShareClick:a})=>{let{t:o}=Ni(),{supportsReactions:s,sendReaction:c,toggleRaisedHand:l}=Ci();M3();let u=(0,M.useRef)(null),[d,f]=L$(),p=T3(u,d),{showControls:m,header:h}=sn(),g=k(J7),_=w3(x7({sounds:J$(async()=>w7({waiting:{mp3:a9,ogg:o9}})),latencyHint:`interactive`,muted:g})),v=k(i.audio.enabled$),y=k(i.video.enabled$),b=k(i.audio.toggle$),x=k(i.video.toggle$);u1(u,b,x,k(i.audio.setEnabled$),e=>void c(e),()=>void l());let S=k(t.ringing$),C=k(t.livekitRoomItems$),w=k(t.participantCount$),T=k(t.reconnecting$),E=k(t.windowMode$),ee=k(t.layout$),te=k(t.tileStoreGeneration$),[ne]=Et(ge),re=k(t.gridMode$),ie=k(t.showHeader$),ae=k(t.showFooter$),D=k(t.earpieceMode$),O=k(t.audioOutputSwitcher$),oe=k(t.sharingScreen$),se=k(t.fatalError$);if(se)throw s9.debug(`fatalCallError stop rendering`,se),se;(0,M.useEffect)(()=>{let e=_.current;if(S&&e){let t=e.playSoundLooping(`waiting`,e.soundDuration.waiting??1);return()=>{t().catch(e=>{s9.error(`Failed to stop ringing sound`,e)})}}},[S,_]);let ce=(0,M.useCallback)(e=>{e.nativeEvent.pointerType===`touch`&&e.target.closest?.(`button, input`)===null&&t.tapScreen()},[t]),le=(0,M.useCallback)(e=>{e.pointerType===`mouse`&&t.hoverScreen()},[t]),ue=(0,M.useCallback)(()=>t.unhoverScreen(),[t]),[de,fe]=(0,M.useState)(!1),[pe,me]=(0,M.useState)(nX),he=(0,M.useCallback)(()=>fe(!0),[fe]),_e=(0,M.useCallback)(()=>fe(!1),[fe]),ve=(0,M.useMemo)(()=>At===null?()=>{me(`profile`),fe(!0)}:null,[me,fe]),[ye,be]=L$(),[xe,Se]=L$(),Ce=(0,M.useMemo)(()=>({width:f.width,height:f.height-be.height-(E===`flat`?0:Se.height)}),[f.width,f.height,be.height,Se.height,E]),we=KL(e=>e.pipe(G(([e])=>e)),[Ce]),Ee=J$(()=>new Ge(a7)),De=J$(()=>new Ge(o7)),Oe=(0,M.useCallback)(e=>t.setGridMode(e),[t]);t9(!ie);let ke=null;if(ie)switch(h){case Bt.AppBar:break;case Bt.None:ke=(0,W.jsx)(`div`,{className:(0,U.default)(P$.header,P$.filler),ref:ye});break;case Bt.Standard:ke=(0,W.jsxs)(Zi,{className:P$.header,ref:ye,disconnectedBanner:!1,children:[(0,W.jsx)(Ae,{children:(0,W.jsx)(Tt,{id:n.roomId,name:n.roomName,avatarUrl:n.roomAvatar,encrypted:n.e2eeSystem.kind!==fn.NONE,participantCount:w})}),(0,W.jsx)(Te,{children:m&&a!==null&&(0,W.jsx)(q$,{className:P$.invite,onClick:a})})]})}let je=(0,M.useCallback)(()=>{},[]),Me=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:(0,U.default)(Fi.bg,Fi.animate),"data-state":T?`open`:`closed`}),(0,W.jsx)(i9,{onDismiss:je,open:T,modal:!1,children:o(`common.reconnecting`)})]}),Ne=(0,W.jsx)(X7,{show:D&&!T,onBackToVideoPressed:O?.switch}),Pe=T||D,Fe=(0,M.useMemo)(()=>function({ref:e,className:n,style:r,targetWidth:i,targetHeight:a,model:o}){let s=k(t.spotlightExpanded$),c=k(t.toggleSpotlightExpanded$),l=k(t.showSpeakingIndicators$),u=k(t.showSpotlightIndicators$);return o instanceof F3?(0,W.jsx)(A3,{ref:e,vm:o,onOpenProfile:ve,targetWidth:i,targetHeight:a,className:(0,U.default)(n,P$.tile),style:r,showSpeakingIndicators:l,focusable:!Pe}):(0,W.jsx)(r7,{ref:e,vm:o,expanded:s,onToggleExpanded:c,targetWidth:i,targetHeight:a,showIndicators:u,focusable:!Pe,className:(0,U.default)(n,P$.tile),style:r})},[t,ve,Pe]),Ie=(0,M.useMemo)(()=>{let e={minBounds$:we,spotlightAlignment$:Ee,pipAlignment$:De};return{grid:u7(e),"spotlight-landscape":g7(e),"spotlight-portrait":v7(e),"spotlight-expanded":m7(e),"one-on-one":f7(e)}},[we,Ee,De]),Le=()=>{if(ee.type===`pip`)return(0,W.jsx)(r7,{className:(0,U.default)(P$.tile,P$.maximised),vm:ee.spotlight,expanded:!0,onToggleExpanded:null,targetWidth:Ce.width,targetHeight:Ce.height,showIndicators:!1,focusable:!Pe,"aria-hidden":Pe});let e=Ie[ee.type],t=(0,W.jsx)(U5,{className:P$.fixedGrid,style:{insetBlockStart:be.height>0?be.bottom:f.top,height:Ce.height},model:ee,Layout:e.fixed,Tile:Fe,"aria-hidden":Pe},`fixed`),n=(0,W.jsx)(U5,{className:P$.scrollingGrid,model:ee,Layout:e.scrolling,Tile:Fe,"aria-hidden":Pe},`scrolling`);return ee.type===`spotlight-expanded`?(0,W.jsxs)(W.Fragment,{children:[t,n]}):(0,W.jsxs)(W.Fragment,{children:[n,t]})},Re=na(r.roomId),ze=h===Bt.AppBar&&ie;n9((0,W.jsx)(_r,{onClick:he,"data-testid":`settings-app-bar`},`settings`));let Be=(0,W.jsx)($$,{ref:xe,hidden:!ae,hideControls:!m,asOverlay:E===`flat`,asPip:ee.type===`pip`,hideLogo:h!==Bt.Standard,layoutMode:re,setLayoutMode:Oe,audioEnabled:v,toggleAudio:b??void 0,videoEnabled:y,toggleVideo:x??void 0,sharingScreen:oe,toggleScreenSharing:t.toggleScreenSharing??void 0,reactionIdentifier:`${e.getUserId()}:${e.getDeviceId()}`,reactionData:s?t:void 0,audioOutputSwitcher:O??void 0,openSettings:ze?void 0:he,hangup:t.hangup,debugTileLayout:ne,tileStoreGeneration:te}),Ve=k(t.allConnections$);return(0,W.jsxs)(`div`,{className:P$.inRoom,ref:p,onClick:ce,onPointerMove:le,onPointerOut:ue,children:[ke,C.map(({livekitRoom:e,url:t,participants:n})=>(0,W.jsx)(K7,{url:t,livekitRoom:e,validIdentities:n,muted:g},t)),Le(),(0,W.jsx)(H7,{vm:t,muted:g}),(0,W.jsx)(E7,{vm:t,muted:g}),Me,Ne,(0,W.jsx)(O7,{vm:t}),Be,ee.type!==`pip`&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(j3,{...Re}),(0,W.jsx)(rX,{client:e,roomId:r.roomId,open:de,onDismiss:_e,tab:pe,onTabChange:me,livekitRooms:Ve.getConnections().map(e=>({room:e.livekitRoom,livekitAlias:e.livekitAlias,isLocal:void 0,url:e.transport.livekit_service_url}))})]})]})};function u9(e,t){let n=Yn(e,l.CurrentStateUpdated,(0,M.useCallback)(()=>e.currentState,[e]));return Yn(n,x.Update,(0,M.useCallback)(()=>t(n),[t,n]))}function d9(e){return u9(e,(0,M.useCallback)(()=>e.getMxcAvatarUrl(),[e]))}function f9(e){return Yn(e,l.Name,(0,M.useCallback)(()=>e.name,[e]))}function p9(e){return u9(e,(0,M.useCallback)(e=>e.getJoinRule(),[]))}var m9=n(((e,t)=>{t.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case`INPUT`:case`TEXTAREA`:t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type===`Caret`&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}})),h9=e(n(((e,t)=>{var n=m9(),r={"text/plain":`Text`,"text/html":`Url`,default:`Text`},i=`Copy to clipboard: #{key}, Enter`;function a(e){var t=(/mac os x/i.test(navigator.userAgent)?`⌘`:`Ctrl`)+`+C`;return e.replace(/#{\s*key\s*}/g,t)}function o(e,t){var o,s,c,l,u,d,f=!1;t||={},o=t.debug||!1;try{if(c=n(),l=document.createRange(),u=document.getSelection(),d=document.createElement(`span`),d.textContent=e,d.ariaHidden=`true`,d.style.all=`unset`,d.style.position=`fixed`,d.style.top=0,d.style.clip=`rect(0, 0, 0, 0)`,d.style.whiteSpace=`pre`,d.style.webkitUserSelect=`text`,d.style.MozUserSelect=`text`,d.style.msUserSelect=`text`,d.style.userSelect=`text`,d.addEventListener(`copy`,function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),n.clipboardData===void 0){o&&console.warn(`unable to use e.clipboardData`),o&&console.warn(`trying IE specific stuff`),window.clipboardData.clearData();var i=r[t.format]||r.default;window.clipboardData.setData(i,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),l.selectNodeContents(d),u.addRange(l),!document.execCommand(`copy`))throw Error(`copy command was unsuccessful`);f=!0}catch(n){o&&console.error(`unable to copy using execCommand: `,n),o&&console.warn(`trying IE specific stuff`);try{window.clipboardData.setData(t.format||`text`,e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(n){o&&console.error(`unable to copy using clipboardData: `,n),o&&console.error(`falling back to prompt`),s=a(`message`in t?t.message:i),window.prompt(s,e)}}finally{u&&(typeof u.removeRange==`function`?u.removeRange(l):u.removeAllRanges()),d&&document.body.removeChild(d),c()}return f}t.exports=o}))(),1),g9={url:`_url_1ibuh_8`,button:`_button_1ibuh_15`,qrCode:`_qrCode_1ibuh_19`},_9=n(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),v9=n((e=>{var t,n=[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];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),y9=n((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),b9=n(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),x9=n(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),S9=n((e=>{var t=v9().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),C9=n((e=>{var t=v9().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),w9=n((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),T9=n((e=>{var t=y9(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),E9=n((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),D9=n((e=>{var t=E9();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),O9=n(((e,t)=>{var n=D9();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),k9=n((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),A9=n((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
@@ -214,6 +214,6 @@ Minimum version required to store current data is: `+c+`.
214
214
  `);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),N9=n((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),Ree=n((e=>{var t=N9();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),zee=n((e=>{var t=N9();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
215
215
  `;return typeof a==`function`&&a(null,p),p}})),Bee=n((e=>{var t=_9(),n=Lee(),r=Ree(),i=zee();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))(),Vee={qrCode:`_qrCode_h54ia_8`},Hee=({data:e,className:t})=>{let[n,r]=(0,M.useState)(null);return(0,M.useEffect)(()=>{let t=!1;return(0,Bee.toDataURL)(e,{errorCorrectionLevel:`L`}).then(e=>{t||r(e)}).catch(e=>{t||r(null)}),()=>{t=!0}},[e]),(0,W.jsx)(`div`,{className:(0,U.default)(Vee.qrCode,t),children:n&&(0,W.jsx)(`img`,{src:n,alt:iN(`qr_code`)})})},Uee=({room:e,open:t,onDismiss:n})=>{let{t:r}=Ni(),i=Ii(e.roomId),a=(0,M.useMemo)(()=>vi(e.roomId,i,e.name),[i,e.name,e.roomId]),[o,s]=(0,M.useState)(!1),c=(0,M.useCallback)(()=>s(!1),[s]),l=(0,M.useCallback)(e=>{e.stopPropagation(),(0,h9.default)(a),n(),s(!0)},[a,n]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(or,{title:r(`invite_modal.title`),open:t,onDismiss:n,children:[(0,W.jsx)(Hee,{className:g9.qrCode,data:a}),(0,W.jsx)(ei,{className:g9.url,size:`sm`,weight:`semibold`,children:a}),(0,W.jsx)(Pi,{className:g9.button,Icon:WN,onClick:l,"data-testid":`modal_inviteLink`,children:r(`action.copy_link`)})]}),(0,W.jsx)(i9,{open:o,onDismiss:c,autoDismiss:2e3,Icon:vj,children:r(`invite_modal.link_copied_toast`)})]})},Wee=({error:e,recoveryActionHandler:t,widget:n})=>{let{t:r}=Ni();h.error(`Error boundary caught:`,e);let i;switch(e.category){case DY.CONFIGURATION_ISSUE:i=HN;break;case DY.NETWORK_CONNECTIVITY:i=JN;break;case DY.CLIENT_CONFIGURATION:i=fP;break;default:i=an}let a=[];return e instanceof AY&&a.push({label:r(`call_ended_view.reconnect_button`),onClick:()=>void t(`reconnect`)}),(0,W.jsx)(pn,{children:(0,W.jsxs)(jt,{Icon:i,title:e.localisedTitle,rageshake:e.code==EY.UNKNOWN_ERROR,widget:n,children:[(0,W.jsx)(`p`,{children:e.localisedMessage??(0,W.jsx)(ON,{i18nKey:`error.unexpected_ec_error`,components:[(0,W.jsx)(`b`,{}),(0,W.jsx)(`code`,{})],values:{errorCode:e.code}})}),a&&a.map((e,t)=>(0,W.jsx)(Pi,{kind:`secondary`,onClick:e.onClick,children:e.label},`action${t}`))]})})},Gee=({recoveryActionHandler:e,onError:t,children:n,widget:r})=>(0,W.jsx)(wT,{fallback:(0,M.useCallback)(({error:t,resetError:n})=>{let i=t instanceof OY?t:new NY(t instanceof Error?t:Error());return(0,W.jsx)(Wee,{widget:r??null,error:i,resetError:n,recoveryActionHandler:async t=>{await e(t),n()}})},[e,r]),onError:e=>t?.(e),children:n}),Kee=({client:e,isPasswordlessUser:t,confineToRoom:n,preload:r,skipLobby:i,rtcSession:a,joined:o,setJoined:s,muteStates:c,widget:l})=>{let[u,d]=(0,M.useState)(null),f=Rn(a),p=w3(x7({sounds:V7,latencyHint:`interactive`,muted:k(J7)}));(0,M.useEffect)(()=>{f.length>=8&&c.audio.setEnabled$.value?.(!1)},[]),(0,M.useEffect)(()=>(h.info(`[Lifecycle] GroupCallView Component mounted`),()=>{h.info(`[Lifecycle] GroupCallView Component unmounted`)}),[]),(0,M.useEffect)(()=>(document.body.classList.add(`no-scroll-body`),()=>{document.body.classList.remove(`no-scroll-body`)}),[]),(0,M.useEffect)(()=>(window.rtcSession=a,()=>{delete window.rtcSession}),[a]),ki(a,S.MembershipManagerError,e=>d(new AY)),(0,M.useEffect)(()=>{e.getRoom(a.room.roomId)!==a.room&&h.warn(`We've ended up with multiple rooms for the same ID (${a.room.roomId}). This indicates a bug in the group call loading code, and may lead to incomplete room state.`)},[e,a.room]);let m=a.room,{displayName:g,avatarUrl:_}=xI(e),v=f9(m),y=d9(m),{perParticipantE2EE:b,returnToLobby:x,password:C,header:w}=sn(),T=Ii(m.roomId);(0,M.useEffect)(()=>{C&&Rr(m.roomId,C)},[C,m.roomId]),VX(v),e9(v);let E=(0,M.useMemo)(()=>({userId:e.getUserId(),displayName:g,avatarUrl:_,roomId:m.roomId,roomName:v,roomAlias:m.getCanonicalAlias(),roomAvatar:y,e2eeSystem:T}),[e,g,_,v,m,y,T]),ee=(0,M.useMemo)(()=>new Set(f.map(e=>e.userId)).size,[f]),te=$L(),re=w3(c),ie=(0,M.useCallback)(async e=>{try{s(!0)}catch(e){e instanceof OY?d(e):(h.error(`Unknown Error while entering RTC session`,e),d(new NY(e instanceof Error?e:Error(`Unknown error`,{cause:e}))))}return Promise.resolve()},[s]);(0,M.useEffect)(()=>{let e=async({audioInput:e,videoInput:t})=>{let n=await J_.getLocalDevices(void 0,!0);if(e){let t=s1(e,`audioinput`,n);t?(h.debug(`Found audio input ID ${t} for name ${e}`),te.audioInput.select(t)):(h.warn(`Unknown audio input: `+e),re.current.audio.setEnabled$.value?.(!1))}if(t){let e=s1(t,`videoinput`,n);e?(h.debug(`Found video input ID ${e} for name ${t}`),te.videoInput.select(e)):(h.warn(`Unknown video input: `+t),re.current.video.setEnabled$.value?.(!1))}};if(i)if(l&&r){let t=t=>{(async()=>{await e(t.detail.data),s(!0),l.api.transport.reply(t.detail,{})})().catch(e=>{h.error(`Error joining RTC session on preload`,e)})};return l.lazyActions.on(ht.JoinCall,t),()=>{l.lazyActions.off(ht.JoinCall,t)}}else s(!0)},[l,a,r,i,b,te,re,s]);let[ae,D]=(0,M.useState)(!1),O=ri(),oe=(0,M.useCallback)(e=>{let r=`left`;(e===`timeout`||e===`decline`)&&(r=e),s(!1),D(!0);let i=p.current?.playSound(r),o=new Promise(e=>{let t=l!==null;vr.instance.eventCallEnded.track(m.roomId,a.memberships.length,t,a),window.setTimeout(e,10)});Promise.all([i,o]).catch(e=>h.error(`Failed to play leave audio and/or send PostHog leave event`,e)).then(async()=>{if(!t&&!n&&!vr.instance.isEnabled()&&O(`/`),l){try{await l.api.setAlwaysOnScreen(!1)}catch(e){h.error("Failed to set call widget `alwaysOnScreen` to false",e)}if(e!=`error`&&!da().returnToLobby){try{await l.api.transport.send(ht.Close,{})}catch(e){h.error(`Failed to send close action`,e)}l.api.transport.stop()}}})},[s,p,l,m.roomId,a,t,n,O]);(0,M.useEffect)(()=>{l&&o&&l.api.setAlwaysOnScreen(!0).catch(e=>{h.error(`Error calling setAlwaysOnScreen(true)`,e)})},[l,o,a]);let se=p9(m),[ce,le]=(0,M.useState)(!1),ue=(0,M.useCallback)(()=>le(!1),[le]),de=(0,M.useCallback)(()=>le(!0),[le]),fe=se===ne.Public?de:null;if(!Yp()&&T.kind!==fn.NONE)throw new MY;let pe=(0,W.jsx)(Uee,{room:m,open:ce,onDismiss:ue}),me=(0,W.jsxs)(W.Fragment,{children:[pe,(0,W.jsx)(e1,{client:e,matrixInfo:E,muteStates:c,onEnter:()=>s(!0),confineToRoom:n,hideHeader:w!==Bt.Standard,participantCount:ee,onShareClick:fe})]}),he;return he=u?(0,W.jsx)(()=>{throw u},{}):o?(0,W.jsxs)(W.Fragment,{children:[pe,(0,W.jsx)(c9,{client:e,matrixInfo:E,rtcSession:a,matrixRoom:m,onLeft:oe,muteStates:c,e2eeSystem:T,onShareClick:fe})]}):ae&&l===null?t||vr.instance.isEnabled()&&l===null?(0,W.jsx)(o1,{endedCallId:a.room.roomId,client:e,isPasswordlessUser:t,hideHeader:w===Bt.None,confineToRoom:n}):null:ae&&l!==null?x?me:null:r||i?null:me,(0,W.jsx)(Gee,{widget:l,recoveryActionHandler:async e=>{d(null),e==`reconnect`&&(D(!1),await ie(a).catch(e=>{h.error(`Error re-entering RTC session`,e)}))},onError:()=>{a.isJoined()&&oe(`error`)},children:he})},qee=3,Jee=3e3;async function P9(e,t=0,...n){try{return await e.joinRoom(...n)}catch(r){if(r instanceof a&&r.errcode===`M_FORBIDDEN`&&t<qee)return await new Promise(e=>setTimeout(e,Jee)),P9(e,t+1,...n);throw r}}var F9=class extends Error{constructor(e,t,n,r){super(t),this.icon=e,this.messageBody=n,this.reason=r}},Yee=(e,t,n)=>{let[r,a]=(0,M.useState)({kind:`loading`}),o=(0,M.useRef)(void 0),{t:s}=Ni(),u=(0,M.useCallback)(()=>new F9(AN,s(`group_call_loader.banned_heading`),s(`group_call_loader.banned_body`),m()),[s]),f=(0,M.useCallback)(()=>new F9(pe,s(`group_call_loader.knock_reject_heading`),s(`group_call_loader.knock_reject_body`),m()),[s]),p=(0,M.useCallback)(()=>new F9(ir,s(`group_call_loader.call_ended_heading`),s(`group_call_loader.call_ended_body`),m()),[s]),m=()=>o.current?.currentState.getStateEvents(i.RoomMember,o.current?.myUserId)?.getContent().reason;return(0,M.useEffect)(()=>{if(!e||!t)return;let i=async t=>{let n=null,r=await e.getRoomIdForAlias(t.toLowerCase());return h.info(`${t} resolved to ${r.room_id}`),n=e.getRoom(r.room_id),n?h.info(`Already in room ${r.room_id}, not rejoining.`):(h.info(`Room ${r.room_id} not found, joining.`),n=await e.joinRoom(r.room_id,{viaServers:r.servers})),n},s=async(t,n,r)=>(await e.knockRoom(t,{viaServers:n}),r(),await new Promise((r,i)=>{e.on(l.MyMembership,(a,s,l)=>{t===a.roomId&&(o.current=a,s===c.Invite&&l===c.Knock&&P9(e,0,a.roomId,{viaServers:n}).then(e=>{h.log(`Auto-joined %s`,e.roomId),r(e)},i),s===c.Ban&&i(u()),s===c.Leave&&i(f()))})})),m=async()=>{let r=null;if(t[0]===`#`)r=await i(t),o.current=r;else{let i=t;r=e.getRoom(i),o.current=r??void 0;let l=r?.getMyMembership();if(l===c.Join)return r;if(At)throw Error(`Room not found. The widget-api did not pass over the relevant room events/information.`);if(l===c.Ban)throw u();if(l===c.Invite)r=await e.joinRoom(i,{viaServers:n});else{let t;try{t=await e.getRoomSummary(i,n)}catch(e){h.warn(`Could not load room summary to decide whether we want to join or knock.
216
216
  EC will fallback to join as if this would be a public room.
217
- Reach out to your homeserver admin to ask them about supporting the \`/summary\` endpoint (im.nheko.summary):`,e)}if(t===void 0||t.join_rule===ne.Public)r=await e.joinRoom(i,{viaServers:n});else if(t.join_rule===ne.Knock){let e=t,i=()=>{},o=new Promise(t=>{e.membership===c.Knock?t():i=t});a({kind:`canKnock`,roomSummary:e,knock:i}),await o,r=await s(t.room_id,n,()=>a({kind:`waitForInvite`,roomSummary:e}))}else throw Error(`Room ${t.room_id} is not joinable. This likely means, that the conference owner has changed the room settings to private.`)}}return h.info(`Joined ${t}, waiting room to be ready for group calls`),await e.waitUntilRoomReadyForGroupCalls(r.roomId),h.info(`${t}, is ready for group calls`),r};r.kind===`loading`&&(h.log(`Start loading group call`),(async()=>{e.getSyncState()!==d.Syncing&&(h.debug(`useLoadGroupCall: waiting for client to start syncing...`),await new Promise(t=>{let n=()=>{if(e.getSyncState()===d.Syncing)return e.off(ee.Sync,n),t()};e.on(ee.Sync,n)}),h.debug(`useLoadGroupCall: client is now syncing.`))})().then(async()=>{let n=await m();return o.current=n,h.debug(`Fetched / joined room ${t}`),e.matrixRTC.getRoomSession(n)}).then(e=>a({kind:`loaded`,rtcSession:e})).then(async()=>{await new Promise((t,n)=>{e.on(l.MyMembership,(e,t)=>{t===c.Leave&&n(p()),t===c.Ban&&n(u())})})}).catch(e=>a({kind:`failed`,error:e})))},[u,e,f,p,t,r,s,n]),r},I9=async e=>Promise.resolve(e),L9=class{setHandler(e){if(this.handler$.value!==I9)throw Error(`Multiple mute state handlers are not supported`);this.handler$.next(e)}unsetHandler(){this.handler$.next(I9)}constructor(e,t,n,r){this.scope=e,this.device=t,this.enabledByDefault=n,this.forceMute$=r,this.handler$=new Ge(I9),this.canControlDevices$=yF([this.device.available$,this.forceMute$]).pipe(G(([e,t])=>!t&&e.size>0)),this.data$=this.scope.behavior(this.canControlDevices$.pipe(eI(),G(e=>{if(h.info(`MuteState: canControlDevices: ${e}, enabled by default: ${this.enabledByDefault}`),!e)return h.info(`MuteState: devices connected: ${e}, disabling`),this.handler$.value(!1).catch(e=>{h.error(`MuteState-disable: handler error`,e)}),{enabled$:aF(!1),set:null,toggle:null};let t=this.enabledByDefault,n=new ot,r=new ot,i=RF(n,r.pipe(G(()=>!t)));return{set:e=>n.next(e),toggle:()=>r.next(),enabled$:new It(e=>{e.next(t);let n=this.enabledByDefault,r=!1,a=async()=>{if(t===n)r=!1;else{let i=t;t=await sF(this.handler$.pipe(K(async e=>e(n)))),t===i?r=!1:(e.next(t),r=!0,a().catch(e=>{h.error(`MuteState: handler error`,e)}))}},o=i.subscribe(e=>{n=e,r===!1&&(r=!0,a().catch(e=>{h.error(`MuteState: handler error`,e)}))});return()=>o.unsubscribe()})}}))),this.enabled$=this.scope.behavior(this.data$.pipe(K(({enabled$:e})=>e))),this.setEnabled$=this.scope.behavior(this.data$.pipe(G(({set:e})=>e))),this.toggle$=this.scope.behavior(this.data$.pipe(G(({toggle:e})=>e)))}},Xee=class{constructor(e,t,n){if(this.scope=e,this.mediaDevices=t,this.initialMuteState=n,this.isEarpiece$=yF([this.mediaDevices.audioOutput.available$,this.mediaDevices.audioOutput.selected$]).pipe(G(([e,t])=>{if(!t?.id)return!1;let n=e.get(t.id);return h.info(`MuteStates: selected audio output device:`,n),n?.type===`earpiece`})),this.audio=new L9(this.scope,this.mediaDevices.audioInput,this.initialMuteState.audioEnabled,ML(!1)),this.video=new L9(this.scope,this.mediaDevices.videoInput,this.initialMuteState.videoEnabled,this.isEarpiece$),At!==null){let e=yF([this.audio.enabled$,this.video.enabled$],(e,t)=>({audio_enabled:e,video_enabled:t}));e.pipe(this.scope.bind()).subscribe(e=>{At.api.transport.send(ht.DeviceMute,e).catch(e=>h.warn(`Could not send DeviceMute action to widget`,e))}),jF(At.lazyActions,ht.DeviceMute).pipe(bI(e,this.audio.setEnabled$,this.video.setEnabled$),this.scope.bind()).subscribe(([e,t,n,r])=>{let i={...t};e.detail.data.audio_enabled!=null&&typeof e.detail.data.audio_enabled==`boolean`&&n!==null&&(i.audio_enabled=e.detail.data.audio_enabled,n(i.audio_enabled)),e.detail.data.video_enabled!=null&&typeof e.detail.data.video_enabled==`boolean`&&r!==null&&(i.video_enabled=e.detail.data.video_enabled,r(i.video_enabled)),At.api.transport.reply(e.detail,i)})}}};function Zee(e,t,n){return h.debug(`calculateInitialMuteState: skipLobby=${e}, callIntent=${t} isWidgetMode=${n}`),e&&!n?{audioEnabled:!1,videoEnabled:!1}:{audioEnabled:!0,videoEnabled:t!=`audio`}}var Qee=()=>{let e=sn(),{confineToRoom:t,preload:n,header:r,displayName:i,skipLobby:a}=e,{t:o}=Ni(),{roomAlias:s,roomId:c,viaServers:l}=he(),u=c??s;u||h.error(`No room specified`);let{registerPasswordlessUser:d}=YX(),[f,p]=(0,M.useState)(!1),{loading:m,authenticated:g,client:_,error:v,passwordlessUser:y}=ci(),{avatarUrl:b,displayName:x}=xI(_),S=Yee(_,u,l),[C,w]=(0,M.useState)(!1),T=$L(),[E,ee]=(0,M.useState)(null);(0,M.useEffect)(()=>{let t=new pL;return ee(new Xee(t,T,Zee(e.skipLobby,e.callIntent,At!==null))),()=>t.end()},[T,e]),(0,M.useEffect)(()=>{!m&&!g&&i&&!At&&(p(!0),d(i).catch(e=>{h.error(`Failed to register passwordless user`,e)}).finally(()=>{p(!1)}))},[m,g,i,p,d]);let[te,ne]=gt();(0,M.useEffect)(()=>{te===null&&ne&&ne(!0)},[te,ne]);let re=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{S.kind===`loaded`&&re.current&&h.log(`Play join sound 'Not yet implemented'`)},[S.kind]),m||f?(0,W.jsx)(Cn,{}):v?(0,W.jsx)(vn,{widget:At,error:v}):_?u?(()=>{switch(S.kind){case`loaded`:return E&&(0,W.jsx)(Kee,{widget:At,client:_,rtcSession:S.rtcSession,joined:C,setJoined:w,isPasswordlessUser:y,confineToRoom:t,preload:n,skipLobby:a||re.current,muteStates:E});case`waitForInvite`:case`canKnock`:{re.current=re.current||S.kind===`waitForInvite`;let e=S.kind===`canKnock`?S.knock:null,n=S.kind===`canKnock`?o(`lobby.ask_to_join`):(0,W.jsxs)(W.Fragment,{children:[o(`lobby.waiting_for_invite`),(0,W.jsx)(vj,{})]});return E&&(0,W.jsx)(e1,{client:_,matrixInfo:{userId:_.getUserId()??``,displayName:x??``,avatarUrl:b??``,roomAlias:null,roomId:S.roomSummary.room_id,roomName:S.roomSummary.name??``,roomAvatar:S.roomSummary.avatar_url??null,e2eeSystem:{kind:S.roomSummary[`im.nheko.summary.encryption`]?fn.PER_PARTICIPANT:fn.NONE}},onEnter:()=>e?.(),enterLabel:n,waitingForInvite:S.kind===`waitForInvite`,confineToRoom:t,hideHeader:r!==`standard`,participantCount:null,muteStates:E,onShareClick:null})}case`loading`:return(0,W.jsx)(pn,{children:(0,W.jsx)(`h1`,{children:o(`common.loading`)})});case`failed`:return re.current=!1,S.error.errcode===`M_NOT_FOUND`?(0,W.jsx)(pn,{children:(0,W.jsx)(jt,{Icon:xee,title:o(`error.call_not_found`),widget:At,children:(0,W.jsx)(ON,{i18nKey:`error.call_not_found_description`,children:(0,W.jsxs)(`p`,{children:[`That link doesn't appear to belong to any existing call. Check that you have the right link, or`,` `,(0,W.jsx)(tr,{to:`/`,children:`create a new one`}),`.`]})})})}):S.error instanceof F9?(0,W.jsx)(pn,{children:(0,W.jsxs)(jt,{Icon:S.error.icon,title:S.error.message,widget:At,children:[(0,W.jsx)(`p`,{children:S.error.messageBody}),S.error.reason&&(0,W.jsx)(`p`,{children:o(`group_call_loader.reason`,{reason:S.error.reason})})]})}):(0,W.jsx)(vn,{widget:At,error:S.error});default:return(0,W.jsx)(W.Fragment,{children:` `})}})():(0,W.jsx)(HX,{}):(0,W.jsx)(XX,{})},$ee=`data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICLQn9C+0YLRgNC10LHQuNGC0LXQu9GB0LrQviDQvNC10L3RjiIKICB9LAogICJhY3Rpb24iOiB7CiAgICAiY2xvc2UiOiAi0JfQsNGC0LLQvtGA0LgiLAogICAgImNvcHlfbGluayI6ICLQmtC+0L/QuNGA0LDQvdC1INC90LAg0LLRgNGK0LfQutCw0YLQsCIsCiAgICAiZ28iOiAi0J3QsNC/0YDQtdC0IiwKICAgICJpbnZpdGUiOiAi0J/QvtC60LDQvdCwIiwKICAgICJubyI6ICLQndC1IiwKICAgICJyZWdpc3RlciI6ICLQoNC10LPQuNGB0YLRgNCw0YbQuNGPIiwKICAgICJyZW1vdmUiOiAi0J/RgNC10LzQsNGF0L3QuCIsCiAgICAic2lnbl9pbiI6ICLQktC70LXQtyIsCiAgICAic2lnbl9vdXQiOiAi0JjQt9C70LXQtyIKICB9LAogICJjYWxsX2VuZGVkX3ZpZXciOiB7CiAgICAiY3JlYXRlX2FjY291bnRfYnV0dG9uIjogItCh0YrQt9C00LDQuSDQsNC60LDRg9C90YIiLAogICAgImNyZWF0ZV9hY2NvdW50X3Byb21wdCI6ICI8MD7Ql9Cw0YnQviDQvdC1INC90LDRgdGC0YDQvtC50YLQtSDQv9Cw0YDQvtC70LAg0LfQsCDQtNCwINC30LDQv9Cw0LfQuNGC0LUg0LDQutCw0YPQvdGC0LAg0YHQuD88LzA+PDE+0KnQtSDQvNC+0LbQtdGC0LUg0LTQsCDQt9Cw0L/QsNC30LjRgtC1INC40LzQtdGC0L4g0Lgg0LDQstCw0YLQsNGA0LAg0YHQuCDQt9CwINCx0YrQtNC10YnQuCDRgNCw0LfQs9C+0LLQvtGA0Lg8LzE+IiwKICAgICJub3Rfbm93X2J1dHRvbiI6ICLQndC1INGB0LXQs9CwLCDQstGK0YDQvdC4INGB0LUg0L3QsCDQvdCw0YfQsNC70L3QuNGPINC10LrRgNCw0L0iCiAgfSwKICAiY29tbW9uIjogewogICAgImF1ZGlvIjogItCX0LLRg9C6IiwKICAgICJhdmF0YXIiOiAi0JDQstCw0YLQsNGAIiwKICAgICJkaXNwbGF5X25hbWUiOiAi0JjQvNC1L9C/0YHQtdCy0LTQvtC90LjQvCIsCiAgICAiaG9tZSI6ICLQndCw0YfQsNC70L4iLAogICAgImxvYWRpbmciOiAi0JfQsNGA0LXQttC00LDQvdC14oCmIiwKICAgICJwYXNzd29yZCI6ICLQn9Cw0YDQvtC70LAiLAogICAgInByb2ZpbGUiOiAi0J/RgNC+0YTQuNC7IiwKICAgICJzZXR0aW5ncyI6ICLQndCw0YHRgtGA0L7QudC60LgiLAogICAgInVzZXJuYW1lIjogItCf0L7RgtGA0LXQsdC40YLQtdC70YHQutC+INC40LzQtSIsCiAgICAidmlkZW8iOiAi0JLQuNC00LXQviIKICB9LAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAi0JTQsCwg0L/RgNC40YHRitC10LTQuNC90Lgg0YHQtSIsCiAgICAidGV4dCI6ICLQotC+0LfQuCDRgNCw0LfQs9C+0LLQvtGAINCy0LXRh9C1INGB0YrRidC10YHRgtCy0YPQstCwLCDQuNGB0LrQsNGC0LUg0LvQuCDQtNCwINGB0LUg0L/RgNC40YHRitC10LTQuNC90LjRgtC1PyIsCiAgICAidGl0bGUiOiAi0J/RgNC40YHRitC10LTQuNC90Y/QstCw0L3QtSDQutGK0Lwg0YHRitGJ0LXRgdGC0LLRg9Cy0LDRiSDRgNCw0LfQs9C+0LLQvtGAPyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogItCf0YDQvtC20LXQutGC0L7RgCIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogItCS0LvQtdC3INCyINGA0LDQt9Cz0L7QstC+0YDQsCIKICB9LAogICJsb2dnaW5nX2luIjogItCS0LvQuNC30LDQvdC14oCmIiwKICAibG9naW5fYXV0aF9saW5rcyI6ICI8MD7QodGK0LfQtNCw0LnRgtC1INCw0LrQsNGD0L3RgjwvMD4g0LjQu9C4IDwyPtCS0LvQtdC30YLQtSDQutCw0YLQviDQs9C+0YHRgjwvMj4iLAogICJsb2dpbl90aXRsZSI6ICLQktC70LXQtyIsCiAgInJhZ2VzaGFrZV9yZXF1ZXN0X21vZGFsIjogewogICAgImJvZHkiOiAi0JTRgNGD0LMg0L/QvtGC0YDQtdCx0LjRgtC10Lsg0LIg0YLQvtC30Lgg0YDQsNC30LPQvtCy0L7RgCDQuNC80LAg0L/RgNC+0LHQu9C10LwuINCX0LAg0LTQsCDQtNC40LDQs9C90L7RgdGC0LjRhtC40YDQsNC80LUg0YLQvtC30Lgg0L/RgNC+0LHQu9C10Lwg0L/Qvi3QtNC+0LHRgNC1INC90Lgg0YHQtSDQuNGB0LrQsCDQtNCwINGB0YrQsdC10YDQtdC8IGRlYnVnINC70L7Qs9C+0LLQtS4iLAogICAgInRpdGxlIjogItCX0LDRj9Cy0LrQsCDQt9CwIGRlYnVnINC70L7Qs9C+0LLQtSIKICB9LAogICJyYWdlc2hha2Vfc2VuZF9sb2dzIjogItCY0LfQv9GA0LDRgtC10YLQtSBkZWJ1ZyDQu9C+0LPQvtCy0LUiLAogICJyYWdlc2hha2Vfc2VuZGluZyI6ICLQmNC30L/RgNCw0YnQsNC90LXigKYiLAogICJyZWNhcHRjaGFfZGlzbWlzc2VkIjogIlJlY2FwdGNoYSDQvtGC0YXQstGK0YDQu9C10L3QsCIsCiAgInJlY2FwdGNoYV9ub3RfbG9hZGVkIjogIlJlY2FwdGNoYSDQvdC1INC1INC30LDRgNC10LTQtdC90LAiLAogICJyZWdpc3RlciI6IHsKICAgICJwYXNzd29yZHNfbXVzdF9tYXRjaCI6ICLQn9Cw0YDQvtC70LjRgtC1INC90LUg0YHRitCy0L/QsNC00LDRgiIsCiAgICAicmVnaXN0ZXJpbmciOiAi0KDQtdCz0LjRgdGC0YDQuNGA0LDQvdC14oCmIgogIH0sCiAgInJlZ2lzdGVyX2F1dGhfbGlua3MiOiAiPDA+0JLQtdGH0LUg0LjQvNCw0YLQtSDQsNC60LDRg9C90YI/PC8wPjwxPjwwPtCS0LvQtdC30YLQtSDRgSDQvdC10LPQvjwvMD4g0LjQu9C4IDwyPtCS0LvQtdC30YLQtSDQutCw0YLQviDQs9C+0YHRgjwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICLQn9C+0YLQstGK0YDQtNC4INC/0LDRgNC+0LvQsNGC0LAiLAogICJyZXR1cm5faG9tZV9idXR0b24iOiAi0JLRgNGK0YnQsNC90LUg0L3QsCDQvdCw0YfQsNC70L3QuNGPINC10LrRgNCw0L0iLAogICJzY3JlZW5zaGFyZV9idXR0b25fbGFiZWwiOiAi0KHQv9C+0LTQtdC70Lgg0LXQutGA0LDQvdCwIiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICLQoNCw0LfRgNCw0LHQvtGC0YfQuNC6IiwKICAgICJmZWVkYmFja190YWJfaDQiOiAi0JjQt9C/0YDQsNGC0Lgg0L7QsdGA0LDRgtC90LAg0LLRgNGK0LfQutCwIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogItCS0LrQu9GO0YfQuCBkZWJ1ZyDQu9C+0LPQvtCy0LUiCiAgfSwKICAidW5hdXRoZW50aWNhdGVkX3ZpZXdfYm9keSI6ICLQktGB0LUg0L7RidC1INC90LUg0YHRgtC1INGA0LXQs9C40YHRgtGA0LjRgNCw0L3QuD8gPDI+0KHRitC30LTQsNC50YLQtSDQsNC60LDRg9C90YI8LzI+IiwKICAidW5hdXRoZW50aWNhdGVkX3ZpZXdfbG9naW5fYnV0dG9uIjogItCS0LvQtdC30YLQtSDQsiDQsNC60LDRg9C90YLQsCDRgdC4IiwKICAidmVyc2lvbiI6ICLQktC10YDRgdC40Y86IHt7dmVyc2lvbn19Igp9Cg==`,ete=``+new URL(`cs-app-B7hInJc5.json`,import.meta.url).href,tte=``+new URL(`da-app-DAnspZzv.json`,import.meta.url).href,nte=``+new URL(`de-app-BfO8Ru-l.json`,import.meta.url).href,rte=``+new URL(`el-app-D5PqbGwj.json`,import.meta.url).href,ite=``+new URL(`en-app-D7n_5gIv.json`,import.meta.url).href,ate=`data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICJNZW7DuiBkZSB1c3VhcmlvIgogIH0sCiAgImFjdGlvbiI6IHsKICAgICJjbG9zZSI6ICJDZXJyYXIiLAogICAgImNvcHlfbGluayI6ICJDb3BpYXIgdsOtbmN1bG8iLAogICAgImdvIjogIkNvbWVuemFyIiwKICAgICJpbnZpdGUiOiAiSW52aXRhciIsCiAgICAibm8iOiAiTm8iLAogICAgInJlZ2lzdGVyIjogIlJlZ2lzdHJhcnNlIiwKICAgICJyZW1vdmUiOiAiRWxpbWluYXIiLAogICAgInNpZ25faW4iOiAiSW5pY2lhciBzZXNpw7NuIiwKICAgICJzaWduX291dCI6ICJDZXJyYXIgc2VzacOzbiIsCiAgICAic3VibWl0IjogIkVudmlhciIKICB9LAogICJhbmFseXRpY3Nfbm90aWNlIjogIkFsIHBhcnRpY2lwYXIgZW4gZXN0YSBiZXRhLCBjb25zaWVudGVzIGEgbGEgcmVjb2dpZGEgZGUgZGF0b3MgYW7Ds25pbW9zLCBsb3MgY3VhbGVzIHVzYXJlbW9zIHBhcmEgbWVqb3JhciBlbCBwcm9kdWN0by4gUHVlZGVzIGVuY29udHJhciBtw6FzIGluZm9ybWFjacOzbiBzb2JyZSBxdWUgZGF0b3MgcmVjb2dlbW9zIGVuIG51ZXN0cmEgPDI+UG9sw610aWNhIGRlIHByaXZhY2lkYWQ8LzI+IHkgZW4gbnVlc3RyYSA8NT5Qb2zDrXRpY2Egc29icmUgQ29va2llczwvNT4uIiwKICAiY2FsbF9lbmRlZF92aWV3IjogewogICAgImNyZWF0ZV9hY2NvdW50X2J1dHRvbiI6ICJDcmVhciBjdWVudGEiLAogICAgImNyZWF0ZV9hY2NvdW50X3Byb21wdCI6ICI8MD7Cv1BvciBxdcOpIG5vIG1hbnRpZW5lcyB0dSBjdWVudGEgZXN0YWJsZWNpZW5kbyB1bmEgY29udHJhc2XDsWE/PC8wPjwxPlBvZHLDoXMgbWFudGVuZXIgdHUgbm9tYnJlIHkgZXN0YWJsZWNlciB1biBhdmF0YXIgcGFyYSB1c2FybG8gZW4gZnV0dXJhcyBsbGFtYWRhczwvMT4iLAogICAgImZlZWRiYWNrX2RvbmUiOiAiPDA+wqFHcmFjaWFzIHBvciB0dXMgY29tZW50YXJpb3MhPC8wPiIsCiAgICAiZmVlZGJhY2tfcHJvbXB0IjogIjwwPk5vcyBlbmNhbnRhcsOtYSBjb25vY2VyIHR1IG9waW5pw7NuIHBhcmEgcXVlIHBvZGFtb3MgbWVqb3JhciB0dSBleHBlcmllbmNpYTwvMD4iLAogICAgImhlYWRsaW5lIjogInt7ZGlzcGxheU5hbWV9fSwgdHUgbGxhbWFkYSBoYSBmaW5hbGl6YWRvLiIsCiAgICAibm90X25vd19idXR0b24iOiAiQWhvcmEgbm8sIHZvbHZlciBhIGxhIHBhbnRhbGxhIGRlIGluaWNpbyIsCiAgICAic3VydmV5X3Byb21wdCI6ICLCv0PDs21vIGhhIGlkbz8iCiAgfSwKICAiY29tbW9uIjogewogICAgImRpc3BsYXlfbmFtZSI6ICJOb21icmUgYSBtb3N0cmFyIiwKICAgICJob21lIjogIkluaWNpbyIsCiAgICAibG9hZGluZyI6ICJDYXJnYW5kb+KApiIsCiAgICAicGFzc3dvcmQiOiAiQ29udHJhc2XDsWEiLAogICAgInByb2ZpbGUiOiAiUGVyZmlsIiwKICAgICJzZXR0aW5ncyI6ICJBanVzdGVzIiwKICAgICJ1c2VybmFtZSI6ICJOb21icmUgZGUgdXN1YXJpbyIKICB9LAogICJoZWFkZXJfbGFiZWwiOiAiSW5pY2lvIGRlIEVsZW1lbnQgQ2FsbCIsCiAgImpvaW5fZXhpc3RpbmdfY2FsbF9tb2RhbCI6IHsKICAgICJqb2luX2J1dHRvbiI6ICJTaSwgdW5pcnNlIGEgbGEgbGxhbWFkYSIsCiAgICAidGV4dCI6ICJFc3RhIGxsYW1hZGEgeWEgZXhpc3RlLCDCv3RlIGd1c3RhcsOtYSB1bmlydGU/IiwKICAgICJ0aXRsZSI6ICLCv1VuaXJzZSBhIGxsYW1hZGEgZXhpc3RlbnRlPyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogIkZvY28iLAogICJsb2JieSI6IHsKICAgICJqb2luX2J1dHRvbiI6ICJVbmlyc2UgYSBsYSBsbGFtYWRhIgogIH0sCiAgImxvZ2dpbmdfaW4iOiAiSW5pY2lhbmRvIHNlc2nDs27igKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPkNyZWFyIHVuYSBjdWVudGE8LzA+IG8gPDI+QWNjZWRlciBjb21vIGludml0YWRvPC8yPiIsCiAgImxvZ2luX3RpdGxlIjogIkluaWNpYXIgc2VzacOzbiIsCiAgInJhZ2VzaGFrZV9yZXF1ZXN0X21vZGFsIjogewogICAgImJvZHkiOiAiT3RybyB1c3VhcmlvIGVuIGVzdGEgbGxhbWFkYSBlc3TDoSB0ZW5pZW5kbyBwcm9ibGVtYXMuIFBhcmEgZGlhZ25vc3RpY2FyIGVzdG9zIHByb2JsZW1hcyBub3MgZ3VzdGFyw61hIHJlY29waWxhciB1biByZWdpc3RybyBkZSBkZXB1cmFjacOzbi4iLAogICAgInRpdGxlIjogIlBldGljacOzbiBkZSByZWdpc3Ryb3MgZGUgZGVwdXJhY2nDs24iCiAgfSwKICAicmFnZXNoYWtlX3NlbmRfbG9ncyI6ICJFbnZpYXIgcmVnaXN0cm9zIGRlIGRlcHVyYWNpw7NuIiwKICAicmFnZXNoYWtlX3NlbmRpbmciOiAiRW52aWFuZG/igKYiLAogICJyYWdlc2hha2Vfc2VuZGluZ19sb2dzIjogIkVudmlhbmRvIHJlZ2lzdHJvcyBkZSBkZXB1cmFjacOzbuKApiIsCiAgInJlY2FwdGNoYV9kaXNtaXNzZWQiOiAiUmVjYXB0Y2hhIGNhbmNlbGFkbyIsCiAgInJlY2FwdGNoYV9ub3RfbG9hZGVkIjogIk5vIHNlIGhhIGNhcmdhZG8gZWwgUmVjYXB0Y2hhIiwKICAicmVnaXN0ZXIiOiB7CiAgICAicGFzc3dvcmRzX211c3RfbWF0Y2giOiAiTGFzIGNvbnRyYXNlw7FhcyBkZWJlbiBjb2luY2lkaXIiLAogICAgInJlZ2lzdGVyaW5nIjogIlJlZ2lzdHJhbmRv4oCmIgogIH0sCiAgInJlZ2lzdGVyX2F1dGhfbGlua3MiOiAiPDA+wr9ZYSB0aWVuZXMgdW5hIGN1ZW50YT88LzA+PDE+PDA+SW5pY2lhciBzZXNpw7NuPC8wPiBvIDwyPkFjY2VkZXIgY29tbyBpbnZpdGFkbzwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICJDb25maXJtYXIgY29udHJhc2XDsWEiLAogICJyZXR1cm5faG9tZV9idXR0b24iOiAiVm9sdmVyIGEgbGEgcGFudGFsbGEgZGUgaW5pY2lvIiwKICAic2NyZWVuc2hhcmVfYnV0dG9uX2xhYmVsIjogIkNvbXBhcnRpciBwYW50YWxsYSIsCiAgInNldHRpbmdzIjogewogICAgImRldmVsb3Blcl90YWJfdGl0bGUiOiAiRGVzYXJyb2xsYWRvciIsCiAgICAiZmVlZGJhY2tfdGFiX2JvZHkiOiAiU2kgdGllbmVzIGFsZ8O6biBwcm9ibGVtYSBvIHNpbXBsZW1lbnRlIHF1aWVyZXMgZGFybm9zIHR1IG9waW5pw7NuLCBwb3IgZmF2b3IgZW52w61hbm9zIHVuYSBicmV2ZSBkZXNjcmlwY2nDs24uIiwKICAgICJmZWVkYmFja190YWJfZGVzY3JpcHRpb25fbGFiZWwiOiAiVHVzIGNvbWVudGFyaW9zIiwKICAgICJmZWVkYmFja190YWJfaDQiOiAiRW52aWFyIGNvbWVudGFyaW9zIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogIkluY2x1aXIgcmVnaXN0cm9zIGRlIGRlcHVyYWNpw7NuIiwKICAgICJmZWVkYmFja190YWJfdGhhbmtfeW91IjogIsKhR3JhY2lhcywgaGVtb3MgcmVjaWJpZG8gdHVzIGNvbWVudGFyaW9zISIsCiAgICAiZmVlZGJhY2tfdGFiX3RpdGxlIjogIkRhbm9zIHR1IG9waW5pw7NuIiwKICAgICJvcHRfaW5fZGVzY3JpcHRpb24iOiAiPDA+PC8wPjwxPjwvMT5QdWVkZXMgcmV0aXJhciB0dSBjb25zZW50aW1pZW50byBkZXNtYXJjYW5kbyBlc3RhIGNhc2lsbGEuIFNpIGVzdMOhcyBlbiB1bmEgbGxhbWFkYSwgZXN0ZSBhanVzdGUgc2UgYXBsaWNhcsOhIGFsIGZpbmFsIGRlIGVzdGEuIgogIH0sCiAgInN0YXJfcmF0aW5nX2lucHV0X2xhYmVsX29uZSI6ICJ7e2NvdW50fX0gZXN0cmVsbGEiLAogICJzdGFyX3JhdGluZ19pbnB1dF9sYWJlbF9vdGhlciI6ICJ7e2NvdW50fX0gZXN0cmVsbGFzIiwKICAic3VibWl0dGluZyI6ICJFbnZpYW5kb+KApiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2JvZHkiOiAiwr9ObyBlc3TDoXMgcmVnaXN0cmFkbyB0b2RhdsOtYT8gPDI+Q3JlYXIgdW5hIGN1ZW50YTwvMj4iLAogICJ1bmF1dGhlbnRpY2F0ZWRfdmlld19sb2dpbl9idXR0b24iOiAiSW5pY2lhciBzZXNpw7NuIGVuIHR1IGN1ZW50YSIsCiAgInZlcnNpb24iOiAiVmVyc2nDs246IHt7dmVyc2lvbn19Igp9Cg==`,ote=``+new URL(`et-app-sWjqunAO.json`,import.meta.url).href,ste=`data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICLZgdmH2LHYs9iqINqp2KfYsdio2LEiCiAgfSwKICAiYWN0aW9uIjogewogICAgImNsb3NlIjogItio2LPYqtmGIiwKICAgICJnbyI6ICLYsdmB2KrZhiIsCiAgICAibm8iOiAi2K7bjNixIiwKICAgICJyZWdpc3RlciI6ICLYq9io2KrigIzZhtin2YUiLAogICAgInJlbW92ZSI6ICLYrdiw2YEiLAogICAgInNpZ25faW4iOiAi2YjYsdmI2K8iLAogICAgInNpZ25fb3V0IjogItiu2LHZiNisIgogIH0sCiAgImNhbGxfZW5kZWRfdmlldyI6IHsKICAgICJjcmVhdGVfYWNjb3VudF9idXR0b24iOiAi2LPYp9iu2Kog2K3Ys9in2Kgg2qnYp9ix2KjYsduMIiwKICAgICJjcmVhdGVfYWNjb3VudF9wcm9tcHQiOiAiPDA+2obYsdinINuM2qkg2LHZhdiyINi52KjZiNixINio2LHYp9uMINit2LPYp9ioINqp2KfYsdio2LHbjCDYrtmI2K8g2KrZhti424zZhSDZhtmF24zigIzaqdmG24zYr9ifPC8wPjwxPti02YXYpyDZhduM4oCM2KrZiNin2YbbjNivINmG2KfZhSDYrtmI2K8g2LHYpyDYrdmB2Lgg2qnZhtuM2K8g2Ygg24zaqSDYotmI2KfYqtin2LEg2KjYsdin24wg2KrZhdin2LPigIzZh9in24wg2KLbjNmG2K/ZhyDYqNiz2KfYstuM2K88LzE+IiwKICAgICJub3Rfbm93X2J1dHRvbiI6ICLYp9mE2KfZhiDZhtmH2Iwg2KjZhyDYtdmB2K3ZhyDYp9i12YTbjCDYqNix2q/Ysdiv24zYryIKICB9LAogICJjb21tb24iOiB7CiAgICAiYXVkaW8iOiAi2LXYr9inIiwKICAgICJhdmF0YXIiOiAi2KLZiNin2KrYp9ixIiwKICAgICJkaXNwbGF5X25hbWUiOiAi2YbYp9mFINmG2YXYp9uM2LTbjCIsCiAgICAiaG9tZSI6ICLYrtin2YbZhyIsCiAgICAibG9hZGluZyI6ICLYqNin2LHar9iy2KfYsduM4oCmIiwKICAgICJwYXNzd29yZCI6ICLYsdmF2LIg2LnYqNmI2LEiLAogICAgInByb2ZpbGUiOiAi2b7YsdmI2YHYp9uM2YQiLAogICAgInNldHRpbmdzIjogItiq2YbYuNuM2YXYp9iqIiwKICAgICJ1c2VybmFtZSI6ICLZhtin2YUg2qnYp9ix2KjYsduMIiwKICAgICJ2aWRlbyI6ICLZiNuM2K/bjNmIIgogIH0sCiAgImhlYWRlcl9sYWJlbCI6ICLYrtin2YbZh9mUINiq2YXYp9izINin2YTZhdmG2KoiLAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAi2KjZhNmH2Iwg2KjZhyDYqtmF2KfYsyDYqNm+24zZiNmG2K/bjNivIiwKICAgICJ0ZXh0IjogItin24zZhiDYqtmF2KfYsyDYp9iyINmC2KjZhCDZiNis2YjYryDYr9in2LHYr9iMINmF24zigIzYrtmI2KfZh9uM2K8g2KjZvtuM2YjZhtiv24zYr9ifIiwKICAgICJ0aXRsZSI6ICLZvtuM2YjYs9iqINio2Ycg2KrZhdin2LPYnyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogItmG2YjYsSDYp9mB2qnZhiIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogItm+24zZiNiz2KrZhiDYqNmHINiq2YXYp9izIgogIH0sCiAgImxvZ2dpbmdfaW4iOiAi2YjYsdmI2K/igKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPtiz2KfYrtiqINit2LPYp9ioINqp2KfYsdio2LHbjDwvMD4gT3IgPDI+2K/Ys9iq2LHYs9uMINio2Ycg2LnZhtmI2KfZhiDZhduM2YfZhdin2YY8LzI+IiwKICAibG9naW5fdGl0bGUiOiAi2YjYsdmI2K8iLAogICJyYWdlc2hha2VfcmVxdWVzdF9tb2RhbCI6IHsKICAgICJib2R5IjogItqp2KfYsdio2LEg2K/bjNqv2LHbjCDYr9ixINin24zZhiDYqtmF2KfYsyDZhdi02qnZhNuMINiv2KfYsdivLiDYqNix2KfbjCDYqti02K7bjNi1INio2YfYqtixINmF2LTaqdmE2Iwg2KjZh9iq2LEg2KfYs9iqINmF2Kcg2YTYp9qvINi524zYqOKAjNuM2KfYqNuMINix2Kcg2KzZhdi54oCM2KLZiNix24wg2qnZhtuM2YUuIiwKICAgICJ0aXRsZSI6ICLYr9ix2K7ZiNin2LPYqiDZhNin2q8g2LnbjNio4oCM24zYp9io24wiCiAgfSwKICAicmFnZXNoYWtlX3NlbmRfbG9ncyI6ICLYp9ix2LPYp9mEINmE2Kfar+KAjNmH2KfbjCDYuduM2KjigIzbjNin2KjbjCIsCiAgInJhZ2VzaGFrZV9zZW5kaW5nIjogItiv2LEg2K3Yp9mEINin2LHYs9in2YTigKYiLAogICJyYWdlc2hha2Vfc2VuZGluZ19sb2dzIjogItiv2LEg2K3Yp9mEINin2LHYs9in2YQg2KjYp9qv4oCM2YfYp9uMINi524zYqOKAjNuM2KfYqNuM4oCmIiwKICAicmVjYXB0Y2hhX2Rpc21pc3NlZCI6ICLYsduM2qnZvtqG2Kcg2LHYryDYtNivIiwKICAicmVjYXB0Y2hhX25vdF9sb2FkZWQiOiAi2qnZvtqG2Kcg2KjYp9ix2q/bjNix24wg2YbYtNivIiwKICAicmVnaXN0ZXIiOiB7CiAgICAicGFzc3dvcmRzX211c3RfbWF0Y2giOiAi2LHZhdiyINi52KjZiNixINio2KfbjNivINmH2YXYrtmI2KfZhtuMINiv2KfYtNiq2Ycg2KjYp9i02K8iLAogICAgInJlZ2lzdGVyaW5nIjogItir2KjYquKAjNmG2KfZheKApiIKICB9LAogICJyZWdpc3Rlcl9hdXRoX2xpbmtzIjogIjwwPtin2LIg2YLYqNmEINit2LPYp9ioINqp2KfYsdio2LHbjCDYr9in2LHbjNiv2J88LzA+PDE+PDA+2YjYsdmI2K88LzA+IE9yIDwyPtio2Ycg2LnZhtmI2KfZhiDbjNqpINmF24zZh9mF2KfZhiDZiNin2LHYryDYtNmI24zYrzwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICLYqtin24zbjNivINix2YXYsti52KjZiNixIiwKICAicmV0dXJuX2hvbWVfYnV0dG9uIjogItio2LHar9i02Kog2KjZhyDYtdmB2K3ZhyDYp9i12YTbjCIsCiAgInNjcmVlbnNoYXJlX2J1dHRvbl9sYWJlbCI6ICLYp9i02KrYsdin2qkg2q/YsNin2LHbjCDYtdmB2K3ZhyDZhtmF2KfbjNi0IiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICLYqtmI2LPYudmHINiv2YfZhtiv2YciLAogICAgImZlZWRiYWNrX3RhYl9oNCI6ICLYqNin2LLYrtmI2LHYryDYp9ix2KfYptmHINiv2YfbjNivIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogIti02KfZhdmEINmE2Kfar+KAjNmH2KfbjCDYuduM2KjigIzbjNin2KjbjCIKICB9LAogICJ1bmF1dGhlbnRpY2F0ZWRfdmlld19ib2R5IjogItmH2YbZiNiyINir2KjYquKAjNmG2KfZhSDZhtqp2LHYr9mH4oCM2KfbjNiv2J8gPDI+2LPYp9iu2Kog2K3Ys9in2Kgg2qnYp9ix2KjYsduMPC8yPiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2xvZ2luX2J1dHRvbiI6ICLYqNmHINit2LPYp9ioINqp2KfYsdio2LHbjCDYrtmI2K8g2YjYp9ix2K8g2LTZiNuM2K8iLAogICJ2ZXJzaW9uIjogItmG2LPYrtmHOiB7e9mG2LPYrtmHfX0iCn0K`,cte=``+new URL(`fi-app-BJflsxzx.json`,import.meta.url).href,lte=``+new URL(`fr-app-BV0pXPBE.json`,import.meta.url).href,ute=``+new URL(`id-app-DmDEpFdR.json`,import.meta.url).href,dte=``+new URL(`it-app-BTzsgy_P.json`,import.meta.url).href,fte=``+new URL(`ja-app-6HGEeBLx.json`,import.meta.url).href,pte=``+new URL(`lv-app-CpuRwzhS.json`,import.meta.url).href,mte=``+new URL(`pl-app-PMg7mZdN.json`,import.meta.url).href,hte=``+new URL(`ro-app-Ca2AQ3G7.json`,import.meta.url).href,gte=``+new URL(`ru-app-DRx4R8Xw.json`,import.meta.url).href,_te=``+new URL(`sk-app-DIJY0DkT.json`,import.meta.url).href,vte=``+new URL(`sv-app-BYt1wvxs.json`,import.meta.url).href,yte=``+new URL(`tr-app-DLAuaEBW.json`,import.meta.url).href,bte=``+new URL(`uk-app-CyQjdEqz.json`,import.meta.url).href,xte=`data:application/json;base64,ewogICJhY3Rpb24iOiB7CiAgICAiY2xvc2UiOiAixJDDs25nIiwKICAgICJubyI6ICJLaMO0bmciLAogICAgInJlZ2lzdGVyIjogIsSQxINuZyBrw70iLAogICAgInNpZ25faW4iOiAixJDEg25nIG5o4bqtcCIsCiAgICAic2lnbl9vdXQiOiAixJDEg25nIHh14bqldCIsCiAgICAic3VibWl0IjogIkfhu61pIgogIH0sCiAgImNhbGxfZW5kZWRfdmlldyI6IHsKICAgICJjcmVhdGVfYWNjb3VudF9idXR0b24iOiAiVOG6oW8gdMOgaSBraG/huqNuIiwKICAgICJjcmVhdGVfYWNjb3VudF9wcm9tcHQiOiAiPDA+VOG6oWkgc2FvIGzhuqFpIGtow7RuZyBob8OgbiB0aGnhu4duIGLhurFuZyBjw6FjaCDEkeG6t3QgbeG6rXQga2jhuql1IMSR4buDIGdp4buvIHTDoGkga2hv4bqjbiBj4bunYSBi4bqhbj88LzA+PDE+QuG6oW4gc+G6vSBjw7MgdGjhu4MgZ2nhu68gdMOqbiB2w6AgxJHhurd0IOG6o25oIMSR4bqhaSBkaeG7h24gY2hvIG5o4buvbmcgY3Xhu5ljIGfhu41pIHRp4bq/cCB0aGVvLjwvMT4iLAogICAgImZlZWRiYWNrX2RvbmUiOiAiPDA+Q+G6o20gaMahbiB2w6wgxJHDoyBwaOG6o24gaOG7k2khPC8wPiIsCiAgICAiZmVlZGJhY2tfcHJvbXB0IjogIjwwPkNow7puZyB0w7RpIG114buRbiBuZ2hlIHBo4bqjbiBo4buTaSBj4bunYSBi4bqhbiDEkeG7gyBjw7JuIGPhuqNpIHRoaeG7h24gdHLhuqNpIG5naGnhu4dtIGNobyBi4bqhbi48LzA+IiwKICAgICJoZWFkbGluZSI6ICJ7e2Rpc3BsYXlOYW1lfX0sIGN14buZYyBn4buNaSDEkcOjIGvhur90IHRow7pjLiIKICB9LAogICJjb21tb24iOiB7CiAgICAiYXVkaW8iOiAiw4JtIHRoYW5oIiwKICAgICJhdmF0YXIiOiAi4bqibmggxJHhuqFpIGRp4buHbiIsCiAgICAiZGlzcGxheV9uYW1lIjogIlTDqm4gaGnhu4NuIHRo4buLIiwKICAgICJsb2FkaW5nIjogIsSQYW5nIHThuqNp4oCmIiwKICAgICJwYXNzd29yZCI6ICJN4bqtdCBraOG6qXUiLAogICAgInByb2ZpbGUiOiAiSOG7kyBzxqEiLAogICAgInNldHRpbmdzIjogIkPDoGkgxJHhurd0IiwKICAgICJ1c2VybmFtZSI6ICJUw6puIG5nxrDhu51pIGTDuW5nIiwKICAgICJ2aWRlbyI6ICJUcnV54buBbiBow6xuaCIKICB9LAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAiVsOibmcsIHRoYW0gZ2lhIGN14buZYyBn4buNaSIsCiAgICAidGV4dCI6ICJDdeG7mWMgZ+G7jWkgxJHDoyB04buTbiB04bqhaSwgYuG6oW4gY8OzIG114buRbiB0aGFtIGdpYSBraMO0bmc/IiwKICAgICJ0aXRsZSI6ICJUaGFtIGdpYSBjdeG7mWMgZ+G7jWk/IgogIH0sCiAgImxheW91dF9zcG90bGlnaHRfbGFiZWwiOiAiVGnDqnUgxJFp4buDbSIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogIlRoYW0gZ2lhIGN14buZYyBn4buNaSIKICB9LAogICJsb2dnaW5nX2luIjogIsSQYW5nIMSRxINuZyBuaOG6rXDigKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPlThuqFvIHTDoGkga2hv4bqjbjwvMD4gSGF5IDwyPlRoYW0gZ2lhIGTGsOG7m2kgdMOqbiBraMOhYzwvMj4iLAogICJsb2dpbl90aXRsZSI6ICLEkMSDbmcgbmjhuq1wIiwKICAicmFnZXNoYWtlX3JlcXVlc3RfbW9kYWwiOiB7CiAgICAiYm9keSI6ICJN4buZdCBuZ8aw4budaSBkw7luZyBraMOhYyB0cm9uZyBjdeG7mWMgZ+G7jWkgxJFhbmcgZ+G6t3AgduG6pW4gxJHhu4EuIMSQ4buDIGPDsyB0aOG7gyBjaOG6qW4gxJFvw6FuIHThu5F0IGjGoW4gY2jDum5nIHTDtGkgbXXhu5FuIHRodSB0aOG6rXAgbmjhuq10IGvDvSBn4buhIGzhu5dpLiIsCiAgICAidGl0bGUiOiAiWcOqdSBj4bqndSBuaOG6rXQga8O9IGfhu6EgbOG7l2kiCiAgfSwKICAicmFnZXNoYWtlX3NlbmRpbmciOiAixJBhbmcgZ+G7rWnigKYiLAogICJyZWNhcHRjaGFfbm90X2xvYWRlZCI6ICJDaMawYSB04bqjaSDEkcaw4bujYyBSZWNhcHRjaGEiLAogICJyZWdpc3RlciI6IHsKICAgICJwYXNzd29yZHNfbXVzdF9tYXRjaCI6ICJN4bqtdCBraOG6qXUgcGjhuqNpIGto4bubcCIsCiAgICAicmVnaXN0ZXJpbmciOiAixJBhbmcgxJHEg25nIGvDveKApiIKICB9LAogICJyZWdpc3Rlcl9hdXRoX2xpbmtzIjogIjwwPsSQw6MgY8OzIHTDoGkga2hv4bqjbj88LzA+PDE+PDA+xJDEg25nIG5o4bqtcDwvMD4gSGF5IDwyPlRoYW0gZ2lhIGTGsOG7m2kgdMOqbiBLaMOhY2g8LzI+PC8xPiIsCiAgInJlZ2lzdGVyX2NvbmZpcm1fcGFzc3dvcmRfbGFiZWwiOiAiWMOhYyBuaOG6rW4gbeG6rXQga2jhuql1IiwKICAic2NyZWVuc2hhcmVfYnV0dG9uX2xhYmVsIjogIkNoaWEgc+G6uyBtw6BuIGjDrG5oIiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICJOaMOgIHBow6F0IHRyaeG7g24iLAogICAgImZlZWRiYWNrX3RhYl9kZXNjcmlwdGlvbl9sYWJlbCI6ICJQaOG6o24gaOG7k2kgY+G7p2EgYuG6oW4iLAogICAgImZlZWRiYWNrX3RhYl9oNCI6ICJH4butaSBwaOG6o24gaOG7k2kiLAogICAgImZlZWRiYWNrX3RhYl9zZW5kX2xvZ3NfbGFiZWwiOiAiS8OobSB0aGVvIG5o4bqtdCBrw70gZ+G7oSBs4buXaSIsCiAgICAiZmVlZGJhY2tfdGFiX3RoYW5rX3lvdSI6ICJD4bqjbSDGoW4sIGNow7puZyB0w7RpIMSRw6Mgbmjhuq1uIMSRxrDhu6NjIHBo4bqjbiBo4buTaSEiLAogICAgImZlZWRiYWNrX3RhYl90aXRsZSI6ICJQaOG6o24gaOG7k2kiCiAgfSwKICAic3VibWl0dGluZyI6ICLEkGFuZyBn4butaeKApiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2JvZHkiOiAiQ2jGsGEgxJHEg25nIGvDvT8gPDI+VOG6oW8gdMOgaSBraG/huqNuPC8yPiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2xvZ2luX2J1dHRvbiI6ICLEkMSDbmcgbmjhuq1wIHbDoG8gdMOgaSBraG/huqNuIGPhu6dhIGLhuqFuIiwKICAidmVyc2lvbiI6ICJQaGnDqm4gYuG6o246IHt7dmVyc2lvbn19Igp9Cg==`,Ste=``+new URL(`zh-Hans-app-d-m--oHo.json`,import.meta.url).href,Cte=``+new URL(`zh-Hant-app-Ba7dG_mB.json`,import.meta.url).href,{slice:wte,forEach:Tte}=[];function Ete(e){return Tte.call(wte.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Dte(e){return typeof e==`string`?[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)):!1}var R9=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ote=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:`/`},r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!R9.test(n.domain))throw TypeError(`option domain is invalid`);r+=`; Domain=${n.domain}`}if(n.path){if(!R9.test(n.path))throw TypeError(`option path is invalid`);r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite)switch(typeof n.sameSite==`string`?n.sameSite.toLowerCase():n.sameSite){case!0:r+=`; SameSite=Strict`;break;case`lax`:r+=`; SameSite=Lax`;break;case`strict`:r+=`; SameSite=Strict`;break;case`none`:r+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return n.partitioned&&(r+=`; Partitioned`),r},z9={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:`/`,sameSite:`strict`};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Ote(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},kte={name:`cookie`,lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<`u`)return z9.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&typeof document<`u`&&z9.create(n,e,r,i,a)}},Ate={name:`querystring`,lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<`u`){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(e=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=e.substring(1).split(`&`);for(let e=0;e<r.length;e++){let i=r[e].indexOf(`=`);i>0&&r[e].substring(0,i)===t&&(n=r[e].substring(i+1))}}return n}},jte={name:`hash`,lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<`u`){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(t){let e=i.split(`&`);for(let n=0;n<e.length;n++){let i=e[n].indexOf(`=`);i>0&&e[n].substring(0,i)===t&&(r=e[n].substring(i+1))}}if(r)return r;if(!r&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof n==`number`?n:0]?.replace(`/`,``):void 0}}}return r}},B9=null,V9=()=>{if(B9!==null)return B9;try{if(B9=typeof window<`u`&&window.localStorage!==null,!B9)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{B9=!1}return B9},H9={name:`localStorage`,lookup(e){let{lookupLocalStorage:t}=e;if(t&&V9())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&V9()&&window.localStorage.setItem(n,e)}},U9=null,W9=()=>{if(U9!==null)return U9;try{if(U9=typeof window<`u`&&window.sessionStorage!==null,!U9)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{U9=!1}return U9},Mte={name:`sessionStorage`,lookup(e){let{lookupSessionStorage:t}=e;if(t&&W9())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&W9()&&window.sessionStorage.setItem(n,e)}},Nte={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Pte={name:`htmlTag`,lookup(e){let{htmlTag:t}=e,n,r=t||(typeof document<`u`?document.documentElement:null);return r&&typeof r.getAttribute==`function`&&(n=r.getAttribute(`lang`)),n}},Fte={name:`path`,lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>`u`)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n[typeof t==`number`?t:0]?.replace(`/`,``)}},Ite={name:`subdomain`,lookup(e){let{lookupFromSubdomainIndex:t}=e,n=typeof t==`number`?t+1:1,r=typeof window<`u`&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},G9=!1;try{document.cookie,G9=!0}catch{}var K9=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];G9||K9.splice(1,1);var Lte=()=>({order:K9,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),q9=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Ete(t,this.options||{},Lte()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(kte),this.addDetector(Ate),this.addDetector(H9),this.addDetector(Mte),this.addDetector(Nte),this.addDetector(Pte),this.addDetector(Fte),this.addDetector(Ite),this.addDetector(jte)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>e!=null&&!Dte(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};q9.type=`languageDetector`;var Rte=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldPolyfill=t;function t(){return!Intl.Segmenter}}))();function zte(){return typeof Intl>`u`||!(`DurationFormat`in Intl)}var J9=Object.assign({"../locales/bg/app.json":$ee,"../locales/cs/app.json":ete,"../locales/da/app.json":tte,"../locales/de/app.json":nte,"../locales/el/app.json":rte,"../locales/en/app.json":ite,"../locales/es/app.json":ate,"../locales/et/app.json":ote,"../locales/fa/app.json":ste,"../locales/fi/app.json":cte,"../locales/fr/app.json":lte,"../locales/id/app.json":ute,"../locales/it/app.json":dte,"../locales/ja/app.json":fte,"../locales/lv/app.json":pte,"../locales/pl/app.json":mte,"../locales/ro/app.json":hte,"../locales/ru/app.json":gte,"../locales/sk/app.json":_te,"../locales/sv/app.json":vte,"../locales/tr/app.json":yte,"../locales/uk/app.json":bte,"../locales/vi/app.json":xte,"../locales/zh-Hans/app.json":Ste,"../locales/zh-Hant/app.json":Cte}),Bte=(e,t)=>J9[`../locales/${e}/${t}.json`],Vte=[...new Set(Object.keys(J9).map(e=>{let t=e.match(/\/([^/]+)\/[^/]+\.json$/)?.[1];if(!t)throw Error(`Could not parse locale URL ${e}`);return t}))],Hte={type:`backend`,init(){},read(e,t,n){(async()=>{let n=Bte(e,t);if(!n)throw Error(`Namespace ${t} for locale ${e} not found`);let r=await fetch(n,{credentials:`omit`,headers:{Accept:`application/json`}});if(at(r))throw Error(`Failed to fetch ${n}`);return await r.json()})().then(e=>n(null,e),e=>n(e,null))}},Y9=function(e){return e[e.None=0]=`None`,e[e.Loading=1]=`Loading`,e[e.Loaded=2]=`Loaded`,e}(Y9||{}),Ute=class{constructor(){this.config=Y9.None,this.sentry=Y9.None}allDepsAreLoaded(){return!Object.values(this).some(e=>e!==Y9.Loaded)}},X9=class t{constructor(){this.isInitialized=!1,this.loadStates=new Ute}static isInitialized(){return!!t.internalInstance?.isInitialized}static async initBeforeReact(){bt();let t=[];(0,Rte.shouldPolyfill)()&&t.push(o(()=>import(`./polyfill-force-CL7owmpV.js`).then(t=>e(t.default,1)),__vite__mapDeps([0,1,2]),import.meta.url)),zte()&&t.push(o(()=>import(`./polyfill-force-BjJnj5Za.js`),__vite__mapDeps([3,1]),import.meta.url)),await Promise.all(t);let n=new q9;n.addDetector({name:`urlFragment`,lookup:()=>da().lang??void 0}),rN.on(`languageChanged`,e=>{document.documentElement.lang=e}),await rN.use(Hte).use(n).use(xi).init({fallbackLng:`en`,defaultNS:`app`,keySeparator:`.`,nsSeparator:!1,pluralSeparator:`_`,contextSeparator:`|`,supportedLngs:Vte,interpolation:{escapeValue:!1},detection:{order:[`urlFragment`,`navigator`],caches:[]}});let{fonts:r,fontScale:i}=da();i!==null&&document.documentElement.style.setProperty(`--font-scale`,i.toString()),r.length>0&&document.documentElement.style.setProperty(`--font-family`,r.map(e=>`"${e}"`).join(`, `)),document.body.setAttribute(`data-platform`,tn)}static init(){return t?.internalInstance?.initPromise?null:(t.internalInstance=new t,t.internalInstance.initPromise=new Promise(e=>{t.internalInstance?.initStep(e)}),t.internalInstance.initPromise)}static reset(){t.internalInstance=void 0}initStep(e){if(this.loadStates.config===Y9.None&&(this.loadStates.config=Y9.Loading,ze.init().then(()=>{this.loadStates.config=Y9.Loaded,this.initStep(e)},e=>{h.error(`Failed to load config`,e)})),this.loadStates.sentry===Y9.None&&this.loadStates.config===Y9.Loaded){let e,t;e=da().sentryDsn??void 0,t=da().sentryEnvironment??void 0,e&&mT({dsn:e,environment:t,integrations:[QT({useEffect:M.useEffect,useLocation:Pn,useNavigationType:Ti,createRoutesFromChildren:yi,matchRoutes:wr})],tracesSampleRate:1}),this.loadStates.sentry=Y9.Loaded}this.loadStates.allDepsAreLoaded()&&(e(),this.isInitialized=!0)}},Wte=()=>{let[e,t]=(0,M.useState)(()=>da().theme),n=(0,M.useRef)(document.body.classList.item(0));(0,M.useEffect)(()=>{if(At){let e=e=>{e.preventDefault(),`name`in e.detail.data&&typeof e.detail.data.name==`string`&&t(e.detail.data.name),At.api.transport.reply(e.detail,{})};return At.lazyActions.on(Gr.ThemeChange,e),()=>{At.lazyActions.off(Gr.ThemeChange,e)}}},[]),(0,M.useLayoutEffect)(()=>{let t=e?.includes(`light`)?`light`:`dark`,r=e?.includes(`high-contrast`)?`-hc`:``,i=`cpd-theme-`+t+r;i!==n.current&&(document.body.classList.remove(`cpd-theme-light`,`cpd-theme-dark`,`cpd-theme-light-hc`,`cpd-theme-dark-hc`),document.body.classList.add(i),n.current=i),document.body.classList.remove(`no-theme`)},[n,e])},Z9=$T(ji),Gte=({children:e})=>{let{pathname:t}=Pn();return(0,M.useEffect)(()=>{let e=``;![`/login`,`/register`].includes(t)&&!At&&(e=`var(--background-gradient)`),document.getElementsByTagName(`body`)[0].style.backgroundImage=e},[t]),(0,W.jsx)(W.Fragment,{children:e})},Kte=({children:e})=>(Wte(),e),qte=({vm:e})=>{let[t,n]=(0,M.useState)(!1);(0,M.useEffect)(()=>{X9.init()?.then(async()=>{t||(n(!0),await At?.api.sendContentLoaded())}).catch(h.error)});let{header:r}=(0,M.useMemo)(da,[]),i=t?(0,W.jsx)(Xn,{children:(0,W.jsx)(QL,{value:e.mediaDevices,children:(0,W.jsx)(wY,{children:(0,W.jsx)(wT,{fallback:e=>(0,W.jsx)(vn,{error:e,widget:At}),children:(0,W.jsxs)(Zr,{children:[(0,W.jsx)(Z9,{path:`/`,element:(0,W.jsx)(HX,{})}),(0,W.jsx)(Z9,{path:`/login`,element:(0,W.jsx)(KX,{})}),(0,W.jsx)(Z9,{path:`/register`,element:(0,W.jsx)(qX,{})}),(0,W.jsx)(Z9,{path:`*`,element:(0,W.jsx)(Qee,{})})]})})})})}):(0,W.jsx)(Cn,{});return(0,W.jsx)(ie,{children:(0,W.jsx)(Gte,{children:(0,W.jsx)(Kte,{children:(0,W.jsx)(un,{children:(0,W.jsx)(M.Suspense,{fallback:null,children:r===Bt.AppBar?(0,W.jsx)($7,{children:i}):i})})})})})},Jte=class{constructor(e){this.scope=e,this.mediaDevices=new WL(this.scope)}};window.setLKLogLevel=eu,be().catch(e=>{h.error(`Failed to initialize rageshake`,e)}),eu(`info`),tu((e,n,r)=>{t.mx_rage_logger.log(e,`livekit`,n,r)}),h.info(`Element Call embedded-v0.19.2-rc.1`);var Q9=(0,Ea.createRoot)(document.getElementById(`root`)),$9=null;if(window.isSecureContext?navigator.mediaDevices||($9=Error(`Your browser does not support WebRTC.`)):$9=Error(`This app cannot run in an insecure context. To fix this, access the app via a local loopback address, or serve it over HTTPS.
217
+ Reach out to your homeserver admin to ask them about supporting the \`/summary\` endpoint (im.nheko.summary):`,e)}if(t===void 0||t.join_rule===ne.Public)r=await e.joinRoom(i,{viaServers:n});else if(t.join_rule===ne.Knock){let e=t,i=()=>{},o=new Promise(t=>{e.membership===c.Knock?t():i=t});a({kind:`canKnock`,roomSummary:e,knock:i}),await o,r=await s(t.room_id,n,()=>a({kind:`waitForInvite`,roomSummary:e}))}else throw Error(`Room ${t.room_id} is not joinable. This likely means, that the conference owner has changed the room settings to private.`)}}return h.info(`Joined ${t}, waiting room to be ready for group calls`),await e.waitUntilRoomReadyForGroupCalls(r.roomId),h.info(`${t}, is ready for group calls`),r};r.kind===`loading`&&(h.log(`Start loading group call`),(async()=>{e.getSyncState()!==d.Syncing&&(h.debug(`useLoadGroupCall: waiting for client to start syncing...`),await new Promise(t=>{let n=()=>{if(e.getSyncState()===d.Syncing)return e.off(ee.Sync,n),t()};e.on(ee.Sync,n)}),h.debug(`useLoadGroupCall: client is now syncing.`))})().then(async()=>{let n=await m();return o.current=n,h.debug(`Fetched / joined room ${t}`),e.matrixRTC.getRoomSession(n)}).then(e=>a({kind:`loaded`,rtcSession:e})).then(async()=>{await new Promise((t,n)=>{e.on(l.MyMembership,(e,t)=>{t===c.Leave&&n(p()),t===c.Ban&&n(u())})})}).catch(e=>a({kind:`failed`,error:e})))},[u,e,f,p,t,r,s,n]),r},I9=async e=>Promise.resolve(e),L9=class{setHandler(e){if(this.handler$.value!==I9)throw Error(`Multiple mute state handlers are not supported`);this.handler$.next(e)}unsetHandler(){this.handler$.next(I9)}constructor(e,t,n,r){this.scope=e,this.device=t,this.enabledByDefault=n,this.forceMute$=r,this.handler$=new Ge(I9),this.canControlDevices$=yF([this.device.available$,this.forceMute$]).pipe(G(([e,t])=>!t&&e.size>0)),this.data$=this.scope.behavior(this.canControlDevices$.pipe(eI(),G(e=>{if(h.info(`MuteState: canControlDevices: ${e}, enabled by default: ${this.enabledByDefault}`),!e)return h.info(`MuteState: devices connected: ${e}, disabling`),this.handler$.value(!1).catch(e=>{h.error(`MuteState-disable: handler error`,e)}),{enabled$:aF(!1),set:null,toggle:null};let t=this.enabledByDefault,n=new ot,r=new ot,i=RF(n,r.pipe(G(()=>!t)));return{set:e=>n.next(e),toggle:()=>r.next(),enabled$:new It(e=>{e.next(t);let n=this.enabledByDefault,r=!1,a=async()=>{if(t===n)r=!1;else{let i=t;t=await sF(this.handler$.pipe(K(async e=>e(n)))),t===i?r=!1:(e.next(t),r=!0,a().catch(e=>{h.error(`MuteState: handler error`,e)}))}},o=i.subscribe(e=>{n=e,r===!1&&(r=!0,a().catch(e=>{h.error(`MuteState: handler error`,e)}))});return()=>o.unsubscribe()})}}))),this.enabled$=this.scope.behavior(this.data$.pipe(K(({enabled$:e})=>e))),this.setEnabled$=this.scope.behavior(this.data$.pipe(G(({set:e})=>e))),this.toggle$=this.scope.behavior(this.data$.pipe(G(({toggle:e})=>e)))}},Xee=class{constructor(e,t,n){if(this.scope=e,this.mediaDevices=t,this.initialMuteState=n,this.isEarpiece$=yF([this.mediaDevices.audioOutput.available$,this.mediaDevices.audioOutput.selected$]).pipe(G(([e,t])=>{if(!t?.id)return!1;let n=e.get(t.id);return h.info(`MuteStates: selected audio output device:`,n),n?.type===`earpiece`})),this.audio=new L9(this.scope,this.mediaDevices.audioInput,this.initialMuteState.audioEnabled,ML(!1)),this.video=new L9(this.scope,this.mediaDevices.videoInput,this.initialMuteState.videoEnabled,this.isEarpiece$),At!==null){let e=yF([this.audio.enabled$,this.video.enabled$],(e,t)=>({audio_enabled:e,video_enabled:t}));e.pipe(this.scope.bind()).subscribe(e=>{At.api.transport.send(ht.DeviceMute,e).catch(e=>h.warn(`Could not send DeviceMute action to widget`,e))}),jF(At.lazyActions,ht.DeviceMute).pipe(bI(e,this.audio.setEnabled$,this.video.setEnabled$),this.scope.bind()).subscribe(([e,t,n,r])=>{let i={...t};e.detail.data.audio_enabled!=null&&typeof e.detail.data.audio_enabled==`boolean`&&n!==null&&(i.audio_enabled=e.detail.data.audio_enabled,n(i.audio_enabled)),e.detail.data.video_enabled!=null&&typeof e.detail.data.video_enabled==`boolean`&&r!==null&&(i.video_enabled=e.detail.data.video_enabled,r(i.video_enabled)),At.api.transport.reply(e.detail,i)})}}};function Zee(e,t,n){return h.debug(`calculateInitialMuteState: skipLobby=${e}, callIntent=${t} isWidgetMode=${n}`),e&&!n?{audioEnabled:!1,videoEnabled:!1}:{audioEnabled:!0,videoEnabled:t!=`audio`}}var Qee=()=>{let e=sn(),{confineToRoom:t,preload:n,header:r,displayName:i,skipLobby:a}=e,{t:o}=Ni(),{roomAlias:s,roomId:c,viaServers:l}=he(),u=c??s;u||h.error(`No room specified`);let{registerPasswordlessUser:d}=YX(),[f,p]=(0,M.useState)(!1),{loading:m,authenticated:g,client:_,error:v,passwordlessUser:y}=ci(),{avatarUrl:b,displayName:x}=xI(_),S=Yee(_,u,l),[C,w]=(0,M.useState)(!1),T=$L(),[E,ee]=(0,M.useState)(null);(0,M.useEffect)(()=>{let t=new pL;return ee(new Xee(t,T,Zee(e.skipLobby,e.callIntent,At!==null))),()=>t.end()},[T,e]),(0,M.useEffect)(()=>{!m&&!g&&i&&!At&&(p(!0),d(i).catch(e=>{h.error(`Failed to register passwordless user`,e)}).finally(()=>{p(!1)}))},[m,g,i,p,d]);let[te,ne]=gt();(0,M.useEffect)(()=>{te===null&&ne&&ne(!0)},[te,ne]);let re=(0,M.useRef)(!1);return(0,M.useEffect)(()=>{S.kind===`loaded`&&re.current&&h.log(`Play join sound 'Not yet implemented'`)},[S.kind]),m||f?(0,W.jsx)(Cn,{}):v?(0,W.jsx)(vn,{widget:At,error:v}):_?u?(()=>{switch(S.kind){case`loaded`:return E&&(0,W.jsx)(Kee,{widget:At,client:_,rtcSession:S.rtcSession,joined:C,setJoined:w,isPasswordlessUser:y,confineToRoom:t,preload:n,skipLobby:a||re.current,muteStates:E});case`waitForInvite`:case`canKnock`:{re.current=re.current||S.kind===`waitForInvite`;let e=S.kind===`canKnock`?S.knock:null,n=S.kind===`canKnock`?o(`lobby.ask_to_join`):(0,W.jsxs)(W.Fragment,{children:[o(`lobby.waiting_for_invite`),(0,W.jsx)(vj,{})]});return E&&(0,W.jsx)(e1,{client:_,matrixInfo:{userId:_.getUserId()??``,displayName:x??``,avatarUrl:b??``,roomAlias:null,roomId:S.roomSummary.room_id,roomName:S.roomSummary.name??``,roomAvatar:S.roomSummary.avatar_url??null,e2eeSystem:{kind:S.roomSummary[`im.nheko.summary.encryption`]?fn.PER_PARTICIPANT:fn.NONE}},onEnter:()=>e?.(),enterLabel:n,waitingForInvite:S.kind===`waitForInvite`,confineToRoom:t,hideHeader:r!==`standard`,participantCount:null,muteStates:E,onShareClick:null})}case`loading`:return(0,W.jsx)(pn,{children:(0,W.jsx)(`h1`,{children:o(`common.loading`)})});case`failed`:return re.current=!1,S.error.errcode===`M_NOT_FOUND`?(0,W.jsx)(pn,{children:(0,W.jsx)(jt,{Icon:xee,title:o(`error.call_not_found`),widget:At,children:(0,W.jsx)(ON,{i18nKey:`error.call_not_found_description`,children:(0,W.jsxs)(`p`,{children:[`That link doesn't appear to belong to any existing call. Check that you have the right link, or`,` `,(0,W.jsx)(tr,{to:`/`,children:`create a new one`}),`.`]})})})}):S.error instanceof F9?(0,W.jsx)(pn,{children:(0,W.jsxs)(jt,{Icon:S.error.icon,title:S.error.message,widget:At,children:[(0,W.jsx)(`p`,{children:S.error.messageBody}),S.error.reason&&(0,W.jsx)(`p`,{children:o(`group_call_loader.reason`,{reason:S.error.reason})})]})}):(0,W.jsx)(vn,{widget:At,error:S.error});default:return(0,W.jsx)(W.Fragment,{children:` `})}})():(0,W.jsx)(HX,{}):(0,W.jsx)(XX,{})},$ee=`data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICLQn9C+0YLRgNC10LHQuNGC0LXQu9GB0LrQviDQvNC10L3RjiIKICB9LAogICJhY3Rpb24iOiB7CiAgICAiY2xvc2UiOiAi0JfQsNGC0LLQvtGA0LgiLAogICAgImNvcHlfbGluayI6ICLQmtC+0L/QuNGA0LDQvdC1INC90LAg0LLRgNGK0LfQutCw0YLQsCIsCiAgICAiZ28iOiAi0J3QsNC/0YDQtdC0IiwKICAgICJpbnZpdGUiOiAi0J/QvtC60LDQvdCwIiwKICAgICJubyI6ICLQndC1IiwKICAgICJyZWdpc3RlciI6ICLQoNC10LPQuNGB0YLRgNCw0YbQuNGPIiwKICAgICJyZW1vdmUiOiAi0J/RgNC10LzQsNGF0L3QuCIsCiAgICAic2lnbl9pbiI6ICLQktC70LXQtyIsCiAgICAic2lnbl9vdXQiOiAi0JjQt9C70LXQtyIKICB9LAogICJjYWxsX2VuZGVkX3ZpZXciOiB7CiAgICAiY3JlYXRlX2FjY291bnRfYnV0dG9uIjogItCh0YrQt9C00LDQuSDQsNC60LDRg9C90YIiLAogICAgImNyZWF0ZV9hY2NvdW50X3Byb21wdCI6ICI8MD7Ql9Cw0YnQviDQvdC1INC90LDRgdGC0YDQvtC50YLQtSDQv9Cw0YDQvtC70LAg0LfQsCDQtNCwINC30LDQv9Cw0LfQuNGC0LUg0LDQutCw0YPQvdGC0LAg0YHQuD88LzA+PDE+0KnQtSDQvNC+0LbQtdGC0LUg0LTQsCDQt9Cw0L/QsNC30LjRgtC1INC40LzQtdGC0L4g0Lgg0LDQstCw0YLQsNGA0LAg0YHQuCDQt9CwINCx0YrQtNC10YnQuCDRgNCw0LfQs9C+0LLQvtGA0Lg8LzE+IiwKICAgICJub3Rfbm93X2J1dHRvbiI6ICLQndC1INGB0LXQs9CwLCDQstGK0YDQvdC4INGB0LUg0L3QsCDQvdCw0YfQsNC70L3QuNGPINC10LrRgNCw0L0iCiAgfSwKICAiY29tbW9uIjogewogICAgImF1ZGlvIjogItCX0LLRg9C6IiwKICAgICJhdmF0YXIiOiAi0JDQstCw0YLQsNGAIiwKICAgICJkaXNwbGF5X25hbWUiOiAi0JjQvNC1L9C/0YHQtdCy0LTQvtC90LjQvCIsCiAgICAiaG9tZSI6ICLQndCw0YfQsNC70L4iLAogICAgImxvYWRpbmciOiAi0JfQsNGA0LXQttC00LDQvdC14oCmIiwKICAgICJwYXNzd29yZCI6ICLQn9Cw0YDQvtC70LAiLAogICAgInByb2ZpbGUiOiAi0J/RgNC+0YTQuNC7IiwKICAgICJzZXR0aW5ncyI6ICLQndCw0YHRgtGA0L7QudC60LgiLAogICAgInVzZXJuYW1lIjogItCf0L7RgtGA0LXQsdC40YLQtdC70YHQutC+INC40LzQtSIsCiAgICAidmlkZW8iOiAi0JLQuNC00LXQviIKICB9LAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAi0JTQsCwg0L/RgNC40YHRitC10LTQuNC90Lgg0YHQtSIsCiAgICAidGV4dCI6ICLQotC+0LfQuCDRgNCw0LfQs9C+0LLQvtGAINCy0LXRh9C1INGB0YrRidC10YHRgtCy0YPQstCwLCDQuNGB0LrQsNGC0LUg0LvQuCDQtNCwINGB0LUg0L/RgNC40YHRitC10LTQuNC90LjRgtC1PyIsCiAgICAidGl0bGUiOiAi0J/RgNC40YHRitC10LTQuNC90Y/QstCw0L3QtSDQutGK0Lwg0YHRitGJ0LXRgdGC0LLRg9Cy0LDRiSDRgNCw0LfQs9C+0LLQvtGAPyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogItCf0YDQvtC20LXQutGC0L7RgCIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogItCS0LvQtdC3INCyINGA0LDQt9Cz0L7QstC+0YDQsCIKICB9LAogICJsb2dnaW5nX2luIjogItCS0LvQuNC30LDQvdC14oCmIiwKICAibG9naW5fYXV0aF9saW5rcyI6ICI8MD7QodGK0LfQtNCw0LnRgtC1INCw0LrQsNGD0L3RgjwvMD4g0LjQu9C4IDwyPtCS0LvQtdC30YLQtSDQutCw0YLQviDQs9C+0YHRgjwvMj4iLAogICJsb2dpbl90aXRsZSI6ICLQktC70LXQtyIsCiAgInJhZ2VzaGFrZV9yZXF1ZXN0X21vZGFsIjogewogICAgImJvZHkiOiAi0JTRgNGD0LMg0L/QvtGC0YDQtdCx0LjRgtC10Lsg0LIg0YLQvtC30Lgg0YDQsNC30LPQvtCy0L7RgCDQuNC80LAg0L/RgNC+0LHQu9C10LwuINCX0LAg0LTQsCDQtNC40LDQs9C90L7RgdGC0LjRhtC40YDQsNC80LUg0YLQvtC30Lgg0L/RgNC+0LHQu9C10Lwg0L/Qvi3QtNC+0LHRgNC1INC90Lgg0YHQtSDQuNGB0LrQsCDQtNCwINGB0YrQsdC10YDQtdC8IGRlYnVnINC70L7Qs9C+0LLQtS4iLAogICAgInRpdGxlIjogItCX0LDRj9Cy0LrQsCDQt9CwIGRlYnVnINC70L7Qs9C+0LLQtSIKICB9LAogICJyYWdlc2hha2Vfc2VuZF9sb2dzIjogItCY0LfQv9GA0LDRgtC10YLQtSBkZWJ1ZyDQu9C+0LPQvtCy0LUiLAogICJyYWdlc2hha2Vfc2VuZGluZyI6ICLQmNC30L/RgNCw0YnQsNC90LXigKYiLAogICJyZWNhcHRjaGFfZGlzbWlzc2VkIjogIlJlY2FwdGNoYSDQvtGC0YXQstGK0YDQu9C10L3QsCIsCiAgInJlY2FwdGNoYV9ub3RfbG9hZGVkIjogIlJlY2FwdGNoYSDQvdC1INC1INC30LDRgNC10LTQtdC90LAiLAogICJyZWdpc3RlciI6IHsKICAgICJwYXNzd29yZHNfbXVzdF9tYXRjaCI6ICLQn9Cw0YDQvtC70LjRgtC1INC90LUg0YHRitCy0L/QsNC00LDRgiIsCiAgICAicmVnaXN0ZXJpbmciOiAi0KDQtdCz0LjRgdGC0YDQuNGA0LDQvdC14oCmIgogIH0sCiAgInJlZ2lzdGVyX2F1dGhfbGlua3MiOiAiPDA+0JLQtdGH0LUg0LjQvNCw0YLQtSDQsNC60LDRg9C90YI/PC8wPjwxPjwwPtCS0LvQtdC30YLQtSDRgSDQvdC10LPQvjwvMD4g0LjQu9C4IDwyPtCS0LvQtdC30YLQtSDQutCw0YLQviDQs9C+0YHRgjwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICLQn9C+0YLQstGK0YDQtNC4INC/0LDRgNC+0LvQsNGC0LAiLAogICJyZXR1cm5faG9tZV9idXR0b24iOiAi0JLRgNGK0YnQsNC90LUg0L3QsCDQvdCw0YfQsNC70L3QuNGPINC10LrRgNCw0L0iLAogICJzY3JlZW5zaGFyZV9idXR0b25fbGFiZWwiOiAi0KHQv9C+0LTQtdC70Lgg0LXQutGA0LDQvdCwIiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICLQoNCw0LfRgNCw0LHQvtGC0YfQuNC6IiwKICAgICJmZWVkYmFja190YWJfaDQiOiAi0JjQt9C/0YDQsNGC0Lgg0L7QsdGA0LDRgtC90LAg0LLRgNGK0LfQutCwIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogItCS0LrQu9GO0YfQuCBkZWJ1ZyDQu9C+0LPQvtCy0LUiCiAgfSwKICAidW5hdXRoZW50aWNhdGVkX3ZpZXdfYm9keSI6ICLQktGB0LUg0L7RidC1INC90LUg0YHRgtC1INGA0LXQs9C40YHRgtGA0LjRgNCw0L3QuD8gPDI+0KHRitC30LTQsNC50YLQtSDQsNC60LDRg9C90YI8LzI+IiwKICAidW5hdXRoZW50aWNhdGVkX3ZpZXdfbG9naW5fYnV0dG9uIjogItCS0LvQtdC30YLQtSDQsiDQsNC60LDRg9C90YLQsCDRgdC4IiwKICAidmVyc2lvbiI6ICLQktC10YDRgdC40Y86IHt7dmVyc2lvbn19Igp9Cg==`,ete=``+new URL(`cs-app-B7hInJc5.json`,import.meta.url).href,tte=``+new URL(`da-app-DAnspZzv.json`,import.meta.url).href,nte=``+new URL(`de-app-BfO8Ru-l.json`,import.meta.url).href,rte=``+new URL(`el-app-D5PqbGwj.json`,import.meta.url).href,ite=``+new URL(`en-app-D7n_5gIv.json`,import.meta.url).href,ate=`data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICJNZW7DuiBkZSB1c3VhcmlvIgogIH0sCiAgImFjdGlvbiI6IHsKICAgICJjbG9zZSI6ICJDZXJyYXIiLAogICAgImNvcHlfbGluayI6ICJDb3BpYXIgdsOtbmN1bG8iLAogICAgImdvIjogIkNvbWVuemFyIiwKICAgICJpbnZpdGUiOiAiSW52aXRhciIsCiAgICAibm8iOiAiTm8iLAogICAgInJlZ2lzdGVyIjogIlJlZ2lzdHJhcnNlIiwKICAgICJyZW1vdmUiOiAiRWxpbWluYXIiLAogICAgInNpZ25faW4iOiAiSW5pY2lhciBzZXNpw7NuIiwKICAgICJzaWduX291dCI6ICJDZXJyYXIgc2VzacOzbiIsCiAgICAic3VibWl0IjogIkVudmlhciIKICB9LAogICJhbmFseXRpY3Nfbm90aWNlIjogIkFsIHBhcnRpY2lwYXIgZW4gZXN0YSBiZXRhLCBjb25zaWVudGVzIGEgbGEgcmVjb2dpZGEgZGUgZGF0b3MgYW7Ds25pbW9zLCBsb3MgY3VhbGVzIHVzYXJlbW9zIHBhcmEgbWVqb3JhciBlbCBwcm9kdWN0by4gUHVlZGVzIGVuY29udHJhciBtw6FzIGluZm9ybWFjacOzbiBzb2JyZSBxdWUgZGF0b3MgcmVjb2dlbW9zIGVuIG51ZXN0cmEgPDI+UG9sw610aWNhIGRlIHByaXZhY2lkYWQ8LzI+IHkgZW4gbnVlc3RyYSA8NT5Qb2zDrXRpY2Egc29icmUgQ29va2llczwvNT4uIiwKICAiY2FsbF9lbmRlZF92aWV3IjogewogICAgImNyZWF0ZV9hY2NvdW50X2J1dHRvbiI6ICJDcmVhciBjdWVudGEiLAogICAgImNyZWF0ZV9hY2NvdW50X3Byb21wdCI6ICI8MD7Cv1BvciBxdcOpIG5vIG1hbnRpZW5lcyB0dSBjdWVudGEgZXN0YWJsZWNpZW5kbyB1bmEgY29udHJhc2XDsWE/PC8wPjwxPlBvZHLDoXMgbWFudGVuZXIgdHUgbm9tYnJlIHkgZXN0YWJsZWNlciB1biBhdmF0YXIgcGFyYSB1c2FybG8gZW4gZnV0dXJhcyBsbGFtYWRhczwvMT4iLAogICAgImZlZWRiYWNrX2RvbmUiOiAiPDA+wqFHcmFjaWFzIHBvciB0dXMgY29tZW50YXJpb3MhPC8wPiIsCiAgICAiZmVlZGJhY2tfcHJvbXB0IjogIjwwPk5vcyBlbmNhbnRhcsOtYSBjb25vY2VyIHR1IG9waW5pw7NuIHBhcmEgcXVlIHBvZGFtb3MgbWVqb3JhciB0dSBleHBlcmllbmNpYTwvMD4iLAogICAgImhlYWRsaW5lIjogInt7ZGlzcGxheU5hbWV9fSwgdHUgbGxhbWFkYSBoYSBmaW5hbGl6YWRvLiIsCiAgICAibm90X25vd19idXR0b24iOiAiQWhvcmEgbm8sIHZvbHZlciBhIGxhIHBhbnRhbGxhIGRlIGluaWNpbyIsCiAgICAic3VydmV5X3Byb21wdCI6ICLCv0PDs21vIGhhIGlkbz8iCiAgfSwKICAiY29tbW9uIjogewogICAgImRpc3BsYXlfbmFtZSI6ICJOb21icmUgYSBtb3N0cmFyIiwKICAgICJob21lIjogIkluaWNpbyIsCiAgICAibG9hZGluZyI6ICJDYXJnYW5kb+KApiIsCiAgICAicGFzc3dvcmQiOiAiQ29udHJhc2XDsWEiLAogICAgInByb2ZpbGUiOiAiUGVyZmlsIiwKICAgICJzZXR0aW5ncyI6ICJBanVzdGVzIiwKICAgICJ1c2VybmFtZSI6ICJOb21icmUgZGUgdXN1YXJpbyIKICB9LAogICJoZWFkZXJfbGFiZWwiOiAiSW5pY2lvIGRlIEVsZW1lbnQgQ2FsbCIsCiAgImpvaW5fZXhpc3RpbmdfY2FsbF9tb2RhbCI6IHsKICAgICJqb2luX2J1dHRvbiI6ICJTaSwgdW5pcnNlIGEgbGEgbGxhbWFkYSIsCiAgICAidGV4dCI6ICJFc3RhIGxsYW1hZGEgeWEgZXhpc3RlLCDCv3RlIGd1c3RhcsOtYSB1bmlydGU/IiwKICAgICJ0aXRsZSI6ICLCv1VuaXJzZSBhIGxsYW1hZGEgZXhpc3RlbnRlPyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogIkZvY28iLAogICJsb2JieSI6IHsKICAgICJqb2luX2J1dHRvbiI6ICJVbmlyc2UgYSBsYSBsbGFtYWRhIgogIH0sCiAgImxvZ2dpbmdfaW4iOiAiSW5pY2lhbmRvIHNlc2nDs27igKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPkNyZWFyIHVuYSBjdWVudGE8LzA+IG8gPDI+QWNjZWRlciBjb21vIGludml0YWRvPC8yPiIsCiAgImxvZ2luX3RpdGxlIjogIkluaWNpYXIgc2VzacOzbiIsCiAgInJhZ2VzaGFrZV9yZXF1ZXN0X21vZGFsIjogewogICAgImJvZHkiOiAiT3RybyB1c3VhcmlvIGVuIGVzdGEgbGxhbWFkYSBlc3TDoSB0ZW5pZW5kbyBwcm9ibGVtYXMuIFBhcmEgZGlhZ25vc3RpY2FyIGVzdG9zIHByb2JsZW1hcyBub3MgZ3VzdGFyw61hIHJlY29waWxhciB1biByZWdpc3RybyBkZSBkZXB1cmFjacOzbi4iLAogICAgInRpdGxlIjogIlBldGljacOzbiBkZSByZWdpc3Ryb3MgZGUgZGVwdXJhY2nDs24iCiAgfSwKICAicmFnZXNoYWtlX3NlbmRfbG9ncyI6ICJFbnZpYXIgcmVnaXN0cm9zIGRlIGRlcHVyYWNpw7NuIiwKICAicmFnZXNoYWtlX3NlbmRpbmciOiAiRW52aWFuZG/igKYiLAogICJyYWdlc2hha2Vfc2VuZGluZ19sb2dzIjogIkVudmlhbmRvIHJlZ2lzdHJvcyBkZSBkZXB1cmFjacOzbuKApiIsCiAgInJlY2FwdGNoYV9kaXNtaXNzZWQiOiAiUmVjYXB0Y2hhIGNhbmNlbGFkbyIsCiAgInJlY2FwdGNoYV9ub3RfbG9hZGVkIjogIk5vIHNlIGhhIGNhcmdhZG8gZWwgUmVjYXB0Y2hhIiwKICAicmVnaXN0ZXIiOiB7CiAgICAicGFzc3dvcmRzX211c3RfbWF0Y2giOiAiTGFzIGNvbnRyYXNlw7FhcyBkZWJlbiBjb2luY2lkaXIiLAogICAgInJlZ2lzdGVyaW5nIjogIlJlZ2lzdHJhbmRv4oCmIgogIH0sCiAgInJlZ2lzdGVyX2F1dGhfbGlua3MiOiAiPDA+wr9ZYSB0aWVuZXMgdW5hIGN1ZW50YT88LzA+PDE+PDA+SW5pY2lhciBzZXNpw7NuPC8wPiBvIDwyPkFjY2VkZXIgY29tbyBpbnZpdGFkbzwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICJDb25maXJtYXIgY29udHJhc2XDsWEiLAogICJyZXR1cm5faG9tZV9idXR0b24iOiAiVm9sdmVyIGEgbGEgcGFudGFsbGEgZGUgaW5pY2lvIiwKICAic2NyZWVuc2hhcmVfYnV0dG9uX2xhYmVsIjogIkNvbXBhcnRpciBwYW50YWxsYSIsCiAgInNldHRpbmdzIjogewogICAgImRldmVsb3Blcl90YWJfdGl0bGUiOiAiRGVzYXJyb2xsYWRvciIsCiAgICAiZmVlZGJhY2tfdGFiX2JvZHkiOiAiU2kgdGllbmVzIGFsZ8O6biBwcm9ibGVtYSBvIHNpbXBsZW1lbnRlIHF1aWVyZXMgZGFybm9zIHR1IG9waW5pw7NuLCBwb3IgZmF2b3IgZW52w61hbm9zIHVuYSBicmV2ZSBkZXNjcmlwY2nDs24uIiwKICAgICJmZWVkYmFja190YWJfZGVzY3JpcHRpb25fbGFiZWwiOiAiVHVzIGNvbWVudGFyaW9zIiwKICAgICJmZWVkYmFja190YWJfaDQiOiAiRW52aWFyIGNvbWVudGFyaW9zIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogIkluY2x1aXIgcmVnaXN0cm9zIGRlIGRlcHVyYWNpw7NuIiwKICAgICJmZWVkYmFja190YWJfdGhhbmtfeW91IjogIsKhR3JhY2lhcywgaGVtb3MgcmVjaWJpZG8gdHVzIGNvbWVudGFyaW9zISIsCiAgICAiZmVlZGJhY2tfdGFiX3RpdGxlIjogIkRhbm9zIHR1IG9waW5pw7NuIiwKICAgICJvcHRfaW5fZGVzY3JpcHRpb24iOiAiPDA+PC8wPjwxPjwvMT5QdWVkZXMgcmV0aXJhciB0dSBjb25zZW50aW1pZW50byBkZXNtYXJjYW5kbyBlc3RhIGNhc2lsbGEuIFNpIGVzdMOhcyBlbiB1bmEgbGxhbWFkYSwgZXN0ZSBhanVzdGUgc2UgYXBsaWNhcsOhIGFsIGZpbmFsIGRlIGVzdGEuIgogIH0sCiAgInN0YXJfcmF0aW5nX2lucHV0X2xhYmVsX29uZSI6ICJ7e2NvdW50fX0gZXN0cmVsbGEiLAogICJzdGFyX3JhdGluZ19pbnB1dF9sYWJlbF9vdGhlciI6ICJ7e2NvdW50fX0gZXN0cmVsbGFzIiwKICAic3VibWl0dGluZyI6ICJFbnZpYW5kb+KApiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2JvZHkiOiAiwr9ObyBlc3TDoXMgcmVnaXN0cmFkbyB0b2RhdsOtYT8gPDI+Q3JlYXIgdW5hIGN1ZW50YTwvMj4iLAogICJ1bmF1dGhlbnRpY2F0ZWRfdmlld19sb2dpbl9idXR0b24iOiAiSW5pY2lhciBzZXNpw7NuIGVuIHR1IGN1ZW50YSIsCiAgInZlcnNpb24iOiAiVmVyc2nDs246IHt7dmVyc2lvbn19Igp9Cg==`,ote=``+new URL(`et-app-sWjqunAO.json`,import.meta.url).href,ste=`data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICLZgdmH2LHYs9iqINqp2KfYsdio2LEiCiAgfSwKICAiYWN0aW9uIjogewogICAgImNsb3NlIjogItio2LPYqtmGIiwKICAgICJnbyI6ICLYsdmB2KrZhiIsCiAgICAibm8iOiAi2K7bjNixIiwKICAgICJyZWdpc3RlciI6ICLYq9io2KrigIzZhtin2YUiLAogICAgInJlbW92ZSI6ICLYrdiw2YEiLAogICAgInNpZ25faW4iOiAi2YjYsdmI2K8iLAogICAgInNpZ25fb3V0IjogItiu2LHZiNisIgogIH0sCiAgImNhbGxfZW5kZWRfdmlldyI6IHsKICAgICJjcmVhdGVfYWNjb3VudF9idXR0b24iOiAi2LPYp9iu2Kog2K3Ys9in2Kgg2qnYp9ix2KjYsduMIiwKICAgICJjcmVhdGVfYWNjb3VudF9wcm9tcHQiOiAiPDA+2obYsdinINuM2qkg2LHZhdiyINi52KjZiNixINio2LHYp9uMINit2LPYp9ioINqp2KfYsdio2LHbjCDYrtmI2K8g2KrZhti424zZhSDZhtmF24zigIzaqdmG24zYr9ifPC8wPjwxPti02YXYpyDZhduM4oCM2KrZiNin2YbbjNivINmG2KfZhSDYrtmI2K8g2LHYpyDYrdmB2Lgg2qnZhtuM2K8g2Ygg24zaqSDYotmI2KfYqtin2LEg2KjYsdin24wg2KrZhdin2LPigIzZh9in24wg2KLbjNmG2K/ZhyDYqNiz2KfYstuM2K88LzE+IiwKICAgICJub3Rfbm93X2J1dHRvbiI6ICLYp9mE2KfZhiDZhtmH2Iwg2KjZhyDYtdmB2K3ZhyDYp9i12YTbjCDYqNix2q/Ysdiv24zYryIKICB9LAogICJjb21tb24iOiB7CiAgICAiYXVkaW8iOiAi2LXYr9inIiwKICAgICJhdmF0YXIiOiAi2KLZiNin2KrYp9ixIiwKICAgICJkaXNwbGF5X25hbWUiOiAi2YbYp9mFINmG2YXYp9uM2LTbjCIsCiAgICAiaG9tZSI6ICLYrtin2YbZhyIsCiAgICAibG9hZGluZyI6ICLYqNin2LHar9iy2KfYsduM4oCmIiwKICAgICJwYXNzd29yZCI6ICLYsdmF2LIg2LnYqNmI2LEiLAogICAgInByb2ZpbGUiOiAi2b7YsdmI2YHYp9uM2YQiLAogICAgInNldHRpbmdzIjogItiq2YbYuNuM2YXYp9iqIiwKICAgICJ1c2VybmFtZSI6ICLZhtin2YUg2qnYp9ix2KjYsduMIiwKICAgICJ2aWRlbyI6ICLZiNuM2K/bjNmIIgogIH0sCiAgImhlYWRlcl9sYWJlbCI6ICLYrtin2YbZh9mUINiq2YXYp9izINin2YTZhdmG2KoiLAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAi2KjZhNmH2Iwg2KjZhyDYqtmF2KfYsyDYqNm+24zZiNmG2K/bjNivIiwKICAgICJ0ZXh0IjogItin24zZhiDYqtmF2KfYsyDYp9iyINmC2KjZhCDZiNis2YjYryDYr9in2LHYr9iMINmF24zigIzYrtmI2KfZh9uM2K8g2KjZvtuM2YjZhtiv24zYr9ifIiwKICAgICJ0aXRsZSI6ICLZvtuM2YjYs9iqINio2Ycg2KrZhdin2LPYnyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogItmG2YjYsSDYp9mB2qnZhiIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogItm+24zZiNiz2KrZhiDYqNmHINiq2YXYp9izIgogIH0sCiAgImxvZ2dpbmdfaW4iOiAi2YjYsdmI2K/igKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPtiz2KfYrtiqINit2LPYp9ioINqp2KfYsdio2LHbjDwvMD4gT3IgPDI+2K/Ys9iq2LHYs9uMINio2Ycg2LnZhtmI2KfZhiDZhduM2YfZhdin2YY8LzI+IiwKICAibG9naW5fdGl0bGUiOiAi2YjYsdmI2K8iLAogICJyYWdlc2hha2VfcmVxdWVzdF9tb2RhbCI6IHsKICAgICJib2R5IjogItqp2KfYsdio2LEg2K/bjNqv2LHbjCDYr9ixINin24zZhiDYqtmF2KfYsyDZhdi02qnZhNuMINiv2KfYsdivLiDYqNix2KfbjCDYqti02K7bjNi1INio2YfYqtixINmF2LTaqdmE2Iwg2KjZh9iq2LEg2KfYs9iqINmF2Kcg2YTYp9qvINi524zYqOKAjNuM2KfYqNuMINix2Kcg2KzZhdi54oCM2KLZiNix24wg2qnZhtuM2YUuIiwKICAgICJ0aXRsZSI6ICLYr9ix2K7ZiNin2LPYqiDZhNin2q8g2LnbjNio4oCM24zYp9io24wiCiAgfSwKICAicmFnZXNoYWtlX3NlbmRfbG9ncyI6ICLYp9ix2LPYp9mEINmE2Kfar+KAjNmH2KfbjCDYuduM2KjigIzbjNin2KjbjCIsCiAgInJhZ2VzaGFrZV9zZW5kaW5nIjogItiv2LEg2K3Yp9mEINin2LHYs9in2YTigKYiLAogICJyYWdlc2hha2Vfc2VuZGluZ19sb2dzIjogItiv2LEg2K3Yp9mEINin2LHYs9in2YQg2KjYp9qv4oCM2YfYp9uMINi524zYqOKAjNuM2KfYqNuM4oCmIiwKICAicmVjYXB0Y2hhX2Rpc21pc3NlZCI6ICLYsduM2qnZvtqG2Kcg2LHYryDYtNivIiwKICAicmVjYXB0Y2hhX25vdF9sb2FkZWQiOiAi2qnZvtqG2Kcg2KjYp9ix2q/bjNix24wg2YbYtNivIiwKICAicmVnaXN0ZXIiOiB7CiAgICAicGFzc3dvcmRzX211c3RfbWF0Y2giOiAi2LHZhdiyINi52KjZiNixINio2KfbjNivINmH2YXYrtmI2KfZhtuMINiv2KfYtNiq2Ycg2KjYp9i02K8iLAogICAgInJlZ2lzdGVyaW5nIjogItir2KjYquKAjNmG2KfZheKApiIKICB9LAogICJyZWdpc3Rlcl9hdXRoX2xpbmtzIjogIjwwPtin2LIg2YLYqNmEINit2LPYp9ioINqp2KfYsdio2LHbjCDYr9in2LHbjNiv2J88LzA+PDE+PDA+2YjYsdmI2K88LzA+IE9yIDwyPtio2Ycg2LnZhtmI2KfZhiDbjNqpINmF24zZh9mF2KfZhiDZiNin2LHYryDYtNmI24zYrzwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICLYqtin24zbjNivINix2YXYsti52KjZiNixIiwKICAicmV0dXJuX2hvbWVfYnV0dG9uIjogItio2LHar9i02Kog2KjZhyDYtdmB2K3ZhyDYp9i12YTbjCIsCiAgInNjcmVlbnNoYXJlX2J1dHRvbl9sYWJlbCI6ICLYp9i02KrYsdin2qkg2q/YsNin2LHbjCDYtdmB2K3ZhyDZhtmF2KfbjNi0IiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICLYqtmI2LPYudmHINiv2YfZhtiv2YciLAogICAgImZlZWRiYWNrX3RhYl9oNCI6ICLYqNin2LLYrtmI2LHYryDYp9ix2KfYptmHINiv2YfbjNivIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogIti02KfZhdmEINmE2Kfar+KAjNmH2KfbjCDYuduM2KjigIzbjNin2KjbjCIKICB9LAogICJ1bmF1dGhlbnRpY2F0ZWRfdmlld19ib2R5IjogItmH2YbZiNiyINir2KjYquKAjNmG2KfZhSDZhtqp2LHYr9mH4oCM2KfbjNiv2J8gPDI+2LPYp9iu2Kog2K3Ys9in2Kgg2qnYp9ix2KjYsduMPC8yPiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2xvZ2luX2J1dHRvbiI6ICLYqNmHINit2LPYp9ioINqp2KfYsdio2LHbjCDYrtmI2K8g2YjYp9ix2K8g2LTZiNuM2K8iLAogICJ2ZXJzaW9uIjogItmG2LPYrtmHOiB7e9mG2LPYrtmHfX0iCn0K`,cte=``+new URL(`fi-app-BJflsxzx.json`,import.meta.url).href,lte=``+new URL(`fr-app-BV0pXPBE.json`,import.meta.url).href,ute=``+new URL(`id-app-DmDEpFdR.json`,import.meta.url).href,dte=``+new URL(`it-app-BTzsgy_P.json`,import.meta.url).href,fte=``+new URL(`ja-app-6HGEeBLx.json`,import.meta.url).href,pte=``+new URL(`lv-app-CpuRwzhS.json`,import.meta.url).href,mte=``+new URL(`pl-app-PMg7mZdN.json`,import.meta.url).href,hte=``+new URL(`ro-app-Ca2AQ3G7.json`,import.meta.url).href,gte=``+new URL(`ru-app-DRx4R8Xw.json`,import.meta.url).href,_te=``+new URL(`sk-app-DIJY0DkT.json`,import.meta.url).href,vte=``+new URL(`sv-app-BYt1wvxs.json`,import.meta.url).href,yte=``+new URL(`tr-app-DLAuaEBW.json`,import.meta.url).href,bte=``+new URL(`uk-app-CyQjdEqz.json`,import.meta.url).href,xte=`data:application/json;base64,ewogICJhY3Rpb24iOiB7CiAgICAiY2xvc2UiOiAixJDDs25nIiwKICAgICJubyI6ICJLaMO0bmciLAogICAgInJlZ2lzdGVyIjogIsSQxINuZyBrw70iLAogICAgInNpZ25faW4iOiAixJDEg25nIG5o4bqtcCIsCiAgICAic2lnbl9vdXQiOiAixJDEg25nIHh14bqldCIsCiAgICAic3VibWl0IjogIkfhu61pIgogIH0sCiAgImNhbGxfZW5kZWRfdmlldyI6IHsKICAgICJjcmVhdGVfYWNjb3VudF9idXR0b24iOiAiVOG6oW8gdMOgaSBraG/huqNuIiwKICAgICJjcmVhdGVfYWNjb3VudF9wcm9tcHQiOiAiPDA+VOG6oWkgc2FvIGzhuqFpIGtow7RuZyBob8OgbiB0aGnhu4duIGLhurFuZyBjw6FjaCDEkeG6t3QgbeG6rXQga2jhuql1IMSR4buDIGdp4buvIHTDoGkga2hv4bqjbiBj4bunYSBi4bqhbj88LzA+PDE+QuG6oW4gc+G6vSBjw7MgdGjhu4MgZ2nhu68gdMOqbiB2w6AgxJHhurd0IOG6o25oIMSR4bqhaSBkaeG7h24gY2hvIG5o4buvbmcgY3Xhu5ljIGfhu41pIHRp4bq/cCB0aGVvLjwvMT4iLAogICAgImZlZWRiYWNrX2RvbmUiOiAiPDA+Q+G6o20gaMahbiB2w6wgxJHDoyBwaOG6o24gaOG7k2khPC8wPiIsCiAgICAiZmVlZGJhY2tfcHJvbXB0IjogIjwwPkNow7puZyB0w7RpIG114buRbiBuZ2hlIHBo4bqjbiBo4buTaSBj4bunYSBi4bqhbiDEkeG7gyBjw7JuIGPhuqNpIHRoaeG7h24gdHLhuqNpIG5naGnhu4dtIGNobyBi4bqhbi48LzA+IiwKICAgICJoZWFkbGluZSI6ICJ7e2Rpc3BsYXlOYW1lfX0sIGN14buZYyBn4buNaSDEkcOjIGvhur90IHRow7pjLiIKICB9LAogICJjb21tb24iOiB7CiAgICAiYXVkaW8iOiAiw4JtIHRoYW5oIiwKICAgICJhdmF0YXIiOiAi4bqibmggxJHhuqFpIGRp4buHbiIsCiAgICAiZGlzcGxheV9uYW1lIjogIlTDqm4gaGnhu4NuIHRo4buLIiwKICAgICJsb2FkaW5nIjogIsSQYW5nIHThuqNp4oCmIiwKICAgICJwYXNzd29yZCI6ICJN4bqtdCBraOG6qXUiLAogICAgInByb2ZpbGUiOiAiSOG7kyBzxqEiLAogICAgInNldHRpbmdzIjogIkPDoGkgxJHhurd0IiwKICAgICJ1c2VybmFtZSI6ICJUw6puIG5nxrDhu51pIGTDuW5nIiwKICAgICJ2aWRlbyI6ICJUcnV54buBbiBow6xuaCIKICB9LAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAiVsOibmcsIHRoYW0gZ2lhIGN14buZYyBn4buNaSIsCiAgICAidGV4dCI6ICJDdeG7mWMgZ+G7jWkgxJHDoyB04buTbiB04bqhaSwgYuG6oW4gY8OzIG114buRbiB0aGFtIGdpYSBraMO0bmc/IiwKICAgICJ0aXRsZSI6ICJUaGFtIGdpYSBjdeG7mWMgZ+G7jWk/IgogIH0sCiAgImxheW91dF9zcG90bGlnaHRfbGFiZWwiOiAiVGnDqnUgxJFp4buDbSIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogIlRoYW0gZ2lhIGN14buZYyBn4buNaSIKICB9LAogICJsb2dnaW5nX2luIjogIsSQYW5nIMSRxINuZyBuaOG6rXDigKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPlThuqFvIHTDoGkga2hv4bqjbjwvMD4gSGF5IDwyPlRoYW0gZ2lhIGTGsOG7m2kgdMOqbiBraMOhYzwvMj4iLAogICJsb2dpbl90aXRsZSI6ICLEkMSDbmcgbmjhuq1wIiwKICAicmFnZXNoYWtlX3JlcXVlc3RfbW9kYWwiOiB7CiAgICAiYm9keSI6ICJN4buZdCBuZ8aw4budaSBkw7luZyBraMOhYyB0cm9uZyBjdeG7mWMgZ+G7jWkgxJFhbmcgZ+G6t3AgduG6pW4gxJHhu4EuIMSQ4buDIGPDsyB0aOG7gyBjaOG6qW4gxJFvw6FuIHThu5F0IGjGoW4gY2jDum5nIHTDtGkgbXXhu5FuIHRodSB0aOG6rXAgbmjhuq10IGvDvSBn4buhIGzhu5dpLiIsCiAgICAidGl0bGUiOiAiWcOqdSBj4bqndSBuaOG6rXQga8O9IGfhu6EgbOG7l2kiCiAgfSwKICAicmFnZXNoYWtlX3NlbmRpbmciOiAixJBhbmcgZ+G7rWnigKYiLAogICJyZWNhcHRjaGFfbm90X2xvYWRlZCI6ICJDaMawYSB04bqjaSDEkcaw4bujYyBSZWNhcHRjaGEiLAogICJyZWdpc3RlciI6IHsKICAgICJwYXNzd29yZHNfbXVzdF9tYXRjaCI6ICJN4bqtdCBraOG6qXUgcGjhuqNpIGto4bubcCIsCiAgICAicmVnaXN0ZXJpbmciOiAixJBhbmcgxJHEg25nIGvDveKApiIKICB9LAogICJyZWdpc3Rlcl9hdXRoX2xpbmtzIjogIjwwPsSQw6MgY8OzIHTDoGkga2hv4bqjbj88LzA+PDE+PDA+xJDEg25nIG5o4bqtcDwvMD4gSGF5IDwyPlRoYW0gZ2lhIGTGsOG7m2kgdMOqbiBLaMOhY2g8LzI+PC8xPiIsCiAgInJlZ2lzdGVyX2NvbmZpcm1fcGFzc3dvcmRfbGFiZWwiOiAiWMOhYyBuaOG6rW4gbeG6rXQga2jhuql1IiwKICAic2NyZWVuc2hhcmVfYnV0dG9uX2xhYmVsIjogIkNoaWEgc+G6uyBtw6BuIGjDrG5oIiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICJOaMOgIHBow6F0IHRyaeG7g24iLAogICAgImZlZWRiYWNrX3RhYl9kZXNjcmlwdGlvbl9sYWJlbCI6ICJQaOG6o24gaOG7k2kgY+G7p2EgYuG6oW4iLAogICAgImZlZWRiYWNrX3RhYl9oNCI6ICJH4butaSBwaOG6o24gaOG7k2kiLAogICAgImZlZWRiYWNrX3RhYl9zZW5kX2xvZ3NfbGFiZWwiOiAiS8OobSB0aGVvIG5o4bqtdCBrw70gZ+G7oSBs4buXaSIsCiAgICAiZmVlZGJhY2tfdGFiX3RoYW5rX3lvdSI6ICJD4bqjbSDGoW4sIGNow7puZyB0w7RpIMSRw6Mgbmjhuq1uIMSRxrDhu6NjIHBo4bqjbiBo4buTaSEiLAogICAgImZlZWRiYWNrX3RhYl90aXRsZSI6ICJQaOG6o24gaOG7k2kiCiAgfSwKICAic3VibWl0dGluZyI6ICLEkGFuZyBn4butaeKApiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2JvZHkiOiAiQ2jGsGEgxJHEg25nIGvDvT8gPDI+VOG6oW8gdMOgaSBraG/huqNuPC8yPiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2xvZ2luX2J1dHRvbiI6ICLEkMSDbmcgbmjhuq1wIHbDoG8gdMOgaSBraG/huqNuIGPhu6dhIGLhuqFuIiwKICAidmVyc2lvbiI6ICJQaGnDqm4gYuG6o246IHt7dmVyc2lvbn19Igp9Cg==`,Ste=``+new URL(`zh-Hans-app-d-m--oHo.json`,import.meta.url).href,Cte=``+new URL(`zh-Hant-app-Ba7dG_mB.json`,import.meta.url).href,{slice:wte,forEach:Tte}=[];function Ete(e){return Tte.call(wte.call(arguments,1),t=>{if(t)for(let n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Dte(e){return typeof e==`string`?[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(t=>t.test(e)):!1}var R9=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Ote=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:`/`},r=`${e}=${encodeURIComponent(t)}`;if(n.maxAge>0){let e=n.maxAge-0;if(Number.isNaN(e))throw Error(`maxAge should be a Number`);r+=`; Max-Age=${Math.floor(e)}`}if(n.domain){if(!R9.test(n.domain))throw TypeError(`option domain is invalid`);r+=`; Domain=${n.domain}`}if(n.path){if(!R9.test(n.path))throw TypeError(`option path is invalid`);r+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!=`function`)throw TypeError(`option expires is invalid`);r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+=`; HttpOnly`),n.secure&&(r+=`; Secure`),n.sameSite)switch(typeof n.sameSite==`string`?n.sameSite.toLowerCase():n.sameSite){case!0:r+=`; SameSite=Strict`;break;case`lax`:r+=`; SameSite=Lax`;break;case`strict`:r+=`; SameSite=Strict`;break;case`none`:r+=`; SameSite=None`;break;default:throw TypeError(`option sameSite is invalid`)}return n.partitioned&&(r+=`; Partitioned`),r},z9={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:`/`,sameSite:`strict`};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Ote(e,t,i)},read(e){let t=`${e}=`,n=document.cookie.split(`;`);for(let e=0;e<n.length;e++){let r=n[e];for(;r.charAt(0)===` `;)r=r.substring(1,r.length);if(r.indexOf(t)===0)return r.substring(t.length,r.length)}return null},remove(e,t){this.create(e,``,-1,t)}},kte={name:`cookie`,lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<`u`)return z9.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:a}=t;n&&typeof document<`u`&&z9.create(n,e,r,i,a)}},Ate={name:`querystring`,lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<`u`){let{search:e}=window.location;!window.location.search&&window.location.hash?.indexOf(`?`)>-1&&(e=window.location.hash.substring(window.location.hash.indexOf(`?`)));let r=e.substring(1).split(`&`);for(let e=0;e<r.length;e++){let i=r[e].indexOf(`=`);i>0&&r[e].substring(0,i)===t&&(n=r[e].substring(i+1))}}return n}},jte={name:`hash`,lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<`u`){let{hash:e}=window.location;if(e&&e.length>2){let i=e.substring(1);if(t){let e=i.split(`&`);for(let n=0;n<e.length;n++){let i=e[n].indexOf(`=`);i>0&&e[n].substring(0,i)===t&&(r=e[n].substring(i+1))}}if(r)return r;if(!r&&n>-1){let t=e.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof n==`number`?n:0]?.replace(`/`,``):void 0}}}return r}},B9=null,V9=()=>{if(B9!==null)return B9;try{if(B9=typeof window<`u`&&window.localStorage!==null,!B9)return!1;let e=`i18next.translate.boo`;window.localStorage.setItem(e,`foo`),window.localStorage.removeItem(e)}catch{B9=!1}return B9},H9={name:`localStorage`,lookup(e){let{lookupLocalStorage:t}=e;if(t&&V9())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&V9()&&window.localStorage.setItem(n,e)}},U9=null,W9=()=>{if(U9!==null)return U9;try{if(U9=typeof window<`u`&&window.sessionStorage!==null,!U9)return!1;let e=`i18next.translate.boo`;window.sessionStorage.setItem(e,`foo`),window.sessionStorage.removeItem(e)}catch{U9=!1}return U9},Mte={name:`sessionStorage`,lookup(e){let{lookupSessionStorage:t}=e;if(t&&W9())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&W9()&&window.sessionStorage.setItem(n,e)}},Nte={name:`navigator`,lookup(e){let t=[];if(typeof navigator<`u`){let{languages:e,userLanguage:n,language:r}=navigator;if(e)for(let n=0;n<e.length;n++)t.push(e[n]);n&&t.push(n),r&&t.push(r)}return t.length>0?t:void 0}},Pte={name:`htmlTag`,lookup(e){let{htmlTag:t}=e,n,r=t||(typeof document<`u`?document.documentElement:null);return r&&typeof r.getAttribute==`function`&&(n=r.getAttribute(`lang`)),n}},Fte={name:`path`,lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>`u`)return;let n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(Array.isArray(n))return n[typeof t==`number`?t:0]?.replace(`/`,``)}},Ite={name:`subdomain`,lookup(e){let{lookupFromSubdomainIndex:t}=e,n=typeof t==`number`?t+1:1,r=typeof window<`u`&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}},G9=!1;try{document.cookie,G9=!0}catch{}var K9=[`querystring`,`cookie`,`localStorage`,`sessionStorage`,`navigator`,`htmlTag`];G9||K9.splice(1,1);var Lte=()=>({order:K9,lookupQuerystring:`lng`,lookupCookie:`i18next`,lookupLocalStorage:`i18nextLng`,lookupSessionStorage:`i18nextLng`,caches:[`localStorage`],excludeCacheFor:[`cimode`],convertDetectedLanguage:e=>e}),q9=class{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type=`languageDetector`,this.detectors={},this.init(e,t)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Ete(t,this.options||{},Lte()),typeof this.options.convertDetectedLanguage==`string`&&this.options.convertDetectedLanguage.indexOf(`15897`)>-1&&(this.options.convertDetectedLanguage=e=>e.replace(`-`,`_`)),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(kte),this.addDetector(Ate),this.addDetector(H9),this.addDetector(Mte),this.addDetector(Nte),this.addDetector(Pte),this.addDetector(Fte),this.addDetector(Ite),this.addDetector(jte)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,t=[];return e.forEach(e=>{if(this.detectors[e]){let n=this.detectors[e].lookup(this.options);n&&typeof n==`string`&&(n=[n]),n&&(t=t.concat(n))}}),t=t.filter(e=>e!=null&&!Dte(e)).map(e=>this.options.convertDetectedLanguage(e)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach(t=>{this.detectors[t]&&this.detectors[t].cacheUserLanguage(e,this.options)}))}};q9.type=`languageDetector`;var Rte=n((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.shouldPolyfill=t;function t(){return!Intl.Segmenter}}))();function zte(){return typeof Intl>`u`||!(`DurationFormat`in Intl)}var J9=Object.assign({"../locales/bg/app.json":$ee,"../locales/cs/app.json":ete,"../locales/da/app.json":tte,"../locales/de/app.json":nte,"../locales/el/app.json":rte,"../locales/en/app.json":ite,"../locales/es/app.json":ate,"../locales/et/app.json":ote,"../locales/fa/app.json":ste,"../locales/fi/app.json":cte,"../locales/fr/app.json":lte,"../locales/id/app.json":ute,"../locales/it/app.json":dte,"../locales/ja/app.json":fte,"../locales/lv/app.json":pte,"../locales/pl/app.json":mte,"../locales/ro/app.json":hte,"../locales/ru/app.json":gte,"../locales/sk/app.json":_te,"../locales/sv/app.json":vte,"../locales/tr/app.json":yte,"../locales/uk/app.json":bte,"../locales/vi/app.json":xte,"../locales/zh-Hans/app.json":Ste,"../locales/zh-Hant/app.json":Cte}),Bte=(e,t)=>J9[`../locales/${e}/${t}.json`],Vte=[...new Set(Object.keys(J9).map(e=>{let t=e.match(/\/([^/]+)\/[^/]+\.json$/)?.[1];if(!t)throw Error(`Could not parse locale URL ${e}`);return t}))],Hte={type:`backend`,init(){},read(e,t,n){(async()=>{let n=Bte(e,t);if(!n)throw Error(`Namespace ${t} for locale ${e} not found`);let r=await fetch(n,{credentials:`omit`,headers:{Accept:`application/json`}});if(at(r))throw Error(`Failed to fetch ${n}`);return await r.json()})().then(e=>n(null,e),e=>n(e,null))}},Y9=function(e){return e[e.None=0]=`None`,e[e.Loading=1]=`Loading`,e[e.Loaded=2]=`Loaded`,e}(Y9||{}),Ute=class{constructor(){this.config=Y9.None,this.sentry=Y9.None}allDepsAreLoaded(){return!Object.values(this).some(e=>e!==Y9.Loaded)}},X9=class t{constructor(){this.isInitialized=!1,this.loadStates=new Ute}static isInitialized(){return!!t.internalInstance?.isInitialized}static async initBeforeReact(){bt();let t=[];(0,Rte.shouldPolyfill)()&&t.push(o(()=>import(`./polyfill-force-Dey3kAQw.js`).then(t=>e(t.default,1)),__vite__mapDeps([0,1,2]),import.meta.url)),zte()&&t.push(o(()=>import(`./polyfill-force-CL46JUpA.js`),__vite__mapDeps([3,1]),import.meta.url)),await Promise.all(t);let n=new q9;n.addDetector({name:`urlFragment`,lookup:()=>da().lang??void 0}),rN.on(`languageChanged`,e=>{document.documentElement.lang=e}),await rN.use(Hte).use(n).use(xi).init({fallbackLng:`en`,defaultNS:`app`,keySeparator:`.`,nsSeparator:!1,pluralSeparator:`_`,contextSeparator:`|`,supportedLngs:Vte,interpolation:{escapeValue:!1},detection:{order:[`urlFragment`,`navigator`],caches:[]}});let{fonts:r,fontScale:i}=da();i!==null&&document.documentElement.style.setProperty(`--font-scale`,i.toString()),r.length>0&&document.documentElement.style.setProperty(`--font-family`,r.map(e=>`"${e}"`).join(`, `)),document.body.setAttribute(`data-platform`,tn)}static init(){return t?.internalInstance?.initPromise?null:(t.internalInstance=new t,t.internalInstance.initPromise=new Promise(e=>{t.internalInstance?.initStep(e)}),t.internalInstance.initPromise)}static reset(){t.internalInstance=void 0}initStep(e){if(this.loadStates.config===Y9.None&&(this.loadStates.config=Y9.Loading,ze.init().then(()=>{this.loadStates.config=Y9.Loaded,this.initStep(e)},e=>{h.error(`Failed to load config`,e)})),this.loadStates.sentry===Y9.None&&this.loadStates.config===Y9.Loaded){let e,t;e=da().sentryDsn??void 0,t=da().sentryEnvironment??void 0,e&&mT({dsn:e,environment:t,integrations:[QT({useEffect:M.useEffect,useLocation:Pn,useNavigationType:Ti,createRoutesFromChildren:yi,matchRoutes:wr})],tracesSampleRate:1}),this.loadStates.sentry=Y9.Loaded}this.loadStates.allDepsAreLoaded()&&(e(),this.isInitialized=!0)}},Wte=()=>{let[e,t]=(0,M.useState)(()=>da().theme),n=(0,M.useRef)(document.body.classList.item(0));(0,M.useEffect)(()=>{if(At){let e=e=>{e.preventDefault(),`name`in e.detail.data&&typeof e.detail.data.name==`string`&&t(e.detail.data.name),At.api.transport.reply(e.detail,{})};return At.lazyActions.on(Gr.ThemeChange,e),()=>{At.lazyActions.off(Gr.ThemeChange,e)}}},[]),(0,M.useLayoutEffect)(()=>{let t=e?.includes(`light`)?`light`:`dark`,r=e?.includes(`high-contrast`)?`-hc`:``,i=`cpd-theme-`+t+r;i!==n.current&&(document.body.classList.remove(`cpd-theme-light`,`cpd-theme-dark`,`cpd-theme-light-hc`,`cpd-theme-dark-hc`),document.body.classList.add(i),n.current=i),document.body.classList.remove(`no-theme`)},[n,e])},Z9=$T(ji),Gte=({children:e})=>{let{pathname:t}=Pn();return(0,M.useEffect)(()=>{let e=``;![`/login`,`/register`].includes(t)&&!At&&(e=`var(--background-gradient)`),document.getElementsByTagName(`body`)[0].style.backgroundImage=e},[t]),(0,W.jsx)(W.Fragment,{children:e})},Kte=({children:e})=>(Wte(),e),qte=({vm:e})=>{let[t,n]=(0,M.useState)(!1);(0,M.useEffect)(()=>{X9.init()?.then(async()=>{t||(n(!0),await At?.api.sendContentLoaded())}).catch(h.error)});let{header:r}=(0,M.useMemo)(da,[]),i=t?(0,W.jsx)(Xn,{children:(0,W.jsx)(QL,{value:e.mediaDevices,children:(0,W.jsx)(wY,{children:(0,W.jsx)(wT,{fallback:e=>(0,W.jsx)(vn,{error:e,widget:At}),children:(0,W.jsxs)(Zr,{children:[(0,W.jsx)(Z9,{path:`/`,element:(0,W.jsx)(HX,{})}),(0,W.jsx)(Z9,{path:`/login`,element:(0,W.jsx)(KX,{})}),(0,W.jsx)(Z9,{path:`/register`,element:(0,W.jsx)(qX,{})}),(0,W.jsx)(Z9,{path:`*`,element:(0,W.jsx)(Qee,{})})]})})})})}):(0,W.jsx)(Cn,{});return(0,W.jsx)(ie,{children:(0,W.jsx)(Gte,{children:(0,W.jsx)(Kte,{children:(0,W.jsx)(un,{children:(0,W.jsx)(M.Suspense,{fallback:null,children:r===Bt.AppBar?(0,W.jsx)($7,{children:i}):i})})})})})},Jte=class{constructor(e){this.scope=e,this.mediaDevices=new WL(this.scope)}};window.setLKLogLevel=eu,be().catch(e=>{h.error(`Failed to initialize rageshake`,e)}),eu(`info`),tu((e,n,r)=>{t.mx_rage_logger.log(e,`livekit`,n,r)}),h.info(`Element Call embedded-v0.19.2`);var Q9=(0,Ea.createRoot)(document.getElementById(`root`)),$9=null;if(window.isSecureContext?navigator.mediaDevices||($9=Error(`Your browser does not support WebRTC.`)):$9=Error(`This app cannot run in an insecure context. To fix this, access the app via a local loopback address, or serve it over HTTPS.
218
218
  https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts`),$9!==null)throw Q9.render($9.message),$9;X9.initBeforeReact().then(()=>{Q9.render((0,W.jsx)(M.StrictMode,{children:(0,W.jsx)(qte,{vm:new Jte(mL)})}))}).catch(e=>{h.error(`Failed to initialize app ${e.message}`,e),Q9.render(e.message)});
219
- //# sourceMappingURL=index-Djc6082U.js.map
219
+ //# sourceMappingURL=index-DzoaVylG.js.map