@lmvz-ds/components 0.12.4 → 0.12.5-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
  2. package/dist/cjs/assets-Cswkqk_c.js +18971 -0
  3. package/dist/cjs/assets-Cswkqk_c.js.map +1 -0
  4. package/dist/cjs/axe-C2rxi-K2.js +32837 -0
  5. package/dist/cjs/axe-C2rxi-K2.js.map +1 -0
  6. package/dist/cjs/header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem-BTL_B6qg.js +3665 -0
  7. package/dist/cjs/header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem-BTL_B6qg.js.map +1 -0
  8. package/dist/cjs/header-integration_6.cjs.entry.js +18 -0
  9. package/dist/cjs/header-integration_6.cjs.entry.js.map +1 -0
  10. package/dist/cjs/icons-jn_Uak9B.js +1063 -0
  11. package/dist/cjs/icons-jn_Uak9B.js.map +1 -0
  12. package/dist/cjs/index-DpBPf1cE.js +2112 -0
  13. package/dist/cjs/index-DpBPf1cE.js.map +1 -0
  14. package/dist/cjs/index.cjs.js.map +1 -0
  15. package/dist/cjs/lmvz-action.cjs.entry.js.map +1 -0
  16. package/dist/cjs/lmvz-card.cjs.entry.js.map +1 -0
  17. package/dist/cjs/lmvz-chip.cjs.entry.js.map +1 -0
  18. package/dist/cjs/lmvz-components.cjs.js.map +1 -0
  19. package/dist/cjs/loader.cjs.js.map +1 -0
  20. package/dist/collection/api/ds.constants.js.map +1 -0
  21. package/dist/collection/api/index.js.map +1 -0
  22. package/dist/collection/components/lmvz-action/lmvz-action.js.map +1 -0
  23. package/dist/collection/components/lmvz-button/lmvz-button.js.map +1 -0
  24. package/dist/collection/components/lmvz-card/lmvz-card.js.map +1 -0
  25. package/dist/collection/components/lmvz-chip/lmvz-chip.js.map +1 -0
  26. package/dist/collection/components/lmvz-header/lmvz-header.js.map +1 -0
  27. package/dist/collection/components/lmvz-icon/icons.js.map +1 -0
  28. package/dist/collection/components/lmvz-icon/lmvz-icon.js.map +1 -0
  29. package/dist/collection/components/lmvz-icon/public.js.map +1 -0
  30. package/dist/collection/components/lmvz-icon/test/icons.unit.js.map +1 -0
  31. package/dist/collection/components/lmvz-input/lmvz-input.js.map +1 -0
  32. package/dist/collection/components/lmvz-menuitem/lmvz-menuitem.js.map +1 -0
  33. package/dist/collection/index.js.map +1 -0
  34. package/dist/collection/integration/header-integration.js +22 -4
  35. package/dist/collection/integration/header-integration.js.map +1 -0
  36. package/dist/collection/utils/assets.js.map +1 -0
  37. package/dist/collection/utils/component.js.map +1 -0
  38. package/dist/collection/utils/effect.js.map +1 -0
  39. package/dist/collection/utils/element-activation-controller.js.map +1 -0
  40. package/dist/collection/utils/environment.js.map +1 -0
  41. package/dist/collection/utils/http.js.map +1 -0
  42. package/dist/collection/utils/http.test.js.map +1 -0
  43. package/dist/collection/utils/list-keyboard-controller.js.map +1 -0
  44. package/dist/collection/utils/public.js.map +1 -0
  45. package/dist/collection/utils/reactive-controller-host.js.map +1 -0
  46. package/dist/collection/utils/typing.js.map +1 -0
  47. package/dist/collection/utils/validation/aria-validation-controller.js.map +1 -0
  48. package/dist/collection/utils/validation/svg.js.map +1 -0
  49. package/dist/components/header-integration.d.ts +11 -0
  50. package/dist/components/header-integration.js +2 -0
  51. package/dist/components/header-integration.js.map +1 -0
  52. package/dist/components/index.js.map +1 -0
  53. package/dist/components/lmvz-action.js.map +1 -0
  54. package/dist/components/lmvz-button.js.map +1 -0
  55. package/dist/components/lmvz-card.js.map +1 -0
  56. package/dist/components/lmvz-chip.js.map +1 -0
  57. package/dist/components/lmvz-header.js.map +1 -0
  58. package/dist/components/lmvz-icon.js.map +1 -0
  59. package/dist/components/lmvz-input.js.map +1 -0
  60. package/dist/components/lmvz-menuitem.js.map +1 -0
  61. package/dist/components/p-B3JVFwO1.js.map +1 -0
  62. package/dist/components/p-B85MJLTf.js.map +1 -0
  63. package/dist/components/p-CN0JX9-m.js.map +1 -0
  64. package/dist/components/p-Cd4nH2vx.js +2 -0
  65. package/dist/components/p-Cd4nH2vx.js.map +1 -0
  66. package/dist/components/p-CdofjRtQ.js.map +1 -0
  67. package/dist/components/p-CkTUjPwD.js +2 -0
  68. package/dist/components/p-CkTUjPwD.js.map +1 -0
  69. package/dist/components/p-CpI4KFOu.js +2 -0
  70. package/dist/components/p-CpI4KFOu.js.map +1 -0
  71. package/dist/components/p-D1HbKFuh.js.map +1 -0
  72. package/dist/components/p-D7xthqTT.js +2 -0
  73. package/dist/components/p-D7xthqTT.js.map +1 -0
  74. package/dist/components/p-DBeynNeU.js +2 -0
  75. package/dist/components/p-DBeynNeU.js.map +1 -0
  76. package/dist/components/p-DMLRPGid.js.map +1 -0
  77. package/dist/components/p-UiqQVZhU.js +2 -0
  78. package/dist/components/p-UiqQVZhU.js.map +1 -0
  79. package/dist/components/p-Xq267cFM.js +2 -0
  80. package/dist/components/p-Xq267cFM.js.map +1 -0
  81. package/dist/components/p-glDDybgu.js +2 -0
  82. package/dist/components/p-glDDybgu.js.map +1 -0
  83. package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
  84. package/dist/esm/assets-K2FHD9qn.js +18770 -0
  85. package/dist/esm/assets-K2FHD9qn.js.map +1 -0
  86. package/dist/esm/axe-CZ0Rtkog.js +32835 -0
  87. package/dist/esm/axe-CZ0Rtkog.js.map +1 -0
  88. package/dist/esm/header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem-CW3FGLZC.js +3657 -0
  89. package/dist/esm/header-integration.lmvz-button.lmvz-header.lmvz-icon.lmvz-input.lmvz-menuitem-CW3FGLZC.js.map +1 -0
  90. package/dist/esm/header-integration_6.entry.js +7 -0
  91. package/dist/esm/header-integration_6.entry.js.map +1 -0
  92. package/dist/esm/icons-BITzEzmq.js +1032 -0
  93. package/dist/esm/icons-BITzEzmq.js.map +1 -0
  94. package/dist/esm/index-D2eyw7iv.js +2101 -0
  95. package/dist/esm/index-D2eyw7iv.js.map +1 -0
  96. package/dist/esm/index.js.map +1 -0
  97. package/dist/esm/lmvz-action.entry.js.map +1 -0
  98. package/dist/esm/lmvz-card.entry.js.map +1 -0
  99. package/dist/esm/lmvz-chip.entry.js.map +1 -0
  100. package/dist/esm/lmvz-components.js.map +1 -0
  101. package/dist/esm/loader.js.map +1 -0
  102. package/dist/lmvz-components/index.esm.js.map +1 -0
  103. package/dist/lmvz-components/lmvz-components.esm.js.map +1 -0
  104. package/dist/lmvz-components/p-366a01f8.entry.js +2 -0
  105. package/dist/lmvz-components/p-366a01f8.entry.js.map +1 -0
  106. package/dist/lmvz-components/p-84ee7919.entry.js +2 -0
  107. package/dist/lmvz-components/p-84ee7919.entry.js.map +1 -0
  108. package/dist/lmvz-components/p-BLwPC3DQ.js +2 -0
  109. package/dist/lmvz-components/p-BLwPC3DQ.js.map +1 -0
  110. package/dist/lmvz-components/p-D2eyw7iv.js +3 -0
  111. package/dist/lmvz-components/p-D2eyw7iv.js.map +1 -0
  112. package/dist/lmvz-components/p-DANVVVBd.js +7 -0
  113. package/dist/lmvz-components/p-DANVVVBd.js.map +1 -0
  114. package/dist/lmvz-components/p-DQuL1Twl.js.map +1 -0
  115. package/dist/lmvz-components/p-DlDurXvX.js +2 -0
  116. package/dist/lmvz-components/p-DlDurXvX.js.map +1 -0
  117. package/dist/lmvz-components/p-Hc4uxoTU.js +13 -0
  118. package/dist/lmvz-components/p-Hc4uxoTU.js.map +1 -0
  119. package/dist/lmvz-components/p-a4200b26.entry.js +2 -0
  120. package/dist/lmvz-components/p-a4200b26.entry.js.map +1 -0
  121. package/dist/lmvz-components/p-d3243bae.entry.js +2 -0
  122. package/dist/lmvz-components/p-d3243bae.entry.js.map +1 -0
  123. package/dist/manifest.json +26 -2
  124. package/package.json +10 -9
