@weaverclub/render 0.0.5 → 0.0.6
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/cli/entrypoint.mjs +1 -1
- package/package.json +1 -1
package/dist/cli/entrypoint.mjs
CHANGED
|
@@ -203,7 +203,7 @@ ${i0(KQ(K,8),`
|
|
|
203
203
|
`))));case"zsh":return JD(X.command,K).pipe(h((B)=>G9(i0(B,`
|
|
204
204
|
`))))}}case"ShowWizard":{let K=Rb(X.summary)?N7:v6([x6,r0("--"),x6,X.summary]),B=k0(Y0(v6([r0("The wizard mode will assist you with constructing commands for"),x6,KG(`${X.name} (${X.version})`),r0(".")])),Y0("Please answer all prompts provided by the wizard.")),V=d4([[r0("Instructions"),B]]),W=QY(v6([KG("Wizard Mode for CLI Application:"),x6,KG(X.name),x6,KG(`(${X.version})`),K])),$=k0(W,V),_=L8($),T=J0(bW(X.command))[0],D=Ed0(Y,T,Q);return G9(_).pipe(v0(ZD(Y.command,D,Z)),h8((A)=>G9(L8(Sd0(A)))),h((A)=>AA({message:"Would you like to run the command?",initial:!0,active:"yes",inactive:"no"}).pipe(h((M)=>{let C=ZU(H,2),E=$Q(A,1),I=E0(C,E);return M?G9().pipe(v0(HD(X,I,G))):O0}))),VJ((A)=>{if(j50(A)){let M=Y0(w50(`
|
|
205
205
|
|
|
206
|
-
Quitting wizard mode...`));return G9(L8(M))}return f(A)}))}case"ShowVersion":{let K=Y0(X.version);return G9(L8(K))}}},Id0=(X)=>{let J=X,Q=D0();while(J!==void 0)switch(J._tag){case"Standard":{Q=w0(J.name),J=void 0;break}case"GetUserInput":{Q=w0(J.name),J=void 0;break}case"Map":{J=J.command;break}case"Subcommands":{J=J.parent;break}}return Q},Ed0=(X,J,Q)=>{let Y=QD(X.command),[G,Z]=FG(Q,(K)=>!yd(Y,K)),H=gX(Z,{onEmpty:()=>aZ(G,(K)=>K!=="--wizard"),onNonEmpty:(K)=>V9(G,K)});return E0(J.split(/\s+/),H)},Sd0=(X)=>{let J=O(aZ(X,(Y)=>Y.length>0),i0(" ")),Q=r0("You may now execute your command directly with the following options and arguments:");return Lb([Y0(WA(KG("Wizard Mode Complete!"))),Y0(Q),Y0($J(r0(" "),h4(J,VA)))])},bH0=(X)=>{return X&&(X==="--log-level"||X.startsWith("--log-level="))};var FB={};BQ(FB,{wizard:()=>Gu0,withSubcommands:()=>Yu0,withHandler:()=>Qu0,withDescription:()=>Ju0,transformHandler:()=>Xu0,run:()=>Zu0,provideSync:()=>ed0,provideEffectDiscard:()=>td0,provideEffect:()=>sd0,provide:()=>ad0,prompt:()=>id0,make:()=>ld0,getZshCompletions:()=>nd0,getUsage:()=>od0,getSubcommands:()=>rd0,getNames:()=>cd0,getHelp:()=>ud0,getFishCompletions:()=>fd0,getBashCompletions:()=>pd0,fromDescriptor:()=>dd0,TypeId:()=>md0});var gH0=vH0;var vd0="@effect/cli/Command",KD=Symbol.for(vd0),kd0=(X)=>{let J=[],Q=0,Y=[],G=0;function Z(K){let B={};for(let V in K)B[V]=H(K[V]);return B}function H(K){if(zY(K))return{_tag:"Array",children:U0(K,H)};else if(Vq(K))return J.push(K),{_tag:"Args",index:Q++};else if(nA(K))return Y.push(K),{_tag:"Options",index:G++};else return{_tag:"ParsedConfig",tree:Z(K)}}return{args:J,options:Y,tree:Z(X)}},mH0=(X,J,Q)=>{let Y={};for(let Z in X)Y[Z]=G(X[Z]);return Y;function G(Z){if(Z._tag==="Args")return J[Z.index];else if(Z._tag==="Options")return Q[Z.index];else if(Z._tag==="Array")return U0(Z.children,G);else return mH0(Z.tree,J,Q)}},dH0={...tH,[KD]:KD,commit(){return this.tag},pipe(){return m(this,arguments)}},xy=A0("@effect/cli/Command/registeredDescriptors",()=>new WeakMap),bd0=(X)=>xy.get(X.tag)??X.descriptor,uH0=(X,J,Q,Y=n)=>{let G=Object.create(dH0);return G.descriptor=X,G.handler=J,G.transform=Y,G.tag=Q,G},i4=(X,J)=>{let Q=Object.create(dH0);return Q.descriptor=J.descriptor??X.descriptor,Q.handler=J.handler??X.handler,Q.transform=J.transform?(Y,G)=>J.transform(X.transform(Y,G),G):X.transform,Q.tag=X.tag,Q},vy=N((X)=>FH0(X[0]),(X,J)=>{let Q=uH0(X,J??((Y)=>x_(()=>gH0(bd0(Q)))),j8(`@effect/cli/Command/(${J0(bW(X)).join("|")})`));return Q}),yd0=(X,J)=>{let{args:Q,options:Y,tree:G}=kd0(J);return GD(CH0(X,bZ(Y),vA(Q)),({args:Z,options:H})=>mH0(G,Z,H))},cH0=(X,J={},Q)=>vy(yd0(X,J),Q),pH0=(X,J)=>tA(X.descriptor,J),fH0=(X)=>bW(X.descriptor),nH0=(X,J)=>eA(X.descriptor,J),rH0=(X,J)=>XD(X.descriptor,J),oH0=(X,J)=>JD(X.descriptor,J),lH0=(X)=>QD(X.descriptor),iH0=(X)=>YD(X.descriptor),gd0=N(2,(X,J)=>i4(X,{descriptor:J(X.descriptor)})),aH0=(X,J,Q)=>uH0(GD(jH0(X,J),(Y)=>Y.value),Q,j8(`@effect/cli/Prompt/${X}`)),sH0=N(2,(X,J)=>i4(X,{handler:J,transform:n})),tH0=N(2,(X,J)=>i4(X,{transform:J})),eH0=N(2,(X,J)=>i4(X,{transform:(Q,Y)=>n5(Q,typeof J==="function"?J(Y):J)})),XK0=N(3,(X,J,Q)=>i4(X,{transform:(Y,G)=>{let Z=typeof Q==="function"?Q(G):Q;return h_(Y,J,Z)}})),JK0=N(2,(X,J)=>i4(X,{transform:(Q,Y)=>{let G=typeof J==="function"?J(Y):J;return v0(G,Q)}})),QK0=N(3,(X,J,Q)=>i4(X,{transform:(Y,G)=>{let Z=typeof Q==="function"?Q(G):Q;return UV(Y,J,Z)}})),YK0=N(2,(X,J)=>gd0(X,SH0(J))),GK0=N(2,(X,J)=>{let Q=xH0(X.descriptor,U0(J,(Z)=>[Z.tag,Z.descriptor])),Y=mX(J,new Map,(Z,H)=>{return Z.set(H.tag,H),xy.set(H.tag,H.descriptor),Z});function G(Z){if(Z.subcommand._tag==="Some"){let[H,K]=Z.subcommand.value,B=Y.get(H),V=B.transform(B.handler(K),K);return UV(V,X.tag,Z)}return X.handler(Z)}return i4(X,{descriptor:Q,handler:G})}),ZK0=N(3,(X,J,Q)=>ZD(X.descriptor,J,Q)),HK0=N(2,(X,J)=>{let Q=yH0({...J,command:X.descriptor});xy.set(X.tag,X.descriptor);let Y=(G)=>X.transform(X.handler(G),G);return(G)=>HD(Q,G,Y)});var md0=KD,dd0=vy,ud0=pH0,cd0=fH0,pd0=nH0,fd0=rH0,nd0=oH0,rd0=lH0,od0=iH0,ld0=cH0,id0=aH0,ad0=eH0,sd0=XK0,td0=JK0,ed0=QK0,Xu0=tH0,Ju0=YK0,Qu0=sH0,Yu0=GK0,Gu0=ZK0,Zu0=HK0;var WD=Symbol.for("effect/Mailbox"),ky=Symbol.for("effect/Mailbox/ReadonlyMailbox");var CB=I8(),KK0=O8(CB),BD=O8(!1),VD=O8(!0),BK0=[CB,!0];class VK0 extends $6{scheduler;capacity;strategy;[WD]=WD;[ky]=ky;state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set};messages=[];messagesChunk=I8();constructor(X,J,Q){super();this.scheduler=X,this.capacity=J,this.strategy=Q}offer(X){return Z0(()=>{if(this.state._tag!=="Open")return BD;else if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return BD;case"suspend":if(this.capacity<=0&&this.state.takers.size>0)return this.messages.push(X),this.releaseTaker(),VD;return this.offerRemainingSingle(X);case"sliding":return this.unsafeTake(),this.messages.push(X),VD}return this.messages.push(X),this.scheduleReleaseTaker(),VD})}unsafeOffer(X){if(this.state._tag!=="Open")return!1;else if(this.messages.length+this.messagesChunk.length>=this.capacity){if(this.strategy==="sliding")return this.unsafeTake(),this.messages.push(X),!0;else if(this.capacity<=0&&this.state.takers.size>0)return this.messages.push(X),this.releaseTaker(),!0;return!1}return this.messages.push(X),this.scheduleReleaseTaker(),!0}offerAll(X){return Z0(()=>{if(this.state._tag!=="Open")return x(NX(X));let J=this.unsafeOfferAllArray(X);if(J.length===0)return KK0;else if(this.strategy==="dropping")return x(h9(J));return this.offerRemainingArray(J)})}unsafeOfferAll(X){return h9(this.unsafeOfferAllArray(X))}unsafeOfferAllArray(X){if(this.state._tag!=="Open")return J0(X);else if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding"){if(this.messages.length>0)this.messagesChunk=y8(this.messagesChunk,h9(this.messages));if(this.strategy==="sliding")this.messagesChunk=this.messagesChunk.pipe(y8(NX(X)),EM(this.capacity));else if(tZ(X))this.messagesChunk=y8(this.messagesChunk,X);else this.messages=J0(X);return this.scheduleReleaseTaker(),[]}let J=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(J===0)return J0(X);let Q=[],Y=0;for(let G of X){if(Y<J)this.messages.push(G);else Q.push(G);Y++}return this.scheduleReleaseTaker(),Q}fail(X){return this.done(pG(X))}failCause(X){return this.done(N8(X))}unsafeDone(X){if(this.state._tag!=="Open")return!1;else if(this.state.offers.size===0&&this.messages.length===0&&this.messagesChunk.length===0)return this.finalize(X),!0;return this.state={...this.state,_tag:"Closing",exit:X},!0}shutdown=k(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=CB;let X=this.state.offers;if(this.finalize(this.state._tag==="Open"?F9:this.state.exit),X.size>0){for(let J of X)if(J._tag==="Single")J.resume(BD);else J.resume(O8(h9(J.remaining.slice(J.offset))));X.clear()}return!0});done(X){return k(()=>this.unsafeDone(X))}end=this.done(F9);clear=Z0(()=>{if(this.state._tag==="Done")return I3(this.state.exit,CB);let X=this.unsafeTakeAll();return this.releaseCapacity(),x(X)});takeAll=Z0(()=>{if(this.state._tag==="Done")return I3(this.state.exit,BK0);let X=this.unsafeTakeAll();if(X.length===0)return Q8(this.awaitTake,this.takeAll);return x([X,this.releaseCapacity()])});takeN(X){return Z0(()=>{if(this.state._tag==="Done")return I3(this.state.exit,BK0);else if(X<=0)return x([CB,!1]);X=Math.min(X,this.capacity);let J;if(X<=this.messagesChunk.length)J=Y3(this.messagesChunk,X),this.messagesChunk=_Q(this.messagesChunk,X);else if(X<=this.messages.length+this.messagesChunk.length)this.messagesChunk=y8(this.messagesChunk,h9(this.messages)),this.messages=[],J=Y3(this.messagesChunk,X),this.messagesChunk=_Q(this.messagesChunk,X);else return Q8(this.awaitTake,this.takeN(X));return x([J,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return Cz(this.state.exit,pG(new Tl));let X;if(this.messagesChunk.length>0)X=NU(this.messagesChunk),this.messagesChunk=_Q(this.messagesChunk,1);else if(this.messages.length>0)X=this.messages[0],this.messagesChunk=_Q(h9(this.messages),1),this.messages=[];else if(this.capacity<=0&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,this.messages.length>0?O8(this.messages.pop()):void 0;else return;return this.releaseCapacity(),O8(X)}take=Z0(()=>this.unsafeTake()??Q8(this.awaitTake,this.take));await=LY((X)=>{if(this.state._tag==="Done")return X(this.state.exit);return this.state.awaiters.add(X),k(()=>{if(this.state._tag!=="Done")this.state.awaiters.delete(X)})});unsafeSize(){let X=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?L():R(X)}size=k(()=>this.unsafeSize());commit(){return this.takeAll}pipe(){return m(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return J8(this)}[I0](){return J8(this)}offerRemainingSingle(X){return LY((J)=>{if(this.state._tag!=="Open")return J(BD);let Q={_tag:"Single",message:X,resume:J};return this.state.offers.add(Q),k(()=>{if(this.state._tag==="Open")this.state.offers.delete(Q)})})}offerRemainingArray(X){return LY((J)=>{if(this.state._tag!=="Open")return J(O8(h9(X)));let Q={_tag:"Array",remaining:X,offset:0,resume:J};return this.state.offers.add(Q),k(()=>{if(this.state._tag==="Open")this.state.offers.delete(Q)})})}releaseCapacity(){if(this.state._tag==="Done")return this.state.exit._tag==="Success";else if(this.state.offers.size===0){if(this.state._tag==="Closing"&&this.messages.length===0&&this.messagesChunk.length===0)return this.finalize(this.state.exit),this.state.exit._tag==="Success";return!1}let X=this.capacity-this.messages.length-this.messagesChunk.length;for(let J of this.state.offers)if(X===0)return!1;else if(J._tag==="Single")this.messages.push(J.message),X--,J.resume(VD),this.state.offers.delete(J);else{for(;J.offset<J.remaining.length;J.offset++){if(X===0)return!1;this.messages.push(J.remaining[J.offset]),X--}J.resume(KK0),this.state.offers.delete(J)}return!1}awaitTake=LY((X)=>{if(this.state._tag==="Done")return X(this.state.exit);return this.state.takers.add(X),k(()=>{if(this.state._tag!=="Done")this.state.takers.delete(X)})});scheduleRunning=!1;scheduleReleaseTaker(){if(this.scheduleRunning)return;this.scheduleRunning=!0,this.scheduler.scheduleTask(this.releaseTaker,0)}releaseTaker=()=>{if(this.scheduleRunning=!1,this.state._tag==="Done")return;else if(this.state.takers.size===0)return;for(let X of this.state.takers)if(this.state.takers.delete(X),X(F9),this.messages.length+this.messagesChunk.length===0)break};unsafeTakeAll(){if(this.messagesChunk.length>0){let X=this.messages.length>0?y8(this.messagesChunk,h9(this.messages)):this.messagesChunk;return this.messagesChunk=CB,this.messages=[],X}else if(this.messages.length>0){let X=h9(this.messages);return this.messages=[],X}else if(this.state._tag!=="Done"&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,K8(this.messages.pop());return CB}finalize(X){if(this.state._tag==="Done")return;let J=this.state;this.state={_tag:"Done",exit:X};for(let Q of J.takers)Q(X);J.takers.clear();for(let Q of J.awaiters)Q(X);J.awaiters.clear()}}var WK0=(X)=>u0((J)=>x(new VK0(J.currentScheduler,typeof X==="number"?X:X?.capacity??Number.POSITIVE_INFINITY,typeof X==="number"?"suspend":X?.strategy??"suspend")));var UK0=(X)=>{let J=t0(X.takeAll,([Q,Y])=>Y?Q.length===0?NJ:_8(Q):$Z(_8(Q),J));return J};var Ku0=WD;var NK0=(X)=>i(X,Ku0);var UD=WK0;var qK0=UK0;var yy=Symbol.for("effect/FiberSet"),Bu0=(X)=>i(X,yy),Vu0={[yy]:yy,[Symbol.iterator](){if(this.state._tag==="Closed")return mh();return this.state.backing[Symbol.iterator]()},toString(){return J8(this.toJSON())},toJSON(){return{_id:"FiberMap",state:this.state}},[I0](){return this.toJSON()},pipe(){return m(this,arguments)}},Wu0=(X,J)=>{let Q=Object.create(Vu0);return Q.state={_tag:"Open",backing:X},Q.deferred=J,Q},$K0=()=>IX(e(a8(),(X)=>Wu0(new Set,X)),(X)=>f5((J)=>{let Q=X.state;if(Q._tag==="Closed")return O0;X.state={_tag:"Closed"};let Y=Q.backing;return Ri(Y,$3(J.id(),OK0)).pipe(NV(X.deferred))}));var zK0=-1,OK0=vd(zK0,0),Uu0=wl(void 0,{emptyCase:TX,failCase:TX,dieCase:TX,interruptCase:(X,J)=>U3(DU(J),zK0),sequentialCase:(X,J,Q)=>J||Q,parallelCase:(X,J,Q)=>J||Q}),_K0=N((X)=>Bu0(X[0]),(X,J,Q)=>{if(X.state._tag==="Closed"){J.unsafeInterruptAsFork($3(Q?.interruptAs??cX,OK0));return}else if(X.state.backing.has(J))return;X.state.backing.add(J),J.addObserver((Y)=>{if(X.state._tag==="Closed")return;if(X.state.backing.delete(J),d7(Y)&&(Q?.propagateInterruption===!0?!Uu0(Y.cause):!g2(Y.cause)))cY(X.deferred,Y)})});var wK0=(X)=>B8(X.deferred);class ND extends $$("@effect/platform/Transferable/Collector")(){}var PK0=()=>{let X=[],J=(G)=>{X.push(...G)},Q=()=>X,Y=()=>{let G=X;return X=[],G};return ND.of({unsafeAddAll:J,addAll:(G)=>x0(()=>J(G)),unsafeRead:Q,read:x0(Q),unsafeClear:Y,clear:x0(Y)})};var DK0=Symbol.for("@effect/platform/WorkerError");var MK0=DK0;class jB extends lV()("WorkerError",{reason:w8("spawn","decode","send","unknown","encode"),cause:eY}){[MK0]=MK0;static Cause=qv({error:this,defect:eY});static encodeCause=qw(this.Cause);static decodeCause=Nw(this.Cause);get message(){switch(this.reason){case"send":return"An error occurred calling .postMessage";case"spawn":return"An error occurred while spawning a worker";case"decode":return"An error occurred during decoding";case"encode":return"An error occurred during encoding";case"unknown":return"An unexpected error occurred"}}}var gy=Symbol.for("@effect/platform/Worker/PlatformWorker"),qD=j8("@effect/platform/Worker/PlatformWorker"),hy=Symbol.for("@effect/platform/Worker/WorkerManager"),my=j8("@effect/platform/Worker/WorkerManager"),RK0=j8("@effect/platform/Worker/Spawner"),LK0=c0(function*(){let X=yield*qD,J=0;return my.of({[hy]:hy,spawn({encode:Q,initialMessage:Y}){return c0(function*(){let G=J++,Z=0,H=new Map,K=PK0(),B=Q?(M)=>v0(K.clear,UV(Q(M),ND,K)):S,V=yield*a8(),W=yield*X.spawn(G);yield*W.run((M)=>{if(M[0]===0)return R_(V,O0);return $(M[1])}).pipe(V1((M)=>q9(H.values(),(C)=>(u5 in C)?uY(C,M):C.failCause(M))),GZ(lj),uj(i00(1000)),aj({package:"@effect/platform",module:"Worker"}),lX,WV),yield*B1(()=>v0(q9(H.values(),(M)=>(u5 in M)?H1(M):M.end,{discard:!0}),x0(()=>H.clear())));let $=(M)=>m0(()=>{let C=H.get(M[0]);if(!C)return O0;switch(M[1]){case 0:return u5 in C?rX(C,M[2][0]):C.offerAll(M[2]);case 1:{if(M.length===2)return u5 in C?H1(C):C.end;return u5 in C?rX(C,M[2][0]):v0(C.offerAll(M[2]),C.end)}case 2:case 3:{if(M[1]===2)return u5 in C?jj(C,M[2]):C.fail(M[2]);let E=jB.decodeCause(M[2]);return u5 in C?uY(C,E):C.failCause(E)}}}),_=(M,C)=>f5((E)=>{let I=E.getFiberRef(Re),b=mJ(I,np).pipe(qY((d)=>d._tag==="Span")),g=Z++;return C.pipe(h8((d)=>{return H.set(g,d),B(M).pipe(h8((t)=>W.send([g,0,t,b._tag==="Some"?[b.value.traceId,b.value.spanId,b.value.sampled]:void 0],K.unsafeRead())),pY((t)=>NK0(d)?d.failCause(t):uY(d,t)))}),e((d)=>({id:g,mailbox:d})))}),T=({id:M},C)=>{let E=x0(()=>H.delete(M));return d7(C)?v0(u9(W.send([M,1])),E):E},D=(M)=>bV(P80(_(M,UD()),({mailbox:C})=>qK0(C),T)),A=(M)=>VV(_(M,a8()),({mailbox:C})=>B8(C),T);if(yield*B8(V),Y)yield*x0(Y).pipe(h(A),HX((M)=>new jB({reason:"spawn",cause:M})));return{id:G,execute:D,executeEffect:A}})}})}),FK0=MV(my,LK0);var CK0=()=>(X)=>qD.of({[gy]:gy,spawn(J){return c0(function*(){let Q=yield*RK0,Y,G=[];return{run:(K)=>MK((B)=>c0(function*(){let V=yield*W1,W=yield*X.setup({worker:Q(J),scope:V});Y=W,yield*hY(V,x0(()=>{Y=void 0}));let $=(yield*HZ()).pipe(l00(vm(ol))),_=yield*$K0(),T=oE($);if(yield*X.listen({port:W,scope:V,emit(D){_K0(_,T(K(D)))},deferred:_.deferred}),G.length>0){for(let[D,A]of G)W.postMessage([0,D],A);G.length=0}return yield*B(wK0(_))}).pipe(Q7)),send:(K,B)=>f7({try:()=>{if(Y===void 0)G.push([K,B]);else Y.postMessage([0,K],B)},catch:(V)=>new jB({reason:"send",cause:V})})}})}});var jK0=CK0,IK0=qD;var EK0=FK0;var gZ={};BQ(gZ,{layer:()=>zc0});var dy=Symbol.for("@effect/platform/CommandExecutor"),xK0=Symbol.for("@effect/platform/Process"),vK0=b1(),kK0=b1(),bK0=j8("@effect/platform/CommandExecutor"),yK0=(X)=>{let J=(Y)=>W4(e(X(Y),(G)=>G.stdout)),Q=(Y,G)=>{let Z=new TextDecoder(G);return v80(S80(J(Y),_H((H)=>Z.decode(H))))};return{[dy]:dy,start:X,exitCode:(Y)=>Q7(h(X(Y),(G)=>G.exitCode)),stream:J,string:(Y,G="utf-8")=>{let Z=new TextDecoder(G);return O(X(Y),h((H)=>VT(H.stdout,zu0)),e((H)=>Z.decode(H)),Q7)},lines:(Y,G="utf-8")=>{return O(Q(Y,G),x80,e(ym))},streamLines:Q}},zu0=L80(new Uint8Array,(X,J)=>qU(J,X,(Q,Y)=>{let G=new Uint8Array(Q.length+Y.length);return G.set(Q),G.set(Y,Q.length),G}));var uy=Symbol.for("@effect/platform/Command");var gK0=(X)=>Array.from(cy(X)),cy=(X)=>{switch(X._tag){case"StandardCommand":return K8(X);case"PipedCommand":return y8(cy(X.left),cy(X.right))}};var hK0={[uy]:uy,pipe(){return m(this,arguments)},...kq},_u0={...hK0,_tag:"StandardCommand",toJSON(){return{_id:"@effect/platform/Command",_tag:this._tag,command:this.command,args:this.args,env:Object.fromEntries(this.env),cwd:this.cwd.toJSON(),shell:this.shell,gid:this.gid.toJSON(),uid:this.uid.toJSON()}}},wu0=(X)=>Object.assign(Object.create(_u0),X),Tu0={...hK0,_tag:"PipedCommand",toJSON(){return{_id:"@effect/platform/Command",_tag:this._tag,left:this.left.toJSON(),right:this.right.toJSON()}}},Pu0=(X)=>Object.assign(Object.create(Tu0),X);var py=N(2,(X,J)=>{switch(X._tag){case"StandardCommand":return wu0({...X,stdin:J});case"PipedCommand":return Pu0({...X,left:py(X.left,J)})}});var fy=gK0;var ny=py;var dK0=bK0,ry=xK0,uK0=vK0,cK0=kK0,pK0=yK0;import*as $D from"child_process";var c8=(X,J)=>(Q,[Y])=>{let G="Unknown";switch(Q.code){case"ENOENT":G="NotFound";break;case"EACCES":G="PermissionDenied";break;case"EEXIST":G="AlreadyExists";break;case"EISDIR":G="BadResource";break;case"ENOTDIR":G="BadResource";break;case"EBUSY":G="Busy";break;case"ELOOP":G="BadResource";break}return new M4({reason:G,module:X,method:J,pathOrDescriptor:Y,syscall:Q.syscall,description:Q.message,cause:Q})};var oy=(X,J,Q)=>bV(Du0(X,J,Q));var Du0=(X,J,Q)=>ZS(()=>Ru0(X(),J,B6(void 0),Q)),nK0=(X,J,{encoding:Q,endOnDone:Y=!0}={},G=O0)=>{let Z=Mu0(X,Q),H=Y?oJ((K)=>{if("closed"in X&&X.closed)K(O0);else X.once("finish",()=>K(O0)),X.end()}):O0;return{awaitRead:()=>O0,emit:Z,error:(K)=>v0(H,J(K)),done:(K)=>v0(H,G)}},Mu0=(X,J)=>(Q)=>Q.length===0?O0:oJ((Y)=>{let G=Q[Symbol.iterator](),Z=G.next();function H(){let K=Z;Z=G.next();let B=X.write(K.value,J);if(Z.done)Y(O0);else if(B)H();else X.once("drain",H)}H()}),Ru0=(X,J,Q,Y)=>{if(!X.readable)return s1;let G=p_(!1);function Z(){G.unsafeOpen()}function H(W){Q.current=k5(J(W)),G.unsafeOpen()}function K(){Q.current=yY,G.unsafeOpen()}X.on("readable",Z),X.on("error",H),X.on("end",K);let B=Y?.chunkSize?Number(Y.chunkSize):void 0,V=ZS(function W(){let $=X.read(B);if($===null){if(Q.current)return D80(Q.current);return G.unsafeClose(),V4(G.await,W)}let _=[$];while(!0){if($=X.read(B),$===null)return V4(BT(h9(_)),W);_.push($)}});return A80(V,x0(()=>{if(X.off("readable",Z),X.off("error",H),X.off("end",K),Y?.closeOnDone!==!1&&"closed"in X&&!X.closed)X.destroy()}))};var rK0=(X,J,Q)=>C80(Lu0(X,J,Q)),Lu0=(X,J,Q)=>V4(A6(x0(()=>X()),a8()),([Y,G])=>GS(Fu0(Y,G,J),nK0(Y,(Z)=>uY(G,Z),Q,R_(G,O0)))),Fu0=(X,J,Q)=>m0(()=>{function Y(G){cY(J,f(Q(G)))}return X.on("error",Y),P6(B8(J),x0(()=>{X.removeListener("error",Y)}))});var Cu0=(X)=>typeof X==="string"?X:"pipe",oK0=(X)=>typeof X==="string"?X:"pipe",wq=(X)=>X instanceof globalThis.Error?X:new globalThis.Error(String(X)),a4=(X,J,Q)=>{let Y=fy(Q).reduce((G,Z)=>{let H=`${Z.command} ${Z.args.join(" ")}`;return G.length===0?H:`${G} | ${H}`},"");return c8("Command",X)(J,[Y])},ju0={[ry]:ry,...kq,toJSON(){return{_id:"@effect/platform/CommandExecutor/Process",pid:this.pid}}},Tq=(X)=>(J)=>{switch(J._tag){case"StandardCommand":{let Q=h(a8(),(Z)=>oJ((H)=>{let K=$D.spawn(J.command,J.args,{stdio:[Cu0(J.stdin),oK0(J.stdout),oK0(J.stderr)],cwd:z0(J.cwd,kB),shell:J.shell,env:{...process.env,...Object.fromEntries(J.env)},detached:process.platform!=="win32"});return K.on("error",(B)=>{H(f(a4("spawn",B,J)))}),K.on("exit",(...B)=>{cY(Z,S(B))}),K.on("spawn",()=>{H(S([K,Z]))}),x0(()=>{K.kill("SIGTERM")})})),Y=process.platform==="win32"?(Z,H)=>oJ((K)=>{$D.exec(`taskkill /pid ${Z.pid} /T /F`,(B)=>{if(B)K(f(a4("kill",wq(B),J)));else K(O0)})}):(Z,H)=>f7({try:()=>process.kill(-Z.pid,H),catch:(K)=>a4("kill",wq(K),J)}),G=(Z,H)=>m0(()=>Z.kill(H)?O0:f(a4("kill",new globalThis.Error("Failed to kill process"),J)));return O(Q0(J.cwd,{onNone:()=>O0,onSome:(Z)=>X.access(Z)}),v0(IX(Q,([Z,H])=>h(c5(H),(K)=>{if(!K)return Y(Z,"SIGTERM").pipe(ZZ(()=>G(Z,"SIGTERM")),v0(B8(H)),BV);return h(B8(H),([B])=>{if(B!==0&&B!==null)return Y(Z,"SIGTERM").pipe(BV);return O0})}))),e(([Z,H])=>{let K=M80;if(Z.stdin!==null)K=rK0(()=>Z.stdin,(D)=>a4("toWritable",wq(D),J));let B=h(B8(H),([D,A])=>{if(D!==null)return S(uK0(D));return f(a4("exitCode",new globalThis.Error(`Process interrupted due to receipt of signal: ${A}`),J))}),V=pj(c5(H)),W=(D="SIGTERM")=>Y(Z,D).pipe(ZZ(()=>G(Z,D)),v0(T6(B8(H)))),$=cK0(Z.pid),_=oy(()=>Z.stderr,(D)=>a4("fromReadable(stderr)",wq(D),J)),T=oy(()=>Z.stdout,(D)=>a4("fromReadable(stdout)",wq(D),J));if(typeof J.stdout!=="string")T=k80(T,J.stdout);return Object.assign(Object.create(ju0),{pid:$,exitCode:B,isRunning:V,kill:W,stdin:K,stderr:_,stdout:T})}),typeof J.stdin==="string"?n:h8((Z)=>RK(VT(J.stdin,Z.stdin))))}case"PipedCommand":{let Q=fy(J);if(Q.length===1)return O(Q[0],Tq(X));let Y=Q[0],G=Q.slice(1),Z=G.slice(0,G.length-1),H=G[G.length-1],K=Z.reduce((B,V)=>O(ny(V,B),Tq(X),e((W)=>W.stdout),W4),O(Tq(X)(Y),e((B)=>B.stdout),W4));return O(ny(H,K),Tq(X))}}},lK0=MV(dK0,O(C6,e((X)=>pK0(Tq(X)))));var iK0=lK0;var aK0=iK0;var tK0=(X,J,Q)=>(...Y)=>oJ((G)=>{try{X(...Y,(Z,H)=>{if(Z)G(f(J?J(Z,Y):Z));else G(S(H))})}catch(Z){G(Q?f(Q(Z,Y)):oX(Z))}});var x9=tK0;import*as eK0 from"crypto";import*as b0 from"fs";import*as XB0 from"os";import*as yW from"path";var _9=(X)=>(J)=>new tJ({module:"FileSystem",method:X,cause:J}),vu0=(()=>{let X=x9(b0.access,c8("FileSystem","access"),_9("access"));return(J,Q)=>{let Y=b0.constants.F_OK;if(Q?.readable)Y|=b0.constants.R_OK;if(Q?.writable)Y|=b0.constants.W_OK;return X(J,Y)}})(),ku0=(()=>{let X=x9(b0.cp,c8("FileSystem","copy"),_9("copy"));return(J,Q,Y)=>X(J,Q,{force:Y?.overwrite??!1,preserveTimestamps:Y?.preserveTimestamps??!1,recursive:!0})})(),bu0=(()=>{let X=x9(b0.copyFile,c8("FileSystem","copyFile"),_9("copyFile"));return(J,Q)=>X(J,Q)})(),yu0=(()=>{let X=x9(b0.chmod,c8("FileSystem","chmod"),_9("chmod"));return(J,Q)=>X(J,Q)})(),gu0=(()=>{let X=x9(b0.chown,c8("FileSystem","chown"),_9("chown"));return(J,Q,Y)=>X(J,Q,Y)})(),hu0=(()=>{let X=x9(b0.link,c8("FileSystem","link"),_9("link"));return(J,Q)=>X(J,Q)})(),mu0=(()=>{let X=x9(b0.mkdir,c8("FileSystem","makeDirectory"),_9("makeDirectory"));return(J,Q)=>X(J,{recursive:Q?.recursive??!1,mode:Q?.mode})})(),ly=(X)=>{let J=x9(b0.mkdtemp,c8("FileSystem",X),_9(X));return(Q)=>m0(()=>{let Y=Q?.prefix??"",G=typeof Q?.directory==="string"?yW.join(Q.directory,"."):XB0.tmpdir();return J(Y?yW.join(G,Y):G+"/")})},du0=ly("makeTempDirectory"),iy=(X)=>{let J=x9(b0.rm,c8("FileSystem",X),_9(X));return(Q,Y)=>J(Q,{recursive:Y?.recursive??!1,force:Y?.force??!1})},uu0=iy("remove"),cu0=(()=>{let X=ly("makeTempDirectoryScoped"),J=iy("makeTempDirectoryScoped");return(Q)=>IX(X(Q),(Y)=>u9(J(Y,{recursive:!0})))})(),JB0=(X)=>{let J=x9(b0.open,c8("FileSystem",X),_9(X)),Q=x9(b0.close,c8("FileSystem",X),_9(X));return(Y,G)=>O(IX(J(Y,G?.flag??"r",G?.mode),(Z)=>u9(Q(Z))),e((Z)=>fu0(wv(Z),G?.flag?.startsWith("a")??!1)))},pu0=JB0("open"),fu0=(()=>{let X=(W)=>x9(b0.read,c8("FileSystem",W),_9(W)),J=X("read"),Q=X("readAlloc"),Y=x9(b0.fstat,c8("FileSystem","stat"),_9("stat")),G=x9(b0.ftruncate,c8("FileSystem","truncate"),_9("truncate")),Z=x9(b0.fsync,c8("FileSystem","sync"),_9("sync")),H=(W)=>x9(b0.write,c8("FileSystem",W),_9(W)),K=H("write"),B=H("writeAll");class V{fd;append;[iV];semaphore=sj(1);position=0n;constructor(W,$){this.fd=W,this.append=$,this[iV]=iV}get stat(){return e(Y(this.fd),YB0)}get sync(){return Z(this.fd)}seek(W,$){let _=tK(W);return this.semaphore.withPermits(1)(x0(()=>{if($==="start")this.position=_;else if($==="current")this.position=this.position+_;return this.position}))}read(W){return this.semaphore.withPermits(1)(e(m0(()=>J(this.fd,{buffer:W,position:this.position})),($)=>{let _=tK($);return this.position=this.position+_,_}))}readAlloc(W){let $=Number(W);return this.semaphore.withPermits(1)(h(x0(()=>Buffer.allocUnsafeSlow($)),(_)=>e(Q(this.fd,{buffer:_,position:this.position}),(T)=>{if(T===0)return L();if(this.position=this.position+BigInt(T),T===$)return R(_);let D=Buffer.allocUnsafeSlow(T);return _.copy(D,0,0,T),R(D)})))}truncate(W){return this.semaphore.withPermits(1)(e(G(this.fd,W?Number(W):void 0),()=>{if(!this.append){let $=BigInt(W??0);if(this.position>$)this.position=$}}))}write(W){return this.semaphore.withPermits(1)(e(m0(()=>K(this.fd,W,void 0,void 0,this.append?void 0:Number(this.position))),($)=>{let _=tK($);if(!this.append)this.position=this.position+_;return _}))}writeAllChunk(W){return h(m0(()=>B(this.fd,W,void 0,void 0,this.append?void 0:Number(this.position))),($)=>{if($===0)return f(new M4({module:"FileSystem",method:"writeAll",reason:"WriteZero",pathOrDescriptor:this.fd,description:"write returned 0 bytes written"}));if(!this.append)this.position=this.position+BigInt($);return $<W.length?this.writeAllChunk(W.subarray($)):O0})}writeAll(W){return this.semaphore.withPermits(1)(this.writeAllChunk(W))}}return(W,$)=>new V(W,$)})(),QB0=(X)=>{let J=ly(X),Q=JB0(X),Y=(G)=>x0(()=>eK0.randomBytes(G).toString("hex"));return(G)=>O(A6(J(G),Y(6)),e(([Z,H])=>yW.join(Z,H+(G?.suffix??""))),h8((Z)=>Q7(Q(Z,{flag:"w+"}))))},nu0=QB0("makeTempFile"),ru0=(()=>{let X=QB0("makeTempFileScoped"),J=iy("makeTempFileScoped");return(Q)=>IX(X(Q),(Y)=>u9(J(yW.dirname(Y),{recursive:!0})))})(),ou0=(X,J)=>b_({try:()=>b0.promises.readdir(X,J),catch:(Q)=>c8("FileSystem","readDirectory")(Q,[X])}),lu0=(X)=>oJ((J,Q)=>{try{b0.readFile(X,{signal:Q},(Y,G)=>{if(Y)J(f(c8("FileSystem","readFile")(Y,[X])));else J(S(G))})}catch(Y){J(f(_9("readFile")(Y)))}}),iu0=(()=>{let X=x9(b0.readlink,c8("FileSystem","readLink"),_9("readLink"));return(J)=>X(J)})(),au0=(()=>{let X=x9(b0.realpath,c8("FileSystem","realPath"),_9("realPath"));return(J)=>X(J)})(),su0=(()=>{let X=x9(b0.rename,c8("FileSystem","rename"),_9("rename"));return(J,Q)=>X(J,Q)})(),YB0=(X)=>({type:X.isFile()?"File":X.isDirectory()?"Directory":X.isSymbolicLink()?"SymbolicLink":X.isBlockDevice()?"BlockDevice":X.isCharacterDevice()?"CharacterDevice":X.isFIFO()?"FIFO":X.isSocket()?"Socket":"Unknown",mtime:Z8(X.mtime),atime:Z8(X.atime),birthtime:Z8(X.birthtime),dev:X.dev,rdev:Z8(X.rdev),ino:Z8(X.ino),mode:X.mode,nlink:Z8(X.nlink),uid:Z8(X.uid),gid:Z8(X.gid),size:tK(X.size),blksize:W8(Z8(X.blksize),tK),blocks:Z8(X.blocks)}),ay=(()=>{let X=x9(b0.stat,c8("FileSystem","stat"),_9("stat"));return(J)=>e(X(J),YB0)})(),tu0=(()=>{let X=x9(b0.symlink,c8("FileSystem","symlink"),_9("symlink"));return(J,Q)=>X(J,Q)})(),eu0=(()=>{let X=x9(b0.truncate,c8("FileSystem","truncate"),_9("truncate"));return(J,Q)=>X(J,Q!==void 0?Number(Q):void 0)})(),Xc0=(()=>{let X=x9(b0.utimes,c8("FileSystem","utime"),_9("utime"));return(J,Q,Y)=>X(J,Q,Y)})(),Jc0=(X,J)=>I80((Q)=>IX(x0(()=>{let Y=b0.watch(X,{recursive:J?.recursive},(G,Z)=>{if(!Z)return;switch(G){case"rename":{Q.fromEffect(C9(ay(Z),{onSuccess:(H)=>S(Tv({path:Z})),onFailure:(H)=>H._tag==="SystemError"&&H.reason==="NotFound"?S(Av({path:Z})):f(H)}));return}case"change":{Q.single(Pv({path:Z}));return}}});return Y.on("error",(G)=>{Q.fail(new M4({module:"FileSystem",reason:"Unknown",method:"watch",pathOrDescriptor:X,cause:G}))}),Y.on("close",()=>{Q.end()}),Y}),(Y)=>x0(()=>Y.close()))),Qc0=(X,J,Q)=>ay(J).pipe(e((Y)=>X.pipe(l8((G)=>G.register(J,Y,Q)),z0(()=>Jc0(J,Q)))),b80),Yc0=(X,J,Q)=>oJ((Y,G)=>{try{b0.writeFile(X,J,{signal:G,flag:Q?.flag,mode:Q?.mode},(Z)=>{if(Z)Y(f(c8("FileSystem","writeFile")(Z,[X])));else Y(O0)})}catch(Z){Y(f(_9("writeFile")(Z)))}}),Gc0=e(m_(tT),(X)=>_v({access:vu0,chmod:yu0,chown:gu0,copy:ku0,copyFile:bu0,link:hu0,makeDirectory:mu0,makeTempDirectory:du0,makeTempDirectoryScoped:cu0,makeTempFile:nu0,makeTempFileScoped:ru0,open:pu0,readDirectory:ou0,readFile:lu0,readLink:iu0,realPath:au0,remove:uu0,rename:su0,stat:ay,symlink:tu0,truncate:eu0,utimes:Xc0,watch(J,Q){return Qc0(X,J,Q)},writeFile:Yc0})),GB0=MV(C6,Gc0);var ZB0=GB0;var HB0=ZB0;import*as Pq from"path";import*as zD from"url";var sy=(X)=>f7({try:()=>zD.fileURLToPath(X),catch:(J)=>new tJ({module:"Path",method:"fromFileUrl",description:`Invalid file URL: ${X}`,cause:J})}),ty=(X)=>f7({try:()=>zD.pathToFileURL(X),catch:(J)=>new tJ({module:"Path",method:"toFileUrl",description:`Invalid path: ${X}`,cause:J})}),Kc0=fQ(k6,k6.of({[u4]:u4,...Pq.posix,fromFileUrl:sy,toFileUrl:ty})),Bc0=fQ(k6,k6.of({[u4]:u4,...Pq.win32,fromFileUrl:sy,toFileUrl:ty})),BB0=fQ(k6,k6.of({[u4]:u4,...Pq,fromFileUrl:sy,toFileUrl:ty}));var VB0=BB0;var WB0=VB0;import*as OD from"readline";var NB0=(X)=>X.key.ctrl&&(X.key.name==="c"||X.key.name==="d"),qB0=qV(function*(X=NB0){let{stdin:J,stdout:Q}=process,Y=yield*n00({acquire:IX(x0(()=>{let B=OD.createInterface({input:J,escapeCodeTimeout:50});if(OD.emitKeypressEvents(J,B),J.isTTY)J.setRawMode(!0);return B}),(B)=>x0(()=>{if(J.isTTY)J.setRawMode(!1);B.close()}))}),G=x0(()=>Q.columns??0),Z=c0(function*(){yield*rE(Y);let B=yield*UD(),V=(W,$)=>{let _={input:Z8(W),key:{name:$.name??"",ctrl:!!$.ctrl,meta:!!$.meta,shift:!!$.shift}};if(B.unsafeOffer(_),X(_))B.unsafeDone(yY)};return yield*B1(()=>x0(()=>J.off("keypress",V))),J.on("keypress",V),B}),H=rE(Y).pipe(h((B)=>oJ((V)=>{let W=($)=>V(S($));return B.once("line",W),x0(()=>B.off("line",W))})),Q7),K=(B)=>kQ(oJ((V)=>{Q.write(B,(W)=>W?V(f(new tJ({module:"Terminal",method:"display",description:"Failed to write prompt to stdout",cause:W}))):V(O0))}));return u8.of({columns:G,readInput:Z,readLine:H,display:K})}),$B0=XE(u8,qB0(NB0));var zB0=$B0;var OB0=zB0;var qc0=jK0()({setup({scope:X,worker:J}){return h(a8(),(Q)=>{return J.addEventListener("close",()=>{cY(Q,yY)}),$X(hY(X,m0(()=>{return J.postMessage([1]),B8(Q)}).pipe(lX,nj(5000),pY(()=>x0(()=>J.terminate())))),J)})},listen({deferred:X,emit:J,port:Q,scope:Y}){function G(H){J(H.data)}function Z(H){cY(X,new jB({reason:"unknown",cause:H.error??H.message}))}return Q.addEventListener("message",G),Q.addEventListener("error",Z),hY(Y,x0(()=>{Q.removeEventListener("message",G),Q.removeEventListener("error",Z)}))}}),wB0=fQ(IK0,qc0),TB0=Ce(EK0,wB0);var PB0=TB0;var zc0=O(Fe(WB0,aK0,OB0,PB0),je(HB0));var _D={};BQ(_D,{runMain:()=>Pc0});var Oc0=(X,J)=>{J(d7(X)&&!g2(X.cause)?1:0)},DB0=(X,J)=>{let Q=XK(X,tI);if(!U3(Q,Py))return X;return IL(X,{fiberId:J,fiberRef:tI,value:Q.pipe(wU(Py),xG(OH0))})},MB0=(X)=>N((J)=>jX(J[0]),(J,Q)=>{let Y=Q?.disableErrorReporting===!0?gQ(J,{updateRefs:Q?.disablePrettyLogger===!0?void 0:DB0}):gQ(GZ(J,(Z)=>{if(g2(Z))return O0;return ij(Z)}),{updateRefs:Q?.disablePrettyLogger===!0?void 0:DB0}),G=Q?.teardown??Oc0;return X({fiber:Y,teardown:G})});var RB0=MB0(({fiber:X,teardown:J})=>{let Q=setInterval(_J,2147483647),Y=!1;X.addObserver((Z)=>{if(!Y)process.removeListener("SIGINT",G),process.removeListener("SIGTERM",G);clearInterval(Q),J(Z,(H)=>{if(Y||H!==0)process.exit(H)})});function G(){Y=!0,process.removeListener("SIGINT",G),process.removeListener("SIGTERM",G),X.unsafeInterruptAsFork(X.id())}process.on("SIGINT",G),process.on("SIGTERM",G)});var LB0=RB0;var Pc0=LB0;var FB0={name:"@weaverclub/render",version:"0.0.5",description:"The simplest way to preview React components",packageManager:"bun@1.3.5",files:["dist","package.json"],scripts:{"router:gen":"tsr generate","router:watch":"tsr watch",build:"bun run build.ts",format:"bunx biome format --write",lint:"bunx biome lint && tsc --noEmit",prepublishOnly:"bun run build",release:"bun run publish.ts"},bin:{render:"./dist/cli/entrypoint.mjs"},repository:{type:"git",url:"https://github.com/weaverclub/render.git"},devDependencies:{"@biomejs/biome":"2.3.10","@effect/language-service":"^0.62.5","@tanstack/router-cli":"^1.143.11","@types/bun":"1.3.5","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","bun-plugin-tailwind":"^0.1.2",tailwindcss:"^4.1.18",tsdown:"^0.18.3",typescript:"5.9.3"},dependencies:{"@base-ui/react":"^1.0.0","@effect/cli":"^0.73.0","@effect/platform":"^0.94.0","@effect/platform-bun":"^0.87.0","@tailwindcss/cli":"^4.1.18","@tanstack/react-query":"^5.90.12","@tanstack/react-router":"^1.143.11","class-variance-authority":"^0.7.1",clsx:"^2.1.1",cmdk:"^1.1.1",effect:"^3.19.13",jotai:"^2.16.1","lucide-react":"^0.562.0",react:"^19.2.3","react-dom":"^19.2.3","tailwind-merge":"^3.4.0","tw-animate-css":"^1.4.0"},main:"./dist/index.mjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":"./dist/index.mjs","./package.json":"./package.json"}};import{watch as gc0}from"fs";var Dc0=$8.Struct({dependencies:$8.Record({key:$8.String,value:$8.String}).pipe($8.optional),devDependencies:$8.Record({key:$8.String,value:$8.String}).pipe($8.optional),peerDependencies:$8.Record({key:$8.String,value:$8.String}).pipe($8.optional)}),Mc0=p.fn(function*(X){let J=null,Q=yield*NG.Path,Y=yield*eJ.FileSystem;while(X){let G=Q.join(X,"package.json");if(yield*Y.exists(G)){let K=yield*Y.readFileString(G),B=yield*p.try(()=>JSON.parse(K)),V=yield*$8.decodeUnknown(Dc0)(B);return q0.some(V)}let H=Q.dirname(X);if(X=H,H===J)break;J=X}return q0.none()}),ey=p.fn(function*(X){let J=null,Q=yield*NG.Path,Y=yield*eJ.FileSystem;while(X){let G=Q.join(X,"node_modules");if(yield*Y.exists(G))return q0.some(G);let H=Q.dirname(X);if(X=H,H===J)break;J=X}return q0.none()}),wD=p.fn(function*(X){let J=yield*Mc0(X);if(q0.isNone(J))return[];return[...Object.keys(J.value.dependencies||{}),...Object.keys(J.value.devDependencies||{}),...Object.keys(J.value.peerDependencies||{})]});import{dirname as CB0,join as Aq}from"path";import{fileURLToPath as Rc0}from"url";var Lc0=(X,J)=>{return X.replace(/url\(\.\/([^)]+\.(woff2?|ttf|otf|eot))\)/gi,"url(/_fonts/$1)")},Fc0=()=>{let X=CB0(Rc0(import.meta.url)),J=X;for(let Q=0;Q<5;Q++){let Y=Aq(J,"node_modules");if(Bun.file(Aq(Y,"@tailwindcss","cli","package.json")).size>0)return J;J=CB0(J)}return X},jB0=(X)=>{let J=Aq("node_modules","@tailwindcss","cli","dist","index.mjs"),Q=Aq(X,J);if(Bun.file(Q).size>0)return Q;let Y=Fc0();return Aq(Y,J)},IB=null,TD=null,PD=p.fn(function*(X){let J=new Bun.Glob("**/*.css"),Q=h0.fromIterable(J.scanSync({absolute:!0,cwd:X})),Y=h0.head(Q);if(q0.isNone(Y))return yield*p.fail(Error("No CSS files found for Tailwind CSS."));let G=jB0(X),Z=Bun.spawn(["bun",G,"-i",Y.value,"--minify"],{cwd:X,stdout:"pipe",stderr:"pipe"}),[H,K]=yield*p.all([p.tryPromise(()=>new Response(Z.stdout).text()),p.tryPromise(()=>new Response(Z.stderr).text())],{concurrency:"unbounded"});if((yield*p.tryPromise(()=>Z.exited))!==0)return yield*p.fail(Error(`Tailwind CSS compilation failed: ${K}`));let V=Lc0(H,X);return IB=V,{paths:Q,compiledOutput:V}}),bq8=p.fn(function*(X){let J=new Bun.Glob("**/*.css"),Q=h0.fromIterable(J.scanSync({absolute:!0,cwd:X})),Y=h0.head(Q);if(q0.isNone(Y))return yield*p.fail(Error("No CSS files found for Tailwind CSS."));let G=`${X}/node_modules/.cache/render/tailwind.css`;yield*p.tryPromise(async()=>{await Bun.write(G,"")});let Z=jB0(X);TD={proc:Bun.spawn(["bun",Z,"-i",Y.value,"-o",G,"--minify","--watch"],{cwd:X,stdout:"ignore",stderr:"inherit"}),outputFile:G};let K=0;while(K<20){yield*p.sleep("100 millis");let B=Bun.file(G);if(B.size>0){let W=yield*p.tryPromise(()=>B.text());if(W.length>0){IB=W,console.log(` [Tailwind] Initial compilation: ${W.length} bytes`);break}}K++}return{outputFile:G}}),yq8=p.fn(function*(){if(!TD)return console.log(" [CSS Debug] No tailwind watcher, using cached:",(IB??"").length,"bytes"),IB??"";let X=0;while(X<10){let J=yield*p.tryPromise(async()=>{if(!TD)return"";return Bun.file(TD.outputFile).text()});if(J.length>0)return IB=J,console.log(" [CSS Debug] Read from watcher:",J.length,"bytes"),J;yield*p.sleep("50 millis"),X++}return console.log(" [CSS Debug] File empty, using cached:",(IB??"").length,"bytes"),IB??""});var Cc0=["tailwindcss","@tailwindcss/vite","@tailwindcss/cli"],jc0={tailwind:PD},IB0=p.fn(function*(X){let J=yield*Ic0(X),Q=h0.map(Array.from(J),(G)=>{let Z=jc0[G];return Z(X)});return yield*p.all(Q,{concurrency:"unbounded"})}),Ic0=p.fn(function*(X){let J=yield*wD(X),Q=new Set;for(let Y of Cc0)if(J.includes(Y))Q.add("tailwind");return Q});var Ec0=$8.Struct({compilerOptions:$8.Struct({baseUrl:$8.String.pipe($8.optional),paths:$8.Record({key:$8.String,value:$8.Array($8.String)}).pipe($8.optional)})}),Sc0=["tsconfig.app.json","tsconfig.base.json","tsconfig.json"],Xg=p.fn(function*(X){let J=null,Q=yield*NG.Path,Y=yield*eJ.FileSystem;while(X){for(let Z of Sc0){let H=Q.join(X,Z);if(yield*Y.exists(H)){let B=yield*p.tryPromise(()=>import(H));if((yield*$8.decodeUnknown(Ec0)(B)).compilerOptions?.paths)return q0.some(H)}}let G=Q.dirname(X);if(X=G,G===J)break;J=X}return q0.none()});var xc0=["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","@weaverclub/render"],vc0=$8.Record({key:$8.String,value:$8.Any}),kc0=p.fn(function*({storyPath:X,projectRoot:J}){let Q=yield*Xg(J),Y=yield*wD(J),G=["build",X,"--target","bun","--format","esm"];for(let W of Y)G.push("--external",W);for(let W of xc0)if(!Y.includes(W))G.push("--external",W);if(q0.isSome(Q))G.push("--tsconfig-override",Q.value);let Z=Bun.spawn(["bun",...G],{cwd:J,stdout:"pipe",stderr:"pipe"}),[H,K]=yield*p.all([p.tryPromise(()=>new Response(Z.stdout).text()),p.tryPromise(()=>new Response(Z.stderr).text())],{concurrency:"unbounded"}),B=yield*p.tryPromise(()=>Z.exited),V=H.startsWith("// @bun")||H.includes("export {");if(B!==0&&!V)return yield*p.fail(`Bundle failed:
|
|
206
|
+
Quitting wizard mode...`));return G9(L8(M))}return f(A)}))}case"ShowVersion":{let K=Y0(X.version);return G9(L8(K))}}},Id0=(X)=>{let J=X,Q=D0();while(J!==void 0)switch(J._tag){case"Standard":{Q=w0(J.name),J=void 0;break}case"GetUserInput":{Q=w0(J.name),J=void 0;break}case"Map":{J=J.command;break}case"Subcommands":{J=J.parent;break}}return Q},Ed0=(X,J,Q)=>{let Y=QD(X.command),[G,Z]=FG(Q,(K)=>!yd(Y,K)),H=gX(Z,{onEmpty:()=>aZ(G,(K)=>K!=="--wizard"),onNonEmpty:(K)=>V9(G,K)});return E0(J.split(/\s+/),H)},Sd0=(X)=>{let J=O(aZ(X,(Y)=>Y.length>0),i0(" ")),Q=r0("You may now execute your command directly with the following options and arguments:");return Lb([Y0(WA(KG("Wizard Mode Complete!"))),Y0(Q),Y0($J(r0(" "),h4(J,VA)))])},bH0=(X)=>{return X&&(X==="--log-level"||X.startsWith("--log-level="))};var FB={};BQ(FB,{wizard:()=>Gu0,withSubcommands:()=>Yu0,withHandler:()=>Qu0,withDescription:()=>Ju0,transformHandler:()=>Xu0,run:()=>Zu0,provideSync:()=>ed0,provideEffectDiscard:()=>td0,provideEffect:()=>sd0,provide:()=>ad0,prompt:()=>id0,make:()=>ld0,getZshCompletions:()=>nd0,getUsage:()=>od0,getSubcommands:()=>rd0,getNames:()=>cd0,getHelp:()=>ud0,getFishCompletions:()=>fd0,getBashCompletions:()=>pd0,fromDescriptor:()=>dd0,TypeId:()=>md0});var gH0=vH0;var vd0="@effect/cli/Command",KD=Symbol.for(vd0),kd0=(X)=>{let J=[],Q=0,Y=[],G=0;function Z(K){let B={};for(let V in K)B[V]=H(K[V]);return B}function H(K){if(zY(K))return{_tag:"Array",children:U0(K,H)};else if(Vq(K))return J.push(K),{_tag:"Args",index:Q++};else if(nA(K))return Y.push(K),{_tag:"Options",index:G++};else return{_tag:"ParsedConfig",tree:Z(K)}}return{args:J,options:Y,tree:Z(X)}},mH0=(X,J,Q)=>{let Y={};for(let Z in X)Y[Z]=G(X[Z]);return Y;function G(Z){if(Z._tag==="Args")return J[Z.index];else if(Z._tag==="Options")return Q[Z.index];else if(Z._tag==="Array")return U0(Z.children,G);else return mH0(Z.tree,J,Q)}},dH0={...tH,[KD]:KD,commit(){return this.tag},pipe(){return m(this,arguments)}},xy=A0("@effect/cli/Command/registeredDescriptors",()=>new WeakMap),bd0=(X)=>xy.get(X.tag)??X.descriptor,uH0=(X,J,Q,Y=n)=>{let G=Object.create(dH0);return G.descriptor=X,G.handler=J,G.transform=Y,G.tag=Q,G},i4=(X,J)=>{let Q=Object.create(dH0);return Q.descriptor=J.descriptor??X.descriptor,Q.handler=J.handler??X.handler,Q.transform=J.transform?(Y,G)=>J.transform(X.transform(Y,G),G):X.transform,Q.tag=X.tag,Q},vy=N((X)=>FH0(X[0]),(X,J)=>{let Q=uH0(X,J??((Y)=>x_(()=>gH0(bd0(Q)))),j8(`@effect/cli/Command/(${J0(bW(X)).join("|")})`));return Q}),yd0=(X,J)=>{let{args:Q,options:Y,tree:G}=kd0(J);return GD(CH0(X,bZ(Y),vA(Q)),({args:Z,options:H})=>mH0(G,Z,H))},cH0=(X,J={},Q)=>vy(yd0(X,J),Q),pH0=(X,J)=>tA(X.descriptor,J),fH0=(X)=>bW(X.descriptor),nH0=(X,J)=>eA(X.descriptor,J),rH0=(X,J)=>XD(X.descriptor,J),oH0=(X,J)=>JD(X.descriptor,J),lH0=(X)=>QD(X.descriptor),iH0=(X)=>YD(X.descriptor),gd0=N(2,(X,J)=>i4(X,{descriptor:J(X.descriptor)})),aH0=(X,J,Q)=>uH0(GD(jH0(X,J),(Y)=>Y.value),Q,j8(`@effect/cli/Prompt/${X}`)),sH0=N(2,(X,J)=>i4(X,{handler:J,transform:n})),tH0=N(2,(X,J)=>i4(X,{transform:J})),eH0=N(2,(X,J)=>i4(X,{transform:(Q,Y)=>n5(Q,typeof J==="function"?J(Y):J)})),XK0=N(3,(X,J,Q)=>i4(X,{transform:(Y,G)=>{let Z=typeof Q==="function"?Q(G):Q;return h_(Y,J,Z)}})),JK0=N(2,(X,J)=>i4(X,{transform:(Q,Y)=>{let G=typeof J==="function"?J(Y):J;return v0(G,Q)}})),QK0=N(3,(X,J,Q)=>i4(X,{transform:(Y,G)=>{let Z=typeof Q==="function"?Q(G):Q;return UV(Y,J,Z)}})),YK0=N(2,(X,J)=>gd0(X,SH0(J))),GK0=N(2,(X,J)=>{let Q=xH0(X.descriptor,U0(J,(Z)=>[Z.tag,Z.descriptor])),Y=mX(J,new Map,(Z,H)=>{return Z.set(H.tag,H),xy.set(H.tag,H.descriptor),Z});function G(Z){if(Z.subcommand._tag==="Some"){let[H,K]=Z.subcommand.value,B=Y.get(H),V=B.transform(B.handler(K),K);return UV(V,X.tag,Z)}return X.handler(Z)}return i4(X,{descriptor:Q,handler:G})}),ZK0=N(3,(X,J,Q)=>ZD(X.descriptor,J,Q)),HK0=N(2,(X,J)=>{let Q=yH0({...J,command:X.descriptor});xy.set(X.tag,X.descriptor);let Y=(G)=>X.transform(X.handler(G),G);return(G)=>HD(Q,G,Y)});var md0=KD,dd0=vy,ud0=pH0,cd0=fH0,pd0=nH0,fd0=rH0,nd0=oH0,rd0=lH0,od0=iH0,ld0=cH0,id0=aH0,ad0=eH0,sd0=XK0,td0=JK0,ed0=QK0,Xu0=tH0,Ju0=YK0,Qu0=sH0,Yu0=GK0,Gu0=ZK0,Zu0=HK0;var WD=Symbol.for("effect/Mailbox"),ky=Symbol.for("effect/Mailbox/ReadonlyMailbox");var CB=I8(),KK0=O8(CB),BD=O8(!1),VD=O8(!0),BK0=[CB,!0];class VK0 extends $6{scheduler;capacity;strategy;[WD]=WD;[ky]=ky;state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set};messages=[];messagesChunk=I8();constructor(X,J,Q){super();this.scheduler=X,this.capacity=J,this.strategy=Q}offer(X){return Z0(()=>{if(this.state._tag!=="Open")return BD;else if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return BD;case"suspend":if(this.capacity<=0&&this.state.takers.size>0)return this.messages.push(X),this.releaseTaker(),VD;return this.offerRemainingSingle(X);case"sliding":return this.unsafeTake(),this.messages.push(X),VD}return this.messages.push(X),this.scheduleReleaseTaker(),VD})}unsafeOffer(X){if(this.state._tag!=="Open")return!1;else if(this.messages.length+this.messagesChunk.length>=this.capacity){if(this.strategy==="sliding")return this.unsafeTake(),this.messages.push(X),!0;else if(this.capacity<=0&&this.state.takers.size>0)return this.messages.push(X),this.releaseTaker(),!0;return!1}return this.messages.push(X),this.scheduleReleaseTaker(),!0}offerAll(X){return Z0(()=>{if(this.state._tag!=="Open")return x(NX(X));let J=this.unsafeOfferAllArray(X);if(J.length===0)return KK0;else if(this.strategy==="dropping")return x(h9(J));return this.offerRemainingArray(J)})}unsafeOfferAll(X){return h9(this.unsafeOfferAllArray(X))}unsafeOfferAllArray(X){if(this.state._tag!=="Open")return J0(X);else if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding"){if(this.messages.length>0)this.messagesChunk=y8(this.messagesChunk,h9(this.messages));if(this.strategy==="sliding")this.messagesChunk=this.messagesChunk.pipe(y8(NX(X)),EM(this.capacity));else if(tZ(X))this.messagesChunk=y8(this.messagesChunk,X);else this.messages=J0(X);return this.scheduleReleaseTaker(),[]}let J=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(J===0)return J0(X);let Q=[],Y=0;for(let G of X){if(Y<J)this.messages.push(G);else Q.push(G);Y++}return this.scheduleReleaseTaker(),Q}fail(X){return this.done(pG(X))}failCause(X){return this.done(N8(X))}unsafeDone(X){if(this.state._tag!=="Open")return!1;else if(this.state.offers.size===0&&this.messages.length===0&&this.messagesChunk.length===0)return this.finalize(X),!0;return this.state={...this.state,_tag:"Closing",exit:X},!0}shutdown=k(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=CB;let X=this.state.offers;if(this.finalize(this.state._tag==="Open"?F9:this.state.exit),X.size>0){for(let J of X)if(J._tag==="Single")J.resume(BD);else J.resume(O8(h9(J.remaining.slice(J.offset))));X.clear()}return!0});done(X){return k(()=>this.unsafeDone(X))}end=this.done(F9);clear=Z0(()=>{if(this.state._tag==="Done")return I3(this.state.exit,CB);let X=this.unsafeTakeAll();return this.releaseCapacity(),x(X)});takeAll=Z0(()=>{if(this.state._tag==="Done")return I3(this.state.exit,BK0);let X=this.unsafeTakeAll();if(X.length===0)return Q8(this.awaitTake,this.takeAll);return x([X,this.releaseCapacity()])});takeN(X){return Z0(()=>{if(this.state._tag==="Done")return I3(this.state.exit,BK0);else if(X<=0)return x([CB,!1]);X=Math.min(X,this.capacity);let J;if(X<=this.messagesChunk.length)J=Y3(this.messagesChunk,X),this.messagesChunk=_Q(this.messagesChunk,X);else if(X<=this.messages.length+this.messagesChunk.length)this.messagesChunk=y8(this.messagesChunk,h9(this.messages)),this.messages=[],J=Y3(this.messagesChunk,X),this.messagesChunk=_Q(this.messagesChunk,X);else return Q8(this.awaitTake,this.takeN(X));return x([J,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return Cz(this.state.exit,pG(new Tl));let X;if(this.messagesChunk.length>0)X=NU(this.messagesChunk),this.messagesChunk=_Q(this.messagesChunk,1);else if(this.messages.length>0)X=this.messages[0],this.messagesChunk=_Q(h9(this.messages),1),this.messages=[];else if(this.capacity<=0&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,this.messages.length>0?O8(this.messages.pop()):void 0;else return;return this.releaseCapacity(),O8(X)}take=Z0(()=>this.unsafeTake()??Q8(this.awaitTake,this.take));await=LY((X)=>{if(this.state._tag==="Done")return X(this.state.exit);return this.state.awaiters.add(X),k(()=>{if(this.state._tag!=="Done")this.state.awaiters.delete(X)})});unsafeSize(){let X=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?L():R(X)}size=k(()=>this.unsafeSize());commit(){return this.takeAll}pipe(){return m(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return J8(this)}[I0](){return J8(this)}offerRemainingSingle(X){return LY((J)=>{if(this.state._tag!=="Open")return J(BD);let Q={_tag:"Single",message:X,resume:J};return this.state.offers.add(Q),k(()=>{if(this.state._tag==="Open")this.state.offers.delete(Q)})})}offerRemainingArray(X){return LY((J)=>{if(this.state._tag!=="Open")return J(O8(h9(X)));let Q={_tag:"Array",remaining:X,offset:0,resume:J};return this.state.offers.add(Q),k(()=>{if(this.state._tag==="Open")this.state.offers.delete(Q)})})}releaseCapacity(){if(this.state._tag==="Done")return this.state.exit._tag==="Success";else if(this.state.offers.size===0){if(this.state._tag==="Closing"&&this.messages.length===0&&this.messagesChunk.length===0)return this.finalize(this.state.exit),this.state.exit._tag==="Success";return!1}let X=this.capacity-this.messages.length-this.messagesChunk.length;for(let J of this.state.offers)if(X===0)return!1;else if(J._tag==="Single")this.messages.push(J.message),X--,J.resume(VD),this.state.offers.delete(J);else{for(;J.offset<J.remaining.length;J.offset++){if(X===0)return!1;this.messages.push(J.remaining[J.offset]),X--}J.resume(KK0),this.state.offers.delete(J)}return!1}awaitTake=LY((X)=>{if(this.state._tag==="Done")return X(this.state.exit);return this.state.takers.add(X),k(()=>{if(this.state._tag!=="Done")this.state.takers.delete(X)})});scheduleRunning=!1;scheduleReleaseTaker(){if(this.scheduleRunning)return;this.scheduleRunning=!0,this.scheduler.scheduleTask(this.releaseTaker,0)}releaseTaker=()=>{if(this.scheduleRunning=!1,this.state._tag==="Done")return;else if(this.state.takers.size===0)return;for(let X of this.state.takers)if(this.state.takers.delete(X),X(F9),this.messages.length+this.messagesChunk.length===0)break};unsafeTakeAll(){if(this.messagesChunk.length>0){let X=this.messages.length>0?y8(this.messagesChunk,h9(this.messages)):this.messagesChunk;return this.messagesChunk=CB,this.messages=[],X}else if(this.messages.length>0){let X=h9(this.messages);return this.messages=[],X}else if(this.state._tag!=="Done"&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,K8(this.messages.pop());return CB}finalize(X){if(this.state._tag==="Done")return;let J=this.state;this.state={_tag:"Done",exit:X};for(let Q of J.takers)Q(X);J.takers.clear();for(let Q of J.awaiters)Q(X);J.awaiters.clear()}}var WK0=(X)=>u0((J)=>x(new VK0(J.currentScheduler,typeof X==="number"?X:X?.capacity??Number.POSITIVE_INFINITY,typeof X==="number"?"suspend":X?.strategy??"suspend")));var UK0=(X)=>{let J=t0(X.takeAll,([Q,Y])=>Y?Q.length===0?NJ:_8(Q):$Z(_8(Q),J));return J};var Ku0=WD;var NK0=(X)=>i(X,Ku0);var UD=WK0;var qK0=UK0;var yy=Symbol.for("effect/FiberSet"),Bu0=(X)=>i(X,yy),Vu0={[yy]:yy,[Symbol.iterator](){if(this.state._tag==="Closed")return mh();return this.state.backing[Symbol.iterator]()},toString(){return J8(this.toJSON())},toJSON(){return{_id:"FiberMap",state:this.state}},[I0](){return this.toJSON()},pipe(){return m(this,arguments)}},Wu0=(X,J)=>{let Q=Object.create(Vu0);return Q.state={_tag:"Open",backing:X},Q.deferred=J,Q},$K0=()=>IX(e(a8(),(X)=>Wu0(new Set,X)),(X)=>f5((J)=>{let Q=X.state;if(Q._tag==="Closed")return O0;X.state={_tag:"Closed"};let Y=Q.backing;return Ri(Y,$3(J.id(),OK0)).pipe(NV(X.deferred))}));var zK0=-1,OK0=vd(zK0,0),Uu0=wl(void 0,{emptyCase:TX,failCase:TX,dieCase:TX,interruptCase:(X,J)=>U3(DU(J),zK0),sequentialCase:(X,J,Q)=>J||Q,parallelCase:(X,J,Q)=>J||Q}),_K0=N((X)=>Bu0(X[0]),(X,J,Q)=>{if(X.state._tag==="Closed"){J.unsafeInterruptAsFork($3(Q?.interruptAs??cX,OK0));return}else if(X.state.backing.has(J))return;X.state.backing.add(J),J.addObserver((Y)=>{if(X.state._tag==="Closed")return;if(X.state.backing.delete(J),d7(Y)&&(Q?.propagateInterruption===!0?!Uu0(Y.cause):!g2(Y.cause)))cY(X.deferred,Y)})});var wK0=(X)=>B8(X.deferred);class ND extends $$("@effect/platform/Transferable/Collector")(){}var PK0=()=>{let X=[],J=(G)=>{X.push(...G)},Q=()=>X,Y=()=>{let G=X;return X=[],G};return ND.of({unsafeAddAll:J,addAll:(G)=>x0(()=>J(G)),unsafeRead:Q,read:x0(Q),unsafeClear:Y,clear:x0(Y)})};var DK0=Symbol.for("@effect/platform/WorkerError");var MK0=DK0;class jB extends lV()("WorkerError",{reason:w8("spawn","decode","send","unknown","encode"),cause:eY}){[MK0]=MK0;static Cause=qv({error:this,defect:eY});static encodeCause=qw(this.Cause);static decodeCause=Nw(this.Cause);get message(){switch(this.reason){case"send":return"An error occurred calling .postMessage";case"spawn":return"An error occurred while spawning a worker";case"decode":return"An error occurred during decoding";case"encode":return"An error occurred during encoding";case"unknown":return"An unexpected error occurred"}}}var gy=Symbol.for("@effect/platform/Worker/PlatformWorker"),qD=j8("@effect/platform/Worker/PlatformWorker"),hy=Symbol.for("@effect/platform/Worker/WorkerManager"),my=j8("@effect/platform/Worker/WorkerManager"),RK0=j8("@effect/platform/Worker/Spawner"),LK0=c0(function*(){let X=yield*qD,J=0;return my.of({[hy]:hy,spawn({encode:Q,initialMessage:Y}){return c0(function*(){let G=J++,Z=0,H=new Map,K=PK0(),B=Q?(M)=>v0(K.clear,UV(Q(M),ND,K)):S,V=yield*a8(),W=yield*X.spawn(G);yield*W.run((M)=>{if(M[0]===0)return R_(V,O0);return $(M[1])}).pipe(V1((M)=>q9(H.values(),(C)=>(u5 in C)?uY(C,M):C.failCause(M))),GZ(lj),uj(i00(1000)),aj({package:"@effect/platform",module:"Worker"}),lX,WV),yield*B1(()=>v0(q9(H.values(),(M)=>(u5 in M)?H1(M):M.end,{discard:!0}),x0(()=>H.clear())));let $=(M)=>m0(()=>{let C=H.get(M[0]);if(!C)return O0;switch(M[1]){case 0:return u5 in C?rX(C,M[2][0]):C.offerAll(M[2]);case 1:{if(M.length===2)return u5 in C?H1(C):C.end;return u5 in C?rX(C,M[2][0]):v0(C.offerAll(M[2]),C.end)}case 2:case 3:{if(M[1]===2)return u5 in C?jj(C,M[2]):C.fail(M[2]);let E=jB.decodeCause(M[2]);return u5 in C?uY(C,E):C.failCause(E)}}}),_=(M,C)=>f5((E)=>{let I=E.getFiberRef(Re),b=mJ(I,np).pipe(qY((d)=>d._tag==="Span")),g=Z++;return C.pipe(h8((d)=>{return H.set(g,d),B(M).pipe(h8((t)=>W.send([g,0,t,b._tag==="Some"?[b.value.traceId,b.value.spanId,b.value.sampled]:void 0],K.unsafeRead())),pY((t)=>NK0(d)?d.failCause(t):uY(d,t)))}),e((d)=>({id:g,mailbox:d})))}),T=({id:M},C)=>{let E=x0(()=>H.delete(M));return d7(C)?v0(u9(W.send([M,1])),E):E},D=(M)=>bV(P80(_(M,UD()),({mailbox:C})=>qK0(C),T)),A=(M)=>VV(_(M,a8()),({mailbox:C})=>B8(C),T);if(yield*B8(V),Y)yield*x0(Y).pipe(h(A),HX((M)=>new jB({reason:"spawn",cause:M})));return{id:G,execute:D,executeEffect:A}})}})}),FK0=MV(my,LK0);var CK0=()=>(X)=>qD.of({[gy]:gy,spawn(J){return c0(function*(){let Q=yield*RK0,Y,G=[];return{run:(K)=>MK((B)=>c0(function*(){let V=yield*W1,W=yield*X.setup({worker:Q(J),scope:V});Y=W,yield*hY(V,x0(()=>{Y=void 0}));let $=(yield*HZ()).pipe(l00(vm(ol))),_=yield*$K0(),T=oE($);if(yield*X.listen({port:W,scope:V,emit(D){_K0(_,T(K(D)))},deferred:_.deferred}),G.length>0){for(let[D,A]of G)W.postMessage([0,D],A);G.length=0}return yield*B(wK0(_))}).pipe(Q7)),send:(K,B)=>f7({try:()=>{if(Y===void 0)G.push([K,B]);else Y.postMessage([0,K],B)},catch:(V)=>new jB({reason:"send",cause:V})})}})}});var jK0=CK0,IK0=qD;var EK0=FK0;var gZ={};BQ(gZ,{layer:()=>zc0});var dy=Symbol.for("@effect/platform/CommandExecutor"),xK0=Symbol.for("@effect/platform/Process"),vK0=b1(),kK0=b1(),bK0=j8("@effect/platform/CommandExecutor"),yK0=(X)=>{let J=(Y)=>W4(e(X(Y),(G)=>G.stdout)),Q=(Y,G)=>{let Z=new TextDecoder(G);return v80(S80(J(Y),_H((H)=>Z.decode(H))))};return{[dy]:dy,start:X,exitCode:(Y)=>Q7(h(X(Y),(G)=>G.exitCode)),stream:J,string:(Y,G="utf-8")=>{let Z=new TextDecoder(G);return O(X(Y),h((H)=>VT(H.stdout,zu0)),e((H)=>Z.decode(H)),Q7)},lines:(Y,G="utf-8")=>{return O(Q(Y,G),x80,e(ym))},streamLines:Q}},zu0=L80(new Uint8Array,(X,J)=>qU(J,X,(Q,Y)=>{let G=new Uint8Array(Q.length+Y.length);return G.set(Q),G.set(Y,Q.length),G}));var uy=Symbol.for("@effect/platform/Command");var gK0=(X)=>Array.from(cy(X)),cy=(X)=>{switch(X._tag){case"StandardCommand":return K8(X);case"PipedCommand":return y8(cy(X.left),cy(X.right))}};var hK0={[uy]:uy,pipe(){return m(this,arguments)},...kq},_u0={...hK0,_tag:"StandardCommand",toJSON(){return{_id:"@effect/platform/Command",_tag:this._tag,command:this.command,args:this.args,env:Object.fromEntries(this.env),cwd:this.cwd.toJSON(),shell:this.shell,gid:this.gid.toJSON(),uid:this.uid.toJSON()}}},wu0=(X)=>Object.assign(Object.create(_u0),X),Tu0={...hK0,_tag:"PipedCommand",toJSON(){return{_id:"@effect/platform/Command",_tag:this._tag,left:this.left.toJSON(),right:this.right.toJSON()}}},Pu0=(X)=>Object.assign(Object.create(Tu0),X);var py=N(2,(X,J)=>{switch(X._tag){case"StandardCommand":return wu0({...X,stdin:J});case"PipedCommand":return Pu0({...X,left:py(X.left,J)})}});var fy=gK0;var ny=py;var dK0=bK0,ry=xK0,uK0=vK0,cK0=kK0,pK0=yK0;import*as $D from"child_process";var c8=(X,J)=>(Q,[Y])=>{let G="Unknown";switch(Q.code){case"ENOENT":G="NotFound";break;case"EACCES":G="PermissionDenied";break;case"EEXIST":G="AlreadyExists";break;case"EISDIR":G="BadResource";break;case"ENOTDIR":G="BadResource";break;case"EBUSY":G="Busy";break;case"ELOOP":G="BadResource";break}return new M4({reason:G,module:X,method:J,pathOrDescriptor:Y,syscall:Q.syscall,description:Q.message,cause:Q})};var oy=(X,J,Q)=>bV(Du0(X,J,Q));var Du0=(X,J,Q)=>ZS(()=>Ru0(X(),J,B6(void 0),Q)),nK0=(X,J,{encoding:Q,endOnDone:Y=!0}={},G=O0)=>{let Z=Mu0(X,Q),H=Y?oJ((K)=>{if("closed"in X&&X.closed)K(O0);else X.once("finish",()=>K(O0)),X.end()}):O0;return{awaitRead:()=>O0,emit:Z,error:(K)=>v0(H,J(K)),done:(K)=>v0(H,G)}},Mu0=(X,J)=>(Q)=>Q.length===0?O0:oJ((Y)=>{let G=Q[Symbol.iterator](),Z=G.next();function H(){let K=Z;Z=G.next();let B=X.write(K.value,J);if(Z.done)Y(O0);else if(B)H();else X.once("drain",H)}H()}),Ru0=(X,J,Q,Y)=>{if(!X.readable)return s1;let G=p_(!1);function Z(){G.unsafeOpen()}function H(W){Q.current=k5(J(W)),G.unsafeOpen()}function K(){Q.current=yY,G.unsafeOpen()}X.on("readable",Z),X.on("error",H),X.on("end",K);let B=Y?.chunkSize?Number(Y.chunkSize):void 0,V=ZS(function W(){let $=X.read(B);if($===null){if(Q.current)return D80(Q.current);return G.unsafeClose(),V4(G.await,W)}let _=[$];while(!0){if($=X.read(B),$===null)return V4(BT(h9(_)),W);_.push($)}});return A80(V,x0(()=>{if(X.off("readable",Z),X.off("error",H),X.off("end",K),Y?.closeOnDone!==!1&&"closed"in X&&!X.closed)X.destroy()}))};var rK0=(X,J,Q)=>C80(Lu0(X,J,Q)),Lu0=(X,J,Q)=>V4(A6(x0(()=>X()),a8()),([Y,G])=>GS(Fu0(Y,G,J),nK0(Y,(Z)=>uY(G,Z),Q,R_(G,O0)))),Fu0=(X,J,Q)=>m0(()=>{function Y(G){cY(J,f(Q(G)))}return X.on("error",Y),P6(B8(J),x0(()=>{X.removeListener("error",Y)}))});var Cu0=(X)=>typeof X==="string"?X:"pipe",oK0=(X)=>typeof X==="string"?X:"pipe",wq=(X)=>X instanceof globalThis.Error?X:new globalThis.Error(String(X)),a4=(X,J,Q)=>{let Y=fy(Q).reduce((G,Z)=>{let H=`${Z.command} ${Z.args.join(" ")}`;return G.length===0?H:`${G} | ${H}`},"");return c8("Command",X)(J,[Y])},ju0={[ry]:ry,...kq,toJSON(){return{_id:"@effect/platform/CommandExecutor/Process",pid:this.pid}}},Tq=(X)=>(J)=>{switch(J._tag){case"StandardCommand":{let Q=h(a8(),(Z)=>oJ((H)=>{let K=$D.spawn(J.command,J.args,{stdio:[Cu0(J.stdin),oK0(J.stdout),oK0(J.stderr)],cwd:z0(J.cwd,kB),shell:J.shell,env:{...process.env,...Object.fromEntries(J.env)},detached:process.platform!=="win32"});return K.on("error",(B)=>{H(f(a4("spawn",B,J)))}),K.on("exit",(...B)=>{cY(Z,S(B))}),K.on("spawn",()=>{H(S([K,Z]))}),x0(()=>{K.kill("SIGTERM")})})),Y=process.platform==="win32"?(Z,H)=>oJ((K)=>{$D.exec(`taskkill /pid ${Z.pid} /T /F`,(B)=>{if(B)K(f(a4("kill",wq(B),J)));else K(O0)})}):(Z,H)=>f7({try:()=>process.kill(-Z.pid,H),catch:(K)=>a4("kill",wq(K),J)}),G=(Z,H)=>m0(()=>Z.kill(H)?O0:f(a4("kill",new globalThis.Error("Failed to kill process"),J)));return O(Q0(J.cwd,{onNone:()=>O0,onSome:(Z)=>X.access(Z)}),v0(IX(Q,([Z,H])=>h(c5(H),(K)=>{if(!K)return Y(Z,"SIGTERM").pipe(ZZ(()=>G(Z,"SIGTERM")),v0(B8(H)),BV);return h(B8(H),([B])=>{if(B!==0&&B!==null)return Y(Z,"SIGTERM").pipe(BV);return O0})}))),e(([Z,H])=>{let K=M80;if(Z.stdin!==null)K=rK0(()=>Z.stdin,(D)=>a4("toWritable",wq(D),J));let B=h(B8(H),([D,A])=>{if(D!==null)return S(uK0(D));return f(a4("exitCode",new globalThis.Error(`Process interrupted due to receipt of signal: ${A}`),J))}),V=pj(c5(H)),W=(D="SIGTERM")=>Y(Z,D).pipe(ZZ(()=>G(Z,D)),v0(T6(B8(H)))),$=cK0(Z.pid),_=oy(()=>Z.stderr,(D)=>a4("fromReadable(stderr)",wq(D),J)),T=oy(()=>Z.stdout,(D)=>a4("fromReadable(stdout)",wq(D),J));if(typeof J.stdout!=="string")T=k80(T,J.stdout);return Object.assign(Object.create(ju0),{pid:$,exitCode:B,isRunning:V,kill:W,stdin:K,stderr:_,stdout:T})}),typeof J.stdin==="string"?n:h8((Z)=>RK(VT(J.stdin,Z.stdin))))}case"PipedCommand":{let Q=fy(J);if(Q.length===1)return O(Q[0],Tq(X));let Y=Q[0],G=Q.slice(1),Z=G.slice(0,G.length-1),H=G[G.length-1],K=Z.reduce((B,V)=>O(ny(V,B),Tq(X),e((W)=>W.stdout),W4),O(Tq(X)(Y),e((B)=>B.stdout),W4));return O(ny(H,K),Tq(X))}}},lK0=MV(dK0,O(C6,e((X)=>pK0(Tq(X)))));var iK0=lK0;var aK0=iK0;var tK0=(X,J,Q)=>(...Y)=>oJ((G)=>{try{X(...Y,(Z,H)=>{if(Z)G(f(J?J(Z,Y):Z));else G(S(H))})}catch(Z){G(Q?f(Q(Z,Y)):oX(Z))}});var x9=tK0;import*as eK0 from"crypto";import*as b0 from"fs";import*as XB0 from"os";import*as yW from"path";var _9=(X)=>(J)=>new tJ({module:"FileSystem",method:X,cause:J}),vu0=(()=>{let X=x9(b0.access,c8("FileSystem","access"),_9("access"));return(J,Q)=>{let Y=b0.constants.F_OK;if(Q?.readable)Y|=b0.constants.R_OK;if(Q?.writable)Y|=b0.constants.W_OK;return X(J,Y)}})(),ku0=(()=>{let X=x9(b0.cp,c8("FileSystem","copy"),_9("copy"));return(J,Q,Y)=>X(J,Q,{force:Y?.overwrite??!1,preserveTimestamps:Y?.preserveTimestamps??!1,recursive:!0})})(),bu0=(()=>{let X=x9(b0.copyFile,c8("FileSystem","copyFile"),_9("copyFile"));return(J,Q)=>X(J,Q)})(),yu0=(()=>{let X=x9(b0.chmod,c8("FileSystem","chmod"),_9("chmod"));return(J,Q)=>X(J,Q)})(),gu0=(()=>{let X=x9(b0.chown,c8("FileSystem","chown"),_9("chown"));return(J,Q,Y)=>X(J,Q,Y)})(),hu0=(()=>{let X=x9(b0.link,c8("FileSystem","link"),_9("link"));return(J,Q)=>X(J,Q)})(),mu0=(()=>{let X=x9(b0.mkdir,c8("FileSystem","makeDirectory"),_9("makeDirectory"));return(J,Q)=>X(J,{recursive:Q?.recursive??!1,mode:Q?.mode})})(),ly=(X)=>{let J=x9(b0.mkdtemp,c8("FileSystem",X),_9(X));return(Q)=>m0(()=>{let Y=Q?.prefix??"",G=typeof Q?.directory==="string"?yW.join(Q.directory,"."):XB0.tmpdir();return J(Y?yW.join(G,Y):G+"/")})},du0=ly("makeTempDirectory"),iy=(X)=>{let J=x9(b0.rm,c8("FileSystem",X),_9(X));return(Q,Y)=>J(Q,{recursive:Y?.recursive??!1,force:Y?.force??!1})},uu0=iy("remove"),cu0=(()=>{let X=ly("makeTempDirectoryScoped"),J=iy("makeTempDirectoryScoped");return(Q)=>IX(X(Q),(Y)=>u9(J(Y,{recursive:!0})))})(),JB0=(X)=>{let J=x9(b0.open,c8("FileSystem",X),_9(X)),Q=x9(b0.close,c8("FileSystem",X),_9(X));return(Y,G)=>O(IX(J(Y,G?.flag??"r",G?.mode),(Z)=>u9(Q(Z))),e((Z)=>fu0(wv(Z),G?.flag?.startsWith("a")??!1)))},pu0=JB0("open"),fu0=(()=>{let X=(W)=>x9(b0.read,c8("FileSystem",W),_9(W)),J=X("read"),Q=X("readAlloc"),Y=x9(b0.fstat,c8("FileSystem","stat"),_9("stat")),G=x9(b0.ftruncate,c8("FileSystem","truncate"),_9("truncate")),Z=x9(b0.fsync,c8("FileSystem","sync"),_9("sync")),H=(W)=>x9(b0.write,c8("FileSystem",W),_9(W)),K=H("write"),B=H("writeAll");class V{fd;append;[iV];semaphore=sj(1);position=0n;constructor(W,$){this.fd=W,this.append=$,this[iV]=iV}get stat(){return e(Y(this.fd),YB0)}get sync(){return Z(this.fd)}seek(W,$){let _=tK(W);return this.semaphore.withPermits(1)(x0(()=>{if($==="start")this.position=_;else if($==="current")this.position=this.position+_;return this.position}))}read(W){return this.semaphore.withPermits(1)(e(m0(()=>J(this.fd,{buffer:W,position:this.position})),($)=>{let _=tK($);return this.position=this.position+_,_}))}readAlloc(W){let $=Number(W);return this.semaphore.withPermits(1)(h(x0(()=>Buffer.allocUnsafeSlow($)),(_)=>e(Q(this.fd,{buffer:_,position:this.position}),(T)=>{if(T===0)return L();if(this.position=this.position+BigInt(T),T===$)return R(_);let D=Buffer.allocUnsafeSlow(T);return _.copy(D,0,0,T),R(D)})))}truncate(W){return this.semaphore.withPermits(1)(e(G(this.fd,W?Number(W):void 0),()=>{if(!this.append){let $=BigInt(W??0);if(this.position>$)this.position=$}}))}write(W){return this.semaphore.withPermits(1)(e(m0(()=>K(this.fd,W,void 0,void 0,this.append?void 0:Number(this.position))),($)=>{let _=tK($);if(!this.append)this.position=this.position+_;return _}))}writeAllChunk(W){return h(m0(()=>B(this.fd,W,void 0,void 0,this.append?void 0:Number(this.position))),($)=>{if($===0)return f(new M4({module:"FileSystem",method:"writeAll",reason:"WriteZero",pathOrDescriptor:this.fd,description:"write returned 0 bytes written"}));if(!this.append)this.position=this.position+BigInt($);return $<W.length?this.writeAllChunk(W.subarray($)):O0})}writeAll(W){return this.semaphore.withPermits(1)(this.writeAllChunk(W))}}return(W,$)=>new V(W,$)})(),QB0=(X)=>{let J=ly(X),Q=JB0(X),Y=(G)=>x0(()=>eK0.randomBytes(G).toString("hex"));return(G)=>O(A6(J(G),Y(6)),e(([Z,H])=>yW.join(Z,H+(G?.suffix??""))),h8((Z)=>Q7(Q(Z,{flag:"w+"}))))},nu0=QB0("makeTempFile"),ru0=(()=>{let X=QB0("makeTempFileScoped"),J=iy("makeTempFileScoped");return(Q)=>IX(X(Q),(Y)=>u9(J(yW.dirname(Y),{recursive:!0})))})(),ou0=(X,J)=>b_({try:()=>b0.promises.readdir(X,J),catch:(Q)=>c8("FileSystem","readDirectory")(Q,[X])}),lu0=(X)=>oJ((J,Q)=>{try{b0.readFile(X,{signal:Q},(Y,G)=>{if(Y)J(f(c8("FileSystem","readFile")(Y,[X])));else J(S(G))})}catch(Y){J(f(_9("readFile")(Y)))}}),iu0=(()=>{let X=x9(b0.readlink,c8("FileSystem","readLink"),_9("readLink"));return(J)=>X(J)})(),au0=(()=>{let X=x9(b0.realpath,c8("FileSystem","realPath"),_9("realPath"));return(J)=>X(J)})(),su0=(()=>{let X=x9(b0.rename,c8("FileSystem","rename"),_9("rename"));return(J,Q)=>X(J,Q)})(),YB0=(X)=>({type:X.isFile()?"File":X.isDirectory()?"Directory":X.isSymbolicLink()?"SymbolicLink":X.isBlockDevice()?"BlockDevice":X.isCharacterDevice()?"CharacterDevice":X.isFIFO()?"FIFO":X.isSocket()?"Socket":"Unknown",mtime:Z8(X.mtime),atime:Z8(X.atime),birthtime:Z8(X.birthtime),dev:X.dev,rdev:Z8(X.rdev),ino:Z8(X.ino),mode:X.mode,nlink:Z8(X.nlink),uid:Z8(X.uid),gid:Z8(X.gid),size:tK(X.size),blksize:W8(Z8(X.blksize),tK),blocks:Z8(X.blocks)}),ay=(()=>{let X=x9(b0.stat,c8("FileSystem","stat"),_9("stat"));return(J)=>e(X(J),YB0)})(),tu0=(()=>{let X=x9(b0.symlink,c8("FileSystem","symlink"),_9("symlink"));return(J,Q)=>X(J,Q)})(),eu0=(()=>{let X=x9(b0.truncate,c8("FileSystem","truncate"),_9("truncate"));return(J,Q)=>X(J,Q!==void 0?Number(Q):void 0)})(),Xc0=(()=>{let X=x9(b0.utimes,c8("FileSystem","utime"),_9("utime"));return(J,Q,Y)=>X(J,Q,Y)})(),Jc0=(X,J)=>I80((Q)=>IX(x0(()=>{let Y=b0.watch(X,{recursive:J?.recursive},(G,Z)=>{if(!Z)return;switch(G){case"rename":{Q.fromEffect(C9(ay(Z),{onSuccess:(H)=>S(Tv({path:Z})),onFailure:(H)=>H._tag==="SystemError"&&H.reason==="NotFound"?S(Av({path:Z})):f(H)}));return}case"change":{Q.single(Pv({path:Z}));return}}});return Y.on("error",(G)=>{Q.fail(new M4({module:"FileSystem",reason:"Unknown",method:"watch",pathOrDescriptor:X,cause:G}))}),Y.on("close",()=>{Q.end()}),Y}),(Y)=>x0(()=>Y.close()))),Qc0=(X,J,Q)=>ay(J).pipe(e((Y)=>X.pipe(l8((G)=>G.register(J,Y,Q)),z0(()=>Jc0(J,Q)))),b80),Yc0=(X,J,Q)=>oJ((Y,G)=>{try{b0.writeFile(X,J,{signal:G,flag:Q?.flag,mode:Q?.mode},(Z)=>{if(Z)Y(f(c8("FileSystem","writeFile")(Z,[X])));else Y(O0)})}catch(Z){Y(f(_9("writeFile")(Z)))}}),Gc0=e(m_(tT),(X)=>_v({access:vu0,chmod:yu0,chown:gu0,copy:ku0,copyFile:bu0,link:hu0,makeDirectory:mu0,makeTempDirectory:du0,makeTempDirectoryScoped:cu0,makeTempFile:nu0,makeTempFileScoped:ru0,open:pu0,readDirectory:ou0,readFile:lu0,readLink:iu0,realPath:au0,remove:uu0,rename:su0,stat:ay,symlink:tu0,truncate:eu0,utimes:Xc0,watch(J,Q){return Qc0(X,J,Q)},writeFile:Yc0})),GB0=MV(C6,Gc0);var ZB0=GB0;var HB0=ZB0;import*as Pq from"path";import*as zD from"url";var sy=(X)=>f7({try:()=>zD.fileURLToPath(X),catch:(J)=>new tJ({module:"Path",method:"fromFileUrl",description:`Invalid file URL: ${X}`,cause:J})}),ty=(X)=>f7({try:()=>zD.pathToFileURL(X),catch:(J)=>new tJ({module:"Path",method:"toFileUrl",description:`Invalid path: ${X}`,cause:J})}),Kc0=fQ(k6,k6.of({[u4]:u4,...Pq.posix,fromFileUrl:sy,toFileUrl:ty})),Bc0=fQ(k6,k6.of({[u4]:u4,...Pq.win32,fromFileUrl:sy,toFileUrl:ty})),BB0=fQ(k6,k6.of({[u4]:u4,...Pq,fromFileUrl:sy,toFileUrl:ty}));var VB0=BB0;var WB0=VB0;import*as OD from"readline";var NB0=(X)=>X.key.ctrl&&(X.key.name==="c"||X.key.name==="d"),qB0=qV(function*(X=NB0){let{stdin:J,stdout:Q}=process,Y=yield*n00({acquire:IX(x0(()=>{let B=OD.createInterface({input:J,escapeCodeTimeout:50});if(OD.emitKeypressEvents(J,B),J.isTTY)J.setRawMode(!0);return B}),(B)=>x0(()=>{if(J.isTTY)J.setRawMode(!1);B.close()}))}),G=x0(()=>Q.columns??0),Z=c0(function*(){yield*rE(Y);let B=yield*UD(),V=(W,$)=>{let _={input:Z8(W),key:{name:$.name??"",ctrl:!!$.ctrl,meta:!!$.meta,shift:!!$.shift}};if(B.unsafeOffer(_),X(_))B.unsafeDone(yY)};return yield*B1(()=>x0(()=>J.off("keypress",V))),J.on("keypress",V),B}),H=rE(Y).pipe(h((B)=>oJ((V)=>{let W=($)=>V(S($));return B.once("line",W),x0(()=>B.off("line",W))})),Q7),K=(B)=>kQ(oJ((V)=>{Q.write(B,(W)=>W?V(f(new tJ({module:"Terminal",method:"display",description:"Failed to write prompt to stdout",cause:W}))):V(O0))}));return u8.of({columns:G,readInput:Z,readLine:H,display:K})}),$B0=XE(u8,qB0(NB0));var zB0=$B0;var OB0=zB0;var qc0=jK0()({setup({scope:X,worker:J}){return h(a8(),(Q)=>{return J.addEventListener("close",()=>{cY(Q,yY)}),$X(hY(X,m0(()=>{return J.postMessage([1]),B8(Q)}).pipe(lX,nj(5000),pY(()=>x0(()=>J.terminate())))),J)})},listen({deferred:X,emit:J,port:Q,scope:Y}){function G(H){J(H.data)}function Z(H){cY(X,new jB({reason:"unknown",cause:H.error??H.message}))}return Q.addEventListener("message",G),Q.addEventListener("error",Z),hY(Y,x0(()=>{Q.removeEventListener("message",G),Q.removeEventListener("error",Z)}))}}),wB0=fQ(IK0,qc0),TB0=Ce(EK0,wB0);var PB0=TB0;var zc0=O(Fe(WB0,aK0,OB0,PB0),je(HB0));var _D={};BQ(_D,{runMain:()=>Pc0});var Oc0=(X,J)=>{J(d7(X)&&!g2(X.cause)?1:0)},DB0=(X,J)=>{let Q=XK(X,tI);if(!U3(Q,Py))return X;return IL(X,{fiberId:J,fiberRef:tI,value:Q.pipe(wU(Py),xG(OH0))})},MB0=(X)=>N((J)=>jX(J[0]),(J,Q)=>{let Y=Q?.disableErrorReporting===!0?gQ(J,{updateRefs:Q?.disablePrettyLogger===!0?void 0:DB0}):gQ(GZ(J,(Z)=>{if(g2(Z))return O0;return ij(Z)}),{updateRefs:Q?.disablePrettyLogger===!0?void 0:DB0}),G=Q?.teardown??Oc0;return X({fiber:Y,teardown:G})});var RB0=MB0(({fiber:X,teardown:J})=>{let Q=setInterval(_J,2147483647),Y=!1;X.addObserver((Z)=>{if(!Y)process.removeListener("SIGINT",G),process.removeListener("SIGTERM",G);clearInterval(Q),J(Z,(H)=>{if(Y||H!==0)process.exit(H)})});function G(){Y=!0,process.removeListener("SIGINT",G),process.removeListener("SIGTERM",G),X.unsafeInterruptAsFork(X.id())}process.on("SIGINT",G),process.on("SIGTERM",G)});var LB0=RB0;var Pc0=LB0;var FB0={name:"@weaverclub/render",version:"0.0.6",description:"The simplest way to preview React components",packageManager:"bun@1.3.5",files:["dist","package.json"],scripts:{"router:gen":"tsr generate","router:watch":"tsr watch",build:"bun run build.ts",format:"bunx biome format --write",lint:"bunx biome lint && tsc --noEmit",prepublishOnly:"bun run build",release:"bun run publish.ts"},bin:{render:"./dist/cli/entrypoint.mjs"},repository:{type:"git",url:"https://github.com/weaverclub/render.git"},devDependencies:{"@biomejs/biome":"2.3.10","@effect/language-service":"^0.62.5","@tanstack/router-cli":"^1.143.11","@types/bun":"1.3.5","@types/react":"^19.2.7","@types/react-dom":"^19.2.3","bun-plugin-tailwind":"^0.1.2",tailwindcss:"^4.1.18",tsdown:"^0.18.3",typescript:"5.9.3"},dependencies:{"@base-ui/react":"^1.0.0","@effect/cli":"^0.73.0","@effect/platform":"^0.94.0","@effect/platform-bun":"^0.87.0","@tailwindcss/cli":"^4.1.18","@tanstack/react-query":"^5.90.12","@tanstack/react-router":"^1.143.11","class-variance-authority":"^0.7.1",clsx:"^2.1.1",cmdk:"^1.1.1",effect:"^3.19.13",jotai:"^2.16.1","lucide-react":"^0.562.0",react:"^19.2.3","react-dom":"^19.2.3","tailwind-merge":"^3.4.0","tw-animate-css":"^1.4.0"},main:"./dist/index.mjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":"./dist/index.mjs","./package.json":"./package.json"}};import{watch as gc0}from"fs";var Dc0=$8.Struct({dependencies:$8.Record({key:$8.String,value:$8.String}).pipe($8.optional),devDependencies:$8.Record({key:$8.String,value:$8.String}).pipe($8.optional),peerDependencies:$8.Record({key:$8.String,value:$8.String}).pipe($8.optional)}),Mc0=p.fn(function*(X){let J=null,Q=yield*NG.Path,Y=yield*eJ.FileSystem;while(X){let G=Q.join(X,"package.json");if(yield*Y.exists(G)){let K=yield*Y.readFileString(G),B=yield*p.try(()=>JSON.parse(K)),V=yield*$8.decodeUnknown(Dc0)(B);return q0.some(V)}let H=Q.dirname(X);if(X=H,H===J)break;J=X}return q0.none()}),ey=p.fn(function*(X){let J=null,Q=yield*NG.Path,Y=yield*eJ.FileSystem;while(X){let G=Q.join(X,"node_modules");if(yield*Y.exists(G))return q0.some(G);let H=Q.dirname(X);if(X=H,H===J)break;J=X}return q0.none()}),wD=p.fn(function*(X){let J=yield*Mc0(X);if(q0.isNone(J))return[];return[...Object.keys(J.value.dependencies||{}),...Object.keys(J.value.devDependencies||{}),...Object.keys(J.value.peerDependencies||{})]});import{dirname as CB0,join as Aq}from"path";import{fileURLToPath as Rc0}from"url";var Lc0=(X,J)=>{return X.replace(/url\(\.\/([^)]+\.(woff2?|ttf|otf|eot))\)/gi,"url(/_fonts/$1)")},Fc0=()=>{let X=CB0(Rc0(import.meta.url)),J=X;for(let Q=0;Q<5;Q++){let Y=Aq(J,"node_modules");if(Bun.file(Aq(Y,"@tailwindcss","cli","package.json")).size>0)return J;J=CB0(J)}return X},jB0=(X)=>{let J=Aq("node_modules","@tailwindcss","cli","dist","index.mjs"),Q=Aq(X,J);if(Bun.file(Q).size>0)return Q;let Y=Fc0();return Aq(Y,J)},IB=null,TD=null,PD=p.fn(function*(X){let J=new Bun.Glob("**/*.css"),Q=h0.fromIterable(J.scanSync({absolute:!0,cwd:X})),Y=h0.head(Q);if(q0.isNone(Y))return yield*p.fail(Error("No CSS files found for Tailwind CSS."));let G=jB0(X),Z=Bun.spawn(["bun",G,"-i",Y.value,"--minify"],{cwd:X,stdout:"pipe",stderr:"pipe"}),[H,K]=yield*p.all([p.tryPromise(()=>new Response(Z.stdout).text()),p.tryPromise(()=>new Response(Z.stderr).text())],{concurrency:"unbounded"});if((yield*p.tryPromise(()=>Z.exited))!==0)return yield*p.fail(Error(`Tailwind CSS compilation failed: ${K}`));let V=Lc0(H,X);return IB=V,{paths:Q,compiledOutput:V}}),bq8=p.fn(function*(X){let J=new Bun.Glob("**/*.css"),Q=h0.fromIterable(J.scanSync({absolute:!0,cwd:X})),Y=h0.head(Q);if(q0.isNone(Y))return yield*p.fail(Error("No CSS files found for Tailwind CSS."));let G=`${X}/node_modules/.cache/render/tailwind.css`;yield*p.tryPromise(async()=>{await Bun.write(G,"")});let Z=jB0(X);TD={proc:Bun.spawn(["bun",Z,"-i",Y.value,"-o",G,"--minify","--watch"],{cwd:X,stdout:"ignore",stderr:"inherit"}),outputFile:G};let K=0;while(K<20){yield*p.sleep("100 millis");let B=Bun.file(G);if(B.size>0){let W=yield*p.tryPromise(()=>B.text());if(W.length>0){IB=W,console.log(` [Tailwind] Initial compilation: ${W.length} bytes`);break}}K++}return{outputFile:G}}),yq8=p.fn(function*(){if(!TD)return console.log(" [CSS Debug] No tailwind watcher, using cached:",(IB??"").length,"bytes"),IB??"";let X=0;while(X<10){let J=yield*p.tryPromise(async()=>{if(!TD)return"";return Bun.file(TD.outputFile).text()});if(J.length>0)return IB=J,console.log(" [CSS Debug] Read from watcher:",J.length,"bytes"),J;yield*p.sleep("50 millis"),X++}return console.log(" [CSS Debug] File empty, using cached:",(IB??"").length,"bytes"),IB??""});var Cc0=["tailwindcss","@tailwindcss/vite","@tailwindcss/cli"],jc0={tailwind:PD},IB0=p.fn(function*(X){let J=yield*Ic0(X),Q=h0.map(Array.from(J),(G)=>{let Z=jc0[G];return Z(X)});return yield*p.all(Q,{concurrency:"unbounded"})}),Ic0=p.fn(function*(X){let J=yield*wD(X),Q=new Set;for(let Y of Cc0)if(J.includes(Y))Q.add("tailwind");return Q});var Ec0=$8.Struct({compilerOptions:$8.Struct({baseUrl:$8.String.pipe($8.optional),paths:$8.Record({key:$8.String,value:$8.Array($8.String)}).pipe($8.optional)})}),Sc0=["tsconfig.app.json","tsconfig.base.json","tsconfig.json"],Xg=p.fn(function*(X){let J=null,Q=yield*NG.Path,Y=yield*eJ.FileSystem;while(X){for(let Z of Sc0){let H=Q.join(X,Z);if(yield*Y.exists(H)){let B=yield*p.tryPromise(()=>import(H));if((yield*$8.decodeUnknown(Ec0)(B)).compilerOptions?.paths)return q0.some(H)}}let G=Q.dirname(X);if(X=G,G===J)break;J=X}return q0.none()});var xc0=["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","@weaverclub/render"],vc0=$8.Record({key:$8.String,value:$8.Any}),kc0=p.fn(function*({storyPath:X,projectRoot:J}){let Q=yield*Xg(J),Y=yield*wD(J),G=["build",X,"--target","bun","--format","esm"];for(let W of Y)G.push("--external",W);for(let W of xc0)if(!Y.includes(W))G.push("--external",W);if(q0.isSome(Q))G.push("--tsconfig-override",Q.value);let Z=Bun.spawn(["bun",...G],{cwd:J,stdout:"pipe",stderr:"pipe"}),[H,K]=yield*p.all([p.tryPromise(()=>new Response(Z.stdout).text()),p.tryPromise(()=>new Response(Z.stderr).text())],{concurrency:"unbounded"}),B=yield*p.tryPromise(()=>Z.exited),V=H.startsWith("// @bun")||H.includes("export {");if(B!==0&&!V)return yield*p.fail(`Bundle failed:
|
|
207
207
|
${K||H}`);return H}),EB0=p.fn(function*({storyPath:X,projectRoot:J,storyId:Q}){console.log("[bundleStoryForBrowser] \uD83D\uDE80 Starting..."),console.log("[bundleStoryForBrowser] \uD83D\uDCC1 storyPath:",X),console.log("[bundleStoryForBrowser] \uD83D\uDCC1 projectRoot:",J),console.log("[bundleStoryForBrowser] \uD83D\uDCC1 storyId:",Q);let Y=yield*Xg(J);console.log("[bundleStoryForBrowser] \uD83D\uDCC4 tsconfig:",Y);let G=yield*eJ.FileSystem,Z=yield*ey(J);console.log("[bundleStoryForBrowser] \uD83D\uDCE6 nodeModules:",Z);let H=q0.isSome(Z)?`${Z.value}/.cache/render`:`${J}/.render-cache`;console.log("[bundleStoryForBrowser] \uD83D\uDCC2 tempDir:",H),yield*G.makeDirectory(H,{recursive:!0});let K=`${H}/render-${Q.replace(/[^a-z0-9]/gi,"_")}.tsx`;console.log("[bundleStoryForBrowser] \uD83D\uDCDD entryFile:",K);let V=`
|
|
208
208
|
import * as React from 'react';
|
|
209
209
|
import * as ReactDOMClient from 'react-dom/client';
|