@deslop/workbench 0.0.0 → 0.0.275
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/client/assets/{browser-CqyMvHmT.js → browser-CDM4mh5t.js} +1 -1
- package/dist/client/assets/{browser-vjx4dvob.js → browser-DUaXGcgT.js} +2 -2
- package/dist/client/assets/{diff-7RlcQsLM.js → diff-BCr_QDYx.js} +2 -2
- package/dist/client/assets/{diff-CN-cQOfK.js → diff-EoDIt5jN.js} +1 -1
- package/dist/client/assets/{index-n2tpvnZV.js → index-UUAWOdl4.js} +1 -1
- package/dist/client/assets/{route-CqW75mtJ.js → route-DMxzlDqY.js} +2 -2
- package/dist/client/assets/{route-BMT4pSN6.js → route-MqVf7nES.js} +1 -1
- package/dist/client/assets/{state-Bf7INONf.js → state-DfyXvTLb.js} +2 -2
- package/dist/client/assets/terminal-C8OCiIgm.js +2 -0
- package/dist/client/assets/{terminal-Dn4dSuMk.js → terminal-sqa9_A_E.js} +1 -1
- package/dist/client/index.html +5 -5
- package/dist/server.js +1 -1
- package/package.json +14 -13
- package/dist/client/assets/terminal-tg93j6GM.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{o as e,r as t}from"./compiler-runtime-CUwoe8mk.js";import{$ as n,$a as r,$n as i,$r as a,$t as o,A as s,Aa as c,Ai as l,An as u,Ar as d,At as f,B as p,Ba as m,Br as h,Bt as g,Ca as ee,Cn as te,Cr as _,Ct as ne,D as re,Da as ie,Di as v,Dn as ae,Dr as y,Dt as b,E as oe,Ea as se,Ei as ce,En as le,Et as ue,F as de,Fa as fe,Fi as pe,Fr as me,Ft as he,G as ge,Ga as _e,Gi as ve,Gn as ye,Gr as be,Gt as xe,H as x,Ha as Se,Hr as Ce,Ht as we,I as Te,Ia as Ee,Ii as De,Ir as Oe,It as ke,J as Ae,Ja as je,Jn as Me,Jr as Ne,Jt as Pe,Ka as Fe,Kn as Ie,Kr as Le,Kt as Re,L as ze,La as Be,Li as Ve,Lr as He,Lt as Ue,M as We,Ma as Ge,Mi as Ke,Mn as qe,Mr as Je,Mt as Ye,N as Xe,Na as Ze,Ni as Qe,Nn as $e,Nr as et,Nt as tt,Oa as S,Oi as nt,On as rt,Or as it,Ot as at,Pa as ot,Pi as st,Pn as ct,Pr as lt,Pt as C,Q as ut,Qa as dt,Qi as ft,Qn as pt,Qr as mt,Qt as ht,R as gt,Ra as _t,Rr as vt,Rt as yt,S as bt,Sa as xt,Si as St,Sn as w,Sr as Ct,St as wt,T,Ta as Tt,Ti as Et,Tn as Dt,Tr as Ot,Tt as kt,U as At,Ua as jt,Ur as Mt,Ut as Nt,V as Pt,Va as Ft,Vr as It,Vt as Lt,W as Rt,Wa as zt,Wi as Bt,Wn as Vt,Wr as Ht,Wt as Ut,X as Wt,Xa as Gt,Xi as Kt,Xn as qt,Xr as Jt,Xt as Yt,Y as Xt,Ya as Zt,Yi as Qt,Yn as $t,Yr as en,Yt as tn,Z as nn,Za as rn,Zn as an,Zr as on,Zt as sn,_ as cn,_a as ln,_i as un,_n as dn,_o as fn,_r as pn,_t as mn,aa as hn,ai as gn,an as _n,ao as vn,ar as yn,at as bn,b as xn,ba as Sn,bi as Cn,bn as wn,br as Tn,bt as En,ca as Dn,ci as On,cn as kn,co as An,cr as jn,ct as Mn,d as Nn,da as Pn,di as Fn,dn as In,do as Ln,dr as Rn,dt as zn,ei as Bn,en as Vn,eo as Hn,er as Un,et as Wn,f as Gn,fa as Kn,fi as qn,fn as Jn,fo as Yn,fr as Xn,ft as Zn,g as Qn,ga as $n,gi as er,gn as tr,go as nr,gr as rr,gt as ir,h as ar,ha as or,hi as sr,hn as cr,ho as E,hr as lr,ht as ur,ii as dr,in as fr,io as pr,ir as mr,it as hr,j as gr,ja as _r,ji as vr,jn as yr,jr as br,jt as xr,k as Sr,ka as Cr,ki as wr,kn as Tr,kt as Er,li as Dr,ln as D,lo as Or,lr as kr,lt as Ar,m as O,ma as jr,mi as Mr,mn as Nr,mo as Pr,mr as Fr,mt as Ir,ni as Lr,nn as Rr,no as zr,nr as Br,nt as Vr,oi as Hr,on as Ur,oo as Wr,or as Gr,ot as Kr,p as qr,pa as Jr,pi as Yr,pn as Xr,po as k,pr as Zr,pt as Qr,q as $r,qa as ei,qi as ti,qn as ni,qr as ri,qt as ii,ra as ai,ri as oi,rn as si,ro as ci,rr as li,rt as ui,sa as di,si as fi,sn as A,so as pi,sr as mi,st as hi,ta as gi,ti as _i,tn as vi,to as yi,tr as bi,tt as xi,u as Si,ua as Ci,ui as wi,un as j,ur as Ti,ut as Ei,v as Di,va as Oi,vi as ki,vn as Ai,vo as ji,vr as Mi,vt as M,w as N,wa as Ni,wi as Pi,wn as Fi,wr as Ii,wt as Li,x as Ri,xa as zi,xi as Bi,xn as Vi,xr as Hi,xt as P,y as Ui,ya as Wi,yi as Gi,yn as Ki,yr as qi,yt as Ji,z as Yi,za as Xi,zi as Zi,zr as Qi,zt as $i}from"./utils-CC77kD3H.js";var ea=Jt,ta=on,na=Ne,ra=en,ia=_i,aa=mt,oa=oi,sa=Symbol.for(`effect/MutableList/Empty`),ca=()=>({head:void 0,tail:void 0,length:0}),la=()=>({array:[],mutable:!0,offset:0,next:void 0}),ua=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=la(),e.tail=e.tail.next):e.head=e.tail=la(),e.tail.array.push(t),e.length++},da=(e,t)=>fa(e,Qt(t),!Array.isArray(t)),fa=(e,t,n=!1)=>{if(t.length===0)return 0;let r={array:t,mutable:n,offset:0,next:void 0};return e.head?e.tail=e.tail.next=r:e.head=e.tail=r,e.length+=t.length,t.length},pa=e=>{e.head=e.tail=void 0,e.length=0},ma=(e,t)=>{if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return pa(e),t}let n=Array(t),r=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[r++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,r===t)return e.head=i,e.length-=t,e.length===0&&pa(e),n;i=i.next}return pa(e),n},ha=e=>ma(e,e.length),ga=e=>{if(!e.head)return sa;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:pa(e)),t},_a=(e,t)=>{let n=[],r=e.head;for(;r;){for(let e=r.offset;e<r.array.length;e++)t(r.array[e],e)&&n.push(r.array[e]);r=r.next}e.head=e.tail={array:n,mutable:!0,offset:0,next:void 0},e.length=n.length},va=(e,t)=>_a(e,e=>e!==t),ya=`~effect/MutableRef`,ba={[ya]:ya,...Ge,toJSON(){return{_id:`MutableRef`,current:Se(this.current)}}},xa=e=>{let t=Object.create(ba);return t.current=e,t},Sa=k(2,(e,t)=>(e.current=t,e)),Ca=`~effect/PubSub/Subscription`,wa=k(2,(e,t)=>e.shutdownFlag.current?!1:e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),!0):!1),Ta=e=>Ai(Qr(t=>{let n=l(t,li),r=mi(e.scope),i=ka(e.pubsub,e.subscribers,e.strategy);return mr(r,Ea(i)).pipe(ui(yn(n,e=>Gr(r,e))),bn(i))})),Ea=e=>Ai(Dt(t=>(Sa(e.shutdownFlag,!0),wt(ha(e.pollers),e=>Fr(e,t.id),{discard:!0,concurrency:`unbounded`}).pipe(In(()=>j(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),te(e.shutdownHook.open),Kr)))),Da=e=>D(function t(n){if(e.shutdownFlag.current)return Er;let r=e.pollers.length===0?e.subscription.pollUpTo(1/0):[];return n&&(r=n.concat(r)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?A(e.replayWindow.takeAll().concat(r)):Kt(r)?A(r):M(Oa(e),e=>t([e]))}),Oa=e=>{let t=rr(),n=e.subscribers.get(e.subscription);return n||(n=new Set,e.subscribers.set(e.subscription,n)),n.add(e.pollers),ua(e.pollers,t),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),we(Xn(t),()=>(va(e.pollers,t),w))},ka=(e,t,n)=>new Aa(e,t,e.subscribe(),ca(),oa(!1),xa(!1),n,e.replayWindow()),Aa=class{[Ca]={_A:E};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;constructor(e,t,n,r,i,a,o,s){this.pubsub=e,this.subscribers=t,this.subscription=n,this.pollers=r,this.shutdownHook=i,this.shutdownFlag=a,this.strategy=o,this.replayWindow=s}pipe(){return fn(this,arguments)}},ja=`~effect/Queue`,Ma=`~effect/Queue/Enqueue`,Na=`~effect/Queue/Dequeue`,Pa={_A:E,_E:E},Fa={[ja]:Pa,[Ma]:Pa,[Na]:Pa,...Ge,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:Xa(this)}}},Ia=e=>_t(t=>{let n=Object.create(Fa);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=ca(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},gn(n)}),La=e=>Ia({capacity:e}),Ra=(e,t)=>fi(()=>{if(e.state._tag!==`Open`)return Za;if(e.messages.length>=e.capacity)switch(e.strategy){case`dropping`:return Za;case`suspend`:return e.capacity<=0&&e.state.takers.size>0?(ua(e.messages,t),to(e),Qa):io(e,t);case`sliding`:return ga(e.messages),ua(e.messages,t),Qa}return ua(e.messages,t),no(e),Qa}),za=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(ga(e.messages),ua(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0?(ua(e.messages,t),to(e),!0):!1:(ua(e.messages,t),no(e),!0):!1,Ba=(e,t)=>fi(()=>{if(e.state._tag!==`Open`)return gn(Qt(t));let n=Va(e,t);return n.length===0?Ee([]):e.strategy===`dropping`?gn(n):ao(e,n)}),Va=(e,t)=>{if(e.state._tag!==`Open`)return Qt(t);if(e.capacity===1/0||e.strategy===`sliding`)return da(e.messages,t),e.strategy===`sliding`&&ma(e.messages,e.messages.length-e.capacity),no(e),[];let n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return Qt(t);let r=[],i=0;for(let a of t)i<n?ua(e.messages,a):r.push(a),i++;return no(e),r},Ha=k(2,(e,t)=>On(()=>Ua(e,t))),Ua=(e,t)=>{if(e.state._tag!==`Open`)return!1;let n=ri(fe(t),$a);return e.state.offers.size===0&&e.messages.length===0?(co(e,n),!0):(e.state={...e.state,_tag:`Closing`,exit:n},!0)},Wa=e=>Ha(e,Ze(_r())),Ga=e=>On(()=>{if(e.state._tag===`Done`)return!0;pa(e.messages);let t=e.state.offers;if(co(e,e.state._tag===`Open`?eo:e.state.exit),t.size>0){for(let e of t)e._tag===`Single`?e.resume(Za):e.resume(Ee(e.remaining.slice(e.offset)));t.clear()}return!0}),Ka=e=>qa(e,1,1/0),qa=(e,t,n)=>fi(()=>ro(e,t,n)??Ce(so(e),qa(e,1,n))),Ja=e=>fi(()=>Ya(e)??Ce(so(e),Ja(e))),Ya=e=>{if(e.state._tag===`Done`)return e.state.exit;if(e.messages.length>0){let t=ga(e.messages);return oo(e),Ee(t)}else if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,oo(e),e.capacity=0;let t=ga(e.messages);return oo(e),Ee(t)}},Xa=e=>e.state._tag===`Done`?0:e.messages.length,Za=Ee(!1),Qa=Ee(!0),$a=ot(_r()),eo=be(),to=e=>{if(e.scheduleRunning=!1,!(e.state._tag===`Done`||e.state.takers.size===0)){for(let t of e.state.takers)if(e.state.takers.delete(t),t(Le),e.messages.length===0)break}},no=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>to(e),0))},ro=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return Ee([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,oo(e),e.capacity=0;let t=[ga(e.messages)];return oo(e),Ee(t)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let t=ma(e.messages,n);return oo(e),Ee(t)}},io=(e,t)=>Ht(n=>{if(e.state._tag!==`Open`)return n(Za);let r={_tag:`Single`,message:t,resume:n};return e.state.offers.add(r),On(()=>{e.state._tag===`Open`&&e.state.offers.delete(r)})}),ao=(e,t)=>Ht(n=>{if(e.state._tag!==`Open`)return n(Ee(t));let r={_tag:`Array`,remaining:t,offset:0,resume:n};return e.state.offers.add(r),On(()=>{e.state._tag===`Open`&&e.state.offers.delete(r)})}),oo=e=>{if(e.state._tag===`Done`)return ct(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0?(co(e,e.state.exit),ct(e.state.exit.cause)):!1;let t=e.capacity-e.messages.length;for(let n of e.state.offers)if(t===0)break;else if(n._tag===`Single`)ua(e.messages,n.message),t--,n.resume(Qa),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;ua(e.messages,n.remaining[n.offset]),t--}n.resume(Ee([])),e.state.offers.delete(n)}return!1},so=e=>Ht(t=>e.state._tag===`Done`?t(e.state.exit):(e.state.takers.add(t),On(()=>{e.state._tag!==`Done`&&e.state.takers.delete(t)}))),co=(e,t)=>{if(e.state._tag===`Done`)return;let n=e.state;e.state={_tag:`Done`,exit:t};for(let e of n.takers)e(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},lo=e=>new uo(e),uo=class{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){let t=fi(()=>this.free<e?Ht(n=>{if(this.free>=e)return n(t);let r=()=>{this.free<e||(this.waiters.delete(r),n(t))};return this.waiters.add(r),On(()=>{this.waiters.delete(r)})}):(this.taken+=e,gn(e)));return t}updateTakenUnsafe(e,t){return this.taken=t(this.taken),this.waiters.size>0&&e.currentDispatcher.scheduleTask(()=>{let e=this.waiters.values(),t=e.next();for(;t.done===!1&&this.free>0;)t.value(),t=e.next()},0),this.free}updateTaken(e){return _t(t=>gn(this.updateTakenUnsafe(t,e)))}resize(e){return _t(t=>(this.permits=e,this.free<0||this.updateTakenUnsafe(t,e=>e),wi))}release(e){return this.updateTaken(t=>t-e)}get releaseAll(){return this.updateTaken(e=>0)}withPermits(e){return t=>Dr(n=>a(n(this.take(e)),e=>dr(n(t),()=>{this.updateTakenUnsafe(_i(),t=>t-e)},!0)))}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>Dr(n=>this.free<e?Hr:(this.taken+=e,dr(n(Mt(t)),()=>{this.updateTakenUnsafe(_i(),t=>t-e)},!0)))}},fo=`~effect/Channel`,po=e=>pr(e,fo),mo={[fo]:{_Env:E,_InErr:E,_InElem:E,_OutErr:E,_OutElem:E},pipe(){return fn(this,arguments)}},ho=e=>{let t=Object.create(mo);return t.transform=(t,n)=>Ar(e(t,n),e=>A(mn(e))),t},go=(e,t)=>ho((n,r)=>M(yo(e)(n,r),e=>t(e,r))),_o=e=>ho((t,n)=>e),vo=e=>ho(P(function*(t,n){let r=mi(n),i=e=>Gr(r,$e(e));return g(yield*g(e(t,n,r),i),i)})),yo=e=>e.transform,bo=(e,t,n)=>Ia({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(In(t=>mr(e,Ga(t))),In(n=>kt(kr(t(n),e),e))),xo=(e,t)=>ho((n,r)=>C(bo(r,e,t),Ka)),So=e=>ho((t,n)=>D(()=>yo(e())(t,n))),Co=_o(A(d())),wo=e=>_o(A(ir(e))),To=e=>_o(A(Ka(e))),Eo=e=>_o(A(we(Da(e),()=>d()))),Do=e=>Fo(C(Ta(e),Eo)),Oo=k(2,(e,t)=>go(e,e=>j(()=>{let n=0;return C(e,e=>t(e,n++))}))),ko=e=>e===void 0||e!==`unbounded`&&e<=1,Ao=k(e=>po(e[0]),(e,t,n)=>ko(n?.concurrency)?jo(e,t):Mo(e,t,n)),jo=(e,t)=>ho((n,r)=>{let i=0;return C(yo(e)(n,r),M(e=>t(e,i++)))}),Mo=(e,t,n)=>vo(P(function*(r,i,a){let o=0,s=yield*yo(e)(r,i),c=n.concurrency===`unbounded`?2**53-1:n.concurrency,l=yield*La(0);yield*mr(a,Ga(l));let u=ht(yield*Zn()),d=aa(a);if(n.unordered){let e=lo(c),n=Yn(e.release(1)),r=yt({onFailure:e=>M(Ha(l,e),n),onSuccess:e=>M(Ra(l,e),n)});yield*e.take(1).pipe(M(()=>s),M(e=>(d(u(r(t(e,o++)))),w)),ne({disableYield:!0}),Ar(t=>e.withPermits(c-1)(Ha(l,t))),kt(a))}else{let e=yield*La(c-2);yield*mr(a,Ga(l)),yield*Ja(e).pipe(En,M(e=>Ra(l,e)),ne({disableYield:!0}),Ar(e=>Ha(l,e)),kt(a));let n,r=e=>{e._tag!==`Success`&&(n=e.cause,Ua(l,e.cause))};yield*s.pipe(M(i=>{if(n)return mn(n);let a=u(t(i,o++));return d(a),a.addObserver(r),Ra(e,ea(a))}),ne({disableYield:!0}),Ar(t=>Ra(e,qi(t)).pipe(ui(Ha(e,t)))),kt(a))}return Ja(l)})),No=e=>go(e,e=>{let t,n=0;return A(D(function r(){if(t===void 0)return M(e,e=>{switch(e.length){case 0:return r();case 1:return A(e[0]);default:return t=e,A(e[n++])}});let i=t[n++];return n>=t.length&&(t=void 0,n=0),A(i)}))}),Po=k(2,(e,t)=>go(e,e=>A(M(e,function n(r){let i=[];for(let e=0;e<r.length;e++)t(r[e])&&i.push(r[e]);return ft(i)?A(i):M(e,n)})))),Fo=e=>ho((t,n)=>{let r;return A(D(()=>r||e.pipe(kr(n),M(e=>yo(e)(t,n)),M(e=>r=e))))}),Io=k(2,(e,t)=>vo((n,r,i)=>yn(i,t).pipe(ui(yo(e)(n,r))))),Lo=k(2,(e,t)=>Io(e,e=>t)),Ro=(e,t,n)=>D(()=>{let r=jn();return qe(M(yo(e)(d(),r),t),n||A).pipe(Lt(e=>Gr(r,e)))}),zo=k(2,(e,t)=>ho((n,r)=>C(Re(yo(e)(n,r),t),Re(t)))),Bo=k(2,(e,t)=>Ro(e,e=>ne(M(e,t),{disableYield:!0}))),Vo=P(function*(e){let t=lo(1),n=yield*Zn(),r=l(n,li);return(yield*yo(e)(d(),r)).pipe(Re(n),t.withPermits(1))},Ar(e=>A(mn(e)))),Ho=(e,t)=>yo(e)(d(),t),Uo=`~effect/Stream`,Wo={_R:E,_E:E,_A:E},Go={[Uo]:Wo,pipe(){return fn(this,arguments)}},Ko=e=>{let t=Object.create(Go);return t.channel=e,t},qo=`~effect/Sink`,Jo={_A:E,_In:E,_L:E,_E:E,_R:E},Yo={[qo]:Jo,pipe(){return fn(this,arguments)}},Xo=e=>{let t=Object.create(Yo);return t.transform=e,t},Zo=e=>Xo(t=>{let n=[];if(e<=0)return A([n]);let r;return t.pipe(M(t=>{if(n.length+t.length<=e)return n.push(...t),n.length===e?d():w;for(let i=0;i<t.length;i++)if(n.push(t[i]),n.length===e)return i+1<t.length&&(r=t.slice(i+1)),d();return w}),ne({disableYield:!0}),qe(()=>A([n,r])))}),Qo=`~effect/collections/MutableHashMap`,$o={[Qo]:Qo,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${zt(Array.from(this))})`},toJSON(){return{_id:`MutableHashMap`,values:Se(Array.from(this))}},[Ft](){return this.toJSON()},pipe(){return fn(this,arguments)}},es=()=>{let e=Object.create($o);return e.backing=new Map,e.buckets=new Map,e},ts=k(2,(e,t)=>{if(e.backing.has(t))return c(e.backing.get(t));if(rs(t))return S();let n=ns.get(e);if(n!==void 0)return e.backing.has(n)?c(e.backing.get(n)):S();let r=Hn(t),i=e.buckets.get(r);return i===void 0?S():is(e,i,t)}),ns=new WeakMap,rs=e=>typeof e!=`object`&&typeof e!=`function`,is=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(Gt(n,t[r])){let i=t[r];return ns.set(n,i),c(e.backing.get(i))}return S()},as=k(3,(e,t,n)=>{if(e.backing.has(t)||rs(t))return e.backing.set(t,n),e;let r=ns.get(e);if(r!==void 0&&e.backing.has(r))return e.backing.set(r,n),e;let i=Hn(t),a=e.buckets.get(i);return a===void 0?(e.buckets.set(i,[t]),e.backing.set(t,n),e):(r=os(a,t),r===void 0&&(a.push(t),r=t),e.backing.set(r,n),e)}),os=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(Gt(t,e[n]))return ns.set(t,e[n]),e[n]},ss=k(2,(e,t)=>{if(rs(t))return e.backing.delete(t),e;let n=ns.get(e)??t,r=Hn(n),i=e.buckets.get(r);if(i===void 0)return e;for(let t=0,r=i.length;t<r;t++){let r=i[t];if(r===n||Gt(n,r)){e.backing.delete(r),i.splice(t,1);break}}return i.length===0&&e.buckets.delete(r),e}),cs=`~effect/Stream`,ls=e=>pr(e,cs),us=Ko,ds=e=>e.channel,fs=(e,t)=>us(xo(e,t)),ps=us(Co),ms=e=>us(So(()=>e().channel)),hs=e=>us(wo(e)),gs=e=>us(To(e)),_s=e=>us(Do(e)),vs=e=>us(ho(P(function*(t,n){let r=e.evaluate().getReader();return yield*mr(n,e.releaseLockOnEnd?j(()=>r.releaseLock()):Ut(()=>r.cancel())),M(tr({try:()=>r.read(),catch:t=>e.onError(t)}),({done:e,value:t})=>e?d():A(hn(t)))}))),ys=e=>us(Fo(C(e,ds))),bs=k(e=>ls(e[0]),(e,t,n)=>e.channel.pipe(No,Ao(t,n),Oo(hn),us)),xs=k(2,(e,t)=>us(Po(ds(e),t))),Ss=k(3,(e,t,n)=>Cs(e,Zo(t),u(n))),Cs=k(3,(e,t,n)=>us(vo(P(function*(r,i,a){let o=yield*Ho(e.channel,i),s=oa(!1),l=Symbol(),u=yield*Ia({capacity:0});yield*o.pipe(s.whenOpen,M(e=>(s.closeUnsafe(),Ra(u,e))),ne,Ar(e=>Ha(u,e)),kt(a));let f=S(),p,m=!1,h=yield*yr(n),g=D(function e(){return h(f).pipe(M(()=>m?Ra(u,l):e()),M(()=>$i),qe(()=>d()))}),ee=Ja(u).pipe(M(e=>e===l?d():(m=!0,A(e)))),te=D(()=>{if(p!==void 0){let e=p;return p=void 0,m=!0,A(e)}return s.openUnsafe(),ee}),_=M(([e,t])=>!m&&u.state._tag===`Done`?d():(f=c(e),p=t,A(hn(e))));return D(()=>u.state._tag===`Done`&&p===void 0?u.state.exit:(m=p!==void 0,A(D(()=>t.transform(te,a))))).pipe(M(e=>Pe(_(e),g)))})))),ws=k(2,(e,t)=>us(Lo(e.channel,t))),Ts=k(2,(e,t)=>us(zo(e.channel,t))),Es=k(2,(e,t)=>Bo(e.channel,t)),Ds=e=>Vo(e.channel),Os=k(e=>ls(e[0]),(e,t,n)=>{let r,i,a=oa(!1);return new ReadableStream({start(n){i=sn(Re(Es(e,e=>a.whenOpen(j(()=>{a.closeUnsafe();for(let t=0;t<e.length;t++)n.enqueue(e[t]);r(),r=void 0}))),t)),i.addObserver(e=>{e._tag===`Failure`?n.error(h(e.cause)):n.close()})},pull(){return new Promise(e=>{r=e,a.openUnsafe()})},cancel(){if(i)return o(Kr(na(i)))}},n?.strategy)}),ks=k(e=>ls(e[0]),(e,t)=>C(Zn(),n=>Os(e,n,t))),As=e(t(),1),js=e(ji(),1);function Ms(e){return{_tag:`Value`,value:e}}function Ns(e,t){return{_tag:`Record`,keys:e,value:t}}function Ps(e,t){return{_tag:`Array`,length:e,value:t}}y(`SourceError`);var Fs=ce(`effect/ConfigProvider`,{defaultValue:()=>Hs()}),Is={...Ge,toJSON(){return{_id:`ConfigProvider`}}};function Ls(e,t,n){let r=Object.create(Is);return r.get=e,r.mapInput=t,r.prefix=n,r.load=r=>(t&&(r=t(r)),n&&(r=[...n,...r]),e(r)),r}var Rs=e=>xr(e)?Ie(Fs)(e):bi(Fs)(e);function zs(e){return Ls(t=>A(Bs(e,t)))}function Bs(e,t){let n=e;for(let e of t){if(n==null)return;if(Array.isArray(n)){if(typeof e!=`number`||!Number.isInteger(e)||e<0||e>=n.length)return;n=n[e];continue}if(Wr(n)){if(typeof e!=`string`||!Object.hasOwn(n,e))return;n=n[e];continue}return}return Vs(n)}function Vs(e){if(e!=null)return typeof e==`string`?Ms(e):typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`?Ms(String(e)):Array.isArray(e)?Ps(e.length):Wr(e)?Ns(new Set(Object.keys(e))):Ms(zt(e))}function Hs(e){let t=e?.env??{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_INLINE_CSS_ENABLED:`false`,VITE_OTEL_URL:`http://localhost:27686/v1/traces`},n=Us(t);return Ls(e=>A(Gs(n,t,e)))}function Us(e){let t={};for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let e=n.split(`_`),i=t;for(let t of e)i.children??={},i=i.children[t]??={};i.value=r}return t}var Ws=/^(0|[1-9][0-9]*)$/;function Gs(e,t,n){let r=t[n.map(String).join(`_`)],i=Ks(e,n),a=i?.children?Object.keys(i.children):[];return a.length===0?r===void 0?void 0:Ms(r):a.every(e=>Ws.test(e))?Ps(Math.max(...a.map(e=>parseInt(e,10)))+1,r):Ns(new Set(a),r)}function Ks(e,t){if(t.length===0)return e;let n=e;for(let e of t)if(n=n?.children?.[String(e)],!n)return;return n}var qs=`~effect/Config`,Js=class{_tag=`ConfigError`;name=`ConfigError`;cause;constructor(e){this.cause=e}get message(){return this.cause.toString()}toString(){return`ConfigError(${this.message})`}},Ys={...De({label:`Config`,evaluate(e){return this.parse(e.getRef(Fs))}}),[qs]:qs,toJSON(){return{_id:`Config`}}};function Xs(e){let t=Object.create(Ys);return t.parse=e,t}var Zs=k(2,(e,t)=>Xs(n=>C(e.parse(n),t))),Qs=k(2,(e,t)=>Xs(n=>zn(e.parse(n),e=>t(e).parse(n))));function $s(e){switch(e._tag){case`MissingKey`:return!0;case`InvalidType`:case`InvalidValue`:return Ni(e.actual)||Tt(e.actual)&&e.actual.value===void 0;case`OneOf`:return e.actual===void 0;case`Encoding`:return Ni(e.actual)||Tt(e.actual)&&e.actual.value===void 0?!0:$s(e.issue);case`Pointer`:case`Filter`:return $s(e.issue);case`UnexpectedKey`:return!1;case`Forbidden`:return!1;case`Composite`:case`AnyOf`:return e.issues.every($s)}}var ec=k(2,(e,t)=>Qs(e,e=>{if(Yi(e.cause)){let n=e.cause.issue;if($s(n))return oc(t)}return ac(e.cause)})),tc=e=>e.pipe(Zs(c),ec(S())),nc=P(function*(e,t){let n=yield*e.load(t);if(n!==void 0)switch(n._tag){case`Value`:return n.value;case`Record`:{if(n.value!==void 0)return n.value;let r={};for(let i of n.keys){let n=yield*nc(e,[...t,i]);n!==void 0&&(r[i]=n)}return r}case`Array`:{if(n.value!==void 0)return n.value;let r=[];for(let i=0;i<n.length;i++)r.push(yield*nc(e,[...t,i]));return r}}}),rc=P(function*(e,t,n){switch(e._tag){case`Objects`:{let r={};for(let i of e.propertySignatures){let e=i.name;if(typeof e==`string`){let a=yield*rc(i.type,t,[...n,e]);a!==void 0&&(r[e]=a)}}if(e.indexSignatures.length>0){let i=yield*t.load(n);if(i&&i._tag===`Record`)for(let a of e.indexSignatures){let e=Ae(a.parameter);for(let o of i.keys)if(!Object.hasOwn(r,o)&&e(o)){let e=yield*rc(a.type,t,[...n,o]);e!==void 0&&(r[o]=e)}}}return r}case`Arrays`:{let r=yield*t.load(n);if(r&&r._tag===`Value`)return r.value;let i=[];for(let r=0;r<e.elements.length;r++)i.push(yield*rc(e.elements[r],t,[...n,r]));return i}case`Union`:return yield*nc(t,n);case`Suspend`:return yield*rc(e.thunk(),t,n);default:{let e=yield*t.load(n);return e===void 0?void 0:e._tag===`Value`||e._tag===`Record`&&e.value!==void 0||e._tag===`Array`&&e.value!==void 0?e.value:void 0}}});function ic(e,t){let n=ge(e),r=Xt(n),i=Wt(n.ast),a=typeof t==`string`?[t]:t??[];return Xs(e=>{let t=e.prefix?[...e.prefix,...a]:a;return rc(i,e,a).pipe(Ji(e=>r(e).pipe(Ue(e=>new $r(t.length>0?new Wn(t,e):e)))),Ue(e=>new Js(e)))})}function ac(e){return Xs(()=>ir(new Js(e)))}function oc(e){return Xs(()=>A(e))}function sc(e){return ic(N,e)}var cc=`~effect/SubscriptionRef`,lc=e=>pr(e,cc);({...Ge});var uc=e=>_s(e.pubsub),dc=e=>j(()=>e.value),fc=(e,t)=>{e.value=t,wa(e.pubsub,t)},pc=k(2,(e,t)=>e.semaphore.withPermit(j(()=>fc(e,t)))),mc=class extends v()(`effect/reactivity/Reactivity`){},hc=j(()=>{let e=new Map,t=t=>{xc(t,t=>{let n=e.get(t);n!==void 0&&n.forEach(e=>e())})},n=e=>Qr(n=>{let r=n.mapUnsafe.get(gc.key);return r?xc(e,e=>{r.add(e)}):t(e),w}),r=(e,t)=>In(t,n(e)),i=(t,n)=>{let r=[];return xc(t,t=>{r.push(t);let i=e.get(t);i===void 0&&(i=new Set,e.set(t,i)),i.add(n)}),()=>{for(let t=0;t<r.length;t++){let i=e.get(r[t]);i.delete(n),i.size===0&&e.delete(r[t])}}},a=(e,t)=>b(function*(){let n=yield*Zn(),r=l(n,li),a=yield*Ia(),o=Pr(ht(n),aa(r)),s=!1,c=!1,u=e=>{e._tag===`Failure`?Ua(a,e.cause):za(a,e.value),c?(c=!1,o(t).addObserver(u)):s=!1};function d(){if(s){c=!0;return}s=!0,o(t).addObserver(u)}return yield*mr(r,j(i(e,d))),d(),a});return mc.of({mutation:r,query:a,stream:(e,t)=>a(e,t).pipe(C(gs),ys),invalidateUnsafe:t,invalidate:n,registerUnsafe:i,withBatch:t=>D(()=>{let n=new Set;return t.pipe(ii(gc,n),Lt(t=>j(()=>{n.forEach(t=>{let n=e.get(t);n!==void 0&&n.forEach(e=>e())})})))})})}),gc=class extends v()(`effect/reactivity/Reactivity/PendingInvalidation`){},_c=k(2,(e,t)=>mc.use(n=>n.mutation(t,e))),vc=e=>mc.use(t=>t.invalidate(e)),yc=Ie(mc)(hc);function bc(e){switch(typeof e){case`string`:case`number`:case`bigint`:case`boolean`:return String(e);default:return Hn(e)}}var xc=(e,t)=>{if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(bc(e[n]));return}for(let n in e){t(n);let r=e[n];for(let e=0;e<r.length;e++)t(`${n}:${bc(r[e])}`)}},Sc=`~effect/reactivity/AsyncResult`,Cc=e=>pr(e,Sc),wc={[Sc]:{E,A:E},pipe(){return fn(this,arguments)},[rn](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case`Initial`:return!0;case`Success`:return Gt(this.value,e.value);case`Failure`:return Gt(this.cause,e.cause)}},[ci](){let e=yi(`${this._tag}:${this.waiting}`);return this._tag===`Initial`?e:r(e)(this._tag===`Success`?Hn(this.value):Hn(this.cause))}},Tc=(e,t)=>e._tag===`Success`?Ac(e.value):Nc(e.cause,{previous:t}),Ec=e=>e._tag===`None`?Oc(!0):Fc(e.value),Dc=e=>e._tag!==`Initial`,Oc=(e=!1)=>{let t=Object.create(wc);return t._tag=`Initial`,t.waiting=e,t},kc=e=>e._tag===`Success`,Ac=(e,t)=>{let n=Object.create(wc);return n._tag=`Success`,n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},jc=e=>e._tag===`Failure`,Mc=(e,t)=>{let n=Object.create(wc);return n._tag=`Failure`,n.cause=e,n.previousSuccess=t?.previousSuccess??S(),n.waiting=t?.waiting??!1,n},Nc=(e,t)=>Mc(e,{previousSuccess:Oi(t.previous,e=>kc(e)?c(e):jc(e)?e.previousSuccess:S()),waiting:t.waiting}),Pc=(e,t)=>Nc(br(e),t),Fc=(e,t)=>{if(e.waiting)return t?.touch?Ic(e):e;let n=Object.assign(Object.create(wc),e);return n.waiting=!0,t?.touch&&kc(n)&&(n.timestamp=Date.now()),n},Ic=e=>kc(e)?Ac(e.value,{waiting:e.waiting}):e,Lc=(e,t)=>e._tag===`Failure`?Nc(e.cause,{previous:t,waiting:e.waiting}):e,Rc=e=>e._tag===`Success`?c(e.value):e._tag===`Failure`?se(e.previousSuccess,e=>e.value):S(),zc=e=>xt(Rc(e),()=>new it(`AsyncResult.getOrThrow: no value found`)),Bc=e=>{switch(e._tag){case`Success`:return Ii(e.value);case`Failure`:return qi(e.cause);default:return Mi(new it)}},Vc=e=>{let t=e.success??Ui,r=e.error??Ui,i=We()([t,Gn(r,O)],([e,t])=>(r,i,a)=>{if(!Cc(r))return ir(new n(i,c(r)));switch(r._tag){case`Initial`:return A(r);case`Success`:return he(Xt(e)(r.value,a),{onSuccess:e=>Ac(e,r),onFailure:e=>new ut(i,c(r),[new Wn([`value`],e)])});case`Failure`:{let n=r.previousSuccess.pipe(se(t=>he(Xt(e)(t.value,a),{onSuccess:e=>c(Ac(e,t)),onFailure:e=>new ut(i,c(r),[new Wn([`previousSuccess`,`value`],e)])})),zi(()=>kn)),o=Ue(Xt(t)(r.cause,a),e=>new ut(i,c(r),[new Wn([`cause`],e)]));return Ji(n,e=>ke(o,t=>Mc(t,{previousSuccess:e,waiting:r.waiting})))}}},{expected:`AsyncResult`,toCodec([e,t]){let n=re(`Success`,{value:e,waiting:Nn,timestamp:Ri});return p()(Sr([re(`Initial`,{waiting:Nn}),n,re(`Failure`,{cause:t,previousSuccess:bt(n),waiting:Nn})]),nn({decode:e=>{switch(e._tag){case`Initial`:return Oc(e.waiting);case`Success`:return Ac(e.value,{waiting:e.waiting,timestamp:e.timestamp});case`Failure`:return Mc(e.cause,{previousSuccess:se(e.previousSuccess,e=>Ac(e.value,e)),waiting:e.waiting})}},encode(e){switch(e._tag){case`Initial`:return{_tag:`Initial`,waiting:e.waiting};case`Success`:return{_tag:`Success`,value:e.value,waiting:e.waiting,timestamp:e.timestamp};case`Failure`:return{_tag:`Failure`,cause:e.cause,previousSuccess:e.previousSuccess,waiting:e.waiting}}}}))},toEquivalence:Zt,toFormatter:([e,t])=>n=>{switch(n._tag){case`Success`:return`AsyncResult.Success(${e(n.value)}, ${n.waiting}, ${n.timestamp})`;case`Failure`:return`AsyncResult.Failure(${t(n.cause)}, ${n.waiting})`;case`Initial`:return`AsyncResult.Initial(${n.waiting}, ${n.waiting})`}}});return Object.assign(i,{success:t,error:r})},Hc=`~effect/reactivity/AtomRegistry`,Uc=e=>pr(e,Hc),Wc=e=>new Zc(e?.initialValues,e?.scheduleTask,e?.timeoutResolution,e?.defaultIdleTTL),Gc=v(Hc),Kc=k(e=>Uc(e[0]),(e,t,n)=>{let r=n?.suspendOnWaiting??!1;return Mn(n=>{let i=e.get(t);if(i._tag!==`Initial`&&!(r&&i.waiting))return n(Bc(i));let a=e.subscribe(t,e=>{e._tag!==`Initial`&&!(r&&e.waiting)&&(n(Bc(e)),a())});return j(a)})}),qc={immediate:!0},Jc=e=>{e()},Yc=`~effect-atom/atom/Atom/Serializable`,Xc=e=>Yc in e?e[Yc].key:e,Zc=class{[Hc];timeoutResolution;defaultIdleTTL;scheduler;schedulerAsync;dispatcher;onNodeAdded;onNodeRemoved;constructor(e,t,n,r){if(this[Hc]=Hc,this.scheduler=new er(`sync`,t),this.schedulerAsync=new er(`async`,t),this.dispatcher=this.schedulerAsync.makeDispatcher(),this.defaultIdleTTL=r,n===void 0&&r!==void 0?this.timeoutResolution=Math.round(r/2):this.timeoutResolution=n??1e3,e!==void 0)for(let[t,n]of e){let e=t;for(;e.initialValueTarget;)e=e.initialValueTarget;this.ensureNode(e).setInitialValue(n)}}nodes=new Map;preloadedSerializable=new Map;timeoutBuckets=new Map;nodeTimeoutBucket=new Map;disposed=!1;getNodes(){return this.nodes}get(e){return this.ensureNode(e).value()}set(e,t){e.write(this.ensureNode(e).writeContext,t)}setSerializable(e,t){this.preloadedSerializable.set(e,t)}modify(e,t){let n=this.ensureNode(e),r=t(n.value());return e.write(n.writeContext,r[1]),r[0]}update(e,t){let n=this.ensureNode(e);e.write(n.writeContext,t(n.value()))}refresh=e=>{e.refresh===void 0?this.invalidateAtom(e):e.refresh(this.refresh)};subscribe(e,t,n){let r=this.ensureNode(e);n?.immediate&&t(r.value());let i=r.subscribe(function(){t(r._value)});return()=>{i(),r.canBeRemoved&&this.scheduleNodeRemoval(r)}}mount(e){return this.subscribe(e,Ln,qc)}atomHasTtl(e){return!e.keepAlive&&e.idleTTL!==0&&(e.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(e){let t=Xc(e),n=this.nodes.get(t);if(n===void 0?(n=this.createNode(e),this.nodes.set(t,n),this.onNodeAdded?.(n)):this.atomHasTtl(e)&&this.removeNodeTimeout(n),typeof t==`string`&&this.preloadedSerializable.has(t)){let r=this.preloadedSerializable.get(t);this.preloadedSerializable.delete(t);let i=e[Yc].decode(r);n.setValue(i)}return n}createNode(e){if(this.disposed)throw Error(`Cannot access Atom ${e}: registry is disposed`);return e.keepAlive||this.scheduleAtomRemoval(e),new $c(this,e)}invalidateAtom=e=>{this.ensureNode(e).invalidate()};scheduleAtomRemoval(e){this.dispatcher.scheduleTask(()=>{let t=this.nodes.get(Xc(e));t!==void 0&&t.canBeRemoved&&this.removeNode(t)},0)}scheduleNodeRemoval(e){this.dispatcher.scheduleTask(()=>{e.canBeRemoved&&this.removeNode(e)},0)}removeNode(e){this.atomHasTtl(e.atom)?this.setNodeTimeout(e):(this.nodes.delete(Xc(e.atom)),e.remove(),this.onNodeRemoved?.(e))}setNodeTimeout(e){if(this.nodeTimeoutBucket.has(e))return;let t=e.atom.idleTTL??this.defaultIdleTTL;if(this.#e!==null&&(t-=this.#e,t<=0)){this.nodes.delete(Xc(e.atom)),e.remove(),this.onNodeRemoved?.(e);return}let n=Math.ceil(t/this.timeoutResolution)*this.timeoutResolution,r=Date.now()+n,i=r-r%this.timeoutResolution+this.timeoutResolution,a=this.timeoutBuckets.get(i);a===void 0&&(a=[new Set,setTimeout(()=>this.sweepBucket(i),i-Date.now())],this.timeoutBuckets.set(i,a)),a[0].add(e),this.nodeTimeoutBucket.set(e,i)}removeNodeTimeout(e){let t=this.nodeTimeoutBucket.get(e);if(t===void 0)return;this.nodeTimeoutBucket.delete(e),this.scheduleNodeRemoval(e);let[n,r]=this.timeoutBuckets.get(t);n.delete(e),n.size===0&&(clearTimeout(r),this.timeoutBuckets.delete(t))}#e=null;sweepBucket(e){let t=this.timeoutBuckets.get(e)[0];this.timeoutBuckets.delete(e),t.forEach(e=>{this.nodeTimeoutBucket.delete(e),e.canBeRemoved&&(this.nodes.delete(Xc(e.atom)),this.onNodeRemoved?.(e),this.#e=e.atom.idleTTL??this.defaultIdleTTL,e.remove(),this.#e=null)})}reset(){this.timeoutBuckets.forEach(([,e])=>clearTimeout(e)),this.timeoutBuckets.clear(),this.nodeTimeoutBucket.clear(),this.nodes.forEach(e=>{e.remove(),this.onNodeRemoved?.(e)}),this.nodes.clear()}dispose(){this.disposed=!0,this.reset()}},Qc={alive:1,initialized:2,waitingForValue:4},F={uninitialized:Qc.alive|Qc.waitingForValue,stale:Qc.alive|Qc.initialized|Qc.waitingForValue,valid:Qc.alive|Qc.initialized,removed:0},$c=class{constructor(e,t){this.registry=e,this.atom=t,this.writeContext=new rl(e,this)}registry;atom;state=F.uninitialized;lifetime;writeContext;preserveInitialValueOnBuild=!1;parents=[];previousParents;children=[];listeners=new Set;skipInvalidation=!1;currentState(){switch(this.state){case F.uninitialized:return`uninitialized`;case F.stale:return`stale`;case F.valid:return`valid`;default:return`removed`}}get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.length===0&&this.state!==0}_value=void 0;value(){if((this.state&Qc.waitingForValue)!==0){this.lifetime=nl(this);let e=this.atom.read(this.lifetime);if((this.state&Qc.waitingForValue)!==0&&(this.preserveInitialValueOnBuild?(this.preserveInitialValueOnBuild=!1,this.state=F.valid):this.setValue(e)),this.previousParents){let e=this.previousParents;this.previousParents=void 0;for(let t=0;t<e.length;t++)e[t].removeChild(this),e[t].canBeRemoved&&this.registry.scheduleNodeRemoval(e[t])}}return this._value}valueOption(){return(this.state&Qc.initialized)===0?S():c(this._value)}setInitialValue(e){if((this.state&Qc.initialized)===0){this.preserveInitialValueOnBuild=!0,this.state=F.stale,this._value=e,I.phase===il.collect?I.notify.add(this):this.notify();return}this.setValue(e)}setValue(e){if((this.state&Qc.initialized)===0){this.state=F.valid,this._value=e,I.phase===il.collect?I.notify.add(this):this.notify();return}this.state=F.valid,!Object.is(this._value,e)&&(this._value=e,this.skipInvalidation?this.skipInvalidation=!1:this.invalidateChildren(),this.listeners.size>0&&(I.phase===il.collect?I.notify.add(this):this.notify()))}addParent(e){if(this.parents.push(e),this.previousParents!==void 0){let t=this.previousParents.indexOf(e);t!==-1&&(this.previousParents[t]=this.previousParents[this.previousParents.length-1],this.previousParents.pop()===void 0&&(this.previousParents=void 0))}e.children.indexOf(this)===-1&&(e.children.push(this),e.skipInvalidation&&=!1)}removeChild(e){let t=this.children.indexOf(e);t!==-1&&(this.children[t]=this.children[this.children.length-1],this.children.pop())}invalidate(){this.state===F.valid&&(this.state=F.stale,this.disposeLifetime()),I.phase===il.collect?I.stale.push(this):this.atom.lazy&&this.listeners.size===0&&!el(this.children)?(this.invalidateChildren(),this.skipInvalidation=!0):this.value()}invalidateChildren(){if(this.children.length===0)return;let e=this.children;this.children=[];for(let t=0;t<e.length;t++)e[t].invalidate()}notify(){this.listeners.forEach(Jc),I.phase===il.commit&&I.notify.delete(this)}disposeLifetime(){this.lifetime!==void 0&&(this.lifetime.dispose(),this.lifetime=void 0),this.parents.length!==0&&(this.previousParents=this.parents,this.parents=[])}remove(){if(this.state=F.removed,this.listeners.clear(),this.lifetime===void 0||(this.disposeLifetime(),this.previousParents===void 0))return;let e=this.previousParents;this.previousParents=void 0;for(let t=0;t<e.length;t++)e[t].removeChild(this),e[t].canBeRemoved&&this.registry.removeNode(e[t])}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}};function el(e){if(e.length===0)return!1;let t=e,n,r=0;for(;t!==void 0;){for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!r.atom.lazy||r.listeners.size>0)return!0;r.children.length>0&&(n===void 0?n=[r.children]:n.push(r.children))}t=n?.[r++]}return!1}var tl={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)return e();this.finalizers??=[],this.finalizers.push(e)},get(e){if(this.disposed)return this.node.registry.get(e);let t=this.node.registry.ensureNode(e);return this.node.addParent(t),t.value()},result(e,t){if(this.disposed||this.isFn)return this.resultOnce(e,t);let n=this.get(e);if(t?.suspendOnWaiting&&n.waiting)return $i;switch(n._tag){case`Initial`:return $i;case`Failure`:return qi(n.cause);case`Success`:return A(n.value)}},resultOnce(e,t){return Mn(n=>{let r=this.once(e);if(r._tag!==`Initial`&&!(t?.suspendOnWaiting&&r.waiting))return n(Bc(r));let i=this.node.registry.subscribe(e,e=>{e._tag===`Initial`||t?.suspendOnWaiting&&e.waiting||(i(),n(Bc(e)))},{immediate:!1});return j(i)})},setResult(e,t){return this.disposed?$i:(this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0}))},some(e){if(this.disposed||this.isFn)return this.someOnce(e);let t=this.get(e);return t._tag===`None`?$i:A(t.value)},someOnce(e){return Mn(t=>{let n=this.once(e);if(Tt(n))return t(A(n.value));let r=this.node.registry.subscribe(e,e=>{Ni(e)||(r(),t(A(e.value)))},{immediate:!1});return j(r)})},once(e){return this.node.registry.get(e)},self(){return this.disposed?S():this.node.valueOption()},refresh(e){this.disposed||this.node.registry.refresh(e)},refreshSelf(){this.disposed||this.node.invalidate()},mount(e){this.disposed||this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){this.disposed||this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){this.disposed||this.node.setValue(e)},set(e,t){this.disposed||this.node.registry.set(e,t)},stream(e,t){return this.disposed?ps:fs(n=>j(()=>{this.subscribe(e,e=>za(n,e),{immediate:!t?.withoutInitialValue})}))},streamResult(e,t){return this.stream(e,t).pipe(xs(Dc),bs(e=>e._tag===`Success`?A(e.value):mn(e.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;let e=this.finalizers;this.finalizers=void 0;for(let t=e.length-1;t>=0;t--)e[t]()}},nl=e=>{function t(n){if(t.disposed||t.isFn)return e.registry.get(n);let r=e.registry.ensureNode(n),i=r.value();return e.addParent(r),i}return Object.setPrototypeOf(t,tl),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t},rl=class{constructor(e,t){this.registry=e,this.node=t}registry;node;get(e){return this.registry.get(e)}set(e,t){return this.registry.set(e,t)}setSelf(e){return this.node.setValue(e)}refreshSelf(){return this.node.invalidate()}},il={disabled:0,collect:1,commit:2},I={phase:il.disabled,depth:0,stale:[],notify:new Set};function al(e){I.phase=il.collect,I.depth++;try{if(e(),I.depth===1){for(let e=0;e<I.stale.length;e++)ol(I.stale[e]);I.phase=il.commit;for(let e of I.notify)e.notify();I.notify.clear()}}finally{I.depth--,I.depth===0&&(I.phase=il.disabled,I.stale=[])}}function ol(e){if(e.state!==F.valid){for(let t=0;t<e.parents.length;t++){let n=e.parents[t];n.state!==F.valid&&ol(n)}e.state!==F.valid&&e.value()}}var sl=`~effect/reactivity/Atom`,cl=e=>pr(e,sl),ll=`~effect/reactivity/Atom/Writable`,ul=k(2,(e,t)=>{let n=Bi(t),r=St(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Et(n):void 0})}),dl=ul(0),fl={[sl]:sl,...Ge,toJSON(){return{_id:`Atom`,keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}}},pl={...fl,atom(e,t){let n=xl(e,t);return _l(e=>{let t=e.self(),r=e(this);return r._tag===`Success`?n(e,r.value):Lc(r,t)})},fn(e,t){return arguments.length===0?(e,t)=>ml(this,e,t):ml(this,e,t)},pull(e,t){let n=dl(wl(0));return Ll(n,_l(r=>{let i=r.self(),a=r(this);return a._tag===`Success`?El(r,Il(r,n,e,t),Oc(!0),a.value):Lc(a,i)}))},subscriptionRef(e){return Ml(dl(_l(t=>{let n=t.self(),r=t(this);if(r._tag!==`Success`)return Lc(r,n);let i=typeof e==`function`?e(t):e;return lc(i)?i:El(t,i,Oc(!0),r.value)})),(e,t)=>jl(e,t,zc(e(this))))}},ml=(e,t,n)=>{let[r,i,a]=Fl(n?.reactivityKeys?(e,r)=>{let i=t(e,r);return xr(i)?_c(i,n.reactivityKeys):ws(i,vc(n.reactivityKeys))}:t,n);return vl(t=>{t.get(a);let n=t.self(),i=t.get(e);return i._tag===`Success`?r(t,i.value):Lc(i,n)},i)},hl={...fl,[ll]:ll},gl=e=>ll in e,_l=(e,t)=>{let n=Object.create(fl);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},vl=(e,t,n)=>{let r=Object.create(hl);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function yl(e,t){e.setSelf(t)}var bl=(e,t)=>{let n=xl(e,t);return`~effect/reactivity/Atom`in n?n:_l(n)},xl=(e,t)=>{if(typeof e==`function`&&!xr(e)&&!ls(e)){let n=e;return function(e,r){let i=n(e);switch(typeof i){case`function`:case`object`:return i===null?i:Sl in i?Tl(e,i,t,r):Cl in i?kl(e,i,t,r):i;default:return i}}}else if(xr(e))return function(n,r){return Tl(n,e,t,r)};else if(ls(e))return function(n,r){return kl(n,e,t,r)};return wl(e)},Sl=`~effect/Effect`,Cl=`~effect/Stream`,wl=e=>vl(function(t){return e},yl),Tl=(e,t,n,r)=>El(e,t,n?.initialValue===void 0?Oc():Ac(n.initialValue),r,n?.uninterruptible);function El(e,t,n,r=wr(),i=!1){let a=e.self(),o=jn();e.addFinalizer(()=>{ht(r)(Gr(o,Ot))});let s=new Map(r.mapUnsafe);s.set(li.key,o),s.set(Gc.key,e.registry),s.set(un.key,e.registry.scheduler);let c,l=!1,u=Dl(st(s),t,function(t){c=Tc(t,a),l&&e.setSelf(c)},i);return l=!0,u!==void 0&&e.addFinalizer(u),c===void 0?a._tag===`Some`?Ec(a):Fc(n):c}function Dl(e,t,n,r=!1){if(Hi(t)){n(t);return}let i=ht(e)(t);i.currentDispatcher?.flush();let a=i.pollUnsafe();if(a){n(a);return}let o=i.addObserver(n);function s(){o(),r||i.interruptUnsafe()}return s}var Ol=(e=>{let t=yc;function n(r){let i=Object.create(pl);i.keepAlive=!1,i.lazy=!0,i.refresh=void 0,i.factory=n;let a=zl(_l(typeof r==`function`?e=>Un(r(e),t):()=>Un(r,t)));return i.layer=a,i.read=function(t){let n=t(a);return Tl(t,M(si,t=>ye(n,e.memoMap,t)),{uninterruptible:!0})},i}n.memoMap=e.memoMap,n.addGlobalLayer=e=>{t=Un(t,i(e,yc))};let r=dl(bl(Qr(t=>ye(yc,e.memoMap,l(t,li))).pipe(C(l(mc)))));return n.withReactivity=e=>t=>Bl(t,n=>{let i=zc(n(r));return n.addFinalizer(i.registerUnsafe(e,()=>{n.refresh(t)})),n.subscribe(t,e=>n.setSelf(e)),n.once(t)},{initialValueTarget:t}),n})({memoMap:qt()});Ol.withReactivity;var kl=(e,t,n,r)=>Al(e,t,n?.initialValue===void 0?Oc():Ac(n.initialValue),r);function Al(e,t,n,r=wr()){let i=e.self();r=nt(r,Gc,e.registry);let a=fr(n=>M(Ho(t.channel,n),t=>Fi({while:Or,body:()=>t,step(t){e.setSelf(Ac(gi(t),{waiting:!0}))}}))).pipe(Ar(t=>(ct(t)?nr(e.self(),Oi(Rc),ie({onNone:()=>e.setSelf(Pc(new it,{previous:e.self()})),onSome:t=>e.setSelf(Ac(t))})):e.setSelf(Nc(t,{previous:e.self()})),w))),o=new Map(r.mapUnsafe);o.set(Gc.key,e.registry),o.set(un.key,e.registry.scheduler);let s=Dl(st(o),a,Ln,!1);return s!==void 0&&e.addFinalizer(s),i._tag===`Some`?Ec(i):Fc(n)}var jl=(e,t,n=wr())=>lc(t)?(e.addFinalizer(uc(t).pipe(Es(t=>{for(let n=0;n<t.length;n++)e.setSelf(t[n]);return w}),Yt(n))),Rr(n)(dc(t))):t._tag===`Success`?Al(e,uc(t.value),Oc(!0),n):t,Ml=(e,t)=>{function n(t,n){let r=t.get(e);lc(r)?vi(pc(r,n)):kc(r)&&vi(pc(r.value,n))}return vl(n=>{let r=n(e);return lc(r)||kc(r)?t(n,r):r},n)},Nl=Symbol.for(`effect/reactivity/atom/Atom/Reset`),Pl=Symbol.for(`effect/reactivity/atom/Atom/Interrupt`);function Fl(e,t){let n=dl(wl([0,void 0])),r=t?.initialValue===void 0?Oc():Ac(t.initialValue),i=t?.concurrent?dl(_l(e=>{let t=new Set;return e.addFinalizer(()=>t.forEach(e=>e.interruptUnsafe())),t})):void 0;function a(t,a){let o=i?t(i):void 0;t.isFn=!0;let[s,c]=t.get(n);if(s===0)return r;if(c===Pl)return Nc(Oe(),{previous:t.self()});let l=e(c,t);return Sl in l?(o&&(l=M(Li(l,{startImmediately:!0}),e=>(o.add(e),e.addObserver(()=>o.delete(e)),C(ta(o),e=>e[0])))),El(t,l,r,a,!1)):Al(t,l,r,a)}function o(e,t){Hl(()=>{t===Nl?e.set(n,[0,void 0]):t===Pl?e.set(n,[e.get(n)[0]+1,Pl]):e.set(n,[e.get(n)[0]+1,t]),e.refreshSelf()})}return[a,o,n]}var Il=(e,t,n,r)=>M(Ds(typeof n==`function`?n(e):n),n=>{let i=ia().context,a=Bt(),o=yt(n,{onFailure(e){return ct(e)?ft(a)?A({done:!0,items:a}):ir(new it(`Atom.pull: no items`)):mn(e)},onSuccess(e){let t;return r?.disableAccumulation?t=e:(t=Zi(a,e),a=t),A({done:!1,items:t})}}),s=new Set;return e.addFinalizer(()=>{for(let e of s)e()}),e.once(t),e.subscribe(t,()=>{e.setSelf(Ec(e.self()));let t;t=Dl(i,o,n=>{t&&s.delete(t);let r=Tc(n,e.self()),i=s.size>0;e.setSelf(i?Fc(r):r)}),t&&s.add(t)}),o}),Ll=(e,t)=>vl(t.read,function(t,n){t.set(e,t.get(e)+1)}),Rl=typeof WeakRef>`u`||typeof FinalizationRegistry>`u`?e=>{let t=es();return function(n){let r=ts(t,n);if(r._tag===`Some`)return r.value;let i=e(n);return as(t,n,i),i}}:e=>{let t=es(),n=new FinalizationRegistry(e=>{ss(t,e)});return function(r){let i=ts(t,r).pipe(Wi(e=>e.deref()));if(i._tag===`Some`)return i.value;let a=e(r);return as(t,r,new WeakRef(a)),n.register(a,r),a}},zl=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),Bl=k(e=>cl(e[0]),(e,t,n)=>{let r=dl(gl(e)?vl(n=>t(n,e),function(t,n){t.set(e,n)},e.refresh??function(t){t(e)}):_l(n=>t(n,e),e.refresh??function(t){t(e)}));return n?.initialValueTarget&&(r.initialValueTarget=Vl(n.initialValueTarget)),r}),Vl=e=>{let t=e;for(;t.initialValueTarget;)t=t.initialValueTarget;return t},Hl=al,Ul=`~effect-atom/atom/Atom/Serializable`,Wl=k(2,(e,t)=>{let n=Rt(t.schema);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,label:e.label??[t.key,Error().stack?.split(`
|
|
2
|
-
`)[5]??``],[Ul]:{key:t.key,encode:ze(n),decode:Xe(n)}})}),Gl=`~effect-atom/atom/Atom/ServerValue`,Kl=k(2,(e,t)=>`~effect-atom/atom/Atom/ServerValue`in e?e[Gl](e=>t.get(e)):t.get(e));function ql(e){let t=js.unstable_scheduleCallback(4,e);return()=>js.unstable_cancelCallback(t)}var Jl=As.createContext(Wc({scheduleTask:ql,defaultIdleTTL:400})),Yl=new WeakMap;function Xl(e,t){let n=Yl.get(e);n===void 0&&(n=new WeakMap,Yl.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i={subscribe(n){return e.subscribe(t,n)},snapshot(){return e.get(t)},getServerSnapshot(){return Kl(t,e)}};return n.set(t,i),i}function Zl(e,t){let n=Xl(e,t);return As.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function Ql(e,t){As.useEffect(()=>e.mount(t),[t,e])}function $l(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?As.useCallback(r=>{e.set(t,r);let i=Vn(Kc(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(eu):i},[e,t,n.mode]):As.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var eu=e=>{if(_(e))return e.value;throw h(e.cause)},tu=(e,t)=>{let n=As.useContext(Jl);return Ql(n,e),$l(n,e,t)},nu=e=>{let t=As.useContext(Jl);return Ql(t,e),As.useCallback(()=>{t.refresh(e)},[t,e])},ru={suspendOnWaiting:new Map,default:new Map};function iu(e,t,n){let r=n?ru.suspendOnWaiting:ru.default,i=r.get(t);return i===void 0?(i=new Promise(i=>{let a=e.subscribe(t,e=>{e._tag===`Initial`||n&&e.waiting||(setTimeout(a,1e3),i(),r.delete(t))})}),r.set(t,i),i):i}function au(e,t,n){let r=Zl(e,t);if(r._tag===`Initial`||n&&r.waiting)throw iu(e,t,n);return r}var ou=(e,t)=>{let n=au(As.useContext(Jl),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw h(n.cause);return n},su=Symbol.for(`~effect/http/Headers`),cu=Object.create(null);Object.defineProperties(cu,{[su]:{value:su},[Fe]:{value(e){return vu(this,l(e,yu))}},toJSON:{value(){return _e(this)}},[rn]:{value(e){return uu(this,e)}},[ci]:{value(){return zr(this)}},toString:{value:Xi.toString},[Ft]:{value:Xi[Ft]}});var lu=e=>Object.assign(Object.create(cu),e),uu=Ci(je()),du=Object.create(cu),fu=e=>{if(e===void 0)return du;if(Symbol.iterator in e){let t=Object.create(cu);for(let[n,r]of e)t[n.toLowerCase()]=r;return t}let t=Object.create(cu);for(let[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(`, `):r!==void 0&&(t[n.toLowerCase()]=r);return t},pu=e=>Object.setPrototypeOf(e,cu),mu=k(3,(e,t,n)=>{let r=lu(e);return r[t.toLowerCase()]=n,r}),hu=k(2,(e,t)=>lu({...e,...fu(t)})),gu=k(2,(e,t)=>{let n=lu(e);return Object.assign(n,t),n}),_u=k(2,(e,t)=>{let n=lu(e);return delete n[t.toLowerCase()],n}),vu=k(2,(e,t)=>{let n={...e},r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&(n[r]=xi(e[r]))}else for(let r in e)t.test(r)&&(n[r]=xi(e[r]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),yu=ce(`effect/Headers/CurrentRedactedNames`,{defaultValue:()=>[`authorization`,`cookie`,`set-cookie`,`x-api-key`]}),bu=`~effect/http/UrlParams`,xu={...Ge,[bu]:bu,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:`UrlParams`,params:Object.fromEntries(this.params)}},[rn](e){return Tu(this,e)},[ci](){return dt(this.params.flat())}},Su=e=>{let t=Object.create(xu);return t.params=e,t},Cu=e=>{let t=wu(e),n=[];for(let e=0;e<t.length;e++)if(Array.isArray(t[e][0])){let[r,i]=t[e];n.push([`${r[0]}[${r.slice(1).join(`][`)}]`,i])}else n.push(t[e]);return Su(n)},wu=e=>{let t=typeof e[Symbol.iterator]==`function`?Qt(e):Object.entries(e),n=[];for(let[e,r]of t)if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]!==void 0&&n.push([e,String(r[t])]);else if(typeof r==`object`){let t=wu(r);for(let[r,i]of t)n.push([[e,...typeof r==`string`?[r]:r],i])}else r!==void 0&&n.push([e,String(r)]);return n},Tu=ei((e,t)=>Eu(e.params,t.params)),Eu=ai(Jr([je(),je()])),Du=Su([]),Ou=k(2,(e,t)=>{let n=Cu(t),r=n.params,i=new Set;for(let e=0;e<r.length;e++)i.add(r[e][0]);for(let t=0;t<e.params.length;t++)i.has(e.params[t][0])||r.push(e.params[t]);return n}),ku=class extends y(`UrlParamsError`){},Au=(e,t,n)=>{try{let r=new URL(e,ju());for(let e=0;e<t.params.length;e++){let[n,i]=t.params[e];i!==void 0&&r.searchParams.append(n,i)}return n!==void 0&&(r.hash=n),ln(r)}catch(e){return jr(new ku({cause:e}))}},ju=()=>{if(`location`in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname},Mu=`~effect/http/HttpBody`;y(`HttpBodyError`);var Nu=class{[Mu];constructor(){this[Mu]=Mu}[Ft](){return this.toJSON()}toString(){return zt(this,{ignoreToString:!0})}},Pu=new class extends Nu{_tag=`Empty`;toJSON(){return{_id:`effect/HttpBody`,_tag:`Empty`}}},Fu=`~effect/http/Cookies`,Iu=`~effect/http/Cookies/Cookie`;y(`CookieError`);var Lu={[Fu]:Fu,...Xi,toJSON(){return{_id:`effect/Cookies`,cookies:Pn(this.cookies,e=>e.toJSON())}},pipe(){return fn(this,arguments)}},Ru=e=>{let t=Object.create(Lu);return t.cookies=e,t},zu=e=>{let t={};for(let n of e)t[n.name]=n;return Ru(t)},Bu=e=>{let t=typeof e==`string`?[e]:e,n=[];for(let e of t){let t=Vu(e.trim());t&&n.push(t)}return zu(n)};function Vu(e){let t=e.split(`;`).map(e=>e.trim()).filter(e=>e!==``);if(t.length===0)return;let n=t[0].indexOf(`=`);if(n===-1)return;let r=t[0].slice(0,n);if(!Hu.test(r))return;let i=t[0].slice(n+1),a=Wu(i);if(t.length===1)return Object.assign(Object.create(Uu),{name:r,value:a,valueEncoded:i});let o={};for(let e=1;e<t.length;e++){let n=t[e],r=n.indexOf(`=`),i=r===-1?n:n.slice(0,r).trim(),a=r===-1?void 0:n.slice(r+1).trim();switch(i.toLowerCase()){case`domain`:{if(a===void 0)break;let e=a.trim().replace(/^\./,``);e&&(o.domain=e);break}case`expires`:{if(a===void 0)break;let e=new Date(a);isNaN(e.getTime())||(o.expires=e);break}case`max-age`:{if(a===void 0)break;let e=parseInt(a,10);isNaN(e)||(o.maxAge=Pi(e));break}case`path`:if(a===void 0)break;a[0]===`/`&&(o.path=a);break;case`priority`:if(a===void 0)break;switch(a.toLowerCase()){case`low`:o.priority=`low`;break;case`medium`:o.priority=`medium`;break;case`high`:o.priority=`high`;break}break;case`httponly`:o.httpOnly=!0;break;case`secure`:o.secure=!0;break;case`partitioned`:o.partitioned=!0;break;case`samesite`:if(a===void 0)break;switch(a.toLowerCase()){case`lax`:o.sameSite=`lax`;break;case`strict`:o.sameSite=`strict`;break;case`none`:o.sameSite=`none`;break}break}}return Object.assign(Object.create(Uu),{name:r,value:a,valueEncoded:i,options:Object.keys(o).length>0?o:void 0})}var Hu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Uu={[Iu]:Iu,...Xi,toJSON(){return{_id:`effect/Cookies/Cookie`,name:this.name,value:this.value,options:this.options}}},Wu=e=>{try{return decodeURIComponent(e)}catch{return e}},Gu=`~effect/http/HttpClientError`,Ku=class extends y(`HttpClientError`){constructor(e){`cause`in e.reason?super({...e,cause:e.reason.cause}):super(e)}[Gu]=Gu;get request(){return this.reason.request}get response(){return`response`in this.reason?this.reason.response:void 0}get message(){return this.reason.message}},qu=e=>e.endsWith(`Error`)?e.slice(0,-5):e,Ju=(e,t,n)=>t?`${e}: ${t} (${n})`:`${e} error (${n})`,Yu=class extends y(`TransportError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return Ju(qu(this._tag),this.description,this.methodAndUrl)}};y(`EncodeError`);var Xu=class extends y(`InvalidUrlError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return Ju(qu(this._tag),this.description,this.methodAndUrl)}};y(`StatusCodeError`);var Zu=class extends y(`DecodeError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return Ju(qu(this._tag),this.description,e)}},Qu=class extends y(`EmptyBodyError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return Ju(qu(this._tag),this.description,e)}},$u=class e extends ar(Gu)({_tag:At(`HttpError`),kind:Di([`EncodeError`,`DecodeError`,`TransportError`,`InvalidUrlError`,`StatusCodeError`,`EmptyBodyError`]),cause:x(O)}){static fromHttpClientError(t){return new e({_tag:`HttpError`,kind:t.reason._tag,cause:t.reason})}},ed=[[`GET`,`get`],[`POST`,`post`],[`PUT`,`put`],[`DELETE`,`del`],[`PATCH`,`patch`],[`HEAD`,`head`],[`OPTIONS`,`options`],[`TRACE`,`trace`]],td=`~effect/http/HttpClientRequest`,nd={[td]:td,...Xi,toJSON(){return{_id:`HttpClientRequest`,method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:_e(this.headers),body:this.body.toJSON()}},pipe(){return fn(this,arguments)}};function rd(e,t,n,r,i,a){let o=Object.create(nd);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=i,o.body=a,o}var id=rd(`GET`,``,Du,S(),du,Pu),ad=e=>(t,n)=>od(id,{method:e,url:t,...n??void 0}),od=k(2,(e,t)=>{let n=e;return t.method&&(n=sd(n,t.method)),t.url&&(n=fd(n,t.url)),t.headers&&(n=ld(n,t.headers)),t.urlParams&&(n=pd(n,t.urlParams)),t.hash&&(n=md(n,t.hash)),t.body&&(n=hd(n,t.body)),t.accept&&(n=ud(n,t.accept)),t.acceptJson&&(n=dd(n)),n}),sd=k(2,(e,t)=>rd(t,e.url,e.urlParams,e.hash,e.headers,e.body)),cd=k(3,(e,t,n)=>rd(e.method,e.url,e.urlParams,e.hash,mu(e.headers,t,n),e.body)),ld=k(2,(e,t)=>rd(e.method,e.url,e.urlParams,e.hash,hu(e.headers,t),e.body)),ud=k(2,(e,t)=>cd(e,`Accept`,t)),dd=ud(`application/json`),fd=k(2,(e,t)=>{if(typeof t==`string`)return rd(e.method,t,e.urlParams,e.hash,e.headers,e.body);let n=new URL(t.toString()),r=Cu(n.searchParams),i=Sn(n.hash===``?void 0:n.hash.slice(1));return n.search=``,n.hash=``,rd(e.method,n.toString(),r,i,e.headers,e.body)}),pd=k(2,(e,t)=>rd(e.method,e.url,Ou(e.urlParams,t),e.hash,e.headers,e.body)),md=k(2,(e,t)=>rd(e.method,e.url,e.urlParams,c(t),e.headers,e.body)),hd=k(2,(e,t)=>{let n=e.headers;return t._tag===`Empty`||t._tag===`FormData`?n=_u(_u(n,`Content-Type`),`Content-length`):(t.contentType&&(n=mu(n,`content-type`,t.contentType)),t.contentLength!==void 0&&(n=mu(n,`content-length`,t.contentLength.toString()))),rd(e.method,e.url,e.urlParams,e.hash,n,t)}),gd=`~effect/http/HttpIncomingMessage`,_d=(e,t)=>{let n=e.headers[`content-type`]??``,r;if(n.includes(`application/json`))try{r=vi(e.json)}catch{}else if(n.includes(`text/`)||n.includes(`urlencoded`))try{r=vi(e.text)}catch{}let i={...t,headers:_e(e.headers),remoteAddress:e.remoteAddress};return r!==void 0&&(i.body=r),i},vd=`~effect/http/HttpClientResponse`,yd=(e,t)=>new bd(e,t),bd=class extends m{[gd];[vd];request;source;constructor(e,t){super(),this.request=e,this.source=t,this[gd]=gd,this[vd]=vd}toJSON(){return _d(this,{_id:`HttpClientResponse`,request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return fu(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=Bu(this.source.headers.getSetCookie())}get remoteAddress(){return S()}get stream(){return this.source.body?vs({evaluate:()=>this.source.body,onError:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}):hs(new Ku({reason:new Qu({request:this.request,response:this,description:`can not create stream from empty body`})}))}get json(){return M(this.text,e=>dn({try:()=>e===``?null:JSON.parse(e),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}))}textBody;get text(){return this.textBody?this.textBody:(this.textBody=tr({try:()=>this.source.text(),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}).pipe(hi,vi),this.arrayBufferBody=C(this.textBody,e=>new TextEncoder().encode(e).buffer),this.textBody)}get urlParamsBody(){return M(this.text,e=>dn({try:()=>Cu(new URLSearchParams(e)),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}))}formDataBody;get formData(){return this.formDataBody??=tr({try:()=>this.source.formData(),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}).pipe(hi,vi)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody?this.arrayBufferBody:(this.arrayBufferBody=tr({try:()=>this.source.arrayBuffer(),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}).pipe(hi,vi),this.textBody=C(this.arrayBufferBody,e=>new TextDecoder().decode(e)),this.arrayBufferBody)}pipe(){return fn(this,arguments)}},xd=e=>pu({b3:`${e.traceId}-${e.spanId}-${e.sampled?`1`:`0`}${ie(e.parent,{onNone:()=>``,onSome:e=>`-${e.spanId}`})}`,traceparent:`00-${e.traceId}-${e.spanId}-${e.sampled?`01`:`00`}`}),Sd=`~effect/http/HttpClient`,Cd=v(`effect/HttpClient`),wd=k(2,(e,t)=>Td(n=>t(e.postprocess(n)),e.preprocess)),Td=(e,t)=>{let n=Object.create(Ed);return n.preprocess=t,n.postprocess=e,n.execute=function(n){return e(t(n))},n},Ed={[Sd]:Sd,pipe(){return fn(this,arguments)},...Xi,toJSON(){return{_id:`effect/HttpClient`}},...Object.fromEntries(ed.map(([e,t])=>[t,function(t,n){return this.execute(ad(e)(t,n))}]))},Dd=e=>Td(t=>M(t,t=>Dt(n=>{let r=Nd.get(t),i=r??new AbortController,a=Au(t.url,t.urlParams,ee(t.hash));if(or(a))return ir(new Ku({reason:new Xu({request:t,cause:a.failure})}));let o=a.success;if(n.getRef(Fn)||n.getRef(Od)(t)){let a=e(t,o,i.signal,n);return r?a:Ki(e=>yt(e(a),{onSuccess(e){return Md.register(e,i),A(new Pd(e,i))},onFailure(e){return lt(e)&&i.abort(),mn(e)}}))}return Vi(n.getRef(Ad)(t),{kind:`client`},a=>{a.attribute(`http.request.method`,t.method),a.attribute(`server.address`,o.origin),o.port!==``&&a.attribute(`server.port`,+o.port),a.attribute(`url.full`,o.toString()),a.attribute(`url.path`,o.pathname),a.attribute(`url.scheme`,o.protocol.slice(0,-1));let s=o.search.slice(1);s!==``&&a.attribute(`url.query`,s);let c=n.getRef(yu),l=vu(t.headers,c);for(let e in l)a.attribute(`http.request.header.${e}`,String(l[e]));return t=n.getRef(kd)?ld(t,xd(a)):t,Ki(s=>s(e(t,o,i.signal,n)).pipe(le(a,{captureStackTrace:!1}),yt({onSuccess:e=>{a.attribute(`http.response.status_code`,e.status);let t=vu(e.headers,c);for(let e in t)a.attribute(`http.response.header.${e}`,String(t[e]));return r?A(e):(Md.register(e,i),A(new Pd(e,i)))},onFailure(e){return!r&<(e)&&i.abort(),mn(e)}})))})})),A),Od=ce(`effect/http/HttpClient/TracerDisabledWhen`,{defaultValue:()=>An}),kd=ce(`effect/HttpClient/TracerPropagationEnabled`,{defaultValue:Or}),Ad=ce(`effect/http/HttpClient/SpanNameGenerator`,{defaultValue:()=>e=>`http.client ${e.method}`}),jd=e=>Ie(Cd)(Qr(t=>C(e,e=>wd(e,wn(e=>pe(t,e)))))),Md=(()=>{if(`FinalizationRegistry`in globalThis&&globalThis.FinalizationRegistry){let e=new FinalizationRegistry(e=>{e.abort()});return{register(t,n){e.register(t,n,t)},unregister(t){e.unregister(t)}}}let e=new Map;return{register(t,n){e.set(t,setTimeout(()=>n.abort(),5e3))},unregister(t){let n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))}}})(),Nd=new WeakMap,Pd=class{original;controller;constructor(e,t){this.original=e,this.controller=t}[vd]=vd;[gd]=gd;applyInterrupt(e){return D(()=>(Md.unregister(this.original),we(e,()=>j(()=>{this.controller.abort()}))))}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return ms(()=>(Md.unregister(this.original),ws(this.original.stream,j(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[Ft](){return this.original[Ft]()}pipe(){return fn(this,arguments)}},Fd=`~effect/FiberSet`,Id=e=>pr(e,Fd),Ld={[Fd]:Fd,[Symbol.iterator](){return this.state._tag===`Closed`?Kn():this.state.backing[Symbol.iterator]()},...Ge,toJSON(){return{_id:`FiberMap`,state:this.state}}},Rd=(e,t)=>{let n=Object.create(Ld);return n.state={_tag:`Open`,backing:e},n.deferred=t,n},zd=()=>Vr(j(()=>Rd(new Set,rr())),e=>D(()=>{let t=e.state;if(t._tag===`Closed`)return w;e.state={_tag:`Closed`};let n=t.backing;return ra(n).pipe(lr(e.deferred))})),Bd=-1,Vd=Cn(ki(Je,Gi(Bd))),Hd=k(e=>Id(e[0]),(e,t,n)=>{if(e.state._tag===`Closed`){t.interruptUnsafe(Bd);return}else if(e.state.backing.has(t))return;e.state.backing.add(t),t.addObserver(r=>{e.state._tag!==`Closed`&&(e.state.backing.delete(t),Ct(r)&&(n?.propagateInterruption===!0?!Vd(r.cause):!me(r.cause))&&Zr(e.deferred,r))})}),Ud=function(){let e;return()=>(e===void 0&&(e=sn(Er)),e)}(),Wd=e=>()=>C(Zn(),t=>{let n=ht(t);return(t,r)=>{if(e.state._tag===`Closed`)return Ud();let i=n(t,r);return Hd(e,i),i}}),Gd=e=>Xn(e.deferred),Kd=`~effect/socket/Socket`,qd=v(`effect/socket/Socket`),Jd=e=>qd.of({[Kd]:Kd,runRaw:e.runRaw,run:e.run??((t,n)=>e.runRaw(e=>typeof e==`string`?t(Yd.encode(e)):e instanceof Uint8Array?t(e):t(new Uint8Array(e)),n)),runString:e.runString??(e.run?(t,n)=>e.run(e=>t(Xd.decode(e)),n):(t,n)=>e.runRaw(e=>typeof e==`string`?t(e):e instanceof Uint8Array?t(Xd.decode(e)):t(Xd.decode(new Uint8Array(e))),n)),writer:e.writer}),Yd=new TextEncoder,Xd=new TextDecoder,Zd=`~effect/socket/Socket/CloseEvent`,Qd=e=>pr(e,Zd),$d=`~effect/socket/Socket/SocketError`,ef=e=>pr(e,$d),tf=class extends ar(`effect/socket/Socket/SocketReadError`)({_tag:At(`SocketReadError`),cause:O}){message=`An error occurred during Read`},nf=class extends ar(`effect/socket/Socket/SocketWriteError`)({_tag:At(`SocketWriteError`),cause:O}){message=`An error occurred during Write`},rf=class extends ar(`effect/socket/Socket/SocketOpenError`)({_tag:At(`SocketOpenError`),kind:Di([`Unknown`,`Timeout`]),cause:O}){get message(){return this.kind===`Timeout`?`timeout waiting for "open"`:`An error occurred during Open`}},af=class extends ar(`effect/socket/Socket/SocketCloseError`)({_tag:At(`SocketCloseError`),code:Ri,closeReason:x(N)}){static filterClean(e){return function(t){return sf.is(t)&&t.reason._tag===`SocketCloseError`&&e(t.reason.code)?ln(t.reason):jr(t)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}},of=Sr([tf,nf,rf,af]),sf=class extends oe($d)(`SocketError`,{_tag:At(`SocketError`),reason:of}){constructor(e){`cause`in e.reason?super({...e,cause:e.reason.cause}):super(e)}[$d]=$d;static is(e){return ef(e)}message=this.reason.message},cf=e=>!0,lf=class extends v()(`~effect/socket/Socket/WebSocket`){},uf=class extends v()(`@effect/platform/Socket/WebSocketConstructor`){},df=bi(uf)((e,t)=>new globalThis.WebSocket(e,t)),ff=(e,t)=>uf.use(n=>pf(Vr((typeof e==`string`?A(e):e).pipe(C(e=>n(e,t?.protocols))),e=>j(()=>e.close(1e3))),t)),pf=(e,t)=>Dt(n=>{let r,i=oa(!1),a=n.context,o=t?.closeCodeIsError??cf;return A(Jd({runRaw:(n,s)=>fr(P(function*(a){let c=yield*zd().pipe(kr(a)),l=yield*kr(e,a),u=yield*ii(Wd(c)(),lf,l),d=!1;function f(e){if(e.data instanceof Blob)return u(M(Ut(()=>e.data.arrayBuffer()),e=>{let t=n(new Uint8Array(e));return xr(t)?t:w}));let t=n(e.data);xr(t)&&u(t)}function p(e){l.removeEventListener(`message`,f),l.removeEventListener(`close`,m),Zr(c.deferred,ir(new sf({reason:d?new tf({cause:e}):new rf({kind:`Unknown`,cause:e})})))}function m(e){let t=typeof e.code==`number`?e.code:1001;l.removeEventListener(`message`,f),l.removeEventListener(`error`,p),Zr(c.deferred,ir(new sf({reason:new af({code:t,closeReason:e.reason})})))}if(l.addEventListener(`close`,m,{once:!0}),l.addEventListener(`error`,p,{once:!0}),l.addEventListener(`message`,f),l.readyState!==1){let e=rr();l.addEventListener(`open`,()=>{d=!0,Zr(e,w)},{once:!0}),yield*Xn(e).pipe(cr({duration:t?.openTimeout??1e4,orElse:()=>ir(new sf({reason:new rf({kind:`Timeout`,cause:Error(`timeout waiting for "open"`)})}))}),Pe(Gd(c)))}return d=!0,r=l,i.openUnsafe(),s?.onOpen&&(yield*s.onOpen),yield*Ei(Gd(c),af.filterClean(e=>!o(e)),()=>w)})).pipe(wn(e=>pe(a,e)),ur(j(()=>{i.closeUnsafe(),r=void 0}))),writer:A(e=>i.whenOpen(j(()=>{let t=r;Qd(e)?t.close(e.code,e.reason):t.send(e)})))}))}),mf=Pr(ff,Ie(qd)),hf=class extends v()(`effect/workers/Transferable/Collector`){},gf=()=>{let e=[],t=t=>{e.push(...t)},n=()=>e,r=()=>{let t=e;return e=[],t};return hf.of({addAllUnsafe:t,addAll:e=>j(()=>t(e)),readUnsafe:n,read:j(n),clearUnsafe:r,clear:j(r)})},_f=`~effect/workers/WorkerError`,vf=Sr([class extends ar(`effect/workers/WorkerError/WorkerSpawnError`)({_tag:At(`WorkerSpawnError`),message:N,cause:x(O)}){},class extends ar(`effect/workers/WorkerError/WorkerSendError`)({_tag:At(`WorkerSendError`),message:N,cause:x(O)}){},class extends ar(`effect/workers/WorkerError/WorkerReceiveError`)({_tag:At(`WorkerReceiveError`),message:N,cause:x(O)}){},class extends ar(`effect/workers/WorkerError/WorkerUnknownError`)({_tag:At(`WorkerUnknownError`),message:N,cause:x(O)}){}]);ar(_f)({_tag:At(`WorkerError`),reason:vf});var yf=`~effect/interfaces/PrimaryKey`,bf=`~effect/rpc/RpcSchema/StreamSchema`;function xf(e){return pr(e,bf)}function Sf(e){return xf(e)?c({success:e.success,error:e.error}):S()}var Cf=gr(ls);function wf(e,t){return Pt(Cf.ast,{[bf]:bf,success:e,error:t})}v()(`effect/rpc/RpcSchema/ClientAbort`);var Tf=`~effect/rpc/Rpc`,Ef={[Tf]:Tf,pipe(){return fn(this,arguments)},setSuccess(e){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return Df({_tag:this._tag,payloadSchema:gt(e)?e:T(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return Df({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:nt(this.annotations,e,t)})},annotateMerge(e){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:pe(this.annotations,e)})}},Df=e=>{function t(){}return Object.setPrototypeOf(t,Ef),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},L=(e,t)=>{let n=t?.success??s,r=t?.error??Ui,i=t?.defect??O,a;return a=t?.primaryKey?class extends qr(`effect/rpc/Rpc/${e}`)(t.payload){[yf](){return t.primaryKey(this)}}:gt(t?.payload)?t?.payload:t?.payload?T(t?.payload):s,Df({_tag:e,payloadSchema:a,successSchema:t?.stream?wf(n,r):n,errorSchema:t?.stream?Ui:r,defectSchema:i,annotations:wr(),middlewares:new Set})},Of=new WeakMap,kf=e=>{if(Of.has(e))return Of.get(e);let t=e,n=new Set([t.errorSchema]),r=Sf(t.successSchema);Tt(r)&&n.add(r.value.error);for(let e of t.middlewares)n.add(e.error);let i=Qn(Tt(r)?s:t.successSchema,Sr([...n]),t.defectSchema);return Of.set(e,i),i},Af=`~effect/rpc/Rpc/Wrapper`,jf=e=>Af in e,Mf=`~effect/rpc/RpcClientError`,Nf=class extends ar(`effect/rpc/RpcClientError/RpcClientDefect`)({_tag:At(`RpcClientDefect`),message:N,cause:O}){},Pf=class extends ar(Mf)({_tag:At(`RpcClientError`),reason:Sr([vf,of,$u,Nf])}){[Mf]=Mf;get message(){return`${this.reason._tag}: ${this.reason.message}`}},Ff=e=>typeof e==`bigint`?e:BigInt(e),If={_tag:`Ping`},Lf;try{Lf=new TextDecoder}catch{}var R,Rf,z=0,zf=[],Bf=zf,Vf=0,B={},V,Hf,Uf=0,Wf=0,H,Gf,U=[],W,Kf={useRecords:!1,mapsAsObjects:!0},qf=class{},Jf=new qf;Jf.name=`MessagePack 0xC1`;var Yf=!1,Xf=2,Zf=class e{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.sequential&&e.trusted!==!1&&(e.trusted=!0,!e.structures&&e.useRecords!=0&&(e.structures=[],e.maxSharedStructures||=0)),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType=`number`)),Object.assign(this,e)}unpack(t,n){if(R)return wp(()=>(Tp(),this?this.unpack(t,n):e.prototype.unpack.call(Kf,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<`u`?Buffer.from(t):new Uint8Array(t)),typeof n==`object`?(Rf=n.end||t.length,z=n.start||0):(z=0,Rf=n>-1?n:t.length),Vf=0,Wf=0,Hf=null,Bf=zf,H=null,R=t;try{W=t.dataView||=new DataView(t.buffer,t.byteOffset,t.byteLength)}catch(e){throw R=null,t instanceof Uint8Array?e:Error(`Source must be a Uint8Array or Buffer but was a `+(t&&typeof t==`object`?t.constructor.name:typeof t))}if(this instanceof e){if(B=this,this.structures)return V=this.structures,Qf(n);(!V||V.length>0)&&(V=[])}else B=Kf,(!V||V.length>0)&&(V=[]);return Qf(n)}unpackMultiple(e,t){let n,r=0;try{Yf=!0;let i=e.length,a=this?this.unpack(e,i):Dp.unpack(e,i);if(t){if(t(a,r,z)===!1)return;for(;z<i;)if(r=z,t(Qf(),r,z)===!1)return}else{for(n=[a];z<i;)r=z,n.push(Qf());return n}}catch(e){throw e.lastPosition=r,e.values=n,e}finally{Yf=!1,Tp()}}_mergeStructures(e,t){this._onLoadedStructures&&(e=this._onLoadedStructures(e)),e||=[],Object.isFrozen(e)&&(e=e.map(e=>e.slice(0)));for(let t=0,n=e.length;t<n;t++){let n=e[t];n&&(n.isShared=!0,t>=32&&(n.highByte=t-32>>5))}e.sharedLength=e.length;for(let n in t||[])if(n>=0){let r=e[n],i=t[n];i&&(r&&((e.restoreStructures||=[])[n]=r),e[n]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}};function Qf(e){try{if(!B.trusted&&!Yf){let e=V.sharedLength||0;e<V.length&&(V.length=e)}let t;if(B._readStruct&&R[z]<64&&R[z]>=32?(t=B._readStruct(R,z,Rf),R=null,!(e&&e.lazy)&&t&&(t=t.toJSON()),z=Rf):t=G(),H&&=(z=H.postBundlePosition,null),Yf&&(V.restoreStructures=null),z==Rf)V&&V.restoreStructures&&$f(),V=null,R=null,Gf&&=null;else if(z>Rf)throw Error(`Unexpected end of MessagePack data`);else if(!Yf){let e;try{e=JSON.stringify(t,(e,t)=>typeof t==`bigint`?`${t}n`:t).slice(0,100)}catch(t){e=`(JSON view not available `+t+`)`}throw Error(`Data read, but end of buffer not reached `+e)}return t}catch(e){throw V&&V.restoreStructures&&$f(),Tp(),(e instanceof RangeError||e.message.startsWith(`Unexpected end of buffer`)||z>Rf)&&(e.incomplete=!0),e}}function $f(){for(let e in V.restoreStructures)V[e]=V.restoreStructures[e];V.restoreStructures=null}function G(){let e=R[z++];if(e<160)if(e<128){if(e<64)return e;{let t=V[e&63]||B.getStructures&&rp()[e&63];return t?(t.read||=tp(t,e&63),t.read()):e}}else if(e<144)if(e-=128,B.mapsAsObjects){let t={};for(let n=0;n<e;n++){let e=_p();e===`__proto__`&&(e=`__proto_`),t[e]=G()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(G(),G());return t}else{e-=144;let t=Array(e);for(let n=0;n<e;n++)t[n]=G();return B.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(Wf>=z)return Hf.slice(z-Uf,(z+=t)-Uf);if(Wf==0&&Rf<140){let e=t<16?fp(t):dp(t);if(e!=null)return e}return ip(t)}else{let t;switch(e){case 192:return null;case 193:return H?(t=G(),t>0?H[1].slice(H.position1,H.position1+=t):H[0].slice(H.position0,H.position0-=t)):Jf;case 194:return!1;case 195:return!0;case 196:if(t=R[z++],t===void 0)throw Error(`Unexpected end of buffer`);return mp(t);case 197:return t=W.getUint16(z),z+=2,mp(t);case 198:return t=W.getUint32(z),z+=4,mp(t);case 199:return hp(R[z++]);case 200:return t=W.getUint16(z),z+=2,hp(t);case 201:return t=W.getUint32(z),z+=4,hp(t);case 202:if(t=W.getFloat32(z),B.useFloat32>2){let e=Ep[(R[z]&127)<<1|R[z+1]>>7];return z+=4,(e*t+(t>0?.5:-.5)>>0)/e}return z+=4,t;case 203:return t=W.getFloat64(z),z+=8,t;case 204:return R[z++];case 205:return t=W.getUint16(z),z+=2,t;case 206:return t=W.getUint32(z),z+=4,t;case 207:return B.int64AsType===`number`?(t=W.getUint32(z)*4294967296,t+=W.getUint32(z+4)):B.int64AsType===`string`?t=W.getBigUint64(z).toString():B.int64AsType===`auto`?(t=W.getBigUint64(z),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=W.getBigUint64(z),z+=8,t;case 208:return W.getInt8(z++);case 209:return t=W.getInt16(z),z+=2,t;case 210:return t=W.getInt32(z),z+=4,t;case 211:return B.int64AsType===`number`?(t=W.getInt32(z)*4294967296,t+=W.getUint32(z+4)):B.int64AsType===`string`?t=W.getBigInt64(z).toString():B.int64AsType===`auto`?(t=W.getBigInt64(z),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=W.getBigInt64(z),z+=8,t;case 212:if(t=R[z++],t==114)return yp(R[z++]&63);{let e=U[t];if(e)return e.read?(z++,e.read(G())):e.noBuffer?(z++,e()):e(R.subarray(z,++z));throw Error(`Unknown extension `+t)}case 213:return t=R[z],t==114?(z++,yp(R[z++]&63,R[z++])):hp(2);case 214:return hp(4);case 215:return hp(8);case 216:return hp(16);case 217:return t=R[z++],Wf>=z?Hf.slice(z-Uf,(z+=t)-Uf):ap(t);case 218:return t=W.getUint16(z),z+=2,Wf>=z?Hf.slice(z-Uf,(z+=t)-Uf):op(t);case 219:return t=W.getUint32(z),z+=4,Wf>=z?Hf.slice(z-Uf,(z+=t)-Uf):sp(t);case 220:return t=W.getUint16(z),z+=2,lp(t);case 221:return t=W.getUint32(z),z+=4,lp(t);case 222:return t=W.getUint16(z),z+=2,up(t);case 223:return t=W.getUint32(z),z+=4,up(t);default:if(e>=224)return e-256;if(e===void 0){let e=Error(`Unexpected end of MessagePack data`);throw e.incomplete=!0,e}throw Error(`Unknown MessagePack token `+e)}}}var ep=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function tp(e,t){function n(){if(n.count++>Xf){let r;try{r=e.read=Function(`r`,`return function(){return `+(B.freezeData?`Object.freeze`:``)+`({`+e.map(e=>e===`__proto__`?`__proto_:r()`:ep.test(e)?e+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`})}`)(G)}catch{return Xf=1/0,n()}return e.highByte===0&&(e.read=np(t,e.read)),r()}let r={};for(let t=0,n=e.length;t<n;t++){let n=e[t];n===`__proto__`&&(n=`__proto_`),r[n]=G()}return B.freezeData?Object.freeze(r):r}return n.count=0,e.highByte===0?np(t,n):n}var np=(e,t)=>function(){let n=R[z++];if(n===0)return t();let r=e<32?-(e+(n<<5)):e+(n<<5),i=V[r]||rp()[r];if(!i)throw Error(`Record id is not defined for `+r);return i.read||=tp(i,e),i.read()};function rp(){let e=wp(()=>(R=null,B.getStructures()));return V=B._mergeStructures(e,V)}var ip=cp,ap=cp,op=cp,sp=cp;function cp(e){let t;if(e<16&&(t=fp(e)))return t;if(e>64&&Lf)return Lf.decode(R.subarray(z,z+=e));let n=z+e,r=[];for(t=``;z<n;){let e=R[z++];if(!(e&128))r.push(e);else if((e&224)==192){let t=R[z++]&63,n=(e&31)<<6|t;n<128?r.push(65533):r.push(n)}else if((e&240)==224){let t=R[z++]&63,n=R[z++]&63,i=(e&31)<<12|t<<6|n;i<2048||i>=55296&&i<=57343?r.push(65533):r.push(i)}else if((e&248)==240){let t=R[z++]&63,n=R[z++]&63,i=R[z++]&63,a=(e&7)<<18|t<<12|n<<6|i;a<65536||a>1114111?r.push(65533):a>65535?(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023,r.push(a)):r.push(a)}else r.push(65533);r.length>=4096&&(t+=K.apply(String,r),r.length=0)}return r.length>0&&(t+=K.apply(String,r)),t}function lp(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=G();return B.freezeData?Object.freeze(t):t}function up(e){if(B.mapsAsObjects){let t={};for(let n=0;n<e;n++){let e=_p();e===`__proto__`&&(e=`__proto_`),t[e]=G()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(G(),G());return t}}var K=String.fromCharCode;function dp(e){let t=z,n=Array(e);for(let r=0;r<e;r++){let e=R[z++];if((e&128)>0){z=t;return}n[r]=e}return K.apply(String,n)}function fp(e){if(e<4)if(e<2){if(e===0)return``;{let e=R[z++];if((e&128)>1){--z;return}return K(e)}}else{let t=R[z++],n=R[z++];if((t&128)>0||(n&128)>0){z-=2;return}if(e<3)return K(t,n);let r=R[z++];if((r&128)>0){z-=3;return}return K(t,n,r)}else{let t=R[z++],n=R[z++],r=R[z++],i=R[z++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){z-=4;return}if(e<6){if(e===4)return K(t,n,r,i);{let e=R[z++];if((e&128)>0){z-=5;return}return K(t,n,r,i,e)}}else if(e<8){let a=R[z++],o=R[z++];if((a&128)>0||(o&128)>0){z-=6;return}if(e<7)return K(t,n,r,i,a,o);let s=R[z++];if((s&128)>0){z-=7;return}return K(t,n,r,i,a,o,s)}else{let a=R[z++],o=R[z++],s=R[z++],c=R[z++];if((a&128)>0||(o&128)>0||(s&128)>0||(c&128)>0){z-=8;return}if(e<10){if(e===8)return K(t,n,r,i,a,o,s,c);{let e=R[z++];if((e&128)>0){z-=9;return}return K(t,n,r,i,a,o,s,c,e)}}else if(e<12){let l=R[z++],u=R[z++];if((l&128)>0||(u&128)>0){z-=10;return}if(e<11)return K(t,n,r,i,a,o,s,c,l,u);let d=R[z++];if((d&128)>0){z-=11;return}return K(t,n,r,i,a,o,s,c,l,u,d)}else{let l=R[z++],u=R[z++],d=R[z++],f=R[z++];if((l&128)>0||(u&128)>0||(d&128)>0||(f&128)>0){z-=12;return}if(e<14){if(e===12)return K(t,n,r,i,a,o,s,c,l,u,d,f);{let e=R[z++];if((e&128)>0){z-=13;return}return K(t,n,r,i,a,o,s,c,l,u,d,f,e)}}else{let p=R[z++],m=R[z++];if((p&128)>0||(m&128)>0){z-=14;return}if(e<15)return K(t,n,r,i,a,o,s,c,l,u,d,f,p,m);let h=R[z++];if((h&128)>0){z-=15;return}return K(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}}}}}function pp(){let e=R[z++],t;if(e<192)t=e-160;else switch(e){case 217:t=R[z++];break;case 218:t=W.getUint16(z),z+=2;break;case 219:t=W.getUint32(z),z+=4;break;default:throw Error(`Expected string`)}return cp(t)}function mp(e){return B.copyBuffers?Uint8Array.prototype.slice.call(R,z,z+=e):R.subarray(z,z+=e)}function hp(e){let t=R[z++];if(U[t]){let n;return U[t](R.subarray(z,n=z+=e),e=>{z=e;try{return G()}finally{z=n}})}else throw Error(`Unknown extension type `+t)}var gp=Array(4096);function _p(){let e=R[z++];if(e>=160&&e<192){if(e-=160,Wf>=z)return Hf.slice(z-Uf,(z+=e)-Uf);if(!(Wf==0&&Rf<180))return ip(e)}else return z--,vp(G());let t=(e<<5^(e>1?W.getUint16(z):e>0?R[z]:0))&4095,n=gp[t],r=z,i=z+e-3,a,o=0;if(n&&n.bytes==e){for(;r<i;){if(a=W.getUint32(r),a!=n[o++]){r=1879048192;break}r+=4}for(i+=3;r<i;)if(a=R[r++],a!=n[o++]){r=1879048192;break}if(r===i)return z=r,n.string;i-=3,r=z}for(n=[],gp[t]=n,n.bytes=e;r<i;)a=W.getUint32(r),n.push(a),r+=4;for(i+=3;r<i;)a=R[r++],n.push(a);let s=e<16?fp(e):dp(e);return s==null?n.string=ip(e):n.string=s}function vp(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return e.toString();if(e==null)return e+``;if(B.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every(e=>[`string`,`number`,`boolean`,`bigint`].includes(typeof e)))return e.flat().toString();throw Error(`Invalid property type for record: ${typeof e}`)}var yp=(e,t)=>{let n=G().map(vp),r=e;t!==void 0&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let i=V[e];return i&&(i.isShared||Yf)&&((V.restoreStructures||=[])[e]=i),V[e]=n,n.read=tp(n,r),n.read()};U[0]=()=>{},U[0].noBuffer=!0,U[66]=e=>{let t=e.byteLength%8||8,n=BigInt(e[0]&128?e[0]-256:e[0]);for(let r=1;r<t;r++)n<<=BigInt(8),n+=BigInt(e[r]);if(e.byteLength!==t){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=(e,t)=>{let n=t-e;if(n<=40){let n=r.getBigUint64(e);for(let i=e+8;i<t;i+=8)n<<=BigInt(64),n|=r.getBigUint64(i);return n}let a=e+(n>>4<<3),o=i(e,a),s=i(a,t);return o<<BigInt((t-a)*8)|s};n=n<<BigInt((r.byteLength-t)*8)|i(t,r.byteLength)}return n};var bp={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError==`function`?AggregateError:null};U[101]=()=>{let e=G();if(!bp[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return bp[e[0]](e[1],{cause:e[2]})},U[105]=e=>{if(B.structuredClone===!1)throw Error(`Structured clone extension is disabled`);let t=W.getUint32(z-4);Gf||=new Map;let n=R[z],r;r=n>=144&&n<160||n==220||n==221?[]:n>=128&&n<144||n==222||n==223?new Map:(n>=199&&n<=201||n>=212&&n<=216)&&R[z+1]===115?new Set:{};let i={target:r};Gf.set(t,i);let a=G();if(i.used)Object.assign(r,a);else return i.target=a;if(r instanceof Map)for(let[e,t]of a.entries())r.set(e,t);if(r instanceof Set)for(let e of Array.from(a))r.add(e);return r},U[112]=e=>{if(B.structuredClone===!1)throw Error(`Structured clone extension is disabled`);let t=W.getUint32(z-4),n=Gf.get(t);return n.used=!0,n.target},U[115]=()=>new Set(G());var xp=[`Int8`,`Uint8`,`Uint8Clamped`,`Int16`,`Uint16`,`Int32`,`Uint32`,`Float32`,`Float64`,`BigInt64`,`BigUint64`].map(e=>e+`Array`),Sp=typeof globalThis==`object`?globalThis:window;U[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,r=xp[t];if(!r){if(t===16)return n;if(t===17)return new DataView(n);throw Error(`Could not find typed array for code `+t)}return new Sp[r](n)},U[120]=()=>{let e=G();return new RegExp(e[0],e[1])};var Cp=[];U[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=z;return z+=t-e.length,H=Cp,H=[pp(),pp()],H.position0=0,H.position1=0,H.postBundlePosition=z,z=n,G()},U[255]=e=>e.length==4?new Date((e[0]*16777216+(e[1]<<16)+(e[2]<<8)+e[3])*1e3):e.length==8?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+((e[3]&3)*4294967296+e[4]*16777216+(e[5]<<16)+(e[6]<<8)+e[7])*1e3):e.length==12?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+((e[4]&128?-281474976710656:0)+e[6]*1099511627776+e[7]*4294967296+e[8]*16777216+(e[9]<<16)+(e[10]<<8)+e[11])*1e3):new Date(`invalid`);function wp(e){B&&B._onSaveState&&B._onSaveState();let t=Rf,n=z,r=Vf,i=Uf,a=Wf,o=Hf,s=Bf,c=Gf,l=H,u=new Uint8Array(R.slice(0,Rf)),d=V,f=V.slice(0,V.length),p=B,m=Yf,h=e();return Rf=t,z=n,Vf=r,Uf=i,Wf=a,Hf=o,Bf=s,Gf=c,H=l,R=u,Yf=m,V=d,V.splice(0,V.length,...f),B=p,W=new DataView(R.buffer,R.byteOffset,R.byteLength),h}function Tp(){R=null,Gf=null,V=null}var Ep=Array(147);for(let e=0;e<256;e++)Ep[e]=+(`1e`+Math.floor(45.15-e*.30103));var Dp=new Zf({useRecords:!1});Dp.unpack,Dp.unpackMultiple,Dp.unpack;var Op={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};new Uint8Array(new Float32Array(1).buffer,0,4),Zf.SUPPORTS_STRUCT_HOOKS=!0;var kp;try{kp=new TextEncoder}catch{}var Ap,jp,Mp=typeof Buffer<`u`,Np=Mp?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,Pp=Mp?Buffer:Uint8Array,Fp=Mp?4294967296:2144337920,q,Ip,J,Y=0,X,Z=null,Lp=21760,Rp=/[\u0080-\uFFFF]/,zp=Symbol(`record-id`),Bp=class extends Zf{constructor(e){super(e),this.offset=0;let t,n,r,i,a=Pp.prototype.utf8Write?function(e,t){return q.utf8Write(e,t,q.byteLength-t)}:kp&&kp.encodeInto?function(e,t){return kp.encodeInto(e,q.subarray(t)).written}:!1,o=this;e||={};let s=e&&e.sequential,c=e.structures||e.saveStructures,l=e.maxSharedStructures;if(l??=c?32:0,l>8160)throw Error(`Maximum maxSharedStructure is 8160`);e.structuredClone&&e.moreTypes==null&&(this.moreTypes=!0);let u=e.maxOwnStructures;u??=c?32:64,!this.structures&&e.useRecords!=0&&(this.structures=[]);let d=l>32||u+l>64,f=l+64,p=l+u+64;if(p>8256)throw Error(`Maximum maxSharedStructure + maxOwnStructure is 8192`);let m=[],h=0,g=0;this.pack=this.encode=function(e,a){if(q||(q=new Np(8192),J=q.dataView||=new DataView(q.buffer,0,8192),Y=0),X=q.length-10,X-Y<2048?(q=new Np(q.length),J=q.dataView||=new DataView(q.buffer,0,q.length),X=q.length-10,Y=0):Y=Y+7&2147483640,t=Y,a&2048&&(Y+=a&255),i=o.structuredClone?new Map:null,o.bundleStrings&&typeof e!=`string`?(Z=[],Z.size=1/0):Z=null,r=o.structures,r){r.uninitialized&&(r=o._mergeStructures(o.getStructures()));let e=r.sharedLength||0;if(e>l)throw Error(`Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to `+r.sharedLength);if(!r.transitions){r.transitions=Object.create(null);for(let t=0;t<e;t++){let e=r[t];if(!e)continue;let n,i=r.transitions;for(let t=0,r=e.length;t<r;t++){let r=e[t];n=i[r],n||=i[r]=Object.create(null),i=n}i[zp]=t+64}this.lastNamedStructuresLength=e}s||(r.nextId=e+64)}n&&=!1;let c;try{o._writeStruct&&e&&typeof e==`object`?e.constructor===Object?ae(e):e.constructor!==Map&&!Array.isArray(e)&&!jp.some(t=>e instanceof t)?ae(e.toJSON?e.toJSON():e):_(e):_(e);let n=Z;if(Z&&Gp(t,_,0),i&&i.idsToInsert){let e=i.idsToInsert.sort((e,t)=>e.offset>t.offset?1:-1),r=e.length,a=-1;for(;n&&r>0;){let i=e[--r].offset+t;i<n.stringsPosition+t&&a===-1&&(a=0),i>n.position+t?a>=0&&(a+=6):(a>=0&&(J.setUint32(n.position+t,J.getUint32(n.position+t)+a),a=-1),n=n.previous,r++)}a>=0&&n&&J.setUint32(n.position+t,J.getUint32(n.position+t)+a),Y+=e.length*6,Y>X&&y(Y),o.offset=Y;let s=Wp(q.subarray(t,Y),e);return i=null,s}return o.offset=Y,a&512?(q.start=t,q.end=Y,q):q.subarray(t,Y)}catch(e){throw c=e,e}finally{if(r&&(ee(),n&&o.saveStructures)){let n=r.sharedLength||0,i=q.subarray(t,Y),s=(o._prepareStructures||Kp)(r,o);if(!c)return o.saveStructures(s,s.isCompatible)===!1?o.pack(e,a):(o.lastNamedStructuresLength=n,q.length>1073741824&&(q=null),i)}q.length>1073741824&&(q=null),a&1024&&(Y=t)}};let ee=()=>{g<10&&g++;let e=r.sharedLength||0;if(r.length>e&&!s&&(r.length=e),h>1e4)r.transitions=null,g=0,h=0,m.length>0&&(m=[]);else if(m.length>0&&!s){for(let e=0,t=m.length;e<t;e++)m[e][zp]=0;m=[]}},te=e=>{var t=e.length;t<16?q[Y++]=144|t:t<65536?(q[Y++]=220,q[Y++]=t>>8,q[Y++]=t&255):(q[Y++]=221,J.setUint32(Y,t),Y+=4);for(let n=0;n<t;n++)_(e[n])},_=e=>{Y>X&&(q=y(Y));var n=typeof e,r;if(n===`string`){let n=e.length;if(Z&&n>=4&&n<4096){if((Z.size+=n)>Lp){let e,n=(Z[0]?Z[0].length*3+Z[1].length:0)+10;Y+n>X&&(q=y(Y+n));let r;Z.position?(r=Z,q[Y]=200,Y+=3,q[Y++]=98,e=Y-t,Y+=4,Gp(t,_,0),J.setUint16(e+t-3,Y-t-e)):(q[Y++]=214,q[Y++]=98,e=Y-t,Y+=4),Z=[``,``],Z.previous=r,Z.size=0,Z.position=e}let r=Rp.test(e);Z[+!r]+=e,q[Y++]=193,_(r?-n:n);return}let i;i=n<32?1:n<256?2:n<65536?3:5;let o=n*3;if(Y+o>X&&(q=y(Y+o)),n<64||!a){let t,a,o,s=Y+i;for(t=0;t<n;t++)a=e.charCodeAt(t),a<128?q[s++]=a:a<2048?(q[s++]=a>>6|192,q[s++]=a&63|128):(a&64512)==55296&&((o=e.charCodeAt(t+1))&64512)==56320?(a=65536+((a&1023)<<10)+(o&1023),t++,q[s++]=a>>18|240,q[s++]=a>>12&63|128,q[s++]=a>>6&63|128,q[s++]=a&63|128):(q[s++]=a>>12|224,q[s++]=a>>6&63|128,q[s++]=a&63|128);r=s-Y-i}else r=a(e,Y+i);r<32?q[Y++]=160|r:r<256?(i<2&&q.copyWithin(Y+2,Y+1,Y+1+r),q[Y++]=217,q[Y++]=r):r<65536?(i<3&&q.copyWithin(Y+3,Y+2,Y+2+r),q[Y++]=218,q[Y++]=r>>8,q[Y++]=r&255):(i<5&&q.copyWithin(Y+5,Y+3,Y+3+r),q[Y++]=219,J.setUint32(Y,r),Y+=4),Y+=r}else if(n===`number`)if(e>>>0===e)e<32||e<128&&this.useRecords===!1||e<64&&!this._writeStruct?q[Y++]=e:e<256?(q[Y++]=204,q[Y++]=e):e<65536?(q[Y++]=205,q[Y++]=e>>8,q[Y++]=e&255):(q[Y++]=206,J.setUint32(Y,e),Y+=4);else if(e>>0===e)e>=-32?q[Y++]=256+e:e>=-128?(q[Y++]=208,q[Y++]=e+256):e>=-32768?(q[Y++]=209,J.setInt16(Y,e),Y+=2):(q[Y++]=210,J.setInt32(Y,e),Y+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){q[Y++]=202,J.setFloat32(Y,e);let n;if(t<4||(n=e*Ep[(q[Y]&127)<<1|q[Y+1]>>7])>>0===n){Y+=4;return}else Y--}q[Y++]=203,J.setFloat64(Y,e),Y+=8}else if(n===`object`||n===`function`)if(!e)q[Y++]=192;else{if(i){let n=i.get(e);if(n){n.id||=(i.idsToInsert||=[]).push(n),q[Y++]=214,q[Y++]=112,J.setUint32(Y,n.id),Y+=4;return}else i.set(e,{offset:Y-t})}let a=e.constructor;if(a===Object)v(e);else if(a===Array)te(e);else if(a===Map)if(this.mapAsEmptyObject)q[Y++]=128;else{r=e.size,r<16?q[Y++]=128|r:r<65536?(q[Y++]=222,q[Y++]=r>>8,q[Y++]=r&255):(q[Y++]=223,J.setUint32(Y,r),Y+=4);for(let[t,n]of e)_(t),_(n)}else{for(let t=0,n=Ap.length;t<n;t++){let n=jp[t];if(e instanceof n){let n=Ap[t];if(n.write){n.type&&(q[Y++]=212,q[Y++]=n.type,q[Y++]=0);let t=n.write.call(this,e);t===e?Array.isArray(e)?te(e):v(e):_(t);return}let r=q,i=J,a=Y;q=null;let o;try{o=n.pack.call(this,e,e=>(q=r,r=null,Y+=e,Y>X&&y(Y),{target:q,targetView:J,position:Y-e}),_)}finally{r&&(q=r,J=i,Y=a,X=q.length-10)}o&&(o.length+Y>X&&y(o.length+Y),Y=Up(o,q,Y,n.type));return}}if(Array.isArray(e))te(e);else{if(e.toJSON){let t=e.toJSON();if(t!==e)return _(t)}if(n===`function`)return _(this.writeFunction&&this.writeFunction(e));v(e)}}}else if(n===`boolean`)q[Y++]=e?195:194;else if(n===`bigint`){if(e<0x8000000000000000&&e>=-0x8000000000000000)q[Y++]=211,J.setBigInt64(Y,e);else if(e<0x10000000000000000&&e>0)q[Y++]=207,J.setBigUint64(Y,e);else if(this.largeBigIntToFloat)q[Y++]=203,J.setFloat64(Y,Number(e));else if(this.largeBigIntToString)return _(e.toString());else if(this.useBigIntExtension||this.moreTypes){let t=BigInt(e<0?-1:0),n;if(e>>BigInt(65536)===t){let r=BigInt(0x10000000000000000)-BigInt(1),i=[];for(;i.push(e&r),e>>BigInt(63)!==t;)e>>=BigInt(64);n=new Uint8Array(new BigUint64Array(i).buffer),n.reverse()}else{let t=e<0,r=(t?~e:e).toString(16);if(r.length%2?r=`0`+r:parseInt(r.charAt(0),16)>=8&&(r=`00`+r),Mp)n=Buffer.from(r,`hex`);else{n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++)n[e]=parseInt(r.slice(e*2,e*2+2),16)}if(t)for(let e=0;e<n.length;e++)n[e]=~n[e]}n.length+Y>X&&y(n.length+Y),Y=Up(n,q,Y,66);return}else throw RangeError(e+` was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string`);Y+=8}else if(n===`undefined`)this.encodeUndefinedAsNil?q[Y++]=192:(q[Y++]=212,q[Y++]=0,q[Y++]=0);else throw Error(`Unknown type: `+n)},ne=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?e=>{let t;if(this.skipValues){t=[];for(let n in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(n))&&!this.skipValues.includes(e[n])&&t.push(n)}else t=Object.keys(e);let n=t.length;n<16?q[Y++]=128|n:n<65536?(q[Y++]=222,q[Y++]=n>>8,q[Y++]=n&255):(q[Y++]=223,J.setUint32(Y,n),Y+=4);let r;if(this.coercibleKeyAsNumber)for(let i=0;i<n;i++){r=t[i];let n=Number(r);_(isNaN(n)?r:n),_(e[r])}else for(let i=0;i<n;i++)_(r=t[i]),_(e[r])}:e=>{q[Y++]=222;let n=Y-t;Y+=2;let r=0;for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(_(t),_(e[t]),r++);if(r>65535)throw Error(`Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object`);q[n+++t]=r>>8,q[n+t]=r&255},re=this.useRecords===!1?ne:e.progressiveRecords&&!d?e=>{let n,i=r.transitions||=Object.create(null),a=Y++-t,o;for(let s in e)if(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(s)){if(n=i[s],n)i=n;else{let c=Object.keys(e),l=i;i=r.transitions;let u=0;for(let e=0,t=c.length;e<t;e++){let t=c[e];n=i[t],n||(n=i[t]=Object.create(null),u++),i=n}a+t+1==Y?(Y--,b(i,c,u)):oe(i,c,a,u),o=!0,i=l[s]}_(e[s])}if(!o){let n=i[zp];n?q[a+t]=n:oe(i,Object.keys(e),a,0)}}:e=>{let t,n=r.transitions||=Object.create(null),i=0;for(let r in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(r))&&(t=n[r],t||(t=n[r]=Object.create(null),i++),n=t);let a=n[zp];a?a>=96&&d?(q[Y++]=((a-=96)&31)+96,q[Y++]=a>>5):q[Y++]=a:b(n,n.__keys__||Object.keys(e),i);for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&_(e[t])},ie=typeof this.useRecords==`function`&&this.useRecords,v=ie?e=>{ie(e)?re(e):ne(e)}:re,ae=e=>{let i=o._writeStruct(e,q,t,Y,r,y,(e,t,r)=>{if(r)return n=!0;Y=t;let i=q;return _(e),ee(),i===q?Y:{position:Y,targetView:J,target:q}});if(i===0)return v(e);Y=i},y=e=>{let n;if(e>16777216){if(e-t>Fp)throw Error(`Packed buffer would be larger than maximum buffer size`);n=Math.min(Fp,Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096)*4096)}else n=(Math.max(e-t<<2,q.length-1)>>12)+1<<12;let r=new Np(n);return J=r.dataView||=new DataView(r.buffer,0,n),e=Math.min(e,q.length),q.copy?q.copy(r,0,t,e):r.set(q.slice(t,e)),Y-=t,t=0,X=r.length-10,q=r},b=(e,t,i)=>{let a=r.nextId;a||=64,a<f&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(a=r.nextOwnId,a<p||(a=f),r.nextOwnId=a+1):(a>=p&&(a=f),r.nextId=a+1);let o=t.highByte=a>=96&&d?a-96>>5:-1;e[zp]=a,e.__keys__=t,r[a-64]=t,a<f?(t.isShared=!0,r.sharedLength=a-63,n=!0,o>=0?(q[Y++]=(a&31)+96,q[Y++]=o):q[Y++]=a):(o>=0?(q[Y++]=213,q[Y++]=114,q[Y++]=(a&31)+96,q[Y++]=o):(q[Y++]=212,q[Y++]=114,q[Y++]=a),i&&(h+=g*i),m.length>=u&&(m.shift()[zp]=0),m.push(e),_(t))},oe=(e,n,r,i)=>{let a=q,o=Y,s=X,c=t;q=Ip,Y=0,t=0,q||(Ip=q=new Np(8192)),X=q.length-10,b(e,n,i),Ip=q;let l=Y;if(q=a,Y=o,X=s,t=c,l>1){let e=Y+l-1;e>X&&y(e);let n=r+t;q.copyWithin(n+l,n+1,Y),q.set(Ip.slice(0,l),n),Y=e}else q[r+t]=Ip[0]}}useBuffer(e){q=e,q.dataView||=new DataView(q.buffer,q.byteOffset,q.byteLength),J=q.dataView,Y=0}set position(e){Y=e}get position(){return Y}clearSharedData(){this.structures&&=[],this.typedStructs&&=[]}};jp=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,qf],Ap=[{pack(e,t,n){let r=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&r>=0&&r<4294967296){let{target:e,targetView:n,position:i}=t(6);e[i++]=214,e[i++]=255,n.setUint32(i,r)}else if(r>0&&r<4294967296){let{target:n,targetView:i,position:a}=t(10);n[a++]=215,n[a++]=255,i.setUint32(a,e.getMilliseconds()*4e6+(r/1e3/4294967296>>0)),i.setUint32(a+4,r)}else if(isNaN(r)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:e,targetView:r,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:n,targetView:i,position:a}=t(15);n[a++]=199,n[a++]=12,n[a++]=255,i.setUint32(a,e.getMilliseconds()*1e6),i.setBigInt64(a+4,BigInt(Math.floor(r)))}}},{pack(e,t,n){if(this.setAsEmptyObject)return t(0),n({});let r=Array.from(e),{target:i,position:a}=t(this.moreTypes?3:0);this.moreTypes&&(i[a++]=212,i[a++]=115,i[a++]=0),n(r)}},{pack(e,t,n){let{target:r,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(r[i++]=212,r[i++]=101,r[i++]=0),n([e.name,e.message,e.cause])}},{pack(e,t,n){let{target:r,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(r[i++]=212,r[i++]=120,r[i++]=0),n([e.source,e.flags])}},{pack(e,t){this.moreTypes?Vp(e,16,t):Hp(Mp?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==Pp&&this.moreTypes?Vp(e,xp.indexOf(n.name),t):Hp(e,t)}},{pack(e,t){this.moreTypes?Vp(e,17,t):Hp(Mp?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:r}=t(1);n[r]=193}}];function Vp(e,t,n,r){let i=e.byteLength;if(i+1<256){var{target:a,position:o}=n(4+i);a[o++]=199,a[o++]=i+1}else if(i+1<65536){var{target:a,position:o}=n(5+i);a[o++]=200,a[o++]=i+1>>8,a[o++]=i+1&255}else{var{target:a,position:o,targetView:s}=n(7+i);a[o++]=201,s.setUint32(o,i+1),o+=4}a[o++]=116,a[o++]=t,e.buffer||(e=new Uint8Array(e)),a.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function Hp(e,t){let n=e.byteLength;var r,i;if(n<256){var{target:r,position:i}=t(n+2);r[i++]=196,r[i++]=n}else if(n<65536){var{target:r,position:i}=t(n+3);r[i++]=197,r[i++]=n>>8,r[i++]=n&255}else{var{target:r,position:i,targetView:a}=t(n+5);r[i++]=198,a.setUint32(i,n),i+=4}r.set(e,i)}function Up(e,t,n,r){let i=e.length;switch(i){case 1:t[n++]=212;break;case 2:t[n++]=213;break;case 4:t[n++]=214;break;case 8:t[n++]=215;break;case 16:t[n++]=216;break;default:i<256?(t[n++]=199,t[n++]=i):i<65536?(t[n++]=200,t[n++]=i>>8,t[n++]=i&255):(t[n++]=201,t[n++]=i>>24,t[n++]=i>>16&255,t[n++]=i>>8&255,t[n++]=i&255)}return t[n++]=r,t.set(e,n),n+=i,n}function Wp(e,t){let n,r=t.length*6,i=e.length-r;for(;n=t.pop();){let t=n.offset,a=n.id;e.copyWithin(t+r,t,i),r-=6;let o=t+r;e[o++]=214,e[o++]=105,e[o++]=a>>24,e[o++]=a>>16&255,e[o++]=a>>8&255,e[o++]=a&255,i=t}return e}function Gp(e,t,n){if(Z.length>0){J.setUint32(Z.position+e,Y+n-Z.position-e),Z.stringsPosition=Y-e;let r=Z;Z=null,t(r[0]),t(r[1])}}function Kp(e,t){return e.isCompatible=e=>{let n=!e||(t.lastNamedStructuresLength||0)===e.length;return n||t._mergeStructures(e),n},e}Bp.SUPPORTS_STRUCT_HOOKS=!0;var qp=new Bp({useRecords:!1});qp.pack,qp.pack;var{NEVER:Jp,ALWAYS:Yp,DECIMAL_ROUND:Xp,DECIMAL_FIT:Zp}=Op,Qp=class extends v()(`effect/rpc/RpcSerialization`){},$p=(e=>Qp.of({contentType:`application/msgpack`,includesFraming:!0,makeUnsafe:()=>{let t=new Zf(e),n=new Bp(e),r=new TextEncoder,i;return{decode(e){let n=typeof e==`string`?r.encode(e):e;if(i!==void 0){let t=n;e=new Uint8Array(i.length+n.length),e.set(i),e.set(t,i.length),n=e,i=void 0}try{return t.unpackMultiple(n)}catch(e){let t=e;if(t.incomplete)return i=n.subarray(t.lastPosition),t.values??[];throw e}},encode:e=>n.pack(e)}}}))({useRecords:!0}),em=bi(Qp)($p),tm=e=>D(()=>{let t=new Set,n=new Map,r=new Map,i=(e,t)=>Qr(r=>{let i=n.get(e);return i||(i=[],n.set(e,i)),i.push([t,r]),w});return C(e((e,t)=>{let n=r.get(e);return n?n(t):i(e,t)},t),e=>({...e,run(e,i){return b(function*(){t.add(e),r.set(e,i);let a=n.get(e);if(a){n.delete(e);for(let[e,t]of a)yield*Re(D(()=>i(e)),t)}return yield*Lt($i,()=>(t.delete(e),r.delete(e),w))})}}))}),nm=BigInt(0),rm=P(function*(e,t){let n=t?.spanPrefix??`RpcClient`,r=t?.supportsAck??!0,i=t?.disableTracing??!1,a=t?.generateRequestId??(()=>nm++),o=yield*Zn(),s=l(o,li),c=new Map,u=!1;yield*mr(s,Dt(e=>(u=!0,d(Tn(e.id)))));let d=P(function*(e){for(let[t,n]of c)c.delete(t),n._tag===`Queue`?yield*e._tag===`Success`?Wa(n.queue):Ha(n.queue,e.cause):n.resume(e)}),p=e=>{let r=xf(e.successSchema),a=g(e);return(o,s)=>{let c=s?.headers?fu(s.headers):du,l=s?.context??wr();if(!r){let r=t=>m(e,a,t,e.payloadSchema.make(o),c,l,s?.discard??!1);return i?r(void 0):Vi(`${n}.${e._tag}`,{attributes:t.spanAttributes},r)}let u=h(e,a,e.payloadSchema.make(o),c,s?.streamBufferSize??16,l);return s?.asQueue?u:ys(C(u,gs))}},m=(e,n,r,i,o,s,l)=>Dt(d=>{if(u)return Er;let f=a(),p=n(e=>t.onFromClient({message:e,context:s,discard:l}),{_tag:`Request`,id:f,tag:e._tag,payload:i,...r?{traceId:r.traceId,spanId:r.spanId,sampled:r.sampled}:{},headers:gu(d.getRef(cm),o)});if(l)return p;let m;return we(Mn(t=>{let n={_tag:`Effect`,rpc:e,context:s,resume(e){t(e),m&&!m.pollUnsafe()&&d.currentDispatcher.scheduleTask(()=>{m.interruptUnsafe(d.id)},0)}};c.set(f,n),m=p.pipe(r?le(r,{captureStackTrace:!1}):E,ht(d.context)),m.addObserver(e=>{if(e._tag===`Failure`)return t(e)})}),e=>(c.delete(f),ui(na(m),ee(f,Array.from(e),s))))}),h=P(function*(e,r,o,s,l,d){if(u)return yield*Er;let p=i?void 0:yield*tt(`${n}.${e._tag}`,{attributes:t.spanAttributes}),m=ia(),h=a(),g=Ke(m.context,li);yield*yn(g,e=>c.has(h)?(c.delete(h),ee(h,Ct(e)?Array.from(He(e.cause)):[],d)):w);let te=yield*La(l);return c.set(h,{_tag:`Queue`,rpc:e,queue:te,scope:g,context:d}),yield*r(e=>t.onFromClient({message:e,context:d,discard:!1}),{_tag:`Request`,id:h,tag:e._tag,payload:o,...p?{traceId:p.traceId,spanId:p.spanId,sampled:p.sampled}:{},headers:gu(m.getRef(cm),s)}).pipe(p?le(p,{captureStackTrace:!1}):E,Ar(e=>Ha(te,e)),f,kt(g,{startImmediately:!0})),te}),g=e=>{let t=[];for(let n of e.middlewares.values()){let e=o.mapUnsafe.get(`${n.key}/Client`);e&&t.push(e)}return t.length===0?(e,t)=>e(t):function n(r,i,a=t.length-1){return a===-1?r(i):t[a]({rpc:e,request:i,next(e){return n(r,e,a-1)}})}},ee=(e,n,r)=>Mn(i=>{let a=ia();t.onFromClient({message:{_tag:`Interrupt`,requestId:e,interruptors:n},context:r,discard:!1}).pipe(Xr(1e3),ht(a.context)).addObserver(()=>{i(w)})}),te=e=>{switch(e._tag){case`Chunk`:{let n=e.requestId,i=c.get(n);return!i||i._tag!==`Queue`?w:Ba(i.queue,e.values).pipe(r?M(()=>t.onFromClient({message:{_tag:`Ack`,requestId:e.requestId},context:i.context,discard:!1})):E,Ar(e=>Ha(i.queue,e)))}case`Exit`:{let t=e.requestId,n=c.get(t);return n?(c.delete(t),n._tag===`Effect`?(n.resume(e.exit),w):e.exit._tag===`Success`?Wa(n.queue):Ha(n.queue,e.exit.cause)):w}case`Defect`:return d(pn(e.defect));case`ClientEnd`:return w}},_;if(t.flatten){let t=new Map;_=function(n,r,i){let a=t.get(n);return a||(a=p(e.requests.get(n)),t.set(n,a)),a(r,i)}}else _={},e.requests.forEach(e=>{_[e._tag]=p(e)});return{client:_,write:te}}),im=0,am=P(function*(e,t){let n=im++,{run:r,send:i,supportsAck:a,supportsTransferables:o}=yield*lm,s=new Map,{client:c,write:l}=yield*rm(e,{...t,supportsAck:a,onFromClient({message:t}){switch(t._tag){case`Request`:{let r=e.requests.get(t.tag),a=o?gf():void 0,c=ia(),l={rpc:r,context:a?nt(c.context,hf,a):c.context,schemas:sm(r)};return s.set(t.id,l),l.schemas.encodePayload(t.payload).pipe(Re(l.context),Nt,M(e=>i(n,{...t,id:String(t.id),payload:e,headers:Object.entries(t.headers)},a&&a.readUnsafe())))}case`Ack`:return s.get(t.requestId)?i(n,{_tag:`Ack`,requestId:String(t.requestId)}):w;case`Interrupt`:return s.get(t.requestId)?(s.delete(t.requestId),i(n,{_tag:`Interrupt`,requestId:String(t.requestId)})):w;case`Eof`:return w}}});return yield*r(n,e=>{switch(e._tag){case`Chunk`:{let t=Ff(e.requestId),n=s.get(t);return!n||Ni(n.schemas.decodeChunk)?w:n.schemas.decodeChunk.value(e.values).pipe(Re(n.context),Nt,M(t=>l({_tag:`Chunk`,clientId:0,requestId:Ff(e.requestId),values:t})),g(t=>l({_tag:`Exit`,clientId:0,requestId:Ff(e.requestId),exit:qi(t)})))}case`Exit`:{let t=Ff(e.requestId),n=s.get(t);return n?(s.delete(t),n.schemas.decodeExit(e.exit).pipe(Re(n.context),Nt,yt({onSuccess:e=>l({_tag:`Exit`,clientId:0,requestId:t,exit:e}),onFailure:e=>l({_tag:`Exit`,clientId:0,requestId:t,exit:qi(e)})}))):w}case`Defect`:return l({_tag:`Defect`,clientId:0,defect:hm(e.defect)});case`ClientProtocolError`:{let t=Mi(e.error);return wt(s.keys(),e=>l({_tag:`Exit`,clientId:0,requestId:e,exit:t}))}default:return w}}).pipe(Ar(Ye),f,ue),c}),om=new WeakMap,sm=e=>{let t=om.get(e);return t===void 0?(t={decodeChunk:se(Sf(e.successSchema),e=>de(Rt(xn(e.success)))),encodePayload:Te(Rt(e.payloadSchema)),decodeExit:de(Rt(kf(e)))},om.set(e,t),t):t},cm=ce(`effect/rpc/RpcClient/CurrentHeaders`,{defaultValue:()=>du}),lm=class extends v()(`effect/rpc/RpcClient/Protocol`){static make=tm},um=e=>lm.make(P(function*(t,n){let r=yield*qd,i=yield*Qp,a=yield*Ur(mm),o=new Map,s=yield*r.writer,c=i.makeUnsafe(),l=yield*fm(s(c.encode(If))),u,d=D(()=>(u=void 0,Tt(a)?a.value.onConnect:w)),f=e=>wt(n,n=>t(n,e));return yield*D(()=>(c=i.makeUnsafe(),l.reset(),r.runRaw(e=>{try{let n=c.decode(e);if(n.length===0)return;let r=0;return Fi({while:()=>r<n.length,body:()=>{let e=n[r++];if(e._tag===`Pong`)return l.onPong(),w;if(`requestId`in e){let n=o.get(e.requestId);if(n!==void 0)return e._tag===`Exit`&&o.delete(e.requestId),t(n,e)}return f(e)},step:Ln})}catch(e){return f({_tag:`ClientProtocolError`,error:new Pf({reason:new Nf({message:`Error decoding message`,cause:e})})})}},{onOpen:d}).pipe(Pe(M(l.timeout,()=>ir(new sf({reason:new rf({kind:`Timeout`,cause:Error(`ping timeout`)})}))))))).pipe(M(()=>ir(new sf({reason:new af({code:1e3})}))),Tt(a)?ur(a.value.onDisconnect):E,Jn(t=>{let n=et(t),r=$n(n);return e?.retryTransientErrors&&r&&n.success.reason._tag===`SocketOpenError`?w:(u=new Pf({reason:r?n.success.reason:new Nf({message:`Unknown socket error`,cause:h(t)})}),f({_tag:`ClientProtocolError`,error:u}))}),tn(e?.retryPolicy??dm),hr({module:`RpcClient`,method:`makeProtocolSocket`}),ue),{send(e,t){if(u)return ir(u);t._tag===`Request`&&o.set(t.id,e);let n=c.encode(t);return n===void 0?w:Nt(s(n))},supportsAck:!0,supportsTransferables:!1}})),dm=Tr(500,1.5).pipe(rt(u(5e3))),fm=P(function*(e){let t=!0,n=oa();return yield*D(()=>t?(t=!1,e):n.open).pipe(Ir(`5 seconds`),at,ne,f,ue),{timeout:n.await,reset:()=>{t=!0,n.closeUnsafe()},onPong:()=>{t=!0}}}),pm=e=>Ie(lm)(um(e)),mm=class extends v()(`effect/rpc/RpcClient/ConnectionHooks`){},hm=Xe(O),gm=()=>(e,t)=>{let n=v()(e),r=Ie(n,t.makeEffect??am(t.group,{...t,flatten:!0}));n.runtime=(t.runtime??Ol)(typeof t.protocol==`function`?e=>i(r,pt(t.protocol(e))):i(r,pt(t.protocol))),n.mutation=Rl(e=>{let r=t.group.requests.get(e);return n.runtime.fn()(P(function*({headers:t,payload:r,reactivityKeys:i}){let a=(yield*n)(e,r,{headers:t});return yield*i?_c(a,i):a})).pipe(Wl({key:`AtomRpc:mutation:${e}`,schema:Vc({success:r.successSchema,error:_m(r)})}))});let a=Rl(e=>{let{headers:r,payload:i,reactivityKeys:a,tag:o,timeToLive:s}=e,c=t.group.requests.get(o),l=xf(c.successSchema),u=l?n.runtime.pull(ys(n.use(e=>A(e(o,i,{headers:r}))))):n.runtime.atom(n.use(e=>e(o,i,{headers:r})));return!l&&e.serializationKey&&(u=Wl(u,{key:`AtomRpc:${e.tag}:${e.serializationKey}`,schema:Vc({success:c.successSchema,error:_m(c)})})),s&&(u=St(s)?ul(u,s):zl(u)),a?n.runtime.factory.withReactivity(a)(u):u});return n.query=(e,t,n)=>a({tag:e,payload:t,headers:n?.headers?fu(n.headers):void 0,reactivityKeys:n?.reactivityKeys,timeToLive:n?.timeToLive?Bi(n.timeToLive):void 0,serializationKey:n?.serializationKey}),n},_m=e=>Sr([e.errorSchema,...Array.from(e.middlewares,e=>e.error),Pf]),vm=ce(`effect/http/FetchHttpClient/Fetch`,{defaultValue:()=>globalThis.fetch}),ym=class extends v()(`effect/http/FetchHttpClient/RequestInit`){},bm=jd(A(Dd((e,t,n,r)=>{let i=r.getRef(vm),a=r.context.mapUnsafe.get(ym.key)??{},o=a.headers?gu(fu(a.headers),e.headers):e.headers;o[`content-length`]&&(o=_u(o,`content-length`));let s=r=>C(tr({try:()=>i(t,{...a,method:e.method,headers:o,body:r,duplex:e.body._tag===`Stream`?`half`:void 0,signal:n}),catch:t=>new Ku({reason:new Yu({request:e,cause:t})})}),t=>yd(e,t));switch(e.body._tag){case`Raw`:case`Uint8Array`:return s(e.body.body);case`FormData`:return s(e.body.formData);case`Stream`:return M(ks(e.body.stream),s)}return s(void 0)}))),xm={add(...e){let t=new Map(this.requests);for(let n of e)t.set(n._tag,n);return Sm({requests:t,annotations:this.annotations})},merge(...e){let t=new Map(this.requests),n=new Map(this.annotations.mapUnsafe);for(let r of e){for(let[e,n]of r.requests)t.set(e,n);for(let[e,t]of r.annotations.mapUnsafe)n.set(e,t)}return Sm({requests:t,annotations:st(n)})},omit(...e){let t=new Map(this.requests);for(let n of e)t.delete(n);return Sm({requests:t,annotations:this.annotations})},middleware(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.middleware(e));return Sm({requests:t,annotations:this.annotations})},toHandlers(e){let t=this;return b(function*(){let n=yield*Zn(),r=xr(e)?yield*e:e,i=new Map;for(let[e,a]of Object.entries(r)){let r=t.requests.get(e);i.set(r.key,{tag:r._tag,handler:a,context:n})}return st(i)})},prefix(e){let t=new Map;for(let n of this.requests.values()){let r=n.prefix(e);t.set(r._tag,r)}return Sm({requests:t,annotations:this.annotations})},toLayer(e){return ni(this.toHandlers(e))},of:E,toLayerHandler(e,t){let n=this;return ni(b(function*(){let r=yield*Zn(),i=xr(t)?yield*t:t,a=new Map,o=n.requests.get(e);return a.set(o.key,{handler:i,context:r}),st(a)}))},accessHandler(e){return Qr(t=>{let n=this.requests.get(e),{handler:r,context:i}=t.mapUnsafe.get(n.key);return A((e,t)=>{t.rpc=n;let a=r(e,t),o=jf(a)?a.value:a;return xr(o)?xe(o,i):Ts(o,i)})})},annotate(e,t){return Sm({requests:this.requests,annotations:nt(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(Qe(e,t))},annotateMerge(e){return Sm({requests:this.requests,annotations:pe(this.annotations,e)})},annotateRpcsMerge(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.annotateMerge(pe(e,r.annotations)));return Sm({requests:t,annotations:this.annotations})}},Sm=e=>Object.assign(function(){},xm,{requests:e.requests,annotations:e.annotations}),Cm=(...e)=>Sm({requests:new Map(e.map(e=>[e._tag,e])),annotations:wr()}),wm=class extends oe()(`GitError`,{cause:x(O),message:x(N)}){},Tm=Di([`added`,`deleted`,`modified`,`renamed`]),Em=Di([`staged-to-worktree`,`head-to-staged`]),Dm=class extends qr(`GitDiff`)({filePath:N,patch:N,status:Tm}){},Om=Sr([T({ref:N,type:cn(`ref`)}),T({base:N,type:cn(`merge-base`)})]),km=Sr([T({ref:N,type:cn(`ref`)}),T({type:cn(`worktree`)})]),Am=class extends qr(`GitCommit`)({hash:N,parents:Si(N),shortHash:N,subject:N,wip:Nn}){},jm=class extends qr(`GitReviewMetadata`)({base:N,commits:Si(Am),dirty:Nn}){},Mm=class extends qr(`GitRepository`)({gitDirectory:N,root:N}){},Nm=class extends qr(`GitBranch`)({name:N,remote:x(N),type:Di([`local`,`remote`])}){},Pm=class extends qr(`GitBranchesSnapshot`)({branches:Si(Nm),defaultBranch:N}){},Fm=class extends qr(`GitWorktreeStatus`)({ahead:Ri,behind:Ri,dirtyTracked:Nn,unpushedCommits:Nn,untracked:Nn}){},Im=class extends qr(`GitWorktree`)({branch:x(N),root:N,status:x(Fm)}){},Lm=class extends qr(`GitProject`)({repository:Mm,worktrees:Si(Im)}){},Rm=class extends oe()(`TerminalError`,{cause:x(O),message:x(N)}){},zm=Sr([T({data:N,type:cn(`data`)}),T({data:N,type:cn(`snapshot`)})]),Bm=class extends Cm(L(`projects.watch`,{stream:!0,success:Si(Lm)}),L(`projects.branches`,{error:wm,payload:T({cwd:N}),success:Pm}),L(`review.watch`,{error:wm,payload:T({cwd:N,scope:Em}),stream:!0,success:Si(Dm)}),L(`review.metadata`,{error:wm,payload:T({base:x(N),cwd:N}),success:jm}),L(`review.watchRange`,{error:wm,payload:T({cwd:N,from:Om,to:km}),stream:!0,success:Si(Dm)}),L(`review.createWipCommit`,{error:wm,payload:T({cwd:N,message:N})}),L(`review.commitAndPush`,{error:wm,payload:T({base:N,cwd:N,message:N})}),L(`review.stageFile`,{error:wm,payload:T({cwd:N,filePath:N})}),L(`review.unstageFile`,{error:wm,payload:T({cwd:N,filePath:N})}),L(`review.discardFile`,{error:wm,payload:T({cwd:N,filePath:N})}),L(`projects.createWorktree`,{error:wm,payload:T({baseBranch:N,branch:N,cwd:N,mode:Di([`existing-local`,`existing-remote`,`new-local`])}),success:N}),L(`projects.deleteWorktree`,{error:wm,payload:T({cwd:N,force:Nn})}),L(`terminal.events`,{error:Rm,payload:T({cwd:N}),stream:!0,success:zm}),L(`terminal.input`,{error:Rm,payload:T({cwd:N,data:N})}),L(`terminal.resize`,{error:Rm,payload:T({cols:Ri,cwd:N,rows:Ri})})){},Vm=`1.9.1`,Hm=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Um(e){let t=new Set([e]),n=new Set,r=e.match(Hm);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(Hm);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var Wm=Um(Vm),Gm=Vm.split(`.`)[0],Km=Symbol.for(`opentelemetry.js.api.${Gm}`),qm=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function Jm(e,t,n,r=!1){let i=qm[Km]=qm[Km]??{version:Vm};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Vm}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Vm}.`),!0}function Ym(e){let t=qm[Km]?.version;if(!(!t||!Wm(t)))return qm[Km]?.[e]}function Xm(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Vm}.`);let n=qm[Km];n&&delete n[e]}var Zm=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Qm(`debug`,this._namespace,e)}error(...e){return Qm(`error`,this._namespace,e)}info(...e){return Qm(`info`,this._namespace,e)}warn(...e){return Qm(`warn`,this._namespace,e)}verbose(...e){return Qm(`verbose`,this._namespace,e)}};function Qm(e,t,n){let r=Ym(`diag`);if(r)return r[e](t,...n)}var $m;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})($m||={});function eh(e,t){e<$m.NONE?e=$m.NONE:e>$m.ALL&&(e=$m.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,$m.ERROR),warn:n(`warn`,$m.WARN),info:n(`info`,$m.INFO),debug:n(`debug`,$m.DEBUG),verbose:n(`verbose`,$m.VERBOSE)}}var th=`diag`,nh=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=Ym(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:$m.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=Ym(`diag`),i=eh(n.logLevel??$m.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return Jm(`diag`,i,t,!0)},t.disable=()=>{Xm(th,t)},t.createComponentLogger=e=>new Zm(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},rh=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}},ih=Symbol(`BaggageEntryMetadata`),ah=nh.instance();function oh(e={}){return new rh(new Map(Object.entries(e)))}function sh(e){return typeof e!=`string`&&(ah.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:ih,toString(){return e}}}function ch(e){return Symbol.for(e)}var lh=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},uh=class{constructor(){}createGauge(e,t){return Sh}createHistogram(e,t){return Ch}createCounter(e,t){return xh}createUpDownCounter(e,t){return wh}createObservableGauge(e,t){return Eh}createObservableCounter(e,t){return Th}createObservableUpDownCounter(e,t){return Dh}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},dh=class{},fh=class extends dh{add(e,t){}},ph=class extends dh{add(e,t){}},mh=class extends dh{record(e,t){}},hh=class extends dh{record(e,t){}},gh=class{addCallback(e){}removeCallback(e){}},_h=class extends gh{},vh=class extends gh{},yh=class extends gh{},bh=new uh,xh=new fh,Sh=new mh,Ch=new hh,wh=new ph,Th=new _h,Eh=new vh,Dh=new yh;function Oh(){return bh}var kh;(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(kh||={});var Ah={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},jh={set(e,t,n){e!=null&&(e[t]=n)}},Mh=class{active(){return lh}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}},Nh=`context`,Ph=new Mh,Fh=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return Jm(Nh,e,nh.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return Ym(Nh)||Ph}disable(){this._getContextManager().disable(),Xm(Nh,nh.instance())}},Ih;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Ih||={});var Lh={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:Ih.NONE},Rh=class{constructor(e=Lh){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},zh=ch(`OpenTelemetry Context Key SPAN`);function Bh(e){return e.getValue(zh)||void 0}function Vh(){return Bh(Fh.getInstance().active())}function Hh(e,t){return e.setValue(zh,t)}function Uh(e){return e.deleteValue(zh)}function Wh(e,t){return Hh(e,new Rh(t))}function Gh(e){return Bh(e)?.spanContext()}var Kh=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function qh(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Kh[e.charCodeAt(t)]|0)+(Kh[e.charCodeAt(t+1)]|0)+(Kh[e.charCodeAt(t+2)]|0)+(Kh[e.charCodeAt(t+3)]|0);return n===t}function Jh(e){return qh(e,32)&&e!==`00000000000000000000000000000000`}function Yh(e){return qh(e,16)&&e!==`0000000000000000`}function Xh(e){return Jh(e.traceId)&&Yh(e.spanId)}function Zh(e){return new Rh(e)}var Qh=Fh.getInstance(),$h=class{startSpan(e,t,n=Qh.active()){if(t?.root)return new Rh;let r=n&&Gh(n);return eg(r)&&Xh(r)?new Rh(r):new Rh}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??Qh.active(),c=this.startSpan(e,i,s),l=Hh(s,c);return Qh.with(l,o,void 0,c)}};function eg(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var tg=new $h,ng=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):tg}},rg=new class{getTracer(e,t,n){return new $h}},ig=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new ng(this,e,t,n)}getDelegate(){return this._delegate??rg}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}},ag;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ag||={});var og;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(og||={});var sg;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(sg||={});var cg=Fh.getInstance(),Q=nh.instance(),lg=class{inject(e,t){}extract(e,t){return e}fields(){return[]}},ug=ch(`OpenTelemetry Baggage Key`);function dg(e){return e.getValue(ug)||void 0}function fg(){return dg(Fh.getInstance().active())}function pg(e,t){return e.setValue(ug,t)}function mg(e){return e.deleteValue(ug)}var hg=`propagation`,gg=new lg,_g=class e{constructor(){this.createBaggage=oh,this.getBaggage=dg,this.getActiveBaggage=fg,this.setBaggage=pg,this.deleteBaggage=mg}static getInstance(){return this._instance||=new e,this._instance}setGlobalPropagator(e){return Jm(hg,e,nh.instance())}inject(e,t,n=jh){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=Ah){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Xm(hg,nh.instance())}_getGlobalPropagator(){return Ym(hg)||gg}}.getInstance(),vg=`trace`,$=class e{constructor(){this._proxyTracerProvider=new ig,this.wrapSpanContext=Zh,this.isSpanContextValid=Xh,this.deleteSpan=Uh,this.getSpan=Bh,this.getActiveSpan=Vh,this.getSpanContext=Gh,this.setSpan=Hh,this.setSpanContext=Wh}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=Jm(vg,this._proxyTracerProvider,nh.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return Ym(vg)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){Xm(vg,nh.instance()),this._proxyTracerProvider=new ig}}.getInstance(),yg=ch(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function bg(e){return e.setValue(yg,!0)}function xg(e){return e.getValue(yg)===!0}var Sg=`baggage`,Cg=4096;function wg(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Tg(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Eg(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=sh(e.substring(t+1))),{key:o,value:s,metadata:c}}var Dg=class{inject(e,t,n){let r=_g.getBaggage(e);if(!r||xg(e))return;let i=wg(Tg(r).filter(e=>e.length<=Cg).slice(0,180));i.length>0&&n.set(t,Sg,i)}extract(e,t,n){let r=n.get(t,Sg),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=Eg(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:_g.setBaggage(e,_g.createBaggage(a))}fields(){return[Sg]}};function Og(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!kg(n)){Q.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ag(r)){Q.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function kg(e){return typeof e==`string`&&e!==``}function Ag(e){return e==null?!0:Array.isArray(e)?jg(e):Mg(typeof e)}function jg(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Mg(e)){t=e;continue}return!1}return!1}}return!0}function Mg(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Ng(){return e=>{Q.error(Pg(e))}}function Pg(e){return typeof e==`string`?e:JSON.stringify(Fg(e))}function Fg(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Ig=Ng();function Lg(e){try{Ig(e)}catch{}}var Rg=`2.7.1`,zg=`exception.message`,Bg=`exception.stacktrace`,Vg=`exception.type`,Hg=`service.name`,Ug=`service.version`,Wg=`telemetry.sdk.language`,Gg=`nodejs`,Kg=`webjs`,qg=`telemetry.sdk.name`,Jg=`telemetry.sdk.version`,Yg=`process.runtime.name`,Xg={[qg]:`opentelemetry`,[Yg]:`browser`,[Wg]:Kg,[Jg]:Rg},Zg=performance,Qg=9,$g=10**6,e_=10**Qg;function t_(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*$g)]}function n_(e){return c_(t_(Zg.timeOrigin),t_(typeof e==`number`?e:Zg.now()))}function r_(e){if(o_(e))return e;if(typeof e==`number`)return e<Zg.timeOrigin?n_(e):t_(e);if(e instanceof Date)return t_(e.getTime());throw TypeError(`Invalid input type`)}function i_(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=e_),[n,r]}function a_(e){return e[0]*e_+e[1]}function o_(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function s_(e){return o_(e)||typeof e==`number`||e instanceof Date}function c_(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=e_&&(n[1]-=e_,n[0]+=1),n}var l_;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(l_||={});var u_=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){Q.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){Q.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},d_=`[_0-9a-z-*/]`,f_=RegExp(`^(?:${`[a-z]${d_}{0,255}`}|${`[a-z0-9]${d_}{0,240}@[a-z]${d_}{0,13}`})$`),p_=/^[ -~]{0,255}[!-~]$/,m_=/,|=/;function h_(e){return f_.test(e)}function g_(e){return p_.test(e)&&!m_.test(e)}var __=32,v_=512,y_=`,`,b_=`=`,x_=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!h_(e)||!g_(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>v_)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=y_+e),e=`${n[0]}${b_}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(y_),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(b_);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!h_(a)||!g_(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>v_)&&(t.set(a,o),n=s,t.size>=__))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},S_=`traceparent`,C_=`tracestate`,w_=`00`,T_=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function E_(e){let t=T_.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var D_=class{inject(e,t,n){let r=$.getSpanContext(e);if(!r||xg(e)||!Xh(r))return;let i=`${w_}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||Ih.NONE).toString(16)}`;n.set(t,S_,i),r.traceState&&n.set(t,C_,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,S_);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=E_(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,C_);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new x_(typeof e==`string`?e:void 0)}return $.setSpanContext(e,a)}fields(){return[S_,C_]}},O_=`[object Object]`,k_=`[object Null]`,A_=`[object Undefined]`,j_=Function.prototype.toString,M_=j_.call(Object),N_=Object.getPrototypeOf,P_=Object.prototype,F_=P_.hasOwnProperty,I_=Symbol?Symbol.toStringTag:void 0,L_=P_.toString;function R_(e){if(!z_(e)||B_(e)!==O_)return!1;let t=N_(e);if(t===null)return!0;let n=F_.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&j_.call(n)===M_}function z_(e){return typeof e==`object`&&!!e}function B_(e){return e==null?e===void 0?A_:k_:I_&&I_ in Object(e)?V_(e):H_(e)}function V_(e){let t=F_.call(e,I_),n=e[I_],r=!1;try{e[I_]=void 0,r=!0}catch{}let i=L_.call(e);return r&&(t?e[I_]=n:delete e[I_]),i}function H_(e){return L_.call(e)}var U_=20;function W_(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=K_(t,e.shift(),0,n);return t}function G_(e){return J_(e)?e.slice():e}function K_(e,t,n=0,r){let i;if(!(n>U_)){if(n++,Z_(e)||Z_(t)||Y_(t))i=G_(t);else if(J_(e)){if(i=e.slice(),J_(t))for(let e=0,n=t.length;e<n;e++)i.push(G_(t[e]));else if(X_(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=G_(t[r]))}}}else if(X_(e))if(X_(t)){if(!Q_(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(Z_(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(q_(e,s,r)||q_(t,s,r))delete i[s];else{if(X_(a)&&X_(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=K_(i[s],c,n,r)}}}}else i=t;return i}}function q_(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function J_(e){return Array.isArray(e)}function Y_(e){return typeof e==`function`}function X_(e){return!Z_(e)&&!J_(e)&&!Y_(e)&&typeof e==`object`}function Z_(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Q_(e,t){return!(!R_(e)||!R_(t))}var $_=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function ev(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new $_(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}var tv=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},nv=class{_isCalled=!1;_deferred=new tv;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}};function rv(e,t){return new Promise(n=>{cg.with(bg(cg.active()),()=>{e.export(t,n)})})}var iv={_export:rv},av;function ov(){if(av===void 0)try{let e=globalThis.process.argv0;av=e?`unknown_service:${e}`:`unknown_service`}catch{av=`unknown_service`}return av}var sv=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,cv=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=dv(t),r._asyncAttributesPending=t.filter(([e,t])=>sv(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(sv(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=dv(this._rawAttributes),this._schemaUrl=fv(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,sv(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Q.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(sv(n)){Q.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=pv(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function lv(e,t){return cv.FromAttributeList(Object.entries(e),t)}function uv(){return lv({[Hg]:ov(),[Wg]:Xg[Wg],[qg]:Xg[qg],[Jg]:Xg[Jg]})}function dv(e){return e.map(([e,t])=>sv(t)?[e,t.catch(t=>{Q.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function fv(e){if(typeof e==`string`||e===void 0)return e;Q.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function pv(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;Q.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var mv=`exception`,hv=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:sg.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=Zg.now(),this._performanceOffset=t-(this._performanceStartTime+Zg.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return Q.warn(`Invalid attribute key: ${e}`),this;if(!Ag(t))return Q.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return Q.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&Q.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),s_(t)&&(s_(n)||(n=t),t=void 0);let i=Og(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&Q.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Og(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===sg.UNSET||this.status.code===sg.OK)return this;let t={code:e.code};return e.code===sg.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&Q.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){Q.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=i_(this.startTime,this.endTime),this._duration[0]<0&&(Q.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Q.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Q.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=Zg.now())return n_(e+this._performanceOffset);if(typeof e==`number`)return t_(e);if(e instanceof Date)return t_(e.getTime());if(o_(e))return e;if(this._startTimeProvided)return t_(Date.now());let t=Zg.now()-this._performanceStartTime;return c_(this.startTime,t_(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[zg]=e:e&&(e.code?n[Vg]=e.code.toString():e.name&&(n[Vg]=e.name),e.message&&(n[zg]=e.message),e.stack&&(n[Bg]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(mv,n,t):Q.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Q.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(Q.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},gv;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(gv||={});var _v=class{shouldSample(){return{decision:gv.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},vv=class{shouldSample(){return{decision:gv.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},yv=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(Lg(Error(`ParentBasedSampler must have a root sampler configured`)),new vv),this._remoteParentSampled=e.remoteParentSampled??new vv,this._remoteParentNotSampled=e.remoteParentNotSampled??new _v,this._localParentSampled=e.localParentSampled??new vv,this._localParentNotSampled=e.localParentNotSampled??new _v}shouldSample(e,t,n,r,i,a){let o=$.getSpanContext(e);return!o||!Xh(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&Ih.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&Ih.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},bv=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Jh(t)&&this._accumulate(t)<this._upperBound?gv.RECORD_AND_SAMPLED:gv.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},xv;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(xv||={});var Sv=1;function Cv(){return{sampler:wv(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function wv(){let e=xv.ParentBasedAlwaysOn;switch(e){case xv.AlwaysOn:return new vv;case xv.AlwaysOff:return new _v;case xv.ParentBasedAlwaysOn:return new yv({root:new vv});case xv.ParentBasedAlwaysOff:return new yv({root:new _v});case xv.TraceIdRatio:return new bv(Tv());case xv.ParentBasedTraceIdRatio:return new yv({root:new bv(Tv())});default:return Q.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${xv.ParentBasedAlwaysOn}".`),new yv({root:new vv})}}function Tv(){return Q.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Sv}.`),Sv}function Ev(e){let t={sampler:wv()},n=Cv(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function Dv(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var Ov=16,kv=8,Av=new Uint8Array(Ov),jv=new Uint8Array(kv),Mv=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Nv(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Pv(e){let t=``;for(let n=0;n<e.length;n++)t+=Mv[e[n]];return t}var Fv=class{generateTraceId(){return Nv(Av),Pv(Av)}generateSpanId(){return Nv(jv),Pv(jv)}},Iv=`otel.span.parent.origin`,Lv=`otel.span.sampling_result`,Rv=`otel.sdk.span.live`,zv=`otel.sdk.span.started`,Bv=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(zv,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(Rv,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Hv(t);if(this.startedSpans.add(1,{[Iv]:Vv(e),[Lv]:n}),t===gv.NOT_RECORD)return()=>{};let r={[Lv]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Vv(e){return e?e.isRemote?`remote`:`local`:`none`}function Hv(e){switch(e){case gv.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case gv.RECORD:return`RECORD_ONLY`;case gv.NOT_RECORD:return`DROP`}}var Uv=`2.7.1`,Wv=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=Ev(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Fv,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Uv):Oh();this._tracerMetrics=new Bv(a)}startSpan(e,t={},n=cg.active()){t.root&&(n=$.deleteSpan(n));let r=$.getSpan(n);if(xg(n))return Q.debug(`Instrumentation suppressed, returning Noop Span`),$.wrapSpanContext(Lh);let i=r?.spanContext(),a=this._idGenerator.generateSpanId(),o,s,c;!i||!$.isSpanContextValid(i)?s=this._idGenerator.generateTraceId():(s=i.traceId,c=i.traceState,o=i);let l=t.kind??og.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:Og(e.attributes)})),d=Og(t.attributes),f=this._sampler.shouldSample(n,s,e,l,d,u),p=this._tracerMetrics.startSpan(i,f.decision);c=f.traceState??c;let m=f.decision===ag.RECORD_AND_SAMPLED?Ih.SAMPLED:Ih.NONE,h={traceId:s,spanId:a,traceFlags:m,traceState:c};if(f.decision===ag.NOT_RECORD)return Q.debug(`Recording is off, propagating context in a non-recording span`),$.wrapSpanContext(h);let g=Og(Object.assign(d,f.attributes));return new hv({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:h,name:e,kind:l,links:u,parentSpanContext:o,attributes:g,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:p})}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??cg.active(),c=this.startSpan(e,i,s),l=$.setSpan(s,c);return cg.with(l,o,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},Gv=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{Lg(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},Kv;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(Kv||={});var qv=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=W_({},Cv(),Dv(e));this._resource=t.resource??uv(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Gv(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new Wv({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=Kv.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==Kv.timeout&&(r=Kv.resolved,n(r))}).catch(e=>{clearTimeout(i),r=Kv.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==Kv.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},Jv=class{_exporter;_shutdownOnce;_pendingExports;constructor(e){this._exporter=e,this._shutdownOnce=new nv(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Ih.SAMPLED)===0)return;let t=this._doExport(e).catch(e=>Lg(e));this._pendingExports.add(t),t.finally(()=>this._pendingExports.delete(t))}async _doExport(e){e.resource.asyncAttributesPending&&await e.resource.waitForAsyncAttributes?.();let t=await iv._export(this._exporter,[e]);if(t.code!==l_.SUCCESS)throw t.error??Error(`SimpleSpanProcessor: span export failed (status ${t})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}},Yv=class{_enabled=!1;_currentContext=lh;_bindFunction(e=lh,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=lh,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=lh,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||lh;try{return t.call(n,...r)}finally{this._currentContext=i}}};function Xv(e){if(e!==null){if(e===void 0){let e=new Yv;e.enable(),cg.setGlobalContextManager(e);return}e.enable(),cg.setGlobalContextManager(e)}}function Zv(e){if(e!==null){if(e===void 0){_g.setGlobalPropagator(new u_({propagators:[new D_,new Dg]}));return}_g.setGlobalPropagator(e)}}var Qv=class extends qv{constructor(e={}){super(e)}register(e={}){$.setGlobalTracerProvider(this),Zv(e.propagator),Xv(e.contextManager)}},$v=e=>e!==void 0&&!(Array.isArray(e)&&e.length===0),ey;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(ey||={});var ty=new class{emit(e){}enabled(){return!1}};function ny(e){return ry(e,new WeakSet)}function ry(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>ry(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>ry(e,t))}return!1}var iy=class{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;_attributesCount=0;_droppedAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=r_(r??f),this.hrTimeObserved=r_(i??f),d){let e=$.getSpanContext(d);e&&Xh(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return Q.warn(`Invalid attribute key: ${e}`),this;if(!ny(t))return Q.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&Q.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return Q.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(zg,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(Vg,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(Vg,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(zg,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(Bg,n.stack),t=!0)}t||Q.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&Q.warn(`Can not execute the operation on emitted log record`),this._isReadonly}},ay=class{instrumentationScope;_sharedState;_loggerConfig;constructor(e,t){this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=e.context||cg.active();if(!this.enabled(e))return;let n=new iy(this._sharedState,this.instrumentationScope,{context:t,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==ey.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||cg.active();if(t.traceBased){let e=$.getSpanContext(r);if(e&&Xh(e)&&(e.traceFlags&Ih.SAMPLED)!==Ih.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},oy=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}},sy=class{processors;forceFlushTimeoutMillis;constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>ev(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function cy(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var ly=`otel.sdk.log.created`,uy=class{createdLogs;constructor(e){this.createdLogs=e.createCounter(ly,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}},dy=`0.218.0`,fy={disabled:!1,minimumSeverity:ey.UNSPECIFIED,traceBased:!1},py=()=>({...fy}),my=class{loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];resource;forceFlushTimeoutMillis;logRecordLimits;processors;loggerMetrics;_loggerConfigurator;_loggerConfigs=new Map;constructor(e,t,n,r,i,a){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new sy(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new oy,this._loggerConfigurator=i??py;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,dy):Oh();this.loggerMetrics=new uy(o)}getLoggerConfig(e){let t=cy(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}},hy=class{_shutdownOnce;_sharedState;constructor(e={}){let t={resource:e.resource??uv(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??py,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new my(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new nv(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return Q.warn(`A shutdown LoggerProvider cannot provide a Logger`),ty;e||Q.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new ay({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(Q.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Q.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}},gy=It,_y=Lr,vy=(e,t)=>Ie(gy,_t(Bn(function*(n){let r=new Set(t?.mergeWithExisting===!0?n.getRef(It):[]);for(let t of e)r.add(Be(t)?yield*t:t);return r}))),yy=BigInt(1e9),by=e=>[Number(e/yy),Number(e%yy)],xy=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]=Sy(r);return t},Sy=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?e:typeof e==`bigint`?e.toString():jt(e),Cy=class extends v()(`@effect/opentelemetry/Resource`){},wy=e=>bi(Cy,lv(Ty(e))),Ty=e=>{let t={...e.attributes??void 0,[Hg]:e.serviceName,[qg]:`@effect/opentelemetry`,[Wg]:globalThis.document===void 0?Gg:Kg};return e.serviceVersion&&(t[Ug]=e.serviceVersion),t},Ey=class extends v()(`@effect/opentelemetry/Logger/OtelLoggerProvider`){},Dy=e=>{switch(e){case`Trace`:return ey.TRACE;case`Debug`:return ey.DEBUG;case`Info`:return ey.INFO;case`Warn`:return ey.WARN;case`Error`:return ey.ERROR;case`Fatal`:return ey.FATAL;default:return ey.UNSPECIFIED}},Oy=b(function*(){let e=yield*Ey,t=yield*Vt,n=e.getLogger(`@effect/opentelemetry`);return _y(e=>{let r={fiberId:e.fiber.id},i=vr(e.fiber.context,qn);vn(i)&&(r.spanId=i.spanId,r.traceId=i.traceId);for(let[t,n]of Object.entries(e.fiber.getRef(Ti)))r[t]=Sy(n);let a=e.date.getTime();for(let[t,n]of e.fiber.getRef(Rn))r[`logSpan.${t}`]=`${a-n}ms`;let o=ve(e.message).map(Sy),s=by(t.currentTimeNanosUnsafe());n.emit({body:o.length===1?o[0]:o,severityText:e.logLevel,severityNumber:Dy(e.logLevel),timestamp:s,observedTimestamp:s,attributes:r})})}),ky=e=>vy([Oy],{mergeWithExisting:e.mergeWithExisting??!0}),Ay=(e,t)=>Ie(Ey,b(function*(){let n=yield*Cy;return yield*Vr(j(()=>new hy({...t??void 0,processors:ve(e),resource:n})),e=>Ut(()=>e.forceFlush().then(()=>e.shutdown())).pipe(at,f,Nr(t?.shutdownTimeout??3e3)))})),jy;(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`})(jy||={});var My;(function(e){e.COUNTER=`COUNTER`,e.GAUGE=`GAUGE`,e.HISTOGRAM=`HISTOGRAM`,e.UP_DOWN_COUNTER=`UP_DOWN_COUNTER`,e.OBSERVABLE_COUNTER=`OBSERVABLE_COUNTER`,e.OBSERVABLE_GAUGE=`OBSERVABLE_GAUGE`,e.OBSERVABLE_UP_DOWN_COUNTER=`OBSERVABLE_UP_DOWN_COUNTER`})(My||={});var Ny;(function(e){e[e.HISTOGRAM=0]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=1]=`EXPONENTIAL_HISTOGRAM`,e[e.GAUGE=2]=`GAUGE`,e[e.SUM=3]=`SUM`})(Ny||={});var Py=`@effect/opentelemetry/Metrics`,Fy=class{resource;context;temporality;startTimes;startTimeNanos;previousExportTimeNanos;previousCounterState;previousHistogramState;previousFrequencyState;previousSummaryState;constructor(e,t,n=`cumulative`){this.resource=e,this.context=t,this.temporality=n,this.startTimes=new Map,this.startTimeNanos=Ly(),this.previousExportTimeNanos=this.startTimeNanos,this.previousCounterState=new Map,this.previousHistogramState=new Map,this.previousFrequencyState=new Map,this.previousSummaryState=new Map}startTimeFor(e,t){return this.startTimes.has(e)?this.startTimes.get(e):(this.startTimes.set(e,t),t)}collect(e){let t=ae(this.context),n=Ly(),r=[],i=new Map,a=e=>{r.push(e),i.set(e.descriptor.name,e)},o=this.temporality===`delta`,s=o?jy.DELTA:jy.CUMULATIVE,c=o?this.previousExportTimeNanos:this.startTimeNanos;for(let e=0,r=t.length;e<r;e++){let r=t[e],l=r.attributes?di(Object.entries(r.attributes),{},(e,[t,n])=>(e[t]=String(n),e)):{},u=Iy(r.id,r.attributes);switch(r.type){case`Counter`:{let e=r.state.count,t=e;if(o){let n=this.previousCounterState.get(u);if(n!==void 0)if(typeof e==`bigint`&&typeof n==`bigint`)t=e-n,t<BigInt(0)&&(t=e);else{let r=Number(e);t=r-Number(n),t<0&&(t=r)}this.previousCounterState.set(u,e)}let d=Ry(r,l),f={startTime:this.startTimeFor(d.name,c),endTime:n,attributes:l,value:Number(t)};i.has(r.id)?i.get(r.id).dataPoints.push(f):a({dataPointType:Ny.SUM,descriptor:d,isMonotonic:r.state.incremental,aggregationTemporality:s,dataPoints:[f]});break}case`Gauge`:{let e=Ry(r,l),t={startTime:this.startTimeFor(e.name,this.startTimeNanos),endTime:n,attributes:l,value:Number(r.state.value)};i.has(r.id)?i.get(r.id).dataPoints.push(t):a({dataPointType:Ny.GAUGE,descriptor:e,aggregationTemporality:jy.CUMULATIVE,dataPoints:[t]});break}case`Histogram`:{let e=r.state.buckets.length,t={boundaries:Ve(e-1),counts:Ve(e)},d=0,f=0;for(let[n,i]of r.state.buckets)d<e-1&&(t.boundaries[d]=n),t.counts[d]=i-f,f=i,d++;let p=r.state.count,m=r.state.sum,h=t.counts,g=r.state.min,ee=r.state.max;if(o){let e=this.previousHistogramState.get(u);e!==void 0&&(p=r.state.count-e.count,m=r.state.sum-e.sum,h=t.counts.map((t,n)=>Math.max(0,t-(e.bucketCounts[n]??0)))),this.previousHistogramState.set(u,{count:r.state.count,sum:r.state.sum,bucketCounts:t.counts.slice(),min:r.state.min,max:r.state.max})}let te=Ry(r,l),_={startTime:this.startTimeFor(te.name,c),endTime:n,attributes:l,value:{buckets:{boundaries:t.boundaries,counts:h},count:p,min:g,max:ee,sum:m}};i.has(r.id)?i.get(r.id).dataPoints.push(_):a({dataPointType:Ny.HISTOGRAM,descriptor:te,aggregationTemporality:s,dataPoints:[_]});break}case`Frequency`:{let e=[],t=new Map;for(let[i,a]of r.state.occurrences){t.set(i,a);let s=a;if(o){let e=this.previousFrequencyState.get(u);if(e!==void 0){let t=e.get(i)??0;s=Math.max(0,a-t)}}let d=Ry(r,l),f=this.startTimeFor(d.name,c);e.push({startTime:f,endTime:n,attributes:{...l,key:i},value:s})}if(o&&this.previousFrequencyState.set(u,t),i.has(r.id))i.get(r.id).dataPoints.push(...e);else{let t=Ry(r,l);a({dataPointType:Ny.SUM,descriptor:t,aggregationTemporality:s,isMonotonic:!0,dataPoints:e})}break}case`Summary`:{let e=[{startTime:c,endTime:n,attributes:{...l,quantile:`min`},value:r.state.min}];for(let[t,i]of r.state.quantiles)e.push({startTime:c,endTime:n,attributes:{...l,quantile:t.toString()},value:i??0});e.push({startTime:c,endTime:n,attributes:{...l,quantile:`max`},value:r.state.max});let t=r.state.count,d=r.state.sum;if(o){let e=this.previousSummaryState.get(u);e!==void 0&&(t=r.state.count-e.count,d=r.state.sum-e.sum),this.previousSummaryState.set(u,{count:r.state.count,sum:r.state.sum})}let f={startTime:c,endTime:n,attributes:l,value:t},p={startTime:c,endTime:n,attributes:l,value:d};if(i.has(`${r.id}_quantiles`))i.get(`${r.id}_quantiles`).dataPoints.push(...e),i.get(`${r.id}_count`).dataPoints.push(f),i.get(`${r.id}_sum`).dataPoints.push(p);else{let t=Ry(r,l);a({dataPointType:Ny.SUM,descriptor:{...t,name:`${t.name}_quantiles`},aggregationTemporality:s,isMonotonic:!1,dataPoints:e}),a({dataPointType:Ny.SUM,descriptor:{name:`${r.id}_count`,description:r.description??``,unit:`1`,type:My.COUNTER,valueType:kh.INT,advice:{}},aggregationTemporality:s,isMonotonic:!0,dataPoints:[f]}),a({dataPointType:Ny.SUM,descriptor:{name:`${r.id}_sum`,description:r.description??``,unit:`1`,type:My.COUNTER,valueType:kh.DOUBLE,advice:{}},aggregationTemporality:s,isMonotonic:!0,dataPoints:[p]})}break}}}return o&&(this.previousExportTimeNanos=n),Promise.resolve({resourceMetrics:{resource:this.resource,scopeMetrics:[{scope:{name:Py},metrics:r}]},errors:[]})}},Iy=(e,t)=>{if(t===void 0||Object.keys(t).length===0)return e;let n=Object.entries(t).sort((e,t)=>e[0].localeCompare(t[0]));return`${e}:${JSON.stringify(n)}`},Ly=()=>{let e=Date.now();return[Math.floor(e/1e3),e%1e3*1e6]},Ry=(e,t)=>{let n=t.unit??t.time_unit??`1`;return{name:e.id,description:e.description??``,unit:n,type:zy(e),valueType:By(e),advice:{}}},zy=e=>{switch(e.type){case`Histogram`:return My.HISTOGRAM;case`Gauge`:return My.OBSERVABLE_GAUGE;case`Frequency`:return My.COUNTER;case`Counter`:return e.state.incremental?My.COUNTER:My.UP_DOWN_COUNTER;case`Summary`:return My.COUNTER}},By=e=>e.type===`Counter`?typeof e.state.count==`bigint`?kh.INT:kh.DOUBLE:e.type===`Gauge`&&typeof e.state.value==`bigint`?kh.INT:kh.DOUBLE,Vy=e=>b(function*(){return new Fy(yield*Cy,yield*Zn(),e)}),Hy=(e,t,n)=>Vr(j(()=>{let n=t(),r=Array.isArray(n)?n:[n];return r.forEach(t=>t.setMetricProducer(e)),r}),e=>Ut(()=>Promise.all(e.map(e=>e.shutdown()))).pipe(at,f,Nr(n?.shutdownTimeout??3e3))),Uy=(e,t)=>Me(M(Vy(t?.temporality),n=>Hy(n,e,t))),Wy=class extends v()(`@effect/opentelemetry/Tracer`){},Gy=class extends v()(`@effect/opentelemetry/Tracer/OtelTracerProvider`){},Ky=class extends v()(`@effect/opentelemetry/Tracer/OtelTraceFlags`){},qy=class extends v()(`@effect/opentelemetry/Tracer/OtelTraceState`){},Jy=C(_n(Wy),e=>sr({span(t){return new $y(cg,$,e,t)},context(e,t){let n=t.currentSpan;return n===void 0?e[`~effect/Effect/evaluate`](t):cg.with(ob(cg.active(),n),()=>e[`~effect/Effect/evaluate`](t))}})),Yy=Ie(Wy,b(function*(){let e=yield*Cy;return(yield*Gy).getTracer(e.attributes[Hg],e.attributes[Ug])})),Xy=Ie(Yr,Jy).pipe(Un(Yy)),Zy=`~@effect/opentelemetry/Tracer/OtelSpan`,Qy={internal:og.INTERNAL,client:og.CLIENT,server:og.SERVER,producer:og.PRODUCER,consumer:og.CONSUMER},$y=class{[Zy];_tag=`Span`;name;kind;annotations;links;span;spanId;traceId;attributes=new Map;sampled;parent;status;constructor(e,t,n,r){this[Zy]=Zy,this.name=r.name,this.annotations=r.annotations,this.links=r.links,this.kind=r.kind;let i=e.active();this.parent=r.root===!0?r.parent:Cr(r.parent,()=>tb(t,i,r.annotations)),this.span=n.startSpan(r.name,{startTime:by(r.startTime),links:r.links.length>0?r.links.map(e=>({context:nb(e.span),attributes:xy(e.attributes)})):void 0,kind:Qy[this.kind]},Tt(this.parent)?ob(i,this.parent.value,r.annotations):$.deleteSpan(i));let a=this.span.spanContext();this.spanId=a.spanId,this.traceId=a.traceId,this.status={_tag:`Started`,startTime:r.startTime},this.sampled=eb(a.traceFlags)}attribute(e,t){this.span.setAttribute(e,Sy(t)),this.attributes.set(e,t)}addLinks(e){this.links.push(...e),this.span.addLinks(e.map(e=>({context:nb(e.span),attributes:xy(e.attributes)})))}end(e,t){let n=by(e);if(this.status={_tag:`Ended`,endTime:e,exit:t,startTime:this.status.startTime},t._tag===`Success`)this.span.setStatus({code:sg.OK});else if(me(t.cause))this.span.setStatus({code:sg.OK,message:vt(t.cause)}),this.span.setAttribute(`span.label`,`⚠︎ Interrupted`),this.span.setAttribute(`status.interrupted`,!0);else{let e=Qi(t.cause);if(e.length>0){for(let t of e)this.span.recordException(t,n);this.span.setStatus({code:sg.ERROR,message:e[0].message})}else this.span.setStatus({code:sg.OK})}this.span.end(n)}event(e,t,n){this.span.addEvent(e,n?xy(n):void 0,by(t))}},eb=e=>(e&Ih.SAMPLED)===Ih.SAMPLED,tb=(e,t,n)=>{let r=e.getSpan(t)?.spanContext();return r?c(Mr({spanId:r.spanId,traceId:r.traceId,sampled:(r.traceFlags&1)==1,annotations:n})):S()},nb=(e,t)=>{let n=rb(e,t),r=ib(e,t);return{spanId:e.spanId,traceId:e.traceId,isRemote:e._tag===`ExternalSpan`,traceFlags:n,traceState:r}},rb=(e,t)=>{let n;return vn(t)&&(n=ab(e,t,Ky),pi(n)&&(n=vr(e.annotations,Ky))),n??Ih.SAMPLED},ib=(e,t)=>{let n;return vn(t)&&(n=ab(e,t,qy),pi(n)&&(n=vr(e.annotations,qy))),n},ab=(e,t,n)=>{let r=vr(t,n);return vn(r)?r:vr(e.annotations,n)},ob=(e,t,n)=>t instanceof $y?$.setSpan(e,t.span):$.setSpanContext(e,nb(t,n)),sb=(e,t)=>Ie(Gy,b(function*(){let n=yield*Cy;return yield*Vr(j(()=>new Qv({...t??void 0,resource:n,spanProcessors:Array.isArray(e)?e:[e]})),e=>at(Ut(()=>e.forceFlush().then(()=>e.shutdown()))))})),cb=e=>Br(b(function*(){let t=yield*xr(e)?e:j(e),n=wy(t.resource),r=$v(t.spanProcessor)?i(Xy,sb(t.spanProcessor,t.tracerConfig)):$t,a=$v(t.logRecordProcessor)?i(ky({mergeWithExisting:t.loggerMergeWithExisting}),Ay(t.logRecordProcessor,t.loggerProviderConfig)):$t;return an(r,$v(t.metricReader)?Uy(Yn(t.metricReader),{temporality:t.metricTemporality}):$t,a).pipe(Un(n))})),lb=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};function ub(e,t){let n={attributes:fb(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function db(e){return{name:e.name,version:e.version}}function fb(e,t){return Object.keys(e).map(n=>pb(n,e[n],t))}function pb(e,t,n){return{key:e,value:mb(t,n)}}function mb(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=mb(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:mb(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}var hb=256,gb=512;function _b(e,t){let n=e&255|hb;return t&&(n|=gb),n}function vb(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:fb(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>bb(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>yb(e,t)),droppedLinksCount:e.droppedLinksCount,flags:_b(n.traceFlags,e.parentSpanContext?.isRemote)}}function yb(e,t){return{attributes:e.attributes?fb(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:_b(e.context.traceFlags,e.context.isRemote)}}function bb(e,t){return{attributes:e.attributes?fb(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function xb(e,t){return{resourceSpans:Cb(e,t)}}function Sb(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Cb(e,t){let n=Sb(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>vb(e,t));o.push({scope:db(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=ub(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}function wb(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Tb(e){return wb(e).toString()}var Eb=typeof BigInt<`u`?Tb:a_;function Db(e){return e}var Ob={encodeHrTime:Eb,encodeSpanContext:Db,encodeOptionalSpanContext:Db,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}},kb={serializeRequest:e=>{let t=xb(e,Ob);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Q.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}},Ab=5,jb=1e3,Mb=5e3,Nb=1.5,Pb=.2;function Fb(){return 2*Pb*Math.random()-Pb}var Ib=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Ab,r=jb,i=Date.now()+t,a=await this._transport.send(e,t);for(;a.status===`retryable`&&n>0;){n--;let t=Math.max(Math.min(r*(1+Fb()),Mb),0);r*=Nb;let o=a.retryInMillis??t,s=i-Date.now();if(o>s)return Q.info(`Export retry time ${Math.round(o)}ms exceeds remaining timeout ${Math.round(s)}ms, not retrying further.`),a;Q.verbose(`Scheduling export retry in ${Math.round(o)}ms`),a=await this.retry(e,s,o)}return a.status===`success`?Q.verbose(`Export succeeded after ${Ab-n} retry attempts.`):a.status===`retryable`?Q.info(`Export failed after maximum retry attempts (${Ab}).`):Q.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}};function Lb(e){return new Ib(e.transport)}var Rb=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function zb(e){return new Rb(e.concurrencyLimit)}var Bb=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Vb(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function Hb(){return{handleResponse(e){e==null||!Vb(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||Q.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var Ub=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=Q.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:l_.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:l_.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:l_.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:l_.FAILED,error:e.error});return}else e.status===`retryable`?t({code:l_.FAILED,error:e.error??new Bb(`Export failed with retryable status`)}):t({code:l_.FAILED,error:new Bb(`Export failed with unknown error`)})},e=>t({code:l_.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function Wb(e,t){return new Ub(e.transport,e.serializer,Hb(),e.promiseHandler,t.timeout)}function Gb(e,t,n){return Wb({transport:n,serializer:t,promiseHandler:zb(e)},{timeout:e.timeoutMillis})}function Kb(e){return e===429||e===502||e===503||e===504}function qb(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var Jb=60*1024,Yb=9,Xb=0,Zb=0,Qb=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t),i=globalThis.fetch;typeof i.__original==`function`&&(i=i.__original);let a=e.byteLength,o=Xb+a>Jb,s=!o&&!(Zb>=Yb);if(s)Xb+=a,Zb++;else{let e=o?`size limit`:`count limit`;Q.debug(`keepalive disabled: ${(a/1024).toFixed(1)}KB payload, ${Zb} pending (${e})`)}try{let t=new URL(this._parameters.url),r=await i(t.href,{method:`POST`,headers:await this._parameters.headers(),body:e,signal:n.signal,keepalive:s,mode:globalThis.location?globalThis.location.origin===t.origin?`same-origin`:`cors`:`no-cors`});return r.status>=200&&r.status<=299?(Q.debug(`export response success (status: ${r.status})`),{status:`success`}):Kb(r.status)?(Q.warn(`export response retryable (status: ${r.status})`),{status:`retryable`,retryInMillis:qb(r.headers.get(`Retry-After`))}):(Q.error(`export response failure (status: ${r.status})`),{status:`failure`,error:Error(`Fetch request failed with non-retryable status ${r.status}`)})}catch(e){return ex(e)?(Q.warn(`export request retryable (network error: ${e})`),{status:`retryable`,error:Error(`Fetch request encountered a network error`,{cause:e})}):(Q.error(`export request failure (error: ${e})`),{status:`failure`,error:Error(`Fetch request errored`,{cause:e})})}finally{clearTimeout(r),s&&(Xb-=a,Zb--)}}shutdown(){}};function $b(e){return new Qb(e)}function ex(e){return e instanceof TypeError&&!e.cause}function tx(e,t){return Gb(e,t,Lb({transport:$b(e)}))}function nx(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function rx(e){if(e!=null)return async()=>e}function ix(e,t,n){return{timeoutMillis:nx(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ax(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}function ox(e){let t={};return Object.entries(e??{}).forEach(([e,n])=>{n===void 0?Q.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}function sx(e,t,n){return async()=>{let r={...await n()},i={};return t!=null&&Object.assign(i,await t()),e!=null&&Object.assign(i,ox(await e())),Object.assign(i,r)}}function cx(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function lx(e,t,n){return{...ix(e,t,n),headers:sx(e.headers,t.headers,n.headers),url:cx(e.url)??t.url??n.url}}function ux(e,t){return{...ax(),headers:async()=>e,url:`http://localhost:4318/`+t}}function dx(e){return typeof e.headers==`function`?e.headers:rx(e.headers)}function fx(e,t,n){return lx({url:e.url,timeoutMillis:e.timeoutMillis,headers:dx(e),concurrencyLimit:e.concurrencyLimit},{},ux(n,t))}function px(e,t,n,r){return tx(fx(e,n,r),t)}var mx=class extends lb{constructor(e={}){super(px(e,kb,`v1/traces`,{"Content-Type":`application/json`}))}};function hx(e){return Br(C(tc(sc(`VITE_OTEL_URL`)),ie({onNone:()=>$t,onSome:t=>cb(()=>({resource:{serviceName:e},spanProcessor:new Jv(new mx({url:t}))}))})))}var gx=nr($t,Un(hx(`workbench-client`)),Un(bm),Un(em),Un(Rs(zs({VITE_OTEL_URL:{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_INLINE_CSS_ENABLED:`false`,VITE_OTEL_URL:`http://localhost:27686/v1/traces`}.VITE_OTEL_URL})))),_x=class extends gm()(`ApiClient`,{group:Cm().merge(Bm),protocol:nr(pm({retryTransientErrors:!0}),Un(mf(`${location.origin}/api/rpc`)),Un(df),Un(gx))}){},vx=zl(_x.runtime.atom(nr(_x,C(e=>e(`projects.watch`,void 0)),ys))),yx=Rl(e=>zl(bl(t=>b(function*(){let n=yield*t.result(vx),r=nr(n,ti(t=>Dn(t.worktrees,t=>Math.abs(yi(t.root)).toString(36)===e)),ee);return{activeProject:r,activeWorktree:nr(r?.worktrees??[],ti(t=>Math.abs(yi(t.root)).toString(36)===e),ee),projects:n}}))));export{nu as a,Rl as c,ys as d,Pm as i,zl as l,vx as n,tu as o,_x as r,ou as s,yx as t,Ss as u};
|
|
1
|
+
import{o as e,r as t}from"./compiler-runtime-CUwoe8mk.js";import{$ as n,$a as r,$n as i,$r as a,$t as o,A as s,Aa as c,Ai as l,An as u,Ar as d,At as f,B as p,Ba as m,Br as h,Bt as g,Ca as ee,Cn as te,Cr as _,Ct as ne,D as re,Da as ie,Di as v,Dn as ae,Dr as y,Dt as b,E as oe,Ea as se,Ei as ce,En as le,Et as ue,F as de,Fa as fe,Fi as pe,Fr as me,Ft as he,G as ge,Ga as _e,Gi as ve,Gn as ye,Gr as be,Gt as xe,H as x,Ha as Se,Hr as Ce,Ht as we,I as Te,Ia as Ee,Ii as De,Ir as Oe,It as ke,J as Ae,Ja as je,Jn as Me,Jr as Ne,Jt as Pe,Ka as Fe,Kn as Ie,Kr as Le,Kt as Re,L as ze,La as Be,Li as Ve,Lr as He,Lt as Ue,M as We,Ma as Ge,Mi as Ke,Mn as qe,Mr as Je,Mt as Ye,N as Xe,Na as Ze,Ni as Qe,Nn as $e,Nr as et,Nt as tt,Oa as S,Oi as nt,On as rt,Or as it,Ot as at,Pa as ot,Pi as st,Pn as ct,Pr as lt,Pt as C,Q as ut,Qa as dt,Qi as ft,Qn as pt,Qr as mt,Qt as ht,R as gt,Ra as _t,Rr as vt,Rt as yt,S as bt,Sa as xt,Si as St,Sn as w,Sr as Ct,St as wt,T,Ta as Tt,Ti as Et,Tn as Dt,Tr as Ot,Tt as kt,U as At,Ua as jt,Ur as Mt,Ut as Nt,V as Pt,Va as Ft,Vr as It,Vt as Lt,W as Rt,Wa as zt,Wi as Bt,Wn as Vt,Wr as Ht,Wt as Ut,X as Wt,Xa as Gt,Xi as Kt,Xn as qt,Xr as Jt,Xt as Yt,Y as Xt,Ya as Zt,Yi as Qt,Yn as $t,Yr as en,Yt as tn,Z as nn,Za as rn,Zn as an,Zr as on,Zt as sn,_ as cn,_a as ln,_i as un,_n as dn,_o as fn,_r as pn,_t as mn,aa as hn,ai as gn,an as _n,ao as vn,ar as yn,at as bn,b as xn,ba as Sn,bi as Cn,bn as wn,br as Tn,bt as En,ca as Dn,ci as On,cn as kn,co as An,cr as jn,ct as Mn,d as Nn,da as Pn,di as Fn,dn as In,do as Ln,dr as Rn,dt as zn,ei as Bn,en as Vn,eo as Hn,er as Un,et as Wn,f as Gn,fa as Kn,fi as qn,fn as Jn,fo as Yn,fr as Xn,ft as Zn,g as Qn,ga as $n,gi as er,gn as tr,go as nr,gr as rr,gt as ir,h as ar,ha as or,hi as sr,hn as cr,ho as E,hr as lr,ht as ur,ii as dr,in as fr,io as pr,ir as mr,it as hr,j as gr,ja as _r,ji as vr,jn as yr,jr as br,jt as xr,k as Sr,ka as Cr,ki as wr,kn as Tr,kt as Er,li as Dr,ln as D,lo as Or,lr as kr,lt as Ar,m as O,ma as jr,mi as Mr,mn as Nr,mo as Pr,mr as Fr,mt as Ir,ni as Lr,nn as Rr,no as zr,nr as Br,nt as Vr,oi as Hr,on as Ur,oo as Wr,or as Gr,ot as Kr,p as qr,pa as Jr,pi as Yr,pn as Xr,po as k,pr as Zr,pt as Qr,q as $r,qa as ei,qi as ti,qn as ni,qr as ri,qt as ii,ra as ai,ri as oi,rn as si,ro as ci,rr as li,rt as ui,sa as di,si as fi,sn as A,so as pi,sr as mi,st as hi,ta as gi,ti as _i,tn as vi,to as yi,tr as bi,tt as xi,u as Si,ua as Ci,ui as wi,un as j,ur as Ti,ut as Ei,v as Di,va as Oi,vi as ki,vn as Ai,vo as ji,vr as Mi,vt as M,w as N,wa as Ni,wi as Pi,wn as Fi,wr as Ii,wt as Li,x as Ri,xa as zi,xi as Bi,xn as Vi,xr as Hi,xt as P,y as Ui,ya as Wi,yi as Gi,yn as Ki,yr as qi,yt as Ji,z as Yi,za as Xi,zi as Zi,zr as Qi,zt as $i}from"./utils-CC77kD3H.js";var ea=Jt,ta=on,na=Ne,ra=en,ia=_i,aa=mt,oa=oi,sa=Symbol.for(`effect/MutableList/Empty`),ca=()=>({head:void 0,tail:void 0,length:0}),la=()=>({array:[],mutable:!0,offset:0,next:void 0}),ua=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=la(),e.tail=e.tail.next):e.head=e.tail=la(),e.tail.array.push(t),e.length++},da=(e,t)=>fa(e,Qt(t),!Array.isArray(t)),fa=(e,t,n=!1)=>{if(t.length===0)return 0;let r={array:t,mutable:n,offset:0,next:void 0};return e.head?e.tail=e.tail.next=r:e.head=e.tail=r,e.length+=t.length,t.length},pa=e=>{e.head=e.tail=void 0,e.length=0},ma=(e,t)=>{if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return pa(e),t}let n=Array(t),r=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[r++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,r===t)return e.head=i,e.length-=t,e.length===0&&pa(e),n;i=i.next}return pa(e),n},ha=e=>ma(e,e.length),ga=e=>{if(!e.head)return sa;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:pa(e)),t},_a=(e,t)=>{let n=[],r=e.head;for(;r;){for(let e=r.offset;e<r.array.length;e++)t(r.array[e],e)&&n.push(r.array[e]);r=r.next}e.head=e.tail={array:n,mutable:!0,offset:0,next:void 0},e.length=n.length},va=(e,t)=>_a(e,e=>e!==t),ya=`~effect/MutableRef`,ba={[ya]:ya,...Ge,toJSON(){return{_id:`MutableRef`,current:Se(this.current)}}},xa=e=>{let t=Object.create(ba);return t.current=e,t},Sa=k(2,(e,t)=>(e.current=t,e)),Ca=`~effect/PubSub/Subscription`,wa=k(2,(e,t)=>e.shutdownFlag.current?!1:e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),!0):!1),Ta=e=>Ai(Qr(t=>{let n=l(t,li),r=mi(e.scope),i=ka(e.pubsub,e.subscribers,e.strategy);return mr(r,Ea(i)).pipe(ui(yn(n,e=>Gr(r,e))),bn(i))})),Ea=e=>Ai(Dt(t=>(Sa(e.shutdownFlag,!0),wt(ha(e.pollers),e=>Fr(e,t.id),{discard:!0,concurrency:`unbounded`}).pipe(In(()=>j(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),te(e.shutdownHook.open),Kr)))),Da=e=>D(function t(n){if(e.shutdownFlag.current)return Er;let r=e.pollers.length===0?e.subscription.pollUpTo(1/0):[];return n&&(r=n.concat(r)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?A(e.replayWindow.takeAll().concat(r)):Kt(r)?A(r):M(Oa(e),e=>t([e]))}),Oa=e=>{let t=rr(),n=e.subscribers.get(e.subscription);return n||(n=new Set,e.subscribers.set(e.subscription,n)),n.add(e.pollers),ua(e.pollers,t),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),we(Xn(t),()=>(va(e.pollers,t),w))},ka=(e,t,n)=>new Aa(e,t,e.subscribe(),ca(),oa(!1),xa(!1),n,e.replayWindow()),Aa=class{[Ca]={_A:E};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;constructor(e,t,n,r,i,a,o,s){this.pubsub=e,this.subscribers=t,this.subscription=n,this.pollers=r,this.shutdownHook=i,this.shutdownFlag=a,this.strategy=o,this.replayWindow=s}pipe(){return fn(this,arguments)}},ja=`~effect/Queue`,Ma=`~effect/Queue/Enqueue`,Na=`~effect/Queue/Dequeue`,Pa={_A:E,_E:E},Fa={[ja]:Pa,[Ma]:Pa,[Na]:Pa,...Ge,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:Xa(this)}}},Ia=e=>_t(t=>{let n=Object.create(Fa);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=ca(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},gn(n)}),La=e=>Ia({capacity:e}),Ra=(e,t)=>fi(()=>{if(e.state._tag!==`Open`)return Za;if(e.messages.length>=e.capacity)switch(e.strategy){case`dropping`:return Za;case`suspend`:return e.capacity<=0&&e.state.takers.size>0?(ua(e.messages,t),to(e),Qa):io(e,t);case`sliding`:return ga(e.messages),ua(e.messages,t),Qa}return ua(e.messages,t),no(e),Qa}),za=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(ga(e.messages),ua(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0?(ua(e.messages,t),to(e),!0):!1:(ua(e.messages,t),no(e),!0):!1,Ba=(e,t)=>fi(()=>{if(e.state._tag!==`Open`)return gn(Qt(t));let n=Va(e,t);return n.length===0?Ee([]):e.strategy===`dropping`?gn(n):ao(e,n)}),Va=(e,t)=>{if(e.state._tag!==`Open`)return Qt(t);if(e.capacity===1/0||e.strategy===`sliding`)return da(e.messages,t),e.strategy===`sliding`&&ma(e.messages,e.messages.length-e.capacity),no(e),[];let n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return Qt(t);let r=[],i=0;for(let a of t)i<n?ua(e.messages,a):r.push(a),i++;return no(e),r},Ha=k(2,(e,t)=>On(()=>Ua(e,t))),Ua=(e,t)=>{if(e.state._tag!==`Open`)return!1;let n=ri(fe(t),$a);return e.state.offers.size===0&&e.messages.length===0?(co(e,n),!0):(e.state={...e.state,_tag:`Closing`,exit:n},!0)},Wa=e=>Ha(e,Ze(_r())),Ga=e=>On(()=>{if(e.state._tag===`Done`)return!0;pa(e.messages);let t=e.state.offers;if(co(e,e.state._tag===`Open`?eo:e.state.exit),t.size>0){for(let e of t)e._tag===`Single`?e.resume(Za):e.resume(Ee(e.remaining.slice(e.offset)));t.clear()}return!0}),Ka=e=>qa(e,1,1/0),qa=(e,t,n)=>fi(()=>ro(e,t,n)??Ce(so(e),qa(e,1,n))),Ja=e=>fi(()=>Ya(e)??Ce(so(e),Ja(e))),Ya=e=>{if(e.state._tag===`Done`)return e.state.exit;if(e.messages.length>0){let t=ga(e.messages);return oo(e),Ee(t)}else if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,oo(e),e.capacity=0;let t=ga(e.messages);return oo(e),Ee(t)}},Xa=e=>e.state._tag===`Done`?0:e.messages.length,Za=Ee(!1),Qa=Ee(!0),$a=ot(_r()),eo=be(),to=e=>{if(e.scheduleRunning=!1,!(e.state._tag===`Done`||e.state.takers.size===0)){for(let t of e.state.takers)if(e.state.takers.delete(t),t(Le),e.messages.length===0)break}},no=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>to(e),0))},ro=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return Ee([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,oo(e),e.capacity=0;let t=[ga(e.messages)];return oo(e),Ee(t)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let t=ma(e.messages,n);return oo(e),Ee(t)}},io=(e,t)=>Ht(n=>{if(e.state._tag!==`Open`)return n(Za);let r={_tag:`Single`,message:t,resume:n};return e.state.offers.add(r),On(()=>{e.state._tag===`Open`&&e.state.offers.delete(r)})}),ao=(e,t)=>Ht(n=>{if(e.state._tag!==`Open`)return n(Ee(t));let r={_tag:`Array`,remaining:t,offset:0,resume:n};return e.state.offers.add(r),On(()=>{e.state._tag===`Open`&&e.state.offers.delete(r)})}),oo=e=>{if(e.state._tag===`Done`)return ct(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0?(co(e,e.state.exit),ct(e.state.exit.cause)):!1;let t=e.capacity-e.messages.length;for(let n of e.state.offers)if(t===0)break;else if(n._tag===`Single`)ua(e.messages,n.message),t--,n.resume(Qa),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;ua(e.messages,n.remaining[n.offset]),t--}n.resume(Ee([])),e.state.offers.delete(n)}return!1},so=e=>Ht(t=>e.state._tag===`Done`?t(e.state.exit):(e.state.takers.add(t),On(()=>{e.state._tag!==`Done`&&e.state.takers.delete(t)}))),co=(e,t)=>{if(e.state._tag===`Done`)return;let n=e.state;e.state={_tag:`Done`,exit:t};for(let e of n.takers)e(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},lo=e=>new uo(e),uo=class{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){let t=fi(()=>this.free<e?Ht(n=>{if(this.free>=e)return n(t);let r=()=>{this.free<e||(this.waiters.delete(r),n(t))};return this.waiters.add(r),On(()=>{this.waiters.delete(r)})}):(this.taken+=e,gn(e)));return t}updateTakenUnsafe(e,t){return this.taken=t(this.taken),this.waiters.size>0&&e.currentDispatcher.scheduleTask(()=>{let e=this.waiters.values(),t=e.next();for(;t.done===!1&&this.free>0;)t.value(),t=e.next()},0),this.free}updateTaken(e){return _t(t=>gn(this.updateTakenUnsafe(t,e)))}resize(e){return _t(t=>(this.permits=e,this.free<0||this.updateTakenUnsafe(t,e=>e),wi))}release(e){return this.updateTaken(t=>t-e)}get releaseAll(){return this.updateTaken(e=>0)}withPermits(e){return t=>Dr(n=>a(n(this.take(e)),e=>dr(n(t),()=>{this.updateTakenUnsafe(_i(),t=>t-e)},!0)))}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>Dr(n=>this.free<e?Hr:(this.taken+=e,dr(n(Mt(t)),()=>{this.updateTakenUnsafe(_i(),t=>t-e)},!0)))}},fo=`~effect/Channel`,po=e=>pr(e,fo),mo={[fo]:{_Env:E,_InErr:E,_InElem:E,_OutErr:E,_OutElem:E},pipe(){return fn(this,arguments)}},ho=e=>{let t=Object.create(mo);return t.transform=(t,n)=>Ar(e(t,n),e=>A(mn(e))),t},go=(e,t)=>ho((n,r)=>M(yo(e)(n,r),e=>t(e,r))),_o=e=>ho((t,n)=>e),vo=e=>ho(P(function*(t,n){let r=mi(n),i=e=>Gr(r,$e(e));return g(yield*g(e(t,n,r),i),i)})),yo=e=>e.transform,bo=(e,t,n)=>Ia({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(In(t=>mr(e,Ga(t))),In(n=>kt(kr(t(n),e),e))),xo=(e,t)=>ho((n,r)=>C(bo(r,e,t),Ka)),So=e=>ho((t,n)=>D(()=>yo(e())(t,n))),Co=_o(A(d())),wo=e=>_o(A(ir(e))),To=e=>_o(A(Ka(e))),Eo=e=>_o(A(we(Da(e),()=>d()))),Do=e=>Fo(C(Ta(e),Eo)),Oo=k(2,(e,t)=>go(e,e=>j(()=>{let n=0;return C(e,e=>t(e,n++))}))),ko=e=>e===void 0||e!==`unbounded`&&e<=1,Ao=k(e=>po(e[0]),(e,t,n)=>ko(n?.concurrency)?jo(e,t):Mo(e,t,n)),jo=(e,t)=>ho((n,r)=>{let i=0;return C(yo(e)(n,r),M(e=>t(e,i++)))}),Mo=(e,t,n)=>vo(P(function*(r,i,a){let o=0,s=yield*yo(e)(r,i),c=n.concurrency===`unbounded`?2**53-1:n.concurrency,l=yield*La(0);yield*mr(a,Ga(l));let u=ht(yield*Zn()),d=aa(a);if(n.unordered){let e=lo(c),n=Yn(e.release(1)),r=yt({onFailure:e=>M(Ha(l,e),n),onSuccess:e=>M(Ra(l,e),n)});yield*e.take(1).pipe(M(()=>s),M(e=>(d(u(r(t(e,o++)))),w)),ne({disableYield:!0}),Ar(t=>e.withPermits(c-1)(Ha(l,t))),kt(a))}else{let e=yield*La(c-2);yield*mr(a,Ga(l)),yield*Ja(e).pipe(En,M(e=>Ra(l,e)),ne({disableYield:!0}),Ar(e=>Ha(l,e)),kt(a));let n,r=e=>{e._tag!==`Success`&&(n=e.cause,Ua(l,e.cause))};yield*s.pipe(M(i=>{if(n)return mn(n);let a=u(t(i,o++));return d(a),a.addObserver(r),Ra(e,ea(a))}),ne({disableYield:!0}),Ar(t=>Ra(e,qi(t)).pipe(ui(Ha(e,t)))),kt(a))}return Ja(l)})),No=e=>go(e,e=>{let t,n=0;return A(D(function r(){if(t===void 0)return M(e,e=>{switch(e.length){case 0:return r();case 1:return A(e[0]);default:return t=e,A(e[n++])}});let i=t[n++];return n>=t.length&&(t=void 0,n=0),A(i)}))}),Po=k(2,(e,t)=>go(e,e=>A(M(e,function n(r){let i=[];for(let e=0;e<r.length;e++)t(r[e])&&i.push(r[e]);return ft(i)?A(i):M(e,n)})))),Fo=e=>ho((t,n)=>{let r;return A(D(()=>r||e.pipe(kr(n),M(e=>yo(e)(t,n)),M(e=>r=e))))}),Io=k(2,(e,t)=>vo((n,r,i)=>yn(i,t).pipe(ui(yo(e)(n,r))))),Lo=k(2,(e,t)=>Io(e,e=>t)),Ro=(e,t,n)=>D(()=>{let r=jn();return qe(M(yo(e)(d(),r),t),n||A).pipe(Lt(e=>Gr(r,e)))}),zo=k(2,(e,t)=>ho((n,r)=>C(Re(yo(e)(n,r),t),Re(t)))),Bo=k(2,(e,t)=>Ro(e,e=>ne(M(e,t),{disableYield:!0}))),Vo=P(function*(e){let t=lo(1),n=yield*Zn(),r=l(n,li);return(yield*yo(e)(d(),r)).pipe(Re(n),t.withPermits(1))},Ar(e=>A(mn(e)))),Ho=(e,t)=>yo(e)(d(),t),Uo=`~effect/Stream`,Wo={_R:E,_E:E,_A:E},Go={[Uo]:Wo,pipe(){return fn(this,arguments)}},Ko=e=>{let t=Object.create(Go);return t.channel=e,t},qo=`~effect/Sink`,Jo={_A:E,_In:E,_L:E,_E:E,_R:E},Yo={[qo]:Jo,pipe(){return fn(this,arguments)}},Xo=e=>{let t=Object.create(Yo);return t.transform=e,t},Zo=e=>Xo(t=>{let n=[];if(e<=0)return A([n]);let r;return t.pipe(M(t=>{if(n.length+t.length<=e)return n.push(...t),n.length===e?d():w;for(let i=0;i<t.length;i++)if(n.push(t[i]),n.length===e)return i+1<t.length&&(r=t.slice(i+1)),d();return w}),ne({disableYield:!0}),qe(()=>A([n,r])))}),Qo=`~effect/collections/MutableHashMap`,$o={[Qo]:Qo,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${zt(Array.from(this))})`},toJSON(){return{_id:`MutableHashMap`,values:Se(Array.from(this))}},[Ft](){return this.toJSON()},pipe(){return fn(this,arguments)}},es=()=>{let e=Object.create($o);return e.backing=new Map,e.buckets=new Map,e},ts=k(2,(e,t)=>{if(e.backing.has(t))return c(e.backing.get(t));if(rs(t))return S();let n=ns.get(e);if(n!==void 0)return e.backing.has(n)?c(e.backing.get(n)):S();let r=Hn(t),i=e.buckets.get(r);return i===void 0?S():is(e,i,t)}),ns=new WeakMap,rs=e=>typeof e!=`object`&&typeof e!=`function`,is=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(Gt(n,t[r])){let i=t[r];return ns.set(n,i),c(e.backing.get(i))}return S()},as=k(3,(e,t,n)=>{if(e.backing.has(t)||rs(t))return e.backing.set(t,n),e;let r=ns.get(e);if(r!==void 0&&e.backing.has(r))return e.backing.set(r,n),e;let i=Hn(t),a=e.buckets.get(i);return a===void 0?(e.buckets.set(i,[t]),e.backing.set(t,n),e):(r=os(a,t),r===void 0&&(a.push(t),r=t),e.backing.set(r,n),e)}),os=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(Gt(t,e[n]))return ns.set(t,e[n]),e[n]},ss=k(2,(e,t)=>{if(rs(t))return e.backing.delete(t),e;let n=ns.get(e)??t,r=Hn(n),i=e.buckets.get(r);if(i===void 0)return e;for(let t=0,r=i.length;t<r;t++){let r=i[t];if(r===n||Gt(n,r)){e.backing.delete(r),i.splice(t,1);break}}return i.length===0&&e.buckets.delete(r),e}),cs=`~effect/Stream`,ls=e=>pr(e,cs),us=Ko,ds=e=>e.channel,fs=(e,t)=>us(xo(e,t)),ps=us(Co),ms=e=>us(So(()=>e().channel)),hs=e=>us(wo(e)),gs=e=>us(To(e)),_s=e=>us(Do(e)),vs=e=>us(ho(P(function*(t,n){let r=e.evaluate().getReader();return yield*mr(n,e.releaseLockOnEnd?j(()=>r.releaseLock()):Ut(()=>r.cancel())),M(tr({try:()=>r.read(),catch:t=>e.onError(t)}),({done:e,value:t})=>e?d():A(hn(t)))}))),ys=e=>us(Fo(C(e,ds))),bs=k(e=>ls(e[0]),(e,t,n)=>e.channel.pipe(No,Ao(t,n),Oo(hn),us)),xs=k(2,(e,t)=>us(Po(ds(e),t))),Ss=k(3,(e,t,n)=>Cs(e,Zo(t),u(n))),Cs=k(3,(e,t,n)=>us(vo(P(function*(r,i,a){let o=yield*Ho(e.channel,i),s=oa(!1),l=Symbol(),u=yield*Ia({capacity:0});yield*o.pipe(s.whenOpen,M(e=>(s.closeUnsafe(),Ra(u,e))),ne,Ar(e=>Ha(u,e)),kt(a));let f=S(),p,m=!1,h=yield*yr(n),g=D(function e(){return h(f).pipe(M(()=>m?Ra(u,l):e()),M(()=>$i),qe(()=>d()))}),ee=Ja(u).pipe(M(e=>e===l?d():(m=!0,A(e)))),te=D(()=>{if(p!==void 0){let e=p;return p=void 0,m=!0,A(e)}return s.openUnsafe(),ee}),_=M(([e,t])=>!m&&u.state._tag===`Done`?d():(f=c(e),p=t,A(hn(e))));return D(()=>u.state._tag===`Done`&&p===void 0?u.state.exit:(m=p!==void 0,A(D(()=>t.transform(te,a))))).pipe(M(e=>Pe(_(e),g)))})))),ws=k(2,(e,t)=>us(Lo(e.channel,t))),Ts=k(2,(e,t)=>us(zo(e.channel,t))),Es=k(2,(e,t)=>Bo(e.channel,t)),Ds=e=>Vo(e.channel),Os=k(e=>ls(e[0]),(e,t,n)=>{let r,i,a=oa(!1);return new ReadableStream({start(n){i=sn(Re(Es(e,e=>a.whenOpen(j(()=>{a.closeUnsafe();for(let t=0;t<e.length;t++)n.enqueue(e[t]);r(),r=void 0}))),t)),i.addObserver(e=>{e._tag===`Failure`?n.error(h(e.cause)):n.close()})},pull(){return new Promise(e=>{r=e,a.openUnsafe()})},cancel(){if(i)return o(Kr(na(i)))}},n?.strategy)}),ks=k(e=>ls(e[0]),(e,t)=>C(Zn(),n=>Os(e,n,t))),As=e(t(),1),js=e(ji(),1);function Ms(e){return{_tag:`Value`,value:e}}function Ns(e,t){return{_tag:`Record`,keys:e,value:t}}function Ps(e,t){return{_tag:`Array`,length:e,value:t}}y(`SourceError`);var Fs=ce(`effect/ConfigProvider`,{defaultValue:()=>Hs()}),Is={...Ge,toJSON(){return{_id:`ConfigProvider`}}};function Ls(e,t,n){let r=Object.create(Is);return r.get=e,r.mapInput=t,r.prefix=n,r.load=r=>(t&&(r=t(r)),n&&(r=[...n,...r]),e(r)),r}var Rs=e=>xr(e)?Ie(Fs)(e):bi(Fs)(e);function zs(e){return Ls(t=>A(Bs(e,t)))}function Bs(e,t){let n=e;for(let e of t){if(n==null)return;if(Array.isArray(n)){if(typeof e!=`number`||!Number.isInteger(e)||e<0||e>=n.length)return;n=n[e];continue}if(Wr(n)){if(typeof e!=`string`||!Object.hasOwn(n,e))return;n=n[e];continue}return}return Vs(n)}function Vs(e){if(e!=null)return typeof e==`string`?Ms(e):typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`?Ms(String(e)):Array.isArray(e)?Ps(e.length):Wr(e)?Ns(new Set(Object.keys(e))):Ms(zt(e))}function Hs(e){let t=e?.env??{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_INLINE_CSS_ENABLED:`false`},n=Us(t);return Ls(e=>A(Gs(n,t,e)))}function Us(e){let t={};for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let e=n.split(`_`),i=t;for(let t of e)i.children??={},i=i.children[t]??={};i.value=r}return t}var Ws=/^(0|[1-9][0-9]*)$/;function Gs(e,t,n){let r=t[n.map(String).join(`_`)],i=Ks(e,n),a=i?.children?Object.keys(i.children):[];return a.length===0?r===void 0?void 0:Ms(r):a.every(e=>Ws.test(e))?Ps(Math.max(...a.map(e=>parseInt(e,10)))+1,r):Ns(new Set(a),r)}function Ks(e,t){if(t.length===0)return e;let n=e;for(let e of t)if(n=n?.children?.[String(e)],!n)return;return n}var qs=`~effect/Config`,Js=class{_tag=`ConfigError`;name=`ConfigError`;cause;constructor(e){this.cause=e}get message(){return this.cause.toString()}toString(){return`ConfigError(${this.message})`}},Ys={...De({label:`Config`,evaluate(e){return this.parse(e.getRef(Fs))}}),[qs]:qs,toJSON(){return{_id:`Config`}}};function Xs(e){let t=Object.create(Ys);return t.parse=e,t}var Zs=k(2,(e,t)=>Xs(n=>C(e.parse(n),t))),Qs=k(2,(e,t)=>Xs(n=>zn(e.parse(n),e=>t(e).parse(n))));function $s(e){switch(e._tag){case`MissingKey`:return!0;case`InvalidType`:case`InvalidValue`:return Ni(e.actual)||Tt(e.actual)&&e.actual.value===void 0;case`OneOf`:return e.actual===void 0;case`Encoding`:return Ni(e.actual)||Tt(e.actual)&&e.actual.value===void 0?!0:$s(e.issue);case`Pointer`:case`Filter`:return $s(e.issue);case`UnexpectedKey`:return!1;case`Forbidden`:return!1;case`Composite`:case`AnyOf`:return e.issues.every($s)}}var ec=k(2,(e,t)=>Qs(e,e=>{if(Yi(e.cause)){let n=e.cause.issue;if($s(n))return oc(t)}return ac(e.cause)})),tc=e=>e.pipe(Zs(c),ec(S())),nc=P(function*(e,t){let n=yield*e.load(t);if(n!==void 0)switch(n._tag){case`Value`:return n.value;case`Record`:{if(n.value!==void 0)return n.value;let r={};for(let i of n.keys){let n=yield*nc(e,[...t,i]);n!==void 0&&(r[i]=n)}return r}case`Array`:{if(n.value!==void 0)return n.value;let r=[];for(let i=0;i<n.length;i++)r.push(yield*nc(e,[...t,i]));return r}}}),rc=P(function*(e,t,n){switch(e._tag){case`Objects`:{let r={};for(let i of e.propertySignatures){let e=i.name;if(typeof e==`string`){let a=yield*rc(i.type,t,[...n,e]);a!==void 0&&(r[e]=a)}}if(e.indexSignatures.length>0){let i=yield*t.load(n);if(i&&i._tag===`Record`)for(let a of e.indexSignatures){let e=Ae(a.parameter);for(let o of i.keys)if(!Object.hasOwn(r,o)&&e(o)){let e=yield*rc(a.type,t,[...n,o]);e!==void 0&&(r[o]=e)}}}return r}case`Arrays`:{let r=yield*t.load(n);if(r&&r._tag===`Value`)return r.value;let i=[];for(let r=0;r<e.elements.length;r++)i.push(yield*rc(e.elements[r],t,[...n,r]));return i}case`Union`:return yield*nc(t,n);case`Suspend`:return yield*rc(e.thunk(),t,n);default:{let e=yield*t.load(n);return e===void 0?void 0:e._tag===`Value`||e._tag===`Record`&&e.value!==void 0||e._tag===`Array`&&e.value!==void 0?e.value:void 0}}});function ic(e,t){let n=ge(e),r=Xt(n),i=Wt(n.ast),a=typeof t==`string`?[t]:t??[];return Xs(e=>{let t=e.prefix?[...e.prefix,...a]:a;return rc(i,e,a).pipe(Ji(e=>r(e).pipe(Ue(e=>new $r(t.length>0?new Wn(t,e):e)))),Ue(e=>new Js(e)))})}function ac(e){return Xs(()=>ir(new Js(e)))}function oc(e){return Xs(()=>A(e))}function sc(e){return ic(N,e)}var cc=`~effect/SubscriptionRef`,lc=e=>pr(e,cc);({...Ge});var uc=e=>_s(e.pubsub),dc=e=>j(()=>e.value),fc=(e,t)=>{e.value=t,wa(e.pubsub,t)},pc=k(2,(e,t)=>e.semaphore.withPermit(j(()=>fc(e,t)))),mc=class extends v()(`effect/reactivity/Reactivity`){},hc=j(()=>{let e=new Map,t=t=>{xc(t,t=>{let n=e.get(t);n!==void 0&&n.forEach(e=>e())})},n=e=>Qr(n=>{let r=n.mapUnsafe.get(gc.key);return r?xc(e,e=>{r.add(e)}):t(e),w}),r=(e,t)=>In(t,n(e)),i=(t,n)=>{let r=[];return xc(t,t=>{r.push(t);let i=e.get(t);i===void 0&&(i=new Set,e.set(t,i)),i.add(n)}),()=>{for(let t=0;t<r.length;t++){let i=e.get(r[t]);i.delete(n),i.size===0&&e.delete(r[t])}}},a=(e,t)=>b(function*(){let n=yield*Zn(),r=l(n,li),a=yield*Ia(),o=Pr(ht(n),aa(r)),s=!1,c=!1,u=e=>{e._tag===`Failure`?Ua(a,e.cause):za(a,e.value),c?(c=!1,o(t).addObserver(u)):s=!1};function d(){if(s){c=!0;return}s=!0,o(t).addObserver(u)}return yield*mr(r,j(i(e,d))),d(),a});return mc.of({mutation:r,query:a,stream:(e,t)=>a(e,t).pipe(C(gs),ys),invalidateUnsafe:t,invalidate:n,registerUnsafe:i,withBatch:t=>D(()=>{let n=new Set;return t.pipe(ii(gc,n),Lt(t=>j(()=>{n.forEach(t=>{let n=e.get(t);n!==void 0&&n.forEach(e=>e())})})))})})}),gc=class extends v()(`effect/reactivity/Reactivity/PendingInvalidation`){},_c=k(2,(e,t)=>mc.use(n=>n.mutation(t,e))),vc=e=>mc.use(t=>t.invalidate(e)),yc=Ie(mc)(hc);function bc(e){switch(typeof e){case`string`:case`number`:case`bigint`:case`boolean`:return String(e);default:return Hn(e)}}var xc=(e,t)=>{if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(bc(e[n]));return}for(let n in e){t(n);let r=e[n];for(let e=0;e<r.length;e++)t(`${n}:${bc(r[e])}`)}},Sc=`~effect/reactivity/AsyncResult`,Cc=e=>pr(e,Sc),wc={[Sc]:{E,A:E},pipe(){return fn(this,arguments)},[rn](e){if(this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case`Initial`:return!0;case`Success`:return Gt(this.value,e.value);case`Failure`:return Gt(this.cause,e.cause)}},[ci](){let e=yi(`${this._tag}:${this.waiting}`);return this._tag===`Initial`?e:r(e)(this._tag===`Success`?Hn(this.value):Hn(this.cause))}},Tc=(e,t)=>e._tag===`Success`?Ac(e.value):Nc(e.cause,{previous:t}),Ec=e=>e._tag===`None`?Oc(!0):Fc(e.value),Dc=e=>e._tag!==`Initial`,Oc=(e=!1)=>{let t=Object.create(wc);return t._tag=`Initial`,t.waiting=e,t},kc=e=>e._tag===`Success`,Ac=(e,t)=>{let n=Object.create(wc);return n._tag=`Success`,n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},jc=e=>e._tag===`Failure`,Mc=(e,t)=>{let n=Object.create(wc);return n._tag=`Failure`,n.cause=e,n.previousSuccess=t?.previousSuccess??S(),n.waiting=t?.waiting??!1,n},Nc=(e,t)=>Mc(e,{previousSuccess:Oi(t.previous,e=>kc(e)?c(e):jc(e)?e.previousSuccess:S()),waiting:t.waiting}),Pc=(e,t)=>Nc(br(e),t),Fc=(e,t)=>{if(e.waiting)return t?.touch?Ic(e):e;let n=Object.assign(Object.create(wc),e);return n.waiting=!0,t?.touch&&kc(n)&&(n.timestamp=Date.now()),n},Ic=e=>kc(e)?Ac(e.value,{waiting:e.waiting}):e,Lc=(e,t)=>e._tag===`Failure`?Nc(e.cause,{previous:t,waiting:e.waiting}):e,Rc=e=>e._tag===`Success`?c(e.value):e._tag===`Failure`?se(e.previousSuccess,e=>e.value):S(),zc=e=>xt(Rc(e),()=>new it(`AsyncResult.getOrThrow: no value found`)),Bc=e=>{switch(e._tag){case`Success`:return Ii(e.value);case`Failure`:return qi(e.cause);default:return Mi(new it)}},Vc=e=>{let t=e.success??Ui,r=e.error??Ui,i=We()([t,Gn(r,O)],([e,t])=>(r,i,a)=>{if(!Cc(r))return ir(new n(i,c(r)));switch(r._tag){case`Initial`:return A(r);case`Success`:return he(Xt(e)(r.value,a),{onSuccess:e=>Ac(e,r),onFailure:e=>new ut(i,c(r),[new Wn([`value`],e)])});case`Failure`:{let n=r.previousSuccess.pipe(se(t=>he(Xt(e)(t.value,a),{onSuccess:e=>c(Ac(e,t)),onFailure:e=>new ut(i,c(r),[new Wn([`previousSuccess`,`value`],e)])})),zi(()=>kn)),o=Ue(Xt(t)(r.cause,a),e=>new ut(i,c(r),[new Wn([`cause`],e)]));return Ji(n,e=>ke(o,t=>Mc(t,{previousSuccess:e,waiting:r.waiting})))}}},{expected:`AsyncResult`,toCodec([e,t]){let n=re(`Success`,{value:e,waiting:Nn,timestamp:Ri});return p()(Sr([re(`Initial`,{waiting:Nn}),n,re(`Failure`,{cause:t,previousSuccess:bt(n),waiting:Nn})]),nn({decode:e=>{switch(e._tag){case`Initial`:return Oc(e.waiting);case`Success`:return Ac(e.value,{waiting:e.waiting,timestamp:e.timestamp});case`Failure`:return Mc(e.cause,{previousSuccess:se(e.previousSuccess,e=>Ac(e.value,e)),waiting:e.waiting})}},encode(e){switch(e._tag){case`Initial`:return{_tag:`Initial`,waiting:e.waiting};case`Success`:return{_tag:`Success`,value:e.value,waiting:e.waiting,timestamp:e.timestamp};case`Failure`:return{_tag:`Failure`,cause:e.cause,previousSuccess:e.previousSuccess,waiting:e.waiting}}}}))},toEquivalence:Zt,toFormatter:([e,t])=>n=>{switch(n._tag){case`Success`:return`AsyncResult.Success(${e(n.value)}, ${n.waiting}, ${n.timestamp})`;case`Failure`:return`AsyncResult.Failure(${t(n.cause)}, ${n.waiting})`;case`Initial`:return`AsyncResult.Initial(${n.waiting}, ${n.waiting})`}}});return Object.assign(i,{success:t,error:r})},Hc=`~effect/reactivity/AtomRegistry`,Uc=e=>pr(e,Hc),Wc=e=>new Zc(e?.initialValues,e?.scheduleTask,e?.timeoutResolution,e?.defaultIdleTTL),Gc=v(Hc),Kc=k(e=>Uc(e[0]),(e,t,n)=>{let r=n?.suspendOnWaiting??!1;return Mn(n=>{let i=e.get(t);if(i._tag!==`Initial`&&!(r&&i.waiting))return n(Bc(i));let a=e.subscribe(t,e=>{e._tag!==`Initial`&&!(r&&e.waiting)&&(n(Bc(e)),a())});return j(a)})}),qc={immediate:!0},Jc=e=>{e()},Yc=`~effect-atom/atom/Atom/Serializable`,Xc=e=>Yc in e?e[Yc].key:e,Zc=class{[Hc];timeoutResolution;defaultIdleTTL;scheduler;schedulerAsync;dispatcher;onNodeAdded;onNodeRemoved;constructor(e,t,n,r){if(this[Hc]=Hc,this.scheduler=new er(`sync`,t),this.schedulerAsync=new er(`async`,t),this.dispatcher=this.schedulerAsync.makeDispatcher(),this.defaultIdleTTL=r,n===void 0&&r!==void 0?this.timeoutResolution=Math.round(r/2):this.timeoutResolution=n??1e3,e!==void 0)for(let[t,n]of e){let e=t;for(;e.initialValueTarget;)e=e.initialValueTarget;this.ensureNode(e).setInitialValue(n)}}nodes=new Map;preloadedSerializable=new Map;timeoutBuckets=new Map;nodeTimeoutBucket=new Map;disposed=!1;getNodes(){return this.nodes}get(e){return this.ensureNode(e).value()}set(e,t){e.write(this.ensureNode(e).writeContext,t)}setSerializable(e,t){this.preloadedSerializable.set(e,t)}modify(e,t){let n=this.ensureNode(e),r=t(n.value());return e.write(n.writeContext,r[1]),r[0]}update(e,t){let n=this.ensureNode(e);e.write(n.writeContext,t(n.value()))}refresh=e=>{e.refresh===void 0?this.invalidateAtom(e):e.refresh(this.refresh)};subscribe(e,t,n){let r=this.ensureNode(e);n?.immediate&&t(r.value());let i=r.subscribe(function(){t(r._value)});return()=>{i(),r.canBeRemoved&&this.scheduleNodeRemoval(r)}}mount(e){return this.subscribe(e,Ln,qc)}atomHasTtl(e){return!e.keepAlive&&e.idleTTL!==0&&(e.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(e){let t=Xc(e),n=this.nodes.get(t);if(n===void 0?(n=this.createNode(e),this.nodes.set(t,n),this.onNodeAdded?.(n)):this.atomHasTtl(e)&&this.removeNodeTimeout(n),typeof t==`string`&&this.preloadedSerializable.has(t)){let r=this.preloadedSerializable.get(t);this.preloadedSerializable.delete(t);let i=e[Yc].decode(r);n.setValue(i)}return n}createNode(e){if(this.disposed)throw Error(`Cannot access Atom ${e}: registry is disposed`);return e.keepAlive||this.scheduleAtomRemoval(e),new $c(this,e)}invalidateAtom=e=>{this.ensureNode(e).invalidate()};scheduleAtomRemoval(e){this.dispatcher.scheduleTask(()=>{let t=this.nodes.get(Xc(e));t!==void 0&&t.canBeRemoved&&this.removeNode(t)},0)}scheduleNodeRemoval(e){this.dispatcher.scheduleTask(()=>{e.canBeRemoved&&this.removeNode(e)},0)}removeNode(e){this.atomHasTtl(e.atom)?this.setNodeTimeout(e):(this.nodes.delete(Xc(e.atom)),e.remove(),this.onNodeRemoved?.(e))}setNodeTimeout(e){if(this.nodeTimeoutBucket.has(e))return;let t=e.atom.idleTTL??this.defaultIdleTTL;if(this.#e!==null&&(t-=this.#e,t<=0)){this.nodes.delete(Xc(e.atom)),e.remove(),this.onNodeRemoved?.(e);return}let n=Math.ceil(t/this.timeoutResolution)*this.timeoutResolution,r=Date.now()+n,i=r-r%this.timeoutResolution+this.timeoutResolution,a=this.timeoutBuckets.get(i);a===void 0&&(a=[new Set,setTimeout(()=>this.sweepBucket(i),i-Date.now())],this.timeoutBuckets.set(i,a)),a[0].add(e),this.nodeTimeoutBucket.set(e,i)}removeNodeTimeout(e){let t=this.nodeTimeoutBucket.get(e);if(t===void 0)return;this.nodeTimeoutBucket.delete(e),this.scheduleNodeRemoval(e);let[n,r]=this.timeoutBuckets.get(t);n.delete(e),n.size===0&&(clearTimeout(r),this.timeoutBuckets.delete(t))}#e=null;sweepBucket(e){let t=this.timeoutBuckets.get(e)[0];this.timeoutBuckets.delete(e),t.forEach(e=>{this.nodeTimeoutBucket.delete(e),e.canBeRemoved&&(this.nodes.delete(Xc(e.atom)),this.onNodeRemoved?.(e),this.#e=e.atom.idleTTL??this.defaultIdleTTL,e.remove(),this.#e=null)})}reset(){this.timeoutBuckets.forEach(([,e])=>clearTimeout(e)),this.timeoutBuckets.clear(),this.nodeTimeoutBucket.clear(),this.nodes.forEach(e=>{e.remove(),this.onNodeRemoved?.(e)}),this.nodes.clear()}dispose(){this.disposed=!0,this.reset()}},Qc={alive:1,initialized:2,waitingForValue:4},F={uninitialized:Qc.alive|Qc.waitingForValue,stale:Qc.alive|Qc.initialized|Qc.waitingForValue,valid:Qc.alive|Qc.initialized,removed:0},$c=class{constructor(e,t){this.registry=e,this.atom=t,this.writeContext=new rl(e,this)}registry;atom;state=F.uninitialized;lifetime;writeContext;preserveInitialValueOnBuild=!1;parents=[];previousParents;children=[];listeners=new Set;skipInvalidation=!1;currentState(){switch(this.state){case F.uninitialized:return`uninitialized`;case F.stale:return`stale`;case F.valid:return`valid`;default:return`removed`}}get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.length===0&&this.state!==0}_value=void 0;value(){if((this.state&Qc.waitingForValue)!==0){this.lifetime=nl(this);let e=this.atom.read(this.lifetime);if((this.state&Qc.waitingForValue)!==0&&(this.preserveInitialValueOnBuild?(this.preserveInitialValueOnBuild=!1,this.state=F.valid):this.setValue(e)),this.previousParents){let e=this.previousParents;this.previousParents=void 0;for(let t=0;t<e.length;t++)e[t].removeChild(this),e[t].canBeRemoved&&this.registry.scheduleNodeRemoval(e[t])}}return this._value}valueOption(){return(this.state&Qc.initialized)===0?S():c(this._value)}setInitialValue(e){if((this.state&Qc.initialized)===0){this.preserveInitialValueOnBuild=!0,this.state=F.stale,this._value=e,I.phase===il.collect?I.notify.add(this):this.notify();return}this.setValue(e)}setValue(e){if((this.state&Qc.initialized)===0){this.state=F.valid,this._value=e,I.phase===il.collect?I.notify.add(this):this.notify();return}this.state=F.valid,!Object.is(this._value,e)&&(this._value=e,this.skipInvalidation?this.skipInvalidation=!1:this.invalidateChildren(),this.listeners.size>0&&(I.phase===il.collect?I.notify.add(this):this.notify()))}addParent(e){if(this.parents.push(e),this.previousParents!==void 0){let t=this.previousParents.indexOf(e);t!==-1&&(this.previousParents[t]=this.previousParents[this.previousParents.length-1],this.previousParents.pop()===void 0&&(this.previousParents=void 0))}e.children.indexOf(this)===-1&&(e.children.push(this),e.skipInvalidation&&=!1)}removeChild(e){let t=this.children.indexOf(e);t!==-1&&(this.children[t]=this.children[this.children.length-1],this.children.pop())}invalidate(){this.state===F.valid&&(this.state=F.stale,this.disposeLifetime()),I.phase===il.collect?I.stale.push(this):this.atom.lazy&&this.listeners.size===0&&!el(this.children)?(this.invalidateChildren(),this.skipInvalidation=!0):this.value()}invalidateChildren(){if(this.children.length===0)return;let e=this.children;this.children=[];for(let t=0;t<e.length;t++)e[t].invalidate()}notify(){this.listeners.forEach(Jc),I.phase===il.commit&&I.notify.delete(this)}disposeLifetime(){this.lifetime!==void 0&&(this.lifetime.dispose(),this.lifetime=void 0),this.parents.length!==0&&(this.previousParents=this.parents,this.parents=[])}remove(){if(this.state=F.removed,this.listeners.clear(),this.lifetime===void 0||(this.disposeLifetime(),this.previousParents===void 0))return;let e=this.previousParents;this.previousParents=void 0;for(let t=0;t<e.length;t++)e[t].removeChild(this),e[t].canBeRemoved&&this.registry.removeNode(e[t])}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}};function el(e){if(e.length===0)return!1;let t=e,n,r=0;for(;t!==void 0;){for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!r.atom.lazy||r.listeners.size>0)return!0;r.children.length>0&&(n===void 0?n=[r.children]:n.push(r.children))}t=n?.[r++]}return!1}var tl={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)return e();this.finalizers??=[],this.finalizers.push(e)},get(e){if(this.disposed)return this.node.registry.get(e);let t=this.node.registry.ensureNode(e);return this.node.addParent(t),t.value()},result(e,t){if(this.disposed||this.isFn)return this.resultOnce(e,t);let n=this.get(e);if(t?.suspendOnWaiting&&n.waiting)return $i;switch(n._tag){case`Initial`:return $i;case`Failure`:return qi(n.cause);case`Success`:return A(n.value)}},resultOnce(e,t){return Mn(n=>{let r=this.once(e);if(r._tag!==`Initial`&&!(t?.suspendOnWaiting&&r.waiting))return n(Bc(r));let i=this.node.registry.subscribe(e,e=>{e._tag===`Initial`||t?.suspendOnWaiting&&e.waiting||(i(),n(Bc(e)))},{immediate:!1});return j(i)})},setResult(e,t){return this.disposed?$i:(this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0}))},some(e){if(this.disposed||this.isFn)return this.someOnce(e);let t=this.get(e);return t._tag===`None`?$i:A(t.value)},someOnce(e){return Mn(t=>{let n=this.once(e);if(Tt(n))return t(A(n.value));let r=this.node.registry.subscribe(e,e=>{Ni(e)||(r(),t(A(e.value)))},{immediate:!1});return j(r)})},once(e){return this.node.registry.get(e)},self(){return this.disposed?S():this.node.valueOption()},refresh(e){this.disposed||this.node.registry.refresh(e)},refreshSelf(){this.disposed||this.node.invalidate()},mount(e){this.disposed||this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){this.disposed||this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){this.disposed||this.node.setValue(e)},set(e,t){this.disposed||this.node.registry.set(e,t)},stream(e,t){return this.disposed?ps:fs(n=>j(()=>{this.subscribe(e,e=>za(n,e),{immediate:!t?.withoutInitialValue})}))},streamResult(e,t){return this.stream(e,t).pipe(xs(Dc),bs(e=>e._tag===`Success`?A(e.value):mn(e.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;let e=this.finalizers;this.finalizers=void 0;for(let t=e.length-1;t>=0;t--)e[t]()}},nl=e=>{function t(n){if(t.disposed||t.isFn)return e.registry.get(n);let r=e.registry.ensureNode(n),i=r.value();return e.addParent(r),i}return Object.setPrototypeOf(t,tl),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t},rl=class{constructor(e,t){this.registry=e,this.node=t}registry;node;get(e){return this.registry.get(e)}set(e,t){return this.registry.set(e,t)}setSelf(e){return this.node.setValue(e)}refreshSelf(){return this.node.invalidate()}},il={disabled:0,collect:1,commit:2},I={phase:il.disabled,depth:0,stale:[],notify:new Set};function al(e){I.phase=il.collect,I.depth++;try{if(e(),I.depth===1){for(let e=0;e<I.stale.length;e++)ol(I.stale[e]);I.phase=il.commit;for(let e of I.notify)e.notify();I.notify.clear()}}finally{I.depth--,I.depth===0&&(I.phase=il.disabled,I.stale=[])}}function ol(e){if(e.state!==F.valid){for(let t=0;t<e.parents.length;t++){let n=e.parents[t];n.state!==F.valid&&ol(n)}e.state!==F.valid&&e.value()}}var sl=`~effect/reactivity/Atom`,cl=e=>pr(e,sl),ll=`~effect/reactivity/Atom/Writable`,ul=k(2,(e,t)=>{let n=Bi(t),r=St(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Et(n):void 0})}),dl=ul(0),fl={[sl]:sl,...Ge,toJSON(){return{_id:`Atom`,keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}}},pl={...fl,atom(e,t){let n=xl(e,t);return _l(e=>{let t=e.self(),r=e(this);return r._tag===`Success`?n(e,r.value):Lc(r,t)})},fn(e,t){return arguments.length===0?(e,t)=>ml(this,e,t):ml(this,e,t)},pull(e,t){let n=dl(wl(0));return Ll(n,_l(r=>{let i=r.self(),a=r(this);return a._tag===`Success`?El(r,Il(r,n,e,t),Oc(!0),a.value):Lc(a,i)}))},subscriptionRef(e){return Ml(dl(_l(t=>{let n=t.self(),r=t(this);if(r._tag!==`Success`)return Lc(r,n);let i=typeof e==`function`?e(t):e;return lc(i)?i:El(t,i,Oc(!0),r.value)})),(e,t)=>jl(e,t,zc(e(this))))}},ml=(e,t,n)=>{let[r,i,a]=Fl(n?.reactivityKeys?(e,r)=>{let i=t(e,r);return xr(i)?_c(i,n.reactivityKeys):ws(i,vc(n.reactivityKeys))}:t,n);return vl(t=>{t.get(a);let n=t.self(),i=t.get(e);return i._tag===`Success`?r(t,i.value):Lc(i,n)},i)},hl={...fl,[ll]:ll},gl=e=>ll in e,_l=(e,t)=>{let n=Object.create(fl);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},vl=(e,t,n)=>{let r=Object.create(hl);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function yl(e,t){e.setSelf(t)}var bl=(e,t)=>{let n=xl(e,t);return`~effect/reactivity/Atom`in n?n:_l(n)},xl=(e,t)=>{if(typeof e==`function`&&!xr(e)&&!ls(e)){let n=e;return function(e,r){let i=n(e);switch(typeof i){case`function`:case`object`:return i===null?i:Sl in i?Tl(e,i,t,r):Cl in i?kl(e,i,t,r):i;default:return i}}}else if(xr(e))return function(n,r){return Tl(n,e,t,r)};else if(ls(e))return function(n,r){return kl(n,e,t,r)};return wl(e)},Sl=`~effect/Effect`,Cl=`~effect/Stream`,wl=e=>vl(function(t){return e},yl),Tl=(e,t,n,r)=>El(e,t,n?.initialValue===void 0?Oc():Ac(n.initialValue),r,n?.uninterruptible);function El(e,t,n,r=wr(),i=!1){let a=e.self(),o=jn();e.addFinalizer(()=>{ht(r)(Gr(o,Ot))});let s=new Map(r.mapUnsafe);s.set(li.key,o),s.set(Gc.key,e.registry),s.set(un.key,e.registry.scheduler);let c,l=!1,u=Dl(st(s),t,function(t){c=Tc(t,a),l&&e.setSelf(c)},i);return l=!0,u!==void 0&&e.addFinalizer(u),c===void 0?a._tag===`Some`?Ec(a):Fc(n):c}function Dl(e,t,n,r=!1){if(Hi(t)){n(t);return}let i=ht(e)(t);i.currentDispatcher?.flush();let a=i.pollUnsafe();if(a){n(a);return}let o=i.addObserver(n);function s(){o(),r||i.interruptUnsafe()}return s}var Ol=(e=>{let t=yc;function n(r){let i=Object.create(pl);i.keepAlive=!1,i.lazy=!0,i.refresh=void 0,i.factory=n;let a=zl(_l(typeof r==`function`?e=>Un(r(e),t):()=>Un(r,t)));return i.layer=a,i.read=function(t){let n=t(a);return Tl(t,M(si,t=>ye(n,e.memoMap,t)),{uninterruptible:!0})},i}n.memoMap=e.memoMap,n.addGlobalLayer=e=>{t=Un(t,i(e,yc))};let r=dl(bl(Qr(t=>ye(yc,e.memoMap,l(t,li))).pipe(C(l(mc)))));return n.withReactivity=e=>t=>Bl(t,n=>{let i=zc(n(r));return n.addFinalizer(i.registerUnsafe(e,()=>{n.refresh(t)})),n.subscribe(t,e=>n.setSelf(e)),n.once(t)},{initialValueTarget:t}),n})({memoMap:qt()});Ol.withReactivity;var kl=(e,t,n,r)=>Al(e,t,n?.initialValue===void 0?Oc():Ac(n.initialValue),r);function Al(e,t,n,r=wr()){let i=e.self();r=nt(r,Gc,e.registry);let a=fr(n=>M(Ho(t.channel,n),t=>Fi({while:Or,body:()=>t,step(t){e.setSelf(Ac(gi(t),{waiting:!0}))}}))).pipe(Ar(t=>(ct(t)?nr(e.self(),Oi(Rc),ie({onNone:()=>e.setSelf(Pc(new it,{previous:e.self()})),onSome:t=>e.setSelf(Ac(t))})):e.setSelf(Nc(t,{previous:e.self()})),w))),o=new Map(r.mapUnsafe);o.set(Gc.key,e.registry),o.set(un.key,e.registry.scheduler);let s=Dl(st(o),a,Ln,!1);return s!==void 0&&e.addFinalizer(s),i._tag===`Some`?Ec(i):Fc(n)}var jl=(e,t,n=wr())=>lc(t)?(e.addFinalizer(uc(t).pipe(Es(t=>{for(let n=0;n<t.length;n++)e.setSelf(t[n]);return w}),Yt(n))),Rr(n)(dc(t))):t._tag===`Success`?Al(e,uc(t.value),Oc(!0),n):t,Ml=(e,t)=>{function n(t,n){let r=t.get(e);lc(r)?vi(pc(r,n)):kc(r)&&vi(pc(r.value,n))}return vl(n=>{let r=n(e);return lc(r)||kc(r)?t(n,r):r},n)},Nl=Symbol.for(`effect/reactivity/atom/Atom/Reset`),Pl=Symbol.for(`effect/reactivity/atom/Atom/Interrupt`);function Fl(e,t){let n=dl(wl([0,void 0])),r=t?.initialValue===void 0?Oc():Ac(t.initialValue),i=t?.concurrent?dl(_l(e=>{let t=new Set;return e.addFinalizer(()=>t.forEach(e=>e.interruptUnsafe())),t})):void 0;function a(t,a){let o=i?t(i):void 0;t.isFn=!0;let[s,c]=t.get(n);if(s===0)return r;if(c===Pl)return Nc(Oe(),{previous:t.self()});let l=e(c,t);return Sl in l?(o&&(l=M(Li(l,{startImmediately:!0}),e=>(o.add(e),e.addObserver(()=>o.delete(e)),C(ta(o),e=>e[0])))),El(t,l,r,a,!1)):Al(t,l,r,a)}function o(e,t){Hl(()=>{t===Nl?e.set(n,[0,void 0]):t===Pl?e.set(n,[e.get(n)[0]+1,Pl]):e.set(n,[e.get(n)[0]+1,t]),e.refreshSelf()})}return[a,o,n]}var Il=(e,t,n,r)=>M(Ds(typeof n==`function`?n(e):n),n=>{let i=ia().context,a=Bt(),o=yt(n,{onFailure(e){return ct(e)?ft(a)?A({done:!0,items:a}):ir(new it(`Atom.pull: no items`)):mn(e)},onSuccess(e){let t;return r?.disableAccumulation?t=e:(t=Zi(a,e),a=t),A({done:!1,items:t})}}),s=new Set;return e.addFinalizer(()=>{for(let e of s)e()}),e.once(t),e.subscribe(t,()=>{e.setSelf(Ec(e.self()));let t;t=Dl(i,o,n=>{t&&s.delete(t);let r=Tc(n,e.self()),i=s.size>0;e.setSelf(i?Fc(r):r)}),t&&s.add(t)}),o}),Ll=(e,t)=>vl(t.read,function(t,n){t.set(e,t.get(e)+1)}),Rl=typeof WeakRef>`u`||typeof FinalizationRegistry>`u`?e=>{let t=es();return function(n){let r=ts(t,n);if(r._tag===`Some`)return r.value;let i=e(n);return as(t,n,i),i}}:e=>{let t=es(),n=new FinalizationRegistry(e=>{ss(t,e)});return function(r){let i=ts(t,r).pipe(Wi(e=>e.deref()));if(i._tag===`Some`)return i.value;let a=e(r);return as(t,r,new WeakRef(a)),n.register(a,r),a}},zl=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),Bl=k(e=>cl(e[0]),(e,t,n)=>{let r=dl(gl(e)?vl(n=>t(n,e),function(t,n){t.set(e,n)},e.refresh??function(t){t(e)}):_l(n=>t(n,e),e.refresh??function(t){t(e)}));return n?.initialValueTarget&&(r.initialValueTarget=Vl(n.initialValueTarget)),r}),Vl=e=>{let t=e;for(;t.initialValueTarget;)t=t.initialValueTarget;return t},Hl=al,Ul=`~effect-atom/atom/Atom/Serializable`,Wl=k(2,(e,t)=>{let n=Rt(t.schema);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,label:e.label??[t.key,Error().stack?.split(`
|
|
2
|
+
`)[5]??``],[Ul]:{key:t.key,encode:ze(n),decode:Xe(n)}})}),Gl=`~effect-atom/atom/Atom/ServerValue`,Kl=k(2,(e,t)=>`~effect-atom/atom/Atom/ServerValue`in e?e[Gl](e=>t.get(e)):t.get(e));function ql(e){let t=js.unstable_scheduleCallback(4,e);return()=>js.unstable_cancelCallback(t)}var Jl=As.createContext(Wc({scheduleTask:ql,defaultIdleTTL:400})),Yl=new WeakMap;function Xl(e,t){let n=Yl.get(e);n===void 0&&(n=new WeakMap,Yl.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i={subscribe(n){return e.subscribe(t,n)},snapshot(){return e.get(t)},getServerSnapshot(){return Kl(t,e)}};return n.set(t,i),i}function Zl(e,t){let n=Xl(e,t);return As.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function Ql(e,t){As.useEffect(()=>e.mount(t),[t,e])}function $l(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?As.useCallback(r=>{e.set(t,r);let i=Vn(Kc(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(eu):i},[e,t,n.mode]):As.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var eu=e=>{if(_(e))return e.value;throw h(e.cause)},tu=(e,t)=>{let n=As.useContext(Jl);return Ql(n,e),$l(n,e,t)},nu=e=>{let t=As.useContext(Jl);return Ql(t,e),As.useCallback(()=>{t.refresh(e)},[t,e])},ru={suspendOnWaiting:new Map,default:new Map};function iu(e,t,n){let r=n?ru.suspendOnWaiting:ru.default,i=r.get(t);return i===void 0?(i=new Promise(i=>{let a=e.subscribe(t,e=>{e._tag===`Initial`||n&&e.waiting||(setTimeout(a,1e3),i(),r.delete(t))})}),r.set(t,i),i):i}function au(e,t,n){let r=Zl(e,t);if(r._tag===`Initial`||n&&r.waiting)throw iu(e,t,n);return r}var ou=(e,t)=>{let n=au(As.useContext(Jl),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw h(n.cause);return n},su=Symbol.for(`~effect/http/Headers`),cu=Object.create(null);Object.defineProperties(cu,{[su]:{value:su},[Fe]:{value(e){return vu(this,l(e,yu))}},toJSON:{value(){return _e(this)}},[rn]:{value(e){return uu(this,e)}},[ci]:{value(){return zr(this)}},toString:{value:Xi.toString},[Ft]:{value:Xi[Ft]}});var lu=e=>Object.assign(Object.create(cu),e),uu=Ci(je()),du=Object.create(cu),fu=e=>{if(e===void 0)return du;if(Symbol.iterator in e){let t=Object.create(cu);for(let[n,r]of e)t[n.toLowerCase()]=r;return t}let t=Object.create(cu);for(let[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(`, `):r!==void 0&&(t[n.toLowerCase()]=r);return t},pu=e=>Object.setPrototypeOf(e,cu),mu=k(3,(e,t,n)=>{let r=lu(e);return r[t.toLowerCase()]=n,r}),hu=k(2,(e,t)=>lu({...e,...fu(t)})),gu=k(2,(e,t)=>{let n=lu(e);return Object.assign(n,t),n}),_u=k(2,(e,t)=>{let n=lu(e);return delete n[t.toLowerCase()],n}),vu=k(2,(e,t)=>{let n={...e},r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&(n[r]=xi(e[r]))}else for(let r in e)t.test(r)&&(n[r]=xi(e[r]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),yu=ce(`effect/Headers/CurrentRedactedNames`,{defaultValue:()=>[`authorization`,`cookie`,`set-cookie`,`x-api-key`]}),bu=`~effect/http/UrlParams`,xu={...Ge,[bu]:bu,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:`UrlParams`,params:Object.fromEntries(this.params)}},[rn](e){return Tu(this,e)},[ci](){return dt(this.params.flat())}},Su=e=>{let t=Object.create(xu);return t.params=e,t},Cu=e=>{let t=wu(e),n=[];for(let e=0;e<t.length;e++)if(Array.isArray(t[e][0])){let[r,i]=t[e];n.push([`${r[0]}[${r.slice(1).join(`][`)}]`,i])}else n.push(t[e]);return Su(n)},wu=e=>{let t=typeof e[Symbol.iterator]==`function`?Qt(e):Object.entries(e),n=[];for(let[e,r]of t)if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]!==void 0&&n.push([e,String(r[t])]);else if(typeof r==`object`){let t=wu(r);for(let[r,i]of t)n.push([[e,...typeof r==`string`?[r]:r],i])}else r!==void 0&&n.push([e,String(r)]);return n},Tu=ei((e,t)=>Eu(e.params,t.params)),Eu=ai(Jr([je(),je()])),Du=Su([]),Ou=k(2,(e,t)=>{let n=Cu(t),r=n.params,i=new Set;for(let e=0;e<r.length;e++)i.add(r[e][0]);for(let t=0;t<e.params.length;t++)i.has(e.params[t][0])||r.push(e.params[t]);return n}),ku=class extends y(`UrlParamsError`){},Au=(e,t,n)=>{try{let r=new URL(e,ju());for(let e=0;e<t.params.length;e++){let[n,i]=t.params[e];i!==void 0&&r.searchParams.append(n,i)}return n!==void 0&&(r.hash=n),ln(r)}catch(e){return jr(new ku({cause:e}))}},ju=()=>{if(`location`in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname},Mu=`~effect/http/HttpBody`;y(`HttpBodyError`);var Nu=class{[Mu];constructor(){this[Mu]=Mu}[Ft](){return this.toJSON()}toString(){return zt(this,{ignoreToString:!0})}},Pu=new class extends Nu{_tag=`Empty`;toJSON(){return{_id:`effect/HttpBody`,_tag:`Empty`}}},Fu=`~effect/http/Cookies`,Iu=`~effect/http/Cookies/Cookie`;y(`CookieError`);var Lu={[Fu]:Fu,...Xi,toJSON(){return{_id:`effect/Cookies`,cookies:Pn(this.cookies,e=>e.toJSON())}},pipe(){return fn(this,arguments)}},Ru=e=>{let t=Object.create(Lu);return t.cookies=e,t},zu=e=>{let t={};for(let n of e)t[n.name]=n;return Ru(t)},Bu=e=>{let t=typeof e==`string`?[e]:e,n=[];for(let e of t){let t=Vu(e.trim());t&&n.push(t)}return zu(n)};function Vu(e){let t=e.split(`;`).map(e=>e.trim()).filter(e=>e!==``);if(t.length===0)return;let n=t[0].indexOf(`=`);if(n===-1)return;let r=t[0].slice(0,n);if(!Hu.test(r))return;let i=t[0].slice(n+1),a=Wu(i);if(t.length===1)return Object.assign(Object.create(Uu),{name:r,value:a,valueEncoded:i});let o={};for(let e=1;e<t.length;e++){let n=t[e],r=n.indexOf(`=`),i=r===-1?n:n.slice(0,r).trim(),a=r===-1?void 0:n.slice(r+1).trim();switch(i.toLowerCase()){case`domain`:{if(a===void 0)break;let e=a.trim().replace(/^\./,``);e&&(o.domain=e);break}case`expires`:{if(a===void 0)break;let e=new Date(a);isNaN(e.getTime())||(o.expires=e);break}case`max-age`:{if(a===void 0)break;let e=parseInt(a,10);isNaN(e)||(o.maxAge=Pi(e));break}case`path`:if(a===void 0)break;a[0]===`/`&&(o.path=a);break;case`priority`:if(a===void 0)break;switch(a.toLowerCase()){case`low`:o.priority=`low`;break;case`medium`:o.priority=`medium`;break;case`high`:o.priority=`high`;break}break;case`httponly`:o.httpOnly=!0;break;case`secure`:o.secure=!0;break;case`partitioned`:o.partitioned=!0;break;case`samesite`:if(a===void 0)break;switch(a.toLowerCase()){case`lax`:o.sameSite=`lax`;break;case`strict`:o.sameSite=`strict`;break;case`none`:o.sameSite=`none`;break}break}}return Object.assign(Object.create(Uu),{name:r,value:a,valueEncoded:i,options:Object.keys(o).length>0?o:void 0})}var Hu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Uu={[Iu]:Iu,...Xi,toJSON(){return{_id:`effect/Cookies/Cookie`,name:this.name,value:this.value,options:this.options}}},Wu=e=>{try{return decodeURIComponent(e)}catch{return e}},Gu=`~effect/http/HttpClientError`,Ku=class extends y(`HttpClientError`){constructor(e){`cause`in e.reason?super({...e,cause:e.reason.cause}):super(e)}[Gu]=Gu;get request(){return this.reason.request}get response(){return`response`in this.reason?this.reason.response:void 0}get message(){return this.reason.message}},qu=e=>e.endsWith(`Error`)?e.slice(0,-5):e,Ju=(e,t,n)=>t?`${e}: ${t} (${n})`:`${e} error (${n})`,Yu=class extends y(`TransportError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return Ju(qu(this._tag),this.description,this.methodAndUrl)}};y(`EncodeError`);var Xu=class extends y(`InvalidUrlError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return Ju(qu(this._tag),this.description,this.methodAndUrl)}};y(`StatusCodeError`);var Zu=class extends y(`DecodeError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return Ju(qu(this._tag),this.description,e)}},Qu=class extends y(`EmptyBodyError`){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return Ju(qu(this._tag),this.description,e)}},$u=class e extends ar(Gu)({_tag:At(`HttpError`),kind:Di([`EncodeError`,`DecodeError`,`TransportError`,`InvalidUrlError`,`StatusCodeError`,`EmptyBodyError`]),cause:x(O)}){static fromHttpClientError(t){return new e({_tag:`HttpError`,kind:t.reason._tag,cause:t.reason})}},ed=[[`GET`,`get`],[`POST`,`post`],[`PUT`,`put`],[`DELETE`,`del`],[`PATCH`,`patch`],[`HEAD`,`head`],[`OPTIONS`,`options`],[`TRACE`,`trace`]],td=`~effect/http/HttpClientRequest`,nd={[td]:td,...Xi,toJSON(){return{_id:`HttpClientRequest`,method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:_e(this.headers),body:this.body.toJSON()}},pipe(){return fn(this,arguments)}};function rd(e,t,n,r,i,a){let o=Object.create(nd);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=i,o.body=a,o}var id=rd(`GET`,``,Du,S(),du,Pu),ad=e=>(t,n)=>od(id,{method:e,url:t,...n??void 0}),od=k(2,(e,t)=>{let n=e;return t.method&&(n=sd(n,t.method)),t.url&&(n=fd(n,t.url)),t.headers&&(n=ld(n,t.headers)),t.urlParams&&(n=pd(n,t.urlParams)),t.hash&&(n=md(n,t.hash)),t.body&&(n=hd(n,t.body)),t.accept&&(n=ud(n,t.accept)),t.acceptJson&&(n=dd(n)),n}),sd=k(2,(e,t)=>rd(t,e.url,e.urlParams,e.hash,e.headers,e.body)),cd=k(3,(e,t,n)=>rd(e.method,e.url,e.urlParams,e.hash,mu(e.headers,t,n),e.body)),ld=k(2,(e,t)=>rd(e.method,e.url,e.urlParams,e.hash,hu(e.headers,t),e.body)),ud=k(2,(e,t)=>cd(e,`Accept`,t)),dd=ud(`application/json`),fd=k(2,(e,t)=>{if(typeof t==`string`)return rd(e.method,t,e.urlParams,e.hash,e.headers,e.body);let n=new URL(t.toString()),r=Cu(n.searchParams),i=Sn(n.hash===``?void 0:n.hash.slice(1));return n.search=``,n.hash=``,rd(e.method,n.toString(),r,i,e.headers,e.body)}),pd=k(2,(e,t)=>rd(e.method,e.url,Ou(e.urlParams,t),e.hash,e.headers,e.body)),md=k(2,(e,t)=>rd(e.method,e.url,e.urlParams,c(t),e.headers,e.body)),hd=k(2,(e,t)=>{let n=e.headers;return t._tag===`Empty`||t._tag===`FormData`?n=_u(_u(n,`Content-Type`),`Content-length`):(t.contentType&&(n=mu(n,`content-type`,t.contentType)),t.contentLength!==void 0&&(n=mu(n,`content-length`,t.contentLength.toString()))),rd(e.method,e.url,e.urlParams,e.hash,n,t)}),gd=`~effect/http/HttpIncomingMessage`,_d=(e,t)=>{let n=e.headers[`content-type`]??``,r;if(n.includes(`application/json`))try{r=vi(e.json)}catch{}else if(n.includes(`text/`)||n.includes(`urlencoded`))try{r=vi(e.text)}catch{}let i={...t,headers:_e(e.headers),remoteAddress:e.remoteAddress};return r!==void 0&&(i.body=r),i},vd=`~effect/http/HttpClientResponse`,yd=(e,t)=>new bd(e,t),bd=class extends m{[gd];[vd];request;source;constructor(e,t){super(),this.request=e,this.source=t,this[gd]=gd,this[vd]=vd}toJSON(){return _d(this,{_id:`HttpClientResponse`,request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return fu(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=Bu(this.source.headers.getSetCookie())}get remoteAddress(){return S()}get stream(){return this.source.body?vs({evaluate:()=>this.source.body,onError:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}):hs(new Ku({reason:new Qu({request:this.request,response:this,description:`can not create stream from empty body`})}))}get json(){return M(this.text,e=>dn({try:()=>e===``?null:JSON.parse(e),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}))}textBody;get text(){return this.textBody?this.textBody:(this.textBody=tr({try:()=>this.source.text(),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}).pipe(hi,vi),this.arrayBufferBody=C(this.textBody,e=>new TextEncoder().encode(e).buffer),this.textBody)}get urlParamsBody(){return M(this.text,e=>dn({try:()=>Cu(new URLSearchParams(e)),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}))}formDataBody;get formData(){return this.formDataBody??=tr({try:()=>this.source.formData(),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}).pipe(hi,vi)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody?this.arrayBufferBody:(this.arrayBufferBody=tr({try:()=>this.source.arrayBuffer(),catch:e=>new Ku({reason:new Zu({request:this.request,response:this,cause:e})})}).pipe(hi,vi),this.textBody=C(this.arrayBufferBody,e=>new TextDecoder().decode(e)),this.arrayBufferBody)}pipe(){return fn(this,arguments)}},xd=e=>pu({b3:`${e.traceId}-${e.spanId}-${e.sampled?`1`:`0`}${ie(e.parent,{onNone:()=>``,onSome:e=>`-${e.spanId}`})}`,traceparent:`00-${e.traceId}-${e.spanId}-${e.sampled?`01`:`00`}`}),Sd=`~effect/http/HttpClient`,Cd=v(`effect/HttpClient`),wd=k(2,(e,t)=>Td(n=>t(e.postprocess(n)),e.preprocess)),Td=(e,t)=>{let n=Object.create(Ed);return n.preprocess=t,n.postprocess=e,n.execute=function(n){return e(t(n))},n},Ed={[Sd]:Sd,pipe(){return fn(this,arguments)},...Xi,toJSON(){return{_id:`effect/HttpClient`}},...Object.fromEntries(ed.map(([e,t])=>[t,function(t,n){return this.execute(ad(e)(t,n))}]))},Dd=e=>Td(t=>M(t,t=>Dt(n=>{let r=Nd.get(t),i=r??new AbortController,a=Au(t.url,t.urlParams,ee(t.hash));if(or(a))return ir(new Ku({reason:new Xu({request:t,cause:a.failure})}));let o=a.success;if(n.getRef(Fn)||n.getRef(Od)(t)){let a=e(t,o,i.signal,n);return r?a:Ki(e=>yt(e(a),{onSuccess(e){return Md.register(e,i),A(new Pd(e,i))},onFailure(e){return lt(e)&&i.abort(),mn(e)}}))}return Vi(n.getRef(Ad)(t),{kind:`client`},a=>{a.attribute(`http.request.method`,t.method),a.attribute(`server.address`,o.origin),o.port!==``&&a.attribute(`server.port`,+o.port),a.attribute(`url.full`,o.toString()),a.attribute(`url.path`,o.pathname),a.attribute(`url.scheme`,o.protocol.slice(0,-1));let s=o.search.slice(1);s!==``&&a.attribute(`url.query`,s);let c=n.getRef(yu),l=vu(t.headers,c);for(let e in l)a.attribute(`http.request.header.${e}`,String(l[e]));return t=n.getRef(kd)?ld(t,xd(a)):t,Ki(s=>s(e(t,o,i.signal,n)).pipe(le(a,{captureStackTrace:!1}),yt({onSuccess:e=>{a.attribute(`http.response.status_code`,e.status);let t=vu(e.headers,c);for(let e in t)a.attribute(`http.response.header.${e}`,String(t[e]));return r?A(e):(Md.register(e,i),A(new Pd(e,i)))},onFailure(e){return!r&<(e)&&i.abort(),mn(e)}})))})})),A),Od=ce(`effect/http/HttpClient/TracerDisabledWhen`,{defaultValue:()=>An}),kd=ce(`effect/HttpClient/TracerPropagationEnabled`,{defaultValue:Or}),Ad=ce(`effect/http/HttpClient/SpanNameGenerator`,{defaultValue:()=>e=>`http.client ${e.method}`}),jd=e=>Ie(Cd)(Qr(t=>C(e,e=>wd(e,wn(e=>pe(t,e)))))),Md=(()=>{if(`FinalizationRegistry`in globalThis&&globalThis.FinalizationRegistry){let e=new FinalizationRegistry(e=>{e.abort()});return{register(t,n){e.register(t,n,t)},unregister(t){e.unregister(t)}}}let e=new Map;return{register(t,n){e.set(t,setTimeout(()=>n.abort(),5e3))},unregister(t){let n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))}}})(),Nd=new WeakMap,Pd=class{original;controller;constructor(e,t){this.original=e,this.controller=t}[vd]=vd;[gd]=gd;applyInterrupt(e){return D(()=>(Md.unregister(this.original),we(e,()=>j(()=>{this.controller.abort()}))))}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return ms(()=>(Md.unregister(this.original),ws(this.original.stream,j(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[Ft](){return this.original[Ft]()}pipe(){return fn(this,arguments)}},Fd=`~effect/FiberSet`,Id=e=>pr(e,Fd),Ld={[Fd]:Fd,[Symbol.iterator](){return this.state._tag===`Closed`?Kn():this.state.backing[Symbol.iterator]()},...Ge,toJSON(){return{_id:`FiberMap`,state:this.state}}},Rd=(e,t)=>{let n=Object.create(Ld);return n.state={_tag:`Open`,backing:e},n.deferred=t,n},zd=()=>Vr(j(()=>Rd(new Set,rr())),e=>D(()=>{let t=e.state;if(t._tag===`Closed`)return w;e.state={_tag:`Closed`};let n=t.backing;return ra(n).pipe(lr(e.deferred))})),Bd=-1,Vd=Cn(ki(Je,Gi(Bd))),Hd=k(e=>Id(e[0]),(e,t,n)=>{if(e.state._tag===`Closed`){t.interruptUnsafe(Bd);return}else if(e.state.backing.has(t))return;e.state.backing.add(t),t.addObserver(r=>{e.state._tag!==`Closed`&&(e.state.backing.delete(t),Ct(r)&&(n?.propagateInterruption===!0?!Vd(r.cause):!me(r.cause))&&Zr(e.deferred,r))})}),Ud=function(){let e;return()=>(e===void 0&&(e=sn(Er)),e)}(),Wd=e=>()=>C(Zn(),t=>{let n=ht(t);return(t,r)=>{if(e.state._tag===`Closed`)return Ud();let i=n(t,r);return Hd(e,i),i}}),Gd=e=>Xn(e.deferred),Kd=`~effect/socket/Socket`,qd=v(`effect/socket/Socket`),Jd=e=>qd.of({[Kd]:Kd,runRaw:e.runRaw,run:e.run??((t,n)=>e.runRaw(e=>typeof e==`string`?t(Yd.encode(e)):e instanceof Uint8Array?t(e):t(new Uint8Array(e)),n)),runString:e.runString??(e.run?(t,n)=>e.run(e=>t(Xd.decode(e)),n):(t,n)=>e.runRaw(e=>typeof e==`string`?t(e):e instanceof Uint8Array?t(Xd.decode(e)):t(Xd.decode(new Uint8Array(e))),n)),writer:e.writer}),Yd=new TextEncoder,Xd=new TextDecoder,Zd=`~effect/socket/Socket/CloseEvent`,Qd=e=>pr(e,Zd),$d=`~effect/socket/Socket/SocketError`,ef=e=>pr(e,$d),tf=class extends ar(`effect/socket/Socket/SocketReadError`)({_tag:At(`SocketReadError`),cause:O}){message=`An error occurred during Read`},nf=class extends ar(`effect/socket/Socket/SocketWriteError`)({_tag:At(`SocketWriteError`),cause:O}){message=`An error occurred during Write`},rf=class extends ar(`effect/socket/Socket/SocketOpenError`)({_tag:At(`SocketOpenError`),kind:Di([`Unknown`,`Timeout`]),cause:O}){get message(){return this.kind===`Timeout`?`timeout waiting for "open"`:`An error occurred during Open`}},af=class extends ar(`effect/socket/Socket/SocketCloseError`)({_tag:At(`SocketCloseError`),code:Ri,closeReason:x(N)}){static filterClean(e){return function(t){return sf.is(t)&&t.reason._tag===`SocketCloseError`&&e(t.reason.code)?ln(t.reason):jr(t)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}},of=Sr([tf,nf,rf,af]),sf=class extends oe($d)(`SocketError`,{_tag:At(`SocketError`),reason:of}){constructor(e){`cause`in e.reason?super({...e,cause:e.reason.cause}):super(e)}[$d]=$d;static is(e){return ef(e)}message=this.reason.message},cf=e=>!0,lf=class extends v()(`~effect/socket/Socket/WebSocket`){},uf=class extends v()(`@effect/platform/Socket/WebSocketConstructor`){},df=bi(uf)((e,t)=>new globalThis.WebSocket(e,t)),ff=(e,t)=>uf.use(n=>pf(Vr((typeof e==`string`?A(e):e).pipe(C(e=>n(e,t?.protocols))),e=>j(()=>e.close(1e3))),t)),pf=(e,t)=>Dt(n=>{let r,i=oa(!1),a=n.context,o=t?.closeCodeIsError??cf;return A(Jd({runRaw:(n,s)=>fr(P(function*(a){let c=yield*zd().pipe(kr(a)),l=yield*kr(e,a),u=yield*ii(Wd(c)(),lf,l),d=!1;function f(e){if(e.data instanceof Blob)return u(M(Ut(()=>e.data.arrayBuffer()),e=>{let t=n(new Uint8Array(e));return xr(t)?t:w}));let t=n(e.data);xr(t)&&u(t)}function p(e){l.removeEventListener(`message`,f),l.removeEventListener(`close`,m),Zr(c.deferred,ir(new sf({reason:d?new tf({cause:e}):new rf({kind:`Unknown`,cause:e})})))}function m(e){let t=typeof e.code==`number`?e.code:1001;l.removeEventListener(`message`,f),l.removeEventListener(`error`,p),Zr(c.deferred,ir(new sf({reason:new af({code:t,closeReason:e.reason})})))}if(l.addEventListener(`close`,m,{once:!0}),l.addEventListener(`error`,p,{once:!0}),l.addEventListener(`message`,f),l.readyState!==1){let e=rr();l.addEventListener(`open`,()=>{d=!0,Zr(e,w)},{once:!0}),yield*Xn(e).pipe(cr({duration:t?.openTimeout??1e4,orElse:()=>ir(new sf({reason:new rf({kind:`Timeout`,cause:Error(`timeout waiting for "open"`)})}))}),Pe(Gd(c)))}return d=!0,r=l,i.openUnsafe(),s?.onOpen&&(yield*s.onOpen),yield*Ei(Gd(c),af.filterClean(e=>!o(e)),()=>w)})).pipe(wn(e=>pe(a,e)),ur(j(()=>{i.closeUnsafe(),r=void 0}))),writer:A(e=>i.whenOpen(j(()=>{let t=r;Qd(e)?t.close(e.code,e.reason):t.send(e)})))}))}),mf=Pr(ff,Ie(qd)),hf=class extends v()(`effect/workers/Transferable/Collector`){},gf=()=>{let e=[],t=t=>{e.push(...t)},n=()=>e,r=()=>{let t=e;return e=[],t};return hf.of({addAllUnsafe:t,addAll:e=>j(()=>t(e)),readUnsafe:n,read:j(n),clearUnsafe:r,clear:j(r)})},_f=`~effect/workers/WorkerError`,vf=Sr([class extends ar(`effect/workers/WorkerError/WorkerSpawnError`)({_tag:At(`WorkerSpawnError`),message:N,cause:x(O)}){},class extends ar(`effect/workers/WorkerError/WorkerSendError`)({_tag:At(`WorkerSendError`),message:N,cause:x(O)}){},class extends ar(`effect/workers/WorkerError/WorkerReceiveError`)({_tag:At(`WorkerReceiveError`),message:N,cause:x(O)}){},class extends ar(`effect/workers/WorkerError/WorkerUnknownError`)({_tag:At(`WorkerUnknownError`),message:N,cause:x(O)}){}]);ar(_f)({_tag:At(`WorkerError`),reason:vf});var yf=`~effect/interfaces/PrimaryKey`,bf=`~effect/rpc/RpcSchema/StreamSchema`;function xf(e){return pr(e,bf)}function Sf(e){return xf(e)?c({success:e.success,error:e.error}):S()}var Cf=gr(ls);function wf(e,t){return Pt(Cf.ast,{[bf]:bf,success:e,error:t})}v()(`effect/rpc/RpcSchema/ClientAbort`);var Tf=`~effect/rpc/Rpc`,Ef={[Tf]:Tf,pipe(){return fn(this,arguments)},setSuccess(e){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return Df({_tag:this._tag,payloadSchema:gt(e)?e:T(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return Df({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:nt(this.annotations,e,t)})},annotateMerge(e){return Df({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:pe(this.annotations,e)})}},Df=e=>{function t(){}return Object.setPrototypeOf(t,Ef),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},L=(e,t)=>{let n=t?.success??s,r=t?.error??Ui,i=t?.defect??O,a;return a=t?.primaryKey?class extends qr(`effect/rpc/Rpc/${e}`)(t.payload){[yf](){return t.primaryKey(this)}}:gt(t?.payload)?t?.payload:t?.payload?T(t?.payload):s,Df({_tag:e,payloadSchema:a,successSchema:t?.stream?wf(n,r):n,errorSchema:t?.stream?Ui:r,defectSchema:i,annotations:wr(),middlewares:new Set})},Of=new WeakMap,kf=e=>{if(Of.has(e))return Of.get(e);let t=e,n=new Set([t.errorSchema]),r=Sf(t.successSchema);Tt(r)&&n.add(r.value.error);for(let e of t.middlewares)n.add(e.error);let i=Qn(Tt(r)?s:t.successSchema,Sr([...n]),t.defectSchema);return Of.set(e,i),i},Af=`~effect/rpc/Rpc/Wrapper`,jf=e=>Af in e,Mf=`~effect/rpc/RpcClientError`,Nf=class extends ar(`effect/rpc/RpcClientError/RpcClientDefect`)({_tag:At(`RpcClientDefect`),message:N,cause:O}){},Pf=class extends ar(Mf)({_tag:At(`RpcClientError`),reason:Sr([vf,of,$u,Nf])}){[Mf]=Mf;get message(){return`${this.reason._tag}: ${this.reason.message}`}},Ff=e=>typeof e==`bigint`?e:BigInt(e),If={_tag:`Ping`},Lf;try{Lf=new TextDecoder}catch{}var R,Rf,z=0,zf=[],Bf=zf,Vf=0,B={},V,Hf,Uf=0,Wf=0,H,Gf,U=[],W,Kf={useRecords:!1,mapsAsObjects:!0},qf=class{},Jf=new qf;Jf.name=`MessagePack 0xC1`;var Yf=!1,Xf=2,Zf=class e{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.sequential&&e.trusted!==!1&&(e.trusted=!0,!e.structures&&e.useRecords!=0&&(e.structures=[],e.maxSharedStructures||=0)),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType=`number`)),Object.assign(this,e)}unpack(t,n){if(R)return wp(()=>(Tp(),this?this.unpack(t,n):e.prototype.unpack.call(Kf,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<`u`?Buffer.from(t):new Uint8Array(t)),typeof n==`object`?(Rf=n.end||t.length,z=n.start||0):(z=0,Rf=n>-1?n:t.length),Vf=0,Wf=0,Hf=null,Bf=zf,H=null,R=t;try{W=t.dataView||=new DataView(t.buffer,t.byteOffset,t.byteLength)}catch(e){throw R=null,t instanceof Uint8Array?e:Error(`Source must be a Uint8Array or Buffer but was a `+(t&&typeof t==`object`?t.constructor.name:typeof t))}if(this instanceof e){if(B=this,this.structures)return V=this.structures,Qf(n);(!V||V.length>0)&&(V=[])}else B=Kf,(!V||V.length>0)&&(V=[]);return Qf(n)}unpackMultiple(e,t){let n,r=0;try{Yf=!0;let i=e.length,a=this?this.unpack(e,i):Dp.unpack(e,i);if(t){if(t(a,r,z)===!1)return;for(;z<i;)if(r=z,t(Qf(),r,z)===!1)return}else{for(n=[a];z<i;)r=z,n.push(Qf());return n}}catch(e){throw e.lastPosition=r,e.values=n,e}finally{Yf=!1,Tp()}}_mergeStructures(e,t){this._onLoadedStructures&&(e=this._onLoadedStructures(e)),e||=[],Object.isFrozen(e)&&(e=e.map(e=>e.slice(0)));for(let t=0,n=e.length;t<n;t++){let n=e[t];n&&(n.isShared=!0,t>=32&&(n.highByte=t-32>>5))}e.sharedLength=e.length;for(let n in t||[])if(n>=0){let r=e[n],i=t[n];i&&(r&&((e.restoreStructures||=[])[n]=r),e[n]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}};function Qf(e){try{if(!B.trusted&&!Yf){let e=V.sharedLength||0;e<V.length&&(V.length=e)}let t;if(B._readStruct&&R[z]<64&&R[z]>=32?(t=B._readStruct(R,z,Rf),R=null,!(e&&e.lazy)&&t&&(t=t.toJSON()),z=Rf):t=G(),H&&=(z=H.postBundlePosition,null),Yf&&(V.restoreStructures=null),z==Rf)V&&V.restoreStructures&&$f(),V=null,R=null,Gf&&=null;else if(z>Rf)throw Error(`Unexpected end of MessagePack data`);else if(!Yf){let e;try{e=JSON.stringify(t,(e,t)=>typeof t==`bigint`?`${t}n`:t).slice(0,100)}catch(t){e=`(JSON view not available `+t+`)`}throw Error(`Data read, but end of buffer not reached `+e)}return t}catch(e){throw V&&V.restoreStructures&&$f(),Tp(),(e instanceof RangeError||e.message.startsWith(`Unexpected end of buffer`)||z>Rf)&&(e.incomplete=!0),e}}function $f(){for(let e in V.restoreStructures)V[e]=V.restoreStructures[e];V.restoreStructures=null}function G(){let e=R[z++];if(e<160)if(e<128){if(e<64)return e;{let t=V[e&63]||B.getStructures&&rp()[e&63];return t?(t.read||=tp(t,e&63),t.read()):e}}else if(e<144)if(e-=128,B.mapsAsObjects){let t={};for(let n=0;n<e;n++){let e=_p();e===`__proto__`&&(e=`__proto_`),t[e]=G()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(G(),G());return t}else{e-=144;let t=Array(e);for(let n=0;n<e;n++)t[n]=G();return B.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(Wf>=z)return Hf.slice(z-Uf,(z+=t)-Uf);if(Wf==0&&Rf<140){let e=t<16?fp(t):dp(t);if(e!=null)return e}return ip(t)}else{let t;switch(e){case 192:return null;case 193:return H?(t=G(),t>0?H[1].slice(H.position1,H.position1+=t):H[0].slice(H.position0,H.position0-=t)):Jf;case 194:return!1;case 195:return!0;case 196:if(t=R[z++],t===void 0)throw Error(`Unexpected end of buffer`);return mp(t);case 197:return t=W.getUint16(z),z+=2,mp(t);case 198:return t=W.getUint32(z),z+=4,mp(t);case 199:return hp(R[z++]);case 200:return t=W.getUint16(z),z+=2,hp(t);case 201:return t=W.getUint32(z),z+=4,hp(t);case 202:if(t=W.getFloat32(z),B.useFloat32>2){let e=Ep[(R[z]&127)<<1|R[z+1]>>7];return z+=4,(e*t+(t>0?.5:-.5)>>0)/e}return z+=4,t;case 203:return t=W.getFloat64(z),z+=8,t;case 204:return R[z++];case 205:return t=W.getUint16(z),z+=2,t;case 206:return t=W.getUint32(z),z+=4,t;case 207:return B.int64AsType===`number`?(t=W.getUint32(z)*4294967296,t+=W.getUint32(z+4)):B.int64AsType===`string`?t=W.getBigUint64(z).toString():B.int64AsType===`auto`?(t=W.getBigUint64(z),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=W.getBigUint64(z),z+=8,t;case 208:return W.getInt8(z++);case 209:return t=W.getInt16(z),z+=2,t;case 210:return t=W.getInt32(z),z+=4,t;case 211:return B.int64AsType===`number`?(t=W.getInt32(z)*4294967296,t+=W.getUint32(z+4)):B.int64AsType===`string`?t=W.getBigInt64(z).toString():B.int64AsType===`auto`?(t=W.getBigInt64(z),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=W.getBigInt64(z),z+=8,t;case 212:if(t=R[z++],t==114)return yp(R[z++]&63);{let e=U[t];if(e)return e.read?(z++,e.read(G())):e.noBuffer?(z++,e()):e(R.subarray(z,++z));throw Error(`Unknown extension `+t)}case 213:return t=R[z],t==114?(z++,yp(R[z++]&63,R[z++])):hp(2);case 214:return hp(4);case 215:return hp(8);case 216:return hp(16);case 217:return t=R[z++],Wf>=z?Hf.slice(z-Uf,(z+=t)-Uf):ap(t);case 218:return t=W.getUint16(z),z+=2,Wf>=z?Hf.slice(z-Uf,(z+=t)-Uf):op(t);case 219:return t=W.getUint32(z),z+=4,Wf>=z?Hf.slice(z-Uf,(z+=t)-Uf):sp(t);case 220:return t=W.getUint16(z),z+=2,lp(t);case 221:return t=W.getUint32(z),z+=4,lp(t);case 222:return t=W.getUint16(z),z+=2,up(t);case 223:return t=W.getUint32(z),z+=4,up(t);default:if(e>=224)return e-256;if(e===void 0){let e=Error(`Unexpected end of MessagePack data`);throw e.incomplete=!0,e}throw Error(`Unknown MessagePack token `+e)}}}var ep=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function tp(e,t){function n(){if(n.count++>Xf){let r;try{r=e.read=Function(`r`,`return function(){return `+(B.freezeData?`Object.freeze`:``)+`({`+e.map(e=>e===`__proto__`?`__proto_:r()`:ep.test(e)?e+`:r()`:`[`+JSON.stringify(e)+`]:r()`).join(`,`)+`})}`)(G)}catch{return Xf=1/0,n()}return e.highByte===0&&(e.read=np(t,e.read)),r()}let r={};for(let t=0,n=e.length;t<n;t++){let n=e[t];n===`__proto__`&&(n=`__proto_`),r[n]=G()}return B.freezeData?Object.freeze(r):r}return n.count=0,e.highByte===0?np(t,n):n}var np=(e,t)=>function(){let n=R[z++];if(n===0)return t();let r=e<32?-(e+(n<<5)):e+(n<<5),i=V[r]||rp()[r];if(!i)throw Error(`Record id is not defined for `+r);return i.read||=tp(i,e),i.read()};function rp(){let e=wp(()=>(R=null,B.getStructures()));return V=B._mergeStructures(e,V)}var ip=cp,ap=cp,op=cp,sp=cp;function cp(e){let t;if(e<16&&(t=fp(e)))return t;if(e>64&&Lf)return Lf.decode(R.subarray(z,z+=e));let n=z+e,r=[];for(t=``;z<n;){let e=R[z++];if(!(e&128))r.push(e);else if((e&224)==192){let t=R[z++]&63,n=(e&31)<<6|t;n<128?r.push(65533):r.push(n)}else if((e&240)==224){let t=R[z++]&63,n=R[z++]&63,i=(e&31)<<12|t<<6|n;i<2048||i>=55296&&i<=57343?r.push(65533):r.push(i)}else if((e&248)==240){let t=R[z++]&63,n=R[z++]&63,i=R[z++]&63,a=(e&7)<<18|t<<12|n<<6|i;a<65536||a>1114111?r.push(65533):a>65535?(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023,r.push(a)):r.push(a)}else r.push(65533);r.length>=4096&&(t+=K.apply(String,r),r.length=0)}return r.length>0&&(t+=K.apply(String,r)),t}function lp(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=G();return B.freezeData?Object.freeze(t):t}function up(e){if(B.mapsAsObjects){let t={};for(let n=0;n<e;n++){let e=_p();e===`__proto__`&&(e=`__proto_`),t[e]=G()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(G(),G());return t}}var K=String.fromCharCode;function dp(e){let t=z,n=Array(e);for(let r=0;r<e;r++){let e=R[z++];if((e&128)>0){z=t;return}n[r]=e}return K.apply(String,n)}function fp(e){if(e<4)if(e<2){if(e===0)return``;{let e=R[z++];if((e&128)>1){--z;return}return K(e)}}else{let t=R[z++],n=R[z++];if((t&128)>0||(n&128)>0){z-=2;return}if(e<3)return K(t,n);let r=R[z++];if((r&128)>0){z-=3;return}return K(t,n,r)}else{let t=R[z++],n=R[z++],r=R[z++],i=R[z++];if((t&128)>0||(n&128)>0||(r&128)>0||(i&128)>0){z-=4;return}if(e<6){if(e===4)return K(t,n,r,i);{let e=R[z++];if((e&128)>0){z-=5;return}return K(t,n,r,i,e)}}else if(e<8){let a=R[z++],o=R[z++];if((a&128)>0||(o&128)>0){z-=6;return}if(e<7)return K(t,n,r,i,a,o);let s=R[z++];if((s&128)>0){z-=7;return}return K(t,n,r,i,a,o,s)}else{let a=R[z++],o=R[z++],s=R[z++],c=R[z++];if((a&128)>0||(o&128)>0||(s&128)>0||(c&128)>0){z-=8;return}if(e<10){if(e===8)return K(t,n,r,i,a,o,s,c);{let e=R[z++];if((e&128)>0){z-=9;return}return K(t,n,r,i,a,o,s,c,e)}}else if(e<12){let l=R[z++],u=R[z++];if((l&128)>0||(u&128)>0){z-=10;return}if(e<11)return K(t,n,r,i,a,o,s,c,l,u);let d=R[z++];if((d&128)>0){z-=11;return}return K(t,n,r,i,a,o,s,c,l,u,d)}else{let l=R[z++],u=R[z++],d=R[z++],f=R[z++];if((l&128)>0||(u&128)>0||(d&128)>0||(f&128)>0){z-=12;return}if(e<14){if(e===12)return K(t,n,r,i,a,o,s,c,l,u,d,f);{let e=R[z++];if((e&128)>0){z-=13;return}return K(t,n,r,i,a,o,s,c,l,u,d,f,e)}}else{let p=R[z++],m=R[z++];if((p&128)>0||(m&128)>0){z-=14;return}if(e<15)return K(t,n,r,i,a,o,s,c,l,u,d,f,p,m);let h=R[z++];if((h&128)>0){z-=15;return}return K(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h)}}}}}function pp(){let e=R[z++],t;if(e<192)t=e-160;else switch(e){case 217:t=R[z++];break;case 218:t=W.getUint16(z),z+=2;break;case 219:t=W.getUint32(z),z+=4;break;default:throw Error(`Expected string`)}return cp(t)}function mp(e){return B.copyBuffers?Uint8Array.prototype.slice.call(R,z,z+=e):R.subarray(z,z+=e)}function hp(e){let t=R[z++];if(U[t]){let n;return U[t](R.subarray(z,n=z+=e),e=>{z=e;try{return G()}finally{z=n}})}else throw Error(`Unknown extension type `+t)}var gp=Array(4096);function _p(){let e=R[z++];if(e>=160&&e<192){if(e-=160,Wf>=z)return Hf.slice(z-Uf,(z+=e)-Uf);if(!(Wf==0&&Rf<180))return ip(e)}else return z--,vp(G());let t=(e<<5^(e>1?W.getUint16(z):e>0?R[z]:0))&4095,n=gp[t],r=z,i=z+e-3,a,o=0;if(n&&n.bytes==e){for(;r<i;){if(a=W.getUint32(r),a!=n[o++]){r=1879048192;break}r+=4}for(i+=3;r<i;)if(a=R[r++],a!=n[o++]){r=1879048192;break}if(r===i)return z=r,n.string;i-=3,r=z}for(n=[],gp[t]=n,n.bytes=e;r<i;)a=W.getUint32(r),n.push(a),r+=4;for(i+=3;r<i;)a=R[r++],n.push(a);let s=e<16?fp(e):dp(e);return s==null?n.string=ip(e):n.string=s}function vp(e){if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return e.toString();if(e==null)return e+``;if(B.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every(e=>[`string`,`number`,`boolean`,`bigint`].includes(typeof e)))return e.flat().toString();throw Error(`Invalid property type for record: ${typeof e}`)}var yp=(e,t)=>{let n=G().map(vp),r=e;t!==void 0&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let i=V[e];return i&&(i.isShared||Yf)&&((V.restoreStructures||=[])[e]=i),V[e]=n,n.read=tp(n,r),n.read()};U[0]=()=>{},U[0].noBuffer=!0,U[66]=e=>{let t=e.byteLength%8||8,n=BigInt(e[0]&128?e[0]-256:e[0]);for(let r=1;r<t;r++)n<<=BigInt(8),n+=BigInt(e[r]);if(e.byteLength!==t){let r=new DataView(e.buffer,e.byteOffset,e.byteLength),i=(e,t)=>{let n=t-e;if(n<=40){let n=r.getBigUint64(e);for(let i=e+8;i<t;i+=8)n<<=BigInt(64),n|=r.getBigUint64(i);return n}let a=e+(n>>4<<3),o=i(e,a),s=i(a,t);return o<<BigInt((t-a)*8)|s};n=n<<BigInt((r.byteLength-t)*8)|i(t,r.byteLength)}return n};var bp={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError==`function`?AggregateError:null};U[101]=()=>{let e=G();if(!bp[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return bp[e[0]](e[1],{cause:e[2]})},U[105]=e=>{if(B.structuredClone===!1)throw Error(`Structured clone extension is disabled`);let t=W.getUint32(z-4);Gf||=new Map;let n=R[z],r;r=n>=144&&n<160||n==220||n==221?[]:n>=128&&n<144||n==222||n==223?new Map:(n>=199&&n<=201||n>=212&&n<=216)&&R[z+1]===115?new Set:{};let i={target:r};Gf.set(t,i);let a=G();if(i.used)Object.assign(r,a);else return i.target=a;if(r instanceof Map)for(let[e,t]of a.entries())r.set(e,t);if(r instanceof Set)for(let e of Array.from(a))r.add(e);return r},U[112]=e=>{if(B.structuredClone===!1)throw Error(`Structured clone extension is disabled`);let t=W.getUint32(z-4),n=Gf.get(t);return n.used=!0,n.target},U[115]=()=>new Set(G());var xp=[`Int8`,`Uint8`,`Uint8Clamped`,`Int16`,`Uint16`,`Int32`,`Uint32`,`Float32`,`Float64`,`BigInt64`,`BigUint64`].map(e=>e+`Array`),Sp=typeof globalThis==`object`?globalThis:window;U[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,r=xp[t];if(!r){if(t===16)return n;if(t===17)return new DataView(n);throw Error(`Could not find typed array for code `+t)}return new Sp[r](n)},U[120]=()=>{let e=G();return new RegExp(e[0],e[1])};var Cp=[];U[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=z;return z+=t-e.length,H=Cp,H=[pp(),pp()],H.position0=0,H.position1=0,H.postBundlePosition=z,z=n,G()},U[255]=e=>e.length==4?new Date((e[0]*16777216+(e[1]<<16)+(e[2]<<8)+e[3])*1e3):e.length==8?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+((e[3]&3)*4294967296+e[4]*16777216+(e[5]<<16)+(e[6]<<8)+e[7])*1e3):e.length==12?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+((e[4]&128?-281474976710656:0)+e[6]*1099511627776+e[7]*4294967296+e[8]*16777216+(e[9]<<16)+(e[10]<<8)+e[11])*1e3):new Date(`invalid`);function wp(e){B&&B._onSaveState&&B._onSaveState();let t=Rf,n=z,r=Vf,i=Uf,a=Wf,o=Hf,s=Bf,c=Gf,l=H,u=new Uint8Array(R.slice(0,Rf)),d=V,f=V.slice(0,V.length),p=B,m=Yf,h=e();return Rf=t,z=n,Vf=r,Uf=i,Wf=a,Hf=o,Bf=s,Gf=c,H=l,R=u,Yf=m,V=d,V.splice(0,V.length,...f),B=p,W=new DataView(R.buffer,R.byteOffset,R.byteLength),h}function Tp(){R=null,Gf=null,V=null}var Ep=Array(147);for(let e=0;e<256;e++)Ep[e]=+(`1e`+Math.floor(45.15-e*.30103));var Dp=new Zf({useRecords:!1});Dp.unpack,Dp.unpackMultiple,Dp.unpack;var Op={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};new Uint8Array(new Float32Array(1).buffer,0,4),Zf.SUPPORTS_STRUCT_HOOKS=!0;var kp;try{kp=new TextEncoder}catch{}var Ap,jp,Mp=typeof Buffer<`u`,Np=Mp?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,Pp=Mp?Buffer:Uint8Array,Fp=Mp?4294967296:2144337920,q,Ip,J,Y=0,X,Z=null,Lp=21760,Rp=/[\u0080-\uFFFF]/,zp=Symbol(`record-id`),Bp=class extends Zf{constructor(e){super(e),this.offset=0;let t,n,r,i,a=Pp.prototype.utf8Write?function(e,t){return q.utf8Write(e,t,q.byteLength-t)}:kp&&kp.encodeInto?function(e,t){return kp.encodeInto(e,q.subarray(t)).written}:!1,o=this;e||={};let s=e&&e.sequential,c=e.structures||e.saveStructures,l=e.maxSharedStructures;if(l??=c?32:0,l>8160)throw Error(`Maximum maxSharedStructure is 8160`);e.structuredClone&&e.moreTypes==null&&(this.moreTypes=!0);let u=e.maxOwnStructures;u??=c?32:64,!this.structures&&e.useRecords!=0&&(this.structures=[]);let d=l>32||u+l>64,f=l+64,p=l+u+64;if(p>8256)throw Error(`Maximum maxSharedStructure + maxOwnStructure is 8192`);let m=[],h=0,g=0;this.pack=this.encode=function(e,a){if(q||(q=new Np(8192),J=q.dataView||=new DataView(q.buffer,0,8192),Y=0),X=q.length-10,X-Y<2048?(q=new Np(q.length),J=q.dataView||=new DataView(q.buffer,0,q.length),X=q.length-10,Y=0):Y=Y+7&2147483640,t=Y,a&2048&&(Y+=a&255),i=o.structuredClone?new Map:null,o.bundleStrings&&typeof e!=`string`?(Z=[],Z.size=1/0):Z=null,r=o.structures,r){r.uninitialized&&(r=o._mergeStructures(o.getStructures()));let e=r.sharedLength||0;if(e>l)throw Error(`Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to `+r.sharedLength);if(!r.transitions){r.transitions=Object.create(null);for(let t=0;t<e;t++){let e=r[t];if(!e)continue;let n,i=r.transitions;for(let t=0,r=e.length;t<r;t++){let r=e[t];n=i[r],n||=i[r]=Object.create(null),i=n}i[zp]=t+64}this.lastNamedStructuresLength=e}s||(r.nextId=e+64)}n&&=!1;let c;try{o._writeStruct&&e&&typeof e==`object`?e.constructor===Object?ae(e):e.constructor!==Map&&!Array.isArray(e)&&!jp.some(t=>e instanceof t)?ae(e.toJSON?e.toJSON():e):_(e):_(e);let n=Z;if(Z&&Gp(t,_,0),i&&i.idsToInsert){let e=i.idsToInsert.sort((e,t)=>e.offset>t.offset?1:-1),r=e.length,a=-1;for(;n&&r>0;){let i=e[--r].offset+t;i<n.stringsPosition+t&&a===-1&&(a=0),i>n.position+t?a>=0&&(a+=6):(a>=0&&(J.setUint32(n.position+t,J.getUint32(n.position+t)+a),a=-1),n=n.previous,r++)}a>=0&&n&&J.setUint32(n.position+t,J.getUint32(n.position+t)+a),Y+=e.length*6,Y>X&&y(Y),o.offset=Y;let s=Wp(q.subarray(t,Y),e);return i=null,s}return o.offset=Y,a&512?(q.start=t,q.end=Y,q):q.subarray(t,Y)}catch(e){throw c=e,e}finally{if(r&&(ee(),n&&o.saveStructures)){let n=r.sharedLength||0,i=q.subarray(t,Y),s=(o._prepareStructures||Kp)(r,o);if(!c)return o.saveStructures(s,s.isCompatible)===!1?o.pack(e,a):(o.lastNamedStructuresLength=n,q.length>1073741824&&(q=null),i)}q.length>1073741824&&(q=null),a&1024&&(Y=t)}};let ee=()=>{g<10&&g++;let e=r.sharedLength||0;if(r.length>e&&!s&&(r.length=e),h>1e4)r.transitions=null,g=0,h=0,m.length>0&&(m=[]);else if(m.length>0&&!s){for(let e=0,t=m.length;e<t;e++)m[e][zp]=0;m=[]}},te=e=>{var t=e.length;t<16?q[Y++]=144|t:t<65536?(q[Y++]=220,q[Y++]=t>>8,q[Y++]=t&255):(q[Y++]=221,J.setUint32(Y,t),Y+=4);for(let n=0;n<t;n++)_(e[n])},_=e=>{Y>X&&(q=y(Y));var n=typeof e,r;if(n===`string`){let n=e.length;if(Z&&n>=4&&n<4096){if((Z.size+=n)>Lp){let e,n=(Z[0]?Z[0].length*3+Z[1].length:0)+10;Y+n>X&&(q=y(Y+n));let r;Z.position?(r=Z,q[Y]=200,Y+=3,q[Y++]=98,e=Y-t,Y+=4,Gp(t,_,0),J.setUint16(e+t-3,Y-t-e)):(q[Y++]=214,q[Y++]=98,e=Y-t,Y+=4),Z=[``,``],Z.previous=r,Z.size=0,Z.position=e}let r=Rp.test(e);Z[+!r]+=e,q[Y++]=193,_(r?-n:n);return}let i;i=n<32?1:n<256?2:n<65536?3:5;let o=n*3;if(Y+o>X&&(q=y(Y+o)),n<64||!a){let t,a,o,s=Y+i;for(t=0;t<n;t++)a=e.charCodeAt(t),a<128?q[s++]=a:a<2048?(q[s++]=a>>6|192,q[s++]=a&63|128):(a&64512)==55296&&((o=e.charCodeAt(t+1))&64512)==56320?(a=65536+((a&1023)<<10)+(o&1023),t++,q[s++]=a>>18|240,q[s++]=a>>12&63|128,q[s++]=a>>6&63|128,q[s++]=a&63|128):(q[s++]=a>>12|224,q[s++]=a>>6&63|128,q[s++]=a&63|128);r=s-Y-i}else r=a(e,Y+i);r<32?q[Y++]=160|r:r<256?(i<2&&q.copyWithin(Y+2,Y+1,Y+1+r),q[Y++]=217,q[Y++]=r):r<65536?(i<3&&q.copyWithin(Y+3,Y+2,Y+2+r),q[Y++]=218,q[Y++]=r>>8,q[Y++]=r&255):(i<5&&q.copyWithin(Y+5,Y+3,Y+3+r),q[Y++]=219,J.setUint32(Y,r),Y+=4),Y+=r}else if(n===`number`)if(e>>>0===e)e<32||e<128&&this.useRecords===!1||e<64&&!this._writeStruct?q[Y++]=e:e<256?(q[Y++]=204,q[Y++]=e):e<65536?(q[Y++]=205,q[Y++]=e>>8,q[Y++]=e&255):(q[Y++]=206,J.setUint32(Y,e),Y+=4);else if(e>>0===e)e>=-32?q[Y++]=256+e:e>=-128?(q[Y++]=208,q[Y++]=e+256):e>=-32768?(q[Y++]=209,J.setInt16(Y,e),Y+=2):(q[Y++]=210,J.setInt32(Y,e),Y+=4);else{let t;if((t=this.useFloat32)>0&&e<4294967296&&e>=-2147483648){q[Y++]=202,J.setFloat32(Y,e);let n;if(t<4||(n=e*Ep[(q[Y]&127)<<1|q[Y+1]>>7])>>0===n){Y+=4;return}else Y--}q[Y++]=203,J.setFloat64(Y,e),Y+=8}else if(n===`object`||n===`function`)if(!e)q[Y++]=192;else{if(i){let n=i.get(e);if(n){n.id||=(i.idsToInsert||=[]).push(n),q[Y++]=214,q[Y++]=112,J.setUint32(Y,n.id),Y+=4;return}else i.set(e,{offset:Y-t})}let a=e.constructor;if(a===Object)v(e);else if(a===Array)te(e);else if(a===Map)if(this.mapAsEmptyObject)q[Y++]=128;else{r=e.size,r<16?q[Y++]=128|r:r<65536?(q[Y++]=222,q[Y++]=r>>8,q[Y++]=r&255):(q[Y++]=223,J.setUint32(Y,r),Y+=4);for(let[t,n]of e)_(t),_(n)}else{for(let t=0,n=Ap.length;t<n;t++){let n=jp[t];if(e instanceof n){let n=Ap[t];if(n.write){n.type&&(q[Y++]=212,q[Y++]=n.type,q[Y++]=0);let t=n.write.call(this,e);t===e?Array.isArray(e)?te(e):v(e):_(t);return}let r=q,i=J,a=Y;q=null;let o;try{o=n.pack.call(this,e,e=>(q=r,r=null,Y+=e,Y>X&&y(Y),{target:q,targetView:J,position:Y-e}),_)}finally{r&&(q=r,J=i,Y=a,X=q.length-10)}o&&(o.length+Y>X&&y(o.length+Y),Y=Up(o,q,Y,n.type));return}}if(Array.isArray(e))te(e);else{if(e.toJSON){let t=e.toJSON();if(t!==e)return _(t)}if(n===`function`)return _(this.writeFunction&&this.writeFunction(e));v(e)}}}else if(n===`boolean`)q[Y++]=e?195:194;else if(n===`bigint`){if(e<0x8000000000000000&&e>=-0x8000000000000000)q[Y++]=211,J.setBigInt64(Y,e);else if(e<0x10000000000000000&&e>0)q[Y++]=207,J.setBigUint64(Y,e);else if(this.largeBigIntToFloat)q[Y++]=203,J.setFloat64(Y,Number(e));else if(this.largeBigIntToString)return _(e.toString());else if(this.useBigIntExtension||this.moreTypes){let t=BigInt(e<0?-1:0),n;if(e>>BigInt(65536)===t){let r=BigInt(0x10000000000000000)-BigInt(1),i=[];for(;i.push(e&r),e>>BigInt(63)!==t;)e>>=BigInt(64);n=new Uint8Array(new BigUint64Array(i).buffer),n.reverse()}else{let t=e<0,r=(t?~e:e).toString(16);if(r.length%2?r=`0`+r:parseInt(r.charAt(0),16)>=8&&(r=`00`+r),Mp)n=Buffer.from(r,`hex`);else{n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++)n[e]=parseInt(r.slice(e*2,e*2+2),16)}if(t)for(let e=0;e<n.length;e++)n[e]=~n[e]}n.length+Y>X&&y(n.length+Y),Y=Up(n,q,Y,66);return}else throw RangeError(e+` was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string`);Y+=8}else if(n===`undefined`)this.encodeUndefinedAsNil?q[Y++]=192:(q[Y++]=212,q[Y++]=0,q[Y++]=0);else throw Error(`Unknown type: `+n)},ne=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?e=>{let t;if(this.skipValues){t=[];for(let n in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(n))&&!this.skipValues.includes(e[n])&&t.push(n)}else t=Object.keys(e);let n=t.length;n<16?q[Y++]=128|n:n<65536?(q[Y++]=222,q[Y++]=n>>8,q[Y++]=n&255):(q[Y++]=223,J.setUint32(Y,n),Y+=4);let r;if(this.coercibleKeyAsNumber)for(let i=0;i<n;i++){r=t[i];let n=Number(r);_(isNaN(n)?r:n),_(e[r])}else for(let i=0;i<n;i++)_(r=t[i]),_(e[r])}:e=>{q[Y++]=222;let n=Y-t;Y+=2;let r=0;for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&(_(t),_(e[t]),r++);if(r>65535)throw Error(`Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object`);q[n+++t]=r>>8,q[n+t]=r&255},re=this.useRecords===!1?ne:e.progressiveRecords&&!d?e=>{let n,i=r.transitions||=Object.create(null),a=Y++-t,o;for(let s in e)if(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(s)){if(n=i[s],n)i=n;else{let c=Object.keys(e),l=i;i=r.transitions;let u=0;for(let e=0,t=c.length;e<t;e++){let t=c[e];n=i[t],n||(n=i[t]=Object.create(null),u++),i=n}a+t+1==Y?(Y--,b(i,c,u)):oe(i,c,a,u),o=!0,i=l[s]}_(e[s])}if(!o){let n=i[zp];n?q[a+t]=n:oe(i,Object.keys(e),a,0)}}:e=>{let t,n=r.transitions||=Object.create(null),i=0;for(let r in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(r))&&(t=n[r],t||(t=n[r]=Object.create(null),i++),n=t);let a=n[zp];a?a>=96&&d?(q[Y++]=((a-=96)&31)+96,q[Y++]=a>>5):q[Y++]=a:b(n,n.__keys__||Object.keys(e),i);for(let t in e)(typeof e.hasOwnProperty!=`function`||e.hasOwnProperty(t))&&_(e[t])},ie=typeof this.useRecords==`function`&&this.useRecords,v=ie?e=>{ie(e)?re(e):ne(e)}:re,ae=e=>{let i=o._writeStruct(e,q,t,Y,r,y,(e,t,r)=>{if(r)return n=!0;Y=t;let i=q;return _(e),ee(),i===q?Y:{position:Y,targetView:J,target:q}});if(i===0)return v(e);Y=i},y=e=>{let n;if(e>16777216){if(e-t>Fp)throw Error(`Packed buffer would be larger than maximum buffer size`);n=Math.min(Fp,Math.round(Math.max((e-t)*(e>67108864?1.25:2),4194304)/4096)*4096)}else n=(Math.max(e-t<<2,q.length-1)>>12)+1<<12;let r=new Np(n);return J=r.dataView||=new DataView(r.buffer,0,n),e=Math.min(e,q.length),q.copy?q.copy(r,0,t,e):r.set(q.slice(t,e)),Y-=t,t=0,X=r.length-10,q=r},b=(e,t,i)=>{let a=r.nextId;a||=64,a<f&&this.shouldShareStructure&&!this.shouldShareStructure(t)?(a=r.nextOwnId,a<p||(a=f),r.nextOwnId=a+1):(a>=p&&(a=f),r.nextId=a+1);let o=t.highByte=a>=96&&d?a-96>>5:-1;e[zp]=a,e.__keys__=t,r[a-64]=t,a<f?(t.isShared=!0,r.sharedLength=a-63,n=!0,o>=0?(q[Y++]=(a&31)+96,q[Y++]=o):q[Y++]=a):(o>=0?(q[Y++]=213,q[Y++]=114,q[Y++]=(a&31)+96,q[Y++]=o):(q[Y++]=212,q[Y++]=114,q[Y++]=a),i&&(h+=g*i),m.length>=u&&(m.shift()[zp]=0),m.push(e),_(t))},oe=(e,n,r,i)=>{let a=q,o=Y,s=X,c=t;q=Ip,Y=0,t=0,q||(Ip=q=new Np(8192)),X=q.length-10,b(e,n,i),Ip=q;let l=Y;if(q=a,Y=o,X=s,t=c,l>1){let e=Y+l-1;e>X&&y(e);let n=r+t;q.copyWithin(n+l,n+1,Y),q.set(Ip.slice(0,l),n),Y=e}else q[r+t]=Ip[0]}}useBuffer(e){q=e,q.dataView||=new DataView(q.buffer,q.byteOffset,q.byteLength),J=q.dataView,Y=0}set position(e){Y=e}get position(){return Y}clearSharedData(){this.structures&&=[],this.typedStructs&&=[]}};jp=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,qf],Ap=[{pack(e,t,n){let r=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&r>=0&&r<4294967296){let{target:e,targetView:n,position:i}=t(6);e[i++]=214,e[i++]=255,n.setUint32(i,r)}else if(r>0&&r<4294967296){let{target:n,targetView:i,position:a}=t(10);n[a++]=215,n[a++]=255,i.setUint32(a,e.getMilliseconds()*4e6+(r/1e3/4294967296>>0)),i.setUint32(a+4,r)}else if(isNaN(r)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:e,targetView:r,position:i}=t(3);e[i++]=212,e[i++]=255,e[i++]=255}else{let{target:n,targetView:i,position:a}=t(15);n[a++]=199,n[a++]=12,n[a++]=255,i.setUint32(a,e.getMilliseconds()*1e6),i.setBigInt64(a+4,BigInt(Math.floor(r)))}}},{pack(e,t,n){if(this.setAsEmptyObject)return t(0),n({});let r=Array.from(e),{target:i,position:a}=t(this.moreTypes?3:0);this.moreTypes&&(i[a++]=212,i[a++]=115,i[a++]=0),n(r)}},{pack(e,t,n){let{target:r,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(r[i++]=212,r[i++]=101,r[i++]=0),n([e.name,e.message,e.cause])}},{pack(e,t,n){let{target:r,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(r[i++]=212,r[i++]=120,r[i++]=0),n([e.source,e.flags])}},{pack(e,t){this.moreTypes?Vp(e,16,t):Hp(Mp?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==Pp&&this.moreTypes?Vp(e,xp.indexOf(n.name),t):Hp(e,t)}},{pack(e,t){this.moreTypes?Vp(e,17,t):Hp(Mp?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:r}=t(1);n[r]=193}}];function Vp(e,t,n,r){let i=e.byteLength;if(i+1<256){var{target:a,position:o}=n(4+i);a[o++]=199,a[o++]=i+1}else if(i+1<65536){var{target:a,position:o}=n(5+i);a[o++]=200,a[o++]=i+1>>8,a[o++]=i+1&255}else{var{target:a,position:o,targetView:s}=n(7+i);a[o++]=201,s.setUint32(o,i+1),o+=4}a[o++]=116,a[o++]=t,e.buffer||(e=new Uint8Array(e)),a.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o)}function Hp(e,t){let n=e.byteLength;var r,i;if(n<256){var{target:r,position:i}=t(n+2);r[i++]=196,r[i++]=n}else if(n<65536){var{target:r,position:i}=t(n+3);r[i++]=197,r[i++]=n>>8,r[i++]=n&255}else{var{target:r,position:i,targetView:a}=t(n+5);r[i++]=198,a.setUint32(i,n),i+=4}r.set(e,i)}function Up(e,t,n,r){let i=e.length;switch(i){case 1:t[n++]=212;break;case 2:t[n++]=213;break;case 4:t[n++]=214;break;case 8:t[n++]=215;break;case 16:t[n++]=216;break;default:i<256?(t[n++]=199,t[n++]=i):i<65536?(t[n++]=200,t[n++]=i>>8,t[n++]=i&255):(t[n++]=201,t[n++]=i>>24,t[n++]=i>>16&255,t[n++]=i>>8&255,t[n++]=i&255)}return t[n++]=r,t.set(e,n),n+=i,n}function Wp(e,t){let n,r=t.length*6,i=e.length-r;for(;n=t.pop();){let t=n.offset,a=n.id;e.copyWithin(t+r,t,i),r-=6;let o=t+r;e[o++]=214,e[o++]=105,e[o++]=a>>24,e[o++]=a>>16&255,e[o++]=a>>8&255,e[o++]=a&255,i=t}return e}function Gp(e,t,n){if(Z.length>0){J.setUint32(Z.position+e,Y+n-Z.position-e),Z.stringsPosition=Y-e;let r=Z;Z=null,t(r[0]),t(r[1])}}function Kp(e,t){return e.isCompatible=e=>{let n=!e||(t.lastNamedStructuresLength||0)===e.length;return n||t._mergeStructures(e),n},e}Bp.SUPPORTS_STRUCT_HOOKS=!0;var qp=new Bp({useRecords:!1});qp.pack,qp.pack;var{NEVER:Jp,ALWAYS:Yp,DECIMAL_ROUND:Xp,DECIMAL_FIT:Zp}=Op,Qp=class extends v()(`effect/rpc/RpcSerialization`){},$p=(e=>Qp.of({contentType:`application/msgpack`,includesFraming:!0,makeUnsafe:()=>{let t=new Zf(e),n=new Bp(e),r=new TextEncoder,i;return{decode(e){let n=typeof e==`string`?r.encode(e):e;if(i!==void 0){let t=n;e=new Uint8Array(i.length+n.length),e.set(i),e.set(t,i.length),n=e,i=void 0}try{return t.unpackMultiple(n)}catch(e){let t=e;if(t.incomplete)return i=n.subarray(t.lastPosition),t.values??[];throw e}},encode:e=>n.pack(e)}}}))({useRecords:!0}),em=bi(Qp)($p),tm=e=>D(()=>{let t=new Set,n=new Map,r=new Map,i=(e,t)=>Qr(r=>{let i=n.get(e);return i||(i=[],n.set(e,i)),i.push([t,r]),w});return C(e((e,t)=>{let n=r.get(e);return n?n(t):i(e,t)},t),e=>({...e,run(e,i){return b(function*(){t.add(e),r.set(e,i);let a=n.get(e);if(a){n.delete(e);for(let[e,t]of a)yield*Re(D(()=>i(e)),t)}return yield*Lt($i,()=>(t.delete(e),r.delete(e),w))})}}))}),nm=BigInt(0),rm=P(function*(e,t){let n=t?.spanPrefix??`RpcClient`,r=t?.supportsAck??!0,i=t?.disableTracing??!1,a=t?.generateRequestId??(()=>nm++),o=yield*Zn(),s=l(o,li),c=new Map,u=!1;yield*mr(s,Dt(e=>(u=!0,d(Tn(e.id)))));let d=P(function*(e){for(let[t,n]of c)c.delete(t),n._tag===`Queue`?yield*e._tag===`Success`?Wa(n.queue):Ha(n.queue,e.cause):n.resume(e)}),p=e=>{let r=xf(e.successSchema),a=g(e);return(o,s)=>{let c=s?.headers?fu(s.headers):du,l=s?.context??wr();if(!r){let r=t=>m(e,a,t,e.payloadSchema.make(o),c,l,s?.discard??!1);return i?r(void 0):Vi(`${n}.${e._tag}`,{attributes:t.spanAttributes},r)}let u=h(e,a,e.payloadSchema.make(o),c,s?.streamBufferSize??16,l);return s?.asQueue?u:ys(C(u,gs))}},m=(e,n,r,i,o,s,l)=>Dt(d=>{if(u)return Er;let f=a(),p=n(e=>t.onFromClient({message:e,context:s,discard:l}),{_tag:`Request`,id:f,tag:e._tag,payload:i,...r?{traceId:r.traceId,spanId:r.spanId,sampled:r.sampled}:{},headers:gu(d.getRef(cm),o)});if(l)return p;let m;return we(Mn(t=>{let n={_tag:`Effect`,rpc:e,context:s,resume(e){t(e),m&&!m.pollUnsafe()&&d.currentDispatcher.scheduleTask(()=>{m.interruptUnsafe(d.id)},0)}};c.set(f,n),m=p.pipe(r?le(r,{captureStackTrace:!1}):E,ht(d.context)),m.addObserver(e=>{if(e._tag===`Failure`)return t(e)})}),e=>(c.delete(f),ui(na(m),ee(f,Array.from(e),s))))}),h=P(function*(e,r,o,s,l,d){if(u)return yield*Er;let p=i?void 0:yield*tt(`${n}.${e._tag}`,{attributes:t.spanAttributes}),m=ia(),h=a(),g=Ke(m.context,li);yield*yn(g,e=>c.has(h)?(c.delete(h),ee(h,Ct(e)?Array.from(He(e.cause)):[],d)):w);let te=yield*La(l);return c.set(h,{_tag:`Queue`,rpc:e,queue:te,scope:g,context:d}),yield*r(e=>t.onFromClient({message:e,context:d,discard:!1}),{_tag:`Request`,id:h,tag:e._tag,payload:o,...p?{traceId:p.traceId,spanId:p.spanId,sampled:p.sampled}:{},headers:gu(m.getRef(cm),s)}).pipe(p?le(p,{captureStackTrace:!1}):E,Ar(e=>Ha(te,e)),f,kt(g,{startImmediately:!0})),te}),g=e=>{let t=[];for(let n of e.middlewares.values()){let e=o.mapUnsafe.get(`${n.key}/Client`);e&&t.push(e)}return t.length===0?(e,t)=>e(t):function n(r,i,a=t.length-1){return a===-1?r(i):t[a]({rpc:e,request:i,next(e){return n(r,e,a-1)}})}},ee=(e,n,r)=>Mn(i=>{let a=ia();t.onFromClient({message:{_tag:`Interrupt`,requestId:e,interruptors:n},context:r,discard:!1}).pipe(Xr(1e3),ht(a.context)).addObserver(()=>{i(w)})}),te=e=>{switch(e._tag){case`Chunk`:{let n=e.requestId,i=c.get(n);return!i||i._tag!==`Queue`?w:Ba(i.queue,e.values).pipe(r?M(()=>t.onFromClient({message:{_tag:`Ack`,requestId:e.requestId},context:i.context,discard:!1})):E,Ar(e=>Ha(i.queue,e)))}case`Exit`:{let t=e.requestId,n=c.get(t);return n?(c.delete(t),n._tag===`Effect`?(n.resume(e.exit),w):e.exit._tag===`Success`?Wa(n.queue):Ha(n.queue,e.exit.cause)):w}case`Defect`:return d(pn(e.defect));case`ClientEnd`:return w}},_;if(t.flatten){let t=new Map;_=function(n,r,i){let a=t.get(n);return a||(a=p(e.requests.get(n)),t.set(n,a)),a(r,i)}}else _={},e.requests.forEach(e=>{_[e._tag]=p(e)});return{client:_,write:te}}),im=0,am=P(function*(e,t){let n=im++,{run:r,send:i,supportsAck:a,supportsTransferables:o}=yield*lm,s=new Map,{client:c,write:l}=yield*rm(e,{...t,supportsAck:a,onFromClient({message:t}){switch(t._tag){case`Request`:{let r=e.requests.get(t.tag),a=o?gf():void 0,c=ia(),l={rpc:r,context:a?nt(c.context,hf,a):c.context,schemas:sm(r)};return s.set(t.id,l),l.schemas.encodePayload(t.payload).pipe(Re(l.context),Nt,M(e=>i(n,{...t,id:String(t.id),payload:e,headers:Object.entries(t.headers)},a&&a.readUnsafe())))}case`Ack`:return s.get(t.requestId)?i(n,{_tag:`Ack`,requestId:String(t.requestId)}):w;case`Interrupt`:return s.get(t.requestId)?(s.delete(t.requestId),i(n,{_tag:`Interrupt`,requestId:String(t.requestId)})):w;case`Eof`:return w}}});return yield*r(n,e=>{switch(e._tag){case`Chunk`:{let t=Ff(e.requestId),n=s.get(t);return!n||Ni(n.schemas.decodeChunk)?w:n.schemas.decodeChunk.value(e.values).pipe(Re(n.context),Nt,M(t=>l({_tag:`Chunk`,clientId:0,requestId:Ff(e.requestId),values:t})),g(t=>l({_tag:`Exit`,clientId:0,requestId:Ff(e.requestId),exit:qi(t)})))}case`Exit`:{let t=Ff(e.requestId),n=s.get(t);return n?(s.delete(t),n.schemas.decodeExit(e.exit).pipe(Re(n.context),Nt,yt({onSuccess:e=>l({_tag:`Exit`,clientId:0,requestId:t,exit:e}),onFailure:e=>l({_tag:`Exit`,clientId:0,requestId:t,exit:qi(e)})}))):w}case`Defect`:return l({_tag:`Defect`,clientId:0,defect:hm(e.defect)});case`ClientProtocolError`:{let t=Mi(e.error);return wt(s.keys(),e=>l({_tag:`Exit`,clientId:0,requestId:e,exit:t}))}default:return w}}).pipe(Ar(Ye),f,ue),c}),om=new WeakMap,sm=e=>{let t=om.get(e);return t===void 0?(t={decodeChunk:se(Sf(e.successSchema),e=>de(Rt(xn(e.success)))),encodePayload:Te(Rt(e.payloadSchema)),decodeExit:de(Rt(kf(e)))},om.set(e,t),t):t},cm=ce(`effect/rpc/RpcClient/CurrentHeaders`,{defaultValue:()=>du}),lm=class extends v()(`effect/rpc/RpcClient/Protocol`){static make=tm},um=e=>lm.make(P(function*(t,n){let r=yield*qd,i=yield*Qp,a=yield*Ur(mm),o=new Map,s=yield*r.writer,c=i.makeUnsafe(),l=yield*fm(s(c.encode(If))),u,d=D(()=>(u=void 0,Tt(a)?a.value.onConnect:w)),f=e=>wt(n,n=>t(n,e));return yield*D(()=>(c=i.makeUnsafe(),l.reset(),r.runRaw(e=>{try{let n=c.decode(e);if(n.length===0)return;let r=0;return Fi({while:()=>r<n.length,body:()=>{let e=n[r++];if(e._tag===`Pong`)return l.onPong(),w;if(`requestId`in e){let n=o.get(e.requestId);if(n!==void 0)return e._tag===`Exit`&&o.delete(e.requestId),t(n,e)}return f(e)},step:Ln})}catch(e){return f({_tag:`ClientProtocolError`,error:new Pf({reason:new Nf({message:`Error decoding message`,cause:e})})})}},{onOpen:d}).pipe(Pe(M(l.timeout,()=>ir(new sf({reason:new rf({kind:`Timeout`,cause:Error(`ping timeout`)})}))))))).pipe(M(()=>ir(new sf({reason:new af({code:1e3})}))),Tt(a)?ur(a.value.onDisconnect):E,Jn(t=>{let n=et(t),r=$n(n);return e?.retryTransientErrors&&r&&n.success.reason._tag===`SocketOpenError`?w:(u=new Pf({reason:r?n.success.reason:new Nf({message:`Unknown socket error`,cause:h(t)})}),f({_tag:`ClientProtocolError`,error:u}))}),tn(e?.retryPolicy??dm),hr({module:`RpcClient`,method:`makeProtocolSocket`}),ue),{send(e,t){if(u)return ir(u);t._tag===`Request`&&o.set(t.id,e);let n=c.encode(t);return n===void 0?w:Nt(s(n))},supportsAck:!0,supportsTransferables:!1}})),dm=Tr(500,1.5).pipe(rt(u(5e3))),fm=P(function*(e){let t=!0,n=oa();return yield*D(()=>t?(t=!1,e):n.open).pipe(Ir(`5 seconds`),at,ne,f,ue),{timeout:n.await,reset:()=>{t=!0,n.closeUnsafe()},onPong:()=>{t=!0}}}),pm=e=>Ie(lm)(um(e)),mm=class extends v()(`effect/rpc/RpcClient/ConnectionHooks`){},hm=Xe(O),gm=()=>(e,t)=>{let n=v()(e),r=Ie(n,t.makeEffect??am(t.group,{...t,flatten:!0}));n.runtime=(t.runtime??Ol)(typeof t.protocol==`function`?e=>i(r,pt(t.protocol(e))):i(r,pt(t.protocol))),n.mutation=Rl(e=>{let r=t.group.requests.get(e);return n.runtime.fn()(P(function*({headers:t,payload:r,reactivityKeys:i}){let a=(yield*n)(e,r,{headers:t});return yield*i?_c(a,i):a})).pipe(Wl({key:`AtomRpc:mutation:${e}`,schema:Vc({success:r.successSchema,error:_m(r)})}))});let a=Rl(e=>{let{headers:r,payload:i,reactivityKeys:a,tag:o,timeToLive:s}=e,c=t.group.requests.get(o),l=xf(c.successSchema),u=l?n.runtime.pull(ys(n.use(e=>A(e(o,i,{headers:r}))))):n.runtime.atom(n.use(e=>e(o,i,{headers:r})));return!l&&e.serializationKey&&(u=Wl(u,{key:`AtomRpc:${e.tag}:${e.serializationKey}`,schema:Vc({success:c.successSchema,error:_m(c)})})),s&&(u=St(s)?ul(u,s):zl(u)),a?n.runtime.factory.withReactivity(a)(u):u});return n.query=(e,t,n)=>a({tag:e,payload:t,headers:n?.headers?fu(n.headers):void 0,reactivityKeys:n?.reactivityKeys,timeToLive:n?.timeToLive?Bi(n.timeToLive):void 0,serializationKey:n?.serializationKey}),n},_m=e=>Sr([e.errorSchema,...Array.from(e.middlewares,e=>e.error),Pf]),vm=ce(`effect/http/FetchHttpClient/Fetch`,{defaultValue:()=>globalThis.fetch}),ym=class extends v()(`effect/http/FetchHttpClient/RequestInit`){},bm=jd(A(Dd((e,t,n,r)=>{let i=r.getRef(vm),a=r.context.mapUnsafe.get(ym.key)??{},o=a.headers?gu(fu(a.headers),e.headers):e.headers;o[`content-length`]&&(o=_u(o,`content-length`));let s=r=>C(tr({try:()=>i(t,{...a,method:e.method,headers:o,body:r,duplex:e.body._tag===`Stream`?`half`:void 0,signal:n}),catch:t=>new Ku({reason:new Yu({request:e,cause:t})})}),t=>yd(e,t));switch(e.body._tag){case`Raw`:case`Uint8Array`:return s(e.body.body);case`FormData`:return s(e.body.formData);case`Stream`:return M(ks(e.body.stream),s)}return s(void 0)}))),xm={add(...e){let t=new Map(this.requests);for(let n of e)t.set(n._tag,n);return Sm({requests:t,annotations:this.annotations})},merge(...e){let t=new Map(this.requests),n=new Map(this.annotations.mapUnsafe);for(let r of e){for(let[e,n]of r.requests)t.set(e,n);for(let[e,t]of r.annotations.mapUnsafe)n.set(e,t)}return Sm({requests:t,annotations:st(n)})},omit(...e){let t=new Map(this.requests);for(let n of e)t.delete(n);return Sm({requests:t,annotations:this.annotations})},middleware(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.middleware(e));return Sm({requests:t,annotations:this.annotations})},toHandlers(e){let t=this;return b(function*(){let n=yield*Zn(),r=xr(e)?yield*e:e,i=new Map;for(let[e,a]of Object.entries(r)){let r=t.requests.get(e);i.set(r.key,{tag:r._tag,handler:a,context:n})}return st(i)})},prefix(e){let t=new Map;for(let n of this.requests.values()){let r=n.prefix(e);t.set(r._tag,r)}return Sm({requests:t,annotations:this.annotations})},toLayer(e){return ni(this.toHandlers(e))},of:E,toLayerHandler(e,t){let n=this;return ni(b(function*(){let r=yield*Zn(),i=xr(t)?yield*t:t,a=new Map,o=n.requests.get(e);return a.set(o.key,{handler:i,context:r}),st(a)}))},accessHandler(e){return Qr(t=>{let n=this.requests.get(e),{handler:r,context:i}=t.mapUnsafe.get(n.key);return A((e,t)=>{t.rpc=n;let a=r(e,t),o=jf(a)?a.value:a;return xr(o)?xe(o,i):Ts(o,i)})})},annotate(e,t){return Sm({requests:this.requests,annotations:nt(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(Qe(e,t))},annotateMerge(e){return Sm({requests:this.requests,annotations:pe(this.annotations,e)})},annotateRpcsMerge(e){let t=new Map;for(let[n,r]of this.requests)t.set(n,r.annotateMerge(pe(e,r.annotations)));return Sm({requests:t,annotations:this.annotations})}},Sm=e=>Object.assign(function(){},xm,{requests:e.requests,annotations:e.annotations}),Cm=(...e)=>Sm({requests:new Map(e.map(e=>[e._tag,e])),annotations:wr()}),wm=class extends oe()(`GitError`,{cause:x(O),message:x(N)}){},Tm=Di([`added`,`deleted`,`modified`,`renamed`]),Em=Di([`staged-to-worktree`,`head-to-staged`]),Dm=class extends qr(`GitDiff`)({filePath:N,patch:N,status:Tm}){},Om=Sr([T({ref:N,type:cn(`ref`)}),T({base:N,type:cn(`merge-base`)})]),km=Sr([T({ref:N,type:cn(`ref`)}),T({type:cn(`worktree`)})]),Am=class extends qr(`GitCommit`)({hash:N,parents:Si(N),shortHash:N,subject:N,wip:Nn}){},jm=class extends qr(`GitReviewMetadata`)({base:N,commits:Si(Am),dirty:Nn}){},Mm=class extends qr(`GitRepository`)({gitDirectory:N,root:N}){},Nm=class extends qr(`GitBranch`)({name:N,remote:x(N),type:Di([`local`,`remote`])}){},Pm=class extends qr(`GitBranchesSnapshot`)({branches:Si(Nm),defaultBranch:N}){},Fm=class extends qr(`GitWorktreeStatus`)({ahead:Ri,behind:Ri,dirtyTracked:Nn,unpushedCommits:Nn,untracked:Nn}){},Im=class extends qr(`GitWorktree`)({branch:x(N),root:N,status:x(Fm)}){},Lm=class extends qr(`GitProject`)({repository:Mm,worktrees:Si(Im)}){},Rm=class extends oe()(`TerminalError`,{cause:x(O),message:x(N)}){},zm=Sr([T({data:N,type:cn(`data`)}),T({data:N,type:cn(`snapshot`)})]),Bm=class extends Cm(L(`projects.watch`,{stream:!0,success:Si(Lm)}),L(`projects.branches`,{error:wm,payload:T({cwd:N}),success:Pm}),L(`review.watch`,{error:wm,payload:T({cwd:N,scope:Em}),stream:!0,success:Si(Dm)}),L(`review.metadata`,{error:wm,payload:T({base:x(N),cwd:N}),success:jm}),L(`review.watchRange`,{error:wm,payload:T({cwd:N,from:Om,to:km}),stream:!0,success:Si(Dm)}),L(`review.createWipCommit`,{error:wm,payload:T({cwd:N,message:N})}),L(`review.commitAndPush`,{error:wm,payload:T({base:N,cwd:N,message:N})}),L(`review.stageFile`,{error:wm,payload:T({cwd:N,filePath:N})}),L(`review.unstageFile`,{error:wm,payload:T({cwd:N,filePath:N})}),L(`review.discardFile`,{error:wm,payload:T({cwd:N,filePath:N})}),L(`projects.createWorktree`,{error:wm,payload:T({baseBranch:N,branch:N,cwd:N,mode:Di([`existing-local`,`existing-remote`,`new-local`])}),success:N}),L(`projects.deleteWorktree`,{error:wm,payload:T({cwd:N,force:Nn})}),L(`terminal.events`,{error:Rm,payload:T({cwd:N}),stream:!0,success:zm}),L(`terminal.input`,{error:Rm,payload:T({cwd:N,data:N})}),L(`terminal.resize`,{error:Rm,payload:T({cols:Ri,cwd:N,rows:Ri})})){},Vm=`1.9.1`,Hm=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Um(e){let t=new Set([e]),n=new Set,r=e.match(Hm);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(i.prerelease!=null)return function(t){return t===e};function a(e){return n.add(e),!1}function o(e){return t.add(e),!0}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(Hm);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};return s.prerelease!=null||i.major!==s.major?a(e):i.major===0?i.minor===s.minor&&i.patch<=s.patch?o(e):a(e):i.minor<=s.minor?o(e):a(e)}}var Wm=Um(Vm),Gm=Vm.split(`.`)[0],Km=Symbol.for(`opentelemetry.js.api.${Gm}`),qm=typeof globalThis==`object`?globalThis:typeof self==`object`?self:typeof window==`object`?window:typeof global==`object`?global:{};function Jm(e,t,n,r=!1){let i=qm[Km]=qm[Km]??{version:Vm};if(!r&&i[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(i.version!==`1.9.1`){let t=Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Vm}`);return n.error(t.stack||t.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Vm}.`),!0}function Ym(e){let t=qm[Km]?.version;if(!(!t||!Wm(t)))return qm[Km]?.[e]}function Xm(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Vm}.`);let n=qm[Km];n&&delete n[e]}var Zm=class{constructor(e){this._namespace=e.namespace||`DiagComponentLogger`}debug(...e){return Qm(`debug`,this._namespace,e)}error(...e){return Qm(`error`,this._namespace,e)}info(...e){return Qm(`info`,this._namespace,e)}warn(...e){return Qm(`warn`,this._namespace,e)}verbose(...e){return Qm(`verbose`,this._namespace,e)}};function Qm(e,t,n){let r=Ym(`diag`);if(r)return r[e](t,...n)}var $m;(function(e){e[e.NONE=0]=`NONE`,e[e.ERROR=30]=`ERROR`,e[e.WARN=50]=`WARN`,e[e.INFO=60]=`INFO`,e[e.DEBUG=70]=`DEBUG`,e[e.VERBOSE=80]=`VERBOSE`,e[e.ALL=9999]=`ALL`})($m||={});function eh(e,t){e<$m.NONE?e=$m.NONE:e>$m.ALL&&(e=$m.ALL),t||={};function n(n,r){let i=t[n];return typeof i==`function`&&e>=r?i.bind(t):function(){}}return{error:n(`error`,$m.ERROR),warn:n(`warn`,$m.WARN),info:n(`info`,$m.INFO),debug:n(`debug`,$m.DEBUG),verbose:n(`verbose`,$m.VERBOSE)}}var th=`diag`,nh=class e{static instance(){return this._instance||=new e,this._instance}constructor(){function e(e){return function(...t){let n=Ym(`diag`);if(n)return n[e](...t)}}let t=this;t.setLogger=(e,n={logLevel:$m.INFO})=>{if(e===t){let e=Error(`Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation`);return t.error(e.stack??e.message),!1}typeof n==`number`&&(n={logLevel:n});let r=Ym(`diag`),i=eh(n.logLevel??$m.INFO,e);if(r&&!n.suppressOverrideMessage){let e=Error().stack??`<failed to generate stacktrace>`;r.warn(`Current logger will be overwritten from ${e}`),i.warn(`Current logger will overwrite one already registered from ${e}`)}return Jm(`diag`,i,t,!0)},t.disable=()=>{Xm(th,t)},t.createComponentLogger=e=>new Zm(e),t.verbose=e(`verbose`),t.debug=e(`debug`),t.info=e(`info`),t.warn=e(`warn`),t.error=e(`error`)}},rh=class e{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let t=this._entries.get(e);if(t)return Object.assign({},t)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let e of t)n._entries.delete(e);return n}clear(){return new e}},ih=Symbol(`BaggageEntryMetadata`),ah=nh.instance();function oh(e={}){return new rh(new Map(Object.entries(e)))}function sh(e){return typeof e!=`string`&&(ah.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=``),{__TYPE__:ih,toString(){return e}}}function ch(e){return Symbol.for(e)}var lh=new class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=e=>n._currentContext.get(e),n.setValue=(t,r)=>{let i=new e(n._currentContext);return i._currentContext.set(t,r),i},n.deleteValue=t=>{let r=new e(n._currentContext);return r._currentContext.delete(t),r}}},uh=class{constructor(){}createGauge(e,t){return Sh}createHistogram(e,t){return Ch}createCounter(e,t){return xh}createUpDownCounter(e,t){return wh}createObservableGauge(e,t){return Eh}createObservableCounter(e,t){return Th}createObservableUpDownCounter(e,t){return Dh}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},dh=class{},fh=class extends dh{add(e,t){}},ph=class extends dh{add(e,t){}},mh=class extends dh{record(e,t){}},hh=class extends dh{record(e,t){}},gh=class{addCallback(e){}removeCallback(e){}},_h=class extends gh{},vh=class extends gh{},yh=class extends gh{},bh=new uh,xh=new fh,Sh=new mh,Ch=new hh,wh=new ph,Th=new _h,Eh=new vh,Dh=new yh;function Oh(){return bh}var kh;(function(e){e[e.INT=0]=`INT`,e[e.DOUBLE=1]=`DOUBLE`})(kh||={});var Ah={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},jh={set(e,t,n){e!=null&&(e[t]=n)}},Mh=class{active(){return lh}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}},Nh=`context`,Ph=new Mh,Fh=class e{constructor(){}static getInstance(){return this._instance||=new e,this._instance}setGlobalContextManager(e){return Jm(Nh,e,nh.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return Ym(Nh)||Ph}disable(){this._getContextManager().disable(),Xm(Nh,nh.instance())}},Ih;(function(e){e[e.NONE=0]=`NONE`,e[e.SAMPLED=1]=`SAMPLED`})(Ih||={});var Lh={traceId:`00000000000000000000000000000000`,spanId:`0000000000000000`,traceFlags:Ih.NONE},Rh=class{constructor(e=Lh){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},zh=ch(`OpenTelemetry Context Key SPAN`);function Bh(e){return e.getValue(zh)||void 0}function Vh(){return Bh(Fh.getInstance().active())}function Hh(e,t){return e.setValue(zh,t)}function Uh(e){return e.deleteValue(zh)}function Wh(e,t){return Hh(e,new Rh(t))}function Gh(e){return Bh(e)?.spanContext()}var Kh=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function qh(e,t){if(typeof e!=`string`||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(Kh[e.charCodeAt(t)]|0)+(Kh[e.charCodeAt(t+1)]|0)+(Kh[e.charCodeAt(t+2)]|0)+(Kh[e.charCodeAt(t+3)]|0);return n===t}function Jh(e){return qh(e,32)&&e!==`00000000000000000000000000000000`}function Yh(e){return qh(e,16)&&e!==`0000000000000000`}function Xh(e){return Jh(e.traceId)&&Yh(e.spanId)}function Zh(e){return new Rh(e)}var Qh=Fh.getInstance(),$h=class{startSpan(e,t,n=Qh.active()){if(t?.root)return new Rh;let r=n&&Gh(n);return eg(r)&&Xh(r)?new Rh(r):new Rh}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??Qh.active(),c=this.startSpan(e,i,s),l=Hh(s,c);return Qh.with(l,o,void 0,c)}};function eg(e){return typeof e==`object`&&!!e&&`spanId`in e&&typeof e.spanId==`string`&&`traceId`in e&&typeof e.traceId==`string`&&`traceFlags`in e&&typeof e.traceFlags==`number`}var tg=new $h,ng=class{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):tg}},rg=new class{getTracer(e,t,n){return new $h}},ig=class{getTracer(e,t,n){return this.getDelegateTracer(e,t,n)??new ng(this,e,t,n)}getDelegate(){return this._delegate??rg}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){return this._delegate?.getTracer(e,t,n)}},ag;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(ag||={});var og;(function(e){e[e.INTERNAL=0]=`INTERNAL`,e[e.SERVER=1]=`SERVER`,e[e.CLIENT=2]=`CLIENT`,e[e.PRODUCER=3]=`PRODUCER`,e[e.CONSUMER=4]=`CONSUMER`})(og||={});var sg;(function(e){e[e.UNSET=0]=`UNSET`,e[e.OK=1]=`OK`,e[e.ERROR=2]=`ERROR`})(sg||={});var cg=Fh.getInstance(),Q=nh.instance(),lg=class{inject(e,t){}extract(e,t){return e}fields(){return[]}},ug=ch(`OpenTelemetry Baggage Key`);function dg(e){return e.getValue(ug)||void 0}function fg(){return dg(Fh.getInstance().active())}function pg(e,t){return e.setValue(ug,t)}function mg(e){return e.deleteValue(ug)}var hg=`propagation`,gg=new lg,_g=class e{constructor(){this.createBaggage=oh,this.getBaggage=dg,this.getActiveBaggage=fg,this.setBaggage=pg,this.deleteBaggage=mg}static getInstance(){return this._instance||=new e,this._instance}setGlobalPropagator(e){return Jm(hg,e,nh.instance())}inject(e,t,n=jh){return this._getGlobalPropagator().inject(e,t,n)}extract(e,t,n=Ah){return this._getGlobalPropagator().extract(e,t,n)}fields(){return this._getGlobalPropagator().fields()}disable(){Xm(hg,nh.instance())}_getGlobalPropagator(){return Ym(hg)||gg}}.getInstance(),vg=`trace`,$=class e{constructor(){this._proxyTracerProvider=new ig,this.wrapSpanContext=Zh,this.isSpanContextValid=Xh,this.deleteSpan=Uh,this.getSpan=Bh,this.getActiveSpan=Vh,this.getSpanContext=Gh,this.setSpan=Hh,this.setSpanContext=Wh}static getInstance(){return this._instance||=new e,this._instance}setGlobalTracerProvider(e){let t=Jm(vg,this._proxyTracerProvider,nh.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return Ym(vg)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){Xm(vg,nh.instance()),this._proxyTracerProvider=new ig}}.getInstance(),yg=ch(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function bg(e){return e.setValue(yg,!0)}function xg(e){return e.getValue(yg)===!0}var Sg=`baggage`,Cg=4096;function wg(e){return e.reduce((e,t)=>{let n=`${e}${e===``?``:`,`}${t}`;return n.length>8192?e:n},``)}function Tg(e){return e.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=`;`+t.metadata.toString()),n})}function Eg(e){if(!e)return;let t=e.indexOf(`;`),n=t===-1?e:e.substring(0,t),r=n.indexOf(`=`);if(r<=0)return;let i=n.substring(0,r).trim(),a=n.substring(r+1).trim();if(!i||!a)return;let o,s;try{o=decodeURIComponent(i),s=decodeURIComponent(a)}catch{return}let c;return t!==-1&&t<e.length-1&&(c=sh(e.substring(t+1))),{key:o,value:s,metadata:c}}var Dg=class{inject(e,t,n){let r=_g.getBaggage(e);if(!r||xg(e))return;let i=wg(Tg(r).filter(e=>e.length<=Cg).slice(0,180));i.length>0&&n.set(t,Sg,i)}extract(e,t,n){let r=n.get(t,Sg),i=Array.isArray(r)?r.join(`,`):r;if(!i)return e;let a={};return i.length===0||(i.split(`,`).forEach(e=>{let t=Eg(e);if(t){let e={value:t.value};t.metadata&&(e.metadata=t.metadata),a[t.key]=e}}),Object.entries(a).length===0)?e:_g.setBaggage(e,_g.createBaggage(a))}fields(){return[Sg]}};function Og(e){let t={};if(typeof e!=`object`||!e)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!kg(n)){Q.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ag(r)){Q.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}function kg(e){return typeof e==`string`&&e!==``}function Ag(e){return e==null?!0:Array.isArray(e)?jg(e):Mg(typeof e)}function jg(e){let t;for(let n of e){if(n==null)continue;let e=typeof n;if(e!==t){if(!t){if(Mg(e)){t=e;continue}return!1}return!1}}return!0}function Mg(e){switch(e){case`number`:case`boolean`:case`string`:return!0}return!1}function Ng(){return e=>{Q.error(Pg(e))}}function Pg(e){return typeof e==`string`?e:JSON.stringify(Fg(e))}function Fg(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(e=>{if(t[e])return;let r=n[e];r&&(t[e]=String(r))}),n=Object.getPrototypeOf(n);return t}var Ig=Ng();function Lg(e){try{Ig(e)}catch{}}var Rg=`2.7.1`,zg=`exception.message`,Bg=`exception.stacktrace`,Vg=`exception.type`,Hg=`service.name`,Ug=`service.version`,Wg=`telemetry.sdk.language`,Gg=`nodejs`,Kg=`webjs`,qg=`telemetry.sdk.name`,Jg=`telemetry.sdk.version`,Yg=`process.runtime.name`,Xg={[qg]:`opentelemetry`,[Yg]:`browser`,[Wg]:Kg,[Jg]:Rg},Zg=performance,Qg=9,$g=10**6,e_=10**Qg;function t_(e){let t=e/1e3;return[Math.trunc(t),Math.round(e%1e3*$g)]}function n_(e){return c_(t_(Zg.timeOrigin),t_(typeof e==`number`?e:Zg.now()))}function r_(e){if(o_(e))return e;if(typeof e==`number`)return e<Zg.timeOrigin?n_(e):t_(e);if(e instanceof Date)return t_(e.getTime());throw TypeError(`Invalid input type`)}function i_(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(--n,r+=e_),[n,r]}function a_(e){return e[0]*e_+e[1]}function o_(e){return Array.isArray(e)&&e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`}function s_(e){return o_(e)||typeof e==`number`||e instanceof Date}function c_(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=e_&&(n[1]-=e_,n[0]+=1),n}var l_;(function(e){e[e.SUCCESS=0]=`SUCCESS`,e[e.FAILED=1]=`FAILED`})(l_||={});var u_=class{_propagators;_fields;constructor(e={}){this._propagators=e.propagators??[];let t=new Set;for(let e of this._propagators){let n=typeof e.fields==`function`?e.fields():[];for(let e of n)t.add(e)}this._fields=Array.from(t)}inject(e,t,n){for(let r of this._propagators)try{r.inject(e,t,n)}catch(e){Q.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`)}}extract(e,t,n){return this._propagators.reduce((e,r)=>{try{return r.extract(e,t,n)}catch(e){Q.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`)}return e},e)}fields(){return this._fields.slice()}},d_=`[_0-9a-z-*/]`,f_=RegExp(`^(?:${`[a-z]${d_}{0,255}`}|${`[a-z0-9]${d_}{0,240}@[a-z]${d_}{0,13}`})$`),p_=/^[ -~]{0,255}[!-~]$/,m_=/,|=/;function h_(e){return f_.test(e)}function g_(e){return p_.test(e)&&!m_.test(e)}var __=32,v_=512,y_=`,`,b_=`=`,x_=class e{_length;_rawTraceState;_internalState;constructor(e){this._rawTraceState=typeof e==`string`?e:``,this._length=this._rawTraceState.length}set(e,t){if(!h_(e)||!g_(t))return this;let n=this._getState(),r=n.get(e),i=this._length;if(typeof r==`string`?i+=t.length-r.length:i+=e.length+t.length+(n.size>0?2:1),i>v_)return this;let a=new Map(n);return a.delete(e),a.set(e,t),this._fromState(a,i)}unset(e){let t=this._getState(),n=t.get(e);if(typeof n!=`string`)return this;let r=this._length-(e.length+n.length+1);t.size>1&&--r;let i=new Map(t);return i.delete(e),this._fromState(i,r)}get(e){return this._getState().get(e)}serialize(){let e=``,t=0;for(let n of this._getState())t>0&&(e=y_+e),e=`${n[0]}${b_}${n[1]}`+e,t++;return e}_getState(){if(this._internalState)return this._internalState;let e=this._rawTraceState.split(y_),t=new Map,n=0;for(let r of e){let e=r.trim(),i=e.indexOf(b_);if(i===-1)continue;let a=e.slice(0,i),o=e.slice(i+1);if(!h_(a)||!g_(o))continue;let s=n+e.length+ +(t.size>0);if(!(s>v_)&&(t.set(a,o),n=s,t.size>=__))break}return this._length=n,this._internalState=new Map(Array.from(t.entries()).reverse()),this._internalState}_fromState(t,n){let r=Object.create(e.prototype);return r._internalState=t,r._length=n,r}},S_=`traceparent`,C_=`tracestate`,w_=`00`,T_=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function E_(e){let t=T_.exec(e);return!t||t[1]===`00`&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}var D_=class{inject(e,t,n){let r=$.getSpanContext(e);if(!r||xg(e)||!Xh(r))return;let i=`${w_}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||Ih.NONE).toString(16)}`;n.set(t,S_,i),r.traceState&&n.set(t,C_,r.traceState.serialize())}extract(e,t,n){let r=n.get(t,S_);if(!r)return e;let i=Array.isArray(r)?r[0]:r;if(typeof i!=`string`)return e;let a=E_(i);if(!a)return e;a.isRemote=!0;let o=n.get(t,C_);if(o){let e=Array.isArray(o)?o.join(`,`):o;a.traceState=new x_(typeof e==`string`?e:void 0)}return $.setSpanContext(e,a)}fields(){return[S_,C_]}},O_=`[object Object]`,k_=`[object Null]`,A_=`[object Undefined]`,j_=Function.prototype.toString,M_=j_.call(Object),N_=Object.getPrototypeOf,P_=Object.prototype,F_=P_.hasOwnProperty,I_=Symbol?Symbol.toStringTag:void 0,L_=P_.toString;function R_(e){if(!z_(e)||B_(e)!==O_)return!1;let t=N_(e);if(t===null)return!0;let n=F_.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&j_.call(n)===M_}function z_(e){return typeof e==`object`&&!!e}function B_(e){return e==null?e===void 0?A_:k_:I_&&I_ in Object(e)?V_(e):H_(e)}function V_(e){let t=F_.call(e,I_),n=e[I_],r=!1;try{e[I_]=void 0,r=!0}catch{}let i=L_.call(e);return r&&(t?e[I_]=n:delete e[I_]),i}function H_(e){return L_.call(e)}var U_=20;function W_(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=K_(t,e.shift(),0,n);return t}function G_(e){return J_(e)?e.slice():e}function K_(e,t,n=0,r){let i;if(!(n>U_)){if(n++,Z_(e)||Z_(t)||Y_(t))i=G_(t);else if(J_(e)){if(i=e.slice(),J_(t))for(let e=0,n=t.length;e<n;e++)i.push(G_(t[e]));else if(X_(t)){let e=Object.keys(t);for(let n=0,r=e.length;n<r;n++){let r=e[n];r===`__proto__`||r===`constructor`||r===`prototype`||(i[r]=G_(t[r]))}}}else if(X_(e))if(X_(t)){if(!Q_(e,t))return t;i=Object.assign({},e);let a=Object.keys(t);for(let o=0,s=a.length;o<s;o++){let s=a[o];if(s===`__proto__`||s===`constructor`||s===`prototype`)continue;let c=t[s];if(Z_(c))c===void 0?delete i[s]:i[s]=c;else{let a=i[s],o=c;if(q_(e,s,r)||q_(t,s,r))delete i[s];else{if(X_(a)&&X_(o)){let n=r.get(a)||[],i=r.get(o)||[];n.push({obj:e,key:s}),i.push({obj:t,key:s}),r.set(a,n),r.set(o,i)}i[s]=K_(i[s],c,n,r)}}}}else i=t;return i}}function q_(e,t,n){let r=n.get(e[t])||[];for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i.key===t&&i.obj===e)return!0}return!1}function J_(e){return Array.isArray(e)}function Y_(e){return typeof e==`function`}function X_(e){return!Z_(e)&&!J_(e)&&!Y_(e)&&typeof e==`object`}function Z_(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e===void 0||e instanceof Date||e instanceof RegExp||e===null}function Q_(e,t){return!(!R_(e)||!R_(t))}var $_=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};function ev(e,t){let n,r=new Promise(function(e,r){n=setTimeout(function(){r(new $_(`Operation timed out.`))},t)});return Promise.race([e,r]).then(e=>(clearTimeout(n),e),e=>{throw clearTimeout(n),e})}var tv=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},nv=class{_isCalled=!1;_deferred=new tv;_callback;_that;constructor(e,t){this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(e=>this._deferred.resolve(e),e=>this._deferred.reject(e))}catch(e){this._deferred.reject(e)}}return this._deferred.promise}};function rv(e,t){return new Promise(n=>{cg.with(bg(cg.active()),()=>{e.export(t,n)})})}var iv={_export:rv},av;function ov(){if(av===void 0)try{let e=globalThis.process.argv0;av=e?`unknown_service:${e}`:`unknown_service`}catch{av=`unknown_service`}return av}var sv=e=>typeof e==`object`&&!!e&&typeof e.then==`function`,cv=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let r=new e({},n);return r._rawAttributes=dv(t),r._asyncAttributesPending=t.filter(([e,t])=>sv(t)).length>0,r}constructor(e,t){let n=e.attributes??{};this._rawAttributes=Object.entries(n).map(([e,t])=>(sv(t)&&(this._asyncAttributesPending=!0),[e,t])),this._rawAttributes=dv(this._rawAttributes),this._schemaUrl=fv(t?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let e=0;e<this._rawAttributes.length;e++){let[t,n]=this._rawAttributes[e];this._rawAttributes[e]=[t,sv(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&Q.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let e={};for(let[t,n]of this._rawAttributes){if(sv(n)){Q.debug(`Unsettled resource attribute ${t} skipped`);continue}n!=null&&(e[t]??=n)}return this._asyncAttributesPending||(this._memoizedAttributes=e),e}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=pv(this,t),r=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],r)}};function lv(e,t){return cv.FromAttributeList(Object.entries(e),t)}function uv(){return lv({[Hg]:ov(),[Wg]:Xg[Wg],[qg]:Xg[qg],[Jg]:Xg[Jg]})}function dv(e){return e.map(([e,t])=>sv(t)?[e,t.catch(t=>{Q.debug(`promise rejection for resource attribute: %s - %s`,e,t)})]:[e,t])}function fv(e){if(typeof e==`string`||e===void 0)return e;Q.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,e)}function pv(e,t){let n=e?.schemaUrl,r=t?.schemaUrl,i=n===void 0||n===``,a=r===void 0||r===``;if(i)return r;if(a||n===r)return n;Q.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,n,r)}var mv=`exception`,hv=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:sg.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(e){let t=Date.now();if(this._spanContext=e.spanContext,this._performanceStartTime=Zg.now(),this._performanceOffset=t-(this._performanceStartTime+Zg.timeOrigin),this._startTimeProvided=e.startTime!=null,this._spanLimits=e.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=e.spanProcessor,this.name=e.name,this.parentSpanContext=e.parentSpanContext,this.kind=e.kind,e.links)for(let t of e.links)this.addLink(t);this.startTime=this._getTime(e.startTime??t),this.resource=e.resource,this.instrumentationScope=e.scope,this._recordEndMetrics=e.recordEndMetrics,e.attributes!=null&&this.setAttributes(e.attributes),this._spanProcessor.onStart(this,e.context)}spanContext(){return this._spanContext}setAttribute(e,t){if(t==null||this._isSpanEnded())return this;if(e.length===0)return Q.warn(`Invalid attribute key: ${e}`),this;if(!Ag(t))return Q.warn(`Invalid attribute value set for key: ${e}`),this;let{attributeCountLimit:n}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n!==void 0&&this._attributesCount>=n&&r?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),r&&this._attributesCount++,this)}setAttributes(e){for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&this.setAttribute(t,e[t]);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return Q.warn(`No events allowed.`),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&Q.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),s_(t)&&(s_(n)||(n=t),t=void 0);let i=Og(t),{attributePerEventCountLimit:a}=this._spanLimits,o={},s=0,c=0;for(let e in i){if(!Object.prototype.hasOwnProperty.call(i,e))continue;let t=i[e];if(a!==void 0&&c>=a){s++;continue}o[e]=this._truncateToSize(t),c++}return this.events.push({name:e,attributes:o,time:this._getTime(n),droppedAttributesCount:s}),this}addLink(e){if(this._isSpanEnded())return this;let{linkCountLimit:t}=this._spanLimits;if(t===0)return this._droppedLinksCount++,this;t!==void 0&&this.links.length>=t&&(this._droppedLinksCount===0&&Q.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:n}=this._spanLimits,r=Og(e.attributes),i={},a=0,o=0;for(let e in r){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=r[e];if(n!==void 0&&o>=n){a++;continue}i[e]=this._truncateToSize(t),o++}let s={context:e.context};return o>0&&(s.attributes=i),a>0&&(s.droppedAttributesCount=a),this.links.push(s),this}addLinks(e){for(let t of e)this.addLink(t);return this}setStatus(e){if(this._isSpanEnded()||e.code===sg.UNSET||this.status.code===sg.OK)return this;let t={code:e.code};return e.code===sg.ERROR&&(typeof e.message==`string`?t.message=e.message:e.message!=null&&Q.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)),this.status=t,this}updateName(e){return this._isSpanEnded()||(this.name=e),this}end(e){if(this._isSpanEnded()){Q.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(e),this._duration=i_(this.startTime,this.endTime),this._duration[0]<0&&(Q.warn(`Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.`,this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Q.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&Q.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e==`number`&&e<=Zg.now())return n_(e+this._performanceOffset);if(typeof e==`number`)return t_(e);if(e instanceof Date)return t_(e.getTime());if(o_(e))return e;if(this._startTimeProvided)return t_(Date.now());let t=Zg.now()-this._performanceStartTime;return c_(this.startTime,t_(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e==`string`?n[zg]=e:e&&(e.code?n[Vg]=e.code.toString():e.name&&(n[Vg]=e.name),e.message&&(n[zg]=e.message),e.stack&&(n[Bg]=e.stack)),n[`exception.type`]||n[`exception.message`]?this.addEvent(mv,n,t):Q.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let e=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);Q.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,e)}return this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(Q.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e==`string`?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(e=>typeof e==`string`?this._truncateToLimitUtil(e,t):e):e}},gv;(function(e){e[e.NOT_RECORD=0]=`NOT_RECORD`,e[e.RECORD=1]=`RECORD`,e[e.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(gv||={});var _v=class{shouldSample(){return{decision:gv.NOT_RECORD}}toString(){return`AlwaysOffSampler`}},vv=class{shouldSample(){return{decision:gv.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}},yv=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(e){this._root=e.root,this._root||=(Lg(Error(`ParentBasedSampler must have a root sampler configured`)),new vv),this._remoteParentSampled=e.remoteParentSampled??new vv,this._remoteParentNotSampled=e.remoteParentNotSampled??new _v,this._localParentSampled=e.localParentSampled??new vv,this._localParentNotSampled=e.localParentNotSampled??new _v}shouldSample(e,t,n,r,i,a){let o=$.getSpanContext(e);return!o||!Xh(o)?this._root.shouldSample(e,t,n,r,i,a):o.isRemote?o.traceFlags&Ih.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,r,i,a):this._remoteParentNotSampled.shouldSample(e,t,n,r,i,a):o.traceFlags&Ih.SAMPLED?this._localParentSampled.shouldSample(e,t,n,r,i,a):this._localParentNotSampled.shouldSample(e,t,n,r,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}},bv=class{_ratio;_upperBound;constructor(e=0){this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:Jh(t)&&this._accumulate(t)<this._upperBound?gv.RECORD_AND_SAMPLED:gv.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!=`number`||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<32;n+=8){let r=0;for(let t=0;t<8;t++){let i=e.charCodeAt(n+t),a=i<58?i-48:i<71?i-55:i-87;r=r<<4|a}t=(t^r)>>>0}return t}},xv;(function(e){e.AlwaysOff=`always_off`,e.AlwaysOn=`always_on`,e.ParentBasedAlwaysOff=`parentbased_always_off`,e.ParentBasedAlwaysOn=`parentbased_always_on`,e.ParentBasedTraceIdRatio=`parentbased_traceidratio`,e.TraceIdRatio=`traceidratio`})(xv||={});var Sv=1;function Cv(){return{sampler:wv(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function wv(){let e=xv.ParentBasedAlwaysOn;switch(e){case xv.AlwaysOn:return new vv;case xv.AlwaysOff:return new _v;case xv.ParentBasedAlwaysOn:return new yv({root:new vv});case xv.ParentBasedAlwaysOff:return new yv({root:new _v});case xv.TraceIdRatio:return new bv(Tv());case xv.ParentBasedTraceIdRatio:return new yv({root:new bv(Tv())});default:return Q.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${xv.ParentBasedAlwaysOn}".`),new yv({root:new vv})}}function Tv(){return Q.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Sv}.`),Sv}function Ev(e){let t={sampler:wv()},n=Cv(),r=Object.assign({},n,t,e);return r.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),r}function Dv(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??void 0??void 0??128,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??void 0??void 0??1/0,Object.assign({},e,{spanLimits:t})}var Ov=16,kv=8,Av=new Uint8Array(Ov),jv=new Uint8Array(kv),Mv=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Nv(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Pv(e){let t=``;for(let n=0;n<e.length;n++)t+=Mv[e[n]];return t}var Fv=class{generateTraceId(){return Nv(Av),Pv(Av)}generateSpanId(){return Nv(jv),Pv(jv)}},Iv=`otel.span.parent.origin`,Lv=`otel.span.sampling_result`,Rv=`otel.sdk.span.live`,zv=`otel.sdk.span.started`,Bv=class{startedSpans;liveSpans;constructor(e){this.startedSpans=e.createCounter(zv,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=e.createUpDownCounter(Rv,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(e,t){let n=Hv(t);if(this.startedSpans.add(1,{[Iv]:Vv(e),[Lv]:n}),t===gv.NOT_RECORD)return()=>{};let r={[Lv]:n};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};function Vv(e){return e?e.isRemote?`remote`:`local`:`none`}function Hv(e){switch(e){case gv.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case gv.RECORD:return`RECORD_ONLY`;case gv.NOT_RECORD:return`DROP`}}var Uv=`2.7.1`,Wv=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(e,t,n,r){let i=Ev(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Fv,this._resource=n,this._spanProcessor=r,this.instrumentationScope=e;let a=i.meterProvider?i.meterProvider.getMeter(`@opentelemetry/sdk-trace`,Uv):Oh();this._tracerMetrics=new Bv(a)}startSpan(e,t={},n=cg.active()){t.root&&(n=$.deleteSpan(n));let r=$.getSpan(n);if(xg(n))return Q.debug(`Instrumentation suppressed, returning Noop Span`),$.wrapSpanContext(Lh);let i=r?.spanContext(),a=this._idGenerator.generateSpanId(),o,s,c;!i||!$.isSpanContextValid(i)?s=this._idGenerator.generateTraceId():(s=i.traceId,c=i.traceState,o=i);let l=t.kind??og.INTERNAL,u=(t.links??[]).map(e=>({context:e.context,attributes:Og(e.attributes)})),d=Og(t.attributes),f=this._sampler.shouldSample(n,s,e,l,d,u),p=this._tracerMetrics.startSpan(i,f.decision);c=f.traceState??c;let m=f.decision===ag.RECORD_AND_SAMPLED?Ih.SAMPLED:Ih.NONE,h={traceId:s,spanId:a,traceFlags:m,traceState:c};if(f.decision===ag.NOT_RECORD)return Q.debug(`Recording is off, propagating context in a non-recording span`),$.wrapSpanContext(h);let g=Og(Object.assign(d,f.attributes));return new hv({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:h,name:e,kind:l,links:u,parentSpanContext:o,attributes:g,startTime:t.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:p})}startActiveSpan(e,t,n,r){let i,a,o;if(arguments.length<2)return;arguments.length===2?o=t:arguments.length===3?(i=t,o=n):(i=t,a=n,o=r);let s=a??cg.active(),c=this.startSpan(e,i,s),l=$.setSpan(s,c);return cg.with(l,o,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}},Gv=class{_spanProcessors;constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(e=>{Lg(e||Error(`MultiSpanProcessor: forceFlush failed`)),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnding(e){for(let t of this._spanProcessors)t.onEnding&&t.onEnding(e)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}},Kv;(function(e){e[e.resolved=0]=`resolved`,e[e.timeout=1]=`timeout`,e[e.error=2]=`error`,e[e.unresolved=3]=`unresolved`})(Kv||={});var qv=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(e={}){let t=W_({},Cv(),Dv(e));this._resource=t.resource??uv(),this._config=Object.assign({},t,{resource:this._resource});let n=[];e.spanProcessors?.length&&n.push(...e.spanProcessors),this._activeSpanProcessor=new Gv(n)}getTracer(e,t,n){let r=`${e}@${t||``}:${n?.schemaUrl||``}`;return this._tracers.has(r)||this._tracers.set(r,new Wv({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._activeSpanProcessor._spanProcessors.map(t=>new Promise(n=>{let r,i=setTimeout(()=>{n(Error(`Span processor did not completed within timeout period of ${e} ms`)),r=Kv.timeout},e);t.forceFlush().then(()=>{clearTimeout(i),r!==Kv.timeout&&(r=Kv.resolved,n(r))}).catch(e=>{clearTimeout(i),r=Kv.error,n(e)})}));return new Promise((e,n)=>{Promise.all(t).then(t=>{let r=t.filter(e=>e!==Kv.resolved);r.length>0?n(r):e()}).catch(e=>n([e]))})}shutdown(){return this._activeSpanProcessor.shutdown()}},Jv=class{_exporter;_shutdownOnce;_pendingExports;constructor(e){this._exporter=e,this._shutdownOnce=new nv(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Ih.SAMPLED)===0)return;let t=this._doExport(e).catch(e=>Lg(e));this._pendingExports.add(t),t.finally(()=>this._pendingExports.delete(t))}async _doExport(e){e.resource.asyncAttributesPending&&await e.resource.waitForAsyncAttributes?.();let t=await iv._export(this._exporter,[e]);if(t.code!==l_.SUCCESS)throw t.error??Error(`SimpleSpanProcessor: span export failed (status ${t})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}},Yv=class{_enabled=!1;_currentContext=lh;_bindFunction(e=lh,t){let n=this,r=function(...r){return n.with(e,()=>t.apply(this,r))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),r}active(){return this._currentContext}bind(e,t){return e===void 0&&(e=this.active()),typeof t==`function`?this._bindFunction(e,t):t}disable(){return this._currentContext=lh,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=lh,this)}with(e,t,n,...r){let i=this._currentContext;this._currentContext=e||lh;try{return t.call(n,...r)}finally{this._currentContext=i}}};function Xv(e){if(e!==null){if(e===void 0){let e=new Yv;e.enable(),cg.setGlobalContextManager(e);return}e.enable(),cg.setGlobalContextManager(e)}}function Zv(e){if(e!==null){if(e===void 0){_g.setGlobalPropagator(new u_({propagators:[new D_,new Dg]}));return}_g.setGlobalPropagator(e)}}var Qv=class extends qv{constructor(e={}){super(e)}register(e={}){$.setGlobalTracerProvider(this),Zv(e.propagator),Xv(e.contextManager)}},$v=e=>e!==void 0&&!(Array.isArray(e)&&e.length===0),ey;(function(e){e[e.UNSPECIFIED=0]=`UNSPECIFIED`,e[e.TRACE=1]=`TRACE`,e[e.TRACE2=2]=`TRACE2`,e[e.TRACE3=3]=`TRACE3`,e[e.TRACE4=4]=`TRACE4`,e[e.DEBUG=5]=`DEBUG`,e[e.DEBUG2=6]=`DEBUG2`,e[e.DEBUG3=7]=`DEBUG3`,e[e.DEBUG4=8]=`DEBUG4`,e[e.INFO=9]=`INFO`,e[e.INFO2=10]=`INFO2`,e[e.INFO3=11]=`INFO3`,e[e.INFO4=12]=`INFO4`,e[e.WARN=13]=`WARN`,e[e.WARN2=14]=`WARN2`,e[e.WARN3=15]=`WARN3`,e[e.WARN4=16]=`WARN4`,e[e.ERROR=17]=`ERROR`,e[e.ERROR2=18]=`ERROR2`,e[e.ERROR3=19]=`ERROR3`,e[e.ERROR4=20]=`ERROR4`,e[e.FATAL=21]=`FATAL`,e[e.FATAL2=22]=`FATAL2`,e[e.FATAL3=23]=`FATAL3`,e[e.FATAL4=24]=`FATAL4`})(ey||={});var ty=new class{emit(e){}enabled(){return!1}};function ny(e){return ry(e,new WeakSet)}function ry(e,t){if(e==null||typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof Uint8Array)return!0;if(typeof e==`object`){if(t.has(e))return!1;if(t.add(e),Array.isArray(e))return e.every(e=>ry(e,t));let n=e;return n.constructor!==Object&&n.constructor!==void 0?!1:Object.values(n).every(e=>ry(e,t))}return!1}var iy=class{hrTime;hrTimeObserved;spanContext;resource;instrumentationScope;attributes={};_severityText;_severityNumber;_body;_eventName;_attributesCount=0;_droppedAttributesCount=0;_isReadonly=!1;_logRecordLimits;set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}constructor(e,t,n){let{timestamp:r,observedTimestamp:i,eventName:a,severityNumber:o,severityText:s,body:c,attributes:l={},exception:u,context:d}=n,f=Date.now();if(this.hrTime=r_(r??f),this.hrTimeObserved=r_(i??f),d){let e=$.getSpanContext(d);e&&Xh(e)&&(this.spanContext=e)}this.severityNumber=o,this.severityText=s,this.body=c,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(l),u!=null&&this._setException(u)}setAttribute(e,t){if(this._isLogRecordReadonly())return this;if(e.length===0)return Q.warn(`Invalid attribute key: ${e}`),this;if(!ny(t))return Q.warn(`Invalid attribute value set for key: ${e}`),this;let n=!Object.prototype.hasOwnProperty.call(this.attributes,e);return n&&this._attributesCount>=this._logRecordLimits.attributeCountLimit?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&Q.warn(`Dropping extra attributes.`),this):(this.attributes[e]=this._truncateToSize(t),n&&this._attributesCount++,this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;if(t<=0)return Q.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e==`string`)return this._truncateToLimitUtil(e,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(e=>this._truncateToSize(e));if(typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=this._truncateToSize(r);return t}return e}_setException(e){let t=!1;if(typeof e==`string`||typeof e==`number`)Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(zg,String(e)),t=!0;else if(e&&typeof e==`object`){let n=e;n.code?(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(Vg,n.code.toString()),t=!0):n.name&&(Object.hasOwn(this.attributes,`exception.type`)||this.setAttribute(Vg,n.name),t=!0),n.message&&(Object.hasOwn(this.attributes,`exception.message`)||this.setAttribute(zg,n.message),t=!0),n.stack&&(Object.hasOwn(this.attributes,`exception.stacktrace`)||this.setAttribute(Bg,n.stack),t=!0)}t||Q.warn(`Failed to record an exception ${e}`)}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&Q.warn(`Can not execute the operation on emitted log record`),this._isReadonly}},ay=class{instrumentationScope;_sharedState;_loggerConfig;constructor(e,t){this.instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this.instrumentationScope)}emit(e){let t=e.context||cg.active();if(!this.enabled(e))return;let n=new iy(this._sharedState,this.instrumentationScope,{context:t,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}enabled(e){let t=this._loggerConfig;if(t.disabled)return!1;let n=e?.severityNumber;if(typeof n==`number`&&n!==ey.UNSPECIFIED&&n<t.minimumSeverity)return!1;let r=e?.context||cg.active();if(t.traceBased){let e=$.getSpanContext(r);if(e&&Xh(e)&&(e.traceFlags&Ih.SAMPLED)!==Ih.SAMPLED)return!1}let i={context:r,instrumentationScope:this.instrumentationScope,severityNumber:e?.severityNumber,eventName:e?.eventName};for(let e of this._sharedState.processors)if(!e.enabled||e.enabled(i))return!0;return!1}},oy=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}enabled(e){return!1}},sy=class{processors;forceFlushTimeoutMillis;constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>ev(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(let t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function cy(e){return`${e.name}@${e.version||``}:${e.schemaUrl||``}`}var ly=`otel.sdk.log.created`,uy=class{createdLogs;constructor(e){this.createdLogs=e.createCounter(ly,{unit:`{log_record}`,description:`The number of logs submitted to enabled SDK Loggers.`})}emitLog(){this.createdLogs.add(1)}},dy=`0.218.0`,fy={disabled:!1,minimumSeverity:ey.UNSPECIFIED,traceBased:!1},py=()=>({...fy}),my=class{loggers=new Map;activeProcessor;registeredLogRecordProcessors=[];resource;forceFlushTimeoutMillis;logRecordLimits;processors;loggerMetrics;_loggerConfigurator;_loggerConfigs=new Map;constructor(e,t,n,r,i,a){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.processors=r,r.length>0?(this.registeredLogRecordProcessors=r,this.activeProcessor=new sy(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new oy,this._loggerConfigurator=i??py;let o=a?a.getMeter(`@opentelemetry/sdk-logs`,dy):Oh();this.loggerMetrics=new uy(o)}getLoggerConfig(e){let t=cy(e),n=this._loggerConfigs.get(t);return n||(n=this._loggerConfigurator(e),this._loggerConfigs.set(t,n),n)}},hy=class{_shutdownOnce;_sharedState;constructor(e={}){let t={resource:e.resource??uv(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??py,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new my(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new nv(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return Q.warn(`A shutdown LoggerProvider cannot provide a Logger`),ty;e||Q.warn(`Logger requested without instrumentation scope name.`);let r=e||`unknown`,i=`${r}@${t||``}:${n?.schemaUrl||``}`;return this._sharedState.loggers.has(i)||this._sharedState.loggers.set(i,new ay({name:r,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(i)}forceFlush(){return this._shutdownOnce.isCalled?(Q.warn(`invalid attempt to force flush after LoggerProvider shutdown`),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(Q.warn(`shutdown may only be called once per LoggerProvider`),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}},gy=It,_y=Lr,vy=(e,t)=>Ie(gy,_t(Bn(function*(n){let r=new Set(t?.mergeWithExisting===!0?n.getRef(It):[]);for(let t of e)r.add(Be(t)?yield*t:t);return r}))),yy=BigInt(1e9),by=e=>[Number(e/yy),Number(e%yy)],xy=e=>{let t={};for(let[n,r]of Object.entries(e))t[n]=Sy(r);return t},Sy=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?e:typeof e==`bigint`?e.toString():jt(e),Cy=class extends v()(`@effect/opentelemetry/Resource`){},wy=e=>bi(Cy,lv(Ty(e))),Ty=e=>{let t={...e.attributes??void 0,[Hg]:e.serviceName,[qg]:`@effect/opentelemetry`,[Wg]:globalThis.document===void 0?Gg:Kg};return e.serviceVersion&&(t[Ug]=e.serviceVersion),t},Ey=class extends v()(`@effect/opentelemetry/Logger/OtelLoggerProvider`){},Dy=e=>{switch(e){case`Trace`:return ey.TRACE;case`Debug`:return ey.DEBUG;case`Info`:return ey.INFO;case`Warn`:return ey.WARN;case`Error`:return ey.ERROR;case`Fatal`:return ey.FATAL;default:return ey.UNSPECIFIED}},Oy=b(function*(){let e=yield*Ey,t=yield*Vt,n=e.getLogger(`@effect/opentelemetry`);return _y(e=>{let r={fiberId:e.fiber.id},i=vr(e.fiber.context,qn);vn(i)&&(r.spanId=i.spanId,r.traceId=i.traceId);for(let[t,n]of Object.entries(e.fiber.getRef(Ti)))r[t]=Sy(n);let a=e.date.getTime();for(let[t,n]of e.fiber.getRef(Rn))r[`logSpan.${t}`]=`${a-n}ms`;let o=ve(e.message).map(Sy),s=by(t.currentTimeNanosUnsafe());n.emit({body:o.length===1?o[0]:o,severityText:e.logLevel,severityNumber:Dy(e.logLevel),timestamp:s,observedTimestamp:s,attributes:r})})}),ky=e=>vy([Oy],{mergeWithExisting:e.mergeWithExisting??!0}),Ay=(e,t)=>Ie(Ey,b(function*(){let n=yield*Cy;return yield*Vr(j(()=>new hy({...t??void 0,processors:ve(e),resource:n})),e=>Ut(()=>e.forceFlush().then(()=>e.shutdown())).pipe(at,f,Nr(t?.shutdownTimeout??3e3)))})),jy;(function(e){e[e.DELTA=0]=`DELTA`,e[e.CUMULATIVE=1]=`CUMULATIVE`})(jy||={});var My;(function(e){e.COUNTER=`COUNTER`,e.GAUGE=`GAUGE`,e.HISTOGRAM=`HISTOGRAM`,e.UP_DOWN_COUNTER=`UP_DOWN_COUNTER`,e.OBSERVABLE_COUNTER=`OBSERVABLE_COUNTER`,e.OBSERVABLE_GAUGE=`OBSERVABLE_GAUGE`,e.OBSERVABLE_UP_DOWN_COUNTER=`OBSERVABLE_UP_DOWN_COUNTER`})(My||={});var Ny;(function(e){e[e.HISTOGRAM=0]=`HISTOGRAM`,e[e.EXPONENTIAL_HISTOGRAM=1]=`EXPONENTIAL_HISTOGRAM`,e[e.GAUGE=2]=`GAUGE`,e[e.SUM=3]=`SUM`})(Ny||={});var Py=`@effect/opentelemetry/Metrics`,Fy=class{resource;context;temporality;startTimes;startTimeNanos;previousExportTimeNanos;previousCounterState;previousHistogramState;previousFrequencyState;previousSummaryState;constructor(e,t,n=`cumulative`){this.resource=e,this.context=t,this.temporality=n,this.startTimes=new Map,this.startTimeNanos=Ly(),this.previousExportTimeNanos=this.startTimeNanos,this.previousCounterState=new Map,this.previousHistogramState=new Map,this.previousFrequencyState=new Map,this.previousSummaryState=new Map}startTimeFor(e,t){return this.startTimes.has(e)?this.startTimes.get(e):(this.startTimes.set(e,t),t)}collect(e){let t=ae(this.context),n=Ly(),r=[],i=new Map,a=e=>{r.push(e),i.set(e.descriptor.name,e)},o=this.temporality===`delta`,s=o?jy.DELTA:jy.CUMULATIVE,c=o?this.previousExportTimeNanos:this.startTimeNanos;for(let e=0,r=t.length;e<r;e++){let r=t[e],l=r.attributes?di(Object.entries(r.attributes),{},(e,[t,n])=>(e[t]=String(n),e)):{},u=Iy(r.id,r.attributes);switch(r.type){case`Counter`:{let e=r.state.count,t=e;if(o){let n=this.previousCounterState.get(u);if(n!==void 0)if(typeof e==`bigint`&&typeof n==`bigint`)t=e-n,t<BigInt(0)&&(t=e);else{let r=Number(e);t=r-Number(n),t<0&&(t=r)}this.previousCounterState.set(u,e)}let d=Ry(r,l),f={startTime:this.startTimeFor(d.name,c),endTime:n,attributes:l,value:Number(t)};i.has(r.id)?i.get(r.id).dataPoints.push(f):a({dataPointType:Ny.SUM,descriptor:d,isMonotonic:r.state.incremental,aggregationTemporality:s,dataPoints:[f]});break}case`Gauge`:{let e=Ry(r,l),t={startTime:this.startTimeFor(e.name,this.startTimeNanos),endTime:n,attributes:l,value:Number(r.state.value)};i.has(r.id)?i.get(r.id).dataPoints.push(t):a({dataPointType:Ny.GAUGE,descriptor:e,aggregationTemporality:jy.CUMULATIVE,dataPoints:[t]});break}case`Histogram`:{let e=r.state.buckets.length,t={boundaries:Ve(e-1),counts:Ve(e)},d=0,f=0;for(let[n,i]of r.state.buckets)d<e-1&&(t.boundaries[d]=n),t.counts[d]=i-f,f=i,d++;let p=r.state.count,m=r.state.sum,h=t.counts,g=r.state.min,ee=r.state.max;if(o){let e=this.previousHistogramState.get(u);e!==void 0&&(p=r.state.count-e.count,m=r.state.sum-e.sum,h=t.counts.map((t,n)=>Math.max(0,t-(e.bucketCounts[n]??0)))),this.previousHistogramState.set(u,{count:r.state.count,sum:r.state.sum,bucketCounts:t.counts.slice(),min:r.state.min,max:r.state.max})}let te=Ry(r,l),_={startTime:this.startTimeFor(te.name,c),endTime:n,attributes:l,value:{buckets:{boundaries:t.boundaries,counts:h},count:p,min:g,max:ee,sum:m}};i.has(r.id)?i.get(r.id).dataPoints.push(_):a({dataPointType:Ny.HISTOGRAM,descriptor:te,aggregationTemporality:s,dataPoints:[_]});break}case`Frequency`:{let e=[],t=new Map;for(let[i,a]of r.state.occurrences){t.set(i,a);let s=a;if(o){let e=this.previousFrequencyState.get(u);if(e!==void 0){let t=e.get(i)??0;s=Math.max(0,a-t)}}let d=Ry(r,l),f=this.startTimeFor(d.name,c);e.push({startTime:f,endTime:n,attributes:{...l,key:i},value:s})}if(o&&this.previousFrequencyState.set(u,t),i.has(r.id))i.get(r.id).dataPoints.push(...e);else{let t=Ry(r,l);a({dataPointType:Ny.SUM,descriptor:t,aggregationTemporality:s,isMonotonic:!0,dataPoints:e})}break}case`Summary`:{let e=[{startTime:c,endTime:n,attributes:{...l,quantile:`min`},value:r.state.min}];for(let[t,i]of r.state.quantiles)e.push({startTime:c,endTime:n,attributes:{...l,quantile:t.toString()},value:i??0});e.push({startTime:c,endTime:n,attributes:{...l,quantile:`max`},value:r.state.max});let t=r.state.count,d=r.state.sum;if(o){let e=this.previousSummaryState.get(u);e!==void 0&&(t=r.state.count-e.count,d=r.state.sum-e.sum),this.previousSummaryState.set(u,{count:r.state.count,sum:r.state.sum})}let f={startTime:c,endTime:n,attributes:l,value:t},p={startTime:c,endTime:n,attributes:l,value:d};if(i.has(`${r.id}_quantiles`))i.get(`${r.id}_quantiles`).dataPoints.push(...e),i.get(`${r.id}_count`).dataPoints.push(f),i.get(`${r.id}_sum`).dataPoints.push(p);else{let t=Ry(r,l);a({dataPointType:Ny.SUM,descriptor:{...t,name:`${t.name}_quantiles`},aggregationTemporality:s,isMonotonic:!1,dataPoints:e}),a({dataPointType:Ny.SUM,descriptor:{name:`${r.id}_count`,description:r.description??``,unit:`1`,type:My.COUNTER,valueType:kh.INT,advice:{}},aggregationTemporality:s,isMonotonic:!0,dataPoints:[f]}),a({dataPointType:Ny.SUM,descriptor:{name:`${r.id}_sum`,description:r.description??``,unit:`1`,type:My.COUNTER,valueType:kh.DOUBLE,advice:{}},aggregationTemporality:s,isMonotonic:!0,dataPoints:[p]})}break}}}return o&&(this.previousExportTimeNanos=n),Promise.resolve({resourceMetrics:{resource:this.resource,scopeMetrics:[{scope:{name:Py},metrics:r}]},errors:[]})}},Iy=(e,t)=>{if(t===void 0||Object.keys(t).length===0)return e;let n=Object.entries(t).sort((e,t)=>e[0].localeCompare(t[0]));return`${e}:${JSON.stringify(n)}`},Ly=()=>{let e=Date.now();return[Math.floor(e/1e3),e%1e3*1e6]},Ry=(e,t)=>{let n=t.unit??t.time_unit??`1`;return{name:e.id,description:e.description??``,unit:n,type:zy(e),valueType:By(e),advice:{}}},zy=e=>{switch(e.type){case`Histogram`:return My.HISTOGRAM;case`Gauge`:return My.OBSERVABLE_GAUGE;case`Frequency`:return My.COUNTER;case`Counter`:return e.state.incremental?My.COUNTER:My.UP_DOWN_COUNTER;case`Summary`:return My.COUNTER}},By=e=>e.type===`Counter`?typeof e.state.count==`bigint`?kh.INT:kh.DOUBLE:e.type===`Gauge`&&typeof e.state.value==`bigint`?kh.INT:kh.DOUBLE,Vy=e=>b(function*(){return new Fy(yield*Cy,yield*Zn(),e)}),Hy=(e,t,n)=>Vr(j(()=>{let n=t(),r=Array.isArray(n)?n:[n];return r.forEach(t=>t.setMetricProducer(e)),r}),e=>Ut(()=>Promise.all(e.map(e=>e.shutdown()))).pipe(at,f,Nr(n?.shutdownTimeout??3e3))),Uy=(e,t)=>Me(M(Vy(t?.temporality),n=>Hy(n,e,t))),Wy=class extends v()(`@effect/opentelemetry/Tracer`){},Gy=class extends v()(`@effect/opentelemetry/Tracer/OtelTracerProvider`){},Ky=class extends v()(`@effect/opentelemetry/Tracer/OtelTraceFlags`){},qy=class extends v()(`@effect/opentelemetry/Tracer/OtelTraceState`){},Jy=C(_n(Wy),e=>sr({span(t){return new $y(cg,$,e,t)},context(e,t){let n=t.currentSpan;return n===void 0?e[`~effect/Effect/evaluate`](t):cg.with(ob(cg.active(),n),()=>e[`~effect/Effect/evaluate`](t))}})),Yy=Ie(Wy,b(function*(){let e=yield*Cy;return(yield*Gy).getTracer(e.attributes[Hg],e.attributes[Ug])})),Xy=Ie(Yr,Jy).pipe(Un(Yy)),Zy=`~@effect/opentelemetry/Tracer/OtelSpan`,Qy={internal:og.INTERNAL,client:og.CLIENT,server:og.SERVER,producer:og.PRODUCER,consumer:og.CONSUMER},$y=class{[Zy];_tag=`Span`;name;kind;annotations;links;span;spanId;traceId;attributes=new Map;sampled;parent;status;constructor(e,t,n,r){this[Zy]=Zy,this.name=r.name,this.annotations=r.annotations,this.links=r.links,this.kind=r.kind;let i=e.active();this.parent=r.root===!0?r.parent:Cr(r.parent,()=>tb(t,i,r.annotations)),this.span=n.startSpan(r.name,{startTime:by(r.startTime),links:r.links.length>0?r.links.map(e=>({context:nb(e.span),attributes:xy(e.attributes)})):void 0,kind:Qy[this.kind]},Tt(this.parent)?ob(i,this.parent.value,r.annotations):$.deleteSpan(i));let a=this.span.spanContext();this.spanId=a.spanId,this.traceId=a.traceId,this.status={_tag:`Started`,startTime:r.startTime},this.sampled=eb(a.traceFlags)}attribute(e,t){this.span.setAttribute(e,Sy(t)),this.attributes.set(e,t)}addLinks(e){this.links.push(...e),this.span.addLinks(e.map(e=>({context:nb(e.span),attributes:xy(e.attributes)})))}end(e,t){let n=by(e);if(this.status={_tag:`Ended`,endTime:e,exit:t,startTime:this.status.startTime},t._tag===`Success`)this.span.setStatus({code:sg.OK});else if(me(t.cause))this.span.setStatus({code:sg.OK,message:vt(t.cause)}),this.span.setAttribute(`span.label`,`⚠︎ Interrupted`),this.span.setAttribute(`status.interrupted`,!0);else{let e=Qi(t.cause);if(e.length>0){for(let t of e)this.span.recordException(t,n);this.span.setStatus({code:sg.ERROR,message:e[0].message})}else this.span.setStatus({code:sg.OK})}this.span.end(n)}event(e,t,n){this.span.addEvent(e,n?xy(n):void 0,by(t))}},eb=e=>(e&Ih.SAMPLED)===Ih.SAMPLED,tb=(e,t,n)=>{let r=e.getSpan(t)?.spanContext();return r?c(Mr({spanId:r.spanId,traceId:r.traceId,sampled:(r.traceFlags&1)==1,annotations:n})):S()},nb=(e,t)=>{let n=rb(e,t),r=ib(e,t);return{spanId:e.spanId,traceId:e.traceId,isRemote:e._tag===`ExternalSpan`,traceFlags:n,traceState:r}},rb=(e,t)=>{let n;return vn(t)&&(n=ab(e,t,Ky),pi(n)&&(n=vr(e.annotations,Ky))),n??Ih.SAMPLED},ib=(e,t)=>{let n;return vn(t)&&(n=ab(e,t,qy),pi(n)&&(n=vr(e.annotations,qy))),n},ab=(e,t,n)=>{let r=vr(t,n);return vn(r)?r:vr(e.annotations,n)},ob=(e,t,n)=>t instanceof $y?$.setSpan(e,t.span):$.setSpanContext(e,nb(t,n)),sb=(e,t)=>Ie(Gy,b(function*(){let n=yield*Cy;return yield*Vr(j(()=>new Qv({...t??void 0,resource:n,spanProcessors:Array.isArray(e)?e:[e]})),e=>at(Ut(()=>e.forceFlush().then(()=>e.shutdown()))))})),cb=e=>Br(b(function*(){let t=yield*xr(e)?e:j(e),n=wy(t.resource),r=$v(t.spanProcessor)?i(Xy,sb(t.spanProcessor,t.tracerConfig)):$t,a=$v(t.logRecordProcessor)?i(ky({mergeWithExisting:t.loggerMergeWithExisting}),Ay(t.logRecordProcessor,t.loggerProviderConfig)):$t;return an(r,$v(t.metricReader)?Uy(Yn(t.metricReader),{temporality:t.metricTemporality}):$t,a).pipe(Un(n))})),lb=class{_delegate;constructor(e){this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}};function ub(e,t){let n={attributes:fb(e.attributes,t),droppedAttributesCount:0},r=e.schemaUrl;return r&&r!==``&&(n.schemaUrl=r),n}function db(e){return{name:e.name,version:e.version}}function fb(e,t){return Object.keys(e).map(n=>pb(n,e[n],t))}function pb(e,t,n){return{key:e,value:mb(t,n)}}function mb(e,t){let n=typeof e;if(n===`string`)return{stringValue:e};if(n===`number`)return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(n===`boolean`)return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=mb(e[r],t);return{arrayValue:{values:n}}}if(n===`object`&&e!=null){let n=Object.keys(e),r=Array(n.length);for(let i=0;i<n.length;i++)r[i]={key:n[i],value:mb(e[n[i]],t)};return{kvlistValue:{values:r}}}return{}}var hb=256,gb=512;function _b(e,t){let n=e&255|hb;return t&&(n|=gb),n}function vb(e,t){let n=e.spanContext(),r=e.status,i=e.parentSpanContext?.spanId?t.encodeSpanContext(e.parentSpanContext?.spanId):void 0;return{traceId:t.encodeSpanContext(n.traceId),spanId:t.encodeSpanContext(n.spanId),parentSpanId:i,traceState:n.traceState?.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:fb(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(e=>bb(e,t)),droppedEventsCount:e.droppedEventsCount,status:{code:r.code,message:r.message},links:e.links.map(e=>yb(e,t)),droppedLinksCount:e.droppedLinksCount,flags:_b(n.traceFlags,e.parentSpanContext?.isRemote)}}function yb(e,t){return{attributes:e.attributes?fb(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:e.context.traceState?.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:_b(e.context.traceFlags,e.context.isRemote)}}function bb(e,t){return{attributes:e.attributes?fb(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function xb(e,t){return{resourceSpans:Cb(e,t)}}function Sb(e){let t=new Map;for(let n of e){let e=t.get(n.resource);e||(e=new Map,t.set(n.resource,e));let r=`${n.instrumentationScope.name}@${n.instrumentationScope.version||``}:${n.instrumentationScope.schemaUrl||``}`,i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return t}function Cb(e,t){let n=Sb(e),r=[],i=n.entries(),a=i.next();for(;!a.done;){let[e,n]=a.value,o=[],s=n.values(),c=s.next();for(;!c.done;){let e=c.value;if(e.length>0){let n=e.map(e=>vb(e,t));o.push({scope:db(e[0].instrumentationScope),spans:n,schemaUrl:e[0].instrumentationScope.schemaUrl})}c=s.next()}let l=ub(e,t),u={resource:l,scopeSpans:o,schemaUrl:l.schemaUrl};r.push(u),a=i.next()}return r}function wb(e){let t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Tb(e){return wb(e).toString()}var Eb=typeof BigInt<`u`?Tb:a_;function Db(e){return e}var Ob={encodeHrTime:Eb,encodeSpanContext:Db,encodeOptionalSpanContext:Db,encodeUint8Array:e=>{if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return btoa(t.join(``))}},kb={serializeRequest:e=>{let t=xb(e,Ob);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};let t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(e){return Q.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`),{}}}},Ab=5,jb=1e3,Mb=5e3,Nb=1.5,Pb=.2;function Fb(){return 2*Pb*Math.random()-Pb}var Ib=class{_transport;constructor(e){this._transport=e}retry(e,t,n){return new Promise((r,i)=>{setTimeout(()=>{this._transport.send(e,t).then(r,i)},n)})}async send(e,t){let n=Ab,r=jb,i=Date.now()+t,a=await this._transport.send(e,t);for(;a.status===`retryable`&&n>0;){n--;let t=Math.max(Math.min(r*(1+Fb()),Mb),0);r*=Nb;let o=a.retryInMillis??t,s=i-Date.now();if(o>s)return Q.info(`Export retry time ${Math.round(o)}ms exceeds remaining timeout ${Math.round(s)}ms, not retrying further.`),a;Q.verbose(`Scheduling export retry in ${Math.round(o)}ms`),a=await this.retry(e,s,o)}return a.status===`success`?Q.verbose(`Export succeeded after ${Ab-n} retry attempts.`):a.status===`retryable`?Q.info(`Export failed after maximum retry attempts (${Ab}).`):Q.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}};function Lb(e){return new Ib(e.transport)}var Rb=class{_concurrencyLimit;_sendingPromises=[];constructor(e){this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw Error(`Concurrency Limit reached`);this._sendingPromises.push(e);let t=()=>{let t=this._sendingPromises.indexOf(e);this._sendingPromises.splice(t,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function zb(e){return new Rb(e.concurrencyLimit)}var Bb=class extends Error{code;name=`OTLPExporterError`;data;constructor(e,t,n){super(e),this.data=n,this.code=t}};function Vb(e){return Object.prototype.hasOwnProperty.call(e,`partialSuccess`)}function Hb(){return{handleResponse(e){e==null||!Vb(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||Q.warn(`Received Partial Success response:`,JSON.stringify(e.partialSuccess))}}}var Ub=class{_diagLogger;_transport;_serializer;_responseHandler;_promiseQueue;_timeout;constructor(e,t,n,r,i){this._transport=e,this._serializer=t,this._responseHandler=n,this._promiseQueue=r,this._timeout=i,this._diagLogger=Q.createComponentLogger({namespace:`OTLPExportDelegate`})}export(e,t){if(this._diagLogger.debug(`items to be sent`,e),this._promiseQueue.hasReachedLimit()){t({code:l_.FAILED,error:Error(`Concurrent export limit reached`)});return}let n=this._serializer.serializeRequest(e);if(n==null){t({code:l_.FAILED,error:Error(`Nothing to send`)});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(e=>{if(e.status===`success`){if(e.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data))}catch(t){this._diagLogger.warn(`Export succeeded but could not deserialize response - is the response specification compliant?`,t,e.data)}t({code:l_.SUCCESS});return}else if(e.status===`failure`&&e.error){t({code:l_.FAILED,error:e.error});return}else e.status===`retryable`?t({code:l_.FAILED,error:e.error??new Bb(`Export failed with retryable status`)}):t({code:l_.FAILED,error:new Bb(`Export failed with unknown error`)})},e=>t({code:l_.FAILED,error:e})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug(`shutdown started`),await this.forceFlush(),this._transport.shutdown()}};function Wb(e,t){return new Ub(e.transport,e.serializer,Hb(),e.promiseHandler,t.timeout)}function Gb(e,t,n){return Wb({transport:n,serializer:t,promiseHandler:zb(e)},{timeout:e.timeoutMillis})}function Kb(e){return e===429||e===502||e===503||e===504}function qb(e){if(e==null)return;let t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;let n=new Date(e).getTime()-Date.now();return n>=0?n:0}var Jb=60*1024,Yb=9,Xb=0,Zb=0,Qb=class{_parameters;constructor(e){this._parameters=e}async send(e,t){let n=new AbortController,r=setTimeout(()=>n.abort(),t),i=globalThis.fetch;typeof i.__original==`function`&&(i=i.__original);let a=e.byteLength,o=Xb+a>Jb,s=!o&&!(Zb>=Yb);if(s)Xb+=a,Zb++;else{let e=o?`size limit`:`count limit`;Q.debug(`keepalive disabled: ${(a/1024).toFixed(1)}KB payload, ${Zb} pending (${e})`)}try{let t=new URL(this._parameters.url),r=await i(t.href,{method:`POST`,headers:await this._parameters.headers(),body:e,signal:n.signal,keepalive:s,mode:globalThis.location?globalThis.location.origin===t.origin?`same-origin`:`cors`:`no-cors`});return r.status>=200&&r.status<=299?(Q.debug(`export response success (status: ${r.status})`),{status:`success`}):Kb(r.status)?(Q.warn(`export response retryable (status: ${r.status})`),{status:`retryable`,retryInMillis:qb(r.headers.get(`Retry-After`))}):(Q.error(`export response failure (status: ${r.status})`),{status:`failure`,error:Error(`Fetch request failed with non-retryable status ${r.status}`)})}catch(e){return ex(e)?(Q.warn(`export request retryable (network error: ${e})`),{status:`retryable`,error:Error(`Fetch request encountered a network error`,{cause:e})}):(Q.error(`export request failure (error: ${e})`),{status:`failure`,error:Error(`Fetch request errored`,{cause:e})})}finally{clearTimeout(r),s&&(Xb-=a,Zb--)}}shutdown(){}};function $b(e){return new Qb(e)}function ex(e){return e instanceof TypeError&&!e.cause}function tx(e,t){return Gb(e,t,Lb({transport:$b(e)}))}function nx(e){if(Number.isFinite(e)&&e>0)return e;throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function rx(e){if(e!=null)return async()=>e}function ix(e,t,n){return{timeoutMillis:nx(e.timeoutMillis??t.timeoutMillis??n.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??n.concurrencyLimit,compression:e.compression??t.compression??n.compression}}function ax(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:`none`}}function ox(e){let t={};return Object.entries(e??{}).forEach(([e,n])=>{n===void 0?Q.warn(`Header "${e}" has invalid value (${n}) and will be ignored`):t[e]=String(n)}),t}function sx(e,t,n){return async()=>{let r={...await n()},i={};return t!=null&&Object.assign(i,await t()),e!=null&&Object.assign(i,ox(await e())),Object.assign(i,r)}}function cx(e){if(e!=null)try{let t=globalThis.location?.href;return new URL(e,t).href}catch{throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function lx(e,t,n){return{...ix(e,t,n),headers:sx(e.headers,t.headers,n.headers),url:cx(e.url)??t.url??n.url}}function ux(e,t){return{...ax(),headers:async()=>e,url:`http://localhost:4318/`+t}}function dx(e){return typeof e.headers==`function`?e.headers:rx(e.headers)}function fx(e,t,n){return lx({url:e.url,timeoutMillis:e.timeoutMillis,headers:dx(e),concurrencyLimit:e.concurrencyLimit},{},ux(n,t))}function px(e,t,n,r){return tx(fx(e,n,r),t)}var mx=class extends lb{constructor(e={}){super(px(e,kb,`v1/traces`,{"Content-Type":`application/json`}))}};function hx(e){return Br(C(tc(sc(`VITE_OTEL_URL`)),ie({onNone:()=>$t,onSome:t=>cb(()=>({resource:{serviceName:e},spanProcessor:new Jv(new mx({url:t}))}))})))}var gx=nr($t,Un(hx(`workbench-client`)),Un(bm),Un(em),Un(Rs(zs({VITE_OTEL_URL:{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_INLINE_CSS_ENABLED:`false`}.VITE_OTEL_URL})))),_x=class extends gm()(`ApiClient`,{group:Cm().merge(Bm),protocol:nr(pm({retryTransientErrors:!0}),Un(mf(`${location.origin}/api/rpc`)),Un(df),Un(gx))}){},vx=zl(_x.runtime.atom(nr(_x,C(e=>e(`projects.watch`,void 0)),ys))),yx=Rl(e=>zl(bl(t=>b(function*(){let n=yield*t.result(vx),r=nr(n,ti(t=>Dn(t.worktrees,t=>Math.abs(yi(t.root)).toString(36)===e)),ee);return{activeProject:r,activeWorktree:nr(r?.worktrees??[],ti(t=>Math.abs(yi(t.root)).toString(36)===e),ee),projects:n}}))));export{nu as a,Rl as c,ys as d,Pm as i,zl as l,vx as n,tu as o,_x as r,ou as s,yx as t,Ss as u};
|