@dxos/shell 0.4.8-main.de30065 โ 0.4.8-main.e23f3c5
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.
- package/dist/bundle/shell.mjs +24 -16
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +3 -3
- package/dist/bundle/shell.umd.js.map +1 -1
- package/package.json +19 -19
package/dist/bundle/shell.umd.js
CHANGED
|
@@ -100,10 +100,10 @@ Check the top-level render call using <`+ke+">.")}return ce}}function ka(q,ce){{
|
|
|
100
100
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
101
101
|
* @license MIT
|
|
102
102
|
*)
|
|
103
|
-
*/var k8=rr(Dp());globalThis.global=globalThis,globalThis.Buffer=k8.Buffer,globalThis.process=Mp;var x8=rr(Fp()),wd=rr(Fp());x8.default,wd.callbackify;var Ft=wd.inspect;wd.promisify;var ks={exports:{}};ks.exports,function(e,n){var t=200,i="__lodash_hash_undefined__",r=800,a=16,o=9007199254740991,s="[object Arguments]",f="[object Array]",d="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",v="[object Error]",m="[object Function]",g="[object GeneratorFunction]",b="[object Map]",w="[object Number]",_="[object Null]",k="[object Object]",E="[object Proxy]",S="[object RegExp]",P="[object Set]",I="[object String]",C="[object Undefined]",T="[object WeakMap]",M="[object ArrayBuffer]",j="[object DataView]",L="[object Float32Array]",D="[object Float64Array]",X="[object Int8Array]",J="[object Int16Array]",ee="[object Int32Array]",ae="[object Uint8Array]",fe="[object Uint8ClampedArray]",de="[object Uint16Array]",oe="[object Uint32Array]",me=/[\\^$.*+?()[\]{}|]/g,se=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,Y={};Y[L]=Y[D]=Y[X]=Y[J]=Y[ee]=Y[ae]=Y[fe]=Y[de]=Y[oe]=!0,Y[s]=Y[f]=Y[M]=Y[u]=Y[j]=Y[h]=Y[v]=Y[m]=Y[b]=Y[w]=Y[k]=Y[S]=Y[P]=Y[I]=Y[T]=!1;var ie=typeof pn=="object"&&pn&&pn.Object===Object&&pn,pe=typeof self=="object"&&self&&self.Object===Object&&self,H=ie||pe||Function("return this")(),K=n&&!n.nodeType&&n,B=K&&!0&&e&&!e.nodeType&&e,W=B&&B.exports===K,V=W&&ie.process,O=function(){try{var $=B&&B.require&&B.require("util").types;return $||V&&V.binding&&V.binding("util")}catch{}}(),F=O&&O.isTypedArray;function Z($,U,ne){switch(ne.length){case 0:return $.call(U);case 1:return $.call(U,ne[0]);case 2:return $.call(U,ne[0],ne[1]);case 3:return $.call(U,ne[0],ne[1],ne[2])}return $.apply(U,ne)}function te($,U){for(var ne=-1,ve=Array($);++ne<$;)ve[ne]=U(ne);return ve}function he($){return function(U){return $(U)}}function ye($,U){return $==null?void 0:$[U]}function xe($,U){return function(ne){return $(U(ne))}}var Ee=Array.prototype,re=Function.prototype,Be=Object.prototype,hn=H["__core-js_shared__"],Te=re.toString,ze=Be.hasOwnProperty,yn=function(){var $=/[^.]+$/.exec(hn&&hn.keys&&hn.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),Se=Be.toString,Ue=Te.call(Object),y=RegExp("^"+Te.call(ze).replace(me,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),c=W?H.Buffer:void 0,p=H.Symbol,x=H.Uint8Array,A=c?c.allocUnsafe:void 0,N=xe(Object.getPrototypeOf,Object),z=Object.create,ge=Be.propertyIsEnumerable,Fe=Ee.splice,Ce=p?p.toStringTag:void 0,Ie=function(){try{var $=No(Object,"defineProperty");return $({},"",{}),$}catch{}}(),Ae=c?c.isBuffer:void 0,pi=Math.max,wa=Date.now,St=No(H,"Map"),st=No(Object,"create"),br=function(){function $(){}return function(U){if(!lt(U))return{};if(z)return z(U);$.prototype=U;var ne=new $;return $.prototype=void 0,ne}}();function Rn($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function Ao(){this.__data__=st?st(null):{},this.size=0}function _a($){var U=this.has($)&&delete this.__data__[$];return this.size-=U?1:0,U}function To($){var U=this.__data__;if(st){var ne=U[$];return ne===i?void 0:ne}return ze.call(U,$)?U[$]:void 0}function ka($){var U=this.__data__;return st?U[$]!==void 0:ze.call(U,$)}function xa($,U){var ne=this.__data__;return this.size+=this.has($)?0:1,ne[$]=st&&U===void 0?i:U,this}Rn.prototype.clear=Ao,Rn.prototype.delete=_a,Rn.prototype.get=To,Rn.prototype.has=ka,Rn.prototype.set=xa;function Fn($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function Oo(){this.__data__=[],this.size=0}function Ea($){var U=this.__data__,ne=Bn(U,$);if(ne<0)return!1;var ve=U.length-1;return ne==ve?U.pop():Fe.call(U,ne,1),--this.size,!0}function Po($){var U=this.__data__,ne=Bn(U,$);return ne<0?void 0:U[ne][1]}function Io($){return Bn(this.__data__,$)>-1}function Fo($,U){var ne=this.__data__,ve=Bn(ne,$);return ve<0?(++this.size,ne.push([$,U])):ne[ve][1]=U,this}Fn.prototype.clear=Oo,Fn.prototype.delete=Ea,Fn.prototype.get=Po,Fn.prototype.has=Io,Fn.prototype.set=Fo;function ft($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function q(){this.size=0,this.__data__={hash:new Rn,map:new(St||Fn),string:new Rn}}function ce($){var U=Gi(this,$).delete($);return this.size-=U?1:0,U}function ke($){return Gi(this,$).get($)}function Ne($){return Gi(this,$).has($)}function an($,U){var ne=Gi(this,$),ve=ne.size;return ne.set($,U),this.size+=ne.size==ve?0:1,this}ft.prototype.clear=q,ft.prototype.delete=ce,ft.prototype.get=ke,ft.prototype.has=Ne,ft.prototype.set=an;function qe($){var U=this.__data__=new Fn($);this.size=U.size}function Ze(){this.__data__=new Fn,this.size=0}function Ke($){var U=this.__data__,ne=U.delete($);return this.size=U.size,ne}function Ln($){return this.__data__.get($)}function Sn($){return this.__data__.has($)}function Cn($,U){var ne=this.__data__;if(ne instanceof Fn){var ve=ne.__data__;if(!St||ve.length<t-1)return ve.push([$,U]),this.size=++ne.size,this;ne=this.__data__=new ft(ve)}return ne.set($,U),this.size=ne.size,this}qe.prototype.clear=Ze,qe.prototype.delete=Ke,qe.prototype.get=Ln,qe.prototype.has=Sn,qe.prototype.set=Cn;function Zn($,U){var ne=kr($),ve=!ne&&_r($),Oe=!ne&&!ve&&Aa($),$e=!ne&&!ve&&!Oe&&il($),je=ne||ve||Oe||$e,Re=je?te($.length,String):[],Qe=Re.length;for(var Un in $)(U||ze.call($,Un))&&!(je&&(Un=="length"||Oe&&(Un=="offset"||Un=="parent")||$e&&(Un=="buffer"||Un=="byteLength"||Un=="byteOffset")||Zf(Un,Qe)))&&Re.push(Un);return Re}function ct($,U,ne){(ne!==void 0&&!Ki($[U],ne)||ne===void 0&&!(U in $))&&yr($,U,ne)}function Sa($,U,ne){var ve=$[U];(!(ze.call($,U)&&Ki(ve,ne))||ne===void 0&&!(U in $))&&yr($,U,ne)}function Bn($,U){for(var ne=$.length;ne--;)if(Ki($[ne][0],U))return ne;return-1}function yr($,U,ne){U=="__proto__"&&Ie?Ie($,U,{configurable:!0,enumerable:!0,value:ne,writable:!0}):$[U]=ne}var Bc=Jc();function mi($){return $==null?$===void 0?C:_:Ce&&Ce in Object($)?Xc($):nh($)}function Mo($){return xr($)&&mi($)==s}function jc($){if(!lt($)||Qf($))return!1;var U=Ta($)?y:se;return U.test($a($))}function Rc($){return xr($)&&ei($.length)&&!!Y[mi($)]}function Uc($){if(!lt($))return eh($);var U=el($),ne=[];for(var ve in $)ve=="constructor"&&(U||!ze.call($,ve))||ne.push(ve);return ne}function Ca($,U,ne,ve,Oe){$!==U&&Bc(U,function($e,je){if(Oe||(Oe=new qe),lt($e))zc($,U,je,ne,Ca,ve,Oe);else{var Re=ve?ve(Lo($,je),$e,je+"",$,U,Oe):void 0;Re===void 0&&(Re=$e),ct($,je,Re)}},al)}function zc($,U,ne,ve,Oe,$e,je){var Re=Lo($,ne),Qe=Lo(U,ne),Un=je.get(Qe);if(Un){ct($,ne,Un);return}var qn=$e?$e(Re,Qe,ne+"",$,U,je):void 0,gi=qn===void 0;if(gi){var Oa=kr(Qe),oh=!Oa&&Aa(Qe),d_=!Oa&&!oh&&il(Qe);qn=Qe,Oa||oh||d_?kr(Re)?qn=Re:nl(Re)?qn=Gc(Re):oh?(gi=!1,qn=Hc(Qe,!0)):d_?(gi=!1,qn=qc(Qe,!0)):qn=[]:tl(Qe)||_r(Qe)?(qn=Re,_r(Re)?qn=rl(Re):(!lt(Re)||Ta(Re))&&(qn=Xf(Qe))):gi=!1}gi&&(je.set(Qe,qn),Oe(qn,Qe,ve,$e,je),je.delete(Qe)),ct($,ne,qn)}function Jf($,U){return th(Do($,U,R),$+"")}var Wc=Ie?function($,U){return Ie($,"toString",{configurable:!0,enumerable:!1,value:ah(U),writable:!0})}:R;function Hc($,U){if(U)return $.slice();var ne=$.length,ve=A?A(ne):new $.constructor(ne);return $.copy(ve),ve}function Vc($){var U=new $.constructor($.byteLength);return new x(U).set(new x($)),U}function qc($,U){var ne=U?Vc($.buffer):$.buffer;return new $.constructor(ne,$.byteOffset,$.length)}function Gc($,U){var ne=-1,ve=$.length;for(U||(U=Array(ve));++ne<ve;)U[ne]=$[ne];return U}function Kc($,U,ne,ve){var Oe=!ne;ne||(ne={});for(var $e=-1,je=U.length;++$e<je;){var Re=U[$e],Qe=ve?ve(ne[Re],$[Re],Re,ne,$):void 0;Qe===void 0&&(Qe=$[Re]),Oe?yr(ne,Re,Qe):Sa(ne,Re,Qe)}return ne}function Yc($){return Jf(function(U,ne){var ve=-1,Oe=ne.length,$e=Oe>1?ne[Oe-1]:void 0,je=Oe>2?ne[2]:void 0;for($e=$.length>3&&typeof $e=="function"?(Oe--,$e):void 0,je&&Zc(ne[0],ne[1],je)&&($e=Oe<3?void 0:$e,Oe=1),U=Object(U);++ve<Oe;){var Re=ne[ve];Re&&$(U,Re,ve,$e)}return U})}function Jc($){return function(U,ne,ve){for(var Oe=-1,$e=Object(U),je=ve(U),Re=je.length;Re--;){var Qe=je[$?Re:++Oe];if(ne($e[Qe],Qe,$e)===!1)break}return U}}function wr($,U,ne,ve,Oe,$e){return lt($)&<(U)&&($e.set(U,$),Ca($,U,void 0,wr,$e),$e.delete(U)),$}function Gi($,U){var ne=$.__data__;return Qc(U)?ne[typeof U=="string"?"string":"hash"]:ne.map}function No($,U){var ne=ye($,U);return jc(ne)?ne:void 0}function Xc($){var U=ze.call($,Ce),ne=$[Ce];try{$[Ce]=void 0;var ve=!0}catch{}var Oe=Se.call($);return ve&&(U?$[Ce]=ne:delete $[Ce]),Oe}function Xf($){return typeof $.constructor=="function"&&!el($)?br(N($)):{}}function Zf($,U){var ne=typeof $;return U=U??o,!!U&&(ne=="number"||ne!="symbol"&&G.test($))&&$>-1&&$%1==0&&$<U}function Zc($,U,ne){if(!lt(ne))return!1;var ve=typeof U;return(ve=="number"?Bo(ne)&&Zf(U,ne.length):ve=="string"&&U in ne)?Ki(ne[U],$):!1}function Qc($){var U=typeof $;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?$!=="__proto__":$===null}function Qf($){return!!yn&&yn in $}function el($){var U=$&&$.constructor,ne=typeof U=="function"&&U.prototype||Be;return $===ne}function eh($){var U=[];if($!=null)for(var ne in Object($))U.push(ne);return U}function nh($){return Se.call($)}function Do($,U,ne){return U=pi(U===void 0?$.length-1:U,0),function(){for(var ve=arguments,Oe=-1,$e=pi(ve.length-U,0),je=Array($e);++Oe<$e;)je[Oe]=ve[U+Oe];Oe=-1;for(var Re=Array(U+1);++Oe<U;)Re[Oe]=ve[Oe];return Re[U]=ne(je),Z($,this,Re)}}function Lo($,U){if(!(U==="constructor"&&typeof $[U]=="function")&&U!="__proto__")return $[U]}var th=ih(Wc);function ih($){var U=0,ne=0;return function(){var ve=wa(),Oe=a-(ve-ne);if(ne=ve,Oe>0){if(++U>=r)return arguments[0]}else U=0;return $.apply(void 0,arguments)}}function $a($){if($!=null){try{return Te.call($)}catch{}try{return $+""}catch{}}return""}function Ki($,U){return $===U||$!==$&&U!==U}var _r=Mo(function(){return arguments}())?Mo:function($){return xr($)&&ze.call($,"callee")&&!ge.call($,"callee")},kr=Array.isArray;function Bo($){return $!=null&&ei($.length)&&!Ta($)}function nl($){return xr($)&&Bo($)}var Aa=Ae||Q;function Ta($){if(!lt($))return!1;var U=mi($);return U==m||U==g||U==d||U==E}function ei($){return typeof $=="number"&&$>-1&&$%1==0&&$<=o}function lt($){var U=typeof $;return $!=null&&(U=="object"||U=="function")}function xr($){return $!=null&&typeof $=="object"}function tl($){if(!xr($)||mi($)!=k)return!1;var U=N($);if(U===null)return!0;var ne=ze.call(U,"constructor")&&U.constructor;return typeof ne=="function"&&ne instanceof ne&&Te.call(ne)==Ue}var il=F?he(F):Rc;function rl($){return Kc($,al($))}var rh=Jf(function($){return $.push(void 0,wr),Z(ol,void 0,$)});function al($){return Bo($)?Zn($,!0):Uc($)}var ol=Yc(function($,U,ne,ve){Ca($,U,ne,ve)});function ah($){return function(){return $}}function R($){return $}function Q(){return!1}e.exports=rh}(ks,ks.exports);var E8=ks.exports;const S8=Er(E8);var C8=rr(Dp()),Lp=C8.Buffer,Ga=(e,n,t)=>{if(e)return;let i="invariant violation";throw n&&(i+=`: ${n}`),t!=null&&t.A&&(i+=` [${t.A[0]}]`),t!=null&&t.F&&(i+=` at ${A8(t.F)}:${t.L}`),new $8(i)},$8=class extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}},A8=e=>{const n=e.match(/.+\/(packages\/.+\/.+)/);if(n){const[,t]=n;return t}return e},T8=tn({"node_modules/.pnpm/events@3.3.0/node_modules/events/events.js"(e,n){var t=typeof Reflect=="object"?Reflect:null,i=t&&typeof t.apply=="function"?t.apply:function(C,T,M){return Function.prototype.apply.call(C,T,M)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:r=function(C){return Object.getOwnPropertyNames(C)};function a(I){console&&console.warn&&console.warn(I)}var o=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}n.exports=s,n.exports.once=E,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var f=10;function d(I){if(typeof I!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof I)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(I){if(typeof I!="number"||I<0||o(I))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+I+".");f=I}}),s.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},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||o(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function u(I){return I._maxListeners===void 0?s.defaultMaxListeners:I._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(C){for(var T=[],M=1;M<arguments.length;M++)T.push(arguments[M]);var j=C==="error",L=this._events;if(L!==void 0)j=j&&L.error===void 0;else if(!j)return!1;if(j){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var X=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw X.context=D,X}var J=L[C];if(J===void 0)return!1;if(typeof J=="function")i(J,this,T);else for(var ee=J.length,ae=w(J,ee),M=0;M<ee;++M)i(ae[M],this,T);return!0};function h(I,C,T,M){var j,L,D;if(d(T),L=I._events,L===void 0?(L=I._events=Object.create(null),I._eventsCount=0):(L.newListener!==void 0&&(I.emit("newListener",C,T.listener?T.listener:T),L=I._events),D=L[C]),D===void 0)D=L[C]=T,++I._eventsCount;else if(typeof D=="function"?D=L[C]=M?[T,D]:[D,T]:M?D.unshift(T):D.push(T),j=u(I),j>0&&D.length>j&&!D.warned){D.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=I,X.type=C,X.count=D.length,a(X)}return I}s.prototype.addListener=function(C,T){return h(this,C,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,T){return h(this,C,T,!0)};function v(){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 m(I,C,T){var M={fired:!1,wrapFn:void 0,target:I,type:C,listener:T},j=v.bind(M);return j.listener=T,M.wrapFn=j,j}s.prototype.once=function(C,T){return d(T),this.on(C,m(this,C,T)),this},s.prototype.prependOnceListener=function(C,T){return d(T),this.prependListener(C,m(this,C,T)),this},s.prototype.removeListener=function(C,T){var M,j,L,D,X;if(d(T),j=this._events,j===void 0)return this;if(M=j[C],M===void 0)return this;if(M===T||M.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete j[C],j.removeListener&&this.emit("removeListener",C,M.listener||T));else if(typeof M!="function"){for(L=-1,D=M.length-1;D>=0;D--)if(M[D]===T||M[D].listener===T){X=M[D].listener,L=D;break}if(L<0)return this;L===0?M.shift():_(M,L),M.length===1&&(j[C]=M[0]),j.removeListener!==void 0&&this.emit("removeListener",C,X||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var T,M,j;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[C]),this;if(arguments.length===0){var L=Object.keys(M),D;for(j=0;j<L.length;++j)D=L[j],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=M[C],typeof T=="function")this.removeListener(C,T);else if(T!==void 0)for(j=T.length-1;j>=0;j--)this.removeListener(C,T[j]);return this};function g(I,C,T){var M=I._events;if(M===void 0)return[];var j=M[C];return j===void 0?[]:typeof j=="function"?T?[j.listener||j]:[j]:T?k(j):w(j,j.length)}s.prototype.listeners=function(C){return g(this,C,!0)},s.prototype.rawListeners=function(C){return g(this,C,!1)},s.listenerCount=function(I,C){return typeof I.listenerCount=="function"?I.listenerCount(C):b.call(I,C)},s.prototype.listenerCount=b;function b(I){var C=this._events;if(C!==void 0){var T=C[I];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function w(I,C){for(var T=new Array(C),M=0;M<C;++M)T[M]=I[M];return T}function _(I,C){for(;C+1<I.length;C++)I[C]=I[C+1];I.pop()}function k(I){for(var C=new Array(I.length),T=0;T<C.length;++T)C[T]=I[T].listener||I[T];return C}function E(I,C){return new Promise(function(T,M){function j(D){I.removeListener(C,L),M(D)}function L(){typeof I.removeListener=="function"&&I.removeListener("error",j),T([].slice.call(arguments))}P(I,C,L,{once:!0}),C!=="error"&&S(I,j,{once:!0})})}function S(I,C,T){typeof I.on=="function"&&P(I,"error",C,T)}function P(I,C,T,M){if(typeof I.on=="function")M.once?I.once(C,T):I.on(C,T);else if(typeof I.addEventListener=="function")I.addEventListener(C,function j(L){M.once&&I.removeEventListener(C,j),T(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof I)}}}),Bp=rr(T8());Bp.EventEmitter,Bp.EventEmitter;var xs=e=>{const n=Object.getPrototypeOf(e).constructor.name;return e.toJSON?`${n}(${Ft(e.toJSON())})`:String(e)},jp=e=>{throw e},Rp;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.VERBOSE=1]="VERBOSE",e[e.BOLD=2]="BOLD"})(Rp||(Rp={}));var O8=(e,n=8)=>{const t=String(e);return t.length<=n?t:t.slice(0,n)},Es=Symbol.for("devtoolsFormatter"),P8=()=>{typeof window<"u"&&(window.devtoolsFormatters??(window.devtoolsFormatters=[])).push({header:(e,n)=>{const t=e[Es];if(t===void 0)return null;if(typeof t!="object"||t===null||typeof t.header!="function")throw new Error(`Invalid devtools formatter for ${e.constructor.name}`);return t.header(n)},hasBody:(e,n)=>{const t=e[Es];return!t||!t.hasBody?!1:t.hasBody(n)},body:(e,n)=>{const t=e[Es];return!t||!t.body?null:t.body(n)}})};P8();var I8=Symbol.for("dxos.common.equals"),F8=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),_d="/home/runner/work/dxos/dxos/packages/common/keys/src/public-key.ts",M8=32,Up=class Qn{static from(n){if(Ga(n,void 0,{F:_d,L:30,S:this,A:["source",""]}),n instanceof Qn)return n;if(n instanceof Buffer)return new Qn(new Uint8Array(n.buffer,n.byteOffset,n.byteLength));if(n instanceof Uint8Array)return new Qn(n);if(n instanceof ArrayBuffer)return new Qn(new Uint8Array(n));if(typeof n=="string")return Qn.fromHex(n);if(n.asUint8Array)return new Qn(n.asUint8Array());throw new TypeError(`Unable to create PublicKey from ${n}`)}static safeFrom(n){if(n)try{return Qn.from(n)}catch{return}}static fromHex(n){n.startsWith("0x")&&(n=n.slice(2));const t=Buffer.from(n,"hex");return new Qn(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}static random(){return Qn.from(N8(M8))}static*randomSequence(){for(let n=0;n<1e4;n++)yield Qn.random();throw new Error("Too many keys requested")}static isPublicKey(n){return n instanceof Qn}static assertValidPublicKey(n){if(!this.isPublicKey(n))throw new TypeError("Invalid PublicKey")}static equals(n,t){return Qn.from(n).equals(t)}static bufferize(n){return Ga(typeof n=="string","Invalid type",{F:_d,L:129,S:this,A:["typeof str === 'string'","'Invalid type'"]}),Buffer.from(n,"hex")}static stringify(n){return n instanceof Qn?n=n.asBuffer():n instanceof Uint8Array&&(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),Ga(n instanceof Buffer,"Invalid type",{F:_d,L:148,S:this,A:["key instanceof Buffer","'Invalid type'"]}),n.toString("hex")}static hash(n){return n.toHex()}constructor(n){if(this._value=n,!(n instanceof Uint8Array))throw new TypeError(`Expected Uint8Array, got: ${n}`)}toString(){return this.toHex()}toJSON(){return this.toHex()}get length(){return this._value.length}toHex(){return this.asBuffer().toString("hex")}truncate(n=void 0){return O8(this,n)}asBuffer(){return Buffer.from(this._value.buffer,this._value.byteOffset,this._value.byteLength)}asUint8Array(){return this._value}getInsecureHash(n){return Math.abs(this._value.reduce((t,i)=>t^i|0,0))%n}[Ft.custom](n,t){if(!t.colors||typeof process.stdout.hasColors!="function"||!process.stdout.hasColors())return`<PublicKey ${this.truncate()}>`;const i=o=>`\x1B[${o}m`,r=["red","green","yellow","blue","magenta","cyan","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],a=r[this.getInsecureHash(r.length)];return`PublicKey(${i(Ft.colors[a][0])}${this.truncate()}${i(Ft.colors.reset[0])})`}get[Es](){return{header:()=>{const n=["darkred","green","orange","blue","darkmagenta","darkcyan","red","green","orange","blue","magenta","darkcyan","black"],t=n[this.getInsecureHash(n.length)];return["span",{},["span",{},"PublicKey("],["span",{style:`color: ${t};`},this.truncate()],["span",{},")"]]}}}equals(n){const t=Qn.from(n);if(this._value.length!==t._value.length)return!1;let i=!0;for(let r=0;r<this._value.length;r++)i&&(i=this._value[r]===t._value[r]);return i}[I8](n){return Qn.isPublicKey(n)?this.equals(n):!1}},N8=e=>{const n=globalThis.crypto??F8("@dxos/node-std/crypto").webcrypto,t=new Uint8Array(e);return n.getRandomValues(t),t},zp=10;(class{constructor(e,n){if(this._projection=e,this._values=new Map,n)for(const t of n)this.add(t)}toString(){return xs(this)}toJSON(){return this._values.size>zp?{size:this._values.size}:Array.from(this._values.values())}[Ft.custom](){return xs(this)}add(e){return this._values.set(this._projection(e),e),this}clear(){this._values.clear()}delete(e){return this._values.delete(this._projection(e))}forEach(e,n){n&&(e=e.bind(n)),this._values.forEach(t=>e(t,t,this))}has(e){return this._values.has(this._projection(e))}get size(){return this._values.size}[Symbol.iterator](){return this._values.values()}*entries(){for(const e of this._values.values())yield[e,e]}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}get[Symbol.toStringTag](){return"ComplexSet"}}),class{constructor(e,n){if(this._keyProjection=e,this._keys=new Map,this._values=new Map,n)for(const[t,i]of n)this.set(t,i)}toString(){return xs(this)}toJSON(){return this._values.size>zp?{size:this._values.size}:Array.from(this._values.values())}[Ft.custom](){return xs(this)}clear(){this._keys.clear(),this._values.clear()}delete(e){const n=this._keys.delete(this._keyProjection(e)),t=this._values.delete(this._keyProjection(e));return n||t}forEach(e,n){n&&(e=e.bind(n)),this._keys.forEach((t,i)=>e(this._values.get(i)??jp(new Error("Map corrupted.")),t,this))}get(e){return this._values.get(this._keyProjection(e))}has(e){return this._keys.has(this._keyProjection(e))}set(e,n){const t=this._keyProjection(e);return this._keys.set(t,e),this._values.set(t,n),this}get size(){return this._keys.size}*[Symbol.iterator](){for(const[e,n]of this._keys){const t=this._values.get(e)??jp(new Error("Map corrupted."));yield[n,t]}}entries(){return this[Symbol.iterator]()}keys(){return this._keys.values()}values(){return this._values.values()}get[Symbol.toStringTag](){return"ComplexMap"}};var Wp=["๐น","๐ป","๐ฝ","๐ค","๐","๐ฆพ","๐ฆฟ","๐ฆท","๐ฃ","๐๏ธ","๐งถ","๐","๐","๐ฆ","๐ฆ","๐ด","๐ฆ","๐","๐ฆ","๐","๐ชฒ","๐ข","๐ฆ","๐ฆ","๐ฆ","๐ฆ","๐ ","๐ฌ","๐","๐ฆญ","๐
","๐","๐ฆ","๐ฆ","๐ฆง","๐","๐ซ","๐ฆ","๐ฆ","๐ฆฌ","๐","๐","๐ฆ","๐","๐","๐","๐ฆ","๐ฆ","๐ฆข","๐ฆฉ","๐ฆฆ","๐","๐ฟ๏ธ","๐ต","๐ฒ","๐ณ","๐ชต","๐ฑ","๐","๐ชบ","๐","๐","๐ชธ","๐ชจ","๐พ","๐ท","๐ป","โ๏ธ","๐","๐ช","โญ๏ธ","โก๏ธ","โ๏ธ","๐ฅ","๐","โ๏ธ","๐ง","โฑ๏ธ","๐","๐","๐","๐","๐","๐ซ","๐","๐","๐","๐ฅญ","๐","๐ฅฅ","๐ฅ","๐ฅ","๐ถ๏ธ","๐ฝ","๐ฅ","๐ฌ","๐ฅ","๐ซ","โ๏ธ","๐ต","๐ง","๐ง","๐๏ธ","โ๏ธ","๐","๐๏ธ","๐ถ","๐","๐ฐ๏ธ","โฒ๏ธ","๐ฐ","๐ฒ","โบ๏ธ","๐๏ธ","๐งฒ","โ๏ธ","๐ฉ","๐ฎ","๐ญ","๐ฌ","๐งฌ","๐ก๏ธ","๐งบ","๐๏ธ","๐","๐ช","๐งธ","๐","๐","๐","โป๏ธ","๐ต"],Hp=["red","amber","lime","green","emerald","teal","cyan","violet","purple","fuchsia","pink","rose"],D8=e=>Ka(e.toHex()),Ka=e=>Vp(parseInt(e,16)),Vp=e=>Wp[e%Wp.length],L8=e=>qp(parseInt(e,16)),qp=e=>Hp[e%Hp.length],Gp=e=>Kp(e.toHex()),Kp=e=>B8(parseInt(e,16)),B8=e=>({emoji:Vp(e),hue:qp(e)}),j8=["ack","alabama","alanine","alaska","alpha","angel","apart","april","arizona","arkansas","artist","asparagus","aspen","august","autumn","avocado","bacon","bakerloo","batman","beer","berlin","beryllium","black","blossom","blue","bluebird","bravo","bulldog","burger","butter","california","carbon","cardinal","carolina","carpet","cat","ceiling","charlie","chicken","coffee","cola","cold","colorado","comet","connecticut","crazy","cup","dakota","december","delaware","delta","diet","don","double","early","earth","east","echo","edward","eight","eighteen","eleven","emma","enemy","equal","failed","fanta","fifteen","fillet","finch","fish","five","fix","floor","florida","football","four","fourteen","foxtrot","freddie","friend","fruit","gee","georgia","glucose","golf","green","grey","hamper","happy","harry","hawaii","helium","high","hot","hotel","hydrogen","idaho","illinois","india","indigo","ink","iowa","island","item","jersey","jig","johnny","juliet","july","jupiter","kansas","kentucky","kilo","king","kitten","lactose","lake","lamp","lemon","leopard","lima","lion","lithium","london","louisiana","low","magazine","magnesium","maine","mango","march","mars","maryland","massachusetts","may","mexico","michigan","mike","minnesota","mirror","mississippi","missouri","mobile","mockingbird","monkey","montana","moon","mountain","muppet","music","nebraska","neptune","network","nevada","nine","nineteen","nitrogen","north","november","nuts","october","ohio","oklahoma","one","orange","oranges","oregon","oscar","oven","oxygen","papa","paris","pasta","pennsylvania","pip","pizza","pluto","potato","princess","purple","quebec","queen","quiet","red","river","robert","robin","romeo","rugby","sad","salami","saturn","september","seven","seventeen","shade","sierra","single","sink","six","sixteen","skylark","snake","social","sodium","solar","south","spaghetti","speaker","spring","stairway","steak","stream","summer","sweet","table","tango","ten","tennessee","tennis","texas","thirteen","three","timing","triple","twelve","twenty","two","uncle","undress","uniform","uranus","utah","vegan","venus","vermont","victor","video","violet","virginia","washington","west","whiskey","white","william","winner","winter","wisconsin","wolfram","wyoming","xray","yankee","yellow","zebra","zulu"],R8=class{constructor(e=j8){if(this.wordlist=e,e.length!==256)throw new Error("Wordlist must have exactly 256 items");this.wordlist=e}humanize(e,n=4,t="-"){const i=e.match(/(..?)/g);if(!i)throw new Error("");const r=i.map(o=>parseInt(o,16));return this._compress(r,n).map(o=>this.wordlist[o]).join(t)}_compress(e,n){const t=e.length;if(n>t)throw new Error("Fewer input bytes than requested output");const i=t/n>>0,r=[];for(let o=0;o<i*n;o+=i)r.push(e.slice(o,o+i));return r[r.length-1]=r[r.length-1].concat(e.slice(n*i)),r.map(o=>o.reduce((s,f)=>s^f))}},U8=new R8,z8=e=>(e instanceof Lp||e instanceof Uint8Array||e instanceof ArrayBuffer?e=Up.stringify(e):e instanceof Up&&(e=e.toHex()),U8.humanize(e)),W8=e=>Lp.from(e.buffer,e.byteOffset,e.byteLength),H8=5,kd=(e,n=0,t=new WeakSet)=>{if(n>H8)return null;if(typeof e=="function")return null;if(typeof e=="object"&&e!==null){if(t.has(e))return null;t.add(e);try{if(e instanceof Uint8Array)return W8(e).toString("hex");if(Array.isArray(e))return e.map(i=>kd(i,n+1,t));if(typeof e.toJSON=="function")return e.toJSON();{const i={};for(const r of Object.keys(e))i[r]=kd(e[r],n+1,t);return i}}finally{t.delete(e)}}else return e},V8=(e,n,t)=>{let i=e.get(n);return i===void 0&&(i=typeof t=="function"?t():t,e.set(n,i)),i},q8=()=>typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),xd=Symbol("instanceTag"),G8=e=>n=>{n.prototype[xd]=e,Object.defineProperty(n.prototype,Symbol.hasInstance,{value:t=>(t==null?void 0:t[xd])===e}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>(t==null?void 0:t[xd])===e})},Ed=Symbol.for("dxos.instance-contexts"),K8=globalThis[Ed]??(globalThis[Ed]=new WeakMap),Y8=e=>{const n=Object.getPrototypeOf(e),t=V8(K8,n,()=>({nextId:0,instanceIds:new WeakMap}));let i=t.instanceIds.get(e);return i===void 0&&(i=t.nextId++,t.instanceIds.set(e,i)),i},J8=e=>e==null?"null":`${Object.getPrototypeOf(e).constructor.name}#${Y8(e)}`;Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));var Sd=()=>{throw new Error("Not available on this platform")},X8=()=>Sd(),Z8=()=>Sd(),Q8=()=>Sd(),Yp=tn({"node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(e,n){function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function i(o,s){for(var f="",d=0,u=-1,h=0,v,m=0;m<=o.length;++m){if(m<o.length)v=o.charCodeAt(m);else{if(v===47)break;v=47}if(v===47){if(!(u===m-1||h===1))if(u!==m-1&&h===2){if(f.length<2||d!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var g=f.lastIndexOf("/");if(g!==f.length-1){g===-1?(f="",d=0):(f=f.slice(0,g),d=f.length-1-f.lastIndexOf("/")),u=m,h=0;continue}}else if(f.length===2||f.length===1){f="",d=0,u=m,h=0;continue}}s&&(f.length>0?f+="/..":f="..",d=2)}else f.length>0?f+="/"+o.slice(u+1,m):f=o.slice(u+1,m),d=m-u-1;u=m,h=0}else v===46&&h!==-1?++h:h=-1}return f}function r(o,s){var f=s.dir||s.root,d=s.base||(s.name||"")+(s.ext||"");return f?f===s.root?f+d:f+o+d:d}var a={resolve:function(){for(var s="",f=!1,d,u=arguments.length-1;u>=-1&&!f;u--){var h;u>=0?h=arguments[u]:(d===void 0&&(d=process.cwd()),h=d),t(h),h.length!==0&&(s=h+"/"+s,f=h.charCodeAt(0)===47)}return s=i(s,!f),f?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(t(s),s.length===0)return".";var f=s.charCodeAt(0)===47,d=s.charCodeAt(s.length-1)===47;return s=i(s,!f),s.length===0&&!f&&(s="."),s.length>0&&d&&(s+="/"),f?"/"+s:s},isAbsolute:function(s){return t(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,f=0;f<arguments.length;++f){var d=arguments[f];t(d),d.length>0&&(s===void 0?s=d:s+="/"+d)}return s===void 0?".":a.normalize(s)},relative:function(s,f){if(t(s),t(f),s===f||(s=a.resolve(s),f=a.resolve(f),s===f))return"";for(var d=1;d<s.length&&s.charCodeAt(d)===47;++d);for(var u=s.length,h=u-d,v=1;v<f.length&&f.charCodeAt(v)===47;++v);for(var m=f.length,g=m-v,b=h<g?h:g,w=-1,_=0;_<=b;++_){if(_===b){if(g>b){if(f.charCodeAt(v+_)===47)return f.slice(v+_+1);if(_===0)return f.slice(v+_)}else h>b&&(s.charCodeAt(d+_)===47?w=_:_===0&&(w=0));break}var k=s.charCodeAt(d+_),E=f.charCodeAt(v+_);if(k!==E)break;k===47&&(w=_)}var S="";for(_=d+w+1;_<=u;++_)(_===u||s.charCodeAt(_)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+f.slice(v+w):(v+=w,f.charCodeAt(v)===47&&++v,f.slice(v))},_makeLong:function(s){return s},dirname:function(s){if(t(s),s.length===0)return".";for(var f=s.charCodeAt(0),d=f===47,u=-1,h=!0,v=s.length-1;v>=1;--v)if(f=s.charCodeAt(v),f===47){if(!h){u=v;break}}else h=!1;return u===-1?d?"/":".":d&&u===1?"//":s.slice(0,u)},basename:function(s,f){if(f!==void 0&&typeof f!="string")throw new TypeError('"ext" argument must be a string');t(s);var d=0,u=-1,h=!0,v;if(f!==void 0&&f.length>0&&f.length<=s.length){if(f.length===s.length&&f===s)return"";var m=f.length-1,g=-1;for(v=s.length-1;v>=0;--v){var b=s.charCodeAt(v);if(b===47){if(!h){d=v+1;break}}else g===-1&&(h=!1,g=v+1),m>=0&&(b===f.charCodeAt(m)?--m===-1&&(u=v):(m=-1,u=g))}return d===u?u=g:u===-1&&(u=s.length),s.slice(d,u)}else{for(v=s.length-1;v>=0;--v)if(s.charCodeAt(v)===47){if(!h){d=v+1;break}}else u===-1&&(h=!1,u=v+1);return u===-1?"":s.slice(d,u)}},extname:function(s){t(s);for(var f=-1,d=0,u=-1,h=!0,v=0,m=s.length-1;m>=0;--m){var g=s.charCodeAt(m);if(g===47){if(!h){d=m+1;break}continue}u===-1&&(h=!1,u=m+1),g===46?f===-1?f=m:v!==1&&(v=1):f!==-1&&(v=-1)}return f===-1||u===-1||v===0||v===1&&f===u-1&&f===d+1?"":s.slice(f,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return r("/",s)},parse:function(s){t(s);var f={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return f;var d=s.charCodeAt(0),u=d===47,h;u?(f.root="/",h=1):h=0;for(var v=-1,m=0,g=-1,b=!0,w=s.length-1,_=0;w>=h;--w){if(d=s.charCodeAt(w),d===47){if(!b){m=w+1;break}continue}g===-1&&(b=!1,g=w+1),d===46?v===-1?v=w:_!==1&&(_=1):v!==-1&&(_=-1)}return v===-1||g===-1||_===0||_===1&&v===g-1&&v===m+1?g!==-1&&(m===0&&u?f.base=f.name=s.slice(1,g):f.base=f.name=s.slice(m,g)):(m===0&&u?(f.name=s.slice(1,v),f.base=s.slice(1,g)):(f.name=s.slice(m,v),f.base=s.slice(m,g)),f.ext=s.slice(v,g)),m>0?f.dir=s.slice(0,m-1):u&&(f.dir="/"),f},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,n.exports=a}});rr(Yp());var Vt=rr(Yp());Vt.basename;var eS=Vt.dirname;Vt.extname,Vt.format,Vt.isAbsolute,Vt.join,Vt.normalize,Vt.parse,Vt.relative,Vt.resolve;var An;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})(An||(An={}));var nS={trace:5,debug:10,info:11,warn:12,error:13},Ya;(function(e){e.CONSOLE="console",e.BROWSER="browser",e.DEBUG="debug"})(Ya||(Ya={}));var tS=Symbol("logInfoProperties"),iS=e=>{if(!e)return{};const n={},i=Object.getPrototypeOf(e)[tS]??[];for(const r of i)try{n[r]=typeof e[r]=="function"?e[r]():e[r]}catch(a){n[r]=a.message}return n},rS=(e,n,t)=>n>=e.level&&(!e.pattern||t.includes(e.pattern)),Jp=(e,n)=>n===void 0?!0:n.some(t=>{var i;return rS(t,e.level,((i=e.meta)==null?void 0:i.F)??"")}),Cd=e=>{let n;if(e.meta){const t=iS(e.meta.S);Object.keys(t).length>0&&(n=Object.assign(n??{},t))}if(e.context)if(e.context instanceof Error){const t=e.context.context;n=Object.assign(n??{},{error:e.context.stack,...t})}else typeof e.context=="object"&&(n=Object.assign(n??{},e.context));if(e.error){const t=e.error.context;n=Object.assign(n??{},{error:e.error.stack,...t})}return n&&Object.keys(n).length>0?n:void 0},aS=0,oS=e=>(n,t,i)=>(r,a,o)=>{const s=o.value;o.value=function(...f){const d={...i??{},S:this},u=f.map(h=>Ft(h,!1,1,!0)).join(", ");try{const h=performance.now(),v=s.apply(this,f);if(sS(v)){const m=aS++;e.info(`${a}(${u}) => Promise { #${m} }`,{},d),v.then(g=>{g!==void 0?e.info(`โ
resolve #${m} ${(performance.now()-h).toFixed(0)}ms => ${Ft(g,!1,1,!0)}`,{},d):e.info(`โ
resolve #${m} ${(performance.now()-h).toFixed(0)}ms`,{},d)},g=>{e.info(`๐ฅ reject #${m} #${(performance.now()-h).toFixed(0)}ms => ${g}`,{},d)})}else e.info(`${a}(${u}) => ${Ft(v,!1,1,!0)}`,{},d);return v}catch(h){throw e.error(`${a}(${u}) ๐ฅ ${h}`,{},d),h}},Object.defineProperty(o.value,"name",{value:a+"$log"})},sS=e=>e&&typeof e.then=="function",fS=e=>{try{return JSON.parse(localStorage.getItem("dxlog"))}catch{return}},Xp=()=>{},lS=(e,n)=>{console.log(Ft(n,!1,null,!0))},Zp=e=>{const n=e.match(/.+\/(packages\/.+\/.+)/);if(n){const[,t]=n;return t}return e},$d=typeof mochaExecutor<"u"?{useTestProcessor:!0,printFileLinks:!0}:{useTestProcessor:!1,printFileLinks:!1},dS=(e,n)=>{var d,u,h,v;if(!Jp(n,e.filters))return;const t=e.prefix??"https://vscode.dev/github.com/dxos/dxos/blob/main/",i=[];let r="";if(n.meta){const m=Zp(n.meta.F);r=`${`${t.replace(/\/$/,"")}/${m}`}#L${n.meta.L}`}let a=[];if((d=n.meta)!=null&&d.S){const m=(u=n.meta)==null?void 0:u.S,g=m.name||J8(m),b=(h=n.meta.S)!=null&&h.hostSessionId?"[worker] ":"";a.push(`%c${b}${g}`,"color:#C026D3;font-weight:bold")}a.push(n.message);const o=Cd(n);o&&a.push(o);const s={[An.ERROR]:console.error,[An.WARN]:console.warn,[An.DEBUG]:console.log};($d.printFileLinks||q8())&&(i!=null&&i.length?a=[`%c${r}
|
|
103
|
+
*/var k8=rr(Dp());globalThis.global=globalThis,globalThis.Buffer=k8.Buffer,globalThis.process=Mp;var x8=rr(Fp()),wd=rr(Fp());x8.default,wd.callbackify;var Ft=wd.inspect;wd.promisify;var ks={exports:{}};ks.exports,function(e,n){var t=200,i="__lodash_hash_undefined__",r=800,a=16,o=9007199254740991,s="[object Arguments]",f="[object Array]",d="[object AsyncFunction]",u="[object Boolean]",h="[object Date]",v="[object Error]",m="[object Function]",g="[object GeneratorFunction]",b="[object Map]",w="[object Number]",_="[object Null]",k="[object Object]",E="[object Proxy]",S="[object RegExp]",P="[object Set]",I="[object String]",C="[object Undefined]",T="[object WeakMap]",M="[object ArrayBuffer]",j="[object DataView]",L="[object Float32Array]",D="[object Float64Array]",X="[object Int8Array]",J="[object Int16Array]",ee="[object Int32Array]",ae="[object Uint8Array]",fe="[object Uint8ClampedArray]",de="[object Uint16Array]",oe="[object Uint32Array]",me=/[\\^$.*+?()[\]{}|]/g,se=/^\[object .+?Constructor\]$/,G=/^(?:0|[1-9]\d*)$/,Y={};Y[L]=Y[D]=Y[X]=Y[J]=Y[ee]=Y[ae]=Y[fe]=Y[de]=Y[oe]=!0,Y[s]=Y[f]=Y[M]=Y[u]=Y[j]=Y[h]=Y[v]=Y[m]=Y[b]=Y[w]=Y[k]=Y[S]=Y[P]=Y[I]=Y[T]=!1;var ie=typeof pn=="object"&&pn&&pn.Object===Object&&pn,pe=typeof self=="object"&&self&&self.Object===Object&&self,H=ie||pe||Function("return this")(),K=n&&!n.nodeType&&n,B=K&&!0&&e&&!e.nodeType&&e,W=B&&B.exports===K,V=W&&ie.process,O=function(){try{var $=B&&B.require&&B.require("util").types;return $||V&&V.binding&&V.binding("util")}catch{}}(),F=O&&O.isTypedArray;function Z($,U,ne){switch(ne.length){case 0:return $.call(U);case 1:return $.call(U,ne[0]);case 2:return $.call(U,ne[0],ne[1]);case 3:return $.call(U,ne[0],ne[1],ne[2])}return $.apply(U,ne)}function te($,U){for(var ne=-1,ve=Array($);++ne<$;)ve[ne]=U(ne);return ve}function he($){return function(U){return $(U)}}function ye($,U){return $==null?void 0:$[U]}function xe($,U){return function(ne){return $(U(ne))}}var Ee=Array.prototype,re=Function.prototype,Be=Object.prototype,hn=H["__core-js_shared__"],Te=re.toString,ze=Be.hasOwnProperty,yn=function(){var $=/[^.]+$/.exec(hn&&hn.keys&&hn.keys.IE_PROTO||"");return $?"Symbol(src)_1."+$:""}(),Se=Be.toString,Ue=Te.call(Object),y=RegExp("^"+Te.call(ze).replace(me,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),c=W?H.Buffer:void 0,p=H.Symbol,x=H.Uint8Array,A=c?c.allocUnsafe:void 0,N=xe(Object.getPrototypeOf,Object),z=Object.create,ge=Be.propertyIsEnumerable,Fe=Ee.splice,Ce=p?p.toStringTag:void 0,Ie=function(){try{var $=No(Object,"defineProperty");return $({},"",{}),$}catch{}}(),Ae=c?c.isBuffer:void 0,pi=Math.max,wa=Date.now,St=No(H,"Map"),st=No(Object,"create"),br=function(){function $(){}return function(U){if(!lt(U))return{};if(z)return z(U);$.prototype=U;var ne=new $;return $.prototype=void 0,ne}}();function Rn($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function Ao(){this.__data__=st?st(null):{},this.size=0}function _a($){var U=this.has($)&&delete this.__data__[$];return this.size-=U?1:0,U}function To($){var U=this.__data__;if(st){var ne=U[$];return ne===i?void 0:ne}return ze.call(U,$)?U[$]:void 0}function ka($){var U=this.__data__;return st?U[$]!==void 0:ze.call(U,$)}function xa($,U){var ne=this.__data__;return this.size+=this.has($)?0:1,ne[$]=st&&U===void 0?i:U,this}Rn.prototype.clear=Ao,Rn.prototype.delete=_a,Rn.prototype.get=To,Rn.prototype.has=ka,Rn.prototype.set=xa;function Fn($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function Oo(){this.__data__=[],this.size=0}function Ea($){var U=this.__data__,ne=Bn(U,$);if(ne<0)return!1;var ve=U.length-1;return ne==ve?U.pop():Fe.call(U,ne,1),--this.size,!0}function Po($){var U=this.__data__,ne=Bn(U,$);return ne<0?void 0:U[ne][1]}function Io($){return Bn(this.__data__,$)>-1}function Fo($,U){var ne=this.__data__,ve=Bn(ne,$);return ve<0?(++this.size,ne.push([$,U])):ne[ve][1]=U,this}Fn.prototype.clear=Oo,Fn.prototype.delete=Ea,Fn.prototype.get=Po,Fn.prototype.has=Io,Fn.prototype.set=Fo;function ft($){var U=-1,ne=$==null?0:$.length;for(this.clear();++U<ne;){var ve=$[U];this.set(ve[0],ve[1])}}function q(){this.size=0,this.__data__={hash:new Rn,map:new(St||Fn),string:new Rn}}function ce($){var U=Gi(this,$).delete($);return this.size-=U?1:0,U}function ke($){return Gi(this,$).get($)}function Ne($){return Gi(this,$).has($)}function an($,U){var ne=Gi(this,$),ve=ne.size;return ne.set($,U),this.size+=ne.size==ve?0:1,this}ft.prototype.clear=q,ft.prototype.delete=ce,ft.prototype.get=ke,ft.prototype.has=Ne,ft.prototype.set=an;function qe($){var U=this.__data__=new Fn($);this.size=U.size}function Ze(){this.__data__=new Fn,this.size=0}function Ke($){var U=this.__data__,ne=U.delete($);return this.size=U.size,ne}function Ln($){return this.__data__.get($)}function Sn($){return this.__data__.has($)}function Cn($,U){var ne=this.__data__;if(ne instanceof Fn){var ve=ne.__data__;if(!St||ve.length<t-1)return ve.push([$,U]),this.size=++ne.size,this;ne=this.__data__=new ft(ve)}return ne.set($,U),this.size=ne.size,this}qe.prototype.clear=Ze,qe.prototype.delete=Ke,qe.prototype.get=Ln,qe.prototype.has=Sn,qe.prototype.set=Cn;function Zn($,U){var ne=kr($),ve=!ne&&_r($),Oe=!ne&&!ve&&Aa($),$e=!ne&&!ve&&!Oe&&il($),je=ne||ve||Oe||$e,Re=je?te($.length,String):[],Qe=Re.length;for(var Un in $)(U||ze.call($,Un))&&!(je&&(Un=="length"||Oe&&(Un=="offset"||Un=="parent")||$e&&(Un=="buffer"||Un=="byteLength"||Un=="byteOffset")||Zf(Un,Qe)))&&Re.push(Un);return Re}function ct($,U,ne){(ne!==void 0&&!Ki($[U],ne)||ne===void 0&&!(U in $))&&yr($,U,ne)}function Sa($,U,ne){var ve=$[U];(!(ze.call($,U)&&Ki(ve,ne))||ne===void 0&&!(U in $))&&yr($,U,ne)}function Bn($,U){for(var ne=$.length;ne--;)if(Ki($[ne][0],U))return ne;return-1}function yr($,U,ne){U=="__proto__"&&Ie?Ie($,U,{configurable:!0,enumerable:!0,value:ne,writable:!0}):$[U]=ne}var Bc=Jc();function mi($){return $==null?$===void 0?C:_:Ce&&Ce in Object($)?Xc($):nh($)}function Mo($){return xr($)&&mi($)==s}function jc($){if(!lt($)||Qf($))return!1;var U=Ta($)?y:se;return U.test($a($))}function Rc($){return xr($)&&ei($.length)&&!!Y[mi($)]}function Uc($){if(!lt($))return eh($);var U=el($),ne=[];for(var ve in $)ve=="constructor"&&(U||!ze.call($,ve))||ne.push(ve);return ne}function Ca($,U,ne,ve,Oe){$!==U&&Bc(U,function($e,je){if(Oe||(Oe=new qe),lt($e))zc($,U,je,ne,Ca,ve,Oe);else{var Re=ve?ve(Lo($,je),$e,je+"",$,U,Oe):void 0;Re===void 0&&(Re=$e),ct($,je,Re)}},al)}function zc($,U,ne,ve,Oe,$e,je){var Re=Lo($,ne),Qe=Lo(U,ne),Un=je.get(Qe);if(Un){ct($,ne,Un);return}var qn=$e?$e(Re,Qe,ne+"",$,U,je):void 0,gi=qn===void 0;if(gi){var Oa=kr(Qe),oh=!Oa&&Aa(Qe),d_=!Oa&&!oh&&il(Qe);qn=Qe,Oa||oh||d_?kr(Re)?qn=Re:nl(Re)?qn=Gc(Re):oh?(gi=!1,qn=Hc(Qe,!0)):d_?(gi=!1,qn=qc(Qe,!0)):qn=[]:tl(Qe)||_r(Qe)?(qn=Re,_r(Re)?qn=rl(Re):(!lt(Re)||Ta(Re))&&(qn=Xf(Qe))):gi=!1}gi&&(je.set(Qe,qn),Oe(qn,Qe,ve,$e,je),je.delete(Qe)),ct($,ne,qn)}function Jf($,U){return th(Do($,U,R),$+"")}var Wc=Ie?function($,U){return Ie($,"toString",{configurable:!0,enumerable:!1,value:ah(U),writable:!0})}:R;function Hc($,U){if(U)return $.slice();var ne=$.length,ve=A?A(ne):new $.constructor(ne);return $.copy(ve),ve}function Vc($){var U=new $.constructor($.byteLength);return new x(U).set(new x($)),U}function qc($,U){var ne=U?Vc($.buffer):$.buffer;return new $.constructor(ne,$.byteOffset,$.length)}function Gc($,U){var ne=-1,ve=$.length;for(U||(U=Array(ve));++ne<ve;)U[ne]=$[ne];return U}function Kc($,U,ne,ve){var Oe=!ne;ne||(ne={});for(var $e=-1,je=U.length;++$e<je;){var Re=U[$e],Qe=ve?ve(ne[Re],$[Re],Re,ne,$):void 0;Qe===void 0&&(Qe=$[Re]),Oe?yr(ne,Re,Qe):Sa(ne,Re,Qe)}return ne}function Yc($){return Jf(function(U,ne){var ve=-1,Oe=ne.length,$e=Oe>1?ne[Oe-1]:void 0,je=Oe>2?ne[2]:void 0;for($e=$.length>3&&typeof $e=="function"?(Oe--,$e):void 0,je&&Zc(ne[0],ne[1],je)&&($e=Oe<3?void 0:$e,Oe=1),U=Object(U);++ve<Oe;){var Re=ne[ve];Re&&$(U,Re,ve,$e)}return U})}function Jc($){return function(U,ne,ve){for(var Oe=-1,$e=Object(U),je=ve(U),Re=je.length;Re--;){var Qe=je[$?Re:++Oe];if(ne($e[Qe],Qe,$e)===!1)break}return U}}function wr($,U,ne,ve,Oe,$e){return lt($)&<(U)&&($e.set(U,$),Ca($,U,void 0,wr,$e),$e.delete(U)),$}function Gi($,U){var ne=$.__data__;return Qc(U)?ne[typeof U=="string"?"string":"hash"]:ne.map}function No($,U){var ne=ye($,U);return jc(ne)?ne:void 0}function Xc($){var U=ze.call($,Ce),ne=$[Ce];try{$[Ce]=void 0;var ve=!0}catch{}var Oe=Se.call($);return ve&&(U?$[Ce]=ne:delete $[Ce]),Oe}function Xf($){return typeof $.constructor=="function"&&!el($)?br(N($)):{}}function Zf($,U){var ne=typeof $;return U=U??o,!!U&&(ne=="number"||ne!="symbol"&&G.test($))&&$>-1&&$%1==0&&$<U}function Zc($,U,ne){if(!lt(ne))return!1;var ve=typeof U;return(ve=="number"?Bo(ne)&&Zf(U,ne.length):ve=="string"&&U in ne)?Ki(ne[U],$):!1}function Qc($){var U=typeof $;return U=="string"||U=="number"||U=="symbol"||U=="boolean"?$!=="__proto__":$===null}function Qf($){return!!yn&&yn in $}function el($){var U=$&&$.constructor,ne=typeof U=="function"&&U.prototype||Be;return $===ne}function eh($){var U=[];if($!=null)for(var ne in Object($))U.push(ne);return U}function nh($){return Se.call($)}function Do($,U,ne){return U=pi(U===void 0?$.length-1:U,0),function(){for(var ve=arguments,Oe=-1,$e=pi(ve.length-U,0),je=Array($e);++Oe<$e;)je[Oe]=ve[U+Oe];Oe=-1;for(var Re=Array(U+1);++Oe<U;)Re[Oe]=ve[Oe];return Re[U]=ne(je),Z($,this,Re)}}function Lo($,U){if(!(U==="constructor"&&typeof $[U]=="function")&&U!="__proto__")return $[U]}var th=ih(Wc);function ih($){var U=0,ne=0;return function(){var ve=wa(),Oe=a-(ve-ne);if(ne=ve,Oe>0){if(++U>=r)return arguments[0]}else U=0;return $.apply(void 0,arguments)}}function $a($){if($!=null){try{return Te.call($)}catch{}try{return $+""}catch{}}return""}function Ki($,U){return $===U||$!==$&&U!==U}var _r=Mo(function(){return arguments}())?Mo:function($){return xr($)&&ze.call($,"callee")&&!ge.call($,"callee")},kr=Array.isArray;function Bo($){return $!=null&&ei($.length)&&!Ta($)}function nl($){return xr($)&&Bo($)}var Aa=Ae||Q;function Ta($){if(!lt($))return!1;var U=mi($);return U==m||U==g||U==d||U==E}function ei($){return typeof $=="number"&&$>-1&&$%1==0&&$<=o}function lt($){var U=typeof $;return $!=null&&(U=="object"||U=="function")}function xr($){return $!=null&&typeof $=="object"}function tl($){if(!xr($)||mi($)!=k)return!1;var U=N($);if(U===null)return!0;var ne=ze.call(U,"constructor")&&U.constructor;return typeof ne=="function"&&ne instanceof ne&&Te.call(ne)==Ue}var il=F?he(F):Rc;function rl($){return Kc($,al($))}var rh=Jf(function($){return $.push(void 0,wr),Z(ol,void 0,$)});function al($){return Bo($)?Zn($,!0):Uc($)}var ol=Yc(function($,U,ne,ve){Ca($,U,ne,ve)});function ah($){return function(){return $}}function R($){return $}function Q(){return!1}e.exports=rh}(ks,ks.exports);var E8=ks.exports;const S8=Er(E8);var C8=rr(Dp()),Lp=C8.Buffer,Ga=(e,n,t)=>{if(e)return;let i="invariant violation";throw n&&(i+=`: ${n}`),t!=null&&t.A&&(i+=` [${t.A[0]}]`),t!=null&&t.F&&(i+=` at ${A8(t.F)}:${t.L}`),new $8(i)},$8=class extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}},A8=e=>{const n=e.match(/.+\/(packages\/.+\/.+)/);if(n){const[,t]=n;return t}return e},T8=tn({"node_modules/.pnpm/events@3.3.0/node_modules/events/events.js"(e,n){var t=typeof Reflect=="object"?Reflect:null,i=t&&typeof t.apply=="function"?t.apply:function(C,T,M){return Function.prototype.apply.call(C,T,M)},r;t&&typeof t.ownKeys=="function"?r=t.ownKeys:Object.getOwnPropertySymbols?r=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:r=function(C){return Object.getOwnPropertyNames(C)};function a(I){console&&console.warn&&console.warn(I)}var o=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}n.exports=s,n.exports.once=E,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var f=10;function d(I){if(typeof I!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof I)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(I){if(typeof I!="number"||I<0||o(I))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+I+".");f=I}}),s.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},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||o(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function u(I){return I._maxListeners===void 0?s.defaultMaxListeners:I._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(C){for(var T=[],M=1;M<arguments.length;M++)T.push(arguments[M]);var j=C==="error",L=this._events;if(L!==void 0)j=j&&L.error===void 0;else if(!j)return!1;if(j){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var X=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw X.context=D,X}var J=L[C];if(J===void 0)return!1;if(typeof J=="function")i(J,this,T);else for(var ee=J.length,ae=w(J,ee),M=0;M<ee;++M)i(ae[M],this,T);return!0};function h(I,C,T,M){var j,L,D;if(d(T),L=I._events,L===void 0?(L=I._events=Object.create(null),I._eventsCount=0):(L.newListener!==void 0&&(I.emit("newListener",C,T.listener?T.listener:T),L=I._events),D=L[C]),D===void 0)D=L[C]=T,++I._eventsCount;else if(typeof D=="function"?D=L[C]=M?[T,D]:[D,T]:M?D.unshift(T):D.push(T),j=u(I),j>0&&D.length>j&&!D.warned){D.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=I,X.type=C,X.count=D.length,a(X)}return I}s.prototype.addListener=function(C,T){return h(this,C,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,T){return h(this,C,T,!0)};function v(){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 m(I,C,T){var M={fired:!1,wrapFn:void 0,target:I,type:C,listener:T},j=v.bind(M);return j.listener=T,M.wrapFn=j,j}s.prototype.once=function(C,T){return d(T),this.on(C,m(this,C,T)),this},s.prototype.prependOnceListener=function(C,T){return d(T),this.prependListener(C,m(this,C,T)),this},s.prototype.removeListener=function(C,T){var M,j,L,D,X;if(d(T),j=this._events,j===void 0)return this;if(M=j[C],M===void 0)return this;if(M===T||M.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete j[C],j.removeListener&&this.emit("removeListener",C,M.listener||T));else if(typeof M!="function"){for(L=-1,D=M.length-1;D>=0;D--)if(M[D]===T||M[D].listener===T){X=M[D].listener,L=D;break}if(L<0)return this;L===0?M.shift():_(M,L),M.length===1&&(j[C]=M[0]),j.removeListener!==void 0&&this.emit("removeListener",C,X||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var T,M,j;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[C]),this;if(arguments.length===0){var L=Object.keys(M),D;for(j=0;j<L.length;++j)D=L[j],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=M[C],typeof T=="function")this.removeListener(C,T);else if(T!==void 0)for(j=T.length-1;j>=0;j--)this.removeListener(C,T[j]);return this};function g(I,C,T){var M=I._events;if(M===void 0)return[];var j=M[C];return j===void 0?[]:typeof j=="function"?T?[j.listener||j]:[j]:T?k(j):w(j,j.length)}s.prototype.listeners=function(C){return g(this,C,!0)},s.prototype.rawListeners=function(C){return g(this,C,!1)},s.listenerCount=function(I,C){return typeof I.listenerCount=="function"?I.listenerCount(C):b.call(I,C)},s.prototype.listenerCount=b;function b(I){var C=this._events;if(C!==void 0){var T=C[I];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function w(I,C){for(var T=new Array(C),M=0;M<C;++M)T[M]=I[M];return T}function _(I,C){for(;C+1<I.length;C++)I[C]=I[C+1];I.pop()}function k(I){for(var C=new Array(I.length),T=0;T<C.length;++T)C[T]=I[T].listener||I[T];return C}function E(I,C){return new Promise(function(T,M){function j(D){I.removeListener(C,L),M(D)}function L(){typeof I.removeListener=="function"&&I.removeListener("error",j),T([].slice.call(arguments))}P(I,C,L,{once:!0}),C!=="error"&&S(I,j,{once:!0})})}function S(I,C,T){typeof I.on=="function"&&P(I,"error",C,T)}function P(I,C,T,M){if(typeof I.on=="function")M.once?I.once(C,T):I.on(C,T);else if(typeof I.addEventListener=="function")I.addEventListener(C,function j(L){M.once&&I.removeEventListener(C,j),T(L)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof I)}}}),Bp=rr(T8());Bp.EventEmitter,Bp.EventEmitter;var xs=e=>{const n=Object.getPrototypeOf(e).constructor.name;return e.toJSON?`${n}(${Ft(e.toJSON())})`:String(e)},jp=e=>{throw e},Rp;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.VERBOSE=1]="VERBOSE",e[e.BOLD=2]="BOLD"})(Rp||(Rp={}));var O8=(e,n=8)=>{const t=String(e);return t.length<=n?t:t.slice(0,n)},Es=Symbol.for("devtoolsFormatter"),P8=()=>{typeof window<"u"&&(window.devtoolsFormatters??(window.devtoolsFormatters=[])).push({header:(e,n)=>{const t=e[Es];if(t===void 0)return null;if(typeof t!="object"||t===null||typeof t.header!="function")throw new Error(`Invalid devtools formatter for ${e.constructor.name}`);return t.header(n)},hasBody:(e,n)=>{const t=e[Es];return!t||!t.hasBody?!1:t.hasBody(n)},body:(e,n)=>{const t=e[Es];return!t||!t.body?null:t.body(n)}})};P8();var I8=Symbol.for("dxos.common.equals"),F8=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),_d="/home/runner/work/dxos/dxos/packages/common/keys/src/public-key.ts",M8=32,Up=class Qn{static from(n){if(Ga(n,void 0,{F:_d,L:30,S:this,A:["source",""]}),n instanceof Qn)return n;if(n instanceof Buffer)return new Qn(new Uint8Array(n.buffer,n.byteOffset,n.byteLength));if(n instanceof Uint8Array)return new Qn(n);if(n instanceof ArrayBuffer)return new Qn(new Uint8Array(n));if(typeof n=="string")return Qn.fromHex(n);if(n.asUint8Array)return new Qn(n.asUint8Array());throw new TypeError(`Unable to create PublicKey from ${n}`)}static safeFrom(n){if(n)try{return Qn.from(n)}catch{return}}static fromHex(n){n.startsWith("0x")&&(n=n.slice(2));const t=Buffer.from(n,"hex");return new Qn(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}static random(){return Qn.from(N8(M8))}static*randomSequence(){for(let n=0;n<1e4;n++)yield Qn.random();throw new Error("Too many keys requested")}static isPublicKey(n){return n instanceof Qn}static assertValidPublicKey(n){if(!this.isPublicKey(n))throw new TypeError("Invalid PublicKey")}static equals(n,t){return Qn.from(n).equals(t)}static bufferize(n){return Ga(typeof n=="string","Invalid type",{F:_d,L:129,S:this,A:["typeof str === 'string'","'Invalid type'"]}),Buffer.from(n,"hex")}static stringify(n){return n instanceof Qn?n=n.asBuffer():n instanceof Uint8Array&&(n=Buffer.from(n.buffer,n.byteOffset,n.byteLength)),Ga(n instanceof Buffer,"Invalid type",{F:_d,L:148,S:this,A:["key instanceof Buffer","'Invalid type'"]}),n.toString("hex")}static hash(n){return n.toHex()}constructor(n){if(this._value=n,!(n instanceof Uint8Array))throw new TypeError(`Expected Uint8Array, got: ${n}`)}toString(){return this.toHex()}toJSON(){return this.toHex()}get length(){return this._value.length}toHex(){return this.asBuffer().toString("hex")}truncate(n=void 0){return O8(this,n)}asBuffer(){return Buffer.from(this._value.buffer,this._value.byteOffset,this._value.byteLength)}asUint8Array(){return this._value}getInsecureHash(n){return Math.abs(this._value.reduce((t,i)=>t^i|0,0))%n}[Ft.custom](n,t){if(!t.colors||typeof process.stdout.hasColors!="function"||!process.stdout.hasColors())return`<PublicKey ${this.truncate()}>`;const i=o=>`\x1B[${o}m`,r=["red","green","yellow","blue","magenta","cyan","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright"],a=r[this.getInsecureHash(r.length)];return`PublicKey(${i(Ft.colors[a][0])}${this.truncate()}${i(Ft.colors.reset[0])})`}get[Es](){return{header:()=>{const n=["darkred","green","orange","blue","darkmagenta","darkcyan","red","green","orange","blue","magenta","darkcyan","black"],t=n[this.getInsecureHash(n.length)];return["span",{},["span",{},"PublicKey("],["span",{style:`color: ${t};`},this.truncate()],["span",{},")"]]}}}equals(n){const t=Qn.from(n);if(this._value.length!==t._value.length)return!1;let i=!0;for(let r=0;r<this._value.length;r++)i&&(i=this._value[r]===t._value[r]);return i}[I8](n){return Qn.isPublicKey(n)?this.equals(n):!1}},N8=e=>{const n=globalThis.crypto??F8("@dxos/node-std/crypto").webcrypto,t=new Uint8Array(e);return n.getRandomValues(t),t},zp=10;(class{constructor(e,n){if(this._projection=e,this._values=new Map,n)for(const t of n)this.add(t)}toString(){return xs(this)}toJSON(){return this._values.size>zp?{size:this._values.size}:Array.from(this._values.values())}[Ft.custom](){return xs(this)}add(e){return this._values.set(this._projection(e),e),this}clear(){this._values.clear()}delete(e){return this._values.delete(this._projection(e))}forEach(e,n){n&&(e=e.bind(n)),this._values.forEach(t=>e(t,t,this))}has(e){return this._values.has(this._projection(e))}get size(){return this._values.size}[Symbol.iterator](){return this._values.values()}*entries(){for(const e of this._values.values())yield[e,e]}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}get[Symbol.toStringTag](){return"ComplexSet"}}),class{constructor(e,n){if(this._keyProjection=e,this._keys=new Map,this._values=new Map,n)for(const[t,i]of n)this.set(t,i)}toString(){return xs(this)}toJSON(){return this._values.size>zp?{size:this._values.size}:Array.from(this._values.values())}[Ft.custom](){return xs(this)}clear(){this._keys.clear(),this._values.clear()}delete(e){const n=this._keys.delete(this._keyProjection(e)),t=this._values.delete(this._keyProjection(e));return n||t}forEach(e,n){n&&(e=e.bind(n)),this._keys.forEach((t,i)=>e(this._values.get(i)??jp(new Error("Map corrupted.")),t,this))}get(e){return this._values.get(this._keyProjection(e))}has(e){return this._keys.has(this._keyProjection(e))}set(e,n){const t=this._keyProjection(e);return this._keys.set(t,e),this._values.set(t,n),this}get size(){return this._keys.size}*[Symbol.iterator](){for(const[e,n]of this._keys){const t=this._values.get(e)??jp(new Error("Map corrupted."));yield[n,t]}}entries(){return this[Symbol.iterator]()}keys(){return this._keys.values()}values(){return this._values.values()}get[Symbol.toStringTag](){return"ComplexMap"}};var Wp=["๐น","๐ป","๐ฝ","๐ค","๐","๐ฆพ","๐ฆฟ","๐ฆท","๐ฃ","๐๏ธ","๐งถ","๐","๐","๐ฆ","๐ฆ","๐ด","๐ฆ","๐","๐ฆ","๐","๐ชฒ","๐ข","๐ฆ","๐ฆ","๐ฆ","๐ฆ","๐ ","๐ฌ","๐","๐ฆญ","๐
","๐","๐ฆ","๐ฆ","๐ฆง","๐","๐ซ","๐ฆ","๐ฆ","๐ฆฌ","๐","๐","๐ฆ","๐","๐","๐","๐ฆ","๐ฆ","๐ฆข","๐ฆฉ","๐ฆฆ","๐","๐ฟ๏ธ","๐ต","๐ฒ","๐ณ","๐ชต","๐ฑ","๐","๐ชบ","๐","๐","๐ชธ","๐ชจ","๐พ","๐ท","๐ป","โ๏ธ","๐","๐ช","โญ๏ธ","โก๏ธ","โ๏ธ","๐ฅ","๐","โ๏ธ","๐ง","โฑ๏ธ","๐","๐","๐","๐","๐","๐ซ","๐","๐","๐","๐ฅญ","๐","๐ฅฅ","๐ฅ","๐ฅ","๐ถ๏ธ","๐ฝ","๐ฅ","๐ฌ","๐ฅ","๐ซ","โ๏ธ","๐ต","๐ง","๐ง","๐๏ธ","โ๏ธ","๐","๐๏ธ","๐ถ","๐","๐ฐ๏ธ","โฒ๏ธ","๐ฐ","๐ฒ","โบ๏ธ","๐๏ธ","๐งฒ","โ๏ธ","๐ฉ","๐ฎ","๐ญ","๐ฌ","๐งฌ","๐ก๏ธ","๐งบ","๐๏ธ","๐","๐ช","๐งธ","๐","๐","๐","โป๏ธ","๐ต"],Hp=["red","amber","lime","green","emerald","teal","cyan","violet","purple","fuchsia","pink","rose"],D8=e=>Ka(e.toHex()),Ka=e=>Vp(parseInt(e,16)),Vp=e=>Wp[e%Wp.length],L8=e=>qp(parseInt(e,16)),qp=e=>Hp[e%Hp.length],Gp=e=>Kp(e.toHex()),Kp=e=>B8(parseInt(e,16)),B8=e=>({emoji:Vp(e),hue:qp(e)}),j8=["ack","alabama","alanine","alaska","alpha","angel","apart","april","arizona","arkansas","artist","asparagus","aspen","august","autumn","avocado","bacon","bakerloo","batman","beer","berlin","beryllium","black","blossom","blue","bluebird","bravo","bulldog","burger","butter","california","carbon","cardinal","carolina","carpet","cat","ceiling","charlie","chicken","coffee","cola","cold","colorado","comet","connecticut","crazy","cup","dakota","december","delaware","delta","diet","don","double","early","earth","east","echo","edward","eight","eighteen","eleven","emma","enemy","equal","failed","fanta","fifteen","fillet","finch","fish","five","fix","floor","florida","football","four","fourteen","foxtrot","freddie","friend","fruit","gee","georgia","glucose","golf","green","grey","hamper","happy","harry","hawaii","helium","high","hot","hotel","hydrogen","idaho","illinois","india","indigo","ink","iowa","island","item","jersey","jig","johnny","juliet","july","jupiter","kansas","kentucky","kilo","king","kitten","lactose","lake","lamp","lemon","leopard","lima","lion","lithium","london","louisiana","low","magazine","magnesium","maine","mango","march","mars","maryland","massachusetts","may","mexico","michigan","mike","minnesota","mirror","mississippi","missouri","mobile","mockingbird","monkey","montana","moon","mountain","muppet","music","nebraska","neptune","network","nevada","nine","nineteen","nitrogen","north","november","nuts","october","ohio","oklahoma","one","orange","oranges","oregon","oscar","oven","oxygen","papa","paris","pasta","pennsylvania","pip","pizza","pluto","potato","princess","purple","quebec","queen","quiet","red","river","robert","robin","romeo","rugby","sad","salami","saturn","september","seven","seventeen","shade","sierra","single","sink","six","sixteen","skylark","snake","social","sodium","solar","south","spaghetti","speaker","spring","stairway","steak","stream","summer","sweet","table","tango","ten","tennessee","tennis","texas","thirteen","three","timing","triple","twelve","twenty","two","uncle","undress","uniform","uranus","utah","vegan","venus","vermont","victor","video","violet","virginia","washington","west","whiskey","white","william","winner","winter","wisconsin","wolfram","wyoming","xray","yankee","yellow","zebra","zulu"],R8=class{constructor(e=j8){if(this.wordlist=e,e.length!==256)throw new Error("Wordlist must have exactly 256 items");this.wordlist=e}humanize(e,n=4,t="-"){const i=e.match(/(..?)/g);if(!i)throw new Error("");const r=i.map(o=>parseInt(o,16));return this._compress(r,n).map(o=>this.wordlist[o]).join(t)}_compress(e,n){const t=e.length;if(n>t)throw new Error("Fewer input bytes than requested output");const i=t/n>>0,r=[];for(let o=0;o<i*n;o+=i)r.push(e.slice(o,o+i));return r[r.length-1]=r[r.length-1].concat(e.slice(n*i)),r.map(o=>o.reduce((s,f)=>s^f))}},U8=new R8,z8=e=>(e instanceof Lp||e instanceof Uint8Array||e instanceof ArrayBuffer?e=Up.stringify(e):e instanceof Up&&(e=e.toHex()),U8.humanize(e)),W8=e=>Lp.from(e.buffer,e.byteOffset,e.byteLength),H8=5,kd=(e,n=0,t=new WeakSet)=>{if(n>H8)return null;if(typeof e=="function")return null;if(typeof e=="object"&&e!==null){if(t.has(e))return null;t.add(e);try{if(e instanceof Uint8Array)return W8(e).toString("hex");if(Array.isArray(e))return e.map(i=>kd(i,n+1,t));if(typeof e.toJSON=="function")return e.toJSON();{const i={};for(const r of Object.keys(e))i[r]=kd(e[r],n+1,t);return i}}finally{t.delete(e)}}else return e},V8=(e,n,t)=>{let i=e.get(n);return i===void 0&&(i=typeof t=="function"?t():t,e.set(n,i)),i},q8=()=>typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),xd=Symbol("instanceTag"),G8=e=>n=>{n.prototype[xd]=e,Object.defineProperty(n.prototype,Symbol.hasInstance,{value:t=>(t==null?void 0:t[xd])===e}),Object.defineProperty(n,Symbol.hasInstance,{value:t=>(t==null?void 0:t[xd])===e})},Ed=Symbol.for("dxos.instance-contexts"),K8=globalThis[Ed]??(globalThis[Ed]=new WeakMap),Y8=e=>{const n=Object.getPrototypeOf(e),t=V8(K8,n,()=>({nextId:0,instanceIds:new WeakMap}));let i=t.instanceIds.get(e);return i===void 0&&(i=t.nextId++,t.instanceIds.set(e,i)),i},J8=e=>e==null?"null":`${Object.getPrototypeOf(e).constructor.name}#${Y8(e)}`;Symbol.dispose??(Symbol.dispose=Symbol("Symbol.dispose")),Symbol.asyncDispose??(Symbol.asyncDispose=Symbol("Symbol.asyncDispose"));var Sd=()=>{throw new Error("Not available on this platform")},X8=()=>Sd(),Z8=()=>Sd(),Q8=()=>Sd(),Yp=tn({"node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(e,n){function t(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function i(o,s){for(var f="",d=0,u=-1,h=0,v,m=0;m<=o.length;++m){if(m<o.length)v=o.charCodeAt(m);else{if(v===47)break;v=47}if(v===47){if(!(u===m-1||h===1))if(u!==m-1&&h===2){if(f.length<2||d!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var g=f.lastIndexOf("/");if(g!==f.length-1){g===-1?(f="",d=0):(f=f.slice(0,g),d=f.length-1-f.lastIndexOf("/")),u=m,h=0;continue}}else if(f.length===2||f.length===1){f="",d=0,u=m,h=0;continue}}s&&(f.length>0?f+="/..":f="..",d=2)}else f.length>0?f+="/"+o.slice(u+1,m):f=o.slice(u+1,m),d=m-u-1;u=m,h=0}else v===46&&h!==-1?++h:h=-1}return f}function r(o,s){var f=s.dir||s.root,d=s.base||(s.name||"")+(s.ext||"");return f?f===s.root?f+d:f+o+d:d}var a={resolve:function(){for(var s="",f=!1,d,u=arguments.length-1;u>=-1&&!f;u--){var h;u>=0?h=arguments[u]:(d===void 0&&(d=process.cwd()),h=d),t(h),h.length!==0&&(s=h+"/"+s,f=h.charCodeAt(0)===47)}return s=i(s,!f),f?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(t(s),s.length===0)return".";var f=s.charCodeAt(0)===47,d=s.charCodeAt(s.length-1)===47;return s=i(s,!f),s.length===0&&!f&&(s="."),s.length>0&&d&&(s+="/"),f?"/"+s:s},isAbsolute:function(s){return t(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,f=0;f<arguments.length;++f){var d=arguments[f];t(d),d.length>0&&(s===void 0?s=d:s+="/"+d)}return s===void 0?".":a.normalize(s)},relative:function(s,f){if(t(s),t(f),s===f||(s=a.resolve(s),f=a.resolve(f),s===f))return"";for(var d=1;d<s.length&&s.charCodeAt(d)===47;++d);for(var u=s.length,h=u-d,v=1;v<f.length&&f.charCodeAt(v)===47;++v);for(var m=f.length,g=m-v,b=h<g?h:g,w=-1,_=0;_<=b;++_){if(_===b){if(g>b){if(f.charCodeAt(v+_)===47)return f.slice(v+_+1);if(_===0)return f.slice(v+_)}else h>b&&(s.charCodeAt(d+_)===47?w=_:_===0&&(w=0));break}var k=s.charCodeAt(d+_),E=f.charCodeAt(v+_);if(k!==E)break;k===47&&(w=_)}var S="";for(_=d+w+1;_<=u;++_)(_===u||s.charCodeAt(_)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+f.slice(v+w):(v+=w,f.charCodeAt(v)===47&&++v,f.slice(v))},_makeLong:function(s){return s},dirname:function(s){if(t(s),s.length===0)return".";for(var f=s.charCodeAt(0),d=f===47,u=-1,h=!0,v=s.length-1;v>=1;--v)if(f=s.charCodeAt(v),f===47){if(!h){u=v;break}}else h=!1;return u===-1?d?"/":".":d&&u===1?"//":s.slice(0,u)},basename:function(s,f){if(f!==void 0&&typeof f!="string")throw new TypeError('"ext" argument must be a string');t(s);var d=0,u=-1,h=!0,v;if(f!==void 0&&f.length>0&&f.length<=s.length){if(f.length===s.length&&f===s)return"";var m=f.length-1,g=-1;for(v=s.length-1;v>=0;--v){var b=s.charCodeAt(v);if(b===47){if(!h){d=v+1;break}}else g===-1&&(h=!1,g=v+1),m>=0&&(b===f.charCodeAt(m)?--m===-1&&(u=v):(m=-1,u=g))}return d===u?u=g:u===-1&&(u=s.length),s.slice(d,u)}else{for(v=s.length-1;v>=0;--v)if(s.charCodeAt(v)===47){if(!h){d=v+1;break}}else u===-1&&(h=!1,u=v+1);return u===-1?"":s.slice(d,u)}},extname:function(s){t(s);for(var f=-1,d=0,u=-1,h=!0,v=0,m=s.length-1;m>=0;--m){var g=s.charCodeAt(m);if(g===47){if(!h){d=m+1;break}continue}u===-1&&(h=!1,u=m+1),g===46?f===-1?f=m:v!==1&&(v=1):f!==-1&&(v=-1)}return f===-1||u===-1||v===0||v===1&&f===u-1&&f===d+1?"":s.slice(f,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return r("/",s)},parse:function(s){t(s);var f={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return f;var d=s.charCodeAt(0),u=d===47,h;u?(f.root="/",h=1):h=0;for(var v=-1,m=0,g=-1,b=!0,w=s.length-1,_=0;w>=h;--w){if(d=s.charCodeAt(w),d===47){if(!b){m=w+1;break}continue}g===-1&&(b=!1,g=w+1),d===46?v===-1?v=w:_!==1&&(_=1):v!==-1&&(_=-1)}return v===-1||g===-1||_===0||_===1&&v===g-1&&v===m+1?g!==-1&&(m===0&&u?f.base=f.name=s.slice(1,g):f.base=f.name=s.slice(m,g)):(m===0&&u?(f.name=s.slice(1,v),f.base=s.slice(1,g)):(f.name=s.slice(m,v),f.base=s.slice(m,g)),f.ext=s.slice(v,g)),m>0?f.dir=s.slice(0,m-1):u&&(f.dir="/"),f},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,n.exports=a}});rr(Yp());var Vt=rr(Yp());Vt.basename;var eS=Vt.dirname;Vt.extname,Vt.format,Vt.isAbsolute,Vt.join,Vt.normalize,Vt.parse,Vt.relative,Vt.resolve;var An;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})(An||(An={}));var nS={trace:5,debug:10,info:11,warn:12,error:13},Ya;(function(e){e.CONSOLE="console",e.BROWSER="browser",e.DEBUG="debug"})(Ya||(Ya={}));var tS=Symbol("logInfoProperties"),iS=e=>{if(!e)return{};const n={},i=Object.getPrototypeOf(e)[tS]??[];for(const r of i)try{n[r]=typeof e[r]=="function"?e[r]():e[r]}catch(a){n[r]=a.message}return n},rS=(e,n,t)=>n>=e.level&&(!e.pattern||t.includes(e.pattern)),Jp=(e,n)=>n===void 0?!0:n.some(t=>{var i;return rS(t,e.level,((i=e.meta)==null?void 0:i.F)??"")}),Cd=e=>{let n;if(e.meta){const t=iS(e.meta.S);Object.keys(t).length>0&&(n=Object.assign(n??{},t))}if(e.context)if(e.context instanceof Error){const t=e.context.context;n=Object.assign(n??{},{error:e.context.stack,...t})}else typeof e.context=="object"&&(n=Object.assign(n??{},e.context));if(e.error){const t=e.error.context;n=Object.assign(n??{},{error:e.error.stack,...t})}return n&&Object.keys(n).length>0?n:void 0},aS=0,oS=e=>(n,t,i)=>(r,a,o)=>{const s=o.value;o.value=function(...f){const d={...i??{},S:this},u=f.map(h=>Ft(h,!1,1,!0)).join(", ");try{const h=performance.now(),v=s.apply(this,f);if(sS(v)){const m=aS++;e.info(`${a}(${u}) => Promise { #${m} }`,{},d),v.then(g=>{g!==void 0?e.info(`โ
resolve #${m} ${(performance.now()-h).toFixed(0)}ms => ${Ft(g,!1,1,!0)}`,{},d):e.info(`โ
resolve #${m} ${(performance.now()-h).toFixed(0)}ms`,{},d)},g=>{e.info(`๐ฅ reject #${m} #${(performance.now()-h).toFixed(0)}ms => ${g}`,{},d)})}else e.info(`${a}(${u}) => ${Ft(v,!1,1,!0)}`,{},d);return v}catch(h){throw e.error(`${a}(${u}) ๐ฅ ${h}`,{},d),h}},Object.defineProperty(o.value,"name",{value:a+"$log"})},sS=e=>e&&typeof e.then=="function",fS=e=>{let n;if(typeof localStorage>"u"?globalThis.localStorage_dxlog&&(n=globalThis.localStorage_dxlog):n=localStorage.getItem("dxlog")??void 0,!!n)try{return JSON.parse(n)}catch(t){console.info("can't parse dxlog config",t);return}},Xp=()=>{},lS=(e,n)=>{console.log(Ft(n,!1,null,!0))},Zp=e=>{const n=e.match(/.+\/(packages\/.+\/.+)/);if(n){const[,t]=n;return t}return e},$d=typeof mochaExecutor<"u"?{useTestProcessor:!0,printFileLinks:!0}:{useTestProcessor:!1,printFileLinks:!1},dS=(e,n)=>{var d,u,h,v;if(!Jp(n,e.filters))return;const t=e.prefix??"https://vscode.dev/github.com/dxos/dxos/blob/main/",i=[];let r="";if(n.meta){const m=Zp(n.meta.F);r=`${`${t.replace(/\/$/,"")}/${m}`}#L${n.meta.L}`}let a=[];if((d=n.meta)!=null&&d.S){const m=(u=n.meta)==null?void 0:u.S,g=m.name||J8(m),b=(h=n.meta.S)!=null&&h.hostSessionId?"[worker] ":"";a.push(`%c${b}${g}`,"color:#C026D3;font-weight:bold")}a.push(n.message);const o=Cd(n);o&&a.push(o);const s={[An.ERROR]:console.error,[An.WARN]:console.warn,[An.DEBUG]:console.log};($d.printFileLinks||q8())&&(i!=null&&i.length?a=[`%c${r}
|
|
104
104
|
%c${a.join(" ")}`,...i]:a=[r+`
|
|
105
105
|
`,...a]);const f=s[n.level]??console.log;typeof((v=n.meta)==null?void 0:v.C)=="function"?n.meta.C(f,a):f(...a)},uS=(e,n)=>{var f,d,u;if(!Jp(n,e.filters))return;let t="";n.meta&&(t=`${Zp(n.meta.F)}:${n.meta.L}`);let i=[];const r=(d=(f=n.meta)==null?void 0:f.S)!=null&&d.hostSessionId?"[worker] ":"";i.push(`${r}${n.message}`);const a=Cd(n);a&&i.push(a);const o={[An.ERROR]:console.error,[An.WARN]:console.warn,[An.DEBUG]:console.log};$d.printFileLinks&&(i=[t,...i]);const s=o[n.level]??console.log;typeof((u=n.meta)==null?void 0:u.C)=="function"?n.meta.C(s,i):s(...i)},Qp=$d.useTestProcessor?uS:dS,cS=({path:e,levels:n})=>{let t;return(i,r)=>{var o,s;if(!n.includes(r.level))return;if(!t){try{Z8(eS(e))}catch{}t=Q8()}const a={...r,timestamp:Date.now(),meta:{file:(o=r.meta)==null?void 0:o.F,line:(s=r.meta)==null?void 0:s.L},context:kd(Cd(r))};X8(t,JSON.stringify(a)+`
|
|
106
|
-
`)}},em,hS=()=>(em??(em=process.env.LOG_FILE??(process.env.HOME?`${process.env.HOME}/.dxlog/${new Date().toISOString()}.log`:void 0)),em);cS({path:hS(),levels:[An.ERROR,An.WARN,An.INFO,An.TRACE]});var vS={[Ya.CONSOLE]:Xp,[Ya.BROWSER]:Qp,[Ya.DEBUG]:lS},pS=typeof window<"u"||typeof navigator<"u",Ad=[pS?Qp:Xp],nm=e=>{if(typeof e=="number")return[{level:e}];const n=(i,r=An.WARN)=>nS[i.toLowerCase()]??r;return(typeof e=="string"?e.split(/,\s*/):e).map(i=>{const[r,a]=i.split(":");return a?{level:n(a),pattern:r}:{level:n(r)}})},tm=e=>{const n="process"in globalThis?{file:process.env.LOG_CONFIG,filter:process.env.LOG_FILTER,processor:process.env.LOG_PROCESSOR}:void 0,t=S8({},
|
|
106
|
+
`)}},em,hS=()=>(em??(em=process.env.LOG_FILE??(process.env.HOME?`${process.env.HOME}/.dxlog/${new Date().toISOString()}.log`:void 0)),em);cS({path:hS(),levels:[An.ERROR,An.WARN,An.INFO,An.TRACE]});var vS={[Ya.CONSOLE]:Xp,[Ya.BROWSER]:Qp,[Ya.DEBUG]:lS},pS=typeof window<"u"||typeof navigator<"u",Ad=[pS?Qp:Xp],nm=e=>{if(typeof e=="number")return[{level:e}];const n=(i,r=An.WARN)=>nS[i.toLowerCase()]??r;return(typeof e=="string"?e.split(/,\s*/):e).map(i=>{const[r,a]=i.split(":");return a?{level:n(a),pattern:r}:{level:n(r)}})},tm=e=>{const n="process"in globalThis?{file:process.env.LOG_CONFIG,filter:process.env.LOG_FILTER,processor:process.env.LOG_PROCESSOR}:void 0,t=S8({},fS(n==null?void 0:n.file),n,e);return{options:t,filters:nm(t.filter??An.INFO),captureFilters:nm(t.captureFilter??An.WARN),processors:t.processor?[vS[t.processor]]:Ad,prefix:t.prefix}},mS=()=>{const e=(...t)=>n(An.DEBUG,...t);e._config=tm(),Object.defineProperty(e,"runtimeConfig",{get:()=>e._config}),e.addProcessor=t=>{Ad.filter(i=>i===t).length===0&&Ad.push(t),e._config.processors.filter(i=>i===t).length===0&&e._config.processors.push(t)},e.config=t=>{e._config=tm(t)},e.trace=(...t)=>n(An.TRACE,...t),e.debug=(...t)=>n(An.DEBUG,...t),e.info=(...t)=>n(An.INFO,...t),e.warn=(...t)=>n(An.WARN,...t),e.error=(...t)=>n(An.ERROR,...t),e.catch=(t,i,r)=>n(An.ERROR,t.stack,i,r,t),e.break=()=>e.info("โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ"),e.stack=(t,i,r)=>n(An.INFO,`${t??"Stack Dump"}
|
|
107
107
|
${gS()}`,i,r),e.method=oS(e);const n=(t,i,r={},a,o)=>{e._config.processors.forEach(s=>s(e._config,{level:t,message:i,context:r,meta:a,error:o}))};return e},We=globalThis.dx_log??(globalThis.dx_log=mS()),gS=()=>new Error().stack.split(`
|
|
108
108
|
`).slice(3).join(`
|
|
109
109
|
`),bS=Symbol("kDebugInfoProperties");(class{constructor(e,n){this.constr=e,this.parent=n}getInfo(){if(!this.instance)return{};const e=this.constr.prototype[bS]??[],n={};for(const t of e)n[t]=this.instance[t];return n}[Ft.custom](){return{className:this.constr.name,info:this.getInfo(),parent:this.parent}}});const im="Popover",[rm,Bj]=At(im,[us]),Ja=us(),[yS,Ti]=rm(im),wS=e=>{const{__scopePopover:n,children:t,open:i,defaultOpen:r,onOpenChange:a,modal:o=!1}=e,s=Ja(n),f=l.useRef(null),[d,u]=l.useState(!1),[h=!1,v]=bt({prop:i,defaultProp:r,onChange:a});return l.createElement(S1,s,l.createElement(yS,{scope:n,contentId:ts(),triggerRef:f,open:h,onOpenChange:v,onOpenToggle:l.useCallback(()=>v(m=>!m),[v]),hasCustomAnchor:d,onCustomAnchorAdd:l.useCallback(()=>u(!0),[]),onCustomAnchorRemove:l.useCallback(()=>u(!1),[]),modal:o},t))},_S="PopoverAnchor",kS=l.forwardRef((e,n)=>{const{__scopePopover:t,...i}=e,r=Ti(_S,t),a=Ja(t),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=r;return l.useEffect(()=>(o(),()=>s()),[o,s]),l.createElement(Zl,Ye({},a,i,{ref:n}))}),xS="PopoverTrigger",ES=l.forwardRef((e,n)=>{const{__scopePopover:t,...i}=e,r=Ti(xS,t),a=Ja(t),o=et(n,r.triggerRef),s=l.createElement(Xe.button,Ye({type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":sm(r.open)},i,{ref:o,onClick:sn(e.onClick,r.onOpenToggle)}));return r.hasCustomAnchor?s:l.createElement(Zl,Ye({asChild:!0},a),s)}),am="PopoverPortal",[SS,CS]=rm(am,{forceMount:void 0}),$S=e=>{const{__scopePopover:n,forceMount:t,children:i,container:r}=e,a=Ti(am,n);return l.createElement(SS,{scope:n,forceMount:t},l.createElement(Nr,{present:t||a.open},l.createElement(A1,{asChild:!0,container:r},i)))},Xa="PopoverContent",AS=l.forwardRef((e,n)=>{const t=CS(Xa,e.__scopePopover),{forceMount:i=t.forceMount,...r}=e,a=Ti(Xa,e.__scopePopover);return l.createElement(Nr,{present:i||a.open},a.modal?l.createElement(TS,Ye({},r,{ref:n})):l.createElement(OS,Ye({},r,{ref:n})))}),TS=l.forwardRef((e,n)=>{const t=Ti(Xa,e.__scopePopover),i=l.useRef(null),r=et(n,i),a=l.useRef(!1);return l.useEffect(()=>{const o=i.current;if(o)return Pl(o)},[]),l.createElement(Tl,{as:$n,allowPinchZoom:!0},l.createElement(om,Ye({},e,{ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:sn(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),a.current||(s=t.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:sn(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,f=s.button===0&&s.ctrlKey===!0,d=s.button===2||f;a.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:sn(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),OS=l.forwardRef((e,n)=>{const t=Ti(Xa,e.__scopePopover),i=l.useRef(!1),r=l.useRef(!1);return l.createElement(om,Ye({},e,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,a),!a.defaultPrevented){var s;i.current||(s=t.triggerRef.current)===null||s===void 0||s.focus(),a.preventDefault()}i.current=!1,r.current=!1},onInteractOutside:a=>{var o,s;(o=e.onInteractOutside)===null||o===void 0||o.call(e,a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const f=a.target;((s=t.triggerRef.current)===null||s===void 0?void 0:s.contains(f))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}}))}),om=l.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:i,onOpenAutoFocus:r,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:u,...h}=e,v=Ti(Xa,t),m=Ja(t);return Iv(),l.createElement(h1,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:r,onUnmountAutoFocus:a},l.createElement(l1,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:f,onFocusOutside:d,onDismiss:()=>v.onOpenChange(!1)},l.createElement(C1,Ye({"data-state":sm(v.open),role:"dialog",id:v.contentId},m,h,{ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))}),PS="PopoverClose",IS=l.forwardRef((e,n)=>{const{__scopePopover:t,...i}=e,r=Ti(PS,t);return l.createElement(Xe.button,Ye({type:"button"},i,{ref:n,onClick:sn(e.onClick,()=>r.onOpenChange(!1))}))}),FS=l.forwardRef((e,n)=>{const{__scopePopover:t,...i}=e,r=Ja(t);return l.createElement($1,Ye({},r,i,{ref:n}))});function sm(e){return e?"open":"closed"}const MS=wS;function NS(e,[n,t]){return Math.min(t,Math.max(n,e))}function DS(e,n){return l.useReducer((t,i)=>{const r=n[t][i];return r??t},e)}const fm="ScrollArea",[lm,jj]=Ei(fm),[LS,yt]=lm(fm),BS=l.forwardRef((e,n)=>{const{__scopeScrollArea:t,type:i="hover",dir:r,scrollHideDelay:a=600,...o}=e,[s,f]=l.useState(null),[d,u]=l.useState(null),[h,v]=l.useState(null),[m,g]=l.useState(null),[b,w]=l.useState(null),[_,k]=l.useState(0),[E,S]=l.useState(0),[P,I]=l.useState(!1),[C,T]=l.useState(!1),M=Mn(n,L=>f(L)),j=Tk(r);return l.createElement(LS,{scope:t,type:i,dir:j,scrollHideDelay:a,scrollArea:s,viewport:d,onViewportChange:u,content:h,onContentChange:v,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:P,onScrollbarXEnabledChange:I,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:C,onScrollbarYEnabledChange:T,onCornerWidthChange:k,onCornerHeightChange:S},l.createElement(bn.div,Ye({dir:j},o,{ref:M,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})))}),jS="ScrollAreaViewport",RS=l.forwardRef((e,n)=>{const{__scopeScrollArea:t,children:i,...r}=e,a=yt(jS,t),o=l.useRef(null),s=Mn(n,o,a.onViewportChange);return l.createElement(l.Fragment,null,l.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),l.createElement(bn.div,Ye({"data-radix-scroll-area-viewport":""},r,{ref:s,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style}}),l.createElement("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"}},i)))}),ri="ScrollAreaScrollbar",US=l.forwardRef((e,n)=>{const{forceMount:t,...i}=e,r=yt(ri,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=r,s=e.orientation==="horizontal";return l.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),r.type==="hover"?l.createElement(zS,Ye({},i,{ref:n,forceMount:t})):r.type==="scroll"?l.createElement(WS,Ye({},i,{ref:n,forceMount:t})):r.type==="auto"?l.createElement(dm,Ye({},i,{ref:n,forceMount:t})):r.type==="always"?l.createElement(Td,Ye({},i,{ref:n})):null}),zS=l.forwardRef((e,n)=>{const{forceMount:t,...i}=e,r=yt(ri,e.__scopeScrollArea),[a,o]=l.useState(!1);return l.useEffect(()=>{const s=r.scrollArea;let f=0;if(s){const d=()=>{window.clearTimeout(f),o(!0)},u=()=>{f=window.setTimeout(()=>o(!1),r.scrollHideDelay)};return s.addEventListener("pointerenter",d),s.addEventListener("pointerleave",u),()=>{window.clearTimeout(f),s.removeEventListener("pointerenter",d),s.removeEventListener("pointerleave",u)}}},[r.scrollArea,r.scrollHideDelay]),l.createElement(mt,{present:t||a},l.createElement(dm,Ye({"data-state":a?"visible":"hidden"},i,{ref:n})))}),WS=l.forwardRef((e,n)=>{const{forceMount:t,...i}=e,r=yt(ri,e.__scopeScrollArea),a=e.orientation==="horizontal",o=$s(()=>f("SCROLL_END"),100),[s,f]=DS("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return l.useEffect(()=>{if(s==="idle"){const d=window.setTimeout(()=>f("HIDE"),r.scrollHideDelay);return()=>window.clearTimeout(d)}},[s,r.scrollHideDelay,f]),l.useEffect(()=>{const d=r.viewport,u=a?"scrollLeft":"scrollTop";if(d){let h=d[u];const v=()=>{const m=d[u];h!==m&&(f("SCROLL"),o()),h=m};return d.addEventListener("scroll",v),()=>d.removeEventListener("scroll",v)}},[r.viewport,a,f,o]),l.createElement(mt,{present:t||s!=="hidden"},l.createElement(Td,Ye({"data-state":s==="hidden"?"hidden":"visible"},i,{ref:n,onPointerEnter:wn(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:wn(e.onPointerLeave,()=>f("POINTER_LEAVE"))})))}),dm=l.forwardRef((e,n)=>{const t=yt(ri,e.__scopeScrollArea),{forceMount:i,...r}=e,[a,o]=l.useState(!1),s=e.orientation==="horizontal",f=$s(()=>{if(t.viewport){const d=t.viewport.offsetWidth<t.viewport.scrollWidth,u=t.viewport.offsetHeight<t.viewport.scrollHeight;o(s?d:u)}},10);return Rr(t.viewport,f),Rr(t.content,f),l.createElement(mt,{present:i||a},l.createElement(Td,Ye({"data-state":a?"visible":"hidden"},r,{ref:n})))}),Td=l.forwardRef((e,n)=>{const{orientation:t="vertical",...i}=e,r=yt(ri,e.__scopeScrollArea),a=l.useRef(null),o=l.useRef(0),[s,f]=l.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=vm(s.viewport,s.content),u={...i,sizes:s,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:v=>a.current=v,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:v=>o.current=v};function h(v,m){return XS(v,o.current,s,m)}return t==="horizontal"?l.createElement(HS,Ye({},u,{ref:n,onThumbPositionChange:()=>{if(r.viewport&&a.current){const v=r.viewport.scrollLeft,m=pm(v,s,r.dir);a.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollLeft=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollLeft=h(v,r.dir))}})):t==="vertical"?l.createElement(VS,Ye({},u,{ref:n,onThumbPositionChange:()=>{if(r.viewport&&a.current){const v=r.viewport.scrollTop,m=pm(v,s);a.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:v=>{r.viewport&&(r.viewport.scrollTop=v)},onDragScroll:v=>{r.viewport&&(r.viewport.scrollTop=h(v))}})):null}),HS=l.forwardRef((e,n)=>{const{sizes:t,onSizesChange:i,...r}=e,a=yt(ri,e.__scopeScrollArea),[o,s]=l.useState(),f=l.useRef(null),d=Mn(n,f,a.onScrollbarXChange);return l.useEffect(()=>{f.current&&s(getComputedStyle(f.current))},[f]),l.createElement(cm,Ye({"data-orientation":"horizontal"},r,{ref:d,sizes:t,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cs(t)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,h)=>{if(a.viewport){const v=a.viewport.scrollLeft+u.deltaX;e.onWheelScroll(v),gm(v,h)&&u.preventDefault()}},onResize:()=>{f.current&&a.viewport&&o&&i({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Ss(o.paddingLeft),paddingEnd:Ss(o.paddingRight)}})}}))}),VS=l.forwardRef((e,n)=>{const{sizes:t,onSizesChange:i,...r}=e,a=yt(ri,e.__scopeScrollArea),[o,s]=l.useState(),f=l.useRef(null),d=Mn(n,f,a.onScrollbarYChange);return l.useEffect(()=>{f.current&&s(getComputedStyle(f.current))},[f]),l.createElement(cm,Ye({"data-orientation":"vertical"},r,{ref:d,sizes:t,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cs(t)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,h)=>{if(a.viewport){const v=a.viewport.scrollTop+u.deltaY;e.onWheelScroll(v),gm(v,h)&&u.preventDefault()}},onResize:()=>{f.current&&a.viewport&&o&&i({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Ss(o.paddingTop),paddingEnd:Ss(o.paddingBottom)}})}}))}),[qS,um]=lm(ri),cm=l.forwardRef((e,n)=>{const{__scopeScrollArea:t,sizes:i,hasThumb:r,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:u,onResize:h,...v}=e,m=yt(ri,t),[g,b]=l.useState(null),w=Mn(n,M=>b(M)),_=l.useRef(null),k=l.useRef(""),E=m.viewport,S=i.content-i.viewport,P=tt(u),I=tt(f),C=$s(h,10);function T(M){if(_.current){const j=M.clientX-_.current.left,L=M.clientY-_.current.top;d({x:j,y:L})}}return l.useEffect(()=>{const M=j=>{const L=j.target;(g==null?void 0:g.contains(L))&&P(j,S)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[E,g,S,P]),l.useEffect(I,[i,I]),Rr(g,C),Rr(m.content,C),l.createElement(qS,{scope:t,scrollbar:g,hasThumb:r,onThumbChange:tt(a),onThumbPointerUp:tt(o),onThumbPositionChange:I,onThumbPointerDown:tt(s)},l.createElement(bn.div,Ye({},v,{ref:w,style:{position:"absolute",...v.style},onPointerDown:wn(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),_.current=g.getBoundingClientRect(),k.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",T(M))}),onPointerMove:wn(e.onPointerMove,T),onPointerUp:wn(e.onPointerUp,M=>{const j=M.target;j.hasPointerCapture(M.pointerId)&&j.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=k.current,_.current=null})})))}),Od="ScrollAreaThumb",GS=l.forwardRef((e,n)=>{const{forceMount:t,...i}=e,r=um(Od,e.__scopeScrollArea);return l.createElement(mt,{present:t||r.hasThumb},l.createElement(KS,Ye({ref:n},i)))}),KS=l.forwardRef((e,n)=>{const{__scopeScrollArea:t,style:i,...r}=e,a=yt(Od,t),o=um(Od,t),{onThumbPositionChange:s}=o,f=Mn(n,h=>o.onThumbChange(h)),d=l.useRef(),u=$s(()=>{d.current&&(d.current(),d.current=void 0)},100);return l.useEffect(()=>{const h=a.viewport;if(h){const v=()=>{if(u(),!d.current){const m=ZS(h,s);d.current=m,s()}};return s(),h.addEventListener("scroll",v),()=>h.removeEventListener("scroll",v)}},[a.viewport,u,s]),l.createElement(bn.div,Ye({"data-state":o.hasThumb?"visible":"hidden"},r,{ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:wn(e.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),g=h.clientX-m.left,b=h.clientY-m.top;o.onThumbPointerDown({x:g,y:b})}),onPointerUp:wn(e.onPointerUp,o.onThumbPointerUp)}))}),hm="ScrollAreaCorner",YS=l.forwardRef((e,n)=>{const t=yt(hm,e.__scopeScrollArea),i=!!(t.scrollbarX&&t.scrollbarY);return t.type!=="scroll"&&i?l.createElement(JS,Ye({},e,{ref:n})):null}),JS=l.forwardRef((e,n)=>{const{__scopeScrollArea:t,...i}=e,r=yt(hm,t),[a,o]=l.useState(0),[s,f]=l.useState(0),d=!!(a&&s);return Rr(r.scrollbarX,()=>{var u;const h=((u=r.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;r.onCornerHeightChange(h),f(h)}),Rr(r.scrollbarY,()=>{var u;const h=((u=r.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;r.onCornerWidthChange(h),o(h)}),d?l.createElement(bn.div,Ye({},i,{ref:n,style:{width:a,height:s,position:"absolute",right:r.dir==="ltr"?0:void 0,left:r.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Ss(e){return e?parseInt(e,10):0}function vm(e,n){const t=e/n;return isNaN(t)?0:t}function Cs(e){const n=vm(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-t)*n;return Math.max(i,18)}function XS(e,n,t,i="ltr"){const r=Cs(t),a=r/2,o=n||a,s=r-o,f=t.scrollbar.paddingStart+o,d=t.scrollbar.size-t.scrollbar.paddingEnd-s,u=t.content-t.viewport,h=i==="ltr"?[0,u]:[u*-1,0];return mm([f,d],h)(e)}function pm(e,n,t="ltr"){const i=Cs(n),r=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,a=n.scrollbar.size-r,o=n.content-n.viewport,s=a-i,f=t==="ltr"?[0,o]:[o*-1,0],d=NS(e,f);return mm([0,o],[0,s])(d)}function mm(e,n){return t=>{if(e[0]===e[1]||n[0]===n[1])return n[0];const i=(n[1]-n[0])/(e[1]-e[0]);return n[0]+i*(t-e[0])}}function gm(e,n){return e>0&&e<n}const ZS=(e,n=()=>{})=>{let t={left:e.scrollLeft,top:e.scrollTop},i=0;return function r(){const a={left:e.scrollLeft,top:e.scrollTop},o=t.left!==a.left,s=t.top!==a.top;(o||s)&&n(),t=a,i=window.requestAnimationFrame(r)}(),()=>window.cancelAnimationFrame(i)};function $s(e,n){const t=tt(e),i=l.useRef(0);return l.useEffect(()=>()=>window.clearTimeout(i.current),[]),l.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(t,n)},[t,n])}function Rr(e,n){const t=tt(n);zt(()=>{let i=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(t)});return r.observe(e),()=>{window.cancelAnimationFrame(i),r.unobserve(e)}}},[e,t])}const QS=BS,e7=RS,n7=US,t7=GS,i7=YS;function or(e){return e.split("-")[0]}function Za(e){return e.split("-")[1]}function Ur(e){return["top","bottom"].includes(or(e))?"x":"y"}function Pd(e){return e==="y"?"height":"width"}function bm(e,n,t){let{reference:i,floating:r}=e;const a=i.x+i.width/2-r.width/2,o=i.y+i.height/2-r.height/2,s=Ur(n),f=Pd(s),d=i[f]/2-r[f]/2,u=s==="x";let h;switch(or(n)){case"top":h={x:a,y:i.y-r.height};break;case"bottom":h={x:a,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:o};break;case"left":h={x:i.x-r.width,y:o};break;default:h={x:i.x,y:i.y}}switch(Za(n)){case"start":h[s]-=d*(t&&u?-1:1);break;case"end":h[s]+=d*(t&&u?-1:1)}return h}const r7=async(e,n,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:a=[],platform:o}=t,s=await(o.isRTL==null?void 0:o.isRTL(n));let f=await o.getElementRects({reference:e,floating:n,strategy:r}),{x:d,y:u}=bm(f,i,s),h=i,v={},m=0;for(let g=0;g<a.length;g++){const{name:b,fn:w}=a[g],{x:_,y:k,data:E,reset:S}=await w({x:d,y:u,initialPlacement:i,placement:h,strategy:r,middlewareData:v,rects:f,platform:o,elements:{reference:e,floating:n}});d=_??d,u=k??u,v={...v,[b]:{...v[b],...E}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(f=S.rects===!0?await o.getElementRects({reference:e,floating:n,strategy:r}):S.rects),{x:d,y:u}=bm(f,h,s)),g=-1)}return{x:d,y:u,placement:h,strategy:r,middlewareData:v}};function ym(e){return typeof e!="number"?function(n){return{top:0,right:0,bottom:0,left:0,...n}}(e):{top:e,right:e,bottom:e,left:e}}function As(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Qa(e,n){var t;n===void 0&&(n={});const{x:i,y:r,platform:a,rects:o,elements:s,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:v=!1,padding:m=0}=n,g=ym(m),b=s[v?h==="floating"?"reference":"floating":h],w=As(await a.getClippingRect({element:(t=await(a.isElement==null?void 0:a.isElement(b)))==null||t?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:d,rootBoundary:u,strategy:f})),_=As(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:h==="floating"?{...o.floating,x:i,y:r}:o.reference,offsetParent:await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),strategy:f}):o[h]);return{top:w.top-_.top+g.top,bottom:_.bottom-w.bottom+g.bottom,left:w.left-_.left+g.left,right:_.right-w.right+g.right}}const a7=Math.min,sr=Math.max;function Id(e,n,t){return sr(e,a7(n,t))}const wm=e=>({name:"arrow",options:e,async fn(n){const{element:t,padding:i=0}=e??{},{x:r,y:a,placement:o,rects:s,platform:f}=n;if(t==null)return{};const d=ym(i),u={x:r,y:a},h=Ur(o),v=Za(o),m=Pd(h),g=await f.getDimensions(t),b=h==="y"?"top":"left",w=h==="y"?"bottom":"right",_=s.reference[m]+s.reference[h]-u[h]-s.floating[m],k=u[h]-s.reference[h],E=await(f.getOffsetParent==null?void 0:f.getOffsetParent(t));let S=E?h==="y"?E.clientHeight||0:E.clientWidth||0:0;S===0&&(S=s.floating[m]);const P=_/2-k/2,I=d[b],C=S-g[m]-d[w],T=S/2-g[m]/2+P,M=Id(I,T,C),j=(v==="start"?d[b]:d[w])>0&&T!==M&&s.reference[m]<=s.floating[m];return{[h]:u[h]-(j?T<I?I-T:C-T:0),data:{[h]:M,centerOffset:T-M}}}}),o7={left:"right",right:"left",bottom:"top",top:"bottom"};function Ts(e){return e.replace(/left|right|bottom|top/g,n=>o7[n])}function s7(e,n,t){t===void 0&&(t=!1);const i=Za(e),r=Ur(e),a=Pd(r);let o=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[a]>n.floating[a]&&(o=Ts(o)),{main:o,cross:Ts(o)}}const f7={start:"end",end:"start"};function _m(e){return e.replace(/start|end/g,n=>f7[n])}const km=["top","right","bottom","left"];km.reduce((e,n)=>e.concat(n,n+"-start",n+"-end"),[]);const l7=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var t;const{placement:i,middlewareData:r,rects:a,initialPlacement:o,platform:s,elements:f}=n,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",flipAlignment:m=!0,...g}=e,b=or(i),w=h||(b===o||!m?[Ts(o)]:function(T){const M=Ts(T);return[_m(T),M,_m(M)]}(o)),_=[o,...w],k=await Qa(n,g),E=[];let S=((t=r.flip)==null?void 0:t.overflows)||[];if(d&&E.push(k[b]),u){const{main:T,cross:M}=s7(i,a,await(s.isRTL==null?void 0:s.isRTL(f.floating)));E.push(k[T],k[M])}if(S=[...S,{placement:i,overflows:E}],!E.every(T=>T<=0)){var P,I;const T=((P=(I=r.flip)==null?void 0:I.index)!=null?P:0)+1,M=_[T];if(M)return{data:{index:T,overflows:S},reset:{placement:M}};let j="bottom";switch(v){case"bestFit":{var C;const L=(C=S.map(D=>[D,D.overflows.filter(X=>X>0).reduce((X,J)=>X+J,0)]).sort((D,X)=>D[1]-X[1])[0])==null?void 0:C[0].placement;L&&(j=L);break}case"initialPlacement":j=o}if(i!==j)return{reset:{placement:j}}}return{}}}};function xm(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Em(e){return km.some(n=>e[n]>=0)}const d7=function(e){let{strategy:n="referenceHidden",...t}=e===void 0?{}:e;return{name:"hide",async fn(i){const{rects:r}=i;switch(n){case"referenceHidden":{const a=xm(await Qa(i,{...t,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Em(a)}}}case"escaped":{const a=xm(await Qa(i,{...t,altBoundary:!0}),r.floating);return{data:{escapedOffsets:a,escaped:Em(a)}}}default:return{}}}}},u7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){const{x:t,y:i}=n,r=await async function(a,o){const{placement:s,platform:f,elements:d}=a,u=await(f.isRTL==null?void 0:f.isRTL(d.floating)),h=or(s),v=Za(s),m=Ur(s)==="x",g=["left","top"].includes(h)?-1:1,b=u&&m?-1:1,w=typeof o=="function"?o(a):o;let{mainAxis:_,crossAxis:k,alignmentAxis:E}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return v&&typeof E=="number"&&(k=v==="end"?-1*E:E),m?{x:k*b,y:_*g}:{x:_*g,y:k*b}}(n,e);return{x:t+r.x,y:i+r.y,data:r}}}};function Sm(e){return e==="x"?"y":"x"}const c7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:t,y:i,placement:r}=n,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:w=>{let{x:_,y:k}=w;return{x:_,y:k}}},...f}=e,d={x:t,y:i},u=await Qa(n,f),h=Ur(or(r)),v=Sm(h);let m=d[h],g=d[v];if(a){const w=h==="y"?"bottom":"right";m=Id(m+u[h==="y"?"top":"left"],m,m-u[w])}if(o){const w=v==="y"?"bottom":"right";g=Id(g+u[v==="y"?"top":"left"],g,g-u[w])}const b=s.fn({...n,[h]:m,[v]:g});return{...b,data:{x:b.x-t,y:b.y-i}}}}},h7=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:t,y:i,placement:r,rects:a,middlewareData:o}=n,{offset:s=0,mainAxis:f=!0,crossAxis:d=!0}=e,u={x:t,y:i},h=Ur(r),v=Sm(h);let m=u[h],g=u[v];const b=typeof s=="function"?s({...a,placement:r}):s,w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(f){const P=h==="y"?"height":"width",I=a.reference[h]-a.floating[P]+w.mainAxis,C=a.reference[h]+a.reference[P]-w.mainAxis;m<I?m=I:m>C&&(m=C)}if(d){var _,k,E,S;const P=h==="y"?"width":"height",I=["top","left"].includes(or(r)),C=a.reference[v]-a.floating[P]+(I&&(_=(k=o.offset)==null?void 0:k[v])!=null?_:0)+(I?0:w.crossAxis),T=a.reference[v]+a.reference[P]+(I?0:(E=(S=o.offset)==null?void 0:S[v])!=null?E:0)-(I?w.crossAxis:0);g<C?g=C:g>T&&(g=T)}return{[h]:m,[v]:g}}}},v7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){const{placement:t,rects:i,platform:r,elements:a}=n,{apply:o,...s}=e,f=await Qa(n,s),d=or(t),u=Za(t);let h,v;d==="top"||d==="bottom"?(h=d,v=u===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,h=u==="end"?"top":"bottom");const m=sr(f.left,0),g=sr(f.right,0),b=sr(f.top,0),w=sr(f.bottom,0),_={availableHeight:i.floating.height-(["left","right"].includes(t)?2*(b!==0||w!==0?b+w:sr(f.top,f.bottom)):f[h]),availableWidth:i.floating.width-(["top","bottom"].includes(t)?2*(m!==0||g!==0?m+g:sr(f.left,f.right)):f[v])},k=await r.getDimensions(a.floating);o==null||o({...n,..._});const E=await r.getDimensions(a.floating);return k.width!==E.width||k.height!==E.height?{reset:{rects:!0}}:{}}}};function Cm(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function ai(e){if(e==null)return window;if(!Cm(e)){const n=e.ownerDocument;return n&&n.defaultView||window}return e}function eo(e){return ai(e).getComputedStyle(e)}function oi(e){return Cm(e)?"":e?(e.nodeName||"").toLowerCase():""}function $m(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(n=>n.brand+"/"+n.version).join(" "):navigator.userAgent}function qt(e){return e instanceof ai(e).HTMLElement}function Oi(e){return e instanceof ai(e).Element}function Fd(e){return typeof ShadowRoot>"u"?!1:e instanceof ai(e).ShadowRoot||e instanceof ShadowRoot}function Os(e){const{overflow:n,overflowX:t,overflowY:i}=eo(e);return/auto|scroll|overlay|hidden/.test(n+i+t)}function p7(e){return["table","td","th"].includes(oi(e))}function Am(e){const n=/firefox/i.test($m()),t=eo(e);return t.transform!=="none"||t.perspective!=="none"||t.contain==="paint"||["transform","perspective"].includes(t.willChange)||n&&t.willChange==="filter"||n&&!!t.filter&&t.filter!=="none"}function Tm(){return!/^((?!chrome|android).)*safari/i.test($m())}const Om=Math.min,no=Math.max,Ps=Math.round;function si(e,n,t){var i,r,a,o;n===void 0&&(n=!1),t===void 0&&(t=!1);const s=e.getBoundingClientRect();let f=1,d=1;n&&qt(e)&&(f=e.offsetWidth>0&&Ps(s.width)/e.offsetWidth||1,d=e.offsetHeight>0&&Ps(s.height)/e.offsetHeight||1);const u=Oi(e)?ai(e):window,h=!Tm()&&t,v=(s.left+(h&&(i=(r=u.visualViewport)==null?void 0:r.offsetLeft)!=null?i:0))/f,m=(s.top+(h&&(a=(o=u.visualViewport)==null?void 0:o.offsetTop)!=null?a:0))/d,g=s.width/f,b=s.height/d;return{width:g,height:b,top:m,right:v+g,bottom:m+b,left:v,x:v,y:m}}function Pi(e){return(n=e,(n instanceof ai(n).Node?e.ownerDocument:e.document)||window.document).documentElement;var n}function Is(e){return Oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Pm(e){return si(Pi(e)).left+Is(e).scrollLeft}function m7(e,n,t){const i=qt(n),r=Pi(n),a=si(e,i&&function(f){const d=si(f);return Ps(d.width)!==f.offsetWidth||Ps(d.height)!==f.offsetHeight}(n),t==="fixed");let o={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if(i||!i&&t!=="fixed")if((oi(n)!=="body"||Os(r))&&(o=Is(n)),qt(n)){const f=si(n,!0);s.x=f.x+n.clientLeft,s.y=f.y+n.clientTop}else r&&(s.x=Pm(r));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}function Im(e){return oi(e)==="html"?e:e.assignedSlot||e.parentNode||(Fd(e)?e.host:null)||Pi(e)}function Fm(e){return qt(e)&&getComputedStyle(e).position!=="fixed"?e.offsetParent:null}function Md(e){const n=ai(e);let t=Fm(e);for(;t&&p7(t)&&getComputedStyle(t).position==="static";)t=Fm(t);return t&&(oi(t)==="html"||oi(t)==="body"&&getComputedStyle(t).position==="static"&&!Am(t))?n:t||function(i){let r=Im(i);for(Fd(r)&&(r=r.host);qt(r)&&!["html","body"].includes(oi(r));){if(Am(r))return r;r=r.parentNode}return null}(e)||n}function Mm(e){if(qt(e))return{width:e.offsetWidth,height:e.offsetHeight};const n=si(e);return{width:n.width,height:n.height}}function Nm(e){const n=Im(e);return["html","body","#document"].includes(oi(n))?e.ownerDocument.body:qt(n)&&Os(n)?n:Nm(n)}function Fs(e,n){var t;n===void 0&&(n=[]);const i=Nm(e),r=i===((t=e.ownerDocument)==null?void 0:t.body),a=ai(i),o=r?[a].concat(a.visualViewport||[],Os(i)?i:[]):i,s=n.concat(o);return r?s:s.concat(Fs(o))}function Dm(e,n,t){return n==="viewport"?As(function(i,r){const a=ai(i),o=Pi(i),s=a.visualViewport;let f=o.clientWidth,d=o.clientHeight,u=0,h=0;if(s){f=s.width,d=s.height;const v=Tm();(v||!v&&r==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}return{width:f,height:d,x:u,y:h}}(e,t)):Oi(n)?function(i,r){const a=si(i,!1,r==="fixed"),o=a.top+i.clientTop,s=a.left+i.clientLeft;return{top:o,left:s,x:s,y:o,right:s+i.clientWidth,bottom:o+i.clientHeight,width:i.clientWidth,height:i.clientHeight}}(n,t):As(function(i){var r;const a=Pi(i),o=Is(i),s=(r=i.ownerDocument)==null?void 0:r.body,f=no(a.scrollWidth,a.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),d=no(a.scrollHeight,a.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0);let u=-o.scrollLeft+Pm(i);const h=-o.scrollTop;return eo(s||a).direction==="rtl"&&(u+=no(a.clientWidth,s?s.clientWidth:0)-f),{width:f,height:d,x:u,y:h}}(Pi(e)))}function g7(e){const n=Fs(e),t=["absolute","fixed"].includes(eo(e).position)&&qt(e)?Md(e):e;return Oi(t)?n.filter(i=>Oi(i)&&function(r,a){const o=a.getRootNode==null?void 0:a.getRootNode();if(r.contains(a))return!0;if(o&&Fd(o)){let s=a;do{if(s&&r===s)return!0;s=s.parentNode||s.host}while(s)}return!1}(i,t)&&oi(i)!=="body"):[]}const b7={getClippingRect:function(e){let{element:n,boundary:t,rootBoundary:i,strategy:r}=e;const a=[...t==="clippingAncestors"?g7(n):[].concat(t),i],o=a[0],s=a.reduce((f,d)=>{const u=Dm(n,d,r);return f.top=no(u.top,f.top),f.right=Om(u.right,f.right),f.bottom=Om(u.bottom,f.bottom),f.left=no(u.left,f.left),f},Dm(n,o,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:n,offsetParent:t,strategy:i}=e;const r=qt(t),a=Pi(t);if(t===a)return n;let o={scrollLeft:0,scrollTop:0};const s={x:0,y:0};if((r||!r&&i!=="fixed")&&((oi(t)!=="body"||Os(a))&&(o=Is(t)),qt(t))){const f=si(t,!0);s.x=f.x+t.clientLeft,s.y=f.y+t.clientTop}return{...n,x:n.x-o.scrollLeft+s.x,y:n.y-o.scrollTop+s.y}},isElement:Oi,getDimensions:Mm,getOffsetParent:Md,getDocumentElement:Pi,getElementRects:e=>{let{reference:n,floating:t,strategy:i}=e;return{reference:m7(n,Md(t),i),floating:{...Mm(t),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>eo(e).direction==="rtl"};function y7(e,n,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:a=!0,elementResize:o=!0,animationFrame:s=!1}=i,f=r&&!s,d=a&&!s,u=f||d?[...Oi(e)?Fs(e):[],...Fs(n)]:[];u.forEach(g=>{f&&g.addEventListener("scroll",t,{passive:!0}),d&&g.addEventListener("resize",t)});let h,v=null;if(o){let g=!0;v=new ResizeObserver(()=>{g||t(),g=!1}),Oi(e)&&!s&&v.observe(e),v.observe(n)}let m=s?si(e):null;return s&&function g(){const b=si(e);!m||b.x===m.x&&b.y===m.y&&b.width===m.width&&b.height===m.height||t(),m=b,h=requestAnimationFrame(g)}(),t(),()=>{var g;u.forEach(b=>{f&&b.removeEventListener("scroll",t),d&&b.removeEventListener("resize",t)}),(g=v)==null||g.disconnect(),v=null,s&&cancelAnimationFrame(h)}}const w7=(e,n,t)=>r7(e,n,{platform:b7,...t});var Nd=typeof document<"u"?l.useLayoutEffect:l.useEffect;function Dd(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let t,i,r;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(t=e.length,t!=n.length)return!1;for(i=t;i--!==0;)if(!Dd(e[i],n[i]))return!1;return!0}if(r=Object.keys(e),t=r.length,t!==Object.keys(n).length)return!1;for(i=t;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,r[i]))return!1;for(i=t;i--!==0;){const a=r[i];if(!(a==="_owner"&&e.$$typeof)&&!Dd(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}function _7(e){const n=be.useRef(e);return Nd(()=>{n.current=e}),n}function k7(e){let{middleware:n,placement:t="bottom",strategy:i="absolute",whileElementsMounted:r}=e===void 0?{}:e;const a=be.useRef(null),o=be.useRef(null),s=_7(r),f=be.useRef(null),[d,u]=be.useState({x:null,y:null,strategy:i,placement:t,middlewareData:{}}),[h,v]=be.useState(n);Dd(h==null?void 0:h.map(E=>{let{options:S}=E;return S}),n==null?void 0:n.map(E=>{let{options:S}=E;return S}))||v(n);const m=be.useCallback(()=>{!a.current||!o.current||w7(a.current,o.current,{middleware:h,placement:t,strategy:i}).then(E=>{g.current&&fh.flushSync(()=>{u(E)})})},[h,t,i]);Nd(()=>{g.current&&m()},[m]);const g=be.useRef(!1);Nd(()=>(g.current=!0,()=>{g.current=!1}),[]);const b=be.useCallback(()=>{if(typeof f.current=="function"&&(f.current(),f.current=null),a.current&&o.current)if(s.current){const E=s.current(a.current,o.current,m);f.current=E}else m()},[m,s]),w=be.useCallback(E=>{a.current=E,b()},[b]),_=be.useCallback(E=>{o.current=E,b()},[b]),k=be.useMemo(()=>({reference:a,floating:o}),[]);return be.useMemo(()=>({...d,update:m,refs:k,reference:w,floating:_}),[d,m,k,w,_])}const x7=e=>{const{element:n,padding:t}=e;function i(r){return Object.prototype.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){return i(n)?n.current!=null?wm({element:n.current,padding:t}).fn(r):{}:n?wm({element:n,padding:t}).fn(r):{}}}},E7=l.forwardRef((e,n)=>{const{children:t,width:i=10,height:r=5,...a}=e;return l.createElement(bn.svg,nn({},a,{ref:n,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?t:l.createElement("polygon",{points:"0,0 30,0 15,10"}))}),Lm="Popper",[Ld,Bm]=Ei(Lm),[S7,jm]=Ld(Lm),C7=e=>{const{__scopePopper:n,children:t}=e,[i,r]=l.useState(null);return l.createElement(S7,{scope:n,anchor:i,onAnchorChange:r},t)},$7="PopperAnchor",A7=l.forwardRef((e,n)=>{const{__scopePopper:t,virtualRef:i,...r}=e,a=jm($7,t),o=l.useRef(null),s=Mn(n,o);return l.useEffect(()=>{a.onAnchorChange((i==null?void 0:i.current)||o.current)}),i?null:l.createElement(bn.div,nn({},r,{ref:s}))}),Ms="PopperContent",[T7,O7]=Ld(Ms),[P7,I7]=Ld(Ms,{hasParent:!1,positionUpdateFns:new Set}),F7=l.forwardRef((e,n)=>{var t,i,r,a,o,s,f,d;const{__scopePopper:u,side:h="bottom",sideOffset:v=0,align:m="center",alignOffset:g=0,arrowPadding:b=0,collisionBoundary:w=[],collisionPadding:_=0,sticky:k="partial",hideWhenDetached:E=!1,avoidCollisions:S=!0,onPlaced:P,...I}=e,C=jm(Ms,u),[T,M]=l.useState(null),j=Mn(n,Te=>M(Te)),[L,D]=l.useState(null),X=U1(L),J=(t=X==null?void 0:X.width)!==null&&t!==void 0?t:0,ee=(i=X==null?void 0:X.height)!==null&&i!==void 0?i:0,ae=h+(m!=="center"?"-"+m:""),fe=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},de=Array.isArray(w)?w:[w],oe=de.length>0,me={padding:fe,boundary:de.filter(D7),altBoundary:oe},{reference:se,floating:G,strategy:Y,x:ie,y:pe,placement:H,middlewareData:K,update:B}=k7({strategy:"fixed",placement:ae,whileElementsMounted:y7,middleware:[L7(),u7({mainAxis:v+ee,alignmentAxis:g}),S?c7({mainAxis:!0,crossAxis:!1,limiter:k==="partial"?h7():void 0,...me}):void 0,L?x7({element:L,padding:b}):void 0,S?l7({...me}):void 0,v7({...me,apply:({elements:Te,availableWidth:ze,availableHeight:yn})=>{Te.floating.style.setProperty("--radix-popper-available-width",`${ze}px`),Te.floating.style.setProperty("--radix-popper-available-height",`${yn}px`)}}),B7({arrowWidth:J,arrowHeight:ee}),E?d7({strategy:"referenceHidden"}):void 0].filter(N7)});zt(()=>{se(C.anchor)},[se,C.anchor]);const W=ie!==null&&pe!==null,[V,O]=zm(H),F=tt(P);zt(()=>{W&&(F==null||F())},[W,F]);const Z=(r=K.arrow)===null||r===void 0?void 0:r.x,te=(a=K.arrow)===null||a===void 0?void 0:a.y,he=((o=K.arrow)===null||o===void 0?void 0:o.centerOffset)!==0,[ye,xe]=l.useState();zt(()=>{T&&xe(window.getComputedStyle(T).zIndex)},[T]);const{hasParent:Ee,positionUpdateFns:re}=I7(Ms,u),Be=!Ee;l.useLayoutEffect(()=>{if(!Be)return re.add(B),()=>{re.delete(B)}},[Be,re,B]),zt(()=>{Be&&W&&Array.from(re).reverse().forEach(Te=>requestAnimationFrame(Te))},[Be,W,re]);const hn={"data-side":V,"data-align":O,...I,ref:j,style:{...I.style,animation:W?void 0:"none",opacity:(s=K.hide)!==null&&s!==void 0&&s.referenceHidden?0:void 0}};return l.createElement("div",{ref:G,"data-radix-popper-content-wrapper":"",style:{position:Y,left:0,top:0,transform:W?`translate3d(${Math.round(ie)}px, ${Math.round(pe)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:ye,"--radix-popper-transform-origin":[(f=K.transformOrigin)===null||f===void 0?void 0:f.x,(d=K.transformOrigin)===null||d===void 0?void 0:d.y].join(" ")},dir:e.dir},l.createElement(T7,{scope:u,placedSide:V,onArrowChange:D,arrowX:Z,arrowY:te,shouldHideArrow:he},Be?l.createElement(P7,{scope:u,hasParent:!0,positionUpdateFns:re},l.createElement(bn.div,hn)):l.createElement(bn.div,hn)))}),Rm="PopperArrow",M7={top:"bottom",right:"left",bottom:"top",left:"right"},Um=l.forwardRef(function(n,t){const{__scopePopper:i,...r}=n,a=O7(Rm,i),o=M7[a.placedSide];return l.createElement("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0}},l.createElement(E7,nn({},r,{ref:t,style:{...r.style,display:"block"}})))});function N7(e){return e!==void 0}function D7(e){return e!==null}const L7=()=>({name:"anchorCssProperties",fn(e){const{rects:n,elements:t}=e,{width:i,height:r}=n.reference;return t.floating.style.setProperty("--radix-popper-anchor-width",`${i}px`),t.floating.style.setProperty("--radix-popper-anchor-height",`${r}px`),{}}}),B7=e=>({name:"transformOrigin",options:e,fn(n){var t,i,r,a,o;const{placement:s,rects:f,middlewareData:d}=n,h=((t=d.arrow)===null||t===void 0?void 0:t.centerOffset)!==0,v=h?0:e.arrowWidth,m=h?0:e.arrowHeight,[g,b]=zm(s),w={start:"0%",center:"50%",end:"100%"}[b],_=((i=(r=d.arrow)===null||r===void 0?void 0:r.x)!==null&&i!==void 0?i:0)+v/2,k=((a=(o=d.arrow)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)+m/2;let E="",S="";return g==="bottom"?(E=h?w:`${_}px`,S=`${-m}px`):g==="top"?(E=h?w:`${_}px`,S=`${f.floating.height+m}px`):g==="right"?(E=`${-m}px`,S=h?w:`${k}px`):g==="left"&&(E=`${f.floating.width+m}px`,S=h?w:`${k}px`),{data:{x:E,y:S}}}});function zm(e){const[n,t="center"]=e.split("-");return[n,t]}const j7=C7,R7=A7,U7=F7,z7=Um,W7=l.forwardRef((e,n)=>l.createElement(bn.span,nn({},e,{ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),[Ns,zj]=Ei("Tooltip",[Bm]),Ds=Bm(),H7="TooltipProvider",V7=700,Bd="tooltip.open",[q7,jd]=Ns(H7),G7=e=>{const{__scopeTooltip:n,delayDuration:t=V7,skipDelayDuration:i=300,disableHoverableContent:r=!1,children:a}=e,[o,s]=l.useState(!0),f=l.useRef(!1),d=l.useRef(0);return l.useEffect(()=>{const u=d.current;return()=>window.clearTimeout(u)},[]),l.createElement(q7,{scope:n,isOpenDelayed:o,delayDuration:t,onOpen:l.useCallback(()=>{window.clearTimeout(d.current),s(!1)},[]),onClose:l.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>s(!0),i)},[i]),isPointerInTransitRef:f,onPointerInTransitChange:l.useCallback(u=>{f.current=u},[]),disableHoverableContent:r},a)},Rd="Tooltip",[K7,to]=Ns(Rd),Y7=e=>{const{__scopeTooltip:n,children:t,open:i,defaultOpen:r=!1,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,f=jd(Rd,e.__scopeTooltip),d=Ds(n),[u,h]=l.useState(null),v=Da(),m=l.useRef(0),g=o??f.disableHoverableContent,b=s??f.delayDuration,w=l.useRef(!1),[_=!1,k]=qo({prop:i,defaultProp:r,onChange:C=>{C?(f.onOpen(),document.dispatchEvent(new CustomEvent(Bd))):f.onClose(),a==null||a(C)}}),E=l.useMemo(()=>_?w.current?"delayed-open":"instant-open":"closed",[_]),S=l.useCallback(()=>{window.clearTimeout(m.current),w.current=!1,k(!0)},[k]),P=l.useCallback(()=>{window.clearTimeout(m.current),k(!1)},[k]),I=l.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{w.current=!0,k(!0)},b)},[b,k]);return l.useEffect(()=>()=>window.clearTimeout(m.current),[]),l.createElement(j7,d,l.createElement(K7,{scope:n,contentId:v,open:_,stateAttribute:E,trigger:u,onTriggerChange:h,onTriggerEnter:l.useCallback(()=>{f.isOpenDelayed?I():S()},[f.isOpenDelayed,I,S]),onTriggerLeave:l.useCallback(()=>{g?P():window.clearTimeout(m.current)},[P,g]),onOpen:S,onClose:P,disableHoverableContent:g},t))},Wm="TooltipTrigger",J7=l.forwardRef((e,n)=>{const{__scopeTooltip:t,...i}=e,r=to(Wm,t),a=jd(Wm,t),o=Ds(t),s=l.useRef(null),f=Mn(n,s,r.onTriggerChange),d=l.useRef(!1),u=l.useRef(!1),h=l.useCallback(()=>d.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),l.createElement(R7,De({asChild:!0},o),l.createElement(bn.button,De({"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute},i,{ref:f,onPointerMove:wn(e.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:wn(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:wn(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:wn(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:wn(e.onBlur,r.onClose),onClick:wn(e.onClick,r.onClose)})))}),Hm="TooltipPortal",[X7,Z7]=Ns(Hm,{forceMount:void 0}),Q7=e=>{const{__scopeTooltip:n,forceMount:t,children:i,container:r}=e,a=to(Hm,n);return l.createElement(X7,{scope:n,forceMount:t},l.createElement(mt,{present:t||a.open},l.createElement(iv,{asChild:!0,container:r},i)))},io="TooltipContent",eC=l.forwardRef((e,n)=>{const t=Z7(io,e.__scopeTooltip),{forceMount:i=t.forceMount,side:r="top",...a}=e,o=to(io,e.__scopeTooltip);return l.createElement(mt,{present:i||o.open},o.disableHoverableContent?l.createElement(Vm,De({side:r},a,{ref:n})):l.createElement(nC,De({side:r},a,{ref:n})))}),nC=l.forwardRef((e,n)=>{const t=to(io,e.__scopeTooltip),i=jd(io,e.__scopeTooltip),r=l.useRef(null),a=Mn(n,r),[o,s]=l.useState(null),{trigger:f,onClose:d}=t,u=r.current,{onPointerInTransitChange:h}=i,v=l.useCallback(()=>{s(null),h(!1)},[h]),m=l.useCallback((g,b)=>{const w=g.currentTarget,_={x:g.clientX,y:g.clientY},k=oC(_,w.getBoundingClientRect()),E=k==="right"||k==="bottom"?-5:5,P=k==="right"||k==="left"?{x:g.clientX+E,y:g.clientY}:{x:g.clientX,y:g.clientY+E},I=sC(b.getBoundingClientRect()),C=lC([P,...I]);s(C),h(!0)},[h]);return l.useEffect(()=>()=>v(),[v]),l.useEffect(()=>{if(f&&u){const g=w=>m(w,u),b=w=>m(w,f);return f.addEventListener("pointerleave",g),u.addEventListener("pointerleave",b),()=>{f.removeEventListener("pointerleave",g),u.removeEventListener("pointerleave",b)}}},[f,u,m,v]),l.useEffect(()=>{if(o){const g=b=>{const w=b.target,_={x:b.clientX,y:b.clientY},k=(f==null?void 0:f.contains(w))||(u==null?void 0:u.contains(w)),E=!fC(_,o);k?v():E&&(v(),d())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[f,u,o,d,v]),l.createElement(Vm,De({},e,{ref:a}))}),[tC,iC]=Ns(Rd,{isInside:!1}),Vm=l.forwardRef((e,n)=>{const{__scopeTooltip:t,children:i,"aria-label":r,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,f=to(io,t),d=Ds(t),{onClose:u}=f;return l.useEffect(()=>(document.addEventListener(Bd,u),()=>document.removeEventListener(Bd,u)),[u]),l.useEffect(()=>{if(f.trigger){const h=v=>{const m=v.target;m!=null&&m.contains(f.trigger)&&u()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[f.trigger,u]),l.createElement(Yh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:u},l.createElement(U7,De({"data-state":f.stateAttribute},d,s,{ref:n,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),l.createElement(_l,null,i),l.createElement(tC,{scope:t,isInside:!0},l.createElement(W7,{id:f.contentId,role:"tooltip"},r||i))))}),rC="TooltipArrow",aC=l.forwardRef((e,n)=>{const{__scopeTooltip:t,...i}=e,r=Ds(t);return iC(rC,t).isInside?null:l.createElement(z7,De({},r,i,{ref:n}))});function oC(e,n){const t=Math.abs(n.top-e.y),i=Math.abs(n.bottom-e.y),r=Math.abs(n.right-e.x),a=Math.abs(n.left-e.x);switch(Math.min(t,i,r,a)){case a:return"left";case r:return"right";case t:return"top";case i:return"bottom";default:return null}}function sC(e){const{top:n,right:t,bottom:i,left:r}=e;return[{x:r,y:n},{x:t,y:n},{x:t,y:i},{x:r,y:i}]}function fC(e,n){const{x:t,y:i}=e;let r=!1;for(let a=0,o=n.length-1;a<n.length;o=a++){const s=n[a].x,f=n[a].y,d=n[o].x,u=n[o].y;f>i!=u>i&&t<(d-s)*(i-f)/(u-f)+s&&(r=!r)}return r}function lC(e){const n=e.slice();return n.sort((t,i)=>t.x<i.x?-1:t.x>i.x?1:t.y<i.y?-1:t.y>i.y?1:0),dC(n)}function dC(e){if(e.length<=1)return e.slice();const n=[];for(let i=0;i<e.length;i++){const r=e[i];for(;n.length>=2;){const a=n[n.length-1],o=n[n.length-2];if((a.x-o.x)*(r.y-o.y)>=(a.y-o.y)*(r.x-o.x))n.pop();else break}n.push(r)}n.pop();const t=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(r.y-o.y)>=(a.y-o.y)*(r.x-o.x))t.pop();else break}t.push(r)}return t.pop(),n.length===1&&t.length===1&&n[0].x===t[0].x&&n[0].y===t[0].y?n:n.concat(t)}const uC=G7,cC=Y7;var hC=typeof WeakRef<"u",qm=class{constructor(e){hC&&typeof e=="object"?this._weakRef=new WeakRef(e):this._instance=e}deref(){var e,n;let t;return this._weakRef?(t=(e=this._weakRef)==null?void 0:e.deref(),t||delete this._weakRef):(t=this._instance,(n=t==null?void 0:t.isDisposed)!=null&&n.call(t)&&delete this._instance),t}},fr="keyborg:focusin",ro="keyborg:focusout";function vC(e){const n=e.HTMLElement,t=n.prototype.focus;let i=!1;return n.prototype.focus=function(){i=!0},e.document.createElement("button").focus(),n.prototype.focus=t,i}var Ud=!1;function zr(e){const n=e.focus;n.__keyborgNativeFocus?n.__keyborgNativeFocus.call(e):e.focus()}function pC(e){const n=e;Ud||(Ud=vC(n));const t=n.HTMLElement.prototype.focus;if(t.__keyborgNativeFocus)return;n.HTMLElement.prototype.focus=f;const i=new Set,r=u=>{const h=u.target;if(!h)return;const v=new CustomEvent(ro,{cancelable:!0,bubbles:!0,composed:!0,detail:{originalEvent:u}});h.dispatchEvent(v)},a=u=>{const h=u.target;if(!h)return;let v=u.composedPath()[0];const m=new Set;for(;v;)v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?(m.add(v),v=v.host):v=v.parentNode;for(const g of i){const b=g.deref();(!b||!m.has(b))&&(i.delete(g),b&&(b.removeEventListener("focusin",a,!0),b.removeEventListener("focusout",r,!0)))}o(h,u.relatedTarget||void 0)},o=(u,h,v)=>{var m;const g=u.shadowRoot;if(g){for(const _ of i)if(_.deref()===g)return;g.addEventListener("focusin",a,!0),g.addEventListener("focusout",r,!0),i.add(new qm(g));return}const b={relatedTarget:h,originalEvent:v},w=new CustomEvent(fr,{cancelable:!0,bubbles:!0,composed:!0,detail:b});w.details=b,(Ud||s.lastFocusedProgrammatically)&&(b.isFocusedProgrammatically=u===((m=s.lastFocusedProgrammatically)==null?void 0:m.deref()),s.lastFocusedProgrammatically=void 0),u.dispatchEvent(w)},s=n.__keyborgData={focusInHandler:a,focusOutHandler:r,shadowTargets:i};n.document.addEventListener("focusin",n.__keyborgData.focusInHandler,!0),n.document.addEventListener("focusout",n.__keyborgData.focusOutHandler,!0);function f(){const u=n.__keyborgData;return u&&(u.lastFocusedProgrammatically=new qm(this)),t.apply(this,arguments)}let d=n.document.activeElement;for(;d&&d.shadowRoot;)o(d),d=d.shadowRoot.activeElement;f.__keyborgNativeFocus=t}function mC(e){const n=e,t=n.HTMLElement.prototype,i=t.focus.__keyborgNativeFocus,r=n.__keyborgData;if(r){n.document.removeEventListener("focusin",r.focusInHandler,!0),n.document.removeEventListener("focusout",r.focusOutHandler,!0);for(const a of r.shadowTargets){const o=a.deref();o&&(o.removeEventListener("focusin",r.focusInHandler,!0),o.removeEventListener("focusout",r.focusOutHandler,!0))}r.shadowTargets.clear(),delete n.__keyborgData}i&&(t.focus=i)}var gC=500,Gm=0,bC=class{constructor(e,n){this._isNavigatingWithKeyboard_DO_NOT_USE=!1,this._onFocusIn=i=>{if(this._isMouseUsedTimer||this.isNavigatingWithKeyboard)return;const r=i.detail;r.relatedTarget&&(r.isFocusedProgrammatically||r.isFocusedProgrammatically===void 0||(this.isNavigatingWithKeyboard=!0))},this._onMouseDown=i=>{if(i.buttons===0||i.clientX===0&&i.clientY===0&&i.screenX===0&&i.screenY===0)return;const r=this._win;r&&(this._isMouseUsedTimer&&r.clearTimeout(this._isMouseUsedTimer),this._isMouseUsedTimer=r.setTimeout(()=>{delete this._isMouseUsedTimer},1e3)),this.isNavigatingWithKeyboard=!1},this._onKeyDown=i=>{this.isNavigatingWithKeyboard?this._shouldDismissKeyboardNavigation(i)&&this._scheduleDismiss():this._shouldTriggerKeyboardNavigation(i)&&(this.isNavigatingWithKeyboard=!0)},this.id="c"+ ++Gm,this._win=e;const t=e.document;if(n){const i=n.triggerKeys,r=n.dismissKeys;i!=null&&i.length&&(this._triggerKeys=new Set(i)),r!=null&&r.length&&(this._dismissKeys=new Set(r))}t.addEventListener(fr,this._onFocusIn,!0),t.addEventListener("mousedown",this._onMouseDown,!0),e.addEventListener("keydown",this._onKeyDown,!0),pC(e)}get isNavigatingWithKeyboard(){return this._isNavigatingWithKeyboard_DO_NOT_USE}set isNavigatingWithKeyboard(e){this._isNavigatingWithKeyboard_DO_NOT_USE!==e&&(this._isNavigatingWithKeyboard_DO_NOT_USE=e,this.update())}dispose(){const e=this._win;if(e){this._isMouseUsedTimer&&(e.clearTimeout(this._isMouseUsedTimer),this._isMouseUsedTimer=void 0),this._dismissTimer&&(e.clearTimeout(this._dismissTimer),this._dismissTimer=void 0),mC(e);const n=e.document;n.removeEventListener(fr,this._onFocusIn,!0),n.removeEventListener("mousedown",this._onMouseDown,!0),e.removeEventListener("keydown",this._onKeyDown,!0),delete this._win}}isDisposed(){return!!this._win}update(){var e,n;const t=(n=(e=this._win)==null?void 0:e.__keyborg)==null?void 0:n.refs;if(t)for(const i of Object.keys(t))zd.update(t[i],this.isNavigatingWithKeyboard)}_shouldTriggerKeyboardNavigation(e){var n;if(e.key==="Tab")return!0;const t=(n=this._win)==null?void 0:n.document.activeElement,i=!this._triggerKeys||this._triggerKeys.has(e.keyCode),r=t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable);return i&&!r}_shouldDismissKeyboardNavigation(e){var n;return(n=this._dismissKeys)==null?void 0:n.has(e.keyCode)}_scheduleDismiss(){const e=this._win;if(e){this._dismissTimer&&(e.clearTimeout(this._dismissTimer),this._dismissTimer=void 0);const n=e.document.activeElement;this._dismissTimer=e.setTimeout(()=>{this._dismissTimer=void 0;const t=e.document.activeElement;n&&t&&n===t&&(this.isNavigatingWithKeyboard=!1)},gC)}}},zd=class u_{constructor(n,t){this._cb=[],this._id="k"+ ++Gm,this._win=n;const i=n.__keyborg;i?(this._core=i.core,i.refs[this._id]=this):(this._core=new bC(n,t),n.__keyborg={core:this._core,refs:{[this._id]:this}})}static create(n,t){return new u_(n,t)}static dispose(n){n.dispose()}static update(n,t){n._cb.forEach(i=>i(t))}dispose(){var n;const t=(n=this._win)==null?void 0:n.__keyborg;t!=null&&t.refs[this._id]?(delete t.refs[this._id],Object.keys(t.refs).length===0&&(t.core.dispose(),delete this._win.__keyborg)):process.env.NODE_ENV!=="production"&&console.error(`Keyborg instance ${this._id} is being disposed incorrectly.`),this._cb=[],delete this._core,delete this._win}isNavigatingWithKeyboard(){var n;return!!((n=this._core)!=null&&n.isNavigatingWithKeyboard)}subscribe(n){this._cb.push(n)}unsubscribe(n){const t=this._cb.indexOf(n);t>=0&&this._cb.splice(t,1)}setVal(n){this._core&&(this._core.isNavigatingWithKeyboard=n)}};function Km(e,n){return zd.create(e,n)}function yC(e){zd.dispose(e)}/*!
|
|
@@ -824,7 +824,7 @@ button {
|
|
|
824
824
|
background-color: #61493f;
|
|
825
825
|
}
|
|
826
826
|
|
|
827
|
-
`;function zM(e){const n=l.useRef(null),t=l.useRef(null);return t.current&&t.current.update(e),l.useEffect(()=>(t.current=new Nu({...e,ref:n}),()=>{t.current=null}),[]),l.createElement("div",{ref:n})}const WM=({disabled:e,defaultEmoji:n,emoji:t,onChangeEmoji:i,onClickClear:r})=>{const{t:a}=fn("os"),[o,s]=bt({prop:t,onChange:i,defaultProp:n}),[f,d]=l.useState(!1);return l.createElement(l.Fragment,null,l.createElement(Bs.Root,{open:f,onOpenChange:d},l.createElement(Bs.Trigger,{asChild:!0},l.createElement(it,{variant:"ghost",classNames:"gap-2 text-2xl plb-1",disabled:e},l.createElement("span",{className:"sr-only"},a("select emoji label")),l.createElement("span",{className:"grow pis-14"},o),l.createElement(Ge.CaretDown,{className:He(4)}))),l.createElement(Bs.Content,{side:"right",onKeyDownCapture:u=>{u.key==="Escape"&&(u.stopPropagation(),d(!1))}},l.createElement(zM,{data:iM,onEmojiSelect:({native:u})=>{u&&(s(u),d(!1))},autoFocus:!0,maxFrequentRows:0,noCountryFlags:!0}),l.createElement(Bs.Arrow,null))),l.createElement(_n.Root,null,l.createElement(_n.Trigger,{asChild:!0},l.createElement(it,{variant:"ghost",onClick:r,disabled:e},l.createElement("span",{className:"sr-only"},a("clear label")),l.createElement(Ge.ArrowCounterClockwise,null))),l.createElement(_n.Portal,null,l.createElement(_n.Content,{style:{zIndex:70},side:"right"},a("clear label"),l.createElement(_n.Arrow,null)))))},Pb=({hue:e})=>{const{tx:n}=Pe();return l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12"},l.createElement("rect",{x:0,y:0,width:12,height:12,className:n("hue.fill","select--hue__preview",{hue:e})}))},HM=({disabled:e,hue:n,onChangeHue:t,defaultHue:i,onClickClear:r})=>{const{t:a}=fn("os"),[o,s]=bt({prop:n,onChange:t,defaultProp:i});return l.createElement(l.Fragment,null,l.createElement(ut.Root,{modal:!1},l.createElement(ut.Trigger,{asChild:!0},l.createElement(it,{variant:"ghost",classNames:"gap-2 plb-1",disabled:e},l.createElement("span",{className:"sr-only"},a("select hue label")),l.createElement("div",{role:"none",className:"pis-14 grow flex items-center justify-center gap-2"},l.createElement(Pb,{hue:o}),l.createElement("span",null,a(`${o} label`))),l.createElement(Ge.CaretDown,{className:He(4)}))),l.createElement(ut.Content,{side:"right"},l.createElement(ut.Viewport,null,Object.keys(Qr).map(f=>l.createElement(ut.CheckboxItem,{key:f,checked:f===o,onCheckedChange:()=>s(f)},l.createElement(Pb,{hue:f}),l.createElement("span",{className:"grow"},a(`${f} label`)),l.createElement(ut.ItemIndicator,null,l.createElement(Ge.Check,null))))),l.createElement(ut.Arrow,null))),l.createElement(_n.Root,null,l.createElement(_n.Trigger,{asChild:!0},l.createElement(it,{variant:"ghost",onClick:r,disabled:e},l.createElement("span",{className:"sr-only"},a("clear label")),l.createElement(Ge.ArrowCounterClockwise,null))),l.createElement(_n.Portal,null,l.createElement(_n.Content,{style:{zIndex:70},side:"right"},a("clear label"),l.createElement(_n.Arrow,null)))))};var hf={adjectives:["abundant","accessible","accomplished","accurate","achievable","adaptable","adaptive","adequate","adjustable","admirable","admiring","adorable","adored","adoring","adroit","adulatory","advanced","advantageous","adventurous","affable","affectionate","affirmative","affluent","affordable","agile","agreeable","alluring","altruistic","amazed","amazing","ambitious","amenable","amiable","amicable","ample","amusing","angelic","appealing","appreciable","appreciated","appreciative","appropriate","ardent","articulate","artistic","assuring","astonished","astonishing","astounded","astounding","athletic","attentive","attractive","audible","auspicious","authentic","autonomous","available","avid","awed","awesome","awestruck","beauteous","beautiful","believable","beloved","beneficent","beneficial","benevolent","blameless","blissful","blithe","bonny","booming","boundless","bountiful","brainiest","brainy","brave","breathtaking","bright","brighter","brightest","brilliant","brisk","brotherly","bullish","buoyant","calm","calming","capable","captivating","carefree","catchy","celebrated","celebratory","champion","charismatic","charitable","charming","chaste","cheaper","cheapest","cheerful","cheery","cherished","chivalrous","classic","classy","clean","cleaner","cleanest","cleanly","clear","cleared","clearer","clever","coherent","cohesive","colorful","comely","comfortable","comforting","comfy","commendable","commodious","compact","compatible","competitive","compliant","conciliatory","concise","confident","congenial","considerate","consistent","constructive","consummate","contrasty","convenient","convincing","cool","coolest","cooperative","correct","courageous","courteous","courtly","cozy","creative","credible","crisp","crisper","cushy","cute","daring","darling","dashing","dauntless","dazzled","dazzling","decent","decisive","dedicated","defeated","deft","delectable","delicate","delicious","delighted","delightful","dependable","deserving","desirable","desirous","detachable","devout","dexterous","dextrous","dignified","diligent","diplomatic","distinctive","diversified","divine","dominated","dumbfounded","durable","dynamic","eager","earnest","eased","easy","easygoing","ebullient","economical","ecstatic","educated","effective","efficacious","efficient","effortless","effusive","elated","elegant","elite","eloquent","eminent","enchanted","enchanting","encouraging","endearing","endorsed","energetic","engaging","engrossing","enhanced","enjoyable","enraptured","enterprising","entertaining","enthralled","enthusiastic","enticing","entranced","entrancing","enviable","envious","equitable","erudite","ethical","euphoric","evaluative","eventful","everlasting","evocative","exalted","exalting","exceeding","excellent","exceptional","excited","exciting","exemplary","exhilarating","expansive","exquisite","exuberant","exultant","fabulous","fair","faithful","famed","famous","fancier","fancy","fantastic","fascinating","fashionable","fast","faster","fastest","faultless","favorable","favored","favorite","fearless","feasible","feisty","felicitous","fertile","fervent","fervid","festive","fiery","fine","finer","finest","firmer","flashy","flatter","flattering","flawless","flexible","flourishing","fluent","fond","foolproof","foremost","formidable","fortuitous","fortunate","fragrant","free","freed","fresh","fresher","freshest","friendly","frugal","fruitful","fun","funny","futuristic","gainful","gallant","galore","generous","genial","gentle","gentlest","genuine","gifted","glad","glamorous","gleeful","glimmering","glistening","glorious","glowing","godlike","gold","golden","good","goodly","gorgeous","graceful","gracious","grand","grateful","gratified","gratifying","great","greatest","guiltless","gutsy","halcyon","hale","hallowed","handier","handsome","handy","happier","happy","hardier","hardy","harmless","harmonious","healthful","healthy","heartening","heartfelt","heartwarming","heavenly","helpful","heroic","hilarious","holy","honest","honorable","honored","hopeful","hospitable","hot","hottest","humane","humble","humorous","humourous","ideal","idolized","idyllic","illuminating","illustrious","imaginative","immaculate","immense","impartial","impassioned","impeccable","important","impressed","impressive","improved","improving","incredible","indebted","indulgent","industrious","inestimable","inexpensive","infallible","influential","ingenious","ingenuous","innocuous","innovative","insightful","inspiring","instructive","instrumental","intelligent","intelligible","interesting","intimate","intricate","intriguing","intuitive","invaluable","inventive","invigorating","invincible","inviolable","inviolate","invulnerable","irresistible","jolly","jovial","joyful","joyous","jubilant","judicious","keen","kindly","laudable","lavish","lawful","leading","lean","legendary","lighter","likable","like","liked","lionhearted","lively","logical","lovable","loved","lovely","loving","loyal","lucid","luckier","luckiest","lucky","lucrative","luminous","lush","lustrous","luxuriant","luxurious","luxury","lyrical","magic","magical","magnanimous","magnificent","majestic","manageable","marvellous","marvelous","masterful","matchless","mature","meaningful","memorable","merciful","meritorious","merry","mesmerized","mesmerizing","meticulous","mighty","miraculous","modern","modest","momentous","monumental","motivated","navigable","neat","neatest","nice","nifty","nimble","noble","noiseless","noteworthy","nourishing","observant","obtainable","optimal","optimistic","opulent","orderly","organized","outstanding","overjoyed","painless","palatial","pampered","panoramic","paramount","passionate","patient","patri","peaceable","peaceful","peerless","peppy","perfect","permissible","personalized","phenomenal","picturesque","playful","pleasant","pleased","pleasing","pleasurable","plentiful","plush","poetic","poignant","poised","polished","polite","popular","portable","posh","positive","powerful","praiseworthy","praising","precious","precise","preeminent","preferable","premier","prestigious","pretty","priceless","principled","privileged","prize","proactive","prodigious","productive","proficient","profound","progressive","prolific","prominent","promised","promising","prompt","proper","propitious","prosperous","protective","proud","proven","prudent","punctual","pure","purposeful","quaint","qualified","quicker","quiet","quieter","radiant","rapid","rapt","rapturous","rational","reachable","readable","ready","realistic","realizable","reasonable","reasoned","receptive","recommended","redeeming","refined","reformed","refreshed","refreshing","regal","rejoicing","relaxed","reliable","remarkable","renewed","renowned","replaceable","reputable","resilient","resolute","resounding","resourceful","respectable","respectful","resplendent","responsive","restful","restored","retractable","reverent","rewarding","rich","righteous","rightful","robust","romantic","roomier","rosy","safe","saintly","salutary","sane","satisfactory","satisfied","satisfying","scenic","seamless","seasoned","secure","selective","sensational","sensible","sensitive","serene","sexy","sharp","sharper","sharpest","shiny","significant","silent","simpler","simplest","simplified","sincere","skilled","skillful","sleek","slick","smart","smarter","smartest","smelly","smiling","smitten","smooth","smoother","smoothest","snappy","snazzy","sociable","soft","softer","solid","soulful","spacious","sparkling","spectacular","speedy","spellbinding","spellbound","spirited","spiritual","splendid","spontaneous","sporty","spotless","sprightly","stable","stainless","stately","statuesque","staunch","steadfast","steadiest","steady","stellar","stimulating","stimulative","streamlined","striking","strong","stronger","strongest","stunned","stunning","stupendous","sturdier","sturdy","stylish","stylized","suave","sublime","subsidized","substantive","succeeding","successful","sufficient","suitable","sumptuous","super","superb","superior","supple","supportive","supreme","surreal","sustainable","swankier","swankiest","swanky","sweeping","sweet","sweetheart","swift","talented","tantalizing","tempting","tenacious","tender","terrific","thankful","thinner","thoughtful","thrifty","thrilled","thrilling","thriving","tidy","timely","titillating","tolerable","top","topnotch","tough","tougher","toughest","tranquil","transparent","trendy","triumphal","triumphant","trusted","trusting","trustworthy","trusty","truthful","twinkly","unabashed","unaffected","unassailable","unbeatable","unbiased","unbound","undamaged","undaunted","undisputable","undisputed","unencumbered","unequivocal","unfettered","unlimited","unmatched","unparalleled","unreal","unrestricted","unrivaled","unselfish","unwavering","upbeat","upscale","usable","useful","valiant","valuable","verifiable","veritable","versatile","vibrant","victorious","viewable","vigilant","virtuous","visionary","vivacious","vivid","warm","warmer","warmhearted","wealthy","welcome","wholesome","wieldy","winning","wise","witty","wonderful","wondrous","workable","worth","worthwhile","worthy","young","youthful","zippy"],animals:["aardvark","albatross","alligator","angelfish","angora","ant","anteater","antelope","armadillo","avocet","baboon","badger","bandicoot","barnacle","barracuda","bat","beagle","bear","beaver","bee","beetle","bird","bison","bloodhound","boar","bobcat","bonobo","buffalo","bulldog","bullfrog","butterfly","buzzard","camel","cat","caterpillar","catfish","cattle","centipede","chameleon","cheetah","chicken","chihuahua","chimpanzee","chin","chinchilla","chipmunk","civet","clam","cockroach","coon","coral","corgi","cougar","cow","coyote","crab","crane","cuttlefish","dachshund","dalmatian","dane","deer","devil","dingo","dodo","dog","dogfish","dollar","dolphin","donkey","dormouse","dragon","dragonfly","duck","dugong","eagle","earwig","eel","elephant","emperor","emu","falcon","ferret","fish","flamingo","flounder","fly","forest","fowl","fox","foxhound","frog","gar","gecko","gerbil","gharial","gibbon","giraffe","goat","goose","gopher","gorilla","grasshopper","greyhound","grouse","guppy","hamster","hare","hedgehog","heron","hippopotamus","hornet","horse","hound","hummingbird","husky","hyena","hyrax","ibis","iguana","impala","insect","jackal","jaguar","jellyfish","kangaroo","kingfisher","kiwi","koala","kudu","labradoodle","ladybird","lemming","lemur","leopard","liger","lion","lionfish","lizard","llama","lobster","lynx","macaque","macaw","magpie","malamute","maltese","mammoth","manatee","mandrill","markhor","marmoset","mastiff","mayfly","meerkat","millipede","mole","mongoose","monkey","monster","moorhen","moose","moth","mouse","mule","newt","nightingale","ocelot","octopus","okapi","orangutan","ostrich","otter","owl","oyster","panda","panther","parrot","peacock","pelican","penguin","pheasant","pig","pike","piranha","platypus","pointer","poodle","porcupine","possum","prawn","puffin","pug","puma","quail","rabbit","raccoon","rat","rattlesnake","ray","reindeer","retriever","rhinoceros","robin","rottweiler","russel","salamander","scorpion","seahorse","seal","shark","sheep","sheepdog","shrew","shrimp","skater","skunk","sloth","slug","snail","snake","snowshoe","spaniel","sparrow","spider","sponge","squid","squirrel","squirt","starfish","stingray","stoat","swan","tapir","tarantula","termite","terrier","tiger","toad","tortoise","toucan","tuatara","turkey","turtle","uakari","urchin","vole","vulture","wallaby","walrus","warthog","wasp","weasel","whale","whippet","wildebeest","wolf","wolfhound","wolverine","wombat","woodlouse","woodpecker","worm","yak","zebra","zebu","zonkey","zorse"]},Ib=e=>e.charAt(0).toUpperCase()+e.slice(1),vf=e=>{const n=e.length*2/3,t=e.substring(0,n),i=e.substring(n),r=Ib(hf.adjectives[parseInt(t,16)%hf.adjectives.length]),a=Ib(hf.animals[parseInt(i,16)%hf.animals.length]);return`${r} ${a}`};const Fb=l.forwardRef(({identity:e,presence:n,onClick:t,classNames:i,...r},a)=>{var d,u,h,v,m;const o=Gp(e.identityKey),s=On("identityListItem__label"),f=((d=e.profile)==null?void 0:d.displayName)??vf(e.identityKey.toHex());return l.createElement(Hd.Root,{...r,classNames:le("flex gap-2 pis-3 pie-1 items-center",t&&"cursor-pointer",i),onClick:()=>t==null?void 0:t(),"data-testid":"identity-list-item",labelId:s,ref:a},l.createElement(Dn.Root,{status:n===jo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:s,hue:((h=(u=e.profile)==null?void 0:u.data)==null?void 0:h.hue)||o.hue},l.createElement(Dn.Frame,{classNames:"place-self-center"},l.createElement(Dn.Fallback,{text:((m=(v=e.profile)==null?void 0:v.data)==null?void 0:m.emoji)||o.emoji})),l.createElement(Dn.Label,{classNames:"text-sm truncate pli-2"},f)))}),VM=({devices:e,onSelect:n})=>{const{t}=fn("os");return e.length>0?l.createElement(Wd,{classNames:"flex flex-col gap-2"},e.map(i=>{var s,f;const r=((s=i.profile)==null?void 0:s.type)||Yi.DeviceType.UNKNOWN,a=(f=i.profile)!=null&&f.label?`${i.profile.label} (${Yi.DeviceType[r]})`:vf(i.deviceKey.toHex()),o={identityKey:i.deviceKey,profile:{displayName:a}};return l.createElement(Fb,{key:i.deviceKey.toHex(),identity:o,presence:i.presence,onClick:n&&(()=>n(i))})})):l.createElement("div",{role:"none",className:"grow flex items-center p-2"},l.createElement("p",{className:le(Nn,"text-center is-full")},t("empty device list message")))},qM=({spaceKey:e,includeSelf:n,onSelect:t})=>{const i=Je.useClient(),r=jo.useMembers(e),a=l.useMemo(()=>n?r.sort(o=>o.identity.identityKey.equals(i.halo.identity.get().identityKey)?-1:1):r.filter(o=>!o.identity.identityKey.equals(i.halo.identity.get().identityKey)),[r]);return l.createElement(GM,{members:a,onSelect:t})},GM=({members:e,onSelect:n})=>{const{t}=fn("os"),i=e.filter(r=>r.identity);return i.length>0?l.createElement(Wd,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},i.map(r=>l.createElement(Fb,{key:r.identity.identityKey.toHex(),identity:r.identity,presence:r.presence,onClick:n&&(()=>n(r))}))):l.createElement("div",{role:"none",className:"grow flex items-center p-2"},l.createElement("p",{className:le(Nn,"text-center is-full mlb-2")},t("empty space members message")))},pf=43200,Mb=1440;function Nb(e){const n=zn(e),t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+e-+t}function mf(e,n){const t=zn(e),i=zn(n),r=t.getTime()-i.getTime();return r<0?-1:r>0?1:r}function KM(e,n){const t=zn(e),i=zn(n),r=t.getFullYear()-i.getFullYear(),a=t.getMonth()-i.getMonth();return r*12+a}function YM(e){return n=>{const i=(e?Math[e]:Math.trunc)(n);return i===0?0:i}}function JM(e,n){return+zn(e)-+zn(n)}function XM(e){const n=zn(e);return n.setHours(23,59,59,999),n}function ZM(e){const n=zn(e),t=n.getMonth();return n.setFullYear(n.getFullYear(),t+1,0),n.setHours(23,59,59,999),n}function QM(e){const n=zn(e);return+XM(n)==+ZM(n)}function eN(e,n){const t=zn(e),i=zn(n),r=mf(t,i),a=Math.abs(KM(t,i));let o;if(a<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-r*a);let s=mf(t,i)===-r;QM(zn(e))&&a===1&&mf(e,i)===1&&(s=!1),o=r*(a-Number(s))}return o===0?0:o}function nN(e,n,t){const i=JM(e,n)/1e3;return YM(t==null?void 0:t.roundingMethod)(i)}function tN(e,n,t){const i=e2(),r=(t==null?void 0:t.locale)??i.locale??kh,a=2520,o=mf(e,n);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let f,d;o>0?(f=zn(n),d=zn(e)):(f=zn(e),d=zn(n));const u=nN(d,f),h=(Nb(d)-Nb(f))/1e3,v=Math.round((u-h)/60);let m;if(v<2)return t!=null&&t.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,s):u<10?r.formatDistance("lessThanXSeconds",10,s):u<20?r.formatDistance("lessThanXSeconds",20,s):u<40?r.formatDistance("halfAMinute",0,s):u<60?r.formatDistance("lessThanXMinutes",1,s):r.formatDistance("xMinutes",1,s):v===0?r.formatDistance("lessThanXMinutes",1,s):r.formatDistance("xMinutes",v,s);if(v<45)return r.formatDistance("xMinutes",v,s);if(v<90)return r.formatDistance("aboutXHours",1,s);if(v<Mb){const g=Math.round(v/60);return r.formatDistance("aboutXHours",g,s)}else{if(v<a)return r.formatDistance("xDays",1,s);if(v<pf){const g=Math.round(v/Mb);return r.formatDistance("xDays",g,s)}else if(v<pf*2)return m=Math.round(v/pf),r.formatDistance("aboutXMonths",m,s)}if(m=eN(d,f),m<12){const g=Math.round(v/pf);return r.formatDistance("xMonths",g,s)}else{const g=m%12,b=Math.trunc(m/12);return g<3?r.formatDistance("aboutXYears",b,s):g<9?r.formatDistance("overXYears",b,s):r.formatDistance("almostXYears",b+1,s)}}function iN(e,n){return tN(e,Date.now(),n)}var Db;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})(Db||(Db={}));var Lb;(function(e){(function(n){n[n.INCLUSIVE=1]="INCLUSIVE",n[n.EXPLICIT=2]="EXPLICIT"})(e.MatchingOptions||(e.MatchingOptions={}))})(Lb||(Lb={}));var Bb;(function(e){e[e.ACTIVE=0]="ACTIVE",e[e.INACTIVE=1]="INACTIVE"})(Bb||(Bb={}));var jb;(function(e){(function(n){n[n.NONE=0]="NONE",n[n.TRUNCATE=1]="TRUNCATE",n[n.HUMANIZE=2]="HUMANIZE"})(e.KEY_OPTION||(e.KEY_OPTION={}))})(jb||(jb={}));var Rb;(function(e){(function(n){n[n.BROWSER=0]="BROWSER",n[n.SHARED_WORKER=1]="SHARED_WORKER",n[n.NODE=2]="NODE"})(e.PLATFORM_TYPE||(e.PLATFORM_TYPE={}))})(Rb||(Rb={}));var Ub;(function(e){e[e.CURRENT=0]="CURRENT",e[e.TRUSTED=1]="TRUSTED"})(Ub||(Ub={}));var zb;(function(e){(function(n){n[n.OFFLINE=0]="OFFLINE",n[n.ONLINE=1]="ONLINE",n[n.REMOVED=2]="REMOVED"})(e.PresenceState||(e.PresenceState={}))})(zb||(zb={}));var Wb;(function(e){(function(n){n[n.OFFLINE=0]="OFFLINE",n[n.ONLINE=1]="ONLINE",n[n.REMOVED=2]="REMOVED"})(e.PresenceState||(e.PresenceState={}))})(Wb||(Wb={}));var Hb;(function(e){e[e.INACTIVE=2]="INACTIVE",e[e.ACTIVE=6]="ACTIVE",e[e.CLOSED=1]="CLOSED",e[e.CONTROL_ONLY=7]="CONTROL_ONLY",e[e.INITIALIZING=4]="INITIALIZING",e[e.READY=3]="READY",e[e.ERROR=5]="ERROR"})(Hb||(Hb={}));var Vb;(function(e){(function(n){n[n.NONE=0]="NONE",n[n.INIT_AUTOMERGE=1]="INIT_AUTOMERGE",n[n.PRUNE_AUTOMERGE_ROOT_HISTORY=2]="PRUNE_AUTOMERGE_ROOT_HISTORY"})(e.Migration||(e.Migration={}))})(Vb||(Vb={}));var _e;(function(e){(function(n){n[n.INTERACTIVE=0]="INTERACTIVE",n[n.OFFLINE=1]="OFFLINE",n[n.MULTIUSE=2]="MULTIUSE"})(e.Type||(e.Type={})),function(n){n[n.DEVICE=0]="DEVICE",n[n.SPACE=1]="SPACE"}(e.Kind||(e.Kind={})),function(n){n[n.NONE=0]="NONE",n[n.SHARED_SECRET=1]="SHARED_SECRET"}(e.AuthMethod||(e.AuthMethod={})),function(n){n[n.INIT=0]="INIT",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",n[n.AUTHENTICATING=4]="AUTHENTICATING",n[n.SUCCESS=5]="SUCCESS",n[n.CANCELLED=6]="CANCELLED",n[n.TIMEOUT=7]="TIMEOUT",n[n.ERROR=8]="ERROR",n[n.EXPIRED=9]="EXPIRED"}(e.State||(e.State={}))})(_e||(_e={}));var qb;(function(e){(function(n){n[n.ADDED=0]="ADDED",n[n.REMOVED=1]="REMOVED",n[n.SAVED=2]="SAVED",n[n.LOAD_COMPLETE=3]="LOAD_COMPLETE"})(e.Action||(e.Action={})),function(n){n[n.CREATED=0]="CREATED",n[n.ACCEPTED=1]="ACCEPTED"}(e.Type||(e.Type={}))})(qb||(qb={}));var Gb;(function(e){e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE"})(Gb||(Gb={}));var rN=class extends Error{constructor(){super("Context disposed.")}};function aN(e,n,t,i){var r=arguments.length,a=r<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,n,t,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(n,t,a):o(n,t))||a);return r>3&&a&&Object.defineProperty(n,t,a),a}var Du="/home/runner/work/dxos/dxos/packages/common/context/src/context.ts",oN=300,Kb=class c_{constructor({onError:n=r=>{if(!(r instanceof rN))throw this.dispose(),r},attributes:t={},parent:i}={}){this._disposeCallbacks=[],this._isDisposed=!1,this._disposePromise=void 0,this._parent=null,this.maxSafeDisposeCallbacks=oN,this._onError=n,this._attributes=t,i!==void 0&&(this._parent=i)}get disposed(){return this._isDisposed}get disposeCallbacksLength(){return this._disposeCallbacks.length}onDispose(n){return this._isDisposed&&(async()=>{try{await n()}catch(t){We.catch(t,void 0,{F:Du,L:82,S:this,C:(i,r)=>i(...r)})}})(),this._disposeCallbacks.push(n),this._disposeCallbacks.length>this.maxSafeDisposeCallbacks&&We.warn("Context has a large number of dispose callbacks. This might be a memory leak.",{count:this._disposeCallbacks.length,safeThreshold:this.maxSafeDisposeCallbacks},{F:Du,L:89,S:this,C:(t,i)=>t(...i)}),()=>{const t=this._disposeCallbacks.indexOf(n);t!==-1&&this._disposeCallbacks.splice(t,1)}}dispose(){if(this._disposePromise)return this._disposePromise;this._isDisposed=!0;const n=[];for(const t of this._disposeCallbacks.reverse())n.push((async()=>{try{await t()}catch(i){We.catch(i,void 0,{F:Du,L:124,S:this,C:(r,a)=>r(...a)})}})());return this._disposeCallbacks.length=0,this._disposePromise=Promise.all(n).then(()=>{})}raise(n){if(!this._isDisposed)try{this._onError(n)}catch(t){Promise.reject(t)}}derive({onError:n,attributes:t}={}){const i=new c_({onError:async a=>{if(!n)this.raise(a);else try{await n(a)}catch{this.raise(a)}},attributes:t}),r=this.onDispose(()=>i.dispose());return i.onDispose(r),i}getAttribute(n){if(n in this._attributes)return this._attributes[n];if(this._parent!==null)return this._parent.getAttribute(n)}};Kb=aN([G8("Context")],Kb);var gf={};Object.defineProperty(gf,"__esModule",{value:!0}),gf.Observable=void 0;const Yb=e=>!!Symbol[e],Lu=e=>Yb(e)?Symbol[e]:"@@"+e,sN=Lu("iterator"),Bu=Lu("observable"),Jb=Lu("species");function bf(e,n){let t=e[n];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function lo(e){let n=e.constructor;return n!==void 0&&(n=n[Jb],n===null&&(n=void 0)),n!==void 0?n:wf}function fN(e){return e instanceof wf}function oa(e){oa.log?oa.log(e):setTimeout(()=>{throw e})}function yf(e){Promise.resolve().then(()=>{try{e()}catch(n){oa(n)}})}function Xb(e){let n=e._cleanup;if(n!==void 0&&(e._cleanup=void 0,!!n))try{if(typeof n=="function")n();else{let t=bf(n,"unsubscribe");t&&t.call(n)}}catch(t){oa(t)}}function ju(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function lN(e){let n=e._queue;if(n){e._queue=void 0,e._state="ready";for(let t=0;t<n.length&&(Zb(e,n[t].type,n[t].value),e._state!=="closed");++t);}}function Zb(e,n,t){e._state="running";let i=e._observer;try{let r=bf(i,n);switch(n){case"next":r&&r.call(i,t);break;case"error":if(ju(e),r)r.call(i,t);else throw t;break;case"complete":ju(e),r&&r.call(i);break}}catch(r){oa(r)}e._state==="closed"?Xb(e):e._state==="running"&&(e._state="ready")}function Ru(e,n,t){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:n,value:t});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:n,value:t}],yf(()=>lN(e));return}Zb(e,n,t)}}class dN{constructor(n,t){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";let i=this,r={get closed(){return i._state==="closed"},next(a){Ru(i,"next",a)},error(a){Ru(i,"error",a)},complete(){Ru(i,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(a){r.error(a)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(ju(this),Xb(this))}}let wf=class sl{constructor(n){if(!(this instanceof sl))throw new TypeError("Observable cannot be called as a function");if(typeof n!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=n}subscribe(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new dN(n,this._subscriber)}forEach(n){return new Promise((t,i)=>{if(typeof n!="function"){i(new TypeError(n+" is not a function"));return}function r(){a.unsubscribe(),t()}let a=this.subscribe({next(o){try{n(o,r)}catch(s){i(s),a.unsubscribe()}},error:i,complete:t})})}map(n){if(typeof n!="function")throw new TypeError(n+" is not a function");let t=lo(this);return new t(i=>this.subscribe({next(r){try{r=n(r)}catch(a){return i.error(a)}i.next(r)},error(r){i.error(r)},complete(){i.complete()}}))}filter(n){if(typeof n!="function")throw new TypeError(n+" is not a function");let t=lo(this);return new t(i=>this.subscribe({next(r){try{if(!n(r))return}catch(a){return i.error(a)}i.next(r)},error(r){i.error(r)},complete(){i.complete()}}))}reduce(n){if(typeof n!="function")throw new TypeError(n+" is not a function");let t=lo(this),i=arguments.length>1,r=!1,o=arguments[1];return new t(s=>this.subscribe({next(f){let d=!r;if(r=!0,!d||i)try{o=n(o,f)}catch(u){return s.error(u)}else o=f},error(f){s.error(f)},complete(){if(!r&&!i)return s.error(new TypeError("Cannot reduce an empty sequence"));s.next(o),s.complete()}}))}async all(){let n=[];return await this.forEach(t=>n.push(t)),n}concat(...n){let t=lo(this);return new t(i=>{let r,a=0;function o(s){r=s.subscribe({next(f){i.next(f)},error(f){i.error(f)},complete(){a===n.length?(r=void 0,i.complete()):o(t.from(n[a++]))}})}return o(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(n){if(typeof n!="function")throw new TypeError(n+" is not a function");let t=lo(this);return new t(i=>{let r=[],a=this.subscribe({next(s){if(n)try{s=n(s)}catch(d){return i.error(d)}let f=t.from(s).subscribe({next(d){i.next(d)},error(d){i.error(d)},complete(){let d=r.indexOf(f);d>=0&&r.splice(d,1),o()}});r.push(f)},error(s){i.error(s)},complete(){o()}});function o(){a.closed&&r.length===0&&i.complete()}return()=>{r.forEach(s=>s.unsubscribe()),a.unsubscribe()}})}[Bu](){return this}static from(n){let t=typeof this=="function"?this:sl;if(n==null)throw new TypeError(n+" is not an object");let i=bf(n,Bu);if(i){let r=i.call(n);if(Object(r)!==r)throw new TypeError(r+" is not an object");return fN(r)&&r.constructor===t?r:new t(a=>r.subscribe(a))}if(Yb("iterator")&&(i=bf(n,sN),i))return new t(r=>{yf(()=>{if(!r.closed){for(let a of i.call(n))if(r.next(a),r.closed)return;r.complete()}})});if(Array.isArray(n))return new t(r=>{yf(()=>{if(!r.closed){for(let a=0;a<n.length;++a)if(r.next(n[a]),r.closed)return;r.complete()}})});throw new TypeError(n+" is not observable")}static of(...n){let t=typeof this=="function"?this:sl;return new t(i=>{yf(()=>{if(!i.closed){for(let r=0;r<n.length;++r)if(i.next(n[r]),i.closed)return;i.complete()}})})}static get[Jb](){return this}};gf.Observable=wf,Object.defineProperty(wf,Symbol("extensions"),{value:{symbol:Bu,hostReportError:oa},configurable:!0});var uN=gf.Observable;const _f=Er(uN);var Qb={exports:{}},Uu={exports:{}},sa=typeof Reflect=="object"?Reflect:null,ey=sa&&typeof sa.apply=="function"?sa.apply:function(n,t,i){return Function.prototype.apply.call(n,t,i)},kf;sa&&typeof sa.ownKeys=="function"?kf=sa.ownKeys:Object.getOwnPropertySymbols?kf=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:kf=function(n){return Object.getOwnPropertyNames(n)};function cN(e){console&&console.warn&&console.warn(e)}var ny=Number.isNaN||function(n){return n!==n};function mn(){mn.init.call(this)}Uu.exports=mn,Uu.exports.once=mN,mn.EventEmitter=mn,mn.prototype._events=void 0,mn.prototype._eventsCount=0,mn.prototype._maxListeners=void 0;var ty=10;function xf(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(mn,"defaultMaxListeners",{enumerable:!0,get:function(){return ty},set:function(e){if(typeof e!="number"||e<0||ny(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ty=e}}),mn.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},mn.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||ny(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function iy(e){return e._maxListeners===void 0?mn.defaultMaxListeners:e._maxListeners}mn.prototype.getMaxListeners=function(){return iy(this)},mn.prototype.emit=function(n){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var r=n==="error",a=this._events;if(a!==void 0)r=r&&a.error===void 0;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var f=a[n];if(f===void 0)return!1;if(typeof f=="function")ey(f,this,t);else for(var d=f.length,u=fy(f,d),i=0;i<d;++i)ey(u[i],this,t);return!0};function ry(e,n,t,i){var r,a,o;if(xf(t),a=e._events,a===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit("newListener",n,t.listener?t.listener:t),a=e._events),o=a[n]),o===void 0)o=a[n]=t,++e._eventsCount;else if(typeof o=="function"?o=a[n]=i?[t,o]:[o,t]:i?o.unshift(t):o.push(t),r=iy(e),r>0&&o.length>r&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=n,s.count=o.length,cN(s)}return e}mn.prototype.addListener=function(n,t){return ry(this,n,t,!1)},mn.prototype.on=mn.prototype.addListener,mn.prototype.prependListener=function(n,t){return ry(this,n,t,!0)};function hN(){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 ay(e,n,t){var i={fired:!1,wrapFn:void 0,target:e,type:n,listener:t},r=hN.bind(i);return r.listener=t,i.wrapFn=r,r}mn.prototype.once=function(n,t){return xf(t),this.on(n,ay(this,n,t)),this},mn.prototype.prependOnceListener=function(n,t){return xf(t),this.prependListener(n,ay(this,n,t)),this},mn.prototype.removeListener=function(n,t){var i,r,a,o,s;if(xf(t),r=this._events,r===void 0)return this;if(i=r[n],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[n],r.removeListener&&this.emit("removeListener",n,i.listener||t));else if(typeof i!="function"){for(a=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){s=i[o].listener,a=o;break}if(a<0)return this;a===0?i.shift():vN(i,a),i.length===1&&(r[n]=i[0]),r.removeListener!==void 0&&this.emit("removeListener",n,s||t)}return this},mn.prototype.off=mn.prototype.removeListener,mn.prototype.removeAllListeners=function(n){var t,i,r;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[n]),this;if(arguments.length===0){var a=Object.keys(i),o;for(r=0;r<a.length;++r)o=a[r],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=i[n],typeof t=="function")this.removeListener(n,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(n,t[r]);return this};function oy(e,n,t){var i=e._events;if(i===void 0)return[];var r=i[n];return r===void 0?[]:typeof r=="function"?t?[r.listener||r]:[r]:t?pN(r):fy(r,r.length)}mn.prototype.listeners=function(n){return oy(this,n,!0)},mn.prototype.rawListeners=function(n){return oy(this,n,!1)},mn.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):sy.call(e,n)},mn.prototype.listenerCount=sy;function sy(e){var n=this._events;if(n!==void 0){var t=n[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}mn.prototype.eventNames=function(){return this._eventsCount>0?kf(this._events):[]};function fy(e,n){for(var t=new Array(n),i=0;i<n;++i)t[i]=e[i];return t}function vN(e,n){for(;n+1<e.length;n++)e[n]=e[n+1];e.pop()}function pN(e){for(var n=new Array(e.length),t=0;t<n.length;++t)n[t]=e[t].listener||e[t];return n}function mN(e,n){return new Promise(function(t,i){function r(o){e.removeListener(n,a),i(o)}function a(){typeof e.removeListener=="function"&&e.removeListener("error",r),t([].slice.call(arguments))}ly(e,n,a,{once:!0}),n!=="error"&&gN(e,r,{once:!0})})}function gN(e,n,t){typeof e.on=="function"&&ly(e,"error",n,t)}function ly(e,n,t,i){if(typeof e.on=="function")i.once?e.once(n,t):e.on(n,t);else if(typeof e.addEventListener=="function")e.addEventListener(n,function r(a){i.once&&e.removeEventListener(n,r),t(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var dy=Uu.exports,uy=dy.EventEmitter,uo={},Ef={};Ef.byteLength=wN,Ef.toByteArray=kN,Ef.fromByteArray=SN;for(var Zt=[],_t=[],bN=typeof Uint8Array<"u"?Uint8Array:Array,zu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fa=0,yN=zu.length;fa<yN;++fa)Zt[fa]=zu[fa],_t[zu.charCodeAt(fa)]=fa;_t[45]=62,_t[95]=63;function cy(e){var n=e.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=n);var i=t===n?0:4-t%4;return[t,i]}function wN(e){var n=cy(e),t=n[0],i=n[1];return(t+i)*3/4-i}function _N(e,n,t){return(n+t)*3/4-t}function kN(e){var n,t=cy(e),i=t[0],r=t[1],a=new bN(_N(e,i,r)),o=0,s=r>0?i-4:i,f;for(f=0;f<s;f+=4)n=_t[e.charCodeAt(f)]<<18|_t[e.charCodeAt(f+1)]<<12|_t[e.charCodeAt(f+2)]<<6|_t[e.charCodeAt(f+3)],a[o++]=n>>16&255,a[o++]=n>>8&255,a[o++]=n&255;return r===2&&(n=_t[e.charCodeAt(f)]<<2|_t[e.charCodeAt(f+1)]>>4,a[o++]=n&255),r===1&&(n=_t[e.charCodeAt(f)]<<10|_t[e.charCodeAt(f+1)]<<4|_t[e.charCodeAt(f+2)]>>2,a[o++]=n>>8&255,a[o++]=n&255),a}function xN(e){return Zt[e>>18&63]+Zt[e>>12&63]+Zt[e>>6&63]+Zt[e&63]}function EN(e,n,t){for(var i,r=[],a=n;a<t;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),r.push(xN(i));return r.join("")}function SN(e){for(var n,t=e.length,i=t%3,r=[],a=16383,o=0,s=t-i;o<s;o+=a)r.push(EN(e,o,o+a>s?s:o+a));return i===1?(n=e[t-1],r.push(Zt[n>>2]+Zt[n<<4&63]+"==")):i===2&&(n=(e[t-2]<<8)+e[t-1],r.push(Zt[n>>10]+Zt[n>>4&63]+Zt[n<<2&63]+"=")),r.join("")}var Wu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Wu.read=function(e,n,t,i,r){var a,o,s=r*8-i-1,f=(1<<s)-1,d=f>>1,u=-7,h=t?r-1:0,v=t?-1:1,m=e[n+h];for(h+=v,a=m&(1<<-u)-1,m>>=-u,u+=s;u>0;a=a*256+e[n+h],h+=v,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=i;u>0;o=o*256+e[n+h],h+=v,u-=8);if(a===0)a=1-d;else{if(a===f)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,i),a=a-d}return(m?-1:1)*o*Math.pow(2,a-i)},Wu.write=function(e,n,t,i,r,a){var o,s,f,d=a*8-r-1,u=(1<<d)-1,h=u>>1,v=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:a-1,g=i?1:-1,b=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(s=isNaN(n)?1:0,o=u):(o=Math.floor(Math.log(n)/Math.LN2),n*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+h>=1?n+=v/f:n+=v*Math.pow(2,1-h),n*f>=2&&(o++,f/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(n*f-1)*Math.pow(2,r),o=o+h):(s=n*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;e[t+m]=s&255,m+=g,s/=256,r-=8);for(o=o<<r|s,d+=r;d>0;e[t+m]=o&255,m+=g,o/=256,d-=8);e[t+m-g]|=b*128};/*!
|
|
827
|
+
`;function zM(e){const n=l.useRef(null),t=l.useRef(null);return t.current&&t.current.update(e),l.useEffect(()=>(t.current=new Nu({...e,ref:n}),()=>{t.current=null}),[]),l.createElement("div",{ref:n})}const WM=({disabled:e,defaultEmoji:n,emoji:t,onChangeEmoji:i,onClickClear:r})=>{const{t:a}=fn("os"),[o,s]=bt({prop:t,onChange:i,defaultProp:n}),[f,d]=l.useState(!1);return l.createElement(l.Fragment,null,l.createElement(Bs.Root,{open:f,onOpenChange:d},l.createElement(Bs.Trigger,{asChild:!0},l.createElement(it,{variant:"ghost",classNames:"gap-2 text-2xl plb-1",disabled:e},l.createElement("span",{className:"sr-only"},a("select emoji label")),l.createElement("span",{className:"grow pis-14"},o),l.createElement(Ge.CaretDown,{className:He(4)}))),l.createElement(Bs.Content,{side:"right",onKeyDownCapture:u=>{u.key==="Escape"&&(u.stopPropagation(),d(!1))}},l.createElement(zM,{data:iM,onEmojiSelect:({native:u})=>{u&&(s(u),d(!1))},autoFocus:!0,maxFrequentRows:0,noCountryFlags:!0}),l.createElement(Bs.Arrow,null))),l.createElement(_n.Root,null,l.createElement(_n.Trigger,{asChild:!0},l.createElement(it,{variant:"ghost",onClick:r,disabled:e},l.createElement("span",{className:"sr-only"},a("clear label")),l.createElement(Ge.ArrowCounterClockwise,null))),l.createElement(_n.Portal,null,l.createElement(_n.Content,{style:{zIndex:70},side:"right"},a("clear label"),l.createElement(_n.Arrow,null)))))},Pb=({hue:e})=>{const{tx:n}=Pe();return l.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12"},l.createElement("rect",{x:0,y:0,width:12,height:12,className:n("hue.fill","select--hue__preview",{hue:e})}))},HM=({disabled:e,hue:n,onChangeHue:t,defaultHue:i,onClickClear:r})=>{const{t:a}=fn("os"),[o,s]=bt({prop:n,onChange:t,defaultProp:i});return l.createElement(l.Fragment,null,l.createElement(ut.Root,{modal:!1},l.createElement(ut.Trigger,{asChild:!0},l.createElement(it,{variant:"ghost",classNames:"gap-2 plb-1",disabled:e},l.createElement("span",{className:"sr-only"},a("select hue label")),l.createElement("div",{role:"none",className:"pis-14 grow flex items-center justify-center gap-2"},l.createElement(Pb,{hue:o}),l.createElement("span",null,a(`${o} label`))),l.createElement(Ge.CaretDown,{className:He(4)}))),l.createElement(ut.Content,{side:"right"},l.createElement(ut.Viewport,null,Object.keys(Qr).map(f=>l.createElement(ut.CheckboxItem,{key:f,checked:f===o,onCheckedChange:()=>s(f)},l.createElement(Pb,{hue:f}),l.createElement("span",{className:"grow"},a(`${f} label`)),l.createElement(ut.ItemIndicator,null,l.createElement(Ge.Check,null))))),l.createElement(ut.Arrow,null))),l.createElement(_n.Root,null,l.createElement(_n.Trigger,{asChild:!0},l.createElement(it,{variant:"ghost",onClick:r,disabled:e},l.createElement("span",{className:"sr-only"},a("clear label")),l.createElement(Ge.ArrowCounterClockwise,null))),l.createElement(_n.Portal,null,l.createElement(_n.Content,{style:{zIndex:70},side:"right"},a("clear label"),l.createElement(_n.Arrow,null)))))};var hf={adjectives:["abundant","accessible","accomplished","accurate","achievable","adaptable","adaptive","adequate","adjustable","admirable","admiring","adorable","adored","adoring","adroit","adulatory","advanced","advantageous","adventurous","affable","affectionate","affirmative","affluent","affordable","agile","agreeable","alluring","altruistic","amazed","amazing","ambitious","amenable","amiable","amicable","ample","amusing","angelic","appealing","appreciable","appreciated","appreciative","appropriate","ardent","articulate","artistic","assuring","astonished","astonishing","astounded","astounding","athletic","attentive","attractive","audible","auspicious","authentic","autonomous","available","avid","awed","awesome","awestruck","beauteous","beautiful","believable","beloved","beneficent","beneficial","benevolent","blameless","blissful","blithe","bonny","booming","boundless","bountiful","brainiest","brainy","brave","breathtaking","bright","brighter","brightest","brilliant","brisk","brotherly","bullish","buoyant","calm","calming","capable","captivating","carefree","catchy","celebrated","celebratory","champion","charismatic","charitable","charming","chaste","cheaper","cheapest","cheerful","cheery","cherished","chivalrous","classic","classy","clean","cleaner","cleanest","cleanly","clear","cleared","clearer","clever","coherent","cohesive","colorful","comely","comfortable","comforting","comfy","commendable","commodious","compact","compatible","competitive","compliant","conciliatory","concise","confident","congenial","considerate","consistent","constructive","consummate","contrasty","convenient","convincing","cool","coolest","cooperative","correct","courageous","courteous","courtly","cozy","creative","credible","crisp","crisper","cushy","cute","daring","darling","dashing","dauntless","dazzled","dazzling","decent","decisive","dedicated","defeated","deft","delectable","delicate","delicious","delighted","delightful","dependable","deserving","desirable","desirous","detachable","devout","dexterous","dextrous","dignified","diligent","diplomatic","distinctive","diversified","divine","dominated","dumbfounded","durable","dynamic","eager","earnest","eased","easy","easygoing","ebullient","economical","ecstatic","educated","effective","efficacious","efficient","effortless","effusive","elated","elegant","elite","eloquent","eminent","enchanted","enchanting","encouraging","endearing","endorsed","energetic","engaging","engrossing","enhanced","enjoyable","enraptured","enterprising","entertaining","enthralled","enthusiastic","enticing","entranced","entrancing","enviable","envious","equitable","erudite","ethical","euphoric","evaluative","eventful","everlasting","evocative","exalted","exalting","exceeding","excellent","exceptional","excited","exciting","exemplary","exhilarating","expansive","exquisite","exuberant","exultant","fabulous","fair","faithful","famed","famous","fancier","fancy","fantastic","fascinating","fashionable","fast","faster","fastest","faultless","favorable","favored","favorite","fearless","feasible","feisty","felicitous","fertile","fervent","fervid","festive","fiery","fine","finer","finest","firmer","flashy","flatter","flattering","flawless","flexible","flourishing","fluent","fond","foolproof","foremost","formidable","fortuitous","fortunate","fragrant","free","freed","fresh","fresher","freshest","friendly","frugal","fruitful","fun","funny","futuristic","gainful","gallant","galore","generous","genial","gentle","gentlest","genuine","gifted","glad","glamorous","gleeful","glimmering","glistening","glorious","glowing","godlike","gold","golden","good","goodly","gorgeous","graceful","gracious","grand","grateful","gratified","gratifying","great","greatest","guiltless","gutsy","halcyon","hale","hallowed","handier","handsome","handy","happier","happy","hardier","hardy","harmless","harmonious","healthful","healthy","heartening","heartfelt","heartwarming","heavenly","helpful","heroic","hilarious","holy","honest","honorable","honored","hopeful","hospitable","hot","hottest","humane","humble","humorous","humourous","ideal","idolized","idyllic","illuminating","illustrious","imaginative","immaculate","immense","impartial","impassioned","impeccable","important","impressed","impressive","improved","improving","incredible","indebted","indulgent","industrious","inestimable","inexpensive","infallible","influential","ingenious","ingenuous","innocuous","innovative","insightful","inspiring","instructive","instrumental","intelligent","intelligible","interesting","intimate","intricate","intriguing","intuitive","invaluable","inventive","invigorating","invincible","inviolable","inviolate","invulnerable","irresistible","jolly","jovial","joyful","joyous","jubilant","judicious","keen","kindly","laudable","lavish","lawful","leading","lean","legendary","lighter","likable","like","liked","lionhearted","lively","logical","lovable","loved","lovely","loving","loyal","lucid","luckier","luckiest","lucky","lucrative","luminous","lush","lustrous","luxuriant","luxurious","luxury","lyrical","magic","magical","magnanimous","magnificent","majestic","manageable","marvellous","marvelous","masterful","matchless","mature","meaningful","memorable","merciful","meritorious","merry","mesmerized","mesmerizing","meticulous","mighty","miraculous","modern","modest","momentous","monumental","motivated","navigable","neat","neatest","nice","nifty","nimble","noble","noiseless","noteworthy","nourishing","observant","obtainable","optimal","optimistic","opulent","orderly","organized","outstanding","overjoyed","painless","palatial","pampered","panoramic","paramount","passionate","patient","patri","peaceable","peaceful","peerless","peppy","perfect","permissible","personalized","phenomenal","picturesque","playful","pleasant","pleased","pleasing","pleasurable","plentiful","plush","poetic","poignant","poised","polished","polite","popular","portable","posh","positive","powerful","praiseworthy","praising","precious","precise","preeminent","preferable","premier","prestigious","pretty","priceless","principled","privileged","prize","proactive","prodigious","productive","proficient","profound","progressive","prolific","prominent","promised","promising","prompt","proper","propitious","prosperous","protective","proud","proven","prudent","punctual","pure","purposeful","quaint","qualified","quicker","quiet","quieter","radiant","rapid","rapt","rapturous","rational","reachable","readable","ready","realistic","realizable","reasonable","reasoned","receptive","recommended","redeeming","refined","reformed","refreshed","refreshing","regal","rejoicing","relaxed","reliable","remarkable","renewed","renowned","replaceable","reputable","resilient","resolute","resounding","resourceful","respectable","respectful","resplendent","responsive","restful","restored","retractable","reverent","rewarding","rich","righteous","rightful","robust","romantic","roomier","rosy","safe","saintly","salutary","sane","satisfactory","satisfied","satisfying","scenic","seamless","seasoned","secure","selective","sensational","sensible","sensitive","serene","sexy","sharp","sharper","sharpest","shiny","significant","silent","simpler","simplest","simplified","sincere","skilled","skillful","sleek","slick","smart","smarter","smartest","smelly","smiling","smitten","smooth","smoother","smoothest","snappy","snazzy","sociable","soft","softer","solid","soulful","spacious","sparkling","spectacular","speedy","spellbinding","spellbound","spirited","spiritual","splendid","spontaneous","sporty","spotless","sprightly","stable","stainless","stately","statuesque","staunch","steadfast","steadiest","steady","stellar","stimulating","stimulative","streamlined","striking","strong","stronger","strongest","stunned","stunning","stupendous","sturdier","sturdy","stylish","stylized","suave","sublime","subsidized","substantive","succeeding","successful","sufficient","suitable","sumptuous","super","superb","superior","supple","supportive","supreme","surreal","sustainable","swankier","swankiest","swanky","sweeping","sweet","sweetheart","swift","talented","tantalizing","tempting","tenacious","tender","terrific","thankful","thinner","thoughtful","thrifty","thrilled","thrilling","thriving","tidy","timely","titillating","tolerable","top","topnotch","tough","tougher","toughest","tranquil","transparent","trendy","triumphal","triumphant","trusted","trusting","trustworthy","trusty","truthful","twinkly","unabashed","unaffected","unassailable","unbeatable","unbiased","unbound","undamaged","undaunted","undisputable","undisputed","unencumbered","unequivocal","unfettered","unlimited","unmatched","unparalleled","unreal","unrestricted","unrivaled","unselfish","unwavering","upbeat","upscale","usable","useful","valiant","valuable","verifiable","veritable","versatile","vibrant","victorious","viewable","vigilant","virtuous","visionary","vivacious","vivid","warm","warmer","warmhearted","wealthy","welcome","wholesome","wieldy","winning","wise","witty","wonderful","wondrous","workable","worth","worthwhile","worthy","young","youthful","zippy"],animals:["aardvark","albatross","alligator","angelfish","angora","ant","anteater","antelope","armadillo","avocet","baboon","badger","bandicoot","barnacle","barracuda","bat","beagle","bear","beaver","bee","beetle","bird","bison","bloodhound","boar","bobcat","bonobo","buffalo","bulldog","bullfrog","butterfly","buzzard","camel","cat","caterpillar","catfish","cattle","centipede","chameleon","cheetah","chicken","chihuahua","chimpanzee","chin","chinchilla","chipmunk","civet","clam","cockroach","coon","coral","corgi","cougar","cow","coyote","crab","crane","cuttlefish","dachshund","dalmatian","dane","deer","devil","dingo","dodo","dog","dogfish","dollar","dolphin","donkey","dormouse","dragon","dragonfly","duck","dugong","eagle","earwig","eel","elephant","emperor","emu","falcon","ferret","fish","flamingo","flounder","fly","forest","fowl","fox","foxhound","frog","gar","gecko","gerbil","gharial","gibbon","giraffe","goat","goose","gopher","gorilla","grasshopper","greyhound","grouse","guppy","hamster","hare","hedgehog","heron","hippopotamus","hornet","horse","hound","hummingbird","husky","hyena","hyrax","ibis","iguana","impala","insect","jackal","jaguar","jellyfish","kangaroo","kingfisher","kiwi","koala","kudu","labradoodle","ladybird","lemming","lemur","leopard","liger","lion","lionfish","lizard","llama","lobster","lynx","macaque","macaw","magpie","malamute","maltese","mammoth","manatee","mandrill","markhor","marmoset","mastiff","mayfly","meerkat","millipede","mole","mongoose","monkey","monster","moorhen","moose","moth","mouse","mule","newt","nightingale","ocelot","octopus","okapi","orangutan","ostrich","otter","owl","oyster","panda","panther","parrot","peacock","pelican","penguin","pheasant","pig","pike","piranha","platypus","pointer","poodle","porcupine","possum","prawn","puffin","pug","puma","quail","rabbit","raccoon","rat","rattlesnake","ray","reindeer","retriever","rhinoceros","robin","rottweiler","russel","salamander","scorpion","seahorse","seal","shark","sheep","sheepdog","shrew","shrimp","skater","skunk","sloth","slug","snail","snake","snowshoe","spaniel","sparrow","spider","sponge","squid","squirrel","squirt","starfish","stingray","stoat","swan","tapir","tarantula","termite","terrier","tiger","toad","tortoise","toucan","tuatara","turkey","turtle","uakari","urchin","vole","vulture","wallaby","walrus","warthog","wasp","weasel","whale","whippet","wildebeest","wolf","wolfhound","wolverine","wombat","woodlouse","woodpecker","worm","yak","zebra","zebu","zonkey","zorse"]},Ib=e=>e.charAt(0).toUpperCase()+e.slice(1),vf=e=>{const n=e.length*2/3,t=e.substring(0,n),i=e.substring(n),r=Ib(hf.adjectives[parseInt(t,16)%hf.adjectives.length]),a=Ib(hf.animals[parseInt(i,16)%hf.animals.length]);return`${r} ${a}`};const Fb=l.forwardRef(({identity:e,presence:n,onClick:t,classNames:i,...r},a)=>{var d,u,h,v,m;const o=Gp(e.identityKey),s=On("identityListItem__label"),f=((d=e.profile)==null?void 0:d.displayName)??vf(e.identityKey.toHex());return l.createElement(Hd.Root,{...r,classNames:le("flex gap-2 pis-3 pie-1 items-center",t&&"cursor-pointer",i),onClick:()=>t==null?void 0:t(),"data-testid":"identity-list-item",labelId:s,ref:a},l.createElement(Dn.Root,{status:n===jo.SpaceMember.PresenceState.ONLINE?"active":"inactive",labelId:s,hue:((h=(u=e.profile)==null?void 0:u.data)==null?void 0:h.hue)||o.hue},l.createElement(Dn.Frame,{classNames:"place-self-center"},l.createElement(Dn.Fallback,{text:((m=(v=e.profile)==null?void 0:v.data)==null?void 0:m.emoji)||o.emoji})),l.createElement(Dn.Label,{classNames:"text-sm truncate pli-2"},f)))}),VM=({devices:e,onSelect:n})=>{const{t}=fn("os");return e.length>0?l.createElement(Wd,{classNames:"flex flex-col gap-2"},e.map(i=>{var s,f;const r=((s=i.profile)==null?void 0:s.type)||Yi.DeviceType.UNKNOWN,a=(f=i.profile)!=null&&f.label?`${i.profile.label} (${Yi.DeviceType[r]})`:vf(i.deviceKey.toHex()),o={identityKey:i.deviceKey,profile:{displayName:a}};return l.createElement(Fb,{key:i.deviceKey.toHex(),identity:o,presence:i.presence,onClick:n&&(()=>n(i))})})):l.createElement("div",{role:"none",className:"grow flex items-center p-2"},l.createElement("p",{className:le(Nn,"text-center is-full")},t("empty device list message")))},qM=({spaceKey:e,includeSelf:n,onSelect:t})=>{const i=Je.useClient(),r=jo.useMembers(e),a=l.useMemo(()=>n?r.sort(o=>o.identity.identityKey.equals(i.halo.identity.get().identityKey)?-1:1):r.filter(o=>!o.identity.identityKey.equals(i.halo.identity.get().identityKey)),[r]);return l.createElement(GM,{members:a,onSelect:t})},GM=({members:e,onSelect:n})=>{const{t}=fn("os"),i=e.filter(r=>r.identity);return i.length>0?l.createElement(Wd,{classNames:"flex flex-col gap-2","data-testid":"space-members-list"},i.map(r=>l.createElement(Fb,{key:r.identity.identityKey.toHex(),identity:r.identity,presence:r.presence,onClick:n&&(()=>n(r))}))):l.createElement("div",{role:"none",className:"grow flex items-center p-2"},l.createElement("p",{className:le(Nn,"text-center is-full mlb-2")},t("empty space members message")))},pf=43200,Mb=1440;function Nb(e){const n=zn(e),t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+e-+t}function mf(e,n){const t=zn(e),i=zn(n),r=t.getTime()-i.getTime();return r<0?-1:r>0?1:r}function KM(e,n){const t=zn(e),i=zn(n),r=t.getFullYear()-i.getFullYear(),a=t.getMonth()-i.getMonth();return r*12+a}function YM(e){return n=>{const i=(e?Math[e]:Math.trunc)(n);return i===0?0:i}}function JM(e,n){return+zn(e)-+zn(n)}function XM(e){const n=zn(e);return n.setHours(23,59,59,999),n}function ZM(e){const n=zn(e),t=n.getMonth();return n.setFullYear(n.getFullYear(),t+1,0),n.setHours(23,59,59,999),n}function QM(e){const n=zn(e);return+XM(n)==+ZM(n)}function eN(e,n){const t=zn(e),i=zn(n),r=mf(t,i),a=Math.abs(KM(t,i));let o;if(a<1)o=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-r*a);let s=mf(t,i)===-r;QM(zn(e))&&a===1&&mf(e,i)===1&&(s=!1),o=r*(a-Number(s))}return o===0?0:o}function nN(e,n,t){const i=JM(e,n)/1e3;return YM(t==null?void 0:t.roundingMethod)(i)}function tN(e,n,t){const i=e2(),r=(t==null?void 0:t.locale)??i.locale??kh,a=2520,o=mf(e,n);if(isNaN(o))throw new RangeError("Invalid time value");const s=Object.assign({},t,{addSuffix:t==null?void 0:t.addSuffix,comparison:o});let f,d;o>0?(f=zn(n),d=zn(e)):(f=zn(e),d=zn(n));const u=nN(d,f),h=(Nb(d)-Nb(f))/1e3,v=Math.round((u-h)/60);let m;if(v<2)return t!=null&&t.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,s):u<10?r.formatDistance("lessThanXSeconds",10,s):u<20?r.formatDistance("lessThanXSeconds",20,s):u<40?r.formatDistance("halfAMinute",0,s):u<60?r.formatDistance("lessThanXMinutes",1,s):r.formatDistance("xMinutes",1,s):v===0?r.formatDistance("lessThanXMinutes",1,s):r.formatDistance("xMinutes",v,s);if(v<45)return r.formatDistance("xMinutes",v,s);if(v<90)return r.formatDistance("aboutXHours",1,s);if(v<Mb){const g=Math.round(v/60);return r.formatDistance("aboutXHours",g,s)}else{if(v<a)return r.formatDistance("xDays",1,s);if(v<pf){const g=Math.round(v/Mb);return r.formatDistance("xDays",g,s)}else if(v<pf*2)return m=Math.round(v/pf),r.formatDistance("aboutXMonths",m,s)}if(m=eN(d,f),m<12){const g=Math.round(v/pf);return r.formatDistance("xMonths",g,s)}else{const g=m%12,b=Math.trunc(m/12);return g<3?r.formatDistance("aboutXYears",b,s):g<9?r.formatDistance("overXYears",b,s):r.formatDistance("almostXYears",b+1,s)}}function iN(e,n){return tN(e,Date.now(),n)}var Db;(function(e){e[e.TRACE=5]="TRACE",e[e.DEBUG=10]="DEBUG",e[e.INFO=11]="INFO",e[e.WARN=12]="WARN",e[e.ERROR=13]="ERROR"})(Db||(Db={}));var Lb;(function(e){(function(n){n[n.INCLUSIVE=1]="INCLUSIVE",n[n.EXPLICIT=2]="EXPLICIT"})(e.MatchingOptions||(e.MatchingOptions={}))})(Lb||(Lb={}));var Bb;(function(e){e[e.ACTIVE=0]="ACTIVE",e[e.INACTIVE=1]="INACTIVE"})(Bb||(Bb={}));var jb;(function(e){(function(n){n[n.NONE=0]="NONE",n[n.TRUNCATE=1]="TRUNCATE",n[n.HUMANIZE=2]="HUMANIZE"})(e.KEY_OPTION||(e.KEY_OPTION={}))})(jb||(jb={}));var Rb;(function(e){(function(n){n[n.BROWSER=0]="BROWSER",n[n.SHARED_WORKER=1]="SHARED_WORKER",n[n.NODE=2]="NODE"})(e.PLATFORM_TYPE||(e.PLATFORM_TYPE={}))})(Rb||(Rb={}));var Ub;(function(e){e[e.CURRENT=0]="CURRENT",e[e.TRUSTED=1]="TRUSTED"})(Ub||(Ub={}));var zb;(function(e){(function(n){n[n.OFFLINE=0]="OFFLINE",n[n.ONLINE=1]="ONLINE",n[n.REMOVED=2]="REMOVED"})(e.PresenceState||(e.PresenceState={}))})(zb||(zb={}));var Wb;(function(e){(function(n){n[n.OFFLINE=0]="OFFLINE",n[n.ONLINE=1]="ONLINE",n[n.REMOVED=2]="REMOVED"})(e.PresenceState||(e.PresenceState={}))})(Wb||(Wb={}));var Hb;(function(e){e[e.INACTIVE=2]="INACTIVE",e[e.ACTIVE=6]="ACTIVE",e[e.CLOSED=1]="CLOSED",e[e.CONTROL_ONLY=7]="CONTROL_ONLY",e[e.INITIALIZING=4]="INITIALIZING",e[e.READY=3]="READY",e[e.ERROR=5]="ERROR"})(Hb||(Hb={}));var Vb;(function(e){(function(n){n[n.NONE=0]="NONE",n[n.INIT_AUTOMERGE=1]="INIT_AUTOMERGE",n[n.PRUNE_AUTOMERGE_ROOT_HISTORY=2]="PRUNE_AUTOMERGE_ROOT_HISTORY"})(e.Migration||(e.Migration={}))})(Vb||(Vb={}));var _e;(function(e){(function(n){n[n.INTERACTIVE=0]="INTERACTIVE",n[n.OFFLINE=1]="OFFLINE",n[n.MULTIUSE=2]="MULTIUSE"})(e.Type||(e.Type={})),function(n){n[n.DEVICE=0]="DEVICE",n[n.SPACE=1]="SPACE"}(e.Kind||(e.Kind={})),function(n){n[n.NONE=0]="NONE",n[n.SHARED_SECRET=1]="SHARED_SECRET"}(e.AuthMethod||(e.AuthMethod={})),function(n){n[n.INIT=0]="INIT",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED",n[n.READY_FOR_AUTHENTICATION=3]="READY_FOR_AUTHENTICATION",n[n.AUTHENTICATING=4]="AUTHENTICATING",n[n.SUCCESS=5]="SUCCESS",n[n.CANCELLED=6]="CANCELLED",n[n.TIMEOUT=7]="TIMEOUT",n[n.ERROR=8]="ERROR",n[n.EXPIRED=9]="EXPIRED"}(e.State||(e.State={}))})(_e||(_e={}));var qb;(function(e){(function(n){n[n.ADDED=0]="ADDED",n[n.REMOVED=1]="REMOVED",n[n.SAVED=2]="SAVED",n[n.LOAD_COMPLETE=3]="LOAD_COMPLETE"})(e.Action||(e.Action={})),function(n){n[n.CREATED=0]="CREATED",n[n.ACCEPTED=1]="ACCEPTED"}(e.Type||(e.Type={}))})(qb||(qb={}));var Gb;(function(e){e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE"})(Gb||(Gb={}));var rN=class extends Error{constructor(){super("Context disposed.")}};function aN(e,n,t,i){var r=arguments.length,a=r<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,n,t,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(n,t,a):o(n,t))||a);return r>3&&a&&Object.defineProperty(n,t,a),a}var Du="/home/runner/work/dxos/dxos/packages/common/context/src/context.ts",oN=300,Kb=class c_{constructor({onError:n=r=>{if(!(r instanceof rN))throw this.dispose(),r},attributes:t={},parent:i}={}){this._disposeCallbacks=[],this._isDisposed=!1,this._disposePromise=void 0,this._parent=null,this.maxSafeDisposeCallbacks=oN,this._onError=n,this._attributes=t,i!==void 0&&(this._parent=i)}get disposed(){return this._isDisposed}get disposeCallbacksLength(){return this._disposeCallbacks.length}onDispose(n){return this._isDisposed&&(async()=>{try{await n()}catch(t){We.catch(t,void 0,{F:Du,L:82,S:this,C:(i,r)=>i(...r)})}})(),this._disposeCallbacks.push(n),this._disposeCallbacks.length>this.maxSafeDisposeCallbacks&&We.warn("Context has a large number of dispose callbacks. This might be a memory leak.",{count:this._disposeCallbacks.length,safeThreshold:this.maxSafeDisposeCallbacks},{F:Du,L:89,S:this,C:(t,i)=>t(...i)}),()=>{const t=this._disposeCallbacks.indexOf(n);t!==-1&&this._disposeCallbacks.splice(t,1)}}dispose(){if(this._disposePromise)return this._disposePromise;this._isDisposed=!0;let n;this._disposePromise=new Promise(r=>{n=r});const t=[],i=Array.from(this._disposeCallbacks).reverse();for(const r of i)t.push((async()=>{try{await r()}catch(a){We.catch(a,void 0,{F:Du,L:132,S:this,C:(o,s)=>o(...s)})}})());return this._disposeCallbacks.length=0,Promise.all(t).then(()=>{n()}),this._disposePromise}raise(n){if(!this._isDisposed)try{this._onError(n)}catch(t){Promise.reject(t)}}derive({onError:n,attributes:t}={}){const i=new c_({onError:async a=>{if(!n)this.raise(a);else try{await n(a)}catch{this.raise(a)}},attributes:t}),r=this.onDispose(()=>i.dispose());return i.onDispose(r),i}getAttribute(n){if(n in this._attributes)return this._attributes[n];if(this._parent!==null)return this._parent.getAttribute(n)}};Kb=aN([G8("Context")],Kb);var gf={};Object.defineProperty(gf,"__esModule",{value:!0}),gf.Observable=void 0;const Yb=e=>!!Symbol[e],Lu=e=>Yb(e)?Symbol[e]:"@@"+e,sN=Lu("iterator"),Bu=Lu("observable"),Jb=Lu("species");function bf(e,n){let t=e[n];if(t!=null){if(typeof t!="function")throw new TypeError(t+" is not a function");return t}}function lo(e){let n=e.constructor;return n!==void 0&&(n=n[Jb],n===null&&(n=void 0)),n!==void 0?n:wf}function fN(e){return e instanceof wf}function oa(e){oa.log?oa.log(e):setTimeout(()=>{throw e})}function yf(e){Promise.resolve().then(()=>{try{e()}catch(n){oa(n)}})}function Xb(e){let n=e._cleanup;if(n!==void 0&&(e._cleanup=void 0,!!n))try{if(typeof n=="function")n();else{let t=bf(n,"unsubscribe");t&&t.call(n)}}catch(t){oa(t)}}function ju(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function lN(e){let n=e._queue;if(n){e._queue=void 0,e._state="ready";for(let t=0;t<n.length&&(Zb(e,n[t].type,n[t].value),e._state!=="closed");++t);}}function Zb(e,n,t){e._state="running";let i=e._observer;try{let r=bf(i,n);switch(n){case"next":r&&r.call(i,t);break;case"error":if(ju(e),r)r.call(i,t);else throw t;break;case"complete":ju(e),r&&r.call(i);break}}catch(r){oa(r)}e._state==="closed"?Xb(e):e._state==="running"&&(e._state="ready")}function Ru(e,n,t){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:n,value:t});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:n,value:t}],yf(()=>lN(e));return}Zb(e,n,t)}}class dN{constructor(n,t){this._cleanup=void 0,this._observer=n,this._queue=void 0,this._state="initializing";let i=this,r={get closed(){return i._state==="closed"},next(a){Ru(i,"next",a)},error(a){Ru(i,"error",a)},complete(){Ru(i,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(a){r.error(a)}this._state==="initializing"&&(this._state="ready")}get closed(){return this._state==="closed"}unsubscribe(){this._state!=="closed"&&(ju(this),Xb(this))}}let wf=class sl{constructor(n){if(!(this instanceof sl))throw new TypeError("Observable cannot be called as a function");if(typeof n!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=n}subscribe(n){return(typeof n!="object"||n===null)&&(n={next:n,error:arguments[1],complete:arguments[2]}),new dN(n,this._subscriber)}forEach(n){return new Promise((t,i)=>{if(typeof n!="function"){i(new TypeError(n+" is not a function"));return}function r(){a.unsubscribe(),t()}let a=this.subscribe({next(o){try{n(o,r)}catch(s){i(s),a.unsubscribe()}},error:i,complete:t})})}map(n){if(typeof n!="function")throw new TypeError(n+" is not a function");let t=lo(this);return new t(i=>this.subscribe({next(r){try{r=n(r)}catch(a){return i.error(a)}i.next(r)},error(r){i.error(r)},complete(){i.complete()}}))}filter(n){if(typeof n!="function")throw new TypeError(n+" is not a function");let t=lo(this);return new t(i=>this.subscribe({next(r){try{if(!n(r))return}catch(a){return i.error(a)}i.next(r)},error(r){i.error(r)},complete(){i.complete()}}))}reduce(n){if(typeof n!="function")throw new TypeError(n+" is not a function");let t=lo(this),i=arguments.length>1,r=!1,o=arguments[1];return new t(s=>this.subscribe({next(f){let d=!r;if(r=!0,!d||i)try{o=n(o,f)}catch(u){return s.error(u)}else o=f},error(f){s.error(f)},complete(){if(!r&&!i)return s.error(new TypeError("Cannot reduce an empty sequence"));s.next(o),s.complete()}}))}async all(){let n=[];return await this.forEach(t=>n.push(t)),n}concat(...n){let t=lo(this);return new t(i=>{let r,a=0;function o(s){r=s.subscribe({next(f){i.next(f)},error(f){i.error(f)},complete(){a===n.length?(r=void 0,i.complete()):o(t.from(n[a++]))}})}return o(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(n){if(typeof n!="function")throw new TypeError(n+" is not a function");let t=lo(this);return new t(i=>{let r=[],a=this.subscribe({next(s){if(n)try{s=n(s)}catch(d){return i.error(d)}let f=t.from(s).subscribe({next(d){i.next(d)},error(d){i.error(d)},complete(){let d=r.indexOf(f);d>=0&&r.splice(d,1),o()}});r.push(f)},error(s){i.error(s)},complete(){o()}});function o(){a.closed&&r.length===0&&i.complete()}return()=>{r.forEach(s=>s.unsubscribe()),a.unsubscribe()}})}[Bu](){return this}static from(n){let t=typeof this=="function"?this:sl;if(n==null)throw new TypeError(n+" is not an object");let i=bf(n,Bu);if(i){let r=i.call(n);if(Object(r)!==r)throw new TypeError(r+" is not an object");return fN(r)&&r.constructor===t?r:new t(a=>r.subscribe(a))}if(Yb("iterator")&&(i=bf(n,sN),i))return new t(r=>{yf(()=>{if(!r.closed){for(let a of i.call(n))if(r.next(a),r.closed)return;r.complete()}})});if(Array.isArray(n))return new t(r=>{yf(()=>{if(!r.closed){for(let a=0;a<n.length;++a)if(r.next(n[a]),r.closed)return;r.complete()}})});throw new TypeError(n+" is not observable")}static of(...n){let t=typeof this=="function"?this:sl;return new t(i=>{yf(()=>{if(!i.closed){for(let r=0;r<n.length;++r)if(i.next(n[r]),i.closed)return;i.complete()}})})}static get[Jb](){return this}};gf.Observable=wf,Object.defineProperty(wf,Symbol("extensions"),{value:{symbol:Bu,hostReportError:oa},configurable:!0});var uN=gf.Observable;const _f=Er(uN);var Qb={exports:{}},Uu={exports:{}},sa=typeof Reflect=="object"?Reflect:null,ey=sa&&typeof sa.apply=="function"?sa.apply:function(n,t,i){return Function.prototype.apply.call(n,t,i)},kf;sa&&typeof sa.ownKeys=="function"?kf=sa.ownKeys:Object.getOwnPropertySymbols?kf=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:kf=function(n){return Object.getOwnPropertyNames(n)};function cN(e){console&&console.warn&&console.warn(e)}var ny=Number.isNaN||function(n){return n!==n};function mn(){mn.init.call(this)}Uu.exports=mn,Uu.exports.once=mN,mn.EventEmitter=mn,mn.prototype._events=void 0,mn.prototype._eventsCount=0,mn.prototype._maxListeners=void 0;var ty=10;function xf(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(mn,"defaultMaxListeners",{enumerable:!0,get:function(){return ty},set:function(e){if(typeof e!="number"||e<0||ny(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ty=e}}),mn.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},mn.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||ny(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function iy(e){return e._maxListeners===void 0?mn.defaultMaxListeners:e._maxListeners}mn.prototype.getMaxListeners=function(){return iy(this)},mn.prototype.emit=function(n){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var r=n==="error",a=this._events;if(a!==void 0)r=r&&a.error===void 0;else if(!r)return!1;if(r){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var f=a[n];if(f===void 0)return!1;if(typeof f=="function")ey(f,this,t);else for(var d=f.length,u=fy(f,d),i=0;i<d;++i)ey(u[i],this,t);return!0};function ry(e,n,t,i){var r,a,o;if(xf(t),a=e._events,a===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit("newListener",n,t.listener?t.listener:t),a=e._events),o=a[n]),o===void 0)o=a[n]=t,++e._eventsCount;else if(typeof o=="function"?o=a[n]=i?[t,o]:[o,t]:i?o.unshift(t):o.push(t),r=iy(e),r>0&&o.length>r&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=n,s.count=o.length,cN(s)}return e}mn.prototype.addListener=function(n,t){return ry(this,n,t,!1)},mn.prototype.on=mn.prototype.addListener,mn.prototype.prependListener=function(n,t){return ry(this,n,t,!0)};function hN(){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 ay(e,n,t){var i={fired:!1,wrapFn:void 0,target:e,type:n,listener:t},r=hN.bind(i);return r.listener=t,i.wrapFn=r,r}mn.prototype.once=function(n,t){return xf(t),this.on(n,ay(this,n,t)),this},mn.prototype.prependOnceListener=function(n,t){return xf(t),this.prependListener(n,ay(this,n,t)),this},mn.prototype.removeListener=function(n,t){var i,r,a,o,s;if(xf(t),r=this._events,r===void 0)return this;if(i=r[n],i===void 0)return this;if(i===t||i.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[n],r.removeListener&&this.emit("removeListener",n,i.listener||t));else if(typeof i!="function"){for(a=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){s=i[o].listener,a=o;break}if(a<0)return this;a===0?i.shift():vN(i,a),i.length===1&&(r[n]=i[0]),r.removeListener!==void 0&&this.emit("removeListener",n,s||t)}return this},mn.prototype.off=mn.prototype.removeListener,mn.prototype.removeAllListeners=function(n){var t,i,r;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[n]),this;if(arguments.length===0){var a=Object.keys(i),o;for(r=0;r<a.length;++r)o=a[r],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=i[n],typeof t=="function")this.removeListener(n,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(n,t[r]);return this};function oy(e,n,t){var i=e._events;if(i===void 0)return[];var r=i[n];return r===void 0?[]:typeof r=="function"?t?[r.listener||r]:[r]:t?pN(r):fy(r,r.length)}mn.prototype.listeners=function(n){return oy(this,n,!0)},mn.prototype.rawListeners=function(n){return oy(this,n,!1)},mn.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):sy.call(e,n)},mn.prototype.listenerCount=sy;function sy(e){var n=this._events;if(n!==void 0){var t=n[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}mn.prototype.eventNames=function(){return this._eventsCount>0?kf(this._events):[]};function fy(e,n){for(var t=new Array(n),i=0;i<n;++i)t[i]=e[i];return t}function vN(e,n){for(;n+1<e.length;n++)e[n]=e[n+1];e.pop()}function pN(e){for(var n=new Array(e.length),t=0;t<n.length;++t)n[t]=e[t].listener||e[t];return n}function mN(e,n){return new Promise(function(t,i){function r(o){e.removeListener(n,a),i(o)}function a(){typeof e.removeListener=="function"&&e.removeListener("error",r),t([].slice.call(arguments))}ly(e,n,a,{once:!0}),n!=="error"&&gN(e,r,{once:!0})})}function gN(e,n,t){typeof e.on=="function"&&ly(e,"error",n,t)}function ly(e,n,t,i){if(typeof e.on=="function")i.once?e.once(n,t):e.on(n,t);else if(typeof e.addEventListener=="function")e.addEventListener(n,function r(a){i.once&&e.removeEventListener(n,r),t(a)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var dy=Uu.exports,uy=dy.EventEmitter,uo={},Ef={};Ef.byteLength=wN,Ef.toByteArray=kN,Ef.fromByteArray=SN;for(var Zt=[],_t=[],bN=typeof Uint8Array<"u"?Uint8Array:Array,zu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fa=0,yN=zu.length;fa<yN;++fa)Zt[fa]=zu[fa],_t[zu.charCodeAt(fa)]=fa;_t[45]=62,_t[95]=63;function cy(e){var n=e.length;if(n%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=n);var i=t===n?0:4-t%4;return[t,i]}function wN(e){var n=cy(e),t=n[0],i=n[1];return(t+i)*3/4-i}function _N(e,n,t){return(n+t)*3/4-t}function kN(e){var n,t=cy(e),i=t[0],r=t[1],a=new bN(_N(e,i,r)),o=0,s=r>0?i-4:i,f;for(f=0;f<s;f+=4)n=_t[e.charCodeAt(f)]<<18|_t[e.charCodeAt(f+1)]<<12|_t[e.charCodeAt(f+2)]<<6|_t[e.charCodeAt(f+3)],a[o++]=n>>16&255,a[o++]=n>>8&255,a[o++]=n&255;return r===2&&(n=_t[e.charCodeAt(f)]<<2|_t[e.charCodeAt(f+1)]>>4,a[o++]=n&255),r===1&&(n=_t[e.charCodeAt(f)]<<10|_t[e.charCodeAt(f+1)]<<4|_t[e.charCodeAt(f+2)]>>2,a[o++]=n>>8&255,a[o++]=n&255),a}function xN(e){return Zt[e>>18&63]+Zt[e>>12&63]+Zt[e>>6&63]+Zt[e&63]}function EN(e,n,t){for(var i,r=[],a=n;a<t;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),r.push(xN(i));return r.join("")}function SN(e){for(var n,t=e.length,i=t%3,r=[],a=16383,o=0,s=t-i;o<s;o+=a)r.push(EN(e,o,o+a>s?s:o+a));return i===1?(n=e[t-1],r.push(Zt[n>>2]+Zt[n<<4&63]+"==")):i===2&&(n=(e[t-2]<<8)+e[t-1],r.push(Zt[n>>10]+Zt[n>>4&63]+Zt[n<<2&63]+"=")),r.join("")}var Wu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Wu.read=function(e,n,t,i,r){var a,o,s=r*8-i-1,f=(1<<s)-1,d=f>>1,u=-7,h=t?r-1:0,v=t?-1:1,m=e[n+h];for(h+=v,a=m&(1<<-u)-1,m>>=-u,u+=s;u>0;a=a*256+e[n+h],h+=v,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=i;u>0;o=o*256+e[n+h],h+=v,u-=8);if(a===0)a=1-d;else{if(a===f)return o?NaN:(m?-1:1)*(1/0);o=o+Math.pow(2,i),a=a-d}return(m?-1:1)*o*Math.pow(2,a-i)},Wu.write=function(e,n,t,i,r,a){var o,s,f,d=a*8-r-1,u=(1<<d)-1,h=u>>1,v=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:a-1,g=i?1:-1,b=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(s=isNaN(n)?1:0,o=u):(o=Math.floor(Math.log(n)/Math.LN2),n*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+h>=1?n+=v/f:n+=v*Math.pow(2,1-h),n*f>=2&&(o++,f/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(n*f-1)*Math.pow(2,r),o=o+h):(s=n*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;e[t+m]=s&255,m+=g,s/=256,r-=8);for(o=o<<r|s,d+=r;d>0;e[t+m]=o&255,m+=g,o/=256,d-=8);e[t+m-g]|=b*128};/*!
|
|
828
828
|
* The buffer module from node.js, for the browser.
|
|
829
829
|
*
|
|
830
830
|
* @author Feross Aboukhadijeh <https://feross.org>
|