www.federated.computer/public/target/assets/main.5848f48b.js

37 lines
521 KiB
JavaScript
Raw Normal View History

2023-09-19 19:27:32 +00:00
var Pd=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);import"./modulepreload-polyfill.b7f2da20.js";var GS=Pd((WS,Ke)=>{var Ao=/[\\\"\x00-\x1F]/g,He={};for(var or=0;or<32;++or)He[String.fromCharCode(or)]="\\U"+("0000"+or.toString(16)).slice(-4).toUpperCase();He["\b"]="\\b";He[" "]="\\t";He[`
`]="\\n";He["\f"]="\\f";He["\r"]="\\r";He['"']='\\"';He["\\"]="\\\\";function sc(s){return Ao.lastIndex=0,s.replace(Ao,function(e){return He[e]})}function _n(s){switch(typeof s){case"string":return'"'+sc(s)+'"';case"number":return isFinite(s)?s:"null";case"boolean":return s;case"object":return s===null?"null":Array.isArray(s)?Od(s):Ud(s);default:throw new Error("Cannot stringify: "+typeof s)}}function Od(s){for(var e="[",t="",i=0;i<s.length;++i)t+=e,e=",",t+=_n(s[i]);return e!=","?"[]":t+"]"}function Ud(s){var e="{",t="",i=Object.keys(s);i.sort();for(var r=0;r<i.length;++r){var n=i[r];t+=e+'"'+sc(n)+'":',e=",",t+=_n(s[n])}return e!=","?"{}":t+"}"}var nc={stringify:_n},Nt={};(function(){for(var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Uint8Array(256),t=0;t<s.length;t++)e[s.charCodeAt(t)]=t;Nt.encode=function(i){var r=new Uint8Array(i),n,o=r.length,a="";for(n=0;n<o;n+=3)a+=s[r[n]>>2],a+=s[(r[n]&3)<<4|r[n+1]>>4],a+=s[(r[n+1]&15)<<2|r[n+2]>>6],a+=s[r[n+2]&63];return o%3===2?a=a.substring(0,a.length-1)+"=":o%3===1&&(a=a.substring(0,a.length-2)+"=="),a},Nt.decode=function(i){var r=i.length*.75,n=i.length,o,a=0,c,l,d,u;i[i.length-1]==="="&&(r--,i[i.length-2]==="="&&r--);var h=new ArrayBuffer(r),m=new Uint8Array(h);for(o=0;o<n;o+=4)c=e[i.charCodeAt(o)],l=e[i.charCodeAt(o+1)],d=e[i.charCodeAt(o+2)],u=e[i.charCodeAt(o+3)],m[a++]=c<<2|l>>4,m[a++]=(l&15)<<4|d>>2,m[a++]=(d&3)<<6|u&63;return h}})();/*! @license DOMPurify 2.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.0/LICENSE */function it(s){return it=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},it(s)}function Ks(s,e){return Ks=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Ks(s,e)}function Bd(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ar(s,e,t){return Bd()?Ar=Reflect.construct:Ar=function(r,n,o){var a=[null];a.push.apply(a,n);var c=Function.bind.apply(r,a),l=new c;return o&&Ks(l,o.prototype),l},Ar.apply(null,arguments)}function ge(s){return Ld(s)||Fd(s)||Vd(s)||Kd()}function Ld(s){if(Array.isArray(s))return $s(s)}function Fd(s){if(typeof Symbol<"u"&&s[Symbol.iterator]!=null||s["@@iterator"]!=null)return Array.from(s)}function Vd(s,e){if(!!s){if(typeof s=="string")return $s(s,e);var t=Object.prototype.toString.call(s).slice(8,-1);if(t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set")return Array.from(s);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return $s(s,e)}}function $s(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=s[t];return i}function Kd(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var $d=Object.hasOwnProperty,Co=Object.setPrototypeOf,jd=Object.isFrozen,Gd=Object.getPrototypeOf,qd=Object.getOwnPropertyDescriptor,le=Object.freeze,Ne=Object.seal,zd=Object.create,oc=typeof Reflect<"u"&&Reflect,Or=oc.apply,js=oc.construct;Or||(Or=function(e,t,i){return e.apply(t,i)});le||(le=function(e){return e});Ne||(Ne=function(e){return e});js||(js=function(e,t){return Ar(e,ge(t))});var Hd=Ie(Array.prototype.forEach),No=Ie(Array.prototype.pop),yi=Ie(Array.prototype.push),Cr=Ie(String.prototype.toLowerCase),Wd=Ie(String.prototype.match),Xe=Ie(String.prototype.replace),Yd=Ie(String.prototype.indexOf),Jd=Ie(String.prototype.trim),ne=Ie(RegExp.prototype.test),Is=Xd(TypeError);function Ie(s){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];return Or(s,e,i)}}function Xd(s){return function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return js(s,t)}}function R(s,e,t){t=t||Cr,Co&&Co(s,null);for(var i=e.length;i--;){var r=e[i];if(typeof r=="string"){var n=t(r);n!==r&&(jd(e)||(e[i]=n),r=n)}s[r]=!0}return s}function wt(s){var e=zd(null),t;for(t in s)Or($d,s,[t])&&(e[t]=s[t]);return e}function ar(s,e){for(;s!==null;){var t=qd(s,e);if(t){if(t.get)return Ie(t.get);if(typeof t.value=="function")return Ie(t.value)}s=Gd(s)}function i(r){return console.warn("fallback value for",r),null}return i}var Mo=le(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ts=le(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),xs=le(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Qd=le(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ks=le(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Zd=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Do=le(["#text"]),Po=le(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","con
`+ee),Vt&&(ee=Xe(ee,cs," "),ee=Xe(ee,ls," ")),w&&ir?w.createHTML(ee):ee},e.setConfig=function(b){ws(b),ps=!0},e.clearConfig=function(){qt=null,ps=!1},e.isValidAttribute=function(b,p,g){qt||ws({});var v=H(b),N=H(p);return To(v,N,g)},e.addHook=function(b,p){typeof p=="function"&&(xe[b]=xe[b]||[],yi(xe[b],p))},e.removeHook=function(b){if(xe[b])return No(xe[b])},e.removeHooks=function(b){xe[b]&&(xe[b]=[])},e.removeAllHooks=function(){xe={}},e}var du=ac(),Yr={exports:{}},uu=function(s){var e={};function t(i){if(e[i])return e[i].exports;var r=e[i]={i,l:!1,exports:{}};return s[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=s,t.c=e,t.d=function(i,r,n){t.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:n})},t.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},t.t=function(i,r){if(1&r&&(i=t(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var o in i)t.d(n,o,function(a){return i[a]}.bind(null,o));return n},t.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return t.d(r,"a",r),r},t.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},t.p="",t(t.s=0)}([function(s,e,t){function i(l){let d,u;const h={light:function(){return!_()},dark:_,lighten:I,darken:E,saturate:T,desaturate:function(w=0){return T(w*=-1)},increaseContrast:function(w=0){return k(w*=-1)},decreaseContrast:k,active:function(){return k(.123)},highlight:function(){return k(.1)},selected:function(){return k(.066)},text:function(){return u=f()?r("#333333"):r("#FFFFFF"),h},shadow:function(){return u=f()?r("#000000"):r("#FFFFFF"),h},hex:function(){const w=u;return u=d,"#"+w.map(x=>parseInt(x+"",10).toString(16).padStart(2,"0")).join("")},rgb:function(){const w=u;return u=d,`rgb(${w.join()})`},rgba:function(w=1){const x=u;return u=d,`rgba(${x.join()}, ${w})`},setHex:m,setRgb:function(w=[0,0,0]){let[x,C,O]=w;return x=c(x,0,255),C=c(C,0,255),O=c(O,0,255),d=[x,C,O],u=[x,C,O],h}};function m(w="#000000"){return d=r(w),u=d,h}function _(){const[w,x,C]=u;return u=d,(299*w+587*x+114*C)/1e3<128}function f(){const[w,x,C]=u;return(299*w+587*x+114*C)/1e3>=128}function E(w=0){return I(w*=-1)}function I(w=0){let[x,C,O]=a(u);return O=c(O+w,0,1),u=n([x,C,O]),h}function T(w=0){let[x,C,O]=a(u);return C=c(C+w,0,1),u=n([x,C,O]),h}function k(w=0){return f()?E(w):I(w)}return m(l),h}function r(l){if(typeof l!="string")throw new TypeError("Expected a string");(l=l.replace(/^#/,"")).length===3&&(l=l[0]+l[0]+l[1]+l[1]+l[2]+l[2]);var d=parseInt(l,16);return[d>>16,d>>8&255,255&d]}function n(l){const[d,u,h]=l;let m,_,f;if(u===0)m=_=f=h;else{const E=function(k,w,x){return x<0&&(x+=1),x>1&&(x-=1),x<.16666666666666666?k+6*(w-k)*x:x<.5?w:x<.6666666666666666?k+(w-k)*(.6666666666666666-x)*6:k},I=h<.5?h*(1+u):h+u-h*u,T=2*h-I;m=c(E(T,I,d+1/3),0,1),_=c(E(T,I,d),0,1),f=c(E(T,I,d-1/3),0,1)}return[Math.round(255*m),Math.round(255*_),Math.round(255*f)]}t.r(e),t.d(e,"offColor",function(){return i}),t.d(e,"hexRgb",function(){return r}),t.d(e,"hslToRgb",function(){return n}),t.d(e,"color",function(){return o}),t.d(e,"rgbToHsl",function(){return a});const o=i;function a(l){const d=l[0]/255,u=l[1]/255,h=l[2]/255,m=Math.max(d,u,h),_=Math.min(d,u,h);let f=(m+_)/2,E=(m+_)/2;const I=(m+_)/2;if(m===_)f=E=0;else{const T=m-_;switch(E=I>.5?T/(2-m-_):T/(m+_),m){case d:f=(u-h)/T+(u<h?6:0);break;case u:f=(h-d)/T+2;break;case h:f=(d-u)/T+4}f/=6}return[f,E,I]}function c(l,d,u){return l=(l=l<=u?l:u)>=d?l:d}}]);Yr.exports=uu;var cc=Yr.exports,hu=Object.defineProperty,pu=Object.defineProperties,mu=Object.getOwnPropertyDescriptors,Ur=Object.getOwnPropertySymbols,lc=Object.prototype.hasOwnProperty,dc=Object.prototype.propertyIsEnumerable,Uo=(s,e,t)=>e in s?hu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Oi=(s,e)=>{for(var t in e||(e={}))lc.call(e,t)&&Uo(s,t,e[t]);if(Ur)for(var t of Ur(e))dc.call(e,t)&&Uo(s,t,e[t]);r
`)[0]}),i&&(n.f=!0),r&&(n.c=r),n}run(e){this.end!==void 0&&console.trace("log item is finished, additional logs will likely not be recorded");try{const t=e(this);return t instanceof Promise?t.then(i=>(this.finish(),i),i=>{throw this.catch(i)}):(this.finish(),t)}catch(t){throw this.catch(t)}}finish(){if(this.end===void 0){if(this._children)for(const e of this._children)e.finish();this.end=this._logger._now()}}get level(){return we}catch(e){return this.error=e,this.logLevel=we.Error,this.finish(),e}child(e,t,i){this.end&&console.trace("log item is finished, additional logs will likely not be recorded"),t||(t=this.logLevel||we.Info);const r=new Ai(e,t,this._logger,i);return this._children||(this._children=[]),this._children.push(r),r}get logger(){return this._logger}get values(){return this._values}get children(){return this._children}}class Ac{constructor({platform:e,serializedTransformer:t=i=>i}){this._openItems=new Set,this._platform=e,this._serializedTransformer=t}log(e,t=we.Info){const i=new Ai(e,t,this);i.end=i.start,this._persistItem(i,void 0,!1)}wrapOrRun(e,t,i,r,n){return e?e.wrap(t,i,r,n):this.run(t,i,r,n)}runDetached(e,t,i,r){i||(i=we.Info);const n=new Ai(e,i,this);return this._run(n,t,i,!1,r),n}run(e,t,i,r){i===void 0&&(i=we.Info);const n=new Ai(e,i,this);return this._run(n,t,i,!0,r)}_run(e,t,i,r,n){this._openItems.add(e);const o=()=>{let a=new zs;if(n)try{a=n(a,e)}catch(c){console.error("Error while creating log filter",c)}else a=a.minLevel(i);try{this._persistItem(e,a,!1)}catch(c){console.error("Could not persist log item",c)}this._openItems.delete(e)};try{let a=e.run(t);if(a instanceof Promise){if(a=a.then(c=>(o(),c),c=>{if(o(),r)throw c}),r)return a}else if(o(),r)return a}catch(a){if(o(),r)throw a}}_finishOpenItems(){for(const e of this._openItems){e.finish();try{this._persistItem(e,new zs,!0)}catch(t){console.error("Could not serialize log item",t)}}this._openItems.clear()}get level(){return we}_now(){return this._platform.clock.now()}_createRefId(){return Math.round(this._platform.random()*Number.MAX_SAFE_INTEGER)}}class Kh extends Ac{constructor(e){super(e);const{name:t,flushInterval:i=60*1e3,limit:r=3e3}=e;this._name=t,this._limit=r,this._queuedItems=this._loadQueuedItems(),window.addEventListener("pagehide",this,!1),this._flushInterval=this._platform.clock.createInterval(()=>this._tryFlush(),i)}dispose(){window.removeEventListener("pagehide",this,!1),this._flushInterval.dispose()}handleEvent(e){e.type==="pagehide"&&this._finishAllAndFlush()}async _tryFlush(){const e=await this._openDB();try{const t=e.transaction(["logs"],"readwrite"),i=t.objectStore("logs"),r=this._queuedItems.length;for(const o of this._queuedItems)i.add(o);const n=await ce(i.count());if(n>this._limit){let o=n-this._limit+Math.round(.1*this._limit);await W(i.openCursor(),(a,c,l)=>(l.delete(),o-=1,{done:o===0}))}await Bi(t),this._queuedItems.splice(0,r)}catch(t){console.error("Could not flush logs",t)}finally{try{e.close()}catch{}}}_finishAllAndFlush(){this._finishOpenItems(),this.log({l:"pagehide, closing logs",t:"navigation"}),this._persistQueuedItems(this._queuedItems)}_loadQueuedItems(){const e=`${this._name}_queuedItems`;try{const t=window.localStorage.getItem(e);if(t)return window.localStorage.removeItem(e),JSON.parse(t)}catch(t){console.error("Could not load queued log items",t)}return[]}_openDB(){return yn(this._name,e=>e.createObjectStore("logs",{keyPath:"id",autoIncrement:!0}),1)}_persistItem(e,t,i){const r=e.serialize(t,void 0,i);if(r){const n=this._serializedTransformer(r);this._queuedItems.push({json:JSON.stringify(n)})}}_persistQueuedItems(e){try{window.localStorage.setItem(`${this._name}_queuedItems`,JSON.stringify(e))}catch(t){console.error("Could not persist queued log items in localStorage, they will likely be lost",t)}}async export(){const e=await this._openDB();try{const i=e.transaction(["logs"],"readonly").objectStore("logs"),n=(await ku(i.openCursor(),()=>!1)).concat(this._queuedItems);return new $h(n,this,this._platform)}finally{try{e.close()}catch{}}}async _removeItems(e){const t=await this._openDB();try{const i
`)[1]),A.div([A.h2("Something went wrong\u2026"),A.h3(s.message),A.p(`This occurred while running ${t}.`),A.pre(s.stack)])}function Jo(s,e,t){if(e===s.childElementCount)s.appendChild(t);else{const r=s.children[e];s.insertBefore(t,r)}}function Jh(s){s.innerHTML=""}function Xh(s){return async e=>{var t,i;(t=e.target)==null||t.setAttribute("disabled","disabled"),await s(e),(i=e.target)==null||i.removeAttribute("disabled")}}class Ji{constructor({list:e,onItemClick:t,className:i,tagName:r="ul",parentProvidesUpdates:n=!0},o){this._onItemClick=t,this._list=e,this._className=i,this._tagName=r,this._root=void 0,this._subscription=void 0,this._childCreator=o,this._childInstances=void 0,this._mountArgs={parentProvidesUpdates:n}}root(){return this._root}update(e){if(e.list){if(this._subscription)for(this._unloadList();this._root.lastChild;)this._root.lastChild.remove();this._list=e.list,this.loadList()}}mount(){const e={};this._className&&(e.className=this._className);const t=this._root=Hh(this._tagName,e);return this.loadList(),this._onItemClick&&t.addEventListener("click",this),t}handleEvent(e){e.type==="click"&&this._handleClick(e)}unmount(){this._list&&this._unloadList()}_handleClick(e){if(e.target===this._root||!this._onItemClick)return;let t=e.target;for(;t.parentNode!==this._root;)t=t.parentNode;const i=Array.prototype.indexOf.call(this._root.childNodes,t),r=this._childInstances[i];r&&this._onItemClick(r,e)}_unloadList(){this._subscription=this._subscription();for(let e of this._childInstances)e.unmount();this._childInstances=void 0}loadList(){if(!this._list)return;this._subscription=this._list.subscribe(this),this._childInstances=[];const e=document.createDocumentFragment();for(let t of this._list){const i=this._childCreator(t);this._childInstances.push(i),e.appendChild(Li(i,this._mountArgs))}this._root.appendChild(e)}onReset(){for(const e of this._childInstances)e.root().remove(),e.unmount();this._childInstances.length=0}onAdd(e,t){this.addChild(e,t)}onRemove(e,t){this.removeChild(e)}onMove(e,t,i){this.moveChild(e,t)}onUpdate(e,t,i){this.updateChild(e,t,i)}addChild(e,t){const i=this._childCreator(t);this._childInstances.splice(e,0,i),Jo(this._root,e,Li(i,this._mountArgs))}removeChild(e){const[t]=this._childInstances.splice(e,1);t.root().remove(),t.unmount()}moveChild(e,t){const[i]=this._childInstances.splice(e,1);this._childInstances.splice(t,0,i),i.root().remove(),Jo(this._root,t,i.root())}updateChild(e,t,i){if(this._childInstances){const r=this._childInstances[e];r&&r.update(t,i)}}recreateItem(e,t){if(this._childInstances){const i=this._childCreator(t);if(!i)this.onRemove(e,t);else{const[r]=this._childInstances.splice(e,1,i);this._root.replaceChild(i.mount(this._mountArgs),r.root()),r.unmount()}}}getChildInstanceByIndex(e){var t;return(t=this._childInstances)==null?void 0:t[e]}}class Pc{constructor(e){this._value=e,this._boundUpdateFromValue=null}subscribeOnMount(e){e&&e.parentProvidesUpdates||this._subscribe()}unmount(){this._unsubscribe()}get value(){return this._value}_updateFromValue(e){this.update(this._value,e)}_subscribe(){var e;typeof((e=this._value)==null?void 0:e.on)=="function"&&(this._boundUpdateFromValue=this._updateFromValue.bind(this),this._value.on("change",this._boundUpdateFromValue))}_unsubscribe(){this._boundUpdateFromValue&&(typeof this._value.off=="function"&&this._value.off("change",this._boundUpdateFromValue),this._boundUpdateFromValue=null)}}function Qh(s){for(const e of Object.values(s))if(typeof e=="function")return!0;return!1}class S extends Pc{constructor(){super(...arguments),this._eventListeners=void 0,this._bindings=void 0,this._root=void 0,this._subViews=void 0}_attach(){if(this._eventListeners)for(let{node:e,name:t,fn:i,useCapture:r}of this._eventListeners)e.addEventListener(t,i,r)}_detach(){if(this._eventListeners)for(let{node:e,name:t,fn:i,useCapture:r}of this._eventListeners)e.removeEventListener(t,i,r)}mount(e){const t=new Oc(this);try{this._root=this.render(t,this._value)}finally{t.close()}return this.subscribeOnMount(e),this._attach(),this._root}unmount(){if(this._detach(),super.unm
`);d[0]=`> ${r}<${n}> ${d[0]}`;const h=d.join(`
> `)+`
`+t,m=c+la(t);return x_(s.id,e,h,m)}class sl extends il{constructor(e){super(e),this._pendingRedactions=null,this._pendingAnnotations=null,this._contextEntry=null,this._contextForEntries=null}get isReply(){var e;return!!((e=this.relation)!=null&&e["m.in_reply_to"])}get isRedacting(){return!!this._pendingRedactions}get isRedacted(){return this.isRedacting}get isRedaction(){return this.eventType===Ce}get redactionReason(){var e;return this._pendingRedactions?(e=this._pendingRedactions[0].content)==null?void 0:e.reason:null}setContextEntry(e){this._contextEntry=e,e._setAsContextOf(this)}_setAsContextOf(e){this._contextForEntries||(this._contextForEntries=[]),this._contextForEntries.push(e)}get contextForEntries(){return this._contextForEntries}get contextEntry(){return this._contextEntry}addLocalRelation(e){if(e.eventType===Ce&&e.isRelatedToId(this.id)){if(this._pendingRedactions||(this._pendingRedactions=[]),this._pendingRedactions.push(e),this._pendingRedactions.length===1)return"isRedacted"}else{const t=e.redactingEntry||e;if(t.isRelatedToId(this.id)&&t.relation.rel_type===at&&this._addPendingAnnotation(e))return"pendingAnnotations"}}removeLocalRelation(e){var t;if(e.eventType===Ce&&e.isRelatedToId(this.id)&&this._pendingRedactions){const i=this._pendingRedactions.length;if(this._pendingRedactions=this._pendingRedactions.filter(r=>r!==e),this._pendingRedactions.length===0&&(this._pendingRedactions=null,i!==0))return"isRedacted"}else{const i=e.redactingEntry||e;if(i.isRelatedToId(this.id)&&((t=i.relation)==null?void 0:t.rel_type)===at&&this._pendingAnnotations&&this._removePendingAnnotation(e))return"pendingAnnotations"}}_addPendingAnnotation(e){this._pendingAnnotations||(this._pendingAnnotations=new Map);const{key:t}=(e.redactingEntry||e).relation;if(t){let i=this._pendingAnnotations.get(t);return i||(i=new E_,this._pendingAnnotations.set(t,i)),i.add(e),!0}return!1}_removePendingAnnotation(e){const{key:t}=(e.redactingEntry||e).relation;if(t){let i=this._pendingAnnotations.get(t);return i.remove(e)&&i.isEmpty&&this._pendingAnnotations.delete(t),this._pendingAnnotations.size===0&&(this._pendingAnnotations=null),!0}return!1}async abortPendingRedaction(){if(this._pendingRedactions)for(const e of this._pendingRedactions)await e.pendingEvent.abort()}get pendingRedaction(){return this._pendingRedactions?this._pendingRedactions[0]:null}annotate(e){return b_(this.id,e)}reply(e,t){return k_(this,e,t)}isRelatedToId(e){return e&&this.relatedEventId===e}haveAnnotation(e){var t,i,r;const n=((i=(t=this.annotations)==null?void 0:t[e])==null?void 0:i.me)||!1,o=(r=this.pendingAnnotations)==null?void 0:r.get(e),a=o?.willAnnotate||!1;return n&&(!o||a)||!n&&a}get relation(){return mt(this.content)}get pendingAnnotations(){return this._pendingAnnotations}get annotations(){return null}}class R_ extends sl{constructor({pendingEvent:e,member:t,clock:i,redactingEntry:r}){super(null),this._pendingEvent=e,this._member=t,this._timestamp=i.now()-(100-e.queueIndex),this._redactingEntry=r}get fragmentId(){return Js}get entryIndex(){return this._pendingEvent.queueIndex}get content(){return this._pendingEvent.content}get event(){return null}get eventType(){return this._pendingEvent.eventType}get stateKey(){return null}get sender(){var e;return(e=this._member)==null?void 0:e.userId}get displayName(){var e;return(e=this._member)==null?void 0:e.name}get avatarUrl(){var e;return(e=this._member)==null?void 0:e.avatarUrl}get timestamp(){return this._timestamp}get isPending(){return!0}get id(){return this._pendingEvent.txnId}get pendingEvent(){return this._pendingEvent}notifyUpdate(){}isRelatedToId(e){return e&&e===this._pendingEvent.relatedTxnId?!0:super.isRelatedToId(e)}get relatedEventId(){return this._pendingEvent.relatedEventId}get redactingEntry(){return this._redactingEntry}get contextEventId(){var e;return this.isReply?(e=this._pendingEvent.relatedEventId)!=null?e:this._pendingEvent.relatedTxnId:null}}const P=We("Waiting","EncryptingAttachments","UploadingAttachments","Encrypting","Sending","Sent","Error"),da=["m.relates_to"];class A_{constructor({data
* @license
* Based off baseSortedIndex function in Lodash <https://lodash.com/>
* Copyright JS Foundation and other contributors <https://js.foundation/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/function ct(s,e,t){let i=0,r=s.length;for(;i<r;){let n=i+r>>>1,o=t(e,s[n]);o>0?i=n+1:o<0?r=n:i=r=n}return r}class H_ extends ui{constructor(e,t){super(),this._sourceMap=e,this._comparator=(i,r)=>t(i.value,r.value),this._sortedPairs=null,this._mapSubscription=null}onAdd(e,t){const i={key:e,value:t},r=ct(this._sortedPairs,i,this._comparator);this._sortedPairs.splice(r,0,i),this.emitAdd(r,t)}onRemove(e,t){const i={key:e,value:t},r=ct(this._sortedPairs,i,this._comparator);this._sortedPairs.splice(r,1),this.emitRemove(r,t)}onUpdate(e,t,i){if(!this._sortedPairs)return;const r=this._sortedPairs.findIndex(a=>a.key===e);this._sortedPairs.splice(r,1);const n={key:e,value:t},o=ct(this._sortedPairs,n,this._comparator);this._sortedPairs.splice(o,0,n),r!==o&&this.emitMove(r,o,t),this.emitUpdate(o,t,i)}onReset(){this._sortedPairs=[],this.emitReset()}onSubscribeFirst(){this._mapSubscription=this._sourceMap.subscribe(this),this._sortedPairs=new Array(this._sourceMap.size);let e=0;for(let[t,i]of this._sourceMap)this._sortedPairs[e]={key:t,value:i},++e;this._sortedPairs.sort(this._comparator),super.onSubscribeFirst()}onUnsubscribeLast(){super.onUnsubscribeLast(),this._sortedPairs=null,this._mapSubscription=this._mapSubscription()}get(e){return this._sortedPairs[e].value}get length(){return this._sourceMap.size}[Symbol.iterator](){const e=this._sortedPairs.values();return{next(){const t=e.next();return t.value&&(t.value=t.value.value),t}}}}class Zr extends fn{constructor(){super()}emitReset(){for(let e of this._handlers)e.onReset()}emitAdd(e,t){for(let i of this._handlers)i.onAdd(e,t)}emitUpdate(e,t,i){for(let r of this._handlers)r.onUpdate(e,t,i)}emitRemove(e,t){for(let i of this._handlers)i.onRemove(e,t)}join(...e){return new J_([this].concat(e))}mapValues(e,t){return new Z_(this,e,t)}sortValues(e){return new H_(this,e)}filterValues(e){return new W_(this,e)}}class W_ extends Zr{constructor(e,t){super(),this._source=e,this._filter=t}setFilter(e){this._filter=e,this._subscription&&this._reapplyFilter()}_reapplyFilter(e=!1){if(this._filter){const t=this._included;this._included=this._included||new Map;for(const[i,r]of this._source){const n=this._filter(r,i);if(this._included.set(i,n),!e){const o=t?t.get(i):!0;this._emitForUpdate(o,n,i,r)}}}else{if(this._included&&!e)for(const[t,i]of this._source)this._included.get(t)||this.emitAdd(t,i);this._included=void 0}}onAdd(e,t){if(this._filter)if(this._included){const i=this._filter(t,e);if(this._included.set(e,i),!i)return}else throw new Error("Internal logic error: FilteredMap._included used before initialized");this.emitAdd(e,t)}onRemove(e,t){var i;const r=!this._filter||((i=this._included)==null?void 0:i.get(e));if(this._included)this._included.delete(e),r&&this.emitRemove(e,t);else throw new Error("Internal logic error: FilteredMap._included used before initialized")}onUpdate(e,t,i){if(!!this._included)if(this._filter){const r=this._included.get(e),n=this._filter(t,e);this._included.set(e,n),this._emitForUpdate(r,n,e,t,i)}else this.emitUpdate(e,t,i)}_emitForUpdate(e,t,i,r,n=null){e&&!t?this.emitRemove(i,r):!e&&t?this.emitAdd(i,r):e&&t&&this.emitUpdate(i,r,n)}onSubscribeFirst(){this._subscription=this._source.subscribe(this),this._reapplyFilter(!0),super.onSubscribeFirst()}onUnsubscribeLast(){super.onUnsubscribeLast(),this._included=void 0,this._subscription&&(this._subscription=this._subscription())}onReset(){this._reapplyFilter(),this.emitReset()}[Symbol.iterator](){return new Y_(this._source,this._included)}get size(){var e;let t=0;return(e=this._included)==null||e.forEach(i=>{i&&(t+=1)}),t}get(e){const t=this._source.get(e);if(t&&this._filter(t,e))return t}}class Y_{constructor(e,t){this._included=t,this._sourceIterator=e[Symbol.iterator]()}next(){for(var e;;){const t=this._sourceIterator.next();if(t.done)return t;const i=t.value[0];if((e=this._included)!=null&&e.get(i))return t}}}class J_ extends Zr{constructor(e){super(),this._sources=e}onAdd(e,t,i){if(!this._isKeyAtSourceOccluded(e,t)){const r=this._getValueFromOccludedSources(e,t);r!==void 0&&this.emitRemove(t,r),this.emitAdd(t,i)}}on
${e.stack}`),this._error=e,e instanceof Se&&(this.emitChange("error"),await this._waitForReconnection()),e}finally{this._loading=!1,this._showSpinner=!1,this.emitChange("isLoading")}return!0}return!1}async notifyVisible(){let e=0,t;this._siblingChanged=!1;do{try{t=await this.fill()}catch(i){if(i instanceof Se){t=!0;continue}else t=!1}e=e+1}while(e<10&&!this._siblingChanged&&t&&!this.isDisposed)}get isAtTop(){return this._isAtTop}updatePreviousSibling(e){super.updatePreviousSibling(e);const t=!e;this._isAtTop!==t&&(this._isAtTop=t,this.emitChange("isAtTop")),this._siblingChanged=!0}updateNextSibling(){this._siblingChanged=!0}updateEntry(e,t){return super.updateEntry(e,t),e.isGap?Ae.Nothing():Ae.Remove()}async _waitForReconnection(){await this.options.client.reconnector.connectionStatus.waitFor(e=>e===In.Online).promise}get shape(){return"gap"}get isLoading(){return this._loading}get showSpinner(){return this._showSpinner}get error(){return this._error?this._error instanceof Se?"Waiting for reconnection":`Could not load ${this._entry.prev_batch?"previous":"next"} messages: ${this._error.message}`:null}get currentAction(){return this.error?this.error:this.isLoading?"Loading":"Not Loading"}}class dy{constructor(e){this._parentTile=e,this._map=new Ni,this._reactions=this._map.sortValues((t,i)=>t._compare(i))}update(e,t){if(e){for(const i in e)if(e.hasOwnProperty(i)){const r=e[i],n=this._map.get(i);n?n._tryUpdate(r)&&this._map.update(i):this._map.add(i,new xa(i,r,null,this._parentTile))}}if(t)for(const[i,r]of t.entries()){const n=this._map.get(i);n?(n._tryUpdatePending(r),this._map.update(i)):this._map.add(i,new xa(i,null,r,this._parentTile))}for(const i of this._map.keys()){const r=t?.has(i),n=e?.hasOwnProperty(i);!n&&!r?this._map.remove(i):n?r||this._map.get(i)._tryUpdatePending(null)&&this._map.update(i):this._map.get(i)._tryUpdate(null)&&this._map.update(i)}}get reactions(){return this._reactions}getReaction(e){return this._map.get(e)}}class xa{constructor(e,t,i,r){this._key=e,this._annotation=t,this._pending=i,this._parentTile=r,this._isToggling=!1}_tryUpdate(e){const t=!!this._annotation!=!!e,r=this._annotation&&e&&(e.me!==this._annotation.me||e.count!==this._annotation.count||e.firstTimestamp!==this._annotation.firstTimestamp);return t||r?(this._annotation=e,!0):!1}_tryUpdatePending(e){return!e&&!this._pending?!1:(this._pending=e,!0)}get key(){return this._key}get count(){var e,t;return(((e=this._pending)==null?void 0:e.count)||0)+(((t=this._annotation)==null?void 0:t.count)||0)}get isPending(){return this._pending!==null}get isActive(){var e;return((e=this._annotation)==null?void 0:e.me)||this.isPending}get firstTimestamp(){let e=Number.MAX_SAFE_INTEGER;return this._annotation&&(e=Math.min(e,this._annotation.firstTimestamp)),this._pending&&(e=Math.min(e,this._pending.firstTimestamp)),e}_compare(e){if(e===this)return 0;if(this.count!==e.count)return e.count-this.count;{const t=this.firstTimestamp-e.firstTimestamp;return t===0?this.key<e.key?-1:1:t}}async toggle(e=null){if(this._isToggling){console.log("busy toggling reaction already");return}this._isToggling=!0;try{await this._parentTile.toggleReaction(this.key,e)}finally{this._isToggling=!1}}}class yt extends Zi{constructor(e,t){super(e,t),this._date=this._entry.timestamp?new Date(this._entry.timestamp):null,this._isContinuation=!1,this._reactions=null,this._replyTile=null,(this._entry.annotations||this._entry.pendingAnnotations)&&this._updateReactions(),this._updateReplyTileIfNeeded(void 0)}notifyVisible(){var e;super.notifyVisible(),(e=this._replyTile)==null||e.notifyVisible()}get _mediaRepository(){return this._room.mediaRepository}get permaLink(){return`https://matrix.to/#/${encodeURIComponent(this._room.id)}/${encodeURIComponent(this._entry.id)}`}get senderProfileLink(){return`https://matrix.to/#/${encodeURIComponent(this.sender)}`}get displayName(){return this._entry.displayName||this.sender}get sender(){return this._entry.sender}get memberPanelLink(){return`${this.urlCreator.urlUntilSegment("room")}/member/${this.sender}`}get avatarColorNumber(){return Ln(this.
`),i=(r,n)=>{n?e.push(new rn(r,[new ni(r)])):e.push(new ni(r))};for(let r=0;r<t.length;r+=1){const n=t[r];n.length&&Tl(n,i),r>=t.length-1||e.push(new xl)}return new Fn(s,e)}function gy(s){return new Fn(s,[new ni(s)])}class yy{constructor(e,t){this.level=e,this.inlines=t}get type(){return"header"}}class Ra{constructor(e,t){this.language=e,this.text=t}get type(){return"codeblock"}}class vy{constructor(e,t){this.items=t,this.startOffset=e}get type(){return"list"}}class wy{constructor(e,t){this.head=e,this.body=t}get type(){return"table"}}class by{get type(){return"rule"}}class xl{get type(){return"newline"}}class br{constructor(e,t){this.format=e.toLowerCase(),this.children=t}get type(){return"format"}}class Sy{constructor(e,t,i,r,n){this.src=e,this.width=t,this.height=i,this.alt=r,this.title=n}get type(){return"image"}}class Ey{constructor(e,t,i){this.id=e,this.href=t,this.children=i}get type(){return"pill"}get avatarColorNumber(){return Ln(this.id)}get avatarInitials(){return Bn(this.id)}}class rn{constructor(e,t){this.url=e,this.inlines=t}get type(){return"link"}}class ni{constructor(e){this.text=e}get type(){return"text"}}function Iy(s){return s.type==="format"&&s.format==="blockquote"}class Fn{constructor(e,t){this.sourceString=e,this.parts=t}insertEmote(e){let t=0;for(;t<this.parts.length&&Iy(this.parts[t]);t++);this.parts.splice(t,0,new ni(e))}}const xi=We("Plain","Html");class kl extends yt{constructor(e,t){super(e,t),this._messageBody=null,this._format=null}get shape(){return"message"}_parseBody(e){return gy(e)}_getBodyFormat(){return xi.Plain}get body(){const e=this._getBody(),t=this._getBodyFormat();return(!this._messageBody||this._messageBody.sourceString!==e||this._format!==t)&&(this._messageBody=this._parseBody(e,t),this._format=t),this._messageBody}}const Ty=["EM","STRONG","CODE","DEL","SPAN"],xy=["DIV","BLOCKQUOTE"],ky=["https","http","ftp","mailto","magnet"].map(s=>`${s}://`),Ry="https://matrix.to",Aa=`${Ry}/#/`;class Ay{constructor(e,t){this.result=e,this.mediaRepository=t}parsePillLink(e){if(!e.startsWith(Aa))return null;const t=e.substring(Aa.length);return t[0]==="@"?t:null}parseLink(e,t){const i=this.result.getAttributeValue(e,"href"),r=i?.toLowerCase();if(!r||!ky.some(o=>r.startsWith(o)))return new br("span",t);const n=this.parsePillLink(i);return n?new Ey(n,i,t):new rn(i,t)}parseList(e){const t=this.result;let i=null;t.getNodeElementName(e)==="OL"&&(i=parseInt(t.getAttributeValue(e,"start"))||1);const r=[];for(const n of t.getChildNodes(e)){if(t.getNodeElementName(n)!=="LI")continue;const o=this.parseAnyNodes(t.getChildNodes(n));r.push(o)}return new vy(i,r)}_ensureElement(e,t){return e&&this.result.isElementNode(e)&&this.result.getNodeElementName(e)===t}parseCodeBlock(e){const t=this.result;let i;for(const o of t.getChildNodes(e)){i=o;break}let r=null;if(!this._ensureElement(i,"CODE"))return new Ra(r,this.result.getNodeText(e));const n=t.getAttributeValue(i,"class")||"";for(const o of n.split(" "))if(o.startsWith("language-")&&!o.startsWith("language-_")){r=o.substring(9);break}return new Ra(r,this.result.getNodeText(i))}parseImage(e){const t=this.result,i=t.getAttributeValue(e,"src")||"",r=this.mediaRepository.mxcUrl(i);if(!r)return null;const n=parseInt(t.getAttributeValue(e,"width"))||null,o=parseInt(t.getAttributeValue(e,"height"))||null,a=t.getAttributeValue(e,"alt"),c=t.getAttributeValue(e,"title");return new Sy(r,n,o,a,c)}parseTableRow(e,t){const i=[];for(const r of this.result.getChildNodes(e)){if(!this._ensureElement(r,t))continue;const n=this.result.getChildNodes(r),o=this.parseInlineNodes(n);i.push(o)}return i}parseTableHead(e){let t=null;for(const i of this.result.getChildNodes(e)){t=i;break}return this._ensureElement(t,"TR")?this.parseTableRow(t,"TH"):null}parseTableBody(e){const t=[];for(const i of this.result.getChildNodes(e))!this._ensureElement(i,"TR")||t.push(this.parseTableRow(i,"TD"));return t}parseTable(e){const t=Array.from(this.result.getChildNodes(e));let i,r;return this._ensureElement(t[0],"THEAD")&&this._ensureElement(t[1],"TBODY")?(i=this.parseTableHead(t[0]),r=this.parseT
${e.stack}`),this._timelineError=e,this.emitChange("error")}this._clearUnreadAfterDelay()}async _recreateComposerOnPowerLevelChange(){const e=await this._room.observePowerLevels(),t=()=>e.get().canSendType("m.room.message");let i=t();const r=n=>{this._composerVM=this.disposeTracked(this._composerVM),n?this._composerVM=this.track(new cy(this)):this._composerVM=this.track(new $y(this.childOptions())),this.emitChange("powerLevelObservable")};this.track(e.subscribe(()=>{const n=t();i!==n&&(r(n),i=n)})),r(i)}async _clearUnreadAfterDelay(){if(!(this._room.isArchived||this._clearUnreadTimout)){this._clearUnreadTimout=this.clock.createTimeout(2e3);try{await this._clearUnreadTimout.elapsed(),await this._room.clearUnread(),this._clearUnreadTimout=null}catch(e){if(e.name!=="AbortError")throw e}}}focus(){this._clearUnreadAfterDelay()}dispose(){super.dispose(),this._room.off("change",this._onRoomChange),this._room.isArchived&&this._room.release(),this._clearUnreadTimout&&(this._clearUnreadTimout.abort(),this._clearUnreadTimout=null)}_onRoomChange(){var e;(e=this._composerVM)==null||e.emitChange(),this.emitChange()}get kind(){return"room"}get closeUrl(){return this._closeUrl}get name(){return this._room.name||this.i18n`Empty Room`}get id(){return this._room.id}get timelineViewModel(){return this._timelineVM}get isEncrypted(){return this._room.isEncrypted}get error(){return this._timelineError?`Something went wrong loading the timeline: ${this._timelineError.message}`:this._sendError?`Something went wrong sending your message: ${this._sendError.message}`:""}get avatarLetter(){return Bn(this.name)}get avatarColorNumber(){return Ln(this._room.avatarColorId)}avatarUrl(e){return El(this._room.avatarUrl,e,this.platform,this._room.mediaRepository)}get avatarTitle(){return this.name}get canLeave(){return this._room.isJoined}leaveRoom(){this._room.leave()}get canForget(){return this._room.isArchived}forgetRoom(){this._room.forget()}get canRejoin(){return this._room.isArchived}rejoinRoom(){this._room.join()}_createTile(e){if(this._tileOptions){const t=this._tileOptions.tileClassForEntry(e);if(t)return new t(e,this._tileOptions)}}async _processCommandJoin(e){try{const t=this._options.client.session,i=await Ly(e,t);this.navigation.push("room",i)}catch(t){this._sendError=t,this._timelineError=null,this.emitChange("error")}}async _processCommand(e){let t;const[i,...r]=e.substring(1).split(" ");switch(i){case"me":e=r.join(" "),t="m.emote";break;case"join":if(r.length===1){const n=r[0];await this._processCommandJoin(n)}else this._sendError=new Error("join syntax: /join <room-id>"),this._timelineError=null,this.emitChange("error");break;case"shrug":e="\xAF\\_(\u30C4)_/\xAF "+r.join(" "),t="m.text";break;case"tableflip":e="(\u256F\xB0\u25A1\xB0\uFF09\u256F\uFE35 \u253B\u2501\u253B "+r.join(" "),t="m.text";break;case"unflip":e="\u252C\u2500\u2500\u252C \u30CE( \u309C-\u309C\u30CE) "+r.join(" "),t="m.text";break;case"lenny":e="( \u0361\xB0 \u035C\u0296 \u0361\xB0) "+r.join(" "),t="m.text";break;default:this._sendError=new Error(`no command name "${i}". To send the message instead of executing, please type "/${e}"`),this._timelineError=null,this.emitChange("error"),e=void 0}return{type:t,message:e}}async _sendMessage(e,t){if(!this._room.isArchived&&e){let i={type:"m.text",message:e};e.startsWith("//")?i.message=e.substring(1).trim():e.startsWith("/")&&(i=await this._processCommand(e));try{const r=i.type,n=i.message;r&&n&&(t?await t.reply(r,n):await this._room.sendEvent("m.room.message",{msgtype:r,body:n}))}catch(r){return console.error(`room.sendMessage(): ${r.message}:
${r.stack}`),this._sendError=r,this._timelineError=null,this.emitChange("error"),!1}return!0}return!1}async _pickAndSendFile(){try{const e=await this.platform.openFile();return e?this._sendFile(e):void 0}catch(e){console.error(e)}}async _sendFile(e){const t={body:e.name,msgtype:"m.file"};await this._room.sendEvent("m.room.message",t,{url:this._room.createAttachment(e.blob,e.name)})}async _pickAndSendVideo(){try{if(!this.platform.hasReadPixelPermission()){alert("Please allow canvas image data access, so we can scale your images down.");return}const e=await this.platform.openFile("video/*");if(!e)return;if(!e.blob.mimeType.startsWith("video/"))return this._sendFile(e);let t;try{t=await this.platform.loadVideo(e.blob)}catch(c){throw c instanceof window.MediaError&&c.code===4?new Error(`this browser does not support videos of type ${e?.blob.mimeType}.`):c}const i={body:e.name,msgtype:"m.video",info:Vy(t)},r={url:this._room.createAttachment(t.blob,e.name)},o=await this.platform.settingsStorage.getInt("sentImageSizeLimit")||Math.min(t.maxDimension,800),a=await t.scale(o);i.info.thumbnail_info=Dr(a),r["info.thumbnail_url"]=this._room.createAttachment(a.blob,e.name),await this._room.sendEvent("m.room.message",i,r)}catch(e){this._sendError=e,this.emitChange("error"),console.error(e.stack)}}async _pickAndSendPicture(){try{if(!this.platform.hasReadPixelPermission()){alert("Please allow canvas image data access, so we can scale your images down.");return}const e=await this.platform.openFile("image/*");if(!e)return;if(!e.blob.mimeType.startsWith("image/"))return this._sendFile(e);let t=await this.platform.loadImage(e.blob);const i=await this.platform.settingsStorage.getInt("sentImageSizeLimit");if(i&&t.maxDimension>i){const o=await t.scale(i);t.dispose(),t=o}const r={body:e.name,msgtype:"m.image",info:Dr(t)},n={url:this._room.createAttachment(t.blob,e.name)};if(t.maxDimension>600){const o=await t.scale(400);r.info.thumbnail_info=Dr(o),n["info.thumbnail_url"]=this._room.createAttachment(o.blob,e.name)}await this._room.sendEvent("m.room.message",r,n)}catch(e){this._sendError=e,this.emitChange("error"),console.error(e.stack)}}get room(){return this._room}get composerViewModel(){return this._composerVM}openDetailsPanel(){let e=this.navigation.path.until("room");e=e.with(this.navigation.segment("right-panel",!0)),e=e.with(this.navigation.segment("details",!0)),this.navigation.applyPath(e)}startReply(e){this._room.isArchived||this._composerVM.setReplyingTo(e)}dismissError(){this._sendError=null,this.emitChange("error")}}function Vy(s){const e=Dr(s);return e.duration=s.duration,e}class Ky extends Pe{constructor(e){super(e),this._archivedRoom=e.archivedRoom}get description(){return this._archivedRoom.isKicked?this._archivedRoom.kickReason?this.i18n`You were kicked from the room by ${this._archivedRoom.kickedBy.name} because: ${this._archivedRoom.kickReason}`:this.i18n`You were kicked from the room by ${this._archivedRoom.kickedBy.name}.`:this._archivedRoom.isBanned?this._archivedRoom.kickReason?this.i18n`You were banned from the room by ${this._archivedRoom.kickedBy.name} because: ${this._archivedRoom.kickReason}`:this.i18n`You were banned from the room by ${this._archivedRoom.kickedBy.name}.`:this.i18n`You left this room`}get kind(){return"disabled"}}class $y extends Pe{get description(){return this.i18n`You do not have the powerlevel necessary to send messages`}get kind(){return"disabled"}}We("Disconnected","Connecting","FirstSync","Sending","Syncing","SyncError");We("Enabled","SetupKey","SetupPhrase","Pending","NewVersionAvailable");We("Writing","Stopped","Done","Pending");class jy extends Rl{get displayName(){return this.isOwn?"me":super.displayName}get avatarLetter(){return""}avatarUrl(e){return this.isOwn?this._options.config.avatar??null:super.avatarUrl(e)}}class Gy extends Cl{get displayName(){return this.isOwn?"me":super.displayName}get avatarLetter(){return""}avatarUrl(e){return this.isOwn?this._options.config.avatar??null:super.avatarUrl(e)}}class qy extends Nl{get displayName(){return this.isOwn?"me":super.displayName}get avatar
`).slice(i))for(var o of e){var a=o(n);if(a){r.push(a);break}}return Uv(r)}}function Ov(s){return Array.isArray(s)?Hl(...s):s}function Uv(s){if(!s.length)return[];let e=s;var t=e[0].function||"",i=e[e.length-1].function||"";return(t.indexOf("captureMessage")!==-1||t.indexOf("captureException")!==-1)&&(e=e.slice(1)),i.indexOf("sentryWrapped")!==-1&&(e=e.slice(0,-1)),e.slice(0,Pv).map(r=>({...r,filename:r.filename||e[0].filename,function:r.function||"?"})).reverse()}var Ps="<anonymous>";function ft(s){try{return!s||typeof s!="function"?Ps:s.name||Ps}catch{return Ps}}function zn(){if(!("fetch"in M()))return!1;try{return new Headers,new Request(""),new Response,!0}catch{return!1}}function an(s){return s&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(s.toString())}function Bv(){if(!zn())return!1;var s=M();if(an(s.fetch))return!0;let e=!1;var t=s.document;if(t&&typeof t.createElement=="function")try{var i=t.createElement("iframe");i.hidden=!0,t.head.appendChild(i),i.contentWindow&&i.contentWindow.fetch&&(e=an(i.contentWindow.fetch)),t.head.removeChild(i)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function Lv(){var s=M(),e=s.chrome,t=e&&e.app&&e.app.runtime,i="history"in s&&!!s.history.pushState&&!!s.history.replaceState;return!t&&i}var U=M(),Di={},Oa={};function Fv(s){if(!Oa[s])switch(Oa[s]=!0,s){case"console":Vv();break;case"dom":Yv();break;case"xhr":Gv();break;case"fetch":Kv();break;case"history":qv();break;case"error":Jv();break;case"unhandledrejection":Xv();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("unknown instrumentation type:",s);return}}function he(s,e){Di[s]=Di[s]||[],Di[s].push(e),Fv(s)}function Ee(s,e){if(!(!s||!Di[s]))for(var t of Di[s]||[])try{t(e)}catch(i){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error(`Error while triggering instrumentation handler.
Type: ${s}
Name: ${ft(t)}
Error:`,i)}}function Vv(){"console"in U&&qr.forEach(function(s){s in U.console&&se(U.console,s,function(e){return function(...t){Ee("console",{args:t,level:s}),e&&e.apply(U.console,t)}})})}function Kv(){!Bv()||se(U,"fetch",function(s){return function(...e){var t={args:e,fetchData:{method:$v(e),url:jv(e)},startTimestamp:Date.now()};return Ee("fetch",{...t}),s.apply(U,e).then(i=>(Ee("fetch",{...t,endTimestamp:Date.now(),response:i}),i),i=>{throw Ee("fetch",{...t,endTimestamp:Date.now(),error:i}),i})}})}function $v(s=[]){return"Request"in U&&Ye(s[0],Request)&&s[0].method?String(s[0].method).toUpperCase():s[1]&&s[1].method?String(s[1].method).toUpperCase():"GET"}function jv(s=[]){return typeof s[0]=="string"?s[0]:"Request"in U&&Ye(s[0],Request)?s[0].url:String(s[0])}function Gv(){if("XMLHttpRequest"in U){var s=XMLHttpRequest.prototype;se(s,"open",function(e){return function(...t){var i=this,r=t[1],n=i.__sentry_xhr__={method:_t(t[0])?t[0].toUpperCase():t[0],url:t[1]};_t(r)&&n.method==="POST"&&r.match(/sentry_key/)&&(i.__sentry_own_request__=!0);var o=function(){if(i.readyState===4){try{n.status_code=i.status}catch{}Ee("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:i})}};return"onreadystatechange"in i&&typeof i.onreadystatechange=="function"?se(i,"onreadystatechange",function(a){return function(...c){return o(),a.apply(i,c)}}):i.addEventListener("readystatechange",o),e.apply(i,t)}}),se(s,"send",function(e){return function(...t){return this.__sentry_xhr__&&t[0]!==void 0&&(this.__sentry_xhr__.body=t[0]),Ee("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}})}}let Sr;function qv(){if(!Lv())return;var s=U.onpopstate;U.onpopstate=function(...t){var i=U.location.href,r=Sr;if(Sr=i,Ee("history",{from:r,to:i}),s)try{return s.apply(this,t)}catch{}};function e(t){return function(...i){var r=i.length>2?i[2]:void 0;if(r){var n=Sr,o=String(r);Sr=o,Ee("history",{from:n,to:o})}return t.apply(this,i)}}se(U.history,"pushState",e),se(U.history,"replaceState",e)}var zv=1e3;let Er,Ir;function Hv(s,e){if(!s||s.type!==e.type)return!0;try{if(s.target!==e.target)return!0}catch{}return!1}function Wv(s){if(s.type!=="keypress")return!1;try{var e=s.target;if(!e||!e.tagName)return!0;if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)return!1}catch{}return!0}function Ua(s,e=!1){return t=>{if(!(!t||Ir===t)&&!Wv(t)){var i=t.type==="keypress"?"input":t.type;Er===void 0?(s({event:t,name:i,global:e}),Ir=t):Hv(Ir,t)&&(s({event:t,name:i,global:e}),Ir=t),clearTimeout(Er),Er=U.setTimeout(()=>{Er=void 0},zv)}}}function Yv(){if("document"in U){var s=Ee.bind(null,"dom"),e=Ua(s,!0);U.document.addEventListener("click",e,!1),U.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(t=>{var i=U[t]&&U[t].prototype;!i||!i.hasOwnProperty||!i.hasOwnProperty("addEventListener")||(se(i,"addEventListener",function(r){return function(n,o,a){if(n==="click"||n=="keypress")try{var c=this,l=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=l[n]=l[n]||{refCount:0};if(!d.handler){var u=Ua(s);d.handler=u,r.call(this,n,u,a)}d.refCount+=1}catch{}return r.call(this,n,o,a)}}),se(i,"removeEventListener",function(r){return function(n,o,a){if(n==="click"||n=="keypress")try{var c=this,l=c.__sentry_instrumentation_handlers__||{},d=l[n];d&&(d.refCount-=1,d.refCount<=0&&(r.call(this,n,d.handler,a),d.handler=void 0,delete l[n]),Object.keys(l).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return r.call(this,n,o,a)}}))})}}let Os=null;function Jv(){Os=U.onerror,U.onerror=function(s,e,t,i,r){return Ee("error",{column:i,error:r,line:t,msg:s,url:e}),Os?Os.apply(this,arguments):!1}}let Us=null;function Xv(){Us=U.onunhandledrejection,U.onunhandledrejection=function(s){return Ee("unhandledrejection",s),Us?Us.apply(this,arguments):!0}}function Qv(){var s=typeof WeakSet=="function",e=s?new WeakSet:[];function t(r){if(s)return e.has(r)?!0:(e.add(r),!1);for(let o=0;o<e.length;o++){var n=e[o];if(n===r)return!0}return e.push(r),!1}function i(r){if(s)e.delete(r);else for(let n=0;n<e.length;n+
${JSON.stringify(a)}
`),n(typeof c=="string"||c instanceof Uint8Array?c:JSON.stringify(c))}return typeof r=="string"?r:dw(r)}function dw(s){var e=s.reduce((n,o)=>n+o.length,0),t=new Uint8Array(e);let i=0;for(var r of s)t.set(r,i),i+=r.length;return t}function uw(s,e){var t=typeof s.data=="string"?hn(s.data,e):s.data;return[lt({type:"attachment",length:t.length,filename:s.filename,content_type:s.contentType,attachment_type:s.attachmentType}),t]}var hw={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function Va(s){return hw[s]}function pw(s,e,t){var i=[{type:"client_report"},{timestamp:t||ts(),discarded_events:s}];return is(e?{dsn:e}:{},[i])}var mw=60*1e3;function _w(s,e=Date.now()){var t=parseInt(`${s}`,10);if(!isNaN(t))return t*1e3;var i=Date.parse(`${s}`);return isNaN(i)?mw:i-e}function fw(s,e){return s[e]||s.all||0}function gw(s,e,t=Date.now()){return fw(s,e)>t}function yw(s,{statusCode:e,headers:t},i=Date.now()){var r={...s},n=t&&t["x-sentry-rate-limits"],o=t&&t["retry-after"];if(n)for(var a of n.trim().split(",")){const[u,h]=a.split(":",2);var c=parseInt(u,10),l=(isNaN(c)?60:c)*1e3;if(!h)r.all=i+l;else for(var d of h.split(";"))r[d]=i+l}else o?r.all=i+_w(o,i):e===429&&(r.all=i+60*1e3);return r}var Wt="baggage",vw="sentry-",Ka=/^sentry-/,ww=8192;function zr(s,e="",t=!0){return[{...s},e,t]}function bw(s){return Object.keys(s[0]).length===0}function Xl(s){return s[0]}function Sw(s){return s[1]}function Ew(s){return s[2]}function Iw(s){s[2]=!1}function Tw(s){return Object.keys(s[0]).reduce((e,t)=>{var i=s[0][t],r=`${vw}${encodeURIComponent(t)}=${encodeURIComponent(i)}`,n=e===""?r:`${e},${r}`;return n.length>ww?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Not adding key: ${t} with val: ${i} to baggage due to exceeding baggage size limits.`),e):n},s[1])}function Ql(s,e=!1){if(!Array.isArray(s)&&!_t(s)||typeof s=="number")return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn("[parseBaggageHeader] Received input value of incompatible type: ",typeof s,s),zr({},"");var t=(_t(s)?s:s.join(",")).split(",").map(i=>i.trim()).filter(i=>i!==""&&(e||Ka.test(i)));return t.reduce(([i,r],n)=>{const[o,a]=n.split("=");if(Ka.test(o)){var c=decodeURIComponent(o.split("-")[1]);return[{...i,[c]:decodeURIComponent(a)},r,!0]}else return[i,r===""?n:`${r},${n}`,!0]},[{},"",!0])}function ki(s,e){if(!s&&!e)return"";var t=e&&Ql(e,!0)||void 0,i=t&&Sw(t),r=zr(s&&s[0]||{},i||"");return Tw(r)}function xw(s,e){var t=Ql(s||"");return(e||!bw(t))&&Iw(t),t}function kw(s){var e=Hn(),t={sid:dt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Aw(t)};return s&&ai(t,s),t}function ai(s,e={}){if(e.user&&(!s.ipAddress&&e.user.ip_address&&(s.ipAddress=e.user.ip_address),!s.did&&!e.did&&(s.did=e.user.id||e.user.email||e.user.username)),s.timestamp=e.timestamp||Hn(),e.ignoreDuration&&(s.ignoreDuration=e.ignoreDuration),e.sid&&(s.sid=e.sid.length===32?e.sid:dt()),e.init!==void 0&&(s.init=e.init),!s.did&&e.did&&(s.did=`${e.did}`),typeof e.started=="number"&&(s.started=e.started),s.ignoreDuration)s.duration=void 0;else if(typeof e.duration=="number")s.duration=e.duration;else{var t=s.timestamp-s.started;s.duration=t>=0?t:0}e.release&&(s.release=e.release),e.environment&&(s.environment=e.environment),!s.ipAddress&&e.ipAddress&&(s.ipAddress=e.ipAddress),!s.userAgent&&e.userAgent&&(s.userAgent=e.userAgent),typeof e.errors=="number"&&(s.errors=e.errors),e.status&&(s.status=e.status)}function Rw(s,e){let t={};e?t={status:e}:s.status==="ok"&&(t={status:"exited"}),ai(s,t)}function Aw(s){return lt({sid:`${s.sid}`,init:s.init,started:new Date(s.started*1e3).toISOString(),timestamp:new Date(s.timestamp*1e3).toISOString(),status:s.status,errors:s.errors,did:typeof s.did=="number"||typeof s.did=="string"?`${s.did}`:void 0,duration:s.duration,attrs:{release:s.release,environment:s.environment,ip_address:s.ipAddress,user_agent:s.userAgent}})}var $a=100;class ut{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProce
Reason: ${a}`))})}_process(e){this._numProcessing+=1,e.then(t=>(this._numProcessing-=1,t),t=>(this._numProcessing-=1,t))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,t=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error("Error while sending event:",t)}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error("Transport disabled")}_clearOutcomes(){var e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[i,r]=t.split(":");return{reason:i,category:r,quantity:e[t]}})}}function jw(s){var e="`beforeSend` method has to return `null` or a valid event.";if($n(s))return s.then(t=>{if(!(oi(t)||t===null))throw new re(e);return t},t=>{throw new re(`beforeSend rejected with ${t}`)});if(!(oi(s)||s===null))throw new re(e);return s}function Gw(s,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?y.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));var t=V(),i=t.getScope();i&&i.update(e.initialScope);var r=new s(e);t.bindClient(r)}var qw=30;function sd(s,e,t=iw(s.bufferSize||qw)){let i={};var r=o=>t.drain(o);function n(o){var a=[];if(Fa(o,(u,h)=>{var m=Va(h);gw(i,m)?s.recordDroppedEvent("ratelimit_backoff",m):a.push(u)}),a.length===0)return Lt();var c=is(o[0],a),l=u=>{Fa(c,(h,m)=>{s.recordDroppedEvent(u,Va(m))})},d=()=>e({body:Jl(c,s.textEncoder)}).then(u=>{u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),i=yw(i,u)},u=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error("Failed while sending event:",u),l("network_error")});return t.add(d).then(u=>u,u=>{if(u instanceof re)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error("Skipped sending event due to full buffer"),l("queue_overflow"),Lt();throw u})}return{send:n,flush:r}}var Ha="7.5.0";let Wa;class zi{constructor(){zi.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=zi.id}setupOnce(){Wa=Function.prototype.toString,Function.prototype.toString=function(...e){var t=qn(this)||this;return Wa.apply(t,e)}}}zi.__initStatic();var zw=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class Qt{static __initStatic(){this.id="InboundFilters"}__init(){this.name=Qt.id}constructor(e={}){this._options=e,Qt.prototype.__init.call(this)}setupOnce(e,t){var i=r=>{var n=t();if(n){var o=n.getIntegration(Qt);if(o){var a=n.getClient(),c=a?a.getOptions():{},l=Hw(o._options,c);return Ww(r,l)?null:r}}return r};i.id=this.name,e(i)}}Qt.__initStatic();function Hw(s={},e={}){return{allowUrls:[...s.allowUrls||[],...e.allowUrls||[]],denyUrls:[...s.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...s.ignoreErrors||[],...e.ignoreErrors||[],...zw],ignoreInternal:s.ignoreInternal!==void 0?s.ignoreInternal:!0}}function Ww(s,e){return e.ignoreInternal&&Zw(s)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to being internal Sentry Error.
Event: ${Ct(s)}`),!0):Yw(s,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${Ct(s)}`),!0):Jw(s,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${Ct(s)}.
Url: ${Hr(s)}`),!0):Xw(s,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${Ct(s)}.
Url: ${Hr(s)}`),!0)}function Yw(s,e){return!e||!e.length?!1:Qw(s).some(t=>e.some(i=>$i(t,i)))}function Jw(s,e){if(!e||!e.length)return!1;var t=Hr(s);return t?e.some(i=>$i(t,i)):!1}function Xw(s,e){if(!e||!e.length)return!0;var t=Hr(s);return t?e.some(i=>$i(t,i)):!0}function Qw(s){if(s.message)return[s.message];if(s.exception)try{const{type:e="",value:t=""}=s.exception.values&&s.exception.values[0]||{};return[`${t}`,`${e}: ${t}`]}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error(`Cannot extract message for event ${Ct(s)}`),[]}return[]}function Zw(s){try{return s.exception.values[0].type==="SentryError"}catch{}return!1}function eb(s=[]){for(let t=s.length-1;t>=0;t--){var e=s[t];if(e&&e.filename!=="<anonymous>"&&e.filename!=="[native code]")return e.filename||null}return null}function Hr(s){try{let e;try{e=s.exception.values[0].stacktrace.frames}catch{}return e?eb(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&y.error(`Cannot extract url for event ${Ct(s)}`),null}}function nd(s,e){var t=Xn(s,e),i={type:e&&e.name,value:sb(e)};return t.length&&(i.stacktrace={frames:t}),i.type===void 0&&i.value===""&&(i.value="Unrecoverable error caught"),i}function tb(s,e,t,i){var r={exception:{values:[{type:Kn(e)?e.constructor.name:i?"UnhandledRejection":"Error",value:`Non-Error ${i?"promise rejection":"exception"} captured with keys: ${Dv(e)}`}]},extra:{__serialized__:Yl(e)}};if(t){var n=Xn(s,t);n.length&&(r.exception.values[0].stacktrace={frames:n})}return r}function Fs(s,e){return{exception:{values:[nd(s,e)]}}}function Xn(s,e){var t=e.stacktrace||e.stack||"",i=rb(e);try{return s(t,i)}catch{}return[]}var ib=/Minified React error #\d+;/i;function rb(s){if(s){if(typeof s.framesToPop=="number")return s.framesToPop;if(ib.test(s.message))return 1}return 0}function sb(s){var e=s&&s.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function nb(s,e,t,i){var r=t&&t.syntheticException||void 0,n=Qn(s,e,r,i);return ji(n),n.level="error",t&&t.event_id&&(n.event_id=t.event_id),Lt(n)}function ob(s,e,t="info",i,r){var n=i&&i.syntheticException||void 0,o=pn(s,e,n,r);return o.level=t,i&&i.event_id&&(o.event_id=i.event_id),Lt(o)}function Qn(s,e,t,i,r){let n;if(Vl(e)&&e.error){var o=e;return Fs(s,o.error)}if(Ca(e)||vv(e)){var a=e;if("stack"in e)n=Fs(s,e);else{var c=a.name||(Ca(a)?"DOMError":"DOMException"),l=a.message?`${c}: ${a.message}`:c;n=pn(s,l,t,i),cn(n,l)}return"code"in a&&(n.tags={...n.tags,"DOMException.code":`${a.code}`}),n}if(Fl(e))return Fs(s,e);if(oi(e)||Kn(e)){var d=e;return n=tb(s,d,t,r),ji(n,{synthetic:!0}),n}return n=pn(s,e,t,i),cn(n,`${e}`,void 0),ji(n,{synthetic:!0}),n}function pn(s,e,t,i){var r={message:e};if(i&&t){var n=Xn(s,t);n.length&&(r.exception={values:[{value:e,stacktrace:{frames:n}}]})}return r}var od="Breadcrumbs";class Hi{static __initStatic(){this.id=od}__init(){this.name=Hi.id}constructor(e){Hi.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&he("console",cb),this.options.dom&&he("dom",ab(this.options.dom)),this.options.xhr&&he("xhr",lb),this.options.fetch&&he("fetch",db),this.options.history&&he("history",ub)}}Hi.__initStatic();function ab(s){function e(t){let i,r=typeof s=="object"?s.serializeAttribute:void 0;typeof r=="string"&&(r=[r]);try{i=t.event.target?Ki(t.event.target,r):Ki(t.event,r)}catch{i="<unknown>"}i.length!==0&&V().addBreadcrumb({category:`ui.${t.name}`,message:i},{event:t.event,name:t.name,global:t.global})}return e}function cb(s){var e={category:"console",data:{arguments:s.args,logger:"console"},level:sw(s.level),message:Ma(s.args," ")};if(s.level==="assert")if(s.args[0]===!1)e.message=`Assertion failed: ${Ma(s.args.slice(1)," ")||"console.assert"}`,e.data.arguments=s.args.slice(1);else return;V().addBreadcrumb(e,{input:s.args,level:s.level})}function lb(s){if(s.endTimestamp){if(s.xhr.__sentry_own_request__)return;const{method:e,url:t,status_code:i,body:r}=s.xhr.__sentry_xhr__||{};V().addBreadcrumb({category:"xhr",data:{method:e,url:t,s
Continue to export logs?`)&&s.saveFileAs(e.asBlob(),"chatterbox-logs.json")}}function jS(){const s=e=>(td(e,{tags:{fatalError:!0}}),e.message==="ResizeObserver loop completed with undelivered notifications."||e.message==="ResizeObserver loop limit exceeded"||e.target.tagName==="IMG"?(e.stopImmediatePropagation(),!1):(console.error(e.error??e.reason),window.sendError(),!1));window.addEventListener("error",s,!0),window.addEventListener("unhandledrejection",s,!0)}window.sendViewChangeToParent=function(s){window.parent?.postMessage({action:"resize-iframe",view:s},"*")};window.sendMinimizeToParent=function(){window.parent?.postMessage({action:"minimize"},"*")};window.sendNotificationCount=function(s){window.parent?.postMessage({action:"unread-message",count:s},"*")};window.sendError=function(){window.parent?.postMessage({action:"error"},"*")};VS()});export default GS();