@@ -0,0 +1,2 @@
1
+ import{H as t,B as n}from"./p-DBeynNeU.js";import{a6 as e,a7 as s,a8 as i,a9 as o,aa as r,ab as c,ac as u,ad as a,ae as h,af as d,ag as l,ah as f,ai as b,aj as m,ak as p,al as y,am as S,an as w,ao as g,ap as _,aq as F,ar as E,as as O,at as C,au as v,av as k,aw as D,ax as x,ay as j,az as R,aA as A,aB as P,aC as I,aD as L,aE as N,aF as z,aG as B,aH as Q,aI as U,aJ as W,aK as M,aL as q,aM as T,aN as V,aO as H,aP as J,aQ as K,J as G,B as Z,s as X,f as Y,H as $,aR as tt,p as nt,aS as et,aT as st,aU as it,u as ot,x as rt,aV as ct,aW as ut,G as at,Q as ht,aX as dt,U as lt,aY as ft,t as bt,aZ as mt,a_ as pt,a$ as yt,b0 as St,T as wt,b1 as gt,b2 as _t,b3 as Ft,b4 as Et,b5 as Ot,b6 as Ct,b7 as vt,k as kt,O as Dt,b8 as xt,i as jt,b9 as Rt,ba as At,bb as Pt,bc as It,bd as Lt,be as Nt,bf as zt,bg as Bt,bh as Qt,bi as Ut,bj as Wt,bk as Mt,bl as qt,bm as Tt,bn as Vt,bo as Ht,bp as Jt,bq as Kt,a3 as Gt,w as Zt,br as Xt,bs as Yt,bt as $t,bu as tn,bv as nn,bw as en,bx as sn,by as on,bz as rn,bA as cn,bB as un,bC as an,bD as hn,bE as dn,bF as ln,bG as fn,bH as bn,bI as mn,bJ as pn,l as yn,b as Sn,bK as wn,bL as gn,bM as _n,bN as Fn,bO as En,X as On,bP as Cn,bQ as vn,bR as kn,bS as Dn,bT as xn,bU as jn,bV as Rn,bW as An,bX as Pn,bY as In,bZ as Ln,b_ as Nn,m as zn,b$ as Bn,c0 as Qn,P as Un,c1 as Wn,c2 as Mn,c3 as qn,c4 as Tn,c5 as Vn,c6 as Hn,c7 as Jn,c8 as Kn,c9 as Gn,ca as Zn,cb as Xn,a2 as Yn,cc as $n,cd as te,ce as ne,cf as ee,cg as se}from"./p-CdofjRtQ.js";const ie=e;const oe=s;const re=u;const ce=o;const ue=c;const ae=a;const he=i;const de=r;const le=h;const fe=d;const be=y;const me=w;const pe=m;const ye=f;const Se=g;const we=l;const ge=b;const _e=S;const Fe=_;const Ee=p;const Oe=Symbol.for("effect/MutableList");const Ce={[Oe]:Oe,[Symbol.iterator](){let t=false;let n=this.head;return{next(){if(t){return this.return()}if(n==null){t=true;return this.return()}const e=n.value;n=n.next;return{done:t,value:e}},return(n){if(!t){t=true}return{done:true,value:n}}}},toString(){return v(this.toJSON())},toJSON(){return{_id:"MutableList",values:Array.from(this).map(C)}},[O](){return this.toJSON()},pipe(){return E(this,arguments)}};const ve=t=>({value:t,removed:false,prev:undefined,next:undefined});const ke=()=>{const t=Object.create(Ce);t.head=undefined;t.tail=undefined;t._length=0;return t};const De=t=>xe(t)===0;const xe=t=>t._length;const je=F(2,((t,n)=>{const e=ve(n);if(t.head===undefined){t.head=e}if(t.tail===undefined){t.tail=e}else{t.tail.next=e;e.prev=t.tail;t.tail=e}t._length+=1;return t}));const Re=t=>{const n=t.head;if(n!==undefined){Ae(t,n);return n.value}return undefined};const Ae=(t,n)=>{if(n.removed){return}n.removed=true;if(n.prev!==undefined&&n.next!==undefined){n.prev.next=n.next;n.next.prev=n.prev}else if(n.prev!==undefined){t.tail=n.prev;n.prev.next=undefined}else if(n.next!==undefined){t.head=n.next;n.next.prev=undefined}else{t.tail=undefined;t.head=undefined}if(t._length>0){t._length-=1}};const Pe=Symbol.for("effect/MutableQueue");const Ie=Symbol.for("effect/mutable/MutableQueue/Empty");const Le={[Pe]:Pe,[Symbol.iterator](){return Array.from(this.queue)[Symbol.iterator]()},toString(){return v(this.toJSON())},toJSON(){return{_id:"MutableQueue",values:Array.from(this).map(C)}},[O](){return this.toJSON()},pipe(){return E(this,arguments)}};const Ne=t=>{const n=Object.create(Le);n.queue=ke();n.capacity=t;return n};const ze=t=>Ne(t);const Be=()=>Ne(undefined);const Qe=t=>xe(t.queue);const Ue=t=>De(t.queue);const We=t=>t.capacity===undefined?Infinity:t.capacity;const Me=F(2,((t,n)=>{const e=xe(t.queue);if(t.capacity!==undefined&&e===t.capacity){return false}je(n)(t.queue);return true}));const qe=F(2,((t,n)=>{const e=n[Symbol.iterator]();let s;let i=D();let o=true;while(o&&(s=e.next())&&!s.done){o=Me(s.value)(t)}while(s!=null&&!s.done){i=k(s.value)(i);s=e.next()}return x(i)}));const Te=F(2,((t,n)=>{if(De(t.queue)){return n}return Re(t.queue)}));const Ve=F(2,((t,n)=>{let e=D();let s=0;while(s<n){const n=Te(Ie)(t);if(n===Ie){break}e=k(n)(e);s+=1}return x(e)}));const He=j;const Je=A;const Ke=R;const Ge=P;const Ze=L;const Xe=Q;const Ye=U;const $e=W;const ts=I;const ns=q;const es=M;const ss=N;const is=z;const os=B;const rs=H;const cs=J;const us=V;const as=K;const hs=T;const ds="effect/QueueEnqueue";const ls=Symbol.for(ds);const fs="effect/QueueDequeue";const bs=Symbol.for(fs);const ms="effect/QueueStrategy";const ps=Symbol.for(ms);const ys="effect/BackingQueue";const Ss=Symbol.for(ys);const ws={_A:t=>t};const gs={_A:t=>t};const _s={_In:t=>t};const Fs={_Out:t=>t};class Es extends tt{queue;takers;shutdownHook;shutdownFlag;strategy;[ls]=_s;[bs]=Fs;constructor(t,n,e,s,i){super();this.queue=t;this.takers=n;this.shutdownHook=e;this.shutdownFlag=s;this.strategy=i}pipe(){return E(this,arguments)}commit(){return this.take}capacity(){return this.queue.capacity()}get size(){return nt((()=>et(this.unsafeSize(),(()=>st))))}unsafeSize(){if(it(this.shutdownFlag)){return ot()}return rt(this.queue.length()-Qe(this.takers)+this.strategy.surplusSize())}get isEmpty(){return Y(this.size,(t=>t<=0))}get isFull(){return Y(this.size,(t=>t>=this.capacity()))}get shutdown(){return ct(ut((t=>{G(this.shutdownFlag,at(true));return G(ft(Ts(this.takers),(n=>Ct(n,t.id())),false,false),lt(this.strategy.shutdown),dt(i(this.shutdownHook,void 0)),ht)})))}get isShutdown(){return X((()=>it(this.shutdownFlag)))}get awaitShutdown(){return s(this.shutdownHook)}isActive(){return!it(this.shutdownFlag)}unsafeOffer(t){if(it(this.shutdownFlag)){return false}let n;if(this.queue.length()===0){const e=G(this.takers,Te(Ie));if(e!==Ie){Ms(e,t);n=true}else{n=false}}else{n=false}if(n){return true}const e=this.queue.offer(t);Js(this.strategy,this.queue,this.takers);return e}offer(t){return nt((()=>{if(it(this.shutdownFlag)){return st}let n;if(this.queue.length()===0){const e=G(this.takers,Te(Ie));if(e!==Ie){Ms(e,t);n=true}else{n=false}}else{n=false}if(n){return bt(true)}const e=this.queue.offer(t);Js(this.strategy,this.queue,this.takers);return e?bt(true):this.strategy.handleSurplus([t],this.queue,this.takers,this.shutdownFlag)}))}offerAll(t){return nt((()=>{if(it(this.shutdownFlag)){return st}const n=mt(t);const e=this.queue.length()===0?mt(Vs(this.takers,n.length)):pt;const[s,i]=G(n,yt(e.length));for(let t=0;t<e.length;t++){const n=e[t];const i=s[t];Ms(n,i)}if(i.length===0){return bt(true)}const o=this.queue.offerAll(i);Js(this.strategy,this.queue,this.takers);return St(o)?bt(true):this.strategy.handleSurplus(o,this.queue,this.takers,this.shutdownFlag)}))}get take(){return ut((t=>{if(it(this.shutdownFlag)){return st}const n=this.queue.poll(Ie);if(n!==Ie){this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers);return bt(n)}else{const n=r(t.id());return G(nt((()=>{G(this.takers,Me(n));Js(this.strategy,this.queue,this.takers);return it(this.shutdownFlag)?st:s(n)})),wt((()=>X((()=>Hs(this.takers,n))))))}}))}get takeAll(){return nt((()=>it(this.shutdownFlag)?st:X((()=>{const t=this.queue.pollUpTo(Number.POSITIVE_INFINITY);this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers);return gt(t)}))))}takeUpTo(t){return nt((()=>it(this.shutdownFlag)?st:X((()=>{const n=this.queue.pollUpTo(t);this.strategy.unsafeOnQueueEmptySpace(this.queue,this.takers);return gt(n)}))))}takeBetween(t,n){return nt((()=>Os(this,t,n,D())))}}const Os=(t,n,e,s)=>{if(e<n){return bt(s)}return G(Ns(t,e),Z((i=>{const o=n-i.length;if(o===1){return G(Ls(t),Y((t=>G(s,Et(i),Ot(t)))))}if(o>1){return G(Ls(t),Z((n=>Os(t,o-1,e-i.length-1,G(s,Et(i),Ot(n))))))}return bt(G(s,Et(i)))})))};const Cs=t=>G(X((()=>ze(t))),Z((t=>Ds(js(t),Bs()))));const vs=()=>G(X((()=>Be())),Z((t=>Ds(js(t),Qs()))));const ks=(t,n,e,s,i)=>new Es(t,n,e,s,i);const Ds=(t,n)=>G(e(),Y((e=>ks(t,Be(),e,$(false),n))));class xs{mutable;[Ss]=gs;constructor(t){this.mutable=t}poll(t){return Te(this.mutable,t)}pollUpTo(t){return Ve(this.mutable,t)}offerAll(t){return qe(this.mutable,t)}offer(t){return Me(this.mutable,t)}capacity(){return We(this.mutable)}length(){return Qe(this.mutable)}}const js=t=>new xs(t);const Rs=t=>t.size;const As=t=>t.isShutdown;const Ps=t=>t.shutdown;const Is=F(2,((t,n)=>t.offer(n)));const Ls=t=>t.take;const Ns=F(2,((t,n)=>t.takeUpTo(n)));const zs=F(3,((t,n,e)=>t.takeBetween(n,e)));const Bs=()=>new Us;const Qs=()=>new Ws;class Us{[ps]=ws;putters=Be();surplusSize(){return Qe(this.putters)}onCompleteTakersWithEmptyQueue(t){while(!Ue(this.putters)&&!Ue(t)){const n=Te(t,void 0);const e=Te(this.putters,void 0);if(e[2]){Ms(e[1],true)}Ms(n,e[0])}}get shutdown(){return G(kt,Z((t=>G(X((()=>Ts(this.putters))),Z((n=>ft(n,(([n,e,s])=>s?G(Ct(e,t),ht):vt),false,false)))))))}handleSurplus(t,n,e,i){return ut((o=>{const c=r(o.id());return G(nt((()=>{this.unsafeOffer(t,c);this.unsafeOnQueueEmptySpace(n,e);Js(this,n,e);return it(i)?st:s(c)})),wt((()=>X((()=>this.unsafeRemove(c))))))}))}unsafeOnQueueEmptySpace(t,n){let e=true;while(e&&(t.capacity()===Number.POSITIVE_INFINITY||t.length()<t.capacity())){const s=G(this.putters,Te(Ie));if(s===Ie){e=false}else{const e=t.offer(s[0]);if(e&&s[2]){Ms(s[1],true)}else if(!e){qs(this.putters,G(Ts(this.putters),k(s)))}Js(this,t,n)}}}unsafeOffer(t,n){const e=mt(t);for(let t=0;t<e.length;t++){const s=e[t];if(t===e.length-1){G(this.putters,Me([s,n,true]))}else{G(this.putters,Me([s,n,false]))}}}unsafeRemove(t){qs(this.putters,G(Ts(this.putters),Ft((([,n])=>n!==t))))}}class Ws{[ps]=ws;surplusSize(){return 0}get shutdown(){return vt}onCompleteTakersWithEmptyQueue(){}handleSurplus(t,n,e,s){return bt(false)}unsafeOnQueueEmptySpace(t,n){}}const Ms=(t,n)=>_t(t,bt(n));const qs=(t,n)=>G(t,qe(n));const Ts=t=>G(t,Ve(Number.POSITIVE_INFINITY));const Vs=(t,n)=>G(t,Ve(n));const Hs=(t,n)=>{qs(t,G(Ts(t),Ft((t=>n!==t))))};const Js=(t,n,e)=>{let s=true;while(s&&n.length()!==0){const i=G(e,Te(Ie));if(i!==Ie){const o=n.poll(Ie);if(o!==Ie){Ms(i,o);t.unsafeOnQueueEmptySpace(n,e)}else{qs(e,G(Ts(e),k(i)))}s=true}else{s=false}}if(s&&n.length()===0&&!Ue(e)){t.onCompleteTakersWithEmptyQueue(e)}};const Ks=Cs;const Gs=vs;const Zs=Rs;const Xs=As;const Ys=Ps;const $s=Is;const ti=Ls;const ni=zs;const ei="Continue";const si="Close";const ii="Yield";const oi="effect/ChannelChildExecutorDecision";const ri=Symbol.for(oi);const ci={[ri]:ri};const ui=t=>{const n=Object.create(ci);n._tag=ei;return n};const ai="ContinuationK";const hi="ContinuationFinalizer";const di=Symbol.for("effect/ChannelContinuation");const li={_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutDone:t=>t,_OutErr2:t=>t,_OutElem:t=>t,_OutDone2:t=>t};class fi{onSuccess;onHalt;_tag=ai;[di]=li;constructor(t,n){this.onSuccess=t;this.onHalt=n}onExit(t){return le(t)?this.onHalt(t.cause):this.onSuccess(t.value)}}class bi{finalizer;_tag=hi;[di]=li;constructor(t){this.finalizer=t}}const mi="PullAfterNext";const pi="PullAfterAllEnqueued";const yi="effect/ChannelUpstreamPullStrategy";const Si=Symbol.for(yi);const wi={_A:t=>t};const gi={[Si]:wi};const _i=t=>{const n=Object.create(gi);n._tag=mi;n.emitSeparator=t;return n};const Fi="BracketOut";const Ei="Bridge";const Oi="ConcatAll";const Ci="Emit";const vi="Ensuring";const ki="Fail";const Di="Fold";const xi="FromEffect";const ji="PipeTo";const Ri="Provide";const Ai="Read";const Pi="Succeed";const Ii="SucceedNow";const Li="Suspend";const Ni="effect/Channel";const zi=Symbol.for(Ni);const Bi={_Env:t=>t,_InErr:t=>t,_InElem:t=>t,_InDone:t=>t,_OutErr:t=>t,_OutElem:t=>t,_OutDone:t=>t};const Qi={[zi]:Bi,pipe(){return E(this,arguments)}};const Ui=t=>Dt(t,zi)||xt(t);const Wi=F(2,((t,n)=>{const e=Object.create(Qi);e._tag=Fi;e.acquire=()=>t;e.finalizer=n;return e}));const Mi=(t,n,e)=>{const s=Object.create(Qi);s._tag=Oi;s.combineInners=n;s.combineAll=e;s.onPull=()=>_i(ot());s.onEmit=()=>ui;s.value=()=>t;s.k=jt;return s};const qi=F(4,((t,n,e,s)=>{const i=Object.create(Qi);i._tag=Oi;i.combineInners=e;i.combineAll=s;i.onPull=()=>_i(ot());i.onEmit=()=>ui;i.value=()=>t;i.k=n;return i}));const Ti=F(2,((t,n)=>{const e=Object.create(Qi);e._tag=Ei;e.input=n;e.channel=t;return e}));const Vi=F(2,((t,n)=>{const e=Object.create(Qi);e._tag=vi;e.channel=t;e.finalizer=n;return e}));const Hi=t=>Ji(Ze(t));const Ji=t=>Ki((()=>t));const Ki=t=>{const n=Object.create(Qi);n._tag=ki;n.error=t;return n};const Gi=F(2,((t,n)=>{const e=Object.create(Qi);e._tag=Di;e.channel=t;e.k=new fi(n,Ji);return e}));const Zi=t=>{const n=Object.create(Qi);n._tag=xi;n.effect=()=>t;return n};const Xi=F(2,((t,n)=>{const e=Object.create(Qi);e._tag=ji;e.left=()=>t;e.right=()=>n;return e}));const Yi=t=>$i({onInput:t.onInput,onFailure:n=>Rt(ss(n),{onLeft:t.onFailure,onRight:Ji}),onDone:t.onDone});const $i=t=>{const n=Object.create(Qi);n._tag=Ai;n.more=t.onInput;n.done=new fi(t.onDone,t.onFailure);return n};const to=t=>so((()=>t));const no=t=>{const n=Object.create(Qi);n._tag=Ii;n.terminal=t;return n};const eo=t=>{const n=Object.create(Qi);n._tag=Li;n.channel=t;return n};const so=t=>{const n=Object.create(Qi);n._tag=Pi;n.evaluate=t;return n};const io=no(void 0);const oo=t=>{const n=Object.create(Qi);n._tag=Ci;n.out=t;return n};const ro="Done";const co="Emit";const uo="FromEffect";const ao="Read";const ho=Symbol.for("effect/ChannelState");const lo={_E:t=>t,_R:t=>t};const fo={[ho]:lo};const bo=()=>{const t=Object.create(fo);t._tag=ro;return t};const mo=()=>{const t=Object.create(fo);t._tag=co;return t};const po=t=>{const n=Object.create(fo);n._tag=uo;n.effect=t;return n};const yo=(t,n,e,s)=>{const i=Object.create(fo);i._tag=ao;i.upstream=t;i.onEffect=n;i.onEmit=e;i.onDone=s;return i};const So=t=>t._tag===uo;const wo=t=>So(t)?t.effect:At;const go=t=>So(t)?Pt(t.effect):undefined;const _o="PullFromChild";const Fo="PullFromUpstream";const Eo="DrainChildExecutors";const Oo="Emit";class Co{childExecutor;parentSubexecutor;onEmit;_tag=_o;constructor(t,n,e){this.childExecutor=t;this.parentSubexecutor=n;this.onEmit=e}close(t){const n=this.childExecutor.close(t);const e=this.parentSubexecutor.close(t);if(n!==undefined&&e!==undefined){return It(Lt(n),Lt(e),((t,n)=>G(t,Ee(n))))}else if(n!==undefined){return n}else if(e!==undefined){return e}else{return undefined}}enqueuePullFromChild(t){return this}}class vo{upstreamExecutor;createChild;lastDone;activeChildExecutors;combineChildResults;combineWithChildResult;onPull;onEmit;_tag=Fo;constructor(t,n,e,s,i,o,r,c){this.upstreamExecutor=t;this.createChild=n;this.lastDone=e;this.activeChildExecutors=s;this.combineChildResults=i;this.combineWithChildResult=o;this.onPull=r;this.onEmit=c}close(t){const n=this.upstreamExecutor.close(t);const e=[...this.activeChildExecutors.map((n=>n!==undefined?n.childExecutor.close(t):undefined)),n];const s=e.reduce(((t,n)=>{if(t!==undefined&&n!==undefined){return It(t,Lt(n),((t,n)=>Ee(t,n)))}else if(t!==undefined){return t}else if(n!==undefined){return Lt(n)}else{return undefined}}),undefined);return s===undefined?s:s}enqueuePullFromChild(t){return new vo(this.upstreamExecutor,this.createChild,this.lastDone,[...this.activeChildExecutors,t],this.combineChildResults,this.combineWithChildResult,this.onPull,this.onEmit)}}class ko{upstreamExecutor;lastDone;activeChildExecutors;upstreamDone;combineChildResults;combineWithChildResult;onPull;_tag=Eo;constructor(t,n,e,s,i,o,r){this.upstreamExecutor=t;this.lastDone=n;this.activeChildExecutors=e;this.upstreamDone=s;this.combineChildResults=i;this.combineWithChildResult=o;this.onPull=r}close(t){const n=this.upstreamExecutor.close(t);const e=[...this.activeChildExecutors.map((n=>n!==undefined?n.childExecutor.close(t):undefined)),n];const s=e.reduce(((t,n)=>{if(t!==undefined&&n!==undefined){return It(t,Lt(n),((t,n)=>Ee(t,n)))}else if(t!==undefined){return t}else if(n!==undefined){return Lt(n)}else{return undefined}}),undefined);return s===undefined?s:s}enqueuePullFromChild(t){return new ko(this.upstreamExecutor,this.lastDone,[...this.activeChildExecutors,t],this.upstreamDone,this.combineChildResults,this.combineWithChildResult,this.onPull)}}class Do{value;next;_tag=Oo;constructor(t,n){this.value=t;this.next=n}close(t){const n=this.next.close(t);return n===undefined?n:n}enqueuePullFromChild(t){return this}}const xo="Pulled";const jo="NoUpstream";const Ro="effect/ChannelUpstreamPullRequest";const Ao=Symbol.for(Ro);const Po={_A:t=>t};const Io={[Ao]:Po};const Lo=t=>{const n=Object.create(Io);n._tag=xo;n.value=t;return n};const No=t=>{const n=Object.create(Io);n._tag=jo;n.activeDownstreamCount=t;return n};class zo{_activeSubexecutor=undefined;_cancelled=undefined;_closeLastSubstream=undefined;_currentChannel;_done=undefined;_doneStack=[];_emitted=undefined;_executeCloseLastSubstream;_input=undefined;_inProgressFinalizer=undefined;_providedEnv;constructor(t,n,e){this._currentChannel=t;this._executeCloseLastSubstream=e;this._providedEnv=n}run(){let t=undefined;while(t===undefined){if(this._cancelled!==undefined){t=this.processCancellation()}else if(this._activeSubexecutor!==undefined){t=this.runSubexecutor()}else{try{if(this._currentChannel===undefined){t=bo()}else{if(xt(this._currentChannel)){this._currentChannel=Zi(this._currentChannel)}switch(this._currentChannel._tag){case Fi:{t=this.runBracketOut(this._currentChannel);break}case Ei:{const n=this._currentChannel.input;this._currentChannel=this._currentChannel.channel;if(this._input!==undefined){const e=this._input;this._input=undefined;const s=()=>Ut(n.awaitRead(),(()=>qt((()=>{const t=e.run();switch(t._tag){case ro:{return we(e.getDone(),{onFailure:t=>n.error(t),onSuccess:t=>n.done(t)})}case co:{return Ut(n.emit(e.getEmit()),(()=>s()))}case uo:{return Bt(t.effect,{onFailure:t=>n.error(t),onSuccess:()=>s()})}case ao:{return Uo(t,(()=>s()),(t=>n.error(t)))}}}))));t=po(Ut(Wt(Mt(s())),(t=>Nt((()=>this.addFinalizer((n=>Ut(us(t),(()=>qt((()=>{const t=this.restorePipe(n,e);return t!==undefined?t:At})))))))))))}break}case Oi:{const t=new zo(this._currentChannel.value(),this._providedEnv,(t=>Nt((()=>{const n=this._closeLastSubstream===undefined?At:this._closeLastSubstream;this._closeLastSubstream=G(n,Qt(t))}))));t._input=this._input;const n=this._currentChannel;this._activeSubexecutor=new vo(t,(t=>n.k(t)),undefined,[],((t,e)=>n.combineInners(t,e)),((t,e)=>n.combineAll(t,e)),(t=>n.onPull(t)),(t=>n.onEmit(t)));this._closeLastSubstream=undefined;this._currentChannel=undefined;break}case Ci:{this._emitted=this._currentChannel.out;this._currentChannel=this._activeSubexecutor!==undefined?undefined:io;t=mo();break}case vi:{this.runEnsuring(this._currentChannel);break}case ki:{t=this.doneHalt(this._currentChannel.error());break}case Di:{this._doneStack.push(this._currentChannel.k);this._currentChannel=this._currentChannel.channel;break}case xi:{const n=this._providedEnv===undefined?this._currentChannel.effect():G(this._currentChannel.effect(),zt(this._providedEnv));t=po(Bt(n,{onFailure:t=>{const n=this.doneHalt(t);return n!==undefined&&So(n)?n.effect:At},onSuccess:t=>{const n=this.doneSucceed(t);return n!==undefined&&So(n)?n.effect:At}}));break}case ji:{const t=this._input;const n=new zo(this._currentChannel.left(),this._providedEnv,(t=>this._executeCloseLastSubstream(t)));n._input=t;this._input=n;this.addFinalizer((n=>{const e=this.restorePipe(n,t);return e!==undefined?e:At}));this._currentChannel=this._currentChannel.right();break}case Ri:{const t=this._providedEnv;this._providedEnv=this._currentChannel.context();this._currentChannel=this._currentChannel.inner;this.addFinalizer((()=>Nt((()=>{this._providedEnv=t}))));break}case Ai:{const n=this._currentChannel;t=yo(this._input,jt,(t=>{try{this._currentChannel=n.more(t)}catch(t){this._currentChannel=n.done.onExit(me(t))}return undefined}),(t=>{const e=t=>n.done.onExit(t);this._currentChannel=e(t);return undefined}));break}case Pi:{t=this.doneSucceed(this._currentChannel.evaluate());break}case Ii:{t=this.doneSucceed(this._currentChannel.terminal);break}case Li:{this._currentChannel=this._currentChannel.channel();break}}}}catch(t){this._currentChannel=Ji(Xe(t))}}}return t}getDone(){return this._done}getEmit(){return this._emitted}cancelWith(t){this._cancelled=t}clearInProgressFinalizer(){this._inProgressFinalizer=undefined}storeInProgressFinalizer(t){this._inProgressFinalizer=t}popAllFinalizers(t){const n=[];let e=this._doneStack.pop();while(e){if(e._tag==="ContinuationFinalizer"){n.push(e.finalizer)}e=this._doneStack.pop()}const s=n.length===0?At:Qo(n,t);this.storeInProgressFinalizer(s);return s}popNextFinalizers(){const t=[];while(this._doneStack.length!==0){const n=this._doneStack[this._doneStack.length-1];if(n._tag===ai){return t}t.push(n);this._doneStack.pop()}return t}restorePipe(t,n){const e=this._input;this._input=n;if(e!==undefined){const n=e.close(t);return n}return At}close(t){let n=undefined;const e=this._inProgressFinalizer;if(e!==undefined){n=G(e,Tt(Nt((()=>this.clearInProgressFinalizer()))))}let s=undefined;const i=this.popAllFinalizers(t);if(i!==undefined){s=G(i,Tt(Nt((()=>this.clearInProgressFinalizer()))))}const o=this._activeSubexecutor===undefined?undefined:this._activeSubexecutor.close(t);if(o===undefined&&n===undefined&&s===undefined){return undefined}return G(Lt(Bo(o)),Jt(Lt(Bo(n))),Jt(Lt(Bo(s))),Ht((([[t,n],e])=>G(t,Ee(n),Ee(e)))),Vt,Ut((t=>qt((()=>t)))))}doneSucceed(t){if(this._doneStack.length===0){this._done=ge(t);this._currentChannel=undefined;return bo()}const n=this._doneStack[this._doneStack.length-1];if(n._tag===ai){this._doneStack.pop();this._currentChannel=n.onSuccess(t);return undefined}const e=this.popNextFinalizers();if(this._doneStack.length===0){this._doneStack=e.reverse();this._done=ge(t);this._currentChannel=undefined;return bo()}const s=Qo(e.map((t=>t.finalizer)),ge(t));this.storeInProgressFinalizer(s);const i=G(s,Tt(Nt((()=>this.clearInProgressFinalizer()))),Vt,Ut((()=>Nt((()=>this.doneSucceed(t))))));return po(i)}doneHalt(t){if(this._doneStack.length===0){this._done=ye(t);this._currentChannel=undefined;return bo()}const n=this._doneStack[this._doneStack.length-1];if(n._tag===ai){this._doneStack.pop();try{this._currentChannel=n.onHalt(t)}catch(t){this._currentChannel=Ji(Xe(t))}return undefined}const e=this.popNextFinalizers();if(this._doneStack.length===0){this._doneStack=e.reverse();this._done=ye(t);this._currentChannel=undefined;return bo()}const s=Qo(e.map((t=>t.finalizer)),ye(t));this.storeInProgressFinalizer(s);const i=G(s,Tt(Nt((()=>this.clearInProgressFinalizer()))),Vt,Ut((()=>Nt((()=>this.doneHalt(t))))));return po(i)}processCancellation(){this._currentChannel=undefined;this._done=this._cancelled;this._cancelled=undefined;return bo()}runBracketOut(t){const n=Vt(Bt(this.provide(t.acquire()),{onFailure:t=>Nt((()=>{this._currentChannel=Ji(t)})),onSuccess:n=>Nt((()=>{this.addFinalizer((e=>this.provide(t.finalizer(n,e))));this._currentChannel=oo(n)}))}));return po(n)}provide(t){if(this._providedEnv===undefined){return t}return G(t,zt(this._providedEnv))}runEnsuring(t){this.addFinalizer(t.finalizer);this._currentChannel=t.channel}addFinalizer(t){this._doneStack.push(new bi(t))}runSubexecutor(){const t=this._activeSubexecutor;switch(t._tag){case _o:{return this.pullFromChild(t.childExecutor,t.parentSubexecutor,t.onEmit,t)}case Fo:{return this.pullFromUpstream(t)}case Eo:{return this.drainChildExecutors(t)}case Oo:{this._emitted=t.value;this._activeSubexecutor=t.next;return mo()}}}replaceSubexecutor(t){this._currentChannel=undefined;this._activeSubexecutor=t}finishWithExit(t){const n=we(t,{onFailure:t=>this.doneHalt(t),onSuccess:t=>this.doneSucceed(t)});this._activeSubexecutor=undefined;return n===undefined?At:wo(n)}finishSubexecutorWithCloseEffect(t,...n){this.addFinalizer((()=>G(n,Kt((n=>G(Nt((()=>n(t))),Ut((t=>t!==undefined?t:At)))),{discard:true}))));const e=G(t,we({onFailure:t=>this.doneHalt(t),onSuccess:t=>this.doneSucceed(t)}));this._activeSubexecutor=undefined;return e}applyUpstreamPullStrategy(t,n,e){switch(e._tag){case mi:{const s=!t||n.some((t=>t!==undefined));return[e.emitSeparator,s?[undefined,...n]:n]}case pi:{const s=!t||n.some((t=>t!==undefined));return[e.emitSeparator,s?[...n,undefined]:n]}}}pullFromChild(t,n,e,s){return yo(t,jt,(i=>{const o=e(i);switch(o._tag){case ei:{break}case si:{this.finishWithDoneValue(t,n,o.value);break}case ii:{const t=n.enqueuePullFromChild(s);this.replaceSubexecutor(t);break}}this._activeSubexecutor=new Do(i,this._activeSubexecutor);return undefined}),we({onFailure:e=>{const s=this.handleSubexecutorFailure(t,n,e);return s===undefined?undefined:go(s)},onSuccess:e=>{this.finishWithDoneValue(t,n,e);return undefined}}))}finishWithDoneValue(t,n,e){const s=n;switch(s._tag){case Fo:{const n=new vo(s.upstreamExecutor,s.createChild,s.lastDone!==undefined?s.combineChildResults(s.lastDone,e):e,s.activeChildExecutors,s.combineChildResults,s.combineWithChildResult,s.onPull,s.onEmit);this._closeLastSubstream=t.close(ge(e));this.replaceSubexecutor(n);break}case Eo:{const n=new ko(s.upstreamExecutor,s.lastDone!==undefined?s.combineChildResults(s.lastDone,e):e,s.activeChildExecutors,s.upstreamDone,s.combineChildResults,s.combineWithChildResult,s.onPull);this._closeLastSubstream=t.close(ge(e));this.replaceSubexecutor(n);break}}}handleSubexecutorFailure(t,n,e){return this.finishSubexecutorWithCloseEffect(ye(e),(t=>n.close(t)),(n=>t.close(n)))}pullFromUpstream(t){if(t.activeChildExecutors.length===0){return this.performPullFromUpstream(t)}const n=t.activeChildExecutors[0];const e=new vo(t.upstreamExecutor,t.createChild,t.lastDone,t.activeChildExecutors.slice(1),t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit);if(n===undefined){return this.performPullFromUpstream(e)}this.replaceSubexecutor(new Co(n.childExecutor,e,n.onEmit));return undefined}performPullFromUpstream(t){return yo(t.upstreamExecutor,(t=>{const n=this._closeLastSubstream===undefined?At:this._closeLastSubstream;this._closeLastSubstream=undefined;return G(this._executeCloseLastSubstream(n),Qt(t))}),(n=>{if(this._closeLastSubstream!==undefined){const e=this._closeLastSubstream;this._closeLastSubstream=undefined;return G(this._executeCloseLastSubstream(e),Ht((()=>{const e=new zo(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);e._input=this._input;const[s,i]=this.applyUpstreamPullStrategy(false,t.activeChildExecutors,t.onPull(Lo(n)));this._activeSubexecutor=new Co(e,new vo(t.upstreamExecutor,t.createChild,t.lastDone,i,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit);if(Zt(s)){this._activeSubexecutor=new Do(s.value,this._activeSubexecutor)}return undefined})))}const e=new zo(t.createChild(n),this._providedEnv,this._executeCloseLastSubstream);e._input=this._input;const[s,i]=this.applyUpstreamPullStrategy(false,t.activeChildExecutors,t.onPull(Lo(n)));this._activeSubexecutor=new Co(e,new vo(t.upstreamExecutor,t.createChild,t.lastDone,i,t.combineChildResults,t.combineWithChildResult,t.onPull,t.onEmit),t.onEmit);if(Zt(s)){this._activeSubexecutor=new Do(s.value,this._activeSubexecutor)}return undefined}),(n=>{if(t.activeChildExecutors.some((t=>t!==undefined))){const n=new ko(t.upstreamExecutor,t.lastDone,[undefined,...t.activeChildExecutors],t.upstreamExecutor.getDone(),t.combineChildResults,t.combineWithChildResult,t.onPull);if(this._closeLastSubstream!==undefined){const t=this._closeLastSubstream;this._closeLastSubstream=undefined;return G(this._executeCloseLastSubstream(t),Ht((()=>this.replaceSubexecutor(n))))}this.replaceSubexecutor(n);return undefined}const e=this._closeLastSubstream;const s=this.finishSubexecutorWithCloseEffect(G(n,Se((n=>t.combineWithChildResult(t.lastDone,n)))),(()=>e),(n=>t.upstreamExecutor.close(n)));return s===undefined?undefined:go(s)}))}drainChildExecutors(t){if(t.activeChildExecutors.length===0){const n=this._closeLastSubstream;if(n!==undefined){this.addFinalizer((()=>Gt(n)))}return this.finishSubexecutorWithCloseEffect(t.upstreamDone,(()=>n),(n=>t.upstreamExecutor.close(n)))}const n=t.activeChildExecutors[0];const e=t.activeChildExecutors.slice(1);if(n===undefined){const[n,s]=this.applyUpstreamPullStrategy(true,e,t.onPull(No(e.reduce(((t,n)=>n!==undefined?t+1:t),0))));this.replaceSubexecutor(new ko(t.upstreamExecutor,t.lastDone,s,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull));if(Zt(n)){this._emitted=n.value;return mo()}return undefined}const s=new ko(t.upstreamExecutor,t.lastDone,e,t.upstreamDone,t.combineChildResults,t.combineWithChildResult,t.onPull);this.replaceSubexecutor(new Co(n.childExecutor,s,n.onEmit));return undefined}}const Bo=t=>t!==undefined?t:At;const Qo=(t,n)=>G(Kt(t,(t=>Lt(t(n)))),Ht((t=>G(be(t),Xt((()=>_e))))),Ut((t=>qt((()=>t)))));const Uo=(t,n,e)=>{const s=[t];const i=()=>{const t=s.pop();if(t===undefined||t.upstream===undefined){return Yt("Unexpected end of input for channel execution")}const o=t.upstream.run();switch(o._tag){case co:{const o=t.onEmit(t.upstream.getEmit());if(s.length===0){if(o===undefined){return qt(n)}return G(o,Bt({onFailure:e,onSuccess:n}))}if(o===undefined){return qt((()=>i()))}return G(o,Bt({onFailure:e,onSuccess:()=>i()}))}case ro:{const o=t.onDone(t.upstream.getDone());if(s.length===0){if(o===undefined){return qt(n)}return G(o,Bt({onFailure:e,onSuccess:n}))}if(o===undefined){return qt((()=>i()))}return G(o,Bt({onFailure:e,onSuccess:()=>i()}))}case uo:{s.push(t);return G(t.onEffect(o.effect),$t((n=>qt((()=>{const e=t.onDone(ye(n));return e===undefined?At:e})))),Bt({onFailure:e,onSuccess:()=>i()}))}case ao:{s.push(t);s.push(o);return qt((()=>i()))}}};return i()};const Wo=F(2,((t,n)=>{const e=(n,e,s)=>on(Nt((()=>new zo(t,void 0,jt))),(t=>qt((()=>Mo(t.run(),t).pipe(an(n),Qt(oe(n)),hn(oe(e)))))),((t,n)=>{const e=t.close(n);if(e===undefined){return At}return dn(e,(t=>ln(s,fn(t))))}));return tn((t=>nn([en(n,sn),ie(),ie()]).pipe(Ut((([s,i,o])=>t(e(i,o,s)).pipe(rn(n),Ut((e=>n.addFinalizer((t=>{const n=le(t)?es(t.cause):undefined;return ae(i).pipe(Ut((t=>t?he(o,void 0).pipe(Qt(rs(e)),Qt(cs(e))):he(o,void 0).pipe(Qt(n&&cn(n)>0?as(e,un(n)):us(e)),Qt(cs(e))))))})).pipe(Qt(t(oe(i))))))))))))}));const Mo=(t,n)=>{const e=t;switch(e._tag){case uo:{return G(e.effect,Ut((()=>Mo(n.run(),n))))}case co:{return Mo(n.run(),n)}case ro:{return qt((()=>n.getDone()))}case ao:{return Uo(e,(()=>Mo(n.run(),n)),fn)}}};const qo="Done";const To="Await";const Vo="effect/ChannelMergeDecision";const Ho=Symbol.for(Vo);const Jo={[Ho]:{_R:t=>t,_E0:t=>t,_Z0:t=>t,_E:t=>t,_Z:t=>t}};const Ko=t=>{const n=Object.create(Jo);n._tag=To;n.f=t;return n};const Go="BothRunning";const Zo="LeftDone";const Xo="RightDone";const Yo="effect/ChannelMergeState";const $o=Symbol.for(Yo);const tr={[$o]:$o};const nr=(t,n)=>{const e=Object.create(tr);e._tag=Go;e.left=t;e.right=n;return e};const er=t=>{const n=Object.create(tr);n._tag=Zo;n.f=t;return n};const sr=t=>{const n=Object.create(tr);n._tag=Xo;n.f=t;return n};const ir="BackPressure";const or="BufferSliding";const rr="effect/ChannelMergeStrategy";const cr=Symbol.for(rr);const ur={[cr]:cr};const ar=t=>{const n=Object.create(ur);n._tag=ir;return n};const hr=t=>{const n=Object.create(ur);n._tag=or;return n};const dr=F(2,((t,{onBackPressure:n,onBufferSliding:e})=>{switch(t._tag){case ir:{return n()}case or:{return e()}}}));const lr="Empty";const fr="Emit";const br="Error";const mr="Done";const pr=t=>({_tag:lr,notifyProducer:t});const yr=t=>({_tag:fr,notifyConsumers:t});const Sr=t=>({_tag:br,cause:t});const wr=t=>({_tag:mr,done:t});class gr{ref;constructor(t){this.ref=t}awaitRead(){return bn(Ke(this.ref,(t=>t._tag===lr?[oe(t.notifyProducer),t]:[At,t])))}get close(){return mn((t=>this.error(Ye(t))))}done(t){return bn(Ke(this.ref,(n=>{switch(n._tag){case lr:{return[oe(n.notifyProducer),n]}case fr:{return[Kt(n.notifyConsumers,(n=>he(n,yn(t))),{discard:true}),wr(t)]}case br:{return[pn,n]}case mr:{return[pn,n]}}})))}emit(t){return Ut(ie(),(n=>bn(Ke(this.ref,(e=>{switch(e._tag){case lr:{return[oe(e.notifyProducer),e]}case fr:{const s=e.notifyConsumers[0];const i=e.notifyConsumers.slice(1);if(s!==undefined){return[he(s,Sn(t)),i.length===0?pr(n):yr(i)]}throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues")}case br:{return[pn,e]}case mr:{return[pn,e]}}})))))}error(t){return bn(Ke(this.ref,(n=>{switch(n._tag){case lr:{return[oe(n.notifyProducer),n]}case fr:{return[Kt(n.notifyConsumers,(n=>ce(n,t)),{discard:true}),Sr(t)]}case br:{return[pn,n]}case mr:{return[pn,n]}}})))}get take(){return this.takeWith((t=>ye(os(t,yn))),(t=>ge(t)),(t=>pe(Sn(t))))}takeWith(t,n,e){return Ut(ie(),(s=>bn(Ke(this.ref,(i=>{switch(i._tag){case lr:{return[Qt(he(i.notifyProducer,void 0),wn(oe(s),{onFailure:t,onSuccess:Rt({onLeft:e,onRight:n})})),yr([s])]}case fr:{return[wn(oe(s),{onFailure:t,onSuccess:Rt({onLeft:e,onRight:n})}),yr([...i.notifyConsumers,s])]}case br:{return[Gt(t(i.cause)),i]}case mr:{return[Gt(e(i.done)),i]}}})))))}}const _r=()=>G(ie(),Ut((t=>He(pr(t)))),Ht((t=>new gr(t))));const Fr=F(2,((t,n)=>qi(t,n,(()=>void 0),(()=>void 0))));const Er=t=>{const n=$i({onInput:()=>n,onFailure:Ji,onDone:to});return Xi(t,n)};const Or=F(2,((t,n)=>Vi(t,(()=>n))));const Cr=t=>Gi(t,jt);const vr=t=>Mr(t.takeWith(Ji,(n=>Gi(oo(n),(()=>vr(t)))),to));const kr=()=>Yi({onInput:t=>Gi(oo(t),(()=>kr())),onFailure:Hi,onDone:no});const Dr=F(2,((t,n)=>Gi(t,(t=>so((()=>n(t)))))));const xr=F(2,((t,n)=>{const e=Yi({onInput:t=>Gi(oo(n(t)),(()=>e)),onFailure:Hi,onDone:no});return Xi(t,e)}));const jr=F(3,((t,n,e)=>Tr((s=>On((function*(){const i=yield*_r();const o=vr(i);const r=yield*Ks(e);yield*ln(s,Ys(r));const c=yield*ie();const u=e===Number.POSITIVE_INFINITY?t=>jt:(yield*Pn(e)).withPermits;const a=yield*o.pipe(Xi(t),Ur(s));yield*a.pipe(Bt({onFailure:t=>$s(r,fn(t)),onSuccess:Rt({onLeft:t=>Qt(Mt(u(e)(At)),Qn($s(r,Gt(yn(t))))),onRight:t=>On((function*(){const e=yield*ie();const i=yield*ie();yield*$s(r,Ht(oe(e),Sn));yield*he(i,void 0).pipe(Qt(tn((e=>Lt(e(oe(c))).pipe(Wn(Lt(e(n(t)))),Ut(jt)))).pipe(dn((t=>ce(c,t))),an(e))),u(1),rn(s));yield*oe(i)}))})}),Mn,Mt,rn(s));const h=Mr(wn(bn(ti(r)),{onFailure:Ji,onSuccess:Rt({onLeft:no,onRight:t=>Gi(oo(t),(()=>h))})}));return Ti(h,i)}))))));const Rr=t=>n=>Ar(t)(n,Fn);const Ar=({bufferSize:t=16,concurrency:n,mergeStrategy:e=ar()})=>(s,i)=>Tr((o=>On((function*(){const r=n==="unbounded"?Number.MAX_SAFE_INTEGER:n;const c=yield*_r();const u=vr(c);const a=yield*Ks(t);yield*ln(o,Ys(a));const h=yield*Gs();yield*ln(o,Ys(h));const d=yield*He(ot());const l=yield*ie();const f=(yield*Pn(r)).withPermits;const b=yield*Ur(Xi(u,s),o);function m(t){return t.pipe(Ut(Rt({onLeft:t=>Gt(rt(t)),onRight:t=>Nn($s(a,Gt(Sn(t))),ot())})),Bn({until:t=>Zt(t)}),Ut((t=>Ge(d,zn({onNone:()=>rt(t.value),onSome:n=>rt(i(n,t.value))})))),$t((t=>ts(t)?fn(t):$s(a,fn(t)).pipe(Qt(he(l,void 0)),Qn))))}yield*b.pipe(Bt({onFailure:t=>$s(a,fn(t)).pipe(Qt(Gt(false))),onSuccess:Rt({onLeft:t=>xn(Mt(oe(l)),Mt(f(r)(At)),{onSelfDone:(t,n)=>Nn(us(n),false),onOtherDone:(n,e)=>Qt(us(e),Je(d).pipe(Ut(zn({onNone:()=>$s(a,Gt(yn(t))),onSome:n=>$s(a,Gt(yn(i(n,t))))})),Nn(false)))}),onRight:t=>dr(e,{onBackPressure:()=>On((function*(){const n=yield*ie();const e=gn((n=>Ur(Xi(u,t),n).pipe(Ut((t=>Ln(Lt(m(t)),Lt(Mt(oe(l)))))),Ut(jt))));yield*he(n,void 0).pipe(Qt(e),f(1),rn(o));yield*oe(n);const s=yield*ae(l);return!s})),onBufferSliding:()=>On((function*(){const n=yield*ie();const e=yield*ie();const s=yield*Zs(h);yield*ti(h).pipe(Ut((t=>he(t,void 0))),In((()=>s>=r)));yield*$s(h,n);const i=gn((e=>Ur(Xi(u,t),e).pipe(Ut((t=>Lt(m(t)).pipe(Ln(Lt(Mt(oe(l)))),Ln(Lt(Mt(oe(n))))))),Ut(jt))));yield*he(e,void 0).pipe(Qt(i),f(1),rn(o));yield*oe(e);const c=yield*ae(l);return!c}))})})}),Bn({while:t=>t}),rn(o));const p=G(ti(a),bn,wn({onFailure:Ji,onSuccess:Rt({onLeft:no,onRight:t=>Gi(oo(t),(()=>p))})}),Mr);return Ti(p,c)}))));const Pr=F(3,((t,n,e)=>Rr(e)(xr(t,n))));const Ir=F(2,((t,n)=>{function e(e){return On((function*(){const s=yield*_r();const i=vr(s);const o=yield*Ur(Xi(i,t),e);const r=yield*Ur(Xi(i,n.other),e);function c(t,n,s){return(i,o,r)=>{function c(t){const e=t;if(e._tag===qo){return Gt(Zi(Qt(us(n),e.effect)))}return Ht(rs(n),we({onFailure:t=>Zi(e.f(ye(t))),onSuccess:Rt({onLeft:t=>Zi(e.f(ge(t))),onRight:t=>Kr(oo(t),u(r(e.f)))})}))}return we(t,{onFailure:t=>c(i(ye(t))),onSuccess:Rt({onLeft:t=>c(i(ge(t))),onRight:t=>Gt(Gi(oo(t),(()=>Gi(Zi(rn(Mt(s),e)),(t=>u(o(t,n)))))))})})}}function u(t){switch(t._tag){case Go:{const e=Mt(hs(t.left));const s=Mt(hs(t.right));return Mr(xn(e,s,{onSelfDone:(e,s)=>Qt(us(s),c(e,t.right,o)(n.onSelfDone,nr,(t=>er(t)))),onOtherDone:(e,s)=>Qt(us(s),c(e,t.left,r)(n.onOtherDone,((t,n)=>nr(n,t)),(t=>sr(t))))}))}case Zo:{return Mr(Ht(Lt(r),we({onFailure:n=>Zi(t.f(ye(n))),onSuccess:Rt({onLeft:n=>Zi(t.f(ge(n))),onRight:n=>Gi(oo(n),(()=>u(er(t.f))))})})))}case Xo:{return Mr(Ht(Lt(o),we({onFailure:n=>Zi(t.f(ye(n))),onSuccess:Rt({onLeft:n=>Zi(t.f(ge(n))),onRight:n=>Gi(oo(n),(()=>u(sr(t.f))))})})))}}}return Zi(Cn((t=>{const n=Cn((n=>{n.transferChildren(t.scope());return At}));const s=Mt(o).pipe(Tt(n),rn(e));const i=Mt(r).pipe(Tt(n),rn(e));return It(s,i,((t,n)=>nr(t,n)))}))).pipe(Gi(u),Ti(s))}))}return Tr(e)}));const Lr=F(2,((t,n)=>eo((()=>{let e=undefined;const s=Yi({onInput:t=>Gi(oo(t),(()=>s)),onFailure:t=>{e=Zr(t);return Ji(Xe(e))},onDone:no});const i=$i({onInput:t=>G(oo(t),Gi((()=>i))),onFailure:t=>$e(t)&&Xr(t.defect)&&Un(t.defect,e)?Hi(t.defect.error):Ji(t),onDone:no});return Xi(Xi(Xi(t,s),n),i)}))));const Nr=t=>gn((n=>Wo(t,n)));const zr=t=>Nr(Er(t));const Br=t=>Mr(tn((n=>Ht(vn(),(e=>Wi(dn(n(kn(t,e)),(t=>Dn(e,ye(t)))),((t,n)=>Dn(e,n))))))));const Qr=t=>qr(Ht(En,(n=>Gi(Zi(t(n)),oo))));const Ur=F(2,((t,n)=>Jt(Nt((()=>new zo(t,void 0,jt))),jn()).pipe(Rn((([t,e])=>An(n,(n=>{const s=t.close(n);return s!==undefined?zt(s,e):At})))),Vt,Ht((([t])=>qt((()=>Wr(t.run(),t))))))));const Wr=(t,n)=>{const e=t;switch(e._tag){case ro:{return we(n.getDone(),{onFailure:fn,onSuccess:t=>Gt(yn(t))})}case co:{return Gt(Sn(n.getEmit()))}case uo:{return G(e.effect,Ut((()=>Wr(n.run(),n))))}case ao:{return Uo(e,(()=>Wr(n.run(),n)),(t=>fn(t)))}}};const Mr=t=>Cr(Zi(t));const qr=t=>Mi(Br(t),((t,n)=>t),((t,n)=>t));const Tr=t=>Mi(Qr(t),((t,n)=>t),((t,n)=>t));const Vr=t=>Hr(0,t.length,t);const Hr=(t,n,e)=>t===n?io:G(oo(G(e,_n(t))),Gi((()=>Hr(t+1,n,e))));const Jr=F((t=>Ui(t[1])),((t,n,e)=>e?.concurrent?Ir(t,{other:n,onSelfDone:t=>Ko((n=>qt((()=>Fe(t,n))))),onOtherDone:t=>Ko((n=>qt((()=>Fe(n,t)))))}):Gi(t,(t=>Dr(n,(n=>[t,n]))))));const Kr=F((t=>Ui(t[1])),((t,n,e)=>e?.concurrent?Dr(Jr(t,n,{concurrent:true}),(t=>t[1])):Gi(t,(()=>n))));const Gr=Symbol.for("effect/Channel/ChannelException");const Zr=t=>({_tag:"ChannelException",[Gr]:Gr,error:t});const Xr=t=>Dt(t,Gr);const Yr=Symbol.for("effect/Sink");const $r={_A:t=>t,_In:t=>t,_L:t=>t,_E:t=>t,_R:t=>t};class tc{channel;[Yr]=$r;constructor(t){this.channel=t}pipe(){return E(this,arguments)}}const nc=new tc(Er(kr()));const ec=t=>new tc(Zi(t));const sc=t=>xt(t)?sc(ec(t)):t.channel;const ic="effect/Take";const oc=Symbol.for(ic);const rc={_A:t=>t,_E:t=>t};class cc{exit;[oc]=rc;constructor(t){this.exit=t}pipe(){return E(this,arguments)}}const uc=t=>new cc(ge(t));const ac=new cc(pe(ot()));const hc=t=>new cc(ye(G(t,os(rt))));const dc=t=>new cc(ge(qn(t)));const lc=()=>Tn(ot());const fc=t=>Vn(fn(t),rt);const bc="effect/Stream";const mc=Symbol.for(bc);const pc={_R:t=>t,_E:t=>t,_A:t=>t};class yc{channel;[mc]=pc;constructor(t){this.channel=t}pipe(){return E(this,arguments)}}const Sc=t=>Dt(t,mc)||xt(t);const wc=4096;const gc=F(2,((t,n)=>new yc(G(Dc(t),Or(n)))));const _c=F((t=>Sc(t[0])),((t,n,e)=>{const s=e?.bufferSize??16;if(e?.switch){return Fc(e?.concurrency,(()=>Ec(t,1,s,n)),(e=>Ec(t,e,s,n)))}return Fc(e?.concurrency,(()=>new yc(Fr(Dc(t),(t=>G(t,Jn((t=>Dc(n(t)))),Hn(io,((t,n)=>G(t,Kr(n))))))))),(s=>new yc(G(Dc(t),Fr(Vr),Pr((t=>Dc(n(t))),e)))))}));const Fc=(t,n,e)=>{switch(t){case undefined:return n();case"unbounded":return e(Number.MAX_SAFE_INTEGER);default:return t>1?e(t):n()}};const Ec=F(4,((t,n,e,s)=>new yc(G(Dc(t),Fr(Vr),Pr((t=>Dc(s(t))),{concurrency:n,mergeStrategy:hr(),bufferSize:e})))));const Oc=F((t=>Sc(t[0])),((t,n)=>_c(t,jt,n)));const Cc=t=>{const n=$i({onInput:t=>Gi(Vr(t),(()=>n)),onFailure:Ji,onDone:()=>io});return new yc(G(Dc(t),Xi(n)))};const vc=t=>{const n=(t,n)=>{const[e,s]=G(t,Gn((t=>!fe(t))));const i=G(Zn(s),zn({onNone:()=>n,onSome:we({onFailure:t=>zn(is(t),{onNone:()=>io,onSome:Ji}),onSuccess:()=>io})}));return G(oo(G(e,Xn((t=>fe(t)?rt(t.value):ot())))),Gi((()=>i)))};const e=$i({onInput:t=>n(t,e),onFailure:t=>Ji(t),onDone:()=>io});return new yc(G(Dc(t),Xi(e)))};const kc=t=>Cc(vc(G(t,Ac((t=>t.exit)))));const Dc=t=>{if("channel"in t){return t.channel}else if(xt(t)){return Dc(xc(t))}else{throw new TypeError(`Expected a Stream.`)}};const xc=t=>G(t,Vn(rt),jc);const jc=t=>new yc(Mr(Kn(t,{onFailure:zn({onNone:()=>io,onSome:Hi}),onSuccess:t=>oo(qn(t))})));const Rc=(t,n)=>G(ni(t,1,n?.maxChunkSize??wc),$t((n=>G(Xs(t),Ut((t=>t&&ts(n)?lc():fc(n)))))),Lc,n?.shutdown?gc(Ys(t)):jt);const Ac=F(2,((t,n)=>new yc(G(Dc(t),xr(Jn(n))))));const Pc=F(2,((t,n)=>{const e=t=>{const s=t.next();if(s.done){return $i({onInput:t=>e(t[Symbol.iterator]()),onFailure:Ji,onDone:to})}else{const i=s.value;return Mr(Ht(n(i),(n=>Gi(oo(qn(n)),(()=>e(t))))))}};return new yc(G(Dc(t),Xi(eo((()=>e(D()[Symbol.iterator]()))))))}));const Ic=F(3,((t,n,e)=>new yc(G(Dc(t),Fr(Vr),jr(e,n),xr(qn)))));const Lc=t=>Uc(t,(t=>G(Ht(t,(n=>rt([n,t]))),Yn(zn({onNone:()=>Gt(ot()),onSome:Tn})))));const Nc=F(2,((t,n)=>Dc(t).pipe(Lr(sc(n)),zr)));const zc=t=>Nc(t,nc);const Bc=t=>new yc(Qr((n=>t(n).pipe(Ht(qn)))));const Qc=t=>new yc(eo((()=>Dc(t()))));const Uc=(t,n)=>Qc((()=>{const e=t=>Mr(Ht(n(t),zn({onNone:()=>io,onSome:([t,n])=>Gi(oo(t),(()=>e(n)))})));return new yc(e(t))}));const Wc=t=>Oc(Bc((n=>t(n))));const Mc="effect/GroupBy";const qc=Symbol.for(Mc);const Tc={_R:t=>t,_E:t=>t,_K:t=>t,_V:t=>t};const Vc=t=>Dt(t,qc);const Hc=F((t=>Vc(t[0])),((t,n,e)=>_c(t.grouped,(([t,e])=>n(t,kc(Rc(e,{shutdown:true})))),{concurrency:"unbounded",bufferSize:e?.bufferSize??16})));const Jc=t=>({[qc]:Tc,pipe(){return E(this,arguments)},grouped:t});const Kc=F((t=>typeof t[0]!=="function"),((t,n,e)=>{if(e?.key){return Hc(Gc(t,e.key,{bufferSize:e.bufferSize}),((t,e)=>Pc(e,n)))}return Fc(e?.concurrency,(()=>Pc(t,n)),(s=>e?.unordered?_c(t,(t=>xc(n(t))),{concurrency:s}):Ic(t,s,n)))}));const Gc=F((t=>typeof t[0]!=="function"),((t,n,e)=>{const s=(t,i)=>$i({onInput:o=>Gi(Zi(Kt(Zc(o,n),(([n,s])=>{const o=t.get(n);if(o===undefined){return G(Ks(e?.bufferSize??16),Ut((e=>G(Nt((()=>{t.set(n,e)})),Qt($s(i,dc([n,e]))),Qt(G($s(e,uc(s)),$n((t=>ns(t)?rt(At):ot()))))))))}return $n($s(o,uc(s)),(t=>ns(t)?rt(At):ot()))}),{discard:true})),(()=>s(t,i))),onFailure:t=>Zi($s(i,hc(t))),onDone:()=>Zi(G(Kt(t.entries(),(([t,n])=>G($s(n,ac),$n((t=>ns(t)?rt(At):ot())))),{discard:true}),Qt($s(i,ac))))});return Jc(Wc((n=>On((function*(){const e=new Map;const i=yield*Gs();yield*ln(n,Ys(i));return yield*Dc(t).pipe(Xi(s(e,i)),Er,Wo(n),rn(n),Nn(kc(Rc(i,{shutdown:true}))))})))))}));const Zc=F(2,((t,n)=>{const e=[];const s=t[Symbol.iterator]();const i=new Map;let o;while((o=s.next())&&!o.done){const t=o.value;const s=n(t);if(i.has(s)){const n=i.get(s);n.push(t)}else{const n=[t];e.push([s,n]);i.set(s,n)}}return te(e.map((t=>[t[0],te(t[1])])))}));const Xc=Rc;const Yc=Kc;const $c=zc;const tu=class extends t{constructor(){super(false)}controllers=new Set;addController(t){this.controllers.add(t)}removeController(t){this.controllers.delete(t)}get activeControllers(){return Array.from(this.controllers).filter((t=>!t.disabled))}connectedCallback(){if(!this.controllers.size){console.warn("ReactiveControllerHost connected with no controllers registered.",this)}this.activeControllers.forEach((t=>t.hostConnected?.()))}disconnectedCallback(){this.activeControllers.forEach((t=>t.hostDisconnected?.()))}componentWillLoad(){this.activeControllers.forEach((t=>t.hostWillLoad?.()))}componentDidLoad(){this.activeControllers.forEach((t=>t.hostDidLoad?.()))}componentWillRender(){this.activeControllers.forEach((t=>t.hostWillRender?.()))}componentDidRender(){this.activeControllers.forEach((t=>t.hostDidRender?.()))}componentWillUpdate(){this.activeControllers.forEach((t=>t.hostWillUpdate?.()))}componentDidUpdate(){this.activeControllers.forEach((t=>t.hostDidUpdate?.()))}};class nu{host;config;static get globalValidationEnabled(){return n.isDev}static axe=this.globalValidationEnabled?import("./p-D1HbKFuh.js").then((function(t){return t.a})):null;static axeQueue=null;static axeStreamFiber=null;visibilityObserver;elementQueued=false;elementValidated=false;knownValidationErrors=[];get disabled(){return true}constructor(t,n){this.host=t;this.config=n;nu.initializeAxeStream()}static initializeAxeStream(){if(!this.globalValidationEnabled)return;if(this.axeStreamFiber)return;const t=On((function*(){const t=nu.axeQueue=yield*Ks(100);const n=yield*ee((()=>nu.axe));if(!n){console.error("Axe library not available, ARIA validation will not run.");return}const e=Xc(t).pipe(Yc((({context:t,onComplete:e})=>se((s=>{n.run(t,{},((t,n)=>{e(t,n);s(At)}))})))));yield*$c(e)}));this.axeStreamFiber=ne(t)}hostDidLoad(){if(this.elementQueued||this.elementValidated)return;if(!this.host.el.checkVisibility()){this.observeVisibilityOnce();return}this.enqueueValidation()}hostDidUpdate(){this.checkLazyValidation()}hostDisconnected(){this.discardVisibilityObserver()}observeVisibilityOnce(){this.visibilityObserver=new IntersectionObserver((t=>{for(const n of t){if(n.target!==this.host.el)continue;if(!n.isIntersecting)continue;this.checkLazyValidation();this.discardVisibilityObserver()}}),{root:this.host.el.parentElement,rootMargin:"0px",threshold:.01});this.visibilityObserver.observe(this.host.el)}checkLazyValidation(){if(!this.config?.reValidateOnPropChanges&&(this.elementQueued||this.elementValidated))return;this.enqueueValidation()}enqueueValidation(){return}discardVisibilityObserver(){if(!this.visibilityObserver)return;this.visibilityObserver.disconnect();this.visibilityObserver=undefined}}export{nu as A,Ie as E,tu as R,oe as _,Be as a,re as d,ue as i,Me as o,Te as p,ge as s,de as u};
2
+ //# sourceMappingURL=p-D7xthqTT.js.map